summaryrefslogtreecommitdiffstats
path: root/mkspecs/symbian
diff options
context:
space:
mode:
authorThomas Zander <t.zander@nokia.com>2010-03-02 16:02:51 (GMT)
committerThomas Zander <t.zander@nokia.com>2010-03-02 16:02:51 (GMT)
commitc8502375c5b31d1b5726cad3efe95539d41fbb4e (patch)
treeb893c97b787245700efbe7b9da1a79bd77544d53 /mkspecs/symbian
parentd0c6958922627154bd907569e1ce5b830cb353f6 (diff)
downloadQt-c8502375c5b31d1b5726cad3efe95539d41fbb4e.zip
Qt-c8502375c5b31d1b5726cad3efe95539d41fbb4e.tar.gz
Qt-c8502375c5b31d1b5726cad3efe95539d41fbb4e.tar.bz2
Make the symbian_building.prf be shared file
the fork I made for gcce is similar enough to now be shared between gcce and armcc so move stuff around a bit to avoid the code duplication.
Diffstat (limited to 'mkspecs/symbian')
-rw-r--r--mkspecs/symbian/features/symbian_building.prf (renamed from mkspecs/symbian/linux-gcce/features/symbian_building.prf)65
-rw-r--r--mkspecs/symbian/linux-armcc/features/symbian_building.prf202
-rw-r--r--mkspecs/symbian/linux-armcc/platformlibs.conf3
-rw-r--r--mkspecs/symbian/linux-armcc/qmake.conf15
-rw-r--r--mkspecs/symbian/linux-gcce/platformlibs.conf20
-rw-r--r--mkspecs/symbian/linux-gcce/qmake.conf31
6 files changed, 85 insertions, 251 deletions
diff --git a/mkspecs/symbian/linux-gcce/features/symbian_building.prf b/mkspecs/symbian/features/symbian_building.prf
index 58d0b5e..5c1a16d 100644
--- a/mkspecs/symbian/linux-gcce/features/symbian_building.prf
+++ b/mkspecs/symbian/features/symbian_building.prf
@@ -1,14 +1,10 @@
-gcceExtraFlags = -I${EPOCROOT}epoc32/include/ --include=${EPOCROOT}epoc32/include/gcce/gcce.h -march=armv5t -mapcs -mthumb-interwork -nostdinc -c -fvisibility-inlines-hidden -msoft-float -T script
-QMAKE_CFLAGS += $${gcceExtraFlags}
-QMAKE_CXXFLAGS += $${gcceExtraFlags} -x c++ -fexceptions -fno-unit-at-a-time
-
# we have some module specific options (defined in qt.prf) lets add them
eval(TMPVAR = \$\$QMAKE_$${TARGET}_CXXFLAGS)
!isEmpty(TMPVAR):QMAKE_CXXFLAGS += $$TMPVAR
eval(TMPVAR = \$\$QMAKE_$${TARGET}_LFLAGS)
!isEmpty(TMPVAR) {
QMAKE_LFLAGS += $$TMPVAR
-} else { # lets provide a simple default. Without elf2e32 complains
+} else :linux-gcce { # lets provide a simple default. Without elf2e32 complains
QMAKE_LFLAGS += -Ttext 0x80000 -Tdata 0x400000
}
@@ -21,7 +17,7 @@ isEmpty(symbianDestdir) {
symbianDestdir = .
}
-contains(QMAKE_CFLAGS, "-mthumb")|contains(QMAKE_CXXFLAGS, "-mthumb") {
+contains(QMAKE_CFLAGS, "--thumb")|contains(QMAKE_CXXFLAGS, "--thumb")|contains(QMAKE_CFLAGS, "-mthumb")|contains(QMAKE_CXXFLAGS, "-mthumb") {
DEFINES += __MARM_THUMB__
}
@@ -30,22 +26,35 @@ for(library, LIBS) {
library = $$replace(library, "^-l", "")
isFullName = $$find(library, \.)
isEmpty(isFullName):library="$${library}.dso"
- newLIBS += "-l:$${library}"
+ linux-gcce {
+ newLIBS += "-l:$${library}"
+ } else {
+ newLIBS += "$${library}"
+ }
}
LIBS = $$newLIBS
newLIBS =
-QMAKE_LIBS += dfpaeabi drtaeabi scppnwdl
for(library, QMAKE_LIBS) {
library = $$replace(library, "\.dll$", ".dso")
library = $$replace(library, "^-l", "")
isFullName = $$find(library, \.)
isEmpty(isFullName):library="$${library}.dso"
- newLIBS += "-l:$${library}"
+ linux-gcce {
+ newLIBS += "-l:$${library}"
+ } else {
+ newLIBS += "$${library}"
+ }
}
QMAKE_LIBS = $$newLIBS
-# This needs to be done after the above LIBS mangling.
-include(../platformlibs.conf)
+linux-gcce {
+ QMAKE_LIBS += -l:usrt2_2.lib \
+ -l:dfpaeabi.dso \
+ -l:drtaeabi.dso \
+ -l:scppnwdl.dso \
+ -lsupc++ \
+ -lgcc
+}
elf2e32_LIBPATH =
for(libPath, QMAKE_LIBDIR) {
@@ -101,11 +110,14 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) {
QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.dso
QMAKE_CLEAN += $${symbianObjdir}/$${TARGET}.def
- QMAKE_LFLAGS += --soname $${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll \
- --target1-abs \
- --no-undefined \
- --strip-debug \
- --nostdlib
+ linux-armcc: {
+ QMAKE_LIBS += -ledllstub.lib -ledll.lib\\(uc_dll_.o\\)
+ } else :linux-gcce {
+ #QMAKE_LIBS += -l:edllstub.lib -l:edll.lib
+ }
+
+ QMAKE_LFLAGS += --soname $${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll -u _E32Dll --entry=_E32Dll
+ DEFINES += __DLL__
}
contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@.*") {
@@ -119,17 +131,20 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@.*") {
QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.exe
QMAKE_CLEAN += $${symbianDestdir}/$${TARGET}
- QMAKE_LFLAGS += --soname=$${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe \
- --target1-abs \
- --no-undefined \
- --strip-debug \
- --shared \
- --nostdlib
+ linux-armcc: {
+ QMAKE_LIBS += -leexe.lib\\(uc_exe_.o\\)
+ } else :linux-gcce {
+ #QMAKE_LIBS += -l:eexe.lib
+ }
+
+ QMAKE_LFLAGS += --soname $${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe
+# TODO gcce added --shared here...
+ DEFINES += __EXE__
}
# Symbian resource files
-#linux-armcc:symbian_resources_INCLUDES = -I$$(RVCT22INC)
+linux-armcc:symbian_resources_INCLUDES = -I$$(RVCT22INC)
symbian_resources_INCLUDES = $$replace(symbian_resources_INCLUDES, ",", " -I")
symbian_resources_INCLUDES += $$join(INCLUDEPATH, " -I", "-I")
symbian_resources_DEFINES = $$join(DEFINES, " -D", "-D")
@@ -163,9 +178,7 @@ QMAKE_EXTRA_COMPILERS += symbianresources
contains(TEMPLATE, "app"):!contains(CONFIG, "no_icon") {
baseTarget = $$basename(TARGET)
- baseTarget = $$replace(baseTarget, -,_)
- baseTarget = $$replace(baseTarget, :,_)
- baseTarget = $$replace(baseTarget, \.,_)
+ # If you change this, also see application_icon.prf
baseTarget = $$replace(baseTarget, " ",_)
# Make our own extra compiler target in order to get dependencies for generated
diff --git a/mkspecs/symbian/linux-armcc/features/symbian_building.prf b/mkspecs/symbian/linux-armcc/features/symbian_building.prf
deleted file mode 100644
index dc52730..0000000
--- a/mkspecs/symbian/linux-armcc/features/symbian_building.prf
+++ /dev/null
@@ -1,202 +0,0 @@
-QMAKE_CFLAGS += --dllimport_runtime --preinclude rvct2_2.h --diag_suppress 186,654,1300 --thumb --fpu softvfp --cpu 5T --enum_is_int -Ono_known_library --fpmode ieee_no_fenv --export_all_vtbl --no_vfe --apcs /inter $$QMAKE_CFLAGS.ARMCC
-QMAKE_CXXFLAGS += $$QMAKE_CFLAGS --no_parse_templates $$QMAKE_CXXFLAGS.ARMCC
-QMAKE_LFLAGS += --diag_suppress 6331,6780 --bpabi --reloc --datacompressor=off --split --rw-base 0x800000 --dll --no_scanlib
-QMAKE_LFLAGS_APP += --entry _E32Startup
-QMAKE_LFLAGS_SHLIB += --entry _E32Dll
-QMAKE_CFLAGS_DEBUG += -g
-QMAKE_CXXFLAGS_DEBUG += -g
-QMAKE_CFLAGS_RELEASE += -O2 -Otime
-QMAKE_CXXFLAGS_RELEASE += -O2 -Otime
-
-DEFINES += __SYMBIAN32__ EKA2 __S60_50__ __S60_3X__ __SERIES60_3X__ __EPOC32__ __MARM__ __EABI__ __ARMCC__ __ARMcc_2__ __ARMCC_2_2__ __MARM_ARMV5__ __MARM_INTERWORK__ __DLL__ _UNICODE __SUPPORT_CPP_EXCEPTIONS__
-
-symbianObjdir=$$OBJECTS_DIR
-isEmpty(symbianObjdir) {
- symbianObjdir = .
-}
-symbianDestdir=$$DESTDIR
-isEmpty(symbianDestdir) {
- symbianDestdir = .
-}
-
-contains(QMAKE_CFLAGS, "--thumb")|contains(QMAKE_CXXFLAGS, "--thumb") {
- DEFINES += __MARM_THUMB__
-}
-
-for(libraries, LIBS) {
- libraries = $$replace(libraries, "\.dll$", ".dso")
- isFullName = $$find(libraries, \.)
- isEmpty(isFullName) {
- newLIBS += "$${libraries}.dso"
- } else {
- newLIBS += "$${libraries}"
- }
-}
-LIBS = $$newLIBS
-newLIBS =
-for(libraries, QMAKE_LIBS) {
- libraries = $$replace(libraries, "\.dll$", ".dso")
- isFullName = $$find(libraries, \.)
- isEmpty(isFullName) {
- newLIBS += "$${libraries}.dso"
- } else {
- newLIBS += "$${libraries}"
- }
-}
-QMAKE_LIBS = $$newLIBS
-
-# This needs to be done after the above LIBS mangling.
-include(../platformlibs.conf)
-
-elf2e32_LIBPATH =
-for(libPath, QMAKE_LIBDIR) {
- elf2e32_LIBPATH += "--libpath=$$libPath"
-}
-
-isEmpty(VERSION) {
- VERSION = $$QT_VERSION
-}
-
-# Check for version validity.
-!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")
-}
-
-splitVersion = $$split(VERSION, ".")
-count(splitVersion, 1) {
- # Default Symbian version if none is specified.
- hexVersion = "000a0000"
- decVersion = "10.0"
-} else {
- count(splitVersion, 3) {
- hexVersion = $$system("sh -c 'printf %02x $$member(splitVersion, 0)'")
- hexPart2 = $$system("sh -c 'printf %02x $$member(splitVersion, 1)'")"
- hexPart2 = $$hexPart2$$system("sh -c 'printf %02x $$member(splitVersion, 2)'")"
- decVersion = $$system("sh -c 'printf %1d 0x$$hexVersion'").
- hexVersion = $$hexVersion$$hexPart2
- decVersion = $$decVersion$$system("sh -c 'printf %d 0x$$hexPart2'")
- !contains(hexVersion, "[0-9a-f]{8}"):hexVersion = "00$${hexVersion}"
- } else { # app code may have different numbering...
- hexVersion = $$VERSION
- decVersion = $$VERSION
- }
-}
-#error ("hexVersion: $$hexVersion, decVersion: $$decVersion")
-
-intUid3 = $$lower($$replace(TARGET.UID3, "^0x", ""))
-isEmpty(TARGET.SID):TARGET.SID = $$TARGET.UID3
-isEmpty(TARGET.UID2):TARGET.UID2 = 0x00000000
-
-capability = $$replace(TARGET.CAPABILITY, " ", "+")
-capability = $$join(capability, "+")
-capability = $$replace(capability, "\+-", "-")
-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
- QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.sym
- QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.dso
- QMAKE_CLEAN += $${symbianObjdir}/$${TARGET}.def
-
- QMAKE_LIBS += -ledllstub.lib -ledll.lib\\(uc_dll_.o\\)
-
- QMAKE_LFLAGS += --symver_soname --soname $${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll
-}
-
-contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@.*") {
- !isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK += &&
-
- QMAKE_POST_LINK += $$QMAKE_MOVE $$symbianDestdir/$${TARGET} $$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=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 += && ln "$${TARGET}.exe" "$$TARGET"
- QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.sym
- QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.exe
- QMAKE_CLEAN += $${symbianDestdir}/$${TARGET}
-
- QMAKE_LIBS += -leexe.lib\\(uc_exe_.o\\)
-
- QMAKE_LFLAGS += --symver_soname --soname $${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe
-}
-
-# Symbian resource files
-
-linux-armcc:symbian_resources_INCLUDES = -I$$(RVCT22INC)
-symbian_resources_INCLUDES = $$replace(symbian_resources_INCLUDES, ",", " -I")
-symbian_resources_INCLUDES += $$join(INCLUDEPATH, " -I", "-I")
-symbian_resources_DEFINES = $$join(DEFINES, " -D", "-D")
-symbian_resources_RCC_DIR = $$replace(RCC_DIR, "/$", "")
-symbian_resources_INCLUDES += "-I $$symbian_resources_RCC_DIR"
-
-for(symbian_resource, SYMBIAN_RESOURCES) {
- symbian_resource = $$basename(symbian_resource)
- symbian_resource_clean = $$replace(symbian_resource, "\.rss$", ".rsc")
- QMAKE_DISTCLEAN += $${symbianDestdir}/$${symbian_resource_clean}
- symbian_resource_clean = $$replace(symbian_resource, "\.rss$", ".rpp")
- QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${symbian_resource_clean}
-}
-
-symbianresources.input = SYMBIAN_RESOURCES
-symbianresources.output = $$symbian_resources_RCC_DIR/${QMAKE_FILE_BASE}.rsg
-symbianresources.commands = cpp -nostdinc -undef \
- $$symbian_resources_INCLUDES \
- $$symbian_resources_DEFINES \
- ${QMAKE_FILE_NAME} \
- -o $${symbian_resources_RCC_DIR}/${QMAKE_FILE_BASE}.rpp \
- && rcomp -u -m045,046,047 \
- -s$${symbian_resources_RCC_DIR}/${QMAKE_FILE_BASE}.rpp \
- -o$${symbianDestdir}/${QMAKE_FILE_BASE}.rsc \
- -h$${symbian_resources_RCC_DIR}/${QMAKE_FILE_BASE}.rsg \
- -i${QMAKE_FILE_NAME}
-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)
- # If you change this, also see application_icon.prf
- baseTarget = $$replace(baseTarget, " ",_)
-
- # Make our own extra compiler target in order to get dependencies for generated
- # files right. This also avoids the warning about files not found.
- symbianGenResource.inputFile = $${baseTarget}.rss
- symbianGenResource.input = symbianGenResource.inputFile
- # Reuse the command from earlier.
- symbianGenResource.commands = $$symbianresources.commands
- symbianGenResource.output = $$symbianresources.output
- symbianGenResource.CONFIG = no_link target_predeps
-
- symbianGenRegResource.inputFile = $${baseTarget}_reg.rss
- symbianGenRegResource.input = symbianGenRegResource.inputFile
- symbianGenRegResource.commands = $$symbianresources.commands
- symbianGenRegResource.output = $$symbianresources.output
- symbianGenRegResource.CONFIG = no_link target_predeps
- symbianGenRegResource.depends = $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
-
- QMAKE_EXTRA_COMPILERS += symbianGenResource symbianGenRegResource
-
- QMAKE_DISTCLEAN += $${TARGET}.rss
- QMAKE_DISTCLEAN += $${TARGET}.rsc
- QMAKE_DISTCLEAN += $${TARGET}_reg.rss
- QMAKE_DISTCLEAN += $${TARGET}_reg.rsc
- QMAKE_DISTCLEAN += $${TARGET}.loc
-}
-
-# Generated pkg files
-
-QMAKE_DISTCLEAN += $${TARGET}_template.pkg
-
-# Pre 2.6.23 Linux kernels have a limit on the environment size that can be passed to
-# a forked process. We quite easily overstep this boundary when building big projects
-# on Symbian, and since we depend on running the system() command, this causes the build
-# to fail. Test here that system() can be successfully run. It is important that this
-# check happens as late as possible, otherwise it will not be caught.
-execve_sanity_test = $$system("echo testing")
-!contains(execve_sanity_test, "testing") {
- error("Running system() failed. Maybe your kernel is too old? (Linux kernels need at least version 2.6.23)")
-}
diff --git a/mkspecs/symbian/linux-armcc/platformlibs.conf b/mkspecs/symbian/linux-armcc/platformlibs.conf
deleted file mode 100644
index d03cb9b..0000000
--- a/mkspecs/symbian/linux-armcc/platformlibs.conf
+++ /dev/null
@@ -1,3 +0,0 @@
-QMAKE_LIBS += usrt2_2.lib dfpaeabi.dso dfprvct2_2.dso drtaeabi.dso scppnwdl.dso drtrvct2_2.dso h_t__uf.l\\(switch8.o\\)
-
-QMAKE_RVCT_LINKSTYLE = 1
diff --git a/mkspecs/symbian/linux-armcc/qmake.conf b/mkspecs/symbian/linux-armcc/qmake.conf
index c98c1f0..a8194b2 100644
--- a/mkspecs/symbian/linux-armcc/qmake.conf
+++ b/mkspecs/symbian/linux-armcc/qmake.conf
@@ -5,3 +5,18 @@
include(../../common/symbian/symbian-makefile.conf)
include(../../common/armcc.conf)
+
+QMAKE_LIBS += usrt2_2.lib dfpaeabi.dso dfprvct2_2.dso drtaeabi.dso scppnwdl.dso drtrvct2_2.dso h_t__uf.l\\(switch8.o\\)
+
+QMAKE_RVCT_LINKSTYLE = 1
+
+QMAKE_CFLAGS += --dllimport_runtime --preinclude rvct2_2.h --diag_suppress 186,654,1300 --thumb --fpu softvfp --cpu 5T --enum_is_int -Ono_known_library --fpmode ieee_no_fenv --export_all_vtbl --no_vfe --apcs /inter $$QMAKE_CFLAGS.ARMCC
+QMAKE_CXXFLAGS += $$QMAKE_CFLAGS --no_parse_templates $$QMAKE_CXXFLAGS.ARMCC
+QMAKE_LFLAGS += --symver_soname --diag_suppress 6331,6780 --bpabi --reloc --datacompressor=off --split --rw-base 0x800000 --dll --no_scanlib
+QMAKE_LFLAGS_APP += --entry _E32Startup
+
+DEFINES += EKA2 \
+ __ARMCC__ \
+ __ARMcc_2__ \
+ __ARMCC_2_2__
+
diff --git a/mkspecs/symbian/linux-gcce/platformlibs.conf b/mkspecs/symbian/linux-gcce/platformlibs.conf
deleted file mode 100644
index f344ef0..0000000
--- a/mkspecs/symbian/linux-gcce/platformlibs.conf
+++ /dev/null
@@ -1,20 +0,0 @@
-QMAKE_LIBS += -l:usrt2_2.lib \
- -l:edllstub.lib \
- -l:edll.lib \
- -lsupc++ \
- -lgcc
-
-QMAKE_LIBDIR += ${EPOCROOT}/epoc32/release/armv5/udeb/
-
-
-# g++ knows the path to the gcc-shipped-libs, ld doesn't. So cache the full path in the generate Makefile
-QMAKE_GCC_SEARCH_DIRS =$$system($$QMAKE_CXX -print-search-dirs)
-for(line, QMAKE_GCC_SEARCH_DIRS) {
- contains(line, "libraries:") {
- foundIt="1"
- } else {
- contains(foundIt, "1") {
- QMAKE_LFLAGS += $$replace(line, "[=:]", " -L")
- }
- }
-}
diff --git a/mkspecs/symbian/linux-gcce/qmake.conf b/mkspecs/symbian/linux-gcce/qmake.conf
index cb30f61..3eb6d56 100644
--- a/mkspecs/symbian/linux-gcce/qmake.conf
+++ b/mkspecs/symbian/linux-gcce/qmake.conf
@@ -34,6 +34,7 @@ QMAKE_QtSvg_CXXFLAGS = -mthumb
QMAKE_QtTest_CXXFLAGS = -mthumb
QMAKE_QtXmlPatterns_CXXFLAGS = -mthumb
QMAKE_QtXml_CXXFLAGS = -mthumb
+#TODO fails with; arm-none-symbianelf-ld: section .data loaded at [00e00000,00e05973] overlaps section .text loaded at [00008000,00fe748b]
QMAKE_QtWebKit_LFLAGS = -Ttext 0x8000 -Tdata 0xE00000
# never use -fPIC, gcce-linker doesn't like it.
@@ -47,3 +48,33 @@ QMAKE_LFLAGS_SONAME =
#QMAKE_LFLAGS_THREAD +=
#QMAKE_LFLAGS_NOUNDEF += -Wl,--no-undefined
QMAKE_RPATH = --rpath=
+
+DEFINES += __GCCE__ \
+ UNICODE \
+ _STLP_NO_EXCEPTION_HEADER
+
+QMAKE_LFLAGS_APP += --entry _E32Startup
+QMAKE_LFLAGS_SHLIB += --default-symver
+
+gcceExtraFlags = -I${EPOCROOT}epoc32/include/ --include=${EPOCROOT}epoc32/include/gcce/gcce.h -march=armv5t -mapcs -mthumb-interwork -nostdinc -c -fvisibility-inlines-hidden -msoft-float -T script
+QMAKE_CFLAGS += $${gcceExtraFlags}
+QMAKE_CXXFLAGS += $${gcceExtraFlags} -x c++ -fexceptions -fno-unit-at-a-time
+
+QMAKE_LFLAGS += --target1-abs \
+ --no-undefined \
+ --strip-debug \
+ --nostdlib
+
+QMAKE_LIBDIR += ${EPOCROOT}/epoc32/release/armv5/udeb/
+
+# g++ knows the path to the gcc-shipped-libs, ld doesn't. So cache the full path in the generate Makefile
+QMAKE_GCC_SEARCH_DIRS =$$system($$QMAKE_CXX -print-search-dirs)
+for(line, QMAKE_GCC_SEARCH_DIRS) {
+ contains(line, "libraries:") {
+ foundIt="1"
+ } else {
+ contains(foundIt, "1") {
+ QMAKE_LFLAGS += $$replace(line, "[=:]", " -L")
+ }
+ }
+}