configure: added env variable handling to extractQMakeVariables
authorTomasz Olszak <olszak.tomasz@gmail.com>
Tue, 10 Nov 2015 14:41:54 +0000 (15:41 +0100)
committerTomasz Olszak <olszak.tomasz@gmail.com>
Tue, 10 Nov 2015 14:41:54 +0000 (15:41 +0100)
Thise makes it possible to extract qmake variables that reference
environment variables, e.g.:

  SOME_QMAKE_VARIABLE = $$(SOME_ENV_VARIABLE)

Change-Id: I5b80a9959bc9041413c7549913c4f939a8fda807
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
configure

index 7f65377..1c8ed4f 100755 (executable)
--- a/configure
+++ b/configure
@@ -239,10 +239,15 @@ BEGIN {
     gsub("[ \t]+$", "", value)
 
     ovalue = ""
-    while (match(value, /\$\$(\{[_A-Z0-9.]+\}|[_A-Z0-9.]+)/)) {
+    while (match(value, /\$\$(\([_A-Z0-9.]+\)|\{[_A-Z0-9.]+\}|[_A-Z0-9.]+)/)) {
         ovalue = ovalue substr(value, 1, RSTART - 1)
         var = substr(value, RSTART + 2, RLENGTH - 2)
         value = substr(value, RSTART + RLENGTH)
+        if (var ~ /^\(/) {
+            var = substr(var, 2, length(var) - 2)
+            ovalue = ovalue ENVIRON[var]
+            continue
+        }
         if (var ~ /^\{/) {
             var = substr(var, 2, length(var) - 2)
         }