X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=configure.ac;h=b7fb222298d2dd5410ee8b437a9501811aa9aa3e;hp=61d72e4b76afab165228f2885a6057d6ae90232c;hb=69f31627c7d9cef2d73855111c61f111a2d4d3ef;hpb=1c5767f1be88c09a96b33cb1e110933b4510f55b diff --git a/configure.ac b/configure.ac index 61d72e4b76a..b7fb222298d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,6 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -# 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +# 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, +# Inc. # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -18,11 +19,41 @@ ############################################################################## ### WARNING: this file contains embedded tabs. Do not run untabify on this file. -sinclude(config/acx.m4) +m4_include(config/acx.m4) +m4_include(config/override.m4) +m4_include(config/proginstall.m4) AC_INIT(move-if-change) AC_PREREQ(2.59) +progname=$0 +# if PWD already has a value, it is probably wrong. +if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi + +# Export original configure arguments for use by sub-configures. +# Quote arguments with shell meta charatcers. +TOPLEVEL_CONFIGURE_ARGUMENTS= +set -- "$progname" "$@" +for ac_arg +do + case "$ac_arg" in + *" "*|*" "*|*[[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\']]*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` + # if the argument is of the form -foo=baz, quote the baz part only + ac_arg=`echo "'$ac_arg'" | sed "s/^'\([[-a-zA-Z0-9]]*=\)/\\1'/"` ;; + *) ;; + esac + # Add the quoted argument to the list. + TOPLEVEL_CONFIGURE_ARGUMENTS="$TOPLEVEL_CONFIGURE_ARGUMENTS $ac_arg" +done +if test "$silent" = yes; then + TOPLEVEL_CONFIGURE_ARGUMENTS="$TOPLEVEL_CONFIGURE_ARGUMENTS --silent" +fi +# Remove the initial space we just introduced and, as these will be +# expanded by make, quote '$'. +TOPLEVEL_CONFIGURE_ARGUMENTS=`echo "x$TOPLEVEL_CONFIGURE_ARGUMENTS" | sed -e 's/^x *//' -e 's,\\$,$$,g'` +AC_SUBST(TOPLEVEL_CONFIGURE_ARGUMENTS) + # Find the build, host, and target systems. ACX_NONCANONICAL_BUILD ACX_NONCANONICAL_HOST @@ -41,6 +72,7 @@ AC_CANONICAL_SYSTEM AC_ARG_PROGRAM m4_pattern_allow([^AS_FOR_TARGET$])dnl +m4_pattern_allow([^AS_FOR_BUILD$])dnl # Get 'install' or 'install-sh' and its variants. AC_PROG_INSTALL @@ -81,34 +113,6 @@ esac config_shell=${CONFIG_SHELL-/bin/sh} -progname=$0 -# if PWD already has a value, it is probably wrong. -if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi - -# Export original configure arguments for use by sub-configures. -# Quote arguments with shell meta charatcers. -TOPLEVEL_CONFIGURE_ARGUMENTS= -set -- "$progname" "$@" -for ac_arg -do - case "$ac_arg" in - *" "*|*" "*|*[[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\']]*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` - # if the argument is of the form -foo=baz, quote the baz part only - ac_arg=`echo "'$ac_arg'" | sed "s/^'\([[-a-zA-Z0-9]]*=\)/\\1'/"` ;; - *) ;; - esac - # Add the quoted argument to the list. - TOPLEVEL_CONFIGURE_ARGUMENTS="$TOPLEVEL_CONFIGURE_ARGUMENTS $ac_arg" -done -if test "$silent" = yes; then - TOPLEVEL_CONFIGURE_ARGUMENTS="$TOPLEVEL_CONFIGURE_ARGUMENTS --silent" -fi -# Remove the initial space we just introduced and, as these will be -# expanded by make, quote '$'. -TOPLEVEL_CONFIGURE_ARGUMENTS=`echo "x$TOPLEVEL_CONFIGURE_ARGUMENTS" | sed -e 's/^x *//' -e 's,\\$,$$,g'` -AC_SUBST(TOPLEVEL_CONFIGURE_ARGUMENTS) - moveifchange=${srcdir}/move-if-change srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}` @@ -161,6 +165,7 @@ host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib l # know that we are building the simulator. # binutils, gas and ld appear in that order because it makes sense to run # "make check" in that particular order. +# If --enable-gold is used, "gold" will replace "ld". host_tools="texinfo byacc flex bison binutils gas ld fixincludes gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar gnattools" # libgcj represents the runtime libraries only used by gcj. @@ -176,6 +181,7 @@ target_libraries="target-libgcc \ target-libiberty \ target-libgloss \ target-newlib \ + target-libgomp \ target-libstdc++-v3 \ target-libmudflap \ target-libssp \ @@ -183,8 +189,7 @@ target_libraries="target-libgcc \ target-boehm-gc \ ${libgcj} \ target-libobjc \ - target-libada \ - target-libgomp" + target-libada" # these tools are built using the target libraries, and are intended to # run only in the target environment @@ -206,6 +211,10 @@ configdirs=`echo ${host_libs} ${host_tools}` target_configdirs=`echo ${target_libraries} ${target_tools}` build_configdirs=`echo ${build_libs} ${build_tools}` +m4_divert_text([PARSE_ARGS], +[ac_subdirs_all=`cd $srcdir && echo */configure | sed 's,/configure,,g'` +]) + ################################################################################ srcname="gnu development package" @@ -233,7 +242,7 @@ use_gnu_ld= # Make sure we don't let GNU ld be added if we didn't want it. if test x$with_gnu_ld = xno ; then use_gnu_ld=no - noconfigdirs="$noconfigdirs ld" + noconfigdirs="$noconfigdirs ld gold" fi use_gnu_as= @@ -284,6 +293,38 @@ case ${with_newlib} in yes) skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;; esac +# Handle --enable-gold. + +AC_ARG_ENABLE(gold, +[ --enable-gold use gold instead of ld], +ENABLE_GOLD=$enableval, +ENABLE_GOLD=no) +if test "${ENABLE_GOLD}" = "yes"; then + # Check for ELF target. + is_elf=no + case "${target}" in + *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \ + | *-*-linux* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \ + | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-solaris2*) + case "${target}" in + *-*-linux*aout* | *-*-linux*oldld*) + ;; + *) + is_elf=yes + ;; + esac + esac + + if test "$is_elf" = "yes"; then + # Check for target supported by gold. + case "${target}" in + i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-*) + configdirs="`echo " ${configdirs} " | sed -e 's/ ld / gold /'`" + ;; + esac + fi +fi + # Configure extra directories which are host specific case "${host}" in @@ -405,7 +446,7 @@ case "${target}" in *-*-chorusos) noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" ;; - powerpc-*-darwin* | i[[3456789]]86-*-darwin*) + powerpc-*-darwin* | i[[3456789]]86-*-darwin* | x86_64-*-darwin9*) noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof" noconfigdirs="$noconfigdirs sim target-rda" ;; @@ -523,7 +564,6 @@ case "${target}" in ;; arm*-*-linux-gnueabi) noconfigdirs="$noconfigdirs target-qthreads" - noconfigdirs="$noconfigdirs target-libobjc" case ${with_newlib} in no) noconfigdirs="$noconfigdirs target-newlib target-libgloss" esac @@ -549,7 +589,7 @@ case "${target}" in noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}" ;; avr-*-*) - noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}" + noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj} target-libssp" ;; bfin-*-*) noconfigdirs="$noconfigdirs gdb" @@ -563,6 +603,9 @@ case "${target}" in c54x*-*-* | tic54x-*-*) noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} gcc gdb newlib" ;; + cr16-*-*) + noconfigdirs="$noconfigdirs ${libgcj} gdb" + ;; cris-*-* | crisv32-*-*) unsupported_languages="$unsupported_languages java" case "${target}" in @@ -570,7 +613,6 @@ case "${target}" in unsupported_languages="$unsupported_languages fortran" noconfigdirs="$noconfigdirs target-libffi target-boehm-gc";; *-*-elf) - unsupported_languages="$unsupported_languages fortran" noconfigdirs="$noconfigdirs target-boehm-gc";; *-*-linux*) noconfigdirs="$noconfigdirs target-newlib target-libgloss";; @@ -782,6 +824,14 @@ case "${target}" in m68k-apollo-*) noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss ${libgcj}" ;; + mips*-sde-elf*) + skipdirs="$skipdirs target-libiberty" + noconfigdirs="$noconfigdirs ${libgcj}" + if test x$with_newlib = xyes; then + noconfigdirs="$noconfigdirs gprof" + fi + libgloss_dir=mips + ;; mips*-*-irix5*) noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" ;; @@ -795,9 +845,6 @@ case "${target}" in mips*-*-bsd*) noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" ;; - mips64*-*-linux*) - noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" - ;; mips*-*-linux*) noconfigdirs="$noconfigdirs target-newlib target-libgloss" ;; @@ -865,7 +912,7 @@ case "${target}" in vax-*-*) noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" ;; - xtensa-*-*) + xtensa*-*-*) noconfigdirs="$noconfigdirs ${libgcj}" ;; ip2k-*-*) @@ -999,12 +1046,10 @@ case "${host}" in host_makefile_frag="config/mh-djgpp" ;; *-cygwin*) + ACX_CHECK_CYGWIN_CAT_WORKS host_makefile_frag="config/mh-cygwin" ;; - *-mingw32*) - host_makefile_frag="config/mh-mingw" - ;; - *-mingw64*) + *-mingw*) host_makefile_frag="config/mh-mingw" ;; *-interix*) @@ -1077,9 +1122,31 @@ if test -z "${CC}" && test "${build}" = "${host}" ; then fi if test "${build}" != "${host}" ; then + AR_FOR_BUILD=${AR_FOR_BUILD-ar} + AS_FOR_BUILD=${AS_FOR_BUILD-as} CC_FOR_BUILD=${CC_FOR_BUILD-gcc} + CXX_FOR_BUILD=${CXX_FOR_BUILD-g++} + GCJ_FOR_BUILD=${GCJ_FOR_BUILD-gcj} + GFORTRAN_FOR_BUILD=${GFORTRAN_FOR_BUILD-gfortran} + DLLTOOL_FOR_BUILD=${DLLTOOL_FOR_BUILD-dlltool} + LD_FOR_BUILD=${LD_FOR_BUILD-ld} + NM_FOR_BUILD=${NM_FOR_BUILD-nm} + RANLIB_FOR_BUILD=${RANLIB_FOR_BUILD-ranlib} + WINDRES_FOR_BUILD=${WINDRES_FOR_BUILD-windres} + WINDMC_FOR_BUILD=${WINDMC_FOR_BUILD-windmc} else + AR_FOR_BUILD="\$(AR)" + AS_FOR_BUILD="\$(AS)" CC_FOR_BUILD="\$(CC)" + CXX_FOR_BUILD="\$(CXX)" + GCJ_FOR_BUILD="\$(GCJ)" + GFORTRAN_FOR_BUILD="\$(GFORTRAN)" + DLLTOOL_FOR_BUILD="\$(DLLTOOL)" + LD_FOR_BUILD="\$(LD)" + NM_FOR_BUILD="\$(NM)" + RANLIB_FOR_BUILD="\$(RANLIB)" + WINDRES_FOR_BUILD="\$(WINDRES)" + WINDMC_FOR_BUILD="\$(WINDMC)" fi AC_PROG_CC @@ -1192,11 +1259,11 @@ if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then if test x"$have_gmp" = xyes; then saved_LIBS="$LIBS" LIBS="$LIBS $gmplibs" - dnl MPFR 2.2.0 is acceptable but buggy, MPFR 2.2.1 is better. + dnl MPFR 2.2.1 is acceptable, but MPFR 2.3.0 is better. AC_MSG_CHECKING([for correct version of mpfr.h]) AC_TRY_LINK([#include #include ],[ - #if MPFR_VERSION < MPFR_VERSION_NUM(2,2,0) + #if MPFR_VERSION < MPFR_VERSION_NUM(2,2,1) choke me #endif mpfr_t n; @@ -1209,7 +1276,7 @@ if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then mpfr_subnormalize (x, t, GMP_RNDN); ], [AC_TRY_LINK([#include #include ],[ - #if MPFR_VERSION < MPFR_VERSION_NUM(2,2,1) + #if MPFR_VERSION < MPFR_VERSION_NUM(2,3,0) choke me #endif mpfr_t n; mpfr_init(n); @@ -1220,7 +1287,7 @@ if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then CFLAGS="$saved_CFLAGS" if test x$have_gmp != xyes; then - AC_MSG_ERROR([Building GCC requires GMP 4.1+ and MPFR 2.2.1+. + AC_MSG_ERROR([Building GCC requires GMP 4.1+ and MPFR 2.3.0+. Try the --with-gmp and/or --with-mpfr options to specify their locations. Copies of these libraries' source code can be found at their respective hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/. @@ -1452,7 +1519,8 @@ fi # Handle --disable- generically. for dir in $configdirs $build_configdirs $target_configdirs ; do dirname=`echo $dir | sed -e s/target-//g -e s/build-//g -e s/-/_/g` - if eval test x\${enable_${dirname}} "=" xno ; then + varname=`echo $dirname | sed -e s/+/_/g` + if eval test x\${enable_${varname}} "=" xno ; then noconfigdirs="$noconfigdirs $dir" fi done @@ -1635,6 +1703,38 @@ AC_ARG_WITH([debug-prefix-map], [DEBUG_PREFIX_CFLAGS_FOR_TARGET=]) AC_SUBST(DEBUG_PREFIX_CFLAGS_FOR_TARGET) +# During gcc bootstrap, if we use some random cc for stage1 then CFLAGS +# might be empty or "-g". We don't require a C++ compiler, so CXXFLAGS +# might also be empty (or "-g", if a non-GCC C++ compiler is in the path). +# We want to ensure that TARGET libraries (which we know are built with +# gcc) are built with "-O2 -g", so include those options when setting +# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET. +if test "x$CFLAGS_FOR_TARGET" = x; then + CFLAGS_FOR_TARGET=$CFLAGS + case " $CFLAGS " in + *" -O2 "*) ;; + *) CFLAGS_FOR_TARGET="-O2 $CFLAGS" ;; + esac + case " $CFLAGS " in + *" -g "* | *" -g3 "*) ;; + *) CFLAGS_FOR_TARGET="-g $CFLAGS" ;; + esac +fi +AC_SUBST(CFLAGS_FOR_TARGET) + +if test "x$CXXFLAGS_FOR_TARGET" = x; then + CXXFLAGS_FOR_TARGET=$CXXFLAGS + case " $CXXFLAGS " in + *" -O2 "*) ;; + *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS" ;; + esac + case " $CXXFLAGS " in + *" -g "* | *" -g3 "*) ;; + *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS" ;; + esac +fi +AC_SUBST(CXXFLAGS_FOR_TARGET) + # Handle --with-headers=XXX. If the value is not "yes", the contents of # the named directory are copied to $(tooldir)/sys-include. if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then @@ -1686,7 +1786,7 @@ if test x${use_gnu_as} = x && fi if test x${use_gnu_ld} = x && - echo " ${configdirs} " | grep " ld " > /dev/null 2>&1 ; then + echo " ${configdirs} " | egrep " (go)?ld " > /dev/null 2>&1 ; then with_gnu_ld=yes extra_host_args="$extra_host_args --with-gnu-ld" fi @@ -1762,7 +1862,7 @@ case "${target}" in v850*-*-*) md_exec_prefix=/usr/ccs/bin ;; - xtensa-*-elf*) + xtensa*-*-elf*) ;; *-*-beos* | \ @@ -1793,6 +1893,9 @@ case "${target}" in mips*-sde-elf*) target_makefile_frag="config/mt-sde" ;; + mipsisa*-*-elfoabi*) + target_makefile_frag="config/mt-mips-elfoabi" + ;; *-*-netware*) target_makefile_frag="config/mt-netware" ;; @@ -2356,7 +2459,11 @@ esac # Allow the user to override the flags for # our build compiler if desired. -CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}} +if test x"${build}" = x"${host}" ; then + CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}} + CXXFLAGS_FOR_BUILD=${CXXFLAGS_FOR_BUILD-${CXXFLAGS}} + LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}} +fi # On Canadian crosses, we'll be searching the right directories for # the previously-installed cross compiler, so don't bother to add @@ -2414,7 +2521,21 @@ AC_SUBST(target_configargs) # Build tools. +AC_SUBST(AR_FOR_BUILD) +AC_SUBST(AS_FOR_BUILD) AC_SUBST(CC_FOR_BUILD) +AC_SUBST(CFLAGS_FOR_BUILD) +AC_SUBST(CXXFLAGS_FOR_BUILD) +AC_SUBST(CXX_FOR_BUILD) +AC_SUBST(DLLTOOL_FOR_BUILD) +AC_SUBST(GCJ_FOR_BUILD) +AC_SUBST(GFORTRAN_FOR_BUILD) +AC_SUBST(LDFLAGS_FOR_BUILD) +AC_SUBST(LD_FOR_BUILD) +AC_SUBST(NM_FOR_BUILD) +AC_SUBST(RANLIB_FOR_BUILD) +AC_SUBST(WINDMC_FOR_BUILD) +AC_SUBST(WINDRES_FOR_BUILD) AC_SUBST(config_shell) # Generate default definitions for YACC, M4, LEX and other programs that run @@ -2454,10 +2575,10 @@ case " $build_configdirs " in *" texinfo "*) MAKEINFO='$$r/$(BUILD_SUBDIR)/texinfo/makeinfo/makeinfo' ;; *) changequote(,) - # For an installed makeinfo, we require it to be from texinfo 4.4 or + # For an installed makeinfo, we require it to be from texinfo 4.6 or # higher, else we use the "missing" dummy. if ${MAKEINFO} --version \ - | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then + | egrep 'texinfo[^0-9]*(4\.([6-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then : else MAKEINFO="$MISSING makeinfo" @@ -2499,7 +2620,6 @@ NCN_STRICT_CHECK_TOOLS(OBJDUMP, objdump) AC_SUBST(CC) AC_SUBST(CXX) AC_SUBST(CFLAGS) -AC_SUBST(CFLAGS_FOR_BUILD) AC_SUBST(CXXFLAGS) # Target tools.