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 GLIBCPP_CHECK_GNU_MAKE
22 if test "x$_cv_gnu_make_command" = "x"; then
23 AC_MSG_ERROR([GNU make not found. Please install it or correct your path.])
25 AM_CONFIG_HEADER(config.h)
27 # Check for c++ or library specific bits that don't require linking.
28 GLIBCPP_CHECK_COMPILER_VERSION
34 # Enable all the crazy c++ stuff. C_MBCHAR must come early.
35 GLIBCPP_ENABLE_DEBUG($USE_MAINTAINER_MODE)
36 GLIBCPP_ENABLE_C_MBCHAR([yes])
38 GLIBCPP_ENABLE_LONG_LONG(yes)
39 GLIBCPP_ENABLE_SHADOW(no)
40 GLIBCPP_ENABLE_THREADS
41 GLIBCPP_ENABLE_ATOMICITY
42 GLIBCPP_ENABLE_CXX_FLAGS([none])
45 if test -n "$with_cross_host"; then
47 # We are being configured with a cross compiler. AC_REPLACE_FUNCS
48 # may not work correctly, because the compiler may not be able to
53 # If Canadian cross, then don't pick up tools from the build
55 if test "$build" != "$with_cross_host"; then
63 case "$target_alias" in
65 # Configure for Microsoft Windows CE, or whatever they are
66 # currently calling it.
67 AC_DEFINE(HAVE_FLOAT_H)
69 AC_DEFINE(HAVE__FINITE)
70 AC_DEFINE(HAVE__ISNAN)
71 AC_DEFINE(HAVE__COPYSIGN)
72 AC_DEFINE(HAVE__FPCLASS)
75 ctype_include_dir="config/os/wince"
76 AC_LINK_FILES($ctype_include_dir/bits/ctype_base.h, bits/ctype_base.h)
77 AC_LINK_FILES($ctype_include_dir/bits/ctype_inline.h, \
79 AC_LINK_FILES($ctype_include_dir/bits/ctype_noninline.h, \
80 bits/ctype_noninline.h)
83 AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
85 AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
86 AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
89 # We assume newlib. This lets us hard-code the functions we know
91 AC_DEFINE(HAVE_FINITE)
93 AC_DEFINE(HAVE_ISNANF)
95 AC_DEFINE(HAVE_ISINFF)
97 ctype_include_dir="config/os/newlib"
98 AC_LINK_FILES($ctype_include_dir/bits/ctype_base.h, bits/ctype_base.h)
99 AC_LINK_FILES($ctype_include_dir/bits/ctype_inline.h, \
101 AC_LINK_FILES($ctype_include_dir/bits/ctype_noninline.h, \
102 bits/ctype_noninline.h)
104 AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
106 AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
107 AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
108 # need to ceck for faster f versions of math functions, ie sinf?
113 # We are being configured natively. We can do more elaborate tests
114 # that include AC_TRY_COMPILE now, as the linker is assumed to be
122 # Check for available headers.
123 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
124 machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h])
126 GLIBCPP_CHECK_COMPILER_FEATURES
127 GLIBCPP_CHECK_LINKER_FEATURES
128 GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
129 GLIBCPP_CHECK_MATH_SUPPORT
130 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
131 GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT
133 GLIBCPP_CHECK_WCHAR_T_SUPPORT
134 GLIBCPP_CHECK_CTYPE_SUPPORT
135 GLIBCPP_CHECK_STDLIB_SUPPORT
138 AC_CHECK_HEADERS(gconv.h)
141 AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
142 AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes)
143 AM_CONDITIONAL(NATIVE, test "$NATIVE" = yes || test "$NULL_TARGET" = yes)
144 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
148 if test "${multilib}" = "yes"; then
149 multilib_arg="--enable-multilib"
155 # Generate the various Makefiles, include files, and scripts.
157 # This helps subvert libstdcxx_interface, as calculated by devo/config.if
158 # Needed so that g++ can find the correct include subdir automatically.
161 # Check for the interface version number for specifying where header
162 # files are installed, if a version number is provided.
163 AC_MSG_CHECKING([for interface version number])
164 libstdcxx_interface=$INTERFACE
165 AC_MSG_RESULT($libstdcxx_interface)
166 AC_SUBST(libstdcxx_interface)
168 # Process the option --with-gxx-include-dir=<path to include-files directory>
169 AC_MSG_CHECKING([for --with-gxx-include-dir])
170 AC_ARG_WITH(gxx-include-dir,
171 [ --with-gxx-include-dir the installation directory for include files],
172 [case "${withval}" in
174 AC_MSG_ERROR(Missing directory for --with-gxx-include-dir)
181 gxx_include_dir=${withval}
183 esac], [gxx_include_dir=no])
184 AC_MSG_RESULT($gxx_include_dir)
185 AC_SUBST(gxx_include_dir)
186 AM_CONDITIONAL(GXX_INCLUDE_DIR, test x${gxx_include_dir} != xno)
188 # Process the option "--enable-version-specific-runtime-libs"
189 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
190 AC_ARG_ENABLE(version-specific-runtime-libs,
191 [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
192 [ version_specific_libs=yes
193 # Need the gcc compiler version to know where to install libraries
194 # and header files if --enable-version-specific-runtime-libs option
197 gcc_tmp=`grep version_string ${srcdir}/../gcc/version.c | awk '{print $6}'`
198 gcc_num=`echo ${gcc_tmp} | sed 's/\"//g'`
199 #gcc_date=`grep version_string ${srcdir}/../gcc/version.c | awk '{print $7}'`
200 #gcc_version=$gcc_num-$gcc_date
203 AC_SUBST(gcc_version)
204 ],version_specific_libs=no)
205 AC_MSG_RESULT($version_specific_libs)
206 if test x${version_specific_libs} = xyes; then
207 AM_CONDITIONAL(VERSION_SPECIFIC_LIBS, test x${version_specific_libs} = xyes)
208 AC_MSG_WARN(version specific directory is: $gcc_version)
213 # Export all the include and flag information to makefiles.
214 GLIBCPP_EXPORT_INCLUDES
217 # NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
218 # so that multilib installs will end up installed in the correct
219 # place. To work around this not being passed down from config-ml.in
220 # -> top_srcdir/Makefile.am -> top_srcdir/src/Makefile.am, manually
222 AC_OUTPUT(mkcheck Makefile src/Makefile libmath/Makefile libio/Makefile libsupc++/Makefile,
223 [if test -n "$CONFIG_FILES"; then
224 ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
225 grep '^MULTISUBDIR =' Makefile >> src/Makefile
232 with_multisubdir=${with_multisubdir}
233 ac_configure_args="${multilib_arg} ${ac_configure_args}"
234 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
235 glibcpp_basedir=${glibcpp_basedir}
242 # Generate bits/c++config.h
243 # NB: This must be the first generated file as others include it. . .
244 AC_OUTPUT_COMMANDS([$srcdir/mkc++config $blddir $srcdir])
246 # Generate bits/std_limits.h and src/limitsMEMBERS.cc
247 if test ! -f stamp-limits; then
248 AC_OUTPUT_COMMANDS([$srcdir/mknumeric_limits $blddir $srcdir $xcompiling])
253 # Sanity checking & User-visible messages.
254 # Checks down here, otherwise they get scrolled off before
255 # the user will notice.
256 ### warnings removed; none were applicable anymore
259 # Trying to get more people to read documentation. Possibly remove
260 # check and warn all the time. There is no "informational" AC_MSG_
261 # macro, so these are going to be printed even when --quiet/--silent
263 if test ! -f stamp-sanity-warned; then
264 touch stamp-sanity-warned
266 echo "Please make certain that you read the installation information here:"
267 echo " faster => ${srcdir}/docs/install.html"
268 echo " slower => <URL:http://sources.redhat.com/libstdc++/install.html>"
270 echo "and the configuration information here:"
271 echo " faster => ${srcdir}/docs/configopts.html"
272 echo " slower => <URL:http://sources.redhat.com/libstdc++/configopts.html>"
274 echo "before proceeding with ${_cv_gnu_make_command}."