Changeset 586


Ignore:
Timestamp:
Feb 21, 2010, 6:13:41 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

configure.cmd: Make sure QT_BUILD_KEY (QLibraryInfo::buildKey()) will contain all QT_NO_ defines as most (all?) of them make the build binary incompatible.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.cmd

    r585 r586  
    213213    G.Compiler = ""
    214214    G.CompilerVersion = 0
     215    G.CompilerVersionString = ""
    215216
    216217    G.CFG_CONFIGURE_EXIT_ON_ERROR = "yes"
     
    12501251     * Things that affect the Qt API/ABI:
    12511252     *
    1252      *   Config:
     1253     *   Options:
    12531254     *     minimal-config small-config medium-config large-config full-config
    1254      *     debug release
    12551255     *
    12561256     *   Different edition modules:
    12571257     *     network canvas table xml opengl sql
    12581258     *
    1259      *   Options:
     1259     * Things that do not affect the Qt API/ABI:
    12601260     *     stl
    1261      *
    1262      * Things that do not affect the Qt API/ABI:
    12631261     *     system-jpeg no-jpeg jpeg
    12641262     *     system-mng no-mng mng
     
    12671265     *     system-libtiff no-libtiff
    12681266     *     no-gif gif
     1267     *     debug release
    12691268     *     dll staticlib
    12701269     *
    1271      *     internal
    12721270     *     nocrosscompiler
    12731271     *     GNUmake
     
    12821280     */
    12831281
    1284     ALL_OPTIONS = "stl"
     1282    ALL_OPTIONS = ""
    12851283    BUILD_CONFIG = ""
    1286     BUILD_CONFIG2 = ""
    12871284    BUILD_OPTIONS = ""
    12881285
     
    13011298             * but a separate build key is maintained for each, so skip it now */
    13021299             nop
    1303         end
    1304         else if (opt == "stl") then do
    1305             /* these config options affect the Qt API/ABI. they should influence
    1306              * the generation of the buildkey, so we don't skip them */
    1307             skip = "no"
    13081300        end
    13091301        /* skip all other options since they don't affect the Qt API/ABI. */
     
    13331325    end
    13341326
    1335     /* QT_NO* defines affect the Qt API (and binary compatibility).  they need
    1336      * to be included in the build key */
    1337     DEFS = ""
    1338     do i = 1 to words(G.D_FLAGS)
    1339         opt = strip(word(G.D_FLAGS, i))
    1340         if (StartsWith(opt, "QT_NO")) then do
    1341             /* skip defines marked as not affecting binary compatibility */
    1342             if (wordpos(opt, G.BUILD_KEY_IRRELEVANT) \= 0) then
    1343                 iterate
    1344             /* maintan sort order and unicity (helps ensure that changes in this
    1345              * configure script don't affect the QT_BUILD_KEY generation) */
    1346             if (DEFS == "") then
    1347                 DEFS = opt
    1348             else
    1349             do j = 1 to words(DEFS)
    1350                 w = word(DEFS, j)
    1351                 c = compare(opt, w)
    1352                 if (c == 0) then leave
    1353                 if (substr(opt, c, 1) < substr(w, c, 1)) then do
    1354                     DEFS = insert(opt" ", DEFS, wordindex(DEFS, j) - 1)
    1355                     leave
    1356                 end
    1357                 if (j == words(DEFS)) then
    1358                     DEFS = DEFS" "opt
    1359             end
    1360         end
    1361         /* skip all other compiler defines */
    1362     end
    1363     BUILD_OPTIONS = BUILD_OPTIONS DEFS
    1364 
    1365     BUILD_OPTIONS = BUILD_CONFIG2 BUILD_CONFIG BUILD_OPTIONS
    1366 
    1367     parse value G.PLATFORM with ."-"COMPILER
     1327    BUILD_OPTIONS = BUILD_CONFIG BUILD_OPTIONS
     1328
     1329    /* some compilers generate binary incompatible code between different versions,
     1330     * so we need to generate a build key that is different between these compilers */
     1331    COMPILER = G.Compiler
     1332    if (COMPILER == 'g++') then do
     1333        if (StartsWith(G.CompilerVersionString, "3.")) then
     1334            COMPILER = COMPILER'-3'
     1335        else if (StartsWith(G.CompilerVersionString, "4.")) then
     1336            COMPILER = COMPILER'-4'
     1337        else
     1338            COMPILER = COMPILER'-'G.CompilerVersionString
     1339    end
     1340    else do
     1341        COMPILER = COMPILER'-'G.CompilerVersionString
     1342    end
     1343
    13681344    QT_BUILD_KEY_PRE = G.CFG_USER_BUILD_KEY G.CFG_ARCH COMPILER
    13691345    QT_BUILD_KEY_POST = BUILD_OPTIONS
    13701346    if (G.QT_NAMESPACE \== "") then
    13711347        QT_BUILD_KEY_POST = Join(QT_BUILD_KEY_POST, G.QT_NAMESPACE)
    1372 
    1373     /* we maintain two separate build keys (mainly necessary for the
    1374      * debug-and-release build) differentiated by the DEBUG compier define */
    1375     QT_BUILD_KEY_RELEASE = Normalize(QT_BUILD_KEY_PRE "release" QT_BUILD_KEY_POST)
    1376     QT_BUILD_KEY_DEBUG = Normalize(QT_BUILD_KEY_PRE "debug" QT_BUILD_KEY_POST)
    1377 
    1378     drop QT_BUILD_KEY_PRE QT_BUILD_KEY_POST
    13791348
    13801349    /*--------------------------------------------------------------------------
     
    14081377'#ifndef QT_EDITION'G.EOL||,
    14091378'#  define QT_EDITION' G.QT_EDITION||G.EOL||,
    1410 '#endif'G.EOL||,
    1411 ''G.EOL||,
    1412 '#ifndef NDEBUG'G.EOL||,
    1413 '# define QT_BUILD_KEY "'QT_BUILD_KEY_DEBUG'"'G.EOL||,
    1414 '#else'G.EOL||,
    1415 '# define QT_BUILD_KEY "'QT_BUILD_KEY_RELEASE'"'G.EOL||,
    14161379'#endif'G.EOL||,
    14171380''G.EOL||,
     
    15691532        end
    15701533    end
     1534
     1535    /* Add QT_NO* defines to the build key */
     1536    DEFS = ""
     1537    ALL_FLAGS = G.D_FLAGS G.QCONFIG_FLAGS
     1538    do i = 1 to words(ALL_FLAGS)
     1539        opt = strip(word(ALL_FLAGS, i))
     1540        if (StartsWith(opt, "QT_NO_")) then do
     1541            /* maintan sort order and unicity (helps ensure that changes in this
     1542             * configure script don't affect the QT_BUILD_KEY generation) */
     1543            if (DEFS == "") then
     1544                DEFS = opt
     1545            else
     1546            do j = 1 to words(DEFS)
     1547                w = word(DEFS, j)
     1548                c = compare(opt, w)
     1549                if (c == 0) then leave
     1550                if (substr(opt, c, 1) < substr(w, c, 1)) then do
     1551                    DEFS = insert(opt" ", DEFS, wordindex(DEFS, j) - 1)
     1552                    leave
     1553                end
     1554                if (j == words(DEFS)) then
     1555                    DEFS = DEFS" "opt
     1556            end
     1557        end
     1558        /* skip all other compiler defines */
     1559    end
     1560    QT_BUILD_KEY_POST = QT_BUILD_KEY_POST DEFS
     1561
     1562    /* write out QT_BUILD_KEY */
     1563
     1564    /* we maintain two separate build keys (mainly necessary for the
     1565     * debug-and-release build) differentiated by the DEBUG compier define */
     1566    QT_BUILD_KEY_RELEASE = Normalize(QT_BUILD_KEY_PRE "release" QT_BUILD_KEY_POST)
     1567    QT_BUILD_KEY_DEBUG = Normalize(QT_BUILD_KEY_PRE "debug" QT_BUILD_KEY_POST)
     1568
     1569    call charout qconfig_h_new,,
     1570'/* Qt Build Key */'G.EOL||,
     1571'#ifndef NDEBUG'G.EOL||,
     1572'# define QT_BUILD_KEY "'QT_BUILD_KEY_DEBUG'"'G.EOL||,
     1573'#else'G.EOL||,
     1574'# define QT_BUILD_KEY "'QT_BUILD_KEY_RELEASE'"'G.EOL||,
     1575'#endif'G.EOL||,
     1576''G.EOL
    15711577
    15721578    /* close the file */
     
    20012007    select
    20022008        when (G.Compiler == "g++") then do
    2003             address "cmd" "g++ --version | rxqueue.exe"
     2009            address "cmd" "g++ -dumpversion | rxqueue.exe"
    20042010            do while queued() <> 0
    20052011                parse pull str
    2006                 if (left(str, 10) == "g++ (GCC) ") then do
    2007                     parse value substr(str, 11) with G.CompilerVersionString " " .
     2012                if (str \= "") then do
     2013                    G.CompilerVersionString = strip(str)
    20082014                    parse var G.CompilerVersionString x "." y "." z
    20092015                    if (x == "") then x = 0
     
    20112017                    if (z == "") then z = 0
    20122018                    G.CompilerVersion = x * 10000 + y * 100 + z
     2019                    leave
    20132020                end
    20142021            end
Note: See TracChangeset for help on using the changeset viewer.