Changeset 417


Ignore:
Timestamp:
Dec 11, 2009, 1:28:58 AM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

qmake/os2-g++: Added support for precompiled headers on GCC >= 3.4.x (still inactive since GCC 4.4.2 traps when including a precompiled header).

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.cmd

    r411 r417  
    212212
    213213    /* initalize internal variables */
     214    G.Compiler = ""
     215    G.CompilerVersion = 0
     216
    214217    G.CFG_CONFIGURE_EXIT_ON_ERROR = "yes"
    215218    G.CFG_PROFILE = "no"
     
    491494    else G.QMAKESPEC = G.RelPath"\mkspecs\"G.PLATFORM
    492495
     496    call CheckCompiler
     497
    493498    /* Cross-builds are not supported */
    494499    G.XPLATFORM = G.PLATFORM
     
    548553    if (wordpos("libs", G.CFG_BUILD_PARTS) == 0) then
    549554        G.CFG_BUILD_PARTS = Join(G.CFG_BUILD_PARTS, "libs")
     555
     556    /* auto-detect precompiled header support */
     557    if (G.CFG_PRECOMPILE == "auto") then do
     558        /* @todo enable the below code once PCH actually work in GCC 4.4.2 */
     559/*
     560        if (G.Compiler == "g++") then do
     561            if (G.CompilerVersion >= 030400) then
     562                G.CFG_PRECOMPILE = "yes"
     563            else
     564                G.CFG_PRECOMPILE = "no"
     565        end
     566*/
     567    end
    550568
    551569    /* detect the exepack program */
     
    883901    end
    884902
    885 /* @todo later, when CFG_PRECOMPILE is implemented
    886903    call QMakeVar "set", "PRECOMPILED_DIR", "tmp\pch\"G.QMAKE_OUTDIR
    887 */
    888904    call QMakeVar "set", "OBJECTS_DIR", "tmp\obj\"G.QMAKE_OUTDIR
    889905    call QMakeVar "set", "MOC_DIR", "tmp\moc\"G.QMAKE_OUTDIR
     
    893909    if (G.CFG_LARGEFILE == "yes") then
    894910        G.QMAKE_CONFIG = Join(G.QMAKE_CONFIG, "largefile")
     911
    895912    if (G.CFG_STL == "no") then
    896913        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_STL")
     
    902919
    903920    if (G.CFG_PRECOMPILE == "yes") then
    904         G.QMAKE_CONFIG = Join(G.QMAKE_CONFIG, "precompile_header")
     921        G.QTCONFIG_CONFIG = Join(G.QTCONFIG_CONFIG, "precompile_header")
    905922
    906923    if (G.CFG_SEPARATE_DEBUG_INFO == "yes") then do
     
    17891806    call SaySay "To reconfigure, run '"G.MAKE" confclean' and 'configure.cmd'."
    17901807    call SaySay
     1808
     1809    return
     1810
     1811/**
     1812 * Gets the information about the compiler from QMAKESPEC and from the
     1813 * compiler's executable and sets the following variables:
     1814 *
     1815 *  G.Compiler              - compiler name from the QMAKESPEC value (e.g. after '-')
     1816 *  G.CompilerVersion       - compiler version as a single number, for comparison
     1817 *  G.CompilerVersionString - compiler version as a string, for printing
     1818 */
     1819CheckCompiler: procedure expose (Globals)
     1820
     1821    parse var G.QMAKESPEC . "-" G.Compiler
     1822    select
     1823        when (G.Compiler == "g++") then do
     1824            address "cmd" "g++ --version | rxqueue.exe"
     1825            do while queued() <> 0
     1826                parse pull str
     1827                if (left(str, 10) == "g++ (GCC) ") then do
     1828                    parse value substr(str, 11) with G.CompilerVersionString " " .
     1829                    parse var G.CompilerVersionString x "." y "." z
     1830                    if (x == "") then x = 0
     1831                    if (y == "") then y = 0
     1832                    if (z == "") then z = 0
     1833                    G.CompilerVersion = x * 10000 + y * 100 + z
     1834                end
     1835            end
     1836        end
     1837    end
    17911838
    17921839    return
  • trunk/mkspecs/os2-g++/qmake.conf

    r415 r417  
    3232QMAKE_CFLAGS_DEBUG      = -g
    3333QMAKE_CFLAGS_YACC       = -Wno-unused -Wno-parentheses
     34
     35QMAKE_CFLAGS_PRECOMPILE     = -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
     36QMAKE_CFLAGS_USE_PRECOMPILE = -include ${QMAKE_PCH_OUTPUT_BASE}
    3437
    3538QMAKE_CFLAGS_INCDIR     = -I
Note: See TracChangeset for help on using the changeset viewer.