X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=Makefile.tpl;h=2413c0fa300112ab8ad6ff117be34356ab30bd16;hb=b898a385044f46a5fe98f8455cf1798a575c9097;hp=2a8b2ef5973da141ad428b3e4af13b6a1c2b2336;hpb=064d0a7c448a0ddea5ff56642408ffc919585c76;p=deliverable%2Fbinutils-gdb.git diff --git a/Makefile.tpl b/Makefile.tpl index 2a8b2ef597..2413c0fa30 100644 --- a/Makefile.tpl +++ b/Makefile.tpl @@ -20,7 +20,7 @@ in # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # ------------------------------- @@ -195,8 +195,10 @@ BASE_TARGET_EXPORTS = \ DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ LD="$(LD_FOR_TARGET)"; export LD; \ LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + LIPO="$(LIPO_FOR_TARGET)"; export LIPO; \ NM="$(NM_FOR_TARGET)"; export NM; \ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); @@ -354,8 +356,8 @@ CONFIGURED_AS_FOR_TARGET=@CONFIGURED_AS_FOR_TARGET@ USUAL_AS_FOR_TARGET = ` \ if [ -f $$r/$(HOST_SUBDIR)/gas/as-new ] ; then \ echo $$r/$(HOST_SUBDIR)/gas/as-new ; \ - elif [ -f $$r/$(HOST_SUBDIR)/gcc/xgcc ]; then \ - $(CC_FOR_TARGET) -print-prog-name=as ; \ + elif [ -f $$r/$(HOST_SUBDIR)/gcc/as ]; then \ + echo $$r/$(HOST_SUBDIR)/gcc/as ; \ else \ if [ '$(host)' = '$(target)' ] ; then \ echo $(AS); \ @@ -364,28 +366,93 @@ USUAL_AS_FOR_TARGET = ` \ fi; \ fi` -CC_FOR_TARGET = @CC_FOR_TARGET@ +CC_FOR_TARGET=$(STAGE_CC_WRAPPER) @CC_FOR_TARGET@ $(FLAGS_FOR_TARGET) +CONFIGURED_CC_FOR_TARGET=@CONFIGURED_CC_FOR_TARGET@ +USUAL_CC_FOR_TARGET = ` \ + if [ -f $$r/$(HOST_SUBDIR)/gcc/xgcc ] ; then \ + echo $$r/$(HOST_SUBDIR)/gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/ ; \ + else \ + if [ '$(host)' = '$(target)' ] ; then \ + echo $(CC); \ + else \ + echo $(CONFIGURED_CC_FOR_TARGET) ; \ + fi; \ + fi` + # During gcc bootstrap, if we use some random cc for stage1 then # CFLAGS will be just -g. We want to ensure that TARGET libraries # (which we know are built with gcc) are built with optimizations so # prepend -O2 when setting CFLAGS_FOR_TARGET. -CFLAGS_FOR_TARGET = -O2 $(CFLAGS) +CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) +SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@ + # 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 # build libgcc2.a. We define it here so that it can itself be # overridden on the command line. GCC_FOR_TARGET=@GCC_FOR_TARGET@ +CONFIGURED_GCC_FOR_TARGET=@CONFIGURED_GCC_FOR_TARGET@ USUAL_GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) \ $$r/$(HOST_SUBDIR)/gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/ $(FLAGS_FOR_TARGET) LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET) -CXX_FOR_TARGET = @CXX_FOR_TARGET@ -RAW_CXX_FOR_TARGET = @RAW_CXX_FOR_TARGET@ -CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@ -RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@ -CXXFLAGS_FOR_TARGET = $(CXXFLAGS) +CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @CXX_FOR_TARGET@ $(FLAGS_FOR_TARGET) +CONFIGURED_CXX_FOR_TARGET=@CONFIGURED_CXX_FOR_TARGET@ +USUAL_CXX_FOR_TARGET = ` \ + if [ -f $$r/$(HOST_SUBDIR)/gcc/g++ ] ; then \ + (echo $$r/$(HOST_SUBDIR)/gcc/g++ -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++; \ + test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes; \ + echo -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs) | tr '\015\012' ' '; \ + else \ + if [ '$(host)' = '$(target)' ] ; then \ + echo $(CXX); \ + else \ + echo $(CONFIGURED_CXX_FOR_TARGET) ; \ + fi; \ + fi` + +RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @RAW_CXX_FOR_TARGET@ $(FLAGS_FOR_TARGET) +USUAL_RAW_CXX_FOR_TARGET = ` \ + if [ -f $$r/$(HOST_SUBDIR)/gcc/xgcc ] ; then \ + echo $$r/$(HOST_SUBDIR)/gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs; \ + else \ + if [ '$(host)' = '$(target)' ] ; then \ + echo $(CXX); \ + else \ + echo $(CONFIGURED_CXX_FOR_TARGET) ; \ + fi; \ + fi` + +CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates +GCJ_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCJ_FOR_TARGET@ $(FLAGS_FOR_TARGET) +CONFIGURED_GCJ_FOR_TARGET=@CONFIGURED_GCJ_FOR_TARGET@ +USUAL_GCJ_FOR_TARGET = ` \ + if [ -f $$r/$(HOST_SUBDIR)/gcc/gcj ] ; then \ + echo $$r/$(HOST_SUBDIR)/gcc/gcj -B$$r/$(HOST_SUBDIR)/gcc ; \ + else \ + if [ '$(host)' = '$(target)' ] ; then \ + echo $(GCJ); \ + else \ + echo $(CONFIGURED_GCJ_FOR_TARGET) ; \ + fi; \ + fi` + +GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@ $(FLAGS_FOR_TARGET) +CONFIGURED_GFORTRAN_FOR_TARGET=@CONFIGURED_GFORTRAN_FOR_TARGET@ +USUAL_GFORTRAN_FOR_TARGET = ` \ + if [ -f $$r/$(HOST_SUBDIR)/gcc/gfortran ] ; then \ + echo $$r/$(HOST_SUBDIR)/gcc/gfortran -B$$r/$(HOST_SUBDIR)/gcc ; \ + else \ + if [ '$(host)' = '$(target)' ] ; then \ + echo $(GFORTRAN); \ + else \ + echo $(CONFIGURED_GFORTRAN_FOR_TARGET) ; \ + fi; \ + fi` + + DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@ CONFIGURED_DLLTOOL_FOR_TARGET=@CONFIGURED_DLLTOOL_FOR_TARGET@ USUAL_DLLTOOL_FOR_TARGET = ` \ @@ -399,16 +466,13 @@ USUAL_DLLTOOL_FOR_TARGET = ` \ fi; \ fi` -GCJ_FOR_TARGET = @GCJ_FOR_TARGET@ -GFORTRAN_FOR_TARGET = @GFORTRAN_FOR_TARGET@ - LD_FOR_TARGET=@LD_FOR_TARGET@ CONFIGURED_LD_FOR_TARGET=@CONFIGURED_LD_FOR_TARGET@ USUAL_LD_FOR_TARGET = ` \ if [ -f $$r/$(HOST_SUBDIR)/ld/ld-new ] ; then \ echo $$r/$(HOST_SUBDIR)/ld/ld-new ; \ - elif [ -f $$r/$(HOST_SUBDIR)/gcc/xgcc ]; then \ - $(CC_FOR_TARGET) -print-prog-name=ld ; \ + elif [ -f $$r/$(HOST_SUBDIR)/gcc/collect-ld ]; then \ + echo $$r/$(HOST_SUBDIR)/gcc/collect-ld ; \ else \ if [ '$(host)' = '$(target)' ] ; then \ echo $(LD); \ @@ -419,13 +483,26 @@ USUAL_LD_FOR_TARGET = ` \ LDFLAGS_FOR_TARGET = +LIPO_FOR_TARGET=@LIPO_FOR_TARGET@ +CONFIGURED_LIPO_FOR_TARGET=@CONFIGURED_LIPO_FOR_TARGET@ +USUAL_LIPO_FOR_TARGET = ` \ + if [ '$(host)' = '$(target)' ] ; then \ + if [ x'$(LIPO)' != x ]; then \ + echo $(LIPO); \ + else \ + echo lipo; \ + fi; \ + else \ + echo $(CONFIGURED_LIPO_FOR_TARGET) ; \ + fi` + NM_FOR_TARGET=@NM_FOR_TARGET@ CONFIGURED_NM_FOR_TARGET=@CONFIGURED_NM_FOR_TARGET@ USUAL_NM_FOR_TARGET = ` \ if [ -f $$r/$(HOST_SUBDIR)/binutils/nm-new ] ; then \ echo $$r/$(HOST_SUBDIR)/binutils/nm-new ; \ - elif [ -f $$r/$(HOST_SUBDIR)/gcc/xgcc ]; then \ - $(CC_FOR_TARGET) -print-prog-name=nm ; \ + elif [ -f $$r/$(HOST_SUBDIR)/gcc/nm ]; then \ + echo $$r/$(HOST_SUBDIR)/gcc/nm ; \ else \ if [ '$(host)' = '$(target)' ] ; then \ echo $(NM); \ @@ -451,6 +528,23 @@ USUAL_RANLIB_FOR_TARGET = ` \ fi; \ fi` +STRIP_FOR_TARGET=@STRIP_FOR_TARGET@ +CONFIGURED_STRIP_FOR_TARGET=@CONFIGURED_STRIP_FOR_TARGET@ +USUAL_STRIP_FOR_TARGET = ` \ + if [ -f $$r/$(HOST_SUBDIR)/binutils/strip ] ; then \ + echo $$r/$(HOST_SUBDIR)/binutils/strip ; \ + else \ + if [ '$(host)' = '$(target)' ] ; then \ + if [ x'$(STRIP)' != x ]; then \ + echo $(STRIP); \ + else \ + echo strip; \ + fi; \ + else \ + echo $(CONFIGURED_STRIP_FOR_TARGET) ; \ + fi; \ + fi` + WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@ CONFIGURED_WINDRES_FOR_TARGET=@CONFIGURED_WINDRES_FOR_TARGET@ USUAL_WINDRES_FOR_TARGET = ` \ @@ -518,16 +612,8 @@ BASE_FLAGS_TO_PASS = [+ FOR flags_to_pass +]\ "CONFIG_SHELL=$(SHELL)" \ "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" -# 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)' \ - RAW_CXX_FOR_TARGET='$(RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \ - -RECURSE_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) +# We leave this in just in case, but it is not needed anymore. +RECURSE_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) # Flags to pass down to most sub-makes, in which we're building with # the host environment. @@ -568,6 +654,7 @@ EXTRA_TARGET_FLAGS = \ 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \ 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \ 'LD=$$(LD_FOR_TARGET)' \ + 'LDFLAGS=$$(LDFLAGS_FOR_TARGET)' \ 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \ 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \ 'NM=$$(NM_FOR_TARGET)' \