diff options
author | axis <qt-info@nokia.com> | 2009-08-14 09:43:25 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-10-23 15:32:21 (GMT) |
commit | 8782f3387bcd1dff3d44ae17ab0547ce08478fb1 (patch) | |
tree | feac9921c83e3a0e9cbc888585ef0cdd4cc9252d | |
parent | b731981cc19195b54f8d5c4ebdf6a9f75b13f790 (diff) | |
download | Qt-8782f3387bcd1dff3d44ae17ab0547ce08478fb1.zip Qt-8782f3387bcd1dff3d44ae17ab0547ce08478fb1.tar.gz Qt-8782f3387bcd1dff3d44ae17ab0547ce08478fb1.tar.bz2 |
Created tools for generating ordinal maps on Symbian.
- winewrapper - This is a simple tool for launching a wine process
by looking at files in the path, since wine itself does not look in
the path. Needed for the Windows-only Symbian tools.
- makeordinalmap - This one takes a list of files containing symbols
to be exported, and creates a stub file library out of them. This
is required by the Symbian post linker. This is a very slow linking
step, and is likely to be rewritten using threads and less process
spawning later on.
- default_post.prf - In here we define the extra compiler rules that
generate the symbol files, as well as the makeordinalmap command
that uses those files.
-rwxr-xr-x | bin/makeordinalmap | 65 | ||||
-rwxr-xr-x | bin/winewrapper | 24 | ||||
-rw-r--r-- | mkspecs/symbian/linux-armcc/features/default_post.prf | 14 |
3 files changed, 103 insertions, 0 deletions
diff --git a/bin/makeordinalmap b/bin/makeordinalmap new file mode 100755 index 0000000..940a9e4 --- /dev/null +++ b/bin/makeordinalmap @@ -0,0 +1,65 @@ +#!/usr/bin/perl -w + +my $objects_dir = $ARGV[0]; +my $target = $ARGV[1]; +my $dllFile = $ARGV[2]; + +shift @ARGV; +shift @ARGV; +shift @ARGV; + +sub uniqueify { + # String must be sorted beforehand. + my $c; + my $last = $_[0]; + for ($c = 1; $c < scalar(@_); $c++) { + if ($_[$c] eq $last) { + splice(@_, $c, 1); + $c--; + } else { + $last = $_[$c]; + } + } + + return @_; +} + +my @exports; + +foreach (@ARGV) { + my $file; + open($file, "< $_") or die("Could not open $_"); + while (<$file>) { + push (@exports, $_); + } + close($file); +} + +@exports = sort(@exports); + +@exports = uniqueify(@exports); + +open(HANDLE, "> test.txt"); +print (HANDLE join("", @exports)); +close(HANDLE); + +my @ordinalfiles; + +for (my $c = 0; $c < scalar(@exports); $c++) { + my $symbol = $exports[$c]; + my $genstubs; + open ($genstubs, "| winewrapper genstubs.exe") or die ("Could not execute genstubs"); + print ($genstubs "$objects_dir/ordinal-$c.o $symbol #<DLL>$dllFile#<\\DLL>$c\n"); + push (@ordinalfiles, "$objects_dir/ordinal-$c.o"); + close ($genstubs); +} + +my $via; +open ($via, "> $objects_dir/input.via") or die("Could not open $objects_dir/input.via"); +print ($via join("\n", @ordinalfiles)); +close($via); + +my $result = system("armar --create $target --via $objects_dir/input.via"); +die("Could not execute armar") if ($result); + +exit 0 diff --git a/bin/winewrapper b/bin/winewrapper new file mode 100755 index 0000000..94cc38a --- /dev/null +++ b/bin/winewrapper @@ -0,0 +1,24 @@ +#!/bin/sh + +if [ "$1" = "" ]; then + echo "Must supply parameters" + exit 3 +fi + +oldIFS="$IFS" +IFS=: +for i in $PATH; do + if [ -e $i/$1 ]; then + executable="$i/$1" + break + fi +done + +if [ "$executable" = "" ]; then + echo "$1 not found in path" 1>&2 + exit 3 +fi + +IFS="$oldIFS" +shift +wine "$executable" "$@" 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..1d8f565 --- /dev/null +++ b/mkspecs/symbian/linux-armcc/features/default_post.prf @@ -0,0 +1,14 @@ +exports.commands = winewrapper getexports.exe ${QMAKE_FILE_NAME} > ${OBJECTS_DIR}${QMAKE_FILE_BASE}.exports +exports.output = $$OBJECTS_DIR/${QMAKE_FILE_BASE}.exports +exports.input = OBJECTS +exports.variable_out = ORDINALMAP +exports.CONFIG = no_link + +ordinalmap.input = ORDINALMAP +ordinalmap.output = $$OBJECTS_DIR/$${TARGET}.lib +ordinalmap.commands = makeordinalmap $$OBJECTS_DIR $$OBJECTS_DIR/$${TARGET}.lib $${TARGET}.dll ${QMAKE_FILE_NAME} +ordinalmap.variable_out = PRE_TARGETDEPS +ordinalmap.CONFIG = combine + +QMAKE_EXTRA_COMPILERS += ordinalmap +QMAKE_EXTRA_COMPILERS += exports |