Changeset 14


Ignore:
Timestamp:
May 22, 2009, 1:53:06 AM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

configure.cmd: Generate qconfig.cpp; generate Makefile and qconfig.h for qmake.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.cmd

    r11 r14  
    2828G.ScreenWidth   = -1
    2929G.ScreenHeight  = -1
    30 
     30G.Verbose       = 1
    3131
    3232/* initialize global variables */
     
    4646G.EditionString = "Open Source"
    4747G.QT_EDITION    = "QT_EDITION_OPENSOURCE"
    48 
    49 /* So far, GCC only */
    50 G.PLATFORM      = "os2-g++"
    5148
    5249
     
    10198    /* the directory of this script is the "source tree */
    10299    G.RelPath = G.ScriptDir
     100
     101
    103102
    104103    /* reset the vars file */
     
    116115    /* QTDIR may be set and point to an old or system-wide Qt installation */
    117116    call UnsetEnv "QTDIR"
     117
     118
     119
    118120
    119121    /* initalize internal variables */
     
    269271    G.QT_INSTALL_DATA = ""
    270272    G.QT_INSTALL_TRANSLATIONS = ""
    271     G.QT_INSTALL_SETTINGS = ""
    272273    G.QT_INSTALL_EXAMPLES = ""
    273274    G.QT_INSTALL_DEMOS = ""
     
    411412    --------------------------------------------------------------------------*/
    412413
     414
     415
     416
     417
     418
     419
     420
     421
     422
     423
     424
     425
     426
     427
     428
     429
     430
     431
     432
     433
     434
     435
     436
     437
     438
     439
     440
     441
     442
     443
     444
     445
     446
     447
     448
     449
     450
     451
     452
     453
     454
     455
     456
     457
     458
     459
     460
     461
     462
     463
     464
     465
     466
     467
     468
     469
     470
     471
     472
     473
     474
     475
     476
     477
     478
     479
     480
     481
     482
     483
     484
     485
     486
     487
     488
     489
     490
     491
     492
     493
     494
     495
     496
     497
     498
     499
     500
     501
     502
     503
     504
     505
     506
     507
     508
     509
     510
     511
     512
     513
     514
     515
     516
     517
     518
     519
     520
     521
     522
     523
     524
     525
     526
     527
     528
     529
     530
     531
     532
     533
     534
     535
     536
     537
     538
     539
     540
     541
     542
     543
     544
     545
     546
     547
     548
     549
     550
     551
     552
     553
     554
     555
     556
     557
     558
     559
     560
     561
     562
     563
     564
     565
     566
     567
     568
     569
     570
     571
     572
     573
     574
     575
     576
     577
     578
     579
     580
     581
     582
     583
     584
     585
     586
     587
     588
     589
     590
     591
     592
     593
     594
     595
     596
     597
     598
     599
     600
     601
     602
     603
     604
     605
     606
     607
     608
     609
     610
     611
     612
     613
     614
     615
     616
     617
     618
     619
     620
     621
     622
     623
     624
     625
     626
     627
     628
     629
     630
     631
     632
     633
     634
     635
     636
     637
     638
     639
     640
     641
     642
     643
     644
     645
     646
     647
     648
     649
     650
     651
     652
     653
     654
     655
     656
     657
     658
     659
     660
     661
     662
     663
     664
     665
     666
     667
     668
     669
     670
     671
     672
     673
     674
     675
     676
     677
     678
     679
     680
     681
     682
     683
     684
     685
     686
     687
     688
     689
     690
     691
     692
     693
    413694    signal Nonsense
    414695    return
     
    439720 utility functions
    440721------------------------------------------------------------------------------*/
     722
     723
     724
     725
     726
    441727
    442728CompareFileToVar: procedure expose (Globals)
     
    474760    return
    475761
     762
     763
     764
     765
     766
     767
     768
     769
     770
     771
     772
     773
     774
     775
     776
     777
     778
     779
    476780MakeDir: procedure expose (Globals)
     781
    477782    parse arg path
    478783    rc = SysMkDir(path)
     
    503808    if (noeol) then call charout, '>>> 'str
    504809    else say '>>> 'str
     810
     811
     812
     813
     814
    505815    return
    506816
     
    527837    parse value SysCurPos() with row col
    528838    col = col + delta
    529     row = row + (col % G.!ScreenWidth)
     839    row = row + (col % G.ScreenWidth)
    530840    if (col < 0) then
    531841        row = row - 1
    532     col = col // G.!ScreenWidth
     842    col = col // G.ScreenWidth
    533843    if (col < 0) then
    534         col = col + G.!ScreenWidth
     844        col = col + G.ScreenWidth
    535845    call SysCurPos row, col
    536846    return
     
    572882
    573883    parse arg prompt, default, mode
    574     call SaySay prompt
     884
     885    if (length(prompt) > 0) then
     886        call SaySay prompt
    575887    say
    576888
     
    7031015
    7041016/**
    705  *  Shows a Yes/No choice.
    706  *
    707  *  @param  prompt  prompt to show (specify '' to suppress the prompt)
    708  *  @param  default default choice:
    709  *      ''          - no default choice
    710  *      'Y' or 1    - default is yes
    711  *      other       - default is no
    712  *  @return
    713  *      1 if Yes is selected, otherwise 0
    714  */
    715 GetYesNo: procedure expose (Globals)
    716     parse arg prompt, default
    717     default = translate(default)
    718     if (default == 1) then default = 'Y'
    719     else if (default \== '' & default \== 'Y') then default = 'N'
    720     if (prompt \= '') then call SaySay prompt
    721     say
    722     call SayPrompt '[YN] ', 1
    723     yn = ReadChoice('YN',, default, 'I')
    724     say
    725     say
    726     return (yn == 'Y')
    727 
    728 /**
    729  *  Shows a menu of choices and returns the menu item number selected by the
    730  *  user. Letters in the mode argument have the following meanings:
    731  *
    732  *      E -- allow to press Enter w/o a choice (will return '')
    733  *      C -- ESC can be pressed to cancel selection (will return -1)
    734  *
    735  *  @param  prompt  prompt to display
    736  *  @param  stem    stem containing a list of choices
    737  *  @param  default default choice
    738  *  @param  mode    input mode string consisting of letters as described above
    739  *  @return
    740  *      selected menu item number
    741  */
    742 GetChoice: procedure expose (Globals)
    743     parse arg prompt, stem, default, mode
    744     mode = translate(mode)
    745     allowEnter = pos('E', mode) > 0
    746     allowESC = pos('C', mode) > 0
    747     count = value(stem'.0')
    748     if (count == 0) then return
    749     call SaySay prompt
    750     say
    751     first = 1
    752     do forever
    753         extChoices = ''
    754         last = first + 9
    755         if (last > count) then last = count
    756         choices = substr('1234567890', 1, last - first + 1)
    757         prompt = choices
    758         if (allowEnter) then prompt = prompt'/Enter'
    759         if (allowESC) then do
    760             prompt = prompt'/Esc'
    761             choices = choices||'1B'x
    762         end
    763         if (first > 1) then do
    764             extChoices = extChoices||'49'x
    765             prompt = prompt'/PgUp'
    766             call SaySay '^^'
    767         end
    768         do i = first to last
    769             ii = i - first + 1
    770             if (ii == 10) then ii = 0
    771             call SaySay ii')' value(stem'.'i)
    772         end
    773         if (last < count) then do
    774             extChoices = extChoices||'51'x
    775             prompt = prompt'/PgDn'
    776             call SaySay 'vv'
    777         end
    778         say
    779         def = ''
    780         if (default \== '') then do
    781             def = default - first + 1
    782             if (def < 1 | def > 10) then def = ''
    783             else if (def == 10) then def = 0
    784         end
    785         call SayPrompt '['prompt'] ', 1
    786         n = ReadChoice(choices, extChoices, def, mode)
    787         say
    788         say
    789         if (n == '1B'x) then do
    790             return -1
    791         end
    792         if (n == '0E49'x) then do
    793             first = first - 10
    794             iterate
    795         end
    796         if (n == '0E51'x) then do
    797             first = first + 10
    798             iterate
    799         end
    800         if (n \== '') then do
    801             if (n == 0) then n = 10
    802             n = n + first - 1
    803         end
    804         leave
    805     end
    806     return n
    807 
    808 /**
    809  *  Reads a one-key choice from the keyboard.
    810  *  user. Letters in the mode argument have the following meanings:
    811  *
    812  *      E -- allow to press Enter w/o a choice (will return '')
    813  *      C -- ESC can be pressed to cancel selection (will return '1B'x)
    814  *      I -- ignore case of pressed letters
    815  *
    816  *  @param  choices     string of allowed one-key choices
    817  *  @param  extChoices  string of allowed one-extended-key choices
    818  *  @param  default     default choice (can be a key from choices)
    819  *  @param  mode        input mode string consisting of letters as described above
    820  *  @return
    821  *      entered key (prefixed with 'E0'x if from extChoices)
    822  */
    823 ReadChoice: procedure expose (Globals)
    824     parse arg choices, extChoices, default, mode
    825     mode = translate(mode)
    826     ignoreCase = pos('I', mode) > 0
    827     allowEnter = pos('E', mode) > 0
    828     allowCancel = pos('C', mode) > 0
    829     choice = default
    830     call charout, choice
    831     if (ignoreCase) then choice = translate(choice)
    832     extended = 0
    833     do forever
    834         key = SysGetKey('NOECHO')
    835         if (key == 'E0'x) then do
    836             extended = 1
    837             iterate
    838         end
    839         if (\extended & ignoreCase) then key = translate(key)
    840         select
    841             when (allowCancel & \extended & key == '1B'x) then do
    842                 choice = key
    843                 leave
    844             end
    845             when (choice == '' & \extended & verify(key, choices) == 0) then do
    846                 choice = key
    847             end
    848             when (extended & verify(key, extChoices) == 0) then do
    849                 choice = '0E'x||key
    850                 leave
    851             end
    852             when (\extended & key == '08'x & choice \== '') then do
    853                 /* backspace pressed */
    854                 call charout, key' '
    855                 choice = ''
    856             end
    857             when (\extended & key == '0D'x & (choice \== '' | allowEnter)) then do
    858                 leave
    859             end
    860             otherwise do
    861                 extended = 0
    862                 iterate
    863             end
    864         end
    865         call charout, key
    866         extended = 0
    867     end
    868     return choice
    869 
    870 /**
    871  *  Shows a menu to select a path from the list of entries.
    872  *
    873  *  A special menu entry is automatically added as the last choice that allows
    874  *  to enter a new location to search for valid paths (this operation will
    875  *  completely overwrite all the menu entries passed to this function in the
    876  *  stem).
    877  *
    878  *  Letters in the mode argument have the following meanings:
    879  *
    880  *      C -- ESC can be pressed to cancel selection (will return '')
    881  *
    882  *  @param  stem
    883  *      stem containing entries to choose from (must be prefixed by a name from
    884  *      Globals), stem'.!choice' must contain a default choice (or '')
    885  *  @param  prompt
    886  *      prompt to display
    887  *  @param  searchPattern
    888  *      pattern to search for when selecting suitable paths in the new location
    889  *      (can include the directory prefix, but wildcards are supported in the
    890  *      filename part only)
    891  *  @param  checkPath
    892  *      name of the funciton to check the path. The first argument is the path
    893  *      to check. If the second argument is 0, it means a preliminary check (i.e.
    894  *      the path is the result of the SysFileThree procedure); checkPath must
    895  *      return a validated (and probably modified) path on success or '' if the
    896  *       path is invalid. If the second argument is 1, it's a final check
    897  *      (path is what returned by the preliminary check call); checkPath must
    898  *      return either 1 on success or 0 on failure. The final check is done
    899  *      right before calling checkVer, so it can set some global variables in
    900  *      order to pass necessary data to checkVer and to the global level for
    901  *      further configuration.
    902  *  @param  checkVer
    903  *      name of the funciton to check the version. The argument is a path to
    904  *      check the version for (as returned by checkPath after the preliminary
    905  *      check call).
    906  *  @param  errPath
    907  *      error message to display when a path check fails (%1 will be replaced
    908  *      with the failed path name)
    909  *  @param  mode
    910  *      input mode string consisting of letters as described above
    911  *  @return
    912  *      the selected path or '' if the selection was canceled.
    913  *      If a non-empty path is returned, stem'.!choice' will contain
    914  *      the selected item number, otherwise it will be empty.
    915  */
    916 MenuSelectPath: procedure expose (Globals)
    917 
    918     parse arg stem, prompt, searchPattern, checkPath, checkVer, errPath, mode
    919 
    920     mode = translate(mode)
    921     if (pos('C', mode) > 0) then mode = 'C'
    922     else mode = ''
    923 
    924     if (symbol('Static.!MenuSelectPath.!Recent') \= 'VAR') then
    925         Static.!MenuSelectPath.!Recent = ''
    926 
    927     do forever
    928 
    929         n = value(stem'.0') + 1
    930         call SysStemInsert stem, n, '[type a location...]'
    931         if (n == 1) then default = 1
    932         else default = value(stem'.!choice')
    933 
    934         choice = GetChoice(prompt, stem, default, mode)
    935         call SysStemDelete stem, n
    936 
    937         if (choice == -1) then return '' /* canceled */
    938 
    939         if (choice == n) then do
    940             call value stem'.!choice', ''
    941             path = InputDir('Enter a location where to start searching from ',
    942                             '(or Esc to cancel):',,
    943                             Static.!MenuSelectPath.!Recent)
    944             if (path == '') then iterate /* canceled */
    945             Static.!MenuSelectPath.!Recent = path
    946             call SaySay 'Please wait...'
    947             say
    948             patternPath = translate(filespec('D', searchPattern) || filespec('P', searchPattern))
    949             patternName = filespec('N', searchPattern)
    950             call SysFileTree FixDirNoSlash(path)'\'patternName, 'found', 'FSO'
    951             found2.0 = 0
    952             if (found.0 > 0) then do
    953                 do i = 1 to found.0
    954                     dir = filespec('D', found.i) || filespec('P', found.i)
    955                     /* check that the found path ends with the pattern path */
    956                     if (translate(right(dir, length(patternPath))) \== patternPath) then
    957                         iterate
    958                     dir = left(dir, length(dir) - length(patternPath))
    959                     /* check path validity  */
    960                     interpret 'dir = 'checkPath'("'dir'")'
    961                     if (dir \== '') then
    962                         call SysStemInsert 'found2', 1, FixDir(dir)
    963                 end
    964             end
    965             if (found2.0 > 0) then do
    966                 call SysStemCopy 'found2', stem
    967                 /* SysStemCopy is bogus and doesn't copy the count field... */
    968                 call value stem'.0', found2.0
    969                 call value stem'.!choice', ''
    970                 call value stem'.!changed', 1
    971                 iterate
    972             end
    973         end
    974         else do
    975             path = value(stem'.'choice)
    976             /* check path validity and tell the version check will be done next */
    977             interpret 'ok = 'checkPath'("'path'", 1)'
    978             if (ok) then do
    979                 if (value(stem'.!choice') \== choice) then
    980                     call value stem'.!changed', 1
    981                 interpret 'ok = 'checkVer'("'path'")'
    982                 if (ok) then do
    983                     call value stem'.!choice', choice
    984                     return path
    985                 end
    986                 call value stem'.!choice', ''
    987                 iterate
    988             end
    989         end
    990 
    991         call SayErr Replace(errPath, '%1', path)
    992         say
    993         call value stem'.!choice', ''
    994 
    995     end
    996 
    997 /**
    9981017 *  Encloses the given path with quotes if it contains
    9991018 *  space characters, otherwise returns it w/o changes.
     
    13491368    parse arg code
    13501369    /* protect against recursive calls */
    1351     if (value('G.!Done_done') == 1) then exit code
    1352     call value 'G.!Done_done', 1
     1370    if (value('G.Done_done') == 1) then exit code
     1371    call value 'G.Done_done', 1
    13531372    /* cleanup stuff goes there */
    13541373    /* ... */
Note: See TracChangeset for help on using the changeset viewer.