summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/makeordinalmap65
-rwxr-xr-xbin/winewrapper24
-rw-r--r--mkspecs/symbian/linux-armcc/features/default_post.prf14
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