1 /* OS/2 REXX : The lib/configure.cmd; Don't delete this comment. */
2 call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
5 X11ROOT=value('X11ROOT',,env)
6 latex_script='chkconfig.ltx'
7 lyxrc_defaults='lyxrc.defaults'
11 parse arg option '=' srcdir
13 when option='-h'|option='-help'|option='--help' then do
14 say 'Usage: configure [options]'
16 say ' --help show this help lines'
17 say ' --without-latex-config do not run LaTeX to determine configuration'
20 when option='--without-latex-config' then
22 when option='--srcdir' then
23 srcdir=translate(srcdir,'\','/')
28 parse source 'OS/2 COMMAND ' script
30 srcdir=filespec('drive',script)strip(filespec('path',script),'T','\')
33 rc=SysFileTree(srcdir'\'latex_script,found,'F')
34 if found.0 = 0 then do
35 say "configure: error: cannot find "srcdir'\'latex_script" script"
39 if \(curdir=srcdir) then do
40 call SysFileTree 'layouts', 'found', 'D'
41 if found.0 = 0 then do
43 call SysMkDir 'clipart'
45 call SysMkDir 'examples'
46 call SysMkDir 'images'
48 call SysMkDir 'layouts'
50 call SysMkDir 'scripts'
51 call SysMkDir 'templates'
54 'cmd /c copy /v' srcdir'\layouts\*.layout layouts'
56 say 'Error! copying layout files.'
58 curdir=translate(curdir,'/','\')
59 srcdir=translate(srcdir,'/','\')
61 call SEARCH_PROG 'converter latex dvi%latex|latex2e%"latex,disable=linuxdoc&docbook"'
62 call SEARCH_PROG 'converter latex pdf%pdflatex|pdflatex2e%"latex,disable=linuxdoc&docbook"'
63 call SEARCH_PROG 'converter latex html%tth -t -e2 -L$$BaseName < $$FName > $$OutName|latex2html -no_subdir -split 0 -show_section_numbers $$FName|hevea -s $$FName%"originaldir,needaux,disable=linuxdoc&docbook"'
64 call SEARCH_PROG 'converter literate latex%noweave -delay -index $$FName > $$OutName%""'
65 call SEARCH_PROG 'converter dvi ps%dvips -o $$OutName $$FName%""'
66 call SEARCH_PROG 'converter ps pdf%ps2pdf $$FName%""'
67 call SEARCH_PROG 'converter ps tiff%gs -sDEVICE=tiffg3 -sOutputFile=$$OutName -dNOPAUSE $$FName -c quit|gsos2 -sDEVICE=tiffg3 -sOutputFile=$$OutName -dNOPAUSE $$FName -c quit%""'
68 call SEARCH_PROG 'converter linuxdoc lyx%sgml2lyx $$FName%""'
69 call SEARCH_PROG 'converter linuxdoc latex%sgml2latex $$FName%""'
70 call SEARCH_PROG 'converter linuxdoc dvi%sgml2latex -o dvi $$FName%""'
71 call SEARCH_PROG 'converter linuxdoc html%sgml2html $$FName%""'
72 call SEARCH_PROG 'converter docbook dvi%sgmltools -b dvi $$FName|db2dvi $$FName%""'
73 call SEARCH_PROG 'converter docbook html%sgmltools -b html $$FName|db2html $$FName%""'
76 call SEARCH_PROG 'converter latex lyx%reLyX -f $$FName%"importer"'
77 call SEARCH_PROG 'converter literate lyx%noweb2lyx $$FName $$OutName%"importer"'
78 call SEARCH_PROG 'converter html latex%html2latex $$FName%"importer"'
79 call SEARCH_PROG 'converter word latex%wvCleanLatex $$FName $$OutName|word2x -f latex $$FName%"importer"'
82 call SEARCH_PROG 'converter gif eps%convert $$FName $$OutName%""'
83 call SEARCH_PROG 'converter png eps%convert $$FName $$OutName%""'
84 call SEARCH_PROG 'converter jpg eps%convert $$FName $$OutName%""'
85 call SEARCH_PROG 'converter gif png%convert $$FName $$OutName%""'
88 call SEARCH_PROG 'viewer dvi%xdvi'
89 call SEARCH_PROG 'viewer html%netscape'
90 call SEARCH_PROG 'viewer pdf%xpdf gv ghostview acroread'
91 call SEARCH_PROG 'viewer ps%gv -swap|ghostview -swap|gvpm -swap'
92 call SEARCH_PROG 'viewer eps%gv|ghostview|gvpm'
95 call SEARCH_PROG 'ps_command%gs|gsos2'
96 call SEARCH_PROG 'ascii_roff_command%groff -t -Tlatin1 $$FName'
97 call SEARCH_PROG 'chktex_command%chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38'
98 call SEARCH_PROG 'spell_command%ispell'
99 /* call SEARCH_PROG 'fax_command%fsend -p$$Phone -i$$FName -d$$Name -m$$Comment' */
100 call SEARCH_PROG 'print_spool_command%lp|lpr'
102 if pos('lpr',A_.i)>0 then
105 A_.i='print_spool_printerprefix "-P"'
110 A_.i='print_spool_printerprefix "-d "'
112 /* call SysFileTree 'reLyX\reLyX.cmd', 'found', 'F' */
114 \nonstopmode\makeatletter
115 \ifx\undefined\documentclass\else
116 \message{ThisIsLaTeX2e}
120 call WRITE_FILE 'chklatex.ltx' '$ChkLaTeX'
121 'cmd /c 'LATEX' chklatex.ltx>nul'
122 call SysFileSearch 'NotLaTeX2e', 'chklatex.log', chklatex
123 if chklatex.0 > 0 then LATEX=''
125 rc=SysFileDelete('textclass.lst')
126 rc=SysFileDelete('packages.lst')
127 rc=SysFileDelete('chkconfig.sed')
128 if \(lyx_check_config='no') then
130 rc=SysFileTree(srcdir'\layouts\*.layout',found,'FO')
131 rc=SysFileDelete('chklayouts.tex')
132 rc=SysFileDelete('chkconfig.vars')
135 parse value filespec('name',found.num) with DocClass '.layout'
136 parse value DocClass with mainClass '_' subClass
138 rc=lineout('chklayouts.tex','\TestDocClass{'DocClass'}')
139 else /* Not used, or must be empty? */
140 rc=lineout('chklayouts.tex','\TestDocClass['mainClass'.cls]{'DocClass'}')
142 rc=lineout('chklayouts.tex')
145 if SGMLTOOLS='sgml2lyx' then
148 sgmltools_cmd='\def\hassgmltools{}'
150 rc=SysFileDelete('wrap_chkconfig.ltx')
151 rc=lineout('wrap_chkconfig.ltx','\newcommand\srcdir{'srcdir'}')
152 rc=lineout('wrap_chkconfig.ltx',sgmltools_cmd)
153 rc=lineout('wrap_chkconfig.ltx','\input{'srcdir'/chkconfig.ltx}')
154 rc=lineout('wrap_chkconfig.ltx')
155 'cmd /c 'LATEX' wrap_chkconfig.ltx'
156 size=stream('chkconfig.sed','c','query size')
157 rc=stream('chkconfig.sed','c','open')
158 if rxfuncquery(SysAddRexxMacro) then
159 rc=stream('chkconfig.sed','c','seek +'size)
161 rc=stream('chkconfig.sed','c','seek + 'size' write')
162 rc=lineout('chkconfig.sed','s/@chk_sgmltools@/'chk_sgmltools'/g')
163 rc=lineout('chkconfig.sed')
164 call SysFileSearch 'chk_fontenc=', 'chkconfig.vars', fontenc
165 if fontenc.0 > 0 then parse var fontenc.1 chk"='"rc_fontenc"'"
168 call SysFileTree 'textclass.lst', 'file', 'FO'
172 # This file declares layouts and their associated definition files
173 # (include dir. relative to the place where this file is).
174 # It contains only default values, since chkconfig.ltx could not be run
175 # for some reason. Run ./configure if you need to update it after a
176 # configuration change.
177 article article article
180 linuxdoc linuxdoc linuxdoc
183 call WRITE_FILE 'textclass.lst' '$TextClass'
184 rc=lineout('chkconfig.sed','s/@.*@/???/g')
185 rc=lineout('chkconfig.sed')
189 call SysFileTree 'chkconfig.sed', 'file', 'FO'
192 rc=lineout('chkconfig.sed','s/@.*@/???/g')
193 rc=lineout('chkconfig.sed')
196 call SysFileTree 'packages.lst', 'file', 'FO'
200 # This file should contain the list of LaTeX packages that have been
201 # recognized by LyX. Unfortunately, since configure could not find
202 # your LaTeX2e program, the tests have not been run. Run configure
203 # if you need to update it after a configuration change.
205 call WRITE_FILE 'packages.lst' '$Packages'
208 say 'creating doc/LaTeXConfig.lyx'
209 'sed -f chkconfig.sed 'srcdir'/doc/LaTeXConfig.lyx.in >doc\LaTeXConfig.lyx'
210 call SysFileDelete 'chkconfig.sed'
211 call SysFileDelete 'chkconfig.vars'
212 call SysFileDelete 'wrap_chkconfig.ltx'
213 call SysFileDelete 'wrap_chkconfig.log'
214 call SysFileDelete 'chklatex.ltx'
215 call SysFileDelete 'chklatex.log'
216 call SysFileDelete 'chklayouts.tex'
217 call SysFileDelete 'missfont.log'
219 say 'creating 'lyxrc_defaults
220 if rxfuncquery(SysAddRexxMacro) then
221 rc=stream(lyxrc_defaults,'c','seek =0')
222 rc=SysFileDelete(X11ROOT'\XFree86\bin\fsend2.cmd')
224 # This file has been automatically generated by LyX' lib/configure
225 # script. It contains default settings that have been determined by
226 # examining your system. PLEASE DO NOT MODIFY ANYTHING HERE! If you
227 # want to customize LyX, make a copy of the file LYXDIR/lyxrc as
228 # ~/.lyx/lyxrc and edit this file instead. Any setting in lyxrc will
229 # override the values given here.
230 \Format latex tex LaTeX L
231 \Format dvi dvi DVI D
232 \Format ps ps Postscript t
233 \Format pdf pdf PDF P
234 \Format html html HTML H
235 \Format text txt ASCII A
236 \Format word doc Word W
237 \Format literate nw NoWeb N
238 \Format linuxdoc sgml LinuxDoc x
239 \Format docbook sgml DocBook B
240 \Format program "" Program ""
241 \Format fax "" Fax ""
244 call WRITE_FILE lyxrc_defaults '$LyXRC_Default'
246 A_.i='font_encoding "'||rc_fontenc||'"'
248 if A_.i\='' then A_.i='\'||A_.i
249 call lineout lyxrc_defaults,A_.i
251 call lineout lyxrc_defaults
255 SEARCH_PROG: procedure expose A_.
256 parse arg LABEL '%' COMMANDS '%' ROUTE
259 A_.i=LABEL||' "none" '||ROUTE
260 do while COMMANDS\=''
261 parse value COMMANDS with COMMAND '|' COMMANDS
262 parse upper value COMMAND with CMD ARGV
263 if (\(''=SysSearchPath('PATH',CMD||'.EXE'))|\(''=SysSearchPath('PATH',CMD||'.CMD'))) then
265 A_.i=LABEL||' "'||COMMAND||'" '||ROUTE
271 WRITE_FILE: procedure expose script
273 call SysFileDelete FILE
275 do while pos(TAG,C_)=0
279 do while pos('EOF',C_)=0
284 /*call lineout script*/