mkspecs/features/symbian/symbian_building.prf
changeset 33 3e2da88830cd
parent 30 5dc02b23752f
child 37 758a864f9613
--- a/mkspecs/features/symbian/symbian_building.prf	Tue Jul 06 15:10:48 2010 +0300
+++ b/mkspecs/features/symbian/symbian_building.prf	Wed Aug 18 10:37:55 2010 +0300
@@ -1,13 +1,32 @@
+linux-armcc {
+    QMAKE_CFLAGS += $$QMAKE_CFLAGS.ARMCC
+    QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS.ARMCC
+} else:linux-gcce {
+    QMAKE_CFLAGS += $$QMAKE_CFLAGS.GCCE
+    QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS.GCCE
+}
+
+# We need a target name without the INFIX'ed part, since flags are not infixed.
+equals(QMAKE_TARGET_PRODUCT, Qt4):clean_TARGET = $$replace(TARGET, "$${QT_LIBINFIX}$", "")
+else:clean_TARGET = $$TARGET
+
 # we have some module specific options (defined in qt.prf) lets add them
-!contains(TARGET, ".*[ -].*"):eval(TMPVAR = \$\$QMAKE_$${TARGET}_CXXFLAGS)
+!contains(clean_TARGET, ".*[ -/].*"):eval(TMPVAR = \$\$QMAKE_$${clean_TARGET}_CXXFLAGS)
 !isEmpty(TMPVAR):QMAKE_CXXFLAGS += $$TMPVAR
-!contains(TARGET, ".*[ -].*"):eval(TMPVAR = \$\$QMAKE_$${TARGET}_LFLAGS)
+!contains(clean_TARGET, ".*[ -/].*"):eval(TMPVAR = \$\$QMAKE_$${clean_TARGET}_LFLAGS)
 !isEmpty(TMPVAR) {
     QMAKE_LFLAGS += $$TMPVAR
 } else :linux-gcce {  # lets provide a simple default. Without elf2e32 complains
     QMAKE_LFLAGS += -Ttext 0x80000 -Tdata 0x400000
 }
 
+qtPrepareTool(QMAKE_ELF2E32_WRAPPER, elf2e32_qtwrapper)
+
+isEmpty(TARGET.EPOCSTACKSIZE):TARGET.EPOCSTACKSIZE = 0x14000
+isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x020000 0x800000
+epoc_heap_size = $$split(TARGET.EPOCHEAPSIZE, " ")
+epoc_heap_size = $$join(epoc_heap_size, ",")
+
 symbianObjdir=$$OBJECTS_DIR
 isEmpty(symbianObjdir) {
     symbianObjdir = .
@@ -16,22 +35,24 @@
 isEmpty(symbianDestdir) {
     symbianDestdir = .
 }
+baseTarget = $$basename(TARGET)
+!equals(TARGET, "$$baseTarget"):symbianDestdir = $$symbianDestdir/$$dirname(TARGET)
 
 contains(QMAKE_CFLAGS, "--thumb")|contains(QMAKE_CXXFLAGS, "--thumb")|contains(QMAKE_CFLAGS, "-mthumb")|contains(QMAKE_CXXFLAGS, "-mthumb") {
     DEFINES += __MARM_THUMB__
 }
 
 defineReplace(processSymbianLibraries) {
-    library = $$replace(1, "\.dll$", ".dso")
+    library = $$replace(1, "\\.dll$", ".dso")
     library = $$replace(library, "^-l", "")
-    isFullName = $$find(library, \.)
+    isFullName = $$find(library, \\.)
     isEmpty(isFullName):library="$${library}.dso"
     linux-gcce {
         newLIB = "-l:$${library}"
     } else {
         newLIB = "$${library}"
     }
-    contains(library, "\.dso$")|contains(library, ".lib$"):PRE_TARGETDEPS += $$library
+    contains(library, "\\.dso$")|contains(library, "\\.lib$"):PRE_TARGETDEPS += $$library
     return($$newLIB)
 }
 
@@ -55,7 +76,7 @@
 }
 
 # Check for version validity.
