0
|
1 |
#!/bin/sh
|
|
2 |
|
|
3 |
COMPILER=$1
|
|
4 |
VERBOSE=$2
|
|
5 |
WORKDIR=$3
|
|
6 |
QT_MAC_DEFAULT_ARCH=
|
|
7 |
|
|
8 |
touch defaultarch.c
|
|
9 |
|
|
10 |
# compile something and run 'file' on it.
|
|
11 |
if "$COMPILER" -c defaultarch.c 2>/dev/null 1>&2; then
|
|
12 |
FIlE_OUTPUT=`file defaultarch.o`
|
|
13 |
[ "$VERBOSE" = "yes" ] && echo "'file' reports compiler ($COMPILER) default architechture as: $FIlE_OUTPUT"
|
|
14 |
|
|
15 |
fi
|
|
16 |
rm -f defaultarch.c defaultarch.o
|
|
17 |
|
|
18 |
# detect our known archs.
|
|
19 |
if echo "$FIlE_OUTPUT" | grep '\<i386\>' > /dev/null 2>&1; then
|
|
20 |
QT_MAC_DEFAULT_ARCH=x86 # configure knows it as "x86" not "i386"
|
|
21 |
fi
|
|
22 |
if echo "$FIlE_OUTPUT" | grep '\<x86_64\>' > /dev/null 2>&1; then
|
|
23 |
QT_MAC_DEFAULT_ARCH=x86_64
|
|
24 |
fi
|
|
25 |
if echo "$FIlE_OUTPUT" | grep '\<ppc\>' > /dev/null 2>&1; then
|
|
26 |
QT_MAC_DEFAULT_ARCH=ppc
|
|
27 |
fi
|
|
28 |
if echo "$FIlE_OUTPUT" | grep '\<ppc64\>' > /dev/null 2>&1; then
|
|
29 |
QT_MAC_DEFAULT_ARCH=ppc64
|
|
30 |
fi
|
|
31 |
|
|
32 |
[ "$VERBOSE" = "yes" ] && echo "setting QT_MAC_DEFAULT_ARCH to \"$QT_MAC_DEFAULT_ARCH\""
|
|
33 |
export QT_MAC_DEFAULT_ARCH
|