OSDN Git Service

gcc:
[pf3gnuchains/gcc-fork.git] / gcc / configure.ac
index 59524c2..efa758c 100644 (file)
@@ -30,9 +30,6 @@ AC_INIT
 AC_CONFIG_SRCDIR(tree.c)
 AC_CONFIG_HEADER(auto-host.h:config.in)
 
-#Set to 1 on a release branch
-is_release=
-
 # Determine the host, build, and target systems
 AC_CANONICAL_BUILD
 AC_CANONICAL_HOST
@@ -100,8 +97,6 @@ AC_MSG_ERROR([
 *** and run configure again.])
 fi
 
-TL_AC_GCC_VERSION([$srcdir/..])
-
 # -----------
 # Directories
 # -----------
@@ -139,7 +134,7 @@ 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=c++/${gcc_version}
+    libstdcxx_incdir='c++/$(version)'
 changequote(<<, >>)dnl
     gcc_gxx_include_dir="\$(libsubdir)/\$(unlibsubdir)/..\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/[^/]*|/..|g'\`/include/"${libstdcxx_incdir}
 changequote([, ])dnl
@@ -375,6 +370,10 @@ fi
 AC_SUBST(warn_cflags)
 
 # Enable -Werror in bootstrap stage2 and later.
+is_release=
+if test x"`cat $srcdir/DEV-PHASE`" != xexperimental; then
+  is_release=yes
+fi
 AC_ARG_ENABLE(werror, 
 [  --enable-werror         enable -Werror in bootstrap stage2 and later], [],
 [if test x$is_release = x ; then
@@ -394,8 +393,9 @@ AC_ARG_ENABLE(checking,
 [  --enable-checking[=LIST]
                          enable expensive run-time checks.  With LIST,
                          enable only specific categories of checks.
-                         Categories are: assert,fold,gc,gcac,misc,
-                         rtlflag,rtl,tree,valgrind,release,yes,all;],
+                         Categories are: yes,no,all,none,release.
+                         Flags are: assert,fold,gc,gcac,misc,
+                         rtlflag,rtl,runtime,tree,valgrind.],
 [ac_checking_flags="${enableval}"],[
 # Determine the default checks.
 if test x$is_release = x ; then
@@ -405,37 +405,50 @@ else
 fi])
 ac_assert_checking=1
 ac_checking=
-ac_tree_checking=
-ac_rtl_checking=
-ac_rtlflag_checking=
+ac_fold_checking=
 ac_gc_checking=
 ac_gc_always_collect=
-ac_fold_checking=
+ac_rtl_checking=
+ac_rtlflag_checking=
+ac_runtime_checking=1
+ac_tree_checking=
+ac_valgrind_checking=
 IFS="${IFS=    }"; ac_save_IFS="$IFS"; IFS="$IFS,"
 for check in $ac_checking_flags
 do
        case $check in
+       # these set all the flags to specific states
        yes)            ac_assert_checking=1 ; ac_checking=1 ;
-                       ac_tree_checking=1 ; ac_gc_checking=1 ;
-                       ac_rtlflag_checking=1 ;;
-       no)             ac_assert_checking= ; ac_checking= ;
-                       ac_tree_checking= ; ac_rtl_checking= ;
-                       ac_rtlflag_checking= ; ac_gc_checking= ;
-                       ac_gc_always_collect= ; ac_fold_checking= ;;
+                       ac_fold_checking= ; ac_gc_checking=1 ;
+                       ac_gc_always_collect= ; ac_rtl_checking= ;
+                       ac_rtlflag_checking=1 ; ac_runtime_chacking=1 ;
+                       ac_tree_checking=1 ; ac_valgrind_checking= ;;
+       no|none)        ac_assert_checking= ; ac_checking= ;
+                       ac_fold_checking= ; ac_gc_checking= ;
+                       ac_gc_always_collect= ; ac_rtl_checking= ;
+                       ac_rtlflag_checking= ; ac_runtime_chacking= ;
+                       ac_tree_checking= ; ac_valgrind_checking= ;;
        all)            ac_assert_checking=1 ; ac_checking=1 ;
