2011-04-27 10:05:43 +00:00
|
|
|
#!/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
|
2015-10-12 07:55:30 +00:00
|
|
|
QMAKE=$8
|
|
|
|
QTCONF=$9
|
|
|
|
shift 9
|
2011-04-27 10:05:43 +00:00
|
|
|
LFLAGS="$SYSROOT_FLAG"
|
|
|
|
INCLUDEPATH=""
|
|
|
|
CXXFLAGS="$SYSROOT_FLAG"
|
|
|
|
MAC_ARCH_CXXFLAGS=""
|
|
|
|
MAC_ARCH_LFLAGS=""
|
2015-07-17 21:41:48 +00:00
|
|
|
QMAKE_ARGS=
|
2011-04-27 10:05:43 +00:00
|
|
|
while [ "$#" -gt 0 ]; do
|
|
|
|
PARAM=$1
|
|
|
|
case $PARAM in
|
2012-08-12 08:14:59 +00:00
|
|
|
-config)
|
|
|
|
QMAKE_CONFIG="$QMAKE_CONFIG $2"
|
|
|
|
shift
|
|
|
|
;;
|
2011-04-27 10:05:43 +00:00
|
|
|
-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*)
|
2014-11-27 13:12:40 +00:00
|
|
|
LFLAGS="$LFLAGS \"$PARAM\""
|
|
|
|
CXXFLAGS="$CXXFLAGS \"$PARAM\""
|
2011-04-27 10:05:43 +00:00
|
|
|
;;
|
|
|
|
-L*|-l*|-pthread)
|
2014-11-27 13:12:40 +00:00
|
|
|
LFLAGS="$LFLAGS \"$PARAM\""
|
2011-04-27 10:05:43 +00:00
|
|
|
;;
|
|
|
|
-I*)
|
|
|
|
INC=`echo $PARAM | sed -e 's/^-I//'`
|
2014-11-27 13:12:40 +00:00
|
|
|
INCLUDEPATH="$INCLUDEPATH \"$INC\""
|
2011-04-27 10:05:43 +00:00
|
|
|
;;
|
|
|
|
-f*|-D*)
|
2014-11-27 13:12:40 +00:00
|
|
|
CXXFLAGS="$CXXFLAGS \"$PARAM\""
|
2011-04-27 10:05:43 +00:00
|
|
|
;;
|
|
|
|
-Qoption)
|
|
|
|
# Two-argument form for the Sun Compiler
|
|
|
|
CXXFLAGS="$CXXFLAGS $PARAM \"$2\""
|
|
|
|
shift
|
|
|
|
;;
|
2015-07-17 21:41:48 +00:00
|
|
|
*)
|
|
|
|
QMAKE_ARGS="$QMAKE_ARGS $PARAM"
|
|
|
|
;;
|
2011-04-27 10:05:43 +00:00
|
|
|
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"
|
|
|
|
|
2015-10-12 07:55:30 +00:00
|
|
|
set -- "$QMAKE" -qtconf "$QTCONF" -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" $QMAKE_ARGS "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile"
|
2011-04-27 10:05:43 +00:00
|
|
|
if [ "$VERBOSE" = "yes" ]; then
|
2014-04-11 12:09:28 +00:00
|
|
|
OUTDIR=$OUTDIR "$@" && $MAKE && SUCCESS=yes
|
2011-04-27 10:05:43 +00:00
|
|
|
else
|
2014-04-11 12:09:28 +00:00
|
|
|
OUTDIR=$OUTDIR "$@" >/dev/null 2>&1 && $MAKE >/dev/null 2>&1 && SUCCESS=yes
|
2011-04-27 10:05:43 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# done
|
|
|
|
if [ "$SUCCESS" != "yes" ]; then
|
|
|
|
[ "$VERBOSE" = "yes" ] && echo "$DESCRIPTION disabled."
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
[ "$VERBOSE" = "yes" ] && echo "$DESCRIPTION enabled."
|
|
|
|
exit 0
|
|
|
|
fi
|