Changeset 989


Ignore:
Timestamp:
Aug 16, 2011, 3:28:04 PM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

OS/2: configure.cmd: Support build type options.

This includes -release, -debug, -debug-and-release and
-developer-build. Also, usual help options are recognized
and the help message is printed when requested.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.cmd

    r988 r989  
    425425    --------------------------------------------------------------------------*/
    426426
     427    /* a no-op to keep the help message close to the parsing code;
     428     * it will be displayed via "signal ShowHelp" when needed */
     429    if (0) then do
     430    ShowHelp:
     431        call SaySay,
     432G.EOL||,
     433"Usage: " filespec('N', G.ScriptFile) "[-h] [-release] [-debug] [-debug-and-release]"G.EOL||,
     434"        [-developer-build]"G.EOL||,
     435G.EOL||G.EOL||,
     436"Configure options:"G.EOL||,
     437G.EOL||,
     438" The defaults (*) are usually acceptable. A plus (+) denotes a default value"G.EOL||,
     439" that needs to be evaluated. If the evaluation succeeds, the feature is"G.EOL||,
     440" included. Here is a short explanation of each option:"G.EOL||,
     441G.EOL||,
     442" *  -release ........... Compile and link Qt with debugging turned off."G.EOL||,
     443"    -debug ............. Compile and link Qt with debugging turned on."G.EOL||,
     444"    -debug-and-release . Compile and link two versions of Qt, with and without"G.EOL||,
     445"                         debugging turned on (default in non-shadow builds)."G.EOL||,
     446G.EOL||,
     447"    -developer-build ... Compile and link Qt with Qt developer options"G.EOL||,
     448"                         (including auto-tests exporting), implies -debug."G.EOL||,
     449""
     450        call Done 1
     451    end
     452
    427453    if (aArgs \= "") then do
    428454        call TokenizeString aArgs, 'G.Args'
     
    431457            a = G.Args.i
    432458            if (StartsWith(a, '-')) then do
    433                 a = strip(a, 'L', '-')
    434459                opt = ''
    435                 typ = 'P' /* path */
     460                typ = ''
    436461                select
    437                     when (a == "prefix") then
    438                         opt = 'G.QT_INSTALL_PREFIX'
    439                     when (a == "datadir") then
    440                         opt = 'G.QT_INSTALL_DATA'
    441                     when (a == "libdir") then
    442                         opt = 'G.QT_INSTALL_LIBS'
    443                     when (a == "headerdir") then
    444                         opt = 'G.QT_INSTALL_HEADERS'
    445                     when (a == "bindir") then
    446                         opt = 'G.QT_INSTALL_BINS'
    447                     when (a == "plugindir") then
    448                         opt = 'G.QT_INSTALL_PLUGINS'
    449                     when (a == "importdir") then
    450                         opt = 'G.QT_INSTALL_IMPORTS'
    451                     when (a == "demosdir") then
    452                         opt = 'G.QT_INSTALL_DEMOS'
    453                     when (a == "examplesdir") then
    454                         opt = 'G.QT_INSTALL_EXAMPLES'
    455                     when (a == "docdir") then
    456                         opt = 'G.QT_INSTALL_DOCS'
    457                     when (a == "translationdir") then
    458                         opt = 'G.QT_INSTALL_TRANSLATIONS'
    459                     when (a == "sysconfdir" | a == "settingsdir") then
    460                         opt = 'G.QT_INSTALL_SETTINGS'
    461                     when (a == "sysconffile") then
    462                         opt = 'G.QT_INSTALL_SYSCONFFILE'
    463                     otherwise typ = ''
     462                    when (a == "-h" | a == "-help" | a == "--help") then
     463                        opt = 'F G.OPT_HELP'
     464
     465                    when (a == "-release") then
     466                        opt = 'F~ G.CFG_DEBUG'
     467                    when (a == "-debug") then
     468                        opt = 'F G.CFG_DEBUG'
     469                    when (a == "-debug-and-release") then
     470                        opt = 'F G.CFG_DEBUG_RELEASE'
     471                    when (a == "-developer-build") then
     472                        opt = 'F G.CFG_DEV'
     473
     474                    when (a == "-prefix") then
     475                        opt = 'P G.QT_INSTALL_PREFIX'
     476                    when (a == "-bindir") then
     477                        opt = 'P G.QT_INSTALL_BINS'
     478                    when (a == "-libdir") then
     479                        opt = 'P G.QT_INSTALL_LIBS'
     480                    when (a == "-docdir") then
     481                        opt = 'P G.QT_INSTALL_DOCS'
     482                    when (a == "-headerdir") then
     483                        opt = 'P G.QT_INSTALL_HEADERS'
     484                    when (a == "-plugindir") then
     485                        opt = 'P G.QT_INSTALL_PLUGINS'
     486                    when (a == "-importdir") then
     487                        opt = 'P G.QT_INSTALL_IMPORTS'
     488                    when (a == "-datadir") then
     489                        opt = 'P G.QT_INSTALL_DATA'
     490                    when (a == "-translationdir") then
     491                        opt = 'P G.QT_INSTALL_TRANSLATIONS'
     492                    when (a == "-sysconfdir" | a == "settingsdir") then
     493                        opt = 'P G.QT_INSTALL_SETTINGS'
     494                    when (a == "-examplesdir") then
     495                        opt = 'P G.QT_INSTALL_EXAMPLES'
     496                    when (a == "-demosdir") then
     497                        opt = 'P G.QT_INSTALL_DEMOS'
     498                    when (a == "-sysconffile") then
     499                        opt = 'P G.QT_INSTALL_SYSCONFFILE'
     500
     501                    otherwise nop
    464502                end
    465                 if (typ == '') then do
     503                parse var opt typ opt
     504                if (opt == '' | typ == '') then do
    466505                    call SayErr "ERROR: Invalid option '"G.Args.i"'."
    467506                    call Done 1
    468507                end
     508                if (StartsWith(typ, 'F')) then do
     509                    /* option is a flag */
     510                    if (EndsWith(typ, '~')) then call value opt, 'no'
     511                    else call value opt, 'yes'
     512                end
    469513                if (typ == 'P') then do
     514                    /* argument is a path */
    470515                    if (i == G.Args.0) then do
    471                         call SayErr "ERROR: Option '"G.Args.i"' needs a path value."
     516                        call SayErr "ERROR: Option '"G.Args.i"' needs a path."
    472517                        call Done 1
    473518                    end
     
    626671            call CopyDir G.RelPath"\mkspecs\modules", G.OutPath"\mkspecs\modules"
    627672            call DeleteDir G.OutPath"\mkspecs\default"
    628 
    629 /*@todo
    630             # symlink the doc directory
    631             rm -rf "$outpath/doc"
    632             ln -s "$relpath/doc" "$outpath/doc"
    633 
    634             # make sure q3porting.xml can be found
    635             mkdir -p "$outpath/tools/porting/src"
    636             rm -f "$outpath/tools/porting/src/q3porting.xml"
    637             ln -s "$relpath/tools/porting/src/q3porting.xml" "$outpath/tools/porting/src"
    638 */
    639673        end
    640674
     
    873907    --------------------------------------------------------------------------*/
    874908
    875     /* next, emit a usage message if something failed. */
     909    /* next, emit a usage message if requested. */
    876910    if (G.OPT_HELP == "yes") then do
    877         /* @todo */
    878         call SayLog "TODO: Help message"
     911        signal ShowHelp
    879912    end
    880913
     
    25502583SayVerbose: procedure expose (Globals)
    25512584    parse arg str, noeol
    2552     if (G.Verbose) then call SayLog str, noeol
     2585    if (G.Verbose & G.OPT_HELP \== "yes") then call SayLog str, noeol
    25532586    return
    25542587
Note: See TracChangeset for help on using the changeset viewer.