OSDN Git Service

2000-09-25 Kazu Hirata <kazu@hxi.com>
[pf3gnuchains/gcc-fork.git] / gcc / configure.in
index 98f3b96..bc6d40e 100644 (file)
@@ -280,10 +280,7 @@ fi)
 # 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.],
-if test x$enable_threads = xno; then
-       enable_threads=''
-fi,
+  --enable-threads=LIB    use LIB thread package for target GCC.],,
 enable_threads='')
 
 enable_threads_flag=$enable_threads
@@ -298,7 +295,7 @@ case x${enable_threads_flag} in
                target_thread_file=''
                ;;
        xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
-       xsolaris | xwin32 | xdce | xvxworks)
+       xsolaris | xwin32 | xdce | xvxworks | xaix)
                target_thread_file=$enable_threads_flag
                ;;
        *)
@@ -355,6 +352,19 @@ if test "x$GCC" = "xyes"; then
 else
   stage1_warn_cflags=""
 fi
+
+# Stage specific cflags for build.
+case $build in
+vax-*-*)
+  if test x$GCC = xyes
+  then
+    stage1_warn_cflags="$stage1_warn_cflags -Wa,-J"
+  else
+    stage1_warn_cflags="$stage1_warn_cflags -J"
+  fi
+  ;;
+esac
+
 AC_SUBST(stage1_warn_cflags)
 AC_SUBST(stage2_warn_cflags)
 
@@ -382,6 +392,20 @@ else
     AC_MSG_RESULT(no)
 fi
 
+AC_MSG_CHECKING(for GNU C library)
+AC_CACHE_VAL(gcc_cv_glibc,
+[AC_TRY_COMPILE(
+  [#include <features.h>],[
+#if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
+#error Not a GNU C library system
+#endif], 
+  [gcc_cv_glibc=yes], 
+  gcc_cv_glibc=no)])
+AC_MSG_RESULT($gcc_cv_glibc)
+if test $gcc_cv_glibc = yes; then
+  AC_DEFINE(_GNU_SOURCE, 1, [Always define this when using the GNU C Library])
+fi
+
 AC_C_INLINE
 
 # Find some useful tools
@@ -401,7 +425,7 @@ 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 \
                 sys/resource.h sys/param.h sys/times.h sys/stat.h \
-                direct.h malloc.h)
+                direct.h malloc.h langinfo.h iconv.h)
 
 # Check for thread headers.
 AC_CHECK_HEADER(thread.h, [have_thread_h=yes], [have_thread_h=])
@@ -477,7 +501,7 @@ fi
 AC_CHECK_FUNCS(strtoul bsearch putenv popen bcopy bzero bcmp \
        index rindex strchr strrchr kill getrlimit setrlimit atoll atoq \
        sysconf isascii gettimeofday strsignal putc_unlocked fputc_unlocked \
-       fputs_unlocked getrusage valloc)
+       fputs_unlocked getrusage valloc iconv nl_langinfo)
 
 AC_CHECK_TYPE(ssize_t, int)
 
@@ -2034,6 +2058,23 @@ changequote([,])dnl
        m32r-*-elf*)
                extra_parts="crtinit.o crtfini.o"
                ;;
+       # m68hc11 and m68hc12 share the same machine description.
+        m68hc11-*-*|m6811-*-*)
+               tm_file="m68hc11/m68hc11.h"
+                xm_file="m68hc11/xm-m68hc11.h"
+               tm_p_file="m68hc11/m68hc11-protos.h"
+               md_file="m68hc11/m68hc11.md"
+               out_file="m68hc11/m68hc11.c"
+               tmake_file="m68hc11/t-m68hc11-gas"
+                ;;
+        m68hc12-*-*|m6812-*-*)
+               tm_file="m68hc11/m68hc12.h"
+               tm_p_file="m68hc11/m68hc11-protos.h"
+                xm_file="m68hc11/xm-m68hc11.h"
+               md_file="m68hc11/m68hc11.md"
+               out_file="m68hc11/m68hc11.c"
+               tmake_file="m68hc11/t-m68hc11-gas"
+                ;;
        m68000-convergent-sysv*)
                tm_file=m68k/ctix.h
                xm_file="m68k/xm-3b1.h ${xm_file}"