-!isEmpty(VERSION):!contains(VERSION, "[0-9]+"):!contains(VERSION, "[0-9]+\.[0-9]+")!contains(VERSION, "[0-9]+(\.[0-9]+){2}") {
+!isEmpty(VERSION):!contains(VERSION, "[0-9]+"):!contains(VERSION, "[0-9]+\\.[0-9]+")!contains(VERSION, "[0-9]+(\\.[0-9]+){2}") {
     error("Invalid VERSION for Symbian: $$VERSION")
 }
 
@@ -86,7 +107,7 @@
 
 capability = $$replace(TARGET.CAPABILITY, " ", "+")
 capability = $$join(capability, "+")
-capability = $$replace(capability, "\+-", "-")
+capability = $$replace(capability, "\\+-", "-")
 isEmpty(capability): capability = "None"
 capability = "--capability=$$capability"
 
@@ -96,34 +117,33 @@
         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 \
+
+    contains(CONFIG, plugin):QMAKE_ELF2E32_FLAGS += --definput=plugin_commonu.def
+
+    QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${baseTarget}.dll $$symbianDestdir/$${baseTarget}.sym \
+                      && $$QMAKE_ELF2E32_WRAPPER --version=$$decVersion \
                       --sid=$$TARGET.SID \
                       --uid1=0x10000079 \
                       --uid2=$$TARGET.UID2 \
                       --uid3=$$TARGET.UID3 \
                       --targettype=DLL \
-                      --elfinput=$${symbianDestdir}/$${TARGET}.sym \
-                      --output=$${symbianDestdir}/$${TARGET}.dll \
-                      --dso=$$symbianObjdir/$${TARGET}.dso \
-                      --defoutput=$$symbianObjdir/$${TARGET}.def \
-                      --linkas=$${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll \
+                      --elfinput=$${symbianDestdir}/$${baseTarget}.sym \
+                      --output=$${symbianDestdir}/$${baseTarget}.dll \
+                      --tmpdso=$${symbianObjdir}/$${baseTarget}.dso \
+                      --dso=$${symbianDestdir}/$${baseTarget}.dso \
+                      --defoutput=$$symbianObjdir/$${baseTarget}.def \
+                      --linkas=$${baseTarget}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll \
+                      --heap=$$epoc_heap_size \
+                      --stack=$$TARGET.EPOCSTACKSIZE \
                       $$elf2e32_LIBPATH \
                       $$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
+    silent:QMAKE_POST_LINK = @echo postlinking $@ && $$QMAKE_POST_LINK
+    QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.sym
+    QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.dso
+    QMAKE_CLEAN += $${symbianObjdir}/$${baseTarget}.dso
+    QMAKE_CLEAN += $${symbianObjdir}/$${baseTarget}.def
 
     linux-armcc: {
         LIBS += usrt2_2.lib dfpaeabi.dso dfprvct2_2.dso drtaeabi.dso scppnwdl.dso drtrvct2_2.dso h_t__uf.l\\(switch8.o\\)
@@ -139,36 +159,37 @@
             -lgcc
     }
 
-    QMAKE_LFLAGS += --soname $${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll
+    QMAKE_LFLAGS += --soname $${baseTarget}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll
     DEFINES += __DLL__
 }
 
-contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@.*") {
+contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@:.*") {
     !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 = $$QMAKE_MOVE $$symbianDestdir/$${TARGET} $$symbianDestdir/$${TARGET}.sym \
-                      && elf2e32  --version $$decVersion \
+    QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${baseTarget} $$symbianDestdir/$${baseTarget}.sym \
+                      && $$QMAKE_ELF2E32_WRAPPER --version $$decVersion \
                       --sid=$$TARGET.SID \
                       --uid1=0x1000007a \
                       --uid2=$$TARGET.UID2 \
                       --uid3=$$TARGET.UID3 \
                       --targettype=EXE \
-                      --elfinput=$${symbianDestdir}/$${TARGET}.sym \
-                      --output=$${symbianDestdir}/$${TARGET}.exe \
-                      --linkas=$${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe \
+                      --elfinput=$${symbianDestdir}/$${baseTarget}.sym \
+                      --output=$${symbianDestdir}/$${baseTarget}.exe \
+                      --linkas=$${baseTarget}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe \
+                      --heap=$$epoc_heap_size \
+                      --stack=$$TARGET.EPOCSTACKSIZE \
                       $$elf2e32_LIBPATH \
                       $$capability \
                       $$QMAKE_ELF2E32_FLAGS \
-                      | tee elf2e32.log && test `grep -c 'Error:' elf2e32.log` = 0 && rm elf2e32.log \
-                      && ln "$${symbianDestdir}/$${TARGET}.exe" "$${symbianDestdir}/$$TARGET" \
+                      && ln "$${symbianDestdir}/$${baseTarget}.exe" "$${symbianDestdir}/$${baseTarget}" \
                       $$QMAKE_POST_LINK
-    QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.sym
-    QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.exe
-    QMAKE_CLEAN += $${symbianDestdir}/$${TARGET}
+    silent:QMAKE_POST_LINK = @echo postlinking $@ && $$QMAKE_POST_LINK
+    QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.sym
+    QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.exe
+    QMAKE_CLEAN += $${symbianDestdir}/$${baseTarget}
 
     linux-armcc: {
         QMAKE_LIBS += usrt2_2.lib dfpaeabi.dso dfprvct2_2.dso drtaeabi.dso scppnwdl.dso drtrvct2_2.dso h_t__uf.l\\(switch8.o\\)
@@ -197,7 +218,7 @@
         QMAKE_LFLAGS += --shared
     }
 
-    QMAKE_LFLAGS += --soname $${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe
+    QMAKE_LFLAGS += --soname $${baseTarget}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe
     DEFINES += __EXE__
 }
 
@@ -214,9 +235,9 @@
 
 for(symbian_resource, SYMBIAN_RESOURCES) {
     symbian_resource = $$basename(symbian_resource)
-    symbian_resource_clean = $$replace(symbian_resource, "\.rss$", ".rsc")
+    symbian_resource_clean = $$replace(symbian_resource, "\\.rss$", ".rsc")
     QMAKE_DISTCLEAN += $${symbianDestdir}/$${symbian_resource_clean}
-    symbian_resource_clean = $$replace(symbian_resource, "\.rss$", ".rpp")
+    symbian_resource_clean = $$replace(symbian_resource, "\\.rss$", ".rpp")
     QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${symbian_resource_clean}
 }
 
@@ -232,53 +253,56 @@
                             -o$${symbianDestdir}/${QMAKE_FILE_BASE}$${QT_LIBINFIX}.rsc \
                             -h$${symbian_resources_RCC_DIR}/${QMAKE_FILE_BASE}$${QT_LIBINFIX}.rsg \
                             -i${QMAKE_FILE_NAME}
+silent:symbianresources.commands = @echo rcomp $< && $$symbianresources.commands
 symbianresources.dependency_type = TYPE_C
 symbianresources.CONFIG = no_link target_predeps
 
 QMAKE_EXTRA_COMPILERS += symbianresources
 
 contains(TEMPLATE, "app"):!contains(CONFIG, "no_icon") {
-    baseTarget = $$basename(TARGET)
+    baseResourceTarget = $$basename(TARGET)
     # If you change this, also see application_icon.prf
-    baseTarget = $$replace(baseTarget, " ",_)
+    baseResourceTarget = $$replace(baseResourceTarget, " ",_)
 
     # Make our own extra target in order to get dependencies for generated
     # files right. This also avoids the warning about files not found.
-    symbianGenResource.target = $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
+    symbianGenResource.target = $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg
     symbianGenResource.commands = cpp -nostdinc -undef \
                                   $$symbian_resources_INCLUDES \
                                   $$symbian_resources_DEFINES \
-                                  $${baseTarget}.rss \
-                                  -o $${symbian_resources_RCC_DIR}/$${baseTarget}.rpp \
+                                  $${baseResourceTarget}.rss \
+                                  -o $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rpp \
                                   && rcomp -u -m045,046,047 \
-                                  -s$${symbian_resources_RCC_DIR}/$${baseTarget}.rpp \
-                                  -o$${symbianDestdir}/$${baseTarget}.rsc \
-                                  -h$${symbian_resources_RCC_DIR}/$${baseTarget}.rsg \
-                                  -i$${baseTarget}.rss
-    symbianGenResource.depends = $${baseTarget}.rss
-    PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
-    QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
-    QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}.rpp
-    QMAKE_DISTCLEAN += $${baseTarget}.rss
-    QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.rsc
+                                  -s$${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rpp \
+                                  -o$${symbianDestdir}/$${baseResourceTarget}.rsc \
+                                  -h$${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg \
+                                  -i$${baseResourceTarget}.rss
+    silent:symbianGenResource.commands = @echo rcomp $${baseResourceTarget}.rss && $$symbianGenResource.commands
+    symbianGenResource.depends = $${baseResourceTarget}.rss
+    PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg
+    QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg
+    QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rpp
+    QMAKE_DISTCLEAN += $${baseResourceTarget}.rss
+    QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseResourceTarget}.rsc
 
-    symbianGenRegResource.target = $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg
+    symbianGenRegResource.target = $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg
     symbianGenRegResource.commands = cpp -nostdinc -undef \
                                      $$symbian_resources_INCLUDES \
                                      $$symbian_resources_DEFINES \
-                                     $${baseTarget}_reg.rss \
-                                     -o $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp \
+                                     $${baseResourceTarget}_reg.rss \
+                                     -o $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rpp \
                                      && rcomp -u -m045,046,047 \
-                                     -s$${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp \
-                                     -o$${symbianDestdir}/$${baseTarget}_reg.rsc \
-                                     -h$${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg \
-                                     -i$${baseTarget}_reg.rss
-    symbianGenRegResource.depends = $${baseTarget}_reg.rss $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
-    PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg
-    QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg
-    QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp
-    QMAKE_DISTCLEAN += $${TARGET}_reg.rss
-    QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}_reg.rsc
+                                     -s$${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rpp \
+                                     -o$${symbianDestdir}/$${baseResourceTarget}_reg.rsc \
+                                     -h$${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg \
+                                     -i$${baseResourceTarget}_reg.rss
+    silent:symbianGenRegResource.commands = @echo rcomp $${baseResourceTarget}_reg.rss && $$symbianGenRegResource.commands
+    symbianGenRegResource.depends = $${baseResourceTarget}_reg.rss $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg
+    PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg
+    QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg
+    QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rpp
+    QMAKE_DISTCLEAN += $${baseResourceTarget}_reg.rss
+    QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseResourceTarget}_reg.rsc
 
     # Trick to get qmake to create the RCC_DIR for us.
     symbianRccDirCreation.input = SOURCES
@@ -289,9 +313,9 @@
     QMAKE_EXTRA_TARGETS += symbianGenResource symbianGenRegResource
     QMAKE_EXTRA_COMPILERS += symbianRccDirCreation
 
-    QMAKE_DISTCLEAN += $${TARGET}.loc
+    QMAKE_DISTCLEAN += $${baseTarget}.loc
 }
 
 # Generated pkg files
 
-QMAKE_DISTCLEAN += $${TARGET}_template.pkg
+QMAKE_DISTCLEAN += $${baseTarget}_template.pkg