From 3508c904e7b36680763556d8e7213ad8f738ee6a Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Mon, 22 Oct 2012 07:32:02 +0000 Subject: 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. --- Makefile.tpl | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'Makefile.tpl') diff --git a/Makefile.tpl b/Makefile.tpl index f2c3f48b7d2..146666a4517 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+] -- cgit v1.2.1