X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fconfigure.ac;h=f9977136b651027dee1f3ecbe94e13e56e890b47;hb=599a3eac965bb61703364d221010bb615be00647;hp=d4c002d45acce1d8ed9514a096e34d9a77d70fa5;hpb=9ace46a5c9c62c1aed1aaed4d65adea7c63dfcfa;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/configure.ac b/gcc/configure.ac index d4c002d45ac..f9977136b65 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -25,7 +25,7 @@ # Initialization and sanity checks # -------------------------------- -AC_PREREQ(2.57) +AC_PREREQ(2.59) AC_INIT AC_CONFIG_SRCDIR(tree.c) AC_CONFIG_HEADER(auto-host.h:config.in) @@ -192,7 +192,7 @@ AC_ARG_WITH(ld, DEFAULT_LINKER="$with_ld") if test x"${DEFAULT_LINKER+set}" = x"set"; then if test ! -x "$DEFAULT_LINKER"; then - AC_MSG_WARN([cannot execute: $DEFAULT_LINKER: check --with-ld or env. var. DEFAULT_LINKER]) + 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 @@ -226,7 +226,7 @@ AC_ARG_WITH(as, DEFAULT_ASSEMBLER="$with_as") if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then if test ! -x "$DEFAULT_ASSEMBLER"; then - AC_MSG_WARN([cannot execute: $DEFAULT_ASSEMBLER: check --with-as or env. var. DEFAULT_ASSEMBLER]) + 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 @@ -274,19 +274,10 @@ AC_SUBST(OUTPUT_OPTION) # Check C compiler features # ------------------------- -AC_CACHE_CHECK(whether ${CC-cc} accepts -Wno-long-long, -ac_cv_prog_cc_no_long_long, -[save_CFLAGS="$CFLAGS" -CFLAGS="-Wno-long-long" -AC_TRY_COMPILE(,,ac_cv_prog_cc_no_long_long=yes, - ac_cv_prog_cc_no_long_long=no) -CFLAGS="$save_CFLAGS"]) - AC_PROG_CPP AC_C_INLINE gcc_AC_C_LONG_LONG -gcc_AC_C__BOOL # sizeof(char) is 1 by definition. AC_COMPILE_CHECK_SIZEOF(void *) @@ -300,23 +291,69 @@ if test $ac_cv_c___int64 = yes; then AC_COMPILE_CHECK_SIZEOF(__int64) fi -# ----------------- -# Find Ada compiler -# ----------------- - -# See if GNAT has been installed -gcc_AC_PROG_GNAT - # --------------------- # 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 +# So, we only use -pedantic if we can disable those warnings. + +AC_CACHE_CHECK( + [whether ${CC} accepts -Wno-long-long], + [ac_cv_prog_cc_w_no_long_long], + [save_CFLAGS="$CFLAGS" + CFLAGS="-Wno-long-long" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])], + [ac_cv_prog_cc_w_no_long_long=yes], + [ac_cv_prog_cc_w_no_long_long=no]) + CFLAGS="$save_CFLAGS" + ]) + +AC_CACHE_CHECK( + [whether ${CC} accepts -Wno-variadic-macros], + [ac_cv_prog_cc_w_no_variadic_macros], + [save_CFLAGS="$CFLAGS" + CFLAGS="-Wno-variadic-macros" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])], + [ac_cv_prog_cc_w_no_variadic_macros=yes], + [ac_cv_prog_cc_w_no_variadic_macros=no]) + CFLAGS="$save_CFLAGS" + ]) + strict1_warn= -if test $ac_cv_prog_cc_no_long_long = yes ; then - strict1_warn="-pedantic -Wno-long-long" +if test $ac_cv_prog_cc_w_no_long_long = yes \ + && test $ac_cv_prog_cc_w_no_variadic_macros = yes ; then + strict1_warn="-pedantic -Wno-long-long -Wno-variadic-macros" fi AC_SUBST(strict1_warn) +# Add -Wold-style-definition if it's accepted +AC_CACHE_CHECK( + [whether ${CC} accepts -Wold-style-definition], + [ac_cv_prog_cc_w_old_style_definition], + [save_CFLAGS="$CFLAGS" + CFLAGS="-Wold-style-definition" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])], + [ac_cv_prog_cc_w_old_style_definition=yes], + [ac_cv_prog_cc_w_old_style_definition=no]) + CFLAGS="$save_CFLAGS" + ]) +if test $ac_cv_prog_cc_w_old_style_definition = yes ; then + strict1_warn="${strict1_warn} -Wold-style-definition" +fi + +# Enable -Werror, period. +AC_ARG_ENABLE(werror_always, +[ --enable-werror-always enable -Werror always], [], +[enable_werror_always=no]) +if test x${enable_werror_always} = xyes ; then + strict1_warn="${strict1_warn} -Werror" + WERROR=-Werror +fi + # If the native compiler is GCC, we can enable warnings even in stage1. # That's useful for people building cross-compilers, or just running a # quick `make'. @@ -388,8 +425,12 @@ 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.]) + at runtime. This is moderately expensive. The tree browser debugging + routines will also be enabled by this option. + ]) + TREEBROWSER=tree-browser.o 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 @@ -472,6 +513,15 @@ fi AC_SUBST(valgrind_path_defines) AC_SUBST(valgrind_command) +AC_ARG_ENABLE(mapped-location, +[ --enable-mapped-location location_t is fileline integer cookie],, +enable_mapped_location=no) + +if test "$enable_mapped_location" = yes ; then + AC_DEFINE(USE_MAPPED_LOCATION, 1, +[Define if location_t is fileline integer cookie.]) +fi + # Enable code coverage collection AC_ARG_ENABLE(coverage, [ --enable-coverage[=LEVEL] @@ -481,15 +531,19 @@ AC_ARG_ENABLE(coverage, 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" - ;; -*) - AC_MSG_ERROR(unknown coverage setting $enableval) - ;; + 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) @@ -529,9 +583,7 @@ AC_ARG_ENABLE(__cxa_atexit, AC_ARG_ENABLE(threads, [ --enable-threads enable thread usage for target GCC --enable-threads=LIB use LIB thread package for target GCC],, -enable_threads='') -# Save in case it gets overwritten in config.gcc -enable_threads_flag=$enable_threads +[enable_threads='']) AC_ARG_ENABLE(objc-gc, [ --enable-objc-gc enable the use of Boehm's garbage collector with @@ -613,6 +665,53 @@ esac], [onestep=""]) AC_SUBST(onestep) +# Sanity check enable_languages in case someone does not run the toplevel +# configure # script. +AC_ARG_ENABLE(languages, +[ --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]) + +subdirs= +for lang in ${srcdir}/*/config-lang.in +do + case $lang in + # The odd quoting in the next line works around + # an apparent bug in bash 1.12 on linux. +changequote(,)dnl + ${srcdir}/[*]/config-lang.in) ;; + *) + lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang` + if test "x$lang_alias" = x + then + echo "$lang doesn't set \$language." 1>&2 + exit 1 + fi + case ",$enable_languages," in + *,$lang_alias,*) + subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`" ;; + esac + ;; +changequote([,])dnl + esac +done + + # ------------------------- # Checks for other programs # ------------------------- @@ -627,8 +726,8 @@ case ${AWK} in "") AC_MSG_ERROR([can't build without awk, bailing out]) ;; esac -gcc_AC_PROG_LN gcc_AC_PROG_LN_S +ACX_PROG_LN($LN_S) AC_PROG_RANLIB gcc_AC_PROG_INSTALL @@ -673,7 +772,7 @@ fi # How about lex? dnl Don't use AC_PROG_LEX; we insist on flex. dnl LEXLIB is not useful in gcc. -if test -f $srcdir/../flex/skel.c; then +if test x${build} = x${host} && test -f $srcdir/../flex/skel.c; then FLEX='$(objdir)/../flex/flex' else AC_CHECK_PROG(FLEX, flex, flex, ${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing flex) @@ -681,7 +780,7 @@ fi # Bison? # The -L switch is so bison can find its skeleton file. -if test -f $srcdir/../bison/bison.simple; then +if test x${build} = x${host} && test -f $srcdir/../bison/bison.simple; then BISON='$(objdir)/../bison/bison -L $(srcdir)/../bison/' else AC_CHECK_PROG(BISON, bison, bison, ${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing bison) @@ -711,8 +810,8 @@ AC_PROG_CPP_WERROR AC_HEADER_STDC AC_HEADER_TIME -gcc_AC_HEADER_STDBOOL -gcc_AC_HEADER_STRING +ACX_HEADER_STDBOOL +ACX_HEADER_STRING AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h \ fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \ @@ -944,19 +1043,6 @@ if test $gcc_cv_type_clock_t = yes; then [Define if defines clock_t.]) fi -AC_CACHE_CHECK(for uchar, gcc_cv_type_uchar, -[AC_TRY_COMPILE([ -#include "ansidecl.h" -#include "system.h" -], -[if ((uchar *)0) return 0; - if (sizeof(uchar)) return 0;], -ac_cv_type_uchar=yes, ac_cv_type_uchar=no)]) -if test $ac_cv_type_uchar = yes; then - AC_DEFINE(HAVE_UCHAR, 1, - [Define if defines \`uchar'.]) -fi - # Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests. CFLAGS="$saved_CFLAGS" @@ -1010,6 +1096,7 @@ target_gtfiles= . ${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 @@ -1117,8 +1204,12 @@ if test "$host_xm_file" != "$build_xm_file"; then fi fi +# --------- +# Threading +# --------- + # Check if a valid thread package -case ${enable_threads_flag} in +case ${enable_threads} in "" | no) # No threads target_thread_file='single' @@ -1129,10 +1220,10 @@ case ${enable_threads_flag} in ;; aix | dce | gnat | irix | posix | rtems | \ single | solaris | vxworks | win32 ) - target_thread_file=${enable_threads_flag} + target_thread_file=${enable_threads} ;; *) - echo "${enable_threads_flag} is an unknown thread package" 1>&2 + echo "${enable_threads} is an unknown thread package" 1>&2 exit 1 ;; esac @@ -1143,6 +1234,19 @@ if test x${thread_file} = x; then thread_file=${target_thread_file} fi +# Make gthr-default.h if we have a thread file. +gthread_flags= +if test $thread_file != single; then + rm -f gthr-default.h + echo "#include \"gthr-${thread_file}.h\"" > gthr-default.h + gthread_flags=-DHAVE_GTHR_DEFAULT +fi +AC_SUBST(gthread_flags) + +# -------- +# UNSORTED +# -------- + if test x$enable___cxa_atexit = xyes || \ test x$enable___cxa_atexit = x -a x$default_use_cxa_atexit = xyes; then AC_CHECK_FUNC(__cxa_atexit, @@ -1188,6 +1292,7 @@ else saved_CFLAGS="${CFLAGS}" CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ ${realsrcdir}/configure \ + --enable-languages=${enable_languages-all} \ --target=$target_alias --host=$build_alias --build=$build_alias CFLAGS="${saved_CFLAGS}" @@ -1548,6 +1653,13 @@ for file in ${extra_headers} ; do extra_headers_list="${extra_headers_list} \$(srcdir)/config/${cpu_type}/${file}" done +# Define collect2 in Makefile. +case $host_can_use_collect2 in + no) collect2= ;; + *) collect2='collect2$(exeext)' ;; +esac +AC_SUBST([collect2]) + # Add a definition of USE_COLLECT2 if system wants one. case $use_collect2 in no) use_collect2= ;; @@ -1555,9 +1667,18 @@ case $use_collect2 in *) host_xm_defines="${host_xm_defines} USE_COLLECT2" xm_defines="${xm_defines} USE_COLLECT2" + case $host_can_use_collect2 in + no) + AC_MSG_ERROR([collect2 is required but cannot be built on this system]) + ;; + esac ;; esac +# --------------------------- +# Assembler & linker features +# --------------------------- + # Identify the assembler which will work hand-in-glove with the newly # built GCC, so that we can examine its features. This is the assembler # which will be driven by the driver program. @@ -1573,14 +1694,15 @@ gcc_cv_gas_minor_version= gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas if test -x "$DEFAULT_ASSEMBLER"; then gcc_cv_as="$DEFAULT_ASSEMBLER" -elif test -x "$AS"; then - gcc_cv_as="$AS" elif test -x as$host_exeext; then # Build using assembler in the current directory. gcc_cv_as=./as$host_exeext elif test -f $gcc_cv_as_gas_srcdir/configure.in \ - && test -f ../gas/Makefile; then - # Single tree build which includes gas. + && test -f ../gas/Makefile \ + && test x$build = x$host; 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. in_tree_gas=yes _gcc_COMPUTE_GAS_VERSION rm -f as$host_exeext @@ -1592,6 +1714,11 @@ elif test -f $gcc_cv_as_gas_srcdir/configure.in \ then in_tree_gas_is_elf=yes fi +m4_pattern_allow([AS_FOR_TARGET])dnl +elif test -x "$AS_FOR_TARGET"; then + gcc_cv_as="$AS_FOR_TARGET" +elif test -x "$AS" && test x$host = x$target; then + gcc_cv_as="$AS" fi if test "x$gcc_cv_as" = x; then @@ -1622,11 +1749,11 @@ if test "x$gcc_cv_as" = x; then if test "x$program_prefix" != xNONE; then gcc_cv_as=${program_prefix}as$host_exeext else - gcc_cv_as=`echo as | sed ${program_transform_name}`$host_exeext + gcc_cv_as=`echo as | sed "${program_transform_name}"`$host_exeext fi - test_dirs="$test_prefix/lib/gcc-lib/$target_noncanonical/$gcc_version \ - $test_prefix/lib/gcc-lib/$target_noncanonical \ + test_dirs="$test_prefix/libexec/gcc/$target_noncanonical/$gcc_version \ + $test_prefix/libexec/gcc/$target_noncanonical \ /usr/lib/gcc/$target_noncanonical/$gcc_version \ /usr/lib/gcc/$target_noncanonical \ $test_prefix/$target_noncanonical/bin/$target_noncanonical/$gcc_version \ @@ -1678,16 +1805,15 @@ gcc_cv_ld_gld_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/ld gcc_cv_ld_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd if test -x "$DEFAULT_LINKER"; then gcc_cv_ld="$DEFAULT_LINKER" -elif test -x "$LD_FOR_TARGET"; then - gcc_cv_ld="$LD_FOR_TARGET" -elif test -x "$LD" && test x$host = x$target; then - gcc_cv_ld="$LD" elif test -x collect-ld$host_exeext; then # Build using linker in the current directory. gcc_cv_ld=./collect-ld$host_exeext elif test -f $gcc_cv_ld_gld_srcdir/configure.in \ - && test -f ../ld/Makefile; then - # Single tree build which includes ld. + && test -f ../ld/Makefile \ + && test x$build = x$host; 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. in_tree_ld=yes in_tree_ld_is_elf=no if (grep 'EMUL = .*elf' ../ld/Makefile \ @@ -1710,6 +1836,10 @@ changequote([,])dnl rm -f collect-ld$host_exeext $symbolic_link ../ld/ld-new$host_exeext collect-ld$host_exeext \ 2>/dev/null +elif test -x "$LD_FOR_TARGET"; then + gcc_cv_ld="$LD_FOR_TARGET" +elif test -x "$LD" && test x$host = x$target; then + gcc_cv_ld="$LD" fi if test "x$gcc_cv_ld" = x; then @@ -1740,11 +1870,11 @@ if test "x$gcc_cv_ld" = x; then if test "x$program_prefix" != xNONE; then gcc_cv_ld=${program_prefix}ld$host_exeext else - gcc_cv_ld=`echo ld | sed ${program_transform_name}`$host_exeext + gcc_cv_ld=`echo ld | sed "${program_transform_name}"`$host_exeext fi - test_dirs="$test_prefix/lib/gcc-lib/$target_noncanonical/$gcc_version \ - $test_prefix/lib/gcc-lib/$target_noncanonical \ + test_dirs="$test_prefix/libexec/gcc/$target_noncanonical/$gcc_version \ + $test_prefix/libexec/gcc/$target_noncanonical \ /usr/lib/gcc/$target_noncanonical/$gcc_version \ /usr/lib/gcc/$target_noncanonical \ $test_prefix/$target_noncanonical/bin/$target_noncanonical/$gcc_version \ @@ -1796,7 +1926,7 @@ elif test -f $gcc_cv_binutils_srcdir/configure.in \ elif test "x$program_prefix" != xNONE; then gcc_cv_nm=${program_prefix}nm$host_exeext else - gcc_cv_nm=`echo nm | sed ${program_transform_name}`$host_exeext + gcc_cv_nm=`echo nm | sed "${program_transform_name}"`$host_exeext fi case $in_tree_nm in yes) AC_MSG_RESULT("newly built nm") ;; @@ -1820,7 +1950,7 @@ elif test "x$program_prefix" != xNONE; then gcc_cv_objdump=${program_prefix}objdump$host_exeext else gcc_cv_objdump=`echo objdump | \ - sed ${program_transform_name}`$host_exeext + sed "${program_transform_name}"`$host_exeext fi case $in_tree_objdump in yes) AC_MSG_RESULT("newly built objdump") ;; @@ -2334,6 +2464,14 @@ case "$target" in [Define if your assembler supports explicit relocations.])]) ;; + cris-*-*) + gcc_GAS_CHECK_FEATURE([-no-mul-bug-abort option], + gcc_cv_as_cris_no_mul_bug,[2,15,91], + [-no-mul-bug-abort], [.text],, + [AC_DEFINE(HAVE_AS_NO_MUL_BUG_ABORT_OPTION, 1, + [Define if your assembler supports the -no-mul-bug-abort option.])]) + ;; + sparc*-*-*) gcc_GAS_CHECK_FEATURE([.register], gcc_cv_as_sparc_register_op,,, [.register %g2, #scratch],, @@ -2409,6 +2547,26 @@ foo: changequote(,)dnl i[34567]86-*-* | x86_64-*-*) changequote([,])dnl + case $target_os in + cygwin* | pe | mingw32*) + # Used for DWARF 2 in PE + gcc_GAS_CHECK_FEATURE([.secrel32 relocs], + gcc_cv_as_ix86_pe_secrel32, + [2,15,91],, +[.text +foo: nop +.data + .secrel32 foo], + [if test x$gcc_cv_ld != x \ + && $gcc_cv_ld -o conftest conftest.o > /dev/null 2>&1; then + gcc_cv_as_ix86_pe_secrel32=yes + fi + rm -f conftest], + [AC_DEFINE(HAVE_GAS_PE_SECREL32_RELOC, 1, + [Define if your assembler and linker support 32-bit section relative relocs via '.secrel32 label'.])]) + ;; + esac + gcc_GAS_CHECK_FEATURE([filds and fists mnemonics], gcc_cv_as_ix86_filds_fists, [2,9,0],, [filds mem; fists mem],, @@ -2620,145 +2778,35 @@ if test x"$gcc_cv_ld_pie" = xyes; then fi AC_MSG_RESULT($gcc_cv_ld_pie) -if test x$with_sysroot = x && test x$host = x$target \ - && test "$prefix" != "/usr" && test "x$prefix" != "x$local_prefix" ; then - AC_DEFINE_UNQUOTED(PREFIX_INCLUDE_DIR, "$prefix/include", -[Define to PREFIX/include if cpp should also search that directory.]) -fi - -# Figure out what language subdirectories are present. -# Look if the user specified --enable-languages="..."; if not, use -# the environment variable $LANGUAGES if defined. $LANGUAGES might -# go away some day. -# NB: embedded tabs in this IF block -- do not untabify -if test x"${enable_languages+set}" != xset; then - if test x"${LANGUAGES+set}" = xset; then - enable_languages="${LANGUAGES}" - AC_MSG_WARN([setting LANGUAGES is deprecated, use --enable-languages instead]) +# -------- +# UNSORTED +# -------- - else - enable_languages=all - fi -else - if test x"${enable_languages}" = x \ - || test x"${enable_languages}" = xyes; - then - AC_MSG_ERROR([--enable-languages needs at least one language argument]) +AC_CACHE_CHECK(linker --as-needed support, +gcc_cv_ld_as_needed, +[gcc_cv_ld_as_needed=no +if test $in_tree_ld = yes ; then + if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \ + && test $in_tree_ld_is_elf = yes; then + gcc_cv_ld_as_needed=yes + fi +elif test x$gcc_cv_ld != x; then + # Check if linker supports --as-needed and --no-as-needed options + if $gcc_cv_ld --help 2>/dev/null | grep as-needed > /dev/null; then + gcc_cv_ld_as_needed=yes fi fi -enable_languages=`echo "${enable_languages}" | sed -e 's/[[ ,]][[ ,]]*/,/g' -e 's/,$//'` - -# First scan to see if an enabled language requires some other language. -# We assume that a given config-lang.in will list all the language -# front ends it requires, even if some are required indirectly. -for lang in ${srcdir}/*/config-lang.in -do - case $lang in - # The odd quoting in the next line works around - # an apparent bug in bash 1.12 on linux. -changequote(,)dnl - ${srcdir}/[*]/config-lang.in) - ;; - *) - lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang` - this_lang_requires=`sed -n -e 's,^lang_requires=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_requires=\([^ ]*\).*$,\1,p' $lang` - for other in $this_lang_requires - do - case ,${enable_languages}, in - *,$other,*) - ;; - *,all,*) - ;; - *,$lang_alias,*) - enable_languages="$enable_languages,$other" - ;; - esac - done - ;; -changequote([,])dnl - esac -done - -expected_languages=`echo ,${enable_languages}, | sed -e 's:,: :g' -e 's: *: :g' -e 's: *: :g' -e 's:^ ::' -e 's: $::'` -found_languages= -subdirs= -for lang in ${srcdir}/*/config-lang.in -do - case $lang in - # The odd quoting in the next line works around - # an apparent bug in bash 1.12 on linux. -changequote(,)dnl - ${srcdir}/[*]/config-lang.in) ;; - *) - lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang` - this_lang_libs=`sed -n -e 's,^target_libs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^target_libs=\([^ ]*\).*$,\1,p' $lang` - build_by_default=`sed -n -e 's,^build_by_default=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^build_by_default=\([^ ]*\).*$,\1,p' $lang` - if test "x$lang_alias" = x - then - echo "$lang doesn't set \$language." 1>&2 - exit 1 - fi - case ${build_by_default},${enable_languages}, in - *,$lang_alias,*) add_this_lang=yes ;; - no,*) add_this_lang=no ;; - *,all,*) add_this_lang=yes ;; - *) add_this_lang=no ;; - esac - found_languages="${found_languages} ${lang_alias}" - if test x"${add_this_lang}" = xyes; then - case $lang in - ${srcdir}/ada/config-lang.in) - if test x$have_gnat = xyes ; then - subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`" - fi - ;; - *) - subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`" - ;; - esac - fi - ;; -changequote([,])dnl - esac -done - -missing_languages= -for expected_language in ${expected_languages} .. -do - if test "${expected_language}" != ..; then - missing_language="${expected_language}" - if test "${expected_language}" = "c" \ - || test "${expected_language}" = "all"; then - missing_language= - fi - for found_language in ${found_languages} .. - do - if test "${found_language}" != ..; then - if test "${expected_language}" = "${found_language}"; then - missing_language= - fi - fi - done - if test "x${missing_language}" != x; then - missing_languages="${missing_languages} ${missing_language}" - fi - fi -done - -if test "x$missing_languages" != x; then - AC_MSG_ERROR([ -The following requested languages were not found:${missing_languages} -The following languages were available: c${found_languages}]) +]) +if test x"$gcc_cv_ld_as_needed" = xyes; then + AC_DEFINE(HAVE_LD_AS_NEEDED, 1, +[Define if your linker supports --as-needed and --no-as-needed options.]) fi -# Make gthr-default.h if we have a thread file. -gthread_flags= -if test $thread_file != single; then - rm -f gthr-default.h - echo "#include \"gthr-${thread_file}.h\"" > gthr-default.h - gthread_flags=-DHAVE_GTHR_DEFAULT +if test x$with_sysroot = x && test x$host = x$target \ + && test "$prefix" != "/usr" && test "x$prefix" != "x$local_prefix" ; then + AC_DEFINE_UNQUOTED(PREFIX_INCLUDE_DIR, "$prefix/include", +[Define to PREFIX/include if cpp should also search that directory.]) fi -AC_SUBST(gthread_flags) # Find out what GC implementation we want, or may, use. AC_ARG_WITH(gc, @@ -2807,6 +2855,32 @@ else fi AC_SUBST(MAINT)dnl +AC_MSG_CHECKING([whether to use libbanshee for points-to alias analysis]) +AC_ARG_WITH(libbanshee, +[ --with-libbanshee enable libbanshee], +libbanshee="$with_libbanshee", +libbanshee=no) + +if test x"$libbanshee" = xyes; then + BANSHEELIB="../libbanshee/points-to/libandersen.a ../libbanshee/engine/libbansheeengine.a ../libbanshee/libcompat/libbansheecompat.a " + BANSHEEINC="-I\$(srcdir)/../libbanshee/libcompat -I\$(srcdir)/../libbanshee -I\$(srcdir)/../libbanshee/points-to" + ANDER="tree-alias-ander.o" + AC_DEFINE(HAVE_BANSHEE, 1, [Define if BANSHEE is available]) +else + BANSHEELIB="" + BANSHEEINC="" + ANDER="" +fi +AC_MSG_RESULT($with_libbanshee) + +AC_SUBST(ANDER) +AC_SUBST(BANSHEEINC) +AC_SUBST(BANSHEELIB) + +# -------------- +# Language hooks +# -------------- + # Make empty files to contain the specs and options for each language. # Then add #include lines to for a compiler that has specs and/or options. @@ -2832,7 +2906,7 @@ all_languages= all_boot_languages= all_compilers= all_stagestuff= -all_outputs='Makefile fixinc/Makefile gccbug mklibgcc mkheaders' +all_outputs='Makefile fixinc/Makefile gccbug mklibgcc mkheaders libada-mk' # List of language makefile fragments. all_lang_makefrags= # List of language subdirectory makefiles. Deprecated. @@ -2923,6 +2997,10 @@ do echo "lang.$t: $x" >> Make-hooks done +# -------- +# UNSORTED +# -------- + # Create .gdbinit. echo "dir ." > .gdbinit @@ -3023,6 +3101,7 @@ AC_SUBST(quoted_cc_set_by_configure) AC_SUBST(cpp_install_dir) AC_SUBST(xmake_file) AC_SUBST(tmake_file) +AC_SUBST(extra_gcc_objs) AC_SUBST(extra_headers_list) AC_SUBST(extra_objs) AC_SUBST(extra_parts) @@ -3036,7 +3115,6 @@ AC_SUBST(gcc_version) AC_SUBST(gcc_version_full) AC_SUBST(gcc_version_trigger) AC_SUBST(host_exeext) -AC_SUBST(host_extra_gcc_objs) AC_SUBST(host_xm_file_list) AC_SUBST(host_xm_include_list) AC_SUBST(host_xm_defines) @@ -3095,6 +3173,9 @@ else fi fi +AC_ARG_VAR(GMPLIBS,[How to link GMP]) +AC_ARG_VAR(GMPINC,[How to find GMP include files]) + # Configure the subdirectories # AC_CONFIG_SUBDIRS($subdirs)