@@ -3279,7 +3320,13 @@ changequote([,])dnl
                then
                        tmake_file=rs6000/t-xnewas
                else
-                       tmake_file='rs6000/t-newas rs6000/t-aix41'
+                       tmake_file=rs6000/t-newas
+               fi
+               if test "$gnu_ld" = yes
+               then
+                       xmake_file=rs6000/x-aix41-gld
+               else
+                       tmake_file='rs6000/t-newas'
                fi
                xmake_file=rs6000/x-aix41
                float_format=none
@@ -3293,6 +3340,7 @@ changequote([,])dnl
                xmake_file=rs6000/x-aix41
                float_format=none
                use_collect2=yes
+               thread_file='aix'
                ;;
 changequote(,)dnl
        rs6000-ibm-aix[56789].* | powerpc-ibm-aix[56789].*)
@@ -3302,6 +3350,7 @@ changequote([,])dnl
                xmake_file=rs6000/x-aix41
                float_format=none
                use_collect2=yes
+               thread_file='aix'
                ;;
        rs6000-ibm-aix*)
                float_format=none
@@ -3325,17 +3374,28 @@ changequote([,])dnl
                use_collect2=yes
                ;;
        sh-*-elf*)
-               tm_file=sh/elf.h
+               tmake_file="sh/t-sh sh/t-elf"
+               tm_file="sh/sh.h sh/elf.h"
                float_format=sh
                ;;
        sh-*-rtemself*)
-               tmake_file="sh/t-sh t-rtems"
-               tm_file=sh/rtemself.h
+               tmake_file="sh/t-sh sh/t-elf t-rtems"
+               tm_file="sh/sh.h sh/elf.h sh/rtemself.h"
                float_format=sh
                ;;
        sh-*-rtems*)
                tmake_file="sh/t-sh t-rtems"
-               tm_file=sh/rtems.h
+               tm_file="sh/sh.h sh/rtems.h"
+               float_format=sh
+               ;;
+       sh-*-linux*)
+               tm_file="sh/sh.h sh/elf.h sh/linux.h"
+               tmake_file="sh/t-sh sh/t-elf sh/t-linux"
+               xmake_file=x-linux
+               gas=yes gnu_ld=yes
+               if test x$enable_threads = xyes; then
+                       thread_file='posix'
+               fi
                float_format=sh
                ;;
        sh-*-*)
@@ -3664,7 +3724,6 @@ changequote([,])dnl
                ;;
        vax-*-ultrix*)                  # vaxen running ultrix
                tm_file="${tm_file} vax/ultrix.h"
-               use_collect2=yes
                float_format=vax
                ;;
        vax-*-vms*)                     # vaxen running VMS
@@ -4367,10 +4426,11 @@ if test -f ../ld/Makefile; then
 #      fi
 fi
 
-# Figure out what assembler alignment features are present.
-AC_MSG_CHECKING(assembler alignment features)
+# Figure out what assembler we will be using.
+AC_MSG_CHECKING(what assembler to use)
 gcc_cv_as=
-gcc_cv_as_alignment_features=
+gcc_cv_gas_major_version=
+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"
@@ -4394,21 +4454,9 @@ changequote(,)dnl
        gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([0-9]*\)"`
        gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
 changequote([,])dnl
