Index: /trunk/configure.cmd
===================================================================
--- /trunk/configure.cmd	(revision 585)
+++ /trunk/configure.cmd	(revision 586)
@@ -213,4 +213,5 @@
     G.Compiler = ""
     G.CompilerVersion = 0
+    G.CompilerVersionString = ""
 
     G.CFG_CONFIGURE_EXIT_ON_ERROR = "yes"
@@ -1250,15 +1251,12 @@
      * Things that affect the Qt API/ABI:
      *
-     *   Config:
+     *   Options:
      *     minimal-config small-config medium-config large-config full-config
-     *     debug release
      *
      *   Different edition modules:
      *     network canvas table xml opengl sql
      *
-     *   Options:
+     * Things that do not affect the Qt API/ABI:
      *     stl
-     *
-     * Things that do not affect the Qt API/ABI:
      *     system-jpeg no-jpeg jpeg
      *     system-mng no-mng mng
@@ -1267,7 +1265,7 @@
      *     system-libtiff no-libtiff
      *     no-gif gif
+     *     debug release
      *     dll staticlib
      *
-     *     internal
      *     nocrosscompiler
      *     GNUmake
@@ -1282,7 +1280,6 @@
      */
 
-    ALL_OPTIONS = "stl"
+    ALL_OPTIONS = ""
     BUILD_CONFIG = ""
-    BUILD_CONFIG2 = ""
     BUILD_OPTIONS = ""
 
@@ -1301,9 +1298,4 @@
              * but a separate build key is maintained for each, so skip it now */
              nop
-        end
-        else if (opt == "stl") then do
-            /* these config options affect the Qt API/ABI. they should influence
-             * the generation of the buildkey, so we don't skip them */
-            skip = "no"
         end
         /* skip all other options since they don't affect the Qt API/ABI. */
@@ -1333,48 +1325,25 @@
     end
 
-    /* QT_NO* defines affect the Qt API (and binary compatibility).  they need
-     * to be included in the build key */
-    DEFS = ""
-    do i = 1 to words(G.D_FLAGS)
-        opt = strip(word(G.D_FLAGS, i))
-        if (StartsWith(opt, "QT_NO")) then do
-            /* skip defines marked as not affecting binary compatibility */
-            if (wordpos(opt, G.BUILD_KEY_IRRELEVANT) \= 0) then
-                iterate
-            /* maintan sort order and unicity (helps ensure that changes in this
-             * configure script don't affect the QT_BUILD_KEY generation) */
-            if (DEFS == "") then
-                DEFS = opt
-            else
-            do j = 1 to words(DEFS)
-                w = word(DEFS, j)
-                c = compare(opt, w)
-                if (c == 0) then leave
-                if (substr(opt, c, 1) < substr(w, c, 1)) then do
-                    DEFS = insert(opt" ", DEFS, wordindex(DEFS, j) - 1)
-                    leave
-                end
-                if (j == words(DEFS)) then
-                    DEFS = DEFS" "opt
-            end
-        end
-        /* skip all other compiler defines */
-    end
-    BUILD_OPTIONS = BUILD_OPTIONS DEFS
-
-    BUILD_OPTIONS = BUILD_CONFIG2 BUILD_CONFIG BUILD_OPTIONS
-
-    parse value G.PLATFORM with ."-"COMPILER
+    BUILD_OPTIONS = BUILD_CONFIG BUILD_OPTIONS
+
+    /* some compilers generate binary incompatible code between different versions,
+     * so we need to generate a build key that is different between these compilers */
+    COMPILER = G.Compiler
+    if (COMPILER == 'g++') then do
+        if (StartsWith(G.CompilerVersionString, "3.")) then
+            COMPILER = COMPILER'-3'
+        else if (StartsWith(G.CompilerVersionString, "4.")) then
+            COMPILER = COMPILER'-4'
+        else
+            COMPILER = COMPILER'-'G.CompilerVersionString
+    end
+    else do
+        COMPILER = COMPILER'-'G.CompilerVersionString
+    end
+
     QT_BUILD_KEY_PRE = G.CFG_USER_BUILD_KEY G.CFG_ARCH COMPILER
     QT_BUILD_KEY_POST = BUILD_OPTIONS
     if (G.QT_NAMESPACE \== "") then
         QT_BUILD_KEY_POST = Join(QT_BUILD_KEY_POST, G.QT_NAMESPACE)
