Changeset 93


Ignore:
Timestamp:
May 1, 2006, 11:16:33 PM (19 years ago)
Author:
dmik
Message:

GNUMAKE backend:

  • Added the internal qmake variable QMAKE_DEFINES_QT (similar to DEFINES but effective only when qt, qtinc or build_qt is present in CONFIG).

Configure script:

  • Mandatory Qt defines are moved from the .qtos2defines file to the generated .qtos2config file (this makes usage of QMAKE_DEFINES_QT).
  • Added the ability to specify a list of custom Qt defines (also using QMAKE_DEFINES_QT).
  • When a custom build is performed, the .qtbuild file is automatically deleted (if exists) to avoid confusion.
  • no_mocdepend is always added to CONFIG in .qtos2config to prevent generated moc sources from being dependent on the moc executable (quite useless).
Location:
trunk
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.cmd

    r91 r93  
    6363Opt.!GIF        = 0 /* WARNING: license restrictions apply when setting to 1! */
    6464
     65Opt.!QTCustomDefines  = ''
     66
     67/*
     68 *  Defines to disable various Qt features that haven't been implemented
     69 *  yet on OS/2. NOTE: don't touch this variable!
     70 */
     71G.!QTMandatoryDefines  = 'QT_NO_DRAGANDDROP QT_NO_PRINTER QT_NO_IPV6'
     72
    6573/* Configuration cache file */
    6674G.!ConfigCache      = '.configure.cache'
     
    7078G.!QMakeCache       = '.qmake.cache'
    7179G.!QtOS2Config      = '.qtos2config'
     80G.!QtBuild          = '.qtbuild'
    7281G.!QModulesH        = 'include\qmodules.h'
    7382G.!QConfigH         = 'include\qconfig.h'
     
    153162    G.!QMakeCache = G.!QTDirP'\'G.!QMakeCache
    154163    G.!QtOS2Config = G.!QTDirP'\'G.!QtOS2Config
     164    G.!QtBuild = G.!QTDirP'\'G.!QtBuild
    155165    G.!QModulesH = G.!QTDirP'\'G.!QModulesH
    156166    G.!QConfigH = G.!QTDirP'\'G.!QConfigH
     
    264274    call WriteVar G.!ConfigCache, 'Opt.!GIF'
    265275
     276    call WriteVar G.!ConfigCache, 'Opt.!QTCustomDefines'
     277   
    266278    call lineout G.!ConfigCache
    267279
     
    510522    Opt.!DLL = -choice + 2
    511523   
    512     MagicConfig = ''
     524    OfficialBuildConfig = ''
    513525   
    514526    if (Opt.!DLL == 1) then do
     
    527539            if (name == 'qt_official_build') then do
    528540                /* magic CONFIG keyword to mark the Qt build as official */
    529                 MagicConfig = 'qt_official_build '
    530                 name = Opt.!CustomDLLName
     541                OfficialBuildConfig = 'qt_official_build '
    531542                leave
    532543            end
     
    534545            if (upperName \= '' & length(upperName) <= 8 &,
    535546                verify(upperName,'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_') == 0 &,
    536                 left(upperName, 2) \= 'QT') then leave
     547                left(upperName, 2) \= 'QT') then do
     548                Opt.!CustomDLLName = name
     549                call DeleteFile G.!QtBuild
     550                leave
     551            end
    537552            call SayErr 'The entered name is not valid.'
    538553            say
    539554        end
    540         Opt.!CustomDLLName = name
    541555    end
    542556
     
    565579    end
    566580
     581    if (OfficialBuildConfig == '') then do
     582        call SaySay 'Enter a list of custom Qt defines separated by spaces'
     583        Opt.!QTCustomDefines =,
     584            InputLine('(if you don''t know what it is, just press Enter):',,
     585                      Opt.!QTCustomDefines)
     586        Opt.!QTCustomDefines = strip(Opt.!QTCustomDefines)
     587    end
     588   
    567589    call WriteConfigCache
    568590
     
    679701    call SaySay 'Library type   : 'DllOrStatic', 'ReleaseOrDebug', multithreaded'
    680702    if (Opt.!DLL == 1) then do
    681         if (MagicConfig == '') then
     703        if (OfficialBuildConfig == '') then
    682704            call SaySay 'Library name   : 'Opt.!CustomDLLName
    683705        else
     
    686708    call SaySay 'Modules        : 'BasicModules OptionalModules
    687709    call SaySay 'Other features : 'OptionalConfig
     710    if (Opt.!QTCustomDefines \= '') then   
     711        call SaySay 'Custom defines : 'Opt.!QTCustomDefines
    688712    say
    689713
     
    714738    call lineout qmake_cache, 'imageformat-plugins+='
    715739    call lineout qmake_cache, 'QT_PRODUCT=qt-enterprise'
    716     call lineout qmake_cache, 'CONFIG+='MagicConfig'nocrosscompiler',
     740    call lineout qmake_cache, 'CONFIG+='OfficialBuildConfig'nocrosscompiler',
    717741                              BasicModules OptionalModules,
    718742                              'minimal-config small-config medium-config large-config full-config ',
     
    733757    call lineout qmake_cache
    734758
    735     if (Opt.!DLL == 1) then
     759    if (Opt.!DLL == 1 & OfficialBuildConfig == '') then
    736760        call lineout qtos2config, 'QMAKE_QT_DLL_TARGET = 'Opt.!CustomDLLName
    737     call lineout qtos2config, 'CONFIG += 'SharedOrNot' thread 'ReleaseOrDebug
    738     call lineout qtos2config, 'exists( $(QTDIR)\.qtos2defines ) {'
    739     call lineout qtos2config, '    include( $(QTDIR)\.qtos2defines )'
    740     call lineout qtos2config, '    QMAKE_INTERNAL_INCLUDED_FILES += $(QTDIR)\.qtos2defines'
    741     call lineout qtos2config, '}'
     761    call lineout qtos2config, 'CONFIG += 'SharedOrNot' thread 'ReleaseOrDebug' no_mocdepend'
     762    call lineout qtos2config, 'QMAKE_DEFINES_QT += 'G.!QTMandatoryDefines
     763    if (OfficialBuildConfig == '' & Opt.!QTCustomDefines \= '') then
     764        call lineout qtos2config, 'QMAKE_DEFINES_QT += 'Opt.!QTCustomDefines
     765    call lineout qtos2config, 'QMAKE_INTERNAL_INCLUDED_FILES += $(QTDIR)\.qtos2config'
    742766    call lineout qtos2config
    743767
     
    830854
    831855    if (\no_cleanup_query) then do
    832         call SaySay "Clean up the previous build?"
     856        call SaySay "Clean up *everything* before compiling?"
    833857        do_cleanup =,
    834858            GetYesNo("(answering N (no) is usually the best choice)", 'N')
  • trunk/mkspecs/os2-g++/qmake.conf

    r90 r93  
    1616
    1717exists( $(QTDIR)\.qtos2config ) {
    18         include( $(QTDIR)\.qtos2config )
     18        include( $(QTDIR)\.qtos2config )
    1919}
    20 exists( $(QTDIR)\.build ) {
    21         include( $(QTDIR)\.build )
     20exists( $(QTDIR)\.qtbuild ) {
     21        include( $(QTDIR)\.qtbuild )
    2222}
    2323
     
    6666QMAKE_LIBDIR_QT         = $(QTDIR)\lib
    6767QMAKE_LIBDIR_QT_DEBUG   = $(QTDIR)\lib\debug
     68
     69QMAKE_DEFINES_QT        +=
    6870
    6971# As a workaround for the CMD.EXE command line length limitation (1024 chars)
  • trunk/os2-doc/doc.html

    r89 r93  
    342342    <kbd>debug</kbd> keywords in the <code>CONFIG</code> statement.</p>
    343343
    344     <p>21. The <code>VERSION</code> project variable is copied by qmake (as
    345     is) to the generated makefile. Note that its value does not affect the
    346     name of the generated DLL target anymore (for projects with the
    347     <kbd>lib</kbd> template and with the <kbd>dll</kbd> keyword in
     344    <p>21. The <code>VERSION</code> project variable is copied by
     345    <kbd>qmake</kbd> (as is) to the generated makefile. Note that its value
     346    does not affect the name of the generated DLL target anymore (for projects
     347    with the <kbd>lib</kbd> template and with the <kbd>dll</kbd> keyword in
    348348    <code>CONFIG</code>), as opposed to other qmake backends. Appending a
    349349    version number to the DLL name could implicitly lead to running out of the
     
    352352    be used by qmake compiler specifications to embed the version to the
    353353    generated DLL file itself (as the GCC specification does).</p>
     354
     355    <p>22. Added the internal qmake variable <code>QMAKE_DEFINES_QT</code>. It
     356    is intended to list a set of C/C++ defines to be used during compilation
     357    of C/C++ sources when either <kbd>qt</kbd>, <kbd>qtinc</kbd> or
     358    <kbd>build_qt</kbd> is present in the <code>CONFIG</code> statement. Using
     359    this variable instead of <code>DEFINES</code> keeps non-Qt projects free
     360    from Qt-only related defines (otherwise added to every Makefile generated
     361    by <kbd>qmake</kbd> from any project file).</p>
    354362  </body>
    355363</html>
  • trunk/qmake/generators/os2/gnumake.cpp

    r89 r93  
    450450    if (project->isActiveConfig("qt") && project->isActiveConfig("shared"))
    451451        project->variables()["DEFINES"].append("QT_DLL");
     452
     453    if (!project->variables()["QMAKE_DEFINES_QT"].isEmpty() &&
     454        (is_qt || project->isActiveConfig("qt") || project->isActiveConfig("qtinc"))) {
     455        QStringList &defs = project->variables()["DEFINES"];
     456        QStringList &qtdefs = project->variables()["QMAKE_DEFINES_QT"];
     457        QStringList::ConstIterator it = qtdefs.end();
     458        while (it != qtdefs.begin()) {
     459            --it;
     460            if (!defs.contains(*it))
     461                defs.prepend(*it);
     462        }
     463    }
    452464   
    453465    if (project->isActiveConfig("qt_dll"))
  • trunk/src/qt.pro

    r86 r93  
    178178shared:os2:qt_official_build {
    179179        TARGET = qt$$split(VERSION,.,)
    180         system( echo QMAKE_QT_DLL_TARGET = $$TARGET > ..\.build )
     180        system( echo QMAKE_QT_DLL_TARGET = $$TARGET > ..\.qtbuild )
    181181} else {
    182182        TARGET = $$QMAKE_QT_DLL_TARGET
Note: See TracChangeset for help on using the changeset viewer.