AC_ARG_WITH(cross-host,
[ --with-cross-host=HOST configuring with a cross compiler])
+ AC_ARG_WITH(newlib,
+ [ --with-newlib Configuring with newlib])
+
glibcpp_basedir=$srcdir/$toprel/$1/libstdc++-v3
AC_SUBST(glibcpp_basedir)
*) glibcpp_flagbasedir='[$](top_builddir)/'[$]{glibcpp_basedir} ;;
esac
+ # Set up safe default values for all subsequent AM_CONDITIONAL tests.
+ need_libmath=no
+ enable_wchar_t=no
+ #enable_debug=no
+ #glibcpp_pch_comp=no
+ #enable_cheaders=c
+ #c_compatibility=no
+ #enable_abi_check=no
+ #enable_symvers=no
+
# Find platform-specific directories containing configuration info. In
# addition to possibly modifying the same flags, it also sets up symlinks.
- GLIBCPP_CHECK_TARGET
+ GLIBCPP_CHECK_HOST
])
])
dnl
-dnl Check to see if the (unistd function) argument passed is
-dnl 1) declared when using the c++ compiler
-dnl 2) has "C" linkage
-dnl
-dnl argument 1 is name of function to check
-dnl
-dnl ASSUMES argument is a function with ONE parameter
-dnl
-dnl GLIBCPP_CHECK_UNISTD_DECL_AND_LINKAGE_1
-AC_DEFUN(GLIBCPP_CHECK_UNISTD_DECL_AND_LINKAGE_1, [
- AC_MSG_CHECKING([for $1 declaration])
- if test x${glibcpp_cv_func_$1_use+set} != xset; then
- AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([#include <unistd.h>],
- [ $1(0);],
- [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
- AC_LANG_RESTORE
- ])
- fi
- AC_MSG_RESULT($glibcpp_cv_func_$1_use)
- if test x$glibcpp_cv_func_$1_use = x"yes"; then
- AC_CHECK_FUNCS($1)
- fi
-])
-
-dnl
dnl Because the builtins are picky picky picky about the arguments they take,
dnl do an explict linkage tests here.
dnl Check to see if the (math function) argument passed is
])
dnl
-dnl Check to see what the underlying c library is like
-dnl These checks need to do two things:
-dnl 1) make sure the name is declared when using the c++ compiler
-dnl 2) make sure the name has "C" linkage
-dnl This might seem like overkill but experience has shown that it's not...
-dnl
-dnl Define HAVE_ISATTY if "isatty" is declared and links
-dnl
-dnl GLIBCPP_CHECK_UNISTD_SUPPORT
-AC_DEFUN(GLIBCPP_CHECK_UNISTD_SUPPORT, [
- ac_test_CXXFLAGS="${CXXFLAGS+set}"
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
-
- GLIBCPP_CHECK_UNISTD_DECL_AND_LINKAGE_1(isatty)
-
- CXXFLAGS="$ac_save_CXXFLAGS"
-])
-
-dnl
dnl Check to see what the underlying c library or math library is like.
dnl These checks need to do two things:
dnl 1) make sure the name is declared when using the c++ compiler
dnl
dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
- dnl Check for complex versions of math functions of platform.
+ dnl Check for complex versions of math functions of platform. This will
+ dnl always pass if libm is available, and fail if it isn't. If it is
+ dnl available, we assume we'll need it later, so add it to LIBS.
AC_CHECK_LIB(m, main)
AC_REPLACE_MATHFUNCS(nan copysignf)
need_libmath=yes
fi
AC_SUBST(LIBMATHOBJS)
- AM_CONDITIONAL(GLIBCPP_BUILD_LIBMATH, test "$need_libmath" = yes)
])
dnl for. Also, if architecture- or OS-specific flags are required for
dnl compilation, pick them up here.
dnl
-dnl GLIBCPP_CHECK_TARGET
-AC_DEFUN(GLIBCPP_CHECK_TARGET, [
- . [$]{glibcpp_basedir}/configure.target
+dnl GLIBCPP_CHECK_HOST
+AC_DEFUN(GLIBCPP_CHECK_HOST, [
+ . [$]{glibcpp_basedir}/configure.host
AC_MSG_RESULT(CPU config directory is $cpu_include_dir)
AC_MSG_RESULT(OS config directory is $os_include_dir)
])
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.
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)
])
CLOCALE_INTERNAL_H=config/locale/gnu/c++locale_internal.h
;;
xieee_1003.1-2001)
- AC_MSG_RESULT(generic)
+ 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
glibcpp_localedir=${glibcpp_builddir}/po/share/locale
AC_SUBST(glibcpp_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(_GLIBCPP_USE_NLS)
+ fi
+
AC_SUBST(USE_NLS)
AC_SUBST(CLOCALE_H)
AC_SUBST(CCODECVT_H)
dnl
-dnl Check for which I/O library to use: libio, or something specific.
+dnl Check for which I/O library to use: stdio, or something specific.
dnl
dnl GLIBCPP_ENABLE_CSTDIO
-dnl --enable-cstdio=libio sets config/io/c_io_libio.h and friends
dnl
dnl default is stdio
dnl
dnl Check if a valid I/O package
case x${enable_cstdio_flag} in
- xlibio)
- CSTDIO_H=config/io/c_io_libio.h
- BASIC_FILE_H=config/io/basic_file_libio.h
- BASIC_FILE_CC=config/io/basic_file_libio.cc
- AC_MSG_RESULT(libio)
-
- # see if we are on a system with libio native (ie, linux)
- AC_CHECK_HEADER(libio.h, has_libio=yes, has_libio=no)
-
- # Need to check and see what version of glibc is being used. If
- # it's not glibc-2.2 or higher, then we'll need to go ahead and
- # compile most of libio for linux systems.
- if test x$has_libio = x"yes"; then
- case "$target" in
- *-*-linux*)
- AC_MSG_CHECKING([for glibc version >= 2.2])
- AC_EGREP_CPP([ok], [
- #include <features.h>
- #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
- ok
- #endif
- ], glibc_satisfactory=yes, glibc_satisfactory=no)
- AC_MSG_RESULT($glibc_satisfactory)
- ;;
- esac
-
- # XXX at the moment, admit defeat and force the recompilation
- # XXX of glibc even on glibc-2.2 systems, because libio is not synched.
- glibc_satisfactory=no
-
- if test x$glibc_satisfactory = x"yes"; then
- need_libio=no
- need_wlibio=no
- else
- need_libio=yes
- # bkoz XXX need to add checks to enable this
- # pme XXX here's a first pass at such a check
- if test x$enable_c_mbchar != xno; then
- need_wlibio=yes
- else
- need_wlibio=no
- fi
- fi
-
- else
- # Using libio, but <libio.h> doesn't exist on the target system. . .
- need_libio=yes
- # bkoz XXX need to add checks to enable this
- # pme XXX here's a first pass at such a check
- if test x$enable_c_mbchar != xno; then
- need_wlibio=yes
- else
- need_wlibio=no
- fi
- fi
- ;;
xstdio | x | xno | xnone | xyes)
# default
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)
-
- # We're not using stdio.
- need_libio=no
- need_wlibio=no
;;
*)
echo "$enable_cstdio is an unknown io package" 1>&2
AC_SUBST(CSTDIO_H)
AC_SUBST(BASIC_FILE_H)
AC_SUBST(BASIC_FILE_CC)
+])
+
- # 2000-08-04 bkoz hack
- CCODECVT_C=config/io/c_io_libio_codecvt.c
- AC_SUBST(CCODECVT_C)
- # 2000-08-04 bkoz hack
-
- AM_CONDITIONAL(GLIBCPP_BUILD_LIBIO,
- test "$need_libio" = yes || test "$need_wlibio" = yes)
- AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
- AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes)
- if test "$need_libio" = yes || test "$need_wlibio" = yes; then
- libio_la=../libio/libio.la
+dnl
+dnl Check to see if building and using a C++ precompiled header can be done.
+dnl
+dnl GLIBCPP_CHECK_PCH
+dnl
+dnl If it looks like it may work, flip bits on in include/Makefile.am
+dnl
+AC_DEFUN(GLIBCPP_CHECK_PCH, [
+ ac_test_CXXFLAGS="${CXXFLAGS+set}"
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS='-Werror -Winvalid-pch -Wno-deprecated -x c++-header'
+
+ AC_MSG_CHECKING([for compiler that seems to compile .gch files])
+ if test x${glibcpp_pch_comp+set} != xset; then
+ AC_CACHE_VAL(glibcpp_pch_comp, [
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([#include <math.h>
+ ],
+ [ $1(0);],
+ [glibcpp_pch_comp=yes], [glibcpp_pch_comp=no])
+ AC_LANG_RESTORE
+ ])
+ fi
+ AC_MSG_RESULT([$glibcpp_pch_comp])
+
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ AM_CONDITIONAL(GLIBCPP_BUILD_PCH, test "$glibcpp_pch_comp" = yes)
+ if test "$glibcpp_pch_comp" = yes; then
+ glibcpp_PCHFLAGS="-include bits/stdc++.h"
else
- libio_la=
+ glibcpp_PCHFLAGS=""
fi
- AC_SUBST(libio_la)
+ AC_SUBST(glibcpp_PCHFLAGS)
])
-
dnl
dnl Setup to use the gcc gthr.h thread-specific memory and mutex model.
dnl We must stage the required headers so that they will be installed
dnl TOPLEVEL_INCLUDES
dnl LIBMATH_INCLUDES
dnl LIBSUPCXX_INCLUDES
-dnl LIBIO_INCLUDES
dnl
dnl GLIBCPP_EXPORT_INCLUDES
AC_DEFUN(GLIBCPP_EXPORT_INCLUDES, [
LIBSUPCXX_INCLUDES='-I$(top_srcdir)/libsupc++'
- if test x"$need_libio" = xyes; then
- LIBIO_INCLUDES='-I$(top_builddir)/libio -I$(top_srcdir)/libio'
- AC_SUBST(LIBIO_INCLUDES)
- fi
-
# Now, export this to all the little Makefiles....
AC_SUBST(GLIBCPP_INCLUDES)
AC_SUBST(TOPLEVEL_INCLUDES)
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)
])
glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
glibcpp_toolexeclibdir='$(libdir)'
fi
- glibcpp_toolexeclibdir=$glibcpp_toolexeclibdir/`$CC -print-multi-os-directory`
+ multi_os_directory=`$CC -print-multi-os-directory`
+ case $multi_os_directory in
+ .) ;; # Avoid trailing /.
+ *) glibcpp_toolexeclibdir=$glibcpp_toolexeclibdir/$multi_os_directory ;;
+ esac
fi
AC_MSG_CHECKING([for install location])
dnl
dnl GLIBCPP_CONFIGURE_TESTSUITE [no args]
AC_DEFUN(GLIBCPP_CONFIGURE_TESTSUITE, [
- GLIBCPP_CHECK_SETRLIMIT
- # Look for setenv, so that extended locale tests can be performed.
- GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
+ 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)
+ 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)
+
+ # 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
- # Don't do ABI checking unless native.
- AM_CONDITIONAL(GLIBCPP_BUILD_ABI_CHECK,
- test x"$build" = x"$host" && test -z "$with_cross_host")
+ AM_CONDITIONAL(GLIBCPP_TEST_WCHAR_T, test "$enable_wchar_t" = yes)
+ AM_CONDITIONAL(GLIBCPP_TEST_ABI, test "$enable_abi_check" = yes)
])
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.