-       if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
-               # Gas version 2.6 and later support for .balign and .p2align.
-               # bytes to skip when using .p2align.
-               if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 6 -o "$gcc_cv_gas_major_version" -gt 2; then
-                       gcc_cv_as_alignment_features=".balign and .p2align"
-                       AC_DEFINE(HAVE_GAS_BALIGN_AND_P2ALIGN)
-               fi
-               # Gas version 2.8 and later support specifying the maximum
-               # bytes to skip when using .p2align.
-               if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 8 -o "$gcc_cv_gas_major_version" -gt 2; then
-                       gcc_cv_as_alignment_features=".p2align including maximum skip"
-                       AC_DEFINE(HAVE_GAS_MAX_SKIP_P2ALIGN)
-               fi
-       fi
-elif test x$host = x$target; then
+fi
+
+if test "x$gcc_cv_as" = x -a x$host = x$target; then
        # Native build.
        # Search the same directories that the installed compiler will
        # search.  Else we may find the wrong assembler and lose.  If we
@@ -4460,7 +4508,39 @@ elif test x$host = x$target; then
                fi
        done
 fi
-if test x$gcc_cv_as != x; then
+if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
+  AC_MSG_RESULT("newly built gas")
+else
+  AC_MSG_RESULT($gcc_cv_as)
+fi
+
+# Figure out what nm we will be using.
+AC_MSG_CHECKING(what nm to use)
+if test -x nm$host_exeext; then
+       gcc_cv_nm=./nm$host_exeext
+elif test x$host = x$target; then
+       # Native build.
+       gcc_cv_nm=nm$host_exeext
+fi
+AC_MSG_RESULT($gcc_cv_nm)
+
+# Figure out what assembler alignment features are present.
+AC_MSG_CHECKING(assembler alignment features)
+gcc_cv_as_alignment_features=
+if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
+       # Gas version 2.6 and later support for .balign and .p2align.
+       # bytes to skip when using .p2align.
+       if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 6 -o "$gcc_cv_gas_major_version" -gt 2; then
+               gcc_cv_as_alignment_features=".balign and .p2align"
+               AC_DEFINE(HAVE_GAS_BALIGN_AND_P2ALIGN)
+       fi
+       # Gas version 2.8 and later support specifying the maximum
+       # bytes to skip when using .p2align.
+       if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 8 -o "$gcc_cv_gas_major_version" -gt 2; then
+               gcc_cv_as_alignment_features=".p2align including maximum skip"
+               AC_DEFINE(HAVE_GAS_MAX_SKIP_P2ALIGN)
+       fi
+elif test x$gcc_cv_as != x; then
        # Check if we have .balign and .p2align
        echo ".balign  4" > conftest.s
        echo ".p2align  2" >> conftest.s
@@ -4482,17 +4562,15 @@ AC_MSG_RESULT($gcc_cv_as_alignment_features)
 
 AC_MSG_CHECKING(assembler subsection support)
 gcc_cv_as_subsections=
-if test x$gcc_cv_as != x; then
+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 9 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
+    gcc_cv_as_subsections="working .subsection -1"
+  fi
+elif test x$gcc_cv_as != x; then
        # Check if we have .subsection
        echo ".subsection 1" > conftest.s
        if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
                gcc_cv_as_subsections=".subsection"
-               if test -x nm$host_exeext; then
-                       gcc_cv_nm=./nm$host_exeext
-               elif test x$host = x$target; then
-                       # Native build.
-                       gcc_cv_nm=nm$host_exeext
-               fi
                if test x$gcc_cv_nm != x; then
                        cat > conftest.s <<EOF
 conftest_label1: .word 0
@@ -4507,44 +4585,57 @@ EOF
                                        :
                                else
                                        gcc_cv_as_subsections="working .subsection -1"
-                                       AC_DEFINE(HAVE_GAS_SUBSECTION_ORDERING, 1,
-[Define if your assembler supports .subsection and .subsection -1 starts
-   emitting at the beginning of your section.])
                                fi
                        fi
                fi
        fi
        rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
 fi
