X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=configure.in;h=eb52df1332ff715d379f8f46036590ca67c6ff24;hb=4b0a8b4642556d1529b35f45a3f4c948bb5df2c1;hp=42f7beacc7f986a1bb75c7e2c1e3803a13b73f2b;hpb=5965d276cd9cbfbd910fa41f9649f6a2dedfcf29;p=pf3gnuchains%2Fgcc-fork.git diff --git a/configure.in b/configure.in index 42f7beacc7f..eb52df1332f 100644 --- a/configure.in +++ b/configure.in @@ -18,6 +18,8 @@ ############################################################################## ### WARNING: this file contains embedded tabs. Do not run untabify on this file. +sinclude(config/acx.m4) + AC_INIT(move-if-change) AC_PREREQ(2.13) AC_CANONICAL_SYSTEM @@ -25,10 +27,9 @@ AC_ARG_PROGRAM # Get 'install' or 'install-sh' and its variants. AC_PROG_INSTALL +ACX_PROG_LN AC_PROG_LN_S -sinclude(config/acx.m4) - ### we might need to use some other shell than /bin/sh for running subshells ### If we are on Windows, search for the shell. This will permit people ### to not have /bin/sh, but to be able to see /SOME/PATH/sh configure @@ -125,6 +126,14 @@ fi # Double entries in build_configdirs, configdirs, or target_configdirs may # cause circular dependencies and break everything horribly. +# these library is used by various programs built for the build +# environment +# +build_libs="build-libiberty" + +# these tools are built for the build environment +build_tools="build-texinfo build-byacc build-flex build-bison build-m4" + # these libraries are used by various programs built for the host environment # host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl tix libgui zlib libbanshee libcpp" @@ -172,20 +181,14 @@ target_tools="target-examples target-groff target-gperf target-rda" ## is important because configure will choke if they ever get through. ## ${configdirs} is directories we build using the host tools. ## ${target_configdirs} is directories we build using the target tools. -# configdirs=`echo ${host_libs} ${host_tools}` target_configdirs=`echo ${target_libraries} ${target_tools}` # Only make build modules if build != host. -# This should be done more generally, but at the moment it doesn't matter. if test ${host_alias} != ${build_alias} ; then - # This is the only build module. - build_modules=libiberty -else - build_modules= + build_configdirs=`echo ${build_libs} ${build_tools}` fi - ################################################################################ srcname="gnu development package" @@ -348,12 +351,24 @@ esac # Allow --disable-libmudflap to exclude target-libmudflap case $enable_libmudflap in -yes | "") - # By default it's enabled +yes) ;; no) noconfigdirs="$noconfigdirs target-libmudflap" ;; +"") + case "${target}" in + *-*-linux*) + # Enable libmudflap by default in GNU/Linux. + ;; + *-*-freebsd*) + # Enable libmudflap by default in FreeBSD. + ;; + *) + # Disable it by default everywhere else. + noconfigdirs="$noconfigdirs target-libmudflap" + ;; + esac esac @@ -584,8 +599,13 @@ case "${target}" in *-*-cygwin*) target_configdirs="$target_configdirs target-libtermcap target-winsup" noconfigdirs="$noconfigdirs target-gperf target-libgloss ${libgcj}" - # always build newlib. - skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` + # always build newlib if winsup directory is present. + if test -d "$srcdir/winsup" + then + skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` + else + echo "Warning: winsup is missing so newlib can't be built." + fi # Can't build gdb for Cygwin if not native. case "${host}" in @@ -950,7 +970,6 @@ if test "${build}" != "${host}" ; then # If we are doing a Canadian Cross, in which the host and build systems # are not the same, we set reasonable default values for the tools. - BISON=${BISON-bison} CC=${CC-${host_alias}-gcc} CFLAGS=${CFLAGS-"-g -O2"} CXX=${CXX-${host_alias}-c++} @@ -960,49 +979,9 @@ if test "${build}" != "${host}" ; then CXX_FOR_TARGET=${CXX_FOR_TARGET-${target_alias}-c++} GCJ_FOR_TARGET=${GCJ_FOR_TARGET-${target_alias}-gcj} GCC_FOR_TARGET=${GCC_FOR_TARGET-${CC_FOR_TARGET-${target_alias}-gcc}} + BUILD_DIR_PREFIX=${build_subdir} BUILD_PREFIX=${build_alias}- BUILD_PREFIX_1=${build_alias}- - MAKEINFO=${MAKEINFO-makeinfo} - - if test -z "${YACC}" ; then - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" - for dir in $PATH; do - test -z "$dir" && dir=. - if test -f $dir/bison; then - YACC="bison -y" - break - fi - if test -f $dir/byacc; then - YACC=byacc - break - fi - if test -f $dir/yacc; then - YACC=yacc - break - fi - done - IFS="$save_ifs" - if test -z "${YACC}" ; then - YACC="bison -y" - fi - fi - - if test -z "${LEX}" ; then - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" - for dir in $PATH; do - test -z "$dir" && dir=. - if test -f $dir/flex; then - LEX=flex - break - fi - if test -f $dir/lex; then - LEX=lex - break - fi - done - IFS="$save_ifs" - LEX=${LEX-flex} - fi else # Set reasonable default values for some tools even if not Canadian. @@ -1013,71 +992,19 @@ else # in Makefile.in, so can still be overridden by fragments. # This is all going to change when we autoconfiscate... - BISON="\$(USUAL_BISON)" CC_FOR_BUILD="\$(CC)" GCC_FOR_TARGET="\$(USUAL_GCC_FOR_TARGET)" + BUILD_DIR_PREFIX= BUILD_PREFIX= BUILD_PREFIX_1=loser- - MAKEINFO="\$(USUAL_MAKEINFO)" - LEX="\$(USUAL_LEX)" - YACC="\$(USUAL_YACC)" - - # If CC is still not set, try to get gcc. - cc_prog_is_gcc= - if test -z "${CC}" ; then - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" - for dir in $PATH; do - test -z "$dir" && dir=. - if test -f $dir/gcc; then - CC="gcc" - cc_prog_is_gcc=yes - echo 'void f(){}' > conftest.c - if test -z "`${CC} -g -c conftest.c 2>&1`"; then - CFLAGS=${CFLAGS-"-g -O2"} - CXXFLAGS=${CXXFLAGS-"-g -O2"} - else - CFLAGS=${CFLAGS-"-O2"} - CXXFLAGS=${CXXFLAGS-"-O2"} - fi - rm -f conftest* - break - fi - done - IFS="$save_ifs" - CC=${CC-cc} - else - # Determine if we are using gcc. - cat > conftest.c </dev/null 2>&1; then - cc_prog_is_gcc=yes - fi - rm -f conftest.c - if test -z "${CFLAGS}"; then - # Here CC is set but CFLAGS is not. Use a quick hack to use -O2 if CC - # is set to a version of gcc. - if test "$cc_prog_is_gcc" = yes; then - echo 'void f(){}' > conftest.c - if test -z "`${CC} -g -c conftest.c 2>&1`"; then - CFLAGS=${CFLAGS-"-g -O2"} - CXXFLAGS=${CXXFLAGS-"-g -O2"} - else - CFLAGS=${CFLAGS-"-O2"} - CXXFLAGS=${CXXFLAGS-"-O2"} - fi - rm -f conftest* - fi - fi - fi + + AC_PROG_CC # We must set the default linker to the linker used by gcc for the correct # operation of libtool. If LD is not defined and we are using gcc, try to # set the LD default to the ld used by gcc. if test -z "$LD"; then - if test "$cc_prog_is_gcc" = yes; then + if test "$GCC" = yes; then case $build in *-*-mingw*) gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;; @@ -1343,6 +1270,15 @@ fi # Quietly strip out all directories which aren't configurable in this tree. # This relies on all configurable subdirectories being autoconfiscated, which # is now the case. +build_configdirs_all="$build_configdirs" +build_configdirs= +for i in ${build_configdirs_all} ; do + j=`echo $i | sed -e s/build-//g` + if test -f ${srcdir}/$j/configure ; then + build_configdirs="${build_configdirs} $i" + fi +done + configdirs_all="$configdirs" configdirs= for i in ${configdirs_all} ; do @@ -1350,6 +1286,7 @@ for i in ${configdirs_all} ; do configdirs="${configdirs} $i" fi done + target_configdirs_all="$target_configdirs" target_configdirs= for i in ${target_configdirs_all} ; do @@ -1376,7 +1313,7 @@ if test -n "${notsupp}" && test -z "${norecursion}" ; then appdirs="" break fi - if echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then + if echo " ${target_configdirs} " | grep " target-${dir} " >/dev/null 2>&1; then appdirs="" break fi @@ -1591,12 +1528,16 @@ esac tooldir='${exec_prefix}'/${target_alias} build_tooldir=${tooldir} -# Generate default definitions for YACC, M4, LEX. These are used if the -# Makefile can't locate these programs in objdir. +# Generate default definitions for YACC, M4, LEX and other programs that run +# on the build machine. These are used if the Makefile can't locate these +# programs in objdir. MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing -AC_CHECK_PROGS([DEFAULT_YACC], ['bison -y' byacc yacc], [$MISSING bison]) -AC_CHECK_PROGS([DEFAULT_M4], [gm4 gnum4 m4], [$MISSING m4]) -AC_CHECK_PROGS([DEFAULT_LEX], [flex lex], [$MISSING flex]) +AC_CHECK_PROGS([CONFIGURED_BISON], [bison], [$MISSING bison]) +AC_CHECK_PROGS([CONFIGURED_YACC], ['bison -y' byacc yacc], [$MISSING bison -y]) +AC_CHECK_PROGS([CONFIGURED_M4], [gm4 gnum4 m4], [$MISSING m4]) +AC_CHECK_PROGS([CONFIGURED_FLEX], [flex], [$MISSING flex]) +AC_CHECK_PROGS([CONFIGURED_LEX], [flex lex], [$MISSING flex]) +AC_CHECK_PROGS([CONFIGURED_MAKEINFO], makeinfo, [$MISSING makeinfo]) # Create a .gdbinit file which runs the one in srcdir # and tells GDB to look there for source files. @@ -1679,17 +1620,7 @@ esac # Record target_configdirs and the configure arguments for target and # build configuration in Makefile. target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'` - -# This is the final value for target_configdirs. configdirs already -# has its final value, as does build_modules. It's time to create some -# lists of valid targets. - -all_build_modules= -configure_build_modules= -for module in ${build_modules} ; do - all_build_modules=all-build-${module} - configure_build_modules=configure-build-${module} -done +build_configdirs=`echo "${build_configdirs}" | sed -e 's/build-//g'` # Determine whether gdb needs tk/tcl or not. # Use 'maybe' since enable_gdbtk might be true even if tk isn't available @@ -1730,7 +1661,32 @@ esac # to maintain later. In this particular case, you just have to be careful # not to nest @if/@endif pairs, because configure will not warn you at all. -for module in ${build_modules} ; do +AC_ARG_ENABLE([bootstrap], +[ --enable-bootstrap Enable bootstrapping [no]],, +enable_bootstrap=no) +if test -d ${srcdir}/gcc; then + case "$host:$target:$enable_bootstrap" in + $build:$build:yes | *:no) ;; + *:yes) AC_MSG_ERROR([cannot bootstrap a cross-compiler]) ;; + *) AC_MSG_ERROR([invalid option for --enable-bootstrap]) ;; + esac +else + if test $enable_bootstrap = yes; then + AC_MSG_ERROR([cannot bootstrap without a compiler]) + fi +fi + +case "$enable_bootstrap" in + yes) + default_target=bootstrap + bootstrap_suffix=bootstrap ;; + no) + default_target=all + bootstrap_suffix=no-bootstrap ;; +esac +AC_SUBST(default_target) + +for module in ${build_configdirs} ; do if test -z "${no_recursion}" \ && test -f ${build_subdir}/${module}/Makefile; then echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure" @@ -1738,7 +1694,9 @@ for module in ${build_modules} ; do fi extrasub="$extrasub /^@if build-$module\$/d -/^@endif build-$module\$/d" +/^@endif build-$module\$/d +/^@if build-$module-$bootstrap_suffix\$/d +/^@endif build-$module-$bootstrap_suffix\$/d" done for module in ${configdirs} ; do if test -z "${no_recursion}" \ @@ -1748,7 +1706,9 @@ for module in ${configdirs} ; do fi extrasub="$extrasub /^@if $module\$/d -/^@endif $module\$/d" +/^@endif $module\$/d +/^@if $module-$bootstrap_suffix\$/d +/^@endif $module-$bootstrap_suffix\$/d" done for module in ${target_configdirs} ; do if test -z "${no_recursion}" \ @@ -1758,8 +1718,11 @@ for module in ${target_configdirs} ; do fi extrasub="$extrasub /^@if target-$module\$/d -/^@endif target-$module\$/d" +/^@endif target-$module\$/d +/^@if target-$module-$bootstrap_suffix\$/d +/^@endif target-$module-$bootstrap_suffix\$/d" done + extrasub="$extrasub /^@if /,/^@endif /d" @@ -2033,7 +1996,7 @@ elif test -d ${srcdir}/gcc; then elif test "$host" = "$target"; then GFORTRAN_FOR_TARGET='gfortran' else - GFORTRAN_FOR_TARGET=`echo gfortran | sed -e 's/x/x/' ${program_transform_name}` + GFORTRAN_FOR_TARGET=`echo gfortran | sed "${program_transform_name}"` fi case $GFORTRAN_FOR_TARGET in *' $(FLAGS_FOR_TARGET)') ;; @@ -2088,10 +2051,13 @@ CXX_FOR_TARGET_FOR_RECURSIVE_MAKE="\$(STAGE_CC_WRAPPER) ${qqCXX_FOR_TARGET}" RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE="\$(STAGE_CC_WRAPPER) ${qqRAW_CXX_FOR_TARGET}" # Makefile fragments. -host_makefile_frag=${srcdir}/${host_makefile_frag} -target_makefile_frag=${srcdir}/${target_makefile_frag} -alphaieee_frag=${srcdir}/${alphaieee_frag} -ospace_frag=${srcdir}/${ospace_frag} +for frag in host_makefile_frag target_makefile_frag alphaieee_frag ospace_frag; +do + eval fragval=\$$frag + if test $fragval != /dev/null; then + eval $frag=${srcdir}/$fragval + fi +done AC_SUBST_FILE(host_makefile_frag) AC_SUBST_FILE(target_makefile_frag) AC_SUBST_FILE(alphaieee_frag) @@ -2100,6 +2066,7 @@ AC_SUBST_FILE(ospace_frag) # Miscellanea: directories, flags, etc. AC_SUBST(SET_LIB_PATH) AC_SUBST(RPATH_ENVVAR) +AC_SUBST(BUILD_DIR_PREFIX) AC_SUBST(BUILD_PREFIX) AC_SUBST(BUILD_PREFIX_1) AC_SUBST(gcc_version_trigger) @@ -2112,8 +2079,7 @@ AC_SUBST(libstdcxx_incdir) # Build module lists & subconfigure args. AC_SUBST(build_configargs) -AC_SUBST(configure_build_modules) -AC_SUBST(all_build_modules) +AC_SUBST(build_configdirs) # Host module lists & subconfigure args. AC_SUBST(host_configargs) @@ -2124,11 +2090,7 @@ AC_SUBST(target_configargs) AC_SUBST(target_configdirs) # Build tools. -AC_SUBST(BISON) AC_SUBST(CC_FOR_BUILD) -AC_SUBST(LEX) -AC_SUBST(MAKEINFO) -AC_SUBST(YACC) AC_SUBST(config_shell) # Host tools. @@ -2146,9 +2108,6 @@ AC_SUBST(CXX) AC_SUBST(CFLAGS) AC_SUBST(CFLAGS_FOR_BUILD) AC_SUBST(CXXFLAGS) -AC_SUBST(DEFAULT_YACC) -AC_SUBST(DEFAULT_LEX) -AC_SUBST(DEFAULT_M4) # Target tools. NCN_STRICT_CHECK_TARGET_TOOL(CONFIGURED_AR_FOR_TARGET, ar)