From 33714b6c022183ca4bd98b7158d072b3892d4d32 Mon Sep 17 00:00:00 2001 From: Dimitrios Apostolou Date: Wed, 24 Jun 2020 23:05:04 +0200 Subject: [PATCH] Adjust configure -cmake to accept both single and double dash arguments This uses sed -E (extended regular expressions) to improve readability of regular expressions. Shouldn't be a problem on most modern systems. Change-Id: I12c9834c1ef83bf5f8547bccff655a6b8525cc3d Reviewed-by: Joerg Bornemann --- configure | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/configure b/configure index 6f67340b4f..0a39adf77d 100755 --- a/configure +++ b/configure @@ -149,23 +149,18 @@ $i" CMAKE_CMDLINE="$CMAKE_CMDLINE -DQT_NO_MAKE_${arg_capitalized}=ON" ;; - -feature-*) - VAR=`echo $i | sed 's,^-feature-\(.*\),\1,'` + -feature-*|--feature-*) + VAR=`echo $i | sed -E 's/-?-feature-(.*)/\1/'` CMAKE_CMDLINE="$CMAKE_CMDLINE -DQT_FEATURE_${VAR}=ON" ;; - -no-feature-*) - VAR=`echo $i | sed 's,^-no-feature-\(.*\),\1,'` + -no-feature-*|--no-feature-*) + VAR=`echo $i | sed -E 's/-?-no-feature-(.*)/\1/'` CMAKE_CMDLINE="$CMAKE_CMDLINE -DQT_FEATURE_${VAR}=OFF" ;; - --no-*) - VAR=`echo $i | sed 's,^--no-\(.*\),\1,'` - CMAKE_CMDLINE="$CMAKE_CMDLINE --DFEATURE_${VAR}=OFF" - ;; - -no-*) - VAR=`echo $i | sed 's,^-no-\(.*\),\1,'` + -no-*|--no-*) + VAR=`echo $i | sed -E 's/-?-no-(.*)/\1/'` CMAKE_CMDLINE="$CMAKE_CMDLINE -DFEATURE_${VAR}=OFF" ;; @@ -179,12 +174,12 @@ $i" CMAKE_CMDLINE="$CMAKE_CMDLINE -DFEATURE_system_${VAR}=OFF" ;; - --sanitize=*) - VAR=`echo $i | sed 's,^--sanitize=\(.*\),\1,'` + -sanitize=*|--sanitize=*) + VAR=`echo $i | sed -E 's/-?-sanitize=(.*)/\1/'` CMAKE_CMDLINE="$CMAKE_CMDLINE -DECM_ENABLE_SANITIZERS=${VAR}" ;; - --ccache) + -ccache|--ccache) CMAKE_CMDLINE="$CMAKE_CMDLINE -DQT_USE_CCACHE=ON" ;;