Blame | Last modification | View Log | RSS feed
/*Licensed to the Apache Software Foundation (ASF) under one or morecontributor license agreements. See the NOTICE file distributed withthis work for additional information regarding copyright ownership.The ASF licenses this file to You under the Apache License, Version 2.0(the "License"); you may not use this file except in compliance withthe License. You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.*/'@echo off'call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"call SysLoadFuncs/* Prepare the parameters for later use */parse arg argvmode = ''args = ''opts = ''cp = ''lcp = ''do i = 1 to words(argv)param = word(argv, i)selectwhen param='-lcp' then mode = 'l'when param='-cp' | param='-classpath' then mode = 'c'when abbrev('-opts', param, 4) then mode = 'o'when abbrev('-args', param, 4) then mode = 'a'otherwiseselectwhen mode = 'a' then args = space(args param, 1)when mode = 'c' then cp = space(cp param, 1)when mode = 'l' then lcp = space(lcp param, 1)when mode = 'o' then opts = space(opts param, 1)otherwisesay 'Option' param 'ignored'endendendenv="OS2ENVIRONMENT"antconf = _getenv_('antconf' 'antconf.cmd')runrc = _getenv_('runrc')interpret 'call "' || runrc || '"' '"' || antconf || '"' 'ETC'ANT_HOME = value('ANT_HOME',,env)JAVA_HOME = value('JAVA_HOME',,env)classpath = value('CLASSPATH',,env)classes = stream(JAVA_HOME || "\lib\classes.zip", "C", "QUERY EXISTS")if classes \= '' then classpath = prepend(classpath classes)classes = stream(JAVA_HOME || "\lib\tools.jar", "C", "QUERY EXISTS")if classes \= '' then classpath = prepend(classpath classes)classpath = prepend(classpath ANT_HOME || '\lib\ant-launcher.jar')'SET CLASSPATH=' || classpath/* Setting classpathes, options and arguments */envset = _getenv_('envset')if cp\='' then interpret 'call "' || envset || '"' '"; CLASSPATH"' '"' || cp || '"'if lcp\='' then interpret 'call "' || envset || '"' '"; LOCALCLASSPATH"' '"' || lcp || '"'if opts\='' then interpret 'call "' || envset || '"' '"-D ANT_OPTS"' '"' || opts || '"'if args\='' then interpret 'call "' || envset || '"' '"ANT_ARGS"' '"' || args || '"'exit 0addpath: procedureparse arg path elemif elem = '' then doif path\='' & right(path, 1)\=';' then path = path || ';'return pathendif substr(path, length(path)) = ';' then glue = ''else glue = ';'if pos(translate(elem), translate(path)) = 0 then path = path || glue || elem || ';'return pathprepend: procedureparse arg path elemif elem = '' then doif path\='' & right(path, 1)\=';' then path = path || ';'return pathendif pos(translate(elem), translate(path)) = 0 then path = elem || ';' || pathreturn path_getenv_: procedure expose envparse arg envar defaultif default = '' then default = envarvar = value(translate(envar),,env)if var = '' then var = defaultreturn var