OSDN Git Service

* cse.c (find_comparison_args): Remove previous change.
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / configure.in
1 # Process this file with autoconf to produce a configure script, like so:
2 # aclocal, autoconf, autoheader, automake
3
4 AC_PREREQ(2.13)
5 AC_INIT(src/ios.cc)
6
7 # When building with srcdir == objdir, links to the source files will
8 # be created in directories within the target_subdir.  We have to
9 # adjust toplevel_srcdir accordingly, so that configure finds
10 # install-sh and other auxiliary files that live in the top-level
11 # source directory.
12 if test "${srcdir}" = "."; then
13   if test -z "${with_target_subdir}"; then
14     toplevel_srcdir="\${top_srcdir}/.."
15     auxdir="${srcdir}/.."
16   else
17     if test "${with_target_subdir}" != "."; then
18       toplevel_srcdir="\${top_srcdir}/${with_multisrctop}../.."
19       auxdir="${srcdir}/${with_multisrctop}../.."
20     else
21       toplevel_srcdir="\${top_srcdir}/${with_multisrctop}.."
22       auxdir="${srcdir}/${with_multisrctop}.."
23     fi
24   fi
25 else
26   toplevel_srcdir="\${top_srcdir}/.."
27   auxdir="${srcdir}/.."
28 fi
29 AC_CONFIG_AUX_DIR($auxdir)
30 AC_SUBST(toplevel_srcdir)
31
32 dnl This is here just to satisfy automake.
33 ifelse(not,equal,[AC_CONFIG_AUX_DIR(..)])
34
35 # Gets and sets build, host, target, *_vendor, *_cpu, *_os, etc.
36 AC_CANONICAL_SYSTEM
37
38 # We use these options to decide which functions to include.
39 AC_ARG_WITH(target-subdir,
40 [  --with-target-subdir=SUBDIR
41                            configuring in a subdirectory])
42 AC_ARG_WITH(cross-host,
43 [  --with-cross-host=HOST  configuring with a cross compiler])
44
45 # Runs configure.host and configure.target. Have to run this before
46 # the GLIBCPP_ENABLE_* macros below.
47 GLIBCPP_CONFIGURE(.)
48
49 AC_LIBTOOL_DLOPEN
50 AM_PROG_LIBTOOL
51 AC_SUBST(enable_shared)
52 AC_SUBST(enable_static)
53 GLIBCPP_CHECK_GNU_MAKE
54   if test "x$_cv_gnu_make_command" = "x"; then
55     AC_MSG_ERROR([GNU make not found. Please install it or correct your path.])
56   fi
57 AM_CONFIG_HEADER(config.h)
58
59 # Check for c++ or library specific bits that don't require linking.
60 GLIBCPP_CHECK_COMPILER_VERSION
61
62 # Enable all the crazy c++ stuff.  C_MBCHAR must come early.
63 GLIBCPP_ENABLE_DEBUG($USE_MAINTAINER_MODE)
64 GLIBCPP_ENABLE_CSTDIO
65 GLIBCPP_ENABLE_CLOCALE
66 GLIBCPP_ENABLE_C_MBCHAR([yes])
67 GLIBCPP_ENABLE_LONG_LONG([no])
68 GLIBCPP_ENABLE_CHEADERS([c_std])
69 GLIBCPP_ENABLE_THREADS
70 GLIBCPP_ENABLE_CXX_FLAGS([none])
71
72 if test -n "$with_cross_host"; then
73
74   # We are being configured with a cross compiler.  AC_REPLACE_FUNCS
75   # may not work correctly, because the compiler may not be able to
76   # link executables.
77   xcompiling=1
78   NATIVE=no
79
80   # If Canadian cross, then don't pick up tools from the build
81   # directory.
82   if test x"$build" != x"$with_cross_host" && x"$build" != x"$target"; then
83     CANADIAN=yes
84     NULL_TARGET=yes
85   else
86     CANADIAN=no
87     NULL_TARGET=no
88   fi
89
90   case "$target_alias" in
91     *-linux*)
92         # Construct linux crosses by hand, eliminating bits that need ld...
93         # Check for available headers.
94         AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
95         machine/endian.h machine/param.h sys/machine.h fp.h locale.h \
96         float.h inttypes.h])
97
98         # GLIBCPP_CHECK_COMPILER_FEATURES
99         SECTION_FLAGS='-ffunction-sections -fdata-sections'
100         AC_SUBST(SECTION_FLAGS)
101         GLIBCPP_CHECK_LINKER_FEATURES
102         # GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
103         # GLIBCPP_CHECK_MATH_SUPPORT
104         AC_DEFINE(HAVE_ACOSF)
105         AC_DEFINE(HAVE_ASINF)
106         AC_DEFINE(HAVE_ATAN2F)
107         AC_DEFINE(HAVE_ATANF)
108         AC_DEFINE(HAVE_CEILF)
109         AC_DEFINE(HAVE_COPYSIGN)
110         AC_DEFINE(HAVE_COPYSIGNF)
111         AC_DEFINE(HAVE_COSF)
112         AC_DEFINE(HAVE_COSHF)
113         AC_DEFINE(HAVE_EXPF)
114         AC_DEFINE(HAVE_FABSF)
115         AC_DEFINE(HAVE_FINITE)
116         AC_DEFINE(HAVE_FINITEF)
117         AC_DEFINE(HAVE_FLOORF)
118         AC_DEFINE(HAVE_FMODF)
119         AC_DEFINE(HAVE_FREXPF)
120         AC_DEFINE(HAVE_ISINF)
121         AC_DEFINE(HAVE_ISINFF)
122         AC_DEFINE(HAVE_ISNAN)
123         AC_DEFINE(HAVE_ISNANF)
124         AC_DEFINE(HAVE_LDEXPF)
125         AC_DEFINE(HAVE_LOG10F)
126         AC_DEFINE(HAVE_LOGF)
127         AC_DEFINE(HAVE_MODFF)
128         AC_DEFINE(HAVE_POWF)
129         AC_DEFINE(HAVE_SINCOS)
130         AC_DEFINE(HAVE_SINCOSF)
131         AC_DEFINE(HAVE_SINF)
132         AC_DEFINE(HAVE_SINHF)
133         AC_DEFINE(HAVE_SQRTF)
134         AC_DEFINE(HAVE_TANF)
135         AC_DEFINE(HAVE_TANHF)
136
137         # At some point, we should differentiate between architectures
138         # like x86, which have long double versions, and alpha/powerpc/etc.,
139         # which don't. For the time being, punt.
140         if test x"long_double_math_on_this_cpu" = x"yes"; then
141           AC_DEFINE(HAVE_ACOSL)
142           AC_DEFINE(HAVE_ASINL)
143           AC_DEFINE(HAVE_ATAN2L)
144           AC_DEFINE(HAVE_ATANL)
145           AC_DEFINE(HAVE_CEILL)
146           AC_DEFINE(HAVE_COPYSIGNL)
147           AC_DEFINE(HAVE_COSL)
148           AC_DEFINE(HAVE_COSHL)
149           AC_DEFINE(HAVE_EXPL)
150           AC_DEFINE(HAVE_FABSL)
151           AC_DEFINE(HAVE_FINITEL)
152           AC_DEFINE(HAVE_FLOORL)
153           AC_DEFINE(HAVE_FMODL)
154           AC_DEFINE(HAVE_FREXPL)
155           AC_DEFINE(HAVE_ISINFL)
156           AC_DEFINE(HAVE_ISNANL)
157           AC_DEFINE(HAVE_LDEXPL)
158           AC_DEFINE(HAVE_LOG10L)
159           AC_DEFINE(HAVE_LOGL)
160           AC_DEFINE(HAVE_MODFL)
161           AC_DEFINE(HAVE_POWL)
162           AC_DEFINE(HAVE_SINCOSL)
163           AC_DEFINE(HAVE_SINL)
164           AC_DEFINE(HAVE_SINHL)
165           AC_DEFINE(HAVE_SQRTL)
166           AC_DEFINE(HAVE_TANL)
167           AC_DEFINE(HAVE_TANHL)
168         fi
169         GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
170         GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT
171         GLIBCPP_CHECK_WCHAR_T_SUPPORT
172         os_include_dir="config/os/gnu-linux"
173         # GLIBCPP_CHECK_STDLIB_SUPPORT
174         AC_DEFINE(HAVE_STRTOF)        
175         AC_DEFINE(HAVE_STRTOLD)        
176         # AC_FUNC_MMAP
177         AC_DEFINE(HAVE_MMAP)
178         ;;
179     *)
180         # We assume newlib.  This lets us hard-code the functions we know
181         # we'll have.
182         AC_DEFINE(HAVE_FINITE)
183         AC_DEFINE(HAVE_ISNAN)
184         AC_DEFINE(HAVE_ISNANF)
185         AC_DEFINE(HAVE_ISINF)
186         AC_DEFINE(HAVE_ISINFF)
187
188         os_include_dir="config/os/newlib"
189
190         AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
191         AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
192         # need to check for faster f versions of math functions, ie sinf?
193         ;;
194   esac
195 else
196
197   # We are being configured natively. We can do more elaborate tests
198   # that include AC_TRY_COMPILE now, as the linker is assumed to be
199   # working.
200   xcompiling=0
201   NATIVE=yes
202   CANADIAN=no
203   NULL_TARGET=no
204
205   # Check for available headers.
206   AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
207   machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h])
208
209   GLIBCPP_CHECK_COMPILER_FEATURES
210   GLIBCPP_CHECK_LINKER_FEATURES
211   GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
212   GLIBCPP_CHECK_MATH_SUPPORT
213   GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
214   GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT
215   GLIBCPP_CHECK_WCHAR_T_SUPPORT
216   GLIBCPP_CHECK_STDLIB_SUPPORT
217
218   AC_TRY_COMPILE([
219 #include <setjmp.h>
220 ], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
221 [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available.  ])])
222
223   AC_FUNC_MMAP
224 fi
225
226 # Now that ctype is determined for all possible targets, we can do this...
227 AC_LINK_FILES($os_include_dir/bits/ctype_base.h, \
228 include/bits/ctype_base.h)
229 AC_LINK_FILES($os_include_dir/bits/ctype_inline.h, \
230 include/bits/ctype_inline.h)
231 AC_LINK_FILES($os_include_dir/bits/ctype_noninline.h, \
232 include/bits/ctype_noninline.h)
233 AC_LINK_FILES($ATOMICITYH/bits/atomicity.h, include/bits/atomicity.h)
234
235 AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes)
236 AM_CONDITIONAL(NATIVE, test "$NATIVE" = yes || test "$NULL_TARGET" = yes)
237 AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
238  
239 AC_CACHE_SAVE
240 AC_LC_MESSAGES
241
242 if test "${multilib}" = "yes"; then
243   multilib_arg="--enable-multilib"
244 else
245   multilib_arg=
246 fi
247
248
249 # Generate the various Makefiles, include files, and scripts.
250
251 # Needed so that g++ can find the correct include subdir automatically.
252 INTERFACE=v3
253
254 # Export all the install information
255 GLIBCPP_EXPORT_INSTALL_INFO
256
257 # Export all the include and flag information to makefiles.
258 GLIBCPP_EXPORT_INCLUDES
259 GLIBCPP_EXPORT_FLAGS
260
261 # This should be done by mkincludedir, but hack around it now.
262 blddir=`pwd`
263 echo "checking for $blddir/include"
264
265 if test ! -d "$blddir/include"; then
266   mkdir "$blddir/include"
267 fi
268
269 # NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
270 # and libsupc++/Makefile.am so that multilib installs will end up
271 # installed in the correct place. To work around this not being passed
272 # down from config-ml.in -> top_srcdir/Makefile.am ->
273 # top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
274 AC_OUTPUT(tests_flags mkcheck Makefile src/Makefile libmath/Makefile libio/Makefile libsupc++/Makefile,
275 [if test -n "$CONFIG_FILES"; then
276   ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
277   grep '^MULTISUBDIR =' Makefile >> src/Makefile
278   grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
279 fi
280 chmod +x tests_flags
281 chmod +x mkcheck
282 ],
283 srcdir=${srcdir}
284 host=${host}
285 target=${target}
286 with_multisubdir=${with_multisubdir}
287 ac_configure_args="${multilib_arg} ${ac_configure_args}"
288 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
289 glibcpp_basedir=${glibcpp_basedir}
290 CC="${CC}"
291 CXX="${CXX}"
292 )
293
294
295 # Generate bits/c++config.h
296 # NB: This must be the first generated file as others include it. . .
297 $srcdir/mkc++config $blddir $srcdir
298
299 # Generate bits/std_limits.h and src/limitsMEMBERS.cc
300 if test ! -f stamp-limits; then
301   $srcdir/mknumeric_limits $blddir $srcdir $xcompiling
302   if test ! -f include/bits/std_limits.h; then
303     echo "mknumeric_limits failed to execute properly: exiting"
304     exit 1
305   else
306     touch stamp-limits 
307   fi
308 fi
309
310
311 # Sanity checking & User-visible messages.
312 # Checks down here, otherwise they get scrolled off before
313 # the user will notice.
314
315 # Trying to get more people to read documentation.  Possibly remove
316 # check and warn all the time. There is no "informational" AC_MSG_
317 # macro, so these are going to be printed even when --quiet/--silent
318 # is given.
319 if test ! -f stamp-sanity-warned; then
320   touch stamp-sanity-warned
321   echo ""
322   echo "Please make certain that you read the installation information here:"
323   echo "  faster => ${srcdir}/docs/install.html"
324   echo "  slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/install.html>"
325   echo ""
326   echo "and the configuration information here:"
327   echo "  faster => ${srcdir}/docs/configopts.html"
328   echo "  slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html>"
329   echo ""
330   echo "before proceeding with ${_cv_gnu_make_command}."
331   echo ""
332 fi