OSDN Git Service

Fix NM/AR propagation from toplevel for recursive makes.
[pf3gnuchains/gcc-fork.git] / gcc / configure.ac
index 742432b..7a2fbb7 100644 (file)
@@ -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
@@ -211,6 +211,12 @@ else
   AC_MSG_RESULT(no)
 fi
 
+# With demangler in GNU ld
+AC_ARG_WITH(demangler-in-ld,
+[  --with-demangler-in-ld  try to use demangler in GNU ld.],
+demangler_in_ld="$with_demangler_in_ld",
+demangler_in_ld=no)
+
 # ----------------------
 # Find default assembler
 # ----------------------
@@ -226,7 +232,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
@@ -278,7 +284,6 @@ 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 *)
@@ -379,8 +384,8 @@ AC_ARG_ENABLE(checking,
 [  --enable-checking[=LIST]
                          enable expensive run-time checks.  With LIST,
                          enable only specific categories of checks.
-                         Categories are: misc,tree,rtl,rtlflag,gc,gcac,fold;
-                         default is misc,tree,gc,rtlflag],
+                         Categories are: fold,gc,gcac,misc,rtlflag,rtl,
+                         tree,valgrind; default is gc,misc,rtlflag,tree],
 [ac_checking=
 ac_tree_checking=
 ac_rtl_checking=
@@ -398,13 +403,13 @@ no)       ;;
        for check
        do
                case $check in
+               fold)   ac_fold_checking=1 ;;
+               gc)     ac_gc_checking=1 ;;
+               gcac)   ac_gc_always_collect=1 ;;
                misc)   ac_checking=1 ;;
-               tree)   ac_tree_checking=1 ;;
                rtlflag)        ac_rtlflag_checking=1 ;;
                rtl)    ac_rtl_checking=1 ;;
-               gc)     ac_gc_checking=1 ;;
-               gcac)   ac_gc_always_collect=1 ;;
-               fold)   ac_fold_checking=1 ;;
+               tree)   ac_tree_checking=1 ;;
                valgrind)       ac_checking_valgrind=1 ;;
                *)      AC_MSG_ERROR(unknown check category $check) ;;
                esac
@@ -426,8 +431,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
@@ -510,6 +519,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]
@@ -571,9 +589,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
@@ -710,15 +726,28 @@ AC_PROG_MAKE_SET
 
 # Find some useful tools
 AC_PROG_AWK
-# We need awk to run opts.sh (to create options.c and options.h).
+# We need awk to create options.c and options.h.
 # Bail out if it's missing.
 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
+case "${host}" in
+*-*-darwin*)
+  # By default, the Darwin ranlib will not treat common symbols as
+  # definitions when  building the archive table of contents.  Other 
+  # ranlibs do that; pass an option to the Darwin ranlib that makes
+  # it behave similarly.
+  ranlib_flags="-c" 
+  ;;
+*)
+  ranlib_flags=""
+esac
+AC_SUBST(ranlib_flags)
+     
 gcc_AC_PROG_INSTALL
 
 # See if cmp has --ignore-initial.
@@ -762,7 +791,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)
@@ -770,12 +799,27 @@ 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)
 fi
 
+# NM
+if test x${build} = x${host} && test -f $srcdir/../binutils/nm.c; then
+  NM='$(objdir)/../binutils/nm-new'
+else
+  AC_CHECK_PROG(NM, nm, nm, ${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing nm)
+fi
+
+# AR
+if test x${build} = x${host} && test -f $srcdir/../binutils/ar.c; then
+  AR='$(objdir)/../binutils/ar'
+else
+  AC_CHECK_PROG(AR, ar, ar, ${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing ar)
+fi
+
+
 # --------------------
 # Checks for C headers
 # --------------------
@@ -800,8 +844,7 @@ AC_PROG_CPP_WERROR
 
 AC_HEADER_STDC
 AC_HEADER_TIME
-gcc_AC_HEADER_STDBOOL
-gcc_AC_HEADER_STRING
+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 \
@@ -970,7 +1013,7 @@ 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, , ,[
+       malloc realloc calloc free basename getopt clock getpagesize, , ,[
 #include "ansidecl.h"
 #include "system.h"])
 
@@ -1033,19 +1076,6 @@ if test $gcc_cv_type_clock_t = yes; then
   [Define if <time.h> 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 <sys/types.h> defines \`uchar'.])
-fi
-
 # Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
 CFLAGS="$saved_CFLAGS"
 
@@ -1212,7 +1242,7 @@ fi
 # ---------
 
 # Check if a valid thread package
-case ${enable_threads_flag} in
+case ${enable_threads} in
   "" | no)
     # No threads
     target_thread_file='single'
@@ -1223,10 +1253,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
@@ -1697,14 +1727,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
@@ -1716,6 +1747,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
@@ -1802,16 +1838,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 \
@@ -1834,6 +1869,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
@@ -2436,6 +2475,26 @@ fi
 
 # Target-specific assembler checks.
 
+if test x"$demangler_in_ld" = xyes; then
+  AC_MSG_CHECKING(linker --demangle support)
+  gcc_cv_ld_demangle=no
+  if test $in_tree_ld = yes; then
+    if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 14 -o "$gcc_cv_gld_major_version" -gt 2; then \
+      gcc_cv_ld_demangle=yes
+    fi
+  elif test x$gcc_cv_ld != x -a x"$gnu_ld" = xyes; then
+    # Check if the GNU linker supports --demangle option
+    if $gcc_cv_ld --help 2>/dev/null | grep no-demangle > /dev/null; then
+      gcc_cv_ld_demangle=yes
+    fi
+  fi
+  if test x"$gcc_cv_ld_demangle" = xyes; then
+    AC_DEFINE(HAVE_LD_DEMANGLE, 1,
+[Define if your linker supports --demangle option.])
+  fi
+  AC_MSG_RESULT($gcc_cv_ld_demangle)
+fi
+
 case "$target" in
   # All TARGET_ABI_OSF targets.
   alpha*-*-osf* | alpha*-*-linux* | alpha*-*-*bsd*)
@@ -2541,6 +2600,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],,
@@ -2756,8 +2835,9 @@ AC_MSG_RESULT($gcc_cv_ld_pie)
 # UNSORTED
 # --------
 
-AC_MSG_CHECKING(linker --as-needed support)
-gcc_cv_ld_as_needed=no
+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
@@ -2769,11 +2849,11 @@ elif test x$gcc_cv_ld != x; then
                gcc_cv_ld_as_needed=yes
        fi
 fi
+])
 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
-AC_MSG_RESULT($gcc_cv_ld_as_needed)
 
 if test x$with_sysroot = x && test x$host = x$target \
    && test "$prefix" != "/usr" && test "x$prefix" != "x$local_prefix" ; then
@@ -2828,6 +2908,28 @@ 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
 # --------------
@@ -2857,7 +2959,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.
@@ -3124,6 +3226,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)