From 39fb55a7783997ae3441d416caf819fc1fc56ffa Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 23 May 2011 17:15:48 +0300 Subject: Rework DLL creation code for MinGW (cross-)compilation Don't run dlltool --output-exp to create a separate object file with just export data (.edata section). In the case where at least one function in the objects being linked has been explicitly marked for export, GNU ld will not look for export information in the object files anyway. At least the GetVersion() function seems to be marked for export explicitly. Just pass the .def file when linking. GNU ld since 2.17 supports @cmdfile syntax, just like MSVC tools, so no need to create a separate shell command file and source that. (Why that even would work better than just running the ld command with a long command line directly, I don't know.) Actually I don't know why even bother with the @cmdfile, after all we mainly intend WNTGCC to be used when cross-compiling, and there are no short command-line length restrictions on modern OSes from which one might want to cross-compile. But oh well. Pass the necessary -L switches, i.e. SOLARLIB, when linking with GNU ld. (For MSVC, the ILIB environment variable is used.) Produce the import library when linking, no need to have a separate rule to produce an import library for WNTGCC. Re-unroll tg_shl.mk into _tg_shl.mk with the recently unbroken mkunroll tool. --- solenv/inc/_tg_shl.mk | 730 +++++++++++++++++++++++++++++++++----------------- solenv/inc/tg_shl.mk | 71 +++-- 2 files changed, 538 insertions(+), 263 deletions(-) diff --git a/solenv/inc/_tg_shl.mk b/solenv/inc/_tg_shl.mk index f6b7cda35..0ca94375d 100644 --- a/solenv/inc/_tg_shl.mk +++ b/solenv/inc/_tg_shl.mk @@ -64,8 +64,11 @@ SHL1IMPLIB=i$(TARGET)_t1 .ENDIF # "$(SHL1IMPLIB)" == "" .IF "$(COM)" != "GCC" USE_1IMPLIB=-implib:$(LB)/$(SHL1IMPLIB).lib -.ENDIF # "$(COM)" != "GCC" SHL1IMPLIBN=$(LB)/$(SHL1IMPLIB).lib +.ELSE +SHL1IMPLIBN=$(LB)/lib$(SHL1IMPLIB).dll.a +USE_1IMPLIB=-Wl,--out-implib=$(SHL1IMPLIBN) +.ENDIF # "$(COM)" != "GCC" ALLTAR : $(SHL1IMPLIBN) .IF "$(USE_DEFFILE)"=="" @@ -282,30 +285,54 @@ $(SHL1TARGETN) : \ .ENDIF # "$(COM)"=="GCC" .ENDIF # "$(SHL1ALLRES)"!="" .IF "$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def - @echo $(DLLTOOL) --dllname $(SHL1TARGET)$(DLLPOST) \ - --kill-at \\ > $(MISC)/$(TARGET).$(@:b)_1.cmd +# GNU ld since 2.17 supports @cmdfile syntax +.IF "$(USE_DEFFILE)"!="" + @$(COMMAND_ECHO)tmpfile=$(mktmp $(strip \ + $(SHL1LINKFLAGS) \ + $(LINKFLAGSSHL) \ + $(SOLARLIB) \ + $(MINGWSSTDOBJ) \ + -o $@ \ + -Wl,-Map,$(MISC)/$(@:b).map \ + $(SHL1DEF) \ + $(USE_1IMPLIB) \ + $(STDOBJ) \ + $(SHL1VERSIONOBJ) $(SHL1OBJS) \ + $(subst,$(ROUT),$(PRJ)/$(ROUT) $(shell cat /dev/null $(SHL1LIBS))) \ + -Wl,--exclude-libs,ALL,--start-group $(SHL1STDLIBS) -Wl,--end-group \ + $(SHL1STDSHL) $(STDSHL1) \ + $(SHL1LINKRESO) \ + )) && echo -n "$(LINK) " && cat $$tmpfile && $(LINK) @$$tmpfile && $(RM) $$tmpfile +.ELSE @noop $(assign ALL1OBJLIST:=$(STDOBJ) $(SHL1OBJS) $(SHL1LINKRESO) $(shell $(TYPE) /dev/null $(SHL1LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g)) .IF "$(DEFLIB1NAME)"!="" # do not have to include objs @noop $(assign DEF1OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB1NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g)) @noop $(foreach,i,$(DEF1OBJLIST) $(assign ALL1OBJLIST:=$(ALL1OBJLIST:s?$i??))) .ENDIF # "$(DEFLIB1NAME)"!="" - @echo --output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_1.cmd -.IF "$(SHL1DEF)"!="" - @echo --input-def $(SHL1DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_1.cmd -.ELSE - @echo $(SHL1VERSIONOBJ) $(SHL1DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_1.cmd -.ENDIF - @echo $(ALL1OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_1.cmd - @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \ - $(STDOBJ) $(SHL1VERSIONOBJ) $(SHL1DESCRIPTIONOBJ) $(SHL1OBJS) $(SHL1LINKRESO) \ - `$(TYPE) /dev/null $(SHL1LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \ + $(COMMAND_ECHO)$(DLLTOOL) @@(mktmp \ + --dllname $(SHL1TARGET)$(DLLPOST) \ + --kill-at \ + --output-exp $(MISC)/$(@:b)_exp.o \ + $(SHL1VERSIONOBJ) \ + @(ALL1OBJLIST) + ) + $(COMMAND_ECHO)$(LINK) @$(mktmp $(strip \ + $(SHL1LINKFLAGS) \ + $(LINKFLAGSSHL) \ + $(SOLARLIB) \ + $(MINGWSSTDOBJ) \ + -o $@ \ + -Wl,-Map,$(MISC)/$(@:b).map \ + $(MISC)/$(@:b)_exp.o \ + $(USE_1IMPLIB) \ + $(STDOBJ) \ + $(SHL1VERSIONOBJ) $(SHL1OBJS) \ + $(subst,$(ROUT),$(PRJ)/$(ROUT) $(shell cat /dev/null $(SHL1LIBS))) \ -Wl,--exclude-libs,ALL,--start-group $(SHL1STDLIBS) -Wl,--end-group \ - $(SHL1STDSHL) $(STDSHL1) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \ - -Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_1.cmd - .IF "$(VERBOSE)" == "TRUE" - @$(TYPE) $(MISC)/$(TARGET).$(@:b)_1.cmd - .ENDIF - @+source $(MISC)/$(TARGET).$(@:b)_1.cmd + $(SHL1STDSHL) $(STDSHL1) \ + $(SHL1LINKRESO) \ + )) +.ENDIF .ELSE .IF "$(linkinc)"=="" .IF "$(SHL1USE_EXPORTS)"!="name" @@ -420,7 +447,7 @@ $(SHL1TARGETN) : \ @echo $(STDSLO) $(SHL1OBJS:s/.obj/.o/) \ $(SHL1VERSIONOBJ) \ `cat /dev/null $(SHL1LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list - @/bin/echo -n $(SHL1LINKER) $(SHL1LINKFLAGS) $(SHL1VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \ + @echo -n $(SHL1LINKER) $(SHL1LINKFLAGS) $(SHL1VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \ $(SHL1STDLIBS) $(SHL1ARCHIVES) $(SHL1STDSHL) $(STDSHL1) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_1.cmd @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \ `cat $(MISC)/$(TARGET).$(@:b)_1.cmd` \ @@ -539,8 +566,11 @@ SHL2IMPLIB=i$(TARGET)_t2 .ENDIF # "$(SHL2IMPLIB)" == "" .IF "$(COM)" != "GCC" USE_2IMPLIB=-implib:$(LB)/$(SHL2IMPLIB).lib -.ENDIF # "$(COM)" != "GCC" SHL2IMPLIBN=$(LB)/$(SHL2IMPLIB).lib +.ELSE +SHL2IMPLIBN=$(LB)/lib$(SHL2IMPLIB).dll.a +USE_2IMPLIB=-Wl,--out-implib=$(SHL2IMPLIBN) +.ENDIF # "$(COM)" != "GCC" ALLTAR : $(SHL2IMPLIBN) .IF "$(USE_DEFFILE)"=="" @@ -757,30 +787,54 @@ $(SHL2TARGETN) : \ .ENDIF # "$(COM)"=="GCC" .ENDIF # "$(SHL2ALLRES)"!="" .IF "$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def - @echo $(DLLTOOL) --dllname $(SHL2TARGET)$(DLLPOST) \ - --kill-at \\ > $(MISC)/$(TARGET).$(@:b)_2.cmd +# GNU ld since 2.17 supports @cmdfile syntax +.IF "$(USE_DEFFILE)"!="" + @$(COMMAND_ECHO)tmpfile=$(mktmp $(strip \ + $(SHL2LINKFLAGS) \ + $(LINKFLAGSSHL) \ + $(SOLARLIB) \ + $(MINGWSSTDOBJ) \ + -o $@ \ + -Wl,-Map,$(MISC)/$(@:b).map \ + $(SHL2DEF) \ + $(USE_2IMPLIB) \ + $(STDOBJ) \ + $(SHL2VERSIONOBJ) $(SHL2OBJS) \ + $(subst,$(ROUT),$(PRJ)/$(ROUT) $(shell cat /dev/null $(SHL2LIBS))) \ + -Wl,--exclude-libs,ALL,--start-group $(SHL2STDLIBS) -Wl,--end-group \ + $(SHL2STDSHL) $(STDSHL2) \ + $(SHL2LINKRESO) \ + )) && echo -n "$(LINK) " && cat $$tmpfile && $(LINK) @$$tmpfile && $(RM) $$tmpfile +.ELSE @noop $(assign ALL2OBJLIST:=$(STDOBJ) $(SHL2OBJS) $(SHL2LINKRESO) $(shell $(TYPE) /dev/null $(SHL2LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g)) .IF "$(DEFLIB2NAME)"!="" # do not have to include objs @noop $(assign DEF2OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB2NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g)) @noop $(foreach,i,$(DEF2OBJLIST) $(assign ALL2OBJLIST:=$(ALL2OBJLIST:s?$i??))) .ENDIF # "$(DEFLIB2NAME)"!="" - @echo --output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_2.cmd -.IF "$(SHL2DEF)"!="" - @echo --input-def $(SHL2DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_2.cmd -.ELSE - @echo $(SHL2VERSIONOBJ) $(SHL2DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_2.cmd -.ENDIF - @echo $(ALL2OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_2.cmd - @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \ - $(STDOBJ) $(SHL2VERSIONOBJ) $(SHL2DESCRIPTIONOBJ) $(SHL2OBJS) $(SHL2LINKRESO) \ - `$(TYPE) /dev/null $(SHL2LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \ + $(COMMAND_ECHO)$(DLLTOOL) @@(mktmp \ + --dllname $(SHL2TARGET)$(DLLPOST) \ + --kill-at \ + --output-exp $(MISC)/$(@:b)_exp.o \ + $(SHL2VERSIONOBJ) \ + @(ALL2OBJLIST) + ) + $(COMMAND_ECHO)$(LINK) @$(mktmp $(strip \ + $(SHL2LINKFLAGS) \ + $(LINKFLAGSSHL) \ + $(SOLARLIB) \ + $(MINGWSSTDOBJ) \ + -o $@ \ + -Wl,-Map,$(MISC)/$(@:b).map \ + $(MISC)/$(@:b)_exp.o \ + $(USE_2IMPLIB) \ + $(STDOBJ) \ + $(SHL2VERSIONOBJ) $(SHL2OBJS) \ + $(subst,$(ROUT),$(PRJ)/$(ROUT) $(shell cat /dev/null $(SHL2LIBS))) \ -Wl,--exclude-libs,ALL,--start-group $(SHL2STDLIBS) -Wl,--end-group \ - $(SHL2STDSHL) $(STDSHL2) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \ - -Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_2.cmd - .IF "$(VERBOSE)" == "TRUE" - @$(TYPE) $(MISC)/$(TARGET).$(@:b)_2.cmd - .ENDIF - @+source $(MISC)/$(TARGET).$(@:b)_2.cmd + $(SHL2STDSHL) $(STDSHL2) \ + $(SHL2LINKRESO) \ + )) +.ENDIF .ELSE .IF "$(linkinc)"=="" .IF "$(SHL2USE_EXPORTS)"!="name" @@ -895,7 +949,7 @@ $(SHL2TARGETN) : \ @echo $(STDSLO) $(SHL2OBJS:s/.obj/.o/) \ $(SHL2VERSIONOBJ) \ `cat /dev/null $(SHL2LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list - @/bin/echo -n $(SHL2LINKER) $(SHL2LINKFLAGS) $(SHL2VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \ + @echo -n $(SHL2LINKER) $(SHL2LINKFLAGS) $(SHL2VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \ $(SHL2STDLIBS) $(SHL2ARCHIVES) $(SHL2STDSHL) $(STDSHL2) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_2.cmd @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \ `cat $(MISC)/$(TARGET).$(@:b)_2.cmd` \ @@ -1014,8 +1068,11 @@ SHL3IMPLIB=i$(TARGET)_t3 .ENDIF # "$(SHL3IMPLIB)" == "" .IF "$(COM)" != "GCC" USE_3IMPLIB=-implib:$(LB)/$(SHL3IMPLIB).lib -.ENDIF # "$(COM)" != "GCC" SHL3IMPLIBN=$(LB)/$(SHL3IMPLIB).lib +.ELSE +SHL3IMPLIBN=$(LB)/lib$(SHL3IMPLIB).dll.a +USE_3IMPLIB=-Wl,--out-implib=$(SHL3IMPLIBN) +.ENDIF # "$(COM)" != "GCC" ALLTAR : $(SHL3IMPLIBN) .IF "$(USE_DEFFILE)"=="" @@ -1232,30 +1289,54 @@ $(SHL3TARGETN) : \ .ENDIF # "$(COM)"=="GCC" .ENDIF # "$(SHL3ALLRES)"!="" .IF "$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def - @echo $(DLLTOOL) --dllname $(SHL3TARGET)$(DLLPOST) \ - --kill-at \\ > $(MISC)/$(TARGET).$(@:b)_3.cmd +# GNU ld since 2.17 supports @cmdfile syntax +.IF "$(USE_DEFFILE)"!="" + @$(COMMAND_ECHO)tmpfile=$(mktmp $(strip \ + $(SHL3LINKFLAGS) \ + $(LINKFLAGSSHL) \ + $(SOLARLIB) \ + $(MINGWSSTDOBJ) \ + -o $@ \ + -Wl,-Map,$(MISC)/$(@:b).map \ + $(SHL3DEF) \ + $(USE_3IMPLIB) \ + $(STDOBJ) \ + $(SHL3VERSIONOBJ) $(SHL3OBJS) \ + $(subst,$(ROUT),$(PRJ)/$(ROUT) $(shell cat /dev/null $(SHL3LIBS))) \ + -Wl,--exclude-libs,ALL,--start-group $(SHL3STDLIBS) -Wl,--end-group \ + $(SHL3STDSHL) $(STDSHL3) \ + $(SHL3LINKRESO) \ + )) && echo -n "$(LINK) " && cat $$tmpfile && $(LINK) @$$tmpfile && $(RM) $$tmpfile +.ELSE @noop $(assign ALL3OBJLIST:=$(STDOBJ) $(SHL3OBJS) $(SHL3LINKRESO) $(shell $(TYPE) /dev/null $(SHL3LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g)) .IF "$(DEFLIB3NAME)"!="" # do not have to include objs @noop $(assign DEF3OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB3NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g)) @noop $(foreach,i,$(DEF3OBJLIST) $(assign ALL3OBJLIST:=$(ALL3OBJLIST:s?$i??))) .ENDIF # "$(DEFLIB3NAME)"!="" - @echo --output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_3.cmd -.IF "$(SHL3DEF)"!="" - @echo --input-def $(SHL3DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_3.cmd -.ELSE - @echo $(SHL3VERSIONOBJ) $(SHL3DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_3.cmd -.ENDIF - @echo $(ALL3OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_3.cmd - @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \ - $(STDOBJ) $(SHL3VERSIONOBJ) $(SHL3DESCRIPTIONOBJ) $(SHL3OBJS) $(SHL3LINKRESO) \ - `$(TYPE) /dev/null $(SHL3LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \ + $(COMMAND_ECHO)$(DLLTOOL) @@(mktmp \ + --dllname $(SHL3TARGET)$(DLLPOST) \ + --kill-at \ + --output-exp $(MISC)/$(@:b)_exp.o \ + $(SHL3VERSIONOBJ) \ + @(ALL3OBJLIST) + ) + $(COMMAND_ECHO)$(LINK) @$(mktmp $(strip \ + $(SHL3LINKFLAGS) \ + $(LINKFLAGSSHL) \ + $(SOLARLIB) \ + $(MINGWSSTDOBJ) \ + -o $@ \ + -Wl,-Map,$(MISC)/$(@:b).map \ + $(MISC)/$(@:b)_exp.o \ + $(USE_3IMPLIB) \ + $(STDOBJ) \ + $(SHL3VERSIONOBJ) $(SHL3OBJS) \ + $(subst,$(ROUT),$(PRJ)/$(ROUT) $(shell cat /dev/null $(SHL3LIBS))) \ -Wl,--exclude-libs,ALL,--start-group $(SHL3STDLIBS) -Wl,--end-group \ - $(SHL3STDSHL) $(STDSHL3) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \ - -Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_3.cmd - .IF "$(VERBOSE)" == "TRUE" - @$(TYPE) $(MISC)/$(TARGET).$(@:b)_3.cmd - .ENDIF - @+source $(MISC)/$(TARGET).$(@:b)_3.cmd + $(SHL3STDSHL) $(STDSHL3) \ + $(SHL3LINKRESO) \ + )) +.ENDIF .ELSE .IF "$(linkinc)"=="" .IF "$(SHL3USE_EXPORTS)"!="name" @@ -1370,7 +1451,7 @@ $(SHL3TARGETN) : \ @echo $(STDSLO) $(SHL3OBJS:s/.obj/.o/) \ $(SHL3VERSIONOBJ) \ `cat /dev/null $(SHL3LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list - @/bin/echo -n $(SHL3LINKER) $(SHL3LINKFLAGS) $(SHL3VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \ + @echo -n $(SHL3LINKER) $(SHL3LINKFLAGS) $(SHL3VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \ $(SHL3STDLIBS) $(SHL3ARCHIVES) $(SHL3STDSHL) $(STDSHL3) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_3.cmd @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \ `cat $(MISC)/$(TARGET).$(@:b)_3.cmd` \ @@ -1489,8 +1570,11 @@ SHL4IMPLIB=i$(TARGET)_t4 .ENDIF # "$(SHL4IMPLIB)" == "" .IF "$(COM)" != "GCC" USE_4IMPLIB=-implib:$(LB)/$(SHL4IMPLIB).lib -.ENDIF # "$(COM)" != "GCC" SHL4IMPLIBN=$(LB)/$(SHL4IMPLIB).lib +.ELSE +SHL4IMPLIBN=$(LB)/lib$(SHL4IMPLIB).dll.a +USE_4IMPLIB=-Wl,--out-implib=$(SHL4IMPLIBN) +.ENDIF # "$(COM)" != "GCC" ALLTAR : $(SHL4IMPLIBN) .IF "$(USE_DEFFILE)"=="" @@ -1707,30 +1791,54 @@ $(SHL4TARGETN) : \ .ENDIF # "$(COM)"=="GCC" .ENDIF # "$(SHL4ALLRES)"!="" .IF "$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def - @echo $(DLLTOOL) --dllname $(SHL4TARGET)$(DLLPOST) \ - --kill-at \\ > $(MISC)/$(TARGET).$(@:b)_4.cmd +# GNU ld since 2.17 supports @cmdfile syntax +.IF "$(USE_DEFFILE)"!="" + @$(COMMAND_ECHO)tmpfile=$(mktmp $(strip \ + $(SHL4LINKFLAGS) \ + $(LINKFLAGSSHL) \ + $(SOLARLIB) \ + $(MINGWSSTDOBJ) \ + -o $@ \ + -Wl,-Map,$(MISC)/$(@:b).map \ + $(SHL4DEF) \ + $(USE_4IMPLIB) \ + $(STDOBJ) \ + $(SHL4VERSIONOBJ) $(SHL4OBJS) \ + $(subst,$(ROUT),$(PRJ)/$(ROUT) $(shell cat /dev/null $(SHL4LIBS))) \ + -Wl,--exclude-libs,ALL,--start-group $(SHL4STDLIBS) -Wl,--end-group \ + $(SHL4STDSHL) $(STDSHL4) \ + $(SHL4LINKRESO) \ + )) && echo -n "$(LINK) " && cat $$tmpfile && $(LINK) @$$tmpfile && $(RM) $$tmpfile +.ELSE @noop $(assign ALL4OBJLIST:=$(STDOBJ) $(SHL4OBJS) $(SHL4LINKRESO) $(shell $(TYPE) /dev/null $(SHL4LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g)) .IF "$(DEFLIB4NAME)"!="" # do not have to include objs @noop $(assign DEF4OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB4NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g)) @noop $(foreach,i,$(DEF4OBJLIST) $(assign ALL4OBJLIST:=$(ALL4OBJLIST:s?$i??))) .ENDIF # "$(DEFLIB4NAME)"!="" - @echo --output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_4.cmd -.IF "$(SHL4DEF)"!="" - @echo --input-def $(SHL4DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_4.cmd -.ELSE - @echo $(SHL4VERSIONOBJ) $(SHL4DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_4.cmd -.ENDIF - @echo $(ALL4OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_4.cmd - @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \ - $(STDOBJ) $(SHL4VERSIONOBJ) $(SHL4DESCRIPTIONOBJ) $(SHL4OBJS) $(SHL4LINKRESO) \ - `$(TYPE) /dev/null $(SHL4LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \ + $(COMMAND_ECHO)$(DLLTOOL) @@(mktmp \ + --dllname $(SHL4TARGET)$(DLLPOST) \ + --kill-at \ + --output-exp $(MISC)/$(@:b)_exp.o \ + $(SHL4VERSIONOBJ) \ + @(ALL4OBJLIST) + ) + $(COMMAND_ECHO)$(LINK) @$(mktmp $(strip \ + $(SHL4LINKFLAGS) \ + $(LINKFLAGSSHL) \ + $(SOLARLIB) \ + $(MINGWSSTDOBJ) \ + -o $@ \ + -Wl,-Map,$(MISC)/$(@:b).map \ + $(MISC)/$(@:b)_exp.o \ + $(USE_4IMPLIB) \ + $(STDOBJ) \ + $(SHL4VERSIONOBJ) $(SHL4OBJS) \ + $(subst,$(ROUT),$(PRJ)/$(ROUT) $(shell cat /dev/null $(SHL4LIBS))) \ -Wl,--exclude-libs,ALL,--start-group $(SHL4STDLIBS) -Wl,--end-group \ - $(SHL4STDSHL) $(STDSHL4) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \ - -Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_4.cmd - .IF "$(VERBOSE)" == "TRUE" - @$(TYPE) $(MISC)/$(TARGET).$(@:b)_4.cmd - .ENDIF - @+source $(MISC)/$(TARGET).$(@:b)_4.cmd + $(SHL4STDSHL) $(STDSHL4) \ + $(SHL4LINKRESO) \ + )) +.ENDIF .ELSE .IF "$(linkinc)"=="" .IF "$(SHL4USE_EXPORTS)"!="name" @@ -1845,7 +1953,7 @@ $(SHL4TARGETN) : \ @echo $(STDSLO) $(SHL4OBJS:s/.obj/.o/) \ $(SHL4VERSIONOBJ) \ `cat /dev/null $(SHL4LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list - @/bin/echo -n $(SHL4LINKER) $(SHL4LINKFLAGS) $(SHL4VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \ + @echo -n $(SHL4LINKER) $(SHL4LINKFLAGS) $(SHL4VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \ $(SHL4STDLIBS) $(SHL4ARCHIVES) $(SHL4STDSHL) $(STDSHL4) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_4.cmd @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \ `cat $(MISC)/$(TARGET).$(@:b)_4.cmd` \ @@ -1964,8 +2072,11 @@ SHL5IMPLIB=i$(TARGET)_t5 .ENDIF # "$(SHL5IMPLIB)" == "" .IF "$(COM)" != "GCC" USE_5IMPLIB=-implib:$(LB)/$(SHL5IMPLIB).lib -.ENDIF # "$(COM)" != "GCC" SHL5IMPLIBN=$(LB)/$(SHL5IMPLIB).lib +.ELSE +SHL5IMPLIBN=$(LB)/lib$(SHL5IMPLIB).dll.a +USE_5IMPLIB=-Wl,--out-implib=$(SHL5IMPLIBN) +.ENDIF # "$(COM)" != "GCC" ALLTAR : $(SHL5IMPLIBN) .IF "$(USE_DEFFILE)"=="" @@ -2182,30 +2293,54 @@ $(SHL5TARGETN) : \ .ENDIF # "$(COM)"=="GCC" .ENDIF # "$(SHL5ALLRES)"!="" .IF "$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def - @echo $(DLLTOOL) --dllname $(SHL5TARGET)$(DLLPOST) \ - --kill-at \\ > $(MISC)/$(TARGET).$(@:b)_5.cmd +# GNU ld since 2.17 supports @cmdfile syntax +.IF "$(USE_DEFFILE)"!="" + @$(COMMAND_ECHO)tmpfile=$(mktmp $(strip \ + $(SHL5LINKFLAGS) \ + $(LINKFLAGSSHL) \ + $(SOLARLIB) \ + $(MINGWSSTDOBJ) \ + -o $@ \ + -Wl,-Map,$(MISC)/$(@:b).map \ + $(SHL5DEF) \ + $(USE_5IMPLIB) \ + $(STDOBJ) \ + $(SHL5VERSIONOBJ) $(SHL5OBJS) \ + $(subst,$(ROUT),$(PRJ)/$(ROUT) $(shell cat /dev/null $(SHL5LIBS))) \ + -Wl,--exclude-libs,ALL,--start-group $(SHL5STDLIBS) -Wl,--end-group \ + $(SHL5STDSHL) $(STDSHL5) \ + $(SHL5LINKRESO) \ + )) && echo -n "$(LINK) " && cat $$tmpfile && $(LINK) @$$tmpfile && $(RM) $$tmpfile +.ELSE @noop $(assign ALL5OBJLIST:=$(STDOBJ) $(SHL5OBJS) $(SHL5LINKRESO) $(shell $(TYPE) /dev/null $(SHL5LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g)) .IF "$(DEFLIB5NAME)"!="" # do not have to include objs @noop $(assign DEF5OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB5NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g)) @noop $(foreach,i,$(DEF5OBJLIST) $(assign ALL5OBJLIST:=$(ALL5OBJLIST:s?$i??))) .ENDIF # "$(DEFLIB5NAME)"!="" - @echo --output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_5.cmd -.IF "$(SHL5DEF)"!="" - @echo --input-def $(SHL5DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_5.cmd -.ELSE - @echo $(SHL5VERSIONOBJ) $(SHL5DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_5.cmd -.ENDIF - @echo $(ALL5OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_5.cmd - @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \ - $(STDOBJ) $(SHL5VERSIONOBJ) $(SHL5DESCRIPTIONOBJ) $(SHL5OBJS) $(SHL5LINKRESO) \ - `$(TYPE) /dev/null $(SHL5LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \ + $(COMMAND_ECHO)$(DLLTOOL) @@(mktmp \ + --dllname $(SHL5TARGET)$(DLLPOST) \ + --kill-at \ + --output-exp $(MISC)/$(@:b)_exp.o \ + $(SHL5VERSIONOBJ) \ + @(ALL5OBJLIST) + ) + $(COMMAND_ECHO)$(LINK) @$(mktmp $(strip \ + $(SHL5LINKFLAGS) \ + $(LINKFLAGSSHL) \ + $(SOLARLIB) \ + $(MINGWSSTDOBJ) \ + -o $@ \ + -Wl,-Map,$(MISC)/$(@:b).map \ + $(MISC)/$(@:b)_exp.o \ + $(USE_5IMPLIB) \ + $(STDOBJ) \ + $(SHL5VERSIONOBJ) $(SHL5OBJS) \ + $(subst,$(ROUT),$(PRJ)/$(ROUT) $(shell cat /dev/null $(SHL5LIBS))) \ -Wl,--exclude-libs,ALL,--start-group $(SHL5STDLIBS) -Wl,--end-group \ - $(SHL5STDSHL) $(STDSHL5) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \ - -Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_5.cmd - .IF "$(VERBOSE)" == "TRUE" - @$(TYPE) $(MISC)/$(TARGET).$(@:b)_5.cmd - .ENDIF - @+source $(MISC)/$(TARGET).$(@:b)_5.cmd + $(SHL5STDSHL) $(STDSHL5) \ + $(SHL5LINKRESO) \ + )) +.ENDIF .ELSE .IF "$(linkinc)"=="" .IF "$(SHL5USE_EXPORTS)"!="name" @@ -2320,7 +2455,7 @@ $(SHL5TARGETN) : \ @echo $(STDSLO) $(SHL5OBJS:s/.obj/.o/) \ $(SHL5VERSIONOBJ) \ `cat /dev/null $(SHL5LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list - @/bin/echo -n $(SHL5LINKER) $(SHL5LINKFLAGS) $(SHL5VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \ + @echo -n $(SHL5LINKER) $(SHL5LINKFLAGS) $(SHL5VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \ $(SHL5STDLIBS) $(SHL5ARCHIVES) $(SHL5STDSHL) $(STDSHL5) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_5.cmd @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \ `cat $(MISC)/$(TARGET).$(@:b)_5.cmd` \ @@ -2439,8 +2574,11 @@ SHL6IMPLIB=i$(TARGET)_t6 .ENDIF # "$(SHL6IMPLIB)" == "" .IF "$(COM)" != "GCC" USE_6IMPLIB=-implib:$(LB)/$(SHL6IMPLIB).lib -.ENDIF # "$(COM)" != "GCC" SHL6IMPLIBN=$(LB)/$(SHL6IMPLIB).lib +.ELSE +SHL6IMPLIBN=$(LB)/lib$(SHL6IMPLIB).dll.a +USE_6IMPLIB=-Wl,--out-implib=$(SHL6IMPLIBN) +.ENDIF # "$(COM)" != "GCC" ALLTAR : $(SHL6IMPLIBN) .IF "$(USE_DEFFILE)"=="" @@ -2657,30 +2795,54 @@ $(SHL6TARGETN) : \ .ENDIF # "$(COM)"=="GCC" .ENDIF # "$(SHL6ALLRES)"!="" .IF "$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def - @echo $(DLLTOOL) --dllname $(SHL6TARGET)$(DLLPOST) \ - --kill-at \\ > $(MISC)/$(TARGET).$(@:b)_6.cmd +# GNU ld since 2.17 supports @cmdfile syntax +.IF "$(USE_DEFFILE)"!="" + @$(COMMAND_ECHO)tmpfile=$(mktmp $(strip \ + $(SHL6LINKFLAGS) \ + $(LINKFLAGSSHL) \ + $(SOLARLIB) \ + $(MINGWSSTDOBJ) \ + -o $@ \ + -Wl,-Map,$(MISC)/$(@:b).map \ + $(SHL6DEF) \ + $(USE_6IMPLIB) \ + $(STDOBJ) \ + $(SHL6VERSIONOBJ) $(SHL6OBJS) \ + $(subst,$(ROUT),$(PRJ)/$(ROUT) $(shell cat /dev/null $(SHL6LIBS))) \ + -Wl,--exclude-libs,ALL,--start-group $(SHL6STDLIBS) -Wl,--end-group \ + $(SHL6STDSHL) $(STDSHL6) \ + $(SHL6LINKRESO) \ + )) && echo -n "$(LINK) " && cat $$tmpfile && $(LINK) @$$tmpfile && $(RM) $$tmpfile +.ELSE @noop $(assign ALL6OBJLIST:=$(STDOBJ) $(SHL6OBJS) $(SHL6LINKRESO) $(shell $(TYPE) /dev/null $(SHL6LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g)) .IF "$(DEFLIB6NAME)"!="" # do not have to include objs @noop $(assign DEF6OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB6NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g)) @noop $(foreach,i,$(DEF6OBJLIST) $(assign ALL6OBJLIST:=$(ALL6OBJLIST:s?$i??))) .ENDIF # "$(DEFLIB6NAME)"!="" - @echo --output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_6.cmd -.IF "$(SHL6DEF)"!="" - @echo --input-def $(SHL6DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_6.cmd -.ELSE - @echo $(SHL6VERSIONOBJ) $(SHL6DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_6.cmd -.ENDIF - @echo $(ALL6OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_6.cmd - @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \ - $(STDOBJ) $(SHL6VERSIONOBJ) $(SHL6DESCRIPTIONOBJ) $(SHL6OBJS) $(SHL6LINKRESO) \ - `$(TYPE) /dev/null $(SHL6LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \ + $(COMMAND_ECHO)$(DLLTOOL) @@(mktmp \ + --dllname $(SHL6TARGET)$(DLLPOST) \ + --kill-at \ + --output-exp $(MISC)/$(@:b)_exp.o \ + $(SHL6VERSIONOBJ) \ + @(ALL6OBJLIST) + ) + $(COMMAND_ECHO)$(LINK) @$(mktmp $(strip \ + $(SHL6LINKFLAGS) \ + $(LINKFLAGSSHL) \ + $(SOLARLIB) \ + $(MINGWSSTDOBJ) \ + -o $@ \ + -Wl,-Map,$(MISC)/$(@:b).map \ + $(MISC)/$(@:b)_exp.o \ + $(USE_6IMPLIB) \ + $(STDOBJ) \ + $(SHL6VERSIONOBJ) $(SHL6OBJS) \ + $(subst,$(ROUT),$(PRJ)/$(ROUT) $(shell cat /dev/null $(SHL6LIBS))) \ -Wl,--exclude-libs,ALL,--start-group $(SHL6STDLIBS) -Wl,--end-group \ - $(SHL6STDSHL) $(STDSHL6) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \ - -Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_6.cmd - .IF "$(VERBOSE)" == "TRUE" - @$(TYPE) $(MISC)/$(TARGET).$(@:b)_6.cmd - .ENDIF - @+source $(MISC)/$(TARGET).$(@:b)_6.cmd + $(SHL6STDSHL) $(STDSHL6) \ + $(SHL6LINKRESO) \ + )) +.ENDIF .ELSE .IF "$(linkinc)"=="" .IF "$(SHL6USE_EXPORTS)"!="name" @@ -2795,7 +2957,7 @@ $(SHL6TARGETN) : \ @echo $(STDSLO) $(SHL6OBJS:s/.obj/.o/) \ $(SHL6VERSIONOBJ) \ `cat /dev/null $(SHL6LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list - @/bin/echo -n $(SHL6LINKER) $(SHL6LINKFLAGS) $(SHL6VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \ + @echo -n $(SHL6LINKER) $(SHL6LINKFLAGS) $(SHL6VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \ $(SHL6STDLIBS) $(SHL6ARCHIVES) $(SHL6STDSHL) $(STDSHL6) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_6.cmd @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \ `cat $(MISC)/$(TARGET).$(@:b)_6.cmd` \ @@ -2914,8 +3076,11 @@ SHL7IMPLIB=i$(TARGET)_t7 .ENDIF # "$(SHL7IMPLIB)" == "" .IF "$(COM)" != "GCC" USE_7IMPLIB=-implib:$(LB)/$(SHL7IMPLIB).lib -.ENDIF # "$(COM)" != "GCC" SHL7IMPLIBN=$(LB)/$(SHL7IMPLIB).lib +.ELSE +SHL7IMPLIBN=$(LB)/lib$(SHL7IMPLIB).dll.a +USE_7IMPLIB=-Wl,--out-implib=$(SHL7IMPLIBN) +.ENDIF # "$(COM)" != "GCC" ALLTAR : $(SHL7IMPLIBN) .IF "$(USE_DEFFILE)"=="" @@ -3132,30 +3297,54 @@ $(SHL7TARGETN) : \ .ENDIF # "$(COM)"=="GCC" .ENDIF # "$(SHL7ALLRES)"!="" .IF "$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def - @echo $(DLLTOOL) --dllname $(SHL7TARGET)$(DLLPOST) \ - --kill-at \\ > $(MISC)/$(TARGET).$(@:b)_7.cmd +# GNU ld since 2.17 supports @cmdfile syntax +.IF "$(USE_DEFFILE)"!="" + @$(COMMAND_ECHO)tmpfile=$(mktmp $(strip \ + $(SHL7LINKFLAGS) \ + $(LINKFLAGSSHL) \ + $(SOLARLIB) \ + $(MINGWSSTDOBJ) \ + -o $@ \ + -Wl,-Map,$(MISC)/$(@:b).map \ + $(SHL7DEF) \ + $(USE_7IMPLIB) \ + $(STDOBJ) \ + $(SHL7VERSIONOBJ) $(SHL7OBJS) \ + $(subst,$(ROUT),$(PRJ)/$(ROUT) $(shell cat /dev/null $(SHL7LIBS))) \ + -Wl,--exclude-libs,ALL,--start-group $(SHL7STDLIBS) -Wl,--end-group \ + $(SHL7STDSHL) $(STDSHL7) \ + $(SHL7LINKRESO) \ + )) && echo -n "$(LINK) " && cat $$tmpfile && $(LINK) @$$tmpfile && $(RM) $$tmpfile +.ELSE @noop $(assign ALL7OBJLIST:=$(STDOBJ) $(SHL7OBJS) $(SHL7LINKRESO) $(shell $(TYPE) /dev/null $(SHL7LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g)) .IF "$(DEFLIB7NAME)"!="" # do not have to include objs @noop $(assign DEF7OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB7NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g)) @noop $(foreach,i,$(DEF7OBJLIST) $(assign ALL7OBJLIST:=$(ALL7OBJLIST:s?$i??))) .ENDIF # "$(DEFLIB7NAME)"!="" - @echo --output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_7.cmd -.IF "$(SHL7DEF)"!="" - @echo --input-def $(SHL7DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_7.cmd -.ELSE - @echo $(SHL7VERSIONOBJ) $(SHL7DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_7.cmd -.ENDIF - @echo $(ALL7OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_7.cmd - @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \ - $(STDOBJ) $(SHL7VERSIONOBJ) $(SHL7DESCRIPTIONOBJ) $(SHL7OBJS) $(SHL7LINKRESO) \ - `$(TYPE) /dev/null $(SHL7LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \ + $(COMMAND_ECHO)$(DLLTOOL) @@(mktmp \ + --dllname $(SHL7TARGET)$(DLLPOST) \ + --kill-at \ + --output-exp $(MISC)/$(@:b)_exp.o \ + $(SHL7VERSIONOBJ) \ + @(ALL7OBJLIST) + ) + $(COMMAND_ECHO)$(LINK) @$(mktmp $(strip \ + $(SHL7LINKFLAGS) \ + $(LINKFLAGSSHL) \ + $(SOLARLIB) \ + $(MINGWSSTDOBJ) \ + -o $@ \ + -Wl,-Map,$(MISC)/$(@:b).map \ + $(MISC)/$(@:b)_exp.o \ + $(USE_7IMPLIB) \ + $(STDOBJ) \ + $(SHL7VERSIONOBJ) $(SHL7OBJS) \ + $(subst,$(ROUT),$(PRJ)/$(ROUT) $(shell cat /dev/null $(SHL7LIBS))) \ -Wl,--exclude-libs,ALL,--start-group $(SHL7STDLIBS) -Wl,--end-group \ - $(SHL7STDSHL) $(STDSHL7) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \ - -Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_7.cmd - .IF "$(VERBOSE)" == "TRUE" - @$(TYPE) $(MISC)/$(TARGET).$(@:b)_7.cmd - .ENDIF - @+source $(MISC)/$(TARGET).$(@:b)_7.cmd + $(SHL7STDSHL) $(STDSHL7) \ + $(SHL7LINKRESO) \ + )) +.ENDIF .ELSE .IF "$(linkinc)"=="" .IF "$(SHL7USE_EXPORTS)"!="name" @@ -3270,7 +3459,7 @@ $(SHL7TARGETN) : \ @echo $(STDSLO) $(SHL7OBJS:s/.obj/.o/) \ $(SHL7VERSIONOBJ) \ `cat /dev/null $(SHL7LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list - @/bin/echo -n $(SHL7LINKER) $(SHL7LINKFLAGS) $(SHL7VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \ + @echo -n $(SHL7LINKER) $(SHL7LINKFLAGS) $(SHL7VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \ $(SHL7STDLIBS) $(SHL7ARCHIVES) $(SHL7STDSHL) $(STDSHL7) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_7.cmd @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \ `cat $(MISC)/$(TARGET).$(@:b)_7.cmd` \ @@ -3389,8 +3578,11 @@ SHL8IMPLIB=i$(TARGET)_t8 .ENDIF # "$(SHL8IMPLIB)" == "" .IF "$(COM)" != "GCC" USE_8IMPLIB=-implib:$(LB)/$(SHL8IMPLIB).lib -.ENDIF # "$(COM)" != "GCC" SHL8IMPLIBN=$(LB)/$(SHL8IMPLIB).lib +.ELSE +SHL8IMPLIBN=$(LB)/lib$(SHL8IMPLIB).dll.a +USE_8IMPLIB=-Wl,--out-implib=$(SHL8IMPLIBN) +.ENDIF # "$(COM)" != "GCC" ALLTAR : $(SHL8IMPLIBN) .IF "$(USE_DEFFILE)"=="" @@ -3607,30 +3799,54 @@ $(SHL8TARGETN) : \ .ENDIF # "$(COM)"=="GCC" .ENDIF # "$(SHL8ALLRES)"!="" .IF "$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def - @echo $(DLLTOOL) --dllname $(SHL8TARGET)$(DLLPOST) \ - --kill-at \\ > $(MISC)/$(TARGET).$(@:b)_8.cmd +# GNU ld since 2.17 supports @cmdfile syntax +.IF "$(USE_DEFFILE)"!="" + @$(COMMAND_ECHO)tmpfile=$(mktmp $(strip \ + $(SHL8LINKFLAGS) \ + $(LINKFLAGSSHL) \ + $(SOLARLIB) \ + $(MINGWSSTDOBJ) \ + -o $@ \ + -Wl,-Map,$(MISC)/$(@:b).map \ + $(SHL8DEF) \ + $(USE_8IMPLIB) \ + $(STDOBJ) \ + $(SHL8VERSIONOBJ) $(SHL8OBJS) \ + $(subst,$(ROUT),$(PRJ)/$(ROUT) $(shell cat /dev/null $(SHL8LIBS))) \ + -Wl,--exclude-libs,ALL,--start-group $(SHL8STDLIBS) -Wl,--end-group \ + $(SHL8STDSHL) $(STDSHL8) \ + $(SHL8LINKRESO) \ + )) && echo -n "$(LINK) " && cat $$tmpfile && $(LINK) @$$tmpfile && $(RM) $$tmpfile +.ELSE @noop $(assign ALL8OBJLIST:=$(STDOBJ) $(SHL8OBJS) $(SHL8LINKRESO) $(shell $(TYPE) /dev/null $(SHL8LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g)) .IF "$(DEFLIB8NAME)"!="" # do not have to include objs @noop $(assign DEF8OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB8NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g)) @noop $(foreach,i,$(DEF8OBJLIST) $(assign ALL8OBJLIST:=$(ALL8OBJLIST:s?$i??))) .ENDIF # "$(DEFLIB8NAME)"!="" - @echo --output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_8.cmd -.IF "$(SHL8DEF)"!="" - @echo --input-def $(SHL8DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_8.cmd -.ELSE - @echo $(SHL8VERSIONOBJ) $(SHL8DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_8.cmd -.ENDIF - @echo $(ALL8OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_8.cmd - @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \ - $(STDOBJ) $(SHL8VERSIONOBJ) $(SHL8DESCRIPTIONOBJ) $(SHL8OBJS) $(SHL8LINKRESO) \ - `$(TYPE) /dev/null $(SHL8LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \ + $(COMMAND_ECHO)$(DLLTOOL) @@(mktmp \ + --dllname $(SHL8TARGET)$(DLLPOST) \ + --kill-at \ + --output-exp $(MISC)/$(@:b)_exp.o \ + $(SHL8VERSIONOBJ) \ + @(ALL8OBJLIST) + ) + $(COMMAND_ECHO)$(LINK) @$(mktmp $(strip \ + $(SHL8LINKFLAGS) \ + $(LINKFLAGSSHL) \ + $(SOLARLIB) \ + $(MINGWSSTDOBJ) \ + -o $@ \ + -Wl,-Map,$(MISC)/$(@:b).map \ + $(MISC)/$(@:b)_exp.o \ + $(USE_8IMPLIB) \ + $(STDOBJ) \ + $(SHL8VERSIONOBJ) $(SHL8OBJS) \ + $(subst,$(ROUT),$(PRJ)/$(ROUT) $(shell cat /dev/null $(SHL8LIBS))) \ -Wl,--exclude-libs,ALL,--start-group $(SHL8STDLIBS) -Wl,--end-group \ - $(SHL8STDSHL) $(STDSHL8) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \ - -Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_8.cmd - .IF "$(VERBOSE)" == "TRUE" - @$(TYPE) $(MISC)/$(TARGET).$(@:b)_8.cmd - .ENDIF - @+source $(MISC)/$(TARGET).$(@:b)_8.cmd + $(SHL8STDSHL) $(STDSHL8) \ + $(SHL8LINKRESO) \ + )) +.ENDIF .ELSE .IF "$(linkinc)"=="" .IF "$(SHL8USE_EXPORTS)"!="name" @@ -3745,7 +3961,7 @@ $(SHL8TARGETN) : \ @echo $(STDSLO) $(SHL8OBJS:s/.obj/.o/) \ $(SHL8VERSIONOBJ) \ `cat /dev/null $(SHL8LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list - @/bin/echo -n $(SHL8LINKER) $(SHL8LINKFLAGS) $(SHL8VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \ + @echo -n $(SHL8LINKER) $(SHL8LINKFLAGS) $(SHL8VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \ $(SHL8STDLIBS) $(SHL8ARCHIVES) $(SHL8STDSHL) $(STDSHL8) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_8.cmd @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \ `cat $(MISC)/$(TARGET).$(@:b)_8.cmd` \ @@ -3864,8 +4080,11 @@ SHL9IMPLIB=i$(TARGET)_t9 .ENDIF # "$(SHL9IMPLIB)" == "" .IF "$(COM)" != "GCC" USE_9IMPLIB=-implib:$(LB)/$(SHL9IMPLIB).lib -.ENDIF # "$(COM)" != "GCC" SHL9IMPLIBN=$(LB)/$(SHL9IMPLIB).lib +.ELSE +SHL9IMPLIBN=$(LB)/lib$(SHL9IMPLIB).dll.a +USE_9IMPLIB=-Wl,--out-implib=$(SHL9IMPLIBN) +.ENDIF # "$(COM)" != "GCC" ALLTAR : $(SHL9IMPLIBN) .IF "$(USE_DEFFILE)"=="" @@ -4082,30 +4301,54 @@ $(SHL9TARGETN) : \ .ENDIF # "$(COM)"=="GCC" .ENDIF # "$(SHL9ALLRES)"!="" .IF "$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def - @echo $(DLLTOOL) --dllname $(SHL9TARGET)$(DLLPOST) \ - --kill-at \\ > $(MISC)/$(TARGET).$(@:b)_9.cmd +# GNU ld since 2.17 supports @cmdfile syntax +.IF "$(USE_DEFFILE)"!="" + @$(COMMAND_ECHO)tmpfile=$(mktmp $(strip \ + $(SHL9LINKFLAGS) \ + $(LINKFLAGSSHL) \ + $(SOLARLIB) \ + $(MINGWSSTDOBJ) \ + -o $@ \ + -Wl,-Map,$(MISC)/$(@:b).map \ + $(SHL9DEF) \ + $(USE_9IMPLIB) \ + $(STDOBJ) \ + $(SHL9VERSIONOBJ) $(SHL9OBJS) \ + $(subst,$(ROUT),$(PRJ)/$(ROUT) $(shell cat /dev/null $(SHL9LIBS))) \ + -Wl,--exclude-libs,ALL,--start-group $(SHL9STDLIBS) -Wl,--end-group \ + $(SHL9STDSHL) $(STDSHL9) \ + $(SHL9LINKRESO) \ + )) && echo -n "$(LINK) " && cat $$tmpfile && $(LINK) @$$tmpfile && $(RM) $$tmpfile +.ELSE @noop $(assign ALL9OBJLIST:=$(STDOBJ) $(SHL9OBJS) $(SHL9LINKRESO) $(shell $(TYPE) /dev/null $(SHL9LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g)) .IF "$(DEFLIB9NAME)"!="" # do not have to include objs @noop $(assign DEF9OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB9NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g)) @noop $(foreach,i,$(DEF9OBJLIST) $(assign ALL9OBJLIST:=$(ALL9OBJLIST:s?$i??))) .ENDIF # "$(DEFLIB9NAME)"!="" - @echo --output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_9.cmd -.IF "$(SHL9DEF)"!="" - @echo --input-def $(SHL9DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_9.cmd -.ELSE - @echo $(SHL9VERSIONOBJ) $(SHL9DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_9.cmd -.ENDIF - @echo $(ALL9OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_9.cmd - @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \ - $(STDOBJ) $(SHL9VERSIONOBJ) $(SHL9DESCRIPTIONOBJ) $(SHL9OBJS) $(SHL9LINKRESO) \ - `$(TYPE) /dev/null $(SHL9LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \ + $(COMMAND_ECHO)$(DLLTOOL) @@(mktmp \ + --dllname $(SHL9TARGET)$(DLLPOST) \ + --kill-at \ + --output-exp $(MISC)/$(@:b)_exp.o \ + $(SHL9VERSIONOBJ) \ + @(ALL9OBJLIST) + ) + $(COMMAND_ECHO)$(LINK) @$(mktmp $(strip \ + $(SHL9LINKFLAGS) \ + $(LINKFLAGSSHL) \ + $(SOLARLIB) \ + $(MINGWSSTDOBJ) \ + -o $@ \ + -Wl,-Map,$(MISC)/$(@:b).map \ + $(MISC)/$(@:b)_exp.o \ + $(USE_9IMPLIB) \ + $(STDOBJ) \ + $(SHL9VERSIONOBJ) $(SHL9OBJS) \ + $(subst,$(ROUT),$(PRJ)/$(ROUT) $(shell cat /dev/null $(SHL9LIBS))) \ -Wl,--exclude-libs,ALL,--start-group $(SHL9STDLIBS) -Wl,--end-group \ - $(SHL9STDSHL) $(STDSHL9) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \ - -Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_9.cmd - .IF "$(VERBOSE)" == "TRUE" - @$(TYPE) $(MISC)/$(TARGET).$(@:b)_9.cmd - .ENDIF - @+source $(MISC)/$(TARGET).$(@:b)_9.cmd + $(SHL9STDSHL) $(STDSHL9) \ + $(SHL9LINKRESO) \ + )) +.ENDIF .ELSE .IF "$(linkinc)"=="" .IF "$(SHL9USE_EXPORTS)"!="name" @@ -4220,7 +4463,7 @@ $(SHL9TARGETN) : \ @echo $(STDSLO) $(SHL9OBJS:s/.obj/.o/) \ $(SHL9VERSIONOBJ) \ `cat /dev/null $(SHL9LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list - @/bin/echo -n $(SHL9LINKER) $(SHL9LINKFLAGS) $(SHL9VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \ + @echo -n $(SHL9LINKER) $(SHL9LINKFLAGS) $(SHL9VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \ $(SHL9STDLIBS) $(SHL9ARCHIVES) $(SHL9STDSHL) $(STDSHL9) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_9.cmd @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \ `cat $(MISC)/$(TARGET).$(@:b)_9.cmd` \ @@ -4339,8 +4582,11 @@ SHL10IMPLIB=i$(TARGET)_t10 .ENDIF # "$(SHL10IMPLIB)" == "" .IF "$(COM)" != "GCC" USE_10IMPLIB=-implib:$(LB)/$(SHL10IMPLIB).lib -.ENDIF # "$(COM)" != "GCC" SHL10IMPLIBN=$(LB)/$(SHL10IMPLIB).lib +.ELSE +SHL10IMPLIBN=$(LB)/lib$(SHL10IMPLIB).dll.a +USE_10IMPLIB=-Wl,--out-implib=$(SHL10IMPLIBN) +.ENDIF # "$(COM)" != "GCC" ALLTAR : $(SHL10IMPLIBN) .IF "$(USE_DEFFILE)"=="" @@ -4557,30 +4803,54 @@ $(SHL10TARGETN) : \ .ENDIF # "$(COM)"=="GCC" .ENDIF # "$(SHL10ALLRES)"!="" .IF "$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def - @echo $(DLLTOOL) --dllname $(SHL10TARGET)$(DLLPOST) \ - --kill-at \\ > $(MISC)/$(TARGET).$(@:b)_10.cmd +# GNU ld since 2.17 supports @cmdfile syntax +.IF "$(USE_DEFFILE)"!="" + @$(COMMAND_ECHO)tmpfile=$(mktmp $(strip \ + $(SHL10LINKFLAGS) \ + $(LINKFLAGSSHL) \ + $(SOLARLIB) \ + $(MINGWSSTDOBJ) \ + -o $@ \ + -Wl,-Map,$(MISC)/$(@:b).map \ + $(SHL10DEF) \ + $(USE_10IMPLIB) \ + $(STDOBJ) \ + $(SHL10VERSIONOBJ) $(SHL10OBJS) \ + $(subst,$(ROUT),$(PRJ)/$(ROUT) $(shell cat /dev/null $(SHL10LIBS))) \ + -Wl,--exclude-libs,ALL,--start-group $(SHL10STDLIBS) -Wl,--end-group \ + $(SHL10STDSHL) $(STDSHL10) \ + $(SHL10LINKRESO) \ + )) && echo -n "$(LINK) " && cat $$tmpfile && $(LINK) @$$tmpfile && $(RM) $$tmpfile +.ELSE @noop $(assign ALL10OBJLIST:=$(STDOBJ) $(SHL10OBJS) $(SHL10LINKRESO) $(shell $(TYPE) /dev/null $(SHL10LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g)) .IF "$(DEFLIB10NAME)"!="" # do not have to include objs @noop $(assign DEF10OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB10NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g)) @noop $(foreach,i,$(DEF10OBJLIST) $(assign ALL10OBJLIST:=$(ALL10OBJLIST:s?$i??))) .ENDIF # "$(DEFLIB10NAME)"!="" - @echo --output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_10.cmd -.IF "$(SHL10DEF)"!="" - @echo --input-def $(SHL10DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_10.cmd -.ELSE - @echo $(SHL10VERSIONOBJ) $(SHL10DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_10.cmd -.ENDIF - @echo $(ALL10OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_10.cmd - @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \ - $(STDOBJ) $(SHL10VERSIONOBJ) $(SHL10DESCRIPTIONOBJ) $(SHL10OBJS) $(SHL10LINKRESO) \ - `$(TYPE) /dev/null $(SHL10LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \ + $(COMMAND_ECHO)$(DLLTOOL) @@(mktmp \ + --dllname $(SHL10TARGET)$(DLLPOST) \ + --kill-at \ + --output-exp $(MISC)/$(@:b)_exp.o \ + $(SHL10VERSIONOBJ) \ + @(ALL10OBJLIST) + ) + $(COMMAND_ECHO)$(LINK) @$(mktmp $(strip \ + $(SHL10LINKFLAGS) \ + $(LINKFLAGSSHL) \ + $(SOLARLIB) \ + $(MINGWSSTDOBJ) \ + -o $@ \ + -Wl,-Map,$(MISC)/$(@:b).map \ + $(MISC)/$(@:b)_exp.o \ + $(USE_10IMPLIB) \ + $(STDOBJ) \ + $(SHL10VERSIONOBJ) $(SHL10OBJS) \ + $(subst,$(ROUT),$(PRJ)/$(ROUT) $(shell cat /dev/null $(SHL10LIBS))) \ -Wl,--exclude-libs,ALL,--start-group $(SHL10STDLIBS) -Wl,--end-group \ - $(SHL10STDSHL) $(STDSHL10) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \ - -Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_10.cmd - .IF "$(VERBOSE)" == "TRUE" - @$(TYPE) $(MISC)/$(TARGET).$(@:b)_10.cmd - .ENDIF - @+source $(MISC)/$(TARGET).$(@:b)_10.cmd + $(SHL10STDSHL) $(STDSHL10) \ + $(SHL10LINKRESO) \ + )) +.ENDIF .ELSE .IF "$(linkinc)"=="" .IF "$(SHL10USE_EXPORTS)"!="name" @@ -4695,7 +4965,7 @@ $(SHL10TARGETN) : \ @echo $(STDSLO) $(SHL10OBJS:s/.obj/.o/) \ $(SHL10VERSIONOBJ) \ `cat /dev/null $(SHL10LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list - @/bin/echo -n $(SHL10LINKER) $(SHL10LINKFLAGS) $(SHL10VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \ + @echo -n $(SHL10LINKER) $(SHL10LINKFLAGS) $(SHL10VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \ $(SHL10STDLIBS) $(SHL10ARCHIVES) $(SHL10STDSHL) $(STDSHL10) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_10.cmd @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \ `cat $(MISC)/$(TARGET).$(@:b)_10.cmd` \ @@ -4761,6 +5031,7 @@ USELIB1DEPN+=$(SHL1LIBS) USE_SHL1TARGET=$(SHL1TARGETN) .ENDIF +.IF "$(GUI)$(COM)" != "WNTGCC" .IF "$(GUI)" != "UNX" $(SHL1IMPLIBN): \ $(SHL1DEF) \ @@ -4773,9 +5044,6 @@ $(SHL1IMPLIBN): \ .ENDIF @echo "Making: " $(@:f) .IF "$(GUI)" == "WNT" -.IF "$(COM)"=="GCC" - $(DLLTOOL) --output-lib=$(SHL1IMPLIBN) --input-def=$(SHL1DEF) -.ELSE # "$(COM)=="GCC" # bei use_deffile implib von linker erstellt .IF "$(USE_DEFFILE)"=="" $(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL1IMPLIBN) \ @@ -4784,7 +5052,6 @@ $(SHL1IMPLIBN): \ @echo build of $(SHL1TARGETN) creates $@ @$(TOUCH) $@ .ENDIF # "$(USE_DEFFILE)=="" -.ENDIF # "$(COM)"=="GCC" .ELSE @echo no ImportLibs on Mac and *ix @@ -4792,6 +5059,7 @@ $(SHL1IMPLIBN): \ @$(TOUCH) $@ .ENDIF .ENDIF +.ENDIF # unroll begin @@ -4806,6 +5074,7 @@ USELIB2DEPN+=$(SHL2LIBS) USE_SHL2TARGET=$(SHL2TARGETN) .ENDIF +.IF "$(GUI)$(COM)" != "WNTGCC" .IF "$(GUI)" != "UNX" $(SHL2IMPLIBN): \ $(SHL2DEF) \ @@ -4818,9 +5087,6 @@ $(SHL2IMPLIBN): \ .ENDIF @echo "Making: " $(@:f) .IF "$(GUI)" == "WNT" -.IF "$(COM)"=="GCC" - $(DLLTOOL) --output-lib=$(SHL2IMPLIBN) --input-def=$(SHL2DEF) -.ELSE # "$(COM)=="GCC" # bei use_deffile implib von linker erstellt .IF "$(USE_DEFFILE)"=="" $(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL2IMPLIBN) \ @@ -4829,7 +5095,6 @@ $(SHL2IMPLIBN): \ @echo build of $(SHL2TARGETN) creates $@ @$(TOUCH) $@ .ENDIF # "$(USE_DEFFILE)=="" -.ENDIF # "$(COM)"=="GCC" .ELSE @echo no ImportLibs on Mac and *ix @@ -4837,6 +5102,7 @@ $(SHL2IMPLIBN): \ @$(TOUCH) $@ .ENDIF .ENDIF +.ENDIF # unroll begin @@ -4851,6 +5117,7 @@ USELIB3DEPN+=$(SHL3LIBS) USE_SHL3TARGET=$(SHL3TARGETN) .ENDIF +.IF "$(GUI)$(COM)" != "WNTGCC" .IF "$(GUI)" != "UNX" $(SHL3IMPLIBN): \ $(SHL3DEF) \ @@ -4863,9 +5130,6 @@ $(SHL3IMPLIBN): \ .ENDIF @echo "Making: " $(@:f) .IF "$(GUI)" == "WNT" -.IF "$(COM)"=="GCC" - $(DLLTOOL) --output-lib=$(SHL3IMPLIBN) --input-def=$(SHL3DEF) -.ELSE # "$(COM)=="GCC" # bei use_deffile implib von linker erstellt .IF "$(USE_DEFFILE)"=="" $(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL3IMPLIBN) \ @@ -4874,7 +5138,6 @@ $(SHL3IMPLIBN): \ @echo build of $(SHL3TARGETN) creates $@ @$(TOUCH) $@ .ENDIF # "$(USE_DEFFILE)=="" -.ENDIF # "$(COM)"=="GCC" .ELSE @echo no ImportLibs on Mac and *ix @@ -4882,6 +5145,7 @@ $(SHL3IMPLIBN): \ @$(TOUCH) $@ .ENDIF .ENDIF +.ENDIF # unroll begin @@ -4896,6 +5160,7 @@ USELIB4DEPN+=$(SHL4LIBS) USE_SHL4TARGET=$(SHL4TARGETN) .ENDIF +.IF "$(GUI)$(COM)" != "WNTGCC" .IF "$(GUI)" != "UNX" $(SHL4IMPLIBN): \ $(SHL4DEF) \ @@ -4908,9 +5173,6 @@ $(SHL4IMPLIBN): \ .ENDIF @echo "Making: " $(@:f) .IF "$(GUI)" == "WNT" -.IF "$(COM)"=="GCC" - $(DLLTOOL) --output-lib=$(SHL4IMPLIBN) --input-def=$(SHL4DEF) -.ELSE # "$(COM)=="GCC" # bei use_deffile implib von linker erstellt .IF "$(USE_DEFFILE)"=="" $(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL4IMPLIBN) \ @@ -4919,7 +5181,6 @@ $(SHL4IMPLIBN): \ @echo build of $(SHL4TARGETN) creates $@ @$(TOUCH) $@ .ENDIF # "$(USE_DEFFILE)=="" -.ENDIF # "$(COM)"=="GCC" .ELSE @echo no ImportLibs on Mac and *ix @@ -4927,6 +5188,7 @@ $(SHL4IMPLIBN): \ @$(TOUCH) $@ .ENDIF .ENDIF +.ENDIF # unroll begin @@ -4941,6 +5203,7 @@ USELIB5DEPN+=$(SHL5LIBS) USE_SHL5TARGET=$(SHL5TARGETN) .ENDIF +.IF "$(GUI)$(COM)" != "WNTGCC" .IF "$(GUI)" != "UNX" $(SHL5IMPLIBN): \ $(SHL5DEF) \ @@ -4953,9 +5216,6 @@ $(SHL5IMPLIBN): \ .ENDIF @echo "Making: " $(@:f) .IF "$(GUI)" == "WNT" -.IF "$(COM)"=="GCC" - $(DLLTOOL) --output-lib=$(SHL5IMPLIBN) --input-def=$(SHL5DEF) -.ELSE # "$(COM)=="GCC" # bei use_deffile implib von linker erstellt .IF "$(USE_DEFFILE)"=="" $(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL5IMPLIBN) \ @@ -4964,7 +5224,6 @@ $(SHL5IMPLIBN): \ @echo build of $(SHL5TARGETN) creates $@ @$(TOUCH) $@ .ENDIF # "$(USE_DEFFILE)=="" -.ENDIF # "$(COM)"=="GCC" .ELSE @echo no ImportLibs on Mac and *ix @@ -4972,6 +5231,7 @@ $(SHL5IMPLIBN): \ @$(TOUCH) $@ .ENDIF .ENDIF +.ENDIF # unroll begin @@ -4986,6 +5246,7 @@ USELIB6DEPN+=$(SHL6LIBS) USE_SHL6TARGET=$(SHL6TARGETN) .ENDIF +.IF "$(GUI)$(COM)" != "WNTGCC" .IF "$(GUI)" != "UNX" $(SHL6IMPLIBN): \ $(SHL6DEF) \ @@ -4998,9 +5259,6 @@ $(SHL6IMPLIBN): \ .ENDIF @echo "Making: " $(@:f) .IF "$(GUI)" == "WNT" -.IF "$(COM)"=="GCC" - $(DLLTOOL) --output-lib=$(SHL6IMPLIBN) --input-def=$(SHL6DEF) -.ELSE # "$(COM)=="GCC" # bei use_deffile implib von linker erstellt .IF "$(USE_DEFFILE)"=="" $(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL6IMPLIBN) \ @@ -5009,7 +5267,6 @@ $(SHL6IMPLIBN): \ @echo build of $(SHL6TARGETN) creates $@ @$(TOUCH) $@ .ENDIF # "$(USE_DEFFILE)=="" -.ENDIF # "$(COM)"=="GCC" .ELSE @echo no ImportLibs on Mac and *ix @@ -5017,6 +5274,7 @@ $(SHL6IMPLIBN): \ @$(TOUCH) $@ .ENDIF .ENDIF +.ENDIF # unroll begin @@ -5031,6 +5289,7 @@ USELIB7DEPN+=$(SHL7LIBS) USE_SHL7TARGET=$(SHL7TARGETN) .ENDIF +.IF "$(GUI)$(COM)" != "WNTGCC" .IF "$(GUI)" != "UNX" $(SHL7IMPLIBN): \ $(SHL7DEF) \ @@ -5043,9 +5302,6 @@ $(SHL7IMPLIBN): \ .ENDIF @echo "Making: " $(@:f) .IF "$(GUI)" == "WNT" -.IF "$(COM)"=="GCC" - $(DLLTOOL) --output-lib=$(SHL7IMPLIBN) --input-def=$(SHL7DEF) -.ELSE # "$(COM)=="GCC" # bei use_deffile implib von linker erstellt .IF "$(USE_DEFFILE)"=="" $(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL7IMPLIBN) \ @@ -5054,7 +5310,6 @@ $(SHL7IMPLIBN): \ @echo build of $(SHL7TARGETN) creates $@ @$(TOUCH) $@ .ENDIF # "$(USE_DEFFILE)=="" -.ENDIF # "$(COM)"=="GCC" .ELSE @echo no ImportLibs on Mac and *ix @@ -5062,6 +5317,7 @@ $(SHL7IMPLIBN): \ @$(TOUCH) $@ .ENDIF .ENDIF +.ENDIF # unroll begin @@ -5076,6 +5332,7 @@ USELIB8DEPN+=$(SHL8LIBS) USE_SHL8TARGET=$(SHL8TARGETN) .ENDIF +.IF "$(GUI)$(COM)" != "WNTGCC" .IF "$(GUI)" != "UNX" $(SHL8IMPLIBN): \ $(SHL8DEF) \ @@ -5088,9 +5345,6 @@ $(SHL8IMPLIBN): \ .ENDIF @echo "Making: " $(@:f) .IF "$(GUI)" == "WNT" -.IF "$(COM)"=="GCC" - $(DLLTOOL) --output-lib=$(SHL8IMPLIBN) --input-def=$(SHL8DEF) -.ELSE # "$(COM)=="GCC" # bei use_deffile implib von linker erstellt .IF "$(USE_DEFFILE)"=="" $(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL8IMPLIBN) \ @@ -5099,7 +5353,6 @@ $(SHL8IMPLIBN): \ @echo build of $(SHL8TARGETN) creates $@ @$(TOUCH) $@ .ENDIF # "$(USE_DEFFILE)=="" -.ENDIF # "$(COM)"=="GCC" .ELSE @echo no ImportLibs on Mac and *ix @@ -5107,6 +5360,7 @@ $(SHL8IMPLIBN): \ @$(TOUCH) $@ .ENDIF .ENDIF +.ENDIF # unroll begin @@ -5121,6 +5375,7 @@ USELIB9DEPN+=$(SHL9LIBS) USE_SHL9TARGET=$(SHL9TARGETN) .ENDIF +.IF "$(GUI)$(COM)" != "WNTGCC" .IF "$(GUI)" != "UNX" $(SHL9IMPLIBN): \ $(SHL9DEF) \ @@ -5133,9 +5388,6 @@ $(SHL9IMPLIBN): \ .ENDIF @echo "Making: " $(@:f) .IF "$(GUI)" == "WNT" -.IF "$(COM)"=="GCC" - $(DLLTOOL) --output-lib=$(SHL9IMPLIBN) --input-def=$(SHL9DEF) -.ELSE # "$(COM)=="GCC" # bei use_deffile implib von linker erstellt .IF "$(USE_DEFFILE)"=="" $(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL9IMPLIBN) \ @@ -5144,7 +5396,6 @@ $(SHL9IMPLIBN): \ @echo build of $(SHL9TARGETN) creates $@ @$(TOUCH) $@ .ENDIF # "$(USE_DEFFILE)=="" -.ENDIF # "$(COM)"=="GCC" .ELSE @echo no ImportLibs on Mac and *ix @@ -5152,6 +5403,7 @@ $(SHL9IMPLIBN): \ @$(TOUCH) $@ .ENDIF .ENDIF +.ENDIF # unroll begin @@ -5166,6 +5418,7 @@ USELIB10DEPN+=$(SHL10LIBS) USE_SHL10TARGET=$(SHL10TARGETN) .ENDIF +.IF "$(GUI)$(COM)" != "WNTGCC" .IF "$(GUI)" != "UNX" $(SHL10IMPLIBN): \ $(SHL10DEF) \ @@ -5178,9 +5431,6 @@ $(SHL10IMPLIBN): \ .ENDIF @echo "Making: " $(@:f) .IF "$(GUI)" == "WNT" -.IF "$(COM)"=="GCC" - $(DLLTOOL) --output-lib=$(SHL10IMPLIBN) --input-def=$(SHL10DEF) -.ELSE # "$(COM)=="GCC" # bei use_deffile implib von linker erstellt .IF "$(USE_DEFFILE)"=="" $(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL10IMPLIBN) \ @@ -5189,7 +5439,6 @@ $(SHL10IMPLIBN): \ @echo build of $(SHL10TARGETN) creates $@ @$(TOUCH) $@ .ENDIF # "$(USE_DEFFILE)=="" -.ENDIF # "$(COM)"=="GCC" .ELSE @echo no ImportLibs on Mac and *ix @@ -5197,4 +5446,5 @@ $(SHL10IMPLIBN): \ @$(TOUCH) $@ .ENDIF .ENDIF +.ENDIF diff --git a/solenv/inc/tg_shl.mk b/solenv/inc/tg_shl.mk index e94a95241..12498270b 100644 --- a/solenv/inc/tg_shl.mk +++ b/solenv/inc/tg_shl.mk @@ -93,8 +93,11 @@ SHL$(TNR)IMPLIB=i$(TARGET)_t$(TNR) .ENDIF # "$(SHL$(TNR)IMPLIB)" == "" .IF "$(COM)" != "GCC" USE_$(TNR)IMPLIB=-implib:$(LB)/$(SHL$(TNR)IMPLIB).lib -.ENDIF # "$(COM)" != "GCC" SHL$(TNR)IMPLIBN=$(LB)/$(SHL$(TNR)IMPLIB).lib +.ELSE +SHL$(TNR)IMPLIBN=$(LB)/lib$(SHL$(TNR)IMPLIB).dll.a +USE_$(TNR)IMPLIB=-Wl,--out-implib=$(SHL$(TNR)IMPLIBN) +.ENDIF # "$(COM)" != "GCC" ALLTAR : $(SHL$(TNR)IMPLIBN) .IF "$(USE_DEFFILE)"=="" @@ -311,30 +314,54 @@ $(SHL$(TNR)TARGETN) : \ .ENDIF # "$(COM)"=="GCC" .ENDIF # "$(SHL$(TNR)ALLRES)"!="" .IF "$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def - @echo $(DLLTOOL) --dllname $(SHL$(TNR)TARGET)$(DLLPOST) \ - --kill-at \\ > $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd +# GNU ld since 2.17 supports @cmdfile syntax +.IF "$(USE_DEFFILE)"!="" + @$(COMMAND_ECHO)$(LINK) @$(mktmp $(strip \ + $(SHL$(TNR)LINKFLAGS) \ + $(LINKFLAGSSHL) \ + $(SOLARLIB) \ + $(MINGWSSTDOBJ) \ + -o $@ \ + -Wl,-Map,$(MISC)/$(@:b).map \ + $(SHL$(TNR)DEF) \ + $(USE_$(TNR)IMPLIB) \ + $(STDOBJ) \ + $(SHL$(TNR)VERSIONOBJ) $(SHL$(TNR)OBJS) \ + $(subst,$(ROUT),$(PRJ)/$(ROUT) $(shell cat /dev/null $(SHL$(TNR)LIBS))) \ + -Wl,--exclude-libs,ALL,--start-group $(SHL$(TNR)STDLIBS) -Wl,--end-group \ + $(SHL$(TNR)STDSHL) $(STDSHL$(TNR)) \ + $(SHL$(TNR)LINKRESO) \ + )) +.ELSE @noop $(assign ALL$(TNR)OBJLIST:=$(STDOBJ) $(SHL$(TNR)OBJS) $(SHL$(TNR)LINKRESO) $(shell $(TYPE) /dev/null $(SHL$(TNR)LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g)) .IF "$(DEFLIB$(TNR)NAME)"!="" # do not have to include objs @noop $(assign DEF$(TNR)OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB$(TNR)NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g)) @noop $(foreach,i,$(DEF$(TNR)OBJLIST) $(assign ALL$(TNR)OBJLIST:=$(ALL$(TNR)OBJLIST:s?$i??))) .ENDIF # "$(DEFLIB$(TNR)NAME)"!="" - @echo --output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd -.IF "$(SHL$(TNR)DEF)"!="" - @echo --input-def $(SHL$(TNR)DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd -.ELSE - @echo $(SHL$(TNR)VERSIONOBJ) $(SHL$(TNR)DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd -.ENDIF - @echo $(ALL$(TNR)OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd - @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \ - $(STDOBJ) $(SHL$(TNR)VERSIONOBJ) $(SHL$(TNR)DESCRIPTIONOBJ) $(SHL$(TNR)OBJS) $(SHL$(TNR)LINKRESO) \ - `$(TYPE) /dev/null $(SHL$(TNR)LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \ + $(COMMAND_ECHO)$(DLLTOOL) @@(mktmp \ + --dllname $(SHL$(TNR)TARGET)$(DLLPOST) \ + --kill-at \ + --output-exp $(MISC)/$(@:b)_exp.o \ + $(SHL$(TNR)VERSIONOBJ) \ + @(ALL$(TNR)OBJLIST) + ) + $(COMMAND_ECHO)$(LINK) @$(mktmp $(strip \ + $(SHL$(TNR)LINKFLAGS) \ + $(LINKFLAGSSHL) \ + $(SOLARLIB) \ + $(MINGWSSTDOBJ) \ + -o $@ \ + -Wl,-Map,$(MISC)/$(@:b).map \ + $(MISC)/$(@:b)_exp.o \ + $(USE_$(TNR)IMPLIB) \ + $(STDOBJ) \ + $(SHL$(TNR)VERSIONOBJ) $(SHL$(TNR)OBJS) \ + $(subst,$(ROUT),$(PRJ)/$(ROUT) $(shell cat /dev/null $(SHL$(TNR)LIBS))) \ -Wl,--exclude-libs,ALL,--start-group $(SHL$(TNR)STDLIBS) -Wl,--end-group \ - $(SHL$(TNR)STDSHL) $(STDSHL$(TNR)) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \ - -Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd - .IF "$(VERBOSE)" == "TRUE" - @$(TYPE) $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd - .ENDIF - @+source $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd + $(SHL$(TNR)STDSHL) $(STDSHL$(TNR)) \ + $(SHL$(TNR)LINKRESO) \ + )) +.ENDIF .ELSE .IF "$(linkinc)"=="" .IF "$(SHL$(TNR)USE_EXPORTS)"!="name" @@ -522,6 +549,7 @@ USELIB$(TNR)DEPN+=$(SHL$(TNR)LIBS) USE_SHL$(TNR)TARGET=$(SHL$(TNR)TARGETN) .ENDIF +.IF "$(GUI)$(COM)" != "WNTGCC" .IF "$(GUI)" != "UNX" $(SHL$(TNR)IMPLIBN): \ $(SHL$(TNR)DEF) \ @@ -534,9 +562,6 @@ $(SHL$(TNR)IMPLIBN): \ .ENDIF @echo "Making: " $(@:f) .IF "$(GUI)" == "WNT" -.IF "$(COM)"=="GCC" - $(DLLTOOL) --output-lib=$(SHL$(TNR)IMPLIBN) --input-def=$(SHL$(TNR)DEF) -.ELSE # "$(COM)=="GCC" # bei use_deffile implib von linker erstellt .IF "$(USE_DEFFILE)"=="" $(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL$(TNR)IMPLIBN) \ @@ -545,7 +570,6 @@ $(SHL$(TNR)IMPLIBN): \ @echo build of $(SHL$(TNR)TARGETN) creates $@ @$(TOUCH) $@ .ENDIF # "$(USE_DEFFILE)=="" -.ENDIF # "$(COM)"=="GCC" .ELSE @echo no ImportLibs on Mac and *ix @@ -553,6 +577,7 @@ $(SHL$(TNR)IMPLIBN): \ @$(TOUCH) $@ .ENDIF .ENDIF +.ENDIF # unroll end ####################################################### -- cgit v1.2.3