fix build with recent changes/gcc 6.3.0
[AROS-Contrib.git] / regina / makebinary.rexx
blob390a0fa8eec9cd8c656ab3c5aafaf22e36392a54
1 /*
3 */
4 Trace O
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'
11 Select
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 = '- - - - - - - - -'
17 extn_dir = 'lib'
18 shldir = 'lib'
19 share_dir = _tmpdir'/share/regina'
20 End
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'
27 shldir = 'lib'
28 share_dir = _tmpdir'/'extn_dir
29 End
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 = '- - - - - - - - - '
35 extn_dir = 'bin'
36 shldir = 'bin'
37 share_dir = _tmpdir'/share/regina'
38 End
39 Otherwise
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 - - - '
44 extn_dir = 'lib'
45 shldir = 'lib'
46 share_dir = _tmpdir'/share/regina'
47 End
48 End
50 Do i = 1 To Words(exes)
51 fn = Word(exes,i)
52 If Stream(fn, 'C', 'QUERY EXISTS') \= '' Then Call copy fn,_tmpdir'/bin'
53 End
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
77 * Copy static library
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'
85 * Copy shared library
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
93 here = Directory()
94 Call Directory _tmpdir'/'shldir
95 Address System 'ln -s' fn_abi fn_abi_major
96 Address System 'ln -s' fn_abi fn
97 Call Directory here
98 End
99 Else
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)
114 Return 0
116 Copy: Procedure
117 Parse Arg from, to
118 Address System 'cp' from to
119 Return 0
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"
134 Say optvar'='optval
135 Leave j
139 error = 0
140 Do i = 1 To Words(vars)
141 Select
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'
145 error = 1
147 When Word(valuereq,i) = 1 & Value(Word(vars,i)) = '' Then
149 Say 'No value supplied for parameter' Word(validargs,i)
150 error = 1
152 Otherwise Nop
156 Return error