Changeset 46


Ignore:
Timestamp:
Jun 24, 2009, 8:47:10 PM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

configure.cmd: Generate qconfig.h, qconfig.pri and .qmake.cache (#14).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.cmd

    r45 r46  
    3939
    4040G.QMAKE_OUTDIR      = ""
    41 G.QMAKE_VARS_FILE   = ".qmake.vars"
    4241
    4342G.CFG_DEV           = "no"
    44 
    45 /* Qt for OS/2 is always the open source edition */
    46 G.Licensee      = "Open Source"
    47 G.Edition       = "OpenSource"
    48 G.EditionString = "Open Source"
    49 G.QT_EDITION    = "QT_EDITION_OPENSOURCE"
    5043
    5144
     
    8477call MagicLogHook arg(1)
    8578
    86 call Main
     79call Main arg(1)
    8780
    8881call Done 0
     
    9588/**
    9689 *  Just do the job.
     90 *
     91 *  @param aArgs    Comand line arguments.
    9792 */
    9893Main: procedure expose (Globals)
     94
     95    parse arg aArgs
    9996
    10097    /* the directory of this script is the "source tree */
     
    103100    G.OutPath = directory()
    104101
    105     /* reset the vars file */
    106     call DeleteFile G.QMAKE_VARS_FILE
     102    /* QTDIR may be set and point to an old or system-wide Qt installation */
     103    call UnsetEnv "QTDIR"
     104
     105    /*--------------------------------------------------------------------------
     106     Qt version detection
     107    --------------------------------------------------------------------------*/
     108
     109    G.QT_VERSION = ""
     110    G.QT_MAJOR_VERSION = ""
     111    G.QT_MINOR_VERSION = 0
     112    G.QT_PATCH_VERSION = 0
     113
     114    G.QT_PACKAGEDATE = ""
     115
     116    qglobal_h = G.RelPath"\src\corelib\global\qglobal.h"
     117
     118    i = 2 /* number of lines to match */
     119    do while lines(qglobal_h)
     120        str = linein(qglobal_h)
     121        parse var str w1 w2 w3
     122        if (w1 == '#define' & w2 == 'QT_VERSION_STR') then do
     123            parse var w3 '"'G.QT_VERSION'"'
     124            i = i -1
     125        end
     126        else if (w1 == '#define' & w2 == 'QT_PACKAGEDATE_STR') then do
     127            parse var w3 '"'G.QT_PACKAGEDATE'"'
     128            i = i -1
     129        end
     130        if (i == 0) then leave
     131    end
     132
     133    if (G.QT_VERSION \== "") then do
     134        parse var G.QT_VERSION maj'.'minor'.'patch
     135        if (patch == "" | verify(patch, '0123456789') = 0) then do
     136            if (patch \== "") then
     137                G.QT_PATCH_VERSION = patch
     138            if (minor == "" | verify(minor, '0123456789') = 0) then do
     139                if (minor \== "") then
     140                    G.QT_MINOR_VERSION = minor
     141                if (maj \== "" & verify(maj, '0123456789') = 0) then
     142                    G.QT_MAJOR_VERSION = maj
     143            end
     144        end
     145    end
     146    if (G.QT_MAJOR_VERSION == "") then do
     147       call SayErr "Cannot process version from qglobal.h: """G.QT_VERSION""""
     148       call SayErr "Cannot proceed."
     149       call Done 1
     150    end
     151
     152    if (G.QT_PACKAGEDATE == "") then do
     153       call SayErr "Unable to determine package date from qglobal.h: """G.QT_PACKAGEDATE""""
     154       call SayErr "Cannot proceed."
     155       call Done 1
     156    end
     157
     158    /*--------------------------------------------------------------------------
     159     check the license
     160    --------------------------------------------------------------------------*/
     161
     162    /* Qt for OS/2 is always the open source edition */
     163    G.Licensee      = "Open Source"
     164    G.Edition       = "OpenSource"
     165    G.EditionString = "Open Source"
     166    G.QT_EDITION    = "QT_EDITION_OPENSOURCE"
     167
     168    /*--------------------------------------------------------------------------
     169     initalize variables
     170    --------------------------------------------------------------------------*/
    107171
    108172    call QMakeVar "add", "styles", "cde mac motif plastique cleanlooks windows"
     
    114178    QMakeVar add mouse-drivers "pc linuxtp"
    115179*/
    116 
    117     /* QTDIR may be set and point to an old or system-wide Qt installation */
    118     call UnsetEnv "QTDIR"
    119180
    120181    /* @todo cleanup the option list below when it's clear which options are
     
    203264    G.CFG_GLIB = "auto"
    204265    G.CFG_GSTREAMER = "auto"
    205     G.CFG_DBUS = "auto"
    206266    G.CFG_NAS = "no"
    207     G.CFG_OPENSSL = "auto"
    208267*/
    209268    G.CFG_QGTKSTYLE = "auto"
     269    G.CFG_OPENSSL = "auto"
     270    G.CFG_OPENSSL_LIBS = ""
     271    G.CFG_DBUS = "auto"
    210272    G.CFG_LARGEFILE = "auto"
    211273    G.CFG_PTMALLOC = "no"
     
    213275    G.CFG_PRECOMPILE = "auto"
    214276    G.CFG_SEPARATE_DEBUG_INFO = "auto"
    215     G.CFG_REDUCE_EXPORTS = "auto"
    216     G.CFG_REDUCE_RELOCATIONS = "no"
    217277/* @todo do we really need this?
    218278    G.CFG_MMX = "auto"
     
    240300    G.CFG_FRAMEWORK = "auto"
    241301*/
    242     G.CFG_SXE = "no"
    243302    G.CFG_PREFIX_INSTALL = "yes"
    244303    G.CFG_SDK = ""
     
    273332    G.QT_HOST_PREFIX = ""
    274333
     334    G.QT_LIBINFIX = ""
    275335    G.QT_NAMESPACE = ""
    276336
     
    344404    end
    345405
    346     /* parse command line arguments
     406    /*--------------------------------------------------------------------------
     407     parse command line arguments
    347408    --------------------------------------------------------------------------*/
    348409
    349410    /* @todo */
     411    if (aArgs \== "") then do
     412        call SayErr
     413        call SayErr "Sorry, command line arguments are not yet processed."
     414        call SayErr "Please run the script again without the arguments."
     415        call SayErr
     416        call Done 1
     417    end
    350418
    351419    if (G.CFG_QCONFIG \== "full" & G.CFG_QT3SUPPORT == "yes") then do
     
    705773    --------------------------------------------------------------------------*/
    706774
    707     /* nothing yet */
     775    /* the current "tests" don't actually need qmake, we just keep the
     776     * structure similar to ./configure */
     777
     778    /* enable all image formats and ZLIB by default */
     779    if (G.CFG_TIFF == "auto")   then G.CFG_TIFF = "yes"
     780    if (G.CFG_PNG == "auto")    then G.CFG_PNG = "yes"
     781    if (G.CFG_JPEG == "auto")   then G.CFG_JPEG = "yes"
     782    if (G.CFG_MNG == "auto")    then G.CFG_MNG = "yes"
     783    if (G.CFG_ZLIB == "auto")   then G.CFG_ZLIB = "yes"
     784
     785    if (G.CFG_QGTKSTYLE == "auto")  then G.CFG_QGTKSTYLE = "no"
     786    if (G.CFG_OPENSSL == "auto")    then G.CFG_OPENSSL = "no"
     787    if (G.CFG_DBUS == "auto")       then G.CFG_DBUS = "no"
     788
     789    if (G.CFG_GRAPHICS_SYSTEM == "default") then G.CFG_GRAPHICS_SYSTEM = "raster"
    708790
    709791    /*--------------------------------------------------------------------------
     
    742824        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_OPENGL")
    743825
    744     /* safe execution environment */
    745     if (G.CFG_SXE \== "no") then
    746         G.QT_CONFIG = Join(G.QT_CONFIG, "sxe")
    747 
    748826    /* build up the variables for output */
    749827    if (G.CFG_DEBUG == "yes") then do
     
    764842    end
    765843
    766     call QMakeVar "set", "PRECOMPILED_DIR", ".pch\"G.QMAKE_OUTDIR
    767     call QMakeVar "set", "OBJECTS_DIR", ".obj\"G.QMAKE_OUTDIR
    768     call QMakeVar "set", "MOC_DIR", ".moc\"G.QMAKE_OUTDIR
    769     call QMakeVar "set", "RCC_DIR", ".rcc\"G.QMAKE_OUTDIR
    770     call QMakeVar "set", "UI_DIR", ".uic\"G.QMAKE_OUTDIR
     844    call QMakeVar "set", "PRECOMPILED_DIR", "tmp\pch\"G.QMAKE_OUTDIR
     845    call QMakeVar "set", "OBJECTS_DIR", "tmp\obj\"G.QMAKE_OUTDIR
     846    call QMakeVar "set", "MOC_DIR", "tmp\moc\"G.QMAKE_OUTDIR
     847    call QMakeVar "set", "RCC_DIR", "tmp\rcc\"G.QMAKE_OUTDIR
     848    call QMakeVar "set", "UI_DIR", "tmp\uic\"G.QMAKE_OUTDIR
    771849
    772850    if (G.CFG_LARGEFILE == "yes") then
     
    780858        G.QMAKE_CONFIG = Join(G.QMAKE_CONFIG, "GNUmake")
    781859
    782     if (G.CFG_REDUCE_EXPORTS == "yes") then
    783         G.QT_CONFIG = Join(G.QT_CONFIG, "reduce_exports")
    784     if (G.CFG_REDUCE_RELOCATIONS == "yes") then
    785         G.QT_CONFIG = Join(G.QT_CONFIG, "reduce_relocations")
    786860    if (G.CFG_PRECOMPILE == "yes") then
    787861        G.QMAKE_CONFIG = Join(G.QMAKE_CONFIG, "precompile_header")
     
    882956    if (G.CFG_GSTREAMER == "yes") then
    883957        G.QT_CONFIG = Join(G.QT_CONFIG, "gstreamer")
    884     if (G.CFG_DBUS == "yes") then
    885         G.QT_CONFIG = Join(G.QT_CONFIG, "dbus")
    886958    if (G.CFG_DBUS == "linked") then
    887959        G.QT_CONFIG = Join(G.QT_CONFIG dbus, "dbus-linked")
    888960    if (G.CFG_NAS == "system") then
    889961        G.QT_CONFIG = Join(G.QT_CONFIG, "nas")
    890     if (G.CFG_OPENSSL == "yes") then
    891         G.QT_CONFIG = Join(G.QT_CONFIG, "openssl")
    892962    if (G.CFG_OPENSSL == "linked") then
    893963        G.QT_CONFIG = Join(G.QT_CONFIG, "openssl-linked")
    894964*/
     965    if (G.CFG_OPENSSL == "yes") then
     966        G.QT_CONFIG = Join(G.QT_CONFIG, "openssl")
     967    if (G.CFG_DBUS == "yes") then
     968        G.QT_CONFIG = Join(G.QT_CONFIG, "dbus")
    895969
    896970    if (G.D_FLAGS \== "") then
     
    914988    end
    915989    if (G.CFG_XMLPATTERNS == "auto" & G.CFG_EXCEPTIONS \== "no") then
    916         G.CFG_XMLPATTERNS = "yes"
     990        G.CFG_XMLPATTERNS = "yes" /* QtXmlPatterns is fine for GCC 3.3.x */
    917991    else if (G.CFG_EXCEPTIONS == "no") then
    918992        G.CFG_XMLPATTERNS = "no"
     
    9281002
    9291003    if (G.CFG_WEBKIT == "auto") then
    930         G.CFG_WEBKIT = "yes"
     1004        G.CFG_WEBKIT = "no" /* WebKit seems to require G++ >= 3.4.x */
    9311005
    9321006    if (G.CFG_WEBKIT == "yes") then
     
    9441018    if (G.CFG_SCRIPTTOOLS == "yes") then
    9451019        G.QT_CONFIG = Join(G.QT_CONFIG, "scripttools")
    946     else
    947         G.CFG_SCRIPTTOOLS="no"
     1020    else do
     1021        G.CFG_SCRIPTTOOLS = "no"
    9481022        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_SCRIPTTOOLS")
     1023    end
    9491024
    9501025    if (G.CFG_EXCEPTIONS == "no") then do
     
    10311106                do j = 1 to words(BUILD_OPTIONS)
    10321107                    w = word(BUILD_OPTIONS, j)
    1033                     if (w == opt) then leave
    1034                     if (w > opt) then do
    1035                         insert(opt" ", BUILD_OPTIONS, wordindex(BUILD_OPTIONS, j))
     1108                    c = compare(opt, w)
     1109                    if (c == 0) then leave
     1110                    if (substr(opt, c, 1) < substr(w, c, 1)) then do
     1111                        BUILD_OPTIONS = insert(opt" ", BUILD_OPTIONS, wordindex(BUILD_OPTIONS, j) - 1)
    10361112                        leave
    10371113                    end
    1038                     if (j == words(BUILD_OPTIONS) then
     1114                    if (j == words(BUILD_OPTIONS)) then
    10391115                        BUILD_OPTIONS = Join(BUILD_OPTIONS, opt)
    10401116                end
     
    10561132            do j = 1 to words(DEFS)
    10571133                w = word(DEFS, j)
    1058                 if (w == opt) then leave
    1059                 if (w > opt) then do
    1060                     insert(opt" ", DEFS, wordindex(DEFS, j))
     1134                c = compare(opt, w)
     1135                if (c == 0) then leave
     1136                if (substr(opt, c, 1) < substr(w, c, 1)) then do
     1137                    DEFS = insert(opt" ", DEFS, wordindex(DEFS, j) - 1)
    10611138                    leave
    10621139                end
    1063                 if (j == words(DEFS) then
     1140                if (j == words(DEFS)) then
    10641141                    DEFS = DEFS" "opt
    10651142            end
     
    11261203'#define QT_ARCH_'translate(G.CFG_ARCH)||G.EOL,
    11271204''G.EOL||,
    1128 '/* Compile time features */'||G.EOL
     1205'/* Compile time features */'||G.EOL||G.EOL
    11291206
    11301207    if (G.CFG_LARGEFILE == "yes") then
     
    11341211        call charout qconfig_h_new, '"#define QT_BUILD_INTERNAL'G.EOL||G.EOL
    11351212
     1213    /* Add turned on SQL drivers */
     1214    SQL_DRIVERS = ""
     1215    SQL_PLUGINS = ""
     1216    do i = 1 to words(G.CFG_SQL_AVAILABLE)
     1217        drv = word(G.CFG_SQL_AVAILABLE, i)
     1218        val = value("G.CFG_SQL_"drv)
     1219        if (val == "qt") then do
     1220            G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_SQL_"translate(drv))
     1221            SQL_DRIVERS = Join(SQL_DRIVERS, drv)
     1222        end
     1223        else if (val == "plugin") then
     1224            SQL_PLUGINS = Join(SQL_PLUGINS, drv)
     1225    end
     1226
     1227    if (SQL_DRIVERS \== "") then
     1228        call QMakeVar "set", "sql-drivers", SQL_DRIVERS
     1229    if (SQL_PLUGINS \== "") then
     1230        call QMakeVar "set", "sql-plugins", SQL_PLUGINS
     1231
     1232    /* Add other configuration options to the qconfig.h file */
     1233    if (G.CFG_GIF == "yes") then
     1234        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_BUILTIN_GIF_READER=1")
     1235    if (G.CFG_TIFF \== "yes") then
     1236        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_IMAGEFORMAT_TIFF")
     1237    if (G.CFG_PNG \== "yes") then
     1238        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_IMAGEFORMAT_PNG")
     1239    if (G.CFG_JPEG \== "yes") then
     1240        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_IMAGEFORMAT_JPEG")
     1241    if (G.CFG_MNG \== "yes") then
     1242        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_IMAGEFORMAT_MNG")
     1243    if (G.CFG_ZLIB \== "yes") then
     1244        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_ZLIB")
     1245    if (G.CFG_EXCEPTIONS == "no") then
     1246        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_EXCEPTIONS")
     1247/* @todo detect what's actually relevant
     1248    if (G.CFG_IPV6 == "no") then
     1249        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_IPV6")
     1250*/
     1251    if (G.CFG_QGTKSTYLE \== "yes") then
     1252        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_STYLE_GTK")
     1253    if (G.CFG_OPENSSL == "no") then
     1254        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_OPENSSL")
     1255    if (G.CFG_DBUS == "no") then
     1256        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_DBUS")
     1257
     1258    if (G.CFG_GRAPHICS_SYSTEM == "raster") then
     1259        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_GRAPHICSSYSTEM_RASTER")
     1260    if (G.CFG_GRAPHICS_SYSTEM == "opengl") then
     1261        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_GRAPHICSSYSTEM_OPENGL")
     1262
     1263    /* X11/Unix/Mac only configs */
     1264/* @todo detect what's actually relevant
     1265    if (G.CFG_CUPS == "no") then
     1266        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_CUPS")
     1267    if (G.CFG_ICONV == "no") then
     1268        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_ICONV")
     1269    if (G.CFG_GLIB \== "yes") then
     1270        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_GLIB")
     1271    if (G.CFG_GSTREAMER \== "yes") then
     1272        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_GSTREAMER")
     1273    if (G.CFG_CLOCK_MONOTONIC == "no") then
     1274        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_CLOCK_MONOTONIC")
     1275    if (G.CFG_MREMAP == "no") then
     1276        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_MREMAP")
     1277    if (G.CFG_GETADDRINFO == "no") then
     1278        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_GETADDRINFO")
     1279    if (G.CFG_IPV6IFNAME == "no") then
     1280        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_IPV6IFNAME")
     1281    if (G.CFG_GETIFADDRS == "no") then
     1282        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_GETIFADDRS")
     1283    if (G.CFG_INOTIFY == "no") then
     1284        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_INOTIFY")
     1285    if (G.CFG_NAS == "no") then
     1286        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_NAS")
     1287    if (G.CFG_NIS == "no") then
     1288        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_NIS")
     1289    if (G.CFG_OPENSSL == "linked") then
     1290        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_LINKED_OPENSSL")
     1291
     1292    if (G.CFG_SM == "no") then
     1293        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_SESSIONMANAGER")
     1294    if (G.CFG_XCURSOR == "no") then
     1295        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_XCURSOR")
     1296    if (G.CFG_XFIXES == "no") then
     1297        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_XFIXES")
     1298    if (G.CFG_FONTCONFIG == "no") then
     1299        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_FONTCONFIG")
     1300    if (G.CFG_XINERAMA == "no") then
     1301        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_XINERAMA")
     1302    if (G.CFG_XKB == "no") then
     1303        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_XKB")
     1304    if (G.CFG_XRANDR == "no") then
     1305        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_XRANDR")
     1306    if (G.CFG_XRENDER == "no") then
     1307        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_XRENDER")
     1308    if (G.CFG_MITSHM == "no") then
     1309        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_MITSHM")
     1310    if (G.CFG_XSHAPE == "no") then
     1311        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_SHAPE")
     1312    if (G.CFG_XINPUT == "no") then
     1313        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS QT_NO_XINPUT, "QT_NO_TABLET")
     1314
     1315    if (G.CFG_XCURSOR == "runtime") then
     1316        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_RUNTIME_XCURSOR")
     1317    if (G.CFG_XINERAMA == "runtime") then
     1318        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_RUNTIME_XINERAMA")
     1319    if (G.CFG_XFIXES == "runtime") then
     1320        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_RUNTIME_XFIXES")
     1321    if (G.CFG_XRANDR == "runtime") then
     1322        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_RUNTIME_XRANDR")
     1323    if (G.CFG_XINPUT == "runtime") then
     1324        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_RUNTIME_XINPUT")
     1325*/
     1326
     1327    /* do primitive sorting (the list is not so big so it should be fine) */
     1328    sorted = ""
     1329    do i = 1 to words(G.QCONFIG_FLAGS)
     1330        w = word(G.QCONFIG_FLAGS, i)
     1331        if (sorted == "") then
     1332            sorted = w
     1333        else
     1334        do j = 1 to words(sorted)
     1335            w2 = word(sorted, j)
     1336            c = compare(w, w2)
     1337            if (c == 0) then leave
     1338            if (substr(w, c, 1) < substr(w2, c, 1)) then do
     1339                sorted = insert(w" ", sorted, wordindex(sorted, j) - 1)
     1340                leave
     1341            end
     1342            if (j == words(sorted)) then
     1343                sorted = sorted" "w
     1344        end
     1345    end
     1346    G.QCONFIG_FLAGS = sorted
     1347
     1348    if (G.QCONFIG_FLAGS \== "") then do
     1349        do i = 1 to words(G.QCONFIG_FLAGS)
     1350            cfg = word(G.QCONFIG_FLAGS, i)
     1351            parse value cfg with cfgd'='cfgv /* trim pushed 'Foo=Bar' defines */
     1352            cfg = strip(cfgd' 'cfgv)         /* turn first '=' into a space */
     1353            /* figure out define logic, so we can output the correct
     1354             * ifdefs to override the global defines in a project */
     1355            cfgdNeg = ""
     1356            if (StartsWith(cfg, "QT_NO_")) then
     1357                /* QT_NO_option can be forcefully turned on by QT_option */
     1358                cfgdNeg = "QT_"substr(cfg, 7)
     1359            else if (StartsWith(cfg, "QT_")) then
     1360                /* QT_option can be forcefully turned off by QT_NO_option */
     1361                cfgdNeg = "QT_NO_"substr(cfg, 4)
     1362            if (cfgdNeg == "") then
     1363                call charout qconfig_h_new,,
     1364'#ifndef 'cfgd||G.EOL||,
     1365'# define 'cfg||G.EOL||,
     1366'#endif'G.EOL||G.EOL
     1367            else
     1368                call charout qconfig_h_new,,
     1369'#if defined('cfgd') && defined('cfgdNeg')'G.EOL||,
     1370'# undef 'cfgd||G.EOL||,
     1371'#elif !defined('cfgd') && !defined('cfgdNeg')'G.EOL||,
     1372'# define 'cfg||G.EOL||,
     1373'#endif'G.EOL||G.EOL
     1374        end
     1375    end
     1376
    11361377    /* close the file */
    11371378    call charout qconfig_h_new
    11381379
    1139     /* @todo not everything implemented yet, cry loudly... */
    1140     signal Nonsense
     1380    /* avoid unecessary rebuilds by copying only if qconfig.h has changed */
     1381    changed = \FileExists(qconfig_h)
     1382    if (\changed) then do
     1383        qconfig_h_str = charin(qconfig_h, 1, chars(qconfig_h))
     1384        call charout qconfig_h
     1385        changed = CompareFileToVar(qconfig_h_new, qconfig_h_str) \= 0
     1386    end
     1387    if (changed) then
     1388        call MoveFile qconfig_h_new, qconfig_h
     1389    else
     1390        call DeleteFile qconfig_h_new
     1391
     1392    /*--------------------------------------------------------------------------
     1393     save configuration into qconfig.pri
     1394    --------------------------------------------------------------------------*/
     1395
     1396    qconfig_pri = G.OutPath"\mkspecs\qconfig.pri"
     1397    qconfig_pri_new = qconfig_pri".new"
     1398
     1399    call DeleteFile qconfig_pri_new
     1400
     1401    G.QTCONFIG_CONFIG = Join(G.QTCONFIG_CONFIG, "no_mocdepend")
     1402
     1403    if (G.CFG_DEBUG == "yes") then do
     1404        G.QTCONFIG_CONFIG = Join(G.QTCONFIG_CONFIG, "debug")
     1405        if (G.CFG_DEBUG_RELEASE == "yes") then
     1406            G.QT_CONFIG = Join(G.QT_CONFIG, "release")
     1407        G.QT_CONFIG = Join(G.QT_CONFIG, "debug")
     1408    end
     1409    else if (G.CFG_DEBUG == "no") then do
     1410        G.QTCONFIG_CONFIG = Join(G.QTCONFIG_CONFIG, "release")
     1411        if (G.CFG_DEBUG_RELEASE == "yes") then
     1412            G.QT_CONFIG = Join(G.QT_CONFIG, "debug")
     1413        G.QT_CONFIG = Join(G.QT_CONFIG, "release")
     1414    end
     1415
     1416    if (G.CFG_STL == "yes") then
     1417        G.QTCONFIG_CONFIG = Join(G.QTCONFIG_CONFIG, "stl")
     1418/* @todo do we really need this?
     1419    if (G.CFG_FRAMEWORK == "no") then
     1420        G.QTCONFIG_CONFIG = Join(G.QTCONFIG_CONFIG, "qt_no_framework")
     1421    else do
     1422        G.QT_CONFIG = Join(G.QT_CONFIG, "qt_framework")
     1423        G.QTCONFIG_CONFIG = Join(G.QTCONFIG_CONFIG, "qt_framework")
     1424    end
     1425*/
     1426
     1427    call charout qconfig_pri_new,,
     1428'#configuration'G.EOL||,
     1429'CONFIG += 'G.QTCONFIG_CONFIG||G.EOL||,
     1430'QT_ARCH = 'G.CFG_ARCH||G.EOL||,
     1431'QT_EDITION = 'G.Edition||G.EOL||,
     1432'QT_CONFIG += 'G.QT_CONFIG||G.EOL||,
     1433''G.EOL||,
     1434'#versioning'G.EOL||,
     1435'QT_VERSION = 'G.QT_VERSION||G.EOL||,
     1436'QT_MAJOR_VERSION = 'G.QT_MAJOR_VERSION||G.EOL||,
     1437'QT_MINOR_VERSION = 'G.QT_MINOR_VERSION||G.EOL||,
     1438'QT_PATCH_VERSION = 'G.QT_PATCH_VERSION||G.EOL||,
     1439''G.EOL||,
     1440'#namespaces'G.EOL||,
     1441'QT_LIBINFIX = 'G.QT_LIBINFIX||G.EOL||,
     1442'QT_NAMESPACE = 'G.QT_NAMESPACE||G.EOL||,
     1443''G.EOL
     1444
     1445    /* close the file */
     1446    call charout qconfig_pri_new
     1447
     1448    /* replace qconfig.pri if it differs from the newly created temp file */
     1449    changed = \FileExists(qconfig_pri)
     1450    if (\changed) then do
     1451        qconfig_pri_str = charin(qconfig_pri, 1, chars(qconfig_pri))
     1452        call charout qconfig_pri
     1453        changed = CompareFileToVar(qconfig_pri_new, qconfig_pri_str) \= 0
     1454    end
     1455    if (changed) then
     1456        call MoveFile qconfig_pri_new, qconfig_pri
     1457    else
     1458        call DeleteFile qconfig_pri_new
     1459
     1460    /*--------------------------------------------------------------------------
     1461     save configuration into .qmake.cache
     1462    --------------------------------------------------------------------------*/
     1463
     1464    qmake_cache = G.OutPath"\.qmake.cache"
     1465    qmake_cache_new = qmake_cache".new"
     1466
     1467    call DeleteFile qmake_cache_new
     1468
     1469    call charout qmake_cache_new,,
     1470'CONFIG         += 'G.QMAKE_CONFIG' create_prl link_prl depend_includepath fix_output_dirs QTDIR_build'G.EOL||,
     1471'QT_SOURCE_TREE  = 'QuotePath(G.RelPath)||G.EOL||,
     1472'QT_BUILD_TREE   = 'QuotePath(G.OutPath)||G.EOL||,
     1473'QT_BUILD_PARTS  = 'G.CFG_BUILD_PARTS||G.EOL||,
     1474'QMAKE_MOC_SRC   = $$QT_BUILD_TREE\src\moc'G.EOL||,
     1475''G.EOL||,
     1476'#local paths that cannot be queried from the QT_INSTALL_* properties while building QTDIR'G.EOL||,
     1477'QMAKE_MOC       = $$QT_BUILD_TREE\bin\moc.exe'G.EOL||,
     1478'QMAKE_UIC       = $$QT_BUILD_TREE\bin\uic.exe'G.EOL||,
     1479'QMAKE_UIC3      = $$QT_BUILD_TREE\bin\uic3.exe'G.EOL||,
     1480'QMAKE_RCC       = $$QT_BUILD_TREE\bin\rcc.exe'G.EOL||,
     1481'QMAKE_INCDIR_QT = $$QT_BUILD_TREE\include'G.EOL||,
     1482'QMAKE_LIBDIR_QT = $$QT_BUILD_TREE\lib'G.EOL||G.EOL
     1483
     1484    if (G.QT_CFLAGS_PSQL \== "") then
     1485        call lineout qmake_cache_new, 'QT_CFLAGS_PSQL  = 'G.QT_CFLAGS_PSQL
     1486    if (G.QT_LFLAGS_PSQL \== "") then
     1487        call lineout qmake_cache_new, 'QT_LFLAGS_PSQL  = 'G.QT_LFLAGS_PSQL
     1488    if (G.QT_CFLAGS_MYSQL \== "") then
     1489        call lineout qmake_cache_new, 'QT_CFLAGS_MYSQL = 'G.QT_CFLAGS_MYSQL
     1490    if (G.QT_LFLAGS_MYSQL \== "") then
     1491        call lineout qmake_cache_new, 'QT_LFLAGS_MYSQL = 'G.QT_LFLAGS_MYSQL
     1492    if (G.QT_CFLAGS_SQLITE \== "") then
     1493        call lineout qmake_cache_new, 'QT_CFLAGS_SQLITE = 'G.QT_CFLAGS_SQLITE
     1494    if (G.QT_LFLAGS_SQLITE \== "") then
     1495        call lineout qmake_cache_new, 'QT_LFLAGS_SQLITE = 'G.QT_LFLAGS_SQLITE
     1496
     1497    if (G.QT_EDITION \== "QT_EDITION_OPENSOURCE") then
     1498        call charout qmake_cache_new, 'DEFINES *= QT_EDITION=QT_EDITION_DESKTOP'
     1499
     1500    /* dump in the OPENSSL_LIBS info */
     1501    OPENSSL_LIBS = GetEnv("OPENSSL_LIBS")
     1502    if (OPENSSL_LIBS \== "") then
     1503        call lineout qmake_cache_new, 'OPENSSL_LIBS = 'OPENSSL_LIBS
     1504    else if (G.CFG_OPENSSL == "linked") then
     1505        call lineout qmake_cache_new, 'OPENSSL_LIBS = -lssl -lcrypto'
     1506
     1507    /* dump the qmake spec */
     1508    if (DirExists(G.OutPath"\mkspecs\"G.XPLATFORM)) then
     1509       call lineout qmake_cache_new, 'QMAKESPEC = $$QT_BUILD_TREE\mkspecs\'G.XPLATFORM
     1510    else
     1511       call lineout qmake_cache_new, 'QMAKESPEC = 'G.XPLATFORM
     1512
     1513    /* cmdline args */
     1514    call charout qmake_cache_new, G.EOL||G.QMAKE_VARS
     1515
     1516    /* @todo process CFG_INCREMENTAL? */
     1517
     1518    /* close the file */
     1519    call lineout qmake_cache_new
     1520
     1521    /* replace .qmake.cache if it differs from the newly created temp file */
     1522    changed = \FileExists(qmake_cache)
     1523    if (\changed) then do
     1524        qmake_cache_str = charin(qmake_cache, 1, chars(qmake_cache))
     1525        call charout qmake_cache
     1526        changed = CompareFileToVar(qmake_cache_new, qmake_cache_str) \= 0
     1527    end
     1528    if (changed) then
     1529        call MoveFile qmake_cache_new, qmake_cache
     1530    else
     1531        call DeleteFile qmake_cache_new
     1532
     1533    /*--------------------------------------------------------------------------
     1534     give feedback on configuration
     1535    --------------------------------------------------------------------------*/
     1536
     1537    /* G++ is the only supported compiler on OS/2 so far */
     1538    if (G.CFG_EXCEPTIONS \== "no") then
     1539        call SaySay,,
     1540'        This target is using the GNU C++ compiler ('G.PLATFORM').'G.EOL||,
     1541''G.EOL||,
     1542'        Recent versions of this compiler automatically include code for'G.EOL||,
     1543'        exceptions, which increase both the size of the Qt libraries and'G.EOL||,
     1544'        the amount of memory taken by your applications.'G.EOL||,
     1545''G.EOL||,
     1546'        You may choose to re-run `'filespec('N', G.ScriptFile)'` with the -no-exceptions'G.EOL||,
     1547'        option to compile Qt without exceptions. This is completely binary'G.EOL||,
     1548'        compatible, and existing applications will continue to work.'G.EOL||G.EOL
     1549
     1550    if (G.XPLATFORM == G.PLATFORM) then
     1551        call SaySay "Build type:    "G.PLATFORM
     1552    else do
     1553        call SaySay "Building on:   "G.PLATFORM
     1554        call SaySay "Building for:  "G.XPLATFORM
     1555    end
     1556
     1557    call SaySay "Architecture:  "G.CFG_ARCH
     1558
     1559    if (G.OPT_VERBOSE == "yes") then do
     1560        call SaySay "qmake vars .......... "replace(G.QMAKE_VARS,G.EOL,' ')
     1561        call SaySay "qmake switches ...... "G.QMAKE_SWITCHES
     1562    end
     1563
     1564    /* @todo process CFG_INCREMENTAL? */
     1565
     1566    call SaySay "Build ............... "G.CFG_BUILD_PARTS
     1567    call SaySay "Configuration ....... "G.QMAKE_CONFIG G.QT_CONFIG
     1568    if (G.CFG_DEBUG_RELEASE == "yes") then do
     1569       call SaySay "Debug ............... yes (combined)"
     1570       if (G.CFG_DEBUG == "yes") then
     1571           call SaySay "Default Link ........ debug"
     1572       else
     1573           call SaySay "Default Link ........ release"
     1574    end
     1575    else
     1576       call SaySay "Debug ............... "G.CFG_DEBUG
     1577
     1578    call SaySay "Qt 3 compatibility .. "G.CFG_QT3SUPPORT
     1579/* @todo do we really need this?
     1580    [ "$CFG_DBUS" = "no" ]     && echo "QtDBus module ....... no"
     1581    [ "$CFG_DBUS" = "yes" ]    && echo "QtDBus module ....... yes (run-time)"
     1582    [ "$CFG_DBUS" = "linked" ] && echo "QtDBus module ....... yes (linked)"
     1583*/
     1584    call SaySay "QtScriptTools module  "G.CFG_SCRIPTTOOLS
     1585    call SaySay "QtXmlPatterns module  "G.CFG_XMLPATTERNS
     1586    call SaySay "Phonon module ....... "G.CFG_PHONON
     1587    call SaySay "SVG module .......... "G.CFG_SVG
     1588    call SaySay "WebKit module ....... "G.CFG_WEBKIT
     1589    call SaySay "STL support ......... "G.CFG_STL
     1590    call SaySay "PCH support ......... "G.CFG_PRECOMPILE
     1591/* @todo do we really need this?
     1592    call SaySay "MMX/3DNOW/SSE/SSE2..  "G.CFG_MMX}"/"G.CFG_3DNOW"/"G.CFG_SSE"/"G.CFG_SSE2
     1593*/
     1594    call SaySay "Graphics System ..... "G.CFG_GRAPHICS_SYSTEM
     1595    call SaySay "Accessibility ....... "G.CFG_ACCESSIBILITY
     1596/* @todo do we really need this?
     1597    call SaySay "IPv6 support ........ "G.CFG_IPV6
     1598    call SaySay "IPv6 ifname support . "G.CFG_IPV6IFNAME
     1599    call SaySay "getifaddrs support .. "G.CFG_GETIFADDRS
     1600    call SaySay "NIS support ......... "G.CFG_NIS
     1601    call SaySay "CUPS support ........ "G.CFG_CUPS
     1602    call SaySay "Iconv support ....... "G.CFG_ICONV
     1603    call SaySay "Glib support ........ "G.CFG_GLIB
     1604    call SaySay "GStreamer support ... "G.CFG_GSTREAMER
     1605*/
     1606    call SaySay "Large File support .. "G.CFG_LARGEFILE
     1607    call SaySay "GIF support ......... "G.CFG_GIF
     1608    if (G.CFG_TIFF == "no") then
     1609        call SaySay "TIFF support ........ "G.CFG_TIFF
     1610    else
     1611        call SaySay "TIFF support ........ "G.CFG_TIFF" ("G.CFG_LIBTIFF")"
     1612    if (G.CFG_JPEG == "no") then
     1613        call SaySay "JPEG support ........ "G.CFG_JPEG
     1614    else
     1615        call SaySay "JPEG support ........ "G.CFG_JPEG" ("G.CFG_LIBJPEG")"
     1616    if (G.CFG_PNG == "no") then
     1617        call SaySay "PNG support ......... "G.CFG_PNG
     1618    else
     1619        call SaySay "PNG support ......... "G.CFG_PNG" ("G.CFG_LIBPNG")"
     1620    if (G.CFG_MNG == "no") then
     1621        call SaySay "MNG support ......... "G.CFG_MNG
     1622    else
     1623        call SaySay "MNG support ......... "G.CFG_MNG" ("G.CFG_LIBMNG")"
     1624    call SaySay "zlib support ........ "G.CFG_ZLIB
     1625    call SaySay "Session management .. "G.CFG_SM
     1626
     1627    if (G.CFG_OPENGL == "desktop") then
     1628        call SaySay "OpenGL support ...... yes (Desktop OpenGL)"
     1629    else if (G.CFG_OPENGL == "es1") then
     1630        call SaySay "OpenGL support ...... yes (OpenGL ES 1.x Common profile)"
     1631    else if (G.CFG_OPENGL == "es1cl") then
     1632        call SaySay "OpenGL support ...... yes (OpenGL ES 1.x Common Lite profile)"
     1633    else if (G.CFG_OPENGL == "es2") then
     1634        call SaySay "OpenGL support ...... yes (OpenGL ES 2.x)"
     1635    else
     1636        call SaySay "OpenGL support ...... no"
     1637
     1638    if (G.CFG_SQL_mysql \== "no") then
     1639        call SaySay "MySQL support ....... "G.CFG_SQL_mysql
     1640    if (G.CFG_SQL_psql \== "no") then
     1641        call SaySay "PostgreSQL support .. "G.CFG_SQL_psql
     1642    if (G.CFG_SQL_odbc \== "no") then
     1643        call SaySay "ODBC support ........ "G.CFG_SQL_odbc
     1644    if (G.CFG_SQL_oci \== "no") then
     1645        call SaySay "OCI support ......... "G.CFG_SQL_oci
     1646    if (G.CFG_SQL_tds \== "no") then
     1647        call SaySay "TDS support ......... "G.CFG_SQL_tds
     1648    if (G.CFG_SQL_db2 \== "no") then
     1649        call SaySay "DB2 support ......... "G.CFG_SQL_db2
     1650    if (G.CFG_SQL_ibase \== "no") then
     1651        call SaySay "InterBase support ... "G.CFG_SQL_ibase
     1652    if (G.CFG_SQL_sqlite2 \== "no") then
     1653        call SaySay "SQLite 2 support .... "G.CFG_SQL_sqlite2
     1654    if (G.CFG_SQL_sqlite \== "no") then
     1655        call SaySay "SQLite support ...... "G.CFG_SQL_sqlite" ("G.CFG_SQLITE")"
     1656
     1657    OPENSSL_LINKAGE = ""
     1658    if (G.CFG_OPENSSL == "yes") then
     1659        OPENSSL_LINKAGE = "(run-time)"
     1660    else if (G.CFG_OPENSSL == "linked") then
     1661        OPENSSL_LINKAGE = "(linked)"
     1662    call SaySay "OpenSSL support ..... "G.CFG_OPENSSL OPENSSL_LINKAGE
     1663
     1664    if (G.CFG_PTMALLOC \== "no") then
     1665        call SaySay "Use ptmalloc ........ "G.CFG_PTMALLOC
     1666
     1667    /* complain about not being able to use dynamic plugins if we are using a static build */
     1668    if (G.CFG_SHARED == "no") then
     1669        call SaySay,,
     1670G.EOL||,
     1671"WARNING: Using static linking will disable the use of dynamically"G.EOL||,
     1672"loaded plugins. Make sure to import all needed static plugins,"G.EOL||,
     1673"or compile needed modules into the library."G.EOL||,
     1674G.EOL
     1675    if (G.CFG_OPENSSL == "linked" &  OPENSSL_LIBS == "") then
     1676        call SaySay,,
     1677G.EOL||,
     1678"NOTE: When linking against OpenSSL, you can override the default"G.EOL||,
     1679"library names through OPENSSL_LIBS."G.EOL||,
     1680"For example:"G.EOL||,
     1681"    configure -openssl-linked OPENSSL_LIBS='-L/path/to/lib -lssl -lcrypto'"G.EOL||,
     1682G.EOL
     1683
     1684    call SaySay
     1685
     1686    /*--------------------------------------------------------------------------
     1687     build makefiles based on the configuration
     1688    --------------------------------------------------------------------------*/
     1689
     1690    /* @todo walk through the source tree and call qmake on .pro files */
     1691
     1692    /*--------------------------------------------------------------------------
     1693     check for platforms that we don't yet know about
     1694    --------------------------------------------------------------------------*/
     1695    if (G.CFG_ARCH == "generic") then
     1696        call SaySay,,
     1697G.EOL||,
     1698'            NOTICE: Atomic operations are not yet supported for this'G.EOL||,
     1699'            architecture.'G.EOL||,
     1700G.EOL||,
     1701'            Qt will use the 'generic' architecture instead, which uses a'G.EOL||,
     1702'            single pthread_mutex_t to protect all atomic operations. This'G.EOL||,
     1703'            implementation is the slow (but safe) fallback implementation'G.EOL||,
     1704'            for architectures Qt does not yet support.'G.EOL||,
     1705G.EOL
     1706
     1707    /*--------------------------------------------------------------------------
     1708     finally save the executed command to another script
     1709    --------------------------------------------------------------------------*/
     1710
     1711    /* @todo save a call to configure.cmd with all options to a script called
     1712     * config.staus.cmd */
     1713
     1714    G.MAKE = filespec('N', G.MAKE)
     1715    call SaySay
     1716    call SaySay "Qt is now configured for building. Just run '"G.MAKE"'."
     1717    call SaySay
     1718    call SaySay "To reconfigure, run '"G.MAKE" confclean' and 'configure.cmd'."
     1719    call SaySay
     1720
    11411721    return
    11421722
     
    11591739    end
    11601740
    1161     call lineout G.QMAKE_VARS_FILE, aVarname eq aContents
    1162 
     1741    G.QMAKE_VARS = G.QMAKE_VARS||aVarname eq aContents||G.EOL
    11631742    return
    11641743
Note: See TracChangeset for help on using the changeset viewer.