diff options
author | Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com> | 2012-05-15 08:44:13 -0700 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-19 01:45:04 +0200 |
commit | c01621ec8849123214ac9bcd9e38b572037917f8 (patch) | |
tree | f20b1479188350c50ac10ff7d4cddcbdc05d06c0 /configure | |
parent | 76e073375e8f6160b6dd9eaae2f2ba1fcce63ea9 (diff) |
device: Allow specifying shortnames for device mkspecs
Specifying -device linux-amlogic-8726M-g++ is error prone. With this
change, one can specify any substring of the mkspec names under
devices/ and the first one will be picked.
Change-Id: I7c4522fdaefe4a11e9292f7831075aa766a62c0b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -242,6 +242,21 @@ DeviceVar() echo "$2" "$eq" "$3" >> "$DEVICE_VARS_FILE" } +resolveDeviceMkspec() +{ + result=$(find "$relpath/mkspecs/devices/" -type d -name "*$VAL*" | sed "s,^$relpath/mkspecs/,,") + match_count=$(echo "$result" | wc -w) + if [ "$match_count" -gt 1 ]; then + echo >&2 "Error: Multiple matches for device '$VAL'. Candidates are:" + tabbed_result=$(echo "$result" | sed "s,^, ,") + echo >&2 "$tabbed_result" + echo "undefined" + elif [ "$match_count" -eq 0 ]; then + echo >&2 "Error: No device matching '$VAL'" + echo "undefined" + fi +} + #------------------------------------------------------------------------------- # operating system detection #------------------------------------------------------------------------------- @@ -1270,7 +1285,8 @@ while [ "$#" -gt 0 ]; do case `basename "$XPLATFORM"` in win32-g++*) XPLATFORM_MINGW=yes;; esac ;; device) - XPLATFORM="devices/$VAL" + XPLATFORM=`resolveDeviceMkspec $VAL` + [ "$XPLATFORM" = "undefined" ] && exit 101 ;; device-option) DEV_VAR=`echo $VAL | sed "s,^\(.*\)=.*,\1,"` |