+if test x"$gcc_cv_as_subsections" = x"working .subsection -1"; then
+       AC_DEFINE(HAVE_GAS_SUBSECTION_ORDERING, 1,
+[Define if your assembler supports .subsection and .subsection -1 starts
+   emitting at the beginning of your section.])
+fi
 AC_MSG_RESULT($gcc_cv_as_subsections)
 
 AC_MSG_CHECKING(assembler weak support)
 gcc_cv_as_weak=
-if test x$gcc_cv_as != x; then
+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 2 -o "$gcc_cv_gas_major_version" -gt 2; then
+    gcc_cv_as_weak="yes"
+  fi
+elif test x$gcc_cv_as != x; then
        # Check if we have .weak
        echo "  .weak foobar" > conftest.s
        if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
-               AC_DEFINE(HAVE_GAS_WEAK, 1,
-                       [Define if your assembler supports .weak.])
                gcc_cv_as_weak="yes"
        fi
        rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
 fi
+if test x"$gcc_cv_as_weak" = xyes; then
+       AC_DEFINE(HAVE_GAS_WEAK, 1, [Define if your assembler supports .weak.])
+fi
 AC_MSG_RESULT($gcc_cv_as_weak)
 
 AC_MSG_CHECKING(assembler hidden support)
 gcc_cv_as_hidden=
-if test x$gcc_cv_as != x; then
+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 10 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
+    gcc_cv_as_hidden="yes"
+  fi
+elif test x$gcc_cv_as != x; then
        # Check if we have .hidden
        echo "  .hidden foobar" > conftest.s
        echo "foobar:" >> conftest.s
        if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
-               AC_DEFINE(HAVE_GAS_HIDDEN, 1,
-                       [Define if your assembler supports .hidden.])
                gcc_cv_as_hidden="yes"
        fi
        rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
 fi
+if test x"$gcc_cv_as_hidden" = xyes; then
+       AC_DEFINE(HAVE_GAS_HIDDEN, 1,
+               [Define if your assembler supports .hidden.])
+fi
 AC_MSG_RESULT($gcc_cv_as_hidden)
 
 case "$target" in 
@@ -4659,19 +4750,25 @@ changequote(,)dnl
 changequote([,])dnl
     AC_MSG_CHECKING(assembler instructions)
     gcc_cv_as_instructions=
-    if test x$gcc_cv_as != x; then
+    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 9 -o "$gcc_cv_gas_major_version" -gt 2; then
+       gcc_cv_as_instructions="filds fists"
+      fi
+    elif test x$gcc_cv_as != x; then
        set "filds fists" "filds mem; fists mem"
        while test $# -gt 0
        do
                echo "$2" > conftest.s
                if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
                        gcc_cv_as_instructions=${gcc_cv_as_instructions}$1" "
-                       AC_DEFINE_UNQUOTED(HAVE_GAS_`echo "$1" | tr '[a-z ]' '[A-Z_]'`)
                fi
                shift 2
        done
        rm -f conftest.s conftest.o
     fi
+    if test x"$gcc_cv_as_instructions" != x; then
+       AC_DEFINE_UNQUOTED(HAVE_GAS_`echo "$gcc_cv_as_instructions" | tr '[a-z ]' '[A-Z_]'`)
+    fi
     AC_MSG_RESULT($gcc_cv_as_instructions)
     ;;
 esac
@@ -4766,6 +4863,17 @@ fi])
 AC_SUBST(GGC)
 echo "Using $GGC for garbage collection."
 
+# Use the system's zlib library.
+zlibdir=-L../../zlib
+zlibinc="-I\$(srcdir)/../../zlib"
+AC_ARG_WITH(system-zlib,
+[  --with-system-zlib      use installed libz],
+zlibdir=
+zlibinc=
+)
+AC_SUBST(zlibdir)
+AC_SUBST(zlibinc)
+
 # Build a new-abi (c++) system
 AC_ARG_ENABLE(new-gxx-abi,
 [  --enable-new-gxx-abi