Changeset 14
- Timestamp:
- May 22, 2009, 1:53:06 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.cmd
r11 r14 28 28 G.ScreenWidth = -1 29 29 G.ScreenHeight = -1 30 30 G.Verbose = 1 31 31 32 32 /* initialize global variables */ … … 46 46 G.EditionString = "Open Source" 47 47 G.QT_EDITION = "QT_EDITION_OPENSOURCE" 48 49 /* So far, GCC only */50 G.PLATFORM = "os2-g++"51 48 52 49 … … 101 98 /* the directory of this script is the "source tree */ 102 99 G.RelPath = G.ScriptDir 100 101 103 102 104 103 /* reset the vars file */ … … 116 115 /* QTDIR may be set and point to an old or system-wide Qt installation */ 117 116 call UnsetEnv "QTDIR" 117 118 119 118 120 119 121 /* initalize internal variables */ … … 269 271 G.QT_INSTALL_DATA = "" 270 272 G.QT_INSTALL_TRANSLATIONS = "" 271 G.QT_INSTALL_SETTINGS = ""272 273 G.QT_INSTALL_EXAMPLES = "" 273 274 G.QT_INSTALL_DEMOS = "" … … 411 412 --------------------------------------------------------------------------*/ 412 413 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 413 694 signal Nonsense 414 695 return … … 439 720 utility functions 440 721 ------------------------------------------------------------------------------*/ 722 723 724 725 726 441 727 442 728 CompareFileToVar: procedure expose (Globals) … … 474 760 return 475 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 476 780 MakeDir: procedure expose (Globals) 781 477 782 parse arg path 478 783 rc = SysMkDir(path) … … 503 808 if (noeol) then call charout, '>>> 'str 504 809 else say '>>> 'str 810 811 812 813 814 505 815 return 506 816 … … 527 837 parse value SysCurPos() with row col 528 838 col = col + delta 529 row = row + (col % G. !ScreenWidth)839 row = row + (col % G.ScreenWidth) 530 840 if (col < 0) then 531 841 row = row - 1 532 col = col // G. !ScreenWidth842 col = col // G.ScreenWidth 533 843 if (col < 0) then 534 col = col + G. !ScreenWidth844 col = col + G.ScreenWidth 535 845 call SysCurPos row, col 536 846 return … … 572 882 573 883 parse arg prompt, default, mode 574 call SaySay prompt 884 885 if (length(prompt) > 0) then 886 call SaySay prompt 575 887 say 576 888 … … 703 1015 704 1016 /** 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 choice710 * 'Y' or 1 - default is yes711 * other - default is no712 * @return713 * 1 if Yes is selected, otherwise 0714 */715 GetYesNo: procedure expose (Globals)716 parse arg prompt, default717 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 prompt721 say722 call SayPrompt '[YN] ', 1723 yn = ReadChoice('YN',, default, 'I')724 say725 say726 return (yn == 'Y')727 728 /**729 * Shows a menu of choices and returns the menu item number selected by the730 * 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 display736 * @param stem stem containing a list of choices737 * @param default default choice738 * @param mode input mode string consisting of letters as described above739 * @return740 * selected menu item number741 */742 GetChoice: procedure expose (Globals)743 parse arg prompt, stem, default, mode744 mode = translate(mode)745 allowEnter = pos('E', mode) > 0746 allowESC = pos('C', mode) > 0747 count = value(stem'.0')748 if (count == 0) then return749 call SaySay prompt750 say751 first = 1752 do forever753 extChoices = ''754 last = first + 9755 if (last > count) then last = count756 choices = substr('1234567890', 1, last - first + 1)757 prompt = choices758 if (allowEnter) then prompt = prompt'/Enter'759 if (allowESC) then do760 prompt = prompt'/Esc'761 choices = choices||'1B'x762 end763 if (first > 1) then do764 extChoices = extChoices||'49'x765 prompt = prompt'/PgUp'766 call SaySay '^^'767 end768 do i = first to last769 ii = i - first + 1770 if (ii == 10) then ii = 0771 call SaySay ii')' value(stem'.'i)772 end773 if (last < count) then do774 extChoices = extChoices||'51'x775 prompt = prompt'/PgDn'776 call SaySay 'vv'777 end778 say779 def = ''780 if (default \== '') then do781 def = default - first + 1782 if (def < 1 | def > 10) then def = ''783 else if (def == 10) then def = 0784 end785 call SayPrompt '['prompt'] ', 1786 n = ReadChoice(choices, extChoices, def, mode)787 say788 say789 if (n == '1B'x) then do790 return -1791 end792 if (n == '0E49'x) then do793 first = first - 10794 iterate795 end796 if (n == '0E51'x) then do797 first = first + 10798 iterate799 end800 if (n \== '') then do801 if (n == 0) then n = 10802 n = n + first - 1803 end804 leave805 end806 return n807 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 letters815 *816 * @param choices string of allowed one-key choices817 * @param extChoices string of allowed one-extended-key choices818 * @param default default choice (can be a key from choices)819 * @param mode input mode string consisting of letters as described above820 * @return821 * entered key (prefixed with 'E0'x if from extChoices)822 */823 ReadChoice: procedure expose (Globals)824 parse arg choices, extChoices, default, mode825 mode = translate(mode)826 ignoreCase = pos('I', mode) > 0827 allowEnter = pos('E', mode) > 0828 allowCancel = pos('C', mode) > 0829 choice = default830 call charout, choice831 if (ignoreCase) then choice = translate(choice)832 extended = 0833 do forever834 key = SysGetKey('NOECHO')835 if (key == 'E0'x) then do836 extended = 1837 iterate838 end839 if (\extended & ignoreCase) then key = translate(key)840 select841 when (allowCancel & \extended & key == '1B'x) then do842 choice = key843 leave844 end845 when (choice == '' & \extended & verify(key, choices) == 0) then do846 choice = key847 end848 when (extended & verify(key, extChoices) == 0) then do849 choice = '0E'x||key850 leave851 end852 when (\extended & key == '08'x & choice \== '') then do853 /* backspace pressed */854 call charout, key' '855 choice = ''856 end857 when (\extended & key == '0D'x & (choice \== '' | allowEnter)) then do858 leave859 end860 otherwise do861 extended = 0862 iterate863 end864 end865 call charout, key866 extended = 0867 end868 return choice869 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 allows874 * to enter a new location to search for valid paths (this operation will875 * completely overwrite all the menu entries passed to this function in the876 * 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 stem883 * stem containing entries to choose from (must be prefixed by a name from884 * Globals), stem'.!choice' must contain a default choice (or '')885 * @param prompt886 * prompt to display887 * @param searchPattern888 * pattern to search for when selecting suitable paths in the new location889 * (can include the directory prefix, but wildcards are supported in the890 * filename part only)891 * @param checkPath892 * name of the funciton to check the path. The first argument is the path893 * 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 must895 * return a validated (and probably modified) path on success or '' if the896 * path is invalid. If the second argument is 1, it's a final check897 * (path is what returned by the preliminary check call); checkPath must898 * return either 1 on success or 0 on failure. The final check is done899 * right before calling checkVer, so it can set some global variables in900 * order to pass necessary data to checkVer and to the global level for901 * further configuration.902 * @param checkVer903 * name of the funciton to check the version. The argument is a path to904 * check the version for (as returned by checkPath after the preliminary905 * check call).906 * @param errPath907 * error message to display when a path check fails (%1 will be replaced908 * with the failed path name)909 * @param mode910 * input mode string consisting of letters as described above911 * @return912 * the selected path or '' if the selection was canceled.913 * If a non-empty path is returned, stem'.!choice' will contain914 * 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, mode919 920 mode = translate(mode)921 if (pos('C', mode) > 0) then mode = 'C'922 else mode = ''923 924 if (symbol('Static.!MenuSelectPath.!Recent') \= 'VAR') then925 Static.!MenuSelectPath.!Recent = ''926 927 do forever928 929 n = value(stem'.0') + 1930 call SysStemInsert stem, n, '[type a location...]'931 if (n == 1) then default = 1932 else default = value(stem'.!choice')933 934 choice = GetChoice(prompt, stem, default, mode)935 call SysStemDelete stem, n936 937 if (choice == -1) then return '' /* canceled */938 939 if (choice == n) then do940 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 = path946 call SaySay 'Please wait...'947 say948 patternPath = translate(filespec('D', searchPattern) || filespec('P', searchPattern))949 patternName = filespec('N', searchPattern)950 call SysFileTree FixDirNoSlash(path)'\'patternName, 'found', 'FSO'951 found2.0 = 0952 if (found.0 > 0) then do953 do i = 1 to found.0954 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) then957 iterate958 dir = left(dir, length(dir) - length(patternPath))959 /* check path validity */960 interpret 'dir = 'checkPath'("'dir'")'961 if (dir \== '') then962 call SysStemInsert 'found2', 1, FixDir(dir)963 end964 end965 if (found2.0 > 0) then do966 call SysStemCopy 'found2', stem967 /* SysStemCopy is bogus and doesn't copy the count field... */968 call value stem'.0', found2.0969 call value stem'.!choice', ''970 call value stem'.!changed', 1971 iterate972 end973 end974 else do975 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 do979 if (value(stem'.!choice') \== choice) then980 call value stem'.!changed', 1981 interpret 'ok = 'checkVer'("'path'")'982 if (ok) then do983 call value stem'.!choice', choice984 return path985 end986 call value stem'.!choice', ''987 iterate988 end989 end990 991 call SayErr Replace(errPath, '%1', path)992 say993 call value stem'.!choice', ''994 995 end996 997 /**998 1017 * Encloses the given path with quotes if it contains 999 1018 * space characters, otherwise returns it w/o changes. … … 1349 1368 parse arg code 1350 1369 /* protect against recursive calls */ 1351 if (value('G. !Done_done') == 1) then exit code1352 call value 'G. !Done_done', 11370 if (value('G.Done_done') == 1) then exit code 1371 call value 'G.Done_done', 1 1353 1372 /* cleanup stuff goes there */ 1354 1373 /* ... */
Note:
See TracChangeset
for help on using the changeset viewer.