# configure.ac for GCC # Process this file with autoconf to generate a configuration script. # Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. #This file is part of GCC. #GCC is free software; you can redistribute it and/or modify it under #the terms of the GNU General Public License as published by the Free #Software Foundation; either version 3, or (at your option) any later #version. #GCC is distributed in the hope that it will be useful, but WITHOUT #ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License #for more details. #You should have received a copy of the GNU General Public License #along with GCC; see the file COPYING3. If not see #. # -------------------------------- # Initialization and sanity checks # -------------------------------- AC_PREREQ(2.64) AC_INIT AC_CONFIG_SRCDIR(tree.c) AC_CONFIG_HEADER(auto-host.h:config.in) gcc_version=`cat $srcdir/BASE-VER` # Determine the host, build, and target systems AC_CANONICAL_BUILD AC_CANONICAL_HOST AC_CANONICAL_TARGET # Determine the noncanonical target name, for directory use. ACX_NONCANONICAL_TARGET # Determine the target- and build-specific subdirectories GCC_TOPLEV_SUBDIRS # Set program_transform_name AC_ARG_PROGRAM # Check for bogus environment variables. # Test if LIBRARY_PATH contains the notation for the current directory # since this would lead to problems installing/building glibc. # LIBRARY_PATH contains the current directory if one of the following # is true: # - one of the terminals (":" and ";") is the first or last sign # - two terminals occur directly after each other # - the path contains an element with a dot in it AC_MSG_CHECKING(LIBRARY_PATH variable) changequote(,)dnl case ${LIBRARY_PATH} in [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* ) library_path_setting="contains current directory" ;; *) library_path_setting="ok" ;; esac changequote([,])dnl AC_MSG_RESULT($library_path_setting) if test "$library_path_setting" != "ok"; then AC_MSG_ERROR([ *** LIBRARY_PATH shouldn't contain the current directory when *** building gcc. Please change the environment variable *** and run configure again.]) fi # Test if GCC_EXEC_PREFIX contains the notation for the current directory # since this would lead to problems installing/building glibc. # GCC_EXEC_PREFIX contains the current directory if one of the following # is true: # - one of the terminals (":" and ";") is the first or last sign # - two terminals occur directly after each other # - the path contains an element with a dot in it AC_MSG_CHECKING(GCC_EXEC_PREFIX variable) changequote(,)dnl case ${GCC_EXEC_PREFIX} in [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* ) gcc_exec_prefix_setting="contains current directory" ;; *) gcc_exec_prefix_setting="ok" ;; esac changequote([,])dnl AC_MSG_RESULT($gcc_exec_prefix_setting) if test "$gcc_exec_prefix_setting" != "ok"; then AC_MSG_ERROR([ *** GCC_EXEC_PREFIX shouldn't contain the current directory when *** building gcc. Please change the environment variable *** and run configure again.]) fi # ----------- # Directories # ----------- # Specify the local prefix local_prefix= AC_ARG_WITH(local-prefix, [AS_HELP_STRING([--with-local-prefix=DIR], [specifies directory to put local include])], [case "${withval}" in yes) AC_MSG_ERROR(bad value ${withval} given for local include directory prefix) ;; no) ;; *) local_prefix=$with_local_prefix ;; esac]) # Default local prefix if it is empty if test x$local_prefix = x; then local_prefix=/usr/local fi # Don't set gcc_gxx_include_dir to gxx_include_dir since that's only # passed in by the toplevel make and thus we'd get different behavior # depending on where we built the sources. gcc_gxx_include_dir= # Specify the g++ header file directory AC_ARG_WITH(gxx-include-dir, [AS_HELP_STRING([--with-gxx-include-dir=DIR], [specifies directory to put g++ header files])], [case "${withval}" in yes) AC_MSG_ERROR(bad value ${withval} given for g++ include directory) ;; no) ;; *) gcc_gxx_include_dir=$with_gxx_include_dir ;; esac]) # This logic must match libstdc++-v3/acinclude.m4:GLIBCXX_EXPORT_INSTALL_INFO. if test x${gcc_gxx_include_dir} = x; then if test x${enable_version_specific_runtime_libs} = xyes; then gcc_gxx_include_dir='${libsubdir}/include/c++' else libstdcxx_incdir='include/c++/$(version)' if test x$host != x$target; then libstdcxx_incdir="$target_alias/$libstdcxx_incdir" fi gcc_gxx_include_dir="\$(libsubdir)/\$(libsubdir_to_prefix)$libstdcxx_incdir" fi fi gcc_gxx_include_dir_add_sysroot=0 if test "${with_sysroot+set}" = set; then gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'` if test "${gcc_gxx_without_sysroot}"; then gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" gcc_gxx_include_dir_add_sysroot=1 fi fi AC_ARG_WITH(cpp_install_dir, [AC_HELP_STRING([--with-cpp-install-dir=DIR], [install the user visible C preprocessor in DIR (relative to PREFIX) as well as PREFIX/bin])], [if test x$withval = xyes; then AC_MSG_ERROR([option --with-cpp-install-dir requires an argument]) elif test x$withval != xno; then cpp_install_dir=$withval fi]) # We would like to our source tree to be readonly. However when releases or # pre-releases are generated, the flex/bison generated files as well as the # various formats of manuals need to be included along with the rest of the # sources. Therefore we have --enable-generated-files-in-srcdir to do # just that. AC_MSG_CHECKING([whether to place generated files in the source directory]) dnl generated-files-in-srcdir is disabled by default AC_ARG_ENABLE(generated-files-in-srcdir, [AS_HELP_STRING([--enable-generated-files-in-srcdir], [put copies of generated files in source dir intended for creating source tarballs for users without texinfo bison or flex])], generated_files_in_srcdir=$enableval, generated_files_in_srcdir=no) AC_MSG_RESULT($generated_files_in_srcdir) if test "$generated_files_in_srcdir" = "yes"; then GENINSRC='' else GENINSRC='#' fi AC_SUBST(GENINSRC) # ------------------- # Find default linker # ------------------- # With GNU ld AC_ARG_WITH(gnu-ld, [AS_HELP_STRING([--with-gnu-ld], [arrange to work with GNU ld])], gnu_ld_flag="$with_gnu_ld", gnu_ld_flag=no) # With pre-defined ld AC_ARG_WITH(ld, [AS_HELP_STRING([--with-ld], [arrange to use the specified ld (full pathname)])], DEFAULT_LINKER="$with_ld") if test x"${DEFAULT_LINKER+set}" = x"set"; then if test ! -x "$DEFAULT_LINKER"; then AC_MSG_ERROR([cannot execute: $DEFAULT_LINKER: check --with-ld or env. var. DEFAULT_LINKER]) elif $DEFAULT_LINKER -v < /dev/null 2>&1 | grep GNU > /dev/null; then gnu_ld_flag=yes fi AC_DEFINE_UNQUOTED(DEFAULT_LINKER,"$DEFAULT_LINKER", [Define to enable the use of a default linker.]) fi gnu_ld=`if test x"$gnu_ld_flag" = x"yes"; then echo 1; else echo 0; fi` AC_DEFINE_UNQUOTED(HAVE_GNU_LD, $gnu_ld, [Define if using GNU ld.]) AC_MSG_CHECKING([whether a default linker was specified]) if test x"${DEFAULT_LINKER+set}" = x"set"; then if test x"$gnu_ld_flag" = x"no"; then AC_MSG_RESULT([yes ($DEFAULT_LINKER)]) else AC_MSG_RESULT([yes ($DEFAULT_LINKER - GNU ld)]) fi else AC_MSG_RESULT(no) fi # With demangler in GNU ld AC_ARG_WITH(demangler-in-ld, [AS_HELP_STRING([--with-demangler-in-ld], [try to use demangler in GNU ld])], demangler_in_ld="$with_demangler_in_ld", demangler_in_ld=yes) # ---------------------- # Find default assembler # ---------------------- # With GNU as AC_ARG_WITH(gnu-as, [AS_HELP_STRING([--with-gnu-as], [arrange to work with GNU as])], gas_flag="$with_gnu_as", gas_flag=no) AC_ARG_WITH(as, [AS_HELP_STRING([--with-as], [arrange to use the specified as (full pathname)])], DEFAULT_ASSEMBLER="$with_as") if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then if test ! -x "$DEFAULT_ASSEMBLER"; then AC_MSG_ERROR([cannot execute: $DEFAULT_ASSEMBLER: check --with-as or env. var. DEFAULT_ASSEMBLER]) elif $DEFAULT_ASSEMBLER -v < /dev/null 2>&1 | grep GNU > /dev/null; then gas_flag=yes fi AC_DEFINE_UNQUOTED(DEFAULT_ASSEMBLER,"$DEFAULT_ASSEMBLER", [Define to enable the use of a default assembler.]) fi gnu_as=`if test x"$gas_flag" = x"yes"; then echo 1; else echo 0; fi` AC_DEFINE_UNQUOTED(HAVE_GNU_AS, $gnu_as, [Define if using GNU as.]) AC_MSG_CHECKING([whether a default assembler was specified]) if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then if test x"$gas_flag" = x"no"; then AC_MSG_RESULT([yes ($DEFAULT_ASSEMBLER)]) else AC_MSG_RESULT([yes ($DEFAULT_ASSEMBLER - GNU as)]) fi else AC_MSG_RESULT(no) fi # --------------- # Find C compiler # --------------- # If a non-executable a.out is present (e.g. created by GNU as above even if # invoked with -v only), the IRIX 6 native ld just overwrites the existing # file, even when creating an executable, so an execution test fails. # Remove possible default executable files to avoid this. # # FIXME: This really belongs into AC_PROG_CC and can be removed once # Autoconf includes it. rm -f a.out a.exe b.out # Find the native compiler AC_PROG_CC AM_PROG_CC_C_O AC_PROG_CXX ACX_PROG_GNAT([-I"$srcdir"/ada]) # autoconf is lame and doesn't give us any substitution variable for this. if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then NO_MINUS_C_MINUS_O=yes else OUTPUT_OPTION='-o $@' fi AC_SUBST(NO_MINUS_C_MINUS_O) AC_SUBST(OUTPUT_OPTION) # Remove the -O2: for historical reasons, unless bootstrapping we prefer # optimizations to be activated explicitly by the toplevel. case "$CC" in */prev-gcc/xgcc*) ;; *) CFLAGS=`echo $CFLAGS | sed "s/-O[[s0-9]]* *//" ` ;; esac AC_SUBST(CFLAGS) # Determine PICFLAG for target gnatlib. GCC_PICFLAG_FOR_TARGET AC_SUBST(PICFLAG_FOR_TARGET) # ------------------------- # Check C compiler features # ------------------------- AC_USE_SYSTEM_EXTENSIONS AC_PROG_CPP AC_C_INLINE AC_SYS_LARGEFILE # sizeof(char) is 1 by definition. AC_CHECK_SIZEOF(void *) AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_TYPES([long long], [AC_CHECK_SIZEOF(long long)]) AC_CHECK_TYPES([__int64], [AC_CHECK_SIZEOF(__int64)]) GCC_STDINT_TYPES # --------------------- # Warnings and checking # --------------------- # Check $CC warning features (if it's GCC). # We want to use -pedantic, but we don't want warnings about # * 'long long' # * variadic macros # * overlong strings # * C++11 narrowing conversions in { } # So, we only use -pedantic if we can disable those warnings. ACX_PROG_CC_WARNING_OPTS( m4_quote(m4_do([-W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual])), [loose_warn]) ACX_PROG_CC_WARNING_OPTS( m4_quote(m4_do([-Wstrict-prototypes -Wmissing-prototypes])), [c_loose_warn]) ACX_PROG_CC_WARNING_OPTS( m4_quote(m4_do([-Wmissing-format-attribute])), [strict_warn]) ACX_PROG_CC_WARNING_OPTS( m4_quote(m4_do([-Wold-style-definition -Wc++-compat])), [c_strict_warn]) ACX_PROG_CC_WARNING_ALMOST_PEDANTIC( m4_quote(m4_do([-Wno-long-long -Wno-variadic-macros ], [-Wno-overlength-strings])), [strict_warn]) ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual], [strict_warn]) # The above macros do nothing if the compiler is not GCC. However, the # Makefile has more goo to add other flags, so these variables are used # to enable warnings only for GCC. warn_cflags= warn_cxxflags= if test "x$GCC" = "xyes"; then warn_cflags='$(GCC_WARN_CFLAGS)' warn_cxxflags='$(GCC_WARN_CXXFLAGS)' fi AC_SUBST(warn_cflags) AC_SUBST(warn_cxxflags) # Disable exceptions and RTTI if building with g++ ACX_PROG_CC_WARNING_OPTS( m4_quote(m4_do([-fno-exceptions -fno-rtti])), [noexception_flags]) # Enable expensive internal checks is_release= if test x"`cat $srcdir/DEV-PHASE`" != xexperimental; then is_release=yes fi AC_ARG_ENABLE(checking, [AS_HELP_STRING([[--enable-checking[=LIST]]], [enable expensive run-time checks. With LIST, enable only specific categories of checks. Categories are: yes,no,all,none,release. Flags are: assert,df,fold,gc,gcac,gimple,misc, rtlflag,rtl,runtime,tree,valgrind,types])], [ac_checking_flags="${enableval}"],[ # Determine the default checks. if test x$is_release = x ; then ac_checking_flags=yes else ac_checking_flags=release fi]) IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS," for check in release $ac_checking_flags do case $check in # these set all the flags to specific states yes) ac_assert_checking=1 ; ac_checking=1 ; ac_df_checking= ; ac_fold_checking= ; ac_gc_checking=1 ; ac_gc_always_collect= ; ac_gimple_checking=1 ; ac_rtl_checking= ; ac_rtlflag_checking=1 ; ac_runtime_checking=1 ; ac_tree_checking=1 ; ac_valgrind_checking= ; ac_types_checking=1 ;; no|none) ac_assert_checking= ; ac_checking= ; ac_df_checking= ; ac_fold_checking= ; ac_gc_checking= ; ac_gc_always_collect= ; ac_gimple_checking= ; ac_rtl_checking= ; ac_rtlflag_checking= ; ac_runtime_checking= ; ac_tree_checking= ; ac_valgrind_checking= ; ac_types_checking= ;; all) ac_assert_checking=1 ; ac_checking=1 ; ac_df_checking=1 ; ac_fold_checking=1 ; ac_gc_checking=1 ; ac_gc_always_collect=1 ; ac_gimple_checking=1 ; ac_rtl_checking=1 ; ac_rtlflag_checking=1 ; ac_runtime_checking=1 ; ac_tree_checking=1 ; ac_valgrind_checking= ; ac_types_checking=1 ;; release) ac_assert_checking=1 ; ac_checking= ; ac_df_checking= ; ac_fold_checking= ; ac_gc_checking= ; ac_gc_always_collect= ; ac_gimple_checking= ; ac_rtl_checking= ; ac_rtlflag_checking= ; ac_runtime_checking=1 ; ac_tree_checking= ; ac_valgrind_checking= ; ac_types_checking= ;; # these enable particular checks assert) ac_assert_checking=1 ;; df) ac_df_checking=1 ;; fold) ac_fold_checking=1 ;; gc) ac_gc_checking=1 ;; gcac) ac_gc_always_collect=1 ;; gimple) ac_gimple_checking=1 ;; misc) ac_checking=1 ;; rtl) ac_rtl_checking=1 ;; rtlflag) ac_rtlflag_checking=1 ;; runtime) ac_runtime_checking=1 ;; tree) ac_tree_checking=1 ;; types) ac_types_checking=1 ;; valgrind) ac_valgrind_checking=1 ;; *) AC_MSG_ERROR(unknown check category $check) ;; esac done IFS="$ac_save_IFS" nocommon_flag="" if test x$ac_checking != x ; then AC_DEFINE(ENABLE_CHECKING, 1, [Define if you want more run-time sanity checks. This one gets a grab bag of miscellaneous but relatively cheap checks.]) nocommon_flag=-fno-common fi AC_SUBST(nocommon_flag) if test x$ac_df_checking != x ; then AC_DEFINE(ENABLE_DF_CHECKING, 1, [Define if you want more run-time sanity checks for dataflow.]) fi if test x$ac_assert_checking != x ; then AC_DEFINE(ENABLE_ASSERT_CHECKING, 1, [Define if you want assertions enabled. This is a cheap check.]) fi if test x$ac_gimple_checking != x ; then AC_DEFINE(ENABLE_GIMPLE_CHECKING, 1, [Define if you want operations on GIMPLE (the basic data structure of the high-level optimizers) to be checked for dynamic type safety at runtime. This is moderately expensive.]) fi GCC_TARGET_TEMPLATE(ENABLE_RUNTIME_CHECKING) if test x$ac_runtime_checking != x ; then AC_DEFINE(ENABLE_RUNTIME_CHECKING, 1, [Define if you want runtime assertions enabled. This is a cheap check.]) fi if test x$ac_tree_checking != x ; then AC_DEFINE(ENABLE_TREE_CHECKING, 1, [Define if you want all operations on trees (the basic data structure of the front ends) to be checked for dynamic type safety at runtime. This is moderately expensive. The tree browser debugging routines will also be enabled by this option. ]) TREEBROWSER=tree-browser.o fi if test x$ac_types_checking != x ; then AC_DEFINE(ENABLE_TYPES_CHECKING, 1, [Define if you want all gimple types to be verified after gimplifiation. This is cheap. ]) fi AC_SUBST(TREEBROWSER) if test x$ac_rtl_checking != x ; then AC_DEFINE(ENABLE_RTL_CHECKING, 1, [Define if you want all operations on RTL (the basic data structure of the optimizer and back end) to be checked for dynamic type safety at runtime. This is quite expensive.]) fi if test x$ac_rtlflag_checking != x ; then AC_DEFINE(ENABLE_RTL_FLAG_CHECKING, 1, [Define if you want RTL flag accesses to be checked against the RTL codes that are supported for each access macro. This is relatively cheap.]) fi if test x$ac_gc_checking != x ; then AC_DEFINE(ENABLE_GC_CHECKING, 1, [Define if you want the garbage collector to do object poisoning and other memory allocation checks. This is quite expensive.]) fi if test x$ac_gc_always_collect != x ; then AC_DEFINE(ENABLE_GC_ALWAYS_COLLECT, 1, [Define if you want the garbage collector to operate in maximally paranoid mode, validating the entire heap and collecting garbage at every opportunity. This is extremely expensive.]) fi if test x$ac_fold_checking != x ; then AC_DEFINE(ENABLE_FOLD_CHECKING, 1, [Define if you want fold checked that it never destructs its argument. This is quite expensive.]) fi valgrind_path_defines= valgrind_command= dnl # This check AC_REQUIREs various stuff, so it *must not* be inside dnl # an if statement. This was the source of very frustrating bugs dnl # in converting to autoconf 2.5x! AC_CHECK_HEADER(valgrind.h, have_valgrind_h=yes, have_valgrind_h=no) if test x$ac_valgrind_checking != x ; then # It is certainly possible that there's valgrind but no valgrind.h. # GCC relies on making annotations so we must have both. AC_MSG_CHECKING(for VALGRIND_DISCARD in ) AC_PREPROC_IFELSE([AC_LANG_SOURCE( [[#include #ifndef VALGRIND_DISCARD #error VALGRIND_DISCARD not defined #endif]])], [gcc_cv_header_valgrind_memcheck_h=yes], [gcc_cv_header_valgrind_memcheck_h=no]) AC_MSG_RESULT($gcc_cv_header_valgrind_memcheck_h) AC_MSG_CHECKING(for VALGRIND_DISCARD in ) AC_PREPROC_IFELSE([AC_LANG_SOURCE( [[#include #ifndef VALGRIND_DISCARD #error VALGRIND_DISCARD not defined #endif]])], [gcc_cv_header_memcheck_h=yes], [gcc_cv_header_memcheck_h=no]) AC_MSG_RESULT($gcc_cv_header_memcheck_h) AM_PATH_PROG_WITH_TEST(valgrind_path, valgrind, [$ac_dir/$ac_word --version | grep valgrind- >/dev/null 2>&1]) if test "x$valgrind_path" = "x" \ || (test $have_valgrind_h = no \ && test $gcc_cv_header_memcheck_h = no \ && test $gcc_cv_header_valgrind_memcheck_h = no); then AC_MSG_ERROR([*** Can't find both valgrind and valgrind/memcheck.h, memcheck.h or valgrind.h]) fi valgrind_path_defines=-DVALGRIND_PATH='\"'$valgrind_path'\"' valgrind_command="$valgrind_path -q" AC_DEFINE(ENABLE_VALGRIND_CHECKING, 1, [Define if you want to run subprograms and generated programs through valgrind (a memory checker). This is extremely expensive.]) if test $gcc_cv_header_valgrind_memcheck_h = yes; then AC_DEFINE(HAVE_VALGRIND_MEMCHECK_H, 1, [Define if valgrind's valgrind/memcheck.h header is installed.]) fi if test $gcc_cv_header_memcheck_h = yes; then AC_DEFINE(HAVE_MEMCHECK_H, 1, [Define if valgrind's memcheck.h header is installed.]) fi fi AC_SUBST(valgrind_path_defines) AC_SUBST(valgrind_command) # Enable code coverage collection AC_ARG_ENABLE(coverage, [AS_HELP_STRING([[--enable-coverage[=LEVEL]]], [enable compiler's code coverage collection. Use to measure compiler performance and locate unused parts of the compiler. With LEVEL, specify optimization. Values are opt, noopt, default is noopt])], [case "${enableval}" in yes|noopt) coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O0" ;; opt) coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O2" ;; no) # a.k.a. --disable-coverage coverage_flags="" ;; *) AC_MSG_ERROR(unknown coverage setting $enableval) ;; esac], [coverage_flags=""]) AC_SUBST(coverage_flags) AC_ARG_ENABLE(gather-detailed-mem-stats, [AS_HELP_STRING([--enable-gather-detailed-mem-stats], [enable detailed memory allocation stats gathering])], [], [enable_gather_detailed_mem_stats=no]) if test x$enable_gather_detailed_mem_stats = xyes ; then AC_DEFINE(GATHER_STATISTICS, 1, [Define to enable detailed memory allocation stats gathering.]) fi # ------------------------------- # Miscenalleous configure options # ------------------------------- # See if we are building gcc with C++. AC_ARG_ENABLE(build-with-cxx, [AS_HELP_STRING([--enable-build-with-cxx], [build with C++ compiler instead of C compiler])], ENABLE_BUILD_WITH_CXX=$enableval, ENABLE_BUILD_WITH_CXX=no) AC_SUBST(ENABLE_BUILD_WITH_CXX) if test "$ENABLE_BUILD_WITH_CXX" = "yes"; then AC_DEFINE(ENABLE_BUILD_WITH_CXX, 1, [Define if building with C++.]) fi # With stabs AC_ARG_WITH(stabs, [AS_HELP_STRING([--with-stabs], [arrange to use stabs instead of host debug format])], stabs="$with_stabs", stabs=no) # Determine whether or not multilibs are enabled. AC_ARG_ENABLE(multilib, [AS_HELP_STRING([--enable-multilib], [enable library support for multiple ABIs])], [], [enable_multilib=yes]) AC_SUBST(enable_multilib) # Enable __cxa_atexit for C++. AC_ARG_ENABLE(__cxa_atexit, [AS_HELP_STRING([--enable-__cxa_atexit], [enable __cxa_atexit for C++])], [], []) # Enable C extension for decimal float if target supports it. GCC_AC_ENABLE_DECIMAL_FLOAT([$target]) dfp=`if test $enable_decimal_float != no; then echo 1; else echo 0; fi` AC_DEFINE_UNQUOTED(ENABLE_DECIMAL_FLOAT, $dfp, [Define to 1 to enable decimal float extension to C.]) # Use default_decimal_float for dependency. enable_decimal_float=$default_decimal_float bid=`if test $enable_decimal_float = bid; then echo 1; else echo 0; fi` AC_DEFINE_UNQUOTED(ENABLE_DECIMAL_BID_FORMAT, $bid, [Define to 1 to specify that we are using the BID decimal floating point format instead of DPD]) # Enable C extension for fixed-point arithmetic. AC_ARG_ENABLE(fixed-point, [AS_HELP_STRING([--enable-fixed-point], [enable fixed-point arithmetic extension to C])], [], [ case $target in arm*) enable_fixed_point=yes ;; mips*-*-*) enable_fixed_point=yes ;; *) AC_MSG_WARN([fixed-point is not supported for this target, ignored]) enable_fixed_point=no ;; esac ]) AC_SUBST(enable_fixed_point) fixedpoint=`if test $enable_fixed_point = yes; then echo 1; else echo 0; fi` AC_DEFINE_UNQUOTED(ENABLE_FIXED_POINT, $fixedpoint, [Define to 1 to enable fixed-point arithmetic extension to C.]) # Enable threads # Pass with no value to take the default # Pass with a value to specify a thread package AC_ARG_ENABLE(threads, [AS_HELP_STRING([[--enable-threads[=LIB]]], [enable thread usage for target GCC, using LIB thread package])],, [enable_threads='']) AC_ARG_ENABLE(tls, [AS_HELP_STRING([--enable-tls], [enable or disable generation of tls code overriding the assembler check for tls support])], [ case $enable_tls in yes | no) ;; *) AC_MSG_ERROR(['$enable_tls' is an invalid value for --enable-tls. Valid choices are 'yes' and 'no'.]) ;; esac ], [enable_tls='']) AC_ARG_ENABLE(objc-gc, [AS_HELP_STRING([--enable-objc-gc], [enable the use of Boehm's garbage collector with the GNU Objective-C runtime])], if test x$enable_objc_gc = xno; then objc_boehm_gc='' else objc_boehm_gc=1 fi, objc_boehm_gc='') AC_ARG_WITH(dwarf2, [AS_HELP_STRING([--with-dwarf2], [force the default debug format to be DWARF 2])], dwarf2="$with_dwarf2", dwarf2=no) AC_ARG_ENABLE(shared, [AS_HELP_STRING([--disable-shared], [don't provide a shared libgcc])], [ case $enable_shared in yes | no) ;; *) enable_shared=no IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "Xgcc" || test "X$pkg" = "Xlibgcc"; then enable_shared=yes fi done IFS="$ac_save_ifs" ;; esac ], [enable_shared=yes]) AC_SUBST(enable_shared) AC_ARG_WITH([native-system-header-dir], [ --with-native-system-header-dir=dir use dir as the directory to look for standard system header files in. Defaults to /usr/include.], [ case ${with_native_system_header_dir} in yes|no) AC_MSG_ERROR([bad value ${withval} given for --with-native-system-header-dir]) ;; /* | [[A-Za-z]]:[[\\/]]*) ;; *) AC_MSG_ERROR([--with-native-system-header-dir argument ${withval} must be an absolute directory]) ;; esac configured_native_system_header_dir="${withval}" ], [configured_native_system_header_dir=]) AC_ARG_WITH(build-sysroot, [AS_HELP_STRING([--with-build-sysroot=sysroot], [use sysroot as the system root during the build])], [if test x"$withval" != x ; then SYSROOT_CFLAGS_FOR_TARGET="--sysroot=$withval" fi], [SYSROOT_CFLAGS_FOR_TARGET=]) AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET) AC_ARG_WITH(sysroot, [AS_HELP_STRING([[--with-sysroot[=DIR]]], [search for usr/lib, usr/include, et al, within DIR])], [ case ${with_sysroot} in yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_noncanonical}/sys-root' ;; *) TARGET_SYSTEM_ROOT=$with_sysroot ;; esac TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"' CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$${sysroot_headers_suffix}$(NATIVE_SYSTEM_HEADER_DIR)' if test "x$prefix" = xNONE; then test_prefix=/usr/local else test_prefix=$prefix fi if test "x$exec_prefix" = xNONE; then test_exec_prefix=$test_prefix else test_exec_prefix=$exec_prefix fi case ${TARGET_SYSTEM_ROOT} in "${test_prefix}"|"${test_prefix}/"*|\ "${test_exec_prefix}"|"${test_exec_prefix}/"*|\ '${prefix}'|'${prefix}/'*|\ '${exec_prefix}'|'${exec_prefix}/'*) t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE" TARGET_SYSTEM_ROOT_DEFINE="$t" ;; esac ], [ TARGET_SYSTEM_ROOT= TARGET_SYSTEM_ROOT_DEFINE= CROSS_SYSTEM_HEADER_DIR='$(gcc_tooldir)/sys-include' ]) AC_SUBST(TARGET_SYSTEM_ROOT) AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) AC_SUBST(CROSS_SYSTEM_HEADER_DIR) AC_ARG_WITH(specs, [AS_HELP_STRING([--with-specs=SPECS], [add SPECS to driver command-line processing])], [CONFIGURE_SPECS=$withval], [CONFIGURE_SPECS=] ) AC_SUBST(CONFIGURE_SPECS) ACX_PKGVERSION([GCC]) ACX_BUGURL([http://gcc.gnu.org/bugs.html]) # Sanity check enable_languages in case someone does not run the toplevel # configure # script. AC_ARG_ENABLE(languages, [AS_HELP_STRING([--enable-languages=LIST], [specify which front-ends to build])], [case ,${enable_languages}, in ,,|,yes,) # go safe -- we cannot be much sure without the toplevel # configure's # analysis of which target libs are present and usable enable_languages=c ;; *,all,*) AC_MSG_ERROR([only the toplevel supports --enable-languages=all]) ;; *,c,*) ;; *) enable_languages=c,${enable_languages} ;; esac], [enable_languages=c]) AC_ARG_WITH(multilib-list, [AS_HELP_STRING([--with-multilib-list], [select multilibs (SH and x86-64 only)])], :, with_multilib_list=default) # ------------------------- # Checks for other programs # ------------------------- AC_PROG_MAKE_SET # Find some useful tools AC_PROG_AWK # We need awk to create options.c and options.h. # Bail out if it's missing. case ${AWK} in "") AC_MSG_ERROR([can't build without awk, bailing out]) ;; esac gcc_AC_PROG_LN_S ACX_PROG_LN($LN_S) AC_PROG_RANLIB ranlib_flags="" AC_SUBST(ranlib_flags) gcc_AC_PROG_INSTALL # See if cmp has --ignore-initial. gcc_AC_PROG_CMP_IGNORE_INITIAL # See if we have the mktemp command. AC_CHECK_PROG(have_mktemp_command, mktemp, yes, no) # See if makeinfo has been installed and is modern enough # that we can use it. ACX_CHECK_PROG_VER(MAKEINFO, makeinfo, --version, [GNU texinfo.* \([0-9][0-9.]*\)], [4.[7-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*]) if test $gcc_cv_prog_makeinfo_modern = no; then AC_MSG_WARN([ *** Makeinfo is missing or too old. *** Info documentation will not be built.]) BUILD_INFO= else BUILD_INFO=info fi AC_SUBST(BUILD_INFO) # Is pod2man recent enough to regenerate manpages? AC_MSG_CHECKING([for recent Pod::Man]) if (perl -e 'use 1.10 Pod::Man') >/dev/null 2>&1; then AC_MSG_RESULT(yes) GENERATED_MANPAGES=generated-manpages else AC_MSG_RESULT(no) GENERATED_MANPAGES= fi AC_SUBST(GENERATED_MANPAGES) MISSING="${CONFIG_SHELL-/bin/sh} $ac_aux_dir/missing" # How about lex? dnl Don't use AC_PROG_LEX; we insist on flex. dnl LEXLIB is not useful in gcc. AC_CHECK_PROGS([FLEX], flex, [$MISSING flex]) # Bison? AC_CHECK_PROGS([BISON], bison, [$MISSING bison]) # Binutils are not build modules, unlike bison/flex/makeinfo. So we # check for build == host before using them. # NM if test x${build} = x${host} && test -f $srcdir/../binutils/nm.c \ && test -d ../binutils ; then NM='${objdir}/../binutils/nm-new' else AC_CHECK_PROG(NM, nm, nm, ${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing nm) fi # AR if test x${build} = x${host} && test -f $srcdir/../binutils/ar.c \ && test -d ../binutils ; then AR='${objdir}/../binutils/ar' else AC_CHECK_PROG(AR, ar, ar, ${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing ar) fi # -------------------- # Checks for C headers # -------------------- # Need to reject headers which give warnings, so that the -Werror bootstrap # works later. *sigh* This needs to come before all header checks. AC_PROG_CPP_WERROR AC_HEADER_STDC AC_HEADER_TIME ACX_HEADER_STRING AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h iconv.h \ fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \ sys/resource.h sys/param.h sys/times.h sys/stat.h \ direct.h malloc.h langinfo.h ldfcn.h locale.h wchar.h) # Check for thread headers. AC_CHECK_HEADER(thread.h, [have_thread_h=yes], [have_thread_h=]) AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=]) # These tests can't be done till we know if we have limits.h. gcc_AC_C_CHAR_BIT AC_C_BIGENDIAN # ---------------------- # Checks for C++ headers # ---------------------- dnl Autoconf will give an error in the configure script if there is no dnl C++ preprocessor. Hack to prevent that. m4_pushdef([AC_MSG_ERROR], m4_defn([AC_MSG_WARN]))[]dnl AC_PROG_CXXCPP m4_popdef([AC_MSG_ERROR])[]dnl AC_LANG_PUSH(C++) AC_CHECK_HEADERS(unordered_map) AC_CHECK_HEADERS(tr1/unordered_map) AC_CHECK_HEADERS(ext/hash_map) AC_LANG_POP(C++) # -------- # UNSORTED # -------- # These libraries may be used by collect2. # We may need a special search path to get them linked. AC_CACHE_CHECK(for collect2 libraries, gcc_cv_collect2_libs, [save_LIBS="$LIBS" for libs in '' -lld -lmld \ '-L/usr/lib/cmplrs/cc2.11 -lmld' \ '-L/usr/lib/cmplrs/cc3.11 -lmld' do LIBS="$libs" AC_TRY_LINK_FUNC(ldopen, [gcc_cv_collect2_libs="$libs"; break]) done LIBS="$save_LIBS" test -z "$gcc_cv_collect2_libs" && gcc_cv_collect2_libs='none required']) case $gcc_cv_collect2_libs in "none required") ;; *) COLLECT2_LIBS=$gcc_cv_collect2_libs ;; esac AC_SUBST(COLLECT2_LIBS) # When building Ada code on Alpha, we need exc_resume which is usually in # -lexc. So test for it. save_LIBS="$LIBS" LIBS= AC_SEARCH_LIBS(exc_resume, exc) GNAT_LIBEXC="$LIBS" LIBS="$save_LIBS" AC_SUBST(GNAT_LIBEXC) # To support -mcpu=native on Solaris/SPARC, we need libkstat. save_LIBS="$LIBS" LIBS= AC_SEARCH_LIBS(kstat_open, kstat) EXTRA_GCC_LIBS="$LIBS" LIBS="$save_LIBS" AC_SUBST(EXTRA_GCC_LIBS) # Some systems put ldexp and frexp in libm instead of libc; assume # they're both in the same place. jcf-dump needs them. save_LIBS="$LIBS" LIBS= AC_SEARCH_LIBS(ldexp, m) LDEXP_LIB="$LIBS" LIBS="$save_LIBS" AC_SUBST(LDEXP_LIB) # Use only if it exists, # doesn't clash with , and declares intmax_t. AC_MSG_CHECKING(for inttypes.h) AC_CACHE_VAL(gcc_cv_header_inttypes_h, [AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [[#include #include ]], [[intmax_t i = -1;]])], [gcc_cv_header_inttypes_h=yes], [gcc_cv_header_inttypes_h=no])]) AC_MSG_RESULT($gcc_cv_header_inttypes_h) if test $gcc_cv_header_inttypes_h = yes; then AC_DEFINE(HAVE_INTTYPES_H, 1, [Define if you have a working header file.]) fi dnl Disabled until we have a complete test for buggy enum bitfields. dnl gcc_AC_C_ENUM_BF_UNSIGNED define(gcc_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked dnl fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked dnl fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl putchar_unlocked putc_unlocked) AC_CHECK_FUNCS(times clock kill getrlimit setrlimit atoll atoq \ sysconf strsignal getrusage nl_langinfo \ gettimeofday mbstowcs wcswidth mmap setlocale \ gcc_UNLOCKED_FUNCS madvise) if test x$ac_cv_func_mbstowcs = xyes; then AC_CACHE_CHECK(whether mbstowcs works, gcc_cv_func_mbstowcs_works, [ AC_RUN_IFELSE([AC_LANG_SOURCE([[#include int main() { mbstowcs(0, "", 0); return 0; }]])], [gcc_cv_func_mbstowcs_works=yes], [gcc_cv_func_mbstowcs_works=no], [gcc_cv_func_mbstowcs_works=yes])]) if test x$gcc_cv_func_mbstowcs_works = xyes; then AC_DEFINE(HAVE_WORKING_MBSTOWCS, 1, [Define this macro if mbstowcs does not crash when its first argument is NULL.]) fi fi AC_CHECK_TYPE(ssize_t, int) AC_CHECK_TYPE(caddr_t, char *) GCC_AC_FUNC_MMAP_BLACKLIST case "${host}" in *-*-*vms*) # Under VMS, vfork works very differently than on Unix. The standard test # won't work, and it isn't easily adaptable. It makes more sense to # just force it. ac_cv_func_vfork_works=yes ;; esac AC_FUNC_FORK # g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which exposes a different # iconv() prototype. AS_IF([test "$ENABLE_BUILD_WITH_CXX" = "yes"], [AC_LANG_PUSH([C++]) AM_ICONV AC_LANG_POP([C++])], [AM_ICONV]) # Until we have in-tree GNU iconv: LIBICONV_DEP= AC_SUBST(LIBICONV_DEP) AM_LC_MESSAGES AM_LANGINFO_CODESET # We will need to find libiberty.h and ansidecl.h saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include" saved_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -I${srcdir} -I${srcdir}/../include" gcc_AC_CHECK_DECLS(getenv atol asprintf sbrk abort atof getcwd getwd \ strsignal strstr stpcpy strverscmp \ errno snprintf vsnprintf vasprintf malloc realloc calloc \ free basename getopt clock getpagesize gcc_UNLOCKED_FUNCS, , ,[ #include "ansidecl.h" #include "system.h"]) gcc_AC_CHECK_DECLS(getrlimit setrlimit getrusage, , ,[ #include "ansidecl.h" #include "system.h" #ifdef HAVE_SYS_RESOURCE_H #include #endif ]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include "ansidecl.h" #include "system.h" #ifdef HAVE_SYS_RESOURCE_H #include #endif ]], [[rlim_t l = 0;]])],[],[AC_DEFINE([rlim_t],[long], [Define to `long' if doesn't define.])]) # On AIX 5.2, conflicts with , as both define incompatible # FREAD and FWRITE macros. Fortunately, for GCC's single usage of ldgetname # in collect2.c, isn't visible, but the configure test below needs # to undef these macros to get the correct value for HAVE_DECL_LDGETNAME. gcc_AC_CHECK_DECLS(ldgetname, , ,[ #include "ansidecl.h" #include "system.h" #ifdef HAVE_LDFCN_H #undef FREAD #undef FWRITE #include #endif ]) gcc_AC_CHECK_DECLS(times, , ,[ #include "ansidecl.h" #include "system.h" #ifdef HAVE_SYS_TIMES_H #include #endif ]) gcc_AC_CHECK_DECLS(sigaltstack, , ,[ #include "ansidecl.h" #include "system.h" #include ]) # g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which hides the madvise() # prototype. AS_IF([test "$ENABLE_BUILD_WITH_CXX" = "yes"], [AC_LANG_PUSH([C++]) gcc_AC_CHECK_DECLS(madvise, , ,[ #include "ansidecl.h" #include "system.h" ]) AC_LANG_POP([C++])], [gcc_AC_CHECK_DECLS(madvise, , ,[ #include "ansidecl.h" #include "system.h" ]) ]) # More time-related stuff. AC_CACHE_CHECK(for struct tms, ac_cv_struct_tms, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include "ansidecl.h" #include "system.h" #ifdef HAVE_SYS_TIMES_H #include #endif ]], [[struct tms tms;]])],[ac_cv_struct_tms=yes],[ac_cv_struct_tms=no])]) if test $ac_cv_struct_tms = yes; then AC_DEFINE(HAVE_STRUCT_TMS, 1, [Define if defines struct tms.]) fi # use gcc_cv_* here because this doesn't match the behavior of AC_CHECK_TYPE. # revisit after autoconf 2.50. AC_CACHE_CHECK(for clock_t, gcc_cv_type_clock_t, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include "ansidecl.h" #include "system.h" ]], [[clock_t x;]])],[gcc_cv_type_clock_t=yes],[gcc_cv_type_clock_t=no])]) if test $gcc_cv_type_clock_t = yes; then AC_DEFINE(HAVE_CLOCK_T, 1, [Define if defines clock_t.]) fi # Restore CFLAGS, CXXFLAGS from before the gcc_AC_NEED_DECLARATIONS tests. CFLAGS="$saved_CFLAGS" CXXFLAGS="$saved_CXXFLAGS" # mkdir takes a single argument on some systems. gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG # File extensions manext='.1' objext='.o' AC_SUBST(manext) AC_SUBST(objext) # With Setjmp/Longjmp based exception handling. AC_ARG_ENABLE(sjlj-exceptions, [AS_HELP_STRING([--enable-sjlj-exceptions], [arrange to use setjmp/longjmp exception handling])], [case $target in *-*-hpux10*) if test $enableval != yes; then AC_MSG_WARN([dwarf2 exceptions not supported, sjlj exceptions forced]) enableval=yes fi ;; esac force_sjlj_exceptions=yes], [case $target in *-*-hpux10*) force_sjlj_exceptions=yes enableval=yes ;; *) force_sjlj_exceptions=no ;; esac]) if test $force_sjlj_exceptions = yes; then sjlj=`if test $enableval = yes; then echo 1; else echo 0; fi` AC_DEFINE_UNQUOTED(CONFIG_SJLJ_EXCEPTIONS, $sjlj, [Define 0/1 to force the choice for exception handling model.]) fi # -------------------------------------------------------- # Build, host, and target specific configuration fragments # -------------------------------------------------------- # Collect build-machine-specific information. . ${srcdir}/config.build # Collect host-machine-specific information. . ${srcdir}/config.host target_gtfiles= # Collect target-machine-specific information. . ${srcdir}/config.gcc extra_objs="${host_extra_objs} ${extra_objs}" extra_gcc_objs="${host_extra_gcc_objs} ${extra_gcc_objs}" # Default the target-machine variables that were not explicitly set. if test x"$tm_file" = x then tm_file=$cpu_type/$cpu_type.h; fi if test x"$extra_headers" = x then extra_headers=; fi if test x$md_file = x then md_file=$cpu_type/$cpu_type.md; fi if test x$out_file = x then out_file=$cpu_type/$cpu_type.c; fi if test x"$tmake_file" = x then tmake_file=$cpu_type/t-$cpu_type fi # Support --enable-initfini-array. if test x$enable_initfini_array != xno; then tm_file="${tm_file} initfini-array.h" fi if test x"$dwarf2" = xyes then tm_file="$tm_file tm-dwarf2.h" fi # Say what files are being used for the output code and MD file. echo "Using \`$srcdir/config/$out_file' for machine-specific logic." echo "Using \`$srcdir/config/$md_file' as machine description file." # If any of the xm_file variables contain nonexistent files, warn # about them and drop them. bx= for x in $build_xm_file; do if test -f $srcdir/config/$x then bx="$bx $x" else AC_MSG_WARN($srcdir/config/$x does not exist.) fi done build_xm_file="$bx" hx= for x in $host_xm_file; do if test -f $srcdir/config/$x then hx="$hx $x" else AC_MSG_WARN($srcdir/config/$x does not exist.) fi done host_xm_file="$hx" tx= for x in $xm_file; do if test -f $srcdir/config/$x then tx="$tx $x" else AC_MSG_WARN($srcdir/config/$x does not exist.) fi done xm_file="$tx" count=a for f in $tm_file; do count=${count}x done if test $count = ax; then echo "Using \`$srcdir/config/$tm_file' as target machine macro file." else echo "Using the following target machine macro files:" for f in $tm_file; do echo " $srcdir/config/$f" done fi if test x$need_64bit_hwint = xyes; then AC_DEFINE(NEED_64BIT_HOST_WIDE_INT, 1, [Define to 1 if HOST_WIDE_INT must be 64 bits wide (see hwint.h).]) fi if test x$use_long_long_for_widest_fast_int = xyes; then AC_DEFINE(USE_LONG_LONG_FOR_WIDEST_FAST_INT, 1, [Define to 1 if the 'long long' (or '__int64') is wider than 'long' but still efficiently supported by the host hardware.]) fi count=a for f in $host_xm_file; do count=${count}x done if test $count = a; then : elif test $count = ax; then echo "Using \`$srcdir/config/$host_xm_file' as host machine macro file." else echo "Using the following host machine macro files:" for f in $host_xm_file; do echo " $srcdir/config/$f" done fi echo "Using ${out_host_hook_obj} for host machine hooks." if test "$host_xm_file" != "$build_xm_file"; then count=a for f in $build_xm_file; do count=${count}x done if test $count = a; then : elif test $count = ax; then echo "Using \`$srcdir/config/$build_xm_file' as build machine macro file." else echo "Using the following build machine macro files:" for f in $build_xm_file; do echo " $srcdir/config/$f" done fi fi if test -n "$configured_native_system_header_dir"; then native_system_header_dir=$configured_native_system_header_dir fi NATIVE_SYSTEM_HEADER_DIR="$native_system_header_dir" AC_SUBST(NATIVE_SYSTEM_HEADER_DIR) case ${host} in powerpc*-*-darwin*) AC_CACHE_CHECK([whether mcontext_t fields have underscores], gcc_cv_mcontext_underscores, AC_COMPILE_IFELSE([ #include #include #include int main() { mcontext_t m; if (m->ss.srr0) return 0; return 0; } ], gcc_cv_mcontext_underscores=no, gcc_cv_mcontext_underscores=yes)) if test $gcc_cv_mcontext_underscores = yes; then AC_DEFINE(HAS_MCONTEXT_T_UNDERSCORES,,dnl [mcontext_t fields start with __]) fi ;; esac # --------- # Threading # --------- # Check if a valid thread package case ${enable_threads} in "" | no) # No threads target_thread_file='single' ;; yes) # default target_thread_file='single' ;; aix | dce | lynx | mipssde | posix | rtems | \ single | tpf | vxworks | win32) target_thread_file=${enable_threads} ;; *) echo "${enable_threads} is an unknown thread package" 1>&2 exit 1 ;; esac if test x${thread_file} = x; then # No thread file set by target-specific clauses in config.gcc, # so use file chosen by default logic above thread_file=${target_thread_file} fi # -------- # UNSORTED # -------- use_cxa_atexit=no if test x$enable___cxa_atexit = xyes || \ test x$enable___cxa_atexit = x -a x$default_use_cxa_atexit = xyes; then if test x$host = x$target; then case $host in # mingw32 doesn't have __cxa_atexit but uses atexit registration # keyed to flag_use_cxa_atexit *-*-mingw32*) use_cxa_atexit=yes ;; *) AC_CHECK_FUNC(__cxa_atexit,[use_cxa_atexit=yes], [echo "__cxa_atexit can't be enabled on this target"]) ;; esac else # We can't check for __cxa_atexit when building a cross, so assume # it is available use_cxa_atexit=yes fi if test x$use_cxa_atexit = xyes; then AC_DEFINE(DEFAULT_USE_CXA_ATEXIT, 2, [Define if you want to use __cxa_atexit, rather than atexit, to register C++ destructors for local statics and global objects. This is essential for fully standards-compliant handling of destructors, but requires __cxa_atexit in libc.]) fi fi # Look for a file containing extra machine modes. if test -n "$extra_modes" && test -f $srcdir/config/$extra_modes; then extra_modes_file='$(srcdir)'/config/${extra_modes} AC_SUBST(extra_modes_file) AC_DEFINE_UNQUOTED(EXTRA_MODES_FILE, "config/$extra_modes", [Define to the name of a file containing a list of extra machine modes for this architecture.]) fi # Convert extra_options into a form suitable for Makefile use. extra_opt_files= all_opt_files= for f in $extra_options; do extra_opt_files="$extra_opt_files \$(srcdir)/config/$f" all_opt_files="$all_opt_files $srcdir/config/$f" done AC_SUBST(extra_opt_files) # auto-host.h is the file containing items generated by autoconf and is # the first file included by config.h. # If host=build, it is correct to have bconfig include auto-host.h # as well. If host!=build, we are in error and need to do more # work to find out the build config parameters. if test x$host = x$build then build_auto=auto-host.h else # We create a subdir, then run autoconf in the subdir. # To prevent recursion we set host and build for the new # invocation of configure to the build for this invocation # of configure. tempdir=build.$$ rm -rf $tempdir mkdir $tempdir cd $tempdir case ${srcdir} in /* | [A-Za-z]:[\\/]* ) realsrcdir=${srcdir};; *) realsrcdir=../${srcdir};; esac saved_CFLAGS="${CFLAGS}" CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ LDFLAGS="${LDFLAGS_FOR_BUILD}" \ ${realsrcdir}/configure \ --enable-languages=${enable_languages-all} \ --target=$target_alias --host=$build_alias --build=$build_alias CFLAGS="${saved_CFLAGS}" # We just finished tests for the build machine, so rename # the file auto-build.h in the gcc directory. mv auto-host.h ../auto-build.h cd .. rm -rf $tempdir build_auto=auto-build.h fi AC_SUBST(build_subdir) tm_file="${tm_file} defaults.h" tm_p_file="${tm_p_file} tm-preds.h" host_xm_file="auto-host.h ansidecl.h ${host_xm_file}" build_xm_file="${build_auto} ansidecl.h ${build_xm_file}" # We don't want ansidecl.h in target files, write code there in ISO/GNU C. # put this back in temporarily. xm_file="auto-host.h ansidecl.h ${xm_file}" # -------- # UNSORTED # -------- changequote(,)dnl # Compile in configure arguments. if test -f configargs.h ; then # Being re-configured. gcc_config_arguments=`grep configuration_arguments configargs.h | sed -e 's/.*"\([^"]*\)".*/\1/'` gcc_config_arguments="$gcc_config_arguments : (reconfigured) $TOPLEVEL_CONFIGURE_ARGUMENTS" else gcc_config_arguments="$TOPLEVEL_CONFIGURE_ARGUMENTS" fi # Double all backslashes and backslash all quotes to turn # gcc_config_arguments into a C string. sed -e 's/\\/\\\\/g; s/"/\\"/g' <conftest.out $gcc_config_arguments EOF gcc_config_arguments_str=`cat conftest.out` rm -f conftest.out cat > configargs.h < plugin-version.h <target assembler and hope that it will have the same features # as the host->target assembler we'll be using. gcc_cv_gas_major_version= gcc_cv_gas_minor_version= gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas m4_pattern_allow([AS_FOR_TARGET])dnl AS_VAR_SET_IF(gcc_cv_as,, [ if test -x "$DEFAULT_ASSEMBLER"; then gcc_cv_as="$DEFAULT_ASSEMBLER" elif test -f $gcc_cv_as_gas_srcdir/configure.in \ && test -f ../gas/Makefile \ && test x$build = x$host; then gcc_cv_as=../gas/as-new$build_exeext elif test -x as$build_exeext; then # Build using assembler in the current directory. gcc_cv_as=./as$build_exeext elif ( set dummy $AS_FOR_TARGET; test -x $[2] ); then gcc_cv_as="$AS_FOR_TARGET" else AC_PATH_PROG(gcc_cv_as, $AS_FOR_TARGET) fi]) ORIGINAL_AS_FOR_TARGET=$gcc_cv_as AC_SUBST(ORIGINAL_AS_FOR_TARGET) case "$ORIGINAL_AS_FOR_TARGET" in ./as | ./as$build_exeext) ;; *) AC_CONFIG_FILES(as:exec-tool.in, [chmod +x as]) ;; esac AC_MSG_CHECKING(what assembler to use) if test "$gcc_cv_as" = ../gas/as-new$build_exeext; then # Single tree build which includes gas. We want to prefer it # over whatever linker top-level may have detected, since # we'll use what we're building after installation anyway. AC_MSG_RESULT(newly built gas) in_tree_gas=yes _gcc_COMPUTE_GAS_VERSION in_tree_gas_is_elf=no if grep 'obj_format = elf' ../gas/Makefile > /dev/null \ || (grep 'obj_format = multi' ../gas/Makefile \ && grep 'extra_objects =.* obj-elf' ../gas/Makefile) > /dev/null then in_tree_gas_is_elf=yes fi else AC_MSG_RESULT($gcc_cv_as) in_tree_gas=no fi # Identify the linker which will work hand-in-glove with the newly # built GCC, so that we can examine its features. This is the linker # which will be driven by the driver program. # # If build != host, and we aren't building gas in-tree, we identify a # build->target linker and hope that it will have the same features # as the host->target linker we'll be using. gcc_cv_gld_major_version= gcc_cv_gld_minor_version= gcc_cv_ld_gld_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/ld gcc_cv_ld_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd AS_VAR_SET_IF(gcc_cv_ld,, [ if test -x "$DEFAULT_LINKER"; then gcc_cv_ld="$DEFAULT_LINKER" elif test -f $gcc_cv_ld_gld_srcdir/configure.in \ && test -f ../ld/Makefile \ && test x$build = x$host; then gcc_cv_ld=../ld/ld-new$build_exeext elif test -x collect-ld$build_exeext; then # Build using linker in the current directory. gcc_cv_ld=./collect-ld$build_exeext elif ( set dummy $LD_FOR_TARGET; test -x $[2] ); then gcc_cv_ld="$LD_FOR_TARGET" else AC_PATH_PROG(gcc_cv_ld, $LD_FOR_TARGET) fi]) ORIGINAL_PLUGIN_LD_FOR_TARGET=$gcc_cv_ld PLUGIN_LD=`basename $gcc_cv_ld` AC_ARG_WITH(plugin-ld, [AS_HELP_STRING([[--with-plugin-ld=[ARG]]], [specify the plugin linker])], [if test x"$withval" != x; then ORIGINAL_PLUGIN_LD_FOR_TARGET="$withval" PLUGIN_LD="$withval" fi]) AC_SUBST(ORIGINAL_PLUGIN_LD_FOR_TARGET) AC_DEFINE_UNQUOTED(PLUGIN_LD, "$PLUGIN_LD", [Specify plugin linker]) # Check to see if we are using gold instead of ld AC_MSG_CHECKING(whether we are using gold) ld_is_gold=no if test x$gcc_cv_ld != x; then if $gcc_cv_ld --version 2>/dev/null | sed 1q \ | grep "GNU gold" > /dev/null; then ld_is_gold=yes fi fi AC_MSG_RESULT($ld_is_gold) ORIGINAL_LD_FOR_TARGET=$gcc_cv_ld AC_SUBST(ORIGINAL_LD_FOR_TARGET) case "$ORIGINAL_LD_FOR_TARGET" in ./collect-ld | ./collect-ld$build_exeext) ;; *) AC_CONFIG_FILES(collect-ld:exec-tool.in, [chmod +x collect-ld]) ;; esac AC_MSG_CHECKING(what linker to use) if test "$gcc_cv_ld" = ../ld/ld-new$build_exeext \ || test "$gcc_cv_ld" = ../gold/ld-new$build_exeext; then # Single tree build which includes ld. We want to prefer it # over whatever linker top-level may have detected, since # we'll use what we're building after installation anyway. AC_MSG_RESULT(newly built ld) in_tree_ld=yes in_tree_ld_is_elf=no if (grep 'EMUL = .*elf' ../ld/Makefile \ || grep 'EMUL = .*linux' ../ld/Makefile \ || grep 'EMUL = .*lynx' ../ld/Makefile) > /dev/null; then in_tree_ld_is_elf=yes elif test "$ld_is_gold" = yes; then in_tree_ld_is_elf=yes fi for f in $gcc_cv_ld_bfd_srcdir/configure $gcc_cv_ld_gld_srcdir/configure $gcc_cv_ld_gld_srcdir/configure.in $gcc_cv_ld_gld_srcdir/Makefile.in do changequote(,)dnl gcc_cv_gld_version=`sed -n -e 's/^[ ]*\(VERSION=[0-9]*\.[0-9]*.*\)/\1/p' < $f` if test x$gcc_cv_gld_version != x; then break fi done gcc_cv_gld_major_version=`expr "$gcc_cv_gld_version" : "VERSION=\([0-9]*\)"` gcc_cv_gld_minor_version=`expr "$gcc_cv_gld_version" : "VERSION=[0-9]*\.\([0-9]*\)"` changequote([,])dnl else AC_MSG_RESULT($gcc_cv_ld) in_tree_ld=no fi # Figure out what nm we will be using. gcc_cv_binutils_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/binutils AS_VAR_SET_IF(gcc_cv_nm,, [ if test -f $gcc_cv_binutils_srcdir/configure.in \ && test -f ../binutils/Makefile \ && test x$build = x$host; then gcc_cv_nm=../binutils/nm-new$build_exeext elif test -x nm$build_exeext; then gcc_cv_nm=./nm$build_exeext elif ( set dummy $NM_FOR_TARGET; test -x $[2] ); then gcc_cv_nm="$NM_FOR_TARGET" else AC_PATH_PROG(gcc_cv_nm, $NM_FOR_TARGET) fi]) AC_MSG_CHECKING(what nm to use) if test "$gcc_cv_nm" = ../binutils/nm-new$build_exeext; then # Single tree build which includes binutils. AC_MSG_RESULT(newly built nm) in_tree_nm=yes else AC_MSG_RESULT($gcc_cv_nm) in_tree_nm=no fi ORIGINAL_NM_FOR_TARGET=$gcc_cv_nm AC_SUBST(ORIGINAL_NM_FOR_TARGET) case "$ORIGINAL_NM_FOR_TARGET" in ./nm | ./nm$build_exeext) ;; *) AC_CONFIG_FILES(nm:exec-tool.in, [chmod +x nm]) ;; esac # Figure out what objdump we will be using. AS_VAR_SET_IF(gcc_cv_objdump,, [ if test -f $gcc_cv_binutils_srcdir/configure.in \ && test -f ../binutils/Makefile \ && test x$build = x$host; then # Single tree build which includes binutils. gcc_cv_objdump=../binutils/objdump$build_exeext elif test -x objdump$build_exeext; then gcc_cv_objdump=./objdump$build_exeext elif ( set dummy $OBJDUMP_FOR_TARGET; test -x $[2] ); then gcc_cv_objdump="$OBJDUMP_FOR_TARGET" else AC_PATH_PROG(gcc_cv_objdump, $OBJDUMP_FOR_TARGET) fi]) AC_MSG_CHECKING(what objdump to use) if test "$gcc_cv_objdump" = ../binutils/objdump$build_exeext; then # Single tree build which includes binutils. AC_MSG_RESULT(newly built objdump) elif test x$gcc_cv_objdump = x; then AC_MSG_RESULT(not found) else AC_MSG_RESULT($gcc_cv_objdump) fi # Figure out what readelf we will be using. AS_VAR_SET_IF(gcc_cv_readelf,, [ if test -f $gcc_cv_binutils_srcdir/configure.in \ && test -f ../binutils/Makefile \ && test x$build = x$host; then # Single tree build which includes binutils. gcc_cv_readelf=../binutils/readelf$build_exeext elif test -x readelf$build_exeext; then gcc_cv_readelf=./readelf$build_exeext else AC_PATH_PROG(gcc_cv_readelf, readelf) fi]) AC_MSG_CHECKING(what readelf to use) if test "$gcc_cv_readelf" = ../binutils/readelf$build_exeext; then # Single tree build which includes binutils. AC_MSG_RESULT(newly built readelf) elif test x$gcc_cv_readelf = x; then AC_MSG_RESULT(not found) else AC_MSG_RESULT($gcc_cv_readelf) fi # Figure out what assembler alignment features are present. gcc_GAS_CHECK_FEATURE([.balign and .p2align], gcc_cv_as_balign_and_p2align, [2,6,0],, [.balign 4 .p2align 2],, [AC_DEFINE(HAVE_GAS_BALIGN_AND_P2ALIGN, 1, [Define if your assembler supports .balign and .p2align.])]) gcc_GAS_CHECK_FEATURE([.p2align with maximum skip], gcc_cv_as_max_skip_p2align, [2,8,0],, [.p2align 4,,7],, [AC_DEFINE(HAVE_GAS_MAX_SKIP_P2ALIGN, 1, [Define if your assembler supports specifying the maximum number of bytes to skip when using the GAS .p2align command.])]) gcc_GAS_CHECK_FEATURE([.literal16], gcc_cv_as_literal16, [2,8,0],, [.literal16],, [AC_DEFINE(HAVE_GAS_LITERAL16, 1, [Define if your assembler supports .literal16.])]) gcc_GAS_CHECK_FEATURE([working .subsection -1], gcc_cv_as_subsection_m1, [elf,2,9,0],, [conftest_label1: .word 0 .subsection -1 conftest_label2: .word 0 .previous], [if test x$gcc_cv_nm != x; then $gcc_cv_nm conftest.o | grep conftest_label1 > conftest.nm1 $gcc_cv_nm conftest.o | grep conftest_label2 | sed -e 's/label2/label1/' > conftest.nm2 if cmp conftest.nm1 conftest.nm2 > /dev/null 2>&1 then : else gcc_cv_as_subsection_m1=yes fi rm -f conftest.nm1 conftest.nm2 fi], [AC_DEFINE(HAVE_GAS_SUBSECTION_ORDERING, 1, [Define if your assembler supports .subsection and .subsection -1 starts emitting at the beginning of your section.])]) gcc_GAS_CHECK_FEATURE([.weak], gcc_cv_as_weak, [2,2,0],, [ .weak foobar],, [AC_DEFINE(HAVE_GAS_WEAK, 1, [Define if your assembler supports .weak.])]) gcc_GAS_CHECK_FEATURE([.weakref], gcc_cv_as_weakref, [2,17,0],, [ .weakref foobar, barfnot],, [AC_DEFINE(HAVE_GAS_WEAKREF, 1, [Define if your assembler supports .weakref.])]) gcc_GAS_CHECK_FEATURE([.nsubspa comdat], gcc_cv_as_nsubspa_comdat, [2,15,91],, [ .SPACE $TEXT$ .NSUBSPA $CODE$,COMDAT],, [AC_DEFINE(HAVE_GAS_NSUBSPA_COMDAT, 1, [Define if your assembler supports .nsubspa comdat option.])]) # .hidden needs to be supported in both the assembler and the linker, # because GNU LD versions before 2.12.1 have buggy support for STV_HIDDEN. # This is irritatingly difficult to feature test for; we have to check the # date string after the version number. If we've got an in-tree # ld, we don't know its patchlevel version, so we set the baseline at 2.13 # to be safe. # The gcc_GAS_CHECK_FEATURE call just sets a cache variable. gcc_GAS_CHECK_FEATURE([.hidden], gcc_cv_as_hidden, [elf,2,13,0],, [ .hidden foobar foobar:],[ # Solaris 9/x86 as incorrectly emits an alias for a hidden symbol with # STV_HIDDEN, so disable .hidden support if so. case "${target}" in i?86-*-solaris2* | x86_64-*-solaris2.1[[0-9]]*) if test x$gcc_cv_as != x && test x$gcc_cv_objdump != x; then cat > conftest.s <