-                       ac_tree_checking=1 ; ac_rtl_checking=1 ;
-                       ac_rtlflag_checking=1 ; ac_gc_checking=1 ;
-                       ac_gc_always_collect=1 ; ac_fold_checking=1 ;;
-        release)       ac_assert_checking=1 ;;
+                       ac_fold_checking=1 ; ac_gc_checking=1 ;
+                       ac_gc_always_collect=1 ; ac_rtl_checking=1 ;
+                       ac_rtlflag_checking=1 ; ac_runtime_checking=1 ;
+                       ac_tree_checking=1 ; ac_valgrind_checking= ;;
+       release)        ac_assert_checking=1 ; ac_checking= ;
+                       ac_fold_checking= ; ac_gc_checking= ;
+                       ac_gc_always_collect= ; ac_rtl_checking= ;
+                       ac_rtlflag_checking= ; ac_runtime_checking=1 ;
+                       ac_tree_checking= ; ac_valgrind_checking= ;;
+       # these enable particular checks
        assert)         ac_assert_checking=1 ;;
        fold)           ac_fold_checking=1 ;;
        gc)             ac_gc_checking=1 ;;
        gcac)           ac_gc_always_collect=1 ;;
        misc)           ac_checking=1 ;;
-       rtlflag)        ac_rtlflag_checking=1 ;;
        rtl)            ac_rtl_checking=1 ;;
+       rtlflag)        ac_rtlflag_checking=1 ;;
+       runtime)        ac_runtime_checking=1 ;;
        tree)           ac_tree_checking=1 ;;
-       valgrind)       ac_checking_valgrind=1 ;;
+       valgrind)       ac_valgrind_checking=1 ;;
        *)      AC_MSG_ERROR(unknown check category $check) ;;
        esac
 done
@@ -453,6 +466,10 @@ 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_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
@@ -499,7 +516,7 @@ 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_checking_valgrind != x ; then
+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 <valgrind/memcheck.h>)
@@ -960,11 +977,15 @@ 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 dup2 kill getrlimit setrlimit atoll atoq \
-       sysconf strsignal putc_unlocked fputc_unlocked fputs_unlocked \
-       fwrite_unlocked fprintf_unlocked getrusage nl_langinfo \
-        scandir alphasort gettimeofday mbstowcs wcswidth mmap mincore \
-        setlocale)
+       sysconf strsignal getrusage nl_langinfo scandir alphasort \
+       gettimeofday mbstowcs wcswidth mmap mincore setlocale \
+       gcc_UNLOCKED_FUNCS)
 
 if test x$ac_cv_func_mbstowcs = xyes; then
   AC_CACHE_CHECK(whether mbstowcs works, gcc_cv_func_mbstowcs_works,
@@ -1031,10 +1052,9 @@ AM_LANGINFO_CODESET
 # We will need to find libiberty.h and ansidecl.h
 saved_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"
-gcc_AC_CHECK_DECLS(getenv atol sbrk abort atof getcwd getwd \
-       strsignal putc_unlocked fputs_unlocked fwrite_unlocked \
-        fprintf_unlocked strstr errno snprintf vasprintf \
-       malloc realloc calloc free basename getopt clock getpagesize, , ,[
+gcc_AC_CHECK_DECLS(getenv atol sbrk abort atof getcwd getwd strsignal \
+       strstr errno snprintf vsnprintf vasprintf malloc realloc calloc \
+       free basename getopt clock getpagesize gcc_UNLOCKED_FUNCS, , ,[
 #include "ansidecl.h"
 #include "system.h"])
 
@@ -1332,6 +1352,13 @@ if test -n "$extra_modes" && test -f $srcdir/config/$extra_modes; then
    for this architecture.])
 fi
 
+# Convert extra_options into a form suitable for Makefile use.
+extra_opt_files=
+for f in $extra_options; do
+  extra_opt_files="$extra_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
@@ -1411,13 +1438,6 @@ EOF
 changequote([,])dnl
 
 # Internationalization
-PACKAGE=gcc
-VERSION="$gcc_version"
-AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE",
-  [The name of this program for internationalization purposes.])
-AC_SUBST(PACKAGE)
-AC_SUBST(VERSION)
-
 ZW_GNU_GETTEXT_SISTER_DIR
 
 # If LIBINTL contains LIBICONV, then clear LIBICONV so we don't get
@@ -1435,44 +1455,30 @@ AC_ARG_ENABLE(win32-registry,
   --enable-win32-registry=KEY
                           use KEY instead of GCC version as the last portion
                           of the registry key],,)
+
 case $host_os in
-       win32 | pe | cygwin* | mingw32* | uwin*)
-AC_MSG_CHECKING(whether windows registry support is requested)
-if test "x$enable_win32_registry" != xno; then
-  AC_DEFINE(ENABLE_WIN32_REGISTRY, 1,
-[Define to 1 if installation paths should be looked up in Windows32
-   Registry. Ignored on non windows32 hosts.])
-  AC_MSG_RESULT(yes)
-  AC_SEARCH_LIBS(RegOpenKeyExA, advapi32)
-else
-  AC_MSG_RESULT(no)
-fi
+  win32 | pe | cygwin* | mingw32* | uwin*)
+    if test "x$enable_win32_registry" != xno; then
+      AC_SEARCH_LIBS(RegOpenKeyExA, advapi32,, [enable_win32_registry=no])
+    fi
 
