# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
+# First, test for a proper version of make, but only where one is required.
+
+@if gcc
+ifeq (,$(.VARIABLES)) # The variable .VARIABLES, new with 3.80, is never empty.
+$(error GNU make version 3.80 or newer is required.)
+endif
+@endif gcc
+
# -------------------------------
# Standard Autoconf-set variables
# -------------------------------
# the libraries.
RPATH_ENVVAR = @RPATH_ENVVAR@
+# On targets where RPATH_ENVVAR is PATH, a subdirectory of the GCC build path
+# is used instead of the directory itself to avoid including built
+# executables in PATH.
+GCC_SHLIB_SUBDIR = @GCC_SHLIB_SUBDIR@
+
# Build programs are put under this directory.
BUILD_SUBDIR = @build_subdir@
# This is set by the configure script to the arguments to use when configuring
WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
WINDMC="$(WINDMC_FOR_BUILD)"; export WINDMC;
+# These variables must be set on the make command line for directories
+# built for the build system to override those in BASE_FLAGS_TO_PASSS.
+EXTRA_BUILD_FLAGS = \
+ CFLAGS="$(CFLAGS_FOR_BUILD)" \
+ LDFLAGS="$(LDFLAGS_FOR_BUILD)"
+
# This is the list of directories to built for the host system.
SUBDIRS = @configdirs@
# This is set by the configure script to the arguments to use when configuring
HOST_EXPORTS = \
$(BASE_EXPORTS) \
CC="$(CC)"; export CC; \
+ ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
# here so that they can be overridden by Makefile fragments.
BOOT_CFLAGS= -g -O2
BOOT_LDFLAGS=
+BOOT_ADAFLAGS=-gnatpg -gnata
BISON = @BISON@
YACC = @YACC@
# Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch
@if gcc
-HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc:$$r/$(HOST_SUBDIR)/prev-gcc:
+HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc$(GCC_SHLIB_SUBDIR):$$r/$(HOST_SUBDIR)/prev-gcc$(GCC_SHLIB_SUBDIR):
@endif gcc
"INSTALL_DATA=$(INSTALL_DATA)" \
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
+ "LDFLAGS_FOR_BUILD=$(LDFLAGS_FOR_BUILD)" \
"LEX=$(LEX)" \
"M4=$(M4)" \
"MAKE=$(MAKE)" \
"SHELL=$(SHELL)" \
"YACC=$(YACC)" \
"`echo 'ADAFLAGS=$(ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
+ "ADA_CFLAGS=$(ADA_CFLAGS)" \
"AR_FLAGS=$(AR_FLAGS)" \
"`echo 'BOOT_ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
"BOOT_CFLAGS=$(BOOT_CFLAGS)" \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(BUILD_EXPORTS) \
(cd $(BUILD_SUBDIR)/libiberty && \
- $(MAKE) $(BASE_FLAGS_TO_PASS) \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_BUILD_FLAGS) \
$(TARGET-build-libiberty))
@endif build-libiberty
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(BUILD_EXPORTS) \
(cd $(BUILD_SUBDIR)/bison && \
- $(MAKE) $(BASE_FLAGS_TO_PASS) \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_BUILD_FLAGS) \
$(TARGET-build-bison))
@endif build-bison
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(BUILD_EXPORTS) \
(cd $(BUILD_SUBDIR)/byacc && \
- $(MAKE) $(BASE_FLAGS_TO_PASS) \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_BUILD_FLAGS) \
$(TARGET-build-byacc))
@endif build-byacc
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(BUILD_EXPORTS) \
(cd $(BUILD_SUBDIR)/flex && \
- $(MAKE) $(BASE_FLAGS_TO_PASS) \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_BUILD_FLAGS) \
$(TARGET-build-flex))
@endif build-flex
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(BUILD_EXPORTS) \
(cd $(BUILD_SUBDIR)/m4 && \
- $(MAKE) $(BASE_FLAGS_TO_PASS) \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_BUILD_FLAGS) \
$(TARGET-build-m4))
@endif build-m4
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(BUILD_EXPORTS) \
(cd $(BUILD_SUBDIR)/texinfo && \
- $(MAKE) $(BASE_FLAGS_TO_PASS) \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_BUILD_FLAGS) \
$(TARGET-build-texinfo))
@endif build-texinfo
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(BUILD_EXPORTS) \
(cd $(BUILD_SUBDIR)/fixincludes && \
- $(MAKE) $(BASE_FLAGS_TO_PASS) \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_BUILD_FLAGS) \
$(TARGET-build-fixincludes))
@endif build-fixincludes
# Bubble a bug fix through all the stages up to stage 1. They are
# remade, but not reconfigured. The next stage (if any) will not be
-# reconfigured as well.
+# reconfigured either.
.PHONY: stage1-bubble
stage1-bubble::
@r=`${PWD_COMMAND}`; export r; \
# Bubble a bug fix through all the stages up to stage 2. They are
# remade, but not reconfigured. The next stage (if any) will not be
-# reconfigured as well.
+# reconfigured either.
.PHONY: stage2-bubble
stage2-bubble:: stage1-bubble
@r=`${PWD_COMMAND}`; export r; \
# Bubble a bug fix through all the stages up to stage b2g0. They are
# remade, but not reconfigured. The next stage (if any) will not be
-# reconfigured as well.
+# reconfigured either.
.PHONY: stageb2g0-bubble
stageb2g0-bubble:: stage1-bubble
@r=`${PWD_COMMAND}`; export r; \
# Bubble a bug fix through all the stages up to stage 3. They are
# remade, but not reconfigured. The next stage (if any) will not be
-# reconfigured as well.
+# reconfigured either.
.PHONY: stage3-bubble
stage3-bubble:: stage2-bubble
@r=`${PWD_COMMAND}`; export r; \
# Bubble a bug fix through all the stages up to stage b3g2. They are
# remade, but not reconfigured. The next stage (if any) will not be
-# reconfigured as well.
+# reconfigured either.
.PHONY: stageb3g2-bubble
stageb3g2-bubble:: stageb2g0-bubble
@r=`${PWD_COMMAND}`; export r; \
# Bubble a bug fix through all the stages up to stage 4. They are
# remade, but not reconfigured. The next stage (if any) will not be
-# reconfigured as well.
+# reconfigured either.
.PHONY: stage4-bubble
stage4-bubble:: stage3-bubble
@r=`${PWD_COMMAND}`; export r; \
# Bubble a bug fix through all the stages up to stage profile. They are
# remade, but not reconfigured. The next stage (if any) will not be
-# reconfigured as well.
+# reconfigured either.
.PHONY: stageprofile-bubble
stageprofile-bubble:: stage1-bubble
@r=`${PWD_COMMAND}`; export r; \
# Bubble a bug fix through all the stages up to stage feedback. They are
# remade, but not reconfigured. The next stage (if any) will not be
-# reconfigured as well.
+# reconfigured either.
.PHONY: stagefeedback-bubble
stagefeedback-bubble:: stageprofile-bubble
@r=`${PWD_COMMAND}`; export r; \
@if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi
.PHONY: restrap
-restrap:
+restrap::
@: $(MAKE); $(stage)
rm -rf stage1-$(TARGET_SUBDIR) stage2-* stageb2g0-* stage3-* stageb3g2-* stage4-* stageprofile-* stagefeedback-*
- $(MAKE) $(RECURSE_FLAGS_TO_PASS) all
+restrap:: all
@endif gcc-bootstrap
# --------------------------------------
# Rebuilding configure.
AUTOCONF = autoconf
-$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4
+$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4 \
+ $(srcdir)/config/override.m4 $(srcdir)/config/proginstall.m4
cd $(srcdir) && $(AUTOCONF)
# ------------------------------