Changeset 722 for packaging


Ignore:
Timestamp:
Apr 30, 2010, 10:19:14 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

packaging: Improved QtEnv.cmd:

  • Avoid double slashes.
  • Add X:\OS2\DLL to LIBRARY_PATH.
  • Make sure MAKESHELL is CMD.EXE.
  • Run the non-.cmd executable specified on the command line directly bypassing CMD.EXE
File:
1 edited

Legend:

Unmodified
Added
Removed
  • packaging/QtEnv.cmd

    r544 r722  
    11/*
    2  * Script to set up the environment for the Qt4 development package
     2 * Script to set up the environment for the Qt4 Development package
     3 */
     4
     5/*
     6 * You do not normally need to change anything in this script
     7 *------------------------------------------------------------------------------
    38 */
    49
    510'@echo off'
    611trace off
     12
    713
    814parse arg aArgs
     
    1622    say
    1723    say 'Qt4 Environment is already set up.'
    18     say
    1924    exit 0
    2025end
     26
     27
    2128
    2229etc = value('ETC',, 'OS2ENVIRONMENT')
     
    2431if (etc == '') then etc = SysBootDrive()
    2532
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
    2643look = 0
    2744G.Prefix = ''
    2845G.Binaries = ''
    29 qt_conf = etc"\qtsys.conf"
    3046do while lines(qt_conf)
    3147    v = linein(qt_conf)
     
    4763curdir = directory()
    4864
    49 basedir = stream(qt_conf, 'C', 'QUERY EXISTS')
    50 if (basedir \== '') then
    51     basedir = filespec('D', basedir)||filespec('P',basedir)
    52 else do
    53     say 'ERROR: Cannot find "'qt_conf'". Proabaly, the Qt4 development package is not installed.'
    54     exit 1
    55 end
    56 
    5765call directory basedir
    5866if (G.Prefix \== '') then
     
    6068else
    6169    G.Prefix = basedir
     70
    6271
    6372if (G.Binaries \== '') then
     
    6574else
    6675    G.Binaries = G.Prefix'\bin'
     76
    6777
    68 say
    69 say 'Qt4 base directory is     : "'G.Prefix'"'
    70 say 'Qt4 binary directory is   : "'G.Binaries'"'
    71 say
     78call directory curdir
     79
     80/* Set up the environment */
     81
     82'set QT_BASE='G.Prefix
     83'set QT_BIN='G.Binaries
    7284
    7385'set PATH='G.Binaries';%PATH%'
    7486'set BEGINLIBPATH='G.Binaries';%BEGINLIBPATH%'
     87
     88
     89
     90
     91
     92
     93
     94
     95
    7596'set QTENV_CMD_DONE=1'
    7697
    77 say 'Qt4 Environment is set up.'
    78 say
     98if (aArgs \== '') then do
     99    /* Start the program */
     100    prg = translate(word(aArgs, 1))
     101    isCmd = 0
     102    realPrg = SysSearchPath(PATH, prg)
     103    if (realPrg == '') then realPrg = SysSearchPath(PATH, prg'.EXE')
     104    if (realPrg == '') then realPrg = SysSearchPath(PATH, prg'.COM')
     105    if (realPrg == '') then realPrg = SysSearchPath(PATH, prg'.CMD')
     106    if (realPrg \== '') then do
     107        if (right(realPrg, 4) == '.CMD') then isCmd = 1
     108    end
     109    if (isCmd) then 'call' aArgs
     110    else aArgs
     111end
     112else do
     113    /* Print some information about the environment */
     114    say
     115    say 'Qt4 base directory (QT_BASE)  : 'G.Prefix
     116    say 'Qt4 binary directory (QT_BIN) : 'G.Binaries
     117    say
     118    say 'Qt4 Environment is set up. If you use the qmake tool, it already knows'
     119    say 'where to look for Qt parts. If you use your own makefiles, you may use the'
     120    say 'environment variables shown in parenthesis above to refer to the corresponding'
     121    say 'locations.'
     122    say
     123    say 'Please note that this script does *not* set up the compiler environment!'
     124    say 'You should do it yourself in order to be able to compile Qt programs.'
     125end
    79126
    80 call directory curdir
     127exit
    81128
    82 if (aArgs \= '') then
    83     '%COMSPEC% /c' aArgs
     129FixDir: procedure
     130    parse arg aDir
     131    if (right(aDir, 1) == '\') then
     132        aDir = left(aDir, length(aDir) - 1)
     133    return aDir
    84134
    85 exit 0
     135OnError:
     136        exit
    86137
Note: See TracChangeset for help on using the changeset viewer.