Changeset 91


Ignore:
Timestamp:
May 1, 2006, 10:29:20 AM (19 years ago)
Author:
dmik
Message:
  • Cycle the main menu if 'Configure Compiler' or 'Configure Qt' is selected.
  • Added the magic 'qt_official_build' name recognition when specifying the custom DLL (this will add 'qt_official_build' to .qmake.cache).
  • Improved: qmodules.h, qconfig.h and qconfig.cpp are not recreated unless really need to be changed.
  • Improved: build.log is backed up.
  • Added the 'Compile Qt Library only' choice to the compile menu
  • Improved: don't offer to clean up by defauly when compiling Qt
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.cmd

    r88 r91  
    184184    if (G.!FirstRun) then call CompileQt
    185185
    186     if (\G.!DidConfigureCompiler | \G.!DidConfigureQt | \G.!DidCompileQt) then do
     186    if (\G.!DidConfigureCompiler | \G.!DidConfigureQt | \G.!DidCompileQt) then
     187    do forever
    187188        G.!Choice.0 = 4
    188189        G.!Choice.1 = 'Configure the compiler'
     
    194195            when choice == 1 then call ConfigureCompiler
    195196            when choice == 2 then call ConfigureQt
    196             when choice == 3 then call CompileQt
    197             otherwise nop
     197            when choice == 3 then do; call CompileQt; leave; end
     198            otherwise leave
    198199        end
    199200    end
     
    509510    Opt.!DLL = -choice + 2
    510511   
     512    MagicConfig = ''
     513   
    511514    if (Opt.!DLL == 1) then do
    512515        call SaySay 'You are going to build Qt as a dynamic link library.  In order'
     
    522525        do forever
    523526            name = InputLine('Enter a base name for the Qt DLL:', name)
     527            if (name == 'qt_official_build') then do
     528                /* magic CONFIG keyword to mark the Qt build as official */
     529                MagicConfig = 'qt_official_build '
     530                name = Opt.!CustomDLLName
     531                leave
     532            end
    524533            upperName = translate(name)
    525534            if (upperName \= '' & length(upperName) <= 8 &,
     
    622631    OptionalConfig = strip(OptionalConfig)
    623632
     633    ConfigHeader =,
     634        '/* Everything */'G.!EOL||,
     635        ''G.!EOL||,
     636        '/* License information */'G.!EOL||,
     637        '#define QT_PRODUCT_LICENSEE "Free"'G.!EOL||,
     638        '#define QT_PRODUCT_LICENSE "qt-free"'G.!EOL||,
     639        ''G.!EOL||,
     640        '/* Machine byte-order */'G.!EOL||,
     641        '#define Q_BIG_ENDIAN 4321'G.!EOL||,
     642        '#define Q_LITTLE_ENDIAN 1234'G.!EOL||,
     643        '#define Q_BYTE_ORDER Q_LITTLE_ENDIAN'G.!EOL||,
     644        ''G.!EOL||,
     645        '/* Compile time features */'G.!EOL||,
     646        '#ifndef QT_NO_STL'G.!EOL||,
     647        '#define QT_NO_STL'G.!EOL||,
     648        '#endif'G.!EOL||,
     649        '#ifndef QT_NO_STYLE_WINDOWSXP'G.!EOL||,
     650        '#define QT_NO_STYLE_WINDOWSXP'G.!EOL||,
     651        '#endif'G.!EOL
     652   
     653    ConfigSource =,
     654        '#include <qglobal.h>'G.!EOL||,
     655        ''G.!EOL||,
     656        '/* Install paths from configure */'G.!EOL||,
     657        'static const char QT_INSTALL_PREFIX [267] = "qt_nstpath='CPPPath(G.!QTDir)'";'G.!EOL||,
     658        'static const char QT_INSTALL_BINS   [267] = "qt_binpath='CPPPath(G.!QTDirP)'\\bin";'G.!EOL||,
     659        'static const char QT_INSTALL_DOCS   [267] = "qt_docpath='CPPPath(G.!QTDirP)'\\doc";'G.!EOL||,
     660        'static const char QT_INSTALL_HEADERS[267] = "qt_hdrpath='CPPPath(G.!QTDirP)'\\include";'G.!EOL||,
     661        'static const char QT_INSTALL_LIBS   [267] = "qt_libpath='CPPPath(G.!QTDirP)'\\lib";'G.!EOL||,
     662        'static const char QT_INSTALL_PLUGINS[267] = "qt_plgpath='CPPPath(G.!QTDirP)'\\plugins";'G.!EOL||,
     663        'static const char QT_INSTALL_DATA   [267] = "qt_datpath='CPPPath(G.!QTDir)'";'G.!EOL||,
     664        'static const char QT_INSTALL_TRANSLATIONS [267] = "qt_trnpath='CPPPath(G.!QTDirP)'\\translations";'G.!EOL||,
     665        ''G.!EOL||,
     666        '/* strlen( "qt_xxxpath=" ) == 11 */'G.!EOL||,
     667        'const char *qInstallPath()        { return QT_INSTALL_PREFIX  + 11; }'G.!EOL||,
     668        'const char *qInstallPathDocs()    { return QT_INSTALL_DOCS    + 11; }'G.!EOL||,
     669        'const char *qInstallPathHeaders() { return QT_INSTALL_HEADERS + 11; }'G.!EOL||,
     670        'const char *qInstallPathLibs()    { return QT_INSTALL_LIBS    + 11; }'G.!EOL||,
     671        'const char *qInstallPathBins()    { return QT_INSTALL_BINS    + 11; }'G.!EOL||,
     672        'const char *qInstallPathPlugins() { return QT_INSTALL_PLUGINS + 11; }'G.!EOL||,
     673        'const char *qInstallPathData()    { return QT_INSTALL_DATA    + 11; }'G.!EOL||,
     674        'const char *qInstallPathTranslations() { return QT_INSTALL_TRANSLATIONS + 11; }'G.!EOL||,
     675        'const char *qInstallPathSysconf() { return 0; }'G.!EOL
     676       
    624677    call SaySay 'You have selected the following compiler configuration:'
    625678    say
    626679    call SaySay 'Library type   : 'DllOrStatic', 'ReleaseOrDebug', multithreaded'
    627     if (Opt.!DLL == 1) then
    628         call SaySay 'Library name   : 'Opt.!CustomDLLName
     680    if (Opt.!DLL == 1) then do
     681        if (MagicConfig == '') then
     682            call SaySay 'Library name   : 'Opt.!CustomDLLName
     683        else
     684            call SaySay 'Library name   : qtXYZNN (official build)'
     685    end
    629686    call SaySay 'Modules        : 'BasicModules OptionalModules
    630687    call SaySay 'Other features : 'OptionalConfig
     
    646703    call DeleteFile qmake_cache
    647704    call DeleteFile qtos2config
    648     call DeleteFile qmodules_h
    649     call DeleteFile qconfig_h
    650     call DeleteFile qconfig_cpp
    651705
    652706    call lineout qmake_cache, 'OBJECTS_DIR=tmp\obj\'ReleaseOrDebug'_mt_'SharedOrStatic
     
    660714    call lineout qmake_cache, 'imageformat-plugins+='
    661715    call lineout qmake_cache, 'QT_PRODUCT=qt-enterprise'
    662     call lineout qmake_cache, 'CONFIG+=nocrosscompiler' BasicModules OptionalModules 'minimal-config small-config medium-config large-config full-config 'ReleaseOrDebug' thread' OptionalConfig 'bigcodecs no-tablet incremental create_prl link_prl'
     716    call lineout qmake_cache, 'CONFIG+='MagicConfig'nocrosscompiler',
     717                              BasicModules OptionalModules,
     718                              'minimal-config small-config medium-config large-config full-config ',
     719                              ReleaseOrDebug' thread' OptionalConfig,
     720                              'bigcodecs no-tablet incremental create_prl link_prl'
    663721    call lineout qmake_cache, 'QMAKESPEC=os2-g++'
    664722    call lineout qmake_cache, 'QT_BUILD_TREE='QuotePath(G.!QTDir)
     
    684742    call lineout qtos2config
    685743
    686     call lineout qmodules_h, ModulesHeader
    687     call lineout qmodules_h
    688 
    689     call lineout qconfig_h, '/* Everything */'
    690     call lineout qconfig_h, ''
    691     call lineout qconfig_h, '/* License information */'
    692     call lineout qconfig_h, '#define QT_PRODUCT_LICENSEE "Free"'
    693     call lineout qconfig_h, '#define QT_PRODUCT_LICENSE "qt-free"'
    694     call lineout qconfig_h, ''
    695     call lineout qconfig_h, '/* Machine byte-order */'
    696     call lineout qconfig_h, '#define Q_BIG_ENDIAN 4321'
    697     call lineout qconfig_h, '#define Q_LITTLE_ENDIAN 1234'
    698     call lineout qconfig_h, '#define Q_BYTE_ORDER Q_LITTLE_ENDIAN'
    699     call lineout qconfig_h, ''
    700     call lineout qconfig_h, '/* Compile time features */'
    701     call lineout qconfig_h, '#ifndef QT_NO_STL'
    702     call lineout qconfig_h, '#define QT_NO_STL'
    703     call lineout qconfig_h, '#endif'
    704     call lineout qconfig_h, '#ifndef QT_NO_STYLE_WINDOWSXP'
    705     call lineout qconfig_h, '#define QT_NO_STYLE_WINDOWSXP'
    706     call lineout qconfig_h, '#endif'
    707     call lineout qconfig_h
    708 
    709     call lineout qconfig_cpp, '#include <qglobal.h>'
    710     call lineout qconfig_cpp, ''
    711     call lineout qconfig_cpp, '/* Install paths from configure */'
    712     call lineout qconfig_cpp, 'static const char QT_INSTALL_PREFIX [267] = "qt_nstpath='CPPPath(G.!QTDir)'";'
    713     call lineout qconfig_cpp, 'static const char QT_INSTALL_BINS   [267] = "qt_binpath='CPPPath(G.!QTDirP)'\\bin";'
    714     call lineout qconfig_cpp, 'static const char QT_INSTALL_DOCS   [267] = "qt_docpath='CPPPath(G.!QTDirP)'\\doc";'
    715     call lineout qconfig_cpp, 'static const char QT_INSTALL_HEADERS[267] = "qt_hdrpath='CPPPath(G.!QTDirP)'\\include";'
    716     call lineout qconfig_cpp, 'static const char QT_INSTALL_LIBS   [267] = "qt_libpath='CPPPath(G.!QTDirP)'\\lib";'
    717     call lineout qconfig_cpp, 'static const char QT_INSTALL_PLUGINS[267] = "qt_plgpath='CPPPath(G.!QTDirP)'\\plugins";'
    718     call lineout qconfig_cpp, 'static const char QT_INSTALL_DATA   [267] = "qt_datpath='CPPPath(G.!QTDir)'";'
    719     call lineout qconfig_cpp, 'static const char QT_INSTALL_TRANSLATIONS [267] = "qt_trnpath='CPPPath(G.!QTDirP)'\\translations";'
    720     call lineout qconfig_cpp, ''
    721     call lineout qconfig_cpp, '/* strlen( "qt_xxxpath=" ) == 11 */'
    722     call lineout qconfig_cpp, 'const char *qInstallPath()        { return QT_INSTALL_PREFIX  + 11; }'
    723     call lineout qconfig_cpp, 'const char *qInstallPathDocs()    { return QT_INSTALL_DOCS    + 11; }'
    724     call lineout qconfig_cpp, 'const char *qInstallPathHeaders() { return QT_INSTALL_HEADERS + 11; }'
    725     call lineout qconfig_cpp, 'const char *qInstallPathLibs()    { return QT_INSTALL_LIBS    + 11; }'
    726     call lineout qconfig_cpp, 'const char *qInstallPathBins()    { return QT_INSTALL_BINS    + 11; }'
    727     call lineout qconfig_cpp, 'const char *qInstallPathPlugins() { return QT_INSTALL_PLUGINS + 11; }'
    728     call lineout qconfig_cpp, 'const char *qInstallPathData()    { return QT_INSTALL_DATA    + 11; }'
    729     call lineout qconfig_cpp, 'const char *qInstallPathTranslations() { return QT_INSTALL_TRANSLATIONS + 11; }'
    730     call lineout qconfig_cpp, 'const char *qInstallPathSysconf() { return 0; }'
    731     call lineout qconfig_cpp
     744    /*
     745     *  Create new headers/sources only if they don't exist yet or if their
     746     *  current contents differs from the requested configuration to prevent
     747     *  recompiling every source when no affecting settings are changed
     748     */
     749   
     750    if (\FileExists(qmodules_h) |,
     751        CompareFileToVar(qmodules_h, ModulesHeader) \= 0) then do
     752        call DeleteFile qmodules_h
     753        call charout qmodules_h, ModulesHeader
     754        call charout qmodules_h
     755    end
     756
     757    if (\FileExists(qconfig_h) |,
     758        CompareFileToVar(qconfig_h, ConfigHeader) \= 0) then do
     759        call DeleteFile qconfig_h
     760        call charout qconfig_h, ConfigHeader
     761        call charout qconfig_h
     762    end
     763
     764    if (\FileExists(qconfig_cpp) |,
     765        CompareFileToVar(qconfig_cpp, ConfigSource) \= 0) then do
     766        call DeleteFile qconfig_cpp
     767        call charout qconfig_cpp, ConfigSource
     768        call charout qconfig_cpp
     769    end
    732770   
    733771    call CopyFile QuotePath(G.!QTDirP)'\qmake\"Makefile.os2-g++"',
     
    754792
    755793    call SaySay 'The configuration script is about to compile and build the Qt'
    756     call SaySay 'Library. All output generated by the compiler and other tools'
    757     call SaySay 'will be recorded to a ''build.log'' file located in the'
     794    call SaySay 'Library.  All output generated by the compiler and other tools'
     795    call SaySay 'will be recorded to the ''build.log'' file located in the'
    758796    call SaySay 'installation directory.'
    759797    say
     798    call SaySay 'Selecting ''Everything'' in the menu below is the right choice if'
     799    call SaySay 'this is the first time you are instaling and building the Qt Toolkit.'
     800    call SaySay 'If you want to build a different type of the Qt Library from the same'
     801    call SaySay 'installation directory (for example, the static library in addition'
     802    call SaySay 'to the DLL library built before) you may select ''Qt Library only'''
     803    call SaySay 'from the menu.'
     804    say
    760805
    761806    build_log = G.!QTDirP'\build.log'
    762807
    763     call DeleteFile build_log'.bak'
    764     call CopyFile build_log build_log'.bak'
     808    if (FileExists(build_log)) then do
     809        call DeleteFile build_log'.bak'
     810        call CopyFile build_log build_log'.bak'
     811        call DeleteFile build_log
     812    end
    765813   
    766814    build_target = ''
    767815
    768     G.!Choice.0 = 2
     816    G.!Choice.0 = 3
    769817    G.!Choice.1 = 'Everything (Qt Library, tools, examples and tutorials)'
    770818    G.!Choice.2 = 'Qt Library and tools only'
     819    G.!Choice.3 = 'Qt Library only'
    771820    choice = GetChoice('Select what to compile:', 'G.!Choice')
    772821    select
    773822        when choice == 1 then build_target = 'all'
    774823        when choice == 2 then build_target = 'sub-src sub-tools'
     824        when choice == 3 then build_target = 'sub-src'
    775825        otherwise nop
    776826    end
    777827
    778828    no_cleanup_query = (G.!FirstRun & G.!DidConfigureCompiler & G.!DidConfigureQt)
    779     do_cleanup = 1
     829    do_cleanup = 0
    780830
    781831    if (\no_cleanup_query) then do
    782832        call SaySay "Clean up the previous build?"
    783833        do_cleanup =,
    784             GetYesNo("(answer Y (yes) until you are sure what are you doing)", 'Y')
     834            GetYesNo("(answering N (no) is usually the best choice)", 'N')
    785835    end
    786836
     
    926976 ******************************************************************************/
    927977
     978CompareFileToVar: procedure expose (Globals)
     979    parse arg aFile, aVar
     980    rc = stream(aFile, 'C', 'OPEN READ')
     981    if (rc \= 'READY:') then do
     982        call SayErr 'FATAL: Could not open '''aFile'''!'
     983        call SayErr 'stream returned 'rc
     984        call Done 1
     985    end
     986    contents = charin(aFile, 1, chars(aFile))
     987    call stream aFile, 'C', 'CLOSE'
     988    if (contents < aVar) then return -1
     989    if (contents > aVar) then return 1
     990    return 0
     991 
    928992CopyFile: procedure expose (Globals)
    929     parse arg fileFrom fileTo
     993    parse arg fileFrom, fileTo
    930994    address 'cmd' 'copy' fileFrom fileTo '1>nul 2>nul'
    931995    if (rc \== 0) then do
Note: See TracChangeset for help on using the changeset viewer.