From 71547238ea4391636e37f5cf89905433faeb32d1 Mon Sep 17 00:00:00 2001
From: Olivier Goffart <olivier.goffart@nokia.com>
Date: Thu, 1 Jul 2010 16:23:00 +0200
Subject: Symbian on Linux:  $QTDIR/bin is not necessarily in the path.

So it would not find elf2e32_qtwrapper

use the qtPrepareTool macro that does the right thing.

But this macro need QT_BUILD_TREE to be defined, which is not defined
yet early in the test process. So change the tests accordingly

Reviewed-by: ossi
---
 config.tests/mac/crc.test                     | 2 +-
 config.tests/symbian/compile.test             | 2 +-
 config.tests/unix/compile.test                | 2 +-
 config.tests/unix/doubleformat.test           | 2 +-
 config.tests/unix/endian.test                 | 2 +-
 config.tests/unix/ptrsize.test                | 2 +-
 config.tests/x11/notype.test                  | 2 +-
 mkspecs/features/symbian/symbian_building.prf | 6 ++++--
 8 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/config.tests/mac/crc.test b/config.tests/mac/crc.test
index 644ff75..9cbe7ba 100755
--- a/config.tests/mac/crc.test
+++ b/config.tests/mac/crc.test
@@ -53,7 +53,7 @@ test -d "$OUTDIR/$TEST" || mkdir -p "$OUTDIR/$TEST"
 cd "$OUTDIR/$TEST"
 
 $MAKE distclean >/dev/null 2>&1
-"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "LIBS*=$LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CXXFLAGS*=$CXXFLAGS" "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile"
+"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "LIBS*=$LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CXXFLAGS*=$CXXFLAGS" "QT_BUILD_TREE=$OUTDIR" "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile"
 
 if [ "$VERBOSE" = "yes" ]; then
     $MAKE
diff --git a/config.tests/symbian/compile.test b/config.tests/symbian/compile.test
index 20a3039..ab85819 100755
--- a/config.tests/symbian/compile.test
+++ b/config.tests/symbian/compile.test
@@ -26,7 +26,7 @@ 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"
+"$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" "QT_BUILD_TREE=$OUTDIR" "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile"
 
 if [ "$VERBOSE" = "yes" ]; then
     $MAKE
diff --git a/config.tests/unix/compile.test b/config.tests/unix/compile.test
index 99ebfd2..29ddea7 100755
--- a/config.tests/unix/compile.test
+++ b/config.tests/unix/compile.test
@@ -68,7 +68,7 @@ test -r Makefile && $MAKE distclean >/dev/null 2>&1
 # Make sure output from possible previous tests is gone
 rm -f "$EXE" "${EXE}.exe"
 
-"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "CONFIG-=debug_and_release" "LIBS*=$LFLAGS" "LIBS+=$MAC_ARCH_LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CXXFLAGS*=$CXXFLAGS" "QMAKE_CXXFLAGS+=$MAC_ARCH_CXXFLAGS" "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile"
+"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "CONFIG-=debug_and_release" "LIBS*=$LFLAGS" "LIBS+=$MAC_ARCH_LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CXXFLAGS*=$CXXFLAGS" "QMAKE_CXXFLAGS+=$MAC_ARCH_CXXFLAGS" "QT_BUILD_TREE=$OUTDIR" "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile"
 
 if [ "$VERBOSE" = "yes" ]; then
     $MAKE
diff --git a/config.tests/unix/doubleformat.test b/config.tests/unix/doubleformat.test
index 953efd8..9968553 100755
--- a/config.tests/unix/doubleformat.test
+++ b/config.tests/unix/doubleformat.test
@@ -10,7 +10,7 @@ OUTDIR=$4
 
 # build and run a test program
 test -d "$OUTDIR/config.tests/unix/doubleformat" || mkdir -p "$OUTDIR/config.tests/unix/doubleformat"
-"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "$SRCDIR/config.tests/unix/doubleformat/doubleformattest.pro" -o "$OUTDIR/config.tests/unix/doubleformat/Makefile" >/dev/null 2>&1
+"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "QT_BUILD_TREE=$OUTDIR" "$SRCDIR/config.tests/unix/doubleformat/doubleformattest.pro" -o "$OUTDIR/config.tests/unix/doubleformat/Makefile" >/dev/null 2>&1
 cd "$OUTDIR/config.tests/unix/doubleformat"
 
 DOUBLEFORMAT="UNKNOWN"
