diff options
Diffstat (limited to 'mkspecs/symbian/features/symbian_building.prf')
-rw-r--r-- | mkspecs/symbian/features/symbian_building.prf | 74 |
1 files changed, 52 insertions, 22 deletions
diff --git a/mkspecs/symbian/features/symbian_building.prf b/mkspecs/symbian/features/symbian_building.prf index 5c1a16d..a7663af 100644 --- a/mkspecs/symbian/features/symbian_building.prf +++ b/mkspecs/symbian/features/symbian_building.prf @@ -21,31 +21,30 @@ contains(QMAKE_CFLAGS, "--thumb")|contains(QMAKE_CXXFLAGS, "--thumb")|contains(Q DEFINES += __MARM_THUMB__ } -for(library, LIBS) { - library = $$replace(library, "\.dll$", ".dso") +defineReplace(processSymbianLibraries) { + library = $$replace(1, "\.dll$", ".dso") library = $$replace(library, "^-l", "") isFullName = $$find(library, \.) isEmpty(isFullName):library="$${library}.dso" linux-gcce { - newLIBS += "-l:$${library}" + newLIB = "-l:$${library}" } else { - newLIBS += "$${library}" + newLIB = "$${library}" } + return($$newLIB) +} + +for(libraries, LIBS) { + newLIBS += $$processSymbianLibraries($$libraries) } LIBS = $$newLIBS +PRE_TARGETDEPS += $$replace(newLIBS, "-l", "") newLIBS = -for(library, QMAKE_LIBS) { - library = $$replace(library, "\.dll$", ".dso") - library = $$replace(library, "^-l", "") - isFullName = $$find(library, \.) - isEmpty(isFullName):library="$${library}.dso" - linux-gcce { - newLIBS += "-l:$${library}" - } else { - newLIBS += "$${library}" - } +for(libraries, QMAKE_LIBS) { + newLIBS += $$processSymbianLibraries($$libraries) } QMAKE_LIBS = $$newLIBS +PRE_TARGETDEPS += $$replace(newLIBS, "-l", "") linux-gcce { QMAKE_LIBS += -l:usrt2_2.lib \ @@ -102,12 +101,32 @@ isEmpty(capability): capability = "None" capability = "--capability=$$capability" contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) { - !isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK += && - QMAKE_POST_LINK += $$QMAKE_MOVE $$symbianDestdir/$${TARGET}.dll $$symbianDestdir/$${TARGET}.sym - # the tee and grep at the end work around the issue that elf2e32 doesn't return non-null on error - QMAKE_POST_LINK += && elf2e32 --version=$$decVersion --sid=$$TARGET.SID --uid1=0x10000079 --uid2=$$TARGET.UID2 --uid3=$$TARGET.UID3 --dlldata --heap=0x00020000,0x00800000 --stack=0x00014000 --fpu=softvfp --targettype=DLL --elfinput=$${symbianDestdir}/$${TARGET}.sym --output=$${symbianDestdir}/$${TARGET}.dll --dso=$$symbianDestdir/$${TARGET}.dso --defoutput=$$symbianObjdir/$${TARGET}.def --unfrozen --linkas=$${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll --compressionmethod bytepair $$elf2e32_LIBPATH --unpaged $$capability | tee elf2e32.log && test `grep -c 'Error:' elf2e32.log` = 0 && rm elf2e32.log + !isEmpty(QMAKE_POST_LINK) { + # No way to honor the '@' :-( + QMAKE_POST_LINK = $$replace(QMAKE_POST_LINK, "^@", "") + QMAKE_POST_LINK = && $$QMAKE_POST_LINK + } + # The tee and grep at the end work around the issue that elf2e32 doesn't return non-null on error. + # The comparison of dso files is to avoid extra building of modules that depend on this dso, in + # case it has not changed. + QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${TARGET}.dll $$symbianDestdir/$${TARGET}.sym \ + && elf2e32 --version=$$decVersion --sid=$$TARGET.SID --uid1=0x10000079 \ + --uid2=$$TARGET.UID2 --uid3=$$TARGET.UID3 --dlldata --heap=0x00020000,0x00800000 \ + --stack=0x00014000 --fpu=softvfp --targettype=DLL \ + --elfinput=$${symbianDestdir}/$${TARGET}.sym --output=$${symbianDestdir}/$${TARGET}.dll \ + --dso=$$symbianObjdir/$${TARGET}.dso --defoutput=$$symbianObjdir/$${TARGET}.def \ + --unfrozen --linkas=$${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll \ + --compressionmethod bytepair $$elf2e32_LIBPATH --unpaged $$capability \ + $$QMAKE_ELF2E32_FLAGS \ + | tee elf2e32.log && test `grep -c 'Error:' elf2e32.log` = 0 && rm elf2e32.log \ + && if ! diff -q $${symbianObjdir}/$${TARGET}.dso $${symbianDestdir}/$${TARGET}.dso \ + > /dev/null 2>&1; then \ + $$QMAKE_COPY $${symbianObjdir}/$${TARGET}.dso $${symbianDestdir}/$${TARGET}.dso; \ + fi \ + $$QMAKE_POST_LINK QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.sym QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.dso + QMAKE_CLEAN += $${symbianObjdir}/$${TARGET}.dso QMAKE_CLEAN += $${symbianObjdir}/$${TARGET}.def linux-armcc: { @@ -121,11 +140,22 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) { } contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@.*") { - !isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK += && - - QMAKE_POST_LINK += $$QMAKE_MOVE $$symbianDestdir/$${TARGET} $$symbianDestdir/$${TARGET}.sym + !isEmpty(QMAKE_POST_LINK) { + # No way to honor the '@' :-( + QMAKE_POST_LINK = $$replace(QMAKE_POST_LINK, "^@", "") + QMAKE_POST_LINK = && $$QMAKE_POST_LINK + } # the tee and grep at the end work around the issue that elf2e32 doesn't return non-null on error - QMAKE_POST_LINK += && elf2e32 --version $$decVersion --sid=$$TARGET.SID --uid1=0x1000007a --uid2=$$TARGET.UID2 --uid3=$$TARGET.UID3 --dlldata --heap=0x00020000,0x00800000 --stack=0x00014000 --fpu=softvfp --targettype=EXE --elfinput=$${symbianDestdir}/$${TARGET}.sym --output=$${symbianDestdir}/$${TARGET}.exe --unfrozen --linkas=$${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe --compressionmethod bytepair $$elf2e32_LIBPATH --unpaged $$capability | tee elf2e32.log && test `grep -c 'Error:' elf2e32.log` = 0 && rm elf2e32.log + QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${TARGET} $$symbianDestdir/$${TARGET}.sym \ + && elf2e32 --version $$decVersion --sid=$$TARGET.SID --uid1=0x1000007a \ + --uid2=$$TARGET.UID2 --uid3=$$TARGET.UID3 --dlldata --heap=0x00020000,0x00800000 \ + --stack=0x00014000 --fpu=softvfp --targettype=EXE \ + --elfinput=$${symbianDestdir}/$${TARGET}.sym --output=$${symbianDestdir}/$${TARGET}.exe \ + --unfrozen --linkas=$${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe \ + --compressionmethod bytepair $$elf2e32_LIBPATH --unpaged $$capability \ + $$QMAKE_ELF2E32_FLAGS \ + | tee elf2e32.log && test `grep -c 'Error:' elf2e32.log` = 0 && rm elf2e32.log \ + $$QMAKE_POST_LINK QMAKE_POST_LINK += && ln "$${TARGET}.exe" "$$TARGET" QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.sym QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.exe |