From 7d82bbb0d6b16356458eead0418e307ed92c79fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Thu, 6 Sep 2012 11:25:23 +0200 Subject: Minimal backport of --device-option support in configure This parial backport only adds the --device-option so it becomes possible to set and cache additional qmake variables. Partial cherry pick from qtbase/84e98fd9d2594637e928096c8fcb19d52e5e2676 Change-Id: I96636766aec7e12bfb1d377c8a607301a325a46c Reviewed-by: Oswald Buddenhagen --- configure | 40 +++++++++++++++++++++++++++++++++++++- mkspecs/features/device_config.prf | 14 +++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 mkspecs/features/device_config.prf diff --git a/configure b/configure index 88d03ca..7f618dd 100755 --- a/configure +++ b/configure @@ -71,8 +71,10 @@ QTCONFIG_CONFIG= QT_CONFIG= SUPPORTED= QMAKE_VARS_FILE=.qmake.vars +DEVICE_VARS_FILE=.device.vars :> "$QMAKE_VARS_FILE" +:> "$DEVICE_VARS_FILE" #------------------------------------------------------------------------------- # utility functions @@ -224,6 +226,23 @@ linkerSupportsFlag() } #------------------------------------------------------------------------------- +# device options +#------------------------------------------------------------------------------- +DeviceVar() +{ + case "$1" in + set) + eq="=" + ;; + *) + echo >&2 "BUG: wrong command to QMakeVar: $1" + ;; + esac + + echo "$2" "$eq" "$3" >> "$DEVICE_VARS_FILE" +} + +#------------------------------------------------------------------------------- # operating system detection #------------------------------------------------------------------------------- @@ -1122,7 +1141,7 @@ while [ "$#" -gt 0 ]; do shift VAL=$1 ;; - -prefix|-docdir|-headerdir|-plugindir|-importdir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-demosdir|-depths|-make|-nomake|-platform|-xplatform|-buildkey|-sdk|-arch|-host-arch|-mysql_config|-sysroot) + -prefix|-docdir|-headerdir|-plugindir|-importdir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-demosdir|-depths|-make|-nomake|-platform|-xplatform|-device-option|-buildkey|-sdk|-arch|-host-arch|-mysql_config|-sysroot) VAR=`echo $1 | sed "s,^-\(.*\),\1,"` shift VAL="$1" @@ -1667,6 +1686,11 @@ while [ "$#" -gt 0 ]; do case "$XPLATFORM" in *symbian*) XPLATFORM_SYMBIAN=yes;; esac case "$XPLATFORM" in symbian-sbsv2) XPLATFORM_SYMBIAN_SBSV2=yes;; esac ;; + device-option) + DEV_VAR=`echo $VAL | sed "s,^\(.*\)=.*,\1,"` + DEV_VAL=`echo $VAL | sed "s,^.*=\(.*\),\1,"` + DeviceVar set $DEV_VAR $DEV_VAL + ;; debug-and-release) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_DEBUG_RELEASE="$VAL" @@ -3297,6 +3321,17 @@ if [ "$OPT_VERBOSE" = "yes" ]; then fi #------------------------------------------------------------------------------- +# write out device config before we run the test. +#------------------------------------------------------------------------------- +DEVICE_VARS_OUTFILE="$outpath/mkspecs/qdevice.pri" +if cmp -s "$DEVICE_VARS_FILE" "$DEVICE_VARS_OUTFILE"; then + rm -f "$DEVICE_VARS_FILE" +else + mv -f $DEVICE_VARS_FILE "$DEVICE_VARS_OUTFILE" + DEVICE_VARS_FILE="$DEVICE_VARS_OUTFILE" +fi + +#------------------------------------------------------------------------------- # tests that don't need qmake (must be run before displaying help) #------------------------------------------------------------------------------- @@ -4384,6 +4419,9 @@ if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" ]; then -xplatform target ... The target platform when cross-compiling. + -device-option ... Add device specific options for the device mkspec + (experimental) + -no-feature- Do not compile in . -feature- .. Compile in . The available features are described in src/corelib/global/qfeatures.txt diff --git a/mkspecs/features/device_config.prf b/mkspecs/features/device_config.prf new file mode 100644 index 0000000..f7aeb07 --- /dev/null +++ b/mkspecs/features/device_config.prf @@ -0,0 +1,14 @@ +# Load generated qdevice.pri +isEmpty(QT_BUILD_TREE): QT_BUILD_TREE = $$fromfile($$_QMAKE_CACHE_, QT_BUILD_TREE) +isEmpty(QT_BUILD_TREE): QT_BUILD_TREE = . # where to get? + +DEVICE_PRI = $$QT_BUILD_TREE/mkspecs/qdevice.pri + +exists($$DEVICE_PRI):include($$DEVICE_PRI) +unset(DEVICE_PRI) + +isEmpty(CROSS_COMPILE) { + #this variable can be persisted via qmake -set CROSS_COMPILE /foo + CROSS_COMPILE = $$[CROSS_COMPILE] +} + -- cgit v0.12