diff --git a/config.tests/unix/endian.test b/config.tests/unix/endian.test
index 4755b1f..d0fb6ce 100755
--- a/config.tests/unix/endian.test
+++ b/config.tests/unix/endian.test
@@ -10,7 +10,7 @@ OUTDIR=$4
 
 # build and run a test program
 test -d "$OUTDIR/config.tests/unix/endian" || mkdir -p "$OUTDIR/config.tests/unix/endian"
-"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "$SRCDIR/config.tests/unix/endian/endiantest.pro" -o "$OUTDIR/config.tests/unix/endian/Makefile" >/dev/null 2>&1
+"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "QT_BUILD_TREE=$OUTDIR" "$SRCDIR/config.tests/unix/endian/endiantest.pro" -o "$OUTDIR/config.tests/unix/endian/Makefile" >/dev/null 2>&1
 cd "$OUTDIR/config.tests/unix/endian"
 
 
diff --git a/config.tests/unix/ptrsize.test b/config.tests/unix/ptrsize.test
index c1d80ee..c78c73f 100755
--- a/config.tests/unix/ptrsize.test
+++ b/config.tests/unix/ptrsize.test
@@ -10,7 +10,7 @@ OUTDIR=$4
 
 # build and run a test program
 test -d "$OUTDIR/config.tests/unix/ptrsize" || mkdir -p "$OUTDIR/config.tests/unix/ptrsize"
-"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "$SRCDIR/config.tests/unix/ptrsize/ptrsizetest.pro" -o "$OUTDIR/config.tests/unix/ptrsize/Makefile" >/dev/null 2>&1
+"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "QT_BUILD_TREE=$OUTDIR" "$SRCDIR/config.tests/unix/ptrsize/ptrsizetest.pro" -o "$OUTDIR/config.tests/unix/ptrsize/Makefile" >/dev/null 2>&1
 cd "$OUTDIR/config.tests/unix/ptrsize"
 
 if [ "$VERBOSE" = "yes" ]; then
diff --git a/config.tests/x11/notype.test b/config.tests/x11/notype.test
index 3a01d8f..1b534c8 100755
--- a/config.tests/x11/notype.test
+++ b/config.tests/x11/notype.test
@@ -27,7 +27,7 @@ if [ $XPLATFORM = "solaris-g++" -o $XPLATFORM = "hpux-g++" -o $XPLATFORM = "aix-
     NOTYPE=yes
 
     test -d "$OUTDIR/config.tests/x11/notype" || mkdir -p "$OUTDIR/config.tests/x11/notype"
-    "$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "$SRCDIR/config.tests/x11/notype/notypetest.pro" -o "$OUTDIR/config.tests/x11/notype/Makefile" >/dev/null 2>&1
+    "$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "QT_BUILD_TREE=$OUTDIR" "$SRCDIR/config.tests/x11/notype/notypetest.pro" -o "$OUTDIR/config.tests/x11/notype/Makefile" >/dev/null 2>&1
     cd "$OUTDIR/config.tests/x11/notype"
 
     if [ "$VERBOSE" = "yes" ]; then
diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf
index fbaefca..c4088ca 100644
--- a/mkspecs/features/symbian/symbian_building.prf
+++ b/mkspecs/features/symbian/symbian_building.prf
@@ -8,6 +8,8 @@
     QMAKE_LFLAGS += -Ttext 0x80000 -Tdata 0x400000
 }
 
+qtPrepareTool(QMAKE_ELF2E32_WRAPPER, elf2e32_qtwrapper)
+
 isEmpty(TARGET.EPOCSTACKSIZE):TARGET.EPOCSTACKSIZE = 0x14000
 isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x020000 0x800000
 epoc_heap_size = $$split(TARGET.EPOCHEAPSIZE, " ")
@@ -107,7 +109,7 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) {
     contains(CONFIG, plugin):QMAKE_ELF2E32_FLAGS += --definput=plugin_commonu.def
 
     QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${baseTarget}.dll $$symbianDestdir/$${baseTarget}.sym \
-                      && elf2e32_qtwrapper  --version=$$decVersion \
+                      && $$QMAKE_ELF2E32_WRAPPER --version=$$decVersion \
                       --sid=$$TARGET.SID \
                       --uid1=0x10000079 \
                       --uid2=$$TARGET.UID2 \
@@ -155,7 +157,7 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@.*") {
         QMAKE_POST_LINK = && $$QMAKE_POST_LINK
     }
     QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${baseTarget} $$symbianDestdir/$${baseTarget}.sym \
-                      && elf2e32_qtwrapper  --version $$decVersion \
+                      && $$QMAKE_ELF2E32_WRAPPER --version $$decVersion \
                       --sid=$$TARGET.SID \
                       --uid1=0x1000007a \
                       --uid2=$$TARGET.UID2 \
-- 
cgit v0.12