- # Calculate glibcxx_toolexecdir, glibcxx_toolexeclibdir
- # Install a library built with a cross compiler in tooldir, not libdir.
- if test x"$glibcxx_toolexecdir" = x"no"; then
- if test -n "$with_cross_host" &&
- test x"$with_cross_host" != x"no"; then
- glibcxx_toolexecdir='$(exec_prefix)/$(host_alias)'
- glibcxx_toolexeclibdir='$(toolexecdir)/lib'
- else
- glibcxx_toolexecdir='$(libdir)/gcc-lib/$(host_alias)'
- glibcxx_toolexeclibdir='$(libdir)'
- fi
- multi_os_directory=`$CC -print-multi-os-directory`
- case $multi_os_directory in
- .) ;; # Avoid trailing /.
- *) glibcxx_toolexeclibdir=$glibcxx_toolexeclibdir/$multi_os_directory ;;
- esac
- fi
-
- AC_MSG_CHECKING([for install location])
- AC_MSG_RESULT($gxx_include_dir)
-
- AC_SUBST(glibcxx_prefixdir)
- AC_SUBST(gxx_include_dir)
- AC_SUBST(glibcxx_toolexecdir)
- AC_SUBST(glibcxx_toolexeclibdir)
-])
-
-
-dnl
-dnl GLIBCXX_ENABLE
-dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING)
-dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, permit a|b|c)
-dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, SHELL-CODE-HANDLER)
-dnl
-dnl See docs/html/17_intro/configury.html#enable for documentation.
-dnl
-m4_define([GLIBCXX_ENABLE],[dnl
-m4_define([_g_switch],[--enable-$1])dnl
-m4_define([_g_help],[AC_HELP_STRING(_g_switch$3,[$4 @<:@default=$2@:>@])])dnl
- AC_ARG_ENABLE($1,_g_help,
- m4_bmatch([$5],
- [^permit ],
- [[
- case "$enableval" in
- m4_bpatsubst([$5],[permit ])) ;;
- *) AC_MSG_ERROR(Unknown argument to enable/disable $1) ;;
- dnl Idea for future: generate a URL pointing to
- dnl "onlinedocs/configopts.html#whatever"
- esac
- ]],
- [^$],
- [[
- case "$enableval" in
- yes|no) ;;
- *) AC_MSG_ERROR(Argument to enable/disable $1 must be yes or no) ;;
- esac
- ]],
- [[$5]]),
- [enable_]m4_bpatsubst([$1],-,_)[=][$2])
-m4_undefine([_g_switch])dnl
-m4_undefine([_g_help])dnl
-])
-
-
-dnl
-dnl Check for ISO/IEC 9899:1999 "C99" support.
-dnl
-dnl --enable-c99 defines _GLIBCXX_USE_C99
-dnl --disable-c99 leaves _GLIBCXX_USE_C99 undefined
-dnl + Usage: GLIBCXX_ENABLE_C99[(DEFAULT)]
-dnl Where DEFAULT is either `yes' or `no'.
-dnl + If 'C99' stuff is not available, ignores DEFAULT and sets `no'.
-dnl
-AC_DEFUN(GLIBCXX_ENABLE_C99, [
- GLIBCXX_ENABLE(c99,$1,,[turns on ISO/IEC 9899:1999 support])
-
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
-
- # Check for the existence of <math.h> functions used if C99 is enabled.
- ac_c99_math=yes;
- AC_MSG_CHECKING([for ISO C99 support in <math.h>])
- AC_TRY_COMPILE([#include <math.h>],[fpclassify(0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],[isfinite(0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],[isinf(0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],[isnan(0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],[isnormal(0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],[signbit(0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],[isgreater(0.0,0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],
- [isgreaterequal(0.0,0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],[isless(0.0,0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],[islessequal(0.0,0.0);],,[ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],
- [islessgreater(0.0,0.0);],, [ac_c99_math=no])
- AC_TRY_COMPILE([#include <math.h>],
- [isunordered(0.0,0.0);],, [ac_c99_math=no])
- AC_MSG_RESULT($ac_c99_math)
-
- # Check for the existence in <stdio.h> of vscanf, et. al.
- ac_c99_stdio=yes;
- AC_MSG_CHECKING([for ISO C99 support in <stdio.h>])
- AC_TRY_COMPILE([#include <stdio.h>],
- [snprintf("12", 0, "%i");],, [ac_c99_stdio=no])
- AC_TRY_COMPILE([#include <stdio.h>
- #include <stdarg.h>
- void foo(char* fmt, ...)
- {va_list args; va_start(args, fmt);
- vfscanf(stderr, "%i", args);}],
- [],, [ac_c99_stdio=no])
- AC_TRY_COMPILE([#include <stdio.h>
- #include <stdarg.h>
- void foo(char* fmt, ...)
- {va_list args; va_start(args, fmt);
- vscanf("%i", args);}],
- [],, [ac_c99_stdio=no])
- AC_TRY_COMPILE([#include <stdio.h>
- #include <stdarg.h>
- void foo(char* fmt, ...)
- {va_list args; va_start(args, fmt);
- vsnprintf(fmt, 0, "%i", args);}],
- [],, [ac_c99_stdio=no])
- AC_TRY_COMPILE([#include <stdio.h>
- #include <stdarg.h>
- void foo(char* fmt, ...)
- {va_list args; va_start(args, fmt);
- vsscanf(fmt, "%i", args);}],
- [],, [ac_c99_stdio=no])
- AC_MSG_RESULT($ac_c99_stdio)
-
- # Check for the existence in <stdlib.h> of lldiv_t, et. al.
- ac_c99_stdlib=yes;
- AC_MSG_CHECKING([for lldiv_t declaration])
- AC_CACHE_VAL(ac_c99_lldiv_t, [
- AC_TRY_COMPILE([#include <stdlib.h>],
- [ lldiv_t mydivt;],
- [ac_c99_lldiv_t=yes], [ac_c99_lldiv_t=no])
- ])
- AC_MSG_RESULT($ac_c99_lldiv_t)
-
- AC_MSG_CHECKING([for ISO C99 support in <stdlib.h>])
- AC_TRY_COMPILE([#include <stdlib.h>],
- [char* tmp; strtof("gnu", &tmp);],, [ac_c99_stdlib=no])
- AC_TRY_COMPILE([#include <stdlib.h>],
- [char* tmp; strtold("gnu", &tmp);],, [ac_c99_stdlib=no])
- AC_TRY_COMPILE([#include <stdlib.h>], [llabs(10);],, [ac_c99_stdlib=no])
- AC_TRY_COMPILE([#include <stdlib.h>], [lldiv(10,1);],, [ac_c99_stdlib=no])
- AC_TRY_COMPILE([#include <stdlib.h>], [atoll("10");],, [ac_c99_stdlib=no])
- AC_TRY_COMPILE([#include <stdlib.h>], [_Exit(0);],, [ac_c99_stdlib=no])
- if test x"$ac_c99_lldiv_t" = x"no"; then
- ac_c99_stdlib=no;
- fi;
- AC_MSG_RESULT($ac_c99_stdlib)
-
- # Check for the existence of <wchar.h> functions used if C99 is enabled.
- # XXX the wchar.h checks should be rolled into the general C99 bits.
- ac_c99_wchar=yes;
- AC_MSG_CHECKING([for additional ISO C99 support in <wchar.h>])
- AC_TRY_COMPILE([#include <wchar.h>],
- [wcstold(L"10.0", NULL);],, [ac_c99_wchar=no])
- AC_TRY_COMPILE([#include <wchar.h>],
- [wcstoll(L"10", NULL, 10);],, [ac_c99_wchar=no])
- AC_TRY_COMPILE([#include <wchar.h>],
- [wcstoull(L"10", NULL, 10);],, [ac_c99_wchar=no])
- AC_MSG_RESULT($ac_c99_wchar)
-
- AC_MSG_CHECKING([for enabled ISO C99 support])
- if test x"$ac_c99_math" = x"no" ||
- test x"$ac_c99_stdio" = x"no" ||
- test x"$ac_c99_stdlib" = x"no" ||
- test x"$ac_c99_wchar" = x"no"; then
- enable_c99=no;
- fi;
- AC_MSG_RESULT($enable_c99)
-
- # Option parsed, now set things appropriately
- if test x"$enable_c99" = x"yes"; then
- AC_DEFINE(_GLIBCXX_USE_C99)
- fi
-
- AC_LANG_RESTORE
-])
-
-
-dnl
-dnl Check for what type of C headers to use.
-dnl
-dnl --enable-cheaders= [does stuff].
-dnl --disable-cheaders [does not do anything, really].
-dnl + Usage: GLIBCXX_ENABLE_CHEADERS[(DEFAULT)]
-dnl Where DEFAULT is either `c' or `c_std'.
-dnl
-AC_DEFUN(GLIBCXX_ENABLE_CHEADERS, [
- GLIBCXX_ENABLE(cheaders,$1,[=KIND],
- [construct "C" headers for g++], [permit c|c_std])
- AC_MSG_NOTICE("C" header strategy set to $enable_cheaders)
-
- C_INCLUDE_DIR='${glibcxx_srcdir}/include/'$enable_cheaders
-
- AC_SUBST(C_INCLUDE_DIR)
- AM_CONDITIONAL(GLIBCXX_C_HEADERS_C, test $enable_cheaders = c)
- AM_CONDITIONAL(GLIBCXX_C_HEADERS_C_STD, test $enable_cheaders = c_std)
- AM_CONDITIONAL(GLIBCXX_C_HEADERS_COMPATIBILITY, test $c_compatibility = yes)
-])
-
-
-dnl
-dnl Check for which locale library to use. The choice is mapped to
-dnl a subdirectory of config/locale.
-dnl
-dnl Default is generic.
-dnl
-AC_DEFUN(GLIBCXX_ENABLE_CLOCALE, [
- AC_MSG_CHECKING([for C locale to use])
- GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
- [use MODEL for target locale package],
- [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
-
- # If they didn't use this option switch, or if they specified --enable
- # with no specific model, we'll have to look for one. If they
- # specified --disable (???), do likewise.
- if test $enable_clocale = no || test $enable_clocale = yes; then
- enable_clocale=auto
- fi
-
- # Either a known package, or "auto"
- enable_clocale_flag=$enable_clocale
-
- # Probe for locale support if no specific model is specified.
- # Default to "generic".
- if test $enable_clocale_flag = auto; then
- case x${target_os} in
- xlinux* | xgnu*)
- AC_EGREP_CPP([_GLIBCXX_ok], [
- #include <features.h>
- #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
- _GLIBCXX_ok
- #endif
- ], enable_clocale_flag=gnu, enable_clocale_flag=generic)
-
- # Test for bugs early in glibc-2.2.x series
- if test x$enable_clocale_flag = xgnu; then
- AC_TRY_RUN([
- #define _GNU_SOURCE 1
- #include <locale.h>
- #include <string.h>
- #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
- extern __typeof(newlocale) __newlocale;
- extern __typeof(duplocale) __duplocale;
- extern __typeof(strcoll_l) __strcoll_l;
- #endif
- int main()
- {
- const char __one[] = "Äuglein Augmen";
- const char __two[] = "Äuglein";
- int i;
- int j;
- __locale_t loc;
- __locale_t loc_dup;
- loc = __newlocale(1 << LC_ALL, "de_DE", 0);
- loc_dup = __duplocale(loc);
- i = __strcoll_l(__one, __two, loc);
- j = __strcoll_l(__one, __two, loc_dup);
- return 0;
- }
- ],
- [enable_clocale_flag=gnu],[enable_clocale_flag=generic],
- [enable_clocale_flag=generic])
- fi
-
- # ... at some point put __strxfrm_l tests in as well.
- ;;
- *)
- enable_clocale_flag=generic
- ;;
- esac
- fi
-
- # Deal with gettext issues. Default to not using it (=no) until we detect
- # support for it later. Let the user turn it off via --e/d, but let that
- # default to on for easier handling.
- USE_NLS=no
- AC_ARG_ENABLE(nls,
- AC_HELP_STRING([--enable-nls],[use Native Language Support (default)]),
- [],
- [enable_nls=yes])
-
- # Set configure bits for specified locale package
- case ${enable_clocale_flag} in
- generic)
- AC_MSG_RESULT(generic)
-
- CLOCALE_H=config/locale/generic/c_locale.h
- CLOCALE_CC=config/locale/generic/c_locale.cc
- CCODECVT_H=config/locale/generic/codecvt_specializations.h
- CCODECVT_CC=config/locale/generic/codecvt_members.cc
- CCOLLATE_CC=config/locale/generic/collate_members.cc
- CCTYPE_CC=config/locale/generic/ctype_members.cc
- CMESSAGES_H=config/locale/generic/messages_members.h
- CMESSAGES_CC=config/locale/generic/messages_members.cc
- CMONEY_CC=config/locale/generic/monetary_members.cc
- CNUMERIC_CC=config/locale/generic/numeric_members.cc
- CTIME_H=config/locale/generic/time_members.h
- CTIME_CC=config/locale/generic/time_members.cc
- CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
- ;;
- gnu)
- AC_MSG_RESULT(gnu)
-
- # Declare intention to use gettext, and add support for specific
- # languages.
- # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
- ALL_LINGUAS="de fr"
-
- # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
- AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
- if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
- USE_NLS=yes
- fi
- # Export the build objects.
- for ling in $ALL_LINGUAS; do \
- glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
- glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
- done
- AC_SUBST(glibcxx_MOFILES)
- AC_SUBST(glibcxx_POFILES)
-
- CLOCALE_H=config/locale/gnu/c_locale.h
- CLOCALE_CC=config/locale/gnu/c_locale.cc
- CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
- CCODECVT_CC=config/locale/gnu/codecvt_members.cc
- CCOLLATE_CC=config/locale/gnu/collate_members.cc
- CCTYPE_CC=config/locale/gnu/ctype_members.cc
- CMESSAGES_H=config/locale/gnu/messages_members.h
- CMESSAGES_CC=config/locale/gnu/messages_members.cc
- CMONEY_CC=config/locale/gnu/monetary_members.cc
- CNUMERIC_CC=config/locale/gnu/numeric_members.cc
- CTIME_H=config/locale/gnu/time_members.h
- CTIME_CC=config/locale/gnu/time_members.cc
- CLOCALE_INTERNAL_H=config/locale/gnu/c++locale_internal.h
- ;;
- ieee_1003.1-2001)
- AC_MSG_RESULT(IEEE 1003.1)
-
- CLOCALE_H=config/locale/ieee_1003.1-2001/c_locale.h
- CLOCALE_CC=config/locale/ieee_1003.1-2001/c_locale.cc
- CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
- CCODECVT_CC=config/locale/generic/codecvt_members.cc
- CCOLLATE_CC=config/locale/generic/collate_members.cc
- CCTYPE_CC=config/locale/generic/ctype_members.cc
- CMESSAGES_H=config/locale/ieee_1003.1-2001/messages_members.h
- CMESSAGES_CC=config/locale/ieee_1003.1-2001/messages_members.cc
- CMONEY_CC=config/locale/generic/monetary_members.cc
- CNUMERIC_CC=config/locale/generic/numeric_members.cc
- CTIME_H=config/locale/generic/time_members.h
- CTIME_CC=config/locale/generic/time_members.cc
- CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
- ;;
- esac
-
- # This is where the testsuite looks for locale catalogs, using the
- # -DLOCALEDIR define during testsuite compilation.
- glibcxx_localedir=${glibcxx_builddir}/po/share/locale
- AC_SUBST(glibcxx_localedir)
-
- # A standalone libintl (e.g., GNU libintl) may be in use.
- if test $USE_NLS = yes; then
- AC_CHECK_HEADERS([libintl.h], [], USE_NLS=no)
- AC_SEARCH_LIBS(gettext, intl, [], USE_NLS=no)
- fi
- if test $USE_NLS = yes; then
- AC_DEFINE(_GLIBCXX_USE_NLS)
- fi
-
- AC_SUBST(USE_NLS)
- AC_SUBST(CLOCALE_H)
- AC_SUBST(CCODECVT_H)
- AC_SUBST(CMESSAGES_H)
- AC_SUBST(CCODECVT_CC)
- AC_SUBST(CCOLLATE_CC)
- AC_SUBST(CCTYPE_CC)
- AC_SUBST(CMESSAGES_CC)
- AC_SUBST(CMONEY_CC)
- AC_SUBST(CNUMERIC_CC)
- AC_SUBST(CTIME_H)
- AC_SUBST(CTIME_CC)
- AC_SUBST(CLOCALE_CC)
- AC_SUBST(CLOCALE_INTERNAL_H)
-])
-
-
-dnl
-dnl Check for whether the Boost-derived checks should be turned on.
-dnl
-dnl --enable-concept-checks turns them on.
-dnl --disable-concept-checks leaves them off.
-dnl + Usage: GLIBCXX_ENABLE_CONCEPT_CHECKS[(DEFAULT)]
-dnl Where DEFAULT is either `yes' or `no'.
-dnl
-AC_DEFUN(GLIBCXX_ENABLE_CONCEPT_CHECKS, [
- GLIBCXX_ENABLE(concept-checks,$1,,[use Boost-derived template checks])
- if test $enable_concept_checks = yes; then
- AC_DEFINE(_GLIBCXX_CONCEPT_CHECKS)
- fi
-])
-
-
-dnl
-dnl Check for which I/O library to use: stdio, or something specific.
-dnl
-dnl Default is stdio.
-dnl
-AC_DEFUN(GLIBCXX_ENABLE_CSTDIO, [
- AC_MSG_CHECKING([for underlying I/O to use])
- GLIBCXX_ENABLE(cstdio,stdio,[=PACKAGE],
- [use target-specific I/O package], [permit stdio])
-
- # Now that libio has been removed, you can have any color you want as long
- # as it's black. This is one big no-op until other packages are added, but
- # showing the framework never hurts.
- case ${enable_cstdio} in
- stdio)
- CSTDIO_H=config/io/c_io_stdio.h
- BASIC_FILE_H=config/io/basic_file_stdio.h
- BASIC_FILE_CC=config/io/basic_file_stdio.cc
- AC_MSG_RESULT(stdio)
- ;;
- esac
-
- dnl Set directory for fpos.h
- FPOS_H=$fpos_include_dir
-
- AC_SUBST(CSTDIO_H)
- AC_SUBST(FPOS_H)
- AC_SUBST(BASIC_FILE_H)
- AC_SUBST(BASIC_FILE_CC)
-])
-
-
-dnl
-dnl Check for "unusual" flags to pass to the compiler while building.
-dnl
-dnl --enable-cxx-flags='-foo -bar -baz' is a general method for passing
-dnl experimental flags such as -fpch, -fIMI, -Dfloat=char, etc.
-dnl --disable-cxx-flags passes nothing.
-dnl + See http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00131.html
-dnl http://gcc.gnu.org/ml/libstdc++/2000-q2/msg00284.html
-dnl http://gcc.gnu.org/ml/libstdc++/2000-q1/msg00035.html
-dnl + Usage: GLIBCXX_ENABLE_CXX_FLAGS(default flags)
-dnl If "default flags" is an empty string, the effect is the same
-dnl as --disable or --enable=no.
-dnl
-AC_DEFUN(GLIBCXX_ENABLE_CXX_FLAGS, [dnl
- AC_MSG_CHECKING([for extra compiler flags for building])
- GLIBCXX_ENABLE(cxx-flags,$1,[=FLAGS],
- [pass compiler FLAGS when building library],
- [case "x$enable_cxx_flags" in
- xno | x) enable_cxx_flags= ;;
- x-*) ;;
- *) AC_MSG_ERROR(_g_switch needs compiler flags as arguments) ;;
- esac])
-
- # Run through flags (either default or command-line) and set anything
- # extra (e.g., #defines) that must accompany particular g++ options.
- if test -n "$enable_cxx_flags"; then
- for f in $enable_cxx_flags; do
- case "$f" in
- -fhonor-std) ;;
- -*) ;;
- *) # and we're trying to pass /what/ exactly?
- AC_MSG_ERROR([compiler flags start with a -]) ;;
- esac
- done
- fi
-
- EXTRA_CXX_FLAGS="$enable_cxx_flags"
- AC_MSG_RESULT($EXTRA_CXX_FLAGS)
- AC_SUBST(EXTRA_CXX_FLAGS)
-])
-
-
-dnl
-dnl Check for wide character support. Has the same effect as the option
-dnl in gcc's configure, but in a form that autoconf can mess with.
-dnl
-dnl --enable-c-mbchar requests all the wchar_t stuff.
-dnl --disable-c-mbchar doesn't.
-dnl + Usage: GLIBCXX_ENABLE_C_MBCHAR[(DEFAULT)]
-dnl Where DEFAULT is either `yes' or `no'.
-dnl
-AC_DEFUN(GLIBCXX_ENABLE_C_MBCHAR, [
- GLIBCXX_ENABLE(c-mbchar,$1,,[enable multibyte (wide) characters])
- # Option parsed, now other scripts can test enable_c_mbchar for yes/no.
-])
-
-
-dnl
-dnl Check to see if debugging libraries are to be built.
-dnl
-dnl --enable-libstdcxx-debug
-dnl builds a separate set of debugging libraries in addition to the
-dnl normal (shared, static) libstdc++ binaries.
-dnl
-dnl --disable-libstdcxx-debug
-dnl builds only one (non-debug) version of libstdc++.
-dnl
-dnl --enable-libstdcxx-debug-flags=FLAGS
-dnl iff --enable-debug == yes, then use FLAGS to build the debug library.
-dnl
-dnl + Usage: GLIBCXX_ENABLE_DEBUG[(DEFAULT)]
-dnl Where DEFAULT is either `yes' or `no'.
-dnl
-AC_DEFUN(GLIBCXX_ENABLE_DEBUG, [
- AC_MSG_CHECKING([for additional debug build])
- GLIBCXX_ENABLE(libstdcxx-debug,$1,,[build extra debug library])
- AC_MSG_RESULT($enable_libstdcxx_debug)
- AM_CONDITIONAL(GLIBCXX_BUILD_DEBUG, test $enable_libstdcxx_debug = yes)
-])
-
-
-dnl
-dnl Check for explicit debug flags.
-dnl
-dnl --enable-libstdcxx-debug-flags='-O1'
-dnl is a general method for passing flags to be used when
-dnl building debug libraries with --enable-debug.
-dnl
-dnl --disable-libstdcxx-debug-flags does nothing.
-dnl + Usage: GLIBCXX_ENABLE_DEBUG_FLAGS(default flags)
-dnl If "default flags" is an empty string, the effect is the same
-dnl as --disable or --enable=no.
-dnl
-AC_DEFUN(GLIBCXX_ENABLE_DEBUG_FLAGS, [
- GLIBCXX_ENABLE(libstdcxx-debug-flags,[$1],[=FLAGS],
- [pass compiler FLAGS when building debug library],
- [case "x$enable_libstdcxx_debug_flags" in
- xno | x) enable_libstdcxx_debug_flags= ;;
- x-*) ;;
- *) AC_MSG_ERROR(_g_switch needs compiler flags as arguments) ;;
- esac])
-
- # Option parsed, now set things appropriately
- DEBUG_FLAGS="$enable_libstdcxx_debug_flags"
- AC_SUBST(DEBUG_FLAGS)
-
- AC_MSG_NOTICE([Debug build flags set to $DEBUG_FLAGS])
-])
-
-
-dnl
-dnl Check for libunwind exception handling support. If enabled, then
-dnl we assume that the _Unwind_* functions that make up the Unwind ABI
-dnl (_Unwind_RaiseException, _Unwind_Resume, etc.) are defined by
-dnl libunwind instead of libgcc, and that libstdc++ has a dependency
-dnl on libunwind as well as libgcc.
-dnl
-dnl --enable-libunwind-exceptions forces the use of libunwind.
-dnl --disable-libunwind-exceptions assumes there is no libunwind.
-dnl
-dnl Substs:
-dnl LIBUNWIND_FLAG
-dnl
-AC_DEFUN(GLIBCXX_ENABLE_LIBUNWIND_EXCEPTIONS, [
- AC_MSG_CHECKING([for use of libunwind])
- GLIBCXX_ENABLE(libunwind-exceptions,no,,
- [force use of libunwind for exceptions])
- AC_MSG_RESULT($use_libunwind_exceptions)
- if test $enable_libunwind_exceptions = yes; then
- LIBUNWIND_FLAG="-lunwind"
- else
- LIBUNWIND_FLAG=""
- fi
- AC_SUBST(LIBUNWIND_FLAG)
-])
-
-
-dnl
-dnl Check for template specializations for the 'long long' type extension.
-dnl The result determines only whether 'long long' I/O is enabled; things
-dnl like numeric_limits<> specializations are always available.
-dnl
-dnl --enable-long-long defines _GLIBCXX_USE_LONG_LONG
-dnl --disable-long-long leaves _GLIBCXX_USE_LONG_LONG undefined
-dnl + Usage: GLIBCXX_ENABLE_LONG_LONG[(DEFAULT)]
-dnl Where DEFAULT is either `yes' or `no'.
-dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
-dnl
-AC_DEFUN(GLIBCXX_ENABLE_LONG_LONG, [
- GLIBCXX_ENABLE(long-long,$1,,[enables I/O support for 'long long'])
-
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
-
- AC_MSG_CHECKING([for enabled long long I/O support])
- # iostreams require strtoll, strtoull to compile
- AC_TRY_COMPILE([#include <stdlib.h>],
- [char* tmp; strtoll("gnu", &tmp, 10);],,[enable_long_long=no])
- AC_TRY_COMPILE([#include <stdlib.h>],
- [char* tmp; strtoull("gnu", &tmp, 10);],,[enable_long_long=no])
-
- # Option parsed, now set things appropriately
- if test $enable_long_long = yes; then
- AC_DEFINE(_GLIBCXX_USE_LONG_LONG)
- fi
- AC_MSG_RESULT($enable_long_long)
-
- AC_LANG_RESTORE
-])
-
-
-dnl
-dnl Check to see if building and using a C++ precompiled header can be done.
-dnl
-dnl --enable-libstdcxx-pch=yes
-dnl default, this shows intent to use stdc++.h.gch If it looks like it
-dnl may work, after some light-hearted attempts to puzzle out compiler
-dnl support, flip bits on in include/Makefile.am
-dnl
-dnl --disable-libstdcxx-pch
-dnl turns off attempts to use or build stdc++.h.gch.
-dnl
-dnl Substs:
-dnl glibcxx_PCHFLAGS
-dnl
-AC_DEFUN(GLIBCXX_ENABLE_PCH, [
- AC_MSG_CHECKING([for enabled PCH])
- GLIBCXX_ENABLE(libstdcxx-pch,$1,,[build pre-compiled libstdc++ headers])
- AC_MSG_RESULT([$enable_libstdcxx_pch])
-
- if test $enable_libstdcxx_pch = yes; then
- AC_CACHE_CHECK([for compiler with PCH support],
- [glibcxx_cv_prog_CXX_pch],
- [ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -Werror -Winvalid-pch -Wno-deprecated"
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- echo '#include <math.h>' > conftest.h
- if $CXX $CXXFLAGS $CPPFLAGS -x c++-header conftest.h \
- -o conftest.h.gch 1>&5 2>&1 &&
- echo '#error "pch failed"' > conftest.h &&
- echo '#include "conftest.h"' > conftest.cc &&
- $CXX -c $CXXFLAGS $CPPFLAGS conftest.cc 1>&5 2>&1 ;
- then
- glibcxx_cv_prog_CXX_pch=yes
- else
- glibcxx_cv_prog_CXX_pch=no
- fi
- rm -f conftest*
- CXXFLAGS=$ac_save_CXXFLAGS
- AC_LANG_RESTORE
- ])
- enable_libstdcxx_pch=$glibcxx_cv_prog_CXX_pch
- fi
-
- AM_CONDITIONAL(GLIBCXX_BUILD_PCH, test $enable_libstdcxx_pch = yes)
- if test $enable_libstdcxx_pch = yes; then
- glibcxx_PCHFLAGS="-include bits/stdc++.h"
- else
- glibcxx_PCHFLAGS=""
- fi
- AC_SUBST(glibcxx_PCHFLAGS)
-])
-
-
-dnl
-dnl Check for exception handling support. If an explicit enable/disable
-dnl sjlj exceptions is given, we don't have to detect. Otherwise the
-dnl target may or may not support call frame exceptions.
-dnl
-dnl --enable-sjlj-exceptions forces the use of builtin setjmp.
-dnl --disable-sjlj-exceptions forces the use of call frame unwinding.
-dnl
-dnl Defines:
-dnl _GLIBCXX_SJLJ_EXCEPTIONS if the compiler is configured for it
-dnl
-AC_DEFUN(GLIBCXX_ENABLE_SJLJ_EXCEPTIONS, [
- AC_MSG_CHECKING([for exception model to use])
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- GLIBCXX_ENABLE(sjlj-exceptions,no,,
- [force use of builtin_setjmp for exceptions],
- [:],
- [# Botheration. Now we've got to detect the exception model.
- # Link tests against libgcc.a are problematic since -- at least
- # as of this writing -- we've not been given proper -L bits for
- # single-tree newlib and libgloss.
- #
- # This is what AC_TRY_COMPILE would do if it didn't delete the
- # conftest files before we got a change to grep them first.
- cat > conftest.$ac_ext << EOF
-[#]line __oline__ "configure"
-struct S { ~S(); };
-void bar();
-void foo()
-{
- S s;
- bar();
-}
-EOF
- old_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS=-S
- if AC_TRY_EVAL(ac_compile); then
- if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
- enable_sjlj_exceptions=yes
- elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
- enable_sjlj_exceptions=no
- fi
- fi
- CXXFLAGS="$old_CXXFLAGS"
- rm -f conftest*
- ])
- if test $enable_sjlj_exceptions = yes; then
- AC_DEFINE(_GLIBCXX_SJLJ_EXCEPTIONS, 1,
- [Define if the compiler is configured for setjmp/longjmp exceptions.])
- ac_exception_model_name=sjlj
- elif test x$enable_sjlj_exceptions = xno; then
- ac_exception_model_name="call frame"
- else
- AC_MSG_ERROR([unable to detect exception model])
- fi
- AC_LANG_RESTORE
- AC_MSG_RESULT($ac_exception_model_name)
-])
-
-
-dnl
-dnl Add version tags to symbols in shared library (or not), additionally
-dnl marking other symbols as private/local (or not).
-dnl
-dnl --enable-symvers=style adds a version script to the linker call when
-dnl creating the shared library. The choice of version script is
-dnl controlled by 'style'.
-dnl --disable-symvers does not.
-dnl + Usage: GLIBCXX_ENABLE_SYMVERS[(DEFAULT)]
-dnl Where DEFAULT is either 'yes' or 'no'. Passing `yes' tries to
-dnl choose a default style based on linker characteristics. Passing
-dnl 'no' disables versioning.
-dnl
-AC_DEFUN(GLIBCXX_ENABLE_SYMVERS, [
-
-GLIBCXX_ENABLE(symvers,$1,[=STYLE],
- [enables symbol versioning of the shared library],
- [permit yes|no|gnu])
-
-# If we never went through the GLIBCXX_CHECK_LINKER_FEATURES macro, then we
-# don't know enough about $LD to do tricks...
-AC_REQUIRE([GLIBCXX_CHECK_LINKER_FEATURES])
-# FIXME The following test is too strict, in theory.
-if test $enable_shared = no ||
- test "x$LD" = x ||
- test x$glibcxx_gnu_ld_version = x; then
- enable_symvers=no