OSDN Git Service

* recog.c (validate_replace_src): Remove.
[pf3gnuchains/gcc-fork.git] / gcc / configure.ac
index cbeb3e1..a6b43bd 100644 (file)
@@ -1,7 +1,7 @@
-# configure.in for GCC
+# configure.ac for GCC
 # Process this file with autoconf to generate a configuration script.
 
-# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
 # Free Software Foundation, Inc.
 
 #This file is part of GCC.
 # --------------------------------
 
 AC_PREREQ(2.57)
-AC_INIT(tree.c)
+AC_INIT
+AC_CONFIG_SRCDIR(tree.c)
 AC_CONFIG_HEADER(auto-host.h:config.in)
 
 # Determine the host, build, and target systems
-AC_CANONICAL_SYSTEM
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
 
 # Determine the noncanonical target name, for directory use.
 _GCC_TOPLEV_NONCANONICAL_TARGET
@@ -154,13 +157,24 @@ fi])
 # sources.  Therefore we have --enable-generated-files-in-srcdir to do 
 # just that.
 
-AC_ARG_ENABLE(generated-files-in-srcdir, 
-[  --enable-generated-files-in-srcdir  Put generated files in source dir],
-[case ${enableval} in
-  no)    parsedir='$(objdir)'; docobjdir='$(objdir)/doc';;
-  *)     parsedir='$(srcdir)'; docobjdir='$(srcdir)/doc';;
-esac],
-[parsedir='$(objdir)'; docobjdir='$(objdir)/doc';])
+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, 
+[  --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
@@ -235,6 +249,15 @@ 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
 AC_PROG_CC_C_O
@@ -682,6 +705,10 @@ if test $gcc_cv_glibc = yes; then
   AC_DEFINE(_GNU_SOURCE, 1, [Always define this when using the GNU C Library])
 fi
 
+# 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
 gcc_AC_HEADER_STDBOOL
@@ -983,6 +1010,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
@@ -1118,11 +1146,13 @@ fi
 
 if test x$enable___cxa_atexit = xyes || \
    test x$enable___cxa_atexit = x -a x$default_use_cxa_atexit = xyes; then
-  AC_DEFINE(DEFAULT_USE_CXA_ATEXIT, 1,
-  [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.])
+   AC_CHECK_FUNC(__cxa_atexit,
+       [AC_DEFINE(DEFAULT_USE_CXA_ATEXIT, 1,
+       [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.])],
+       echo "__cxa_atexit can't be enabled on this target")
 fi
 
 # Look for a file containing extra machine modes.
@@ -1159,6 +1189,7 @@ else
        saved_CFLAGS="${CFLAGS}"
        CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
        ${realsrcdir}/configure \
+               --enable-languages=${enable_languages} \
                --target=$target_alias --host=$build_alias --build=$build_alias
        CFLAGS="${saved_CFLAGS}"
 
@@ -1593,11 +1624,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 \
@@ -1649,7 +1680,9 @@ 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"; then
+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.
@@ -1709,11 +1742,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 \
@@ -1765,7 +1798,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") ;;
@@ -1789,7 +1822,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") ;;
@@ -1891,7 +1924,7 @@ changequote([,])dnl
     fi
   else
     case "${target}" in
-      hppa64*-*-hpux*)
+      hppa64*-*-hpux* | ia64*-*-hpux*)
        gcc_cv_ld_hidden=yes
        ;;
       *)
@@ -2040,6 +2073,7 @@ foo:      .long   25
        lda     $4,foo($29)                     !tprel'
        tls_first_major=2
        tls_first_minor=13
+       tls_as_opt=--fatal-warnings
        ;;
   i[34567]86-*-*)
     conftest_s='
@@ -2059,6 +2093,7 @@ foo:      .long   25
        leal    foo@NTPOFF(%ecx), %eax'
        tls_first_major=2
        tls_first_minor=14
+       tls_as_opt=--fatal-warnings
        ;;
   x86_64-*-*)
     conftest_s='
