OSDN Git Service

2005-03-29 Ed Falis <falis@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / configure.ac
index 59524c2..1d6ced1 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
@@ -395,7 +394,7 @@ AC_ARG_ENABLE(checking,
                          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;],
+                         rtlflag,rtl,runtime,tree,valgrind,release,yes,all;],
 [ac_checking_flags="${enableval}"],[
 # Determine the default checks.
 if test x$is_release = x ; then
@@ -408,6 +407,7 @@ ac_checking=
 ac_tree_checking=
 ac_rtl_checking=
 ac_rtlflag_checking=
+ac_runtime_checking=1
 ac_gc_checking=
 ac_gc_always_collect=
 ac_fold_checking=
@@ -417,16 +417,17 @@ do
        case $check in
        yes)            ac_assert_checking=1 ; ac_checking=1 ;
                        ac_tree_checking=1 ; ac_gc_checking=1 ;
-                       ac_rtlflag_checking=1 ;;
+                       ac_rtlflag_checking=1 ; ac_runtime_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= ;;
        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_rtlflag_checking=1 ; ac_runtime_checking=1;
+                       ac_gc_checking=1 ; ac_gc_always_collect=1 ;
+                       ac_fold_checking=1 ;;
+        release)       ac_assert_checking=1 ; ac_runtime_checking=1 ;;
        assert)         ac_assert_checking=1 ;;
        fold)           ac_fold_checking=1 ;;
        gc)             ac_gc_checking=1 ;;
@@ -434,6 +435,7 @@ do
        misc)           ac_checking=1 ;;
        rtlflag)        ac_rtlflag_checking=1 ;;
        rtl)            ac_rtl_checking=1 ;;
+       runtime)        ac_runtime_checking=1 ;;
        tree)           ac_tree_checking=1 ;;
        valgrind)       ac_checking_valgrind=1 ;;
        *)      AC_MSG_ERROR(unknown check category $check) ;;
@@ -453,6 +455,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
@@ -1332,6 +1338,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 +1424,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 +1441,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 +1511,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 +1761,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 +1786,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 +1807,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 +1912,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 +1934,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 +1979,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 +2003,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 +2285,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 +2347,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,8 +3021,12 @@ 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])