diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2009-03-23 09:18:55 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-03-23 09:18:55 (GMT) |
commit | e5fcad302d86d316390c6b0f62759a067313e8a9 (patch) | |
tree | c2afbf6f1066b6ce261f14341cf6d310e5595bc1 /config.tests/unix/compile.test | |
download | Qt-e5fcad302d86d316390c6b0f62759a067313e8a9.zip Qt-e5fcad302d86d316390c6b0f62759a067313e8a9.tar.gz Qt-e5fcad302d86d316390c6b0f62759a067313e8a9.tar.bz2 |
Long live Qt 4.5!
Diffstat (limited to 'config.tests/unix/compile.test')
-rwxr-xr-x | config.tests/unix/compile.test | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/config.tests/unix/compile.test b/config.tests/unix/compile.test new file mode 100755 index 0000000..b5afa18 --- /dev/null +++ b/config.tests/unix/compile.test @@ -0,0 +1,73 @@ +#!/bin/sh + +SUCCESS=no +QMKSPEC=$1 +XPLATFORM=`basename "$1"` +QMAKE_CONFIG=$2 +VERBOSE=$3 +SRCDIR=$4 +OUTDIR=$5 +TEST=$6 +EXE=`basename "$6"` +DESCRIPTION=$7 +shift 7 +LFLAGS="" +INCLUDEPATH="" +CXXFLAGS="" +while [ "$#" -gt 0 ]; do + PARAM=$1 + case $PARAM in + -framework) + LFLAGS="$LFLAGS -framework \"$2\"" + shift + ;; + -F*|-m*|-x*) + LFLAGS="$LFLAGS $PARAM" + CXXFLAGS="$CXXFLAGS $PARAM" + ;; + -L*|-l*|-pthread) + LFLAGS="$LFLAGS $PARAM" + ;; + -I*) + INC=`echo $PARAM | sed -e 's/^-I//'` + INCLUDEPATH="$INCLUDEPATH $INC" + ;; + -f*|-D*) + CXXFLAGS="$CXXFLAGS $PARAM" + ;; + -Qoption) + # Two-argument form for the Sun Compiler + CXXFLAGS="$CXXFLAGS $PARAM \"$2\"" + shift + ;; + *) ;; + esac + shift +done + +# debuggery +[ "$VERBOSE" = "yes" ] && echo "$DESCRIPTION auto-detection... ($*)" + +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" + +if [ "$VERBOSE" = "yes" ]; then + make +else + make >/dev/null 2>&1 +fi + +[ -x "$EXE" ] && SUCCESS=yes + +# done +if [ "$SUCCESS" != "yes" ]; then + [ "$VERBOSE" = "yes" ] && echo "$DESCRIPTION disabled." + exit 1 +else + [ "$VERBOSE" = "yes" ] && echo "$DESCRIPTION enabled." + exit 0 +fi |