diff options
-rwxr-xr-x | configure | 40 | ||||
-rw-r--r-- | mkspecs/features/device_config.prf | 14 |
2 files changed, 53 insertions, 1 deletions
@@ -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 <key=value> ... Add device specific options for the device mkspec + (experimental) + -no-feature-<feature> Do not compile in <feature>. -feature-<feature> .. Compile in <feature>. 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] +} + |