1 /* OS/2 REXX : The lib/configure.cmd; Don't delete this comment. */
2 call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
5 EMTEXDIR=value('EMTEXDIR',,env)
6 X11ROOT=value('X11ROOT',,env)
7 latex_script='chkconfig.ltx'
8 lyxrc_defaults='lyxrc.defaults'
12 parse arg option '=' srcdir
14 when option='-h'|option='-help'|option='--help' then do
15 say 'Usage: configure [options]'
17 say ' --help show this help lines'
18 say ' --without-latex-config do not run LaTeX to determine configuration'
21 when option='--without-latex-config' then
23 when option='--srcdir' then
24 srcdir=translate(srcdir,'\','/')
29 parse source 'OS/2 COMMAND ' script
31 srcdir=filespec('drive',script)strip(filespec('path',script),'T','\')
34 rc=SysFileTree(srcdir'\'latex_script,found,'F')
35 if found.0 = 0 then do
36 say "configure: error: cannot find "srcdir'\'latex_script" script"
40 if \(curdir=srcdir) then do
41 call SysFileTree 'layouts', 'found', 'D'
42 if found.0 = 0 then do
46 call SysMkDir 'layouts'
47 call SysMkDir 'templates'
49 'cmd /c copy /v' srcdir'\layouts\*.layout layouts'
51 say 'Error! copying layout files.'
53 curdir=translate(curdir,'/','\')
54 srcdir=translate(srcdir,'/','\')
55 call SysFileTree EMTEXDIR'\bin\latex.cmd', 'found', 'F'
56 if found.0 = 0 then LATEX='latex2e'
58 if \(''=SysSearchPath('PATH','GS.EXE')) then
61 if \(''=SysSearchPath('PATH','GSOS2.EXE')) then
65 if \(''=SysSearchPath('PATH','GV.EXE')) then
68 if \(''=SysSearchPath('PATH','GHOSTVIEW.EXE')) then
72 if (''=SysSearchPath('PATH','SGML2LYX.CMD')) then
76 if (''=SysSearchPath('PATH','CHKTEX.EXE')) then
79 CHKTEX='chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38'
80 if \(''=SysSearchPath('PATH','ISPELL.EXE')) then
84 if (''=SysSearchPath('PATH','NOWEAVE.EXE')) then do
89 LITERATE='noweave -delay -index'
92 call SysFileTree 'reLyX\reLyX.cmd', 'found', 'F'
94 if (''=SysSearchPath('PATH','reLyX.cmd')) then
100 call SysFileDelete 'chklatex.ltx'
101 rc=lineout('chklatex.ltx','\nonstopmode\makeatletter')
102 rc=lineout('chklatex.ltx','\ifx\undefined\documentclass\else')
103 rc=lineout('chklatex.ltx',' \message{ThisIsLaTeX2e}')
104 rc=lineout('chklatex.ltx','\fi')
105 rc=lineout('chklatex.ltx','\@@end')
106 rc=lineout('chklatex.ltx')
107 'cmd /c 'LATEX' chklatex.ltx>nul'
108 call SysFileSearch 'NotLaTeX2e', 'chklatex.log', chklatex
109 if chklatex.0 > 0 then LATEX=''
111 rc=SysFileDelete('textclass.lst')
112 rc=SysFileDelete('packages.lst')
113 rc=SysFileDelete('chkconfig.sed')
114 if \(lyx_check_config='no') then
116 rc=SysFileTree(srcdir'\layouts\*.layout',found,'FO')
117 rc=SysFileDelete('chklayouts.tex')
118 rc=SysFileDelete('chkconfig.vars')
121 parse value filespec('name',found.num) with DocClass '.layout'
122 parse value DocClass with mainClass '_' subClass
124 rc=lineout('chklayouts.tex','\TestDocClass{'DocClass'}')
125 else /* Not used, or must be empty? */
126 rc=lineout('chklayouts.tex','\TestDocClass['mainClass'.cls]{'DocClass'}')
128 rc=lineout('chklayouts.tex')
131 if SGMLTOOLS='sgml2lyx' then
134 sgmltools_cmd='\def\hassgmltools{}'
136 rc=SysFileDelete('wrap_chkconfig.ltx')
137 rc=lineout('wrap_chkconfig.ltx','\newcommand\srcdir{'srcdir'}')
138 rc=lineout('wrap_chkconfig.ltx',sgmltools_cmd)
139 rc=lineout('wrap_chkconfig.ltx','\input{'srcdir'/chkconfig.ltx}')
140 rc=lineout('wrap_chkconfig.ltx')
141 'cmd /c 'LATEX' wrap_chkconfig.ltx'
142 size=stream('chkconfig.sed','c','query size')
143 rc=stream('chkconfig.sed','c','open')
144 if rxfuncquery(SysAddRexxMacro) then
145 rc=stream('chkconfig.sed','c','seek +'size)
147 rc=stream('chkconfig.sed','c','seek + 'size' write')
148 rc=lineout('chkconfig.sed','s/@chk_sgmltools@/'chk_sgmltools'/g')
149 rc=lineout('chkconfig.sed')
150 call SysFileSearch 'chk_fontenc=', 'chkconfig.vars', fontenc
151 if fontenc.0 > 0 then parse var fontenc.1 chk"='"rc_fontenc"'"
154 call SysFileTree 'textclass.lst', 'file', 'FO'
157 rc=lineout('textclass.lst','# This file declares layouts and their associated definition files')
158 rc=lineout('textclass.lst','# (include dir. relative to the place where this file is).')
159 rc=lineout('textclass.lst','# It contains only default values, since chkconfig.ltx could not be run')
160 rc=lineout('textclass.lst','# for some reason. Run ./configure if you need to update it after a')
161 rc=lineout('textclass.lst','# configuration change.')
162 rc=lineout('textclass.lst','article article article')
163 rc=lineout('textclass.lst','report report report')
164 rc=lineout('textclass.lst','book book book')
165 rc=lineout('textclass.lst','linuxdoc linuxdoc linuxdoc')
166 rc=lineout('textclass.lst','letter letter letter')
167 rc=lineout('textclass.lst')
168 rc=lineout('chkconfig.sed','s/@.*@/???/g')
169 rc=lineout('chkconfig.sed')
173 call SysFileTree 'chkconfig.sed', 'file', 'FO'
176 rc=lineout('chkconfig.sed','s/@.*@/???/g')
177 rc=lineout('chkconfig.sed')
180 call SysFileTree 'packages.lst', 'file', 'FO'
183 rc=lineout('packages.lst','# This file should contain the list of LaTeX packages that have been')
184 rc=lineout('packages.lst','# recognized by LyX. Unfortunately, since configure could not find')
185 rc=lineout('packages.lst','# your LaTeX2e program, the tests have not been run. Run configure')
186 rc=lineout('packages.lst','# if you need to update it after a configuration change.')
187 rc=lineout('packages.lst')
190 say 'creating doc/LaTeXConfig.lyx'
191 'sed -f chkconfig.sed 'srcdir'/doc/LaTeXConfig.lyx.in >doc\LaTeXConfig.lyx'
192 call SysFileDelete 'chkconfig.sed'
193 call SysFileDelete 'chkconfig.vars'
194 call SysFileDelete 'wrap_chkconfig.ltx'
195 call SysFileDelete 'wrap_chkconfig.log'
196 call SysFileDelete 'chklatex.ltx'
197 call SysFileDelete 'chklatex.log'
198 call SysFileDelete 'chklayouts.tex'
199 call SysFileDelete 'missfont.log'
201 say 'creating 'lyxrc_defaults
202 rc=SysFileDelete(lyxrc_defaults)
203 if rxfuncquery(SysAddRexxMacro) then
204 rc=stream(lyxrc_defaults,'c','seek =0')
205 rc=SysFileDelete(X11ROOT'\XFree86\bin\fsend2.cmd')
206 rc=lineout(lyxrc_defaults,'\latex_command "'LATEX'"')
207 rc=lineout(lyxrc_defaults,'\relyx_command "'RELYX'"')
208 rc=lineout(lyxrc_defaults,'\literate_command "'LITERATE'"')
209 rc=lineout(lyxrc_defaults,'\literate_extension "'LITERATE_EXT'"')
210 rc=lineout(lyxrc_defaults,'\ps_command "'GS'"')
211 rc=lineout(lyxrc_defaults,'\view_ps_command "'GHOSTVIEW' -swap"')
212 rc=lineout(lyxrc_defaults,'\view_pspic_command "'GHOSTVIEW'"')
213 rc=lineout(lyxrc_defaults,'\ascii_roff_command "groff -t -ms -Tlatin1"')
214 rc=lineout(lyxrc_defaults,'\chktex_command "'CHKTEX'"')
215 rc=lineout(lyxrc_defaults,'\spell_command "'SPELL'"')
216 if \(''=SysSearchPath('PATH','fsend.exe')) then
218 rc=lineout(X11ROOT'\XFree86\bin\fsend2.cmd','/*A wrapper for fsend.exe*/')
219 rc=lineout(X11ROOT'\XFree86\bin\fsend2.cmd','parse arg "-p" phone "-i" fname "-d" name "-m" comment')
220 rc=lineout(X11ROOT'\XFree86\bin\fsend2.cmd','"gs -sDEVICE=tiffg3 -sOutputFile=temp_tiff.TIF -dNOPAUSE "fname" -c quit"')
221 rc=lineout(X11ROOT'\XFree86\bin\fsend2.cmd','"fsend -p"phone" -itemp_tiff.TIF -d"name" -m"comment')
222 rc=lineout(X11ROOT'\XFree86\bin\fsend2.cmd','"rm -f temp_tiff.TIF"')
223 rc=lineout(X11ROOT'\XFree86\bin\fsend2.cmd')
224 rc=lineout(lyxrc_defaults,'\fax_command "fsend2 -p'"'$$Phone' -i'$$FName' -d'$$Name' -m'$$Comment'"'"')
226 if \(''=SysSearchPath('PATH','lp.exe')) then
228 rc=lineout(lyxrc_defaults,'\print_spool_command "lp"')
229 rc=lineout(lyxrc_defaults,'\print_spool_printerprefix "-d"')
232 if \(''=SysSearchPath('PATH','lpr.exe')) then
234 rc=lineout(lyxrc_defaults,'\print_spool_command "lpr"')
235 rc=lineout(lyxrc_defaults,'\print_spool_printerprefix "-P"')
239 rc=lineout(lyxrc_defaults,'\print_spool_command ""')
240 rc=lineout(lyxrc_defaults,'\print_spool_printerprefix ""')
242 rc=lineout(lyxrc_defaults,'\font_encoding "'rc_fontenc'"')
243 rc=lineout(lyxrc_defaults)