diff options
110 files changed, 2792 insertions, 1498 deletions
@@ -206,6 +206,11 @@ plugin_commonU.def *.sis *.sisx *.lst +*.exe +*.mif +*.rsc +*.sym +*.lib # Generated by abldfast.bat from devtools. .abldsteps.* diff --git a/README.s60-mkspec b/README.s60-mkspec new file mode 100644 index 0000000..af500e1 --- /dev/null +++ b/README.s60-mkspec @@ -0,0 +1,99 @@ +How to build Qt for Symbian using the Linux makespec. + +Prerequisites: + + - Working RVCT 2.2 native Linux compiler. The new publicly + available RVCT 4.0 compiler may work, but it hasn't been tested + yet. + + - A working GnuPoc environment. See this page for details: + http://www.martin.st/symbian/ + Download the latest version, unpack it and run the 'install_eka2_tools' script as + described in the last part under the EKA2 part. The part about the your own gcc + are not needed as we use the rvct compiler. + Make sure you do the part about Wine setup as well. + + - Anderson Lizardo's patches for GnuPoc. Look for the + qt_s60_gnupoc_v10.patch on this page: + http://lizardo.wordpress.com/2009/09/24/installing-qt-for-s60-daily-snapshots-on-linux/ + and carry out the instructions under point 8: Installing Open C. + +Compiling: + + 1. First a few environment variables need to be set: + + export RVCT22LIB=<rvct-dir>/lib/armlib + export EPOCROOT=<s60-root> + export PATH=$PATH:<s60-root>/epoc32/tools:<rvctInstallDir>/bin + export PATH=$PATH:<qt-root>/bin + + Replace the s60-root with the installation directory of your SDK, + and the qt-root with the root of your Qt repository. + These are good candidates for putting in a script somewhere. + + 2. Run configure. It needs a bit more switches than usual, so here's + the full line: + + ./configure -developer-build -platform linux-g++ -xplatform \ + symbian/linux-armcc -little-endian -host-little-endian \ + -arch symbian + + 3. Compile Qt + + cd src + make + + and then wait for a while. + + 4. Package and install Qt + + cd s60installs + + Edit Qt_template.pkg and change the first 0x2xxxxxxx to + 0xExxxxxxx. Then execute: + + makesis Qt_template.pkg + signsis Qt_template.sis Qt_template.sisx selfsigned.cer selfsigned.key + + Then put Qt_template.sisx on a memory card and install it from + the phone file manager. + + Alternatively, you can use the runonphone tool found in the tools + directory of Qt. To build, this requires a separately configured + Qt installation for Linux, unfortunately. To use it, you also + need have App TRK running on the phone. At the time of writing, + only bleeding edge Linux kernels are able to autodetect the USB + serial port on the phone, but you can force detection by running: + + modprobe usbserial vendor=0xXXXX product=0xXXXX + + The XXXXs should be replaced with the two values listed for your + device when executing "lsusb". In most distributions, this will + lead to the creation of two devices: /dev/ttyUSB0 and + /dev/ttyUSB1. The latter is usually the one that App TRK responds + to. Then execute: + + runonphone -p /dev/ttyUSB1 -s Qt_template.sisx dummy.exe + + The dummy.exe argument is irrelevant, since we are not executing + anything yet. + + 5. Compile some helloworld application (I leave the details to you + ;-) + + qmake + make + + 6. Package, install and run application. + + makesis helloworld_template.pkg + signsis helloworld_template.sis helloworld_template.sisx \ + <QTDIR>/src/s60installs/selfsigned.cer \ + <QTDIR>/src/s60installs/selfsigned.key + + Then either install by memory card, or install and run like this: + + runonphone -p /dev/ttyUSB1 -s helloworld_template.sisx \ + helloworld.exe + + 7. Enjoy "hello world" on the phone! diff --git a/bin/createpackage.sh b/bin/createpackage index fdd4eeb..fdd4eeb 100755 --- a/bin/createpackage.sh +++ b/bin/createpackage diff --git a/bin/createpackage.pl b/bin/createpackage.pl index 1d6ab6b..c16c692 100755 --- a/bin/createpackage.pl +++ b/bin/createpackage.pl @@ -85,7 +85,7 @@ Where parameters are as follows: winscw | gcce | armv5 | armv6 | armv7 certificate = The certificate file used for signing key = The certificate's private key file - passphrase = The certificate's private key file's passphrase + passphrase = The passphrase of the certificate's private key file Example: createpackage.pl fluidlauncher_template.pkg release-armv5 @@ -130,16 +130,21 @@ my $templatepkg = $ARGV[0]; my $targetplatform = lc $ARGV[1]; my @tmpvalues = split('-', $targetplatform); -my $target = $tmpvalues[0]; -my $platform = $tmpvalues[1];; +my $target; +$target = $tmpvalues[0] or $target = ""; +my $platform; +$platform = $tmpvalues[1] or $platform = ""; # Convert visual target to real target (debug->udeb and release->urel) $target =~ s/debug/udeb/i; $target =~ s/release/urel/i; -my $certificate = $ARGV[2]; -my $key = $ARGV[3]; -my $passphrase = $ARGV[4]; +my $certificate; +$certificate = $ARGV[2] or $certificate = ""; +my $key; +$key = $ARGV[3] or $key = ""; +my $passphrase; +$passphrase = $ARGV[4] or $passphrase = ""; # Generate output pkg basename (i.e. file name without extension) my $pkgoutputbasename = $templatepkg; @@ -149,11 +154,11 @@ if ($pkgoutputbasename eq $templatepkg) { $preservePkgOutput = "1"; } $pkgoutputbasename =~ s/\.pkg//g; -$pkgoutputbasename = lc($pkgoutputbasename); +$pkgoutputbasename = $pkgoutputbasename; # Store output file names to variables -my $pkgoutput = lc($pkgoutputbasename.".pkg"); -my $sisoutputbasename = lc($pkgoutputbasename); +my $pkgoutput = $pkgoutputbasename.".pkg"; +my $sisoutputbasename = $pkgoutputbasename; $sisoutputbasename =~ s/_$targetplatform//g; my $unsigned_sis_name = $sisoutputbasename."_unsigned.sis"; my $signed_sis_name = $sisoutputbasename.".sis"; @@ -171,14 +176,6 @@ unless (length($templatepkg)) { Usage(); } -# If the pkg file is not actually a template, there is no need for plaform or target. -if ($templatepkg =~ m/_template\.pkg/i) { - unless (length($platform) && length($target)) { - print "\nError: Platform or target is not defined!\n"; - Usage(); - } -} - # Check template exist stat($templatepkg); unless( -e _ ) { @@ -246,6 +243,14 @@ open( TEMPLATE, $templatepkg) or die "Error '$templatepkg': $!\n"; $_=<TEMPLATE>; close (TEMPLATE); +# If the pkg file does not contain macros, there is no need for platform or target. +if (m/\$\(PLATFORM\)/) { + unless (length($platform) && length($target)) { + print "\nError: Platform or target is not defined!\n"; + Usage(); + } +} + # replace the PKG variables s/\$\(PLATFORM\)/$platform/gm; s/\$\(TARGET\)/$target/gm; @@ -267,12 +272,20 @@ if($stub) { # Create stub SIS. system ("makesis -s $pkgoutput $stub_sis_name"); } else { + if ($certtext eq "Self Signed" && !@certificates) { + print("Patching capabilities for self signed package $certificate\n"); + system ("patch_capabilities $templatepkg $targetplatform"); + } # Create SIS. - system ("makesis $pkgoutput $unsigned_sis_name"); + # The 'and' is because system uses 0 to indicate success. + system ("makesis $pkgoutput $unsigned_sis_name") and die ("makesis failed"); print("\n"); # Sign SIS with certificate info given as an argument. - system ("signsis $unsigned_sis_name $signed_sis_name $certificate $key $passphrase"); + my $relcert = File::Spec->abs2rel($certificate); + my $relkey = File::Spec->abs2rel($key); + # The 'and' is because system uses 0 to indicate success. + system ("signsis $unsigned_sis_name $signed_sis_name $relcert $relkey $passphrase") and die ("signsis failed"); # Check if creating signed SIS Succeeded stat($signed_sis_name); @@ -286,10 +299,10 @@ if($stub) { # Sign with additional certificates & keys for my $row ( @certificates ) { # Get certificate absolute file names, relative paths are relative to certfilepath - my $abscert = File::Spec->rel2abs( $row->[0], $certfilepath); - my $abskey = File::Spec->rel2abs( $row->[1], $certfilepath); + my $relcert = File::Spec->abs2rel(File::Spec->rel2abs( $row->[0], $certfilepath)); + my $relkey = File::Spec->abs2rel(File::Spec->rel2abs( $row->[1], $certfilepath)); - system ("signsis $signed_sis_name $signed_sis_name $abscert $abskey $row->[2]"); + system ("signsis $signed_sis_name $signed_sis_name $relcert $relkey $row->[2]"); print ("\tAdditionally signed the SIS with certificate: $row->[0]!\n"); } diff --git a/bin/patch_capabilities b/bin/patch_capabilities new file mode 100755 index 0000000..0d89622 --- /dev/null +++ b/bin/patch_capabilities @@ -0,0 +1,3 @@ +#!/bin/sh +scriptpath=`dirname $0` +perl $scriptpath/patch_capabilities.pl "$@" diff --git a/bin/patch_capabilities.pl b/bin/patch_capabilities.pl index f82c48f..4390957 100755 --- a/bin/patch_capabilities.pl +++ b/bin/patch_capabilities.pl @@ -50,14 +50,26 @@ sub Usage() { print("This script can be used to set capabilities of all binaries\n"); print("specified for deployment in a .pkg file.\n"); print("If no capabilities are given, the binaries will be given the\n"); - print("capabilities supported by self-signed certificates.\n"); - print("\n *** NOTE: If *_template.pkg file is given, 'target-platform' is REQUIRED. ***\n"); - print("\nUsage: patch_capabilities.pl pkg_filename <target-platform> [capability list]\n"); + print("capabilities supported by self-signed certificates.\n\n"); + print(" *** NOTE: If *_template.pkg file is given and one is using symbian-abld or\n"); + print(" symbian-sbsv2 platform, 'target-platform' is REQUIRED. ***\n"); + print("\nUsage: patch_capabilities.pl pkg_filename [target-platform [capability list]]\n"); print("\nE.g. patch_capabilities.pl myapp_template.pkg release-armv5 \"All -TCB\"\n"); exit(); } -my @capabilitiesToSet = ("LocalServices", "NetworkServices", "ReadUserData", "UserEnvironment", "WriteUserData"); +sub trim($) { + my $string = shift; + $string =~ s/^\s+//; + $string =~ s/\s+$//; + return $string; +} + +my $nullDevice = "/dev/null"; +$nullDevice = "NUL" if ($^O =~ /MSWin/); + +my @capabilitiesToAllow = ("LocalServices", "NetworkServices", "ReadUserData", "UserEnvironment", "WriteUserData"); +my @capabilitiesSpecified = (); # If arguments were given to the script, if (@ARGV) @@ -73,11 +85,16 @@ if (@ARGV) if (($pkgFileName =~ m|_template\.pkg$|i) && -r($pkgFileName)) { my $targetplatform; - unless ($targetplatform = shift(@ARGV)) + my $templateFile; + my $templateContents; + open($templateFile, "< $pkgFileName") or die ("Could not open $pkgFileName"); + $templateContents = <$templateFile>; + close($templateFile); + unless (($targetplatform = shift(@ARGV)) || $templateContents !~ /\$\(PLATFORM\)/) { Usage(); } - + $targetplatform = "-" if (!$targetplatform); my @tmpvalues = split('-', $targetplatform); $target = $tmpvalues[0]; $platform = $tmpvalues[1]; @@ -93,10 +110,10 @@ if (@ARGV) # If there are more arguments given, parse them as capabilities. if (@ARGV) { - @capabilitiesToSet = (); + @capabilitiesSpecified = (); while (@ARGV) { - push (@capabilitiesToSet, pop(@ARGV)); + push (@capabilitiesSpecified, pop(@ARGV)); } } @@ -174,7 +191,7 @@ if (@ARGV) my $destinationPath = $2; # If the given file is a binary, check the target and binary type (+ the actual filename) from its path. - if ($sourcePath =~ m:/epoc32/release/([^/]+)/(udeb|urel|\$\(TARGET\))/(\w+(\.dll|\.exe)):i) + if ($sourcePath =~ m:\w+(\.dll|\.exe)$:i) { # Do preprocessing for template pkg, # In case of template pkg target and platform variables are set @@ -197,23 +214,42 @@ if (@ARGV) print ("\n"); - my $baseCommandToExecute = "elftran -vid 0x0 -capability \""; - if (@capabilitiesToSet) - { - $baseCommandToExecute .= join(" ", @capabilitiesToSet); - } - $baseCommandToExecute .= "\" "; + my $baseCommandToExecute = "elftran -vid 0x0 -capability \"%s\" "; # Actually set the capabilities of the listed binaries. foreach my $binaryPath(@binaries) { # Create the command line for setting the capabilities. my $commandToExecute = $baseCommandToExecute; + if (@capabilitiesSpecified) + { + $commandToExecute = sprintf($baseCommandToExecute, join(" ", @capabilitiesSpecified)); + } else { + # Test which capabilities are present and then restrict them to the allowed set. + # This avoid raising the capabilities of apps that already have none. + my $dllCaps; + open($dllCaps, "elftran -dump s $binaryPath |") or die ("Could not execute elftran"); + my $capsFound = 0; + my @capabilitiesToSet; + my $capabilitiesToAllow = join(" ", @capabilitiesToAllow); + while (<$dllCaps>) { + if (!$capsFound) { + $capsFound = 1 if (/Capabilities:/); + } else { + $_ = trim($_); + if ($capabilitiesToAllow =~ /$_/) { + push(@capabilitiesToSet, $_); + } + } + } + close($dllCaps); + $commandToExecute = sprintf($baseCommandToExecute, join(" ", @capabilitiesToSet)); + } $commandToExecute .= $binaryPath; # Actually execute the elftran command to set the capabilities. - system ($commandToExecute." > NUL"); - print ("Executed ".$commandToExecute."\n"); + print ("Executing ".$commandToExecute."\n"); + system ($commandToExecute." > $nullDevice"); ## Create another command line to check that the set capabilities are correct. #$commandToExecute = "elftran -dump s ".$binaryPath; diff --git a/config.tests/.gitignore b/config.tests/.gitignore new file mode 100644 index 0000000..bd76520 --- /dev/null +++ b/config.tests/.gitignore @@ -0,0 +1,2 @@ +*.rpp +*.rsg diff --git a/config.tests/symbian/audio/.gitignore b/config.tests/symbian/audio/.gitignore new file mode 100644 index 0000000..87a251c --- /dev/null +++ b/config.tests/symbian/audio/.gitignore @@ -0,0 +1,2 @@ +audio.rpp +audio.rsg diff --git a/config.tests/unix/largefile/largefiletest.cpp b/config.tests/symbian/audio/audio.cpp index bf25de9..4ffc728 100644 --- a/config.tests/unix/largefile/largefiletest.cpp +++ b/config.tests/symbian/audio/audio.cpp @@ -39,35 +39,9 @@ ** ****************************************************************************/ -/* Sample program for configure to test Large File support on target -platforms. -*/ +#include <sounddevice.h> -#define _LARGEFILE_SOURCE -#define _LARGE_FILES -#define _FILE_OFFSET_BITS 64 -#include <unistd.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <assert.h> -#include <stdio.h> - -int main( int, char **argv ) +int main(int argc, char **argv) { -// check that off_t can hold 2^63 - 1 and perform basic operations... -#define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - if (OFF_T_64 % 2147483647 != 1) - return 1; - - // stat breaks on SCO OpenServer - struct stat buf; - stat( argv[0], &buf ); - if (!S_ISREG(buf.st_mode)) - return 2; - - FILE *file = fopen( argv[0], "r" ); - off_t offset = ftello( file ); - fseek( file, offset, SEEK_CUR ); - fclose( file ); return 0; } diff --git a/config.tests/symbian/audio/audio.pro b/config.tests/symbian/audio/audio.pro new file mode 100644 index 0000000..abbde6e --- /dev/null +++ b/config.tests/symbian/audio/audio.pro @@ -0,0 +1,7 @@ +TARGET = audio +SOURCES = audio.cpp + +INCLUDEPATH += $${EPOCROOT}epoc32/include/mmf/server +INCLUDEPATH += $${EPOCROOT}epoc32/include/mmf/common + +LIBS += -lmmfdevsound diff --git a/config.tests/symbian/compile.test b/config.tests/symbian/compile.test new file mode 100755 index 0000000..20a3039 --- /dev/null +++ b/config.tests/symbian/compile.test @@ -0,0 +1,46 @@ +#!/bin/sh + +SUCCESS=no +QMKSPEC=$1 +XPLATFORM=`basename "$1"` +QMAKE_CONFIG=$2 +VERBOSE=$3 +SRCDIR=$4 +OUTDIR=$5 +TEST=$6 +EXE=`basename "$6"` +DESCRIPTION=$7 +shift 7 +LFLAGS="" +INCLUDEPATH="" +CXXFLAGS="" +MAC_ARCH_CXXFLAGS="" +MAC_ARCH_LFLAGS="" + +# debuggery +[ "$VERBOSE" = "yes" ] && echo "$DESCRIPTION auto-detection... ($*)" + +test -d "$OUTDIR/$TEST" || mkdir -p "$OUTDIR/$TEST" + +cd "$OUTDIR/$TEST" + +test -r Makefile && $MAKE distclean >/dev/null 2>&1 + +"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "LIBS*=$LFLAGS" "LIBS+=$MAC_ARCH_LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CXXFLAGS*=$CXXFLAGS" "QMAKE_CXXFLAGS+=$MAC_ARCH_CXXFLAGS" "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile" + +if [ "$VERBOSE" = "yes" ]; then + $MAKE +else + $MAKE >/dev/null 2>&1 +fi + +[ -x "$EXE.exe" ] && SUCCESS=yes + +# done +if [ "$SUCCESS" != "yes" ]; then + [ "$VERBOSE" = "yes" ] && echo "$DESCRIPTION disabled." + exit 1 +else + [ "$VERBOSE" = "yes" ] && echo "$DESCRIPTION enabled." + exit 0 +fi diff --git a/config.tests/unix/largefile/largefile.pro b/config.tests/unix/largefile/largefile.pro deleted file mode 100644 index d7affc6..0000000 --- a/config.tests/unix/largefile/largefile.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES=largefiletest.cpp -CONFIG-=qt dylib -mac:CONFIG -= app_bundle @@ -644,6 +644,8 @@ CFG_XVIDEO=auto CFG_XINERAMA=runtime CFG_XFIXES=runtime CFG_ZLIB=auto +CFG_SYMBIAN_DEFFILES=auto +CFG_S60=auto CFG_SQLITE=qt CFG_GIF=auto CFG_TIFF=auto @@ -678,7 +680,7 @@ CFG_PHONON=auto CFG_PHONON_BACKEND=yes CFG_MULTIMEDIA=yes CFG_MEDIASERVICE=yes -CFG_AUDIO_BACKEND=yes +CFG_AUDIO_BACKEND=auto CFG_SVG=yes CFG_DECLARATIVE=auto CFG_WEBKIT=auto # (yes|no|auto) @@ -723,7 +725,7 @@ CFG_DBUS=auto CFG_GLIB=auto CFG_GSTREAMER=auto CFG_QGTKSTYLE=auto -CFG_LARGEFILE=auto +CFG_LARGEFILE=yes CFG_OPENSSL=auto CFG_PTMALLOC=no CFG_STL=auto @@ -927,8 +929,7 @@ while [ "$#" -gt 0 ]; do VAL=no ;; #Qt style yes options - - -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xvideo|-xsync|-xinput|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-carbon|-universal|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-mediaservice|-audio-backend|-svg|-declarative|-webkit|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config) + -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-carbon|-universal|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-mediaservice|-audio-backend|-svg|-declarative|-webkit|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config|-s60|-usedeffiles) VAR=`echo $1 | sed "s,^-\(.*\),\1,"` VAL=yes ;; @@ -1493,7 +1494,6 @@ while [ "$#" -gt 0 ]; do fi ;; feature-*) - if [ "$PLATFORM_QWS" = "yes" ]; then FEATURE=`echo $VAR | sed "s,^[^-]*-\([^-]*\),\1," | tr 'abcdefghijklmnopqrstuvwxyz-' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` if [ "$VAL" = "no" ]; then QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_$FEATURE" @@ -1502,9 +1502,6 @@ while [ "$#" -gt 0 ]; do else UNKNOWN_OPT=yes fi - else - UNKNOWN_OPT=yes - fi ;; shared) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then @@ -1658,6 +1655,20 @@ while [ "$#" -gt 0 ]; do # No longer supported: #[ "$VAL" = "no" ] && CFG_LIBPNG=no ;; + s60) + if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then + CFG_S60="$VAL" + else + UNKNOWN_OPT=yes + fi + ;; + usedeffiles) + if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then + CFG_SYMBIAN_DEFFILES="$VAL" + else + UNKNOWN_OPT=yes + fi + ;; sqlite) if [ "$VAL" = "system" ]; then CFG_SQLITE=system @@ -2171,6 +2182,7 @@ esac # where to find which.. unixtests="$relpath/config.tests/unix" mactests="$relpath/config.tests/mac" +symbiantests="$relpath/config.tests/symbian" WHICH="$unixtests/which.test" PERL=`$WHICH perl 2>/dev/null` @@ -3342,6 +3354,7 @@ Usage: $relconf [-h] [-prefix <dir>] [-prefix-install] [-bindir <dir>] [-libdir [-no-openssl] [-openssl] [-openssl-linked] [-no-gtkstyle] [-gtkstyle] [-no-svg] [-svg] [-no-webkit] [-webkit] [-no-javascript-jit] [-javascript-jit] [-no-script] [-script] [-no-scripttools] [-scripttools] [-no-declarative] [-declarative] + [-no-s60] [-s60] [-no-usedeffiles] [-usedeffiles] [additional platform specific options (see below)] @@ -3525,6 +3538,11 @@ EOF fi cat << EOF + -no-s60 ............ Do not compile in S60 support. + + -s60 ............... Compile with support for the S60 UI Framework. + -no-usedeffiles .... Disable the usage of DEF files. + * -usedeffiles ....... Enable the usage of DEF files. + -no-mmx ............ Do not compile with use of MMX instructions. -no-3dnow .......... Do not compile with use of 3DNOW instructions. -no-sse ............ Do not compile with use of SSE instructions. @@ -3988,7 +4006,7 @@ if [ "$PLATFORM_QWS" = "yes" ]; then Platform="Qt for Embedded Linux" elif [ "$PLATFORM_MAC" = "yes" ]; then Platform="Qt for Mac OS X" -else +elif [ '!' -z "`getQMakeConf \"$XQMAKESPEC\" | grep QMAKE_LIBS_X11 | awk '{print $3;}'`" ]; then PLATFORM_X11=yes Platform="Qt for Linux/X11" fi @@ -4612,6 +4630,22 @@ if [ "$CFG_ZLIB" = "auto" ]; then fi fi +if [ "$CFG_S60" = "auto" ]; then + if echo "$XQMAKESPEC" | grep symbian > /dev/null; then + CFG_S60=yes + else + CFG_S60=no + fi +fi + +if [ "$CFG_SYMBIAN_DEFFILES" = "auto" ]; then + if echo "$XQMAKESPEC" | grep symbian > /dev/null && [ "$CFG_DEV" = "no" ]; then + CFG_SYMBIAN_DEFFILES=yes + else + CFG_SYMBIAN_DEFFILES=no + fi +fi + # detect how jpeg should be built if [ "$CFG_JPEG" = "auto" ]; then if [ "$CFG_SHARED" = "yes" ]; then @@ -4890,6 +4924,14 @@ for _SQLDR in $CFG_SQL_AVAILABLE; do fi ;; sqlite) + if [ "$CFG_SQL_sqlite" = "auto" ]; then # the default + case "$XPLATFORM" in + symbian*) + # sqlite on symbian is typically not build in Qt but deployed as a pre-existing sis file. + CFG_SQL_sqlite=no + ;; + esac + fi if [ "$CFG_SQL_sqlite" != "no" ]; then SQLITE_AUTODETECT_FAILED="no" if [ "$CFG_SQLITE" = "system" ]; then @@ -5715,7 +5757,7 @@ if [ "$CFG_DOUBLEFORMAT" = "auto" ]; then fi HAVE_STL=no -if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/stl "STL" $L_FLAGS $I_FLAGS $l_FLAGS; then +if echo "$XQMAKESPEC" | grep symbian > /dev/null || "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/stl "STL" $L_FLAGS $I_FLAGS $l_FLAGS; then HAVE_STL=yes fi @@ -5849,23 +5891,6 @@ if [ "$CFG_GETIFADDRS" != "no" ]; then fi fi -# find if the platform supports X/Open Large File compilation environment -if [ "$CFG_LARGEFILE" != "no" ]; then - if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/largefile "X/Open Large File" $L_FLAGS $I_FLAGS $l_FLAGS; then - CFG_LARGEFILE=yes - else - if [ "$CFG_LARGEFILE" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then - echo "X/Open Large File support cannot be enabled due to functionality tests!" - echo " Turn on verbose messaging (-v) to $0 to see the final report." - echo " If you believe this message is in error you may use the continue" - echo " switch (-continue) to $0 to continue." - exit 101 - else - CFG_LARGEFILE=no - fi - fi -fi - # detect OpenSSL if [ "$CFG_OPENSSL" != "no" ]; then if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/openssl "OpenSSL" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then @@ -5977,6 +6002,14 @@ elif [ "$CFG_JAVASCRIPTCORE_JIT" = "no" ]; then QMakeVar set JAVASCRIPTCORE_JIT no fi +if [ "$CFG_AUDIO_BACKEND" = "auto" ]; then + if echo "$XQMAKESPEC" | grep symbian > /dev/null 2>&1; then + "$symbiantests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/symbian/audio "audio" $L_FLAGS $I_FLAGS $l_FLAGS + else + CFG_AUDIO_BACKEND=yes + fi +fi + #------------------------------------------------------------------------------- # ask for all that hasn't been auto-detected or specified in the arguments #------------------------------------------------------------------------------- @@ -6092,9 +6125,9 @@ case "$PLATFORM,$CFG_MAC_COCOA" in ;; esac -# disable Qt 3 support on VxWorks +# disable Qt 3 support on VxWorks and Symbian case "$XPLATFORM" in - unsupported/vxworks*) + unsupported/vxworks*|symbian*) CFG_QT3SUPPORT="no" ;; esac @@ -6148,6 +6181,13 @@ else fi fi +# Disable OpenGL on Symbian. +case "$XPLATFORM" in + symbian*) + CFG_OPENGL="no" + ;; +esac + # enable opengl if [ "$CFG_OPENGL" = "no" ]; then QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_OPENGL" @@ -6322,6 +6362,16 @@ elif [ "$CFG_ZLIB" = "system" ]; then QT_CONFIG="$QT_CONFIG system-zlib" fi +if [ "$CFG_S60" = "yes" ]; then + QT_CONFIG="$QT_CONFIG s60" +fi + +if [ "$CFG_SYMBIAN_DEFFILES" = "yes" ]; then + QMAKE_CONFIG="$QMAKE_CONFIG def_files" +else + QMAKE_CONFIG="$QMAKE_CONFIG def_files_disabled" +fi + [ "$CFG_NIS" = "yes" ] && QT_CONFIG="$QT_CONFIG nis" [ "$CFG_CUPS" = "yes" ] && QT_CONFIG="$QT_CONFIG cups" [ "$CFG_ICONV" = "yes" ] && QT_CONFIG="$QT_CONFIG iconv" @@ -7130,6 +7180,7 @@ QMakeVar set sql-plugins "$SQL_PLUGINS" [ "$CFG_JPEG" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_JPEG" [ "$CFG_MNG" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_MNG" [ "$CFG_ZLIB" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ZLIB" +[ "$CFG_S60" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_S60" [ "$CFG_EXCEPTIONS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_EXCEPTIONS" [ "$CFG_IPV6" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IPV6" [ "$CFG_SXE" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SXE" @@ -7186,6 +7237,15 @@ fi [ '!' -z "$AWK" ] && QCONFIG_FLAGS=`echo $QCONFIG_FLAGS | $AWK '{ gsub(" ", "\n"); print }' | sort | uniq` QCONFIG_FLAGS=`echo $QCONFIG_FLAGS` +if echo $XPLATFORM | grep symbian >/dev/null +then + # Enable Symbian DLLs and export rules. + # We cannot use Linux's default export rules since they export everything. + QCONFIG_FLAGS="$QCONFIG_FLAGS QT_DLL" + # Disable non-working features. + QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CONCURRENT QT_NO_QFUTURE QT_NO_CRASHHANDLER QT_NO_PRINTER QT_NO_CURSOR QT_NO_SYSTEMTRAYICON" +fi + if [ -n "$QCONFIG_FLAGS" ]; then for cfg in $QCONFIG_FLAGS; do cfgd=`echo $cfg | sed 's/=.*$//'` # trim pushed 'Foo=Bar' defines @@ -7557,9 +7617,11 @@ if [ "$CFG_WEBKIT" = "yes" ]; then fi fi echo "Declarative module ..... $CFG_DECLARATIVE" +echo "Support for S60 ........ $CFG_S60" +echo "Symbian DEF files ...... $CFG_SYMBIAN_DEFFILES" echo "STL support ............ $CFG_STL" echo "PCH support ............ $CFG_PRECOMPILE" -echo "MMX/3DNOW/SSE/SSE2 ..... ${CFG_MMX}/${CFG_3DNOW}/${CFG_SSE}/${CFG_SSE2}" +echo "MMX/3DNOW/SSE/SSE2...... ${CFG_MMX}/${CFG_3DNOW}/${CFG_SSE}/${CFG_SSE2}" if [ "$CFG_ARCH" = "arm" ] || [ "$CFG_ARCH" = "armv6" ]; then echo "iWMMXt support ......... ${CFG_IWMMXT}" echo "NEON support ........... ${CFG_NEON}" diff --git a/demos/demos.pro b/demos/demos.pro index 83e9355..013d40f 100644 --- a/demos/demos.pro +++ b/demos/demos.pro @@ -43,7 +43,7 @@ SUBDIRS += demos_boxes } mac*: SUBDIRS += demos_macmainwindow -wince*|symbian|embedded|x11: SUBDIRS += embedded +wince*|symbian|embedded|x11: SUBDIRS += demos_embedded !contains(QT_EDITION, Console):!cross_compile:!embedded:!wince*:SUBDIRS += demos_arthurplugin @@ -67,6 +67,9 @@ symbian: include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) demos_chip.subdir = chip demos_embeddeddialogs.subdir = embeddeddialogs +demos_embedded.subdir = embedded +# Because of fluidlauncher +demos_embedded.depends = demos_deform demos_pathstroke demos_shared.subdir = shared demos_deform.subdir = deform demos_gradients.subdir = gradients diff --git a/demos/embedded/anomaly/anomaly.pro b/demos/embedded/anomaly/anomaly.pro index e16ef66..584e5cd 100644 --- a/demos/embedded/anomaly/anomaly.pro +++ b/demos/embedded/anomaly/anomaly.pro @@ -26,7 +26,7 @@ RESOURCES += src/anomaly.qrc symbian { TARGET.UID3 = 0xA000CF71 include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) - HEADERS += $$QT_SOURCE_TREE/examples/network/qftp/sym_iap_util.h + INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/ LIBS += -lesock -lcommdb -linsock # For IAP selection TARGET.CAPABILITY = NetworkServices TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 diff --git a/demos/embedded/embedded.pro b/demos/embedded/embedded.pro index 5bd3276..da764d1 100644 --- a/demos/embedded/embedded.pro +++ b/demos/embedded/embedded.pro @@ -4,6 +4,8 @@ SUBDIRS = styledemo raycasting flickable digiflip contains(QT_CONFIG, svg) { SUBDIRS += embeddedsvgviewer \ desktopservices + fluidlauncher.subdir = fluidlauncher + fluidlauncher.depends = styledemo desktopservices raycasting flickable digiflip lightmaps flightinfo !vxworks:!qnx:SUBDIRS += fluidlauncher } diff --git a/demos/embedded/flightinfo/flightinfo.pro b/demos/embedded/flightinfo/flightinfo.pro index 7391f88..985cc42 100644 --- a/demos/embedded/flightinfo/flightinfo.pro +++ b/demos/embedded/flightinfo/flightinfo.pro @@ -8,7 +8,7 @@ QT += network symbian { TARGET.UID3 = 0xA000CF74 include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) - HEADERS += $$QT_SOURCE_TREE/examples/network/qftp/sym_iap_util.h + INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/ LIBS += -lesock -lcommdb -linsock # For IAP selection TARGET.CAPABILITY = NetworkServices } diff --git a/demos/embedded/fluidlauncher/fluidlauncher.pro b/demos/embedded/fluidlauncher/fluidlauncher.pro index f71388c..b2916d7 100644 --- a/demos/embedded/fluidlauncher/fluidlauncher.pro +++ b/demos/embedded/fluidlauncher/fluidlauncher.pro @@ -61,108 +61,124 @@ symbian { TARGET.UID3 = 0xA000A641 ICON = $$QT_SOURCE_TREE/src/s60installs/qt.svg + defineReplace(regResourceDir) { + symbian-abld|symbian-sbsv2 { + return($${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/$$basename(1)) + } else { + return($${QT_BUILD_TREE}/$$1) + } + } + + defineReplace(appResourceDir) { + symbian-abld|symbian-sbsv2 { + return($${EPOCROOT}$${HW_ZDIR}$${APP_RESOURCE_DIR}/$$basename(1)) + } else { + return($${QT_BUILD_TREE}/$$1) + } + } + executables.sources = \ - styledemo.exe \ - deform.exe \ - pathstroke.exe \ - wiggly.exe \ - qftp.exe \ - saxbookmarks.exe \ - desktopservices.exe \ - fridgemagnets.exe \ - softkeys.exe \ - raycasting.exe \ - flickable.exe \ - digiflip.exe \ - lightmaps.exe \ - flightinfo.exe + $$QT_BUILD_TREE/demos/embedded/styledemo/styledemo.exe \ + $$QT_BUILD_TREE/demos/deform/deform.exe \ + $$QT_BUILD_TREE/demos/pathstroke/pathstroke.exe \ + $$QT_BUILD_TREE/examples/widgets/wiggly/wiggly.exe \ + $$QT_BUILD_TREE/examples/network/qftp/qftp.exe \ + $$QT_BUILD_TREE/examples/xml/saxbookmarks/saxbookmarks.exe \ + $$QT_BUILD_TREE/demos/embedded/desktopservices/desktopservices.exe \ + $$QT_BUILD_TREE/examples/draganddrop/fridgemagnets/fridgemagnets.exe \ + $$QT_BUILD_TREE/examples/widgets/softkeys/softkeys.exe \ + $$QT_BUILD_TREE/demos/embedded/raycasting/raycasting.exe \ + $$QT_BUILD_TREE/demos/embedded/flickable/flickable.exe \ + $$QT_BUILD_TREE/demos/embedded/digiflip/digiflip.exe \ + $$QT_BUILD_TREE/demos/embedded/lightmaps/lightmaps.exe \ + $$QT_BUILD_TREE/demos/embedded/flightinfo/flightinfo.exe executables.path = /sys/bin reg_resource.sources = \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/styledemo_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/deform_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/pathstroke_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/wiggly_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/qftp_reg.rsc\ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/saxbookmarks_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/desktopservices_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/fridgemagnets_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/softkeys_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/raycasting_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/flickable_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/digiflip_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/lightmaps_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/flightinfo_reg.rsc + $$regResourceDir(demos/embedded/styledemo/styledemo_reg.rsc) \ + $$regResourceDir(demos/deform/deform_reg.rsc) \ + $$regResourceDir(demos/pathstroke/pathstroke_reg.rsc) \ + $$regResourceDir(examples/widgets/wiggly/wiggly_reg.rsc) \ + $$regResourceDir(examples/network/qftp/qftp_reg.rsc)\ + $$regResourceDir(examples/xml/saxbookmarks/saxbookmarks_reg.rsc) \ + $$regResourceDir(demos/embedded/desktopservices/desktopservices_reg.rsc) \ + $$regResourceDir(examples/draganddrop/fridgemagnets/fridgemagnets_reg.rsc) \ + $$regResourceDir(examples/widgets/softkeys/softkeys_reg.rsc) \ + $$regResourceDir(demos/embedded/raycasting/raycasting_reg.rsc) \ + $$regResourceDir(demos/embedded/flickable/flickable_reg.rsc) \ + $$regResourceDir(demos/embedded/digiflip/digiflip_reg.rsc) \ + $$regResourceDir(demos/embedded/lightmaps/lightmaps_reg.rsc) \ + $$regResourceDir(demos/embedded/flightinfo/flightinfo_reg.rsc) contains(QT_CONFIG, phonon) { - reg_resource.sources += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/qmediaplayer_reg.rsc + reg_resource.sources += $$regResourceDir(demos/qmediaplayer/qmediaplayer_reg.rsc) } reg_resource.path = $$REG_RESOURCE_IMPORT_DIR resource.sources = \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/styledemo.rsc \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/deform.rsc \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/pathstroke.rsc \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/wiggly.rsc \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/qftp.rsc\ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/saxbookmarks.rsc \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/desktopservices.rsc \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/fridgemagnets.rsc \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/softkeys.rsc \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/raycasting.rsc \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/flickable.rsc \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/digiflip.rsc \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/lightmaps.rsc \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/flightinfo.rsc + $$appResourceDir(demos/embedded/styledemo/styledemo.rsc) \ + $$appResourceDir(demos/deform/deform.rsc) \ + $$appResourceDir(demos/pathstroke/pathstroke.rsc) \ + $$appResourceDir(examples/widgets/wiggly/wiggly.rsc) \ + $$appResourceDir(examples/network/qftp/qftp.rsc)\ + $$appResourceDir(examples/xml/saxbookmarks/saxbookmarks.rsc) \ + $$appResourceDir(demos/embedded/desktopservices/desktopservices.rsc) \ + $$appResourceDir(examples/draganddrop/fridgemagnets/fridgemagnets.rsc) \ + $$appResourceDir(examples/widgets/softkeys/softkeys.rsc) \ + $$appResourceDir(demos/embedded/raycasting/raycasting.rsc) \ + $$appResourceDir(demos/embedded/flickable/flickable.rsc) \ + $$appResourceDir(demos/embedded/digiflip/digiflip.rsc) \ + $$appResourceDir(demos/embedded/lightmaps/lightmaps.rsc) \ + $$appResourceDir(demos/embedded/flightinfo/flightinfo.rsc) resource.path = $$APP_RESOURCE_DIR mifs.sources = \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/fluidlauncher.mif \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/styledemo.mif \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/deform.mif \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/pathstroke.mif \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/wiggly.mif \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/qftp.mif \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/saxbookmarks.mif \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/desktopservices.mif \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/fridgemagnets.mif \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/softkeys.mif \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/raycasting.mif \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/flickable.mif \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/digiflip.mif \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/lightmaps.mif \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/flightinfo.mif + $$appResourceDir(demos/embedded/fluidlauncher/fluidlauncher.mif) \ + $$appResourceDir(demos/embedded/styledemo/styledemo.mif) \ + $$appResourceDir(demos/deform/deform.mif) \ + $$appResourceDir(demos/pathstroke/pathstroke.mif) \ + $$appResourceDir(examples/widgets/wiggly/wiggly.mif) \ + $$appResourceDir(examples/network/qftp/qftp.mif) \ + $$appResourceDir(examples/xml/saxbookmarks/saxbookmarks.mif) \ + $$appResourceDir(demos/embedded/desktopservices/desktopservices.mif) \ + $$appResourceDir(examples/draganddrop/fridgemagnets/fridgemagnets.mif) \ + $$appResourceDir(examples/widgets/softkeys/softkeys.mif) \ + $$appResourceDir(demos/embedded/raycasting/raycasting.mif) \ + $$appResourceDir(demos/embedded/flickable/flickable.mif) \ + $$appResourceDir(demos/embedded/digiflip/digiflip.mif) \ + $$appResourceDir(demos/embedded/lightmaps/lightmaps.mif) \ + $$appResourceDir(demos/embedded/flightinfo/flightinfo.mif) mifs.path = $$APP_RESOURCE_DIR contains(QT_CONFIG, svg) { executables.sources += \ - embeddedsvgviewer.exe \ - weatherinfo.exe + $$QT_BUILD_TREE/demos/embedded/embeddedsvgviewer/embeddedsvgviewer.exe \ + $$QT_BUILD_TREE/demos/embedded/weatherinfo/weatherinfo.exe reg_resource.sources += \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/embeddedsvgviewer_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/weatherinfo_reg.rsc + $$regResourceDir(demos/embedded/embeddedsvgviewer/embeddedsvgviewer_reg.rsc) \ + $$regResourceDir(demos/embedded/weatherinfo/weatherinfo_reg.rsc) resource.sources += \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/embeddedsvgviewer.rsc \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/weatherinfo.rsc + $$appResourceDir(demos/embedded/embeddedsvgviewer/embeddedsvgviewer.rsc) \ + $$appResourceDir(demos/embedded/weatherinfo/weatherinfo.rsc) mifs.sources += \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/embeddedsvgviewer.mif \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/weatherinfo.mif + $$appResourceDir(demos/embedded/embeddedsvgviewer/embeddedsvgviewer.mif) \ + $$appResourceDir(demos/embedded/weatherinfo/weatherinfo.mif) } contains(QT_CONFIG, webkit) { - executables.sources += anomaly.exe - reg_resource.sources += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/anomaly_reg.rsc - resource.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/anomaly.rsc + executables.sources += $$QT_BUILD_TREE/demos/embedded/anomaly/anomaly.exe + reg_resource.sources += $$regResourceDir(demos/embedded/anomaly/anomaly_reg.rsc) + resource.sources += $$appResourceDir(demos/embedded/anomaly/anomaly.rsc) mifs.sources += \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/anomaly.mif + $$appResourceDir(demos/embedded/anomaly/anomaly.mif) # Since Fluidlauncher itself doesn't link webkit, we won't get dependency automatically executables.pkg_prerules += \ @@ -171,18 +187,18 @@ symbian { } contains(QT_CONFIG, phonon) { - executables.sources += qmediaplayer.exe - resource.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/qmediaplayer.rsc + executables.sources += $$QT_BUILD_TREE/demos/qmediaplayer/qmediaplayer.exe + resource.sources += $$appResourceDir(demos/qmediaplayer/qmediaplayer.rsc) mifs.sources += \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/qmediaplayer.mif + $$appResourceDir(demos/qmediaplayer/qmediaplayer.mif) } contains(QT_CONFIG, script) { - executables.sources += context2d.exe - reg_resource.sources += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/context2d_reg.rsc - resource.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/context2d.rsc + executables.sources += $$QT_BUILD_TREE/examples/script/context2d/context2d.exe + reg_resource.sources += $$regResourceDir(examples/script/context2d/context2d_reg.rsc) + resource.sources += $$appResourceDir(examples/script/context2d/context2d.rsc) mifs.sources += \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/context2d.mif + $$appResourceDir(examples/script/context2d/context2d.mif) } files.sources = $$PWD/screenshots $$PWD/slides diff --git a/demos/embedded/lightmaps/lightmaps.pro b/demos/embedded/lightmaps/lightmaps.pro index ef1a0a6..ee4cc5a 100644 --- a/demos/embedded/lightmaps/lightmaps.pro +++ b/demos/embedded/lightmaps/lightmaps.pro @@ -5,7 +5,7 @@ QT += network symbian { TARGET.UID3 = 0xA000CF75 include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) - HEADERS += $$QT_SOURCE_TREE/examples/network/qftp/sym_iap_util.h + INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/ LIBS += -lesock -lcommdb -linsock # For IAP selection TARGET.CAPABILITY = NetworkServices TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 diff --git a/demos/embedded/weatherinfo/weatherinfo.pro b/demos/embedded/weatherinfo/weatherinfo.pro index f007bbb..9addbbb 100644 --- a/demos/embedded/weatherinfo/weatherinfo.pro +++ b/demos/embedded/weatherinfo/weatherinfo.pro @@ -7,7 +7,7 @@ QT += network svg symbian { TARGET.UID3 = 0xA000CF77 include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) - HEADERS += $$QT_SOURCE_TREE/examples/network/qftp/sym_iap_util.h + INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/ LIBS += -lesock -lcommdb -linsock # For IAP selection TARGET.CAPABILITY = NetworkServices } diff --git a/demos/shared/shared.pri b/demos/shared/shared.pri index 1541fa7..fb7b04c 100644 --- a/demos/shared/shared.pri +++ b/demos/shared/shared.pri @@ -6,12 +6,12 @@ build_all:!build_pass { } contains(CONFIG, debug_and_release_target) { CONFIG(debug, debug|release) { - LIBS+=-L$$SHARED_FOLDER/debug + QMAKE_LIBDIR += $$SHARED_FOLDER/debug } else { - LIBS+=-L$$SHARED_FOLDER/release + QMAKE_LIBDIR += $$SHARED_FOLDER/release } } else { - LIBS += -L$$SHARED_FOLDER + QMAKE_LIBDIR += $$SHARED_FOLDER } hpux-acc*:LIBS += $$SHARED_FOLDER/libdemo_shared.a diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index 8e1d970..8cb8705 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -1329,9 +1329,13 @@ \target DEF_FILE \section1 DEF_FILE - \e {This is only used on Windows when using the \c app template}. + \e {This is only used on Windows when using the \c app template, + and on Symbian when building a shared DLL}. - Specifies a \c .def file to be included in the project. + Specifies a \c .def file to be included in the project. On Symbian + a directory may be specified instead, in which case the real files + will be located under the standard Symbian directories \c bwins and + \c eabi. \target DEPENDPATH \section1 DEPENDPATH @@ -2601,7 +2605,7 @@ For example: \section1 QMAKE_LIBS_THREAD - \e {This is used on Unix platforms only.} + \e {This is used on Unix and Symbian platforms only.} This variable contains all libraries that need to be linked against when building a multi-threaded application. The diff --git a/examples/graphicsview/padnavigator/padnavigator.qrc b/examples/graphicsview/padnavigator/padnavigator.qrc index 30ee8e1..b26ab92 100644 --- a/examples/graphicsview/padnavigator/padnavigator.qrc +++ b/examples/graphicsview/padnavigator/padnavigator.qrc @@ -9,6 +9,5 @@ <file>images/kopeteavailable.png</file> <file>images/metacontact_online.png</file> <file>images/minitools.png</file> - <file>images/blue_angle_swirl.jpg</file> </qresource> </RCC> diff --git a/examples/network/fortuneclient/fortuneclient.pro b/examples/network/fortuneclient/fortuneclient.pro index 2b65f2f..edbf14d 100644 --- a/examples/network/fortuneclient/fortuneclient.pro +++ b/examples/network/fortuneclient/fortuneclient.pro @@ -11,7 +11,7 @@ INSTALLS += target sources symbian { include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) - HEADERS += $$QT_SOURCE_TREE/examples/network/qftp/sym_iap_util.h + INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/ LIBS += -lesock -lcommdb -linsock # For IAP selection TARGET.CAPABILITY = "NetworkServices ReadUserData WriteUserData" TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 diff --git a/examples/network/fortuneserver/fortuneserver.pro b/examples/network/fortuneserver/fortuneserver.pro index acb285b..29ba313 100644 --- a/examples/network/fortuneserver/fortuneserver.pro +++ b/examples/network/fortuneserver/fortuneserver.pro @@ -12,7 +12,7 @@ INSTALLS += target sources symbian { TARGET.UID3 = 0xA000CF71 include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) - HEADERS += $$QT_SOURCE_TREE/examples/network/qftp/sym_iap_util.h + INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/ LIBS += -lesock -lcommdb -linsock # For IAP selection TARGET.CAPABILITY = "All -TCB" TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 diff --git a/examples/network/network-chat/network-chat.pro b/examples/network/network-chat/network-chat.pro index 7438641..1215aea 100644 --- a/examples/network/network-chat/network-chat.pro +++ b/examples/network/network-chat/network-chat.pro @@ -20,7 +20,7 @@ INSTALLS += target sources symbian { include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) - HEADERS += $$QT_SOURCE_TREE/examples/network/qftp/sym_iap_util.h + INCLUDEPATH += $$QT_SOURCE_TREE/examples/network/qftp/ LIBS += -lesock -lcommdb -linsock # For IAP selection LIBS += -lcharconv TARGET.CAPABILITY = "NetworkServices ReadUserData WriteUserData" diff --git a/imports/Qt/.gitignore b/imports/Qt/.gitignore new file mode 100644 index 0000000..bc54bd5 --- /dev/null +++ b/imports/Qt/.gitignore @@ -0,0 +1,2 @@ +*.dll +*.dso diff --git a/mkspecs/common/armcc.conf b/mkspecs/common/armcc.conf new file mode 100644 index 0000000..2c765bc --- /dev/null +++ b/mkspecs/common/armcc.conf @@ -0,0 +1,41 @@ +# +# qmake configuration for armcc +# + +CONFIG += rvct_linker +QMAKE_CC = armcc +QMAKE_CFLAGS += +QMAKE_CFLAGS_DEPS += -M +QMAKE_CFLAGS_WARN_ON += +QMAKE_CFLAGS_WARN_OFF += -W +QMAKE_CFLAGS_RELEASE += -O2 +QMAKE_CFLAGS_DEBUG += -g -O0 +QMAKE_CFLAGS_HIDESYMS += --visibility_inlines_hidden + +QMAKE_CXX = armcc +QMAKE_CXXFLAGS += $$QMAKE_CFLAGS --exceptions --exceptions_unwind +QMAKE_CXXFLAGS_DEPS += $$QMAKE_CFLAGS_DEPS +QMAKE_CXXFLAGS_WARN_ON += $$QMAKE_CFLAGS_WARN_ON +QMAKE_CXXFLAGS_WARN_OFF += $$QMAKE_CFLAGS_WARN_OFF +QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE +QMAKE_CXXFLAGS_DEBUG += $$QMAKE_CFLAGS_DEBUG +QMAKE_CXXFLAGS_SHLIB += $$QMAKE_CFLAGS_SHLIB +QMAKE_CXXFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_STATIC_LIB +QMAKE_CXXFLAGS_YACC += $$QMAKE_CFLAGS_YACC +QMAKE_CXXFLAGS_HIDESYMS += $$QMAKE_CFLAGS_HIDESYMS + +QMAKE_LINK = armlink +QMAKE_LINK_SHLIB = armlink +QMAKE_LINK_C = armlink +QMAKE_LINK_C_SHLIB = armlink +QMAKE_LFLAGS += +QMAKE_LFLAGS_RELEASE += +QMAKE_LFLAGS_DEBUG += +QMAKE_LFLAGS_APP += +QMAKE_LFLAGS_SHLIB += +QMAKE_LFLAGS_PLUGIN += $$QMAKE_LFLAGS_SHLIB +QMAKE_LFLAGS_THREAD += + +QMAKE_AR = armar --create +QMAKE_RANLIB = + diff --git a/mkspecs/common/symbian/qplatformdefs.h b/mkspecs/common/symbian/qplatformdefs.h index 38a1314..2b075ba 100644 --- a/mkspecs/common/symbian/qplatformdefs.h +++ b/mkspecs/common/symbian/qplatformdefs.h @@ -85,6 +85,8 @@ #include <arpa/inet.h> #define QT_USE_XOPEN_LFS_EXTENSIONS +// unset large file as symbian doesn't support it +#undef QT_LARGEFILE_SUPPORT #include "../posix/qplatformdefs.h" #undef QT_OPEN_LARGEFILE diff --git a/mkspecs/common/symbian/symbian-makefile.conf b/mkspecs/common/symbian/symbian-makefile.conf new file mode 100644 index 0000000..3801eff --- /dev/null +++ b/mkspecs/common/symbian/symbian-makefile.conf @@ -0,0 +1,45 @@ +# +# qmake configuration for makefile based symbian +# + +MAKEFILE_GENERATOR = SYMBIAN_UNIX + +include(symbian.conf) + +QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] + +QMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -o $obj $src +QMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< +QMAKE_RUN_CXX = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $obj $src +QMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +QMAKE_ELF2E32_FLAGS += + +include(../../common/unix.conf) + +QMAKE_PREFIX_SHLIB = +QMAKE_EXTENSION_SHLIB = dll +CONFIG *= no_plugin_name_prefix +QMAKE_EXTENSION_PLUGIN = dll +QMAKE_PREFIX_STATICLIB = +QMAKE_EXTENSION_STATICLIB = lib +QMAKE_SYMBIAN_SHLIB = 1 + +DEFINES *= __PRODUCT_INCLUDE__=\<$${EPOCROOT}epoc32/include/variant/symbian_os.hrh\> \ + __SYMBIAN32__ \ + __MARM_INTERWORK__ \ + _UNICODE \ + __S60_50__ \ + __S60_3X__ \ + __SERIES60_3X__ \ + __EPOC32__ \ + __MARM__ \ + __EABI__ \ + __MARM_ARMV5__ \ + __SUPPORT_CPP_EXCEPTIONS__ + +QMAKE_CFLAGS_DEBUG += -g +QMAKE_CXXFLAGS_DEBUG += -g +QMAKE_CFLAGS_RELEASE += -O2 -Otime +QMAKE_CXXFLAGS_RELEASE += -O2 -Otime + diff --git a/mkspecs/common/symbian/symbian-mmp.conf b/mkspecs/common/symbian/symbian-mmp.conf new file mode 100644 index 0000000..e54e878 --- /dev/null +++ b/mkspecs/common/symbian/symbian-mmp.conf @@ -0,0 +1,76 @@ +# +# qmake configuration for symbian-* +# + +contains(QMAKE_HOST.os, "Windows") { + QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe + QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic.exe + QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe +} else { + QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc + QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic + QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc +} + +include(symbian.conf) +load(symbian/add_mmp_rules) + +symbian-abld { +# Versions of abld prior to Symbian^3 have a bug where you cannot remove something from the command line without replacing it +# Rather than figure out which version of abld we're using, we'll replace the command with a macro *that should never be used* + MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA = "OPTION_REPLACE ARMCC --export_all_vtbl -D__QT_NOEFFECTMACRO_DONOTUSE" +} else { + MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA = "OPTION_REPLACE ARMCC --export_all_vtbl // don't use --export_all_vtbl" +} +MMP_RULES += PAGED BYTEPAIRCOMPRESSTARGET +MMP_RULES += $$MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA +SYMBIAN_PLATFORMS = WINSCW GCCE ARMV5 ARMV6 + +INCLUDEPATH = \ + $$[QT_INSTALL_PREFIX]/mkspecs/common/symbian/stl-off \ + $$[QT_INSTALL_PREFIX]/mkspecs/common/symbian \ + $${EPOCROOT}epoc32/include \ + $$OS_LAYER_LIBC_SYSTEMINCLUDE \ + $$INCLUDEPATH + +# Ensure '.' directory is the first in include path. +# RVCT seems to do this automatically, but WINSCW compiler does not, so add it here. +MMP_RULES += "USERINCLUDE ." + +# Supports S60 3.0, 3.1, 3.2 and 5.0 by default +default_deployment.pkg_prerules = \ + "; Default HW/platform dependencies" \ + "[0x101F7961],0,0,0,{\"S60ProductID\"}" \ + "[0x102032BE],0,0,0,{\"S60ProductID\"}" \ + "[0x102752AE],0,0,0,{\"S60ProductID\"}" \ + "[0x1028315F],0,0,0,{\"S60ProductID\"}" \ + " " + +DEPLOYMENT += default_deployment + +exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/series60v5.0.sis )|exists($${EPOCROOT}epoc32/data/z/system/install/series60v5.0.sis) { + S60_VERSION = 5.0 +} else { + exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/series60v3.2.sis )|exists($${EPOCROOT}epoc32/data/z/system/install/series60v3.2.sis) { + S60_VERSION = 3.2 + } else { + S60_VERSION = 3.1 + MMP_RULES -= PAGED BYTEPAIRCOMPRESSTARGET + } +} + +QMAKE_CXXFLAGS_FAST_VFP.ARMCC = --fpmode fast +# [TODO] QMAKE_CXXFLAGS_FAST_VFP.GCCE = + +symbian { + armfpu = $$find(MMP_RULES, "ARMFPU") + !isEmpty(armfpu) { + vfpv2 = $$find(MMP_RULES, "vfpv2") + !isEmpty(vfpv2) { + # we will respect fpu setting obtained from configure, but, + # if vfpv2 or softvfp+vfpv2 used we want to force RunFast VFP mode + QMAKE_CXXFLAGS.ARMCC += $${QMAKE_CXXFLAGS_FAST_VFP.ARMCC} + # [TODO] QMAKE_CXXFLAGS.GCCE += $${QMAKE_CXXFLAGS_FAST_VFP.GCCE} + } + } +} diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index b42ab6a..e42a705 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -1,9 +1,9 @@ # -# qmake configuration for symbian-* +# qmake configuration for all symbian mkspecs # TEMPLATE = app -CONFIG += qt warn_on release incremental +CONFIG += qt warn_on release incremental link_prl sis_targets QT += core gui QMAKE_INCREMENTAL_STYLE = sublib @@ -13,7 +13,6 @@ QMAKE_COMPILER_DEFINES += SYMBIAN QMAKE_EXT_OBJ = .o QMAKE_EXT_RES = _res.o -QMAKE_CC = gcc QMAKE_LEX = flex QMAKE_LEXFLAGS = QMAKE_YACC = byacc @@ -26,7 +25,6 @@ QMAKE_CFLAGS_RELEASE = QMAKE_CFLAGS_DEBUG = QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses -QMAKE_CXX = g++ QMAKE_CXXFLAGS = $$QMAKE_CFLAGS # Symbian build system applies -cwd source on the MWCC command line. # this causes problems with include paths, -cwd include uses the same @@ -51,12 +49,6 @@ QMAKE_CXXFLAGS_EXCEPTIONS_OFF = QMAKE_INCDIR = QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] -QMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -o $obj $src -QMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< -QMAKE_RUN_CXX = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $obj $src -QMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< - -QMAKE_LINK = QMAKE_LFLAGS = QMAKE_LFLAGS.ARMCC = QMAKE_LFLAGS_EXCEPTIONS_ON = @@ -70,12 +62,13 @@ QMAKE_LINK_OBJECT_MAX = QMAKE_LINK_OBJECT_SCRIPT= QMAKE_LIBS = -llibc -llibm -leuser -llibdl -QMAKE_LIBS_CORE = $$QMAKE_LIBS -llibpthread -lefsrv +QMAKE_LIBS_CORE = $$QMAKE_LIBS -lefsrv QMAKE_LIBS_GUI = $$QMAKE_LIBS_CORE -lfbscli -lbitgdi -lhal -lgdi -lws32 -lapgrfx -lcone -leikcore -lmediaclientaudio -leikcoctl -leiksrv -lapparc -lcentralrepository QMAKE_LIBS_NETWORK = QMAKE_LIBS_EGL = -llibEGL QMAKE_LIBS_OPENGL = QMAKE_LIBS_OPENVG = -llibOpenVG -lgraphicsresource -lfbscli -lbitgdi -lgdi +QMAKE_LIBS_THREAD = -llibpthread QMAKE_LIBS_COMPAT = QMAKE_LIBS_QT_ENTRY = -llibcrt0.lib QMAKE_LIBS_S60 = -lavkon @@ -100,84 +93,15 @@ contains(QMAKE_HOST.os,Windows) { QMAKE_CHK_DIR_EXISTS = test -d } -contains(QMAKE_HOST.os, "Windows") { - QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe - QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic.exe - QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe -} else { - QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc - QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic - QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc -} +QMAKE_IDL = midl +QMAKE_LIB = ar -ru +QMAKE_RC = windres +QMAKE_ZIP = zip -r -9 -QMAKE_IDL = midl -QMAKE_LIB = ar -ru -QMAKE_RC = windres -QMAKE_ZIP = zip -r -9 +QMAKE_TAR = tar -cf +QMAKE_GZIP = gzip -9f -QMAKE_STRIP = strip -QMAKE_STRIPFLAGS_LIB += --strip-unneeded +QT_ARCH = symbian load(qt_config) load(symbian/platform_paths) -load(symbian/add_mmp_rules) - -symbian-abld { -# Versions of abld prior to Symbian^3 have a bug where you cannot remove something from the command line without replacing it -# Rather than figure out which version of abld we're using, we'll replace the command with a macro *that should never be used* - MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA = "OPTION_REPLACE ARMCC --export_all_vtbl -D__QT_NOEFFECTMACRO_DONOTUSE" -} else { - MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA = "OPTION_REPLACE ARMCC --export_all_vtbl // don't use --export_all_vtbl" -} -MMP_RULES += PAGED BYTEPAIRCOMPRESSTARGET -MMP_RULES += $$MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA -SYMBIAN_PLATFORMS = WINSCW GCCE ARMV5 ARMV6 - -INCLUDEPATH = \ - $$[QT_INSTALL_PREFIX]/mkspecs/common/symbian/stl-off \ - $$[QT_INSTALL_PREFIX]/mkspecs/common/symbian \ - $${EPOCROOT}epoc32/include \ - $$OS_LAYER_LIBC_SYSTEMINCLUDE \ - $$INCLUDEPATH - -# Ensure '.' directory is the first in include path. -# RVCT seems to do this automatically, but WINSCW compiler does not, so add it here. -MMP_RULES += "USERINCLUDE ." - -# Supports S60 3.0, 3.1, 3.2 and 5.0 by default -default_deployment.pkg_prerules = \ - "; Default HW/platform dependencies" \ - "[0x101F7961],0,0,0,{\"S60ProductID\"}" \ - "[0x102032BE],0,0,0,{\"S60ProductID\"}" \ - "[0x102752AE],0,0,0,{\"S60ProductID\"}" \ - "[0x1028315F],0,0,0,{\"S60ProductID\"}" \ - " " - -DEPLOYMENT += default_deployment - -exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/series60v5.0.sis )|exists($${EPOCROOT}epoc32/data/z/system/install/series60v5.0.sis) { - S60_VERSION = 5.0 -} else { - exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/series60v3.2.sis )|exists($${EPOCROOT}epoc32/data/z/system/install/series60v3.2.sis) { - S60_VERSION = 3.2 - } else { - S60_VERSION = 3.1 - MMP_RULES -= PAGED BYTEPAIRCOMPRESSTARGET - } -} - -QMAKE_CXXFLAGS_FAST_VFP.ARMCC = --fpmode fast -# [TODO] QMAKE_CXXFLAGS_FAST_VFP.GCCE = - -symbian { - armfpu = $$find(MMP_RULES, "ARMFPU") - !isEmpty(armfpu) { - vfpv2 = $$find(MMP_RULES, "vfpv2") - !isEmpty(vfpv2) { - # we will respect fpu setting obtained from configure, but, - # if vfpv2 or softvfp+vfpv2 used we want to force RunFast VFP mode - QMAKE_CXXFLAGS.ARMCC += $${QMAKE_CXXFLAGS_FAST_VFP.ARMCC} - # [TODO] QMAKE_CXXFLAGS.GCCE += $${QMAKE_CXXFLAGS_FAST_VFP.GCCE} - } - } -} diff --git a/mkspecs/common/unix.conf b/mkspecs/common/unix.conf index 4cb171e..c480ba4 100644 --- a/mkspecs/common/unix.conf +++ b/mkspecs/common/unix.conf @@ -9,3 +9,6 @@ QMAKE_YACCFLAGS += -d QMAKE_YACCFLAGS_MANGLE += -p $base -b $base QMAKE_YACC_HEADER = $base.tab.h QMAKE_YACC_SOURCE = $base.tab.c +QMAKE_PREFIX_SHLIB = lib +QMAKE_PREFIX_STATICLIB = lib +QMAKE_EXTENSION_STATICLIB = a diff --git a/mkspecs/features/sis_targets.prf b/mkspecs/features/sis_targets.prf new file mode 100644 index 0000000..66a7a9d --- /dev/null +++ b/mkspecs/features/sis_targets.prf @@ -0,0 +1,139 @@ +# Sis file creation +contains(TEMPLATE, app)|!isEmpty(DEPLOYMENT) { + symbian-abld|symbian-sbsv2 { + sis_destdir = + make_cache_name = .make.cache + sis_target.target = sis + sis_target.commands = $(if $(wildcard $$basename(TARGET)_template.pkg), \ + $(if $(wildcard $$make_cache_name), \ + $(MAKE) -f $(MAKEFILE) ok_sis MAKEFILES=$$make_cache_name \ + , \ + $(if $(QT_SIS_TARGET), \ + $(MAKE) -f $(MAKEFILE) ok_sis \ + , \ + $(MAKE) -f $(MAKEFILE) fail_sis_nocache \ + ) \ + ) \ + , \ + $(MAKE) -f $(MAKEFILE) fail_sis_nopkg \ + ) + + ok_sis_target.target = ok_sis + ok_sis_target.commands = createpackage.bat $(QT_SIS_OPTIONS) $$basename(TARGET)_template.pkg \ + $(QT_SIS_TARGET) $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE) + + target_sis_target.target = $${sis_destdir}$${TARGET}.sis + target_sis_target.commands = $(MAKE) -f $(MAKEFILE) sis + + installer_sis_target.target = installer_sis + installer_sis_target.commands = $(if $(wildcard $$basename(TARGET)_installer.pkg), \ + $(MAKE) -f $(MAKEFILE) ok_installer_sis \ + , \ + $(MAKE) -f $(MAKEFILE) fail_sis_nopkg \ + ) + installer_sis_target.depends = $${sis_destdir}$${TARGET}.sis + + ok_installer_sis_target.target = ok_installer_sis + ok_installer_sis_target.commands = createpackage.bat $(QT_SIS_OPTIONS) $$basename(TARGET)_installer.pkg - \ + $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE) + + fail_sis_nopkg_target.target = fail_sis_nopkg + fail_sis_nopkg_target.commands = "$(error PKG file does not exist, 'sis' and 'installer_sis' target are only supported for executables or projects with DEPLOYMENT statement)" + + fail_sis_nocache_target.target = fail_sis_nocache + fail_sis_nocache_target.commands = "$(error Project has to be built or QT_SIS_TARGET environment variable has to be set before calling 'SIS' target)" + + stub_sis_target.target = stub_sis + stub_sis_target.commands = $(if $(wildcard $$basename(TARGET)_template.pkg), \ + $(if $(wildcard $$make_cache_name), \ + $(MAKE) -f $(MAKEFILE) ok_stub_sis MAKEFILES=$$make_cache_name \ + , \ + $(if $(QT_SIS_TARGET), \ + $(MAKE) -f $(MAKEFILE) ok_stub_sis \ + , \ + $(MAKE) -f $(MAKEFILE) fail_sis_nocache \ + ) \ + ) \ + , \ + $(MAKE) -f $(MAKEFILE) fail_sis_nopkg \ + ) + + ok_stub_sis_target.target = ok_stub_sis + ok_stub_sis_target.commands = createpackage.bat -s $(QT_SIS_OPTIONS) $$basename(TARGET)_template.pkg \ + $(QT_SIS_TARGET) $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE) + + QMAKE_EXTRA_TARGETS += sis_target \ + ok_sis_target \ + target_sis_target \ + installer_sis_target \ + ok_installer_sis_target \ + fail_sis_nopkg_target \ + fail_sis_nocache_target \ + stub_sis_target \ + ok_stub_sis_target + # Sbsv2 has its own store_build target which is using flms. + !symbian-sbsv2 { + contains(QMAKE_HOST.os, "Windows") { + shellFixedHash = $${LITERAL_HASH} + } else { + shellFixedHash = \\$${LITERAL_HASH} + } + store_build_target.target = store_build + store_build_target.commands = \ + @echo $${shellFixedHash} ============================================================================== > $$make_cache_name \ + && echo $${shellFixedHash} This file is generated by make and should not be modified by the user >> $$make_cache_name \ + && echo $${shellFixedHash} Name : $$make_cache_name >> $$make_cache_name \ + && echo $${shellFixedHash} Part of : lineedits >> $$make_cache_name \ + && echo $${shellFixedHash} Description : This file is used to cache last build target for >> $$make_cache_name \ + && echo $${shellFixedHash} make sis target. >> $$make_cache_name \ + && echo $${shellFixedHash} Version : >> $$make_cache_name \ + && echo $${shellFixedHash} >> $$make_cache_name \ + && echo $${shellFixedHash} ============================================================================== >> $$make_cache_name \ + && echo. >> $$make_cache_name \ + && echo QT_SIS_TARGET ?= $(QT_SIS_TARGET) >> $$make_cache_name + + QMAKE_EXTRA_TARGETS += store_build_target + } + } else { + sis_destdir = $$DESTDIR + !isEmpty(sis_destdir):!contains(sis_destdir, "[/\\]$"):sis_destdir = $${sis_destdir}/ + contains(QMAKE_HOST.os, "Windows"):sis_destdir = $$replace(sis_destdir, "/", "\\") + + sis_target.target = sis + sis_target.commands = createpackage $(QT_SIS_OPTIONS) $$basename(TARGET)_template.pkg \ + - $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE) + sis_target.depends = first + + target_sis_target.target = $${sis_destdir}$${TARGET}.sis + target_sis_target.commands = $(MAKE) -f $(MAKEFILE) sis + + installer_sis_target.target = installer_sis + installer_sis_target.commands = createpackage $(QT_SIS_OPTIONS) $$basename(TARGET)_installer.pkg - \ + $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE) + installer_sis_target.depends = $${sis_destdir}$${TARGET}.sis + + !isEmpty(DESTDIR) { + sis_target.commands += && $$QMAKE_MOVE $$basename(TARGET).sis $$DESTDIR + installer_sis_target.commands += && $$QMAKE_MOVE $$basename(TARGET).sis $$DESTDIR + } + + QMAKE_EXTRA_TARGETS += sis_target \ + target_sis_target \ + installer_sis_target + } +} else { + contains(TEMPLATE, subdirs) { + # Enable recursive sis target. + sis_target.CONFIG = recursive + sis_target.recurse = $$SUBDIRS + } else { + # Make sure we build everything, since other sis targets in a recursive invocation + # may depend on them, even if this one is empty. + sis_target.depends = first + } + sis_target.commands = + sis_target.target = sis + QMAKE_EXTRA_TARGETS += sis_target +} + +QMAKE_DISTCLEAN += $${sis_destdir}$${TARGET}.sis diff --git a/mkspecs/features/symbian/application_icon.prf b/mkspecs/features/symbian/application_icon.prf index ebef8b2..04560c5 100644 --- a/mkspecs/features/symbian/application_icon.prf +++ b/mkspecs/features/symbian/application_icon.prf @@ -15,36 +15,48 @@ contains( CONFIG, no_icon ) { } # Try to produce indentical string to fixedTarget in SymbianMakefileGenerator, replaced chars taken - # from SymbianMakefileGenerator::removeSpecialCharacters. + # from SymbianCommonGenerator::removeSpecialCharacters. # # Note: it is not a major problem even baseTarget is not 100% identical to fixedTarget since qmake # only uses filename from RSS_RULES.icon_file when referring to icon file name. baseTarget = $$basename(TARGET) baseTarget = $$replace(baseTarget, /,_) baseTarget = $$replace(baseTarget, \\,_) - baseTarget = $$replace(baseTarget, -,_) - baseTarget = $$replace(baseTarget, :,_) - baseTarget = $$replace(baseTarget, \.,_) baseTarget = $$replace(baseTarget, " ",_) + symbian-abld|symbian-sbsv2 { + baseTarget = $$replace(baseTarget, -,_) + baseTarget = $$replace(baseTarget, \.,_) + baseTarget = $$replace(baseTarget, :,_) + } # Note: symbian-sbsv2 builds can't utilize extra compiler for mifconv, so ICON handling is done in code - symbian-abld { + !symbian-sbsv2 { #Makefile: requires paths with backslash - contains(QMAKE_HOST.os, "Windows"):ICON = $$replace(ICON, /, \\) + ICON_backslashed = $$replace( ICON, /, \\) + + symbian-abld { + mifIconZDir = ${ZDIR}$$APP_RESOURCE_DIR + } else { + isEmpty(DESTDIR) { + mifIconZDir = . + } else { + mifIconZDir = $$DESTDIR + } + } # Extra compiler rules for mifconv - mifconv.output = ${ZDIR}$$APP_RESOURCE_DIR/$${baseTarget}.mif + mifconv.output = $$mifIconZDir/$${baseTarget}.mif # Based on: http://www.forum.nokia.com/document/Cpp_Developers_Library # svg-t icons should always use /c32 depth mifconv.commands = mifconv ${QMAKE_FILE_OUT} /c32 ${QMAKE_FILE_IN} - mifconv.input = ICON + mifconv.input = ICON_backslashed mifconv.CONFIG = no_link combine # target_predeps together with combine seems not to work correctly, lets define it by ourselves PRE_TARGETDEPS += $$mifconv.output QMAKE_EXTRA_COMPILERS += mifconv } # Rules to use generated MIF file from symbian resources - RSS_RULES.number_of_icons = $$size(ICON) + RSS_RULES.number_of_icons = $$size(ICON_backslashed) RSS_RULES.icon_file = $$APP_RESOURCE_DIR/$${baseTarget}.mif } } diff --git a/mkspecs/features/symbian/debug.prf b/mkspecs/features/symbian/debug.prf new file mode 100644 index 0000000..b5afeb6 --- /dev/null +++ b/mkspecs/features/symbian/debug.prf @@ -0,0 +1 @@ +QMAKE_LIBDIR += $${EPOCROOT}epoc32/release/armv5/udeb diff --git a/mkspecs/features/symbian/def_files.prf b/mkspecs/features/symbian/def_files.prf index 48d91aa..a1f0c8d 100644 --- a/mkspecs/features/symbian/def_files.prf +++ b/mkspecs/features/symbian/def_files.prf @@ -3,32 +3,75 @@ CONFIG -= def_files_disabled -# Firstly, if the MMP_RULES already contain a defBlock variable, don't generate another one -# (this bit is slightly magic, because it depends upon everyone creating their DEFFILE statements -# in a defBlock variable; but otherwise we have to expand MMP_RULES then scan for the DEFFILE keyword) -!contains(MMP_RULES, defBlock) { - # Apps are executables on Symbian, so don't have exports, and therefore don't have DEF files - # Plugins use standard DEF files, which qmake generates, so shouldn't be using these DEFFILE - # statements - they use the qmake generated statements instead - # Static libraries obviously don't have DEF files, as they don't take part in dynamic linkage - !contains(TEMPLATE, app):!contains(CONFIG, plugin):!contains(CONFIG, staticlib): { - !isEmpty(defFilePath) { - defBlock = \ - "$${LITERAL_HASH}ifdef WINSCW" \ - "DEFFILE $$defFilePath/bwins/$${TARGET}.def" \ - "$${LITERAL_HASH}elif defined EABI" \ - "DEFFILE $$defFilePath/eabi/$${TARGET}.def" \ - "$${LITERAL_HASH}endif" - } else { - # If defFilePath is not defined, then put the folders containing the DEF files at the - # same level as the .pro (and generated MMP) file(s) - defBlock = \ - "$${LITERAL_HASH}ifdef WINSCW" \ - "DEFFILE ./bwins/$${TARGET}.def" \ - "$${LITERAL_HASH}elif defined EABI" \ - "DEFFILE ./eabi/$${TARGET}.def" \ - "$${LITERAL_HASH}endif" +symbian-abld|symbian-sbsv2 { + # Firstly, if the MMP_RULES already contain a defBlock variable, don't generate another one + # (this bit is slightly magic, because it depends upon everyone creating their DEFFILE statements + # in a defBlock variable; but otherwise we have to expand MMP_RULES then scan for the DEFFILE keyword) + !contains(MMP_RULES, defBlock) { + # Apps are executables on Symbian, so don't have exports, and therefore don't have DEF files + # Plugins use standard DEF files, which qmake generates, so shouldn't be using these DEFFILE + # statements - they use the qmake generated statements instead + # Static libraries obviously don't have DEF files, as they don't take part in dynamic linkage + !contains(TEMPLATE, app):!contains(CONFIG, plugin):!contains(CONFIG, staticlib): { + !isEmpty(DEF_FILE) { + defBlock = \ + "$${LITERAL_HASH}ifdef WINSCW" \ + "DEFFILE $$DEF_FILE/bwins/$${TARGET}.def" \ + "$${LITERAL_HASH}elif defined EABI" \ + "DEFFILE $$DEF_FILE/eabi/$${TARGET}.def" \ + "$${LITERAL_HASH}endif" + } else:!isEmpty(defFilePath) { + defBlock = \ + "$${LITERAL_HASH}ifdef WINSCW" \ + "DEFFILE $$defFilePath/bwins/$${TARGET}.def" \ + "$${LITERAL_HASH}elif defined EABI" \ + "DEFFILE $$defFilePath/eabi/$${TARGET}.def" \ + "$${LITERAL_HASH}endif" + } else { + # If defFilePath is not defined, then put the folders containing the DEF files at the + # same level as the .pro (and generated MMP) file(s) + defBlock = \ + "$${LITERAL_HASH}ifdef WINSCW" \ + "DEFFILE ./bwins/$${TARGET}.def" \ + "$${LITERAL_HASH}elif defined EABI" \ + "DEFFILE ./eabi/$${TARGET}.def" \ + "$${LITERAL_HASH}endif" + } + MMP_RULES += defBlock } - MMP_RULES += defBlock } + +} else:contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) { + !isEmpty(DEF_FILE) { + defFile = $$DEF_FILE + } else { + defFile = . + } + system("$$QMAKE_CHK_DIR_EXISTS $$_PRO_FILE_PWD_/$$defFile") { + !exists("$$_PRO_FILE_PWD_/$$defFile/eabi") { + system("$$QMAKE_MKDIR $$_PRO_FILE_PWD_/$$defFile/eabi") + } + elf2e32FileToAdd = $$_PRO_FILE_PWD_/$$defFile/eabi/$$basename(TARGET)u.def + } else { + elf2e32FileToAdd = $$_PRO_FILE_PWD_/$$defFile + } + QMAKE_ELF2E32_FLAGS += "`test -e $$elf2e32FileToAdd && echo --definput=$$elf2e32FileToAdd`" + + symbianObjdir = $$OBJECTS_DIR + isEmpty(symbianObjdir):symbianObjdir = . + + freeze_target.target = freeze + freeze_target.depends = first + # The perl part is to convert to unix line endings and remove comments, which the s60 tools refuse to do. + freeze_target.commands = perl -n -e \'next if (/; NEW/); s/\r//g; if (/MISSING:(.*)/x) { print(\"\$\$1 ABSENT\\n\"); } else { print; }\' < $$symbianObjdir/$${TARGET}.def > $$elf2e32FileToAdd + #QMAKE_EXTRA_TARGETS += freeze_target +} else:contains(TEMPLATE, subdirs) { + freeze_target.target = freeze + freeze_target.CONFIG = recursive + freeze_target.recurse = $$SUBDIRS + #QMAKE_EXTRA_TARGETS += freeze_target +} else { + freeze_target.target = freeze + freeze_target.commands = + #QMAKE_EXTRA_TARGETS += freeze_target } diff --git a/mkspecs/features/symbian/default_post.prf b/mkspecs/features/symbian/default_post.prf index 7c9e8ee..d29e460 100644 --- a/mkspecs/features/symbian/default_post.prf +++ b/mkspecs/features/symbian/default_post.prf @@ -28,4 +28,21 @@ contains(TEMPLATE, lib): { contains(TEMPLATE, ".*app"):contains(QT, gui):contains(CONFIG,qt) { load(application_icon.prf) -}
\ No newline at end of file +} + +isEmpty(TARGET.UID3):TARGET.UID3 = $$generate_uid("$${OUT_PWD}/$${TARGET}") +isEmpty(TARGET.UID2) { + contains(CONFIG, stdbinary) { + TARGET.UID2 = 0x20004C45 + } else { + contains(TEMPLATE, app) { + contains(QT, gui) { + TARGET.UID2 = 0x100039CE + } else { + TARGET.UID2 = 0 + } + } else:contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) { + TARGET.UID2 = 0x1000008d + } + } +} diff --git a/mkspecs/features/symbian/do_not_build_as_thumb.prf b/mkspecs/features/symbian/do_not_build_as_thumb.prf new file mode 100644 index 0000000..60d9382 --- /dev/null +++ b/mkspecs/features/symbian/do_not_build_as_thumb.prf @@ -0,0 +1,8 @@ +symbian-abld|symbian-sbsv2 { + MMP_RULES += ALWAYS_BUILD_AS_ARM +} else:linux-armcc { + QMAKE_CFLAGS -= --thumb + QMAKE_CFLAGS += --arm + QMAKE_CXXFLAGS -= --thumb + QMAKE_CXXFLAGS += --arm +} diff --git a/mkspecs/features/symbian/moc.prf b/mkspecs/features/symbian/moc.prf index 9c21ed7..29e0d8d 100644 --- a/mkspecs/features/symbian/moc.prf +++ b/mkspecs/features/symbian/moc.prf @@ -1,16 +1,18 @@ load(moc) -RET = $$find(MOC_DIR, "(/|^)\.[^/]+/?$") -!isEmpty(RET):{ - error("Symbian does not support directories starting with a dot. Please set MOC_DIR to a different value in your profile. MOC_DIR: $$MOC_DIR") -} +symbian-abld|symbian-sbsv2 { + RET = $$find(MOC_DIR, "(/|^)\.[^/]+/?$") + !isEmpty(RET):{ + error("Symbian does not support directories starting with a dot. Please set MOC_DIR to a different value in your profile. MOC_DIR: $$MOC_DIR") + } -RET = $$find(RCC_DIR, "(/|^)\.[^/]+/?$") -!isEmpty(RET):{ - error("Symbian does not support directories starting with a dot. Please set RCC_DIR to a different value in your profile. RCC_DIR: $$RCC_DIR") -} + RET = $$find(RCC_DIR, "(/|^)\.[^/]+/?$") + !isEmpty(RET):{ + error("Symbian does not support directories starting with a dot. Please set RCC_DIR to a different value in your profile. RCC_DIR: $$RCC_DIR") + } -RET = $$find(OBJECTS_DIR, "(/|^)\.[^/]+/?$") -!isEmpty(RET):{ - error("Symbian does not support directories starting with a dot. Please set OBJECTS_DIR to a different value in your profile. OBJECTS_DIR: $$OBJECTS_DIR") + RET = $$find(OBJECTS_DIR, "(/|^)\.[^/]+/?$") + !isEmpty(RET):{ + error("Symbian does not support directories starting with a dot. Please set OBJECTS_DIR to a different value in your profile. OBJECTS_DIR: $$OBJECTS_DIR") + } } diff --git a/mkspecs/features/symbian/platform_paths.prf b/mkspecs/features/symbian/platform_paths.prf index a55e842..f05a885 100644 --- a/mkspecs/features/symbian/platform_paths.prf +++ b/mkspecs/features/symbian/platform_paths.prf @@ -50,6 +50,12 @@ # # ============================================================================== +symbian-abld|symbian-sbsv2 { + epocroot_prefix = / +} else { + epocroot_prefix = $${EPOCROOT} +} + exists($${EPOCROOT}epoc32/include/platform_paths.prf) { # Load platform specific paths @@ -66,10 +72,10 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { # --------------------------------------- defineReplace(APP_LAYER_SDK_EXPORT_PATH) { - return (/epoc32/include/app/$$1) + return ($${epocroot_prefix}epoc32/include/app/$$1) } defineReplace(APP_LAYER_PUBLIC_EXPORT_PATH) { - return (/epoc32/include/app/$$1) + return ($${epocroot_prefix}epoc32/include/app/$$1) } # --------------------------------------- @@ -77,10 +83,10 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { # --------------------------------------- defineReplace(APP_LAYER_DOMAIN_EXPORT_PATH) { - return (/epoc32/include/platform/app/$$1) + return ($${epocroot_prefix}epoc32/include/platform/app/$$1) } defineReplace(APP_LAYER_PLATFORM_EXPORT_PATH) { - return (/epoc32/include/platform/app/$$1) + return ($${epocroot_prefix}epoc32/include/platform/app/$$1) } # --------------------------------------- @@ -88,10 +94,10 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { # --------------------------------------- defineReplace(MW_LAYER_SDK_EXPORT_PATH) { - return (/epoc32/include/mw/$$1) + return ($${epocroot_prefix}epoc32/include/mw/$$1) } defineReplace(MW_LAYER_PUBLIC_EXPORT_PATH) { - return (/epoc32/include/mw/$$1) + return ($${epocroot_prefix}epoc32/include/mw/$$1) } # --------------------------------------- @@ -99,10 +105,10 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { # --------------------------------------- defineReplace(MW_LAYER_DOMAIN_EXPORT_PATH) { - return (/epoc32/include/platform/mw/$$1) + return ($${epocroot_prefix}epoc32/include/platform/mw/$$1) } defineReplace(MW_LAYER_PLATFORM_EXPORT_PATH) { - return (/epoc32/include/platform/mw/$$1) + return ($${epocroot_prefix}epoc32/include/platform/mw/$$1) } # --------------------------------------- @@ -110,11 +116,11 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { # --------------------------------------- defineReplace(OSEXT_LAYER_SDK_EXPORT_PATH) { - return (/epoc32/include/$$1) + return ($${epocroot_prefix}epoc32/include/$$1) } # WARNING: If the following path changes see the exists() function around line 219 defineReplace(OS_LAYER_PUBLIC_EXPORT_PATH) { - return (/epoc32/include/$$1) + return ($${epocroot_prefix}epoc32/include/$$1) } # --------------------------------------- @@ -122,10 +128,10 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { # --------------------------------------- defineReplace(OSEXT_LAYER_DOMAIN_EXPORT_PATH) { - return (/epoc32/include/platform/$$1) + return ($${epocroot_prefix}epoc32/include/platform/$$1) } defineReplace(OS_LAYER_PLATFORM_EXPORT_PATH) { - return (/epoc32/include/platform/$$1) + return ($${epocroot_prefix}epoc32/include/platform/$$1) } # --------------------------------------- @@ -152,18 +158,18 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { # the headers come from middleware or os-layer => thus they are first. APP_LAYER_SYSTEMINCLUDE = \ - /epoc32/include \ - /epoc32/include/mw \ - /epoc32/include/platform/mw \ - /epoc32/include/platform \ - /epoc32/include/app \ - /epoc32/include/platform/app \ - /epoc32/include/platform/loc \ - /epoc32/include/platform/mw/loc \ - /epoc32/include/platform/app/loc \ - /epoc32/include/platform/loc/sc \ - /epoc32/include/platform/mw/loc/sc \ - /epoc32/include/platform/app/loc/sc + $${epocroot_prefix}epoc32/include \ + $${epocroot_prefix}epoc32/include/mw \ + $${epocroot_prefix}epoc32/include/platform/mw \ + $${epocroot_prefix}epoc32/include/platform \ + $${epocroot_prefix}epoc32/include/app \ + $${epocroot_prefix}epoc32/include/platform/app \ + $${epocroot_prefix}epoc32/include/platform/loc \ + $${epocroot_prefix}epoc32/include/platform/mw/loc \ + $${epocroot_prefix}epoc32/include/platform/app/loc \ + $${epocroot_prefix}epoc32/include/platform/loc/sc \ + $${epocroot_prefix}epoc32/include/platform/mw/loc/sc \ + $${epocroot_prefix}epoc32/include/platform/app/loc/sc # This define statements defines the include paths, which are intended to be # used in the pro-files that are part of the middleware-layer. It includes all @@ -171,14 +177,14 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { # middleware-layer components. MW_LAYER_SYSTEMINCLUDE = \ - /epoc32/include \ - /epoc32/include/mw \ - /epoc32/include/platform/mw \ - /epoc32/include/platform \ - /epoc32/include/platform/loc \ - /epoc32/include/platform/mw/loc \ - /epoc32/include/platform/loc/sc \ - /epoc32/include/platform/mw/loc/sc + $${epocroot_prefix}epoc32/include \ + $${epocroot_prefix}epoc32/include/mw \ + $${epocroot_prefix}epoc32/include/platform/mw \ + $${epocroot_prefix}epoc32/include/platform \ + $${epocroot_prefix}epoc32/include/platform/loc \ + $${epocroot_prefix}epoc32/include/platform/mw/loc \ + $${epocroot_prefix}epoc32/include/platform/loc/sc \ + $${epocroot_prefix}epoc32/include/platform/mw/loc/sc # This define statements defines the include paths, which are intended to be # used in the pro-files that are part of the osextensions-layer. It includes all @@ -186,10 +192,10 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { # os-layer components. OS_LAYER_SYSTEMINCLUDE = \ - /epoc32/include \ - /epoc32/include/platform \ - /epoc32/include/platform/loc \ - /epoc32/include/platform/loc/sc + $${epocroot_prefix}epoc32/include \ + $${epocroot_prefix}epoc32/include/platform \ + $${epocroot_prefix}epoc32/include/platform/loc \ + $${epocroot_prefix}epoc32/include/platform/loc/sc # This define statements defines the include paths, which are intended to be # used in the pro-files that are part of the os-layer. This is intended @@ -198,7 +204,7 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { # 2 files already contain the /epoc32/include as system include path. OS_LAYER_KERNEL_SYSTEMINCLUDE = \ - /epoc32/include/platform + $${epocroot_prefix}epoc32/include/platform # --------------------------------------- @@ -237,10 +243,10 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { # --------------------------------------- defineReplace(APP_LAYER_SDK_EXPORT_PATH) { - return (/epoc32/include/applications/$$1) + return ($${epocroot_prefix}epoc32/include/applications/$$1) } defineReplace(APP_LAYER_PUBLIC_EXPORT_PATH) { - return (/epoc32/include/applications/$$1) + return ($${epocroot_prefix}epoc32/include/applications/$$1) } # --------------------------------------- @@ -248,10 +254,10 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { # --------------------------------------- defineReplace(APP_LAYER_DOMAIN_EXPORT_PATH) { - return (/epoc32/include/domain/applications/$$1) + return ($${epocroot_prefix}epoc32/include/domain/applications/$$1) } defineReplace(APP_LAYER_PLATFORM_EXPORT_PATH) { - return (/epoc32/include/domain/applications/$$1) + return ($${epocroot_prefix}epoc32/include/domain/applications/$$1) } # --------------------------------------- @@ -259,10 +265,10 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { # --------------------------------------- defineReplace(MW_LAYER_SDK_EXPORT_PATH) { - return (/epoc32/include/middleware/$$1) + return ($${epocroot_prefix}epoc32/include/middleware/$$1) } defineReplace(MW_LAYER_PUBLIC_EXPORT_PATH) { - return (/epoc32/include/middleware/$$1) + return ($${epocroot_prefix}epoc32/include/middleware/$$1) } # --------------------------------------- @@ -270,10 +276,10 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { # --------------------------------------- defineReplace(MW_LAYER_DOMAIN_EXPORT_PATH) { - return (/epoc32/include/domain/middleware/$$1) + return ($${epocroot_prefix}epoc32/include/domain/middleware/$$1) } defineReplace(MW_LAYER_PLATFORM_EXPORT_PATH) { - return (/epoc32/include/domain/middleware/$$1) + return ($${epocroot_prefix}epoc32/include/domain/middleware/$$1) } # --------------------------------------- @@ -281,11 +287,11 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { # --------------------------------------- defineReplace(OSEXT_LAYER_SDK_EXPORT_PATH) { - return (/epoc32/include/osextensions/$$1) + return ($${epocroot_prefix}epoc32/include/osextensions/$$1) } # WARNING: If the following path changes see the exists() function around line 430 defineReplace(OS_LAYER_PUBLIC_EXPORT_PATH) { - return (/epoc32/include/osextensions/$$1) + return ($${epocroot_prefix}epoc32/include/osextensions/$$1) } # --------------------------------------- @@ -293,10 +299,10 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { # --------------------------------------- defineReplace(OSEXT_LAYER_DOMAIN_EXPORT_PATH) { - return (/epoc32/include/domain/osextensions/$$1) + return ($${epocroot_prefix}epoc32/include/domain/osextensions/$$1) } defineReplace(OS_LAYER_PLATFORM_EXPORT_PATH) { - return (/epoc32/include/domain/osextensions/$$1) + return ($${epocroot_prefix}epoc32/include/domain/osextensions/$$1) } # --------------------------------------- @@ -323,20 +329,20 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { # the headers come from middleware or os-layer => thus they are first. APP_LAYER_SYSTEMINCLUDE = \ - /epoc32/include \ - /epoc32/include/oem \ - /epoc32/include/middleware \ - /epoc32/include/domain/middleware \ - /epoc32/include/osextensions \ - /epoc32/include/domain/osextensions \ - /epoc32/include/applications \ - /epoc32/include/domain/applications \ - /epoc32/include/domain/osextensions/loc \ - /epoc32/include/domain/middleware/loc \ - /epoc32/include/domain/applications/loc \ - /epoc32/include/domain/osextensions/loc/sc \ - /epoc32/include/domain/middleware/loc/sc \ - /epoc32/include/domain/applications/loc/sc + $${epocroot_prefix}epoc32/include \ + $${epocroot_prefix}epoc32/include/oem \ + $${epocroot_prefix}epoc32/include/middleware \ + $${epocroot_prefix}epoc32/include/domain/middleware \ + $${epocroot_prefix}epoc32/include/osextensions \ + $${epocroot_prefix}epoc32/include/domain/osextensions \ + $${epocroot_prefix}epoc32/include/applications \ + $${epocroot_prefix}epoc32/include/domain/applications \ + $${epocroot_prefix}epoc32/include/domain/osextensions/loc \ + $${epocroot_prefix}epoc32/include/domain/middleware/loc \ + $${epocroot_prefix}epoc32/include/domain/applications/loc \ + $${epocroot_prefix}epoc32/include/domain/osextensions/loc/sc \ + $${epocroot_prefix}epoc32/include/domain/middleware/loc/sc \ + $${epocroot_prefix}epoc32/include/domain/applications/loc/sc # This define statements defines the include paths, which are intended to be # used in the pro-files that are part of the middleware-layer. It includes all @@ -344,16 +350,16 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { # middleware-layer components. MW_LAYER_SYSTEMINCLUDE = \ - /epoc32/include \ - /epoc32/include/oem \ - /epoc32/include/middleware \ - /epoc32/include/domain/middleware \ - /epoc32/include/osextensions \ - /epoc32/include/domain/osextensions \ - /epoc32/include/domain/osextensions/loc \ - /epoc32/include/domain/middleware/loc \ - /epoc32/include/domain/osextensions/loc/sc \ - /epoc32/include/domain/middleware/loc/sc + $${epocroot_prefix}epoc32/include \ + $${epocroot_prefix}epoc32/include/oem \ + $${epocroot_prefix}epoc32/include/middleware \ + $${epocroot_prefix}epoc32/include/domain/middleware \ + $${epocroot_prefix}epoc32/include/osextensions \ + $${epocroot_prefix}epoc32/include/domain/osextensions \ + $${epocroot_prefix}epoc32/include/domain/osextensions/loc \ + $${epocroot_prefix}epoc32/include/domain/middleware/loc \ + $${epocroot_prefix}epoc32/include/domain/osextensions/loc/sc \ + $${epocroot_prefix}epoc32/include/domain/middleware/loc/sc # This define statements defines the include paths, which are intended to be # used in the pro-files that are part of the osextensions-layer. It includes all @@ -361,12 +367,12 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { # os-layer components. OS_LAYER_SYSTEMINCLUDE = \ - /epoc32/include \ - /epoc32/include/oem \ - /epoc32/include/osextensions \ - /epoc32/include/domain/osextensions \ - /epoc32/include/domain/osextensions/loc \ - /epoc32/include/domain/osextensions/loc/sc + $${epocroot_prefix}epoc32/include \ + $${epocroot_prefix}epoc32/include/oem \ + $${epocroot_prefix}epoc32/include/osextensions \ + $${epocroot_prefix}epoc32/include/domain/osextensions \ + $${epocroot_prefix}epoc32/include/domain/osextensions/loc \ + $${epocroot_prefix}epoc32/include/domain/osextensions/loc/sc # This define statements defines the include paths, which are intended to be # used in the pro-files that are part of the os-layer. This is intended @@ -375,9 +381,9 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { # 2 files already contain the /epoc32/include as system include path. OS_LAYER_KERNEL_SYSTEMINCLUDE = \ - /epoc32/include/oem \ - /epoc32/include/osextensions \ - /epoc32/include/domain/osextensions + $${epocroot_prefix}epoc32/include/oem \ + $${epocroot_prefix}epoc32/include/osextensions \ + $${epocroot_prefix}epoc32/include/domain/osextensions # --------------------------------------- @@ -387,41 +393,41 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { OS_LAYER_LIBC_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis) \ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/sys) \ - /epoc32/include/stdapis \ - /epoc32/include/stdapis/sys + $${epocroot_prefix}epoc32/include/stdapis \ + $${epocroot_prefix}epoc32/include/stdapis/sys OS_LAYER_GLIB_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0) \ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0/glib) \ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0/gObject) \ - /epoc32/include/stdapis/glib-2.0 \ - /epoc32/include/stdapis/glib-2.0/glib \ - /epoc32/include/stdapis/glib-2.0/gObject + $${epocroot_prefix}epoc32/include/stdapis/glib-2.0 \ + $${epocroot_prefix}epoc32/include/stdapis/glib-2.0/glib \ + $${epocroot_prefix}epoc32/include/stdapis/glib-2.0/gObject OS_LAYER_SSL_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/openssl) \ - /epoc32/include/stdapis/openssl + $${epocroot_prefix}epoc32/include/stdapis/openssl # stlportv5 is preferred over stlport as it has the throwing version of operator new OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) \ - /epoc32/include/stdapis/stlportv5 + $${epocroot_prefix}epoc32/include/stdapis/stlportv5 exists($${EPOCROOT}epoc32/include/osextensions/stdapis/stlport) \ |exists($${EPOCROOT}epoc32/include/stdapis/stlport) { !exists($${EPOCROOT}epoc32/include/osextensions/stdapis/stlportv5) \ :!exists($${EPOCROOT}epoc32/include/stdapis/stlportv5) { OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlport) \ - /epoc32/include/stdapis/stlport + $${epocroot_prefix}epoc32/include/stdapis/stlport } } OS_LAYER_BOOST_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/boost) \ - /epoc32/include/stdapis/boost + $${epocroot_prefix}epoc32/include/stdapis/boost OS_LAYER_DBUS_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/dbus-1.0) \ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/dbus-1.0/dbus) \ - /epoc32/include/stdapis/dbus-1.0 \ - /epoc32/include/stdapis/dbus-1.0/dbus + $${epocroot_prefix}epoc32/include/stdapis/dbus-1.0 \ + $${epocroot_prefix}epoc32/include/stdapis/dbus-1.0/dbus OS_LAYER_LIBUTILITY_SYSTEMINCLUDE = $$OS_LAYER_PLATFORM_EXPORT_PATH(stdapis/utility) \ - /epoc32/include/stdapis/utility + $${epocroot_prefix}epoc32/include/stdapis/utility } @@ -433,31 +439,31 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { # --------------------------------------- defineReplace(CORE_APP_LAYER_IBY_EXPORT_PATH) { - return(/epoc32/rom/include/core/app/$$1) + return($${epocroot_prefix}epoc32/rom/include/core/app/$$1) } defineReplace(CORE_MW_LAYER_IBY_EXPORT_PATH) { - return(/epoc32/rom/include/core/mw/$$1) + return($${epocroot_prefix}epoc32/rom/include/core/mw/$$1) } defineReplace(LANGUAGE_APP_LAYER_IBY_EXPORT_PATH) { - return(/epoc32/rom/include/language/app/$$1) + return($${epocroot_prefix}epoc32/rom/include/language/app/$$1) } defineReplace(LANGUAGE_MW_LAYER_IBY_EXPORT_PATH) { - return(/epoc32/rom/include/language/mw/$$1) + return($${epocroot_prefix}epoc32/rom/include/language/mw/$$1) } defineReplace(CUSTOMER_APP_LAYER_IBY_EXPORT_PATH) { - return(/epoc32/rom/include/customer/app/$$1) + return($${epocroot_prefix}epoc32/rom/include/customer/app/$$1) } defineReplace(CUSTOMER_MW_LAYER_IBY_EXPORT_PATH) { - return(/epoc32/rom/include/customer/mw/$$1) + return($${epocroot_prefix}epoc32/rom/include/customer/mw/$$1) } defineReplace(CUSTOMER_VARIANT_APP_LAYER_IBY_EXPORT_PATH) { - return(/epoc32/rom/include/customervariant/app/$$1) + return($${epocroot_prefix}epoc32/rom/include/customervariant/app/$$1) } defineReplace(CUSTOMER_VARIANT_MW_LAYER_IBY_EXPORT_PATH) { - return(/epoc32/rom/include/customervariant/mw/$$1) + return($${epocroot_prefix}epoc32/rom/include/customervariant/mw/$$1) } # You need to define the following in pro-file, if you are using the stllib: @@ -468,5 +474,4 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { } - - +epocroot_prefix = diff --git a/mkspecs/features/symbian/qt.prf b/mkspecs/features/symbian/qt.prf index 02b3003..99f5ece 100644 --- a/mkspecs/features/symbian/qt.prf +++ b/mkspecs/features/symbian/qt.prf @@ -39,117 +39,3 @@ contains(CONFIG, qt):!contains(TARGET.UID3, 0x2001E61C):!contains(TARGET.UID3, 0 isEmpty(TARGET.EPOCSTACKSIZE):TARGET.EPOCSTACKSIZE = 0x14000 isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x020000 0x800000 - -# Sis file creation -make_cache_name = .make.cache -!symbian-abld:!symbian-sbsv2 { - fixedDestdir = $$DESTDIR - !isEmpty(fixedDestdir):!contains(fixedDestdir, "[/\\]$"):fixedDestdir = $${fixedDestdir}/ - contains(QMAKE_HOST.os, "Windows"):fixedDestdir = $$replace(fixedDestdir, "/", "\\") -} else { - fixedDestdir = -} - -sis_target.target = sis -sis_target.commands = $(if $(wildcard $$basename(TARGET)_template.pkg), \ - $(if $(wildcard $$make_cache_name), \ - $(MAKE) -f $(MAKEFILE) ok_sis MAKEFILES=$$make_cache_name \ - , \ - $(if $(QT_SIS_TARGET), \ - $(MAKE) -f $(MAKEFILE) ok_sis \ - , \ - $(MAKE) -f $(MAKEFILE) fail_sis_nocache \ - ) \ - ) \ - , \ - $(MAKE) -f $(MAKEFILE) fail_sis_nopkg \ - ) - -ok_sis_target.target = ok_sis -ok_sis_target.commands = createpackage.bat $(QT_SIS_OPTIONS) $$basename(TARGET)_template.pkg \ - $(QT_SIS_TARGET) $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE) - -target_sis_target.target = $${fixedDestdir}$${TARGET}.sis -target_sis_target.commands = $(MAKE) -f $(MAKEFILE) sis - -installer_sis_target.target = installer_sis -installer_sis_target.commands = $(if $(wildcard $$basename(TARGET)_installer.pkg), \ - $(MAKE) -f $(MAKEFILE) ok_installer_sis \ - , \ - $(MAKE) -f $(MAKEFILE) fail_sis_nopkg \ - ) -installer_sis_target.depends = $${fixedDestdir}$${TARGET}.sis - -ok_installer_sis_target.target = ok_installer_sis -ok_installer_sis_target.commands = createpackage.bat $(QT_SIS_OPTIONS) $$basename(TARGET)_installer.pkg - \ - $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE) - -fail_sis_nopkg_target.target = fail_sis_nopkg -fail_sis_nopkg_target.commands = "$(error PKG file does not exist, 'sis' and 'installer_sis' target are only supported for executables or projects with DEPLOYMENT statement)" - -fail_sis_nocache_target.target = fail_sis_nocache -fail_sis_nocache_target.commands = "$(error Project has to be built or QT_SIS_TARGET environment variable has to be set before calling 'SIS' target)" - -symbian-abld|symbian-sbsv2 { - # Only enable stub_sis files for the abld/sbsv2 build systems for now, since we don't - # support ROM builds for any other Symbian build system. - stub_sis_target.target = stub_sis - stub_sis_target.commands = $(if $(wildcard $$basename(TARGET)_template.pkg), \ - $(if $(wildcard $$make_cache_name), \ - $(MAKE) -f $(MAKEFILE) ok_stub_sis MAKEFILES=$$make_cache_name \ - , \ - $(if $(QT_SIS_TARGET), \ - $(MAKE) -f $(MAKEFILE) ok_stub_sis \ - , \ - $(MAKE) -f $(MAKEFILE) fail_sis_nocache \ - ) \ - ) \ - , \ - $(MAKE) -f $(MAKEFILE) fail_sis_nopkg \ - ) - - ok_stub_sis_target.target = ok_stub_sis - ok_stub_sis_target.commands = createpackage.bat -s $(QT_SIS_OPTIONS) $$basename(TARGET)_template.pkg \ - $(QT_SIS_TARGET) $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE) - - QMAKE_EXTRA_TARGETS += stub_sis_target \ - ok_stub_sis_target -} else { - # DESTDIR is not honored on abld and sbsv2 - !isEmpty(DESTDIR) { - ok_sis_target.commands += && $$QMAKE_MOVE $$basename(TARGET).sis $$DESTDIR - ok_installer_sis_target.commands += && $$QMAKE_MOVE $$basename(TARGET).sis $$DESTDIR - } -} - -QMAKE_EXTRA_TARGETS += sis_target \ - ok_sis_target \ - target_sis_target \ - installer_sis_target \ - ok_installer_sis_target \ - fail_sis_nopkg_target \ - fail_sis_nocache_target - -# Sbsv2 has its own store_build target which is using flms. -!symbian-sbsv2 { - contains(QMAKE_HOST.os, "Windows") { - shellFixedHash = $${LITERAL_HASH} - } else { - shellFixedHash = \\$${LITERAL_HASH} - } - store_build_target.target = store_build - store_build_target.commands = \ - @echo $${shellFixedHash} ============================================================================== > $$make_cache_name \ - && echo $${shellFixedHash} This file is generated by make and should not be modified by the user >> $$make_cache_name \ - && echo $${shellFixedHash} Name : $$make_cache_name >> $$make_cache_name \ - && echo $${shellFixedHash} Part of : lineedits >> $$make_cache_name \ - && echo $${shellFixedHash} Description : This file is used to cache last build target for >> $$make_cache_name \ - && echo $${shellFixedHash} make sis target. >> $$make_cache_name \ - && echo $${shellFixedHash} Version : >> $$make_cache_name \ - && echo $${shellFixedHash} >> $$make_cache_name \ - && echo $${shellFixedHash} ============================================================================== >> $$make_cache_name \ - && echo. >> $$make_cache_name \ - && echo QT_SIS_TARGET ?= $(QT_SIS_TARGET) >> $$make_cache_name - - QMAKE_EXTRA_TARGETS += store_build_target -} diff --git a/mkspecs/features/symbian/release.prf b/mkspecs/features/symbian/release.prf new file mode 100644 index 0000000..8164495 --- /dev/null +++ b/mkspecs/features/symbian/release.prf @@ -0,0 +1 @@ +QMAKE_LIBDIR += $${EPOCROOT}epoc32/release/armv5/urel diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf new file mode 100644 index 0000000..b543587 --- /dev/null +++ b/mkspecs/features/symbian/symbian_building.prf @@ -0,0 +1,252 @@ +# 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 :linux-gcce { # lets provide a simple default. Without elf2e32 complains + QMAKE_LFLAGS += -Ttext 0x80000 -Tdata 0x400000 +} + +symbianObjdir=$$OBJECTS_DIR +isEmpty(symbianObjdir) { + symbianObjdir = . +} +symbianDestdir=$$DESTDIR +isEmpty(symbianDestdir) { + symbianDestdir = . +} + +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(library, "^-l", "") + 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 + return($$newLIB) +} + +for(libraries, LIBS) { + newLIBS += $$processSymbianLibraries($$libraries) +} +LIBS = $$newLIBS +newLIBS = +for(libraries, QMAKE_LIBS) { + newLIBS += $$processSymbianLibraries($$libraries) +} +QMAKE_LIBS = $$newLIBS + +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) { + 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, 0) { + # 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) { + # 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: { + 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 + DEFINES += __DLL__ +} + +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 --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 + QMAKE_CLEAN += $${symbianDestdir}/$${TARGET} + + 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_RVCT22INC=$$(RVCT22INC) + !isEmpty(SYMBIAN_RVCT22INC):symbian_resources_INCLUDES = -I$${SYMBIAN_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/features/symbian/thread.prf b/mkspecs/features/symbian/thread.prf new file mode 100644 index 0000000..885438a --- /dev/null +++ b/mkspecs/features/symbian/thread.prf @@ -0,0 +1,2 @@ +# Symbian behaves like POSIX when it comes to threads. +include(../unix/thread.prf) diff --git a/mkspecs/symbian-abld/qmake.conf b/mkspecs/symbian-abld/qmake.conf index 33b897d..fe9cd60 100644 --- a/mkspecs/symbian-abld/qmake.conf +++ b/mkspecs/symbian-abld/qmake.conf @@ -7,4 +7,4 @@ MAKEFILE_GENERATOR = SYMBIAN_ABLD option(recursive) -include(../common/symbian/symbian.conf) +include(../common/symbian/symbian-mmp.conf) diff --git a/mkspecs/symbian-sbsv2/qmake.conf b/mkspecs/symbian-sbsv2/qmake.conf index 585e645..73d3ee3 100644 --- a/mkspecs/symbian-sbsv2/qmake.conf +++ b/mkspecs/symbian-sbsv2/qmake.conf @@ -7,4 +7,4 @@ MAKEFILE_GENERATOR = SYMBIAN_SBSV2 option(recursive) -include(../common/symbian/symbian.conf) +include(../common/symbian/symbian-mmp.conf) diff --git a/mkspecs/symbian/linux-armcc/features/default_post.prf b/mkspecs/symbian/linux-armcc/features/default_post.prf new file mode 100644 index 0000000..7aa1f4d --- /dev/null +++ b/mkspecs/symbian/linux-armcc/features/default_post.prf @@ -0,0 +1,5 @@ +load(default_post.prf) + +# It is important that this config be executed last, +# and qmake does them in reverse order. +CONFIG = symbian_building $$CONFIG diff --git a/mkspecs/symbian/linux-armcc/qmake.conf b/mkspecs/symbian/linux-armcc/qmake.conf new file mode 100644 index 0000000..57eb1fc --- /dev/null +++ b/mkspecs/symbian/linux-armcc/qmake.conf @@ -0,0 +1,53 @@ +# +# qmake configuration for symbian/linux-armcc +# + +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 + +# notice that the middle part of the following set of vars matches the TARGET content of the libs + +#QMAKE_qtmain_CXXFLAGS = --arm +#QMAKE_QtCore_CXXFLAGS = +QMAKE_QtGui_LFLAGS = "--rw-base 0x800000" +#QMAKE_QtDBus_CXXFLAGS = +#QMAKE_QtDeclarative_CXXFLAGS = +#QMAKE_QtMultimedia_CXXFLAGS = +#QMAKE_QtNetwork_CXXFLAGS = +#QMAKE_QtOpenGL_CXXFLAGS = +#QMAKE_QtOpenVG_CXXFLAGS = +#QMAKE_phonon_CXXFLAGS = +#QMAKE_QtScript_CXXFLAGS = +#QMAKE_QtScriptTools_CXXFLAGS = +#QMAKE_QtSql_CXXFLAGS = +#QMAKE_QtSvg_CXXFLAGS = +#QMAKE_QtTest_CXXFLAGS = +#QMAKE_QtXmlPatterns_CXXFLAGS = +#QMAKE_QtXml_CXXFLAGS = +# Move RW-section base address to start from 0xE00000 instead of the toolchain default 0x400000. +QMAKE_QtWebKit_LFLAGS = --rw-base 0xE00000 + +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 --dll --no_scanlib +QMAKE_LFLAGS_APP += --entry _E32Startup +QMAKE_LFLAGS_SHLIB += --entry _E32Dll + +DEFINES += EKA2 \ + __ARMCC__ \ + __ARMcc_2__ \ + __ARMCC_2_2__ + +QMAKE_LIBDIR += $${EPOCROOT}epoc32/release/armv5/lib +QMAKE_LIBDIR *= $$(RVCT22LIB) + +INCLUDEPATH = $${EPOCROOT}epoc32/include \ + $${EPOCROOT}epoc32/include/rvct2_2 \ + $${EPOCROOT}epoc32/include/variant \ + $${EPOCROOT}epoc32/include/stdapis \ + $$INCLUDEPATH diff --git a/mkspecs/symbian/linux-armcc/qplatformdefs.h b/mkspecs/symbian/linux-armcc/qplatformdefs.h new file mode 100644 index 0000000..db67648 --- /dev/null +++ b/mkspecs/symbian/linux-armcc/qplatformdefs.h @@ -0,0 +1 @@ +#include "../../common/symbian/qplatformdefs.h" diff --git a/mkspecs/symbian/linux-gcce/features/default_post.prf b/mkspecs/symbian/linux-gcce/features/default_post.prf new file mode 100644 index 0000000..7aa1f4d --- /dev/null +++ b/mkspecs/symbian/linux-gcce/features/default_post.prf @@ -0,0 +1,5 @@ +load(default_post.prf) + +# It is important that this config be executed last, +# and qmake does them in reverse order. +CONFIG = symbian_building $$CONFIG diff --git a/mkspecs/symbian/linux-gcce/qmake.conf b/mkspecs/symbian/linux-gcce/qmake.conf new file mode 100644 index 0000000..6d31f66 --- /dev/null +++ b/mkspecs/symbian/linux-gcce/qmake.conf @@ -0,0 +1,91 @@ +# +# qmake configuration for symbian/linux-gcce +# + +include(../../common/symbian/symbian-makefile.conf) + +include(../../common/g++.conf) + +QMAKE_CC = arm-none-symbianelf-gcc +QMAKE_CXX = arm-none-symbianelf-g++ +QMAKE_LINK = arm-none-symbianelf-ld +QMAKE_LINK_SHLIB = arm-none-symbianelf-ld +QMAKE_LINK_C = arm-none-symbianelf-ld +QMAKE_LINK_C_SHLIB = arm-none-symbianelf-ld +QMAKE_AR = arm-none-symbianelf-ar cqs + +# gcce defaults to 'arm' instruction set. Lets use the better 'thumb' if possible +# notice that the middle part of the following set of vars matches the TARGET content of the libs + +QMAKE_qtmain_CXXFLAGS = -mthumb +QMAKE_QtCore_CXXFLAGS = -mthumb +QMAKE_QtGui_LFLAGS = -Ttext 0x8000 -Tdata 0xE00000 +QMAKE_QtDBus_CXXFLAGS = -mthumb +QMAKE_QtDeclarative_CXXFLAGS = -mthumb +QMAKE_QtMultimedia_CXXFLAGS = -mthumb +QMAKE_QtNetwork_CXXFLAGS = -mthumb +QMAKE_QtOpenGL_CXXFLAGS = -mthumb +QMAKE_QtOpenVG_CXXFLAGS = -mthumb +QMAKE_phonon_CXXFLAGS = -mthumb +QMAKE_QtScript_CXXFLAGS = -mthumb +QMAKE_QtScriptTools_CXXFLAGS = -mthumb +QMAKE_QtSql_CXXFLAGS = -mthumb +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. +# g++ conf above adds it if the host platform is 64 bit, so we remove it again +QMAKE_CFLAGS_SHLIB -= -fPIC +QMAKE_CFLAGS_STATIC_LIB -= -fPIC +QMAKE_CXXFLAGS_SHLIB -= -fPIC +QMAKE_CXXFLAGS_STATIC_LIB -= -fPIC + +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 --entry _E32Dll + +gcceExtraFlags = --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") + } + } +} + +QMAKE_LIBDIR += $${EPOCROOT}epoc32/release/armv5/lib + +INCLUDEPATH = ${EPOCROOT}epoc32/include/ \ + $${EPOCROOT}epoc32/include/variant \ + $${EPOCROOT}epoc32/include/stdapis \ + $${EPOCROOT}epoc32/include/gcce \ + ${EPOCROOT}epoc32/include/stdapis/sys \ + ${EPOCROOT}epoc32/include/stdapis/stlport \ + $$INCLUDEPATH + diff --git a/mkspecs/symbian/linux-gcce/qplatformdefs.h b/mkspecs/symbian/linux-gcce/qplatformdefs.h new file mode 100644 index 0000000..4a658c5 --- /dev/null +++ b/mkspecs/symbian/linux-gcce/qplatformdefs.h @@ -0,0 +1,2 @@ +#include "../../common/symbian/qplatformdefs.h" + diff --git a/projects.pro b/projects.pro index 19a5ff8..fc7db1d 100644 --- a/projects.pro +++ b/projects.pro @@ -48,7 +48,7 @@ for(PROJECT, $$list($$lower($$unique(QT_BUILD_PARTS)))) { contains(QT_BUILD_PARTS, tools) { include(translations/translations.pri) # ts targets } else { - !wince*:!symbian:SUBDIRS += tools/linguist/lrelease + !wince*:SUBDIRS += tools/linguist/lrelease } SUBDIRS += translations # qm build step } else:isEqual(PROJECT, qmake) { diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix index c101626..875b9d1 100644 --- a/qmake/Makefile.unix +++ b/qmake/Makefile.unix @@ -11,8 +11,7 @@ OBJS=project.o property.o main.o makefile.o unixmake2.o unixmake.o \ meta.o makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \ borland_bmake.o msvc_vcproj.o msvc_nmake.o msvc_objectmodel.o \ symmake.o initprojectdeploy_symbian.o symmake_abld.o symmake_sbsv2.o \ - registry.o \ - epocroot.o + symbiancommon.o registry.o epocroot.o #qt code QOBJS=qtextcodec.o qutfcodec.o qstring.o qtextstream.o qiodevice.o qmalloc.o qglobal.o \ @@ -37,6 +36,7 @@ DEPEND_SRC=project.cpp property.cpp meta.cpp main.cpp generators/makefile.cpp ge $(SOURCE_PATH)/tools/shared/windows/registry.cpp \ $(SOURCE_PATH)/tools/shared/symbian/epocroot.cpp \ generators/symbian/symmake_abld.cpp generators/symbian/symmake_sbsv2.cpp \ + generaters/symbian/symbiancommon.cpp \ $(SOURCE_PATH)/src/corelib/codecs/qtextcodec.cpp $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp \ $(SOURCE_PATH)/src/corelib/tools/qstring.cpp $(SOURCE_PATH)/src/corelib/io/qfile.cpp \ $(SOURCE_PATH)/src/corelib/io/qtextstream.cpp $(SOURCE_PATH)/src/corelib/io/qiodevice.cpp \ @@ -235,7 +235,7 @@ option.o: option.cpp option.h $(BUILD_PATH)/src/corelib/global/qconfig.cpp qcryptographichash.o: $(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp -metamakefile.o: generators/metamakefile.cpp +metamakefile.o: generators/metamakefile.cpp generators/symbian/symbian_makefile.h $(CXX) -c -o $@ $(CXXFLAGS) generators/metamakefile.cpp xmloutput.o: generators/xmloutput.cpp @@ -280,6 +280,9 @@ symmake_abld.o: generators/symbian/symmake_abld.cpp symmake_sbsv2.o: generators/symbian/symmake_sbsv2.cpp $(CXX) -c -o $@ $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp +symbiancommon.o: generators/symbian/symbiancommon.cpp + $(CXX) -c -o $@ $(CXXFLAGS) generators/symbian/symbiancommon.cpp + initprojectdeploy_symbian.o: generators/symbian/initprojectdeploy_symbian.cpp $(CXX) -c -o $@ $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index a598350..63156b3 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -77,9 +77,7 @@ OBJS = project.obj main.obj makefile.obj unixmake.obj unixmake2.obj mingw makefiledeps.obj metamakefile.obj xmloutput.obj pbuilder_pbx.obj \ borland_bmake.obj msvc_nmake.obj msvc_vcproj.obj \ msvc_objectmodel.obj symmake.obj initprojectdeploy_symbian.obj \ - registry.obj \ - epocroot.obj \ - symmake_abld.obj symmake_sbsv2.obj + symmake_abld.obj symmake_sbsv2.obj symbiancommon.obj registry.obj epocroot.obj !IFDEF QMAKE_OPENSOURCE_EDITION CFLAGS = $(CFLAGS) -DQMAKE_OPENSOURCE_EDITION @@ -200,6 +198,7 @@ clean:: -del symmake.obj -del symmake_abld.obj -del symmake_sbsv2.obj + -del symbiancommon.obj -del initprojectdeploy_symbian.obj -del registry.obj -del epocroot.obj @@ -396,6 +395,9 @@ symmake_abld.obj: $(SOURCE_PATH)/qmake/generators/symbian/symmake_abld.cpp symmake_sbsv2.obj: $(SOURCE_PATH)/qmake/generators/symbian/symmake_sbsv2.cpp $(CXX) $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp +symbiancommon.obj: $(SOURCE_PATH)/qmake/generators/symbian/symbiancommon.cpp + $(CXX) $(CXXFLAGS) generators/symbian/symbiancommon.cpp + initprojectdeploy_symbian.obj: $(SOURCE_PATH)/qmake/generators/symbian/initprojectdeploy_symbian.cpp $(CXX) $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp @@ -432,7 +434,7 @@ pbuilder_pbx.obj: $(SOURCE_PATH)/qmake/generators/mac/pbuilder_pbx.cpp makefiledeps.obj: $(SOURCE_PATH)/qmake/generators/makefiledeps.cpp $(CXX) $(CXXFLAGS) generators/makefiledeps.cpp -metamakefile.obj: $(SOURCE_PATH)/qmake/generators/metamakefile.cpp +metamakefile.obj: $(SOURCE_PATH)/qmake/generators/metamakefile.cpp $(SOURCE_PATH)/qmake/generators/symbian/symbiancommon.obj $(CXX) $(CXXFLAGS) generators/metamakefile.cpp xmloutput.obj: $(SOURCE_PATH)/qmake/generators/xmloutput.cpp diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++ index 27ae27b..ab7d558 100644 --- a/qmake/Makefile.win32-g++ +++ b/qmake/Makefile.win32-g++ @@ -39,9 +39,7 @@ OBJS = project.o main.o makefile.o unixmake.o unixmake2.o mingw_make.o \ makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \ borland_bmake.o msvc_nmake.o msvc_vcproj.o \ msvc_objectmodel.o symmake.o initprojectdeploy_symbian.o \ - registry.o \ - epocroot.o \ - symmake_abld.o symmake_sbsv2.o + symmake_abld.o symmake_sbsv2.o symbiancommon.o registry.o epocroot.o ifdef QMAKE_OPENSOURCE_EDITION CFLAGS += -DQMAKE_OPENSOURCE_EDITION @@ -275,6 +273,9 @@ symmake_abld.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake_abld.cpp symmake_sbsv2.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake_sbsv2.cpp $(CXX) $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp +symbiancommon.o: $(SOURCE_PATH)/qmake/generators/symbian/symbiancommon.cpp + $(CXX) $(CXXFLAGS) generators/symbian/symbiancommon.cpp + initprojectdeploy_symbian.o: $(SOURCE_PATH)/qmake/generators/symbian/initprojectdeploy_symbian.cpp $(CXX) $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp @@ -308,7 +309,7 @@ pbuilder_pbx.o: $(SOURCE_PATH)/qmake/generators/mac/pbuilder_pbx.cpp makefiledeps.o: $(SOURCE_PATH)/qmake/generators/makefiledeps.cpp $(CXX) $(CXXFLAGS) generators/makefiledeps.cpp -metamakefile.o: $(SOURCE_PATH)/qmake/generators/metamakefile.cpp +metamakefile.o: $(SOURCE_PATH)/qmake/generators/metamakefile.cpp $(SOURCE_PATH)/qmake/generators/symbian/symbian_makefile.h $(CXX) $(CXXFLAGS) generators/metamakefile.cpp xmloutput.o: $(SOURCE_PATH)/qmake/generators/xmloutput.cpp diff --git a/qmake/Makefile.win32-g++-sh b/qmake/Makefile.win32-g++-sh index f7b486f..755d046 100644 --- a/qmake/Makefile.win32-g++-sh +++ b/qmake/Makefile.win32-g++-sh @@ -39,9 +39,7 @@ OBJS = project.o main.o makefile.o unixmake.o unixmake2.o mingw_make.o \ makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \ borland_bmake.o msvc_nmake.o msvc_vcproj.o \ msvc_objectmodel.o symmake.o initprojectdeploy_symbian.o \ - registry.o \ - epocroot.o \ - symmake_abld.o symmake_sbsv2.o + symmake_abld.o symmake_sbsv2.o symbiancommon.o registry.o epocroot.o ifdef QMAKE_OPENSOURCE_EDITION CFLAGS += -DQMAKE_OPENSOURCE_EDITION @@ -274,6 +272,9 @@ symmake_abld.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake_abld.cpp symmake_sbsv2.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake_sbsv2.cpp $(CXX) $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp +symbiancommon.o: $(SOURCE_PATH)/qmake/generators/symbian/symbiancommon.cpp + $(CXX) $(CXXFLAGS) generators/symbian/symbiancommon.cpp + initprojectdeploy_symbian.o: $(SOURCE_PATH)/qmake/generators/symbian/initprojectdeploy_symbian.cpp $(CXX) $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp @@ -307,7 +308,7 @@ pbuilder_pbx.o: $(SOURCE_PATH)/qmake/generators/mac/pbuilder_pbx.cpp makefiledeps.o: $(SOURCE_PATH)/qmake/generators/makefiledeps.cpp $(CXX) $(CXXFLAGS) generators/makefiledeps.cpp -metamakefile.o: $(SOURCE_PATH)/qmake/generators/metamakefile.cpp +metamakefile.o: $(SOURCE_PATH)/qmake/generators/metamakefile.cpp $(SOURCE_PATH)/qmake/generators/symbian/symbian_makefile.h $(CXX) $(CXXFLAGS) generators/metamakefile.cpp xmloutput.o: $(SOURCE_PATH)/qmake/generators/xmloutput.cpp diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h index addb1f5..4c3be3d 100644 --- a/qmake/generators/makefile.h +++ b/qmake/generators/makefile.h @@ -249,6 +249,39 @@ public: virtual bool openOutput(QFile &, const QString &build) const; virtual bool isWindowsShell() const { return Option::host_mode == Option::HOST_WIN_MODE; } virtual bool isForSymbianSbsv2() const { return false; } // FIXME: killme - i'm ugly! + + /* The next one is to avoid having SymbianCommonGenerator as a virtually + inherited class of this class. Instead it is without a base class + (avoiding the virtual inheritance problem), and is allowed to use + functions defined in here. + + To illustrate: + +-------------------+ + | MakefileGenerator | + +-------------------+ + ^ ^ + | | + | X <-- Avoid this inheritance + | | + +------------------------+ +------------------------+ + | UnixMakefileGenerator | | SymbianCommonGenerator | + | or | | | + | NmakeMakefileGenerator | | | + +------------------------+ +------------------------+ + ^ ^ + | | + | | + | | + +-----------------------------+ + | SymbianMakefileTemplate<> | + +-----------------------------+ + + We want to avoid the famous diamond problem, because if we have that, we need + virtual inheritance, which not all compilers like. Therefore, we break the + link as illustrated. Instead, we have a pointer to MakefileGenerator inside + SymbianCommonGenerator, and allows full access by making it a friend here. + */ + friend class SymbianCommonGenerator; }; inline void MakefileGenerator::setNoIO(bool o) diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp index bc8927c..e76e596 100644 --- a/qmake/generators/metamakefile.cpp +++ b/qmake/generators/metamakefile.cpp @@ -443,6 +443,7 @@ QT_BEGIN_INCLUDE_NAMESPACE #include "msvc_vcproj.h" #include "symmake_abld.h" #include "symmake_sbsv2.h" +#include "symbian_makefile.h" QT_END_INCLUDE_NAMESPACE MakefileGenerator * @@ -476,6 +477,8 @@ MetaMakefileGenerator::createMakefileGenerator(QMakeProject *proj, bool noIO) mkfile = new SymbianAbldMakefileGenerator; } else if(gen == "SYMBIAN_SBSV2") { mkfile = new SymbianSbsv2MakefileGenerator; + } else if(gen == "SYMBIAN_UNIX") { + mkfile = new SymbianMakefileTemplate<UnixMakefileGenerator>; } else { fprintf(stderr, "Unknown generator specified: %s\n", gen.toLatin1().constData()); } @@ -504,7 +507,7 @@ MetaMakefileGenerator::modesForGenerator(const QString &gen, } else if (gen == "PROJECTBUILDER" || gen == "XCODE") { *host_mode = Option::HOST_MACX_MODE; *target_mode = Option::TARG_MACX_MODE; - } else if (gen == "SYMBIAN_ABLD" || gen == "SYMBIAN_SBSV2") { + } else if (gen == "SYMBIAN_ABLD" || gen == "SYMBIAN_SBSV2" || gen == "SYMBIAN_UNIX") { #if defined(Q_OS_MAC) *host_mode = Option::HOST_MACX_MODE; #elif defined(Q_OS_UNIX) diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp index 81c9408..6407412 100644 --- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp +++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp @@ -155,6 +155,7 @@ void initProjectDeploySymbian(QMakeProject* project, DeploymentList &deploymentList, const QString &testPath, bool deployBinaries, + bool epocBuild, const QString &platform, const QString &build, QStringList& generatedDirs, @@ -264,7 +265,11 @@ void initProjectDeploySymbian(QMakeProject* project, if (isBinary(info)) { if (deployBinaries) { // Executables and libraries are deployed to \sys\bin - QFileInfo targetPath(epocRoot() + "epoc32/release/" + platform + "/" + build + "/"); + QFileInfo targetPath; + if (epocBuild) + targetPath.setFile(epocRoot() + "epoc32/release/" + platform + "/" + build + "/"); + else + targetPath.setFile(info.path() + QDir::separator()); if(devicePathHasDriveLetter) { deploymentList.append(CopyItem( Option::fixPathToLocalOS(targetPath.absolutePath() + "/" + info.fileName(), diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.h b/qmake/generators/symbian/initprojectdeploy_symbian.h index c621915..2653d2a 100644 --- a/qmake/generators/symbian/initprojectdeploy_symbian.h +++ b/qmake/generators/symbian/initprojectdeploy_symbian.h @@ -69,6 +69,7 @@ extern void initProjectDeploySymbian(QMakeProject* project, DeploymentList &deploymentList, const QString &testPath, bool deployBinaries, + bool epocBuild, const QString &platform, const QString &build, QStringList& generatedDirs, diff --git a/qmake/generators/symbian/symbian_makefile.h b/qmake/generators/symbian/symbian_makefile.h new file mode 100644 index 0000000..f9d3c24 --- /dev/null +++ b/qmake/generators/symbian/symbian_makefile.h @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the qmake application of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef SYMBIAN_MAKEFILE_H +#define SYMBIAN_MAKEFILE_H + +#include "symbiancommon.h" + +// This allows us to reuse the code for both win32 and unix makefile generators. +template <class T> +class SymbianMakefileTemplate : public T, public SymbianCommonGenerator +{ +public: + SymbianMakefileTemplate() : SymbianCommonGenerator(this) {} + + void init() + { + T::init(); + SymbianCommonGenerator::init(); + } + + bool writeMakefile(QTextStream &t) + { + QString numberOfIcons; + QString iconFile; + QMap<QString, QStringList> userRssRules; + readRssRules(numberOfIcons, iconFile, userRssRules); + + // Generate pkg files if there are any actual files to deploy + bool generatePkg = false; + DeploymentList depList; + + if (targetType == TypeExe) { + generatePkg = true; + } else { + foreach(QString item, this->project->values("DEPLOYMENT")) { + if (!this->project->values(item + ".sources").isEmpty()) { + generatePkg = true; + break; + } + } + } + + if (generatePkg) { + generatePkgFile(iconFile, depList, false); + } + + // Get the application translations and convert to symbian OS lang code, i.e. decical number + QStringList symbianLangCodes = symbianLangCodesFromTsFiles(); + + if (targetType == TypeExe) { + if (!this->project->values("CONFIG").contains("no_icon", Qt::CaseInsensitive)) { + writeRegRssFile(userRssRules); + writeRssFile(numberOfIcons, iconFile); + writeLocFile(symbianLangCodes); + } + } + + return T::writeMakefile(t); + } +}; + +#endif // SYMBIAN_MAKEFILE_H diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp new file mode 100644 index 0000000..1de4b65 --- /dev/null +++ b/qmake/generators/symbian/symbiancommon.cpp @@ -0,0 +1,872 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the qmake application of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "symbiancommon.h" +#include <qdebug.h> + +// Included from tools/shared +#include <symbian/epocroot.h> + +#define RESOURCE_DIRECTORY_RESOURCE "\\\\resource\\\\apps\\\\" + +#define RSS_RULES "RSS_RULES" +#define RSS_RULES_BASE "RSS_RULES." +#define RSS_TAG_NBROFICONS "number_of_icons" +#define RSS_TAG_ICONFILE "icon_file" +#define RSS_TAG_HEADER "header" +#define RSS_TAG_SERVICE_LIST "service_list" +#define RSS_TAG_FILE_OWNERSHIP_LIST "file_ownership_list" +#define RSS_TAG_DATATYPE_LIST "datatype_list" +#define RSS_TAG_FOOTER "footer" +#define RSS_TAG_DEFAULT "default_rules" // Same as just giving rules without tag + +#define MANUFACTURER_NOTE_FILE "manufacturer_note.txt" +#define DEFAULT_MANUFACTURER_NOTE \ + "The package is not supported for devices from this manufacturer. Please try the selfsigned " \ + "version of the package instead." + +SymbianCommonGenerator::SymbianCommonGenerator(MakefileGenerator *generator) + : generator(generator) +{ +} + +void SymbianCommonGenerator::init() +{ + QMakeProject *project = generator->project; + fixedTarget = project->first("QMAKE_ORIG_TARGET"); + if (fixedTarget.isEmpty()) + fixedTarget = project->first("TARGET"); + fixedTarget = generator->unescapeFilePath(fixedTarget); + fixedTarget = removePathSeparators(fixedTarget); + if (project->first("MAKEFILE_GENERATOR") == "SYMBIAN_ABLD" + || project->first("MAKEFILE_GENERATOR") == "SYMBIAN_SBSV2") + removeEpocSpecialCharacters(fixedTarget); + else + removeSpecialCharacters(fixedTarget); + + // This should not be empty since the mkspecs are supposed to set it if missing. + uid3 = project->first("TARGET.UID3").trimmed(); + + if ((project->values("TEMPLATE")).contains("app")) + targetType = TypeExe; + else if ((project->values("TEMPLATE")).contains("lib")) { + // Check CONFIG to see if we are to build staticlib or dll + if (project->isActiveConfig("staticlib") || project->isActiveConfig("static")) + targetType = TypeLib; + else if (project->isActiveConfig("plugin")) + targetType = TypePlugin; + else + targetType = TypeDll; + } else { + targetType = TypeSubdirs; + } + + // UID is valid as either hex or decimal, so just convert it to number and back to hex + // to get proper string for private dir + bool conversionOk = false; + uint uidNum = uid3.toUInt(&conversionOk, 0); + + if (!conversionOk) { + fprintf(stderr, "Error: Invalid UID \"%s\".\n", uid3.toUtf8().constData()); + } else { + privateDirUid.setNum(uidNum, 16); + while (privateDirUid.length() < 8) + privateDirUid.insert(0, QLatin1Char('0')); + } +} + +bool SymbianCommonGenerator::containsStartWithItem(const QChar &c, const QStringList& src) +{ + bool result = false; + foreach(QString str, src) { + if (str.startsWith(c)) { + result = true; + break; + } + } + return result; +} + +void SymbianCommonGenerator::removeSpecialCharacters(QString& str) +{ + // When modifying this method check also application_icon.prf + str.replace(QString("/"), QString("_")); + str.replace(QString("\\"), QString("_")); + str.replace(QString(" "), QString("_")); +} + +void SymbianCommonGenerator::removeEpocSpecialCharacters(QString& str) +{ + // When modifying this method check also application_icon.prf + str.replace(QString("-"), QString("_")); + str.replace(QString(":"), QString("_")); + str.replace(QString("."), QString("_")); + removeSpecialCharacters(str); +} + +void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, DeploymentList &depList, bool epocBuild) +{ + QMakeProject *project = generator->project; + QString pkgTarget = project->first("QMAKE_ORIG_TARGET"); + if (pkgTarget.isEmpty()) + pkgTarget = project->first("TARGET"); + pkgTarget = generator->unescapeFilePath(pkgTarget); + pkgTarget = removePathSeparators(pkgTarget); + QString pkgFilename = QString("%1_template.%2").arg(pkgTarget).arg("pkg"); + if (!Option::output_dir.isEmpty()) + pkgFilename = Option::output_dir + '/' + pkgFilename; + + QFile pkgFile(pkgFilename); + if (!pkgFile.open(QIODevice::WriteOnly | QIODevice::Text)) { + PRINT_FILE_CREATE_ERROR(pkgFilename); + return; + } + + generatedFiles << pkgFile.fileName(); + QTextStream t(&pkgFile); + + QString installerSisHeader = project->values("DEPLOYMENT.installer_header").join("\n"); + QString wrapperStreamBuffer; + QTextStream tw(&wrapperStreamBuffer); + + QString dateStr = QDateTime::currentDateTime().toString(Qt::ISODate); + + // Header info + QString wrapperPkgFilename = QString("%1_installer.%2") + .arg(pkgTarget) + .arg("pkg"); + QString headerComment = "; %1 generated by qmake at %2\n" + "; This file is generated by qmake and should not be modified by the user\n" + ";\n\n"; + t << headerComment.arg(pkgFilename).arg(dateStr); + tw << headerComment.arg(wrapperPkgFilename).arg(dateStr); + + // Construct QStringList from pkg_prerules since we need search it before printed to file + QStringList rawPkgPreRules; + foreach(QString deploymentItem, project->values("DEPLOYMENT")) { + foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_prerules")) { + QStringList pkgrulesValue = project->values(pkgrulesItem); + // If there is no stringlist defined for a rule, use rule name directly + // This is convenience for defining single line mmp statements + if (pkgrulesValue.isEmpty()) { + rawPkgPreRules << pkgrulesItem; + } else { + foreach(QString pkgrule, pkgrulesValue) { + rawPkgPreRules << pkgrule; + } + } + } + } + + // Apply some defaults if specific data does not exist in PKG pre-rules + + if (!containsStartWithItem('&', rawPkgPreRules)) { + // language, (*** hardcoded to english atm, should be parsed from TRANSLATIONS) + QString languageCode = "; Language\n&EN\n\n"; + t << languageCode; + tw << languageCode; + } else { + // In case user defines langs, he must take care also about SIS header + if (!containsStartWithItem('#', rawPkgPreRules)) + fprintf(stderr, "Warning: If language is defined with DEPLOYMENT pkg_prerules, also the SIS header must be defined\n"); + } + + // name of application, UID and version + QString applicationVersion = project->first("VERSION").isEmpty() ? "1,0,0" : project->first("VERSION").replace('.', ','); + QString sisHeader = "; SIS header: name, uid, version\n#{\"%1\"},(%2),%3\n\n"; + QString visualTarget = generator->escapeFilePath(project->first("TARGET")); + + visualTarget = removePathSeparators(visualTarget); + QString wrapperTarget = visualTarget + " installer"; + + if (installerSisHeader.startsWith("0x", Qt::CaseInsensitive)) { + tw << sisHeader.arg(wrapperTarget).arg(installerSisHeader).arg(applicationVersion); + } else { + tw << installerSisHeader << endl; + } + if (!containsStartWithItem('#', rawPkgPreRules)) { + t << sisHeader.arg(visualTarget).arg(uid3).arg(applicationVersion); + } + + // Localized vendor name + QString vendorName; + if (!containsStartWithItem('%', rawPkgPreRules)) { + vendorName += "; Localised Vendor name\n%{\"Vendor\"}\n\n"; + } + + // Unique vendor name + if (!containsStartWithItem(':', rawPkgPreRules)) { + vendorName += "; Unique Vendor name\n:\"Vendor\"\n\n"; + } + + t << vendorName; + tw << vendorName; + + // PKG pre-rules - these are added before actual file installations i.e. SIS package body + if (rawPkgPreRules.size()) { + QString comment = "\n; Manual PKG pre-rules from PRO files\n"; + t << comment; + tw << comment; + + foreach(QString item, rawPkgPreRules) { + // Only regular pkg file should have package dependencies or pkg header if that is + // defined using prerules. + if (!item.startsWith("(") && !item.startsWith("#")) { + tw << item << endl; + } + t << item << endl; + } + t << endl; + tw << endl; + } + + // Begin Manufacturer block + if (!project->values("DEPLOYMENT.manufacturers").isEmpty()) { + QString manufacturerStr("IF "); + foreach(QString manufacturer, project->values("DEPLOYMENT.manufacturers")) { + manufacturerStr.append(QString("(MANUFACTURER)=(%1) OR \n ").arg(manufacturer)); + } + // Remove the final OR + manufacturerStr.chop(8); + t << manufacturerStr << endl; + } + + // Install paths on the phone *** should be dynamic at some point + QString installPathBin = "!:\\sys\\bin"; + QString installPathResource = "!:\\resource\\apps"; + QString installPathRegResource = "!:\\private\\10003a3f\\import\\apps"; + + // Find location of builds + QString destDirBin; + QString destDirResource; + QString destDirRegResource; + if (epocBuild) { + destDirBin = QString("%1epoc32/release/$(PLATFORM)/$(TARGET)").arg(epocRoot()); + destDirResource = QString("%1epoc32/data/z/resource/apps").arg(epocRoot()); + destDirRegResource = QString("%1epoc32/data/z/private/10003a3f/import/apps").arg(epocRoot()); + } else { + destDirBin = project->first("DESTDIR"); + if (destDirBin.isEmpty()) + destDirBin = "."; + else if (destDirBin.endsWith('/') || destDirBin.endsWith('\\')) + destDirBin.chop(1); + destDirResource = destDirBin; + destDirRegResource = destDirBin; + } + + if (targetType == TypeExe) { + // deploy .exe file + t << "; Executable and default resource files" << endl; + QString exeFile = fixedTarget + ".exe"; + t << QString("\"%1/%2\" - \"%3\\%4\"") + .arg(destDirBin) + .arg(exeFile) + .arg(installPathBin) + .arg(exeFile) << endl; + + // deploy rsc & reg_rsc file + if (!project->isActiveConfig("no_icon")) { + t << QString("\"%1/%2\" - \"%3\\%4\"") + .arg(destDirResource) + .arg(fixedTarget + ".rsc") + .arg(installPathResource) + .arg(fixedTarget + ".rsc") << endl; + + t << QString("\"%1/%2\" - \"%3\\%4\"") + .arg(destDirRegResource) + .arg(fixedTarget + "_reg.rsc") + .arg(installPathRegResource) + .arg(fixedTarget + "_reg.rsc") << endl; + + if (!iconFile.isEmpty()) { + if (epocBuild) { + t << QString("\"%1epoc32/data/z%2\" - \"!:%3\"") + .arg(epocRoot()) + .arg(iconFile) + .arg(QDir::toNativeSeparators(iconFile)) << endl << endl; + } else { + QDir mifIconDir(project->first("DESTDIR")); + QFileInfo mifIcon(mifIconDir.relativeFilePath(project->first("TARGET"))); + QString mifIconFileName = mifIcon.fileName(); + mifIconFileName.append(".mif"); + t << QString("\"%1/%2\" - \"!:%3\"") + .arg(mifIcon.path()) + .arg(mifIconFileName) + .arg(QDir::toNativeSeparators(iconFile)) << endl << endl; + } + } + } + } + + // deploy any additional DEPLOYMENT files + QString remoteTestPath; + remoteTestPath = QString("!:\\private\\%1").arg(privateDirUid); + + initProjectDeploySymbian(project, depList, remoteTestPath, true, epocBuild, "$(PLATFORM)", "$(TARGET)", generatedDirs, generatedFiles); + if (depList.size()) + t << "; DEPLOYMENT" << endl; + for (int i = 0; i < depList.size(); ++i) { + t << QString("\"%1\" - \"%2\"") + .arg(depList.at(i).from) + .arg(depList.at(i).to) << endl; + } + t << endl; + + // PKG post-rules - these are added after actual file installations i.e. SIS package body + t << "; Manual PKG post-rules from PRO files" << endl; + foreach(QString deploymentItem, project->values("DEPLOYMENT")) { + foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_postrules")) { + QStringList pkgrulesValue = project->values(pkgrulesItem); + // If there is no stringlist defined for a rule, use rule name directly + // This is convenience for defining single line statements + if (pkgrulesValue.isEmpty()) { + t << pkgrulesItem << endl; + } else { + foreach(QString pkgrule, pkgrulesValue) { + t << pkgrule << endl; + } + } + t << endl; + } + } + + // Close Manufacturer block + if (!project->values("DEPLOYMENT.manufacturers").isEmpty()) { + QString manufacturerFailNoteFile; + if (project->values("DEPLOYMENT.manufacturers.fail_note").isEmpty()) { + manufacturerFailNoteFile = QString("%1_" MANUFACTURER_NOTE_FILE).arg(uid3); + QFile ft(manufacturerFailNoteFile); + if (ft.open(QIODevice::WriteOnly)) { + generatedFiles << ft.fileName(); + QTextStream t2(&ft); + + t2 << QString(DEFAULT_MANUFACTURER_NOTE) << endl; + } else { + PRINT_FILE_CREATE_ERROR(manufacturerFailNoteFile) + } + } else { + manufacturerFailNoteFile = project->values("DEPLOYMENT.manufacturers.fail_note").join(""); + } + + t << "ELSEIF NOT(0) ; MANUFACTURER" << endl + << "\"" << generator->fileInfo(manufacturerFailNoteFile).absoluteFilePath() << "\"" + << " - \"\", FILETEXT, TEXTEXIT" << endl + << "ENDIF ; MANUFACTURER" << endl; + } + + // Write wrapper pkg + if (!installerSisHeader.isEmpty()) { + QFile wrapperPkgFile(wrapperPkgFilename); + if (!wrapperPkgFile.open(QIODevice::WriteOnly | QIODevice::Text)) { + PRINT_FILE_CREATE_ERROR(wrapperPkgFilename); + return; + } + + generatedFiles << wrapperPkgFile.fileName(); + QTextStream twf(&wrapperPkgFile); + + twf << wrapperStreamBuffer << endl; + + // Wrapped files deployment + QString currentPath = qmake_getpwd(); + QString sisName = QString("%1.sis").arg(pkgTarget); + twf << "\"" << currentPath << "/" << sisName << "\" - \"c:\\adm\\" << sisName << "\"" << endl; + + QString bootStrapPath = QLibraryInfo::location(QLibraryInfo::PrefixPath); + bootStrapPath.append("/bootstrap.sis"); + QFileInfo fi(generator->fileInfo(bootStrapPath)); + twf << "@\"" << fi.absoluteFilePath() << "\",(0x2002CCCD)" << endl; + } +} + +QString SymbianCommonGenerator::removePathSeparators(QString &file) +{ + QString ret = file; + while (ret.indexOf(QDir::separator()) > 0) { + ret.remove(0, ret.indexOf(QDir::separator()) + 1); + } + + return ret; +} + +void SymbianCommonGenerator::writeRegRssFile(QMap<QString, QStringList> &userItems) +{ + QString filename(fixedTarget); + filename.append("_reg.rss"); + if (!Option::output_dir.isEmpty()) + filename = Option::output_dir + '/' + filename; + QFile ft(filename); + if (ft.open(QIODevice::WriteOnly)) { + generatedFiles << ft.fileName(); + QTextStream t(&ft); + t << "// ============================================================================" << endl; + t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: "; + t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl; + t << "// * This file is generated by qmake and should not be modified by the" << endl; + t << "// * user." << endl; + t << "// ============================================================================" << endl; + t << endl; + t << "#include <" << fixedTarget << ".rsg>" << endl; + t << "#include <appinfo.rh>" << endl; + foreach(QString item, userItems[RSS_TAG_HEADER]) + t << item << endl; + t << endl; + t << "UID2 KUidAppRegistrationResourceFile" << endl; + t << "UID3 " << uid3 << endl << endl; + t << "RESOURCE APP_REGISTRATION_INFO" << endl; + t << "\t{" << endl; + t << "\tapp_file=\"" << fixedTarget << "\";" << endl; + t << "\tlocalisable_resource_file=\"" RESOURCE_DIRECTORY_RESOURCE << fixedTarget << "\";" << endl; + + writeRegRssList(t, userItems[RSS_TAG_SERVICE_LIST], + QLatin1String(RSS_TAG_SERVICE_LIST), + QLatin1String("SERVICE_INFO")); + writeRegRssList(t, userItems[RSS_TAG_FILE_OWNERSHIP_LIST], + QLatin1String(RSS_TAG_FILE_OWNERSHIP_LIST), + QLatin1String("FILE_OWNERSHIP_INFO")); + writeRegRssList(t, userItems[RSS_TAG_DATATYPE_LIST], + QLatin1String(RSS_TAG_DATATYPE_LIST), + QLatin1String("DATATYPE")); + t << endl; + + foreach(QString item, userItems[RSS_TAG_DEFAULT]) + t << "\t" << item.replace("\n","\n\t") << endl; + t << "\t}" << endl; + + foreach(QString item, userItems[RSS_TAG_FOOTER]) + t << item << endl; + } else { + PRINT_FILE_CREATE_ERROR(filename) + } +} + +void SymbianCommonGenerator::writeRegRssList(QTextStream &t, + QStringList &userList, + const QString &listTag, + const QString &listItem) +{ + int itemCount = userList.count(); + if (itemCount) { + t << "\t" << listTag << " ="<< endl; + t << "\t\t{" << endl; + foreach(QString item, userList) { + t << "\t\t" << listItem << endl; + t << "\t\t\t{" << endl; + t << "\t\t\t" << item.replace("\n","\n\t\t\t") << endl; + t << "\t\t\t}"; + if (--itemCount) + t << ","; + t << endl; + } + t << "\t\t}; "<< endl; + } +} + +void SymbianCommonGenerator::writeRssFile(QString &numberOfIcons, QString &iconFile) +{ + QString filename(fixedTarget); + if (!Option::output_dir.isEmpty()) + filename = Option::output_dir + '/' + filename; + filename.append(".rss"); + QFile ft(filename); + if (ft.open(QIODevice::WriteOnly)) { + generatedFiles << ft.fileName(); + QTextStream t(&ft); + t << "// ============================================================================" << endl; + t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: "; + t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl; + t << "// * This file is generated by qmake and should not be modified by the" << endl; + t << "// * user." << endl; + t << "// ============================================================================" << endl; + t << endl; + t << "#include <appinfo.rh>" << endl; + t << "#include \"" << fixedTarget << ".loc\"" << endl; + t << endl; + t << "RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info" << endl; + t << "\t{" << endl; + t << "\tshort_caption = STRING_r_short_caption;" << endl; + t << "\tcaption_and_icon =" << endl; + t << "\tCAPTION_AND_ICON_INFO" << endl; + t << "\t\t{" << endl; + t << "\t\tcaption = STRING_r_caption;" << endl; + + QString rssIconFile = iconFile; + rssIconFile = rssIconFile.replace("/", "\\\\"); + + if (numberOfIcons.isEmpty() || rssIconFile.isEmpty()) { + // There can be maximum one item in this tag, validated when parsed + t << "\t\tnumber_of_icons = 0;" << endl; + t << "\t\ticon_file = \"\";" << endl; + } else { + // There can be maximum one item in this tag, validated when parsed + t << "\t\tnumber_of_icons = " << numberOfIcons << ";" << endl; + t << "\t\ticon_file = \"" << rssIconFile << "\";" << endl; + } + t << "\t\t};" << endl; + t << "\t}" << endl; + t << endl; + } else { + PRINT_FILE_CREATE_ERROR(filename); + } +} + +void SymbianCommonGenerator::writeLocFile(QStringList &symbianLangCodes) +{ + QString filename(fixedTarget); + if (!Option::output_dir.isEmpty()) + filename = Option::output_dir + '/' + filename; + filename.append(".loc"); + QFile ft(filename); + if (ft.open(QIODevice::WriteOnly)) { + generatedFiles << ft.fileName(); + QTextStream t(&ft); + t << "// ============================================================================" << endl; + t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: "; + t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl; + t << "// * This file is generated by qmake and should not be modified by the" << endl; + t << "// * user." << endl; + t << "// ============================================================================" << endl; + t << endl; + t << "#ifdef LANGUAGE_SC" << endl; + t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl; + t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl; + foreach(QString lang, symbianLangCodes) { + t << "#elif defined LANGUAGE_" << lang << endl; + t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl; + t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl; + } + t << "#else" << endl; + t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl; + t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl; + t << "#endif" << endl; + } else { + PRINT_FILE_CREATE_ERROR(filename); + } +} + +void SymbianCommonGenerator::readRssRules(QString &numberOfIcons, + QString &iconFile, QMap<QString, + QStringList> &userRssRules) +{ + QMakeProject *project = generator->project; + for (QMap<QString, QStringList>::iterator it = project->variables().begin(); it != project->variables().end(); ++it) { + if (it.key().startsWith(RSS_RULES_BASE)) { + QString newKey = it.key().mid(sizeof(RSS_RULES_BASE) - 1); + if (newKey.isEmpty()) { + fprintf(stderr, "Warning: Empty RSS_RULES_BASE key encountered\n"); + continue; + } + QStringList newValues; + QStringList values = it.value(); + foreach(QString item, values) { + // If there is no stringlist defined for a rule, use rule value directly + // This is convenience for defining single line statements + if (project->values(item).isEmpty()) { + newValues << item; + } else { + QStringList itemList; + foreach(QString itemRow, project->values(item)) { + itemList << itemRow; + } + newValues << itemList.join("\n"); + } + } + // Verify thet there is exactly one value in RSS_TAG_NBROFICONS + if (newKey == RSS_TAG_NBROFICONS) { + if (newValues.count() == 1) { + numberOfIcons = newValues[0]; + } else { + fprintf(stderr, "Warning: There must be exactly one value in '%s%s'\n", + RSS_RULES_BASE, RSS_TAG_NBROFICONS); + continue; + } + // Verify thet there is exactly one value in RSS_TAG_ICONFILE + } else if (newKey == RSS_TAG_ICONFILE) { + if (newValues.count() == 1) { + iconFile = newValues[0]; + } else { + fprintf(stderr, "Warning: There must be exactly one value in '%s%s'\n", + RSS_RULES_BASE, RSS_TAG_ICONFILE); + continue; + } + } else if (newKey == RSS_TAG_HEADER + || newKey == RSS_TAG_SERVICE_LIST + || newKey == RSS_TAG_FILE_OWNERSHIP_LIST + || newKey == RSS_TAG_DATATYPE_LIST + || newKey == RSS_TAG_FOOTER + || newKey == RSS_TAG_DEFAULT) { + userRssRules[newKey] = newValues; + continue; + } else { + fprintf(stderr, "Warning: Unsupported key:'%s%s'\n", + RSS_RULES_BASE, newKey.toLatin1().constData()); + continue; + } + } + } + + QStringList newValues; + foreach(QString item, project->values(RSS_RULES)) { + // If there is no stringlist defined for a rule, use rule value directly + // This is convenience for defining single line statements + if (project->values(item).isEmpty()) { + newValues << item; + } else { + newValues << project->values(item); + } + } + userRssRules[RSS_TAG_DEFAULT] << newValues; + + // Validate that either both RSS_TAG_NBROFICONS and RSS_TAG_ICONFILE keys exist + // or neither of them exist + if (!((numberOfIcons.isEmpty() && iconFile.isEmpty()) || + (!numberOfIcons.isEmpty() && !iconFile.isEmpty()))) { + numberOfIcons.clear(); + iconFile.clear(); + fprintf(stderr, "Warning: Both or neither of '%s%s' and '%s%s' keys must exist.\n", + RSS_RULES_BASE, RSS_TAG_NBROFICONS, RSS_RULES_BASE, RSS_TAG_ICONFILE); + } + + // Validate that RSS_TAG_NBROFICONS contains only numbers + if (!numberOfIcons.isEmpty()) { + bool ok; + numberOfIcons = numberOfIcons.simplified(); + numberOfIcons.toInt(&ok); + if (!ok) { + numberOfIcons.clear(); + iconFile.clear(); + fprintf(stderr, "Warning: '%s%s' must be integer in decimal format.\n", + RSS_RULES_BASE, RSS_TAG_NBROFICONS); + } + } +} + +QStringList SymbianCommonGenerator::symbianLangCodesFromTsFiles() +{ + QStringList tsfiles; + QStringList symbianLangCodes; + tsfiles << generator->project->values("TRANSLATIONS"); + + fillQt2S60LangMapTable(); + + foreach(QString file, tsfiles) { + int extIndex = file.lastIndexOf("."); + int langIndex = file.lastIndexOf("_", (extIndex - file.length())); + langIndex += 1; + QString qtlang = file.mid(langIndex, extIndex - langIndex); + QString s60lang = qt2S60LangMapTable.value(qtlang, QString("SC")); + + if (!symbianLangCodes.contains(s60lang) && s60lang != "SC") + symbianLangCodes += s60lang; + } + + return symbianLangCodes; +} + +void SymbianCommonGenerator::fillQt2S60LangMapTable() +{ + qt2S60LangMapTable.reserve(170); // 165 items at time of writing. + qt2S60LangMapTable.insert("ab", "SC"); //Abkhazian // + qt2S60LangMapTable.insert("om", "SC"); //Afan // + qt2S60LangMapTable.insert("aa", "SC"); //Afar // + qt2S60LangMapTable.insert("af", "34"); //Afrikaans //Afrikaans + qt2S60LangMapTable.insert("sq", "35"); //Albanian //Albanian + qt2S60LangMapTable.insert("am", "36"); //Amharic //Amharic + qt2S60LangMapTable.insert("ar", "37"); //Arabic //Arabic + qt2S60LangMapTable.insert("hy", "38"); //Armenian //Armenian + qt2S60LangMapTable.insert("as", "SC"); //Assamese // + qt2S60LangMapTable.insert("ay", "SC"); //Aymara // + qt2S60LangMapTable.insert("az", "SC"); //Azerbaijani // + qt2S60LangMapTable.insert("ba", "SC"); //Bashkir // + qt2S60LangMapTable.insert("eu", "SC"); //Basque // + qt2S60LangMapTable.insert("bn", "41"); //Bengali //Bengali + qt2S60LangMapTable.insert("dz", "SC"); //Bhutani // + qt2S60LangMapTable.insert("bh", "SC"); //Bihari // + qt2S60LangMapTable.insert("bi", "SC"); //Bislama // + qt2S60LangMapTable.insert("br", "SC"); //Breton // + qt2S60LangMapTable.insert("bg", "42"); //Bulgarian //Bulgarian + qt2S60LangMapTable.insert("my", "43"); //Burmese //Burmese + qt2S60LangMapTable.insert("be", "40"); //Byelorussian //Belarussian + qt2S60LangMapTable.insert("km", "SC"); //Cambodian // + qt2S60LangMapTable.insert("ca", "44"); //Catalan //Catalan + qt2S60LangMapTable.insert("zh", "SC"); //Chinese // + qt2S60LangMapTable.insert("co", "SC"); //Corsican // + qt2S60LangMapTable.insert("hr", "45"); //Croatian //Croatian + qt2S60LangMapTable.insert("cs", "25"); //Czech //Czech + qt2S60LangMapTable.insert("da", "07"); //Danish //Danish + qt2S60LangMapTable.insert("nl", "18"); //Dutch //Dutch + qt2S60LangMapTable.insert("en", "01"); //English //English(UK) + qt2S60LangMapTable.insert("eo", "SC"); //Esperanto // + qt2S60LangMapTable.insert("et", "49"); //Estonian //Estonian + qt2S60LangMapTable.insert("fo", "SC"); //Faroese // + qt2S60LangMapTable.insert("fj", "SC"); //Fiji // + qt2S60LangMapTable.insert("fi", "09"); //Finnish //Finnish + qt2S60LangMapTable.insert("fr", "02"); //French //French + qt2S60LangMapTable.insert("fy", "SC"); //Frisian // + qt2S60LangMapTable.insert("gd", "52"); //Gaelic //Gaelic + qt2S60LangMapTable.insert("gl", "SC"); //Galician // + qt2S60LangMapTable.insert("ka", "53"); //Georgian //Georgian + qt2S60LangMapTable.insert("de", "03"); //German //German + qt2S60LangMapTable.insert("el", "54"); //Greek //Greek + qt2S60LangMapTable.insert("kl", "SC"); //Greenlandic // + qt2S60LangMapTable.insert("gn", "SC"); //Guarani // + qt2S60LangMapTable.insert("gu", "56"); //Gujarati //Gujarati + qt2S60LangMapTable.insert("ha", "SC"); //Hausa // + qt2S60LangMapTable.insert("he", "57"); //Hebrew //Hebrew + qt2S60LangMapTable.insert("hi", "58"); //Hindi //Hindi + qt2S60LangMapTable.insert("hu", "17"); //Hungarian //Hungarian + qt2S60LangMapTable.insert("is", "15"); //Icelandic //Icelandic + qt2S60LangMapTable.insert("id", "59"); //Indonesian //Indonesian + qt2S60LangMapTable.insert("ia", "SC"); //Interlingua // + qt2S60LangMapTable.insert("ie", "SC"); //Interlingue // + qt2S60LangMapTable.insert("iu", "SC"); //Inuktitut // + qt2S60LangMapTable.insert("ik", "SC"); //Inupiak // + qt2S60LangMapTable.insert("ga", "60"); //Irish //Irish + qt2S60LangMapTable.insert("it", "05"); //Italian //Italian + qt2S60LangMapTable.insert("ja", "32"); //Japanese //Japanese + qt2S60LangMapTable.insert("jv", "SC"); //Javanese // + qt2S60LangMapTable.insert("kn", "62"); //Kannada //Kannada + qt2S60LangMapTable.insert("ks", "SC"); //Kashmiri // + qt2S60LangMapTable.insert("kk", "63"); //Kazakh //Kazakh + qt2S60LangMapTable.insert("rw", "SC"); //Kinyarwanda // + qt2S60LangMapTable.insert("ky", "SC"); //Kirghiz // + qt2S60LangMapTable.insert("ko", "65"); //Korean //Korean + qt2S60LangMapTable.insert("ku", "SC"); //Kurdish // + qt2S60LangMapTable.insert("rn", "SC"); //Kurundi // + qt2S60LangMapTable.insert("lo", "66"); //Laothian //Laothian + qt2S60LangMapTable.insert("la", "SC"); //Latin // + qt2S60LangMapTable.insert("lv", "67"); //Latvian //Latvian + qt2S60LangMapTable.insert("ln", "SC"); //Lingala // + qt2S60LangMapTable.insert("lt", "68"); //Lithuanian //Lithuanian + qt2S60LangMapTable.insert("mk", "69"); //Macedonian //Macedonian + qt2S60LangMapTable.insert("mg", "SC"); //Malagasy // + qt2S60LangMapTable.insert("ms", "70"); //Malay //Malay + qt2S60LangMapTable.insert("ml", "71"); //Malayalam //Malayalam + qt2S60LangMapTable.insert("mt", "SC"); //Maltese // + qt2S60LangMapTable.insert("mi", "SC"); //Maori // + qt2S60LangMapTable.insert("mr", "72"); //Marathi //Marathi + qt2S60LangMapTable.insert("mo", "73"); //Moldavian //Moldovian + qt2S60LangMapTable.insert("mn", "74"); //Mongolian //Mongolian + qt2S60LangMapTable.insert("na", "SC"); //Nauru // + qt2S60LangMapTable.insert("ne", "SC"); //Nepali // + qt2S60LangMapTable.insert("nb", "08"); //Norwegian //Norwegian + qt2S60LangMapTable.insert("oc", "SC"); //Occitan // + qt2S60LangMapTable.insert("or", "SC"); //Oriya // + qt2S60LangMapTable.insert("ps", "SC"); //Pashto // + qt2S60LangMapTable.insert("fa", "SC"); //Persian // + qt2S60LangMapTable.insert("pl", "27"); //Polish //Polish + qt2S60LangMapTable.insert("pt", "13"); //Portuguese //Portuguese + qt2S60LangMapTable.insert("pa", "77"); //Punjabi //Punjabi + qt2S60LangMapTable.insert("qu", "SC"); //Quechua // + qt2S60LangMapTable.insert("rm", "SC"); //RhaetoRomance // + qt2S60LangMapTable.insert("ro", "78"); //Romanian //Romanian + qt2S60LangMapTable.insert("ru", "16"); //Russian //Russian + qt2S60LangMapTable.insert("sm", "SC"); //Samoan // + qt2S60LangMapTable.insert("sg", "SC"); //Sangho // + qt2S60LangMapTable.insert("sa", "SC"); //Sanskrit // + qt2S60LangMapTable.insert("sr", "79"); //Serbian //Serbian + qt2S60LangMapTable.insert("sh", "SC"); //SerboCroatian // + qt2S60LangMapTable.insert("st", "SC"); //Sesotho // + qt2S60LangMapTable.insert("tn", "SC"); //Setswana // + qt2S60LangMapTable.insert("sn", "SC"); //Shona // + qt2S60LangMapTable.insert("sd", "SC"); //Sindhi // + qt2S60LangMapTable.insert("si", "80"); //Singhalese //Sinhalese + qt2S60LangMapTable.insert("ss", "SC"); //Siswati // + qt2S60LangMapTable.insert("sk", "26"); //Slovak //Slovak + qt2S60LangMapTable.insert("sl", "28"); //Slovenian //Slovenian + qt2S60LangMapTable.insert("so", "81"); //Somali //Somali + qt2S60LangMapTable.insert("es", "04"); //Spanish //Spanish + qt2S60LangMapTable.insert("su", "SC"); //Sundanese // + qt2S60LangMapTable.insert("sw", "84"); //Swahili //Swahili + qt2S60LangMapTable.insert("sv", "06"); //Swedish //Swedish + qt2S60LangMapTable.insert("tl", "39"); //Tagalog //Tagalog + qt2S60LangMapTable.insert("tg", "SC"); //Tajik // + qt2S60LangMapTable.insert("ta", "87"); //Tamil //Tamil + qt2S60LangMapTable.insert("tt", "SC"); //Tatar // + qt2S60LangMapTable.insert("te", "88"); //Telugu //Telugu + qt2S60LangMapTable.insert("th", "33"); //Thai //Thai + qt2S60LangMapTable.insert("bo", "89"); //Tibetan //Tibetan + qt2S60LangMapTable.insert("ti", "90"); //Tigrinya //Tigrinya + qt2S60LangMapTable.insert("to", "SC"); //Tonga // + qt2S60LangMapTable.insert("ts", "SC"); //Tsonga // + qt2S60LangMapTable.insert("tr", "14"); //Turkish //Turkish + qt2S60LangMapTable.insert("tk", "92"); //Turkmen //Turkmen + qt2S60LangMapTable.insert("tw", "SC"); //Twi // + qt2S60LangMapTable.insert("ug", "SC"); //Uigur // + qt2S60LangMapTable.insert("uk", "93"); //Ukrainian //Ukrainian + qt2S60LangMapTable.insert("ur", "94"); //Urdu //Urdu + qt2S60LangMapTable.insert("uz", "SC"); //Uzbek // + qt2S60LangMapTable.insert("vi", "96"); //Vietnamese //Vietnamese + qt2S60LangMapTable.insert("vo", "SC"); //Volapuk // + qt2S60LangMapTable.insert("cy", "97"); //Welsh //Welsh + qt2S60LangMapTable.insert("wo", "SC"); //Wolof // + qt2S60LangMapTable.insert("xh", "SC"); //Xhosa // + qt2S60LangMapTable.insert("yi", "SC"); //Yiddish // + qt2S60LangMapTable.insert("yo", "SC"); //Yoruba // + qt2S60LangMapTable.insert("za", "SC"); //Zhuang // + qt2S60LangMapTable.insert("zu", "98"); //Zulu //Zulu + qt2S60LangMapTable.insert("nn", "75"); //Nynorsk //NorwegianNynorsk + qt2S60LangMapTable.insert("bs", "SC"); //Bosnian // + qt2S60LangMapTable.insert("dv", "SC"); //Divehi // + qt2S60LangMapTable.insert("gv", "SC"); //Manx // + qt2S60LangMapTable.insert("kw", "SC"); //Cornish // + qt2S60LangMapTable.insert("ak", "SC"); //Akan // + qt2S60LangMapTable.insert("kok", "SC"); //Konkani // + qt2S60LangMapTable.insert("gaa", "SC"); //Ga // + qt2S60LangMapTable.insert("ig", "SC"); //Igbo // + qt2S60LangMapTable.insert("kam", "SC"); //Kamba // + qt2S60LangMapTable.insert("syr", "SC"); //Syriac // + qt2S60LangMapTable.insert("byn", "SC"); //Blin // + qt2S60LangMapTable.insert("gez", "SC"); //Geez // + qt2S60LangMapTable.insert("kfo", "SC"); //Koro // + qt2S60LangMapTable.insert("sid", "SC"); //Sidamo // + qt2S60LangMapTable.insert("cch", "SC"); //Atsam // + qt2S60LangMapTable.insert("tig", "SC"); //Tigre // + qt2S60LangMapTable.insert("kaj", "SC"); //Jju // + qt2S60LangMapTable.insert("fur", "SC"); //Friulian // + qt2S60LangMapTable.insert("ve", "SC"); //Venda // + qt2S60LangMapTable.insert("ee", "SC"); //Ewe // + qt2S60LangMapTable.insert("wa", "SC"); //Walamo // + qt2S60LangMapTable.insert("haw", "SC"); //Hawaiian // + qt2S60LangMapTable.insert("kcg", "SC"); //Tyap // + qt2S60LangMapTable.insert("ny", "SC"); //Chewa // +} + diff --git a/qmake/generators/symbian/symbiancommon.h b/qmake/generators/symbian/symbiancommon.h new file mode 100644 index 0000000..e2b1173 --- /dev/null +++ b/qmake/generators/symbian/symbiancommon.h @@ -0,0 +1,100 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the qmake application of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef SYMBIANCOMMON_H +#define SYMBIANCOMMON_H + +#include <project.h> +#include <makefile.h> +#include "initprojectdeploy_symbian.h" + +#define PRINT_FILE_CREATE_ERROR(filename) fprintf(stderr, "Error: Could not create '%s'\n", qPrintable(filename)); + +class SymbianCommonGenerator +{ +public: + enum TargetType { + TypeExe, + TypeDll, + TypeLib, + TypePlugin, + TypeSubdirs + }; + + SymbianCommonGenerator(MakefileGenerator *generator); + + virtual void init(); + +protected: + + QString removePathSeparators(QString &file); + void removeSpecialCharacters(QString& str); + void removeEpocSpecialCharacters(QString& str); + void generatePkgFile(const QString &iconFile, DeploymentList &depList, bool epocBuild); + bool containsStartWithItem(const QChar &c, const QStringList& src); + + void writeRegRssFile(QMap<QString, QStringList> &useritems); + void writeRegRssList(QTextStream &t, QStringList &userList, + const QString &listTag, + const QString &listItem); + void writeRssFile(QString &numberOfIcons, QString &iconfile); + void writeLocFile(QStringList &symbianLangCodes); + void readRssRules(QString &numberOfIcons, + QString &iconFile, + QMap<QString, QStringList> &userRssRules); + + QStringList symbianLangCodesFromTsFiles(); + void fillQt2S60LangMapTable(); + +protected: + MakefileGenerator *generator; + + QStringList generatedFiles; + QStringList generatedDirs; + QString fixedTarget; + QString privateDirUid; + QString uid3; + TargetType targetType; + + QHash<QString, QString> qt2S60LangMapTable; +}; + +#endif // SYMBIANCOMMON_H diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index b84f0f1..569f529 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -53,7 +53,6 @@ #include <symbian/epocroot.h> #define RESOURCE_DIRECTORY_MMP "/resource/apps" -#define RESOURCE_DIRECTORY_RESOURCE "\\\\resource\\\\apps\\\\" #define REGISTRATION_RESOURCE_DIRECTORY_HW "/private/10003a3f/import/apps" #define PLUGIN_COMMON_DEF_FILE_FOR_MMP "./plugin_common.def" #define PLUGIN_COMMON_DEF_FILE_ACTUAL "plugin_commonu.def" @@ -66,17 +65,6 @@ #define BLD_INF_TAG_EXTENSIONS "prj_extensions" #define BLD_INF_TAG_TESTEXTENSIONS "prj_testextensions" -#define RSS_RULES "RSS_RULES" -#define RSS_RULES_BASE "RSS_RULES." -#define RSS_TAG_NBROFICONS "number_of_icons" -#define RSS_TAG_ICONFILE "icon_file" -#define RSS_TAG_HEADER "header" -#define RSS_TAG_SERVICE_LIST "service_list" -#define RSS_TAG_FILE_OWNERSHIP_LIST "file_ownership_list" -#define RSS_TAG_DATATYPE_LIST "datatype_list" -#define RSS_TAG_FOOTER "footer" -#define RSS_TAG_DEFAULT "default_rules" // Same as just giving rules without tag - #define MMP_TARGET "TARGET" #define MMP_TARGETTYPE "TARGETTYPE" #define MMP_SECUREID "SECUREID" @@ -96,13 +84,6 @@ #define MMP_START_RESOURCE "START RESOURCE" #define MMP_END_RESOURCE "END" -#define PRINT_FILE_CREATE_ERROR(filename) fprintf(stderr, "Error: Could not create '%s'\n", qPrintable(filename)); - -#define MANUFACTURER_NOTE_FILE "manufacturer_note.txt" -#define DEFAULT_MANUFACTURER_NOTE \ - "The package is not supported for devices from this manufacturer. Please try the selfsigned " \ - "version of the package instead." - QString SymbianMakefileGenerator::fixPathForMmp(const QString& origPath, const QDir& parentDir) { static QString epocRootStr; @@ -160,7 +141,7 @@ QString SymbianMakefileGenerator::absolutizePath(const QString& origPath) return resultPath; } -SymbianMakefileGenerator::SymbianMakefileGenerator() : MakefileGenerator() { } +SymbianMakefileGenerator::SymbianMakefileGenerator() : MakefileGenerator(), SymbianCommonGenerator(this) { } SymbianMakefileGenerator::~SymbianMakefileGenerator() { } void SymbianMakefileGenerator::writeHeader(QTextStream &t) @@ -187,7 +168,7 @@ void SymbianMakefileGenerator::writeHeader(QTextStream &t) bldinfDefine.append(generate_uid(project->projectFile())); bldinfDefine.prepend("BLD_INF_"); - removeSpecialCharacters(bldinfDefine); + removeEpocSpecialCharacters(bldinfDefine); t << "#define " << bldinfDefine.toUpper() << endl << endl; } @@ -220,7 +201,7 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) } if (generatePkg) { - generatePkgFile(iconFile, depList); + generatePkgFile(iconFile, depList, true); } writeBldInfContent(t, generatePkg, iconFile, depList); @@ -280,264 +261,6 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) return true; } -void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile, DeploymentList &depList) -{ - QString pkgFilename = QString("%1_template.%2") - .arg(fixedTarget) - .arg("pkg"); - QFile pkgFile(pkgFilename); - if (!pkgFile.open(QIODevice::WriteOnly | QIODevice::Text)) { - PRINT_FILE_CREATE_ERROR(pkgFilename); - return; - } - - generatedFiles << pkgFile.fileName(); - QTextStream t(&pkgFile); - - QString installerSisHeader = project->values("DEPLOYMENT.installer_header").join("\n"); - if (installerSisHeader.isEmpty()) - installerSisHeader = "0xA000D7CE"; // Use default self-signable UID if not defined - - QString wrapperStreamBuffer; - QTextStream tw(&wrapperStreamBuffer); - - QString dateStr = QDateTime::currentDateTime().toString(Qt::ISODate); - - // Header info - QString wrapperPkgFilename = QString("%1_installer.%2") - .arg(fixedTarget) - .arg("pkg"); - QString headerComment = "; %1 generated by qmake at %2\n" - "; This file is generated by qmake and should not be modified by the user\n" - ";\n\n"; - t << headerComment.arg(pkgFilename).arg(dateStr); - tw << headerComment.arg(wrapperPkgFilename).arg(dateStr); - - // Construct QStringList from pkg_prerules since we need search it before printed to file - QStringList rawPkgPreRules; - foreach(QString deploymentItem, project->values("DEPLOYMENT")) { - foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_prerules")) { - QStringList pkgrulesValue = project->values(pkgrulesItem); - // If there is no stringlist defined for a rule, use rule name directly - // This is convenience for defining single line mmp statements - if (pkgrulesValue.isEmpty()) { - rawPkgPreRules << pkgrulesItem; - } else { - foreach(QString pkgrule, pkgrulesValue) { - rawPkgPreRules << pkgrule; - } - } - } - } - - // Apply some defaults if specific data does not exist in PKG pre-rules - - if (!containsStartWithItem('&', rawPkgPreRules)) { - // language, (*** hardcoded to english atm, should be parsed from TRANSLATIONS) - QString languageCode = "; Language\n&EN\n\n"; - t << languageCode; - tw << languageCode; - } else { - // In case user defines langs, he must take care also about SIS header - if (!containsStartWithItem('#', rawPkgPreRules)) - fprintf(stderr, "Warning: If language is defined with DEPLOYMENT pkg_prerules, also the SIS header must be defined\n"); - } - - // name of application, UID and version - QString applicationVersion = project->first("VERSION").isEmpty() ? "1,0,0" : project->first("VERSION").replace('.', ','); - QString sisHeader = "; SIS header: name, uid, version\n#{\"%1\"},(%2),%3\n\n"; - QString visualTarget = escapeFilePath(fileFixify(project->first("TARGET"))); - visualTarget = removePathSeparators(visualTarget); - QString wrapperTarget = visualTarget + " installer"; - - if (installerSisHeader.startsWith("0x", Qt::CaseInsensitive)) { - tw << sisHeader.arg(wrapperTarget).arg(installerSisHeader).arg(applicationVersion); - } else { - tw << installerSisHeader << endl; - } - - if (!containsStartWithItem('#', rawPkgPreRules)) { - t << sisHeader.arg(visualTarget).arg(uid3).arg(applicationVersion); - } - - // Localized vendor name - QString vendorName; - if (!containsStartWithItem('%', rawPkgPreRules)) { - vendorName += "; Localised Vendor name\n%{\"Vendor\"}\n\n"; - } - - // Unique vendor name - if (!containsStartWithItem(':', rawPkgPreRules)) { - vendorName += "; Unique Vendor name\n:\"Vendor\"\n\n"; - } - - t << vendorName; - tw << vendorName; - - // PKG pre-rules - these are added before actual file installations i.e. SIS package body - if (rawPkgPreRules.size()) { - QString comment = "\n; Manual PKG pre-rules from PRO files\n"; - t << comment; - tw << comment; - - foreach(QString item, rawPkgPreRules) { - // Only regular pkg file should have package dependencies or pkg header if that is - // defined using prerules. - if (!item.startsWith("(") && !item.startsWith("#")) { - tw << item << endl; - } - t << item << endl; - } - t << endl; - tw << endl; - } - - // Begin Manufacturer block - if (!project->values("DEPLOYMENT.manufacturers").isEmpty()) { - QString manufacturerStr("IF "); - foreach(QString manufacturer, project->values("DEPLOYMENT.manufacturers")) { - manufacturerStr.append(QString("(MANUFACTURER)=(%1) OR \n ").arg(manufacturer)); - } - // Remove the final OR - manufacturerStr.chop(8); - t << manufacturerStr << endl; - } - - // Install paths on the phone *** should be dynamic at some point - QString installPathBin = "!:\\sys\\bin"; - QString installPathResource = "!:\\resource\\apps"; - QString installPathRegResource = "!:\\private\\10003a3f\\import\\apps"; - - // Find location of builds - QString epocReleasePath = QString("%1epoc32/release/$(PLATFORM)/$(TARGET)") - .arg(epocRoot()); - - if (targetType == TypeExe) { - // deploy .exe file - t << "; Executable and default resource files" << endl; - QString exeFile = fixedTarget + ".exe"; - t << QString("\"%1/%2\" - \"%3\\%4\"") - .arg(epocReleasePath) - .arg(exeFile) - .arg(installPathBin) - .arg(exeFile) << endl; - - // deploy rsc & reg_rsc file - if (!project->isActiveConfig("no_icon")) { - t << QString("\"%1epoc32/data/z/resource/apps/%2\" - \"%3\\%4\"") - .arg(epocRoot()) - .arg(fixedTarget + ".rsc") - .arg(installPathResource) - .arg(fixedTarget + ".rsc") << endl; - - t << QString("\"%1epoc32/data/z/private/10003a3f/import/apps/%2\" - \"%3\\%4\"") - .arg(epocRoot()) - .arg(fixedTarget + "_reg.rsc") - .arg(installPathRegResource) - .arg(fixedTarget + "_reg.rsc") << endl; - - if (!iconFile.isEmpty()) { - t << QString("\"%1epoc32/data/z%2\" - \"!:%3\"") - .arg(epocRoot()) - .arg(iconFile) - .arg(QDir::toNativeSeparators(iconFile)) << endl << endl; - } - } - } - - // deploy any additional DEPLOYMENT files - QString remoteTestPath; - remoteTestPath = QString("!:\\private\\%1").arg(privateDirUid); - - initProjectDeploySymbian(project, depList, remoteTestPath, true, "$(PLATFORM)", "$(TARGET)", generatedDirs, generatedFiles); - if (depList.size()) - t << "; DEPLOYMENT" << endl; - for (int i = 0; i < depList.size(); ++i) { - t << QString("\"%1\" - \"%2\"") - .arg(QString(depList.at(i).from).replace('\\','/')) - .arg(QString(depList.at(i).to).replace('/','\\')) << endl; - } - t << endl; - - // PKG post-rules - these are added after actual file installations i.e. SIS package body - t << "; Manual PKG post-rules from PRO files" << endl; - foreach(QString deploymentItem, project->values("DEPLOYMENT")) { - foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_postrules")) { - QStringList pkgrulesValue = project->values(pkgrulesItem); - // If there is no stringlist defined for a rule, use rule name directly - // This is convenience for defining single line statements - if (pkgrulesValue.isEmpty()) { - t << pkgrulesItem << endl; - } else { - foreach(QString pkgrule, pkgrulesValue) { - t << pkgrule << endl; - } - } - t << endl; - } - } - - // Close Manufacturer block - if (!project->values("DEPLOYMENT.manufacturers").isEmpty()) { - QString manufacturerFailNoteFile; - if (project->values("DEPLOYMENT.manufacturers.fail_note").isEmpty()) { - manufacturerFailNoteFile = QString("%1_" MANUFACTURER_NOTE_FILE).arg(uid3); - QFile ft(manufacturerFailNoteFile); - if (ft.open(QIODevice::WriteOnly)) { - generatedFiles << ft.fileName(); - QTextStream t2(&ft); - - t2 << QString(DEFAULT_MANUFACTURER_NOTE) << endl; - } else { - PRINT_FILE_CREATE_ERROR(manufacturerFailNoteFile) - } - } else { - manufacturerFailNoteFile = project->values("DEPLOYMENT.manufacturers.fail_note").join(""); - } - - t << "ELSEIF NOT(0) ; MANUFACTURER" << endl - << "\"" << fileInfo(manufacturerFailNoteFile).absoluteFilePath() << "\"" - << " - \"\", FILETEXT, TEXTEXIT" << endl - << "ENDIF ; MANUFACTURER" << endl; - } - - // Write wrapper pkg - if (!installerSisHeader.isEmpty()) { - QFile wrapperPkgFile(wrapperPkgFilename); - if (!wrapperPkgFile.open(QIODevice::WriteOnly | QIODevice::Text)) { - PRINT_FILE_CREATE_ERROR(wrapperPkgFilename); - return; - } - - generatedFiles << wrapperPkgFile.fileName(); - QTextStream twf(&wrapperPkgFile); - - twf << wrapperStreamBuffer << endl; - - // Wrapped files deployment - QString currentPath = qmake_getpwd(); - QString sisName = QString("%1.sis").arg(fixedTarget); - twf << "\"" << currentPath << "/" << sisName << "\" - \"c:\\adm\\" << sisName << "\"" << endl; - - QString bootStrapPath = QLibraryInfo::location(QLibraryInfo::PrefixPath); - bootStrapPath.append("/smartinstaller.sis"); - QFileInfo fi(fileInfo(bootStrapPath)); - twf << "@\"" << fi.absoluteFilePath() << "\",(0x2002CCCD)" << endl; - } -} - -bool SymbianMakefileGenerator::containsStartWithItem(const QChar &c, const QStringList& src) -{ - bool result = false; - foreach(QString str, src) { - if (str.startsWith(c)) { - result = true; - break; - } - } - return result; -} - void SymbianMakefileGenerator::writeCustomDefFile() { if (targetType == TypePlugin && !project->isActiveConfig("stdbinary")) { @@ -575,9 +298,7 @@ void SymbianMakefileGenerator::writeCustomDefFile() void SymbianMakefileGenerator::init() { MakefileGenerator::init(); - fixedTarget = escapeFilePath(fileFixify(project->first("TARGET"))); - fixedTarget = removePathSeparators(fixedTarget); - removeSpecialCharacters(fixedTarget); + SymbianCommonGenerator::init(); if (0 != project->values("QMAKE_PLATFORM").size()) platform = varGlue("QMAKE_PLATFORM", "", " ", ""); @@ -594,60 +315,9 @@ void SymbianMakefileGenerator::init() // .mmp initMmpVariables(); - // Check TARGET.UID3 presence - if (0 != project->values("TARGET.UID3").size()) { - uid3 = project->first("TARGET.UID3"); - } else { - uid3 = generateUID3(); - } - - if ((project->values("TEMPLATE")).contains("app")) - targetType = TypeExe; - else if ((project->values("TEMPLATE")).contains("lib")) { - // Check CONFIG to see if we are to build staticlib or dll - if (project->isActiveConfig("staticlib") || project->isActiveConfig("static")) - targetType = TypeLib; - else if (project->isActiveConfig("plugin")) - targetType = TypePlugin; - else - targetType = TypeDll; - } else { - targetType = TypeSubdirs; - } - - if (0 != project->values("TARGET.UID2").size()) { - uid2 = project->first("TARGET.UID2"); - } else if (project->isActiveConfig("stdbinary")) { - uid2 = "0x20004C45"; - } else { - if (targetType == TypeExe) { - if (project->values("QT").contains("gui", Qt::CaseInsensitive)) { - // exe and gui -> uid2 needed - uid2 = "0x100039CE"; - } else { - // exe but not gui: uid2 is ignored anyway -> set it to 0 - uid2 = "0"; - } - } else if (targetType == TypeDll || targetType == TypeLib || targetType == TypePlugin) { - uid2 = "0x1000008d"; - } - } + uid2 = project->first("TARGET.UID2"); uid2 = uid2.trimmed(); - uid3 = uid3.trimmed(); - - // UID is valid as either hex or decimal, so just convert it to number and back to hex - // to get proper string for private dir - bool conversionOk = false; - uint uidNum = uid3.toUInt(&conversionOk, 0); - - if (!conversionOk) { - fprintf(stderr, "Error: Invalid UID \"%s\".\n", uid3.toUtf8().constData()); - } else { - privateDirUid.setNum(uidNum, 16); - while (privateDirUid.length() < 8) - privateDirUid.insert(0, QLatin1Char('0')); - } } QString SymbianMakefileGenerator::getTargetExtension() @@ -1345,7 +1015,7 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy QString uid = generate_uid(fullProName); QString bldinfDefine = QString("BLD_INF_") + subdirFileName + QString("_") + uid; bldinfDefine = bldinfDefine.toUpper(); - removeSpecialCharacters(bldinfDefine); + removeEpocSpecialCharacters(bldinfDefine); if (!condition.isEmpty()) t << "#if defined(" << condition << ")" << endl; @@ -1424,442 +1094,6 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy } } -void SymbianMakefileGenerator::writeRegRssFile(QMap<QString, QStringList> &userItems) -{ - QString filename(fixedTarget); - filename.append("_reg.rss"); - QFile ft(filename); - if (ft.open(QIODevice::WriteOnly)) { - generatedFiles << ft.fileName(); - QTextStream t(&ft); - t << "// ============================================================================" << endl; - t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: "; - t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl; - t << "// * This file is generated by qmake and should not be modified by the" << endl; - t << "// * user." << endl; - t << "// ============================================================================" << endl; - t << endl; - t << "#include <" << fixedTarget << ".rsg>" << endl; - t << "#include <appinfo.rh>" << endl; - foreach(QString item, userItems[RSS_TAG_HEADER]) - t << item << endl; - t << endl; - t << "UID2 KUidAppRegistrationResourceFile" << endl; - t << "UID3 " << uid3 << endl << endl; - t << "RESOURCE APP_REGISTRATION_INFO" << endl; - t << "\t{" << endl; - t << "\tapp_file=\"" << fixedTarget << "\";" << endl; - t << "\tlocalisable_resource_file=\"" RESOURCE_DIRECTORY_RESOURCE << fixedTarget << "\";" << endl; - - writeRegRssList(t, userItems[RSS_TAG_SERVICE_LIST], - QLatin1String(RSS_TAG_SERVICE_LIST), - QLatin1String("SERVICE_INFO")); - writeRegRssList(t, userItems[RSS_TAG_FILE_OWNERSHIP_LIST], - QLatin1String(RSS_TAG_FILE_OWNERSHIP_LIST), - QLatin1String("FILE_OWNERSHIP_INFO")); - writeRegRssList(t, userItems[RSS_TAG_DATATYPE_LIST], - QLatin1String(RSS_TAG_DATATYPE_LIST), - QLatin1String("DATATYPE")); - t << endl; - - foreach(QString item, userItems[RSS_TAG_DEFAULT]) - t << "\t" << item.replace("\n","\n\t") << endl; - t << "\t}" << endl; - - foreach(QString item, userItems[RSS_TAG_FOOTER]) - t << item << endl; - } else { - PRINT_FILE_CREATE_ERROR(filename) - } -} - -void SymbianMakefileGenerator::writeRegRssList(QTextStream &t, - QStringList &userList, - const QString &listTag, - const QString &listItem) -{ - int itemCount = userList.count(); - if (itemCount) { - t << "\t" << listTag << " ="<< endl; - t << "\t\t{" << endl; - foreach(QString item, userList) { - t << "\t\t" << listItem << endl; - t << "\t\t\t{" << endl; - t << "\t\t\t" << item.replace("\n","\n\t\t\t") << endl; - t << "\t\t\t}"; - if (--itemCount) - t << ","; - t << endl; - } - t << "\t\t}; "<< endl; - } -} - -void SymbianMakefileGenerator::writeRssFile(QString &numberOfIcons, QString &iconFile) -{ - QString filename(fixedTarget); - filename.append(".rss"); - QFile ft(filename); - if (ft.open(QIODevice::WriteOnly)) { - generatedFiles << ft.fileName(); - QTextStream t(&ft); - t << "// ============================================================================" << endl; - t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: "; - t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl; - t << "// * This file is generated by qmake and should not be modified by the" << endl; - t << "// * user." << endl; - t << "// ============================================================================" << endl; - t << endl; - t << "#include <appinfo.rh>" << endl; - t << "#include \"" << fixedTarget << ".loc\"" << endl; - t << endl; - t << "RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info" << endl; - t << "\t{" << endl; - t << "\tshort_caption = STRING_r_short_caption;" << endl; - t << "\tcaption_and_icon =" << endl; - t << "\tCAPTION_AND_ICON_INFO" << endl; - t << "\t\t{" << endl; - t << "\t\tcaption = STRING_r_caption;" << endl; - - QString rssIconFile = iconFile; - rssIconFile = rssIconFile.replace("/", "\\\\"); - - if (numberOfIcons.isEmpty() || rssIconFile.isEmpty()) { - // There can be maximum one item in this tag, validated when parsed - t << "\t\tnumber_of_icons = 0;" << endl; - t << "\t\ticon_file = \"\";" << endl; - } else { - // There can be maximum one item in this tag, validated when parsed - t << "\t\tnumber_of_icons = " << numberOfIcons << ";" << endl; - t << "\t\ticon_file = \"" << rssIconFile << "\";" << endl; - } - t << "\t\t};" << endl; - t << "\t}" << endl; - t << endl; - } else { - PRINT_FILE_CREATE_ERROR(filename); - } -} - -void SymbianMakefileGenerator::writeLocFile(QStringList &symbianLangCodes) -{ - QString filename(fixedTarget); - filename.append(".loc"); - QFile ft(filename); - if (ft.open(QIODevice::WriteOnly)) { - generatedFiles << ft.fileName(); - QTextStream t(&ft); - t << "// ============================================================================" << endl; - t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: "; - t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl; - t << "// * This file is generated by qmake and should not be modified by the" << endl; - t << "// * user." << endl; - t << "// ============================================================================" << endl; - t << endl; - t << "#ifdef LANGUAGE_SC" << endl; - t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl; - t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl; - foreach(QString lang, symbianLangCodes) { - t << "#elif defined LANGUAGE_" << lang << endl; - t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl; - t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl; - } - t << "#else" << endl; - t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl; - t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl; - t << "#endif" << endl; - } else { - PRINT_FILE_CREATE_ERROR(filename); - } -} - -void SymbianMakefileGenerator::readRssRules(QString &numberOfIcons, - QString &iconFile, QMap<QString, - QStringList> &userRssRules) -{ - for (QMap<QString, QStringList>::iterator it = project->variables().begin(); it != project->variables().end(); ++it) { - if (it.key().startsWith(RSS_RULES_BASE)) { - QString newKey = it.key().mid(sizeof(RSS_RULES_BASE) - 1); - if (newKey.isEmpty()) { - fprintf(stderr, "Warning: Empty RSS_RULES_BASE key encountered\n"); - continue; - } - QStringList newValues; - QStringList values = it.value(); - foreach(QString item, values) { - // If there is no stringlist defined for a rule, use rule value directly - // This is convenience for defining single line statements - if (project->values(item).isEmpty()) { - newValues << item; - } else { - QStringList itemList; - foreach(QString itemRow, project->values(item)) { - itemList << itemRow; - } - newValues << itemList.join("\n"); - } - } - // Verify thet there is exactly one value in RSS_TAG_NBROFICONS - if (newKey == RSS_TAG_NBROFICONS) { - if (newValues.count() == 1) { - numberOfIcons = newValues[0]; - } else { - fprintf(stderr, "Warning: There must be exactly one value in '%s%s'\n", - RSS_RULES_BASE, RSS_TAG_NBROFICONS); - continue; - } - // Verify thet there is exactly one value in RSS_TAG_ICONFILE - } else if (newKey == RSS_TAG_ICONFILE) { - if (newValues.count() == 1) { - iconFile = newValues[0]; - } else { - fprintf(stderr, "Warning: There must be exactly one value in '%s%s'\n", - RSS_RULES_BASE, RSS_TAG_ICONFILE); - continue; - } - } else if (newKey == RSS_TAG_HEADER - || newKey == RSS_TAG_SERVICE_LIST - || newKey == RSS_TAG_FILE_OWNERSHIP_LIST - || newKey == RSS_TAG_DATATYPE_LIST - || newKey == RSS_TAG_FOOTER - || newKey == RSS_TAG_DEFAULT) { - userRssRules[newKey] = newValues; - continue; - } else { - fprintf(stderr, "Warning: Unsupported key:'%s%s'\n", - RSS_RULES_BASE, newKey.toLatin1().constData()); - continue; - } - } - } - - QStringList newValues; - foreach(QString item, project->values(RSS_RULES)) { - // If there is no stringlist defined for a rule, use rule value directly - // This is convenience for defining single line statements - if (project->values(item).isEmpty()) { - newValues << item; - } else { - newValues << project->values(item); - } - } - userRssRules[RSS_TAG_DEFAULT] << newValues; - - // Validate that either both RSS_TAG_NBROFICONS and RSS_TAG_ICONFILE keys exist - // or neither of them exist - if (!((numberOfIcons.isEmpty() && iconFile.isEmpty()) || - (!numberOfIcons.isEmpty() && !iconFile.isEmpty()))) { - numberOfIcons.clear(); - iconFile.clear(); - fprintf(stderr, "Warning: Both or neither of '%s%s' and '%s%s' keys must exist.\n", - RSS_RULES_BASE, RSS_TAG_NBROFICONS, RSS_RULES_BASE, RSS_TAG_ICONFILE); - } - - // Validate that RSS_TAG_NBROFICONS contains only numbers - if (!numberOfIcons.isEmpty()) { - bool ok; - numberOfIcons = numberOfIcons.simplified(); - numberOfIcons.toInt(&ok); - if (!ok) { - numberOfIcons.clear(); - iconFile.clear(); - fprintf(stderr, "Warning: '%s%s' must be integer in decimal format.\n", - RSS_RULES_BASE, RSS_TAG_NBROFICONS); - } - } -} - -QStringList SymbianMakefileGenerator::symbianLangCodesFromTsFiles() -{ - QStringList tsfiles; - QStringList symbianLangCodes; - tsfiles << project->values("TRANSLATIONS"); - - fillQt2S60LangMapTable(); - - foreach(QString file, tsfiles) { - int extIndex = file.lastIndexOf("."); - int langIndex = file.lastIndexOf("_", (extIndex - file.length())); - langIndex += 1; - QString qtlang = file.mid(langIndex, extIndex - langIndex); - QString s60lang = qt2S60LangMapTable.value(qtlang, QString("SC")); - - if (!symbianLangCodes.contains(s60lang) && s60lang != "SC") - symbianLangCodes += s60lang; - } - - return symbianLangCodes; -} - -void SymbianMakefileGenerator::fillQt2S60LangMapTable() -{ - qt2S60LangMapTable.reserve(170); // 165 items at time of writing. - qt2S60LangMapTable.insert("ab", "SC"); //Abkhazian // - qt2S60LangMapTable.insert("om", "SC"); //Afan // - qt2S60LangMapTable.insert("aa", "SC"); //Afar // - qt2S60LangMapTable.insert("af", "34"); //Afrikaans //Afrikaans - qt2S60LangMapTable.insert("sq", "35"); //Albanian //Albanian - qt2S60LangMapTable.insert("am", "36"); //Amharic //Amharic - qt2S60LangMapTable.insert("ar", "37"); //Arabic //Arabic - qt2S60LangMapTable.insert("hy", "38"); //Armenian //Armenian - qt2S60LangMapTable.insert("as", "SC"); //Assamese // - qt2S60LangMapTable.insert("ay", "SC"); //Aymara // - qt2S60LangMapTable.insert("az", "SC"); //Azerbaijani // - qt2S60LangMapTable.insert("ba", "SC"); //Bashkir // - qt2S60LangMapTable.insert("eu", "SC"); //Basque // - qt2S60LangMapTable.insert("bn", "41"); //Bengali //Bengali - qt2S60LangMapTable.insert("dz", "SC"); //Bhutani // - qt2S60LangMapTable.insert("bh", "SC"); //Bihari // - qt2S60LangMapTable.insert("bi", "SC"); //Bislama // - qt2S60LangMapTable.insert("br", "SC"); //Breton // - qt2S60LangMapTable.insert("bg", "42"); //Bulgarian //Bulgarian - qt2S60LangMapTable.insert("my", "43"); //Burmese //Burmese - qt2S60LangMapTable.insert("be", "40"); //Byelorussian //Belarussian - qt2S60LangMapTable.insert("km", "SC"); //Cambodian // - qt2S60LangMapTable.insert("ca", "44"); //Catalan //Catalan - qt2S60LangMapTable.insert("zh", "SC"); //Chinese // - qt2S60LangMapTable.insert("co", "SC"); //Corsican // - qt2S60LangMapTable.insert("hr", "45"); //Croatian //Croatian - qt2S60LangMapTable.insert("cs", "25"); //Czech //Czech - qt2S60LangMapTable.insert("da", "07"); //Danish //Danish - qt2S60LangMapTable.insert("nl", "18"); //Dutch //Dutch - qt2S60LangMapTable.insert("en", "01"); //English //English(UK) - qt2S60LangMapTable.insert("eo", "SC"); //Esperanto // - qt2S60LangMapTable.insert("et", "49"); //Estonian //Estonian - qt2S60LangMapTable.insert("fo", "SC"); //Faroese // - qt2S60LangMapTable.insert("fj", "SC"); //Fiji // - qt2S60LangMapTable.insert("fi", "09"); //Finnish //Finnish - qt2S60LangMapTable.insert("fr", "02"); //French //French - qt2S60LangMapTable.insert("fy", "SC"); //Frisian // - qt2S60LangMapTable.insert("gd", "52"); //Gaelic //Gaelic - qt2S60LangMapTable.insert("gl", "SC"); //Galician // - qt2S60LangMapTable.insert("ka", "53"); //Georgian //Georgian - qt2S60LangMapTable.insert("de", "03"); //German //German - qt2S60LangMapTable.insert("el", "54"); //Greek //Greek - qt2S60LangMapTable.insert("kl", "SC"); //Greenlandic // - qt2S60LangMapTable.insert("gn", "SC"); //Guarani // - qt2S60LangMapTable.insert("gu", "56"); //Gujarati //Gujarati - qt2S60LangMapTable.insert("ha", "SC"); //Hausa // - qt2S60LangMapTable.insert("he", "57"); //Hebrew //Hebrew - qt2S60LangMapTable.insert("hi", "58"); //Hindi //Hindi - qt2S60LangMapTable.insert("hu", "17"); //Hungarian //Hungarian - qt2S60LangMapTable.insert("is", "15"); //Icelandic //Icelandic - qt2S60LangMapTable.insert("id", "59"); //Indonesian //Indonesian - qt2S60LangMapTable.insert("ia", "SC"); //Interlingua // - qt2S60LangMapTable.insert("ie", "SC"); //Interlingue // - qt2S60LangMapTable.insert("iu", "SC"); //Inuktitut // - qt2S60LangMapTable.insert("ik", "SC"); //Inupiak // - qt2S60LangMapTable.insert("ga", "60"); //Irish //Irish - qt2S60LangMapTable.insert("it", "05"); //Italian //Italian - qt2S60LangMapTable.insert("ja", "32"); //Japanese //Japanese - qt2S60LangMapTable.insert("jv", "SC"); //Javanese // - qt2S60LangMapTable.insert("kn", "62"); //Kannada //Kannada - qt2S60LangMapTable.insert("ks", "SC"); //Kashmiri // - qt2S60LangMapTable.insert("kk", "63"); //Kazakh //Kazakh - qt2S60LangMapTable.insert("rw", "SC"); //Kinyarwanda // - qt2S60LangMapTable.insert("ky", "SC"); //Kirghiz // - qt2S60LangMapTable.insert("ko", "65"); //Korean //Korean - qt2S60LangMapTable.insert("ku", "SC"); //Kurdish // - qt2S60LangMapTable.insert("rn", "SC"); //Kurundi // - qt2S60LangMapTable.insert("lo", "66"); //Laothian //Laothian - qt2S60LangMapTable.insert("la", "SC"); //Latin // - qt2S60LangMapTable.insert("lv", "67"); //Latvian //Latvian - qt2S60LangMapTable.insert("ln", "SC"); //Lingala // - qt2S60LangMapTable.insert("lt", "68"); //Lithuanian //Lithuanian - qt2S60LangMapTable.insert("mk", "69"); //Macedonian //Macedonian - qt2S60LangMapTable.insert("mg", "SC"); //Malagasy // - qt2S60LangMapTable.insert("ms", "70"); //Malay //Malay - qt2S60LangMapTable.insert("ml", "71"); //Malayalam //Malayalam - qt2S60LangMapTable.insert("mt", "SC"); //Maltese // - qt2S60LangMapTable.insert("mi", "SC"); //Maori // - qt2S60LangMapTable.insert("mr", "72"); //Marathi //Marathi - qt2S60LangMapTable.insert("mo", "73"); //Moldavian //Moldovian - qt2S60LangMapTable.insert("mn", "74"); //Mongolian //Mongolian - qt2S60LangMapTable.insert("na", "SC"); //Nauru // - qt2S60LangMapTable.insert("ne", "SC"); //Nepali // - qt2S60LangMapTable.insert("nb", "08"); //Norwegian //Norwegian - qt2S60LangMapTable.insert("oc", "SC"); //Occitan // - qt2S60LangMapTable.insert("or", "SC"); //Oriya // - qt2S60LangMapTable.insert("ps", "SC"); //Pashto // - qt2S60LangMapTable.insert("fa", "SC"); //Persian // - qt2S60LangMapTable.insert("pl", "27"); //Polish //Polish - qt2S60LangMapTable.insert("pt", "13"); //Portuguese //Portuguese - qt2S60LangMapTable.insert("pa", "77"); //Punjabi //Punjabi - qt2S60LangMapTable.insert("qu", "SC"); //Quechua // - qt2S60LangMapTable.insert("rm", "SC"); //RhaetoRomance // - qt2S60LangMapTable.insert("ro", "78"); //Romanian //Romanian - qt2S60LangMapTable.insert("ru", "16"); //Russian //Russian - qt2S60LangMapTable.insert("sm", "SC"); //Samoan // - qt2S60LangMapTable.insert("sg", "SC"); //Sangho // - qt2S60LangMapTable.insert("sa", "SC"); //Sanskrit // - qt2S60LangMapTable.insert("sr", "79"); //Serbian //Serbian - qt2S60LangMapTable.insert("sh", "SC"); //SerboCroatian // - qt2S60LangMapTable.insert("st", "SC"); //Sesotho // - qt2S60LangMapTable.insert("tn", "SC"); //Setswana // - qt2S60LangMapTable.insert("sn", "SC"); //Shona // - qt2S60LangMapTable.insert("sd", "SC"); //Sindhi // - qt2S60LangMapTable.insert("si", "80"); //Singhalese //Sinhalese - qt2S60LangMapTable.insert("ss", "SC"); //Siswati // - qt2S60LangMapTable.insert("sk", "26"); //Slovak //Slovak - qt2S60LangMapTable.insert("sl", "28"); //Slovenian //Slovenian - qt2S60LangMapTable.insert("so", "81"); //Somali //Somali - qt2S60LangMapTable.insert("es", "04"); //Spanish //Spanish - qt2S60LangMapTable.insert("su", "SC"); //Sundanese // - qt2S60LangMapTable.insert("sw", "84"); //Swahili //Swahili - qt2S60LangMapTable.insert("sv", "06"); //Swedish //Swedish - qt2S60LangMapTable.insert("tl", "39"); //Tagalog //Tagalog - qt2S60LangMapTable.insert("tg", "SC"); //Tajik // - qt2S60LangMapTable.insert("ta", "87"); //Tamil //Tamil - qt2S60LangMapTable.insert("tt", "SC"); //Tatar // - qt2S60LangMapTable.insert("te", "88"); //Telugu //Telugu - qt2S60LangMapTable.insert("th", "33"); //Thai //Thai - qt2S60LangMapTable.insert("bo", "89"); //Tibetan //Tibetan - qt2S60LangMapTable.insert("ti", "90"); //Tigrinya //Tigrinya - qt2S60LangMapTable.insert("to", "SC"); //Tonga // - qt2S60LangMapTable.insert("ts", "SC"); //Tsonga // - qt2S60LangMapTable.insert("tr", "14"); //Turkish //Turkish - qt2S60LangMapTable.insert("tk", "92"); //Turkmen //Turkmen - qt2S60LangMapTable.insert("tw", "SC"); //Twi // - qt2S60LangMapTable.insert("ug", "SC"); //Uigur // - qt2S60LangMapTable.insert("uk", "93"); //Ukrainian //Ukrainian - qt2S60LangMapTable.insert("ur", "94"); //Urdu //Urdu - qt2S60LangMapTable.insert("uz", "SC"); //Uzbek // - qt2S60LangMapTable.insert("vi", "96"); //Vietnamese //Vietnamese - qt2S60LangMapTable.insert("vo", "SC"); //Volapuk // - qt2S60LangMapTable.insert("cy", "97"); //Welsh //Welsh - qt2S60LangMapTable.insert("wo", "SC"); //Wolof // - qt2S60LangMapTable.insert("xh", "SC"); //Xhosa // - qt2S60LangMapTable.insert("yi", "SC"); //Yiddish // - qt2S60LangMapTable.insert("yo", "SC"); //Yoruba // - qt2S60LangMapTable.insert("za", "SC"); //Zhuang // - qt2S60LangMapTable.insert("zu", "98"); //Zulu //Zulu - qt2S60LangMapTable.insert("nn", "75"); //Nynorsk //NorwegianNynorsk - qt2S60LangMapTable.insert("bs", "SC"); //Bosnian // - qt2S60LangMapTable.insert("dv", "SC"); //Divehi // - qt2S60LangMapTable.insert("gv", "SC"); //Manx // - qt2S60LangMapTable.insert("kw", "SC"); //Cornish // - qt2S60LangMapTable.insert("ak", "SC"); //Akan // - qt2S60LangMapTable.insert("kok", "SC"); //Konkani // - qt2S60LangMapTable.insert("gaa", "SC"); //Ga // - qt2S60LangMapTable.insert("ig", "SC"); //Igbo // - qt2S60LangMapTable.insert("kam", "SC"); //Kamba // - qt2S60LangMapTable.insert("syr", "SC"); //Syriac // - qt2S60LangMapTable.insert("byn", "SC"); //Blin // - qt2S60LangMapTable.insert("gez", "SC"); //Geez // - qt2S60LangMapTable.insert("kfo", "SC"); //Koro // - qt2S60LangMapTable.insert("sid", "SC"); //Sidamo // - qt2S60LangMapTable.insert("cch", "SC"); //Atsam // - qt2S60LangMapTable.insert("tig", "SC"); //Tigre // - qt2S60LangMapTable.insert("kaj", "SC"); //Jju // - qt2S60LangMapTable.insert("fur", "SC"); //Friulian // - qt2S60LangMapTable.insert("ve", "SC"); //Venda // - qt2S60LangMapTable.insert("ee", "SC"); //Ewe // - qt2S60LangMapTable.insert("wa", "SC"); //Walamo // - qt2S60LangMapTable.insert("haw", "SC"); //Hawaiian // - qt2S60LangMapTable.insert("kcg", "SC"); //Tyap // - qt2S60LangMapTable.insert("ny", "SC"); //Chewa // -} - void SymbianMakefileGenerator::appendIfnotExist(QStringList &list, QString value) { if (!list.contains(value)) @@ -1872,16 +1106,6 @@ void SymbianMakefileGenerator::appendIfnotExist(QStringList &list, QStringList v appendIfnotExist(list, item); } -QString SymbianMakefileGenerator::removePathSeparators(QString &file) -{ - QString ret = file; - while (ret.indexOf(QDir::separator()) > 0) { - ret.remove(0, ret.indexOf(QDir::separator()) + 1); - } - - return ret; -} - QString SymbianMakefileGenerator::removeTrailingPathSeparators(QString &file) { @@ -1913,17 +1137,6 @@ void SymbianMakefileGenerator::generateCleanCommands(QTextStream& t, } } -void SymbianMakefileGenerator::removeSpecialCharacters(QString& str) -{ - // When modifying this method check also application_icon.prf - str.replace(QString("/"), QString("_")); - str.replace(QString("\\"), QString("_")); - str.replace(QString("-"), QString("_")); - str.replace(QString(":"), QString("_")); - str.replace(QString("."), QString("_")); - str.replace(QString(" "), QString("_")); -} - void SymbianMakefileGenerator::generateDistcleanTargets(QTextStream& t) { t << "dodistclean:" << endl; diff --git a/qmake/generators/symbian/symmake.h b/qmake/generators/symbian/symmake.h index 0847ee8..d9ca390 100644 --- a/qmake/generators/symbian/symmake.h +++ b/qmake/generators/symbian/symmake.h @@ -43,6 +43,7 @@ #define SYMMAKEFILE_H #include "initprojectdeploy_symbian.h" +#include "symbiancommon.h" #include <makefile.h> QT_BEGIN_NAMESPACE @@ -53,22 +54,11 @@ QT_BEGIN_NAMESPACE #define MAKE_CACHE_NAME ".make.cache" #define SYMBIAN_TEST_CONFIG "symbian_test" -class SymbianMakefileGenerator : public MakefileGenerator +class SymbianMakefileGenerator : public MakefileGenerator, public SymbianCommonGenerator { protected: - enum TargetType { - TypeExe, - TypeDll, - TypeLib, - TypePlugin, - TypeSubdirs - }; - QString platform; QString uid2; - QString uid3; - QString privateDirUid; - TargetType targetType; QMap<QString, QStringList> sources; QMap<QString, QStringList> systeminclude; QMap<QString, QStringList> library; @@ -76,19 +66,10 @@ protected: QMap<QString, QStringList> makmakeCommands; QStringList overriddenMmpKeywords; - QStringList generatedFiles; - QStringList generatedDirs; - QHash<QString, QString> qt2S60LangMapTable; - - QString fixedTarget; - - void removeSpecialCharacters(QString& str); QString fixPathForMmp(const QString& origPath, const QDir& parentDir); QString absolutizePath(const QString& origPath); virtual bool writeMakefile(QTextStream &t); - void generatePkgFile(const QString &iconFile, DeploymentList &depList); - bool containsStartWithItem(const QChar &c, const QStringList& src); virtual void init(); @@ -130,23 +111,9 @@ protected: void writeCustomDefFile(); - void writeRegRssFile(QMap<QString, QStringList> &useritems); - void writeRegRssList(QTextStream &t, QStringList &userList, - const QString &listTag, - const QString &listItem); - void writeRssFile(QString &numberOfIcons, QString &iconfile); - void writeLocFile(QStringList &symbianLangCodes); - void readRssRules(QString &numberOfIcons, - QString &iconFile, - QMap<QString, QStringList> &userRssRules); - - QStringList symbianLangCodesFromTsFiles(); - void fillQt2S60LangMapTable(); - void appendIfnotExist(QStringList &list, QString value); void appendIfnotExist(QStringList &list, QStringList values); - QString removePathSeparators(QString &file); QString removeTrailingPathSeparators(QString &file); void generateCleanCommands(QTextStream& t, const QStringList& toClean, diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp index f90421b..f05e7ff 100644 --- a/qmake/generators/symbian/symmake_abld.cpp +++ b/qmake/generators/symbian/symmake_abld.cpp @@ -71,7 +71,7 @@ SymbianAbldMakefileGenerator::~SymbianAbldMakefileGenerator() { } void SymbianAbldMakefileGenerator::writeMkFile(const QString& wrapperFileName, bool deploymentOnly) { QString gnuMakefileName = QLatin1String("Makefile_") + uid3; - removeSpecialCharacters(gnuMakefileName); + removeEpocSpecialCharacters(gnuMakefileName); gnuMakefileName.append(".mk"); QFile ft(gnuMakefileName); @@ -430,7 +430,7 @@ bool SymbianAbldMakefileGenerator::writeDeploymentTargets(QTextStream &t, bool i + privateDirUid; DeploymentList depList; - initProjectDeploySymbian(project, depList, remoteTestPath, false, + initProjectDeploySymbian(project, depList, remoteTestPath, false, true, QLatin1String(isRom ? ROM_DEPLOYMENT_PLATFORM : EMULATOR_DEPLOYMENT_PLATFORM), QString(), generatedDirs, generatedFiles); @@ -472,7 +472,7 @@ void SymbianAbldMakefileGenerator::writeBldInfMkFilePart(QTextStream& t, bool ad // do not get that, special deployment only makefile is generated for them if needed. if (targetType != TypeSubdirs || addDeploymentExtension) { QString gnuMakefileName = QLatin1String("Makefile_") + uid3; - removeSpecialCharacters(gnuMakefileName); + removeEpocSpecialCharacters(gnuMakefileName); gnuMakefileName.append(".mk"); t << "gnumakefile " << gnuMakefileName << endl; } diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp index 79663fb..d1d0104 100644 --- a/qmake/generators/symbian/symmake_sbsv2.cpp +++ b/qmake/generators/symbian/symmake_sbsv2.cpp @@ -386,7 +386,7 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t //write emulator deployment t << "#if defined(WINSCW)" << endl; - initProjectDeploySymbian(project, depList, remoteTestPath, false, + initProjectDeploySymbian(project, depList, remoteTestPath, false, true, QLatin1String(EMULATOR_DEPLOYMENT_PLATFORM), QString(), generatedDirs, generatedFiles); writeSbsDeploymentList(depList, t); t << "#endif" << endl; @@ -394,7 +394,7 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t //write ROM deployment remoteTestPath = epocRoot() + QLatin1String("epoc32/data/z/private/") + privateDirUid; depList.clear(); - initProjectDeploySymbian(project, depList, remoteTestPath, false, + initProjectDeploySymbian(project, depList, remoteTestPath, false, true, QLatin1String(ROM_DEPLOYMENT_PLATFORM), QString(), generatedDirs, generatedFiles); writeSbsDeploymentList(depList, t); t << endl; diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index f85d707..db5b957 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -65,6 +65,10 @@ UnixMakefileGenerator::init() } } + if (project->isEmpty("QMAKE_PREFIX_SHLIB")) + // Prevent crash when using the empty variable. + project->values("QMAKE_PREFIX_SHLIB").append(""); + if(!project->isEmpty("QMAKE_FAILED_REQUIREMENTS")) /* no point */ return; @@ -449,7 +453,9 @@ UnixMakefileGenerator::findLibraries() if(!libdirs.contains(f)) libdirs.append(f); } else if(opt.startsWith("-l")) { - if (project->isActiveConfig("rvct_linker")) { + if (!project->isEmpty("QMAKE_RVCT_LINKSTYLE")) { + (*it) = opt.mid(2); + } else if (project->isActiveConfig("rvct_linker")) { (*it) = "lib" + opt.mid(2) + ".so"; } else { stub = opt.mid(2); @@ -489,26 +495,29 @@ UnixMakefileGenerator::findLibraries() QStringList extens; if(!extn.isNull()) extens << extn; + else if (!project->isEmpty("QMAKE_SYMBIAN_SHLIB")) + // In Symbian you link to the stub .lib file, but run with the .dll file. + extens << "lib"; else extens << project->values("QMAKE_EXTENSION_SHLIB").first() << "a"; for(QStringList::Iterator extit = extens.begin(); extit != extens.end(); ++extit) { if(dir.isNull()) { - QString lib_stub; for(QList<QMakeLocalFileName>::Iterator dep_it = libdirs.begin(); dep_it != libdirs.end(); ++dep_it) { - if(exists((*dep_it).local() + Option::dir_sep + "lib" + stub + - "." + (*extit))) { - lib_stub = stub; + QString pathToLib = ((*dep_it).local() + Option::dir_sep + + project->values("QMAKE_PREFIX_SHLIB").first() + + stub + "." + (*extit)); + if(exists(pathToLib)) { + if (!project->isEmpty("QMAKE_RVCT_LINKSTYLE")) + (*it) = pathToLib; + else + (*it) = "-l" + stub; + found = true; break; } } - if(!lib_stub.isNull()) { - (*it) = "-l" + lib_stub; - found = true; - break; - } } else { - if(exists("lib" + stub + "." + (*extit))) { - (*it) = "lib" + stub + "." + (*extit); + if(exists(project->values("QMAKE_PREFIX_SHLIB").first() + stub + "." + (*extit))) { + (*it) = project->values("QMAKE_PREFIX_SHLIB").first() + stub + "." + (*extit); found = true; break; } @@ -516,8 +525,8 @@ UnixMakefileGenerator::findLibraries() } if(!found && project->isActiveConfig("compile_libtool")) { for(int dep_i = 0; dep_i < libdirs.size(); ++dep_i) { - if(exists(libdirs[dep_i].local() + Option::dir_sep + "lib" + stub + Option::libtool_ext)) { - (*it) = libdirs[dep_i].real() + Option::dir_sep + "lib" + stub + Option::libtool_ext; + if(exists(libdirs[dep_i].local() + Option::dir_sep + project->values("QMAKE_PREFIX_SHLIB").first() + stub + Option::libtool_ext)) { + (*it) = libdirs[dep_i].real() + Option::dir_sep + project->values("QMAKE_PREFIX_SHLIB").first() + stub + Option::libtool_ext; found = true; break; } @@ -557,7 +566,7 @@ UnixMakefileGenerator::processPrlFiles() for(int dep_i = 0; dep_i < libdirs.size(); ++dep_i) { const QMakeLocalFileName &lfn = libdirs[dep_i]; if(!project->isActiveConfig("compile_libtool")) { //give them the .libs.. - QString la = lfn.local() + Option::dir_sep + "lib" + lib + Option::libtool_ext; + QString la = lfn.local() + Option::dir_sep + project->values("QMAKE_PREFIX_SHLIB").first() + lib + Option::libtool_ext; if(exists(la) && QFile::exists(lfn.local() + Option::dir_sep + ".libs")) { QString dot_libs = lfn.real() + Option::dir_sep + ".libs"; l.append("-L" + dot_libs); @@ -565,7 +574,7 @@ UnixMakefileGenerator::processPrlFiles() } } - QString prl = lfn.local() + Option::dir_sep + "lib" + lib; + QString prl = lfn.local() + Option::dir_sep + project->values("QMAKE_PREFIX_SHLIB").first() + lib; if(!project->isEmpty("QMAKE_" + lib.toUpper() + "_SUFFIX")) prl += project->first("QMAKE_" + lib.toUpper() + "_SUFFIX"); if(processPrlFile(prl)) { diff --git a/qmake/generators/unix/unixmake.h b/qmake/generators/unix/unixmake.h index 77bdd01..0ea3350 100644 --- a/qmake/generators/unix/unixmake.h +++ b/qmake/generators/unix/unixmake.h @@ -49,7 +49,6 @@ QT_BEGIN_NAMESPACE class UnixMakefileGenerator : public MakefileGenerator { bool init_flag, include_deps; - bool writeMakefile(QTextStream &); QString libtoolFileName(bool fixify=true); void writeLibtoolFile(); // for libtool QString pkgConfigPrefix() const; @@ -75,6 +74,7 @@ protected: virtual void init(); void writeMakeParts(QTextStream &); + bool writeMakefile(QTextStream &); private: void init2(); diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 5def030..3e731a1 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -177,6 +177,12 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if(!project->isEmpty("QMAKE_MACOSX_DEPLOYMENT_TARGET")) t << "export MACOSX_DEPLOYMENT_TARGET = " //exported to children processes << project->first("QMAKE_MACOSX_DEPLOYMENT_TARGET") << endl; + + if (!project->isEmpty("QMAKE_SYMBIAN_SHLIB")) { + t << "vpath %.dso " << project->values("QMAKE_LIBDIR").join(":") << endl; + t << "vpath %.lib " << project->values("QMAKE_LIBDIR").join(":") << endl; + } + t << endl; t << "####### Output directory" << endl << endl; @@ -233,6 +239,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if(!project->isEmpty("QMAKE_BUNDLE")) { t << "TARGETD = " << escapeFilePath(var("TARGET_x.y")) << endl; t << "TARGET0 = " << escapeFilePath(var("TARGET_")) << endl; + } else if(!project->isEmpty("QMAKE_SYMBIAN_SHLIB")) { + t << "TARGETD = " << escapeFilePath(var("TARGET")) << endl; } else if(project->isEmpty("QMAKE_HPUX_SHLIB")) { t << "TARGETD = " << escapeFilePath(var("TARGET_x.y.z")) << endl; t << "TARGET0 = " << escapeFilePath(var("TARGET_")) << endl; @@ -332,7 +340,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << "SUBLIBS = "; QStringList &l = project->values("SUBLIBS"); for(QStringList::Iterator it = l.begin(); it != l.end(); ++it) - t << libdir << "lib" << (*it) << ".a "; + t << libdir << project->first("QMAKE_PREFIX_STATICLIB") << (*it) << "." + << project->first("QMAKE_EXTENSION_STATICLIB") << " "; t << endl << endl; } if(project->isActiveConfig("depend_prl") && !project->isEmpty("QMAKE_PRL_INTERNAL_FILES")) { @@ -545,6 +554,17 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if(!project->isEmpty("QMAKE_POST_LINK")) t << "\n\t" << var("QMAKE_POST_LINK"); t << endl << endl; + } else if(!project->isEmpty("QMAKE_SYMBIAN_SHLIB")) { + t << "\n\t" + << "-$(DEL_FILE) $(TARGET)" << "\n\t" + << var("QMAKE_LINK_SHLIB_CMD"); + if(!destdir.isEmpty()) + t << "\n\t" + << "-$(DEL_FILE) " << destdir << "$(TARGET)\n\t" + << "-$(MOVE) $(TARGET) " << destdir; + if(!project->isEmpty("QMAKE_POST_LINK")) + t << "\n\t" << var("QMAKE_POST_LINK"); + t << endl << endl; } else if(project->isEmpty("QMAKE_HPUX_SHLIB")) { t << "\n\t" << "-$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2)" << "\n\t" @@ -860,7 +880,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) libdir = project->first("SUBLIBS_DIR"); QStringList &l = project->values("SUBLIBS"); for(it = l.begin(); it != l.end(); ++it) - t << libdir << "lib" << (*it) << ".a" << ":\n\t" + t << libdir << project->first("QMAKE_PREFIX_STATICLIB") << (*it) << "." + << project->first("QMAKE_EXTENSION_STATICLIB") << ":\n\t" << var(QString("MAKELIB") + (*it)) << endl << endl; } @@ -875,9 +896,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << "\t-$(LIBTOOL) --mode=clean $(DEL_FILE) " << "$(TARGET)" << endl; } else if(!project->isActiveConfig("staticlib") && project->values("QMAKE_APP_FLAG").isEmpty() && !project->isActiveConfig("plugin")) { - t << "\t-$(DEL_FILE) " << destdir << "$(TARGET)" << " " << endl - << "\t-$(DEL_FILE) " << destdir << "$(TARGET0) " << destdir << "$(TARGET1) " - << destdir << "$(TARGET2) $(TARGETA)" << endl; + t << "\t-$(DEL_FILE) " << destdir << "$(TARGET)" << " " << endl; + if (project->values("QMAKE_SYMBIAN_SHLIB").isEmpty()) + t << "\t-$(DEL_FILE) " << destdir << "$(TARGET0) " << destdir << "$(TARGET1) " + << destdir << "$(TARGET2) $(TARGETA)" << endl; } else { t << "\t-$(DEL_FILE) " << "$(TARGET)" << " " << endl; } @@ -992,12 +1014,13 @@ void UnixMakefileGenerator::init2() if (!project->values("QMAKE_CYGWIN_EXE").isEmpty()) project->values("TARGET_EXT").append(".exe"); } else if (project->isActiveConfig("staticlib")) { - project->values("TARGET").first().prepend("lib"); - project->values("TARGET").first() += ".a"; + project->values("TARGET").first().prepend(project->first("QMAKE_PREFIX_STATICLIB")); + project->values("TARGET").first() += "." + project->first("QMAKE_EXTENSION_STATICLIB"); if(project->values("QMAKE_AR_CMD").isEmpty()) project->values("QMAKE_AR_CMD").append("$(AR) $(TARGET) $(OBJECTS)"); } else { - project->values("TARGETA").append(project->first("DESTDIR") + "lib" + project->first("TARGET") + ".a"); + project->values("TARGETA").append(project->first("DESTDIR") + project->first("QMAKE_PREFIX_STATICLIB") + + project->first("TARGET") + "." + project->first("QMAKE_EXTENSION_STATICLIB")); if(project->isActiveConfig("compile_libtool")) project->values("TARGET_la") = QStringList(project->first("DESTDIR") + "lib" + project->first("TARGET") + Option::libtool_ext); @@ -1045,7 +1068,8 @@ void UnixMakefileGenerator::init2() project->first("VER_MAJ")); project->values("TARGET") = project->values("TARGET_x"); } else if (!project->isEmpty("QMAKE_AIX_SHLIB")) { - project->values("TARGET_").append("lib" + project->first("TARGET") + ".a"); + project->values("TARGET_").append(project->first("QMAKE_PREFIX_STATICLIB") + project->first("TARGET") + + "." + project->first("QMAKE_EXTENSION_STATICLIB")); if(project->isActiveConfig("lib_version_first")) { project->values("TARGET_x").append("lib" + project->first("TARGET") + "." + project->first("VER_MAJ") + "." + @@ -1074,6 +1098,10 @@ void UnixMakefileGenerator::init2() project->first("VER_PAT")); } project->values("TARGET") = project->values("TARGET_x.y.z"); + } else if (!project->isEmpty("QMAKE_SYMBIAN_SHLIB")) { + project->values("TARGET_").append(project->first("TARGET") + "." + + project->first("QMAKE_EXTENSION_SHLIB")); + project->values("TARGET") = project->values("TARGET_"); } else { project->values("TARGET_").append("lib" + project->first("TARGET") + "." + project->first("QMAKE_EXTENSION_SHLIB")); diff --git a/qmake/option.cpp b/qmake/option.cpp index b41e39d..d7c5397 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -410,6 +410,7 @@ Option::init(int argc, char **argv) Option::res_ext = ".res"; #else Option::dirlist_sep = ":"; + Option::shellPath = QStringList("sh"); #endif Option::sysenv_mod = "QMAKE_ENV_"; Option::field_sep = ' '; diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro index 5654a18..2095179 100644 --- a/src/3rdparty/webkit/WebCore/WebCore.pro +++ b/src/3rdparty/webkit/WebCore/WebCore.pro @@ -8,7 +8,7 @@ symbian: { TARGET.CAPABILITY = All -Tcb TARGET.UID3 = 0x200267C2 - webkitlibs.sources = QtWebKit.dll + webkitlibs.sources = $$QMAKE_LIBDIR_QT/QtWebKit.dll webkitlibs.path = /sys/bin vendorinfo = \ "; Localised Vendor name" \ @@ -24,9 +24,12 @@ symbian: { DEPLOYMENT += webkitlibs webkitbackup - # RO text (code) section in qtwebkit.dll exceeds allocated space for gcce udeb target. - # Move RW-section base address to start from 0xE00000 instead of the toolchain default 0x400000. - MMP_RULES += "LINKEROPTION armcc --rw-base 0xE00000" + symbian-abld:symbian-sbsv2 { + # RO text (code) section in qtwebkit.dll exceeds allocated space for gcce udeb target. + # Move RW-section base address to start from 0xE00000 instead of the toolchain default 0x400000. + QMAKE_LFLAGS.ARMCC += --rw-base 0xE00000 + CONFIG += do_not_build_as_thumb + } } include($$PWD/../WebKit.pri) @@ -3417,7 +3420,7 @@ CONFIG(QTDIR_build):isEqual(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 4 symbian { shared { contains(CONFIG, def_files) { - defFilePath=../WebKit/qt/symbian + DEF_FILE=../WebKit/qt/symbian } } } diff --git a/src/3rdparty/webkit/WebCore/plugins/symbian/PluginViewSymbian.cpp b/src/3rdparty/webkit/WebCore/plugins/symbian/PluginViewSymbian.cpp index cf69723..fd604a0 100644 --- a/src/3rdparty/webkit/WebCore/plugins/symbian/PluginViewSymbian.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/symbian/PluginViewSymbian.cpp @@ -53,7 +53,7 @@ #include "runtime_root.h" #include "QWebPageClient.h" #include <QKeyEvent> -#include <QPixmap.h> +#include <QPixmap> #include <QRegion> #include <QVector> #include <QWidget> diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index df9a463..500cde6 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -48,7 +48,7 @@ symbian: { pu_header = "; Partial upgrade package for testing QtCore changes without reinstalling everything" \ "$${LITERAL_HASH}{\"Qt corelib\"}, (0x2001E61C), $${QT_MAJOR_VERSION},$${QT_MINOR_VERSION},$${QT_PATCH_VERSION}, TYPE=PU" partial_upgrade.pkg_prerules = pu_header vendorinfo - partial_upgrade.sources = qtcore.dll + partial_upgrade.sources = $$QMAKE_LIBDIR_QT/QtCore.dll partial_upgrade.path = c:/sys/bin DEPLOYMENT = partial_upgrade $$DEPLOYMENT } diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index c8f836a..dfa2c17 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -58,6 +58,11 @@ #include <stdarg.h> #include <string.h> +#ifndef QT_NO_EXCEPTIONS +# include <string> +# include <exception> +#endif + #if !defined(Q_OS_WINCE) # include <errno.h> # if defined(Q_CC_MSVC) diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri index 2ed0e46..ef448b1 100644 --- a/src/corelib/io/io.pri +++ b/src/corelib/io/io.pri @@ -74,7 +74,7 @@ win32 { SOURCES += io/qsettings_mac.cpp io/qfilesystemwatcher_fsevents.cpp } - linux-*:{ + linux-*:!symbian { SOURCES += \ io/qfilesystemwatcher_inotify.cpp \ io/qfilesystemwatcher_dnotify.cpp diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index 1331f54..61a4af8 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -55,7 +55,7 @@ #include <stdlib.h> #include <limits.h> #if defined(Q_OS_SYMBIAN) -# include <syslimits.h> +# include <sys/syslimits.h> # include <f32file.h> # include <pathinfo.h> # include "private/qcore_symbian_p.h" diff --git a/src/corelib/io/qprocess_symbian.cpp b/src/corelib/io/qprocess_symbian.cpp index adc87fb..8902f7d 100644 --- a/src/corelib/io/qprocess_symbian.cpp +++ b/src/corelib/io/qprocess_symbian.cpp @@ -66,7 +66,7 @@ #include "qstring.h" #include "qprocess.h" #include "qprocess_p.h" -#include "qeventdispatcher_symbian_p.h" +#include "private/qeventdispatcher_symbian_p.h" #include <private/qthread_p.h> #include <qmutex.h> diff --git a/src/corelib/kernel/qsystemsemaphore_symbian.cpp b/src/corelib/kernel/qsystemsemaphore_symbian.cpp index c252dd5..8cef611 100644 --- a/src/corelib/kernel/qsystemsemaphore_symbian.cpp +++ b/src/corelib/kernel/qsystemsemaphore_symbian.cpp @@ -44,7 +44,7 @@ #include "qcoreapplication.h" #include <qdebug.h> -#include <qcore_symbian_p.h> +#include "qcore_symbian_p.h" #include <e32cmn.h> QT_BEGIN_NAMESPACE diff --git a/src/gui/dialogs/qerrormessage.cpp b/src/gui/dialogs/qerrormessage.cpp index 0bca811..7be7481 100644 --- a/src/gui/dialogs/qerrormessage.cpp +++ b/src/gui/dialogs/qerrormessage.cpp @@ -70,10 +70,10 @@ extern bool qt_wince_is_high_dpi(); //defined in qguifunctions_wince.cpp #if defined(QT_SOFTKEYS_ENABLED) #include <qaction.h> +#endif #ifdef Q_WS_S60 #include "private/qt_s60_p.h" #endif -#endif QT_BEGIN_NAMESPACE diff --git a/src/gui/gui.pro b/src/gui/gui.pro index d46f3b4..52531a3 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -51,12 +51,14 @@ contains(DEFINES,QT_EVAL):include($$QT_SOURCE_TREE/src/corelib/eval.pri) QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtGui.dynlist DEFINES += Q_INTERNAL_QAPP_SRC -symbian: { +symbian { TARGET.UID3=0x2001B2DD - # ro-section in gui can exceed default allocated space, so move rw-section a little further - QMAKE_LFLAGS.ARMCC += --rw-base 0x800000 - QMAKE_LFLAGS.GCCE += -Tdata 0xC00000 + symbian-abld:symbian-sbsv2 { + # ro-section in gui can exceed default allocated space, so move rw-section a little further + QMAKE_LFLAGS.ARMCC += --rw-base 0x800000 + QMAKE_LFLAGS.GCCE += -Tdata 0xC00000 + } # Partial upgrade SIS file vendorinfo = \ @@ -70,7 +72,7 @@ symbian: { pu_header = "; Partial upgrade package for testing QtGui changes without reinstalling everything" \ "$${LITERAL_HASH}{\"Qt gui\"}, (0x2001E61C), $${QT_MAJOR_VERSION},$${QT_MINOR_VERSION},$${QT_PATCH_VERSION}, TYPE=PU" partial_upgrade.pkg_prerules = pu_header vendorinfo - partial_upgrade.sources = qtgui.dll + partial_upgrade.sources = $$QMAKE_LIBDIR_QT/QtGui.dll partial_upgrade.path = c:/sys/bin DEPLOYMENT = partial_upgrade $$DEPLOYMENT } diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 4a15cf2..573bac6 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1254,11 +1254,13 @@ void qt_init(QApplicationPrivate * /* priv */, int) } #endif +#ifdef QT_KEYPAD_NAVIGATION if (touch) { QApplicationPrivate::navigationMode = Qt::NavigationModeNone; } else { QApplicationPrivate::navigationMode = Qt::NavigationModeKeypadDirectional; } +#endif #ifndef QT_NO_CURSOR //Check if window server pointer cursors are supported or not diff --git a/src/gui/kernel/qcursor_s60.cpp b/src/gui/kernel/qcursor_s60.cpp index 54a9176..68e079e 100644 --- a/src/gui/kernel/qcursor_s60.cpp +++ b/src/gui/kernel/qcursor_s60.cpp @@ -44,7 +44,7 @@ #include <private/qapplication_p.h> #include <coecntrl.h> #include <qcursor.h> -#include <qt_s60_p.h> +#include <private/qt_s60_p.h> #include <qbitmap.h> #include <w32std.h> #include <qapplication.h> diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp index d05c7e4..b25dce5 100644 --- a/src/gui/painting/qwindowsurface_s60.cpp +++ b/src/gui/painting/qwindowsurface_s60.cpp @@ -44,8 +44,8 @@ #include <QtGui/qpaintdevice.h> #include <private/qwidget_p.h> #include "qwindowsurface_s60_p.h" -#include "qpixmap_s60_p.h" -#include "qt_s60_p.h" +#include <private/qpixmap_s60_p.h> +#include <private/qt_s60_p.h> #include "private/qdrawhelper_p.h" QT_BEGIN_NAMESPACE diff --git a/src/gui/s60framework/s60framework.pri b/src/gui/s60framework/s60framework.pri index 6080e6d..e177a33 100644 --- a/src/gui/s60framework/s60framework.pri +++ b/src/gui/s60framework/s60framework.pri @@ -9,6 +9,8 @@ minimalAppResource31 = \ "END" MMP_RULES += minimalAppResource31 +SYMBIAN_RESOURCES += s60framework/s60main.rss + SOURCES += s60framework/qs60mainapplication.cpp \ s60framework/qs60mainappui.cpp \ s60framework/qs60maindocument.cpp diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index dd9e69e..9b85c04 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -73,7 +73,7 @@ #endif #endif #ifdef Q_OS_SYMBIAN -#include "qt_s60_p.h" +#include <private/qt_s60_p.h> #endif #include <QMutexLocker> diff --git a/src/gui/text/qfont_s60.cpp b/src/gui/text/qfont_s60.cpp index 52c77d6..ccd17a2 100644 --- a/src/gui/text/qfont_s60.cpp +++ b/src/gui/text/qfont_s60.cpp @@ -40,8 +40,8 @@ ****************************************************************************/ #include "qfont.h" -#include "qt_s60_p.h" -#include "qpixmap_s60_p.h" +#include <private/qt_s60_p.h> +#include <private/qpixmap_s60_p.h> #include "qmutex.h" QT_BEGIN_NAMESPACE diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp index 87a73df..621f666 100644 --- a/src/gui/text/qfontdatabase_s60.cpp +++ b/src/gui/text/qfontdatabase_s60.cpp @@ -45,8 +45,8 @@ #include "qfontengine_s60_p.h" #include "qabstractfileengine.h" #include "qdesktopservices.h" -#include "qpixmap_s60_p.h" -#include "qt_s60_p.h" +#include <private/qpixmap_s60_p.h> +#include <private/qt_s60_p.h> #include "qendian.h" #include <private/qcore_symbian_p.h> #if defined(QT_NO_FREETYPE) diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index 7224768..4a9cfed 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -48,7 +48,7 @@ #include <private/qapplication_p.h> #include <private/qmenu_p.h> #include <private/qmenubar_p.h> -#include <qt_s60_p.h> +#include <private/qt_s60_p.h> #include <QtCore/qlibrary.h> #ifdef Q_WS_S60 diff --git a/src/gui/widgets/widgets.pri b/src/gui/widgets/widgets.pri index 6883dd8..937b8d6 100644 --- a/src/gui/widgets/widgets.pri +++ b/src/gui/widgets/widgets.pri @@ -164,6 +164,6 @@ wince*: { !static: QMAKE_WRITE_DEFAULT_RC = 1 } -symbian*: { +symbian: { SOURCES += widgets/qmenu_symbian.cpp } diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.h b/src/plugins/bearer/symbian/qnetworksession_impl.h index 30f51e1..98d4222 100644 --- a/src/plugins/bearer/symbian/qnetworksession_impl.h +++ b/src/plugins/bearer/symbian/qnetworksession_impl.h @@ -58,7 +58,7 @@ #include <QDateTime> #include <e32base.h> -#include <CommDbConnPref.h> +#include <commdbconnpref.h> #include <es_sock.h> #include <rconnmon.h> #ifdef SNAP_FUNCTIONALITY_AVAILABLE diff --git a/src/plugins/graphicssystems/trace/trace.pro b/src/plugins/graphicssystems/trace/trace.pro index d548a6c..07472e2 100644 --- a/src/plugins/graphicssystems/trace/trace.pro +++ b/src/plugins/graphicssystems/trace/trace.pro @@ -4,6 +4,7 @@ include(../../qpluginbase.pri) QT += network QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/graphicssystems +symbian:TARGET.UID3 = 0x2002130E SOURCES = main.cpp qgraphicssystem_trace.cpp diff --git a/src/plugins/imageformats/tiff/tiff.pro b/src/plugins/imageformats/tiff/tiff.pro index 85f618f..3cb64ad 100644 --- a/src/plugins/imageformats/tiff/tiff.pro +++ b/src/plugins/imageformats/tiff/tiff.pro @@ -58,7 +58,7 @@ contains(QT_CONFIG, system-tiff) { ../../../3rdparty/libtiff/libtiff/tif_wince.c \ ../../../3rdparty/libtiff/libtiff/tif_win32.c } - symbian*: { + symbian: { SOURCES += ../../../3rdparty/libtiff/port/lfind.c } } diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index 730fdc5..42fbf9e 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -1,6 +1,6 @@ TEMPLATE = subdirs -SUBDIRS *= accessible imageformats sqldrivers iconengines script bearer +SUBDIRS *= imageformats sqldrivers iconengines script bearer unix:!symbian { contains(QT_CONFIG,iconv)|contains(QT_CONFIG,gnu-libiconv):SUBDIRS *= codecs } else { @@ -9,6 +9,7 @@ unix:!symbian { !embedded:SUBDIRS *= graphicssystems embedded:SUBDIRS *= gfxdrivers decorations mousedrivers kbddrivers !win32:!embedded:!mac:!symbian:SUBDIRS *= inputmethods +!symbian:SUBDIRS += accessible symbian:SUBDIRS += s60 contains(QT_CONFIG, phonon): SUBDIRS *= phonon contains(QT_CONFIG, multimedia): SUBDIRS *= audio mediaservices diff --git a/src/plugins/s60/s60pluginbase.pri b/src/plugins/s60/s60pluginbase.pri index c1aa4ef..1a6f4a2 100644 --- a/src/plugins/s60/s60pluginbase.pri +++ b/src/plugins/s60/s60pluginbase.pri @@ -4,6 +4,8 @@ include(../qpluginbase.pri) CONFIG -= plugin +QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/s60 + MMP_RULES += NOEXPORTLIBRARY defBlock = \ diff --git a/src/qbase.pri b/src/qbase.pri index 835ed0e..4a75565 100644 --- a/src/qbase.pri +++ b/src/qbase.pri @@ -104,7 +104,7 @@ symbian { # built in this exact environment. *Never* use this when building a version # for release. contains(CONFIG, def_files) { - defFilePath=../s60installs + DEF_FILE=../s60installs } } load(armcc_warnings) diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro index 841fce4..9cc8ff0 100644 --- a/src/s60installs/s60installs.pro +++ b/src/s60installs/s60installs.pro @@ -11,26 +11,37 @@ symbian: { TARGET.UID3 = 0x2001E61C VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} - qtresources.sources = $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/s60main.rsc + symbian-abld|symbian-sbsv2 { + qtresources.sources = $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/s60main.rsc + } else { + qtresources.sources = $$QMAKE_LIBDIR_QT/s60main.rsc + DESTDIR = $$QMAKE_LIBDIR_QT + } qtresources.path = c:$$APP_RESOURCE_DIR qtlibraries.sources = \ - QtCore.dll \ - QtXml.dll \ - QtGui.dll \ - QtNetwork.dll \ - QtTest.dll \ - QtSql.dll + $$QMAKE_LIBDIR_QT/QtCore.dll \ + $$QMAKE_LIBDIR_QT/QtXml.dll \ + $$QMAKE_LIBDIR_QT/QtGui.dll \ + $$QMAKE_LIBDIR_QT/QtNetwork.dll \ + $$QMAKE_LIBDIR_QT/QtTest.dll \ + $$QMAKE_LIBDIR_QT/QtSql.dll + + symbian-abld|symbian-sbsv2 { + pluginLocations = $${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET) + } else { + pluginLocations = $$QT_BUILD_TREE/plugins/s60 + } qts60plugindeployment = \ "IF package(0x1028315F)" \ - " \"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/qts60plugin_5_0.dll\" - \"c:\\sys\\bin\\qts60plugin_5_0.dll\"" \ + " \"$$pluginLocations/qts60plugin_5_0.dll\" - \"c:\\sys\\bin\\qts60plugin_5_0.dll\"" \ "ELSEIF package(0x102752AE)" \ - " \"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/qts60plugin_3_2.dll\" - \"c:\\sys\\bin\\qts60plugin_3_2.dll\"" \ + " \"$$pluginLocations/qts60plugin_3_2.dll\" - \"c:\\sys\\bin\\qts60plugin_3_2.dll\"" \ "ELSEIF package(0x102032BE)" \ - " \"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/qts60plugin_3_1.dll\" - \"c:\\sys\\bin\\qts60plugin_3_1.dll\"" \ + " \"$$pluginLocations/qts60plugin_3_1.dll\" - \"c:\\sys\\bin\\qts60plugin_3_1.dll\"" \ "ELSE" \ - " \"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/qts60plugin_5_0.dll\" - \"c:\\sys\\bin\\qts60plugin_5_0.dll\"" \ + " \"$$pluginLocations/qts60plugin_5_0.dll\" - \"c:\\sys\\bin\\qts60plugin_5_0.dll\"" \ "ENDIF" qtlibraries.pkg_postrules += qts60plugindeployment @@ -61,18 +72,18 @@ symbian: { } qtlibraries.pkg_prerules += "(0x2002af5f), 0, 5, 0, {\"sqlite3\"}" - !contains(QT_CONFIG, no-jpeg): imageformats_plugins.sources += qjpeg.dll - !contains(QT_CONFIG, no-gif): imageformats_plugins.sources += qgif.dll - !contains(QT_CONFIG, no-mng): imageformats_plugins.sources += qmng.dll - !contains(QT_CONFIG, no-tiff): imageformats_plugins.sources += qtiff.dll - !contains(QT_CONFIG, no-ico): imageformats_plugins.sources += qico.dll + !contains(QT_CONFIG, no-jpeg): imageformats_plugins.sources += $$QT_BUILD_TREE/plugins/imageformats/qjpeg.dll + !contains(QT_CONFIG, no-gif): imageformats_plugins.sources += $$QT_BUILD_TREE/plugins/imageformats/qgif.dll + !contains(QT_CONFIG, no-mng): imageformats_plugins.sources += $$QT_BUILD_TREE/plugins/imageformats/qmng.dll + !contains(QT_CONFIG, no-tiff): imageformats_plugins.sources += $$QT_BUILD_TREE/plugins/imageformats/qtiff.dll + !contains(QT_CONFIG, no-ico): imageformats_plugins.sources += $$QT_BUILD_TREE/plugins/imageformats/qico.dll imageformats_plugins.path = c:$$QT_PLUGINS_BASE_DIR/imageformats - codecs_plugins.sources = qcncodecs.dll qjpcodecs.dll qtwcodecs.dll qkrcodecs.dll + codecs_plugins.sources = $$QT_BUILD_TREE/plugins/codecs/qcncodecs.dll $$QT_BUILD_TREE/plugins/codecs/qjpcodecs.dll $$QT_BUILD_TREE/plugins/codecs/qtwcodecs.dll $$QT_BUILD_TREE/plugins/codecs/qkrcodecs.dll codecs_plugins.path = c:$$QT_PLUGINS_BASE_DIR/codecs contains(QT_CONFIG, phonon-backend) { - phonon_backend_plugins.sources += phonon_mmf.dll + phonon_backend_plugins.sources += $$QMAKE_LIBDIR_QT/phonon_mmf.dll phonon_backend_plugins.path = c:$$QT_PLUGINS_BASE_DIR/phonon_backend DEPLOYMENT += phonon_backend_plugins @@ -83,7 +94,7 @@ symbian: { qtbackup.path = c:/private/10202D56/import/packages/$$replace(TARGET.UID3, 0x,) bearer_plugins.path = c:$$QT_PLUGINS_BASE_DIR/bearer - bearer_plugins.sources += qsymbianbearer.dll + bearer_plugins.sources += $$QT_BUILD_TREE/plugins/bearer/qsymbianbearer.dll DEPLOYMENT += qtresources \ qtlibraries \ @@ -94,37 +105,39 @@ symbian: { bearer_plugins contains(QT_CONFIG, svg): { - qtlibraries.sources += QtSvg.dll - imageformats_plugins.sources += qsvg.dll - iconengines_plugins.sources = qsvgicon.dll + qtlibraries.sources += $$QMAKE_LIBDIR_QT/QtSvg.dll + imageformats_plugins.sources += $$QT_BUILD_TREE/plugins/imageformats/qsvg.dll + iconengines_plugins.sources = $$QT_BUILD_TREE/plugins/iconengines/qsvgicon.dll iconengines_plugins.path = c:$$QT_PLUGINS_BASE_DIR/iconengines DEPLOYMENT += iconengines_plugins } contains(QT_CONFIG, phonon): { - qtlibraries.sources += phonon.dll + qtlibraries.sources += $$QMAKE_LIBDIR_QT/phonon.dll } contains(QT_CONFIG, script): { - qtlibraries.sources += QtScript.dll + qtlibraries.sources += $$QMAKE_LIBDIR_QT/QtScript.dll } contains(QT_CONFIG, xmlpatterns): { - qtlibraries.sources += QtXmlPatterns.dll + qtlibraries.sources += $$QMAKE_LIBDIR_QT/QtXmlPatterns.dll } contains(QT_CONFIG, declarative): { - qtlibraries.sources += QtDeclarative.dll + # TODO FIXME For some reason QtDeclarative cannot install on symbian/linux-armcc. + # Revert this patch and investigate later. + symbian-abld|symbian-sbsv2:qtlibraries.sources += $$QMAKE_LIBDIR_QT/QtDeclarative.dll } graphicssystems_plugins.path = c:$$QT_PLUGINS_BASE_DIR/graphicssystems contains(QT_CONFIG, openvg) { - qtlibraries.sources += QtOpenVG.dll - graphicssystems_plugins.sources += qvggraphicssystem.dll + qtlibraries.sources += $$QMAKE_LIBDIR_QT/QtOpenVG.dll + graphicssystems_plugins.sources += $$QT_BUILD_TREE/plugins/graphicssystems/qvggraphicssystem.dll } contains(QT_CONFIG, multimedia) { - qtlibraries.sources += QtMultimedia.dll + qtlibraries.sources += $$QMAKE_LIBDIR_QT/QtMultimedia.dll } BLD_INF_RULES.prj_exports += "qt.iby $$CORE_MW_LAYER_IBY_EXPORT_PATH(qt.iby)" diff --git a/src/s60main/s60main.pro b/src/s60main/s60main.pro index 25fb188..1ba105d 100644 --- a/src/s60main/s60main.pro +++ b/src/s60main/s60main.pro @@ -17,7 +17,7 @@ symbian { qts60main_mcrt0.cpp # s60main needs to be built in ARM mode for GCCE to work. - MMP_RULES+="ALWAYS_BUILD_AS_ARM" + CONFIG += do_not_build_as_thumb # staticlib should not have any lib depencies in s60 # This seems not to work, some hard coded libs are still added as dependency diff --git a/src/s60main/s60main.rsg b/src/s60main/s60main.rsg new file mode 100644 index 0000000..8cdf3ba --- /dev/null +++ b/src/s60main/s60main.rsg @@ -0,0 +1,3 @@ +#define R_DEFAULT_DOCUMENT_NAME 0x55567002 +#define R_QT_WRAPPERAPP_MENUBAR 0x55567004 +#define R_QT_WRAPPERAPP_MENU 0x55567005 diff --git a/src/src.pro b/src/src.pro index 0fbce6b..0033942 100644 --- a/src/src.pro +++ b/src/src.pro @@ -6,7 +6,10 @@ win32:SRC_SUBDIRS += src_winmain wince*:{ SRC_SUBDIRS += src_corelib src_xml src_gui src_sql src_network src_testlib } else:symbian { - SRC_SUBDIRS += src_s60main src_corelib src_xml src_gui src_network src_sql src_testlib src_s60installs + SRC_SUBDIRS += src_s60main src_corelib src_xml src_gui src_network src_sql src_testlib + !symbian-abld:!symbian-sbsv2 { + include(tools/tools.pro) + } } else { SRC_SUBDIRS += src_corelib src_xml src_network src_gui src_sql src_testlib !vxworks:contains(QT_CONFIG, qt3support): SRC_SUBDIRS += src_qt3support @@ -31,6 +34,10 @@ contains(QT_CONFIG, multimedia): SRC_SUBDIRS += src_multimedia SRC_SUBDIRS += src_plugins contains(QT_CONFIG, declarative): SRC_SUBDIRS += src_imports +# s60installs need to be at the end, because projects.pro does an ordered build, +# and s60installs depends on all the others. +symbian:SRC_SUBDIRS += src_s60installs + src_s60main.subdir = $$QT_SOURCE_TREE/src/s60main src_s60main.target = sub-s60main src_s60installs.subdir = $$QT_SOURCE_TREE/src/s60installs @@ -83,7 +90,7 @@ src_declarative.subdir = $$QT_SOURCE_TREE/src/declarative src_declarative.target = sub-declarative #CONFIG += ordered -!wince*:!symbian:!ordered { +!wince*:!ordered { src_corelib.depends = src_tools_moc src_tools_rcc src_gui.depends = src_corelib src_tools_uic embedded: src_gui.depends += src_network @@ -106,6 +113,7 @@ src_declarative.target = sub-declarative src_tools_activeqt.depends = src_tools_idc src_gui src_declarative.depends = src_xml src_gui src_script src_network src_svg src_plugins.depends = src_gui src_sql src_svg src_multimedia + src_s60installs.depends = $$TOOLS_SUBDIRS $$SRC_SUBDIRS src_imports.depends = src_gui src_declarative contains(QT_CONFIG, webkit) { src_webkit.depends = src_gui src_sql src_network src_xml @@ -123,7 +131,7 @@ src_declarative.target = sub-declarative contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2): src_plugins.depends += src_opengl } -!symbian { + # This creates a sub-src rule sub_src_target.CONFIG = recursive sub_src_target.recurse = $$TOOLS_SUBDIRS $$SRC_SUBDIRS @@ -170,6 +178,5 @@ for(subname, SRC_SUBDIRS) { debug.depends = $$EXTRA_DEBUG_TARGETS release.depends = $$EXTRA_RELEASE_TARGETS QMAKE_EXTRA_TARGETS += debug release -} SUBDIRS += $$SRC_SUBDIRS diff --git a/src/tools/bootstrap/bootstrap.pri b/src/tools/bootstrap/bootstrap.pri index b3ee948..15e746a 100644 --- a/src/tools/bootstrap/bootstrap.pri +++ b/src/tools/bootstrap/bootstrap.pri @@ -42,12 +42,12 @@ hpux-acc*|hpuxi-acc* { } else { contains(CONFIG, debug_and_release_target) { CONFIG(debug, debug|release) { - LIBS+=-L$$QT_BUILD_TREE/src/tools/bootstrap/debug + QMAKE_LIBDIR += $$QT_BUILD_TREE/src/tools/bootstrap/debug } else { - LIBS+=-L$$QT_BUILD_TREE/src/tools/bootstrap/release + QMAKE_LIBDIR += $$QT_BUILD_TREE/src/tools/bootstrap/release } } else { - LIBS += -L$$QT_BUILD_TREE/src/tools/bootstrap + QMAKE_LIBDIR += $$QT_BUILD_TREE/src/tools/bootstrap } LIBS += -lbootstrap } @@ -62,3 +62,12 @@ mac { LIBS += -framework CoreServices } +# Make dummy "sis" and "freeze" target to keep recursive "make sis/freeze" working. +sis_target.target = sis +sis_target.commands = +sis_target.depends = first +QMAKE_EXTRA_TARGETS += sis_target +freeze_target.target = freeze +freeze_target.commands = +freeze_target.depends = first +QMAKE_EXTRA_TARGETS += freeze_target diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro index 0dbb90f..48dc444 100644 --- a/src/tools/bootstrap/bootstrap.pro +++ b/src/tools/bootstrap/bootstrap.pro @@ -113,3 +113,13 @@ contains(QT_CONFIG, zlib) { lib.CONFIG = dummy_install INSTALLS += lib + +# Make dummy "sis" and "freeze" target to keep recursive "make sis/freeze" working. +sis_target.target = sis +sis_target.commands = +sis_target.depends = first +QMAKE_EXTRA_TARGETS += sis_target +freeze_target.target = freeze +freeze_target.commands = +freeze_target.depends = first +QMAKE_EXTRA_TARGETS += freeze_target diff --git a/src/tools/tools.pro b/src/tools/tools.pro index 25527e3..cd7cd9b 100644 --- a/src/tools/tools.pro +++ b/src/tools/tools.pro @@ -20,7 +20,7 @@ src_tools_uic3.target = sub-uic3 src_tools_idc.subdir = $$QT_SOURCE_TREE/src/tools/idc src_tools_idc.target = sub-idc -!wince*:!symbian:!ordered { +!wince*:!ordered { # Set dependencies for each subdir src_tools_moc.depends = src_tools_bootstrap src_tools_rcc.depends = src_tools_bootstrap diff --git a/templates/.gitattributes b/templates/.gitattributes new file mode 100644 index 0000000..6540c78 --- /dev/null +++ b/templates/.gitattributes @@ -0,0 +1 @@ +pkg_template.pkg -crlf diff --git a/templates/.gitignore b/templates/.gitignore new file mode 100644 index 0000000..1bb0965 --- /dev/null +++ b/templates/.gitignore @@ -0,0 +1 @@ +!*.pkg diff --git a/tools/assistant/tools/assistant/assistant.pro b/tools/assistant/tools/assistant/assistant.pro index bc4d495..eb8cc51 100644 --- a/tools/assistant/tools/assistant/assistant.pro +++ b/tools/assistant/tools/assistant/assistant.pro @@ -15,7 +15,7 @@ DEPENDPATH += ../shared # ## Work around a qmake issue when statically linking to # ## not-yet-installed plugins -LIBS += -L$$QT_BUILD_TREE/plugins/sqldrivers +QMAKE_LIBDIR += $$QT_BUILD_TREE/plugins/sqldrivers HEADERS += aboutdialog.h \ bookmarkdialog.h \ bookmarkfiltermodel.h \ diff --git a/tools/designer/src/designer/designer.pro b/tools/designer/src/designer/designer.pro index 2050c72..8590c7b 100644 --- a/tools/designer/src/designer/designer.pro +++ b/tools/designer/src/designer/designer.pro @@ -14,10 +14,8 @@ INCLUDEPATH += \ ../lib/uilib \ extra -LIBS += -L../../lib \ - -L../../../../lib \ - -lQtDesignerComponents \ - -lQtDesigner +QMAKE_LIBDIR += ../../lib ../../../../lib +LIBS += -lQtDesignerComponents -lQtDesigner RESOURCES += designer.qrc diff --git a/translations/translations.pro b/translations/translations.pro index 8f37451..ca83d07 100644 --- a/translations/translations.pro +++ b/translations/translations.pro @@ -10,7 +10,8 @@ contains(TEMPLATE_PREFIX, vc):vcproj = 1 TEMPLATE = app TARGET = qm_phony_target -CONFIG -= qt separate_debug_info +CONFIG -= qt separate_debug_info sis_targets +CONFIG += no_icon QT = LIBS = @@ -45,3 +46,8 @@ translations.files ~= s,\\.ts$,.qm,g translations.files ~= s,^,$$OUT_PWD/,g translations.CONFIG += no_check_exist INSTALLS += translations + +# Make dummy "sis" target to keep recursive "make sis" working. +sis_target.target = sis +sis_target.commands = +QMAKE_EXTRA_TARGETS += sis_target |