-# Check if user specified a different registry key.
-case "x${enable_win32_registry}" in
-x | xyes)
-  # default.
-  gcc_cv_win32_registry_key="$VERSION"
-  ;;
-xno)
-  # no registry lookup.
-  gcc_cv_win32_registry_key=''
-  ;;
-*)
-  # user-specified key.
-  gcc_cv_win32_registry_key="$enable_win32_registry"
+    if test "x$enable_win32_registry" != xno; then
+      AC_DEFINE(ENABLE_WIN32_REGISTRY, 1,
+  [Define to 1 if installation paths should be looked up in the Windows
+   Registry. Ignored on non-Windows hosts.])
+
+      if test "x$enable_win32_registry" != xyes \
+         && test "x$enable_win32_registry" != x; then
+       AC_DEFINE_UNQUOTED(WIN32_REGISTRY_KEY, "$enable_win32_registry",
+  [Define to be the last component of the Windows registry key under which
+   to look for installation paths.  The full key used will be 
+   HKEY_LOCAL_MACHINE/SOFTWARE/Free Software Foundation/{WIN32_REGISTRY_KEY}.
+   The default is the GCC version number.])
+      fi
+    fi
   ;;
 esac
 
-if test "x$enable_win32_registry" != xno; then
-  AC_MSG_CHECKING(registry key on windows hosts)
-  AC_DEFINE_UNQUOTED(WIN32_REGISTRY_KEY, "$gcc_cv_win32_registry_key",
-       [Define to be the last portion of registry key on windows hosts.])
-  AC_MSG_RESULT($gcc_cv_win32_registry_key)
-fi
-;;
-esac
-
 # Get an absolute path to the GCC top-level source directory
 holddir=`${PWDCMD-pwd}`
 cd $srcdir
@@ -1519,10 +1525,14 @@ case "$LN_S" in
                ;;
 esac
 
+# This is a terrible hack which will go away some day.
+host_cc_for_libada=${CC}
+AC_SUBST(host_cc_for_libada)
+
 out_object_file=`basename $out_file .c`.o
 
-tm_file_list=
-tm_include_list=
+tm_file_list="options.h"
+tm_include_list="options.h"
 for f in $tm_file; do
   case $f in
     defaults.h )
@@ -1765,6 +1775,8 @@ elif test -x "$AS" && test x$host = x$target; then
        gcc_cv_as="$AS"
 fi
 
+gcc_version=`cat $srcdir/BASE-VER`
+
 if test "x$gcc_cv_as" = x; then
        # Search the same directories that the installed compiler will
        # search.  Else we may find the wrong assembler and lose.  If we
@@ -1788,10 +1800,12 @@ if test "x$gcc_cv_as" = x; then
        fi
 
        # If the loop below does not find an assembler, then use whatever
-       # one we can find in the users's path.
-       # user's path.
+       # one we can find in the users's path.  We are looking for a
+       # ${build} -> ${target} assembler.
        if test "x$program_prefix" != xNONE; then
                gcc_cv_as=${program_prefix}as$build_exeext
+       elif test x$build != x$host && test x$build != x$target; then
+               gcc_cv_as=${target_noncanonical}-as$build_exeext
        else
                gcc_cv_as=`echo as | sed "${program_transform_name}"`$build_exeext
        fi
@@ -1807,7 +1821,7 @@ if test "x$gcc_cv_as" = x; then
            test_dirs=
        fi
 
-       if test x$host = x$target; then
+       if test x$build = x$target; then
            test_dirs="$test_dirs \
                   /usr/libexec \
                   /usr/ccs/gcc \
@@ -1912,11 +1926,13 @@ if test "x$gcc_cv_ld" = x; then
                test_prefix=$exec_prefix
        fi
 
