diff options
author | N.Sukegawa <nsukeg@gmail.com> | 2014-11-08 20:42:00 +0900 |
---|---|---|
committer | Nobuaki Sukegawa <nsukeg@gmail.com> | 2014-11-15 04:26:33 +0100 |
commit | f1aafb595bb5b9bd9b8d3299e5722bcc35aea889 (patch) | |
tree | 205968e4f2a67c82d6e6b2245937888c41c33a8d /configure | |
parent | c1081b9426596c55505838e6ff1318259749ec54 (diff) |
Make configure fail on invalid (-no)-feature options
configure script has been silently accepting whatever flags that begin
with "-feature-" even if the feature name does not exist at all.
Since the script validates many other flags, this behavior can make
users believe flags they supply is valid when it isn't.
Besides, this option is currently not protected against typo in any way.
This commit verifies those flags against content of
"qtbase/src/corelib/global/qfeatures.txt" and fails if supplied
flag is not a valid feature name.
Change-Id: Ib19ec66dd5558fb5491e8e080ce07d4807d94c1f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1409,7 +1409,8 @@ while [ "$#" -gt 0 ]; do fi ;; feature-*) - FEATURE=`echo $VAR | sed 's,^[^-]*-\([^-]*\),\1,' | tr 'abcdefghijklmnopqrstuvwxyz-' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + FEATURE=`echo $VAR | sed 's,^[^-]*-\([^-]*\),\1,' | tr 'abcdefghijklmnopqrstuvwxyz-' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` + if grep "^Feature: *${FEATURE} *\$" "$relpath"/src/corelib/global/qfeatures.txt >/dev/null 2>&1; then if [ "$VAL" = "no" ]; then QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_$FEATURE" elif [ "$VAL" = "yes" ] || [ "$VAL" = "unknown" ]; then @@ -1417,6 +1418,10 @@ while [ "$#" -gt 0 ]; do else UNKNOWN_OPT=yes fi + else + echo "ERROR: Unknown feature $FEATURE" + UNKNOWN_OPT=yes + fi ;; shared) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then |