@@ -2073,6 +2108,7 @@ foo:      .long   25
        movq    $foo@TPOFF, %rax'
        tls_first_major=2
        tls_first_minor=14
+       tls_as_opt=--fatal-warnings
        ;;
   ia64-*-*)
     conftest_s='
@@ -2090,6 +2126,7 @@ foo:      data8   25
        movl    r24 = @tprel(foo#)'
        tls_first_major=2
        tls_first_minor=13
+       tls_as_opt=--fatal-warnings
        ;;
   powerpc-*-*)
     conftest_s='
@@ -2115,7 +2152,7 @@ x3:       .space 4
        addi 9,9,x2@tprel@l'
        tls_first_major=2
        tls_first_minor=14
-       tls_as_opt=-a32
+       tls_as_opt="-a32 --fatal-warnings"
        ;;
   powerpc64-*-*)
     conftest_s='
@@ -2149,7 +2186,7 @@ x3:       .space 8
        nop'
        tls_first_major=2
        tls_first_minor=14
-       tls_as_opt=-a64
+       tls_as_opt="-a64 --fatal-warnings"
        ;;
   s390-*-*)
     conftest_s='
@@ -2168,7 +2205,7 @@ foo:      .long   25
        bas     %r14,0(%r1,%r13):tls_ldcall:foo'
        tls_first_major=2
        tls_first_minor=14
-       tls_as_opt=-m31
+       tls_as_opt="-m31 --fatal-warnings"
        ;;
   s390x-*-*)
     conftest_s='
@@ -2186,7 +2223,7 @@ foo:      .long   25
        brasl   %r14,__tls_get_offset@PLT:tls_ldcall:foo'
        tls_first_major=2
        tls_first_minor=14
-       tls_as_opt="-m64 -Aesame"
+       tls_as_opt="-m64 -Aesame --fatal-warnings"
        ;;
   sh-*-* | sh[34]-*-*)
     conftest_s='
@@ -2200,9 +2237,44 @@ foo:     .long   25
        .long   foo@TPOFF'
        tls_first_major=2
        tls_first_minor=13
+       tls_as_opt=--fatal-warnings
        ;;
   sparc*-*-*)
-    conftest_s='
+    case "$target" in
+      sparc*-sun-solaris2.*)
+       on_solaris=yes
+       ;;
+      *)
+       on_solaris=no
+       ;;
+    esac
+    if test x$on_solaris = xyes && test x$gas_flag = xno; then
+      conftest_s='
+       .section ".tdata",#alloc,#write,#tls
+foo:   .long   25
+       .text
+       sethi   %tgd_hi22(foo), %o0
+       add     %o0, %tgd_lo10(foo), %o1
+       add     %l7, %o1, %o0, %tgd_add(foo)
+       call    __tls_get_addr, %tgd_call(foo)
+       sethi   %tldm_hi22(foo), %l1
+       add     %l1, %tldm_lo10(foo), %l2
+       add     %l7, %l2, %o0, %tldm_add(foo)
+       call    __tls_get_addr, %tldm_call(foo)
+       sethi   %tldo_hix22(foo), %l3
+       xor     %l3, %tldo_lox10(foo), %l4
+       add     %o0, %l4, %l5, %tldo_add(foo)
+       sethi   %tie_hi22(foo), %o3
+       add     %o3, %tie_lo10(foo), %o3
+       ld      [%l7 + %o3], %o2, %tie_ld(foo)
+       add     %g7, %o2, %o4, %tie_add(foo)
+       sethi   %tle_hix22(foo), %l1
+       xor     %l1, %tle_lox10(foo), %o5
+       ld      [%g7 + %o5], %o1'
+       tls_first_major=0
+       tls_first_minor=0
+    else
+      conftest_s='
        .section ".tdata","awT",@progbits
 foo:   .long   25
        .text
@@ -2226,7 +2298,8 @@ foo:      .long   25
        ld      [%g7 + %o5], %o1'
        tls_first_major=2
        tls_first_minor=14
-       tls_as_opt=-32
+       tls_as_opt="-32 --fatal-warnings"
+      fi
        ;;
 changequote([,])dnl
 esac
