5 validargs
= '-s -d -a -A -p -S -l -L -u -e -b -B -P -t'
6 vars
= '_srcdir _tmpdir _abiminor _abimajor _shlpre _shlpst _libpre _libpst _useabi _exe _shlfile _libfile _binprefix _target'
7 mandatory
= '1 1 1 1 1 1 1 1 1 1 1 1 1 1'
8 valuereq
= '1 1 1 1 0 0 0 0 1 0 1 1 0 1'
9 If ValidOpts
( Arg(1), validargs
, mandatory
, valuereq
) = 0 Then
10 exes
= 'rexx'_binprefix
||_exe
'regina'_binprefix
||_exe
'rxqueue'_binprefix
||_exe
'rxstack'_binprefix
||_exe
'regina-config'
12 When Countstr( 'qnx', _target
) \
= 0 & Countstr( 'nto', _target
) = 0 Then
14 from
= 'COPYING-LIB BUGS TODO README.QNX4 README.'_abimajor
'? regina.1 demo/*.rexx regutil/*.rexx rexxsaa.h' /**/
15 to = 'doc/regina doc/regina doc/regina doc/regina doc/regina man/man1 share/regina share/regina include'
16 pp
= '- - - - - - - - -'
19 share_dir
= _tmpdir
'/share/regina'
21 When Countstr( 'beos', _target
) \
= 0 Then
23 from
= 'COPYING-LIB BUGS TODO README.BeOS README.'_abimajor
'? demo/*.rexx regutil/*.rexx rexxsaa.h' /**/
24 to = 'doc/regina doc/regina doc/regina doc/regina doc/regina bin bin include'
25 pp
= '- - - - - - - - '
26 extn_dir
= 'add-ons/regina'
28 share_dir
= _tmpdir
'/'extn_dir
30 When Countstr( 'cygwin', _target
) \
= 0 Then
32 from
= 'COPYING-LIB BUGS TODO README.Unix README.'_abimajor
'? regina.1 demo/*.rexx regutil/*.rexx rexxsaa.h' /**/
33 to = 'doc/regina doc/regina doc/regina doc/regina doc/regina man/man1 share/regina share/regina include'
34 pp
= '- - - - - - - - - '
37 share_dir
= _tmpdir
'/share/regina'
41 from
= 'COPYING-LIB BUGS TODO README.Unix README.'_abimajor
'? regina.1 demo/*.rexx regutil/*.rexx rexxsaa.h' /**/
42 to = 'doc/regina doc/regina doc/regina doc/regina doc/regina man/man1 share/regina share/regina include'
43 pp
= '- - - - - gzip - - - '
46 share_dir
= _tmpdir
'/share/regina'
50 Do i
= 1 To Words(exes
)
52 If Stream(fn
, 'C', 'QUERY EXISTS') \
= '' Then Call copy fn
,_tmpdir
'/bin'
56 * Copy test libraries if they exist
58 fn
= _shlpre
|| 'rxtest1' || _shlpst
59 If Stream( fn
, 'C', 'QUERY EXISTS') \
= '' Then Call copy fn
,_tmpdir
'/'extn_dir
60 fn
= _shlpre
|| 'rxtest2' || _shlpst
61 If Stream( fn
, 'C', 'QUERY EXISTS') \
= '' Then Call copy fn
,_tmpdir
'/'extn_dir
64 * Copy regutil libraries if they exist
66 fn
= _shlpre
|| 'regutil' || _shlpst
67 If Stream( fn
, 'C', 'QUERY EXISTS') \
= '' Then Call copy fn
,_tmpdir
'/'extn_dir
68 fn
= _libpre
|| 'regutil' || _libpst
69 If Stream( fn
, 'C', 'QUERY EXISTS') \
= '' Then Call copy fn
,_tmpdir
'/lib'
72 * Copy message binary files
74 Call copy
'*.mtb',share_dir
79 fn
= _libpre
||_libfile
||_libpst
80 If Stream( fn
, 'C', 'QUERY EXISTS') \
= '' Then Call copy fn
,_tmpdir
'/lib'
81 fn
= _libpre
||_shlfile
||_libpst
82 If Stream( fn
, 'C', 'QUERY EXISTS') \
= '' Then Call copy fn
,_tmpdir
'/lib'
87 fn
= _shlpre
||_shlfile
||_shlpst
88 If _useabi
= 'yes' Then
90 fn_abi_major
= fn
'.'_abimajor
91 fn_abi
= fn_abi_major
'.'_abiminor
92 If Stream( fn_abi
, 'C', 'QUERY EXISTS') \
= '' Then Call copy fn_abi
,_tmpdir
'/'shldir
94 Call Directory _tmpdir
'/'shldir
95 Address System
'ln -s' fn_abi fn_abi_major
96 Address System
'ln -s' fn_abi fn
101 If Stream( fn
, 'C', 'QUERY EXISTS') \
= '' Then Call copy fn
,_tmpdir
'/'shldir
104 * Copy all files in 'from' variable to their appropriate
105 * destination in 'to'.
107 Do i
= 1 To Words(from
)
108 Call copy _srcdir
'/'Word(from
,i
),_tmpdir
'/'Word(to,i
)
109 If Word(pp
,i
) \
= '-' Then
111 Address System
Word(pp
,i
) _tmpdir
'/'Word(to,i
)'/'Word(from
,i
)
118 Address System
'cp' from
to
122 * Validate the input arguments
124 ValidOpts: Procedure Expose (vars
)
125 Parse Arg args
, validargs
, mandatory
, valuereq
126 Do i
= 1 To Words(args
)
127 optarg
= Word(args
,i
)
128 Do j
= 1 To Words(validargs
)
129 If Substr(optarg
,1,Length(Word(validargs
,j
))) = Word(validargs
,j
) Then
131 optval
= Strip(Substr(optarg
,1+Length(Word(validargs
,j
))))
132 optvar
= Word(vars
,j
)
133 Interpret optvar
"=optval"
140 Do i
= 1 To Words(vars
)
142 When Translate(Value(Word(vars
,i
))) = Translate(Word(vars
,i
)) & Word(mandatory
,i
) = 1 Then
144 Say 'Mandatory parameter' Word(validargs
,i
) 'not supplied'
147 When Word(valuereq
,i
) = 1 & Value(Word(vars
,i
)) = '' Then
149 Say 'No value supplied for parameter' Word(validargs
,i
)