acconfig.h: _GLIBCPP_USING_THREADS and some workaround types added.
[gcc.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/complex.cc)
6 AC_CONFIG_AUX_DIR(..)
7
8 # Gets and sets build, host, target, *_vendor, *_cpu, *_os, etc.
9 AC_CANONICAL_SYSTEM
10
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])
17
18 GLIBCPP_CONFIGURE(.)
19 AC_LIBTOOL_DLOPEN
20 AM_PROG_LIBTOOL
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.])
24 fi
25 AM_CONFIG_HEADER(config.h)
26
27 # Check for c++ or library specific bits that don't require linking.
28 GLIBCPP_CHECK_COMPILER_VERSION
29 GLIBCPP_CHECK_CPU
30
31 AC_CACHE_SAVE
32
33 # Enable all the crazy c++ stuff.
34 GLIBCPP_ENABLE_DEBUG
35 GLIBCPP_ENABLE_CSTDIO
36 GLIBCPP_ENABLE_LONG_LONG(yes)
37 GLIBCPP_ENABLE_SHADOW(no)
38 GLIBCPP_ENABLE_THREADS
39 #GLIBCPP_ENABLE_RELIBGCC([../..])
40 GLIBCPP_ENABLE_CXX_FLAGS([none])
41
42
43 if test -n "$with_cross_host"; then
44
45 # We are being configured with a cross compiler. AC_REPLACE_FUNCS
46 # may not work correctly, because the compiler may not be able to
47 # link executables.
48
49 xcompiling=1
50 NATIVE=no
51 # If Canadian cross, then don't pick up tools from the build
52 # directory.
53 if test "$build" != "$with_cross_host"; then
54 CANADIAN=yes
55 NULL_TARGET=yes
56 else
57 CANADIAN=no
58 NULL_TARGET=no
59 fi
60
61 case "$target_alias" in
62 *-wince-*)
63 # Configure for Microsoft Windows CE, or whatever they are
64 # currently calling it.
65 AC_DEFINE(HAVE_FLOAT_H)
66
67 AC_DEFINE(HAVE__FINITE)
68 AC_DEFINE(HAVE__ISNAN)
69 AC_DEFINE(HAVE__COPYSIGN)
70 AC_DEFINE(HAVE__FPCLASS)
71 AC_DEFINE(HAVE_MODF)
72
73 ctype_include_dir="config/wince"
74 AC_SUBST(ctype_include_dir)
75
76 AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
77
78 AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
79 AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
80 ;;
81 *)
82 # We assume newlib. This lets us hard-code the functions we know
83 # we'll have.
84 AC_DEFINE(HAVE_FINITE)
85 AC_DEFINE(HAVE_ISNAN)
86 AC_DEFINE(HAVE_ISNANF)
87 AC_DEFINE(HAVE_ISINF)
88 AC_DEFINE(HAVE_ISINFF)
89
90 ctype_include_dir="config/newlib"
91 AC_SUBST(ctype_include_dir)
92
93 AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
94
95 AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
96 AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
97 # need to ceck for faster f versions of math functions, ie sinf?
98 ;;
99 esac
100 else
101
102 # We are being configured natively. We can do more elaborate tests
103 # that include AC_TRY_COMPILE now, as the linker is assumed to be
104 # working.
105
106 xcompiling=0
107 NATIVE=yes
108 CANADIAN=no
109 NULL_TARGET=no
110
111 # Check for available headers.
112 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
113 machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h])
114
115 GLIBCPP_CHECK_COMPILER_FEATURES
116 GLIBCPP_CHECK_LINKER_FEATURES
117 GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
118 GLIBCPP_CHECK_MATH_SUPPORT
119 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
120 GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT
121 AC_CACHE_SAVE
122 GLIBCPP_CHECK_WCHAR_T_SUPPORT
123 GLIBCPP_CHECK_CTYPE
124
125 AC_FUNC_MMAP
126 fi
127
128 AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
129 AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes)
130 AM_CONDITIONAL(NATIVE, test "$NATIVE" = yes || test "$NULL_TARGET" = yes)
131 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
132
133 AC_LC_MESSAGES
134
135
136 if test "${multilib}" = "yes"; then
137 multilib_arg="--enable-multilib"
138 else
139 multilib_arg=
140 fi
141
142
143 # Generate the various Makefiles, include files, and scripts.
144
145 # NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
146 # so that multilib installs will end up installed in the correct
147 # place. To work around this not being passed down from config-ml.in
148 # -> top_srcdir/Makefile.am -> top_srcdir/src/Makefile.am, manually
149 # append it here.
150
151 AC_OUTPUT(mkcheck Makefile src/Makefile math/Makefile libio/Makefile,
152 [if test -n "$CONFIG_FILES"; then
153 ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
154 grep '^MULTISUBDIR =' Makefile >> src/Makefile
155 fi],
156 srcdir=${srcdir}
157 host=${host}
158 target=${target}
159 with_multisubdir=${with_multisubdir}
160 ac_configure_args="${multilib_arg} ${ac_configure_args}"
161 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
162 glibcpp_basedir=${glibcpp_basedir}
163 CC="${CC}"
164 CXX="${CXX}"
165 )
166
167
168 blddir=`pwd`
169 # Generate bits/c++config.h
170 # NB: This must be the first generated file as others include it. . .
171 AC_OUTPUT_COMMANDS([$srcdir/mkc++config $blddir $srcdir])
172
173 # Generate bits/std_limits.h and src/limitsMEMBERS.cc
174 AC_OUTPUT_COMMANDS([$srcdir/mknumeric_limits $blddir $srcdir $xcompiling])
175
176
177 # Sanity checking & User-visible messages.
178 # Checks down here, otherwise they get scrolled off before
179 # the user will notice.
180 if test "$enable_namespaces" = "yes" && test "$enable_libgcc_rebuild" = "no"
181 then
182 AC_MSG_WARN([libgcc.a will not match mangled symbols unless it is rebuilt])
183 fi
184 if test "$enable_namespaces" = "no" && test "$enable_libgcc_rebuild" != "no"
185 then
186 # Other things besides namespaces can make this true as well, but none
187 # of them are done automatically... yet
188 AC_MSG_WARN([no point in rebuilding libgcc.a if namespaces aren't used])
189 fi
190
191 # Trying to get more people to read documentation. Possibly remove
192 # check and warn all the time. There is no "informational" AC_MSG_
193 # macro, so these are going to be printed even when --quiet/--silent
194 # is given.
195 if test ! -f stamp-sanity-warned; then
196 touch stamp-sanity-warned
197 echo ""
198 echo "Please make certain that you read the installation information here:"
199 echo " faster => ${srcdir}/docs/install.html"
200 echo " slower => <URL:http://sources.redhat.com/libstdc++/install.html>"
201 echo ""
202 echo "and the configuration information here:"
203 echo " faster => ${srcdir}/docs/configopts.html"
204 echo " slower => <URL:http://sources.redhat.com/libstdc++/configopts.html>"
205 echo ""
206 echo "before proceeding with ${_cv_gnu_make_command}."
207 echo ""
208 fi
209
210