@@ -2234,8 +2307,7 @@ if test -z "$tls_first_major"; then
   : # If we don't have a check, assume no support.
 else
   gcc_GAS_CHECK_FEATURE(thread-local storage support, gcc_cv_as_tls,
-  [$tls_first_major,$tls_first_minor,0], [$tls_as_opt --fatal-warnings],
-  [$conftest_s],,
+  [$tls_first_major,$tls_first_minor,0], [$tls_as_opt], [$conftest_s],,
   [AC_DEFINE(HAVE_AS_TLS, 1,
            [Define if your assembler supports thread-local storage.])])
 fi
@@ -2379,11 +2451,13 @@ changequote([,])dnl
 
   powerpc*-*-*)
     case $target in
-      *-*-aix) conftest_s='    .csect .text[PR]';;
-      *)       conftest_s='    .text';;
+      *-*-aix*) conftest_s='   .csect .text[[PR]]
+       mfcr 3,128';;
+      *-*-darwin*) conftest_s='        .text
+       mfcr r3,128';;
+      *)       conftest_s='    .text
+       mfcr 3,128';;
     esac
-    conftest_s="$conftest_s
-       mfcr 3,128"
 
     gcc_GAS_CHECK_FEATURE([mfcr field support],
       gcc_cv_as_powerpc_mfcrf, [2,14,0],,
@@ -2415,7 +2489,7 @@ case "$target" in
   | xstormy16*-*-* | cris-*-* | xtensa-*-*)
     insn="nop"
     ;;
-  ia64*-*-*)
+  ia64*-*-* | s390*-*-*)
     insn="nop 0"
     ;;
   mmix-*-*)
@@ -2690,10 +2764,10 @@ AC_SUBST(gthread_flags)
 
 # Find out what GC implementation we want, or may, use.
 AC_ARG_WITH(gc,
-[  --with-gc={simple,page,zone} choose the garbage collection mechanism to use
+[  --with-gc={page,zone}   choose the garbage collection mechanism to use
                           with the compiler],
 [case "$withval" in
-  simple | page | zone)
+  page | zone)
     GGC=ggc-$withval
     ;;
   *)
@@ -2838,7 +2912,7 @@ rm -f Make-hooks
 touch Make-hooks
 target_list="all.build all.cross start.encap rest.encap tags \
        install-normal install-common install-man \
-       uninstall \
+       uninstall info man srcextra srcman srcinfo \
        mostlyclean clean distclean maintainer-clean \
        stage1 stage2 stage3 stage4 stageprofile stagefeedback"
 for t in $target_list
@@ -2931,8 +3005,6 @@ AC_SUBST(objdir)
 # Substitute configuration variables
 AC_SUBST(subdirs)
 AC_SUBST(srcdir)
-AC_SUBST(docobjdir)
-AC_SUBST(parsedir)
 AC_SUBST(all_boot_languages)
 AC_SUBST(all_compilers)
 AC_SUBST(all_gtfiles)
@@ -2953,6 +3025,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)
@@ -2966,7 +3039,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)
@@ -2999,6 +3071,14 @@ AC_SUBST(target_cpu_default)
 
 AC_SUBST_FILE(language_hooks)
 
+# If it doesn't already exist, create document directory
+echo "checking for the document directory." 1>&2
+if test -d doc ; then
+  true
+else
+  mkdir doc 
+fi
+
 # Echo link setup.
 if test x${build} = x${host} ; then
   if test x${host} = x${target} ; then
@@ -3022,7 +3102,9 @@ fi
 
 # Create the Makefile
 # and configure language subdirectories
-AC_OUTPUT($all_outputs,
+AC_CONFIG_FILES($all_outputs)
+
+AC_CONFIG_COMMANDS([default],
 [
 case ${CONFIG_HEADERS} in
   *auto-host.h:config.in*)
@@ -3055,3 +3137,4 @@ else true ; fi
 [subdirs='$subdirs'
 symbolic_link='$symbolic_link'
 ])
+AC_OUTPUT