From 6a9cf61e0fb67ba9df9ddd800cc8a4c272f91795 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 2 Jul 2004 07:56:07 +0000 Subject: [PATCH] 2004-07-01 Paolo Bonzini * Makefile.def (build_modules): Add bison, byacc, flex, m4, texinfo. (flags_to_pass): Add FLEX. * Makefile.tpl (BUILD_DIR_PREFIX, BASE_EXPORTS): New. (BUILD_EXPORTS, HOST_EXPORTS, BASE_TARGET_EXPORTS): Include it. (DEFAULT_YACC, USUAL_YACC, DEFAULT_LEX, USUAL_LEX, DEFAULT_M4, DEFAULT_MAKEINFO): Remove. (CONFIGURED_YACC, CONFIGURED_FLEX, CONFIGURED_BISON, CONFIGURED_LEX, CONFIGURED_M4, CONFIGURED_MAKEINFO): Substitute. (YACC, FLEX, BISON, LEX, M4, MAKEINFO): Define to look into objdir or else use configured tool. (all-build): New. (all): Depend on it. (Build module dependencies): Add. * Makefile.in: Regenerate. * configure.in: Better support for multiple build modules, matching what is done for host/target modules. Do not look for "plausible" locations of build tools if Canadian cross. Use autoconf's AC_PROG_CC to find a C compiler. Define BUILD_DIR_PREFIX. Look for flex, makeinfo and m4. * configure: Regenerate. --- ChangeLog | 24 +++ Makefile.def | 6 + Makefile.in | 423 +++++++++++++++++++++++++++++++++++---- Makefile.tpl | 101 ++++++---- configure | 545 +++++++++++++++++++++++++-------------------------- configure.in | 170 ++++------------ 6 files changed, 785 insertions(+), 484 deletions(-) diff --git a/ChangeLog b/ChangeLog index d3c9e97928c..2da98a5e3c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2004-07-01 Paolo Bonzini + + * Makefile.def (build_modules): Add bison, byacc, flex, + m4, texinfo. + (flags_to_pass): Add FLEX. + * Makefile.tpl (BUILD_DIR_PREFIX, BASE_EXPORTS): New. + (BUILD_EXPORTS, HOST_EXPORTS, BASE_TARGET_EXPORTS): Include it. + (DEFAULT_YACC, USUAL_YACC, DEFAULT_LEX, USUAL_LEX, DEFAULT_M4, + DEFAULT_MAKEINFO): Remove. + (CONFIGURED_YACC, CONFIGURED_FLEX, CONFIGURED_BISON, + CONFIGURED_LEX, CONFIGURED_M4, CONFIGURED_MAKEINFO): Substitute. + (YACC, FLEX, BISON, LEX, M4, MAKEINFO): Define to look into + objdir or else use configured tool. + (all-build): New. + (all): Depend on it. + (Build module dependencies): Add. + * Makefile.in: Regenerate. + * configure.in: Better support for multiple build modules, + matching what is done for host/target modules. Do not look + for "plausible" locations of build tools if Canadian cross. + Use autoconf's AC_PROG_CC to find a C compiler. Define + BUILD_DIR_PREFIX. Look for flex, makeinfo and m4. + * configure: Regenerate. + 2004-06-22 Paolo Bonzini * Makefile.tpl (HOST_EXPORTS): Fix pasto. diff --git a/Makefile.def b/Makefile.def index b3941381420..511876f8123 100644 --- a/Makefile.def +++ b/Makefile.def @@ -26,6 +26,11 @@ AutoGen definitions Makefile.tpl; build_modules= { module= libiberty; }; build_modules= { module= libbanshee; }; +build_modules= { module= bison; }; +build_modules= { module= byacc; }; +build_modules= { module= flex; }; +build_modules= { module= m4; }; +build_modules= { module= texinfo; }; host_modules= { module= ash; }; host_modules= { module= autoconf; }; @@ -177,6 +182,7 @@ flags_to_pass = { flag= BISON ; }; flags_to_pass = { flag= CC_FOR_BUILD ; }; flags_to_pass = { flag= CXX_FOR_BUILD ; }; flags_to_pass = { flag= EXPECT ; }; +flags_to_pass = { flag= FLEX ; }; flags_to_pass = { flag= INSTALL ; }; flags_to_pass = { flag= INSTALL_DATA ; }; flags_to_pass = { flag= INSTALL_PROGRAM ; }; diff --git a/Makefile.in b/Makefile.in index 5a42f868c43..2dbd157a3a3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -110,11 +110,23 @@ BUILD_SUBDIR = @build_subdir@ # This is set by the configure script to the arguments to use when configuring # directories built for the build system. BUILD_CONFIGARGS = @build_configargs@ + +# This is the list of variables to export in the environment when +# configuring any subdirectory. It must also be exported whenever +# recursing into a build directory in case that directory's Makefile +# re-runs configure. +BASE_EXPORTS = \ + FLEX="$(FLEX)"; export FLEX; \ + LEX="$(LEX)"; export LEX; \ + BISON="$(BISON)"; export BISON; \ + YACC="$(YACC)"; export YACC; \ + M4="$(M4)"; export M4; \ + MAKEINFO="$(MAKEINFO)"; export MAKEINFO; + # This is the list of variables to export in the environment when -# configuring subdirectories for the build system. It must also be -# exported whenever recursing into a build directory in case that -# directory's Makefile re-runs configure. +# configuring subdirectories for the build system. BUILD_EXPORTS = \ + $(BASE_EXPORTS) \ AR="$(AR_FOR_BUILD)"; export AR; \ AS="$(AS_FOR_BUILD)"; export AS; \ CC="$(CC_FOR_BUILD)"; export CC; \ @@ -137,10 +149,9 @@ SUBDIRS = @configdirs@ # directories built for the host system. HOST_CONFIGARGS = @host_configargs@ # This is the list of variables to export in the environment when -# configuring subdirectories for the host system. It must also be -# exported whenever recursing into a host directory in case that -# directory's Makefile re-runs configure. +# configuring subdirectories for the host system. HOST_EXPORTS = \ + $(BASE_EXPORTS) \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ @@ -176,10 +187,9 @@ TARGET_SUBDIR = @target_subdir@ # directories built for the target. TARGET_CONFIGARGS = @target_configargs@ # This is the list of variables to export in the environment when -# configuring subdirectories for the host system. It must also be -# exported whenever recursing into a host directory in case that -# directory's Makefile re-runs configure. +# configuring subdirectories for the host system. BASE_TARGET_EXPORTS = \ + $(BASE_EXPORTS) \ AR="$(AR_FOR_TARGET)"; export AR; \ AS="$(AS_FOR_TARGET)"; export AS; \ CC="$(CC_FOR_TARGET)"; export CC; \ @@ -230,47 +240,55 @@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CXX_FOR_BUILD = $(CXX) +# Path to the build directory for a Canadian cross, empty otherwise. +BUILD_DIR_PREFIX = @BUILD_DIR_PREFIX@ + # Special variables passed down in EXTRA_GCC_FLAGS. They are defined # here so that they can be overridden by Makefile fragments. BUILD_PREFIX = @BUILD_PREFIX@ BUILD_PREFIX_1 = @BUILD_PREFIX_1@ -BISON=@BISON@ -USUAL_BISON = `if [ -f $$r/bison/bison ] ; then \ - echo $$r/bison/bison -L $$s/bison/ ; \ +CONFIGURED_BISON = @CONFIGURED_BISON@ +BISON = `if [ -f $$r/$(BUILD_DIR_PREFIX)/bison/bison ] ; then \ + echo $$r/$(BUILD_DIR_PREFIX)/bison/bison -L $$s/bison/ ; \ else \ - echo bison ; \ + echo ${CONFIGURED_BISON} ; \ fi` -DEFAULT_YACC = @DEFAULT_YACC@ -YACC=@YACC@ -USUAL_YACC = `if [ -f $$r/bison/bison ] ; then \ - echo $$r/bison/bison -y -L $$s/bison/ ; \ - elif [ -f $$r/byacc/byacc ] ; then \ - echo $$r/byacc/byacc ; \ +CONFIGURED_YACC = @CONFIGURED_YACC@ +YACC = `if [ -f $$s/$(BUILD_DIR_PREFIX)/bison/bison ] ; then \ + echo $$r/$(BUILD_DIR_PREFIX)/bison/bison -y -L $$s/bison/ ; \ + elif [ -f $$s/$(BUILD_DIR_PREFIX)/byacc/byacc ] ; then \ + echo $$r/$(BUILD_DIR_PREFIX)/byacc/byacc ; \ else \ - echo ${DEFAULT_YACC} ; \ + echo ${CONFIGURED_YACC} ; \ fi` -DEFAULT_LEX = @DEFAULT_LEX@ -LEX=@LEX@ -USUAL_LEX = `if [ -f $$r/flex/flex ] ; \ - then echo $$r/flex/flex ; \ - else echo ${DEFAULT_LEX} ; fi` +CONFIGURED_FLEX = @CONFIGURED_FLEX@ +FLEX = `if [ -f $$r/$(BUILD_DIR_PREFIX)/flex/flex ] ; \ + then echo $$r/$(BUILD_DIR_PREFIX)/flex/flex ; \ + else echo ${CONFIGURED_FLEX} ; fi` -DEFAULT_M4 = @DEFAULT_M4@ -M4 = `if [ -f $$r/m4/m4 ] ; \ - then echo $$r/m4/m4 ; \ - else echo ${DEFAULT_M4} ; fi` +CONFIGURED_LEX = @CONFIGURED_LEX@ +LEX = `if [ -f $$r/$(BUILD_DIR_PREFIX)/flex/flex ] ; \ + then echo $$r/$(BUILD_DIR_PREFIX)/flex/flex ; \ + else echo ${CONFIGURED_LEX} ; fi` + +CONFIGURED_M4 = @CONFIGURED_M4@ +M4 = `if [ -f $$r/$(BUILD_DIR_PREFIX)/m4/m4 ] ; \ + then echo $$r/$(BUILD_DIR_PREFIX)/m4/m4 ; \ + else echo ${CONFIGURED_M4} ; fi` # For an installed makeinfo, we require it to be from texinfo 4.2 or -# higher, else we use the "missing" dummy. -MAKEINFO=@MAKEINFO@ -USUAL_MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \ - then echo $$r/texinfo/makeinfo/makeinfo ; \ - else if (makeinfo --version \ +# higher, else we use the "missing" dummy. We also pass the subdirectory +# makeinfo even if only the Makefile is there, because Texinfo builds its +# manual when made, and it requires its own version. +CONFIGURED_MAKEINFO = @CONFIGURED_MAKEINFO@ +MAKEINFO = `if [ -f $$r/$(BUILD_DIR_PREFIX)/texinfo/makeinfo/Makefile ] ; \ + then echo $$r/$(BUILD_DIR_PREFIX)/texinfo/makeinfo/makeinfo ; \ + else if (${CONFIGURED_MAKEINFO} --version \ | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])') >/dev/null 2>&1; \ - then echo makeinfo; else echo $$s/missing makeinfo; fi; fi` + then echo ${CONFIGURED_MAKEINFO}; else echo $$s/missing makeinfo; fi; fi` # This just becomes part of the MAKEINFO definition passed down to # sub-makes. It lets flags be given on the command line while still @@ -506,6 +524,7 @@ BASE_FLAGS_TO_PASS = \ "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \ "EXPECT=$(EXPECT)" \ + "FLEX=$(FLEX)" \ "INSTALL=$(INSTALL)" \ "INSTALL_DATA=$(INSTALL_DATA)" \ "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ @@ -713,8 +732,17 @@ configure-target: \ # The target built for a native non-bootstrap build. .PHONY: all -all: @all_build_modules@ all-host all-target - +all: all-build all-host all-target + +.PHONY: all-build +all-build: \ + maybe-all-build-libiberty \ + maybe-all-build-libbanshee \ + maybe-all-build-bison \ + maybe-all-build-byacc \ + maybe-all-build-flex \ + maybe-all-build-m4 \ + maybe-all-build-texinfo .PHONY: all-host all-host: maybe-all-gcc \ maybe-all-ash \ @@ -2159,6 +2187,321 @@ all-build-libbanshee: configure-build-libbanshee (cd $(BUILD_SUBDIR)/libbanshee && $(MAKE) all) @endif build-libbanshee +.PHONY: configure-build-bison maybe-configure-build-bison +maybe-configure-build-bison: +@if build-bison +maybe-configure-build-bison: configure-build-bison +configure-build-bison: + @test ! -f $(BUILD_SUBDIR)/bison/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/bison ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(BUILD_EXPORTS) \ + echo Configuring in $(BUILD_SUBDIR)/bison; \ + cd "$(BUILD_SUBDIR)/bison" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(BUILD_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(BUILD_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/bison "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ + else \ + true; \ + fi; \ + else \ + exit 1; \ + fi; \ + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/bison"; \ + libsrcdir="$$s/bison"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(BUILD_CONFIGARGS) $${srcdiroption} \ + --with-build-subdir="$(BUILD_SUBDIR)" \ + || exit 1 +@endif build-bison + +.PHONY: all-build-bison maybe-all-build-bison +maybe-all-build-bison: +@if build-bison +maybe-all-build-bison: all-build-bison +all-build-bison: configure-build-bison + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(BUILD_EXPORTS) \ + (cd $(BUILD_SUBDIR)/bison && $(MAKE) all) +@endif build-bison + +.PHONY: configure-build-byacc maybe-configure-build-byacc +maybe-configure-build-byacc: +@if build-byacc +maybe-configure-build-byacc: configure-build-byacc +configure-build-byacc: + @test ! -f $(BUILD_SUBDIR)/byacc/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/byacc ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(BUILD_EXPORTS) \ + echo Configuring in $(BUILD_SUBDIR)/byacc; \ + cd "$(BUILD_SUBDIR)/byacc" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(BUILD_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(BUILD_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/byacc "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ + else \ + true; \ + fi; \ + else \ + exit 1; \ + fi; \ + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/byacc"; \ + libsrcdir="$$s/byacc"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(BUILD_CONFIGARGS) $${srcdiroption} \ + --with-build-subdir="$(BUILD_SUBDIR)" \ + || exit 1 +@endif build-byacc + +.PHONY: all-build-byacc maybe-all-build-byacc +maybe-all-build-byacc: +@if build-byacc +maybe-all-build-byacc: all-build-byacc +all-build-byacc: configure-build-byacc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(BUILD_EXPORTS) \ + (cd $(BUILD_SUBDIR)/byacc && $(MAKE) all) +@endif build-byacc + +.PHONY: configure-build-flex maybe-configure-build-flex +maybe-configure-build-flex: +@if build-flex +maybe-configure-build-flex: configure-build-flex +configure-build-flex: + @test ! -f $(BUILD_SUBDIR)/flex/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/flex ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(BUILD_EXPORTS) \ + echo Configuring in $(BUILD_SUBDIR)/flex; \ + cd "$(BUILD_SUBDIR)/flex" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(BUILD_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(BUILD_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/flex "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ + else \ + true; \ + fi; \ + else \ + exit 1; \ + fi; \ + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/flex"; \ + libsrcdir="$$s/flex"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(BUILD_CONFIGARGS) $${srcdiroption} \ + --with-build-subdir="$(BUILD_SUBDIR)" \ + || exit 1 +@endif build-flex + +.PHONY: all-build-flex maybe-all-build-flex +maybe-all-build-flex: +@if build-flex +maybe-all-build-flex: all-build-flex +all-build-flex: configure-build-flex + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(BUILD_EXPORTS) \ + (cd $(BUILD_SUBDIR)/flex && $(MAKE) all) +@endif build-flex + +.PHONY: configure-build-m4 maybe-configure-build-m4 +maybe-configure-build-m4: +@if build-m4 +maybe-configure-build-m4: configure-build-m4 +configure-build-m4: + @test ! -f $(BUILD_SUBDIR)/m4/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/m4 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(BUILD_EXPORTS) \ + echo Configuring in $(BUILD_SUBDIR)/m4; \ + cd "$(BUILD_SUBDIR)/m4" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(BUILD_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(BUILD_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/m4 "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ + else \ + true; \ + fi; \ + else \ + exit 1; \ + fi; \ + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/m4"; \ + libsrcdir="$$s/m4"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(BUILD_CONFIGARGS) $${srcdiroption} \ + --with-build-subdir="$(BUILD_SUBDIR)" \ + || exit 1 +@endif build-m4 + +.PHONY: all-build-m4 maybe-all-build-m4 +maybe-all-build-m4: +@if build-m4 +maybe-all-build-m4: all-build-m4 +all-build-m4: configure-build-m4 + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(BUILD_EXPORTS) \ + (cd $(BUILD_SUBDIR)/m4 && $(MAKE) all) +@endif build-m4 + +.PHONY: configure-build-texinfo maybe-configure-build-texinfo +maybe-configure-build-texinfo: +@if build-texinfo +maybe-configure-build-texinfo: configure-build-texinfo +configure-build-texinfo: + @test ! -f $(BUILD_SUBDIR)/texinfo/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/texinfo ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(BUILD_EXPORTS) \ + echo Configuring in $(BUILD_SUBDIR)/texinfo; \ + cd "$(BUILD_SUBDIR)/texinfo" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(BUILD_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(BUILD_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/texinfo "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ + else \ + true; \ + fi; \ + else \ + exit 1; \ + fi; \ + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/texinfo"; \ + libsrcdir="$$s/texinfo"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(BUILD_CONFIGARGS) $${srcdiroption} \ + --with-build-subdir="$(BUILD_SUBDIR)" \ + || exit 1 +@endif build-texinfo + +.PHONY: all-build-texinfo maybe-all-build-texinfo +maybe-all-build-texinfo: +@if build-texinfo +maybe-all-build-texinfo: all-build-texinfo +all-build-texinfo: configure-build-texinfo + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(BUILD_EXPORTS) \ + (cd $(BUILD_SUBDIR)/texinfo && $(MAKE) all) +@endif build-texinfo + # -------------------------------------- # Modules which run on the host machine @@ -28842,6 +29185,12 @@ profiledbootstrap: all-bootstrap configure-gcc # are specified by depending on a 'maybe-' target. If you're not sure, # it's safer to use a soft dependency. +# Build modules +all-build-bison: maybe-all-build-texinfo +all-build-flex: maybe-all-build-texinfo +all-build-libiberty: maybe-all-build-texinfo +all-build-m4: maybe-all-build-libiberty maybe-all-build-texinfo + # Host modules specific to gcc. # GCC needs to identify certain tools. # GCC also needs the information exported by the intl configure script. diff --git a/Makefile.tpl b/Makefile.tpl index 982620d530a..014aa879ce7 100644 --- a/Makefile.tpl +++ b/Makefile.tpl @@ -113,11 +113,23 @@ BUILD_SUBDIR = @build_subdir@ # This is set by the configure script to the arguments to use when configuring # directories built for the build system. BUILD_CONFIGARGS = @build_configargs@ + +# This is the list of variables to export in the environment when +# configuring any subdirectory. It must also be exported whenever +# recursing into a build directory in case that directory's Makefile +# re-runs configure. +BASE_EXPORTS = \ + FLEX="$(FLEX)"; export FLEX; \ + LEX="$(LEX)"; export LEX; \ + BISON="$(BISON)"; export BISON; \ + YACC="$(YACC)"; export YACC; \ + M4="$(M4)"; export M4; \ + MAKEINFO="$(MAKEINFO)"; export MAKEINFO; + # This is the list of variables to export in the environment when -# configuring subdirectories for the build system. It must also be -# exported whenever recursing into a build directory in case that -# directory's Makefile re-runs configure. +# configuring subdirectories for the build system. BUILD_EXPORTS = \ + $(BASE_EXPORTS) \ AR="$(AR_FOR_BUILD)"; export AR; \ AS="$(AS_FOR_BUILD)"; export AS; \ CC="$(CC_FOR_BUILD)"; export CC; \ @@ -140,10 +152,9 @@ SUBDIRS = @configdirs@ # directories built for the host system. HOST_CONFIGARGS = @host_configargs@ # This is the list of variables to export in the environment when -# configuring subdirectories for the host system. It must also be -# exported whenever recursing into a host directory in case that -# directory's Makefile re-runs configure. +# configuring subdirectories for the host system. HOST_EXPORTS = \ + $(BASE_EXPORTS) \ CC="$(CC)"; export CC; \ CFLAGS="$(CFLAGS)"; export CFLAGS; \ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ @@ -179,10 +190,9 @@ TARGET_SUBDIR = @target_subdir@ # directories built for the target. TARGET_CONFIGARGS = @target_configargs@ # This is the list of variables to export in the environment when -# configuring subdirectories for the host system. It must also be -# exported whenever recursing into a host directory in case that -# directory's Makefile re-runs configure. +# configuring subdirectories for the host system. BASE_TARGET_EXPORTS = \ + $(BASE_EXPORTS) \ AR="$(AR_FOR_TARGET)"; export AR; \ AS="$(AS_FOR_TARGET)"; export AS; \ CC="$(CC_FOR_TARGET)"; export CC; \ @@ -233,47 +243,55 @@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CXX_FOR_BUILD = $(CXX) +# Path to the build directory for a Canadian cross, empty otherwise. +BUILD_DIR_PREFIX = @BUILD_DIR_PREFIX@ + # Special variables passed down in EXTRA_GCC_FLAGS. They are defined # here so that they can be overridden by Makefile fragments. BUILD_PREFIX = @BUILD_PREFIX@ BUILD_PREFIX_1 = @BUILD_PREFIX_1@ -BISON=@BISON@ -USUAL_BISON = `if [ -f $$r/bison/bison ] ; then \ - echo $$r/bison/bison -L $$s/bison/ ; \ +CONFIGURED_BISON = @CONFIGURED_BISON@ +BISON = `if [ -f $$r/$(BUILD_DIR_PREFIX)/bison/bison ] ; then \ + echo $$r/$(BUILD_DIR_PREFIX)/bison/bison -L $$s/bison/ ; \ else \ - echo bison ; \ + echo ${CONFIGURED_BISON} ; \ fi` -DEFAULT_YACC = @DEFAULT_YACC@ -YACC=@YACC@ -USUAL_YACC = `if [ -f $$r/bison/bison ] ; then \ - echo $$r/bison/bison -y -L $$s/bison/ ; \ - elif [ -f $$r/byacc/byacc ] ; then \ - echo $$r/byacc/byacc ; \ +CONFIGURED_YACC = @CONFIGURED_YACC@ +YACC = `if [ -f $$s/$(BUILD_DIR_PREFIX)/bison/bison ] ; then \ + echo $$r/$(BUILD_DIR_PREFIX)/bison/bison -y -L $$s/bison/ ; \ + elif [ -f $$s/$(BUILD_DIR_PREFIX)/byacc/byacc ] ; then \ + echo $$r/$(BUILD_DIR_PREFIX)/byacc/byacc ; \ else \ - echo ${DEFAULT_YACC} ; \ + echo ${CONFIGURED_YACC} ; \ fi` -DEFAULT_LEX = @DEFAULT_LEX@ -LEX=@LEX@ -USUAL_LEX = `if [ -f $$r/flex/flex ] ; \ - then echo $$r/flex/flex ; \ - else echo ${DEFAULT_LEX} ; fi` +CONFIGURED_FLEX = @CONFIGURED_FLEX@ +FLEX = `if [ -f $$r/$(BUILD_DIR_PREFIX)/flex/flex ] ; \ + then echo $$r/$(BUILD_DIR_PREFIX)/flex/flex ; \ + else echo ${CONFIGURED_FLEX} ; fi` + +CONFIGURED_LEX = @CONFIGURED_LEX@ +LEX = `if [ -f $$r/$(BUILD_DIR_PREFIX)/flex/flex ] ; \ + then echo $$r/$(BUILD_DIR_PREFIX)/flex/flex ; \ + else echo ${CONFIGURED_LEX} ; fi` -DEFAULT_M4 = @DEFAULT_M4@ -M4 = `if [ -f $$r/m4/m4 ] ; \ - then echo $$r/m4/m4 ; \ - else echo ${DEFAULT_M4} ; fi` +CONFIGURED_M4 = @CONFIGURED_M4@ +M4 = `if [ -f $$r/$(BUILD_DIR_PREFIX)/m4/m4 ] ; \ + then echo $$r/$(BUILD_DIR_PREFIX)/m4/m4 ; \ + else echo ${CONFIGURED_M4} ; fi` # For an installed makeinfo, we require it to be from texinfo 4.2 or -# higher, else we use the "missing" dummy. -MAKEINFO=@MAKEINFO@ -USUAL_MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \ - then echo $$r/texinfo/makeinfo/makeinfo ; \ - else if (makeinfo --version \ +# higher, else we use the "missing" dummy. We also pass the subdirectory +# makeinfo even if only the Makefile is there, because Texinfo builds its +# manual when made, and it requires its own version. +CONFIGURED_MAKEINFO = @CONFIGURED_MAKEINFO@ +MAKEINFO = `if [ -f $$r/$(BUILD_DIR_PREFIX)/texinfo/makeinfo/Makefile ] ; \ + then echo $$r/$(BUILD_DIR_PREFIX)/texinfo/makeinfo/makeinfo ; \ + else if (${CONFIGURED_MAKEINFO} --version \ | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])') >/dev/null 2>&1; \ - then echo makeinfo; else echo $$s/missing makeinfo; fi; fi` + then echo ${CONFIGURED_MAKEINFO}; else echo $$s/missing makeinfo; fi; fi` # This just becomes part of the MAKEINFO definition passed down to # sub-makes. It lets flags be given on the command line while still @@ -577,8 +595,13 @@ configure-target: [+ # The target built for a native non-bootstrap build. .PHONY: all -all: @all_build_modules@ all-host all-target +all: all-build all-host all-target +.PHONY: all-build +all-build: [+ + FOR build_modules +] \ + maybe-all-build-[+module+][+ + ENDFOR build_modules +] .PHONY: all-host all-host: maybe-all-gcc [+ FOR host_modules +] \ @@ -1642,6 +1665,12 @@ profiledbootstrap: all-bootstrap configure-gcc # are specified by depending on a 'maybe-' target. If you're not sure, # it's safer to use a soft dependency. +# Build modules +all-build-bison: maybe-all-build-texinfo +all-build-flex: maybe-all-build-texinfo +all-build-libiberty: maybe-all-build-texinfo +all-build-m4: maybe-all-build-libiberty maybe-all-build-texinfo + # Host modules specific to gcc. # GCC needs to identify certain tools. # GCC also needs the information exported by the intl configure script. diff --git a/configure b/configure index 729827f29bc..ed10f36b0d6 100755 --- a/configure +++ b/configure @@ -877,6 +877,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" @@ -924,20 +932,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" @@ -1736,7 +1738,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++} @@ -1746,49 +1747,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. @@ -1799,100 +1760,16 @@ 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 - # 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 - case $build in - *-*-mingw*) - gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;; - *) - gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;; - esac - case $gcc_prog_ld in - # Accept absolute paths. - [\\/]* | [A-Za-z]:[\\/]*) - LD="$gcc_prog_ld" ;; - esac - fi - fi - - CXX=${CXX-"c++"} - CFLAGS=${CFLAGS-"-g"} - CXXFLAGS=${CXXFLAGS-"-g -O2"} -fi - -if test $host != $build; then - ac_tool_prefix=${host_alias}- -else - ac_tool_prefix= -fi - -# Extract the first word of "gcc", so it can be a program name with args. + # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1896: checking for $ac_word" >&5 +echo "configure:1773: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1922,7 +1799,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1926: checking for $ac_word" >&5 +echo "configure:1803: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1973,7 +1850,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1977: checking for $ac_word" >&5 +echo "configure:1854: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2005,7 +1882,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2009: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1886: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -2016,12 +1893,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2020 "configure" +#line 1897 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -2047,12 +1924,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:2051: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1928: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:2056: checking whether we are using GNU C" >&5 +echo "configure:1933: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2061,7 +1938,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2065: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1942: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -2080,7 +1957,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2084: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1961: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2112,11 +1989,42 @@ else fi + # 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 "$GCC" = yes; then + case $build in + *-*-mingw*) + gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;; + *) + gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;; + esac + case $gcc_prog_ld in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + LD="$gcc_prog_ld" ;; + esac + fi + fi + + CXX=${CXX-"c++"} + CFLAGS=${CFLAGS-"-g"} + CXXFLAGS=${CXXFLAGS-"-g -O2"} +fi + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + + # Extract the first word of "${ac_tool_prefix}gnatbind", so it can be a program name with args. set dummy ${ac_tool_prefix}gnatbind; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2120: checking for $ac_word" >&5 +echo "configure:2028: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2148,7 +2056,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "gnatbind", so it can be a program name with args. set dummy gnatbind; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2152: checking for $ac_word" >&5 +echo "configure:2060: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2181,7 +2089,7 @@ fi fi echo $ac_n "checking whether compiler driver understands Ada""... $ac_c" 1>&6 -echo "configure:2185: checking whether compiler driver understands Ada" >&5 +echo "configure:2093: checking whether compiler driver understands Ada" >&5 if eval "test \"`echo '$''{'acx_cv_cc_gcc_supports_ada'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2214,7 +2122,7 @@ else fi echo $ac_n "checking how to compare bootstrapped objects""... $ac_c" 1>&6 -echo "configure:2218: checking how to compare bootstrapped objects" >&5 +echo "configure:2126: checking how to compare bootstrapped objects" >&5 if eval "test \"`echo '$''{'gcc_cv_prog_cmp_skip'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2287,9 +2195,9 @@ saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $gmpinc" # Check GMP actually works echo $ac_n "checking for correct version of gmp.h""... $ac_c" 1>&6 -echo "configure:2291: checking for correct version of gmp.h" >&5 +echo "configure:2199: checking for correct version of gmp.h" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2212: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -2313,19 +2221,19 @@ rm -f conftest* if test x"$have_gmp" = xyes; then echo $ac_n "checking for mpf_init in -lgmp""... $ac_c" 1>&6 -echo "configure:2317: checking for mpf_init in -lgmp" >&5 +echo "configure:2225: checking for mpf_init in -lgmp" >&5 saved_LIBS="$LIBS" LIBS="$LIBS $gmplibs" cat > conftest.$ac_ext < int main() { mpf_t n; mpf_init(n); ; return 0; } EOF -if { (eval echo configure:2329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -2531,6 +2439,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 @@ -2538,6 +2455,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 @@ -2564,7 +2482,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 @@ -2779,113 +2697,219 @@ 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 +for ac_prog in bison +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2710: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_BISON'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CONFIGURED_BISON"; then + ac_cv_prog_CONFIGURED_BISON="$CONFIGURED_BISON" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CONFIGURED_BISON="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CONFIGURED_BISON="$ac_cv_prog_CONFIGURED_BISON" +if test -n "$CONFIGURED_BISON"; then + echo "$ac_t""$CONFIGURED_BISON" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$CONFIGURED_BISON" && break +done +test -n "$CONFIGURED_BISON" || CONFIGURED_BISON="$MISSING bison" + for ac_prog in 'bison -y' byacc yacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2791: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_DEFAULT_YACC'+set}'`\" = set"; then +echo "configure:2745: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - if test -n "$DEFAULT_YACC"; then - ac_cv_prog_DEFAULT_YACC="$DEFAULT_YACC" # Let the user override the test. + if test -n "$CONFIGURED_YACC"; then + ac_cv_prog_CONFIGURED_YACC="$CONFIGURED_YACC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then - ac_cv_prog_DEFAULT_YACC="$ac_prog" + ac_cv_prog_CONFIGURED_YACC="$ac_prog" break fi done IFS="$ac_save_ifs" fi fi -DEFAULT_YACC="$ac_cv_prog_DEFAULT_YACC" -if test -n "$DEFAULT_YACC"; then - echo "$ac_t""$DEFAULT_YACC" 1>&6 +CONFIGURED_YACC="$ac_cv_prog_CONFIGURED_YACC" +if test -n "$CONFIGURED_YACC"; then + echo "$ac_t""$CONFIGURED_YACC" 1>&6 else echo "$ac_t""no" 1>&6 fi -test -n "$DEFAULT_YACC" && break +test -n "$CONFIGURED_YACC" && break done -test -n "$DEFAULT_YACC" || DEFAULT_YACC="$MISSING bison" +test -n "$CONFIGURED_YACC" || CONFIGURED_YACC="$MISSING bison -y" for ac_prog in gm4 gnum4 m4 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2826: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_DEFAULT_M4'+set}'`\" = set"; then +echo "configure:2780: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_M4'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CONFIGURED_M4"; then + ac_cv_prog_CONFIGURED_M4="$CONFIGURED_M4" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CONFIGURED_M4="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CONFIGURED_M4="$ac_cv_prog_CONFIGURED_M4" +if test -n "$CONFIGURED_M4"; then + echo "$ac_t""$CONFIGURED_M4" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$CONFIGURED_M4" && break +done +test -n "$CONFIGURED_M4" || CONFIGURED_M4="$MISSING m4" + +for ac_prog in flex +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2815: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_FLEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - if test -n "$DEFAULT_M4"; then - ac_cv_prog_DEFAULT_M4="$DEFAULT_M4" # Let the user override the test. + if test -n "$CONFIGURED_FLEX"; then + ac_cv_prog_CONFIGURED_FLEX="$CONFIGURED_FLEX" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then - ac_cv_prog_DEFAULT_M4="$ac_prog" + ac_cv_prog_CONFIGURED_FLEX="$ac_prog" break fi done IFS="$ac_save_ifs" fi fi -DEFAULT_M4="$ac_cv_prog_DEFAULT_M4" -if test -n "$DEFAULT_M4"; then - echo "$ac_t""$DEFAULT_M4" 1>&6 +CONFIGURED_FLEX="$ac_cv_prog_CONFIGURED_FLEX" +if test -n "$CONFIGURED_FLEX"; then + echo "$ac_t""$CONFIGURED_FLEX" 1>&6 else echo "$ac_t""no" 1>&6 fi -test -n "$DEFAULT_M4" && break +test -n "$CONFIGURED_FLEX" && break done -test -n "$DEFAULT_M4" || DEFAULT_M4="$MISSING m4" +test -n "$CONFIGURED_FLEX" || CONFIGURED_FLEX="$MISSING flex" for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2861: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_DEFAULT_LEX'+set}'`\" = set"; then +echo "configure:2850: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - if test -n "$DEFAULT_LEX"; then - ac_cv_prog_DEFAULT_LEX="$DEFAULT_LEX" # Let the user override the test. + if test -n "$CONFIGURED_LEX"; then + ac_cv_prog_CONFIGURED_LEX="$CONFIGURED_LEX" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then - ac_cv_prog_DEFAULT_LEX="$ac_prog" + ac_cv_prog_CONFIGURED_LEX="$ac_prog" break fi done IFS="$ac_save_ifs" fi fi -DEFAULT_LEX="$ac_cv_prog_DEFAULT_LEX" -if test -n "$DEFAULT_LEX"; then - echo "$ac_t""$DEFAULT_LEX" 1>&6 +CONFIGURED_LEX="$ac_cv_prog_CONFIGURED_LEX" +if test -n "$CONFIGURED_LEX"; then + echo "$ac_t""$CONFIGURED_LEX" 1>&6 else echo "$ac_t""no" 1>&6 fi -test -n "$DEFAULT_LEX" && break +test -n "$CONFIGURED_LEX" && break done -test -n "$DEFAULT_LEX" || DEFAULT_LEX="$MISSING flex" +test -n "$CONFIGURED_LEX" || CONFIGURED_LEX="$MISSING flex" + +for ac_prog in makeinfo +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2885: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_MAKEINFO'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CONFIGURED_MAKEINFO"; then + ac_cv_prog_CONFIGURED_MAKEINFO="$CONFIGURED_MAKEINFO" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CONFIGURED_MAKEINFO="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CONFIGURED_MAKEINFO="$ac_cv_prog_CONFIGURED_MAKEINFO" +if test -n "$CONFIGURED_MAKEINFO"; then + echo "$ac_t""$CONFIGURED_MAKEINFO" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$CONFIGURED_MAKEINFO" && break +done +test -n "$CONFIGURED_MAKEINFO" || CONFIGURED_MAKEINFO="$MISSING makeinfo" # Create a .gdbinit file which runs the one in srcdir @@ -2969,17 +2993,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 @@ -3050,7 +3064,7 @@ case "$enable_bootstrap" in esac -for module in ${build_modules} ; do +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" @@ -3438,8 +3452,8 @@ ospace_frag=${srcdir}/${ospace_frag} -# Build module lists & subconfigure args. +# Build module lists & subconfigure args. @@ -3455,10 +3469,6 @@ ospace_frag=${srcdir}/${ospace_frag} - - - - # Host tools. ncn_tool_prefix= test -n "$host_alias" && ncn_tool_prefix=$host_alias- @@ -3469,7 +3479,7 @@ test -n "$target_alias" && ncn_target_tool_prefix=$target_alias- # Extract the first word of "${ncn_tool_prefix}ar", so it can be a program name with args. set dummy ${ncn_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3473: checking for $ac_word" >&5 +echo "configure:3483: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3502,7 +3512,7 @@ if test -z "$ac_cv_prog_AR" ; then # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3506: checking for $ac_word" >&5 +echo "configure:3516: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3541,7 +3551,7 @@ fi # Extract the first word of "${ncn_tool_prefix}as", so it can be a program name with args. set dummy ${ncn_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3545: checking for $ac_word" >&5 +echo "configure:3555: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3574,7 +3584,7 @@ if test -z "$ac_cv_prog_AS" ; then # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3578: checking for $ac_word" >&5 +echo "configure:3588: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3613,7 +3623,7 @@ fi # Extract the first word of "${ncn_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ncn_tool_prefix}dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3617: checking for $ac_word" >&5 +echo "configure:3627: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3646,7 +3656,7 @@ if test -z "$ac_cv_prog_DLLTOOL" ; then # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3650: checking for $ac_word" >&5 +echo "configure:3660: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3685,7 +3695,7 @@ fi # Extract the first word of "${ncn_tool_prefix}ld", so it can be a program name with args. set dummy ${ncn_tool_prefix}ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3689: checking for $ac_word" >&5 +echo "configure:3699: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3718,7 +3728,7 @@ if test -z "$ac_cv_prog_LD" ; then # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3722: checking for $ac_word" >&5 +echo "configure:3732: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3757,7 +3767,7 @@ fi # Extract the first word of "${ncn_tool_prefix}nm", so it can be a program name with args. set dummy ${ncn_tool_prefix}nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3761: checking for $ac_word" >&5 +echo "configure:3771: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3790,7 +3800,7 @@ if test -z "$ac_cv_prog_NM" ; then # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3794: checking for $ac_word" >&5 +echo "configure:3804: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3829,7 +3839,7 @@ fi # Extract the first word of "${ncn_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ncn_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3833: checking for $ac_word" >&5 +echo "configure:3843: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3862,7 +3872,7 @@ if test -z "$ac_cv_prog_RANLIB" ; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3866: checking for $ac_word" >&5 +echo "configure:3876: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3901,7 +3911,7 @@ fi # Extract the first word of "${ncn_tool_prefix}windres", so it can be a program name with args. set dummy ${ncn_tool_prefix}windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3905: checking for $ac_word" >&5 +echo "configure:3915: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3934,7 +3944,7 @@ if test -z "$ac_cv_prog_WINDRES" ; then # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3938: checking for $ac_word" >&5 +echo "configure:3948: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3973,7 +3983,7 @@ fi # Extract the first word of "${ncn_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ncn_tool_prefix}objcopy; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3977: checking for $ac_word" >&5 +echo "configure:3987: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4006,7 +4016,7 @@ if test -z "$ac_cv_prog_OBJCOPY" ; then # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4010: checking for $ac_word" >&5 +echo "configure:4020: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJCOPY'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4045,7 +4055,7 @@ fi # Extract the first word of "${ncn_tool_prefix}objdump", so it can be a program name with args. set dummy ${ncn_tool_prefix}objdump; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4049: checking for $ac_word" >&5 +echo "configure:4059: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4078,7 +4088,7 @@ if test -z "$ac_cv_prog_OBJDUMP" ; then # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4082: checking for $ac_word" >&5 +echo "configure:4092: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJDUMP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4119,15 +4129,12 @@ fi - - - # Target tools. if test -n "$ncn_target_tool_prefix"; then # Extract the first word of "${ncn_target_tool_prefix}ar", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4131: checking for $ac_word" >&5 +echo "configure:4138: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_AR_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4160,7 +4167,7 @@ if test -z "$ac_cv_prog_CONFIGURED_AR_FOR_TARGET" ; then # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4164: checking for $ac_word" >&5 +echo "configure:4171: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_AR_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4199,7 +4206,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}as", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4203: checking for $ac_word" >&5 +echo "configure:4210: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_AS_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4232,7 +4239,7 @@ if test -z "$ac_cv_prog_CONFIGURED_AS_FOR_TARGET" ; then # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4236: checking for $ac_word" >&5 +echo "configure:4243: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_AS_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4271,7 +4278,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4275: checking for $ac_word" >&5 +echo "configure:4282: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4304,7 +4311,7 @@ if test -z "$ac_cv_prog_CONFIGURED_DLLTOOL_FOR_TARGET" ; then # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4308: checking for $ac_word" >&5 +echo "configure:4315: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4343,7 +4350,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}ld", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4347: checking for $ac_word" >&5 +echo "configure:4354: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_LD_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4376,7 +4383,7 @@ if test -z "$ac_cv_prog_CONFIGURED_LD_FOR_TARGET" ; then # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4380: checking for $ac_word" >&5 +echo "configure:4387: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_LD_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4415,7 +4422,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}nm", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4419: checking for $ac_word" >&5 +echo "configure:4426: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_NM_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4448,7 +4455,7 @@ if test -z "$ac_cv_prog_CONFIGURED_NM_FOR_TARGET" ; then # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4452: checking for $ac_word" >&5 +echo "configure:4459: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_NM_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4487,7 +4494,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4491: checking for $ac_word" >&5 +echo "configure:4498: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_RANLIB_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4520,7 +4527,7 @@ if test -z "$ac_cv_prog_CONFIGURED_RANLIB_FOR_TARGET" ; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4524: checking for $ac_word" >&5 +echo "configure:4531: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_RANLIB_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4559,7 +4566,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}windres", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4563: checking for $ac_word" >&5 +echo "configure:4570: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_WINDRES_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4592,7 +4599,7 @@ if test -z "$ac_cv_prog_CONFIGURED_WINDRES_FOR_TARGET" ; then # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4596: checking for $ac_word" >&5 +echo "configure:4603: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_WINDRES_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4677,7 +4684,7 @@ RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target} NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target} echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:4681: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:4688: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -4724,7 +4731,7 @@ esac # gcc for stageN-gcc and stage-prev for stage(N-1). In case this is not # possible, however, we can resort to mv. echo $ac_n "checking if symbolic links between directories work""... $ac_c" 1>&6 -echo "configure:4728: checking if symbolic links between directories work" >&5 +echo "configure:4735: checking if symbolic links between directories work" >&5 if eval "test \"`echo '$''{'gcc_cv_prog_ln_s_dir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4838,34 +4845,15 @@ trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. -# -# If the first sed substitution is executed (which looks for macros that -# take arguments), then we branch to the quote section. Otherwise, -# look for a macro that doesn't take arguments. -cat >confdef2opt.sed <<\_ACEOF -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g -t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g -t quote -d -: quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g -s,\[,\\&,g -s,\],\\&,g -s,\$,$$,g -p -_ACEOF -# We use echo to avoid assuming a particular line-breaking character. -# The extra dot is to prevent the shell from consuming trailing -# line-breaks from the sub-command output. A line-break within -# single-quotes doesn't work because, if this script is created in a -# platform that uses two characters for line-breaks (e.g., DOS), tr -# would break. -ac_LF_and_DOT=`echo; echo .` -DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` -rm -f confdef2opt.sed +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs # Without the "./", some shells look in PATH for config.status. @@ -4966,9 +4954,12 @@ s%@do_compare@%$do_compare%g s%@gmplibs@%$gmplibs%g s%@gmpinc@%$gmpinc%g s%@stage1_languages@%$stage1_languages%g -s%@DEFAULT_YACC@%$DEFAULT_YACC%g -s%@DEFAULT_M4@%$DEFAULT_M4%g -s%@DEFAULT_LEX@%$DEFAULT_LEX%g +s%@CONFIGURED_BISON@%$CONFIGURED_BISON%g +s%@CONFIGURED_YACC@%$CONFIGURED_YACC%g +s%@CONFIGURED_M4@%$CONFIGURED_M4%g +s%@CONFIGURED_FLEX@%$CONFIGURED_FLEX%g +s%@CONFIGURED_LEX@%$CONFIGURED_LEX%g +s%@CONFIGURED_MAKEINFO@%$CONFIGURED_MAKEINFO%g s%@default_target@%$default_target%g /@serialization_dependencies@/r $serialization_dependencies s%@serialization_dependencies@%%g @@ -4982,6 +4973,7 @@ s%@alphaieee_frag@%%g s%@ospace_frag@%%g s%@SET_LIB_PATH@%$SET_LIB_PATH%g s%@RPATH_ENVVAR@%$RPATH_ENVVAR%g +s%@BUILD_DIR_PREFIX@%$BUILD_DIR_PREFIX%g s%@BUILD_PREFIX@%$BUILD_PREFIX%g s%@BUILD_PREFIX_1@%$BUILD_PREFIX_1%g s%@gcc_version_trigger@%$gcc_version_trigger%g @@ -4992,17 +4984,12 @@ s%@GDB_TK@%$GDB_TK%g s%@gxx_include_dir@%$gxx_include_dir%g s%@libstdcxx_incdir@%$libstdcxx_incdir%g s%@build_configargs@%$build_configargs%g -s%@configure_build_modules@%$configure_build_modules%g -s%@all_build_modules@%$all_build_modules%g +s%@build_configdirs@%$build_configdirs%g s%@host_configargs@%$host_configargs%g s%@configdirs@%$configdirs%g s%@target_configargs@%$target_configargs%g s%@target_configdirs@%$target_configdirs%g -s%@BISON@%$BISON%g s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g -s%@LEX@%$LEX%g -s%@MAKEINFO@%$MAKEINFO%g -s%@YACC@%$YACC%g s%@config_shell@%$config_shell%g s%@AR@%$AR%g s%@ncn_cv_AR@%$ncn_cv_AR%g diff --git a/configure.in b/configure.in index 4ec0d21a9e1..a66e946c0b2 100644 --- a/configure.in +++ b/configure.in @@ -126,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" @@ -173,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" @@ -956,7 +958,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++} @@ -966,49 +967,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. @@ -1019,71 +980,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'` ;; @@ -1349,6 +1258,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 @@ -1356,6 +1274,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 @@ -1382,7 +1301,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 @@ -1597,12 +1516,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. @@ -1685,17 +1608,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 @@ -1761,7 +1674,7 @@ case "$enable_bootstrap" in esac AC_SUBST(default_target) -for module in ${build_modules} ; do +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" @@ -2138,6 +2051,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) @@ -2150,8 +2064,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) @@ -2162,11 +2075,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. @@ -2184,9 +2093,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) -- 2.30.2