X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=gcc%2Fconfigure.in;h=ee5b06d1fcdbbdd3299062ee3430055e1b7065d2;hp=c5fdc2d7cfc286852ca0c29381a087092536873c;hb=7093ff41e72f8f89b3fd38766ca755bb1a2b3859;hpb=3740694f9226244ad0fb2945bd8557ce5b1af3d2 diff --git a/gcc/configure.in b/gcc/configure.in index c5fdc2d7cfc..ee5b06d1fcd 100644 --- a/gcc/configure.in +++ b/gcc/configure.in @@ -93,7 +93,7 @@ gnu_ld_flag=no) # With pre-defined ld AC_ARG_WITH(ld, -[ --with-ld arrange to use the specified ld (full pathname).], +[ --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 @@ -107,12 +107,12 @@ fi # With GNU as AC_ARG_WITH(gnu-as, -[ --with-gnu-as arrange to work with GNU as.], +[ --with-gnu-as arrange to work with GNU as], gas_flag="$with_gnu_as", gas_flag=no) AC_ARG_WITH(as, -[ --with-as arrange to use the specified as (full pathname).], +[ --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 @@ -126,20 +126,20 @@ fi # With stabs AC_ARG_WITH(stabs, -[ --with-stabs arrange to use stabs instead of host debug format.], +[ --with-stabs arrange to use stabs instead of host debug format], stabs="$with_stabs", stabs=no) # With ELF AC_ARG_WITH(elf, -[ --with-elf arrange to use ELF instead of host debug format.], +[ --with-elf arrange to use ELF instead of host debug format], elf="$with_elf", elf=no) # Specify the local prefix local_prefix= AC_ARG_WITH(local-prefix, -[ --with-local-prefix=DIR specifies directory to put local include.], +[ --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) ;; @@ -158,7 +158,7 @@ gcc_gxx_include_dir= # Specify the g++ header file directory AC_ARG_WITH(gxx-include-dir, [ --with-gxx-include-dir=DIR - specifies directory to put g++ header files.], + specifies directory to put g++ header files], [case "${withval}" in yes) AC_MSG_ERROR(bad value ${withval} given for g++ include directory) ;; no) ;; @@ -178,7 +178,7 @@ fi # Determine whether or not multilibs are enabled. AC_ARG_ENABLE(multilib, -[ --enable-multilib enable library support for multiple ABIs], +[ --enable-multilib enable library support for multiple ABIs], [], [enable_multilib=yes]) AC_SUBST(enable_multilib) @@ -247,13 +247,13 @@ fi AC_ARG_ENABLE(cpp, -[ --disable-cpp don't provide a user-visible C preprocessor.], +[ --disable-cpp don't provide a user-visible C preprocessor], [], [enable_cpp=yes]) AC_ARG_WITH(cpp_install_dir, [ --with-cpp-install-dir=DIR install the user visible C preprocessor in DIR - (relative to PREFIX) as well as PREFIX/bin.], + (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 @@ -262,7 +262,7 @@ fi]) # Enable Multibyte Characters for C/C++ AC_ARG_ENABLE(c-mbchar, -[ --enable-c-mbchar Enable multibyte characters for C and C++.], +[ --enable-c-mbchar enable multibyte characters for C and C++], if test x$enable_c_mbchar != xno; then AC_DEFINE(MULTIBYTE_CHARS, 1, [Define if you want the C and C++ compilers to support multibyte @@ -273,8 +273,8 @@ fi) # Pass with no value to take the default # Pass with a value to specify a thread package AC_ARG_ENABLE(threads, -[ --enable-threads enable thread usage for target GCC. - --enable-threads=LIB use LIB thread package for target GCC.],, +[ --enable-threads enable thread usage for target GCC + --enable-threads=LIB use LIB thread package for target GCC],, enable_threads='') enable_threads_flag=$enable_threads @@ -300,7 +300,7 @@ esac AC_ARG_ENABLE(objc-gc, [ --enable-objc-gc enable the use of Boehm's garbage collector with - the GNU Objective-C runtime.], + the GNU Objective-C runtime], if test x$enable_objc_gc = xno; then objc_boehm_gc='' else @@ -309,12 +309,12 @@ fi, objc_boehm_gc='') AC_ARG_WITH(dwarf2, -[ --with-dwarf2 force the default debug format to be DWARF2.], +[ --with-dwarf2 force the default debug format to be DWARF 2], dwarf2="$with_dwarf2", dwarf2=no) AC_ARG_ENABLE(shared, -[ --disable-shared don't provide a shared libgcc.], +[ --disable-shared don't provide a shared libgcc], [ case $enable_shared in yes | no) ;; @@ -366,6 +366,7 @@ gcc_AC_C_VOLATILE gcc_AC_C_LONG_DOUBLE gcc_AC_C_LONG_LONG +gcc_AC_C__BOOL # sizeof(char) is 1 by definition. gcc_AC_COMPILE_CHECK_SIZEOF(short) @@ -379,7 +380,6 @@ if test $ac_cv_c___int64 = yes; then fi gcc_AC_C_CHARSET -gcc_AC_C_FLOAT_FORMAT # 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 @@ -451,12 +451,13 @@ gcc_AC_PROG_INSTALL AC_HEADER_STDC AC_HEADER_TIME +gcc_AC_HEADER_STDBOOL gcc_AC_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 stab.h sys/file.h sys/time.h \ + fcntl.h unistd.h sys/file.h sys/time.h \ sys/resource.h sys/param.h sys/times.h sys/stat.h \ - direct.h malloc.h langinfo.h iconv.h stdbool.h) + direct.h malloc.h langinfo.h) # Check for thread headers. AC_CHECK_HEADER(thread.h, [have_thread_h=yes], [have_thread_h=]) @@ -464,7 +465,8 @@ 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 -gcc_AC_C_COMPILE_BIGENDIAN +gcc_AC_C_COMPILE_ENDIAN +gcc_AC_C_FLOAT_FORMAT # See if GNAT has been installed AC_CHECK_PROG(have_gnat, gnatbind, yes, no) @@ -521,8 +523,37 @@ else AC_CHECK_PROG(BISON, bison, bison, false) fi +# 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) + # See if the stage1 system preprocessor understands the ANSI C -# preprocessor stringification operator. +# preprocessor stringification operator. (Used by symcat.h.) AC_C_STRINGIZE # Use only if it exists, @@ -544,10 +575,10 @@ fi dnl Disabled until we have a complete test for buggy enum bitfields. dnl gcc_AC_C_ENUM_BF_UNSIGNED -AC_CHECK_FUNCS(strtoul bsearch putenv popen bcopy \ +AC_CHECK_FUNCS(strtoul bsearch popen times clock \ strchr strrchr kill getrlimit setrlimit atoll atoq \ sysconf isascii gettimeofday strsignal putc_unlocked fputc_unlocked \ - fputs_unlocked getrusage iconv nl_langinfo) + fputs_unlocked getrusage nl_langinfo lstat) AC_CHECK_TYPE(ssize_t, int) @@ -586,24 +617,59 @@ AC_FUNC_VFORK AC_FUNC_MMAP_ANYWHERE AC_FUNC_MMAP_FILE +AM_ICONV + # We will need to find libiberty.h and ansidecl.h saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include" -gcc_AC_CHECK_DECLS(bcopy \ - getenv atol sbrk abort atof getcwd getwd \ - strsignal putc_unlocked fputs_unlocked strstr environ \ - malloc realloc calloc free basename getopt, , ,[ -#include "gansidecl.h" +gcc_AC_CHECK_DECLS(getenv atol sbrk abort atof getcwd getwd \ + strsignal putc_unlocked fputs_unlocked strstr environ errno \ + malloc realloc calloc free basename getopt clock, , ,[ +#include "ansidecl.h" #include "system.h"]) gcc_AC_CHECK_DECLS(getrlimit setrlimit getrusage, , ,[ -#include "gansidecl.h" +#include "ansidecl.h" #include "system.h" #ifdef HAVE_SYS_RESOURCE_H #include #endif ]) +gcc_AC_CHECK_DECLS(times, , ,[ +#include "ansidecl.h" +#include "system.h" +#ifdef HAVE_SYS_TIMES_H +#include +#endif +]) + +# More time-related stuff. +AC_CACHE_CHECK(for struct tms, ac_cv_struct_tms, [ +AC_TRY_COMPILE([ +#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_TRY_COMPILE([ +#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 from before the gcc_AC_NEED_DECLARATIONS tests. CFLAGS="$saved_CFLAGS" @@ -643,9 +709,6 @@ then tm_file=$cpu_type/$cpu_type.h; fi if test x"$extra_headers" = x then extra_headers=; fi -if test x"$xm_file" = x -then xm_file=$cpu_type/xm-$cpu_type.h; fi - if test x$md_file = x then md_file=$cpu_type/$cpu_type.md; fi @@ -680,15 +743,12 @@ 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. But $cpu/xm-$cpu.h is allowed not to -# exist, if we have nothing for it to do. -changequote(,)dnl +# about them and drop them. + bx= for x in $build_xm_file; do if test -f $srcdir/config/$x then bx="$bx $x" - elif expr $x : '\([^/]*\)/xm-\1\.h' >/dev/null - then : else AC_MSG_WARN($srcdir/config/$x does not exist.) fi done @@ -698,8 +758,6 @@ hx= for x in $host_xm_file; do if test -f $srcdir/config/$x then hx="$hx $x" - elif expr $x : '\([^/]*\)/xm-\1\.h' >/dev/null - then : else AC_MSG_WARN($srcdir/config/$x does not exist.) fi done @@ -709,13 +767,10 @@ tx= for x in $xm_file; do if test -f $srcdir/config/$x then tx="$tx $x" - elif expr $x : '\([^/]*\)/xm-\1\.h' >/dev/null - then : else AC_MSG_WARN($srcdir/config/$x does not exist.) fi done xm_file="$tx" -changequote([,])dnl count=a for f in $tm_file; do @@ -791,8 +846,11 @@ else /* | [A-Za-z]:[\\/]* ) realsrcdir=${srcdir};; *) realsrcdir=../${srcdir};; esac - CC=${CC_FOR_BUILD} ${realsrcdir}/configure \ + saved_CFLAGS="${CFLAGS}" + CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ + ${realsrcdir}/configure \ --target=$target --host=$build --build=$build + CFLAGS="${saved_CFLAGS}" # We just finished tests for the build machine, so rename # the file auto-build.h in the gcc directory. @@ -803,9 +861,9 @@ else fi tm_file="${tm_file} defaults.h" -host_xm_file="auto-host.h gansidecl.h ${host_xm_file} ${tm_file}" -build_xm_file="${build_auto} gansidecl.h ${build_xm_file} ${tm_file}" -xm_file="gansidecl.h ${xm_file} ${tm_file}" +host_xm_file="auto-host.h ansidecl.h ${host_xm_file} ${tm_file}" +build_xm_file="${build_auto} ansidecl.h ${build_xm_file} ${tm_file}" +xm_file="ansidecl.h ${xm_file} ${tm_file}" # Truncate the target if necessary if test x$host_truncate_target != x; then @@ -819,13 +877,13 @@ else gcc_version_trigger=${srcdir}/version.c fi changequote(,)dnl -gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'` +gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'` gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'` # 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=`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" @@ -833,6 +891,7 @@ fi cat > configargs.h < /dev/null; then + if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 11 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then gcc_cv_as_leb128="yes" fi elif test x$gcc_cv_as != x; then @@ -1321,6 +1389,23 @@ L2: EOF if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then gcc_cv_as_leb128="yes" + + # GAS versions before 2.11 do not support uleb128, + # despite appearing to. + # ??? There exists an elf-specific test that will crash + # the assembler. Perhaps it's better to figure out whether + # arbitrary sections are supported and try the test. + as_ver=`$gcc_cv_as --version 2>/dev/null | head -1` + if echo "$as_ver" | grep GNU > /dev/null; then + as_ver=`echo $as_ver | sed -e 's/.* //'` + as_major=`echo $as_ver | sed 's/\..*//'` +changequote(,)dnl + as_minor=`echo $as_ver | sed 's/[^.]*\.\([0-9]*\).*/\1/'` +changequote([,])dnl + if test $as_major -eq 2 -a $as_minor -lt 11; then + gcc_cv_as_leb128="no" + fi + fi fi rm -f conftest.s conftest.o conftest.nm1 conftest.nm2 fi @@ -1330,6 +1415,84 @@ if test x"$gcc_cv_as_leb128" = xyes; then fi AC_MSG_RESULT($gcc_cv_as_leb128) +AC_MSG_CHECKING(assembler eh_frame optimization) +gcc_cv_as_eh_frame=no +if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then + if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 12 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then + gcc_cv_as_eh_frame="yes" + fi +elif test x$gcc_cv_as != x; then + # Check if this is GAS. + as_ver=`$gcc_cv_as --version < /dev/null 2> /dev/null | head -1` + rm -f a.out 2> /dev/null + if echo "$as_ver" | grep GNU > /dev/null; then + # Versions up to and including 2.11.0 may mis-optimize + # .eh_frame data. Try something. + cat > conftest.s < conftest.lit < conftest.big < /dev/null 2>&1 \ + && objdump -s -j .eh_frame conftest.o 2>/dev/null \ + | tail -3 > conftest.got \ + && { cmp conftest.lit conftest.got > /dev/null 2>&1 \ + || cmp conftest.big conftest.got > /dev/null 2>&1; } + then + gcc_cv_as_eh_frame="yes" + else + gcc_cv_as_eh_frame="bad" + if $gcc_cv_as -o conftest.o --traditional-format /dev/null; then + AC_DEFINE(USE_AS_TRADITIONAL_FORMAT, 1, + [Define if your assembler mis-optimizes .eh_frame data.]) + fi + fi + fi + rm -f conftest.* +fi +AC_MSG_RESULT($gcc_cv_as_eh_frame) + case "$target" in sparc*-*-*) AC_CACHE_CHECK([assembler .register pseudo-op support], @@ -1435,6 +1598,7 @@ changequote([, ]) [Define if your assembler supports offsetable %lo().]) fi fi + ;; changequote(,)dnl @@ -1491,8 +1655,8 @@ then gcc_cv_as_dwarf2_debug_line="yes" fi elif test x$gcc_cv_as != x -a x"$insn" != x ; then - echo ' .file 0 "conftest.s"' > conftest.s - echo ' .loc 0 3 0' >> conftest.s + echo ' .file 1 "conftest.s"' > conftest.s + echo ' .loc 1 3 0' >> conftest.s echo " $insn" >> conftest.s # ??? This fails with non-gnu grep. if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \ @@ -1620,8 +1784,8 @@ AC_SUBST(gthread_flags) # Find out what GC implementation we want, or may, use. AC_ARG_WITH(gc, -[ --with-gc={simple,page} Choose the garbage collection mechanism to use - with the compiler.], +[ --with-gc={simple,page} choose the garbage collection mechanism to use + with the compiler], [case "$withval" in simple | page) GGC=ggc-$withval @@ -1645,15 +1809,13 @@ zlibinc= AC_SUBST(zlibdir) AC_SUBST(zlibinc) -AC_DEFINE_UNQUOTED(ENABLE_STD_NAMESPACE, 1, - [Define to 1 if you want to enable namespaces (-fhonor-std) by default.]) - dnl Very limited version of automake's enable-maintainer-mode AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, -[ --enable-maintainer-mode enable make rules and dependencies not useful +[ --enable-maintainer-mode + enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], maintainer_mode=$enableval, maintainer_mode=no) @@ -1667,6 +1829,14 @@ else fi AC_SUBST(MAINT)dnl +# With Setjmp/Longjmp based exception handling. +AC_ARG_ENABLE(sjlj-exceptions, +[ --enable-sjlj-exceptions + arrange to use setjmp/longjmp exception handling], +[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.])]) + # 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. @@ -1804,7 +1974,7 @@ build_canonical=${build} host_canonical=${host} target_subdir= if test "${host}" != "${target}" ; then - target_subdir=${target}/ + target_subdir=${target_alias}/ fi AC_SUBST(build_canonical) AC_SUBST(host_canonical) @@ -1852,8 +2022,9 @@ AC_SUBST(dollar) # Find a directory in which to install a shared libgcc. AC_ARG_ENABLE(version-specific-runtime-libs, -[ --enable-version-specific-runtime-libs Specify that runtime libraries shou -ld be installed in a compiler-specific directory ]) +[ --enable-version-specific-runtime-libs + specify that runtime libraries should be + installed in a compiler-specific directory]) AC_ARG_WITH(slibdir, [ --with-slibdir=DIR shared libraries in DIR [LIBDIR]],