1 # Process this file with autoconf to produce a configure script, like so:
2 # aclocal, 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(yes)
31 GLIBCPP_ENABLE_SHADOW(no)
32 GLIBCPP_ENABLE_THREADS
33 #GLIBCPP_ENABLE_RELIBGCC([../..])
34 GLIBCPP_ENABLE_CXX_FLAGS([none])
37 if test -n "$with_cross_host"; then
39 # We are being configured with a cross compiler. AC_REPLACE_FUNCS
40 # may not work correctly, because the compiler may not be able to
45 # If Canadian cross, then don't pick up tools from the build
47 if test "$build" != "$with_cross_host"; then
55 case "$target_alias" in
57 # Configure for Microsoft Windows CE, or whatever they are
58 # currently calling it.
59 AC_DEFINE(HAVE_FLOAT_H)
61 AC_DEFINE(HAVE__FINITE)
62 AC_DEFINE(HAVE__ISNAN)
63 AC_DEFINE(HAVE__COPYSIGN)
64 AC_DEFINE(HAVE__FPCLASS)
67 ctype_include_dir="config/wince"
68 AC_SUBST(ctype_include_dir)
70 AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
72 AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
73 AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
76 # We assume newlib. This lets us hard-code the functions we know
78 AC_DEFINE(HAVE_FINITE)
80 AC_DEFINE(HAVE_ISNANF)
82 AC_DEFINE(HAVE_ISINFF)
84 ctype_include_dir="config/newlib"
85 AC_SUBST(ctype_include_dir)
87 AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
89 AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
90 AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
91 # need to ceck for faster f versions of math functions, ie sinf?
96 # We are being configured natively. We can do more elaborate tests
97 # that include AC_TRY_COMPILE now, as the linker is assumed to be
105 # Check for available headers.
106 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
107 machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h])
109 GLIBCPP_CHECK_COMPILER_FEATURES
110 GLIBCPP_CHECK_LINKER_FEATURES
111 GLIBCPP_CHECK_COMPLEX_SUPPORT
112 GLIBCPP_CHECK_COMPLEX_FLOAT_SUPPORT
113 GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
114 GLIBCPP_CHECK_MATH_SUPPORT
115 GLIBCPP_CHECK_WCHAR_T_SUPPORT
121 AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
122 AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes)
123 AM_CONDITIONAL(NATIVE, test "$NATIVE" = yes || test "$NULL_TARGET" = yes)
124 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
129 # Sanity checking & User-visible messages.
130 # Checks down here, otherwise they get scrolled off before
131 # the user will notice.
132 if test "$enable_namespaces" = "yes" && test "$enable_libgcc_rebuild" = "no"
134 AC_MSG_WARN([libgcc.a will not match mangled symbols unless it is rebuilt])
136 if test "$enable_namespaces" = "no" && test "$enable_libgcc_rebuild" != "no"
138 # Other things besides namespaces can make this true as well, but none
139 # of them are done automatically... yet
140 AC_MSG_WARN([no point in rebuilding libgcc.a if namespaces aren't used])
144 if test "${multilib}" = "yes"; then
145 multilib_arg="--enable-multilib"
151 # Generate the various Makefiles, include files, and scripts.
153 # NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
154 # so that multilib installs will end up installed in the correct
155 # place. To work around this not being passed down from config-ml.in
156 # -> top_srcdir/Makefile.am -> top_srcdir/src/Makefile.am, manually
159 AC_OUTPUT(mkcheck Makefile src/Makefile math/Makefile libio/Makefile,
160 [if test -n "$CONFIG_FILES"; then
161 ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
162 grep '^MULTISUBDIR =' Makefile >> src/Makefile
167 with_multisubdir=${with_multisubdir}
168 ac_configure_args="${multilib_arg} ${ac_configure_args}"
169 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
170 glibcpp_basedir=${glibcpp_basedir}
177 # Generate mkcheck having execute privs
178 AC_OUTPUT_COMMANDS([chmod +x $blddir/mkcheck])
180 # Generate bits/c++config.h
181 # NB: This must be the first generated file as others include it. . .
182 AC_OUTPUT_COMMANDS([$srcdir/mkc++config $blddir $srcdir])
184 # Generate bits/std_limits.h and src/limitsMEMBERS.cc
185 AC_OUTPUT_COMMANDS([$srcdir/mknumeric_limits $blddir $srcdir $xcompiling])
187 # Generate bits/c++threads.h
188 AC_OUTPUT_COMMANDS([cp $srcdir/config/$THREADH $blddir/bits/c++threads.h])
190 # Generate bits/c++io.h and src/c++io.cc
191 AC_OUTPUT_COMMANDS([cp $srcdir/config/$CSTDIO_H $blddir/bits/c++io.h])
192 AC_OUTPUT_COMMANDS([cp $srcdir/config/$CSTDIO_CC $blddir/src/c++io.cc])