Changeset 88


Ignore:
Timestamp:
Apr 17, 2006, 2:54:37 PM (19 years ago)
Author:
dmik
Message:
  • Added querying a custom name for the Qt DLL when a dynamic library build is selected.
  • Modified the qt.cmd generation code:
  • qt.cmd recognizes the debug mode when given the 'D' or 'DEBUG' keyword as the first argument on the command line. In the DEBUG mode, the debug directories of Qt binaries come before the release ones in PATH and BEGINLIBPATH.
  • qt.cmd lowers the process priority to IDLE to have a smoother system responce time during the compiler activity (that can gain 100% CPU load).
  • Backup build.log before subseqiential builds.
  • Improved InputLine: implemented the Insert editing mode (cursor movement, insertings symbols to the middle) for all strings entered by the user.
  • Improved MenuSelectPath to remember the most recent path entered (offerred as the default path on next path requests).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.cmd

    r72 r88  
    2929G.!EOL          = '0D0A'x
    3030
     31G.!ScreenWidth  = -1
     32G.!ScreenHeight = -1
     33
    3134/* path to GCC */
    3235Opt.!GCCPath            = ''
     
    4750Opt.!RELEASE    = 1
    4851Opt.!DLL        = 1
     52Opt.!CustomDLLName = 'myqt'   
    4953/* optional module configuration */
    5054Opt.!NETWORK    = 1
     
    7377
    7478/* all globals to be exposed in procedures */
    75 Globals = 'G. Opt.'
     79Globals = 'G. Opt. Static.'
    7680
    7781/* init rexx lib
     
    8589/* startup code
    8690 ******************************************************************************/
     91
     92parse value SysTextScreenSize() with G.!ScreenHeight G.!ScreenWidth
     93if (G.!ScreenHeight < 25 | G.!ScreenWidth < 80) then do
     94    address 'cmd' 'mode co80,25'
     95    parse value SysTextScreenSize() with G.!ScreenHeight G.!ScreenWidth
     96    if (G.!ScreenHeight < 25 | G.!ScreenWidth < 80) then do
     97        call SayErr 'WARNING: Cannot set screen size to 80 x 25!'
     98        call SayErr 'Some messages can be unreadable.'
     99        say
     100        call WaitForAnyKey
     101    end
     102end
    87103
    88104call MagicCmdHook arg(1)
     
    234250    call WriteVar G.!ConfigCache, 'Opt.!RELEASE'
    235251    call WriteVar G.!ConfigCache, 'Opt.!DLL'
     252    call WriteVar G.!ConfigCache, 'Opt.!CustomDLLName'
    236253
    237254    call WriteVar G.!ConfigCache, 'Opt.!NETWORK'
     
    354371    call lineout G.!QtCmd, '''@echo off'''
    355372    call lineout G.!QtCmd, ''
    356     call lineout G.!QtCmd, 'if (RxFuncQuery(''SysBootDrive'')) then'
     373    call lineout G.!QtCmd, 'if (RxFuncQuery(''SysBootDrive'')) then do'
    357374    call lineout G.!QtCmd, '    call RxFuncAdd ''SysBootDrive'', ''RexxUtil'', ''SysBootDrive'''
     375    call lineout G.!QtCmd, '    call RxFuncAdd ''SysSetPriority'', ''RexxUtil'', ''SysSetPriority'''
     376    call lineout G.!QtCmd, 'end'
     377    call lineout G.!QtCmd, ''
     378    /*
     379     *  determine whether to setup the environment for the debug version of Qt
     380     */
     381    call lineout G.!QtCmd, 'DEBUG = 0'
     382    call lineout G.!QtCmd, ''
     383    call lineout G.!QtCmd, '/* parse command line */'
     384    call lineout G.!QtCmd, 'parse arg args'
     385    call lineout G.!QtCmd, 'if (translate(word(args, 1)) == ''D'' |,'
     386    call lineout G.!QtCmd, '    translate(word(args, 1)) == ''DEBUG'') then'
     387    call lineout G.!QtCmd, 'do'
     388    call lineout G.!QtCmd, '    DEBUG = 1'
     389    call lineout G.!QtCmd, '    args = subword(args, 2)'
     390    call lineout G.!QtCmd, 'end'
    358391    call lineout G.!QtCmd, ''
    359392    /*
     
    367400    call lineout G.!QtCmd, 'call value ''QTDIR'', QTDIR, ''OS2ENVIRONMENT'''
    368401    call lineout G.!QtCmd, ''
    369     call lineout G.!QtCmd, 'call AddPathEnv ''PATH'', QTDIR''\bin'''
    370     call lineout G.!QtCmd, 'call AddPathEnv ''BEGINLIBPATH'', QTDIR''\bin'''
     402    /*
     403     *  place debug directories first in the PATH if in debug mode
     404     */
     405    call lineout G.!QtCmd, 'if (\DEBUG) then do'
     406    call lineout G.!QtCmd, '    /* releae versions come first */'
     407    call lineout G.!QtCmd, '    call AddPathEnv ''PATH'', QTDIR''\bin'''
     408    call lineout G.!QtCmd, '    call AddPathEnv ''PATH'', QTDIR''\bin\debug'''
     409    call lineout G.!QtCmd, '    call AddPathEnv ''BEGINLIBPATH'', QTDIR''\bin'''
     410    call lineout G.!QtCmd, '    call AddPathEnv ''BEGINLIBPATH'', QTDIR''\bin\debug'''
     411    call lineout G.!QtCmd, 'end'
     412    call lineout G.!QtCmd, 'else do'
     413    call lineout G.!QtCmd, '    /* debug versions come first */'
     414    call lineout G.!QtCmd, '    call AddPathEnv ''PATH'', QTDIR''\bin\debug'''
     415    call lineout G.!QtCmd, '    call AddPathEnv ''PATH'', QTDIR''\bin'''
     416    call lineout G.!QtCmd, '    call AddPathEnv ''BEGINLIBPATH'', QTDIR''\bin\debug'''
     417    call lineout G.!QtCmd, '    call AddPathEnv ''BEGINLIBPATH'', QTDIR''\bin'''
     418    call lineout G.!QtCmd, 'end'
    371419    call lineout G.!QtCmd, ''
    372420    /*
     
    393441    call lineout G.!QtCmd, 'call AddPathEnv ''LIBRARY_PATH'', SysBootDrive()''\MPTN\DLL'''
    394442    call lineout G.!QtCmd, ''
    395     call lineout G.!QtCmd, 'parse arg args'
     443    call lineout G.!QtCmd, '/*'
     444    call lineout G.!QtCmd, ' * set our our priority class to IDLE so prevent GCC from eating'
     445    call lineout G.!QtCmd, ' * 100% of CPU load on single-processor machines'
     446    call lineout G.!QtCmd, ' */'
     447    call lineout G.!QtCmd, 'call SysSetPriority 1, 0'
     448    call lineout G.!QtCmd, ''
     449    call lineout G.!QtCmd, '/* pass arguments to the command shell */'
    396450    call lineout G.!QtCmd, '''cmd /c'' args'
    397451    call lineout G.!QtCmd, 'exit rc'
     
    454508    choice = GetChoice('Select the Qt library type:', 'G.!Choices', -Opt.!DLL + 2)
    455509    Opt.!DLL = -choice + 2
     510   
     511    if (Opt.!DLL == 1) then do
     512        call SaySay 'You are going to build Qt as a dynamic link library.  In order'
     513        call SaySay 'to prevent possible DLL naming conflicts (a.k.a. DLL hell) with'
     514        call SaySay 'the official binary distribution of Qt and with other custom'
     515        call SaySay 'builds, please personalize your version of the DLL by entering'
     516        call SaySay 'a unique base name for it (without extension).  Note that it'
     517        call SaySay 'can only consist of latin letters A to Z, numbers, a dash and'
     518        call SaySay 'an underscore, and its length cannot exceed 8 characters.  Also,'
     519        call SaySay 'this name cannot start with ''qt''.'
     520        say
     521        name = Opt.!CustomDLLName
     522        do forever
     523            name = InputLine('Enter a base name for the Qt DLL:', name)
     524            upperName = translate(name)
     525            if (upperName \= '' & length(upperName) <= 8 &,
     526                verify(upperName,'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_') == 0 &,
     527                left(upperName, 2) \= 'QT') then leave
     528            call SayErr 'The entered name is not valid.'
     529            say
     530        end
     531        Opt.!CustomDLLName = name
     532    end
    456533
    457534    G.!Choices.0 = 2
     
    548625    say
    549626    call SaySay 'Library type   : 'DllOrStatic', 'ReleaseOrDebug', multithreaded'
     627    if (Opt.!DLL == 1) then
     628        call SaySay 'Library name   : 'Opt.!CustomDLLName
    550629    call SaySay 'Modules        : 'BasicModules OptionalModules
    551630    call SaySay 'Other features : 'OptionalConfig
     
    556635    call SaySay 'Please wait...'
    557636    say
    558 
    559     /* do the configure Qt job */
    560637
    561638    qmake_cache = G.!QMakeCache
     
    565642    qconfig_cpp = G.!QConfigCPP
    566643
     644    /* do the configure Qt job */
     645
    567646    call DeleteFile qmake_cache
    568647    call DeleteFile qtos2config
     
    571650    call DeleteFile qconfig_cpp
    572651
    573     call lineout qmake_cache, 'QMAKE_QT_VERSION_OVERRIDE=331'
    574652    call lineout qmake_cache, 'OBJECTS_DIR=tmp\obj\'ReleaseOrDebug'_mt_'SharedOrStatic
    575653    call lineout qmake_cache, 'MOC_DIR=tmp\moc\'ReleaseOrDebug'_mt_'SharedOrStatic
     
    597675    call lineout qmake_cache
    598676
    599     call lineout qtos2config, 'CONFIG+= 'SharedOrNot' thread 'ReleaseOrDebug
     677    if (Opt.!DLL == 1) then
     678        call lineout qtos2config, 'QMAKE_QT_DLL_TARGET = 'Opt.!CustomDLLName
     679    call lineout qtos2config, 'CONFIG += 'SharedOrNot' thread 'ReleaseOrDebug
    600680    call lineout qtos2config, 'exists( $(QTDIR)\.qtos2defines ) {'
    601681    call lineout qtos2config, '    include( $(QTDIR)\.qtos2defines )'
     
    681761    build_log = G.!QTDirP'\build.log'
    682762
     763    call DeleteFile build_log'.bak'
     764    call CopyFile build_log build_log'.bak'
     765   
    683766    build_target = ''
    684767
     
    903986    return
    904987
    905 /**
    906  *  Shows the prompt to input a text line and
     988SayNoMove: procedure expose (Globals)
     989    parse arg str
     990    parse value SysCurPos() with row col
     991    call SysCurState 'OFF'
     992    call charout, str
     993    call SysCurPos row, col
     994    call SysCurState 'ON'
     995    return
     996
     997MovePosBy: procedure expose (Globals)
     998    parse arg delta
     999    parse value SysCurPos() with row col
     1000    col = col + delta
     1001    row = row + (col % G.!ScreenWidth)
     1002    if (col < 0) then
     1003        row = row - 1
     1004    col = col // G.!ScreenWidth
     1005    if (col < 0) then
     1006        col = col + G.!ScreenWidth
     1007    call SysCurPos row, col
     1008    return
     1009   
     1010/**
     1011 *  Displays a prompt to input a text line and
    9071012 *  returns the line entered by the user.
     1013 *
     1014 *  @param  prompt  prompt to display
     1015 *  @param  default initial line contents
     1016 *  @return         selected directory
    9081017 */
    9091018InputLine: procedure expose (Globals)
    910     parse arg prompt
     1019
     1020    parse arg prompt, default
    9111021    call SaySay prompt
    9121022    say
    913     call SayPrompt '', 1
    914     line = linein()
     1023
     1024    line = default
     1025    len = length(line)
     1026    n = len
     1027
     1028    call SayPrompt line, 1
     1029    extended = 0
     1030
     1031    do forever
     1032
     1033        key = SysGetKey('NOECHO')
     1034        if (key == 'E0'x) then do
     1035            extended = 1
     1036            iterate
     1037        end
     1038       
     1039        select
     1040            when (\extended & key == '08'x) then do
     1041                /* Backspace */
     1042                if (n > 0) then do
     1043                    call MovePosBy -1
     1044                    line = delstr(line, n, 1)
     1045                    call SayNoMove substr(line, n)||' '
     1046                    len = len - 1
     1047                    n = n - 1
     1048                end
     1049                iterate
     1050            end
     1051            when (key == '0D'x) then do
     1052                /* Enter */
     1053                say
     1054                leave
     1055            end
     1056            when (extended) then do
     1057                select
     1058                    when (key == '53'x) then do
     1059                        /* Delete */
     1060                        if (n < len) then do
     1061                            line = delstr(line, n + 1, 1)
     1062                            call SayNoMove substr(line, n + 1)||' '
     1063                        end
     1064                        len = len - 1
     1065                    end
     1066                    when (key == '4B'x) then do
     1067                        /* Left arrow */
     1068                        if (n > 0) then do
     1069                            call MovePosBy -1
     1070                            n = n - 1
     1071                        end
     1072                    end
     1073                    when (key == '4D'x) then do
     1074                        /* Right arrow */
     1075                        if (n < len) then do
     1076                            call MovePosBy 1
     1077                            n = n + 1
     1078                        end
     1079                    end
     1080                    when (key == '47'x) then do
     1081                        /* Home */
     1082                        if (n > 0) then do
     1083                            call MovePosBy -n
     1084                            n = 0
     1085                        end
     1086                    end
     1087                    when (key == '4F'x) then do
     1088                        /* End */
     1089                        if (n < len) then do
     1090                            call MovePosBy len - n
     1091                            n = len
     1092                        end
     1093                    end
     1094                    otherwise nop
     1095                end
     1096                extended = 0
     1097                iterate
     1098            end
     1099            otherwise do
     1100                call charout, key
     1101                if (n == len) then do
     1102                    line = line||key
     1103                end
     1104                else do
     1105                    line = insert(key, line, n)
     1106                    call SayNoMove substr(line, n + 2)
     1107                end
     1108                len = len + 1
     1109                n = n + 1
     1110            end
     1111        end
     1112    end
     1113   
    9151114    say
    9161115    return line
     
    9221121 *
    9231122 *  @param  prompt  prompt to show
     1123 *  @param  default initial directory
    9241124 *  @return         selected directory
    9251125 */
    9261126InputDir: procedure expose (Globals)
    927     parse arg prompt
     1127    parse arg prompt, default
     1128    dir = default
    9281129    do forever
    929         dir = InputLine(prompt)
     1130        dir = InputLine(prompt, dir)
    9301131        if (DirExists(dir)) then leave
    9311132        call SayErr 'The entered directory does not exist.'
     
    9511152    call SaySay prompt
    9521153    say
    953     call SayPrompt '[YN] 'default, 1
     1154    call SayPrompt '[YN] ', 1
    9541155    yn = ReadChoice('YN',, default, 1)
    9551156    say
     
    10061207            else if (def == 10) then def = 0
    10071208        end
    1008         call SayPrompt '['prompt'] '||def, 1
     1209        call SayPrompt '['prompt'] ', 1
    10091210        n = ReadChoice(choices, extChoices, def,, allowEnter)
    10101211        say
     
    10431244    allowEnter = (allowEnter == 1)
    10441245    choice = default
     1246    call charout, choice
    10451247    if (ignoreCase) then choice = translate(choice)
    10461248    extended = 0
     
    11171319    parse arg stem, prompt, searchPattern, checkPath, checkVer, errPath
    11181320
     1321    if (symbol('Static.!MenuSelectPath.!Recent') \= 'VAR') then
     1322        Static.!MenuSelectPath.!Recent = ''
     1323   
    11191324    call value stem, ''
    11201325
     
    11281333
    11291334    if (choice == n) then do
    1130         path = InputDir('Enter a location where to start searching from:')
     1335        path = InputDir('Enter a location where to start searching from:',,
     1336                        Static.!MenuSelectPath.!Recent)
     1337        Static.!MenuSelectPath.!Recent = path
    11311338        call SaySay 'Please wait...'
    11321339        say
Note: See TracChangeset for help on using the changeset viewer.