# configure.ac for GCC
# Process this file with autoconf to generate a configuration script.
-# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
#This file is part of GCC.
&& test $ac_cv_prog_cc_w_no_variadic_macros = yes ; then
strict1_warn="-pedantic -Wno-long-long -Wno-variadic-macros"
fi
-AC_SUBST(strict1_warn)
# Add -Wold-style-definition if it's accepted
AC_CACHE_CHECK(
strict1_warn="${strict1_warn} -Wold-style-definition"
fi
+# Add -Wmissing-format-attribute if it's accepted
+AC_CACHE_CHECK(
+ [whether ${CC} accepts -Wmissing-format-attribute],
+ [ac_cv_prog_cc_w_missing_format_attribute],
+ [save_CFLAGS="$CFLAGS"
+ CFLAGS="-Wmissing-format-attribute"
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])],
+ [ac_cv_prog_cc_w_missing_format_attribute=yes],
+ [ac_cv_prog_cc_w_missing_format_attribute=no])
+ CFLAGS="$save_CFLAGS"
+ ])
+if test $ac_cv_prog_cc_w_missing_format_attribute = yes ; then
+ strict1_warn="${strict1_warn} -Wmissing-format-attribute"
+fi
+
# Enable -Werror, period.
AC_ARG_ENABLE(werror_always,
[ --enable-werror-always enable -Werror always], [],
WERROR=-Werror
fi
+AC_SUBST(strict1_warn)
+
# 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'.
], [enable_shared=yes])
AC_SUBST(enable_shared)
+AC_ARG_WITH(build-sysroot,
+ [ --with-build-sysroot=sysroot
+ use sysroot as the system root during the build])
+
AC_ARG_WITH(sysroot,
[ --with-sysroot[=DIR] Search for usr/lib, usr/include, et al, within DIR.],
[
TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$(NATIVE_SYSTEM_HEADER_DIR)'
-
+
if test "x$exec_prefix" = xNONE; then
if test "x$prefix" = xNONE; then
test_prefix=/usr/local
fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked dnl
fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl
putchar_unlocked putc_unlocked)
-AC_CHECK_FUNCS(times clock dup2 kill getrlimit setrlimit atoll atoq \
+AC_CHECK_FUNCS(times clock kill getrlimit setrlimit atoll atoq \
sysconf strsignal getrusage nl_langinfo scandir alphasort \
gettimeofday mbstowcs wcswidth mmap mincore setlocale \
gcc_UNLOCKED_FUNCS)
fi
AC_SUBST(TARGET_GETGROUPS_T)
-gcc_AC_FUNC_PRINTF_PTR
gcc_AC_FUNC_MMAP_BLACKLIST
case "${host}" in
CROSS= AC_SUBST(CROSS)
ALL=all.internal AC_SUBST(ALL)
SYSTEM_HEADER_DIR='$(NATIVE_SYSTEM_HEADER_DIR)' AC_SUBST(SYSTEM_HEADER_DIR)
+
+if test "x$with_build_sysroot" != x; then
+ build_system_header_dir=$with_build_sysroot'$(NATIVE_SYSTEM_HEADER_DIR)'
+else
+ # This value is used, even on a native system, because
+ # CROSS_SYSTEM_HEADER_DIR is just
+ # $(TARGET_SYSTEM_ROOT)$(NATIVE_SYSTEM_HEADER_DIR).
+ build_system_header_dir='$(CROSS_SYSTEM_HEADER_DIR)'
+fi
+
if test x$host != x$target
then
CROSS="-DCROSS_COMPILE"
ALL=all.cross
- SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)'
+ SYSTEM_HEADER_DIR=$build_system_header_dir
case "$host","$target" in
# Darwin crosses can use the host system's libraries and headers,
# because of the fat library support. Of course, it must be the
CROSS="$CROSS -DNATIVE_CROSS" ;;
esac
elif test "x$TARGET_SYSTEM_ROOT" != x; then
- # This is just $(TARGET_SYSTEM_ROOT)$(NATIVE_SYSTEM_HEADER_DIR)
- SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)'
+ SYSTEM_HEADER_DIR=$build_system_header_dir
fi
# If this is a cross-compiler that does not
# then define inhibit_libc in LIBGCC2_CFLAGS.
# This prevents libgcc2 from containing any code which requires libc
# support.
-inhibit_libc=
+inhibit_libc=false
if { { test x$host != x$target && test "x$with_sysroot" = x ; } ||
test x$with_newlib = xyes ; } &&
{ test "x$with_headers" = x || test "x$with_headers" = xno ; } ; then
- inhibit_libc=-Dinhibit_libc
+ inhibit_libc=true
fi
AC_SUBST(inhibit_libc)
elif test -x as$build_exeext; then
# Build using assembler in the current directory.
gcc_cv_as=./as$build_exeext
-elif test -x "$AS_FOR_TARGET"; then
- gcc_cv_as="$AS_FOR_TARGET"
-elif test -x "$AS" && test x$host = x$target; then
- gcc_cv_as="$AS"
fi
-gcc_AC_CHECK_TOOL(gcc_cv_as, as, ORIGINAL_AS_FOR_TARGET)
+gcc_AC_CHECK_TOOL(gcc_cv_as, as, ORIGINAL_AS_FOR_TARGET, AS_FOR_TARGET, AS)
AC_MSG_CHECKING(what assembler to use)
case $in_tree_gas in
yes)
elif test -x collect-ld$build_exeext; then
# Build using linker in the current directory.
gcc_cv_ld=./collect-ld$build_exeext
-elif test -x "$LD_FOR_TARGET"; then
- gcc_cv_ld="$LD_FOR_TARGET"
-elif test -x "$LD" && test x$host = x$target; then
- gcc_cv_ld="$LD"
fi
-gcc_AC_CHECK_TOOL(gcc_cv_ld, ld, ORIGINAL_LD_FOR_TARGET)
+gcc_AC_CHECK_TOOL(gcc_cv_ld, ld, ORIGINAL_LD_FOR_TARGET, LD_FOR_TARGET, LD)
AC_MSG_CHECKING(what linker to use)
case $in_tree_ld in
yes)
gcc_cv_nm=./nm$build_exeext
fi
-gcc_AC_CHECK_TOOL(gcc_cv_nm, nm, ORIGINAL_NM_FOR_TARGET)
+gcc_AC_CHECK_TOOL(gcc_cv_nm, nm, ORIGINAL_NM_FOR_TARGET, NM_FOR_TARGET, NM)
AC_MSG_CHECKING(what nm to use)
case $in_tree_nm in
yes) AC_MSG_RESULT("newly built nm") ;;
esac
# Figure out what objdump we will be using.
-AC_MSG_CHECKING(what objdump to use)
in_tree_objdump=no
-if test -x objdump$build_exeext; then
- gcc_cv_objdump=./objdump$build_exeext
-elif test -f $gcc_cv_binutils_srcdir/configure.in \
+gcc_cv_objdump=
+if test -f $gcc_cv_binutils_srcdir/configure.in \
&& test -f ../binutils/Makefile; then
# Single tree build which includes binutils.
in_tree_objdump=yes
gcc_cv_objdump=../binutils/objdump$build_exeext
-elif test "x$program_prefix" != xNONE; then
- gcc_cv_objdump=${program_prefix}objdump$build_exeext
-elif test x$build != x$host && test x$build != x$target; then
- gcc_cv_objdump=${target_noncanonical}-objdump$build_exeext
-else
- gcc_cv_objdump=`echo objdump | \
- sed "${program_transform_name}"`$build_exeext
+elif test -x objdump$build_exeext; then
+ gcc_cv_objdump=./objdump$build_exeext
fi
+
+gcc_AC_CHECK_TOOL(gcc_cv_objdump, objdump, ORIGINAL_OBJDUMP_FOR_TARGET,
+ OBJDUMP_FOR_TARGET, OBJDUMP)
+AC_MSG_CHECKING(what objdump to use)
case $in_tree_objdump in
yes) AC_MSG_RESULT("newly built objdump") ;;
no) AC_MSG_RESULT($gcc_cv_objdump) ;;
[ .weak foobar],,
[AC_DEFINE(HAVE_GAS_WEAK, 1, [Define if your assembler supports .weak.])])
+gcc_GAS_CHECK_FEATURE([.weakref], gcc_cv_as_weakref,
+ [2,17,0],,
+ [ .weakref foobar, barfnot],,
+[AC_DEFINE(HAVE_GAS_WEAKREF, 1, [Define if your assembler supports .weakref.])])
+
gcc_GAS_CHECK_FEATURE([.nsubspa comdat], gcc_cv_as_nsubspa_comdat,
[2,15,91],,
[ .SPACE $TEXT$
tls_first_minor=15
tls_as_opt=--fatal-warnings
;;
+ arm*-*-*)
+ conftest_s='
+ .section ".tdata","awT",%progbits
+foo: .long 25
+ .text
+.word foo(gottpoff)
+.word foo(tpoff)
+.word foo(tlsgd)
+.word foo(tlsldm)
+.word foo(tlsldo)'
+ tls_first_major=2
+ tls_first_minor=17
+ ;;
i[34567]86-*-*)
conftest_s='
.section ".tdata","awT",@progbits
then target_cpu_default=MASK_EXPLICIT_RELOCS
else target_cpu_default="($target_cpu_default)|MASK_EXPLICIT_RELOCS"
fi])
+ ;;
+esac
+# Mips and HP-UX need the GNU assembler.
+# Linux on IA64 might be able to use the Intel assembler.
+
+case "$target" in
+ mips*-*-* | *-*-hpux* )
if test x$gas_flag = xyes \
|| test x"$host" != x"$build" \
|| test ! -x "$gcc_cv_as" \
fi
;;
esac
+
# ??? Not all targets support dwarf2 debug_line, even within a version
# of gas. Moreover, we need to emit a valid instruction to trigger any
# info to the output file. So, as supported targets are added to gas 2.11,
case "$target" in
i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* \
| x86_64*-*-* | hppa*-*-* | arm*-*-* | strongarm*-*-* | xscale*-*-* \
- | xstormy16*-*-* | cris-*-* | xtensa-*-*)
+ | xstormy16*-*-* | cris-*-* | xtensa-*-* | bfin-*-*)
insn="nop"
;;
ia64*-*-* | s390*-*-*)
[Define if your linker supports --as-needed and --no-as-needed options.])
fi
-case "$target" in
- powerpc64*-*-linux*)
+case "$target:$tm_file" in
+ powerpc64*-*-linux* | powerpc*-*-linux*rs6000/biarch64.h*)
AC_CACHE_CHECK(linker support for omitting dot symbols,
gcc_cv_ld_no_dot_syms,
[gcc_cv_ld_no_dot_syms=no