* Makefile.in (CXX_FOR_TARGET_FOR_RECURSIVE_MAKE, RECURSE_FLAGS):
authorAlexandre Oliva <aoliva@redhat.com>
Mon, 2 Apr 2001 01:32:45 +0000 (01:32 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Mon, 2 Apr 2001 01:32:45 +0000 (01:32 +0000)
New macros.
(bootstrap, cross): Use RECURSE_FLAGS.
* configure.in: Subst CXX_FOR_TARGET_FOR_RECURSIVE_MAKE.

ChangeLog
Makefile.in
configure.in

index 20e7124dd6e25cfdb466f3a908cb791d0fd9623e..73a0438f7d48ebe0d7a46991d7334ffb27ead716 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2001-04-01  Alexandre Oliva  <aoliva@redhat.com>
+
+       * Makefile.in (CXX_FOR_TARGET_FOR_RECURSIVE_MAKE, RECURSE_FLAGS):
+       New macros.
+       (bootstrap, cross): Use RECURSE_FLAGS.
+       * configure.in: Subst CXX_FOR_TARGET_FOR_RECURSIVE_MAKE.
+
 2001-03-27  Alexandre Oliva  <aoliva@redhat.com>
 
        * configure.in (CXX_FOR_TARGET): Use xgcc for libstdc++-v3.
index 65b9cc0b2349d1f194ff389124ebd6e09eb27f65..b56ccb63c472f3d4bf0648f8d12bb514ac90546b 100644 (file)
@@ -220,6 +220,7 @@ FLAGS_FOR_TARGET =
 CC_FOR_TARGET =
 CHILL_FOR_TARGET =
 CXX_FOR_TARGET =
+CXX_FOR_TARGET_FOR_RECURSIVE_MAKE =
 
 # If GCC_FOR_TARGET is not overriden on the command line, then this
 # variable is passed down to the gcc Makefile, where it is used to
@@ -385,6 +386,14 @@ BASE_FLAGS_TO_PASS = \
        "target_alias=$(target_alias)" \
        "libsubdir=$(libsubdir)"
 
+# For any flags above that may contain shell code that varies from one
+# target library to another.  When doing recursive invocations of the
+# top-level Makefile, we don't want the outer make to evaluate them,
+# so we pass these variables down unchanged.  They must not contain
+# single nor double quotes.
+RECURSE_FLAGS = \
+       CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)'
+
 # Flags to pass down to most sub-makes, in which we're building with
 # the host environment.
 # If any variables are added here, they must be added to do-*, below.
@@ -1349,7 +1358,8 @@ $(ALL_TARGET_MODULES):
          r=`pwd`; export r; \
          s=`cd $(srcdir); pwd`; export s; \
          $(SET_LIB_PATH) \
-         (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
+         (cd $(TARGET_SUBDIR)/$${dir}; \
+           $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
        else \
          true; \
        fi
@@ -1363,7 +1373,8 @@ $(CHECK_TARGET_MODULES):
          r=`pwd`; export r; \
          s=`cd $(srcdir); pwd`; export s; \
          $(SET_LIB_PATH) \
-         (cd $(TARGET_SUBDIR)/$${dir};$(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
+         (cd $(TARGET_SUBDIR)/$${dir}; \
+           $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
        else \
          true; \
        fi
@@ -1478,7 +1489,7 @@ bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean b
        s=`cd $(srcdir); pwd` ; export s; \
        $(SET_LIB_PATH) \
        echo "Building runtime libraries"; \
-       $(MAKE) $(BASE_FLAGS_TO_PASS) all
+       $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
 
 .PHONY: cross
 cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
@@ -1491,7 +1502,8 @@ cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
        s=`cd $(srcdir); pwd` ; export s; \
        $(SET_LIB_PATH) \
        echo "Building runtime libraries"; \
-       $(MAKE) $(BASE_FLAGS_TO_PASS) all LANGUAGES="c c++"
+       $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \
+         LANGUAGES="c c++" all
 
 .PHONY: check-gcc
 check-gcc:
index 5357470020a1c3f72eca89f29aa758938842391d..cc8f34f879530af81a357aeb9e646c646eb61121 100644 (file)
@@ -1384,7 +1384,15 @@ case $CXX_FOR_TARGET in
 *' $(FLAGS_FOR_TARGET)') ;;
 *) CXX_FOR_TARGET=$CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
 esac
-qCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET" | sed 's,&,\\\&,g'`
+qCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET" | sed 's,[&%],\\\&,g'`
+
+# We want to defer the evaluation of `cmd`s and shell variables in
+# CXX_FOR_TARGET when recursing in the top-level Makefile, such as for
+# bootstrap.  We'll enclose CXX_FOR_TARGET_FOR_RECURSIVE_MAKE in single
+# quotes, but we still have to duplicate `$'s so that shell variables
+# can be expanded by the nested make as shell variables, not as make
+# macros.
+qqCXX_FOR_TARGET=`echo "$qCXX_FOR_TARGET" | sed -e 's,[$][$],$$$$,g'`
 
 targargs="--cache-file=../config.cache --host=${target_alias} --build=${build_alias} ${targargs}"
 sed -e "s:^TARGET_CONFIGDIRS[  ]*=.*$:TARGET_CONFIGDIRS = ${target_configdirs}:" \
@@ -1393,6 +1401,7 @@ sed -e "s:^TARGET_CONFIGDIRS[     ]*=.*$:TARGET_CONFIGDIRS = ${target_configdirs}:"
     -e "s%^CC_FOR_TARGET[      ]*=.*$%CC_FOR_TARGET = ${CC_FOR_TARGET}%" \
     -e "s%^CHILL_FOR_TARGET[   ]*=.*$%CHILL_FOR_TARGET = ${CHILL_FOR_TARGET}%" \
     -e "s%^CXX_FOR_TARGET[     ]*=.*$%CXX_FOR_TARGET = ${qCXX_FOR_TARGET}%" \
+    -e "s%^CXX_FOR_TARGET_FOR_RECURSIVE_MAKE[  ]*=.*$%CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = ${qqCXX_FOR_TARGET}%" \
     -e "s%^TARGET_SUBDIR[      ]*=.*$%TARGET_SUBDIR = ${target_subdir}%" \
     -e "s%^gxx_include_dir[    ]*=.*$%gxx_include_dir=${gxx_include_dir}%" \
        Makefile > Makefile.tem
This page took 0.032427 seconds and 4 git commands to generate.