symbolic_link='ln -s'
copy=cp
+# Check for bogus environment variables.
+# Test if LIBRARY_PATH contains the notation for the current directory
+# since this would lead to problems installing/building glibc.
+# LIBRARY_PATH contains the current directory if one of the following
+# is true:
+# - one of the terminals (":" and ";") is the first or last sign
+# - two terminals occur directly after each other
+# - the path contains an element with a dot in it
+AC_MSG_CHECKING(LIBRARY_PATH variable)
+changequote(,)dnl
+case ${LIBRARY_PATH} in
+ [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
+ library_path_setting="contains current directory"
+ ;;
+ *)
+ library_path_setting="ok"
+ ;;
+esac
+changequote([,])dnl
+AC_MSG_RESULT($library_path_setting)
+if test "$library_path_setting" != "ok"; then
+AC_MSG_ERROR([
+*** LIBRARY_PATH shouldn't contain the current directory when
+*** building egcs. Please change the environment variable
+*** and run configure again.])
+fi
+
+# Test if GCC_EXEC_PREFIX contains the notation for the current directory
+# since this would lead to problems installing/building glibc.
+# GCC_EXEC_PREFIX contains the current directory if one of the following
+# is true:
+# - one of the terminals (":" and ";") is the first or last sign
+# - two terminals occur directly after each other
+# - the path contains an element with a dot in it
+AC_MSG_CHECKING(GCC_EXEC_PREFIX variable)
+changequote(,)dnl
+case ${GCC_EXEC_PREFIX} in
+ [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
+ gcc_exec_prefix_setting="contains current directory"
+ ;;
+ *)
+ gcc_exec_prefix_setting="ok"
+ ;;
+esac
+changequote([,])dnl
+AC_MSG_RESULT($gcc_exec_prefix_setting)
+if test "$gcc_exec_prefix_setting" != "ok"; then
+AC_MSG_ERROR([
+*** GCC_EXEC_PREFIX shouldn't contain the current directory when
+*** building egcs. Please change the environment variable
+*** and run configure again.])
+fi
+
# Check for additional parameters
# With GNU ld
gnu_ld_flag="$with_gnu_ld",
gnu_ld_flag=no)
+# With pre-defined ld
+AC_ARG_WITH(ld,
+[ --with-ld arrange to use the specified ld (full pathname).],
+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])
+ elif test "GNU" = `$DEFAULT_LINKER -v </dev/null 2>&1 | sed '1s/^GNU.*/GNU/;q'`; then
+ gnu_ld_flag=yes
+ fi
+ AC_DEFINE_UNQUOTED(DEFAULT_LINKER,"$DEFAULT_LINKER")
+fi
+
# With GNU as
AC_ARG_WITH(gnu-as,
[ --with-gnu-as arrange to work with GNU as.],
gas_flag="$with_gnu_as",
gas_flag=no)
+AC_ARG_WITH(as,
+[ --with-as arrange to use the specified as (full pathname).],
+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])
+ elif test "GNU" = `$DEFAULT_ASSEMBLER -v </dev/null 2>&1 | sed '1s/^GNU.*/GNU/;q'`; then
+ gas_flag=yes
+ fi
+ AC_DEFINE_UNQUOTED(DEFAULT_ASSEMBLER,"$DEFAULT_ASSEMBLER")
+fi
+
# With stabs
AC_ARG_WITH(stabs,
[ --with-stabs arrange to use stabs instead of host debug format.],
if test x${enable_version_specific_runtime_libs} = xyes; then
gxx_include_dir='${libsubdir}/include/g++'
else
- gxx_include_dir='${prefix}/include/g++'
+ topsrcdir=${srcdir}/.. . ${srcdir}/../config.if
+changequote(<<, >>)dnl
+ gxx_include_dir="\$(libsubdir)/\$(unlibsubdir)/..\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/[^/]*|/..|g'\`/include/g++"-${libstdcxx_interface}
+changequote([, ])dnl
fi
fi
*) AC_MSG_ERROR(bad value ${enableval} given for checking option) ;;
esac])
-# Enable use of cpplib for C.
+# Use cpplib+cppmain for the preprocessor, but don't link it with the compiler.
cpp_main=cccp
+AC_ARG_ENABLE(cpplib,
+[ --enable-cpplib use cpplib for the C preprocessor.],
+if test x$enable_cpplib != xno; then
+ cpp_main=cppmain
+fi)
+
+# Link cpplib into the compiler proper, for C/C++/ObjC.
AC_ARG_ENABLE(c-cpplib,
-[ --enable-c-cpplib Use cpplib for C and C++.],
+[ --enable-c-cpplib link cpplib directly into C and C++ compilers
+ (implies --enable-cpplib).],
if test x$enable_c_cpplib != xno; then
- extra_c_objs="${extra_c_objs} cpplib.o cppexp.o cpphash.o cpperror.o"
- extra_c_objs="${extra_c_objs} prefix.o"
- extra_cxx_objs="${extra_cxx_objs} ../cpplib.o ../cppexp.o ../cpphash.o ../cpperror.o ../prefix.o"
+ extra_c_objs="${extra_c_objs} libcpp.a"
+ extra_cxx_objs="${extra_cxx_objs} ../libcpp.a"
extra_c_flags=-DUSE_CPPLIB=1
cpp_main=cppmain
fi)
-
+
# Enable Multibyte Characters for C/C++
AC_ARG_ENABLE(c-mbchar,
-[ --enable-c-mbchar Enable multibyte characters for C and C++.],
+[ --enable-c-mbchar enable multibyte characters for C and C++.],
if test x$enable_c_mbchar != xno; then
extra_c_flags=-DMULTIBYTE_CHARS=1
fi)
# Enable Haifa scheduler.
AC_ARG_ENABLE(haifa,
-[ --enable-haifa Use the experimental scheduler.
- --disable-haifa Don't use the experimental scheduler for the
+[ --enable-haifa use the experimental scheduler.
+ --disable-haifa don't use the experimental scheduler for the
targets which normally enable it.])
# Fast fixincludes
#
# This is a work in progress...
AC_ARG_WITH(fast-fixincludes,
-[ --with-fast-fixincludes Use a faster fixinclude program. Experimental],
+[ --with-fast-fixincludes use a faster fixinclude program (experimental)],
fast_fixinc="$with_fast_fixincludes",
fast_fixinc=no)
# Enable init_priority.
AC_ARG_ENABLE(init-priority,
-[ --enable-init-priority Use attributes to assign initialization order
+[ --enable-init-priority use attributes to assign initialization order
for static objects.
- --disable-init-priority Conform to ISO C++ rules for ordering static objects
+ --disable-init-priority conform to ISO C++ rules for ordering static objects
(i.e. initialized in order of declaration). ],
if test x$enable_init_priority != xno; then
extra_c_flags=-DUSE_INIT_PRIORITY
;;
esac
+AC_ARG_ENABLE(objc-gc,
+[ --enable-objc-gc enable the use of Boehm's garbage collector with
+ the GNU Objective-C runtime.],
+if [[[ x$enable_objc_gc = xno ]]]; then
+ objc_boehm_gc=''
+else
+ objc_boehm_gc=1
+fi,
+objc_boehm_gc='')
+
# Determine the host, build, and target systems
AC_CANONICAL_SYSTEM
# Find the native compiler
AC_PROG_CC
+
+# If the native compiler is GCC, we can enable warnings even in stage1.
+# That's useful for people building cross-compilers, or just running a
+# quick `make'.
+if test "x$GCC" = "xyes"; then
+ stage1_warn_cflags='$(WARN_CFLAGS)'
+else
+ stage1_warn_cflags=""
+fi
+AC_SUBST(stage1_warn_cflags)
+
AC_PROG_MAKE_SET
+AC_MSG_CHECKING([whether a default assembler was specified])
+if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then
+ if test x"$with_gas" = x"no"; then
+ AC_MSG_RESULT([yes ($DEFAULT_ASSEMBLER)])
+ else
+ AC_MSG_RESULT([yes ($DEFAULT_ASSEMBLER - GNU as)])
+ fi
+else
+ AC_MSG_RESULT(no)
+fi
+
+AC_MSG_CHECKING([whether a default linker was specified])
+if test x"${DEFAULT_LINKER+set}" = x"set"; then
+ if test x"$with_gnu_ld" = x"no"; then
+ AC_MSG_RESULT([yes ($DEFAULT_LINKER)])
+ else
+ AC_MSG_RESULT([yes ($DEFAULT_LINKER - GNU ld)])
+ fi
+else
+ AC_MSG_RESULT(no)
+fi
+
# Find some useful tools
AC_PROG_AWK
AC_PROG_LEX
AC_HEADER_STDC
AC_HEADER_TIME
+GCC_HEADER_STRING
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 wait.h sys/wait.h)
# Check for thread headers.
AC_CHECK_HEADER(thread.h, [have_thread_h=yes], [have_thread_h=])
AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=])
+# See if GNAT has been installed
+AC_CHECK_PROG(gnat, gnatbind, yes, no)
+
# See if the system preprocessor understands the ANSI C preprocessor
# stringification operator.
AC_MSG_CHECKING(whether cpp understands the stringify operator)
[#include <sys/types.h>
#include <inttypes.h>],
[intmax_t i = -1;],
- [AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H)
- gcc_cv_header_inttypes_h=yes],
+ [gcc_cv_header_inttypes_h=yes],
gcc_cv_header_inttypes_h=no)])
AC_MSG_RESULT($gcc_cv_header_inttypes_h)
+if test $gcc_cv_header_inttypes_h = yes; then
+ AC_DEFINE(HAVE_INTTYPES_H)
+fi
AC_CHECK_FUNCS(strtoul bsearch strerror putenv popen bcopy bzero bcmp \
index rindex strchr strrchr kill getrlimit setrlimit atoll atoq \
- sysconf isascii gettimeofday)
+ sysconf isascii gettimeofday strsignal)
# Make sure wchar_t is available
#AC_CHECK_TYPE(wchar_t, unsigned int)
GCC_FUNC_VFPRINTF_DOPRNT
GCC_FUNC_PRINTF_PTR
+AC_FUNC_VFORK
GCC_NEED_DECLARATIONS(malloc realloc calloc free bcopy bzero bcmp \
- index rindex getenv atol sbrk abort atof strerror getcwd getwd)
+ index rindex getenv atol sbrk abort atof strerror getcwd getwd \
+ strsignal)
GCC_NEED_DECLARATIONS(getrlimit setrlimit, [
#include <sys/types.h>
;;
alpha*-*-netbsd*)
tm_file="${tm_file} alpha/elf.h alpha/netbsd.h alpha/netbsdl-elf.h"
- xm_file="xm-netbsd.h ${xm_file}"
target_cpu_default="MASK_GAS"
tmake_file="alpha/t-crtbe"
extra_parts="crtbegin.o crtend.o"
;;
arm*-*-netbsd*)
tm_file=arm/netbsd.h
- xm_file="xm-netbsd.h ${xm_file}"
+ xm_file="arm/xm-netbsd.h ${xm_file}"
tmake_file="t-netbsd arm/t-netbsd"
# On NetBSD, the headers are already okay, except for math.h.
fixincludes=fixinc.wrap
;;
- arm-*-linux-gnuaout*) # ARM GNU/Linux
+ arm*-*-linux-gnuaout*) # ARM GNU/Linux with a.out
cpu_type=arm
xmake_file=x-linux
- tm_file=arm/linux-gas.h
+ tm_file=arm/linux-aout.h
tmake_file=arm/t-linux
fixincludes=Makefile.in
gnu_ld=yes
;;
- arm-*-aout)
+ arm*-*-linux-gnu*) # ARM GNU/Linux with ELF
+ xm_file=arm/xm-linux.h
+ xmake_file=x-linux
+ case $machine in
+ armv2*-*-*)
+ tm_file=arm/linux-elf26.h
+ ;;
+ *)
+ tm_file=arm/linux-elf.h
+ ;;
+ esac
+ tmake_file="t-linux arm/t-linux"
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
+ fixincludes=Makefile.in # Nothing to fix
+ gnu_ld=yes
+ ;;
+ arm*-*-aout)
tm_file=arm/aout.h
tmake_file=arm/t-bare
;;
+ arm*-*-elf)
+ tm_file=arm/unknown-elf.h
+ tmake_file=arm/t-arm-elf
+ ;;
c1-convex-*) # Convex C1
target_cpu_default=1
use_collect2=yes
use_collect2=yes
fixincludes=Makefile.in
;;
+ c4x-*)
+ cpu_type=c4x
+ tmake_file=c4x/t-c4x
+ ;;
clipper-intergraph-clix*)
tm_file="${tm_file} svr3.h clipper/clix.h"
xm_file=clipper/xm-clix.h
tmake_file=i386/t-next
xmake_file=i386/x-next
extra_objs=nextstep.o
+ extra_parts="crtbegin.o crtend.o"
if test x$enable_threads = xyes; then
thread_file='mach'
fi
fixincludes=fixinc.wrap
tmake_file=i386/t-freebsd
;;
+ # We are hoping OpenBSD is still close enough to NetBSD that we can
+ # share the configurations.
changequote(,)dnl
- i[34567]86-*-netbsd*)
+ i[34567]86-*-netbsd* | i[34567]86-*-openbsd*)
changequote([,])dnl
tm_file=i386/netbsd.h
- xm_file="xm-netbsd.h ${xm_file}"
# On NetBSD, the headers are already okay, except for math.h.
fixincludes=fixinc.wrap
tmake_file=t-netbsd
tmake_file=i386/t-go32
gnu_ld=yes
gas=yes
+ exeext=.exe
+ case $host in
+ *pc-msdosdjgpp*)
+ target_alias=djgpp
+ ;;
+ esac
;;
changequote(,)dnl
i[34567]86-moss-msdos* | i[34567]86-*-moss*)
tmake_file=i386/t-crtpic
xmake_file=x-svr4
extra_parts="crtbegin.o crtend.o"
- fixincludes=Makefile.in # The headers are just fine, thank you.
+ fixincludes=fixinc.svr4
;;
changequote(,)dnl
i[34567]86-*-sysv4*) # Intel 80386's running system V.4
extra_parts="crtbegin.o crtend.o"
;;
changequote(,)dnl
+ i[34567]86-*-udk*) # Intel x86 on SCO UW/OSR5 Dev Kit
+changequote([,])dnl
+ xm_file="xm-alloca.h xm-siglist.h ${xm_file}"
+ xm_defines="USG POSIX"
+ tm_file=i386/udk.h
+ tmake_file="i386/t-crtpic i386/t-udk"
+ xmake_file=x-svr4
+ extra_parts="crtbegin.o crtend.o"
+ fixincludes="fixinc.svr4"
+ ;;
+changequote(,)dnl
i[34567]86-*-osf1*) # Intel 80386's running OSF/1 1.3+
changequote([,])dnl
cpu_type=i386
tmake_file=m68k/t-next
xmake_file=m68k/x-next
extra_objs=nextstep.o
+ extra_parts="crtbegin.o crtend.o"
extra_headers=math-68881.h
float_format=m68k
if test x$enable_threads = xyes; then
;;
m68k*-*-netbsd*)
tm_file=m68k/netbsd.h
- xm_file="xm-netbsd.h ${xm_file}"
# On NetBSD, the headers are already okay, except for math.h.
fixincludes=fixinc.wrap
tmake_file=t-netbsd
;;
mipsel-*-netbsd* | mips-dec-netbsd*) # Decstation running NetBSD
tm_file=mips/netbsd.h
- xm_file="xm-netbsd.h ${xm_file}"
# On NetBSD, the headers are already okay, except for math.h.
fixincludes=fixinc.wrap
tmake_file=t-netbsd
;;
ns32k-*-netbsd*)
tm_file=ns32k/netbsd.h
- xm_file="xm-netbsd.h ${xm_file}"
+ xm_file="ns32k/xm-netbsd.h ${xm_file}"
# On NetBSD, the headers are already okay, except for math.h.
fixincludes=fixinc.wrap
tmake_file=t-netbsd
use_collect2=yes
;;
changequote(,)dnl
- rs6000-ibm-aix4.[12].* | powerpc-ibm-aix4.[12].*)
+ rs6000-ibm-aix4.[12]* | powerpc-ibm-aix4.[12]*)
changequote([,])dnl
tm_file=rs6000/aix41.h
if test x$host != x$target
;;
sparc-*-netbsd*)
tm_file=sparc/netbsd.h
- xm_file="xm-netbsd.h ${xm_file}"
# On NetBSD, the headers are already okay, except for math.h.
fixincludes=fixinc.wrap
tmake_file=t-netbsd
tmake_file="sparc/t-sparcbare t-rtems"
tm_file=sparc/rtems.h
;;
+ sparcv9-*-solaris2*)
+ tm_file=sparc/sol2-sld-64.h
+ xm_file="sparc/xm-sysv4-64.h sparc/xm-sol2.h"
+ xm_defines="USG POSIX"
+ tmake_file="sparc/t-sol2 sparc/t-sol2-64"
+ xmake_file=sparc/x-sysv4
+ extra_parts="crt1.o crti.o crtn.o gcrt1.o crtbegin.o crtend.o"
+ fixincludes=fixinc.wrap
+ float_format=i128
+ if test x${enable_threads} = x ; then
+ enable_threads=$have_pthread_h
+ if test x${enable_threads} = x ; then
+ enable_threads=$have_thread_h
+ fi
+ fi
+ if test x${enable_threads} = xyes ; then
+ if test x${have_pthread_h} = xyes ; then
+ thread_file='posix'
+ else
+ thread_file='solaris'
+ fi
+ fi
+ ;;
sparc-*-solaris2*)
if test x$gnu_ld = xyes
then
extra_parts="crtbegin.o crtend.o"
;;
sparc64-*-linux*) # 64-bit Sparc's running GNU/Linux
- tmake_file=sparc/t-sp64
+ tmake_file="t-linux sparc/t-linux64"
xm_file="sparc/xm-sp64.h sparc/xm-linux.h"
tm_file=sparc/linux64.h
xmake_file=x-linux
fixincludes=Makefile.in # The headers are ok already.
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
gnu_ld=yes
;;
# This hasn't been upgraded to GCC 2.
;;
vax-*-netbsd*)
tm_file="${tm_file} netbsd.h vax/netbsd.h"
- xm_file="xm-netbsd.h ${xm_file}"
# On NetBSD, the headers are already okay, except for math.h.
fixincludes=fixinc.wrap
tmake_file=t-netbsd
AC_MSG_CHECKING(assembler alignment features)
gcc_cv_as=
gcc_cv_as_alignment_features=
-gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,gcc$,gas,'`
-if test -x as$host_exeext; then
+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; then
+elif test -f $gcc_cv_as_gas_srcdir/configure.in -a -f ../gas/Makefile; then
# Single tree build which includes gas.
for f in $gcc_cv_as_gas_srcdir/configure $gcc_cv_as_gas_srcdir/configure.in $gcc_cv_as_gas_srcdir/Makefile.in
do
fi
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
+ # 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
+.subsection -1
+conftest_label2: .word 0
+.previous
+EOF
+ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
+ $gcc_cv_nm conftest.o | grep conftest_label1 > conftest.nm1
+ $gcc_cv_nm conftest.o | grep conftest_label2 | sed -e 's/label2/label1/' > conftest.nm2
+ if cmp conftest.nm1 conftest.nm2 > /dev/null 2>&1; then
+ :
+ else
+ gcc_cv_as_subsections="working .subsection -1"
+ AC_DEFINE(HAVE_GAS_SUBSECTION_ORDERING)
+ fi
+ fi
+ fi
+ fi
+ rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
+fi
+AC_MSG_RESULT($gcc_cv_as_subsections)
+
# Figure out what language subdirectories are present.
subdirs=
for lang in ${srcdir}/*/config-lang.in ..
# The odd quoting in the next line works around
# an apparent bug in bash 1.12 on linux.
changequote(,)dnl
+ ${srcdir}/ada/config-lang.in)
+ if test x$gnat = xyes ; then
+ subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`"
+ fi
+ ;;
${srcdir}/[*]/config-lang.in) ;;
*) subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`" ;;
changequote([,])dnl
lang_specs_files=
lang_options_files=
-rm -f specs.h options.h
-touch specs.h options.h
+lang_tree_files=
+rm -f specs.h options.h gencheck.h
+touch specs.h options.h gencheck.h
for subdir in . $subdirs
do
if test -f $srcdir/$subdir/lang-specs.h; then
echo "#include \"$subdir/lang-options.h\"" >>options.h
lang_options_files="$lang_options_files $srcdir/$subdir/lang-options.h"
fi
+ if test -f $srcdir/$subdir/$subdir-tree.def; then
+ echo "#include \"$subdir/$subdir-tree.def\"" >>gencheck.h
+ lang_tree_files="$lang_tree_files $srcdir/$subdir/$subdir-tree.def"
+ fi
done
# These (without "all_") are set in each config-lang.in.
AC_SUBST(host_xm_file_list)
AC_SUBST(lang_specs_files)
AC_SUBST(lang_options_files)
+AC_SUBST(lang_tree_files)
AC_SUBST(thread_file)
+AC_SUBST(objc_boehm_gc)
AC_SUBST(gcc_version)
AC_SUBST(gcc_version_trigger)
AC_SUBST(local_prefix)