Changeset 128


Ignore:
Timestamp:
Sep 17, 2006, 10:10:13 PM (19 years ago)
Author:
dmik
Message:

General: configure.cmd:

  • Various improvements to the tools configuration routines (compiler, linker, etc.); in particular, the selection process can now be canceled using Esc in many places (not currently used, see below);
  • Added code to optionally configure the usage of the Innotek Font Engine (Freetype 2) support library but it's all commented for now due to lack of the ft2lib.lib file supported by GCC.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.cmd

    r118 r128  
    6262Opt.!MNG        = 1
    6363Opt.!GIF        = 0 /* WARNING: license restrictions apply when setting to 1! */
     64
     65/* extra OS/2 specific features */
     66/* @todo (r=dmik) commented out until there is a GCC compatible FT2 support lib
     67Opt.!Extra.!FT2LIB              = ''
     68Opt.!Extra.!FT2LIB.0            = 0
     69Opt.!Extra.!FT2LIB.!choice      = ''
     70Opt.!Extra.!FT2LIB.!enabled     = ''
     71*/
    6472
    6573Opt.!QTCustomDefines  = ''
     
    288296    call WriteVar G.!ConfigCache, 'Opt.!GIF'
    289297
     298/* @todo (r=dmik) commented out until there is a GCC compatible FT2 support lib
     299    call WriteStem G.!ConfigCache, 'Opt.!Extra.!FT2LIB'
     300    call WriteVar G.!ConfigCache, 'Opt.!Extra.!FT2LIB.!choice'
     301    call WriteVar G.!ConfigCache, 'Opt.!Extra.!FT2LIB.!enabled'
     302*/   
    290303    call WriteVar G.!ConfigCache, 'Opt.!QTCustomDefines'
    291304   
     
    315328    Opt.!GNUMAKEPath.!changed = 0
    316329
     330/* @todo (r=dmik) commented out until there is a GCC compatible FT2 support lib
     331    Opt.!Extra.!FT2LIB.!changed = 0
     332*/
    317333    return
    318334
     
    335351    call SaySay 'generated by GCC into OS/2 executables.'
    336352    say
    337     call SaySay 'Also, the GNU Make utility version 3.81beta1 or newer (statically'
    338     call SaySay 'linked to intl.dll) is required.'
     353    call SaySay 'Also, the GNU Make utility version 3.81beta1 or newer is required.'
    339354    say
    340355
    341356    do until (Opt.!GCCPath \= '')
    342         call MenuSelectPath,
     357        Opt.!GCCPath = MenuSelectPath(,
    343358            'Opt.!GCCPath',,
    344359            'Select where to search for a GCC installation:',,
     
    346361            'ERROR: Could not find a valid GCC installation'||G.!EOL||,
    347362            'in ''%1''!'||G.!EOL||,
    348             'Please read the documentation.'
     363            'Please read the documentation.')
    349364    end
    350365    call WriteConfigCache
    351366
    352367    do until (Opt.!ILINKPath \= '')
    353         call MenuSelectPath,
     368        Opt.!ILINKPath = MenuSelectPath(,
    354369            'Opt.!ILINKPath',,
    355370            'Select where to search for an ILINK installation:',,
     
    357372            'ERROR: Could not find a valid ILINK installation'||G.!EOL||,
    358373            'in ''%1''!'||G.!EOL||,
    359             'Please read the documentation.'
     374            'Please read the documentation.')
    360375    end
    361376    call WriteConfigCache
    362377
    363378    do until (Opt.!GNUMakePath \= '')
    364         call MenuSelectPath,
     379        Opt.!GNUMakePath = MenuSelectPath(,
    365380            'Opt.!GNUMakePath',,
    366381            'Select where to search for the GNU Make utility:',,
     
    368383            'ERROR: Could not find a GNU Make utility'||G.!EOL||,
    369384            'in ''%1''!'||G.!EOL||,
    370             'Please read the documentation.'
     385            'Please read the documentation.')
    371386    end
    372387    call WriteConfigCache
     
    463478     */
    464479    call ConfigureCompiler_GenAddPathEnv 'PATH',,
    465         Opt.!GCCPath.!addPath';'Opt.!ILINKPath.!addPath';'Opt.!GNUMAKEPath.!addPath
     480        Opt.!GCCPath.!path';'Opt.!ILINKPath.!path';'Opt.!GNUMAKEPath.!path
    466481    call ConfigureCompiler_GenAddPathEnv 'BEGINLIBPATH',,
    467         Opt.!GCCPath.!addLibPath';'Opt.!ILINKPath.!addLibPath';'Opt.!GNUMAKEPath.!addLibPath
     482        Opt.!GCCPath.!libpath';'Opt.!ILINKPath.!libpath';'Opt.!GNUMAKEPath.!libpath
    468483    call lineout G.!QtCmd, ''
    469484    call lineout G.!QtCmd, '/*'
     
    536551    say
    537552
     553    /* Qt library type */
     554   
    538555    G.!Choices.0 = 2
    539556    G.!Choices.1 = 'Dynamic link library (DLL)'
     
    575592    end
    576593
     594    /* Qt library debug level */
     595   
    577596    G.!Choices.0 = 2
    578597    G.!Choices.1 = 'Release (no debug information)'
     
    581600    Opt.!RELEASE = -choice + 2
    582601
     602    /* Optional Qt modules */
     603   
    583604    G.!Choices.0 = 4
    584605    do forever
     
    589610        call SaySay 'Enable or disable optional Qt library modules'
    590611        choice = GetChoice('(pressing Enter will accept the current selection):',,
    591                            'G.!Choices',, 1)
     612                           'G.!Choices',, 'E')
    592613        select
    593614            when choice == 1 then Opt.!NETWORK = \Opt.!NETWORK
     
    599620    end
    600621
     622    /* InnoTek Font Engine Support */
     623
     624/* @todo (r=dmik) commented out until there is a GCC compatible FT2 support lib
     625    do forever
     626        call SaySay "Enable InnoTek Font Engine support in Qt?"
     627        Opt.!Extra.!FT2LIB.!enabled =,
     628            GetYesNo("(answering Y (yes) is recommended)",,
     629                     Opt.!Extra.!FT2LIB.!enabled)
     630        if (Opt.!Extra.!FT2LIB.!enabled) then do
     631            path = MenuSelectPath(,
     632                'Opt.!Extra.!FT2LIB',,
     633                'Select where to search for the Innotek Font Engine support library:',,
     634                'ft2lib.h', 'CheckFT2LIBPath', 'CheckFT2LIBVersion',,
     635                'ERROR: Could not find the Innotek Font Engine support library'||G.!EOL||,
     636                'in ''%1''!'||G.!EOL||,
     637                'Please read the documentation.',,
     638                'C')
     639            if (path \== '') then do
     640                Opt.!Extra.!FT2LIB = path
     641                leave
     642            end
     643            Opt.!Extra.!FT2LIB.!enabled = 0
     644        end
     645        else leave
     646    end
     647
     648    call WriteConfigCache
     649*/   
     650    /* Custom Qt defines */
     651                 
    601652    if (OfficialBuildConfig == '') then do
    602653        call SaySay 'Enter a list of custom Qt defines separated by spaces'
     
    609660    call WriteConfigCache
    610661
     662    /* Generate setup files for Qt */
     663   
    611664    BasicModules = 'kernel tools widgets dialogs styles'
    612665    BasicModulesHeader =,
     
    673726    OptionalConfig = strip(OptionalConfig)
    674727
     728    ExtraConfig = ''
     729/* @todo (r=dmik) commented out until there is a GCC compatible FT2 support lib
     730    if (Opt.!Extra.!FT2LIB.!enabled) then do
     731        ExtraConfig = ExtraConfig 'pm_ft2lib'
     732    end
     733*/
     734    ExtraConfig = strip(ExtraConfig)
     735   
    675736    ConfigHeader =,
    676737        '/* Everything */'G.!EOL||,
     
    731792        call SaySay 'Custom defines : 'Opt.!QTCustomDefines
    732793    say
    733 
     794/* @todo (r=dmik) commented out until there is a GCC compatible FT2 support lib
     795    call SaySay 'Innotek Font Engine support  : 'GetYesNoText(Opt.!Extra.!FT2LIB.!enabled)
     796    say
     797*/
    734798    call WaitForAnyKey
    735799
     
    762826                              'minimal-config small-config medium-config large-config full-config ',
    763827                              ReleaseOrDebug' thread' OptionalConfig,
    764                               'bigcodecs no-tablet incremental create_prl link_prl'
     828                              'bigcodecs no-tablet incremental create_prl link_prl',
     829                              ExtraConfig
    765830    call lineout qmake_cache, 'QMAKESPEC=os2-g++'
    766831    call lineout qmake_cache, 'QT_BUILD_TREE='QuotePath(G.!QTDir)
     
    775840    call lineout qmake_cache, 'data.path='QuotePath(G.!QTDirP)
    776841    call lineout qmake_cache, 'translations.path='QuotePath(G.!QTDirP'\translations')
     842    call lineout qmake_cache, ''
     843/* @todo (r=dmik) commented out until there is a GCC compatible FT2 support lib
     844    if (Opt.!Extra.!FT2LIB.!enabled) then do
     845        call lineout qmake_cache, 'pm_ft2lib.include='Opt.!Extra.!FT2LIB.!include
     846        call lineout qmake_cache, 'pm_ft2lib.lib='Opt.!Extra.!FT2LIB.!lib
     847    end
     848*/
    777849    call lineout qmake_cache
    778850
     
    919991 */
    920992CheckGCCPath: procedure expose (Globals)
    921     parse arg path, beforeCheckVer
    922     beforeCheckVer = (beforeCheckVer == 1)
     993    parse arg path, finalCheck
     994    finalCheck = (finalCheck == 1)
    923995    path = FixDirNoSlash(path)
    924996    if (FileExists(path'\bin\gccenv.cmd') & FileExists(path'\bin\gcc.exe')) then do
    925         if (beforeCheckVer) then do
    926             Opt.!GCCPath.!addPath = ''
    927             Opt.!GCCPath.!addLibPath = ''
    928         end
    929     end
    930     else return 0
    931     return 1
     997        if (finalCheck) then do
     998            Opt.!GCCPath.!path = ''
     999            Opt.!GCCPath.!libpath = ''
     1000            return 1
     1001        end
     1002        return path
     1003    end
     1004    /* not valid */
     1005    if (finalCheck) then return 0
     1006    return ''
    9321007
    9331008/**
     
    9451020 */
    9461021CheckILINKPath: procedure expose (Globals)
    947     parse arg path, beforeCheckVer
    948     beforeCheckVer = (beforeCheckVer == 1)
     1022    parse arg path, finalCheck
     1023    finalCheck = (finalCheck == 1)
    9491024    path = FixDirNoSlash(path)
    950     if (translate(right(path, 4)) == '\BIN' &,
    951         FileExists(path'\ilink.exe') & FileExists(path'\..\dll\cppom30.dll')) then do
    952         if (beforeCheckVer) then do
    953             Opt.!ILINKPath.!addPath = path
    954             Opt.!ILINKPath.!addLibPath = left(path, length(path) - 4)'\dll'
    955         end
    956     end
    957     else if (FileExists(path'\ilink.exe') & FileExists(path'\cppom30.dll')) then do
    958         if (beforeCheckVer) then do
    959             Opt.!ILINKPath.!addPath = path
    960             Opt.!ILINKPath.!addLibPath = path
    961         end
    962     end
    963     else return 0
    964     return 1
     1025    base = path
     1026    if (\finalCheck) then do
     1027        if (translate(right(path, 4)) == '\BIN') then
     1028            base = left(path, length(path) - 4)
     1029    end
     1030    if (FileExists(base'\bin\ilink.exe') & FileExists(base'\dll\cppom30.dll')) then do
     1031        /* the \bin and \dll case (as in the VAC3 installation) */
     1032        if (finalCheck) then do
     1033            Opt.!ILINKPath.!path = base'\bin'
     1034            Opt.!ILINKPath.!libpath = base'\dll'
     1035            return 1
     1036        end
     1037        return base
     1038    end
     1039    else if (FileExists(base'\ilink.exe') & FileExists(base'\cppom30.dll')) then do
     1040        /* ilink.exe and DLLs are in the same dir */
     1041        if (finalCheck) then do
     1042            Opt.!ILINKPath.!path = base
     1043            Opt.!ILINKPath.!libpath = base
     1044            return 1
     1045        end
     1046        return base
     1047    end
     1048    /* not valid */
     1049    if (finalCheck) then return 0
     1050    return ''
    9651051
    9661052/**
     
    9691055    parse arg path
    9701056    path = FixDirNoSlash(path)
    971     call AddPathEnv 'PATH', Opt.!ILINKPath.!addPath, '''P'''
    972     call AddPathEnv 'BEGINLIBPATH', Opt.!ILINKPath.!addLibPath, '''P'''
     1057    call AddPathEnv 'PATH', Opt.!ILINKPath.!path, '''P'''
     1058    call AddPathEnv 'BEGINLIBPATH', Opt.!ILINKPath.!libpath, '''P'''
    9731059    address 'cmd' 'ilink.exe | more'
    9741060    say
     
    9791065 */
    9801066CheckGNUMakePath: procedure expose (Globals)
    981     parse arg path, beforeCheckVer
    982     beforeCheckVer = (beforeCheckVer == 1)
     1067    parse arg path, finalCheck
     1068    finalCheck = (finalCheck == 1)
    9831069    path = FixDirNoSlash(path)
    9841070    if (FileExists(path'\make.exe')) then do
     1071        /* make.exe and DLLs are in the same dir */
    9851072        if (FileExists(path'\intl.dll')) then do
    986             if (beforeCheckVer) then do
    987                 Opt.!GNUMakePath.!addPath = path
    988                 Opt.!GNUMakePath.!addLibPath = path
     1073            /* have intl.dll */
     1074            if (finalCheck) then do
     1075                Opt.!GNUMakePath.!path = path
     1076                Opt.!GNUMakePath.!libpath = path
     1077                return 1
    9891078            end
    9901079        end
    9911080        else do
    992             if (beforeCheckVer) then do
    993                 Opt.!GNUMakePath.!addPath = path
    994                 Opt.!GNUMakePath.!addLibPath = ''
    995             end
    996         end
    997     end
    998     else return 0
    999     return 1
     1081            /* no intl.dll */
     1082            if (finalCheck) then do
     1083                Opt.!GNUMakePath.!path = path
     1084                Opt.!GNUMakePath.!libpath = ''
     1085                return 1
     1086            end
     1087        end
     1088        return path
     1089    end
     1090    /* not valid */
     1091    if (finalCheck) then return 0
     1092    return ''
    10001093
    10011094/**
     
    10041097    parse arg path
    10051098    path = FixDirNoSlash(path)
    1006     call AddPathEnv 'PATH', Opt.!GNUMakePath.!addPath, '''P'''
    1007     call AddPathEnv 'BEGINLIBPATH', Opt.!GNUMakePath.!addLibPath, '''P'''
     1099    call AddPathEnv 'PATH', Opt.!GNUMakePath.!path, '''P'''
     1100    call AddPathEnv 'BEGINLIBPATH', Opt.!GNUMakePath.!libpath, '''P'''
    10081101    address 'cmd' 'make.exe --version | more'
    10091102    say
     
    10111104    return GetYesNo("Accept the above version?", def)
    10121105
     1106/**
     1107 */
     1108CheckFT2LIBPath: procedure expose (Globals)
     1109    parse arg path, finalCheck
     1110    finalCheck = (finalCheck == 1)
     1111    path = FixDirNoSlash(path)
     1112    base = path
     1113    if (\finalCheck) then do
     1114        if (translate(right(path, 8)) == '\INCLUDE') then
     1115            base = left(path, length(path) - 8)
     1116        else if (translate(right(path, 2)) == '\H') then
     1117            base = left(path, length(path) - 2)
     1118    end
     1119    if (FileExists(base'\include\ft2lib.h') & FileExists(base'\lib\ft2lib.lib')) then do
     1120        /* the \include and \lib case */
     1121        if (finalCheck) then do
     1122            Opt.!Extra.!FT2LIB.!include = base'\include'
     1123            Opt.!Extra.!FT2LIB.!lib = base'\lib'
     1124            return 1
     1125        end
     1126        return base
     1127    end
     1128    else if (FileExists(base'\h\ft2lib.h') & FileExists(base'\lib\ft2lib.lib')) then do
     1129        /* the \h and \lib case */
     1130        if (finalCheck) then do
     1131            Opt.!Extra.!FT2LIB.!include = base'\h'
     1132            Opt.!Extra.!FT2LIB.!lib = base'\lib'
     1133            return 1
     1134        end
     1135        return base
     1136    end
     1137    else if (FileExists(base'\ft2lib.h') & FileExists(base'\ft2lib.lib')) then do
     1138        /* both are in the same dir */
     1139        if (finalCheck) then do
     1140            Opt.!Extra.!FT2LIB.!include = base
     1141            Opt.!Extra.!FT2LIB.!lib = base
     1142            return 1
     1143        end
     1144        return base
     1145    end
     1146    /* not valid */
     1147    if (finalCheck) then return 0
     1148    return ''
     1149
     1150/**
     1151 */
     1152CheckFT2LIBVersion: procedure expose (Globals)
     1153    parse arg path
     1154    path = FixDirNoSlash(path)
     1155    address 'cmd' 'dir' Opt.!Extra.!FT2LIB.!include'\ft2lib.h',
     1156                        Opt.!Extra.!FT2LIB.!lib'\ft2lib.lib'
     1157    say
     1158    if (Opt.!Extra.!FT2LIB.!changed \== 1) then def = 'Y'; else def = ''
     1159    return GetYesNo("Accept the above version?", def)
     1160   
    10131161/**
    10141162 */
     
    10171165    if (n == 1) then return '[X]'
    10181166    else return '[ ]'
     1167
     1168/**
     1169 */
     1170GetYesNoText: procedure expose (Globals)
     1171    parse arg n
     1172    if (n == 1 | n == 'Y' | n == 'y') then return 'Yes'
     1173    else return 'No'
    10191174
    10201175/* utility functions
     
    11181273   
    11191274/**
    1120  *  Displays a prompt to input a text line and
    1121  *  returns the line entered by the user.
     1275 *  Displays a prompt to input a text line and returns the line entered by the
     1276 *  user. Letters in the mode argument have the following meanings:
     1277 *
     1278 *      N -- empty lines are not allowed (e.g. '' can never be returned)
     1279 *      C -- ESC can be pressed to cancel input ('1B'x is returned)
    11221280 *
    11231281 *  @param  prompt  prompt to display
    11241282 *  @param  default initial line contents
    1125  *  @return         selected directory
     1283 *  @param  mode    input mode string consisting of letters as described above
     1284 *  @return         entered line
    11261285 */
    11271286InputLine: procedure expose (Globals)
    11281287
    1129     parse arg prompt, default
     1288    parse arg prompt, default, mode
    11301289    call SaySay prompt
    11311290    say
    11321291
     1292    mode = translate(mode)
     1293    allow_empty = pos('N', mode) == 0
     1294    allow_cancel = pos('C', mode) > 0
     1295   
    11331296    line = default
    11341297    len = length(line)
     
    11601323            when (key == '0D'x) then do
    11611324                /* Enter */
     1325                if (line == '' & \allow_empty) then iterate
    11621326                say
     1327                leave
     1328            end
     1329            when (key == '1B'x) then do
     1330                /* ESC */
     1331                line = key
    11631332                leave
    11641333            end
     
    12251394
    12261395/**
    1227  *  Shows the prompt to input a directory path and
    1228  *  returns the path entered by the user. The procedure
    1229  *  does not return until a valid existing path is entered.
     1396 *  Shows the prompt to input a directory path and returns the path entered by
     1397 *  the user. The procedure does not return until a valid existing path is
     1398 *  entered or until ESC is pressed in which case it returns ''.
    12301399 *
    12311400 *  @param  prompt  prompt to show
     
    12371406    dir = default
    12381407    do forever
    1239         dir = InputLine(prompt, dir)
     1408        dir = InputLine(prompt, dir, 'NC')
     1409        if (dir == '1B'x) then do
     1410            say
     1411            return '' /* canceled */
     1412        end
    12401413        if (DirExists(dir)) then leave
    12411414        call SayErr 'The entered directory does not exist.'
     
    12491422 *  @param  prompt  prompt to show (specify '' to suppress the prompt)
    12501423 *  @param  default default choice:
    1251  *      ''      - no default choice
    1252  *      'Y'     - default is yes
    1253  *      other   - default is no
     1424 *      ''          - no default choice
     1425 *      'Y' or 1    - default is yes
     1426 *      other       - default is no
    12541427 *  @return
    12551428 *      1 if Yes is selected, otherwise 0
     
    12581431    parse arg prompt, default
    12591432    default = translate(default)
    1260     if (default \== '' & default \== 'Y') then default = 'N'
     1433    if (default == 1) then default = 'Y'
     1434    else if (default \== '' & default \== 'Y') then default = 'N'
    12611435    if (prompt \= '') then call SaySay prompt
    12621436    say
    12631437    call SayPrompt '[YN] ', 1
    1264     yn = ReadChoice('YN',, default, 1)
     1438    yn = ReadChoice('YN',, default, 'I')
    12651439    say
    12661440    say
     
    12681442
    12691443/**
    1270  *  Shows a menu of choices and returns the
    1271  *  menu item number selected by the user.
     1444 *  Shows a menu of choices and returns the menu item number selected by the
     1445 *  user. Letters in the mode argument have the following meanings:
     1446 *
     1447 *      E -- allow to press Enter w/o a choice (will return '')
     1448 *      C -- ESC can be pressed to cancel selection (will return -1)
    12721449 *
    12731450 *  @param  prompt  prompt to display
    12741451 *  @param  stem    stem containing a list of choices
    12751452 *  @param  default default choice
    1276  *  @param  allowEnter
    1277  *      1 allows to press Enter w/o a choice (will return '')
     1453 *  @param  mode    input mode string consisting of letters as described above
    12781454 *  @return
    12791455 *      selected menu item number
    12801456 */
    12811457GetChoice: procedure expose (Globals)
    1282     parse arg prompt, stem, default, allowEnter
    1283     allowEnter = (allowEnter == 1)
     1458    parse arg prompt, stem, default, mode
     1459    mode = translate(mode)
     1460    allowEnter = pos('E', mode) > 0
     1461    allowESC = pos('C', mode) > 0
    12841462    count = value(stem'.0')
    12851463    if (count == 0) then return
     
    12941472        prompt = choices
    12951473        if (allowEnter) then prompt = prompt'/Enter'
     1474        if (allowESC) then do
     1475            prompt = prompt'/Esc'
     1476            choices = choices||'1B'x
     1477        end
    12961478        if (first > 1) then do
    12971479            extChoices = extChoices||'49'x
     
    13171499        end
    13181500        call SayPrompt '['prompt'] ', 1
    1319         n = ReadChoice(choices, extChoices, def,, allowEnter)
     1501        n = ReadChoice(choices, extChoices, def, mode)
    13201502        say
    13211503        say
     1504        if (n == '1B'x) then do
     1505            return -1
     1506        end
    13221507        if (n == '0E49'x) then do
    13231508            first = first - 10
     
    13381523/**
    13391524 *  Reads a one-key choice from the keyboard.
     1525 *  user. Letters in the mode argument have the following meanings:
     1526 *
     1527 *      E -- allow to press Enter w/o a choice (will return '')
     1528 *      C -- ESC can be pressed to cancel selection (will return '1B'x)
     1529 *      I -- ignore case of pressed letters
    13401530 *
    13411531 *  @param  choices     string of allowed one-key choices
    13421532 *  @param  extChoices  string of allowed one-extended-key choices
    13431533 *  @param  default     default choice (can be a key from choices)
    1344  *  @param  ignoreCase  1 ignores case of letters
    1345  *  @param  allowEnter
    1346  *      1 allows to press Enter w/o a choice (will return '')
     1534 *  @param  mode        input mode string consisting of letters as described above
    13471535 *  @return
    13481536 *      entered key (prefixed with 'E0'x if from extChoices)
    13491537 */
    13501538ReadChoice: procedure expose (Globals)
    1351     parse arg choices, extChoices, default, ignoreCase, allowEnter
    1352     ignoreCase = (ignoreCase == 1)
    1353     allowEnter = (allowEnter == 1)
     1539    parse arg choices, extChoices, default, mode
     1540    mode = translate(mode)
     1541    ignoreCase = pos('I', mode) > 0
     1542    allowEnter = pos('E', mode) > 0
     1543    allowCancel = pos('C', mode) > 0
    13541544    choice = default
    13551545    call charout, choice
     
    13641554        if (\extended & ignoreCase) then key = translate(key)
    13651555        select
     1556            when (allowCancel & \extended & key == '1B'x) then do
     1557                choice = key
     1558                leave
     1559            end
    13661560            when (choice == '' & \extended & verify(key, choices) == 0) then do
    13671561                choice = key
     
    13901584
    13911585/**
    1392  *  Shows a menu to select a path.
    1393  *  The last of menu entries allows to enter a new location to search for valid
    1394  *  paths (this operation will completely overwrite all the stem entries passed
    1395  *  to this function).
     1586 *  Shows a menu to select a path from the list of entries.
     1587 *
     1588 *  A special menu entry is automatically added as the last choice that allows
     1589 *  to enter a new location to search for valid paths (this operation will
     1590 *  completely overwrite all the menu entries passed to this function in the
     1591 *  stem).
     1592 *
     1593 *  Letters in the mode argument have the following meanings:
     1594 *
     1595 *      C -- ESC can be pressed to cancel selection (will return '')
    13961596 *
    13971597 *  @param  stem
     
    14001600 *  @param  prompt
    14011601 *      prompt to display
    1402  *  @param  default
    1403  *      default choice
    14041602 *  @param  searchPattern
    14051603 *      pattern to search for when selecting suitable paths in the new location
     
    14081606 *  @param  checkPath
    14091607 *      name of the funciton to check the path. The first argument is the path
    1410  *      to check, the second argument is 1 if this function is called just before
    1411  *      checkVer (this can be used to pass data to checkVer (using global
    1412  *      vafiables) necessary to perform a version check).
     1608 *      to check. If the second argument is 0, it means a preliminary check (i.e.
     1609 *      the path is the result of the SysFileThree procedure); checkPath must
     1610 *      return a validated (and probably modified) path on success or '' if the
     1611 *       path is invalid. If the second argument is 1, it's a final check
     1612 *      (path is what returned by the preliminary check call); checkPath must
     1613 *      return either 1 on success or 0 on failure. The final check is done
     1614 *      right before calling checkVer, so it can set some global variables in
     1615 *      order to pass necessary data to checkVer and to the global level for
     1616 *      further configuration.
    14131617 *  @param  checkVer
    14141618 *      name of the funciton to check the version. The argument is a path to
    1415  *      check the version for.
     1619 *      check the version for (as returned by checkPath after the preliminary
     1620 *      check call).
    14161621 *  @param  errPath
    14171622 *      error message to display when a path check fails (%1 will be replaced
    14181623 *      with the failed path name)
     1624 *  @param  mode
     1625 *      input mode string consisting of letters as described above
    14191626 *  @return
    1420  *      when both path and version checks succeed, stem variable itself
    1421  *      (i.e. w/o any indexes) will contain a path selected and stem'.!choice'
    1422  *      will contain the selected item number; otherwise the stem variable will
    1423  *      be empty (this also includes the case when a user typed a new location
    1424  *      and the stem was overwritten with a list of new paths found)
     1627 *      the selected path or '' if the selection was canceled.
     1628 *      If a non-empty path is returned, stem'.!choice' will contain
     1629 *      the selected item number, otherwise it will be empty.
    14251630 */
    14261631MenuSelectPath: procedure expose (Globals)
    14271632
    1428     parse arg stem, prompt, searchPattern, checkPath, checkVer, errPath
     1633    parse arg stem, prompt, searchPattern, checkPath, checkVer, errPath, mode
     1634   
     1635    mode = translate(mode)
     1636    if (pos('C', mode) > 0) then mode = 'C'
     1637    else mode = ''
    14291638
    14301639    if (symbol('Static.!MenuSelectPath.!Recent') \= 'VAR') then
    14311640        Static.!MenuSelectPath.!Recent = ''
    14321641   
    1433     call value stem, ''
    1434 
    1435     n = value(stem'.0') + 1
    1436     call SysStemInsert stem, n, '[type a location...]'
    1437     if (n == 1) then default = 1
    1438     else default = value(stem'.!choice')
    1439 
    1440     choice = GetChoice(prompt, stem, default)
    1441     call SysStemDelete stem, n
    1442 
    1443     if (choice == n) then do
    1444         path = InputDir('Enter a location where to start searching from:',,
    1445                         Static.!MenuSelectPath.!Recent)
    1446         Static.!MenuSelectPath.!Recent = path
    1447         call SaySay 'Please wait...'
     1642    do forever
     1643
     1644        n = value(stem'.0') + 1
     1645        call SysStemInsert stem, n, '[type a location...]'
     1646        if (n == 1) then default = 1
     1647        else default = value(stem'.!choice')
     1648
     1649        choice = GetChoice(prompt, stem, default, mode)
     1650        call SysStemDelete stem, n
     1651   
     1652        if (choice == -1) then return '' /* canceled */
     1653
     1654        if (choice == n) then do
     1655            call value stem'.!choice', ''
     1656            path = InputDir('Enter a location where to start searching from ',
     1657                            '(or Esc to cancel):',,
     1658                            Static.!MenuSelectPath.!Recent)
     1659            if (path == '') then iterate /* canceled */
     1660            Static.!MenuSelectPath.!Recent = path
     1661            call SaySay 'Please wait...'
     1662            say
     1663            patternPath = translate(filespec('D', searchPattern) || filespec('P', searchPattern))
     1664            patternName = filespec('N', searchPattern)
     1665            call SysFileTree FixDirNoSlash(path)'\'patternName, 'found', 'FSO'
     1666            found2.0 = 0
     1667            if (found.0 > 0) then do
     1668                do i = 1 to found.0
     1669                    dir = filespec('D', found.i) || filespec('P', found.i)
     1670                    /* check that the found path ends with the pattern path */
     1671                    if (translate(right(dir, length(patternPath))) \== patternPath) then
     1672                        iterate
     1673                    dir = left(dir, length(dir) - length(patternPath))
     1674                    /* check path validity  */
     1675                    interpret 'dir = 'checkPath'("'dir'")'
     1676                    if (dir \== '') then
     1677                        call SysStemInsert 'found2', 1, FixDir(dir)
     1678                end
     1679            end
     1680            if (found2.0 > 0) then do
     1681                call SysStemCopy 'found2', stem
     1682                /* SysStemCopy is bogus and doesn't copy the count field... */
     1683                call value stem'.0', found2.0
     1684                call value stem'.!choice', ''
     1685                call value stem'.!changed', 1
     1686                iterate
     1687            end
     1688        end
     1689        else do
     1690            path = value(stem'.'choice)
     1691            /* check path validity and tell the version check will be done next */
     1692            interpret 'ok = 'checkPath'("'path'", 1)'
     1693            if (ok) then do
     1694                if (value(stem'.!choice') \== choice) then
     1695                    call value stem'.!changed', 1
     1696                interpret 'ok = 'checkVer'("'path'")'
     1697                if (ok) then do
     1698                    call value stem'.!choice', choice
     1699                    return path
     1700                end
     1701                call value stem'.!choice', ''
     1702                iterate
     1703            end
     1704        end
     1705
     1706        call SayErr Replace(errPath, '%1', path)
    14481707        say
    1449         patternPath = translate(filespec('D', searchPattern) || filespec('P', searchPattern))
    1450         patternName = filespec('N', searchPattern)
    1451         call SysFileTree FixDirNoSlash(path)'\'patternName, 'found', 'FSO'
    1452         found2.0 = 0
    1453         if (found.0 > 0) then do
    1454             do i = 1 to found.0
    1455                 dir = filespec('D', found.i) || filespec('P', found.i)
    1456                 /* check that the found path ends with the pattern path */
    1457                 if (translate(right(dir, length(patternPath))) \== patternPath) then
    1458                     iterate
    1459                 dir = left(dir, length(dir) - length(patternPath))
    1460                 /* check path validity  */
    1461                 interpret 'ok = 'checkPath'("'dir'")'
    1462                 if (ok) then
    1463                     call SysStemInsert 'found2', 1, FixDir(dir)
    1464             end
    1465         end
    1466         if (found2.0 > 0) then do
    1467             call SysStemCopy 'found2', stem
    1468             call value stem'.!choice', ''
    1469             call value stem'.!changed', 1
    1470             return
    1471         end
    1472     end
    1473     else do
    1474         path = value(stem'.'choice)
    1475         /* check path validity and tell the version check will be done next*/
    1476         interpret 'ok = 'checkPath'("'path'", 1)'
    1477         if (ok) then do
    1478             if (value(stem'.!choice') \== choice) then
    1479                 call value stem'.!changed', 1
    1480             interpret 'ok = 'checkVer'("'path'")'
    1481             if (ok) then do
    1482                 call value stem, path
    1483                 call value stem'.!choice', choice
    1484                 return
    1485             end
    1486             return
    1487         end
    1488     end
    1489 
    1490     call SayErr Replace(errPath, '%1', path)
    1491     say
    1492 
    1493     return
     1708        call value stem'.!choice', ''
     1709
     1710    end
    14941711
    14951712/**
  • trunk/src/kernel/qt_kernel.pri

    r97 r128  
    281281}
    282282
    283 #@@TODO(dmik): headers and sources below are substracted until implemented
     283## @todo (r=dmik) commented out until there is a GCC compatible FT2 support lib
     284#        when uncommented, make sure the static build of Qt library works well
     285#        (mkspecs\os2-g++\qmake.conf also needs to be altered)
     286#os2 {
     287#       pm_ft2lib {
     288#        INCLUDEPATH += $$pm_ft2lib.include
     289#               LIBS += $$pm_ft2lib.lib\ft2lib.lib
     290#       }
     291#       else:DEFINES += QT_PM_NO_FT2LIB
     292#}
     293
     294## @todo (r=dmik): headers and sources below are substracted until implemented
    284295os2 {
    285296        HEADERS -= \
Note: See TracChangeset for help on using the changeset viewer.