summaryrefslogtreecommitdiff
path: root/Makefile.tpl
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@libertysurf.fr>2012-10-22 07:32:02 +0000
committerEric Botcazou <ebotcazou@libertysurf.fr>2012-10-22 07:32:02 +0000
commit21089810442fb7d42fdfc0b557591fc8a0e1a520 (patch)
treeb5a420269fdb1d884998c2c596eda6a70d87e65f /Makefile.tpl
parent928c07d77a5e1f2d12cb8bb7667bd77399112def (diff)
downloadbinutils-redhat-21089810442fb7d42fdfc0b557591fc8a0e1a520.tar.gz
PR bootstrap/54820
* Makefile.tpl (STAGE1_FLAGS_TO_PASS): New variable. (all-[+prefix+][+module+]): Pass stage1_args to sub-makes. (all-stage[+id+]-[+prefix+][+module+]): Likewise, if prev is false. (clean-stage[+id+]-[+prefix+][+module+]): Likewise, if prev is false. (host_modules): Set stage1_args to STAGE1_FLAGS_TO_PASS. * Makefile.in: Regenerate. * configure.ac (have_static_libs): New variable and associated check. (stage1-ldflags): Move to after stage1_libs and set to -static-libstdc++ -static-libgcc if stage1_libs is empty and have_static_libs is yes. * configure: Regenerate.
Diffstat (limited to 'Makefile.tpl')
-rw-r--r--Makefile.tpl19
1 files changed, 12 insertions, 7 deletions
diff --git a/Makefile.tpl b/Makefile.tpl
index f2c3f48b7d..146666a451 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -615,6 +615,12 @@ EXTRA_HOST_FLAGS = \
FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
+# Flags to pass to stage1 or when not bootstrapping.
+
+STAGE1_FLAGS_TO_PASS = \
+ LDFLAGS="$${LDFLAGS}" \
+ HOST_LIBS="$${HOST_LIBS}"
+
# Flags to pass to stage2 and later makes.
POSTSTAGE1_FLAGS_TO_PASS = \
@@ -1076,7 +1082,7 @@ all-[+prefix+][+module+]: configure-[+prefix+][+module+][+ IF bootstrap +][+ ELS
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
[+exports+] [+extra_exports+] \
(cd [+subdir+]/[+module+] && \
- $(MAKE) $(BASE_FLAGS_TO_PASS) [+args+] [+extra_make_flags+] \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) [+args+] [+stage1_args+] [+extra_make_flags+] \
$(TARGET-[+prefix+][+module+]))
@endif [+prefix+][+module+]
@@ -1109,9 +1115,8 @@ all-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+]
CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
- [+args+] [+
- IF prev +][+poststage1_args+][+ ENDIF prev
- +] [+extra_make_flags+] \
+ [+args+] [+IF prev +][+poststage1_args+][+ ELSE prev +] \
+ [+stage1_args+][+ ENDIF prev +] [+extra_make_flags+] \
TFLAGS="$(STAGE[+id+]_TFLAGS)" \
$(TARGET-stage[+id+]-[+prefix+][+module+])
@@ -1125,9 +1130,8 @@ clean-stage[+id+]-[+prefix+][+module+]:
$(MAKE) stage[+id+]-start; \
fi; \
cd [+subdir+]/[+module+] && \
- $(MAKE) [+args+] [+ IF prev +] \
- [+poststage1_args+] [+ ENDIF prev +] \
- [+extra_make_flags+] clean
+ $(MAKE) [+args+] [+ IF prev +][+poststage1_args+][+ ELSE prev +] \
+ [+stage1_args+][+ ENDIF prev +] [+extra_make_flags+] clean
@endif [+prefix+][+module+]-bootstrap
[+ ENDFOR bootstrap_stage +]
@@ -1162,6 +1166,7 @@ clean-stage[+id+]-[+prefix+][+module+]:
exports="$(HOST_EXPORTS)"
poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)"
args="$(EXTRA_HOST_FLAGS)"
+ stage1_args="$(STAGE1_FLAGS_TO_PASS)"
poststage1_args="$(POSTSTAGE1_FLAGS_TO_PASS)" +]
.PHONY: check-[+module+] maybe-check-[+module+]