qt5base-lts/config.tests/mac/defaultarch.test
Qt by Nokia 38be0d1383 Initial import from the monolithic Qt.
This is the beginning of revision history for this module. If you
want to look at revision history older than this, please refer to the
Qt Git wiki for how to use Git history grafting. At the time of
writing, this wiki is located here:

http://qt.gitorious.org/qt/pages/GitIntroductionWithQt

If you have already performed the grafting and you don't see any
history beyond this commit, try running "git log" with the "--follow"
argument.

Branched from the monolithic repo, Qt master branch, at commit
896db169ea224deb96c59ce8af800d019de63f12
2011-04-27 12:05:43 +02:00

34 lines
944 B
Bash
Executable File

#!/bin/sh
COMPILER=$1
VERBOSE=$2
WORKDIR=$3
QT_MAC_DEFAULT_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_DEFAULT_ARCH=x86 # configure knows it as "x86" not "i386"
fi
if echo "$FIlE_OUTPUT" | grep '\<x86_64\>' > /dev/null 2>&1; then
QT_MAC_DEFAULT_ARCH=x86_64
fi
if echo "$FIlE_OUTPUT" | grep '\<ppc\>' > /dev/null 2>&1; then
QT_MAC_DEFAULT_ARCH=ppc
fi
if echo "$FIlE_OUTPUT" | grep '\<ppc64\>' > /dev/null 2>&1; then
QT_MAC_DEFAULT_ARCH=ppc64
fi
[ "$VERBOSE" = "yes" ] && echo "setting QT_MAC_DEFAULT_ARCH to \"$QT_MAC_DEFAULT_ARCH\""
export QT_MAC_DEFAULT_ARCH