# configure.in for GNU CC
# Process this file with autoconf to generate a configuration script.
-# Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
#This file is part of GNU CC.
# With pre-defined ld
AC_ARG_WITH(ld,
-[ --with-ld arrange to use the specified ld (full pathname).],
+[ --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
# With GNU as
AC_ARG_WITH(gnu-as,
-[ --with-gnu-as arrange to work 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).],
+[ --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
# With stabs
AC_ARG_WITH(stabs,
-[ --with-stabs arrange to use stabs instead of host debug format.],
+[ --with-stabs arrange to use stabs instead of host debug format],
stabs="$with_stabs",
stabs=no)
# With ELF
AC_ARG_WITH(elf,
-[ --with-elf arrange to use ELF instead of host debug format.],
+[ --with-elf arrange to use ELF instead of host debug format],
elf="$with_elf",
elf=no)
# Specify the local prefix
local_prefix=
AC_ARG_WITH(local-prefix,
-[ --with-local-prefix=DIR specifies directory to put local include.],
+[ --with-local-prefix=DIR specifies directory to put local include],
[case "${withval}" in
yes) AC_MSG_ERROR(bad value ${withval} given for local include directory prefix) ;;
no) ;;
local_prefix=/usr/local
fi
-# Build a new-libstdc++ system (ie libstdc++-v3)
-AC_MSG_CHECKING([for libstdc++ to install])
-AC_ARG_ENABLE(libstdcxx-v3,
-[ --enable-libstdcxx-v3
- enable libstdc++-v3 for building and installation],
- [enable_libstdcxx_v3="$enableval"], [enable_libstdcxx_v3=yes])
-
-if test x$enable_libstdcxx_v3 = xyes; then
- AC_MSG_RESULT(v3)
- HAVE_LIBSTDCXX_V3=1
- ac_esn=1
-else
- AC_MSG_RESULT(v2)
- HAVE_LIBSTDCXX_V3=0
- ac_esn=0
-fi
-
# Don't set gcc_gxx_include_dir to gxx_include_dir since that's only
# passed in by the toplevel make and thus we'd get different behavior
# depending on where we built the sources.
# Specify the g++ header file directory
AC_ARG_WITH(gxx-include-dir,
[ --with-gxx-include-dir=DIR
- specifies directory to put g++ header files.],
+ specifies directory to put g++ header files],
[case "${withval}" in
yes) AC_MSG_ERROR(bad value ${withval} given for g++ include directory) ;;
no) ;;
else
topsrcdir=${srcdir}/.. . ${srcdir}/../config.if
changequote(<<, >>)dnl
- gcc_gxx_include_dir="\$(libsubdir)/\$(unlibsubdir)/..\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/[^/]*|/..|g'\`/include/g++"-${libstdcxx_interface}
+ gcc_gxx_include_dir="\$(libsubdir)/\$(unlibsubdir)/..\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/[^/]*|/..|g'\`/include/"${libstdcxx_incdir}
changequote([, ])dnl
fi
fi
+# Determine whether or not multilibs are enabled.
+AC_ARG_ENABLE(multilib,
+[ --enable-multilib enable library support for multiple ABIs],
+[], [enable_multilib=yes])
+AC_SUBST(enable_multilib)
+
# Enable expensive internal checks
AC_ARG_ENABLE(checking,
[ --enable-checking[=LIST]
AC_ARG_ENABLE(cpp,
-[ --disable-cpp don't provide a user-visible C preprocessor.],
+[ --disable-cpp don't provide a user-visible C preprocessor],
[], [enable_cpp=yes])
AC_ARG_WITH(cpp_install_dir,
[ --with-cpp-install-dir=DIR
install the user visible C preprocessor in DIR
- (relative to PREFIX) as well as PREFIX/bin.],
+ (relative to PREFIX) as well as PREFIX/bin],
[if test x$withval = xyes; then
AC_MSG_ERROR([option --with-cpp-install-dir requires an argument])
elif test x$withval != xno; then
# 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
AC_DEFINE(MULTIBYTE_CHARS, 1,
[Define if you want the C and C++ compilers to support multibyte
# Pass with no value to take the default
# 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.],,
+[ --enable-threads enable thread usage for target GCC
+ --enable-threads=LIB use LIB thread package for target GCC],,
enable_threads='')
enable_threads_flag=$enable_threads
AC_ARG_ENABLE(objc-gc,
[ --enable-objc-gc enable the use of Boehm's garbage collector with
- the GNU Objective-C runtime.],
+ the GNU Objective-C runtime],
if test x$enable_objc_gc = xno; then
objc_boehm_gc=''
else
objc_boehm_gc='')
AC_ARG_WITH(dwarf2,
-[ --with-dwarf2 force the default debug format to be DWARF2.],
+[ --with-dwarf2 force the default debug format to be DWARF 2],
dwarf2="$with_dwarf2",
dwarf2=no)
AC_ARG_ENABLE(shared,
-[ --disable-shared don't provide a shared libgcc.],
-[], [enable_shared=yes])
+[ --disable-shared don't provide a shared libgcc],
+[
+ case $enable_shared in
+ yes | no) ;;
+ *)
+ enable_shared=no
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "Xgcc" || test "X$pkg" = "Xlibgcc"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+ esac
+], [enable_shared=yes])
AC_SUBST(enable_shared)
# Determine the host, build, and target systems
AC_SUBST(NO_MINUS_C_MINUS_O)
AC_SUBST(OUTPUT_OPTION)
-gcc_AC_C_LONG_DOUBLE
-
AC_CACHE_CHECK(whether ${CC-cc} accepts -Wno-long-long,
ac_cv_prog_cc_no_long_long,
[save_CFLAGS="$CFLAGS"
fi
AC_SUBST(strict1_warn)
+AC_PROG_CPP
+AC_C_INLINE
+gcc_AC_C_VOLATILE
+
+gcc_AC_C_LONG_DOUBLE
+gcc_AC_C_LONG_LONG
+gcc_AC_C__BOOL
+
+# sizeof(char) is 1 by definition.
+gcc_AC_COMPILE_CHECK_SIZEOF(short)
+gcc_AC_COMPILE_CHECK_SIZEOF(int)
+gcc_AC_COMPILE_CHECK_SIZEOF(long)
+if test $ac_cv_c_long_long = yes; then
+ gcc_AC_COMPILE_CHECK_SIZEOF(long long)
+fi
+if test $ac_cv_c___int64 = yes; then
+ gcc_AC_COMPILE_CHECK_SIZEOF(__int64)
+fi
+
+gcc_AC_C_CHARSET
+
# 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'.
AC_DEFINE(_GNU_SOURCE, 1, [Always define this when using the GNU C Library])
fi
-AC_C_INLINE
-
# Find some useful tools
AC_PROG_AWK
gcc_AC_PROG_LN
gcc_AC_PROG_LN_S
-gcc_AC_C_VOLATILE
AC_PROG_RANLIB
gcc_AC_PROG_INSTALL
AC_HEADER_STDC
AC_HEADER_TIME
+gcc_AC_HEADER_STDBOOL
gcc_AC_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 stab.h sys/file.h sys/time.h \
+ fcntl.h unistd.h sys/file.h sys/time.h \
sys/resource.h sys/param.h sys/times.h sys/stat.h \
- direct.h malloc.h langinfo.h iconv.h)
+ direct.h malloc.h langinfo.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=])
+# These tests can't be done till we know if we have limits.h.
+gcc_AC_C_CHAR_BIT
+gcc_AC_C_COMPILE_ENDIAN
+gcc_AC_C_FLOAT_FORMAT
+
# See if GNAT has been installed
-AC_CHECK_PROG(gnat, gnatbind, yes, no)
+AC_CHECK_PROG(have_gnat, gnatbind, yes, no)
+
+# See if we have the mktemp command.
+AC_CHECK_PROG(have_mktemp_command, mktemp, yes, no)
# Do we have a single-tree copy of texinfo?
if test -f $srcdir/../texinfo/Makefile.in; then
# that we can use it.
gcc_AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
[GNU texinfo.* \([0-9][0-9.]*\)],
- [3.1[2-9] | 3.[2-9][0-9] | 4.* | 1.6[89] | 1.7[0-9]])
+ [4.*])
fi
if test $gcc_cv_prog_makeinfo_modern = no; then
AC_MSG_WARN([
*** Makeinfo is missing or too old.
-*** Info documentation will not be built or installed.])
+*** Info documentation will not be built.])
BUILD_INFO=
- INSTALL_INFO=
else
BUILD_INFO=info AC_SUBST(BUILD_INFO)
- INSTALL_INFO=install-info AC_SUBST(INSTALL_INFO)
+fi
+
+# Is pod2man recent enough to regenerate manpages?
+AC_MSG_CHECKING([for recent Pod::Man])
+if perl -e 'use 1.10 Pod::Man' >/dev/null 2>&1; then
+ AC_MSG_RESULT(yes)
+ GENERATED_MANPAGES=generated-manpages AC_SUBST(GENERATED_MANPAGES)
+else
+ AC_MSG_RESULT(no)
+ GENERATED_MANPAGES=
fi
# How about lex?
AC_CHECK_PROG(BISON, bison, bison, false)
fi
+# These libraries may be used by collect2.
+# We may need a special search path to get them linked.
+AC_CACHE_CHECK(for collect2 libraries, gcc_cv_collect2_libs,
+[save_LIBS="$LIBS"
+for libs in '' -lld -lmld \
+ '-L/usr/lib/cmplrs/cc2.11 -lmld' \
+ '-L/usr/lib/cmplrs/cc3.11 -lmld'
+do
+ LIBS="$libs"
+ AC_TRY_LINK_FUNC(ldopen,
+ [gcc_cv_collect2_libs="$libs"; break])
+done
+LIBS="$save_LIBS"
+test -z "$gcc_cv_collect2_libs" && gcc_cv_collect2_libs='none required'])
+case $gcc_cv_collect2_libs in
+ "none required") ;;
+ *) COLLECT2_LIBS=$gcc_cv_collect2_libs ;;
+esac
+AC_SUBST(COLLECT2_LIBS)
+
+# When building Ada code on Alpha, we need exc_resume which is usually in
+# -lexc. So test for it.
+save_LIBS="$LIBS"
+LIBS=
+AC_SEARCH_LIBS(exc_resume, exc)
+GNAT_LIBEXC="$LIBS"
+LIBS="$save_LIBS"
+AC_SUBST(GNAT_LIBEXC)
+
# See if the stage1 system preprocessor understands the ANSI C
-# preprocessor stringification operator.
+# preprocessor stringification operator. (Used by symcat.h.)
AC_C_STRINGIZE
# Use <inttypes.h> only if it exists,
[Define if you have a working <inttypes.h> header file.])
fi
-#
-# Determine if enumerated bitfields are unsigned. ISO C says they can
-# be either signed or unsigned.
-#
-AC_CACHE_CHECK(for unsigned enumerated bitfields, gcc_cv_enum_bf_unsigned,
-[AC_TRY_RUN(#include <stdlib.h>
-enum t { BLAH = 128 } ;
-struct s_t { enum t member : 8; } s ;
-int main(void)
-{
- s.member = BLAH;
- if (s.member < 0) exit(1);
- exit(0);
-
-}, gcc_cv_enum_bf_unsigned=yes, gcc_cv_enum_bf_unsigned=no, gcc_cv_enum_bf_unsigned=yes)])
-if test $gcc_cv_enum_bf_unsigned = yes; then
- AC_DEFINE(ENUM_BITFIELDS_ARE_UNSIGNED, 1,
- [Define if enumerated bitfields are treated as unsigned values.])
-fi
-
-AC_CHECK_FUNCS(strtoul bsearch putenv popen bcopy \
+dnl Disabled until we have a complete test for buggy enum bitfields.
+dnl gcc_AC_C_ENUM_BF_UNSIGNED
+
+AC_CHECK_FUNCS(strtoul bsearch popen times clock \
strchr strrchr kill getrlimit setrlimit atoll atoq \
sysconf isascii gettimeofday strsignal putc_unlocked fputc_unlocked \
- fputs_unlocked getrusage valloc iconv nl_langinfo)
+ fputs_unlocked getrusage nl_langinfo lstat)
AC_CHECK_TYPE(ssize_t, int)
AC_SUBST(TARGET_GETGROUPS_T)
gcc_AC_FUNC_VFPRINTF_DOPRNT
+gcc_AC_FUNC_STRSTR
gcc_AC_FUNC_PRINTF_PTR
case "${host}" in
*-*-uwin*)
- # Under some versions of uwin, vfork is notoriously buggy and the test
- # can hang configure; on other versions, vfork exists just as a stub.
- # FIXME: This should be removed once vfork in uwin's runtime is fixed.
- ac_cv_func_vfork_works=no
+ AC_MSG_ERROR([
+*** UWIN may not be used as a host platform because
+*** linking with posix.dll is not allowed by the GNU GPL])
;;
esac
AC_FUNC_VFORK
AC_FUNC_MMAP_ANYWHERE
AC_FUNC_MMAP_FILE
+AM_ICONV
+
# We will need to find libiberty.h and ansidecl.h
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"
-gcc_AC_CHECK_DECLS(bcopy \
- getenv atol sbrk abort atof getcwd getwd \
- strsignal putc_unlocked fputs_unlocked strstr environ \
- malloc realloc calloc free basename getopt, , ,[
-#include "gansidecl.h"
+gcc_AC_CHECK_DECLS(getenv atol sbrk abort atof getcwd getwd \
+ strsignal putc_unlocked fputs_unlocked strstr environ errno \
+ malloc realloc calloc free basename getopt clock, , ,[
+#include "ansidecl.h"
#include "system.h"])
gcc_AC_CHECK_DECLS(getrlimit setrlimit getrusage, , ,[
-#include "gansidecl.h"
+#include "ansidecl.h"
#include "system.h"
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
])
+gcc_AC_CHECK_DECLS(times, , ,[
+#include "ansidecl.h"
+#include "system.h"
+#ifdef HAVE_SYS_TIMES_H
+#include <sys/times.h>
+#endif
+])
+
+# More time-related stuff.
+AC_CACHE_CHECK(for struct tms, ac_cv_struct_tms, [
+AC_TRY_COMPILE([
+#include "ansidecl.h"
+#include "system.h"
+#ifdef HAVE_SYS_TIMES_H
+#include <sys/times.h>
+#endif
+], [struct tms tms;], ac_cv_struct_tms=yes, ac_cv_struct_tms=no)])
+if test $ac_cv_struct_tms = yes; then
+ AC_DEFINE(HAVE_STRUCT_TMS, 1,
+ [Define if <sys/times.h> defines struct tms.])
+fi
+
+# use gcc_cv_* here because this doesn't match the behavior of AC_CHECK_TYPE.
+# revisit after autoconf 2.50.
+AC_CACHE_CHECK(for clock_t, gcc_cv_type_clock_t, [
+AC_TRY_COMPILE([
+#include "ansidecl.h"
+#include "system.h"
+], [clock_t x;], gcc_cv_type_clock_t=yes, gcc_cv_type_clock_t=no)])
+if test $gcc_cv_type_clock_t = yes; then
+ AC_DEFINE(HAVE_CLOCK_T, 1,
+ [Define if <time.h> defines clock_t.])
+fi
+
# Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
CFLAGS="$saved_CFLAGS"
if test x"$extra_headers" = x
then extra_headers=; fi
-if test x"$xm_file" = x
-then xm_file=$cpu_type/xm-$cpu_type.h; fi
-
if test x$md_file = x
then md_file=$cpu_type/$cpu_type.md; fi
fi
# Say what files are being used for the output code and MD file.
-echo "Using \`$srcdir/config/$out_file' to output insns."
+echo "Using \`$srcdir/config/$out_file' for machine-specific logic."
echo "Using \`$srcdir/config/$md_file' as machine description file."
+# If any of the xm_file variables contain nonexistent files, warn
+# about them and drop them.
+
+bx=
+for x in $build_xm_file; do
+ if test -f $srcdir/config/$x
+ then bx="$bx $x"
+ else AC_MSG_WARN($srcdir/config/$x does not exist.)
+ fi
+done
+build_xm_file="$bx"
+
+hx=
+for x in $host_xm_file; do
+ if test -f $srcdir/config/$x
+ then hx="$hx $x"
+ else AC_MSG_WARN($srcdir/config/$x does not exist.)
+ fi
+done
+host_xm_file="$hx"
+
+tx=
+for x in $xm_file; do
+ if test -f $srcdir/config/$x
+ then tx="$tx $x"
+ else AC_MSG_WARN($srcdir/config/$x does not exist.)
+ fi
+done
+xm_file="$tx"
+
count=a
for f in $tm_file; do
count=${count}x
for f in $host_xm_file; do
count=${count}x
done
-if test $count = ax; then
+if test $count = a; then
+ :
+elif test $count = ax; then
echo "Using \`$srcdir/config/$host_xm_file' as host machine macro file."
else
echo "Using the following host machine macro files:"
for f in $build_xm_file; do
count=${count}x
done
- if test $count = ax; then
+ if test $count = a; then
+ :
+ elif test $count = ax; then
echo "Using \`$srcdir/config/$build_xm_file' as build machine macro file."
else
echo "Using the following build machine macro files:"
fi
fi
-# Set up the header files.
-# $links is the list of header files to create.
-# $vars is the list of shell variables with file names to include.
# auto-host.h is the file containing items generated by autoconf and is
# the first file included by config.h.
-null_defines=
-host_xm_file="auto-host.h gansidecl.h ${host_xm_file} hwint.h"
-
# If host=build, it is correct to have hconfig include auto-host.h
# as well. If host!=build, we are in error and need to do more
# work to find out the build config parameters.
if test x$host = x$build
then
- build_xm_file="auto-host.h gansidecl.h ${build_xm_file} hwint.h"
+ build_auto=auto-host.h
else
# We create a subdir, then run autoconf in the subdir.
# To prevent recursion we set host and build for the new
mkdir $tempdir
cd $tempdir
case ${srcdir} in
- /*) realsrcdir=${srcdir};;
+ /* | [A-Za-z]:[\\/]* ) realsrcdir=${srcdir};;
*) realsrcdir=../${srcdir};;
esac
- CC=${CC_FOR_BUILD} ${realsrcdir}/configure \
+ saved_CFLAGS="${CFLAGS}"
+ CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
+ ${realsrcdir}/configure \
--target=$target --host=$build --build=$build
+ CFLAGS="${saved_CFLAGS}"
# We just finished tests for the build machine, so rename
# the file auto-build.h in the gcc directory.
mv auto-host.h ../auto-build.h
cd ..
rm -rf $tempdir
- build_xm_file="auto-build.h gansidecl.h ${build_xm_file} hwint.h"
+ build_auto=auto-build.h
fi
-xm_file="gansidecl.h ${xm_file}"
-tm_file="gansidecl.h ${tm_file}"
-
-vars="host_xm_file tm_file tm_p_file xm_file build_xm_file"
-links="config.h tm.h tm_p.h tconfig.h hconfig.h"
-defines="host_xm_defines null_defines null_defines xm_defines build_xm_defines"
-
-rm -f config.bak
-if test -f config.status; then mv -f config.status config.bak; fi
-
-# Make the links.
-while test -n "$vars"
-do
- set $vars; var=$1; shift; vars=$*
- set $links; link=$1; shift; links=$*
- set $defines; define=$1; shift; defines=$*
-
- rm -f $link
- # Make sure the file is created, even if it is empty.
- echo >$link
-
- # Define TARGET_CPU_DEFAULT if the system wants one.
- # This substitutes for lots of *.h files.
- if test "$target_cpu_default" != "" -a $link = tm.h
- then
- echo "#define TARGET_CPU_DEFAULT ($target_cpu_default)" >>$link
- fi
- if test $link = tm.h
- then
- echo "#ifndef GENERATOR_FILE" >>$link
- echo "#include \"insn-codes.h\"" >>$link
- echo "#endif" >>$link
- fi
-
- for file in `eval echo '$'$var`; do
- case $file in
- auto-host.h | auto-build.h )
- ;;
- *)
- echo '#ifdef IN_GCC' >>$link
- ;;
- esac
- echo "#include \"$file\"" >>$link
- case $file in
- auto-host.h | auto-build.h )
- ;;
- *)
- echo '#endif' >>$link
- ;;
- esac
- done
-
- for def in `eval echo '$'$define`; do
- echo "#ifndef $def" >>$link
- echo "#define $def" >>$link
- echo "#endif" >>$link
- done
-done
+tm_file="${tm_file} defaults.h"
+host_xm_file="auto-host.h ansidecl.h ${host_xm_file} ${tm_file}"
+build_xm_file="${build_auto} ansidecl.h ${build_xm_file} ${tm_file}"
+xm_file="ansidecl.h ${xm_file} ${tm_file}"
# Truncate the target if necessary
if test x$host_truncate_target != x; then
gcc_version_trigger=${srcdir}/version.c
fi
changequote(,)dnl
-gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
+gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'`
gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
# Compile in configure arguments.
if test -f configargs.h ; then
# Being re-configured.
- gcc_config_arguments=`grep configuration_arguments configargs.h | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
+ gcc_config_arguments=`grep configuration_arguments configargs.h | sed -e 's/.*"\([^"]*\)".*/\1/'`
gcc_config_arguments="$gcc_config_arguments : (reconfigured) $TOPLEVEL_CONFIGURE_ARGUMENTS"
else
gcc_config_arguments="$TOPLEVEL_CONFIGURE_ARGUMENTS"
cat > configargs.h <<EOF
/* Generated automatically. */
static const char configuration_arguments[] = "$gcc_config_arguments";
+static const char thread_model[] = "$thread_file";
EOF
changequote([,])dnl
# Windows32 Registry support for specifying GCC installation paths.
AC_ARG_ENABLE(win32-registry,
[ --disable-win32-registry
- Disable lookup of installation paths in the
- Registry on Windows hosts.
- --enable-win32-registry Enable registry lookup (default).
+ disable lookup of installation paths in the
+ Registry on Windows hosts
+ --enable-win32-registry enable registry lookup (default)
--enable-win32-registry=KEY
- Use KEY instead of GCC version as the last portion
- of the 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
+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
# Check if user specified a different registry key.
-case x${enable_win32_registry} in
+case "x${enable_win32_registry}" in
x | xyes)
# default.
gcc_cv_win32_registry_key="$VERSION"
;;
esac
-if test x$enable_win32_registry != xno; then
+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=`pwd`
tm_file_list=
for f in $tm_file; do
case $f in
- gansidecl.h )
+ ansidecl.h )
+ tm_file_list="${tm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
+ defaults.h )
tm_file_list="${tm_file_list} $f" ;;
*) tm_file_list="${tm_file_list} \$(srcdir)/config/$f" ;;
esac
done
+tm_p_file_list=
+for f in $tm_p_file; do
+ tm_p_file_list="${tm_p_file_list} \$(srcdir)/config/$f"
+done
+
host_xm_file_list=
for f in $host_xm_file; do
case $f in
- auto-host.h | gansidecl.h | hwint.h )
+ ansidecl.h )
+ host_xm_file_list="${host_xm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
+ auto-host.h | defaults.h )
host_xm_file_list="${host_xm_file_list} $f" ;;
*) host_xm_file_list="${host_xm_file_list} \$(srcdir)/config/$f" ;;
esac
build_xm_file_list=
for f in $build_xm_file; do
case $f in
- auto-build.h | auto-host.h | gansidecl.h | hwint.h )
+ ansidecl.h )
+ build_xm_file_list="${build_xm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
+ auto-build.h | auto-host.h | defaults.h )
build_xm_file_list="${build_xm_file_list} $f" ;;
*) build_xm_file_list="${build_xm_file_list} \$(srcdir)/config/$f" ;;
esac
# have its own set of headers then define
# inhibit_libc
-# If this is using newlib, then define inhibit_libc in
-# LIBGCC2_CFLAGS. This will cause __eprintf to be left out of
-# libgcc.a, but that's OK because newlib should have its own version of
-# assert.h.
+# If this is using newlib, then define inhibit_libc in LIBGCC2_CFLAGS.
+# This prevents libgcc2 from containing any code which requires libc
+# support.
inhibit_libc=
if [test x$host != x$target] && [test x$with_headers = x]; then
inhibit_libc=-Dinhibit_libc
# If the loop below does not find an assembler, then use whatever
# one we can find in the users's path.
# user's path.
- as=as$host_exeext
+ gcc_cv_as=as$host_exeext
test_dirs="$test_prefix/lib/gcc-lib/$target/$gcc_version \
$test_prefix/lib/gcc-lib/$target \
fi
AC_MSG_RESULT($gcc_cv_as_hidden)
+AC_MSG_CHECKING(assembler leb128 support)
+gcc_cv_as_leb128=no
+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 11 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
+ gcc_cv_as_leb128="yes"
+ fi
+elif test x$gcc_cv_as != x; then
+ # Check if we have .[us]leb128, and support symbol arithmetic with it.
+ cat > conftest.s <<EOF
+ .data
+ .uleb128 L2 - L1
+L1:
+ .uleb128 1280
+ .sleb128 -1010
+L2:
+EOF
+ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
+ gcc_cv_as_leb128="yes"
+
+ # GAS versions before 2.11 do not support uleb128,
+ # despite appearing to.
+ # ??? There exists an elf-specific test that will crash
+ # the assembler. Perhaps it's better to figure out whether
+ # arbitrary sections are supported and try the test.
+ as_ver=`$gcc_cv_as --version 2>/dev/null | head -1`
+ if echo "$as_ver" | grep GNU > /dev/null; then
+ as_ver=`echo $as_ver | sed -e 's/.* //'`
+ as_major=`echo $as_ver | sed 's/\..*//'`
+changequote(,)dnl
+ as_minor=`echo $as_ver | sed 's/[^.]*\.\([0-9]*\).*/\1/'`
+changequote([,])dnl
+ if test $as_major -eq 2 -a $as_minor -lt 11; then
+ gcc_cv_as_leb128="no"
+ fi
+ fi
+ fi
+ rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
+fi
+if test x"$gcc_cv_as_leb128" = xyes; then
+ AC_DEFINE(HAVE_AS_LEB128, 1,
+ [Define if your assembler supports .uleb128.])
+fi
+AC_MSG_RESULT($gcc_cv_as_leb128)
+
+AC_MSG_CHECKING(assembler eh_frame optimization)
+gcc_cv_as_eh_frame=no
+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 12 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
+ gcc_cv_as_eh_frame="yes"
+ fi
+elif test x$gcc_cv_as != x; then
+ # Check if this is GAS.
+ as_ver=`$gcc_cv_as --version < /dev/null 2> /dev/null | head -1`
+ rm -f a.out 2> /dev/null
+ if echo "$as_ver" | grep GNU > /dev/null; then
+ # Versions up to and including 2.11.0 may mis-optimize
+ # .eh_frame data. Try something.
+ cat > conftest.s <<EOF
+ .text
+.LFB1:
+ .4byte 0
+.L1:
+ .4byte 0
+.LFE1:
+ .section .eh_frame,"aw",@progbits
+__FRAME_BEGIN__:
+ .4byte .LECIE1-.LSCIE1
+.LSCIE1:
+ .4byte 0x0
+ .byte 0x1
+ .ascii "z\0"
+ .byte 0x1
+ .byte 0x78
+ .byte 0x1a
+ .byte 0x0
+ .byte 0x4
+ .4byte 1
+ .p2align 1
+.LECIE1:
+.LSFDE1:
+ .4byte .LEFDE1-.LASFDE1
+.LASFDE1:
+ .4byte .LASFDE1-__FRAME_BEGIN__
+ .4byte .LFB1
+ .4byte .LFE1-.LFB1
+ .byte 0x4
+ .4byte .LFE1-.LFB1
+ .byte 0x4
+ .4byte .L1-.LFB1
+.LEFDE1:
+EOF
+ cat > conftest.lit <<EOF
+ 0000 10000000 00000000 017a0001 781a0004 .........z..x...
+ 0010 01000000 12000000 18000000 00000000 ................
+ 0020 08000000 04080000 0044 .........D
+EOF
+ cat > conftest.big <<EOF
+ 0000 00000010 00000000 017a0001 781a0004 .........z..x...
+ 0010 00000001 00000012 00000018 00000000 ................
+ 0020 00000008 04000000 0844 .........D
+EOF
+ # If the assembler didn't choke, and we can objdump,
+ # and we got the correct data, then succeed.
+ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
+ && objdump -s -j .eh_frame conftest.o 2>/dev/null \
+ | tail -3 > conftest.got \
+ && { cmp conftest.lit conftest.got > /dev/null 2>&1 \
+ || cmp conftest.big conftest.got > /dev/null 2>&1; }
+ then
+ gcc_cv_as_eh_frame="yes"
+ else
+ gcc_cv_as_eh_frame="bad"
+ if $gcc_cv_as -o conftest.o --traditional-format /dev/null; then
+ AC_DEFINE(USE_AS_TRADITIONAL_FORMAT, 1,
+ [Define if your assembler mis-optimizes .eh_frame data.])
+ fi
+ fi
+ fi
+ rm -f conftest.*
+fi
+AC_MSG_RESULT($gcc_cv_as_eh_frame)
+
case "$target" in
sparc*-*-*)
AC_CACHE_CHECK([assembler .register pseudo-op support],
[Define if your assembler supports offsetable %lo().])
fi
fi
+
;;
changequote(,)dnl
# ??? Once 2.11 is released, probably need to add first known working
# version to the per-target configury.
case "$target" in
- i?86*-*-* | mips*-*-* | alpha*-*-* | sparc*-*-*)
+ i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-*)
insn="nop"
;;
ia64*-*-*)
gcc_cv_as_dwarf2_debug_line="yes"
fi
elif test x$gcc_cv_as != x -a x"$insn" != x ; then
- echo ' .file 0 "conftest.s"' > conftest.s
- echo ' .loc 0 3 0' >> conftest.s
+ echo ' .file 1 "conftest.s"' > conftest.s
+ echo ' .loc 1 3 0' >> conftest.s
echo " $insn" >> conftest.s
+ # ??? This fails with non-gnu grep.
if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
&& grep debug_line conftest.o > /dev/null 2>&1 ; then
- gcc_cv_as_dwarf2_debug_line="yes"
+ # The .debug_line file table must be in the exact order that
+ # we specified the files, since these indicies are also used
+ # by DW_AT_decl_file. Approximate this test by testing if
+ # the assembler bitches if the same index is assigned twice.
+ echo ' .file 1 "foo.s"' > conftest.s
+ echo ' .file 1 "bar.s"' >> conftest.s
+ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1
+ then
+ gcc_cv_as_dwarf2_debug_line="no"
+ else
+ gcc_cv_as_dwarf2_debug_line="yes"
+ fi
fi
rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
fi
if test x"$gcc_cv_as_dwarf2_debug_line" = xyes; then
AC_DEFINE(HAVE_AS_DWARF2_DEBUG_LINE, 1,
- [Define if your assembler supports dwarf2 .file/.loc directives.])
+[Define if your assembler supports dwarf2 .file/.loc directives,
+ and preserves file table indicies exactly as given.])
fi
AC_MSG_RESULT($gcc_cv_as_dwarf2_debug_line)
AC_MSG_ERROR([--enable-languages needs at least one argument])
fi
fi
+
+# First scan to see if an enabled language requires some other language.
+# We assume that a given config-lang.in will list all the language
+# front ends it requires, even if some are required indirectly.
+for lang in ${srcdir}/*/config-lang.in ..
+do
+ case $lang in
+ ..)
+ ;;
+ # The odd quoting in the next line works around
+ # an apparent bug in bash 1.12 on linux.
+changequote(,)dnl
+ ${srcdir}/[*]/config-lang.in)
+ ;;
+ *)
+ lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
+ this_lang_requires=`sed -n -e 's,^lang_requires=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_requires=\([^ ]*\).*$,\1,p' $lang`
+ for other in $this_lang_requires
+ do
+ case ,${enable_languages}, in
+ *,$other,*)
+ ;;
+ *,all,*)
+ ;;
+ *,$lang_alias,*)
+ enable_languages="$enable_languages,$other"
+ ;;
+ esac
+ done
+ ;;
+changequote([,])dnl
+ esac
+done
+
subdirs=
for lang in ${srcdir}/*/config-lang.in ..
do
${srcdir}/[*]/config-lang.in) ;;
*)
lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
+ this_lang_libs=`sed -n -e 's,^target_libs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^target_libs=\([^ ]*\).*$,\1,p' $lang`
+ build_by_default=`sed -n -e 's,^build_by_default=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^build_by_default=\([^ ]*\).*$,\1,p' $lang`
if test "x$lang_alias" = x
then
echo "$lang doesn't set \$language." 1>&2
exit 1
fi
- if test x"${enable_languages}" = xall && test x"${lang_alias}" != xCHILL; then
- add_this_lang=yes
- else
- case "${enable_languages}" in
- ${lang_alias} | "${lang_alias},"* | *",${lang_alias},"* | *",${lang_alias}" )
- add_this_lang=yes
- ;;
- * )
- add_this_lang=no
- ;;
- esac
- fi
+ case ${build_by_default},${enable_languages}, in
+ *,$lang_alias,*) add_this_lang=yes ;;
+ no,*) add_this_lang=no ;;
+ *,all,*) add_this_lang=yes ;;
+ *) add_this_lang=no ;;
+ esac
if test x"${add_this_lang}" = xyes; then
case $lang in
${srcdir}/ada/config-lang.in)
- if test x$gnat = xyes ; then
+ if test x$have_gnat = xyes ; then
subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`"
fi
;;
# Find out what GC implementation we want, or may, use.
AC_ARG_WITH(gc,
-[ --with-gc={simple,page} Choose the garbage collection mechanism to use
- with the compiler.],
+[ --with-gc={simple,page} choose the garbage collection mechanism to use
+ with the compiler],
[case "$withval" in
simple | page)
GGC=ggc-$withval
AC_MSG_ERROR([$withval is an invalid option to --with-gc])
;;
esac],
-[if test $ac_cv_func_mmap_anywhere = yes \
- || test $ac_cv_func_valloc = yes; then
- GGC=ggc-page
-else
- GGC=ggc-simple
-fi])
+[GGC=ggc-page])
AC_SUBST(GGC)
echo "Using $GGC for garbage collection."
AC_SUBST(zlibdir)
AC_SUBST(zlibinc)
-# Build a new-abi (c++) system
-AC_ARG_ENABLE(new-gxx-abi,
-[ --enable-new-gxx-abi
- select the new abi for g++. You must select an ABI
- at configuration time, so that the correct runtime
- support is built. You cannot mix ABIs.],
- ,
- enable_new_gxx_abi=yes)
-
-if test x$enable_new_gxx_abi = xyes; then
- AC_DEFINE(ENABLE_NEW_GXX_ABI, 1,
- [Define if you want to always select the new-abi for g++.])
- GXX_ABI_FLAG='-fnew-abi'
-else
- GXX_ABI_FLAG=
-fi
-AC_SUBST(GXX_ABI_FLAG)
-
-AC_DEFINE_UNQUOTED(ENABLE_STD_NAMESPACE, $ac_esn,
- [Define to 1 if you want to enable namespaces (-fhonor-std) by default.])
-AC_SUBST(HAVE_LIBSTDCXX_V3)
-
dnl Very limited version of automake's enable-maintainer-mode
AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode is disabled by default
AC_ARG_ENABLE(maintainer-mode,
-[ --enable-maintainer-mode enable make rules and dependencies not useful
+[ --enable-maintainer-mode
+ enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer],
maintainer_mode=$enableval,
maintainer_mode=no)
fi
AC_SUBST(MAINT)dnl
+# With Setjmp/Longjmp based exception handling.
+AC_ARG_ENABLE(sjlj-exceptions,
+[ --enable-sjlj-exceptions
+ arrange to use setjmp/longjmp exception handling],
+[sjlj=`if test $enableval = yes; then echo 1; else echo 0; fi`
+AC_DEFINE_UNQUOTED(CONFIG_SJLJ_EXCEPTIONS, $sjlj,
+ [Define 0/1 to force the choice for exception handling model.])])
+
# Make empty files to contain the specs and options for each language.
# Then add #include lines to for a compiler that has specs and/or options.
fi
done
+check_languages=
+for language in .. $all_languages
+do
+ if test $language != ".."
+ then
+ check_languages="$check_languages check-$language"
+ fi
+done
+
# Since we can't use `::' targets, we link each language in
# with a set of hooks, reached indirectly via lang.${target}.
echo "lang.$t: $x" >> Make-hooks
done
-# If we're not building in srcdir, create .gdbinit.
+# Create .gdbinit.
-if test ! -f Makefile.in; then
- echo "dir ." > .gdbinit
- echo "dir ${srcdir}" >> .gdbinit
- if test x$gdb_needs_out_file_path = xyes
- then
- echo "dir ${srcdir}/config/"`dirname ${out_file}` >> .gdbinit
- fi
- if test "x$subdirs" != x; then
- for s in $subdirs
- do
- echo "dir ${srcdir}/$s" >> .gdbinit
- done
- fi
- echo "source ${srcdir}/.gdbinit" >> .gdbinit
+echo "dir ." > .gdbinit
+echo "dir ${srcdir}" >> .gdbinit
+if test x$gdb_needs_out_file_path = xyes
+then
+ echo "dir ${srcdir}/config/"`dirname ${out_file}` >> .gdbinit
fi
+if test "x$subdirs" != x; then
+ for s in $subdirs
+ do
+ echo "dir ${srcdir}/$s" >> .gdbinit
+ done
+fi
+echo "source ${srcdir}/gdbinit.in" >> .gdbinit
# Define variables host_canonical and build_canonical
# because some Cygnus local changes in the Makefile depend on them.
host_canonical=${host}
target_subdir=
if test "${host}" != "${target}" ; then
- target_subdir=${target}/
+ target_subdir=${target_alias}/
fi
AC_SUBST(build_canonical)
AC_SUBST(host_canonical)
AC_SUBST(gcc_tooldir)
AC_SUBST(dollar)
+# Find a directory in which to install a shared libgcc.
+
+AC_ARG_ENABLE(version-specific-runtime-libs,
+[ --enable-version-specific-runtime-libs
+ specify that runtime libraries should be
+ installed in a compiler-specific directory])
+
+AC_ARG_WITH(slibdir,
+[ --with-slibdir=DIR shared libraries in DIR [LIBDIR]],
+slibdir="$with_slibdir",
+if test "${enable_version_specific_runtime_libs+set}" = set; then
+ slibdir='$(libsubdir)'
+elif test "$host" != "$target"; then
+ slibdir='$(build_tooldir)/lib'
+else
+ slibdir='$(libdir)'
+fi)
+AC_SUBST(slibdir)
+
# Nothing to do for FLOAT_H, float_format already handled.
objdir=`pwd`
AC_SUBST(objdir)
AC_SUBST(build_exeext)
AC_SUBST(build_install_headers_dir)
AC_SUBST(build_xm_file_list)
+AC_SUBST(build_xm_file)
+AC_SUBST(build_xm_defines)
+AC_SUBST(check_languages)
AC_SUBST(cc_set_by_configure)
AC_SUBST(quoted_cc_set_by_configure)
AC_SUBST(cpp_install_dir)
AC_SUBST(float_h_file)
AC_SUBST(gcc_config_arguments)
AC_SUBST(gcc_gxx_include_dir)
+AC_SUBST(libstdcxx_incdir)
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_file)
+AC_SUBST(host_xm_defines)
AC_SUBST(install)
AC_SUBST(lang_options_files)
AC_SUBST(lang_specs_files)
AC_SUBST(symbolic_link)
AC_SUBST(thread_file)
AC_SUBST(tm_file_list)
+AC_SUBST(tm_file)
+AC_SUBST(tm_p_file_list)
+AC_SUBST(tm_p_file)
+AC_SUBST(xm_file)
+AC_SUBST(xm_defines)
AC_SUBST(will_use_collect2)
AC_SUBST(c_target_objs)
AC_SUBST(cxx_target_objs)
-
+AC_SUBST(target_cpu_default)
AC_SUBST_FILE(target_overrides)
AC_SUBST_FILE(host_overrides)