-       # If the loop below does not find an linker, then use whatever
-       # one we can find in the users's path.
-       # user's path.
+       # If the loop below does not find a linker, then use whatever
+       # one we can find in the users's path.  We are looking for a
+       # ${build} -> ${target} linker.
        if test "x$program_prefix" != xNONE; then
                gcc_cv_ld=${program_prefix}ld$build_exeext
+       elif test x$build != x$host && test x$build != x$target; then
+               gcc_cv_ld=${target_noncanonical}-ld$build_exeext
        else
                gcc_cv_ld=`echo ld | sed "${program_transform_name}"`$build_exeext
        fi
@@ -1932,7 +1948,7 @@ if test "x$gcc_cv_ld" = x; then
            test_dirs=
        fi
 
-       if test x$host = x$target; then
+       if test x$build = x$target; then
            test_dirs="$test_dirs \
                   /usr/libexec \
                   /usr/ccs/gcc \
@@ -1977,6 +1993,8 @@ elif test -f $gcc_cv_binutils_srcdir/configure.in \
        $LN_S ../binutils/nm-new$build_exeext nm$build_exeext 2>/dev/null
 elif test "x$program_prefix" != xNONE; then
        gcc_cv_nm=${program_prefix}nm$build_exeext
+elif test x$build != x$host && test x$build != x$target; then
+       gcc_cv_nm=${target_noncanonical}-nm$build_exeext
 else
        gcc_cv_nm=`echo nm | sed "${program_transform_name}"`$build_exeext
 fi
@@ -1999,6 +2017,8 @@ elif test -f $gcc_cv_binutils_srcdir/configure.in \
        $LN_S ../binutils/objdump$build_exeext objdump$build_exeext 2>/dev/null
 elif test "x$program_prefix" != xNONE; then
        gcc_cv_objdump=${program_prefix}objdump$build_exeext
+elif test x$build != x$host && test x$build != x$target; then
+       gcc_cv_objdump=${target_noncanonical}-objdump$build_exeext
 else
        gcc_cv_objdump=`echo objdump | \
                sed "${program_transform_name}"`$build_exeext
@@ -2279,6 +2299,15 @@ foo:     .long   25
        tls_first_minor=13
        tls_as_opt=--fatal-warnings
        ;;
+  frv*-*-*)
+    conftest_s='
+       .section ".tdata","awT",@progbits
+x:      .long   25
+        .text
+        call    #gettlsoff(x)'
+       tls_first_major=2
+       tls_first_minor=14
+       ;;
   i[34567]86-*-*)
     conftest_s='
        .section ".tdata","awT",@progbits
@@ -2332,6 +2361,23 @@ foo:     data8   25
        tls_first_minor=13
        tls_as_opt=--fatal-warnings
        ;;
+  mips*-*-*)
+    conftest_s='
+       .section .tdata,"awT",@progbits
+x:
+       .word 2
+       .text
+       addiu $4, $28, %tlsgd(x)
+       addiu $4, $28, %tlsldm(x)
+       lui $4, %dtprel_hi(x)
+       addiu $4, $4, %dtprel_lo(x)
+       lw $4, %gottprel(x)($28)
+       lui $4, %tprel_hi(x)
+       addiu $4, $4, %tprel_lo(x)'
+       tls_first_major=2
+       tls_first_minor=16
+       tls_as_opt='-32 --fatal-warnings'
+       ;;
   powerpc-*-*)
     conftest_s='
        .section ".tdata","awT",@progbits
@@ -2989,9 +3035,13 @@ AC_ARG_WITH(gc,
 [  --with-gc={page,zone}   choose the garbage collection mechanism to use
                           with the compiler],
 [case "$withval" in
-  page | zone)
+  page)
     GGC=ggc-$withval
     ;;
+  zone)
+    GGC=ggc-$withval
+    AC_DEFINE(GGC_ZONE, 1, [Define if the zone collector is in use])
+    ;;
   *)
     AC_MSG_ERROR([$withval is an invalid option to --with-gc])
     ;;
@@ -3296,8 +3346,6 @@ AC_SUBST(target_cpu_default)
 
 AC_SUBST_FILE(language_hooks)
 
-TL_AC_GNU_MAKE_GCC_LIB_PATH
-
 # Echo link setup.
 if test x${build} = x${host} ; then
   if test x${host} = x${target} ; then