-dnl Assumes cross_compiling bits already done, and with_cross_host in
-dnl particular
-dnl
-dnl GLIBCXX_EXPORT_INSTALL_INFO
-AC_DEFUN(GLIBCXX_EXPORT_INSTALL_INFO, [
-# Assumes glibcxx_builddir, glibcxx_srcdir are alreay set up and
-# exported correctly in GLIBCXX_CONFIGURE.
-glibcxx_toolexecdir=no
-glibcxx_toolexeclibdir=no
-glibcxx_prefixdir=${prefix}
-
-# Process the option --with-gxx-include-dir=<path to include-files directory>
-AC_MSG_CHECKING([for --with-gxx-include-dir])
-AC_ARG_WITH(gxx-include-dir,
-[ --with-gxx-include-dir the installation directory for include files],
-[case "${withval}" in
- yes)
- AC_MSG_ERROR(Missing directory for --with-gxx-include-dir)
- gxx_include_dir=no
- ;;
- no)
- gxx_include_dir=no
- ;;
- *)
- gxx_include_dir=${withval}
- ;;
-esac], [gxx_include_dir=no])
-AC_MSG_RESULT($gxx_include_dir)
-
-# Process the option "--enable-version-specific-runtime-libs"
-AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
-AC_ARG_ENABLE(version-specific-runtime-libs,
-[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
-[case "$enableval" in
- yes) version_specific_libs=yes ;;
- no) version_specific_libs=no ;;
- *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
- esac],
-version_specific_libs=no)dnl
-# Option set, now we can test it.
-AC_MSG_RESULT($version_specific_libs)
-
-# Default case for install directory for include files.
-if test $version_specific_libs = no && test $gxx_include_dir = no; then
- gxx_include_dir='$(prefix)'/include/c++/${gcc_version}
-fi
-
-# Version-specific runtime libs processing.
-if test $version_specific_libs = yes; then
- # Need the gcc compiler version to know where to install libraries
- # and header files if --enable-version-specific-runtime-libs option
- # is selected.
- if test x"$gxx_include_dir" = x"no"; then
- gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/c++
- fi
- glibcxx_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
- glibcxx_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
-fi
-
-# 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)/$(target_alias)'
- glibcxx_toolexeclibdir='$(toolexecdir)/lib'
- else
- glibcxx_toolexecdir='$(libdir)/gcc-lib/$(target_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)
-])
-
-
-# Check for functions in math library.
-# Ulrich Drepper <drepper@cygnus.com>, 1998.
-#
-# This file can be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
-
-# serial 1
-
-dnl AC_REPLACE_MATHFUNCS(FUNCTION...)
-AC_DEFUN(AC_REPLACE_MATHFUNCS,
-[AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])])
-
-
-dnl This macro searches for a GNU version of make. If a match is found, the
-dnl makefile variable `ifGNUmake' is set to the empty string, otherwise it is
-dnl set to "#". This is useful for including a special features in a Makefile,
-dnl which cannot be handled by other versions of make. The variable
-dnl _cv_gnu_make_command is set to the command to invoke GNU make if it exists,
-dnl the empty string otherwise.
-dnl
-dnl Here is an example of its use:
-dnl
-dnl Makefile.in might contain:
-dnl
-dnl # A failsafe way of putting a dependency rule into a makefile
-dnl $(DEPEND):
-dnl $(CC) -MM $(srcdir)/*.c > $(DEPEND)
-dnl
-dnl @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
-dnl @ifGNUmake@ include $(DEPEND)
-dnl @ifGNUmake@ endif
-dnl
-dnl Then configure.in would normally contain:
-dnl
-dnl CHECK_GNU_MAKE()
-dnl AC_OUTPUT(Makefile)
-dnl
-dnl Then perhaps to cause gnu make to override any other make, we could do
-dnl something like this (note that GNU make always looks for GNUmakefile first):
-dnl
-dnl if ! test x$_cv_gnu_make_command = x ; then
-dnl mv Makefile GNUmakefile
-dnl echo .DEFAULT: > Makefile ;
-dnl echo \ $_cv_gnu_make_command \$@ >> Makefile;
-dnl fi
-dnl
-dnl Then, if any (well almost any) other make is called, and GNU make also
-dnl exists, then the other make wraps the GNU make.
-dnl
-dnl @author John Darrington <j.darrington@elvis.murdoch.edu.au>
-dnl @version 1.1 #### replaced Id string now that Id is for lib-v3; pme
-dnl
-dnl #### Changes for libstdc++-v3: reformatting and linewrapping; prepending
-dnl #### GLIBCXX_ to the macro name; adding the :-make fallback in the
-dnl #### conditional's subshell (" --version" is not a command), using a
-dnl #### different option to grep(1).
-dnl #### -pme
-dnl #### Fixed Bourne shell portability bug (use ${MAKE-make}, not
-dnl #### ${MAKE:-make}).
-dnl #### -msokolov
-AC_DEFUN(
- GLIBCXX_CHECK_GNU_MAKE, [AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
- _cv_gnu_make_command='' ;
-dnl Search all the common names for GNU make
- for a in "${MAKE-make}" make gmake gnumake ; do
- if ( $a --version 2> /dev/null | grep -c GNU > /dev/null )
- then
- _cv_gnu_make_command=$a ;
- break;
- fi
- done ;
- ) ;
-dnl If there was a GNU version, then set @ifGNUmake@ to the empty
-dnl string, '#' otherwise
- if test "x$_cv_gnu_make_command" != "x" ; then
- ifGNUmake='' ;
- else
- ifGNUmake='#' ;
- fi
- AC_SUBST(ifGNUmake)
-])
-
-
-dnl Check for headers for, and arguments to, the setrlimit() function.
-dnl Used only in testsuite_hooks.h.
-AC_DEFUN(GLIBCXX_CHECK_SETRLIMIT_ancilliary, [
- AC_TRY_COMPILE([#include <unistd.h>
- #include <sys/time.h>
- #include <sys/resource.h>
- ], [ int f = RLIMIT_$1 ; ],
- [glibcxx_mresult=1], [glibcxx_mresult=0])
- AC_DEFINE_UNQUOTED(HAVE_MEMLIMIT_$1, $glibcxx_mresult,
- [Only used in build directory testsuite_hooks.h.])
-])
-AC_DEFUN(GLIBCXX_CHECK_SETRLIMIT, [
- setrlimit_have_headers=yes
- AC_CHECK_HEADERS(unistd.h sys/time.h sys/resource.h,
- [],
- setrlimit_have_headers=no)
- # If don't have the headers, then we can't run the tests now, and we
- # won't be seeing any of these during testsuite compilation.
- if test $setrlimit_have_headers = yes; then
- # Can't do these in a loop, else the resulting syntax is wrong.
- GLIBCXX_CHECK_SETRLIMIT_ancilliary(DATA)
- GLIBCXX_CHECK_SETRLIMIT_ancilliary(RSS)
- GLIBCXX_CHECK_SETRLIMIT_ancilliary(VMEM)
- GLIBCXX_CHECK_SETRLIMIT_ancilliary(AS)
-
- # Check for rlimit, setrlimit.
- AC_CACHE_VAL(ac_setrlimit, [
- AC_TRY_COMPILE([#include <unistd.h>
- #include <sys/time.h>
- #include <sys/resource.h>
- ],
- [ struct rlimit r; setrlimit(0, &r);],
- [ac_setrlimit=yes], [ac_setrlimit=no])
- ])
- fi
-
- AC_MSG_CHECKING([for testsuite memory limit support])
- if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then
- ac_mem_limits=yes
- AC_DEFINE(_GLIBCXX_MEM_LIMITS)
- else
- ac_mem_limits=no
- fi
- AC_MSG_RESULT($ac_mem_limits)
-])
-
-