# Initialization and sanity checks
# --------------------------------
-AC_PREREQ(2.59)
+AC_PREREQ(2.64)
AC_INIT
AC_CONFIG_SRCDIR(tree.c)
AC_CONFIG_HEADER(auto-host.h:config.in)
# Find the native compiler
AC_PROG_CC
AM_PROG_CC_C_O
+AC_PROG_CXX
ACX_PROG_GNAT([-I"$srcdir"/ada])
# autoconf is lame and doesn't give us any substitution variable for this.
AC_CHECK_SIZEOF(long)
AC_CHECK_TYPES([long long], [AC_CHECK_SIZEOF(long long)])
AC_CHECK_TYPES([__int64], [AC_CHECK_SIZEOF(__int64)])
+GCC_STDINT_TYPES
# ---------------------
# Warnings and checking
# So, we only use -pedantic if we can disable those warnings.
ACX_PROG_CC_WARNING_OPTS(
- m4_quote(m4_do([-W -Wall -Wwrite-strings -Wstrict-prototypes ],
- [-Wmissing-prototypes -Wcast-qual])), [loose_warn])
+ m4_quote(m4_do([-W -Wall -Wwrite-strings -Wcast-qual])), [loose_warn])
ACX_PROG_CC_WARNING_OPTS(
- m4_quote(m4_do([-Wold-style-definition -Wc++-compat ],
- [-Wmissing-format-attribute])), [strict_warn])
+ m4_quote(m4_do([-Wstrict-prototypes -Wmissing-prototypes])),
+ [c_loose_warn])
+ACX_PROG_CC_WARNING_OPTS(
+ m4_quote(m4_do([-Wmissing-format-attribute])), [strict_warn])
+ACX_PROG_CC_WARNING_OPTS(
+ m4_quote(m4_do([-Wold-style-definition -Wc++-compat])), [c_strict_warn])
ACX_PROG_CC_WARNING_ALMOST_PEDANTIC(
m4_quote(m4_do([-Wno-long-long -Wno-variadic-macros ],
[-Wno-overlength-strings])), [strict_warn])
ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual], [strict_warn])
# The above macros do nothing if the compiler is not GCC. However, the
-# Makefile has more goo to add other flags, so this variabl is used to
-# enables warnings only for GCC.
+# Makefile has more goo to add other flags, so these variables are used
+# to enable warnings only for GCC.
warn_cflags=
+warn_cxxflags=
if test "x$GCC" = "xyes"; then
warn_cflags='$(GCC_WARN_CFLAGS)'
+ warn_cxxflags='$(GCC_WARN_CXXFLAGS)'
fi
AC_SUBST(warn_cflags)
+AC_SUBST(warn_cxxflags)
# Enable expensive internal checks
is_release=
# Miscenalleous configure options
# -------------------------------
+# See if we are building gcc with C++.
+AC_ARG_ENABLE(build-with-cxx,
+[ --enable-build-with-cxx build with C++ compiler instead of C compiler],
+ENABLE_BUILD_WITH_CXX=$enableval,
+ENABLE_BUILD_WITH_CXX=no)
+AC_SUBST(ENABLE_BUILD_WITH_CXX)
+
# With stabs
AC_ARG_WITH(stabs,
[ --with-stabs arrange to use stabs instead of host debug format],
esac],
[enable_languages=c])
-# Used by documentation targets
-AC_SUBST(datarootdir)
-AC_SUBST(docdir)
-AC_SUBST(htmldir)
+AC_ARG_WITH(multilib-list,
+[ --with-multilib-list Select multilibs (SH only)],
+:,
+with_multilib_list=default)
# -------------------------
# Checks for other programs
EOF
changequote([,])dnl
+changequote(,)dnl
+gcc_BASEVER=`cat $srcdir/BASE-VER`
+gcc_DEVPHASE=`cat $srcdir/DEV-PHASE`
+gcc_DATESTAMP=`cat $srcdir/DATESTAMP`
+if test -f $srcdir/REVISION ; then
+ gcc_REVISION=`cat $srcdir/REVISION`
+else
+ gcc_REVISION=""
+fi
+cat > plugin-version.h <<EOF
+#include "configargs.h"
+
+static char basever[] = "$gcc_BASEVER";
+static char datestamp[] = "$gcc_DATESTAMP";
+static char devphase[] = "$gcc_DEVPHASE";
+static char revision[] = "$gcc_REVISION";
+
+/* FIXME plugins: We should make the version information more precise.
+ One way to do is to add a checksum. */
+
+static struct plugin_gcc_version gcc_version = {basever, datestamp,
+ devphase, revision,
+ configuration_arguments};
+EOF
+changequote([,])dnl
+
# Internationalization
ZW_GNU_GETTEXT_SISTER_DIR
[elf,2,16,0], [--fatal-warnings],
[.section .text,"axG",%progbits,.foo,comdat])
fi
-if test $in_tree_ld != yes && test x"$ld_vers" != x; then
+if test $in_tree_ld = yes ; then
+ comdat_group=no
+ 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
+ comdat_group=yes
+ fi
+elif test x"$ld_vers" != x; then
comdat_group=yes
if test 0"$ld_date" -lt 20050308; then
if test -n "$ld_date"; then
[`if test $gcc_cv_as_comdat_group = yes || test $gcc_cv_as_comdat_group_percent = yes; then echo 1; else echo 0; fi`],
[Define 0/1 if your assembler and linker support COMDAT groups.])
+gcc_GAS_CHECK_FEATURE([line table discriminator support],
+ gcc_cv_as_discriminator,
+ [2,19,51],,
+[ .text
+ .file 1 "conf.c"
+ .loc 1 1 0 discriminator 1],,
+[AC_DEFINE(HAVE_GAS_DISCRIMINATOR, 1,
+ [Define if your assembler supports the .loc discriminator sub-directive.])])
+
# Thread-local storage - the check is heavily parameterized.
conftest_s=
tls_first_major=
tls_first_minor=16
tls_as_opt='-32 --fatal-warnings'
;;
+ m68k-*-*)
+ conftest_s='
+ .section .tdata,"awT",@progbits
+x:
+ .word 2
+ .text
+foo:
+ move.l x@TLSGD(%a5),%a0
+ move.l x@TLSLDM(%a5),%a0
+ move.l x@TLSLDO(%a5),%a0
+ move.l x@TLSIE(%a5),%a0
+ move.l x@TLSLE(%a5),%a0'
+ tls_first_major=2
+ tls_first_minor=19
+ tls_as_opt='--fatal-warnings'
+ ;;
powerpc-*-*)
conftest_s='
.section ".tdata","awT",@progbits
changequote([,])dnl
case $target_os in
cygwin* | pe | mingw32*)
+ # Recent binutils allows the three-operand form of ".comm" on PE. This
+ # definition is used unconditionally to initialise the default state of
+ # the target option variable that governs usage of the feature.
+ gcc_GAS_CHECK_FEATURE([.comm with alignment], gcc_cv_as_comm_has_align,
+ [2,19,52],,[.comm foo,1,32])
+ AC_DEFINE_UNQUOTED(HAVE_GAS_ALIGNED_COMM,
+ [`if test $gcc_cv_as_comm_has_align = yes; then echo 1; else echo 0; fi`],
+ [Define if your assembler supports specifying the alignment
+ of objects allocated using the GAS .comm command.])
# Used for DWARF 2 in PE
gcc_GAS_CHECK_FEATURE([.secrel32 relocs],
gcc_cv_as_ix86_pe_secrel32,
esac
gcc_GAS_CHECK_FEATURE([filds and fists mnemonics],
- gcc_cv_as_ix86_filds_fists,
- [2,9,0],, [filds mem; fists mem],,
- [AC_DEFINE(HAVE_GAS_FILDS_FISTS, 1,
- [Define if your assembler uses the new HImode fild and fist notation.])])
+ gcc_cv_as_ix86_filds,,,
+ [filds mem; fists mem],,
+ [AC_DEFINE(HAVE_AS_IX86_FILDS, 1,
+ [Define if your assembler uses filds and fists mnemonics.])])
+
+ gcc_GAS_CHECK_FEATURE([fildq and fistpq mnemonics],
+ gcc_cv_as_ix86_fildq,,,
+ [fildq mem; fistpq mem],,
+ [AC_DEFINE(HAVE_AS_IX86_FILDQ, 1,
+ [Define if your assembler uses fildq and fistq mnemonics.])])
gcc_GAS_CHECK_FEATURE([cmov syntax],
gcc_cv_as_ix86_cmov_sun_syntax,,,
esac
gcc_GAS_CHECK_FEATURE([move fp gpr support],
- gcc_cv_as_powerpc_mfpgpr, [9,99,0],,
+ gcc_cv_as_powerpc_mfpgpr, [2,19,2],,
[$conftest_s],,
[AC_DEFINE(HAVE_AS_MFPGPR, 1,
[Define if your assembler supports mffgpr and mftgpr.])])
esac
gcc_GAS_CHECK_FEATURE([compare bytes support],
- gcc_cv_as_powerpc_cmpb, [9,99,0], -a32,
+ gcc_cv_as_powerpc_cmpb, [2,19,2], -a32,
[$conftest_s],,
[AC_DEFINE(HAVE_AS_CMPB, 1,
[Define if your assembler supports cmpb.])])
esac
gcc_GAS_CHECK_FEATURE([decimal float support],
- gcc_cv_as_powerpc_dfp, [9,99,0], -a32,
+ gcc_cv_as_powerpc_dfp, [2,19,2], -a32,
[$conftest_s],,
[AC_DEFINE(HAVE_AS_DFP, 1,
[Define if your assembler supports DFP instructions.])])
esac
gcc_GAS_CHECK_FEATURE([vector-scalar support],
- gcc_cv_as_powerpc_vsx, [9,99,0], -a32,
+ gcc_cv_as_powerpc_vsx, [2,19,2], -a32,
[$conftest_s],,
[AC_DEFINE(HAVE_AS_VSX, 1,
[Define if your assembler supports VSX instructions.])])
+ case $target in
+ *-*-aix*) conftest_s=' .machine "pwr7"
+ .csect .text[[PR]]
+ popcntd 3,3';;
+ *) conftest_s=' .machine power7
+ .text
+ popcntd 3,3';;
+ esac
+
+ gcc_GAS_CHECK_FEATURE([popcntd support],
+ gcc_cv_as_powerpc_popcntd, [2,19,2], -a32,
+ [$conftest_s],,
+ [AC_DEFINE(HAVE_AS_POPCNTD, 1,
+ [Define if your assembler supports POPCNTD instructions.])])
+
+ case $target in
+ *-*-aix*) conftest_s=' .csect .text[[PR]]
+ lwsync';;
+ *) conftest_s=' .text
+ lwsync';;
+ esac
+
+ gcc_GAS_CHECK_FEATURE([lwsync support],
+ gcc_cv_as_powerpc_lwsync, [2,19,2], -a32,
+ [$conftest_s],,
+ [AC_DEFINE(HAVE_AS_LWSYNC, 1,
+ [Define if your assembler supports LWSYNC instructions.])])
+
gcc_GAS_CHECK_FEATURE([.gnu_attribute support],
gcc_cv_as_powerpc_gnu_attribute, [2,18,0],,
[.gnu_attribute 4,1],,
[AC_DEFINE(HAVE_GAS_LCOMM_WITH_ALIGNMENT, 1,
[Define if your assembler supports .lcomm with an alignment field.])])
+AC_ARG_ENABLE(gnu-unique-object,
+ [ --enable-gnu-unique-object enable the use of the @gnu_unique_object ELF extension on
+ glibc systems],
+ [case $enable_gnu_unique_object in
+ yes | no) ;;
+ *) AC_MSG_ERROR(['$enable_gnu_unique_object' is an invalid value for --enable-gnu-unique-object.
+Valid choices are 'yes' and 'no'.]) ;;
+ esac],
+ [gcc_GAS_CHECK_FEATURE([gnu_unique_object], gcc_cv_as_gnu_unique_object,
+ [elf,2,19,52],,
+ [.type foo, @gnu_unique_object],,
+# Also check for ld.so support, i.e. glibc 2.11 or higher.
+ [if test x$host = x$build -a x$host = x$target &&
+ glibcver=`ldd --version 2>/dev/null`; then
+ glibcmajor=`expr "$glibcver" : "ldd (GNU libc) \([[0-9]]*\)"`
+ glibcminor=`expr "$glibcver" : "ldd (GNU libc) [[0-9]]*\.\([[0-9]]*\)"`
+ glibcnum=`expr $glibcmajor \* 1000 + $glibcminor`
+ if test "$glibcnum" -ge 2011 ; then
+ enable_gnu_unique_object=yes
+ fi
+ fi])])
+if test x$enable_gnu_unique_object = xyes; then
+ AC_DEFINE(HAVE_GAS_GNU_UNIQUE_OBJECT, 1,
+ [Define if your assembler supports @gnu_unique_object.])
+fi
+
AC_CACHE_CHECK([assembler for tolerance to line number 0],
[gcc_cv_as_line_zero],
[gcc_cv_as_line_zero=no
;;
esac
+AC_CACHE_CHECK(linker --build-id support,
+ gcc_cv_ld_buildid,
+ [gcc_cv_ld_buildid=no
+ if test $in_tree_ld = yes ; then
+ if test "$gcc_cv_gld_major_version" -eq 2 -a \
+ "$gcc_cv_gld_minor_version" -ge 18 -o \
+ "$gcc_cv_gld_major_version" -gt 2 \
+ && test $in_tree_ld_is_elf = yes; then
+ gcc_cv_ld_buildid=yes
+ fi
+ elif test x$gcc_cv_ld != x; then
+ if $gcc_cv_ld --help 2>/dev/null | grep build-id > /dev/null; then
+ gcc_cv_ld_buildid=yes
+ fi
+ fi])
+if test x"$gcc_cv_ld_buildid" = xyes; then
+ AC_DEFINE(HAVE_LD_BUILDID, 1,
+ [Define if your linker supports --build-id.])
+fi
+
+AC_ARG_ENABLE(linker-build-id,
+[ --enable-linker-build-id
+ compiler will always pass --build-id to linker],
+[],
+enable_linker_build_id=no)
+
+if test x"$enable_linker_build_id" = xyes; then
+ if test x"$gcc_cv_ld_buildid" = xyes; then
+ AC_DEFINE(ENABLE_LD_BUILDID, 1,
+ [Define if gcc should always pass --build-id to linker.])
+ else
+ AC_MSG_WARN(--build-id is not supported by your linker; --enable-linker-build-id ignored)
+ fi
+fi
+
AC_CACHE_CHECK(linker --sysroot support,
gcc_cv_ld_sysroot,
[gcc_cv_ld_sysroot=no
# simply assert that glibc does provide this, which is true for all
# realistically usable GNU/Hurd configurations.
gcc_cv_libc_provides_ssp=yes;;
- *-*-darwin*)
+ *-*-darwin* | *-*-freebsd*)
AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes],
[echo "no __stack_chk_fail on this target"])
;;
AC_SUBST(GGC)
echo "Using $GGC for garbage collection."
+# Libraries to use on the host. This will normally be set by the top
+# level Makefile. Here we simply capture the value for our Makefile.
+if test -z "${HOST_LIBS+set}"; then
+ HOST_LIBS=
+fi
+AC_SUBST(HOST_LIBS)
+
# Use the system's zlib library.
zlibdir=-L../zlib
zlibinc="-I\$(srcdir)/../zlib"
target_list="all.cross start.encap rest.encap tags \
install-common install-man install-info install-pdf dvi pdf \
html uninstall info man srcextra srcman srcinfo \
- mostlyclean clean distclean maintainer-clean"
+ mostlyclean clean distclean maintainer-clean install-plugin"
for t in $target_list
do
fi)
AC_SUBST(slibdir)
-AC_ARG_WITH(datarootdir,
-[ --with-datarootdir=DIR Use DIR as the data root [[PREFIX/share]]],
-datarootdir="\${prefix}/$with_datarootdir",
-datarootdir='$(prefix)/share')
-AC_SUBST(datarootdir)
-
-AC_ARG_WITH(docdir,
-[ --with-docdir=DIR Install documentation in DIR [[DATAROOTDIR]]],
-docdir="\${prefix}/$with_docdir",
-docdir='$(datarootdir)')
-AC_SUBST(docdir)
-
-AC_ARG_WITH(htmldir,
-[ --with-htmldir=DIR html documentation in in DIR [[DOCDIR]]],
-htmldir="\${prefix}/$with_htmldir",
-htmldir='$(docdir)')
-AC_SUBST(htmldir)
-
# Substitute configuration variables
AC_SUBST(subdirs)
AC_SUBST(srcdir)
AC_SUBST(cpp_install_dir)
AC_SUBST(xmake_file)
AC_SUBST(tmake_file)
+AC_SUBST(TM_ENDIAN_CONFIG)
+AC_SUBST(TM_MULTILIB_CONFIG)
+AC_SUBST(TM_MULTILIB_EXCEPTIONS_CONFIG)
AC_SUBST(extra_gcc_objs)
AC_SUBST(extra_headers_list)
AC_SUBST(extra_objs)
AC_ARG_VAR(GMPLIBS,[How to link GMP])
AC_ARG_VAR(GMPINC,[How to find GMP include files])
+case "${GMPLIBS}" in
+ *-lmpc*) AC_DEFINE(HAVE_mpc, 1, [Define if mpc is in use.]) ;;
+esac
+
AC_ARG_VAR(PPLLIBS,[How to link PPL])
AC_ARG_VAR(PPLINC,[How to find PPL include files])
AC_DEFINE(HAVE_cloog, 1, [Define if cloog is in use.])
fi
+# Check for plugin support
+AC_ARG_ENABLE(plugin,
+[ --enable-plugin enable plugin support],
+enable_plugin=$enableval,
+enable_plugin=yes; default_plugin=yes)
+
+pluginlibs=
+if test x"$enable_plugin" = x"yes"; then
+ # Check that the host supports -rdynamic and -ldl
+ have_rdynamic=no
+ have_dl=no
+ saved_LDFLAGS="$LDFLAGS"
+ saved_LIBS="$LIBS"
+ LIBS=
+
+ # Check -rdynamic
+ LDFLAGS="$LDFLAGS -rdynamic"
+ AC_MSG_CHECKING([for -rdynamic])
+ AC_TRY_LINK([],[return 0;],
+ [AC_MSG_RESULT([yes]); have_rdynamic=yes],
+ [AC_MSG_RESULT([no])])
+ if test x"$have_rdynamic" = x"yes" ; then
+ pluginlibs="-rdynamic"
+ fi
+
+ # Check -ldl
+ LDFLAGS="$LDFLAGS -ldl"
+ AC_MSG_CHECKING([for -ldl])
+ AC_TRY_LINK(
+ [#include <dlfcn.h>],
+ [volatile int f = 0; if (f) dlopen ("dummy", 0);],
+ [AC_MSG_RESULT([yes]); have_dl=yes],
+ [AC_MSG_RESULT([no])])
+ if test x"$have_dl" = x"yes"; then
+ pluginlibs="$pluginlibs -ldl"
+ fi
+
+ # Check that we can build shared objects with -fPIC -shared
+ LDFLAGS="$LDFLAGS -fPIC -shared"
+ AC_MSG_CHECKING([for -fPIC -shared])
+ AC_TRY_LINK(
+ [extern int X;],[return X == 0;],
+ [AC_MSG_RESULT([yes]); have_pic_shared=yes],
+ [AC_MSG_RESULT([no]); have_pic_shared=no])
+ if test x"$have_pic_shared" != x"yes"; then
+ pluginlibs=
+ enable_plugin=no
+ fi
+
+ # If plugin support had been requested but not available, fail.
+ if test x"$enable_plugin" = x"no" ; then
+ if test x"$default_plugin" != x"yes"; then
+ AC_MSG_ERROR([
+Building GCC with plugin support requires a host that supports
+-fPIC, -shared, -ldl and -rdynamic.])
+ fi
+ fi
+
+ LDFLAGS="$saved_LDFLAGS"
+ LIBS="$saved_LIBS"
+fi
+
+AC_SUBST(pluginlibs)
+AC_SUBST(enable_plugin)
+if test x"$enable_plugin" = x"yes"; then
+ AC_DEFINE(ENABLE_PLUGIN, 1, [Define to enable plugin support.])
+fi
+
# Configure the subdirectories
# AC_CONFIG_SUBDIRS($subdirs)