-
-    /* we maintain two separate build keys (mainly necessary for the
-     * debug-and-release build) differentiated by the DEBUG compier define */
-    QT_BUILD_KEY_RELEASE = Normalize(QT_BUILD_KEY_PRE "release" QT_BUILD_KEY_POST)
-    QT_BUILD_KEY_DEBUG = Normalize(QT_BUILD_KEY_PRE "debug" QT_BUILD_KEY_POST)
-
-    drop QT_BUILD_KEY_PRE QT_BUILD_KEY_POST
 
     /*--------------------------------------------------------------------------
@@ -1408,10 +1377,4 @@
 '#ifndef QT_EDITION'G.EOL||,
 '#  define QT_EDITION' G.QT_EDITION||G.EOL||,
-'#endif'G.EOL||,
-''G.EOL||,
-'#ifndef NDEBUG'G.EOL||,
-'# define QT_BUILD_KEY "'QT_BUILD_KEY_DEBUG'"'G.EOL||,
-'#else'G.EOL||,
-'# define QT_BUILD_KEY "'QT_BUILD_KEY_RELEASE'"'G.EOL||,
 '#endif'G.EOL||,
 ''G.EOL||,
@@ -1569,4 +1532,47 @@
         end
     end
+
+    /* Add QT_NO* defines to the build key */
+    DEFS = ""
+    ALL_FLAGS = G.D_FLAGS G.QCONFIG_FLAGS
+    do i = 1 to words(ALL_FLAGS)
+        opt = strip(word(ALL_FLAGS, i))
+        if (StartsWith(opt, "QT_NO_")) then do
+            /* maintan sort order and unicity (helps ensure that changes in this
+             * configure script don't affect the QT_BUILD_KEY generation) */
+            if (DEFS == "") then
+                DEFS = opt
+            else
+            do j = 1 to words(DEFS)
+                w = word(DEFS, j)
+                c = compare(opt, w)
+                if (c == 0) then leave
+                if (substr(opt, c, 1) < substr(w, c, 1)) then do
+                    DEFS = insert(opt" ", DEFS, wordindex(DEFS, j) - 1)
+                    leave
+                end
+                if (j == words(DEFS)) then
+                    DEFS = DEFS" "opt
+            end
+        end
+        /* skip all other compiler defines */
+    end
+    QT_BUILD_KEY_POST = QT_BUILD_KEY_POST DEFS
+
+    /* write out QT_BUILD_KEY */
+
+    /* we maintain two separate build keys (mainly necessary for the
+     * debug-and-release build) differentiated by the DEBUG compier define */
+    QT_BUILD_KEY_RELEASE = Normalize(QT_BUILD_KEY_PRE "release" QT_BUILD_KEY_POST)
+    QT_BUILD_KEY_DEBUG = Normalize(QT_BUILD_KEY_PRE "debug" QT_BUILD_KEY_POST)
+
+    call charout qconfig_h_new,,
+'/* Qt Build Key */'G.EOL||,
+'#ifndef NDEBUG'G.EOL||,
+'# define QT_BUILD_KEY "'QT_BUILD_KEY_DEBUG'"'G.EOL||,
+'#else'G.EOL||,
+'# define QT_BUILD_KEY "'QT_BUILD_KEY_RELEASE'"'G.EOL||,
+'#endif'G.EOL||,
+''G.EOL
 
     /* close the file */
@@ -2001,9 +2007,9 @@
     select
         when (G.Compiler == "g++") then do
-            address "cmd" "g++ --version | rxqueue.exe"
+            address "cmd" "g++ -dumpversion | rxqueue.exe"
             do while queued() <> 0
                 parse pull str
-                if (left(str, 10) == "g++ (GCC) ") then do
-                    parse value substr(str, 11) with G.CompilerVersionString " " .
+                if (str \= "") then do
+                    G.CompilerVersionString = strip(str)
                     parse var G.CompilerVersionString x "." y "." z
                     if (x == "") then x = 0
@@ -2011,4 +2017,5 @@
                     if (z == "") then z = 0
                     G.CompilerVersion = x * 10000 + y * 100 + z
+                    leave
                 end
             end
