# Determine the host, build, and target systems
AC_CANONICAL_SYSTEM
+# Determine the noncanonical target name, for directory use.
+_GCC_TOPLEV_NONCANONICAL_TARGET
+
# Determine the target- and build-specific subdirectories
GCC_TOPLEV_SUBDIRS
cpp_install_dir=$withval
fi])
+# We would like to our source tree to be readonly. However when releases or
+# pre-releases are generated, the flex/bison generated files as well as the
+# various formats of manuals need to be included along with the rest of the
+# sources. Therefore we have --enable-generated-files-in-srcdir to do
+# just that.
+
+AC_ARG_ENABLE(generated-files-in-srcdir,
+[ --enable-generated-files-in-srcdir Put generated files in source dir],
+[case ${enableval} in
+ no) parsedir='$(objdir)'; docobjdir='$(objdir)/doc';;
+ *) parsedir='$(srcdir)'; docobjdir='$(srcdir)/doc';;
+esac],
+[parsedir='$(objdir)'; docobjdir='$(objdir)/doc';])
+
# -------------------
# Find default linker
# -------------------
# See if GNAT has been installed
gcc_AC_PROG_GNAT
-if test x$have_gnat != xno ; then
-AC_CACHE_CHECK(whether ${ADAC} accepts -Wno-long-long,
-ac_cv_prog_adac_no_long_long,
-[cat >conftest.adb <<EOF
-procedure conftest is begin null; end conftest;
-EOF
-if $ADAC -Wno-long-long -c conftest.adb 1>&5 2>&5 ; then
- ac_cv_prog_adac_no_long_long=yes
-else
- ac_cv_prog_adac_no_long_long=no
-fi
-rm -f conftest*])
-else
- ac_cv_prog_adac_no_long_long=yes
-fi
-
# ---------------------
# Warnings and checking
# ---------------------
strict1_warn=
-if test $ac_cv_prog_cc_no_long_long = yes && \
- test $ac_cv_prog_adac_no_long_long = yes ; then
+if test $ac_cv_prog_cc_no_long_long = yes ; then
strict1_warn="-pedantic -Wno-long-long"
fi
AC_SUBST(strict1_warn)
fi
valgrind_path_defines=
valgrind_command=
+
+dnl # This check AC_REQUIREs various stuff, so it *must not* be inside
+dnl # an if statement. This was the source of very frustrating bugs
+dnl # in converting to autoconf 2.5x!
+AC_CHECK_HEADER(valgrind.h, have_valgrind_h=yes, have_valgrind_h=no)
+
if test x$ac_checking_valgrind != x ; then
# It is certainly possible that there's valgrind but no valgrind.h.
# GCC relies on making annotations so we must have both.
+ AC_MSG_CHECKING(for VALGRIND_DISCARD in <valgrind/memcheck.h>)
+ AC_TRY_CPP(
+ [#include <valgrind/memcheck.h>
+#ifndef VALGRIND_DISCARD
+#error VALGRIND_DISCARD not defined
+#endif],
+ [gcc_cv_header_valgrind_memcheck_h=yes],
+ [gcc_cv_header_valgrind_memcheck_h=no])
+ AC_MSG_RESULT($gcc_cv_header_valgrind_memcheck_h)
AC_MSG_CHECKING(for VALGRIND_DISCARD in <memcheck.h>)
AC_TRY_CPP(
[#include <memcheck.h>
[gcc_cv_header_memcheck_h=yes],
gcc_cv_header_memcheck_h=no)
AC_MSG_RESULT($gcc_cv_header_memcheck_h)
- AC_CHECK_HEADER(valgrind.h, have_valgrind_h=yes, have_valgrind_h=no)
AM_PATH_PROG_WITH_TEST(valgrind_path, valgrind,
[$ac_dir/$ac_word --version | grep valgrind- >/dev/null 2>&1])
- if test "x$valgrind_path" = "x" || (test $have_valgrind_h = no && test $gcc_cv_header_memcheck_h = no); then
- AC_MSG_ERROR([*** Can't find both valgrind and valgrind.h/memcheck.h])
+ if test "x$valgrind_path" = "x" \
+ || (test $have_valgrind_h = no \
+ && test $gcc_cv_header_memcheck_h = no \
+ && test $gcc_cv_header_valgrind_memcheck_h = no); then
+ AC_MSG_ERROR([*** Can't find both valgrind and valgrind/memcheck.h, memcheck.h or valgrind.h])
fi
valgrind_path_defines=-DVALGRIND_PATH='\"'$valgrind_path'\"'
valgrind_command="$valgrind_path -q"
AC_DEFINE(ENABLE_VALGRIND_CHECKING, 1,
[Define if you want to run subprograms and generated programs
through valgrind (a memory checker). This is extremely expensive.])
+ if test $gcc_cv_header_valgrind_memcheck_h = yes; then
+ AC_DEFINE(HAVE_VALGRIND_MEMCHECK_H, 1,
+ [Define if valgrind's valgrind/memcheck.h header is installed.])
+ fi
if test $gcc_cv_header_memcheck_h = yes; then
AC_DEFINE(HAVE_MEMCHECK_H, 1,
[Define if valgrind's memcheck.h header is installed.])
[ --with-sysroot[=DIR] Search for usr/lib, usr/include, et al, within DIR.],
[
case ${with_sysroot} in
- yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_alias}/sys-root' ;;
+ yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_noncanonical}/sys-root' ;;
*) TARGET_SYSTEM_ROOT=$with_sysroot ;;
esac
# Find some useful tools
AC_PROG_AWK
+# We need awk to run opts.sh (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
AC_PROG_RANLIB
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 vasprintf \
+ fprintf_unlocked strstr errno snprintf vasprintf \
malloc realloc calloc free basename getopt clock, , ,[
#include "ansidecl.h"
#include "system.h"])
gcc_cv_as=`echo as | sed ${program_transform_name}`$host_exeext
fi
- test_dirs="$test_prefix/lib/gcc-lib/$target_alias/$gcc_version \
- $test_prefix/lib/gcc-lib/$target_alias \
- /usr/lib/gcc/$target_alias/$gcc_version \
- /usr/lib/gcc/$target_alias \
- $test_prefix/$target_alias/bin/$target_alias/$gcc_version \
- $test_prefix/$target_alias/bin"
+ test_dirs="$test_prefix/lib/gcc-lib/$target_noncanonical/$gcc_version \
+ $test_prefix/lib/gcc-lib/$target_noncanonical \
+ /usr/lib/gcc/$target_noncanonical/$gcc_version \
+ /usr/lib/gcc/$target_noncanonical \
+ $test_prefix/$target_noncanonical/bin/$target_noncanonical/$gcc_version \
+ $test_prefix/$target_noncanonical/bin"
if test x$host = x$target; then
test_dirs="$test_dirs \
gcc_cv_ld=`echo ld | sed ${program_transform_name}`$host_exeext
fi
- test_dirs="$test_prefix/lib/gcc-lib/$target_alias/$gcc_version \
- $test_prefix/lib/gcc-lib/$target_alias \
- /usr/lib/gcc/$target_alias/$gcc_version \
- /usr/lib/gcc/$target_alias \
- $test_prefix/$target_alias/bin/$target_alias/$gcc_version \
- $test_prefix/$target_alias/bin"
+ test_dirs="$test_prefix/lib/gcc-lib/$target_noncanonical/$gcc_version \
+ $test_prefix/lib/gcc-lib/$target_noncanonical \
+ /usr/lib/gcc/$target_noncanonical/$gcc_version \
+ /usr/lib/gcc/$target_noncanonical \
+ $test_prefix/$target_noncanonical/bin/$target_noncanonical/$gcc_version \
+ $test_prefix/$target_noncanonical/bin"
if test x$host = x$target; then
test_dirs="$test_dirs \
changequote([,])dnl
fi
else
- # non-GNU linkers don't seem to support .hidden yet
- gcc_cv_ld_hidden=no
+ case "${target}" in
+ hppa64*-*-hpux*)
+ gcc_cv_ld_hidden=yes
+ ;;
+ *)
+ gcc_cv_ld_hidden=no
+ ;;
+ esac
fi
fi])
libgcc_visibility=no
case "$target" in
i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* \
| x86_64*-*-* | hppa*-*-* | arm*-*-* | strongarm*-*-* | xscale*-*-* \
- | xstormy16*-*-* | cris-*-*)
+ | xstormy16*-*-* | cris-*-* | xtensa-*-*)
insn="nop"
;;
ia64*-*-*)
fi
AC_MSG_RESULT($gcc_cv_ld_pie)
-# Miscellaneous target-specific checks.
-case "$target" in
- mips*-*-*)
- AC_MSG_CHECKING(whether libgloss uses STARTUP directives consistently)
- gcc_cv_mips_libgloss_startup=no
- gcc_cv_libgloss_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/libgloss
- if test "x$exec_prefix" = xNONE; then
- if test "x$prefix" = xNONE; then
- test_prefix=/usr/local
- else
- test_prefix=$prefix
- fi
- else
- test_prefix=$exec_prefix
- fi
- for f in $gcc_cv_libgloss_srcdir/mips/idt.ld $test_prefix/$target_alias/lib/idt.ld
- do
- if grep '^STARTUP' $f > /dev/null 2>&1; then
- gcc_cv_mips_libgloss_startup=yes
- break
- fi
- done
- if test x"$gcc_cv_mips_libgloss_startup" = xyes; then
- AC_DEFINE(HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES, 1,
- [Define if your MIPS libgloss linker scripts consistently include STARTUP directives.])
- fi
- AC_MSG_RESULT($gcc_cv_mips_libgloss_startup)
- ;;
-esac
-
if test x$with_sysroot = x && test x$host = x$target \
&& test "$prefix" != "/usr" && test "x$prefix" != "x$local_prefix" ; then
AC_DEFINE_UNQUOTED(PREFIX_INCLUDE_DIR, "$prefix/include",
# 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-gc={simple,page,zone} choose the garbage collection mechanism to use
with the compiler],
[case "$withval" in
- simple | page)
+ simple | page | zone)
GGC=ggc-$withval
;;
*)
rm -f Make-hooks
touch Make-hooks
target_list="all.build all.cross start.encap rest.encap tags \
- install-normal install-common install-info install-man \
+ install-normal install-common install-man \
uninstall \
- mostlyclean clean distclean extraclean maintainer-clean \
+ mostlyclean clean distclean maintainer-clean \
stage1 stage2 stage3 stage4 stageprofile stagefeedback"
for t in $target_list
do
# make and thus we'd get different behavior depending on where we built the
# sources.
if test x$exec_prefix = xNONE -o x$exec_prefix = x$prefix; then
- gcc_tooldir='$(libsubdir)/$(unlibsubdir)/../$(target_alias)'
+ gcc_tooldir='$(libsubdir)/$(unlibsubdir)/../$(target_noncanonical)'
else
changequote(<<, >>)dnl
# An explanation of the sed strings:
# /foo /foo/bar/ugg ../../
#
dollar='$$'
- gcc_tooldir="\$(libsubdir)/\$(unlibsubdir)/\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/\$(dollar)||' -e 's|^[^/]|/|' -e 's|/[^/]*|../|g'\`\$(target_alias)"
+ gcc_tooldir="\$(libsubdir)/\$(unlibsubdir)/\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/\$(dollar)||' -e 's|^[^/]|/|' -e 's|/[^/]*|../|g'\`\$(target_noncanonical)"
changequote([, ])dnl
fi
AC_SUBST(gcc_tooldir)
# Substitute configuration variables
AC_SUBST(subdirs)
AC_SUBST(srcdir)
+AC_SUBST(docobjdir)
+AC_SUBST(parsedir)
AC_SUBST(all_boot_languages)
AC_SUBST(all_compilers)
AC_SUBST(all_gtfiles)
AC_SUBST(xm_file_list)
AC_SUBST(xm_include_list)
AC_SUBST(xm_defines)
-AC_SUBST(target_alias)
+AC_SUBST(target_noncanonical)
AC_SUBST(c_target_objs)
AC_SUBST(cxx_target_objs)
AC_SUBST(target_cpu_default)
AC_SUBST_FILE(language_hooks)
-# Echo that links are built
-if test x$host = x$target
-then
- str1="native "
+# Echo link setup.
+if test x${build} = x${host} ; then
+ if test x${host} = x${target} ; then
+ echo "Links are now set up to build a native compiler for ${target}." 1>&2
+ else
+ echo "Links are now set up to build a cross-compiler" 1>&2
+ echo " from ${host} to ${target}." 1>&2
+ fi
else
- str1="cross-"
- str2=" from $host"
-fi
-
-if test x$host != x$build
-then
- str3=" on a $build system"
-fi
-
-if test "x$str2" != x || test "x$str3" != x
-then
- str4=
-fi
-
-echo "Links are now set up to build a ${str1}compiler for ${target}$str4" 1>&2
-
-if test "x$str2" != x || test "x$str3" != x
-then
- echo " ${str2}${str3}." 1>&2
+ if test x${host} = x${target} ; then
+ echo "Links are now set up to build (on ${build}) a native compiler" 1>&2
+ echo " for ${target}." 1>&2
+ else
+ echo "Links are now set up to build (on ${build}) a cross-compiler" 1>&2
+ echo " from ${host} to ${target}." 1>&2
+ fi
fi
# Configure the subdirectories
# and configure language subdirectories
AC_OUTPUT($all_outputs,
[
-case x$CONFIG_HEADERS in
-xauto-host.h:config.in)
-echo > cstamp-h ;;
+case ${CONFIG_HEADERS} in
+ *auto-host.h:config.in*)
+ echo > cstamp-h ;;
esac
# Make sure all the subdirs exist.
for d in $subdirs