f946a1d0c1
it's a bit braindead to look whether we managed to build an executable if we can simply use the exit codes of qmake and make to test for success. the windows equivalent is already doing that. this also allows us to do tests that can fail despite building an executable, or not build one in the first place. Change-Id: Ib69f9d005309d55a790dd3d89db1ee913e45b26b Reviewed-by: Wolfgang Bremer <wbremer@blackberry.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
85 lines
2.0 KiB
Bash
Executable File
85 lines
2.0 KiB
Bash
Executable File
#!/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="$SYSROOT_FLAG"
|
|
INCLUDEPATH=""
|
|
CXXFLAGS="$SYSROOT_FLAG"
|
|
MAC_ARCH_CXXFLAGS=""
|
|
MAC_ARCH_LFLAGS=""
|
|
while [ "$#" -gt 0 ]; do
|
|
PARAM=$1
|
|
case $PARAM in
|
|
-config)
|
|
QMAKE_CONFIG="$QMAKE_CONFIG $2"
|
|
shift
|
|
;;
|
|
-framework)
|
|
LFLAGS="$LFLAGS -framework \"$2\""
|
|
shift
|
|
;;
|
|
-arch)
|
|
MAC_ARCH_CXXFLAGS="$MAC_ARCH_CXXFLAGS -arch $2"
|
|
MAC_ARCH_LFLAGS="$MAC_ARCH_LFLAGS -arch $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"
|
|
|
|
test -r Makefile && $MAKE distclean >/dev/null 2>&1
|
|
# Make sure output from possible previous tests is gone
|
|
rm -f "$EXE" "${EXE}.exe"
|
|
|
|
set -- "$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "CONFIG+=android_app" "CONFIG-=debug_and_release app_bundle lib_bundle" "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
|
|
OUTDIR=$OUTDIR "$@" && $MAKE && SUCCESS=yes
|
|
else
|
|
OUTDIR=$OUTDIR "$@" >/dev/null 2>&1 && $MAKE >/dev/null 2>&1 && SUCCESS=yes
|
|
fi
|
|
|
|
# done
|
|
if [ "$SUCCESS" != "yes" ]; then
|
|
[ "$VERBOSE" = "yes" ] && echo "$DESCRIPTION disabled."
|
|
exit 1
|
|
else
|
|
[ "$VERBOSE" = "yes" ] && echo "$DESCRIPTION enabled."
|
|
exit 0
|
|
fi
|