]>
Commit | Line | Data |
---|---|---|
b2dad0e3 | 1 | # Process this file with autoconf to produce a configure script, like so: |
d94611f1 | 2 | # aclocal, autoconf, autoheader, automake |
b2dad0e3 BK |
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 | |
5780a46b | 20 | AM_PROG_LIBTOOL |
29bd52c8 PE |
21 | GLIBCPP_CHECK_GNU_MAKE |
22 | if test "x$_cv_gnu_make_command" = "x"; then | |
99b51359 | 23 | AC_MSG_ERROR([GNU make not found. Please install it or correct your path.]) |
29bd52c8 | 24 | fi |
b2dad0e3 BK |
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 | |
e974e9cc | 30 | GLIBCPP_CHECK_OS |
b2dad0e3 | 31 | |
8b8ab21c | 32 | # Enable all the crazy c++ stuff. C_MBCHAR must come early. |
7f586614 | 33 | GLIBCPP_ENABLE_DEBUG($USE_MAINTAINER_MODE) |
8b8ab21c | 34 | GLIBCPP_ENABLE_C_MBCHAR([yes]) |
b2dad0e3 | 35 | GLIBCPP_ENABLE_CSTDIO |
5b80666b | 36 | GLIBCPP_ENABLE_LONG_LONG(yes) |
99246c90 | 37 | GLIBCPP_ENABLE_SHADOW(no) |
b2dad0e3 | 38 | GLIBCPP_ENABLE_THREADS |
e974e9cc | 39 | GLIBCPP_ENABLE_ATOMICITY |
32a4595e | 40 | GLIBCPP_ENABLE_CXX_FLAGS([none]) |
b2dad0e3 | 41 | |
cde28f0d | 42 | |
b2dad0e3 BK |
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 | ||
1fd2f510 BK |
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/os/wince" | |
5e53dba6 BK |
74 | AC_LINK_FILES($ctype_include_dir/bits/ctype_base.h, |
75 | include/bits/ctype_base.h) | |
1fd2f510 | 76 | AC_LINK_FILES($ctype_include_dir/bits/ctype_inline.h, \ |
5e53dba6 | 77 | include/bits/ctype_inline.h) |
1fd2f510 | 78 | AC_LINK_FILES($ctype_include_dir/bits/ctype_noninline.h, \ |
5e53dba6 | 79 | include/bits/ctype_noninline.h) |
e974e9cc | 80 | |
b2dad0e3 | 81 | |
1fd2f510 | 82 | AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T) |
b2dad0e3 | 83 | |
1fd2f510 BK |
84 | AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX) |
85 | AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX) | |
b2dad0e3 BK |
86 | ;; |
87 | *) | |
88 | # We assume newlib. This lets us hard-code the functions we know | |
89 | # we'll have. | |
1fd2f510 BK |
90 | AC_DEFINE(HAVE_FINITE) |
91 | AC_DEFINE(HAVE_ISNAN) | |
92 | AC_DEFINE(HAVE_ISNANF) | |
93 | AC_DEFINE(HAVE_ISINF) | |
94 | AC_DEFINE(HAVE_ISINFF) | |
95 | ||
96 | ctype_include_dir="config/os/newlib" | |
5e53dba6 BK |
97 | AC_LINK_FILES($ctype_include_dir/bits/ctype_base.h, |
98 | include/bits/ctype_base.h) | |
1fd2f510 | 99 | AC_LINK_FILES($ctype_include_dir/bits/ctype_inline.h, \ |
5e53dba6 | 100 | include/bits/ctype_inline.h) |
1fd2f510 | 101 | AC_LINK_FILES($ctype_include_dir/bits/ctype_noninline.h, \ |
5e53dba6 | 102 | include/bits/ctype_noninline.h) |
b2dad0e3 | 103 | |
1fd2f510 | 104 | AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T) |
b2dad0e3 | 105 | |
1fd2f510 BK |
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? | |
b2dad0e3 BK |
109 | ;; |
110 | esac | |
111 | else | |
112 | ||
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 | |
115 | # working. | |
116 | ||
117 | xcompiling=0 | |
118 | NATIVE=yes | |
119 | CANADIAN=no | |
120 | NULL_TARGET=no | |
121 | ||
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]) | |
125 | ||
c470c17d BK |
126 | GLIBCPP_CHECK_COMPILER_FEATURES |
127 | GLIBCPP_CHECK_LINKER_FEATURES | |
b2dad0e3 BK |
128 | GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT |
129 | GLIBCPP_CHECK_MATH_SUPPORT | |
2f103494 BK |
130 | GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT |
131 | GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT | |
b2dad0e3 | 132 | GLIBCPP_CHECK_WCHAR_T_SUPPORT |
e7140677 BK |
133 | GLIBCPP_CHECK_CTYPE_SUPPORT |
134 | GLIBCPP_CHECK_STDLIB_SUPPORT | |
b2dad0e3 BK |
135 | |
136 | AC_FUNC_MMAP | |
dfb1d76f | 137 | AC_CHECK_HEADERS(gconv.h) |
b2dad0e3 BK |
138 | fi |
139 | ||
140 | AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes) | |
141 | AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes) | |
142 | AM_CONDITIONAL(NATIVE, test "$NATIVE" = yes || test "$NULL_TARGET" = yes) | |
143 | AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host") | |
144 | ||
5e53dba6 | 145 | AC_CACHE_SAVE |
b2dad0e3 BK |
146 | AC_LC_MESSAGES |
147 | ||
b2dad0e3 BK |
148 | if test "${multilib}" = "yes"; then |
149 | multilib_arg="--enable-multilib" | |
150 | else | |
151 | multilib_arg= | |
152 | fi | |
153 | ||
154 | ||
155 | # Generate the various Makefiles, include files, and scripts. | |
156 | ||
1fd2f510 BK |
157 | # This helps subvert libstdcxx_interface, as calculated by devo/config.if |
158 | # Needed so that g++ can find the correct include subdir automatically. | |
159 | INTERFACE=v3 | |
160 | ||
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) | |
167 | ||
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 | |
173 | yes) | |
174 | AC_MSG_ERROR(Missing directory for --with-gxx-include-dir) | |
175 | gxx_include_dir=no | |
176 | ;; | |
177 | no) | |
178 | gxx_include_dir=no | |
179 | ;; | |
180 | *) | |
181 | gxx_include_dir=${withval} | |
182 | ;; | |
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) | |
187 | ||
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 | |
195 | # is selected. | |
196 | changequote(,)dnl | |
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 | |
201 | gcc_version=$gcc_num | |
202 | changequote([,])dnl | |
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) | |
209 | fi | |
210 | ||
211 | ||
212 | ||
e466dc8a BK |
213 | # Export all the include and flag information to makefiles. |
214 | GLIBCPP_EXPORT_INCLUDES | |
215 | GLIBCPP_EXPORT_FLAGS | |
216 | ||
5e53dba6 BK |
217 | # This should be done by mkincludedir, but hack around it now. |
218 | blddir=`pwd` | |
219 | echo "checking for $blddir/include" | |
220 | ||
221 | if test ! -d "$blddir/include"; then | |
222 | mkdir "$blddir/include" | |
223 | fi | |
224 | ||
b2dad0e3 BK |
225 | # NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am |
226 | # so that multilib installs will end up installed in the correct | |
227 | # place. To work around this not being passed down from config-ml.in | |
228 | # -> top_srcdir/Makefile.am -> top_srcdir/src/Makefile.am, manually | |
229 | # append it here. | |
c7053b70 | 230 | AC_OUTPUT(mkcheck Makefile src/Makefile libmath/Makefile libio/Makefile libsupc++/Makefile, |
b2dad0e3 BK |
231 | [if test -n "$CONFIG_FILES"; then |
232 | ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in | |
233 | grep '^MULTISUBDIR =' Makefile >> src/Makefile | |
be5aeb60 MM |
234 | fi |
235 | chmod +x mkcheck | |
236 | ], | |
b2dad0e3 BK |
237 | srcdir=${srcdir} |
238 | host=${host} | |
239 | target=${target} | |
240 | with_multisubdir=${with_multisubdir} | |
241 | ac_configure_args="${multilib_arg} ${ac_configure_args}" | |
242 | CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} | |
243 | glibcpp_basedir=${glibcpp_basedir} | |
244 | CC="${CC}" | |
245 | CXX="${CXX}" | |
246 | ) | |
247 | ||
248 | ||
b2dad0e3 BK |
249 | # Generate bits/c++config.h |
250 | # NB: This must be the first generated file as others include it. . . | |
251 | AC_OUTPUT_COMMANDS([$srcdir/mkc++config $blddir $srcdir]) | |
252 | ||
253 | # Generate bits/std_limits.h and src/limitsMEMBERS.cc | |
1fd2f510 BK |
254 | if test ! -f stamp-limits; then |
255 | AC_OUTPUT_COMMANDS([$srcdir/mknumeric_limits $blddir $srcdir $xcompiling]) | |
256 | touch stamp-limits | |
257 | fi | |
29bd52c8 | 258 | |
a9117427 | 259 | |
29bd52c8 PE |
260 | # Sanity checking & User-visible messages. |
261 | # Checks down here, otherwise they get scrolled off before | |
262 | # the user will notice. | |
29bd52c8 | 263 | |
5780a46b BK |
264 | # Trying to get more people to read documentation. Possibly remove |
265 | # check and warn all the time. There is no "informational" AC_MSG_ | |
266 | # macro, so these are going to be printed even when --quiet/--silent | |
267 | # is given. | |
99b51359 BK |
268 | if test ! -f stamp-sanity-warned; then |
269 | touch stamp-sanity-warned | |
5780a46b BK |
270 | echo "" |
271 | echo "Please make certain that you read the installation information here:" | |
29bd52c8 | 272 | echo " faster => ${srcdir}/docs/install.html" |
5780a46b BK |
273 | echo " slower => <URL:http://sources.redhat.com/libstdc++/install.html>" |
274 | echo "" | |
275 | echo "and the configuration information here:" | |
29bd52c8 | 276 | echo " faster => ${srcdir}/docs/configopts.html" |
5780a46b BK |
277 | echo " slower => <URL:http://sources.redhat.com/libstdc++/configopts.html>" |
278 | echo "" | |
421173e6 | 279 | echo "before proceeding with ${_cv_gnu_make_command}." |
5780a46b | 280 | echo "" |
29bd52c8 PE |
281 | fi |
282 | ||
283 |