1 # Process this file with autoconf to produce a configure script, like so:
2 # aclocal -I m4, autoconf, autoheader, automake
5 AC_INIT(src/complex.cc)
8 # Gets and sets build, host, target, *_vendor, *_cpu, *_os, etc.
11 # We use these options to decide which functions to include.
12 AC_ARG_WITH(target-subdir,
13 [ --with-target-subdir=SUBDIR
14 configuring in a subdirectory])
15 AC_ARG_WITH(cross-host,
16 [ --with-cross-host=HOST configuring with a cross compiler])
21 AM_CONFIG_HEADER(config.h)
23 # Check for c++ or library specific bits that don't require linking.
24 GLIBCPP_CHECK_COMPILER_VERSION
27 # Enable all the crazy c++ stuff.
30 GLIBCPP_ENABLE_LONG_LONG
31 GLIBCPP_ENABLE_THREADS
32 #GLIBCPP_ENABLE_RELIBGCC([../..])
33 GLIBCPP_ENABLE_CXX_FLAGS([none])
36 if test -n "$with_cross_host"; then
38 # We are being configured with a cross compiler. AC_REPLACE_FUNCS
39 # may not work correctly, because the compiler may not be able to
44 # If Canadian cross, then don't pick up tools from the build
46 if test "$build" != "$with_cross_host"; then
54 case "$target_alias" in
56 # Configure for Microsoft Windows CE, or whatever they are
57 # currently calling it.
58 AC_DEFINE(HAVE_FLOAT_H)
60 AC_DEFINE(HAVE__FINITE)
61 AC_DEFINE(HAVE__ISNAN)
62 AC_DEFINE(HAVE__COPYSIGN)
63 AC_DEFINE(HAVE__FPCLASS)
66 ctype_include_dir="config/wince"
67 AC_SUBST(ctype_include_dir)
69 AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
71 AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
72 AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
75 # We assume newlib. This lets us hard-code the functions we know
77 AC_DEFINE(HAVE_FINITE)
79 AC_DEFINE(HAVE_ISNANF)
81 AC_DEFINE(HAVE_ISINFF)
83 ctype_include_dir="config/newlib"
84 AC_SUBST(ctype_include_dir)
86 AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
88 AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
89 AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
90 # need to ceck for faster f versions of math functions, ie sinf?
95 # We are being configured natively. We can do more elaborate tests
96 # that include AC_TRY_COMPILE now, as the linker is assumed to be
104 # Check for available headers.
105 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
106 machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h])
108 GLIBCPP_CHECK_COMPLEX_SUPPORT
109 GLIBCPP_CHECK_COMPLEX_FLOAT_SUPPORT
110 GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
111 GLIBCPP_CHECK_MATH_SUPPORT
112 GLIBCPP_CHECK_WCHAR_T_SUPPORT
118 AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
119 AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes)
120 AM_CONDITIONAL(NATIVE, test "$NATIVE" = yes || test "$NULL_TARGET" = yes)
121 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
126 # Sanity checking & User-visible messages.
127 # Checks down here, otherwise they get scrolled off before
128 # the user will notice.
129 if test "$enable_namespaces" = "yes" && test "$enable_libgcc_rebuild" = "no"
131 AC_MSG_WARN([libgcc.a will not match mangled symbols unless it is rebuilt])
133 if test "$enable_namespaces" = "no" && test "$enable_libgcc_rebuild" != "no"
135 # Other things besides namespaces can make this true as well, but none
136 # of them are done automatically... yet
137 AC_MSG_WARN([no point in rebuilding libgcc.a if namespaces aren't used])
141 if test "${multilib}" = "yes"; then
142 multilib_arg="--enable-multilib"
148 # Generate the various Makefiles, include files, and scripts.
150 # NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
151 # so that multilib installs will end up installed in the correct
152 # place. To work around this not being passed down from config-ml.in
153 # -> top_srcdir/Makefile.am -> top_srcdir/src/Makefile.am, manually
156 AC_OUTPUT(mkcheck Makefile src/Makefile math/Makefile libio/Makefile,
157 [if test -n "$CONFIG_FILES"; then
158 ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
159 grep '^MULTISUBDIR =' Makefile >> src/Makefile
164 with_multisubdir=${with_multisubdir}
165 ac_configure_args="${multilib_arg} ${ac_configure_args}"
166 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
167 glibcpp_basedir=${glibcpp_basedir}
174 # Generate mkcheck having execute privs
175 AC_OUTPUT_COMMANDS([chmod +x $blddir/mkcheck])
177 # Generate bits/c++config.h
178 # NB: This must be the first generated file as others include it. . .
179 AC_OUTPUT_COMMANDS([$srcdir/mkc++config $blddir $srcdir])
181 # Generate bits/std_limits.h and src/limitsMEMBERS.cc
182 AC_OUTPUT_COMMANDS([$srcdir/mknumeric_limits $blddir $srcdir $xcompiling])
184 # Generate bits/c++threads.h
185 AC_OUTPUT_COMMANDS([cp $srcdir/config/$THREADH $blddir/bits/c++threads.h])
187 # Generate bits/c++io.h and src/c++io.cc
188 AC_OUTPUT_COMMANDS([cp $srcdir/config/$CSTDIO_H $blddir/bits/c++io.h])
189 AC_OUTPUT_COMMANDS([cp $srcdir/config/$CSTDIO_CC $blddir/src/c++io.cc])