2 * configure.cmd for Mew
\r
4 * Copyleft:-) 1997 OKUNISHI Fujikazu
\r
6 * This [OS/2] REXX procedure conforms
\r
7 * GNU GENERAL PUBLIC LICENSE Version 2.
\r
9 * Created: Jun 22,1997
\r
10 * Revised: Sep 16,1997
\r
11 * Keywords: Mew, OS/2, rexx, configure, install
\r
13 * special thanks to:
\r
14 * SASAKI Osamu <s-osamu@ppp.bekkoame.or.jp>
\r
15 * OHMORI Norihito <ohmori@p.chiba-u.ac.jp>
\r
20 Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
\r
22 Parse Arg Argv.1 Argv.2 Argv.3 .
\r
25 Parse Source . . thiscmd
\r
26 thiscmd = Filespec('Name',thiscmd) /* OS/2 REXX */
\r
27 DefaultPerl5 = 'perl5'
\r
28 CacheFile = '.\os2config.cache'
\r
30 /* ----------------------------------------------------------------- *
\r
32 * ----------------------------------------------------------------- */
\r
33 If Stream(CacheFile,'c','query exist') <> ''
\r
35 Say 'use sed script' CacheFile
\r
38 Say 'NOT exist' CacheFile
\r
40 /* ------------------------------------------------------------------ *
\r
41 * Argment item syntax check CASE: no cachefile
\r
42 * ------------------------------------------------------------------ */
\r
43 ConfVal.1.0='--autoconf'; ConfVal.1.1=''
\r
44 ConfVal.2.0='--perl5'; ConfVal.2.1=''
\r
45 ConfVal.3.0="--help"
\r
48 If Argv.lp = "" Then Leave
\r
55 match = Compare(ConfVal.lp2.0, Argv.lp)
\r
58 If lp2 = 3 Then Signal USAGE /*14*/
\r
62 If (match > Length(ConfVal.lp2.0)) & (Substr(Argv.lp, match,1) = '=')
\r
64 ConfVal.lp2.1=Substr(Argv.lp, match+1)
\r
69 AutoConf = Translate(ConfVal.1.1)
\r
70 If AutoConf <> 'YES' Then AUTOCONF = 'NO'
\r
71 Perl5Prog = ConfVal.2.1
\r
72 If Translate(Perl5Prog)='YES'|Perl5prog =''
\r
74 Else Signal GENERATE
\r
76 /* ----------------------------------------------------------------- *
\r
77 * get perl5 program name w/ fullpath
\r
78 * ----------------------------------------------------------------- */
\r
80 Then Perl5Prog = SysSearchPath('PATH',DefaultPerl5 || '.exe')
\r
81 Else Do /* AUTOCONF=NO */
\r
83 Say "Perl5 program name ? (default =" DefaultPerl5 ")"
\r
84 Parse Pull Perl5Path .
\r
85 If Perl5Path = "" Then
\r
87 Perl5Path = DefaultPerl5
\r
88 Cursor = SysCurPos( Word( SysCurPos( ), 1 ) -1, 0 )
\r
92 Parse Upper Var ChkExt ChkExt
\r
93 If Pos( ".EXE", ChkExt ) = 0 Then Perl5Path = Insert(Perl5Path, ".exe")
\r
95 Perl5Prog = SysSearchPath("PATH", Perl5Path)
\r
99 Say "Perl program `"Perl5Path"' Not Found."
\r
104 Say "Perl5 executable `"Perl5Prog"'. Found."
\r
105 Say "Use this program ? Yes or No ( default = Yes )"
\r
107 If (Anser = "") | (Anser = "YES" ) Then
\r
109 Cursor = SysCurPos( Word( SysCurPos( ), 1 ) -1, 0 )
\r
115 End /* AUTOCONF=YES */
\r
116 Perl5Prog = Translate(Perl5Prog,Xrange('a','z'),Xrange('A','Z'))
\r
117 Perl5Prog = Translate(Perl5Prog,'/','\')
\r
119 /* generate sed script file */
\r
121 Call Lineout STDERR,'AutoConf='autoconf', Perl5Prog='perl5prog
\r
122 SedScr = 's|@PERL@|' || Perl5Prog || '|'
\r
123 Call LineOut CacheFile, SedScr
\r
124 Call LineOut CacheFile
\r
126 /* ----------------------------------------------------------------- *
\r
127 * search `*.in' files, then create
\r
128 * ----------------------------------------------------------------- */
\r
130 Call SysFileTree '*.in', 'src', 'FO'
\r
131 If src.0 <> '0' Then
\r
133 Say 'Please Wait...'
\r
135 /* delete '.in' strings */
\r
136 target = Reverse(Delstr(Reverse(src.i),1,3))
\r
137 If Filespec('Name',src.i) <> 'configure.in' &,
\r
138 Filespec('Name',src.i) <> 'Makefile.in'
\r
141 Say 'creating' target
\r
142 '@sed -f' CacheFile src.i '>' target
\r
149 /* ----------------------------------------------------------------- *
\r
150 * Display usage message
\r
151 * ----------------------------------------------------------------- */
\r
153 Say 'Usage:' thiscmd 'CONFIGURATION [-OPTION[=VALUE] ...]'
\r
155 Say 'Set configration and installation parameters for IM.'
\r
156 Say 'CONFIGURATION specifies the operating system to build for.'
\r
158 Say ConfVal.1.0||' skip manual configuration'
\r
159 Say ConfVal.2.0||' set Perl5 executable w/ fullpath'
\r
162 Say ' ' thiscmd ConfVal.1.0
\r
163 Say ' ' thiscmd ConfVal.2.0 || '=d:/usr/local/bin/perl(.exe)'
\r
169 /* End of procedure */
\r