diff options
Diffstat (limited to 'libstdc++-v3/aclocal.m4')
-rw-r--r-- | libstdc++-v3/aclocal.m4 | 169 |
1 files changed, 107 insertions, 62 deletions
diff --git a/libstdc++-v3/aclocal.m4 b/libstdc++-v3/aclocal.m4 index e42653992d8..b644696ed46 100644 --- a/libstdc++-v3/aclocal.m4 +++ b/libstdc++-v3/aclocal.m4 @@ -279,8 +279,7 @@ AC_DEFUN(GLIBCPP_CHECK_COMPILER_FEATURES, [ # this is the suspicious part CXXFLAGS='' fi - if test x"$ac_fdsections" = x"yes" && - test x"$enable_debug" = x"no"; then + if test x"$ac_fdsections" = x"yes"; then SECTION_FLAGS='-ffunction-sections -fdata-sections' fi AC_MSG_RESULT($ac_fdsections) @@ -373,7 +372,7 @@ AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [ fi # Set linker optimization flags. - if test x"$with_gnu_ld" = x"yes" && test x"$enable_debug" = x"no"; then + if test x"$with_gnu_ld" = x"yes"; then OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS" fi @@ -923,7 +922,11 @@ AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [ AC_CHECK_FUNCS([__signbitl], , [LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"]) fi + if test -n "$LIBMATHOBJS"; then + need_libmath=yes + fi AC_SUBST(LIBMATHOBJS) + AM_CONDITIONAL(GLIBCPP_BUILD_LIBMATH, test "$need_libmath" = yes) ]) @@ -949,6 +952,8 @@ dnl Define HAVE_MBSTATE_T if mbstate_t is not in wchar.h dnl dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [ + dnl Wide characters disabled by default. + enable_wchar_t=no dnl Test wchar.h for mbstate_t, which is needed for char_traits and dnl others even if wchar_t support is not on. @@ -994,7 +999,7 @@ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [ ac_wfuncs=no) dnl Checks for names injected into std:: by the c_std headers. - AC_CHECK_FUNCS(btowc wctob fgetwc fgetwc fgetws fputwc fputws fwide \ + AC_CHECK_FUNCS(btowc wctob fgetwc fgetws fputwc fputws fwide \ fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \ vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \ mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \ @@ -1039,30 +1044,33 @@ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [ dnl At the moment, only enable wchar_t specializations if all the dnl above support is present. - AC_MSG_CHECKING([for enabled wchar_t specializations]) if test x"$ac_isoC99_wchar_t" = xyes && test x"$ac_XPG2_wchar_t" = xyes; then - AC_DEFINE(_GLIBCPP_USE_WCHAR_T) - AC_MSG_RESULT("yes") - else - AC_MSG_RESULT("no") + AC_DEFINE(_GLIBCPP_USE_WCHAR_T) + enable_wchar_t=yes fi - else - dnl Wide characters disabled by the user. - AC_MSG_WARN([wchar_t support disabled.]) fi + AC_MSG_CHECKING([for enabled wchar_t specializations]) + AC_MSG_RESULT($enable_wchar_t) + AM_CONDITIONAL(GLIBCPP_TEST_WCHAR_T, test "$enable_wchar_t" = yes) ]) dnl -dnl Check for special debugging mode; not for production use. +dnl Check to see if debugging libraries are to be built. dnl dnl GLIBCPP_ENABLE_DEBUG -dnl --enable-debug sets '-ggdb3 -O0'. -dnl --disable-debug sets '-g' and whatever optimization options the -dnl compiler can handle. -dnl + --enable-maintainer-mode automatically defaults this to on. -dnl + Perhaps -D/-U of NDEBUG, DEBUG, DEBUG_ASSERT, ...? +dnl +dnl --enable-debug +dnl builds a separate set of debugging libraries in addition to the +dnl normal (shared, static) libstdc++ binaries. +dnl +dnl --disable-debug +dnl builds only one (non-debug) version of libstdc++. +dnl +dnl --enable-debug-flags=FLAGS +dnl iff --enable-debug == yes, then use FLAGS to build the debug library. +dnl dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)] dnl Where DEFAULT is either `yes' or `no'. If ommitted, it dnl defaults to `no'. @@ -1070,7 +1078,7 @@ AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl AC_ARG_ENABLE(debug, changequote(<<, >>)dnl -<< --enable-debug extra debugging, turn off optimization [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT], +<< --enable-debug build extra debug library [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT], changequote([, ])dnl [case "${enableval}" in yes) enable_debug=yes ;; @@ -1078,17 +1086,56 @@ changequote([, ])dnl *) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;; esac], enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl +AC_MSG_CHECKING([for additional debug build]) +AC_MSG_RESULT($enable_debug) +AM_CONDITIONAL(GLIBCPP_BUILD_DEBUG, test "$enable_debug" = yes) +]) + + +dnl Check for explicit debug flags. +dnl +dnl GLIBCPP_ENABLE_DEBUG_FLAGS +dnl +dnl --enable-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-debug-flags does nothing. +dnl + Usage: GLIBCPP_ENABLE_DEBUG_FLAGS(default flags) +dnl If "default flags" is an empty string (or "none"), the effect is +dnl the same as --disable or --enable=no. +AC_DEFUN(GLIBCPP_ENABLE_DEBUG_FLAGS, [dnl +define([GLIBCPP_ENABLE_DEBUG_FLAGS_DEFAULT], ifelse($1,,, $1))dnl +AC_ARG_ENABLE(debug_flags, +changequote(<<, >>)dnl +<< --enable-debug-flags=FLAGS pass compiler FLAGS when building debug + library;[default=>>GLIBCPP_ENABLE_DEBUG_FLAGS_DEFAULT], +changequote([, ])dnl +[case "${enableval}" in + none) ;; + -*) enable_debug_flags="${enableval}" ;; + *) AC_MSG_ERROR([Unknown argument to extra debugging flags]) ;; + esac], +enable_debug_flags=GLIBCPP_ENABLE_DEBUG_FLAGS_DEFAULT)dnl dnl Option parsed, now set things appropriately -case "${enable_debug}" in - yes) - DEBUG_FLAGS='-O0 -ggdb3' - ;; - no) - DEBUG_FLAGS='-g' +case x"$enable_debug" in + xyes) + case "$enable_debug_flags" in + none) + DEBUG_FLAGS="-g3 -O0";; + -*) #valid input + DEBUG_FLAGS="${enableval}" + esac + ;; + xno) + DEBUG_FLAGS="" ;; esac AC_SUBST(DEBUG_FLAGS) + +AC_MSG_CHECKING([for debug build flags]) +AC_MSG_RESULT($DEBUG_FLAGS) ]) @@ -1109,25 +1156,21 @@ dnl If "default flags" is an empty string (or "none"), the effect is dnl the same as --disable or --enable=no. AC_DEFUN(GLIBCPP_ENABLE_CXX_FLAGS, [dnl define([GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], ifelse($1,,, $1))dnl -AC_ARG_ENABLE(cxx-flags, +AC_MSG_CHECKING([for extra compiler flags for building]) +AC_ARG_ENABLE(cxx_flags, changequote(<<, >>)dnl << --enable-cxx-flags=FLAGS pass compiler FLAGS when building library; - [default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], + [default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT], changequote([, ])dnl -[case "x$enableval" in - xyes) - AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;; - xno|x) - enable_cxx_flags='' ;; - *) - enable_cxx_flags="$enableval" ;; - esac], -enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT') - -dnl Thinko on my part during design. This kludge is the workaround. -if test "$enable_cxx_flags" = "none"; then - enable_cxx_flags=''; -fi +[case "x$enable_cxx_flags" in + xyes) + AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;; + xno | xnone | x) + enable_cxx_flags='' ;; + *) + enable_cxx_flags="$enableval" ;; +esac], +enable_cxx_flags=GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT) dnl Run through flags (either default or command-line) and set anything dnl extra (e.g., #defines) that must accompany particular g++ options. @@ -1142,6 +1185,7 @@ if test -n "$enable_cxx_flags"; then done fi EXTRA_CXX_FLAGS="$enable_cxx_flags" +AC_MSG_RESULT($EXTRA_CXX_FLAGS) AC_SUBST(EXTRA_CXX_FLAGS) ]) @@ -1239,6 +1283,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [ 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 ;; @@ -1273,6 +1318,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [ 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 ;; @@ -1289,6 +1335,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [ 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 ;; @@ -1303,23 +1350,20 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [ glibcpp_localedir=${glibcpp_builddir}/po/share/locale AC_SUBST(glibcpp_localedir) - # For the time being, transform ctype_noninline.h to ctype_members_char.cc -# CCTYPE_CHAR_CC=config/${os_include_dir}/ctype_noninline.h - AC_SUBST(USE_NLS) AC_SUBST(CLOCALE_H) AC_SUBST(CCODECVT_H) AC_SUBST(CMESSAGES_H) - AC_LINK_FILES($CLOCALE_CC, src/c++locale.cc) - AC_LINK_FILES($CCODECVT_CC, src/codecvt_members.cc) - AC_LINK_FILES($CCOLLATE_CC, src/collate_members.cc) -# AC_LINK_FILES($CCTYPE_CHAR_CC, src/ctype_members_char.cc) - AC_LINK_FILES($CCTYPE_CC, src/ctype_members.cc) - AC_LINK_FILES($CMESSAGES_CC, src/messages_members.cc) - AC_LINK_FILES($CMONEY_CC, src/monetary_members.cc) - AC_LINK_FILES($CNUMERIC_CC, src/numeric_members.cc) - AC_LINK_FILES($CTIME_CC, src/time_members.cc) - AC_LINK_FILES($CLOCALE_INTERNAL_H, src/c++locale_internal.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) ]) @@ -1420,7 +1464,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [ esac AC_SUBST(CSTDIO_H) AC_SUBST(BASIC_FILE_H) - AC_LINK_FILES($BASIC_FILE_CC, src/basic_file.cc) + AC_SUBST(BASIC_FILE_CC) # 2000-08-04 bkoz hack CCODECVT_C=config/io/c_io_libio_codecvt.c @@ -1739,7 +1783,7 @@ AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl dnl -dnl Check for what kind of C headers to use. +dnl Check for what type of C headers to use. dnl dnl GLIBCPP_ENABLE_CHEADERS dnl --enable-cheaders= [does stuff]. @@ -1752,7 +1796,7 @@ define([GLIBCPP_ENABLE_CHEADERS_DEFAULT], ifelse($1, c_std, c_std, c_std))dnl AC_MSG_CHECKING([for c header strategy to use]) AC_ARG_ENABLE(cheaders, changequote(<<, >>)dnl -<< --enable-cheaders construct "C" header files for g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT], +<< --enable-cheaders=MODEL construct "C" header files for g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT], changequote([, ]) [case "$enableval" in c) @@ -1931,11 +1975,12 @@ if test x"$glibcpp_toolexecdir" = x"no"; then if test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then glibcpp_toolexecdir='$(exec_prefix)/$(target_alias)' - glibcpp_toolexeclibdir='$(toolexecdir)/lib$(MULTISUBDIR)' + glibcpp_toolexeclibdir='$(toolexecdir)/lib' else glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)' - glibcpp_toolexeclibdir='$(libdir)$(MULTISUBDIR)' + glibcpp_toolexeclibdir='$(libdir)' fi + glibcpp_toolexeclibdir=$glibcpp_toolexeclibdir/`$CC -print-multi-os-directory` fi AC_MSG_CHECKING([for install location]) @@ -2247,15 +2292,15 @@ fi dnl Everything parsed; figure out what file to use. case $enable_symvers in no) - LINKER_MAP=config/linker-map.dummy + SYMVER_MAP=config/linker-map.dummy ;; gnu) - LINKER_MAP=config/linker-map.gnu + SYMVER_MAP=config/linker-map.gnu AC_DEFINE(_GLIBCPP_SYMVER) ;; esac -AC_LINK_FILES($LINKER_MAP, src/linker.map) +AC_SUBST(SYMVER_MAP) AM_CONDITIONAL(GLIBCPP_BUILD_VERSIONED_SHLIB, test $enable_symvers != no) AC_MSG_CHECKING([versioning on shared library symbols]) AC_MSG_RESULT($enable_symvers) |