aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/acinclude.m4
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/acinclude.m4')
-rw-r--r--libstdc++-v3/acinclude.m4238
1 files changed, 167 insertions, 71 deletions
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 567c59b16fb..7bd94634b77 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -267,8 +267,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)
@@ -361,7 +360,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
@@ -911,7 +910,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)
])
@@ -937,6 +940,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.
@@ -982,7 +987,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 \
@@ -1027,30 +1032,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'.
@@ -1058,7 +1066,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 ;;
@@ -1066,17 +1074,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)
])
@@ -1097,25 +1144,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.
@@ -1130,6 +1173,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)
])
@@ -1227,6 +1271,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
;;
@@ -1261,6 +1306,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
;;
@@ -1277,6 +1323,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
;;
@@ -1291,23 +1338,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)
])
@@ -1408,7 +1452,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
@@ -1727,7 +1771,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].
@@ -1740,7 +1784,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)
@@ -1843,7 +1887,7 @@ AC_DEFUN(GLIBCPP_EXPORT_FLAGS, [
OPTIMIZE_CXXFLAGS=
AC_SUBST(OPTIMIZE_CXXFLAGS)
- WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings -Winline'
+ WARN_FLAGS='-Wall -Wno-format -W -Wwrite-strings'
AC_SUBST(WARN_FLAGS)
])
@@ -1919,11 +1963,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])
@@ -2074,18 +2119,30 @@ dnl the testsuite_hooks.h header.
dnl
dnl GLIBCPP_CONFIGURE_TESTSUITE [no args]
AC_DEFUN(GLIBCPP_CONFIGURE_TESTSUITE, [
- GLIBCPP_CHECK_SETRLIMIT
+ if test x"$GLIBCPP_IS_CROSS_COMPILING" = xfalse; then
+ # Do checks for memory limit functions.
+ GLIBCPP_CHECK_SETRLIMIT
- # Look for setenv, so that extended locale tests can be performed.
- GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
+ # Look for setenv, so that extended locale tests can be performed.
+ GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
+ fi
# Export file names for ABI checking.
- baseline_file="${glibcpp_srcdir}/config/abi/${abi_baseline_triplet}/baseline_symbols.txt"
- AC_SUBST(baseline_file)
+ baseline_dir="${glibcpp_srcdir}/config/abi/${abi_baseline_pair}\$(MULTISUBDIR)"
+ AC_SUBST(baseline_dir)
- # Don't do ABI checking unless native.
- AM_CONDITIONAL(GLIBCPP_BUILD_ABI_CHECK,
- test x"$build" = x"$host" && test -z "$with_cross_host")
+ # Determine if checking the ABI is desirable.
+ if test x$enable_symvers = xno; then
+ enable_abi_check=no
+ else
+ case "$host" in
+ *-*-cygwin*)
+ enable_abi_check=no ;;
+ *)
+ enable_abi_check=yes ;;
+ esac
+ fi
+ AM_CONDITIONAL(GLIBCPP_TEST_ABI, test "$enable_abi_check" = yes)
])
@@ -2099,6 +2156,45 @@ AC_DEFUN([AC_LIBTOOL_DLOPEN])
AC_DEFUN([AC_PROG_LD])
])
+dnl
+dnl Check whether S_ISREG (Posix) or S_IFREG is available in <sys/stat.h>.
+dnl
+
+AC_DEFUN(GLIBCPP_CHECK_S_ISREG_OR_S_IFREG, [
+ AC_CACHE_VAL(glibcpp_cv_S_ISREG, [
+ AC_TRY_LINK([#include <sys/stat.h>],
+ [struct stat buffer; fstat(0, &buffer); S_ISREG(buffer.st_mode); ],
+ [glibcpp_cv_S_ISREG=yes],
+ [glibcpp_cv_S_ISREG=no])
+ ])
+ AC_CACHE_VAL(glibcpp_cv_S_IFREG, [
+ AC_TRY_LINK([#include <sys/stat.h>],
+ [struct stat buffer; fstat(0, &buffer); S_IFREG & buffer.st_mode; ],
+ [glibcpp_cv_S_IFREG=yes],
+ [glibcpp_cv_S_IFREG=no])
+ ])
+ if test x$glibcpp_cv_S_ISREG = xyes; then
+ AC_DEFINE(HAVE_S_ISREG)
+ elif test x$glibcpp_cv_S_IFREG = xyes; then
+ AC_DEFINE(HAVE_S_IFREG)
+ fi
+])
+
+dnl
+dnl Check whether poll is available in <poll.h>.
+dnl
+
+AC_DEFUN(GLIBCPP_CHECK_POLL, [
+ AC_CACHE_VAL(glibcpp_cv_POLL, [
+ AC_TRY_COMPILE([#include <poll.h>],
+ [struct pollfd pfd[1]; pfd[0].events = POLLIN; poll(pfd, 1, 0); ],
+ [glibcpp_cv_POLL=yes],
+ [glibcpp_cv_POLL=no])
+ ])
+ if test x$glibcpp_cv_POLL = xyes; then
+ AC_DEFINE(HAVE_POLL)
+ fi
+])
# Check whether LC_MESSAGES is available in <locale.h>.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
@@ -2235,15 +2331,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)