1 | dnl aclocal.m4 generated automatically by aclocal 1.4-p5
|
---|
2 |
|
---|
3 | dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
|
---|
4 | dnl This file is free software; the Free Software Foundation
|
---|
5 | dnl gives unlimited permission to copy and/or distribute it,
|
---|
6 | dnl with or without modifications, as long as this notice is preserved.
|
---|
7 |
|
---|
8 | dnl This program is distributed in the hope that it will be useful,
|
---|
9 | dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
---|
10 | dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
---|
11 | dnl PARTICULAR PURPOSE.
|
---|
12 |
|
---|
13 | dnl
|
---|
14 | dnl Initialize basic configure bits, set toplevel_srcdir for Makefiles.
|
---|
15 | dnl
|
---|
16 | dnl GLIBCPP_TOPREL_CONFIGURE
|
---|
17 | AC_DEFUN(GLIBCPP_TOPREL_CONFIGURE, [
|
---|
18 | dnl Default to --enable-multilib (this is also passed by default
|
---|
19 | dnl from the ubercommon-top-level configure)
|
---|
20 | AC_ARG_ENABLE(multilib,
|
---|
21 | [ --enable-multilib build hella library versions (default)],
|
---|
22 | [case "${enableval}" in
|
---|
23 | yes) multilib=yes ;;
|
---|
24 | no) multilib=no ;;
|
---|
25 | *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
|
---|
26 | esac], [multilib=yes])dnl
|
---|
27 |
|
---|
28 | # When building with srcdir == objdir, links to the source files will
|
---|
29 | # be created in directories within the target_subdir. We have to
|
---|
30 | # adjust toplevel_srcdir accordingly, so that configure finds
|
---|
31 | # install-sh and other auxiliary files that live in the top-level
|
---|
32 | # source directory.
|
---|
33 | if test "${srcdir}" = "."; then
|
---|
34 | if test -z "${with_target_subdir}"; then
|
---|
35 | toprel=".."
|
---|
36 | else
|
---|
37 | if test "${with_target_subdir}" != "."; then
|
---|
38 | toprel="${with_multisrctop}../.."
|
---|
39 | else
|
---|
40 | toprel="${with_multisrctop}.."
|
---|
41 | fi
|
---|
42 | fi
|
---|
43 | else
|
---|
44 | toprel=".."
|
---|
45 | fi
|
---|
46 | AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
|
---|
47 | toplevel_srcdir=\${top_srcdir}/$toprel
|
---|
48 | AC_SUBST(toplevel_srcdir)
|
---|
49 | ])
|
---|
50 |
|
---|
51 | dnl
|
---|
52 | dnl Initialize the rest of the library configury.
|
---|
53 | dnl
|
---|
54 | dnl GLIBCPP_CONFIGURE
|
---|
55 | AC_DEFUN(GLIBCPP_CONFIGURE, [
|
---|
56 | # Export build and source directories.
|
---|
57 | # These need to be absolute paths, yet at the same time need to
|
---|
58 | # canonicalize only relative paths, because then amd will not unmount
|
---|
59 | # drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
|
---|
60 | glibcpp_builddir=`${PWDCMD-pwd}`
|
---|
61 | case $srcdir in
|
---|
62 | [\\/$]* | ?:[\\/]*) glibcpp_srcdir=${srcdir} ;;
|
---|
63 | *) glibcpp_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
|
---|
64 | esac
|
---|
65 | AC_SUBST(glibcpp_builddir)
|
---|
66 | AC_SUBST(glibcpp_srcdir)
|
---|
67 |
|
---|
68 | dnl This is here just to satisfy automake.
|
---|
69 | ifelse(not,equal,[AC_CONFIG_AUX_DIR(..)])
|
---|
70 |
|
---|
71 | AC_PROG_AWK
|
---|
72 | # Will set LN_S to either 'ln -s' or 'ln'. With autoconf 2.5x, can also
|
---|
73 | # be 'cp -p' if linking isn't available. Uncomment the next line to
|
---|
74 | # force a particular method.
|
---|
75 | #ac_cv_prog_LN_S='cp -p'
|
---|
76 | AC_PROG_LN_S
|
---|
77 |
|
---|
78 | # We use these options to decide which functions to include.
|
---|
79 | AC_ARG_WITH(newlib,
|
---|
80 | [ --with-newlib use newlib headers])
|
---|
81 | AC_ARG_WITH(target-subdir,
|
---|
82 | [ --with-target-subdir=SUBDIR
|
---|
83 | configuring in a subdirectory])
|
---|
84 | AC_ARG_WITH(cross-host,
|
---|
85 | [ --with-cross-host=HOST configuring with a cross compiler])
|
---|
86 |
|
---|
87 | glibcpp_basedir=$srcdir/$toprel/$1/libstdc++-v3
|
---|
88 | AC_SUBST(glibcpp_basedir)
|
---|
89 |
|
---|
90 | # Never versions of autoconf add an underscore to these functions.
|
---|
91 | # Prevent future problems ...
|
---|
92 | ifdef([AC_PROG_CC_G],[],[define([AC_PROG_CC_G],defn([_AC_PROG_CC_G]))])
|
---|
93 | ifdef([AC_PROG_CC_GNU],[],[define([AC_PROG_CC_GNU],defn([_AC_PROG_CC_GNU]))])
|
---|
94 | ifdef([AC_PROG_CXX_G],[],[define([AC_PROG_CXX_G],defn([_AC_PROG_CXX_G]))])
|
---|
95 | ifdef([AC_PROG_CXX_GNU],[],[define([AC_PROG_CXX_GNU],defn([_AC_PROG_CXX_GNU]))])
|
---|
96 |
|
---|
97 | # AC_PROG_CC
|
---|
98 | # FIXME: We temporarily define our own version of AC_PROG_CC. This is
|
---|
99 | # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
|
---|
100 | # are probably using a cross compiler, which will not be able to fully
|
---|
101 | # link an executable. This is addressed in later versions of autoconf.
|
---|
102 |
|
---|
103 | AC_DEFUN(LIB_AC_PROG_CC,
|
---|
104 | [AC_BEFORE([$0], [AC_PROG_CPP])dnl
|
---|
105 | dnl Fool anybody using AC_PROG_CC.
|
---|
106 | AC_PROVIDE([AC_PROG_CC])
|
---|
107 | AC_CHECK_PROG(CC, gcc, gcc)
|
---|
108 | if test -z "$CC"; then
|
---|
109 | AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
|
---|
110 | test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
|
---|
111 | fi
|
---|
112 |
|
---|
113 | AC_PROG_CC_GNU
|
---|
114 |
|
---|
115 | if test $ac_cv_prog_gcc = yes; then
|
---|
116 | GCC=yes
|
---|
117 | dnl Check whether -g works, even if CFLAGS is set, in case the package
|
---|
118 | dnl plays around with CFLAGS (such as to build both debugging and
|
---|
119 | dnl normal versions of a library), tasteless as that idea is.
|
---|
120 | ac_test_CFLAGS="${CFLAGS+set}"
|
---|
121 | ac_save_CFLAGS="$CFLAGS"
|
---|
122 | CFLAGS=
|
---|
123 | AC_PROG_CC_G
|
---|
124 | if test "$ac_test_CFLAGS" = set; then
|
---|
125 | CFLAGS="$ac_save_CFLAGS"
|
---|
126 | elif test $ac_cv_prog_cc_g = yes; then
|
---|
127 | CFLAGS="-g -O2"
|
---|
128 | else
|
---|
129 | CFLAGS="-O2"
|
---|
130 | fi
|
---|
131 | else
|
---|
132 | GCC=
|
---|
133 | test "${CFLAGS+set}" = set || CFLAGS="-g"
|
---|
134 | fi
|
---|
135 | ])
|
---|
136 |
|
---|
137 | LIB_AC_PROG_CC
|
---|
138 |
|
---|
139 | # Likewise for AC_PROG_CXX. We can't just call it directly because g++
|
---|
140 | # will try to link in libstdc++.
|
---|
141 | AC_DEFUN(LIB_AC_PROG_CXX,
|
---|
142 | [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
|
---|
143 | dnl Fool anybody using AC_PROG_CXX.
|
---|
144 | AC_PROVIDE([AC_PROG_CXX])
|
---|
145 | # Use glibcpp_CXX so that we do not cause CXX to be cached with the
|
---|
146 | # flags that come in CXX while configuring libstdc++. They're different
|
---|
147 | # from those used for all other target libraries. If CXX is set in
|
---|
148 | # the environment, respect that here.
|
---|
149 | glibcpp_CXX=$CXX
|
---|
150 | AC_CHECK_PROGS(glibcpp_CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
|
---|
151 | AC_SUBST(glibcpp_CXX)
|
---|
152 | CXX=$glibcpp_CXX
|
---|
153 | test -z "$glibcpp_CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
|
---|
154 |
|
---|
155 | AC_PROG_CXX_GNU
|
---|
156 |
|
---|
157 | if test $ac_cv_prog_gxx = yes; then
|
---|
158 | GXX=yes
|
---|
159 | dnl Check whether -g works, even if CXXFLAGS is set, in case the package
|
---|
160 | dnl plays around with CXXFLAGS (such as to build both debugging and
|
---|
161 | dnl normal versions of a library), tasteless as that idea is.
|
---|
162 | ac_test_CXXFLAGS="${CXXFLAGS+set}"
|
---|
163 | ac_save_CXXFLAGS="$CXXFLAGS"
|
---|
164 | CXXFLAGS=
|
---|
165 | AC_PROG_CXX_G
|
---|
166 | if test "$ac_test_CXXFLAGS" = set; then
|
---|
167 | CXXFLAGS="$ac_save_CXXFLAGS"
|
---|
168 | elif test $ac_cv_prog_cxx_g = yes; then
|
---|
169 | CXXFLAGS="-g -O2"
|
---|
170 | else
|
---|
171 | CXXFLAGS="-O2"
|
---|
172 | fi
|
---|
173 | else
|
---|
174 | GXX=
|
---|
175 | test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
|
---|
176 | fi
|
---|
177 | ])
|
---|
178 |
|
---|
179 | LIB_AC_PROG_CXX
|
---|
180 |
|
---|
181 | # For directory versioning (e.g., headers) and other variables.
|
---|
182 | AC_MSG_CHECKING([for GCC version number])
|
---|
183 | gcc_version=`$glibcpp_CXX -dumpversion`
|
---|
184 | AC_MSG_RESULT($gcc_version)
|
---|
185 |
|
---|
186 | # For some reason, gettext needs this.
|
---|
187 | AC_ISC_POSIX
|
---|
188 |
|
---|
189 | AC_CHECK_TOOL(AS, as)
|
---|
190 | AC_CHECK_TOOL(AR, ar)
|
---|
191 | AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
|
---|
192 | AC_PROG_INSTALL
|
---|
193 |
|
---|
194 | AM_MAINTAINER_MODE
|
---|
195 |
|
---|
196 | # We need AC_EXEEXT to keep automake happy in cygnus mode. However,
|
---|
197 | # at least currently, we never actually build a program, so we never
|
---|
198 | # need to use $(EXEEXT). Moreover, the test for EXEEXT normally
|
---|
199 | # fails, because we are probably configuring with a cross compiler
|
---|
200 | # which can't create executables. So we include AC_EXEEXT to keep
|
---|
201 | # automake happy, but we don't execute it, since we don't care about
|
---|
202 | # the result.
|
---|
203 | if false; then
|
---|
204 | # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
|
---|
205 | # to nothing, so nothing would remain between `then' and `fi' if it
|
---|
206 | # were not for the `:' below.
|
---|
207 | :
|
---|
208 | AC_EXEEXT
|
---|
209 | fi
|
---|
210 |
|
---|
211 | case [$]{glibcpp_basedir} in
|
---|
212 | /* | [A-Za-z]:[\\/]*) libgcj_flagbasedir=[$]{glibcpp_basedir} ;;
|
---|
213 | *) glibcpp_flagbasedir='[$](top_builddir)/'[$]{glibcpp_basedir} ;;
|
---|
214 | esac
|
---|
215 |
|
---|
216 | # Find platform-specific directories containing configuration info. In
|
---|
217 | # addition to possibly modifying the same flags, it also sets up symlinks.
|
---|
218 | GLIBCPP_CHECK_TARGET
|
---|
219 | ])
|
---|
220 |
|
---|
221 |
|
---|
222 | dnl
|
---|
223 | dnl Check to see if g++ can compile this library, and if so, if any version-
|
---|
224 | dnl specific precautions need to be taken.
|
---|
225 | dnl
|
---|
226 | dnl GLIBCPP_CHECK_COMPILER_VERSION
|
---|
227 | AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
|
---|
228 | if test ! -f stamp-sanity-compiler; then
|
---|
229 | AC_MSG_CHECKING([for g++ that will successfully compile libstdc++-v3])
|
---|
230 | AC_LANG_SAVE
|
---|
231 | AC_LANG_CPLUSPLUS
|
---|
232 | AC_TRY_COMPILE(, [
|
---|
233 | #if __GNUC__ < 3
|
---|
234 | not_ok
|
---|
235 | #endif
|
---|
236 | ], gpp_satisfactory=yes, AC_MSG_ERROR([please upgrade to GCC 3.0 or above]))
|
---|
237 | AC_LANG_RESTORE
|
---|
238 | AC_MSG_RESULT($gpp_satisfactory)
|
---|
239 | touch stamp-sanity-compiler
|
---|
240 | fi
|
---|
241 | ])
|
---|
242 |
|
---|
243 |
|
---|
244 | dnl
|
---|
245 | dnl Tests for newer compiler features, or features that are present in newer
|
---|
246 | dnl compiler versions but not older compiler versions still in use, should
|
---|
247 | dnl be placed here.
|
---|
248 | dnl
|
---|
249 | dnl Define WERROR='-Werror' if requested and possible; g++'s that lack the
|
---|
250 | dnl new inlining code or the new system_header pragma will die on -Werror.
|
---|
251 | dnl Leave it out by default and use maint-mode to use it.
|
---|
252 | dnl
|
---|
253 | dnl Define SECTION_FLAGS='-ffunction-sections -fdata-sections' if
|
---|
254 | dnl compiler supports it and the user has not requested debug mode.
|
---|
255 | dnl
|
---|
256 | dnl GLIBCPP_CHECK_COMPILER_FEATURES
|
---|
257 | AC_DEFUN(GLIBCPP_CHECK_COMPILER_FEATURES, [
|
---|
258 | # All these tests are for C++; save the language and the compiler flags.
|
---|
259 | # The CXXFLAGS thing is suspicious, but based on similar bits previously
|
---|
260 | # found in GLIBCPP_CONFIGURE.
|
---|
261 | AC_LANG_SAVE
|
---|
262 | AC_LANG_CPLUSPLUS
|
---|
263 | ac_test_CXXFLAGS="${CXXFLAGS+set}"
|
---|
264 | ac_save_CXXFLAGS="$CXXFLAGS"
|
---|
265 |
|
---|
266 | # Check for maintainer-mode bits.
|
---|
267 | if test x"$USE_MAINTAINER_MODE" = xno; then
|
---|
268 | WERROR=''
|
---|
269 | else
|
---|
270 | WERROR='-Werror'
|
---|
271 | fi
|
---|
272 |
|
---|
273 | # Check for -ffunction-sections -fdata-sections
|
---|
274 | AC_MSG_CHECKING([for g++ that supports -ffunction-sections -fdata-sections])
|
---|
275 | CXXFLAGS='-Werror -ffunction-sections -fdata-sections'
|
---|
276 | AC_TRY_COMPILE(, [int foo;
|
---|
277 | ], [ac_fdsections=yes], [ac_fdsections=no])
|
---|
278 | if test "$ac_test_CXXFLAGS" = set; then
|
---|
279 | CXXFLAGS="$ac_save_CXXFLAGS"
|
---|
280 | else
|
---|
281 | # this is the suspicious part
|
---|
282 | CXXFLAGS=''
|
---|
283 | fi
|
---|
284 | if test x"$ac_fdsections" = x"yes"; then
|
---|
285 | SECTION_FLAGS='-ffunction-sections -fdata-sections'
|
---|
286 | fi
|
---|
287 | AC_MSG_RESULT($ac_fdsections)
|
---|
288 |
|
---|
289 | AC_LANG_RESTORE
|
---|
290 | AC_SUBST(WERROR)
|
---|
291 | AC_SUBST(SECTION_FLAGS)
|
---|
292 | ])
|
---|
293 |
|
---|
294 |
|
---|
295 | dnl
|
---|
296 | dnl If GNU ld is in use, check to see if tricky linker opts can be used. If
|
---|
297 | dnl the native linker is in use, all variables will be defined to something
|
---|
298 | dnl safe (like an empty string).
|
---|
299 | dnl
|
---|
300 | dnl Define SECTION_LDFLAGS='-Wl,--gc-sections' if possible.
|
---|
301 | dnl Define OPT_LDFLAGS='-Wl,-O1' if possible.
|
---|
302 | dnl Define LD, with_gnu_ld, and (possibly) glibcpp_gnu_ld_version as
|
---|
303 | dnl side-effects of testing.
|
---|
304 | dnl
|
---|
305 | dnl GLIBCPP_CHECK_LINKER_FEATURES
|
---|
306 | AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
|
---|
307 | # If we're not using GNU ld, then there's no point in even trying these
|
---|
308 | # tests. Check for that first. We should have already tested for gld
|
---|
309 | # by now (in libtool), but require it now just to be safe...
|
---|
310 | test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
|
---|
311 | test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
|
---|
312 | AC_REQUIRE([AC_PROG_LD])
|
---|
313 |
|
---|
314 | # The name set by libtool depends on the version of libtool. Shame on us
|
---|
315 | # for depending on an impl detail, but c'est la vie. Older versions used
|
---|
316 | # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on
|
---|
317 | # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually
|
---|
318 | # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't
|
---|
319 | # set (hence we're using an older libtool), then set it.
|
---|
320 | if test x${with_gnu_ld+set} != xset; then
|
---|
321 | if test x${ac_cv_prog_gnu_ld+set} != xset; then
|
---|
322 | # We got through "ac_require(ac_prog_ld)" and still not set? Huh?
|
---|
323 | with_gnu_ld=no
|
---|
324 | else
|
---|
325 | with_gnu_ld=$ac_cv_prog_gnu_ld
|
---|
326 | fi
|
---|
327 | fi
|
---|
328 |
|
---|
329 | # Start by getting the version number. I think the libtool test already
|
---|
330 | # does some of this, but throws away the result.
|
---|
331 | changequote(,)
|
---|
332 | ldver=`$LD --version 2>/dev/null | head -1 | \
|
---|
333 | sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
|
---|
334 | changequote([,])
|
---|
335 | glibcpp_gnu_ld_version=`echo $ldver | \
|
---|
336 | $AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'`
|
---|
337 |
|
---|
338 | # Set --gc-sections.
|
---|
339 | if test "$with_gnu_ld" = "notbroken"; then
|
---|
340 | # GNU ld it is! Joy and bunny rabbits!
|
---|
341 |
|
---|
342 | # All these tests are for C++; save the language and the compiler flags.
|
---|
343 | # Need to do this so that g++ won't try to link in libstdc++
|
---|
344 | ac_test_CFLAGS="${CFLAGS+set}"
|
---|
345 | ac_save_CFLAGS="$CFLAGS"
|
---|
346 | CFLAGS='-x c++ -Wl,--gc-sections'
|
---|
347 |
|
---|
348 | # Check for -Wl,--gc-sections
|
---|
349 | # XXX This test is broken at the moment, as symbols required for
|
---|
350 | # linking are now in libsupc++ (not built yet.....). In addition,
|
---|
351 | # this test has cored on solaris in the past. In addition,
|
---|
352 | # --gc-sections doesn't really work at the moment (keeps on discarding
|
---|
353 | # used sections, first .eh_frame and now some of the glibc sections for
|
---|
354 | # iconv). Bzzzzt. Thanks for playing, maybe next time.
|
---|
355 | AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
|
---|
356 | AC_TRY_RUN([
|
---|
357 | int main(void)
|
---|
358 | {
|
---|
359 | try { throw 1; }
|
---|
360 | catch (...) { };
|
---|
361 | return 0;
|
---|
362 | }
|
---|
363 | ], [ac_sectionLDflags=yes],[ac_sectionLDflags=no], [ac_sectionLDflags=yes])
|
---|
364 | if test "$ac_test_CFLAGS" = set; then
|
---|
365 | CFLAGS="$ac_save_CFLAGS"
|
---|
366 | else
|
---|
367 | # this is the suspicious part
|
---|
368 | CFLAGS=''
|
---|
369 | fi
|
---|
370 | if test "$ac_sectionLDflags" = "yes"; then
|
---|
371 | SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
|
---|
372 | fi
|
---|
373 | AC_MSG_RESULT($ac_sectionLDflags)
|
---|
374 | fi
|
---|
375 |
|
---|
376 | # Set linker optimization flags.
|
---|
377 | if test x"$with_gnu_ld" = x"yes"; then
|
---|
378 | OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
|
---|
379 | fi
|
---|
380 |
|
---|
381 | AC_SUBST(SECTION_LDFLAGS)
|
---|
382 | AC_SUBST(OPT_LDFLAGS)
|
---|
383 | ])
|
---|
384 |
|
---|
385 |
|
---|
386 | dnl
|
---|
387 | dnl Check to see if the (math function) argument passed is
|
---|
388 | dnl declared when using the c++ compiler
|
---|
389 | dnl ASSUMES argument is a math function with ONE parameter
|
---|
390 | dnl
|
---|
391 | dnl GLIBCPP_CHECK_MATH_DECL_1
|
---|
392 | AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_1, [
|
---|
393 | AC_MSG_CHECKING([for $1 declaration])
|
---|
394 | if test x${glibcpp_cv_func_$1_use+set} != xset; then
|
---|
395 | AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
|
---|
396 | AC_LANG_SAVE
|
---|
397 | AC_LANG_CPLUSPLUS
|
---|
398 | AC_TRY_COMPILE([#include <math.h>
|
---|
399 | #ifdef HAVE_IEEEFP_H
|
---|
400 | #include <ieeefp.h>
|
---|
401 | #endif
|
---|
402 | ],
|
---|
403 | [ $1(0);],
|
---|
404 | [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
|
---|
405 | AC_LANG_RESTORE
|
---|
406 | ])
|
---|
407 | fi
|
---|
408 | AC_MSG_RESULT($glibcpp_cv_func_$1_use)
|
---|
409 | ])
|
---|
410 |
|
---|
411 | dnl
|
---|
412 | dnl Check to see if the (math function) argument passed is
|
---|
413 | dnl 1) declared when using the c++ compiler
|
---|
414 | dnl 2) has "C" linkage
|
---|
415 | dnl 3) if not, see if 1) and 2) for argument prepended with '_'
|
---|
416 | dnl
|
---|
417 | dnl Define HAVE_CARGF etc if "cargf" is declared and links
|
---|
418 | dnl
|
---|
419 | dnl argument 1 is name of function to check
|
---|
420 | dnl
|
---|
421 | dnl ASSUMES argument is a math function with ONE parameter
|
---|
422 | dnl
|
---|
423 | dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1
|
---|
424 | AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, [
|
---|
425 | GLIBCPP_CHECK_MATH_DECL_1($1)
|
---|
426 | if test x$glibcpp_cv_func_$1_use = x"yes"; then
|
---|
427 | AC_CHECK_FUNCS($1)
|
---|
428 | else
|
---|
429 | GLIBCPP_CHECK_MATH_DECL_1(_$1)
|
---|
430 | if test x$glibcpp_cv_func__$1_use = x"yes"; then
|
---|
431 | AC_CHECK_FUNCS(_$1)
|
---|
432 | fi
|
---|
433 | fi
|
---|
434 | ])
|
---|
435 |
|
---|
436 |
|
---|
437 | dnl
|
---|
438 | dnl Like GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1, but does a bunch of
|
---|
439 | dnl of functions at once. It's an all-or-nothing check -- either
|
---|
440 | dnl HAVE_XYZ is defined for each of the functions, or for none of them.
|
---|
441 | dnl Doing it this way saves significant configure time.
|
---|
442 | AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [
|
---|
443 | AC_MSG_CHECKING([for $1 functions])
|
---|
444 | AC_CACHE_VAL(glibcpp_cv_func_$2_use, [
|
---|
445 | AC_LANG_SAVE
|
---|
446 | AC_LANG_CPLUSPLUS
|
---|
447 | AC_TRY_COMPILE([#include <math.h>],
|
---|
448 | [ `for x in $3; do echo "$x (0);"; done` ],
|
---|
449 | [glibcpp_cv_func_$2_use=yes],
|
---|
450 | [glibcpp_cv_func_$2_use=no])
|
---|
451 | AC_LANG_RESTORE])
|
---|
452 | AC_MSG_RESULT($glibcpp_cv_func_$2_use)
|
---|
453 | if test x$glibcpp_cv_func_$2_use = x"yes"; then
|
---|
454 | AC_CHECK_FUNCS($3)
|
---|
455 | fi
|
---|
456 | ])
|
---|
457 |
|
---|
458 | dnl
|
---|
459 | dnl Check to see if the (math function) argument passed is
|
---|
460 | dnl declared when using the c++ compiler
|
---|
461 | dnl ASSUMES argument is a math function with TWO parameters
|
---|
462 | dnl
|
---|
463 | dnl GLIBCPP_CHECK_MATH_DECL_2
|
---|
464 | AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_2, [
|
---|
465 | AC_MSG_CHECKING([for $1 declaration])
|
---|
466 | if test x${glibcpp_cv_func_$1_use+set} != xset; then
|
---|
467 | AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
|
---|
468 | AC_LANG_SAVE
|
---|
469 | AC_LANG_CPLUSPLUS
|
---|
470 | AC_TRY_COMPILE([#include <math.h>],
|
---|
471 | [ $1(0, 0);],
|
---|
472 | [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
|
---|
473 | AC_LANG_RESTORE
|
---|
474 | ])
|
---|
475 | fi
|
---|
476 | AC_MSG_RESULT($glibcpp_cv_func_$1_use)
|
---|
477 | ])
|
---|
478 |
|
---|
479 | dnl
|
---|
480 | dnl Check to see if the (math function) argument passed is
|
---|
481 | dnl 1) declared when using the c++ compiler
|
---|
482 | dnl 2) has "C" linkage
|
---|
483 | dnl
|
---|
484 | dnl Define HAVE_CARGF etc if "cargf" is declared and links
|
---|
485 | dnl
|
---|
486 | dnl argument 1 is name of function to check
|
---|
487 | dnl
|
---|
488 | dnl ASSUMES argument is a math function with TWO parameters
|
---|
489 | dnl
|
---|
490 | dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2
|
---|
491 | AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2, [
|
---|
492 | GLIBCPP_CHECK_MATH_DECL_2($1)
|
---|
493 | if test x$glibcpp_cv_func_$1_use = x"yes"; then
|
---|
494 | AC_CHECK_FUNCS($1)
|
---|
495 | else
|
---|
496 | GLIBCPP_CHECK_MATH_DECL_2(_$1)
|
---|
497 | if test x$glibcpp_cv_func__$1_use = x"yes"; then
|
---|
498 | AC_CHECK_FUNCS(_$1)
|
---|
499 | fi
|
---|
500 | fi
|
---|
501 | ])
|
---|
502 |
|
---|
503 |
|
---|
504 | dnl
|
---|
505 | dnl Check to see if the (math function) argument passed is
|
---|
506 | dnl declared when using the c++ compiler
|
---|
507 | dnl ASSUMES argument is a math function with THREE parameters
|
---|
508 | dnl
|
---|
509 | dnl GLIBCPP_CHECK_MATH_DECL_3
|
---|
510 | AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_3, [
|
---|
511 | AC_MSG_CHECKING([for $1 declaration])
|
---|
512 | if test x${glibcpp_cv_func_$1_use+set} != xset; then
|
---|
513 | AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
|
---|
514 | AC_LANG_SAVE
|
---|
515 | AC_LANG_CPLUSPLUS
|
---|
516 | AC_TRY_COMPILE([#include <math.h>],
|
---|
517 | [ $1(0, 0, 0);],
|
---|
518 | [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
|
---|
519 | AC_LANG_RESTORE
|
---|
520 | ])
|
---|
521 | fi
|
---|
522 | AC_MSG_RESULT($glibcpp_cv_func_$1_use)
|
---|
523 | ])
|
---|
524 |
|
---|
525 | dnl
|
---|
526 | dnl Check to see if the (math function) argument passed is
|
---|
527 | dnl 1) declared when using the c++ compiler
|
---|
528 | dnl 2) has "C" linkage
|
---|
529 | dnl
|
---|
530 | dnl Define HAVE_CARGF etc if "cargf" is declared and links
|
---|
531 | dnl
|
---|
532 | dnl argument 1 is name of function to check
|
---|
533 | dnl
|
---|
534 | dnl ASSUMES argument is a math function with THREE parameters
|
---|
535 | dnl
|
---|
536 | dnl GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3
|
---|
537 | AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3, [
|
---|
538 | GLIBCPP_CHECK_MATH_DECL_3($1)
|
---|
539 | if test x$glibcpp_cv_func_$1_use = x"yes"; then
|
---|
540 | AC_CHECK_FUNCS($1)
|
---|
541 | else
|
---|
542 | GLIBCPP_CHECK_MATH_DECL_3(_$1)
|
---|
543 | if test x$glibcpp_cv_func__$1_use = x"yes"; then
|
---|
544 | AC_CHECK_FUNCS(_$1)
|
---|
545 | fi
|
---|
546 | fi
|
---|
547 | ])
|
---|
548 |
|
---|
549 |
|
---|
550 | dnl
|
---|
551 | dnl Check to see if the (stdlib function) argument passed is
|
---|
552 | dnl 1) declared when using the c++ compiler
|
---|
553 | dnl 2) has "C" linkage
|
---|
554 | dnl
|
---|
555 | dnl argument 1 is name of function to check
|
---|
556 | dnl
|
---|
557 | dnl ASSUMES argument is a math function with TWO parameters
|
---|
558 | dnl
|
---|
559 | dnl GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2
|
---|
560 | AC_DEFUN(GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2, [
|
---|
561 | AC_MSG_CHECKING([for $1 declaration])
|
---|
562 | if test x${glibcpp_cv_func_$1_use+set} != xset; then
|
---|
563 | AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
|
---|
564 | AC_LANG_SAVE
|
---|
565 | AC_LANG_CPLUSPLUS
|
---|
566 | AC_TRY_COMPILE([#include <stdlib.h>],
|
---|
567 | [ $1(0, 0);],
|
---|
568 | [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
|
---|
569 | AC_LANG_RESTORE
|
---|
570 | ])
|
---|
571 | fi
|
---|
572 | AC_MSG_RESULT($glibcpp_cv_func_$1_use)
|
---|
573 | if test x$glibcpp_cv_func_$1_use = x"yes"; then
|
---|
574 | AC_CHECK_FUNCS($1)
|
---|
575 | fi
|
---|
576 | ])
|
---|
577 |
|
---|
578 |
|
---|
579 | dnl
|
---|
580 | dnl Check to see if the (stdlib function) argument passed is
|
---|
581 | dnl 1) declared when using the c++ compiler
|
---|
582 | dnl 2) has "C" linkage
|
---|
583 | dnl
|
---|
584 | dnl argument 1 is name of function to check
|
---|
585 | dnl
|
---|
586 | dnl ASSUMES argument is a function with THREE parameters
|
---|
587 | dnl
|
---|
588 | dnl GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3
|
---|
589 | AC_DEFUN(GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3, [
|
---|
590 | AC_MSG_CHECKING([for $1 declaration])
|
---|
591 | if test x${glibcpp_cv_func_$1_use+set} != xset; then
|
---|
592 | AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
|
---|
593 | AC_LANG_SAVE
|
---|
594 | AC_LANG_CPLUSPLUS
|
---|
595 | AC_TRY_COMPILE([#include <stdlib.h>],
|
---|
596 | [ $1(0, 0, 0);],
|
---|
597 | [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
|
---|
598 | AC_LANG_RESTORE
|
---|
599 | ])
|
---|
600 | fi
|
---|
601 | AC_MSG_RESULT($glibcpp_cv_func_$1_use)
|
---|
602 | if test x$glibcpp_cv_func_$1_use = x"yes"; then
|
---|
603 | AC_CHECK_FUNCS($1)
|
---|
604 | fi
|
---|
605 | ])
|
---|
606 |
|
---|
607 | dnl
|
---|
608 | dnl Check to see if the (unistd function) argument passed is
|
---|
609 | dnl 1) declared when using the c++ compiler
|
---|
610 | dnl 2) has "C" linkage
|
---|
611 | dnl
|
---|
612 | dnl argument 1 is name of function to check
|
---|
613 | dnl
|
---|
614 | dnl ASSUMES argument is a function with ONE parameter
|
---|
615 | dnl
|
---|
616 | dnl GLIBCPP_CHECK_UNISTD_DECL_AND_LINKAGE_1
|
---|
617 | AC_DEFUN(GLIBCPP_CHECK_UNISTD_DECL_AND_LINKAGE_1, [
|
---|
618 | AC_MSG_CHECKING([for $1 declaration])
|
---|
619 | if test x${glibcpp_cv_func_$1_use+set} != xset; then
|
---|
620 | AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
|
---|
621 | AC_LANG_SAVE
|
---|
622 | AC_LANG_CPLUSPLUS
|
---|
623 | AC_TRY_COMPILE([#include <unistd.h>],
|
---|
624 | [ $1(0);],
|
---|
625 | [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
|
---|
626 | AC_LANG_RESTORE
|
---|
627 | ])
|
---|
628 | fi
|
---|
629 | AC_MSG_RESULT($glibcpp_cv_func_$1_use)
|
---|
630 | if test x$glibcpp_cv_func_$1_use = x"yes"; then
|
---|
631 | AC_CHECK_FUNCS($1)
|
---|
632 | fi
|
---|
633 | ])
|
---|
634 |
|
---|
635 | dnl
|
---|
636 | dnl Because the builtins are picky picky picky about the arguments they take,
|
---|
637 | dnl do an explict linkage tests here.
|
---|
638 | dnl Check to see if the (math function) argument passed is
|
---|
639 | dnl 1) declared when using the c++ compiler
|
---|
640 | dnl 2) has "C" linkage
|
---|
641 | dnl
|
---|
642 | dnl Define HAVE_CARGF etc if "cargf" is declared and links
|
---|
643 | dnl
|
---|
644 | dnl argument 1 is name of function to check
|
---|
645 | dnl
|
---|
646 | dnl ASSUMES argument is a math function with ONE parameter
|
---|
647 | dnl
|
---|
648 | dnl GLIBCPP_CHECK_BUILTIN_MATH_DECL_LINKAGE_1
|
---|
649 | AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1, [
|
---|
650 | AC_MSG_CHECKING([for $1 declaration])
|
---|
651 | if test x${glibcpp_cv_func_$1_use+set} != xset; then
|
---|
652 | AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
|
---|
653 | AC_LANG_SAVE
|
---|
654 | AC_LANG_CPLUSPLUS
|
---|
655 | AC_TRY_COMPILE([#include <math.h>],
|
---|
656 | [ $1(0);],
|
---|
657 | [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
|
---|
658 | AC_LANG_RESTORE
|
---|
659 | ])
|
---|
660 | fi
|
---|
661 | AC_MSG_RESULT($glibcpp_cv_func_$1_use)
|
---|
662 | if test x$glibcpp_cv_func_$1_use = x"yes"; then
|
---|
663 | AC_MSG_CHECKING([for $1 linkage])
|
---|
664 | if test x${glibcpp_cv_func_$1_link+set} != xset; then
|
---|
665 | AC_CACHE_VAL(glibcpp_cv_func_$1_link, [
|
---|
666 | AC_TRY_LINK([#include <math.h>],
|
---|
667 | [ $1(0);],
|
---|
668 | [glibcpp_cv_func_$1_link=yes], [glibcpp_cv_func_$1_link=no])
|
---|
669 | ])
|
---|
670 | fi
|
---|
671 | AC_MSG_RESULT($glibcpp_cv_func_$1_link)
|
---|
672 | if test x$glibcpp_cv_func_$1_link = x"yes"; then
|
---|
673 | ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
|
---|
674 | AC_DEFINE_UNQUOTED(${ac_tr_func})
|
---|
675 | fi
|
---|
676 | fi
|
---|
677 | ])
|
---|
678 |
|
---|
679 |
|
---|
680 | dnl
|
---|
681 | dnl Check to see what builtin math functions are supported
|
---|
682 | dnl
|
---|
683 | dnl check for __builtin_abs
|
---|
684 | dnl check for __builtin_fabsf
|
---|
685 | dnl check for __builtin_fabs
|
---|
686 | dnl check for __builtin_fabl
|
---|
687 | dnl check for __builtin_labs
|
---|
688 | dnl check for __builtin_sqrtf
|
---|
689 | dnl check for __builtin_sqrtl
|
---|
690 | dnl check for __builtin_sqrt
|
---|
691 | dnl check for __builtin_sinf
|
---|
692 | dnl check for __builtin_sin
|
---|
693 | dnl check for __builtin_sinl
|
---|
694 | dnl check for __builtin_cosf
|
---|
695 | dnl check for __builtin_cos
|
---|
696 | dnl check for __builtin_cosl
|
---|
697 | dnl
|
---|
698 | dnl GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
|
---|
699 | AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [
|
---|
700 | dnl Test for builtin math functions.
|
---|
701 | dnl These are made in gcc/c-common.c
|
---|
702 | GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_abs)
|
---|
703 | GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsf)
|
---|
704 | GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabs)
|
---|
705 | GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsl)
|
---|
706 | GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_labs)
|
---|
707 |
|
---|
708 | GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtf)
|
---|
709 | GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrt)
|
---|
710 | GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtl)
|
---|
711 |
|
---|
712 | GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinf)
|
---|
713 | GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sin)
|
---|
714 | GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinl)
|
---|
715 |
|
---|
716 | GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosf)
|
---|
717 | GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cos)
|
---|
718 | GLIBCPP_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosl)
|
---|
719 |
|
---|
720 | dnl There is, without a doubt, a more elegant way to have these
|
---|
721 | dnl names exported so that they won't be stripped out of acconfig.h by
|
---|
722 | dnl autoheader. I leave this as an exercise to somebody less frustrated
|
---|
723 | dnl than I.... please email the libstdc++ list if you can figure out a
|
---|
724 | dnl more elegant approach (see autoconf/acgen.m4 and specifically
|
---|
725 | dnl AC_CHECK_FUNC for things to steal.)
|
---|
726 | dummyvar=no
|
---|
727 | if test x$dummyvar = x"yes"; then
|
---|
728 | AC_DEFINE(HAVE___BUILTIN_ABS)
|
---|
729 | AC_DEFINE(HAVE___BUILTIN_LABS)
|
---|
730 | AC_DEFINE(HAVE___BUILTIN_COS)
|
---|
731 | AC_DEFINE(HAVE___BUILTIN_COSF)
|
---|
732 | AC_DEFINE(HAVE___BUILTIN_COSL)
|
---|
733 | AC_DEFINE(HAVE___BUILTIN_FABS)
|
---|
734 | AC_DEFINE(HAVE___BUILTIN_FABSF)
|
---|
735 | AC_DEFINE(HAVE___BUILTIN_FABSL)
|
---|
736 | AC_DEFINE(HAVE___BUILTIN_SIN)
|
---|
737 | AC_DEFINE(HAVE___BUILTIN_SINF)
|
---|
738 | AC_DEFINE(HAVE___BUILTIN_SINL)
|
---|
739 | AC_DEFINE(HAVE___BUILTIN_SQRT)
|
---|
740 | AC_DEFINE(HAVE___BUILTIN_SQRTF)
|
---|
741 | AC_DEFINE(HAVE___BUILTIN_SQRTL)
|
---|
742 | fi
|
---|
743 | ])
|
---|
744 |
|
---|
745 | dnl
|
---|
746 | dnl Check to see what the underlying c library is like
|
---|
747 | dnl These checks need to do two things:
|
---|
748 | dnl 1) make sure the name is declared when using the c++ compiler
|
---|
749 | dnl 2) make sure the name has "C" linkage
|
---|
750 | dnl This might seem like overkill but experience has shown that it's not...
|
---|
751 | dnl
|
---|
752 | dnl Define HAVE_STRTOLD if "strtold" is declared and links
|
---|
753 | dnl Define HAVE_STRTOF if "strtof" is declared and links
|
---|
754 | dnl Define HAVE_DRAND48 if "drand48" is declared and links
|
---|
755 | dnl
|
---|
756 | dnl GLIBCPP_CHECK_STDLIB_SUPPORT
|
---|
757 | AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [
|
---|
758 | ac_test_CXXFLAGS="${CXXFLAGS+set}"
|
---|
759 | ac_save_CXXFLAGS="$CXXFLAGS"
|
---|
760 | CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
|
---|
761 |
|
---|
762 | GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
|
---|
763 | GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtof)
|
---|
764 | AC_CHECK_FUNCS(drand48)
|
---|
765 |
|
---|
766 | CXXFLAGS="$ac_save_CXXFLAGS"
|
---|
767 | ])
|
---|
768 |
|
---|
769 | dnl
|
---|
770 | dnl Check to see what the underlying c library is like
|
---|
771 | dnl These checks need to do two things:
|
---|
772 | dnl 1) make sure the name is declared when using the c++ compiler
|
---|
773 | dnl 2) make sure the name has "C" linkage
|
---|
774 | dnl This might seem like overkill but experience has shown that it's not...
|
---|
775 | dnl
|
---|
776 | dnl Define HAVE_ISATTY if "isatty" is declared and links
|
---|
777 | dnl
|
---|
778 | dnl GLIBCPP_CHECK_UNISTD_SUPPORT
|
---|
779 | AC_DEFUN(GLIBCPP_CHECK_UNISTD_SUPPORT, [
|
---|
780 | ac_test_CXXFLAGS="${CXXFLAGS+set}"
|
---|
781 | ac_save_CXXFLAGS="$CXXFLAGS"
|
---|
782 | CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
|
---|
783 |
|
---|
784 | GLIBCPP_CHECK_UNISTD_DECL_AND_LINKAGE_1(isatty)
|
---|
785 |
|
---|
786 | CXXFLAGS="$ac_save_CXXFLAGS"
|
---|
787 | ])
|
---|
788 |
|
---|
789 | dnl
|
---|
790 | dnl Check to see what the underlying c library or math library is like.
|
---|
791 | dnl These checks need to do two things:
|
---|
792 | dnl 1) make sure the name is declared when using the c++ compiler
|
---|
793 | dnl 2) make sure the name has "C" linkage
|
---|
794 | dnl This might seem like overkill but experience has shown that it's not...
|
---|
795 | dnl
|
---|
796 | dnl Define HAVE_CARGF etc if "cargf" is found.
|
---|
797 | dnl
|
---|
798 | dnl GLIBCPP_CHECK_MATH_SUPPORT
|
---|
799 | AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
|
---|
800 | ac_test_CXXFLAGS="${CXXFLAGS+set}"
|
---|
801 | ac_save_CXXFLAGS="$CXXFLAGS"
|
---|
802 | CXXFLAGS='-fno-builtin -D_GNU_SOURCE'
|
---|
803 |
|
---|
804 | dnl Check libm
|
---|
805 | AC_CHECK_LIB(m, sin, libm="-lm")
|
---|
806 | ac_save_LIBS="$LIBS"
|
---|
807 | LIBS="$LIBS $libm"
|
---|
808 |
|
---|
809 | dnl Check to see if certain C math functions exist.
|
---|
810 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinf)
|
---|
811 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnan)
|
---|
812 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finite)
|
---|
813 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysign)
|
---|
814 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincos)
|
---|
815 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fpclass)
|
---|
816 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(qfpclass)
|
---|
817 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypot)
|
---|
818 |
|
---|
819 | dnl Check to see if basic C math functions have float versions.
|
---|
820 | GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float trig,
|
---|
821 | float_trig,
|
---|
822 | acosf asinf atanf \
|
---|
823 | cosf sinf tanf \
|
---|
824 | coshf sinhf tanhf)
|
---|
825 | GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float round,
|
---|
826 | float_round,
|
---|
827 | ceilf floorf)
|
---|
828 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(expf)
|
---|
829 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf)
|
---|
830 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinff)
|
---|
831 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2f)
|
---|
832 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsf)
|
---|
833 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodf)
|
---|
834 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpf)
|
---|
835 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypotf)
|
---|
836 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpf)
|
---|
837 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logf)
|
---|
838 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10f)
|
---|
839 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modff)
|
---|
840 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powf)
|
---|
841 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtf)
|
---|
842 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosf)
|
---|
843 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitef)
|
---|
844 |
|
---|
845 | dnl Check to see if basic C math functions have long double versions.
|
---|
846 | GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double trig,
|
---|
847 | long_double_trig,
|
---|
848 | acosl asinl atanl \
|
---|
849 | cosl sinl tanl \
|
---|
850 | coshl sinhl tanhl)
|
---|
851 | GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(long double round,
|
---|
852 | long_double_round,
|
---|
853 | ceill floorl)
|
---|
854 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanl)
|
---|
855 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinfl)
|
---|
856 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(copysignl)
|
---|
857 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2l)
|
---|
858 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(expl)
|
---|
859 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsl)
|
---|
860 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodl)
|
---|
861 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpl)
|
---|
862 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypotl)
|
---|
863 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpl)
|
---|
864 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logl)
|
---|
865 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10l)
|
---|
866 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(modfl)
|
---|
867 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(powl)
|
---|
868 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtl)
|
---|
869 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincosl)
|
---|
870 | GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(finitel)
|
---|
871 |
|
---|
872 | dnl Some runtimes have these functions with a preceding underscore. Please
|
---|
873 | dnl keep this sync'd with the one above. And if you add any new symbol,
|
---|
874 | dnl please add the corresponding block in the @BOTTOM@ section of acconfig.h.
|
---|
875 | dnl Check to see if certain C math functions exist.
|
---|
876 |
|
---|
877 | dnl Check to see if basic C math functions have float versions.
|
---|
878 | GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float trig,
|
---|
879 | _float_trig,
|
---|
880 | _acosf _asinf _atanf \
|
---|
881 | _cosf _sinf _tanf \
|
---|
882 | _coshf _sinhf _tanhf)
|
---|
883 | GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_float round,
|
---|
884 | _float_round,
|
---|
885 | _ceilf _floorf)
|
---|
886 |
|
---|
887 | dnl Check to see if basic C math functions have long double versions.
|
---|
888 | GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double trig,
|
---|
889 | _long_double_trig,
|
---|
890 | _acosl _asinl _atanl \
|
---|
891 | _cosl _sinl _tanl \
|
---|
892 | _coshl _sinhl _tanhl)
|
---|
893 | GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double round,
|
---|
894 | _long_double_round,
|
---|
895 | _ceill _floorl)
|
---|
896 |
|
---|
897 | LIBS="$ac_save_LIBS"
|
---|
898 | CXXFLAGS="$ac_save_CXXFLAGS"
|
---|
899 | ])
|
---|
900 |
|
---|
901 |
|
---|
902 | dnl
|
---|
903 | dnl Check to see if there is native support for complex
|
---|
904 | dnl
|
---|
905 | dnl Don't compile bits in math/* if native support exits.
|
---|
906 | dnl
|
---|
907 | dnl Define USE_COMPLEX_LONG_DOUBLE etc if "copysignl" is found.
|
---|
908 | dnl
|
---|
909 | dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
|
---|
910 | AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
|
---|
911 | dnl Check for complex versions of math functions of platform.
|
---|
912 | AC_CHECK_LIB(m, main)
|
---|
913 | AC_REPLACE_MATHFUNCS(nan copysignf)
|
---|
914 |
|
---|
915 | dnl For __signbit to signbit conversions.
|
---|
916 | AC_CHECK_FUNCS([__signbit], , [LIBMATHOBJS="$LIBMATHOBJS signbit.lo"])
|
---|
917 | AC_CHECK_FUNCS([__signbitf], , [LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"])
|
---|
918 |
|
---|
919 | dnl Compile the long double complex functions only if the function
|
---|
920 | dnl provides the non-complex long double functions that are needed.
|
---|
921 | dnl Currently this includes copysignl, which should be
|
---|
922 | dnl cached from the GLIBCPP_CHECK_MATH_SUPPORT macro, above.
|
---|
923 | if test x$ac_cv_func_copysignl = x"yes"; then
|
---|
924 | AC_CHECK_FUNCS([__signbitl], , [LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"])
|
---|
925 | fi
|
---|
926 |
|
---|
927 | if test -n "$LIBMATHOBJS"; then
|
---|
928 | need_libmath=yes
|
---|
929 | fi
|
---|
930 | AC_SUBST(LIBMATHOBJS)
|
---|
931 | AM_CONDITIONAL(GLIBCPP_BUILD_LIBMATH, test "$need_libmath" = yes)
|
---|
932 | ])
|
---|
933 |
|
---|
934 |
|
---|
935 | dnl Check to see what architecture and operating system we are compiling
|
---|
936 | dnl for. Also, if architecture- or OS-specific flags are required for
|
---|
937 | dnl compilation, pick them up here.
|
---|
938 | dnl
|
---|
939 | dnl GLIBCPP_CHECK_TARGET
|
---|
940 | AC_DEFUN(GLIBCPP_CHECK_TARGET, [
|
---|
941 | . [$]{glibcpp_basedir}/configure.target
|
---|
942 | AC_MSG_RESULT(CPU config directory is $cpu_include_dir)
|
---|
943 | AC_MSG_RESULT(OS config directory is $os_include_dir)
|
---|
944 | ])
|
---|
945 |
|
---|
946 |
|
---|
947 | dnl
|
---|
948 | dnl Check to see if this target can enable the wchar_t parts of libstdc++.
|
---|
949 | dnl If --disable-c-mbchar was given, no wchar_t stuff is enabled. (This
|
---|
950 | dnl must have been previously checked.)
|
---|
951 | dnl
|
---|
952 | dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found
|
---|
953 | dnl Define HAVE_MBSTATE_T if mbstate_t is not in wchar.h
|
---|
954 | dnl
|
---|
955 | dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
|
---|
956 | AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
|
---|
957 | dnl Wide characters disabled by default.
|
---|
958 | enable_wchar_t=no
|
---|
959 |
|
---|
960 | dnl Test wchar.h for mbstate_t, which is needed for char_traits and
|
---|
961 | dnl others even if wchar_t support is not on.
|
---|
962 | AC_MSG_CHECKING([for mbstate_t])
|
---|
963 | AC_TRY_COMPILE([#include <wchar.h>],
|
---|
964 | [mbstate_t teststate;],
|
---|
965 | have_mbstate_t=yes, have_mbstate_t=no)
|
---|
966 | AC_MSG_RESULT($have_mbstate_t)
|
---|
967 | if test x"$have_mbstate_t" = xyes; then
|
---|
968 | AC_DEFINE(HAVE_MBSTATE_T)
|
---|
969 | fi
|
---|
970 |
|
---|
971 | dnl Sanity check for existence of ISO C99 headers for extended encoding.
|
---|
972 | AC_CHECK_HEADERS(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
|
---|
973 | AC_CHECK_HEADERS(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
|
---|
974 |
|
---|
975 | dnl Only continue checking if the ISO C99 headers exist and support is on.
|
---|
976 | if test x"$ac_has_wchar_h" = xyes &&
|
---|
977 | test x"$ac_has_wctype_h" = xyes &&
|
---|
978 | test x"$enable_c_mbchar" != xno; then
|
---|
979 |
|
---|
980 | dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
|
---|
981 | dnl numeric_limits can instantiate type_traits<wchar_t>
|
---|
982 | AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
|
---|
983 | AC_TRY_COMPILE([#include <wchar.h>],
|
---|
984 | [int i = WCHAR_MIN; int j = WCHAR_MAX;],
|
---|
985 | has_wchar_minmax=yes, has_wchar_minmax=no)
|
---|
986 | AC_MSG_RESULT($has_wchar_minmax)
|
---|
987 |
|
---|
988 | dnl Test wchar.h for WEOF, which is what we use to determine whether
|
---|
989 | dnl to specialize for char_traits<wchar_t> or not.
|
---|
990 | AC_MSG_CHECKING([for WEOF])
|
---|
991 | AC_TRY_COMPILE([
|
---|
992 | #include <wchar.h>
|
---|
993 | #include <stddef.h>],
|
---|
994 | [wint_t i = WEOF;],
|
---|
995 | has_weof=yes, has_weof=no)
|
---|
996 | AC_MSG_RESULT($has_weof)
|
---|
997 |
|
---|
998 | dnl Tests for wide character functions used in char_traits<wchar_t>.
|
---|
999 | ac_wfuncs=yes
|
---|
1000 | AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset,, \
|
---|
1001 | ac_wfuncs=no)
|
---|
1002 |
|
---|
1003 | dnl Checks for names injected into std:: by the c_std headers.
|
---|
1004 | AC_CHECK_FUNCS(btowc wctob fgetwc fgetws fputwc fputws fwide \
|
---|
1005 | fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
|
---|
1006 | vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
|
---|
1007 | mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
|
---|
1008 | wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
|
---|
1009 | wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr,, \
|
---|
1010 | ac_wfuncs=no)
|
---|
1011 |
|
---|
1012 | AC_MSG_CHECKING([for ISO C99 wchar_t support])
|
---|
1013 | if test x"$has_weof" = xyes &&
|
---|
1014 | test x"$has_wchar_minmax" = xyes &&
|
---|
1015 | test x"$ac_wfuncs" = xyes; then
|
---|
1016 | ac_isoC99_wchar_t=yes
|
---|
1017 | else
|
---|
1018 | ac_isoC99_wchar_t=no
|
---|
1019 | fi
|
---|
1020 | AC_MSG_RESULT($ac_isoC99_wchar_t)
|
---|
1021 |
|
---|
1022 | dnl Use iconv for wchar_t to char conversions. As such, check for
|
---|
1023 | dnl X/Open Portability Guide, version 2 features (XPG2).
|
---|
1024 | AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
|
---|
1025 | AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
|
---|
1026 |
|
---|
1027 | dnl Check for existence of libiconv.a providing XPG2 wchar_t support.
|
---|
1028 | AC_CHECK_LIB(iconv, iconv, libiconv="-liconv")
|
---|
1029 | ac_save_LIBS="$LIBS"
|
---|
1030 | LIBS="$LIBS $libiconv"
|
---|
1031 |
|
---|
1032 | AC_CHECK_FUNCS(iconv_open iconv_close iconv nl_langinfo, \
|
---|
1033 | ac_XPG2funcs=yes, ac_XPG2funcs=no)
|
---|
1034 |
|
---|
1035 | LIBS="$ac_save_LIBS"
|
---|
1036 |
|
---|
1037 | AC_MSG_CHECKING([for XPG2 wchar_t support])
|
---|
1038 | if test x"$ac_has_iconv_h" = xyes &&
|
---|
1039 | test x"$ac_has_langinfo_h" = xyes &&
|
---|
1040 | test x"$ac_XPG2funcs" = xyes; then
|
---|
1041 | ac_XPG2_wchar_t=yes
|
---|
1042 | else
|
---|
1043 | ac_XPG2_wchar_t=no
|
---|
1044 | fi
|
---|
1045 | AC_MSG_RESULT($ac_XPG2_wchar_t)
|
---|
1046 |
|
---|
1047 | dnl At the moment, only enable wchar_t specializations if all the
|
---|
1048 | dnl above support is present.
|
---|
1049 | if test x"$ac_isoC99_wchar_t" = xyes &&
|
---|
1050 | test x"$ac_XPG2_wchar_t" = xyes; then
|
---|
1051 | AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
|
---|
1052 | enable_wchar_t=yes
|
---|
1053 | fi
|
---|
1054 | fi
|
---|
1055 | AC_MSG_CHECKING([for enabled wchar_t specializations])
|
---|
1056 | AC_MSG_RESULT($enable_wchar_t)
|
---|
1057 | AM_CONDITIONAL(GLIBCPP_TEST_WCHAR_T, test "$enable_wchar_t" = yes)
|
---|
1058 | ])
|
---|
1059 |
|
---|
1060 |
|
---|
1061 | dnl
|
---|
1062 | dnl Check to see if debugging libraries are to be built.
|
---|
1063 | dnl
|
---|
1064 | dnl GLIBCPP_ENABLE_DEBUG
|
---|
1065 | dnl
|
---|
1066 | dnl --enable-debug
|
---|
1067 | dnl builds a separate set of debugging libraries in addition to the
|
---|
1068 | dnl normal (shared, static) libstdc++ binaries.
|
---|
1069 | dnl
|
---|
1070 | dnl --disable-debug
|
---|
1071 | dnl builds only one (non-debug) version of libstdc++.
|
---|
1072 | dnl
|
---|
1073 | dnl --enable-debug-flags=FLAGS
|
---|
1074 | dnl iff --enable-debug == yes, then use FLAGS to build the debug library.
|
---|
1075 | dnl
|
---|
1076 | dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)]
|
---|
1077 | dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
|
---|
1078 | dnl defaults to `no'.
|
---|
1079 | AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl
|
---|
1080 | define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
|
---|
1081 | AC_ARG_ENABLE(debug,
|
---|
1082 | changequote(<<, >>)dnl
|
---|
1083 | << --enable-debug build extra debug library [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
|
---|
1084 | changequote([, ])dnl
|
---|
1085 | [case "${enableval}" in
|
---|
1086 | yes) enable_debug=yes ;;
|
---|
1087 | no) enable_debug=no ;;
|
---|
1088 | *) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
|
---|
1089 | esac],
|
---|
1090 | enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
|
---|
1091 | AC_MSG_CHECKING([for additional debug build])
|
---|
1092 | AC_MSG_RESULT($enable_debug)
|
---|
1093 | AM_CONDITIONAL(GLIBCPP_BUILD_DEBUG, test "$enable_debug" = yes)
|
---|
1094 | ])
|
---|
1095 |
|
---|
1096 |
|
---|
1097 | dnl Check for explicit debug flags.
|
---|
1098 | dnl
|
---|
1099 | dnl GLIBCPP_ENABLE_DEBUG_FLAGS
|
---|
1100 | dnl
|
---|
1101 | dnl --enable-debug-flags='-O1'
|
---|
1102 | dnl is a general method for passing flags to be used when
|
---|
1103 | dnl building debug libraries with --enable-debug.
|
---|
1104 | dnl
|
---|
1105 | dnl --disable-debug-flags does nothing.
|
---|
1106 | dnl + Usage: GLIBCPP_ENABLE_DEBUG_FLAGS(default flags)
|
---|
1107 | dnl If "default flags" is an empty string (or "none"), the effect is
|
---|
1108 | dnl the same as --disable or --enable=no.
|
---|
1109 | AC_DEFUN(GLIBCPP_ENABLE_DEBUG_FLAGS, [dnl
|
---|
1110 | define([GLIBCPP_ENABLE_DEBUG_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
|
---|
1111 | AC_ARG_ENABLE(debug_flags,
|
---|
1112 | changequote(<<, >>)dnl
|
---|
1113 | << --enable-debug-flags=FLAGS pass compiler FLAGS when building debug
|
---|
1114 | library;[default=>>GLIBCPP_ENABLE_DEBUG_FLAGS_DEFAULT],
|
---|
1115 | changequote([, ])dnl
|
---|
1116 | [case "${enableval}" in
|
---|
1117 | none) ;;
|
---|
1118 | -*) enable_debug_flags="${enableval}" ;;
|
---|
1119 | *) AC_MSG_ERROR([Unknown argument to extra debugging flags]) ;;
|
---|
1120 | esac],
|
---|
1121 | enable_debug_flags=GLIBCPP_ENABLE_DEBUG_FLAGS_DEFAULT)dnl
|
---|
1122 |
|
---|
1123 | dnl Option parsed, now set things appropriately
|
---|
1124 | case x"$enable_debug" in
|
---|
1125 | xyes)
|
---|
1126 | case "$enable_debug_flags" in
|
---|
1127 | none)
|
---|
1128 | DEBUG_FLAGS="-g3 -O0";;
|
---|
1129 | -*) #valid input
|
---|
1130 | DEBUG_FLAGS="${enableval}"
|
---|
1131 | esac
|
---|
1132 | ;;
|
---|
1133 | xno)
|
---|
1134 | DEBUG_FLAGS=""
|
---|
1135 | ;;
|
---|
1136 | esac
|
---|
1137 | AC_SUBST(DEBUG_FLAGS)
|
---|
1138 |
|
---|
1139 | AC_MSG_CHECKING([for debug build flags])
|
---|
1140 | AC_MSG_RESULT($DEBUG_FLAGS)
|
---|
1141 | ])
|
---|
1142 |
|
---|
1143 |
|
---|
1144 | dnl
|
---|
1145 | dnl Check for "unusual" flags to pass to the compiler while building.
|
---|
1146 | dnl
|
---|
1147 | dnl GLIBCPP_ENABLE_CXX_FLAGS
|
---|
1148 | dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
|
---|
1149 | dnl experimental flags such as -fhonor-std, -fsquangle, -Dfloat=char, etc.
|
---|
1150 | dnl Somehow this same set of flags must be passed when [re]building
|
---|
1151 | dnl libgcc.
|
---|
1152 | dnl --disable-cxx-flags passes nothing.
|
---|
1153 | dnl + See http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00131.html
|
---|
1154 | dnl http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00284.html
|
---|
1155 | dnl http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00035.html
|
---|
1156 | dnl + Usage: GLIBCPP_ENABLE_CXX_FLAGS(default flags)
|
---|
1157 | dnl If "default flags" is an empty string (or "none"), the effect is
|
---|
1158 | dnl the same as --disable or --enable=no.
|
---|
1159 | AC_DEFUN(GLIBCPP_ENABLE_CXX_FLAGS, [dnl
|
---|
1160 | define([GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
|
---|
1161 | AC_MSG_CHECKING([for extra compiler flags for building])
|
---|
1162 | AC_ARG_ENABLE(cxx_flags,
|
---|
1163 | changequote(<<, >>)dnl
|
---|
1164 | << --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
|
---|
1165 | [default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
|
---|
1166 | changequote([, ])dnl
|
---|
1167 | [case "x$enable_cxx_flags" in
|
---|
1168 | xyes)
|
---|
1169 | AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
|
---|
1170 | xno | xnone | x)
|
---|
1171 | enable_cxx_flags='' ;;
|
---|
1172 | *)
|
---|
1173 | enable_cxx_flags="$enableval" ;;
|
---|
1174 | esac],
|
---|
1175 | enable_cxx_flags=GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT)
|
---|
1176 |
|
---|
1177 | dnl Run through flags (either default or command-line) and set anything
|
---|
1178 | dnl extra (e.g., #defines) that must accompany particular g++ options.
|
---|
1179 | if test -n "$enable_cxx_flags"; then
|
---|
1180 | for f in $enable_cxx_flags; do
|
---|
1181 | case "$f" in
|
---|
1182 | -fhonor-std) ;;
|
---|
1183 | -*) ;;
|
---|
1184 | *) # and we're trying to pass /what/ exactly?
|
---|
1185 | AC_MSG_ERROR([compiler flags start with a -]) ;;
|
---|
1186 | esac
|
---|
1187 | done
|
---|
1188 | fi
|
---|
1189 | EXTRA_CXX_FLAGS="$enable_cxx_flags"
|
---|
1190 | AC_MSG_RESULT($EXTRA_CXX_FLAGS)
|
---|
1191 | AC_SUBST(EXTRA_CXX_FLAGS)
|
---|
1192 | ])
|
---|
1193 |
|
---|
1194 |
|
---|
1195 | dnl
|
---|
1196 | dnl Check for which locale library to use: gnu or generic.
|
---|
1197 | dnl
|
---|
1198 | dnl GLIBCPP_ENABLE_CLOCALE
|
---|
1199 | dnl --enable-clocale=gnu sets config/locale/c_locale_gnu.cc and friends
|
---|
1200 | dnl --enable-clocale=generic sets config/locale/c_locale_generic.cc and friends
|
---|
1201 | dnl
|
---|
1202 | dnl default is generic
|
---|
1203 | dnl
|
---|
1204 | AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
|
---|
1205 | AC_MSG_CHECKING([for clocale to use])
|
---|
1206 | AC_ARG_ENABLE(clocale,
|
---|
1207 | [ --enable-clocale enable model for target locale package.
|
---|
1208 | --enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
|
---|
1209 | ],
|
---|
1210 | if test x$enable_clocale = xno; then
|
---|
1211 | enable_clocale=no
|
---|
1212 | fi,
|
---|
1213 | enable_clocale=no)
|
---|
1214 |
|
---|
1215 | enable_clocale_flag=$enable_clocale
|
---|
1216 |
|
---|
1217 | dnl Probe for locale support if no specific model is specified.
|
---|
1218 | dnl Default to "generic"
|
---|
1219 | if test x$enable_clocale_flag = xno; then
|
---|
1220 | case x${target_os} in
|
---|
1221 | xlinux* | xgnu*)
|
---|
1222 | AC_EGREP_CPP([_GLIBCPP_ok], [
|
---|
1223 | #include <features.h>
|
---|
1224 | #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
|
---|
1225 | _GLIBCPP_ok
|
---|
1226 | #endif
|
---|
1227 | ], enable_clocale_flag=gnu, enable_clocale_flag=generic)
|
---|
1228 |
|
---|
1229 | # Test for bugs early in glibc-2.2.x series
|
---|
1230 | if test x$enable_clocale_flag = xgnu; then
|
---|
1231 | AC_TRY_RUN([
|
---|
1232 | #define _GNU_SOURCE 1
|
---|
1233 | #include <locale.h>
|
---|
1234 | #include <string.h>
|
---|
1235 | #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
|
---|
1236 | extern __typeof(newlocale) __newlocale;
|
---|
1237 | extern __typeof(duplocale) __duplocale;
|
---|
1238 | extern __typeof(strcoll_l) __strcoll_l;
|
---|
1239 | #endif
|
---|
1240 | int main()
|
---|
1241 | {
|
---|
1242 | const char __one[] = "Äuglein Augmen";
|
---|
1243 | const char __two[] = "Äuglein";
|
---|
1244 | int i;
|
---|
1245 | int j;
|
---|
1246 | __locale_t loc;
|
---|
1247 | __locale_t loc_dup;
|
---|
1248 | loc = __newlocale(1 << LC_ALL, "de_DE", 0);
|
---|
1249 | loc_dup = __duplocale(loc);
|
---|
1250 | i = __strcoll_l(__one, __two, loc);
|
---|
1251 | j = __strcoll_l(__one, __two, loc_dup);
|
---|
1252 | return 0;
|
---|
1253 | }
|
---|
1254 | ],
|
---|
1255 | [enable_clocale_flag=gnu],[enable_clocale_flag=generic],
|
---|
1256 | [enable_clocale_flag=generic])
|
---|
1257 | fi
|
---|
1258 |
|
---|
1259 | # ... at some point put __strxfrm_l tests in as well.
|
---|
1260 | ;;
|
---|
1261 | *)
|
---|
1262 | enable_clocale_flag=generic
|
---|
1263 | ;;
|
---|
1264 | esac
|
---|
1265 | fi
|
---|
1266 |
|
---|
1267 | dnl Deal with gettext issues.
|
---|
1268 | AC_ARG_ENABLE(nls,
|
---|
1269 | [ --enable-nls use Native Language Support (default)],
|
---|
1270 | , enable_nls=yes)
|
---|
1271 | USE_NLS=no
|
---|
1272 |
|
---|
1273 | dnl Set configure bits for specified locale package
|
---|
1274 | case x${enable_clocale_flag} in
|
---|
1275 | xgeneric)
|
---|
1276 | AC_MSG_RESULT(generic)
|
---|
1277 |
|
---|
1278 | CLOCALE_H=config/locale/generic/c_locale.h
|
---|
1279 | CLOCALE_CC=config/locale/generic/c_locale.cc
|
---|
1280 | CCODECVT_H=config/locale/generic/codecvt_specializations.h
|
---|
1281 | CCODECVT_CC=config/locale/generic/codecvt_members.cc
|
---|
1282 | CCOLLATE_CC=config/locale/generic/collate_members.cc
|
---|
1283 | CCTYPE_CC=config/locale/generic/ctype_members.cc
|
---|
1284 | CMESSAGES_H=config/locale/generic/messages_members.h
|
---|
1285 | CMESSAGES_CC=config/locale/generic/messages_members.cc
|
---|
1286 | CMONEY_CC=config/locale/generic/monetary_members.cc
|
---|
1287 | CNUMERIC_CC=config/locale/generic/numeric_members.cc
|
---|
1288 | CTIME_H=config/locale/generic/time_members.h
|
---|
1289 | CTIME_CC=config/locale/generic/time_members.cc
|
---|
1290 | CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
|
---|
1291 | ;;
|
---|
1292 | xgnu)
|
---|
1293 | AC_MSG_RESULT(gnu)
|
---|
1294 |
|
---|
1295 | # Declare intention to use gettext, and add support for specific
|
---|
1296 | # languages.
|
---|
1297 | # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
|
---|
1298 | ALL_LINGUAS="de fr"
|
---|
1299 |
|
---|
1300 | # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
|
---|
1301 | AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
|
---|
1302 | if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
|
---|
1303 | USE_NLS=yes
|
---|
1304 | fi
|
---|
1305 | # Export the build objects.
|
---|
1306 | for ling in $ALL_LINGUAS; do \
|
---|
1307 | glibcpp_MOFILES="$glibcpp_MOFILES $ling.mo"; \
|
---|
1308 | glibcpp_POFILES="$glibcpp_POFILES $ling.po"; \
|
---|
1309 | done
|
---|
1310 | AC_SUBST(glibcpp_MOFILES)
|
---|
1311 | AC_SUBST(glibcpp_POFILES)
|
---|
1312 |
|
---|
1313 | CLOCALE_H=config/locale/gnu/c_locale.h
|
---|
1314 | CLOCALE_CC=config/locale/gnu/c_locale.cc
|
---|
1315 | CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
|
---|
1316 | CCODECVT_CC=config/locale/gnu/codecvt_members.cc
|
---|
1317 | CCOLLATE_CC=config/locale/gnu/collate_members.cc
|
---|
1318 | CCTYPE_CC=config/locale/gnu/ctype_members.cc
|
---|
1319 | CMESSAGES_H=config/locale/gnu/messages_members.h
|
---|
1320 | CMESSAGES_CC=config/locale/gnu/messages_members.cc
|
---|
1321 | CMONEY_CC=config/locale/gnu/monetary_members.cc
|
---|
1322 | CNUMERIC_CC=config/locale/gnu/numeric_members.cc
|
---|
1323 | CTIME_H=config/locale/gnu/time_members.h
|
---|
1324 | CTIME_CC=config/locale/gnu/time_members.cc
|
---|
1325 | CLOCALE_INTERNAL_H=config/locale/gnu/c++locale_internal.h
|
---|
1326 | ;;
|
---|
1327 | xieee_1003.1-2001)
|
---|
1328 | AC_MSG_RESULT(generic)
|
---|
1329 |
|
---|
1330 | CLOCALE_H=config/locale/ieee_1003.1-2001/c_locale.h
|
---|
1331 | CLOCALE_CC=config/locale/ieee_1003.1-2001/c_locale.cc
|
---|
1332 | CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
|
---|
1333 | CCODECVT_CC=config/locale/generic/codecvt_members.cc
|
---|
1334 | CCOLLATE_CC=config/locale/generic/collate_members.cc
|
---|
1335 | CCTYPE_CC=config/locale/generic/ctype_members.cc
|
---|
1336 | CMESSAGES_H=config/locale/ieee_1003.1-2001/messages_members.h
|
---|
1337 | CMESSAGES_CC=config/locale/ieee_1003.1-2001/messages_members.cc
|
---|
1338 | CMONEY_CC=config/locale/generic/monetary_members.cc
|
---|
1339 | CNUMERIC_CC=config/locale/generic/numeric_members.cc
|
---|
1340 | CTIME_H=config/locale/generic/time_members.h
|
---|
1341 | CTIME_CC=config/locale/generic/time_members.cc
|
---|
1342 | CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
|
---|
1343 | ;;
|
---|
1344 | *)
|
---|
1345 | echo "$enable_clocale is an unknown locale package" 1>&2
|
---|
1346 | exit 1
|
---|
1347 | ;;
|
---|
1348 | esac
|
---|
1349 |
|
---|
1350 | # This is where the testsuite looks for locale catalogs, using the
|
---|
1351 | # -DLOCALEDIR define during testsuite compilation.
|
---|
1352 | glibcpp_localedir=${glibcpp_builddir}/po/share/locale
|
---|
1353 | AC_SUBST(glibcpp_localedir)
|
---|
1354 |
|
---|
1355 | AC_SUBST(USE_NLS)
|
---|
1356 | AC_SUBST(CLOCALE_H)
|
---|
1357 | AC_SUBST(CCODECVT_H)
|
---|
1358 | AC_SUBST(CMESSAGES_H)
|
---|
1359 | AC_SUBST(CCODECVT_CC)
|
---|
1360 | AC_SUBST(CCOLLATE_CC)
|
---|
1361 | AC_SUBST(CCTYPE_CC)
|
---|
1362 | AC_SUBST(CMESSAGES_CC)
|
---|
1363 | AC_SUBST(CMONEY_CC)
|
---|
1364 | AC_SUBST(CNUMERIC_CC)
|
---|
1365 | AC_SUBST(CTIME_H)
|
---|
1366 | AC_SUBST(CTIME_CC)
|
---|
1367 | AC_SUBST(CLOCALE_CC)
|
---|
1368 | AC_SUBST(CLOCALE_INTERNAL_H)
|
---|
1369 | ])
|
---|
1370 |
|
---|
1371 |
|
---|
1372 | dnl
|
---|
1373 | dnl Check for which I/O library to use: libio, or something specific.
|
---|
1374 | dnl
|
---|
1375 | dnl GLIBCPP_ENABLE_CSTDIO
|
---|
1376 | dnl --enable-cstdio=libio sets config/io/c_io_libio.h and friends
|
---|
1377 | dnl
|
---|
1378 | dnl default is stdio
|
---|
1379 | dnl
|
---|
1380 | AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
|
---|
1381 | AC_MSG_CHECKING([for cstdio to use])
|
---|
1382 | AC_ARG_ENABLE(cstdio,
|
---|
1383 | [ --enable-cstdio enable stdio for target io package.
|
---|
1384 | --enable-cstdio=LIB use LIB target-speific io package. [default=stdio]
|
---|
1385 | ],
|
---|
1386 | if test x$enable_cstdio = xno; then
|
---|
1387 | enable_cstdio=stdio
|
---|
1388 | fi,
|
---|
1389 | enable_cstdio=stdio)
|
---|
1390 |
|
---|
1391 | enable_cstdio_flag=$enable_cstdio
|
---|
1392 |
|
---|
1393 | dnl Check if a valid I/O package
|
---|
1394 | case x${enable_cstdio_flag} in
|
---|
1395 | xlibio)
|
---|
1396 | CSTDIO_H=config/io/c_io_libio.h
|
---|
1397 | BASIC_FILE_H=config/io/basic_file_libio.h
|
---|
1398 | BASIC_FILE_CC=config/io/basic_file_libio.cc
|
---|
1399 | AC_MSG_RESULT(libio)
|
---|
1400 |
|
---|
1401 | # see if we are on a system with libio native (ie, linux)
|
---|
1402 | AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
|
---|
1403 |
|
---|
1404 | # Need to check and see what version of glibc is being used. If
|
---|
1405 | # it's not glibc-2.2 or higher, then we'll need to go ahead and
|
---|
1406 | # compile most of libio for linux systems.
|
---|
1407 | if test x$has_libio = x"yes"; then
|
---|
1408 | case "$target" in
|
---|
1409 | *-*-linux*)
|
---|
1410 | AC_MSG_CHECKING([for glibc version >= 2.2])
|
---|
1411 | AC_EGREP_CPP([ok], [
|
---|
1412 | #include <features.h>
|
---|
1413 | #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
|
---|
1414 | ok
|
---|
1415 | #endif
|
---|
1416 | ], glibc_satisfactory=yes, glibc_satisfactory=no)
|
---|
1417 | AC_MSG_RESULT($glibc_satisfactory)
|
---|
1418 | ;;
|
---|
1419 | esac
|
---|
1420 |
|
---|
1421 | # XXX at the moment, admit defeat and force the recompilation
|
---|
1422 | # XXX of glibc even on glibc-2.2 systems, because libio is not synched.
|
---|
1423 | glibc_satisfactory=no
|
---|
1424 |
|
---|
1425 | if test x$glibc_satisfactory = x"yes"; then
|
---|
1426 | need_libio=no
|
---|
1427 | need_wlibio=no
|
---|
1428 | else
|
---|
1429 | need_libio=yes
|
---|
1430 | # bkoz XXX need to add checks to enable this
|
---|
1431 | # pme XXX here's a first pass at such a check
|
---|
1432 | if test x$enable_c_mbchar != xno; then
|
---|
1433 | need_wlibio=yes
|
---|
1434 | else
|
---|
1435 | need_wlibio=no
|
---|
1436 | fi
|
---|
1437 | fi
|
---|
1438 |
|
---|
1439 | else
|
---|
1440 | # Using libio, but <libio.h> doesn't exist on the target system. . .
|
---|
1441 | need_libio=yes
|
---|
1442 | # bkoz XXX need to add checks to enable this
|
---|
1443 | # pme XXX here's a first pass at such a check
|
---|
1444 | if test x$enable_c_mbchar != xno; then
|
---|
1445 | need_wlibio=yes
|
---|
1446 | else
|
---|
1447 | need_wlibio=no
|
---|
1448 | fi
|
---|
1449 | fi
|
---|
1450 | ;;
|
---|
1451 | xstdio | x | xno | xnone | xyes)
|
---|
1452 | # default
|
---|
1453 | CSTDIO_H=config/io/c_io_stdio.h
|
---|
1454 | BASIC_FILE_H=config/io/basic_file_stdio.h
|
---|
1455 | BASIC_FILE_CC=config/io/basic_file_stdio.cc
|
---|
1456 | AC_MSG_RESULT(stdio)
|
---|
1457 |
|
---|
1458 | # We're not using stdio.
|
---|
1459 | need_libio=no
|
---|
1460 | need_wlibio=no
|
---|
1461 | ;;
|
---|
1462 | *)
|
---|
1463 | echo "$enable_cstdio is an unknown io package" 1>&2
|
---|
1464 | exit 1
|
---|
1465 | ;;
|
---|
1466 | esac
|
---|
1467 | AC_SUBST(CSTDIO_H)
|
---|
1468 | AC_SUBST(BASIC_FILE_H)
|
---|
1469 | AC_SUBST(BASIC_FILE_CC)
|
---|
1470 |
|
---|
1471 | # 2000-08-04 bkoz hack
|
---|
1472 | CCODECVT_C=config/io/c_io_libio_codecvt.c
|
---|
1473 | AC_SUBST(CCODECVT_C)
|
---|
1474 | # 2000-08-04 bkoz hack
|
---|
1475 |
|
---|
1476 | AM_CONDITIONAL(GLIBCPP_BUILD_LIBIO,
|
---|
1477 | test "$need_libio" = yes || test "$need_wlibio" = yes)
|
---|
1478 | AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
|
---|
1479 | AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes)
|
---|
1480 | if test "$need_libio" = yes || test "$need_wlibio" = yes; then
|
---|
1481 | libio_la=../libio/libio.la
|
---|
1482 | else
|
---|
1483 | libio_la=
|
---|
1484 | fi
|
---|
1485 | AC_SUBST(libio_la)
|
---|
1486 | ])
|
---|
1487 |
|
---|
1488 |
|
---|
1489 | dnl
|
---|
1490 | dnl Setup to use the gcc gthr.h thread-specific memory and mutex model.
|
---|
1491 | dnl We must stage the required headers so that they will be installed
|
---|
1492 | dnl with the library (unlike libgcc, the STL implementation is provided
|
---|
1493 | dnl solely within headers). Since we must not inject random user-space
|
---|
1494 | dnl macro names into user-provided C++ code, we first stage into <file>-in
|
---|
1495 | dnl and process to <file> with an output command. The reason for a two-
|
---|
1496 | dnl stage process here is to correctly handle $srcdir!=$objdir without
|
---|
1497 | dnl having to write complex code (the sed commands to clean the macro
|
---|
1498 | dnl namespace are complex and fragile enough as it is). We must also
|
---|
1499 | dnl add a relative path so that -I- is supported properly.
|
---|
1500 | dnl
|
---|
1501 | AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
|
---|
1502 | AC_MSG_CHECKING([for thread model used by GCC])
|
---|
1503 | target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
|
---|
1504 | AC_MSG_RESULT([$target_thread_file])
|
---|
1505 |
|
---|
1506 | if test $target_thread_file != single; then
|
---|
1507 | AC_DEFINE(HAVE_GTHR_DEFAULT)
|
---|
1508 | AC_DEFINE(_GLIBCPP_SUPPORTS_WEAK, __GXX_WEAK__)
|
---|
1509 | fi
|
---|
1510 |
|
---|
1511 | glibcpp_thread_h=gthr-$target_thread_file.h
|
---|
1512 | AC_SUBST(glibcpp_thread_h)
|
---|
1513 | ])
|
---|
1514 |
|
---|
1515 |
|
---|
1516 | dnl
|
---|
1517 | dnl Check for exception handling support. If an explicit enable/disable
|
---|
1518 | dnl sjlj exceptions is given, we don't have to detect. Otherwise the
|
---|
1519 | dnl target may or may not support call frame exceptions.
|
---|
1520 | dnl
|
---|
1521 | dnl GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
|
---|
1522 | dnl --enable-sjlj-exceptions forces the use of builtin setjmp.
|
---|
1523 | dnl --disable-sjlj-exceptions forces the use of call frame unwinding.
|
---|
1524 | dnl
|
---|
1525 | dnl Define _GLIBCPP_SJLJ_EXCEPTIONS if the compiler is configured for it.
|
---|
1526 | dnl
|
---|
1527 | AC_DEFUN(GLIBCPP_ENABLE_SJLJ_EXCEPTIONS, [
|
---|
1528 | AC_MSG_CHECKING([for exception model to use])
|
---|
1529 | AC_LANG_SAVE
|
---|
1530 | AC_LANG_CPLUSPLUS
|
---|
1531 | AC_ARG_ENABLE(sjlj-exceptions,
|
---|
1532 | [ --enable-sjlj-exceptions force use of builtin_setjmp for exceptions],
|
---|
1533 | [:],
|
---|
1534 | [dnl Botheration. Now we've got to detect the exception model.
|
---|
1535 | dnl Link tests against libgcc.a are problematic since -- at least
|
---|
1536 | dnl as of this writing -- we've not been given proper -L bits for
|
---|
1537 | dnl single-tree newlib and libgloss.
|
---|
1538 | dnl
|
---|
1539 | dnl This is what AC_TRY_COMPILE would do if it didn't delete the
|
---|
1540 | dnl conftest files before we got a change to grep them first.
|
---|
1541 | cat > conftest.$ac_ext << EOF
|
---|
1542 | [#]line __oline__ "configure"
|
---|
1543 | struct S { ~S(); };
|
---|
1544 | void bar();
|
---|
1545 | void foo()
|
---|
1546 | {
|
---|
1547 | S s;
|
---|
1548 | bar();
|
---|
1549 | }
|
---|
1550 | EOF
|
---|
1551 | old_CXXFLAGS="$CXXFLAGS"
|
---|
1552 | CXXFLAGS=-S
|
---|
1553 | if AC_TRY_EVAL(ac_compile); then
|
---|
1554 | if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
|
---|
1555 | enable_sjlj_exceptions=yes
|
---|
1556 | elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
|
---|
1557 | enable_sjlj_exceptions=no
|
---|
1558 | fi
|
---|
1559 | fi
|
---|
1560 | CXXFLAGS="$old_CXXFLAGS"
|
---|
1561 | rm -f conftest*])
|
---|
1562 | if test x$enable_sjlj_exceptions = xyes; then
|
---|
1563 | AC_DEFINE(_GLIBCPP_SJLJ_EXCEPTIONS, 1,
|
---|
1564 | [Define if the compiler is configured for setjmp/longjmp exceptions.])
|
---|
1565 | ac_exception_model_name=sjlj
|
---|
1566 | elif test x$enable_sjlj_exceptions = xno; then
|
---|
1567 | ac_exception_model_name="call frame"
|
---|
1568 | else
|
---|
1569 | AC_MSG_ERROR([unable to detect exception model])
|
---|
1570 | fi
|
---|
1571 | AC_LANG_RESTORE
|
---|
1572 | AC_MSG_RESULT($ac_exception_model_name)
|
---|
1573 | ])
|
---|
1574 |
|
---|
1575 |
|
---|
1576 | dnl
|
---|
1577 | dnl Check for libunwind exception handling support. If enabled then
|
---|
1578 | dnl we assume that the _Unwind_* functions that make up the Unwind ABI
|
---|
1579 | dnl (_Unwind_RaiseException, _Unwind_Resume, etc.) are defined by
|
---|
1580 | dnl libunwind instead of libgcc and that libstdc++ has a dependency
|
---|
1581 | dnl on libunwind as well as libgcc.
|
---|
1582 | dnl
|
---|
1583 | dnl GLIBCPP_ENABLE_LIBUNWIND_EXCEPTIONS
|
---|
1584 | dnl --enable-libunwind-exceptions forces the use of libunwind.
|
---|
1585 | dnl --disable-libunwind-exceptions assumes there is no libunwind.
|
---|
1586 | dnl
|
---|
1587 | dnl Define _GLIBCPP_LIBUNWIND_EXCEPTIONS if requested.
|
---|
1588 | dnl
|
---|
1589 | AC_DEFUN(GLIBCPP_ENABLE_LIBUNWIND_EXCEPTIONS, [
|
---|
1590 | AC_MSG_CHECKING([for use of libunwind])
|
---|
1591 | AC_ARG_ENABLE(libunwind-exceptions,
|
---|
1592 | [ --enable-libunwind-exceptions force use of libunwind for exceptions],
|
---|
1593 | use_libunwind_exceptions=$enableval,
|
---|
1594 | use_libunwind_exceptions=no)
|
---|
1595 | AC_MSG_RESULT($use_libunwind_exceptions)
|
---|
1596 | dnl Option parsed, now set things appropriately
|
---|
1597 | if test x"$use_libunwind_exceptions" = xyes; then
|
---|
1598 | LIBUNWIND_FLAG="-lunwind"
|
---|
1599 | else
|
---|
1600 | LIBUNWIND_FLAG=""
|
---|
1601 | fi
|
---|
1602 | AC_SUBST(LIBUNWIND_FLAG)
|
---|
1603 | ])
|
---|
1604 |
|
---|
1605 | dnl
|
---|
1606 | dnl Check for ISO/IEC 9899:1999 "C99" support.
|
---|
1607 | dnl
|
---|
1608 | dnl GLIBCPP_ENABLE_C99
|
---|
1609 | dnl --enable-c99 defines _GLIBCPP_USE_C99
|
---|
1610 | dnl --disable-c99 leaves _GLIBCPP_USE_C99 undefined
|
---|
1611 | dnl + Usage: GLIBCPP_ENABLE_C99[(DEFAULT)]
|
---|
1612 | dnl Where DEFAULT is either `yes' or `no'. If omitted, it
|
---|
1613 | dnl defaults to `no'.
|
---|
1614 | dnl + If 'C99' stuff is not available, ignores DEFAULT and sets `no'.
|
---|
1615 | dnl
|
---|
1616 | dnl GLIBCPP_ENABLE_C99
|
---|
1617 | AC_DEFUN(GLIBCPP_ENABLE_C99, [dnl
|
---|
1618 | define([GLIBCPP_ENABLE_C99_DEFAULT], ifelse($1, yes, yes, no))dnl
|
---|
1619 |
|
---|
1620 | AC_ARG_ENABLE(c99,
|
---|
1621 | changequote(<<, >>)dnl
|
---|
1622 | <<--enable-c99 turns on 'ISO/IEC 9899:1999 support' [default=>>GLIBCPP_ENABLE_C99_DEFAULT],
|
---|
1623 | changequote([, ])dnl
|
---|
1624 | [case "$enableval" in
|
---|
1625 | yes) enable_c99=yes ;;
|
---|
1626 | no) enable_c99=no ;;
|
---|
1627 | *) AC_MSG_ERROR([Unknown argument to enable/disable C99]) ;;
|
---|
1628 | esac],
|
---|
1629 | enable_c99=GLIBCPP_ENABLE_C99_DEFAULT)dnl
|
---|
1630 |
|
---|
1631 | AC_LANG_SAVE
|
---|
1632 | AC_LANG_CPLUSPLUS
|
---|
1633 |
|
---|
1634 | # Check for the existence of <math.h> functions used if C99 is enabled.
|
---|
1635 | ac_c99_math=yes;
|
---|
1636 | AC_MSG_CHECKING([for ISO C99 support in <math.h>])
|
---|
1637 | AC_TRY_COMPILE([#include <math.h>],[fpclassify(0.0);],, [ac_c99_math=no])
|
---|
1638 | AC_TRY_COMPILE([#include <math.h>],[isfinite(0.0);],, [ac_c99_math=no])
|
---|
1639 | AC_TRY_COMPILE([#include <math.h>],[isinf(0.0);],, [ac_c99_math=no])
|
---|
1640 | AC_TRY_COMPILE([#include <math.h>],[isnan(0.0);],, [ac_c99_math=no])
|
---|
1641 | AC_TRY_COMPILE([#include <math.h>],[isnormal(0.0);],, [ac_c99_math=no])
|
---|
1642 | AC_TRY_COMPILE([#include <math.h>],[signbit(0.0);],, [ac_c99_math=no])
|
---|
1643 | AC_TRY_COMPILE([#include <math.h>],[isgreater(0.0,0.0);],, [ac_c99_math=no])
|
---|
1644 | AC_TRY_COMPILE([#include <math.h>],
|
---|
1645 | [isgreaterequal(0.0,0.0);],, [ac_c99_math=no])
|
---|
1646 | AC_TRY_COMPILE([#include <math.h>],[isless(0.0,0.0);],, [ac_c99_math=no])
|
---|
1647 | AC_TRY_COMPILE([#include <math.h>],[islessequal(0.0,0.0);],,[ac_c99_math=no])
|
---|
1648 | AC_TRY_COMPILE([#include <math.h>],
|
---|
1649 | [islessgreater(0.0,0.0);],, [ac_c99_math=no])
|
---|
1650 | AC_TRY_COMPILE([#include <math.h>],
|
---|
1651 | [isunordered(0.0,0.0);],, [ac_c99_math=no])
|
---|
1652 | AC_MSG_RESULT($ac_c99_math)
|
---|
1653 |
|
---|
1654 | # Check for the existence in <stdio.h> of vscanf, et. al.
|
---|
1655 | ac_c99_stdio=yes;
|
---|
1656 | AC_MSG_CHECKING([for ISO C99 support in <stdio.h>])
|
---|
1657 | AC_TRY_COMPILE([#include <stdio.h>],
|
---|
1658 | [snprintf("12", 0, "%i");],, [ac_c99_stdio=no])
|
---|
1659 | AC_TRY_COMPILE([#include <stdio.h>
|
---|
1660 | #include <stdarg.h>
|
---|
1661 | void foo(char* fmt, ...)
|
---|
1662 | {va_list args; va_start(args, fmt);
|
---|
1663 | vfscanf(stderr, "%i", args);}],
|
---|
1664 | [],, [ac_c99_stdio=no])
|
---|
1665 | AC_TRY_COMPILE([#include <stdio.h>
|
---|
1666 | #include <stdarg.h>
|
---|
1667 | void foo(char* fmt, ...)
|
---|
1668 | {va_list args; va_start(args, fmt);
|
---|
1669 | vscanf("%i", args);}],
|
---|
1670 | [],, [ac_c99_stdio=no])
|
---|
1671 | AC_TRY_COMPILE([#include <stdio.h>
|
---|
1672 | #include <stdarg.h>
|
---|
1673 | void foo(char* fmt, ...)
|
---|
1674 | {va_list args; va_start(args, fmt);
|
---|
1675 | vsnprintf(fmt, 0, "%i", args);}],
|
---|
1676 | [],, [ac_c99_stdio=no])
|
---|
1677 | AC_TRY_COMPILE([#include <stdio.h>
|
---|
1678 | #include <stdarg.h>
|
---|
1679 | void foo(char* fmt, ...)
|
---|
1680 | {va_list args; va_start(args, fmt);
|
---|
1681 | vsscanf(fmt, "%i", args);}],
|
---|
1682 | [],, [ac_c99_stdio=no])
|
---|
1683 | AC_MSG_RESULT($ac_c99_stdio)
|
---|
1684 |
|
---|
1685 | # Check for the existence in <stdlib.h> of lldiv_t, et. al.
|
---|
1686 | ac_c99_stdlib=yes;
|
---|
1687 | AC_MSG_CHECKING([for lldiv_t declaration])
|
---|
1688 | AC_CACHE_VAL(ac_c99_lldiv_t, [
|
---|
1689 | AC_TRY_COMPILE([#include <stdlib.h>],
|
---|
1690 | [ lldiv_t mydivt;],
|
---|
1691 | [ac_c99_lldiv_t=yes], [ac_c99_lldiv_t=no])
|
---|
1692 | ])
|
---|
1693 | AC_MSG_RESULT($ac_c99_lldiv_t)
|
---|
1694 |
|
---|
1695 | AC_MSG_CHECKING([for ISO C99 support in <stdlib.h>])
|
---|
1696 | AC_TRY_COMPILE([#include <stdlib.h>],
|
---|
1697 | [char* tmp; strtof("gnu", &tmp);],, [ac_c99_stdlib=no])
|
---|
1698 | AC_TRY_COMPILE([#include <stdlib.h>],
|
---|
1699 | [char* tmp; strtold("gnu", &tmp);],, [ac_c99_stdlib=no])
|
---|
1700 | AC_TRY_COMPILE([#include <stdlib.h>], [llabs(10);],, [ac_c99_stdlib=no])
|
---|
1701 | AC_TRY_COMPILE([#include <stdlib.h>], [lldiv(10,1);],, [ac_c99_stdlib=no])
|
---|
1702 | AC_TRY_COMPILE([#include <stdlib.h>], [atoll("10");],, [ac_c99_stdlib=no])
|
---|
1703 | AC_TRY_COMPILE([#include <stdlib.h>], [_Exit(0);],, [ac_c99_stdlib=no])
|
---|
1704 | if test x"$ac_c99_lldiv_t" = x"no"; then
|
---|
1705 | ac_c99_stdlib=no;
|
---|
1706 | fi;
|
---|
1707 | AC_MSG_RESULT($ac_c99_stdlib)
|
---|
1708 |
|
---|
1709 | # Check for the existence of <wchar.h> functions used if C99 is enabled.
|
---|
1710 | # XXX the wchar.h checks should be rolled into the general C99 bits.
|
---|
1711 | ac_c99_wchar=yes;
|
---|
1712 | AC_MSG_CHECKING([for additional ISO C99 support in <wchar.h>])
|
---|
1713 | AC_TRY_COMPILE([#include <wchar.h>],
|
---|
1714 | [wcstold(L"10.0", NULL);],, [ac_c99_wchar=no])
|
---|
1715 | AC_TRY_COMPILE([#include <wchar.h>],
|
---|
1716 | [wcstoll(L"10", NULL, 10);],, [ac_c99_wchar=no])
|
---|
1717 | AC_TRY_COMPILE([#include <wchar.h>],
|
---|
1718 | [wcstoull(L"10", NULL, 10);],, [ac_c99_wchar=no])
|
---|
1719 | AC_MSG_RESULT($ac_c99_wchar)
|
---|
1720 |
|
---|
1721 | AC_MSG_CHECKING([for enabled ISO C99 support])
|
---|
1722 | if test x"$ac_c99_math" = x"no" ||
|
---|
1723 | test x"$ac_c99_stdio" = x"no" ||
|
---|
1724 | test x"$ac_c99_stdlib" = x"no" ||
|
---|
1725 | test x"$ac_c99_wchar" = x"no"; then
|
---|
1726 | enable_c99=no;
|
---|
1727 | fi;
|
---|
1728 | AC_MSG_RESULT($enable_c99)
|
---|
1729 |
|
---|
1730 | # Option parsed, now set things appropriately
|
---|
1731 | if test x"$enable_c99" = x"yes"; then
|
---|
1732 | AC_DEFINE(_GLIBCPP_USE_C99)
|
---|
1733 | fi
|
---|
1734 |
|
---|
1735 | AC_LANG_RESTORE
|
---|
1736 | ])
|
---|
1737 |
|
---|
1738 |
|
---|
1739 | dnl
|
---|
1740 | dnl Check for template specializations for the 'long long' type extension.
|
---|
1741 | dnl The result determines only whether 'long long' I/O is enabled; things
|
---|
1742 | dnl like numeric_limits<> specializations are always available.
|
---|
1743 | dnl
|
---|
1744 | dnl GLIBCPP_ENABLE_LONG_LONG
|
---|
1745 | dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
|
---|
1746 | dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
|
---|
1747 | dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
|
---|
1748 | dnl Where DEFAULT is either `yes' or `no'. If omitted, it
|
---|
1749 | dnl defaults to `no'.
|
---|
1750 | dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
|
---|
1751 | dnl
|
---|
1752 | dnl GLIBCPP_ENABLE_LONG_LONG
|
---|
1753 | AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
|
---|
1754 | define([GLIBCPP_ENABLE_LONG_LONG_DEFAULT], ifelse($1, yes, yes, no))dnl
|
---|
1755 |
|
---|
1756 | AC_ARG_ENABLE(long-long,
|
---|
1757 | changequote(<<, >>)dnl
|
---|
1758 | <<--enable-long-long turns on 'long long' [default=>>GLIBCPP_ENABLE_LONG_LONG_DEFAULT],
|
---|
1759 | changequote([, ])dnl
|
---|
1760 | [case "$enableval" in
|
---|
1761 | yes) enable_long_long=yes ;;
|
---|
1762 | no) enable_long_long=no ;;
|
---|
1763 | *) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
|
---|
1764 | esac],
|
---|
1765 | enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
|
---|
1766 |
|
---|
1767 | AC_LANG_SAVE
|
---|
1768 | AC_LANG_CPLUSPLUS
|
---|
1769 |
|
---|
1770 | AC_MSG_CHECKING([for enabled long long I/O support])
|
---|
1771 | # iostreams require strtoll, strtoull to compile
|
---|
1772 | AC_TRY_COMPILE([#include <stdlib.h>],
|
---|
1773 | [char* tmp; strtoll("gnu", &tmp, 10);],,[enable_long_long=no])
|
---|
1774 | AC_TRY_COMPILE([#include <stdlib.h>],
|
---|
1775 | [char* tmp; strtoull("gnu", &tmp, 10);],,[enable_long_long=no])
|
---|
1776 |
|
---|
1777 | # Option parsed, now set things appropriately
|
---|
1778 | if test x"$enable_long_long" = xyes; then
|
---|
1779 | AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
|
---|
1780 | fi
|
---|
1781 | AC_MSG_RESULT($enable_long_long)
|
---|
1782 |
|
---|
1783 | AC_LANG_RESTORE
|
---|
1784 | ])
|
---|
1785 |
|
---|
1786 |
|
---|
1787 | dnl
|
---|
1788 | dnl Check for what type of C headers to use.
|
---|
1789 | dnl
|
---|
1790 | dnl GLIBCPP_ENABLE_CHEADERS
|
---|
1791 | dnl --enable-cheaders= [does stuff].
|
---|
1792 | dnl --disable-cheaders [does not do anything, really].
|
---|
1793 | dnl + Usage: GLIBCPP_ENABLE_CHEADERS[(DEFAULT)]
|
---|
1794 | dnl Where DEFAULT is either `c' or `c_std'.
|
---|
1795 | dnl If ommitted, it defaults to `c_std'.
|
---|
1796 | AC_DEFUN(GLIBCPP_ENABLE_CHEADERS, [dnl
|
---|
1797 | define([GLIBCPP_ENABLE_CHEADERS_DEFAULT], ifelse($1, c_std, c_std, c_std))dnl
|
---|
1798 | AC_MSG_CHECKING([for c header strategy to use])
|
---|
1799 | AC_ARG_ENABLE(cheaders,
|
---|
1800 | changequote(<<, >>)dnl
|
---|
1801 | << --enable-cheaders=MODEL construct "C" header files for g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT],
|
---|
1802 | changequote([, ])
|
---|
1803 | [case "$enableval" in
|
---|
1804 | c)
|
---|
1805 | enable_cheaders=c
|
---|
1806 | ;;
|
---|
1807 | c_std)
|
---|
1808 | enable_cheaders=c_std
|
---|
1809 | ;;
|
---|
1810 | *) AC_MSG_ERROR([Unknown argument to enable/disable "C" headers])
|
---|
1811 | ;;
|
---|
1812 | esac],
|
---|
1813 | enable_cheaders=GLIBCPP_ENABLE_CHEADERS_DEFAULT)
|
---|
1814 | AC_MSG_RESULT($enable_cheaders)
|
---|
1815 |
|
---|
1816 | dnl Option parsed, now set things appropriately
|
---|
1817 | case "$enable_cheaders" in
|
---|
1818 | c_std)
|
---|
1819 | C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_std'
|
---|
1820 | ;;
|
---|
1821 | c)
|
---|
1822 | C_INCLUDE_DIR='${glibcpp_srcdir}/include/c'
|
---|
1823 | ;;
|
---|
1824 | esac
|
---|
1825 |
|
---|
1826 | AC_SUBST(C_INCLUDE_DIR)
|
---|
1827 | AM_CONDITIONAL(GLIBCPP_C_HEADERS_C, test "$enable_cheaders" = c)
|
---|
1828 | AM_CONDITIONAL(GLIBCPP_C_HEADERS_C_STD, test "$enable_cheaders" = c_std)
|
---|
1829 | AM_CONDITIONAL(GLIBCPP_C_HEADERS_COMPATIBILITY, test "$c_compatibility" = yes)
|
---|
1830 | ])
|
---|
1831 |
|
---|
1832 |
|
---|
1833 | dnl
|
---|
1834 | dnl Check for wide character support. Has the same effect as the option
|
---|
1835 | dnl in gcc's configure, but in a form that autoconf can mess with.
|
---|
1836 | dnl
|
---|
1837 | dnl GLIBCPP_ENABLE_C_MBCHAR
|
---|
1838 | dnl --enable-c-mbchar requests all the wchar_t stuff.
|
---|
1839 | dnl --disable-c-mbchar doesn't.
|
---|
1840 | dnl + Usage: GLIBCPP_ENABLE_C_MBCHAR[(DEFAULT)]
|
---|
1841 | dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
|
---|
1842 | dnl defaults to `no'.
|
---|
1843 | AC_DEFUN(GLIBCPP_ENABLE_C_MBCHAR, [dnl
|
---|
1844 | define([GLIBCPP_ENABLE_C_MBCHAR_DEFAULT], ifelse($1, yes, yes, no))dnl
|
---|
1845 | AC_ARG_ENABLE(c-mbchar,
|
---|
1846 | changequote(<<, >>)dnl
|
---|
1847 | << --enable-c-mbchar enable multibyte (wide) characters [default=>>GLIBCPP_ENABLE_C_MBCHAR_DEFAULT],
|
---|
1848 | changequote([, ])dnl
|
---|
1849 | [case "$enableval" in
|
---|
1850 | yes) enable_c_mbchar=yes ;;
|
---|
1851 | no) enable_c_mbchar=no ;;
|
---|
1852 | *) AC_MSG_ERROR([Unknown argument to enable/disable c-mbchar]) ;;
|
---|
1853 | esac],
|
---|
1854 | enable_c_mbchar=GLIBCPP_ENABLE_C_MBCHAR_DEFAULT)dnl
|
---|
1855 | dnl Option parsed, now other scripts can test enable_c_mbchar for yes/no.
|
---|
1856 | ])
|
---|
1857 |
|
---|
1858 |
|
---|
1859 | dnl
|
---|
1860 | dnl Set up *_INCLUDES and *_INCLUDE_DIR variables for all sundry Makefile.am's.
|
---|
1861 | dnl
|
---|
1862 | dnl TOPLEVEL_INCLUDES
|
---|
1863 | dnl LIBMATH_INCLUDES
|
---|
1864 | dnl LIBSUPCXX_INCLUDES
|
---|
1865 | dnl LIBIO_INCLUDES
|
---|
1866 | dnl
|
---|
1867 | dnl GLIBCPP_EXPORT_INCLUDES
|
---|
1868 | AC_DEFUN(GLIBCPP_EXPORT_INCLUDES, [
|
---|
1869 | # Root level of the build directory include sources.
|
---|
1870 | GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include"
|
---|
1871 |
|
---|
1872 | # Passed down for canadian crosses.
|
---|
1873 | if test x"$CANADIAN" = xyes; then
|
---|
1874 | TOPLEVEL_INCLUDES='-I$(includedir)'
|
---|
1875 | fi
|
---|
1876 |
|
---|
1877 | LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
|
---|
1878 |
|
---|
1879 | LIBSUPCXX_INCLUDES='-I$(top_srcdir)/libsupc++'
|
---|
1880 |
|
---|
1881 | if test x"$need_libio" = xyes; then
|
---|
1882 | LIBIO_INCLUDES='-I$(top_builddir)/libio -I$(top_srcdir)/libio'
|
---|
1883 | AC_SUBST(LIBIO_INCLUDES)
|
---|
1884 | fi
|
---|
1885 |
|
---|
1886 | # Now, export this to all the little Makefiles....
|
---|
1887 | AC_SUBST(GLIBCPP_INCLUDES)
|
---|
1888 | AC_SUBST(TOPLEVEL_INCLUDES)
|
---|
1889 | AC_SUBST(LIBMATH_INCLUDES)
|
---|
1890 | AC_SUBST(LIBSUPCXX_INCLUDES)
|
---|
1891 | ])
|
---|
1892 |
|
---|
1893 |
|
---|
1894 | dnl
|
---|
1895 | dnl Set up *_FLAGS and *FLAGS variables for all sundry Makefile.am's.
|
---|
1896 | dnl
|
---|
1897 | AC_DEFUN(GLIBCPP_EXPORT_FLAGS, [
|
---|
1898 | # Optimization flags that are probably a good idea for thrill-seekers. Just
|
---|
1899 | # uncomment the lines below and make, everything else is ready to go...
|
---|
1900 | # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
|
---|
1901 | OPTIMIZE_CXXFLAGS=
|
---|
1902 | AC_SUBST(OPTIMIZE_CXXFLAGS)
|
---|
1903 |
|
---|
1904 | WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings'
|
---|
1905 | AC_SUBST(WARN_FLAGS)
|
---|
1906 | ])
|
---|
1907 |
|
---|
1908 | dnl
|
---|
1909 | dnl GLIBCPP_EXPORT_INSTALL_INFO
|
---|
1910 | dnl calculates gxx_install_dir
|
---|
1911 | dnl exports glibcpp_toolexecdir
|
---|
1912 | dnl exports glibcpp_toolexeclibdir
|
---|
1913 | dnl exports glibcpp_prefixdir
|
---|
1914 | dnl
|
---|
1915 | dnl Assumes cross_compiling bits already done, and with_cross_host in
|
---|
1916 | dnl particular
|
---|
1917 | dnl
|
---|
1918 | dnl GLIBCPP_EXPORT_INSTALL_INFO
|
---|
1919 | AC_DEFUN(GLIBCPP_EXPORT_INSTALL_INFO, [
|
---|
1920 | # Assumes glibcpp_builddir, glibcpp_srcdir are alreay set up and
|
---|
1921 | # exported correctly in GLIBCPP_CONFIGURE.
|
---|
1922 | glibcpp_toolexecdir=no
|
---|
1923 | glibcpp_toolexeclibdir=no
|
---|
1924 | glibcpp_prefixdir=${prefix}
|
---|
1925 |
|
---|
1926 | # Process the option --with-gxx-include-dir=<path to include-files directory>
|
---|
1927 | AC_MSG_CHECKING([for --with-gxx-include-dir])
|
---|
1928 | AC_ARG_WITH(gxx-include-dir,
|
---|
1929 | [ --with-gxx-include-dir the installation directory for include files],
|
---|
1930 | [case "${withval}" in
|
---|
1931 | yes)
|
---|
1932 | AC_MSG_ERROR(Missing directory for --with-gxx-include-dir)
|
---|
1933 | gxx_include_dir=no
|
---|
1934 | ;;
|
---|
1935 | no)
|
---|
1936 | gxx_include_dir=no
|
---|
1937 | ;;
|
---|
1938 | *)
|
---|
1939 | gxx_include_dir=${withval}
|
---|
1940 | ;;
|
---|
1941 | esac], [gxx_include_dir=no])
|
---|
1942 | AC_MSG_RESULT($gxx_include_dir)
|
---|
1943 |
|
---|
1944 | # Process the option "--enable-version-specific-runtime-libs"
|
---|
1945 | AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
|
---|
1946 | AC_ARG_ENABLE(version-specific-runtime-libs,
|
---|
1947 | [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
|
---|
1948 | [case "$enableval" in
|
---|
1949 | yes) version_specific_libs=yes ;;
|
---|
1950 | no) version_specific_libs=no ;;
|
---|
1951 | *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
|
---|
1952 | esac],
|
---|
1953 | version_specific_libs=no)dnl
|
---|
1954 | # Option set, now we can test it.
|
---|
1955 | AC_MSG_RESULT($version_specific_libs)
|
---|
1956 |
|
---|
1957 | # Default case for install directory for include files.
|
---|
1958 | if test $version_specific_libs = no && test $gxx_include_dir = no; then
|
---|
1959 | gxx_include_dir='$(prefix)'/include/c++/${gcc_version}
|
---|
1960 | fi
|
---|
1961 |
|
---|
1962 | # Version-specific runtime libs processing.
|
---|
1963 | if test $version_specific_libs = yes; then
|
---|
1964 | # Need the gcc compiler version to know where to install libraries
|
---|
1965 | # and header files if --enable-version-specific-runtime-libs option
|
---|
1966 | # is selected.
|
---|
1967 | if test x"$gxx_include_dir" = x"no"; then
|
---|
1968 | gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/c++
|
---|
1969 | fi
|
---|
1970 | glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
|
---|
1971 | glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
|
---|
1972 | fi
|
---|
1973 |
|
---|
1974 | # Calculate glibcpp_toolexecdir, glibcpp_toolexeclibdir
|
---|
1975 | # Install a library built with a cross compiler in tooldir, not libdir.
|
---|
1976 | if test x"$glibcpp_toolexecdir" = x"no"; then
|
---|
1977 | if test -n "$with_cross_host" &&
|
---|
1978 | test x"$with_cross_host" != x"no"; then
|
---|
1979 | glibcpp_toolexecdir='$(exec_prefix)/$(target_alias)'
|
---|
1980 | glibcpp_toolexeclibdir='$(toolexecdir)/lib'
|
---|
1981 | else
|
---|
1982 | glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
|
---|
1983 | glibcpp_toolexeclibdir='$(libdir)'
|
---|
1984 | fi
|
---|
1985 | glibcpp_toolexeclibdir=$glibcpp_toolexeclibdir/`$CC -print-multi-os-directory`
|
---|
1986 | fi
|
---|
1987 |
|
---|
1988 | AC_MSG_CHECKING([for install location])
|
---|
1989 | AC_MSG_RESULT($gxx_include_dir)
|
---|
1990 |
|
---|
1991 | AC_SUBST(glibcpp_prefixdir)
|
---|
1992 | AC_SUBST(gxx_include_dir)
|
---|
1993 | AC_SUBST(glibcpp_toolexecdir)
|
---|
1994 | AC_SUBST(glibcpp_toolexeclibdir)
|
---|
1995 | ])
|
---|
1996 |
|
---|
1997 |
|
---|
1998 | # Check for functions in math library.
|
---|
1999 | # Ulrich Drepper <drepper@cygnus.com>, 1998.
|
---|
2000 | #
|
---|
2001 | # This file can be copied and used freely without restrictions. It can
|
---|
2002 | # be used in projects which are not available under the GNU Public License
|
---|
2003 | # but which still want to provide support for the GNU gettext functionality.
|
---|
2004 | # Please note that the actual code is *not* freely available.
|
---|
2005 |
|
---|
2006 | # serial 1
|
---|
2007 |
|
---|
2008 | dnl AC_REPLACE_MATHFUNCS(FUNCTION...)
|
---|
2009 | AC_DEFUN(AC_REPLACE_MATHFUNCS,
|
---|
2010 | [AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])])
|
---|
2011 |
|
---|
2012 |
|
---|
2013 | dnl This macro searches for a GNU version of make. If a match is found, the
|
---|
2014 | dnl makefile variable `ifGNUmake' is set to the empty string, otherwise it is
|
---|
2015 | dnl set to "#". This is useful for including a special features in a Makefile,
|
---|
2016 | dnl which cannot be handled by other versions of make. The variable
|
---|
2017 | dnl _cv_gnu_make_command is set to the command to invoke GNU make if it exists,
|
---|
2018 | dnl the empty string otherwise.
|
---|
2019 | dnl
|
---|
2020 | dnl Here is an example of its use:
|
---|
2021 | dnl
|
---|
2022 | dnl Makefile.in might contain:
|
---|
2023 | dnl
|
---|
2024 | dnl # A failsafe way of putting a dependency rule into a makefile
|
---|
2025 | dnl $(DEPEND):
|
---|
2026 | dnl $(CC) -MM $(srcdir)/*.c > $(DEPEND)
|
---|
2027 | dnl
|
---|
2028 | dnl @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
|
---|
2029 | dnl @ifGNUmake@ include $(DEPEND)
|
---|
2030 | dnl @ifGNUmake@ endif
|
---|
2031 | dnl
|
---|
2032 | dnl Then configure.in would normally contain:
|
---|
2033 | dnl
|
---|
2034 | dnl CHECK_GNU_MAKE()
|
---|
2035 | dnl AC_OUTPUT(Makefile)
|
---|
2036 | dnl
|
---|
2037 | dnl Then perhaps to cause gnu make to override any other make, we could do
|
---|
2038 | dnl something like this (note that GNU make always looks for GNUmakefile first):
|
---|
2039 | dnl
|
---|
2040 | dnl if ! test x$_cv_gnu_make_command = x ; then
|
---|
2041 | dnl mv Makefile GNUmakefile
|
---|
2042 | dnl echo .DEFAULT: > Makefile ;
|
---|
2043 | dnl echo \ $_cv_gnu_make_command \$@ >> Makefile;
|
---|
2044 | dnl fi
|
---|
2045 | dnl
|
---|
2046 | dnl Then, if any (well almost any) other make is called, and GNU make also
|
---|
2047 | dnl exists, then the other make wraps the GNU make.
|
---|
2048 | dnl
|
---|
2049 | dnl @author John Darrington <j.darrington@elvis.murdoch.edu.au>
|
---|
2050 | dnl @version 1.1 #### replaced Id string now that Id is for lib-v3; pme
|
---|
2051 | dnl
|
---|
2052 | dnl #### Changes for libstdc++-v3: reformatting and linewrapping; prepending
|
---|
2053 | dnl #### GLIBCPP_ to the macro name; adding the :-make fallback in the
|
---|
2054 | dnl #### conditional's subshell (" --version" is not a command), using a
|
---|
2055 | dnl #### different option to grep(1).
|
---|
2056 | dnl #### -pme
|
---|
2057 | dnl #### Fixed Bourne shell portability bug (use ${MAKE-make}, not
|
---|
2058 | dnl #### ${MAKE:-make}).
|
---|
2059 | dnl #### -msokolov
|
---|
2060 | AC_DEFUN(
|
---|
2061 | GLIBCPP_CHECK_GNU_MAKE, [AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
|
---|
2062 | _cv_gnu_make_command='' ;
|
---|
2063 | dnl Search all the common names for GNU make
|
---|
2064 | for a in "${MAKE-make}" make gmake gnumake ; do
|
---|
2065 | if ( $a --version 2> /dev/null | grep -c GNU > /dev/null )
|
---|
2066 | then
|
---|
2067 | _cv_gnu_make_command=$a ;
|
---|
2068 | break;
|
---|
2069 | fi
|
---|
2070 | done ;
|
---|
2071 | ) ;
|
---|
2072 | dnl If there was a GNU version, then set @ifGNUmake@ to the empty
|
---|
2073 | dnl string, '#' otherwise
|
---|
2074 | if test "x$_cv_gnu_make_command" != "x" ; then
|
---|
2075 | ifGNUmake='' ;
|
---|
2076 | else
|
---|
2077 | ifGNUmake='#' ;
|
---|
2078 | fi
|
---|
2079 | AC_SUBST(ifGNUmake)
|
---|
2080 | ])
|
---|
2081 |
|
---|
2082 |
|
---|
2083 | dnl Check for headers for, and arguments to, the setrlimit() function.
|
---|
2084 | dnl Used only in testsuite_hooks.h.
|
---|
2085 | AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT_ancilliary, [
|
---|
2086 | AC_TRY_COMPILE([#include <unistd.h>
|
---|
2087 | #include <sys/time.h>
|
---|
2088 | #include <sys/resource.h>
|
---|
2089 | ], [ int f = RLIMIT_$1 ; ],
|
---|
2090 | [glibcpp_mresult=1], [glibcpp_mresult=0])
|
---|
2091 | AC_DEFINE_UNQUOTED(HAVE_MEMLIMIT_$1, $glibcpp_mresult,
|
---|
2092 | [Only used in build directory testsuite_hooks.h.])
|
---|
2093 | ])
|
---|
2094 | AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT, [
|
---|
2095 | setrlimit_have_headers=yes
|
---|
2096 | AC_CHECK_HEADERS(unistd.h sys/time.h sys/resource.h,
|
---|
2097 | [],
|
---|
2098 | setrlimit_have_headers=no)
|
---|
2099 | # If don't have the headers, then we can't run the tests now, and we
|
---|
2100 | # won't be seeing any of these during testsuite compilation.
|
---|
2101 | if test $setrlimit_have_headers = yes; then
|
---|
2102 | # Can't do these in a loop, else the resulting syntax is wrong.
|
---|
2103 | GLIBCPP_CHECK_SETRLIMIT_ancilliary(DATA)
|
---|
2104 | GLIBCPP_CHECK_SETRLIMIT_ancilliary(RSS)
|
---|
2105 | GLIBCPP_CHECK_SETRLIMIT_ancilliary(VMEM)
|
---|
2106 | GLIBCPP_CHECK_SETRLIMIT_ancilliary(AS)
|
---|
2107 |
|
---|
2108 | # Check for rlimit, setrlimit.
|
---|
2109 | AC_CACHE_VAL(ac_setrlimit, [
|
---|
2110 | AC_TRY_COMPILE([#include <unistd.h>
|
---|
2111 | #include <sys/time.h>
|
---|
2112 | #include <sys/resource.h>
|
---|
2113 | ],
|
---|
2114 | [ struct rlimit r; setrlimit(0, &r);],
|
---|
2115 | [ac_setrlimit=yes], [ac_setrlimit=no])
|
---|
2116 | ])
|
---|
2117 | fi
|
---|
2118 |
|
---|
2119 | AC_MSG_CHECKING([for testsuite memory limit support])
|
---|
2120 | if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then
|
---|
2121 | ac_mem_limits=yes
|
---|
2122 | AC_DEFINE(_GLIBCPP_MEM_LIMITS)
|
---|
2123 | else
|
---|
2124 | ac_mem_limits=no
|
---|
2125 | fi
|
---|
2126 | AC_MSG_RESULT($ac_mem_limits)
|
---|
2127 | ])
|
---|
2128 |
|
---|
2129 |
|
---|
2130 | dnl
|
---|
2131 | dnl Does any necessary configuration of the testsuite directory. Generates
|
---|
2132 | dnl the testsuite_hooks.h header.
|
---|
2133 | dnl
|
---|
2134 | dnl GLIBCPP_CONFIGURE_TESTSUITE [no args]
|
---|
2135 | AC_DEFUN(GLIBCPP_CONFIGURE_TESTSUITE, [
|
---|
2136 | if test x"$GLIBCPP_IS_CROSS_COMPILING" = xfalse; then
|
---|
2137 | # Do checks for memory limit functions.
|
---|
2138 | GLIBCPP_CHECK_SETRLIMIT
|
---|
2139 |
|
---|
2140 | # Look for setenv, so that extended locale tests can be performed.
|
---|
2141 | GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
|
---|
2142 | fi
|
---|
2143 |
|
---|
2144 | # Export file names for ABI checking.
|
---|
2145 | baseline_dir="${glibcpp_srcdir}/config/abi/${abi_baseline_pair}\$(MULTISUBDIR)"
|
---|
2146 | AC_SUBST(baseline_dir)
|
---|
2147 |
|
---|
2148 | # Determine if checking the ABI is desirable.
|
---|
2149 | # Only build this as native, since automake does not understand
|
---|
2150 | # CXX_FOR_BUILD.
|
---|
2151 | if test x"$GLIBCPP_IS_CROSS_COMPILING" = xtrue || test x$enable_symvers = xno; then
|
---|
2152 | enable_abi_check=no
|
---|
2153 | else
|
---|
2154 | case "$host" in
|
---|
2155 | *-*-cygwin*)
|
---|
2156 | enable_abi_check=no ;;
|
---|
2157 | *)
|
---|
2158 | enable_abi_check=yes ;;
|
---|
2159 | esac
|
---|
2160 | fi
|
---|
2161 | AM_CONDITIONAL(GLIBCPP_TEST_ABI, test "$enable_abi_check" = yes)
|
---|
2162 | ])
|
---|
2163 |
|
---|
2164 |
|
---|
2165 | sinclude(../libtool.m4)
|
---|
2166 | dnl The lines below arrange for aclocal not to bring an installed
|
---|
2167 | dnl libtool.m4 into aclocal.m4, while still arranging for automake to
|
---|
2168 | dnl add a definition of LIBTOOL to Makefile.in.
|
---|
2169 | ifelse(,,,[AC_SUBST(LIBTOOL)
|
---|
2170 | AC_DEFUN([AM_PROG_LIBTOOL])
|
---|
2171 | AC_DEFUN([AC_LIBTOOL_DLOPEN])
|
---|
2172 | AC_DEFUN([AC_PROG_LD])
|
---|
2173 | ])
|
---|
2174 |
|
---|
2175 | dnl
|
---|
2176 | dnl Check whether S_ISREG (Posix) or S_IFREG is available in <sys/stat.h>.
|
---|
2177 | dnl
|
---|
2178 |
|
---|
2179 | AC_DEFUN(GLIBCPP_CHECK_S_ISREG_OR_S_IFREG, [
|
---|
2180 | AC_CACHE_VAL(glibcpp_cv_S_ISREG, [
|
---|
2181 | AC_TRY_LINK([#include <sys/stat.h>],
|
---|
2182 | [struct stat buffer; fstat(0, &buffer); S_ISREG(buffer.st_mode); ],
|
---|
2183 | [glibcpp_cv_S_ISREG=yes],
|
---|
2184 | [glibcpp_cv_S_ISREG=no])
|
---|
2185 | ])
|
---|
2186 | AC_CACHE_VAL(glibcpp_cv_S_IFREG, [
|
---|
2187 | AC_TRY_LINK([#include <sys/stat.h>],
|
---|
2188 | [struct stat buffer; fstat(0, &buffer); S_IFREG & buffer.st_mode; ],
|
---|
2189 | [glibcpp_cv_S_IFREG=yes],
|
---|
2190 | [glibcpp_cv_S_IFREG=no])
|
---|
2191 | ])
|
---|
2192 | if test x$glibcpp_cv_S_ISREG = xyes; then
|
---|
2193 | AC_DEFINE(HAVE_S_ISREG)
|
---|
2194 | elif test x$glibcpp_cv_S_IFREG = xyes; then
|
---|
2195 | AC_DEFINE(HAVE_S_IFREG)
|
---|
2196 | fi
|
---|
2197 | ])
|
---|
2198 |
|
---|
2199 | dnl
|
---|
2200 | dnl Check whether poll is available in <poll.h>.
|
---|
2201 | dnl
|
---|
2202 |
|
---|
2203 | AC_DEFUN(GLIBCPP_CHECK_POLL, [
|
---|
2204 | AC_CACHE_VAL(glibcpp_cv_POLL, [
|
---|
2205 | AC_TRY_COMPILE([#include <poll.h>],
|
---|
2206 | [struct pollfd pfd[1]; pfd[0].events = POLLIN; poll(pfd, 1, 0); ],
|
---|
2207 | [glibcpp_cv_POLL=yes],
|
---|
2208 | [glibcpp_cv_POLL=no])
|
---|
2209 | ])
|
---|
2210 | if test x$glibcpp_cv_POLL = xyes; then
|
---|
2211 | AC_DEFINE(HAVE_POLL)
|
---|
2212 | fi
|
---|
2213 | ])
|
---|
2214 |
|
---|
2215 | # Check whether LC_MESSAGES is available in <locale.h>.
|
---|
2216 | # Ulrich Drepper <drepper@cygnus.com>, 1995.
|
---|
2217 | #
|
---|
2218 | # This file file be copied and used freely without restrictions. It can
|
---|
2219 | # be used in projects which are not available under the GNU Public License
|
---|
2220 | # but which still want to provide support for the GNU gettext functionality.
|
---|
2221 | # Please note that the actual code is *not* freely available.
|
---|
2222 |
|
---|
2223 | # serial 1
|
---|
2224 |
|
---|
2225 | AC_DEFUN(AC_LC_MESSAGES, [
|
---|
2226 | AC_CHECK_HEADER(locale.h, [
|
---|
2227 | AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
|
---|
2228 | [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
|
---|
2229 | ac_cv_val_LC_MESSAGES=yes, ac_cv_val_LC_MESSAGES=no)])
|
---|
2230 | if test $ac_cv_val_LC_MESSAGES = yes; then
|
---|
2231 | AC_DEFINE(HAVE_LC_MESSAGES)
|
---|
2232 | fi
|
---|
2233 | ])
|
---|
2234 | ])
|
---|
2235 |
|
---|
2236 |
|
---|
2237 | dnl
|
---|
2238 | dnl Check for whether the Boost-derived checks should be turned on.
|
---|
2239 | dnl
|
---|
2240 | dnl GLIBCPP_ENABLE_CONCEPT_CHECKS
|
---|
2241 | dnl --enable-concept-checks turns them on.
|
---|
2242 | dnl --disable-concept-checks leaves them off.
|
---|
2243 | dnl + Usage: GLIBCPP_ENABLE_CONCEPT_CHECKS[(DEFAULT)]
|
---|
2244 | dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
|
---|
2245 | dnl defaults to `no'.
|
---|
2246 | AC_DEFUN(GLIBCPP_ENABLE_CONCEPT_CHECKS, [dnl
|
---|
2247 | define([GLIBCPP_ENABLE_CONCEPT_CHECKS_DEFAULT], ifelse($1, yes, yes, no))dnl
|
---|
2248 | AC_ARG_ENABLE(concept-checks,
|
---|
2249 | changequote(<<, >>)dnl
|
---|
2250 | << --enable-concept-checks use Boost-derived template checks [default=>>GLIBCPP_ENABLE_CONCEPT_CHECKS_DEFAULT],
|
---|
2251 | changequote([, ])dnl
|
---|
2252 | [case "$enableval" in
|
---|
2253 | yes) enable_concept_checks=yes ;;
|
---|
2254 | no) enable_concept_checks=no ;;
|
---|
2255 | *) AC_MSG_ERROR([Unknown argument to enable/disable concept checks]) ;;
|
---|
2256 | esac],
|
---|
2257 | enable_concept_checks=GLIBCPP_ENABLE_CONCEPT_CHECKS_DEFAULT)dnl
|
---|
2258 | dnl Option parsed, now set things appropriately
|
---|
2259 | if test x"$enable_concept_checks" = xyes; then
|
---|
2260 | AC_DEFINE(_GLIBCPP_CONCEPT_CHECKS)
|
---|
2261 | fi
|
---|
2262 | ])
|
---|
2263 |
|
---|
2264 |
|
---|
2265 | dnl
|
---|
2266 | dnl Add version tags to symbols in shared library (or not), additionally
|
---|
2267 | dnl marking other symbols as private/local (or not).
|
---|
2268 | dnl
|
---|
2269 | dnl GLIBCPP_ENABLE_SYMVERS
|
---|
2270 | dnl --enable-symvers=style adds a version script to the linker call when
|
---|
2271 | dnl creating the shared library. The choice of version script is
|
---|
2272 | dnl controlled by 'style'.
|
---|
2273 | dnl --disable-symvers does not.
|
---|
2274 | dnl + Usage: GLIBCPP_ENABLE_SYMVERS[(DEFAULT)]
|
---|
2275 | dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
|
---|
2276 | dnl defaults to `no'. Passing `yes' tries to choose a default style
|
---|
2277 | dnl based on linker characteristics. Passing 'no' disables versioning.
|
---|
2278 | AC_DEFUN(GLIBCPP_ENABLE_SYMVERS, [dnl
|
---|
2279 | define([GLIBCPP_ENABLE_SYMVERS_DEFAULT], ifelse($1, yes, yes, no))dnl
|
---|
2280 | AC_ARG_ENABLE(symvers,
|
---|
2281 | changequote(<<, >>)dnl
|
---|
2282 | << --enable-symvers=style enables symbol versioning of the shared library [default=>>GLIBCPP_ENABLE_SYMVERS_DEFAULT],
|
---|
2283 | changequote([, ])dnl
|
---|
2284 | [case "$enableval" in
|
---|
2285 | yes) enable_symvers=yes ;;
|
---|
2286 | no) enable_symvers=no ;;
|
---|
2287 | # other names here, just as sanity checks
|
---|
2288 | #gnu|sun|etcetera) enable_symvers=$enableval ;;
|
---|
2289 | gnu) enable_symvers=$enableval ;;
|
---|
2290 | *) AC_MSG_ERROR([Unknown argument to enable/disable symvers]) ;;
|
---|
2291 | esac],
|
---|
2292 | enable_symvers=GLIBCPP_ENABLE_SYMVERS_DEFAULT)dnl
|
---|
2293 |
|
---|
2294 | # If we never went through the GLIBCPP_CHECK_LINKER_FEATURES macro, then we
|
---|
2295 | # don't know enough about $LD to do tricks...
|
---|
2296 | if test x$enable_shared = xno ||
|
---|
2297 | test "x$LD" = x ||
|
---|
2298 | test x$glibcpp_gnu_ld_version = x; then
|
---|
2299 | enable_symvers=no
|
---|
2300 | fi
|
---|
2301 |
|
---|
2302 | # Check to see if libgcc_s exists, indicating that shared libgcc is possible.
|
---|
2303 | if test $enable_symvers != no; then
|
---|
2304 | AC_MSG_CHECKING([for shared libgcc])
|
---|
2305 | ac_save_CFLAGS="$CFLAGS"
|
---|
2306 | CFLAGS=' -lgcc_s'
|
---|
2307 | AC_TRY_LINK(, [return 0], glibcpp_shared_libgcc=yes, glibcpp_shared_libgcc=no)
|
---|
2308 | CFLAGS="$ac_save_CFLAGS"
|
---|
2309 | AC_MSG_RESULT($glibcpp_shared_libgcc)
|
---|
2310 | fi
|
---|
2311 |
|
---|
2312 | # For GNU ld, we need at least this version. It's 2.12 in the same format
|
---|
2313 | # as the tested-for version. See GLIBCPP_CHECK_LINKER_FEATURES for more.
|
---|
2314 | glibcpp_min_gnu_ld_version=21200
|
---|
2315 |
|
---|
2316 | # Check to see if unspecified "yes" value can win, given results
|
---|
2317 | # above.
|
---|
2318 | if test $enable_symvers = yes ; then
|
---|
2319 | if test $with_gnu_ld = yes &&
|
---|
2320 | test $glibcpp_shared_libgcc = yes ;
|
---|
2321 | then
|
---|
2322 | if test $glibcpp_gnu_ld_version -ge $glibcpp_min_gnu_ld_version ; then
|
---|
2323 | enable_symvers=gnu
|
---|
2324 | else
|
---|
2325 | ac_test_CFLAGS="${CFLAGS+set}"
|
---|
2326 | ac_save_CFLAGS="$CFLAGS"
|
---|
2327 | CFLAGS='-shared -Wl,--version-script,conftest.map'
|
---|
2328 | enable_symvers=no
|
---|
2329 | changequote(,)
|
---|
2330 | echo 'FOO { global: f[a-z]o; local: *; };' > conftest.map
|
---|
2331 | changequote([,])
|
---|
2332 | AC_TRY_LINK([int foo;],, enable_symvers=gnu)
|
---|
2333 | if test "$ac_test_CFLAGS" = set; then
|
---|
2334 | CFLAGS="$ac_save_CFLAGS"
|
---|
2335 | else
|
---|
2336 | # this is the suspicious part
|
---|
2337 | CFLAGS=''
|
---|
2338 | fi
|
---|
2339 | rm -f conftest.map
|
---|
2340 | fi
|
---|
2341 | else
|
---|
2342 | # just fail for now
|
---|
2343 | enable_symvers=no
|
---|
2344 | fi
|
---|
2345 | fi
|
---|
2346 |
|
---|
2347 | dnl Everything parsed; figure out what file to use.
|
---|
2348 | case $enable_symvers in
|
---|
2349 | no)
|
---|
2350 | SYMVER_MAP=config/linker-map.dummy
|
---|
2351 | ;;
|
---|
2352 | gnu)
|
---|
2353 | SYMVER_MAP=config/linker-map.gnu
|
---|
2354 | AC_DEFINE(_GLIBCPP_SYMVER)
|
---|
2355 | ;;
|
---|
2356 | esac
|
---|
2357 |
|
---|
2358 | AC_SUBST(SYMVER_MAP)
|
---|
2359 | AM_CONDITIONAL(GLIBCPP_BUILD_VERSIONED_SHLIB, test $enable_symvers != no)
|
---|
2360 | AC_MSG_CHECKING([versioning on shared library symbols])
|
---|
2361 | AC_MSG_RESULT($enable_symvers)
|
---|
2362 | ])
|
---|
2363 |
|
---|
2364 |
|
---|
2365 | # isc-posix.m4 serial 1 (gettext-0.10.40)
|
---|
2366 | dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
|
---|
2367 | dnl This file is free software, distributed under the terms of the GNU
|
---|
2368 | dnl General Public License. As a special exception to the GNU General
|
---|
2369 | dnl Public License, this file may be distributed as part of a program
|
---|
2370 | dnl that contains a configuration script generated by Autoconf, under
|
---|
2371 | dnl the same distribution terms as the rest of that program.
|
---|
2372 |
|
---|
2373 | # This test replaces the one in autoconf.
|
---|
2374 | # Currently this macro should have the same name as the autoconf macro
|
---|
2375 | # because gettext's gettext.m4 (distributed in the automake package)
|
---|
2376 | # still uses it. Otherwise, the use in gettext.m4 makes autoheader
|
---|
2377 | # give these diagnostics:
|
---|
2378 | # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
|
---|
2379 | # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
|
---|
2380 |
|
---|
2381 | undefine([AC_ISC_POSIX])
|
---|
2382 |
|
---|
2383 | AC_DEFUN([AC_ISC_POSIX],
|
---|
2384 | [
|
---|
2385 | dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
|
---|
2386 | AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
|
---|
2387 | ]
|
---|
2388 | )
|
---|
2389 |
|
---|
2390 | # Add --enable-maintainer-mode option to configure.
|
---|
2391 | # From Jim Meyering
|
---|
2392 |
|
---|
2393 | # serial 1
|
---|
2394 |
|
---|
2395 | AC_DEFUN([AM_MAINTAINER_MODE],
|
---|
2396 | [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
|
---|
2397 | dnl maintainer-mode is disabled by default
|
---|
2398 | AC_ARG_ENABLE(maintainer-mode,
|
---|
2399 | [ --enable-maintainer-mode enable make rules and dependencies not useful
|
---|
2400 | (and sometimes confusing) to the casual installer],
|
---|
2401 | USE_MAINTAINER_MODE=$enableval,
|
---|
2402 | USE_MAINTAINER_MODE=no)
|
---|
2403 | AC_MSG_RESULT($USE_MAINTAINER_MODE)
|
---|
2404 | AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
|
---|
2405 | MAINT=$MAINTAINER_MODE_TRUE
|
---|
2406 | AC_SUBST(MAINT)dnl
|
---|
2407 | ]
|
---|
2408 | )
|
---|
2409 |
|
---|
2410 | # Define a conditional.
|
---|
2411 |
|
---|
2412 | AC_DEFUN([AM_CONDITIONAL],
|
---|
2413 | [AC_SUBST($1_TRUE)
|
---|
2414 | AC_SUBST($1_FALSE)
|
---|
2415 | if $2; then
|
---|
2416 | $1_TRUE=
|
---|
2417 | $1_FALSE='#'
|
---|
2418 | else
|
---|
2419 | $1_TRUE='#'
|
---|
2420 | $1_FALSE=
|
---|
2421 | fi])
|
---|
2422 |
|
---|
2423 | # Do all the work for Automake. This macro actually does too much --
|
---|
2424 | # some checks are only needed if your package does certain things.
|
---|
2425 | # But this isn't really a big deal.
|
---|
2426 |
|
---|
2427 | # serial 1
|
---|
2428 |
|
---|
2429 | dnl Usage:
|
---|
2430 | dnl AM_INIT_AUTOMAKE(package,version, [no-define])
|
---|
2431 |
|
---|
2432 | AC_DEFUN([AM_INIT_AUTOMAKE],
|
---|
2433 | [AC_REQUIRE([AC_PROG_INSTALL])
|
---|
2434 | PACKAGE=[$1]
|
---|
2435 | AC_SUBST(PACKAGE)
|
---|
2436 | VERSION=[$2]
|
---|
2437 | AC_SUBST(VERSION)
|
---|
2438 | dnl test to see if srcdir already configured
|
---|
2439 | if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
|
---|
2440 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
---|
2441 | fi
|
---|
2442 | ifelse([$3],,
|
---|
2443 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
---|
2444 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
|
---|
2445 | AC_REQUIRE([AM_SANITY_CHECK])
|
---|
2446 | AC_REQUIRE([AC_ARG_PROGRAM])
|
---|
2447 | dnl FIXME This is truly gross.
|
---|
2448 | missing_dir=`cd $ac_aux_dir && pwd`
|
---|
2449 | AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
|
---|
2450 | AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
|
---|
2451 | AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
|
---|
2452 | AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
|
---|
2453 | AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
|
---|
2454 | AC_REQUIRE([AC_PROG_MAKE_SET])])
|
---|
2455 |
|
---|
2456 | #
|
---|
2457 | # Check to make sure that the build environment is sane.
|
---|
2458 | #
|
---|
2459 |
|
---|
2460 | AC_DEFUN([AM_SANITY_CHECK],
|
---|
2461 | [AC_MSG_CHECKING([whether build environment is sane])
|
---|
2462 | # Just in case
|
---|
2463 | sleep 1
|
---|
2464 | echo timestamp > conftestfile
|
---|
2465 | # Do `set' in a subshell so we don't clobber the current shell's
|
---|
2466 | # arguments. Must try -L first in case configure is actually a
|
---|
2467 | # symlink; some systems play weird games with the mod time of symlinks
|
---|
2468 | # (eg FreeBSD returns the mod time of the symlink's containing
|
---|
2469 | # directory).
|
---|
2470 | if (
|
---|
2471 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
|
---|
2472 | if test "[$]*" = "X"; then
|
---|
2473 | # -L didn't work.
|
---|
2474 | set X `ls -t $srcdir/configure conftestfile`
|
---|
2475 | fi
|
---|
2476 | if test "[$]*" != "X $srcdir/configure conftestfile" \
|
---|
2477 | && test "[$]*" != "X conftestfile $srcdir/configure"; then
|
---|
2478 |
|
---|
2479 | # If neither matched, then we have a broken ls. This can happen
|
---|
2480 | # if, for instance, CONFIG_SHELL is bash and it inherits a
|
---|
2481 | # broken ls alias from the environment. This has actually
|
---|
2482 | # happened. Such a system could not be considered "sane".
|
---|
2483 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
---|
2484 | alias in your environment])
|
---|
2485 | fi
|
---|
2486 |
|
---|
2487 | test "[$]2" = conftestfile
|
---|
2488 | )
|
---|
2489 | then
|
---|
2490 | # Ok.
|
---|
2491 | :
|
---|
2492 | else
|
---|
2493 | AC_MSG_ERROR([newly created file is older than distributed files!
|
---|
2494 | Check your system clock])
|
---|
2495 | fi
|
---|
2496 | rm -f conftest*
|
---|
2497 | AC_MSG_RESULT(yes)])
|
---|
2498 |
|
---|
2499 | dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
|
---|
2500 | dnl The program must properly implement --version.
|
---|
2501 | AC_DEFUN([AM_MISSING_PROG],
|
---|
2502 | [AC_MSG_CHECKING(for working $2)
|
---|
2503 | # Run test in a subshell; some versions of sh will print an error if
|
---|
2504 | # an executable is not found, even if stderr is redirected.
|
---|
2505 | # Redirect stdin to placate older versions of autoconf. Sigh.
|
---|
2506 | if ($2 --version) < /dev/null > /dev/null 2>&1; then
|
---|
2507 | $1=$2
|
---|
2508 | AC_MSG_RESULT(found)
|
---|
2509 | else
|
---|
2510 | $1="$3/missing $2"
|
---|
2511 | AC_MSG_RESULT(missing)
|
---|
2512 | fi
|
---|
2513 | AC_SUBST($1)])
|
---|
2514 |
|
---|
2515 | # Like AC_CONFIG_HEADER, but automatically create stamp file.
|
---|
2516 |
|
---|
2517 | AC_DEFUN([AM_CONFIG_HEADER],
|
---|
2518 | [AC_PREREQ([2.12])
|
---|
2519 | AC_CONFIG_HEADER([$1])
|
---|
2520 | dnl When config.status generates a header, we must update the stamp-h file.
|
---|
2521 | dnl This file resides in the same directory as the config header
|
---|
2522 | dnl that is generated. We must strip everything past the first ":",
|
---|
2523 | dnl and everything past the last "/".
|
---|
2524 | AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
|
---|
2525 | ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
|
---|
2526 | <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
|
---|
2527 | <<am_indx=1
|
---|
2528 | for am_file in <<$1>>; do
|
---|
2529 | case " <<$>>CONFIG_HEADERS " in
|
---|
2530 | *" <<$>>am_file "*<<)>>
|
---|
2531 | echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
|
---|
2532 | ;;
|
---|
2533 | esac
|
---|
2534 | am_indx=`expr "<<$>>am_indx" + 1`
|
---|
2535 | done<<>>dnl>>)
|
---|
2536 | changequote([,]))])
|
---|
2537 |
|
---|