summaryrefslogtreecommitdiffstats
path: root/config.tests/mac/defaultarch.test
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2009-03-23 09:34:13 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2009-03-23 09:34:13 (GMT)
commit67ad0519fd165acee4a4d2a94fa502e9e4847bd0 (patch)
tree1dbf50b3dff8d5ca7e9344733968c72704eb15ff /config.tests/mac/defaultarch.test
downloadQt-67ad0519fd165acee4a4d2a94fa502e9e4847bd0.zip
Qt-67ad0519fd165acee4a4d2a94fa502e9e4847bd0.tar.gz
Qt-67ad0519fd165acee4a4d2a94fa502e9e4847bd0.tar.bz2
Long live Qt!
Diffstat (limited to 'config.tests/mac/defaultarch.test')
-rwxr-xr-xconfig.tests/mac/defaultarch.test33
1 files changed, 33 insertions, 0 deletions
diff --git a/config.tests/mac/defaultarch.test b/config.tests/mac/defaultarch.test
new file mode 100755
index 0000000..4502af7
--- /dev/null
+++ b/config.tests/mac/defaultarch.test
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+COMPILER=$1
+VERBOSE=$2
+WORKDIR=$3
+QT_MAC_DEFUALT_ARCH=
+
+touch defaultarch.c
+
+# compile something and run 'file' on it.
+if "$COMPILER" -c defaultarch.c 2>/dev/null 1>&2; then
+ FIlE_OUTPUT=`file defaultarch.o`
+ [ "$VERBOSE" = "yes" ] && echo "'file' reports compiler ($COMPILER) default architechture as: $FIlE_OUTPUT"
+
+fi
+rm -f defaultarch.c defaultarch.o
+
+# detect our known archs.
+if echo "$FIlE_OUTPUT" | grep '\<i386\>' > /dev/null 2>&1; then
+ QT_MAC_DEFUALT_ARCH=x86 # configure knows it as "x86" not "i386"
+fi
+if echo "$FIlE_OUTPUT" | grep '\<x86_64\>' > /dev/null 2>&1; then
+ QT_MAC_DEFUALT_ARCH=x86_64
+fi
+if echo "$FIlE_OUTPUT" | grep '\<ppc\>' > /dev/null 2>&1; then
+ QT_MAC_DEFUALT_ARCH=ppc
+fi
+if echo "$FIlE_OUTPUT" | grep '\<ppc64\>' > /dev/null 2>&1; then
+ QT_MAC_DEFUALT_ARCH=ppc64
+fi
+
+[ "$VERBOSE" = "yes" ] && echo "setting QT_MAC_DEFUALT_ARCH to \"$QT_MAC_DEFUALT_ARCH\""
+export QT_MAC_DEFUALT_ARCH