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 $$i|latex2e $$i
%"latex"'
62 call SEARCH_PROG 'converter latex pdf2
%pdflatex $$i|pdflatex2e $$i
%"latex"'
63 call SEARCH_PROG 'converter latex html
%tth
-t
-e2
-L$$BaseName
< $$i
> $$o|latex2html
-no_subdir
-split
0 -show_section_numbers $$i|hevea
-s $$i
%"originaldir,needaux"'
64 call SEARCH_PROG 'converter literate latex
%noweave
-delay
-index $$i
> $$o
%""'
65 call SEARCH_PROG 'converter dvi ps
%dvips
-o $$o $$i
%""'
66 call SEARCH_PROG 'converter ps pdf
%ps2pdf $$i
%""'
67 call SEARCH_PROG 'converter ps fax
%ksendfax $$i
%""'
68 /* call SEARCH_PROG 'converter ps tiff
%gs
-sDEVICE
=tiffg3
-sOutputFile
=$$o
-dNOPAUSE $$i
-c quit|gsos2
-sDEVICE
=tiffg3
-sOutputFile
=$$o
-dNOPAUSE $$i
-c quit
%""' */
69 call SEARCH_PROG 'converter linuxdoc lyx
%sgml2lyx $$i
%""'
70 call SEARCH_PROG 'converter linuxdoc latex
%sgml2latex $$i
%""'
71 call SEARCH_PROG 'converter linuxdoc dvi
%sgml2latex
-o dvi $$i
%""'
72 call SEARCH_PROG 'converter linuxdoc html
%sgml2html $$i
%""'
73 call SEARCH_PROG 'converter docbook dvi
%sgmltools
-b dvi $$i|db2dvi $$i
%""'
74 call SEARCH_PROG 'converter docbook html
%sgmltools
-b html $$i|db2html $$i
%""'
77 call SEARCH_PROG 'converter latex lyx
%reLyX
-f $$i
%""'
78 call SEARCH_PROG 'converter literate lyx
%noweb2lyx $$i $$o
%""'
79 call SEARCH_PROG 'converter html latex
%html2latex $$i
%""'
80 call SEARCH_PROG 'converter word latex
%wvCleanLatex $$i $$o|word2x
-f latex $$i
%""'
83 call SEARCH_PROG 'converter gif eps
%convert $$i $$o
%""'
84 call SEARCH_PROG 'converter png eps
%convert $$i $$o
%""'
85 call SEARCH_PROG 'converter jpg eps
%convert $$i $$o
%""'
86 call SEARCH_PROG 'converter gif png
%convert $$i $$o
%""'
89 call SEARCH_PROG 'viewer dvi
%xdvi
'
90 call SEARCH_PROG 'viewer html
%netscape
'
91 call SEARCH_PROG 'viewer pdf
%xpdf gv ghostview acroread
'
92 call SEARCH_PROG 'viewer ps
%gv
-swap|ghostview
-swap|gvpm
-swap
'
93 call SEARCH_PROG 'viewer eps
%gv|ghostview|gvpm
'
96 call SEARCH_PROG 'ps_command
%gs|gsos2
'
97 call SEARCH_PROG 'ascii_roff_command
%groff
-t
-Tlatin1 $$i
'
98 call SEARCH_PROG 'chktex_command
%chktex
-n1
-n3
-n6
-n9
-n22
-n25
-n30
-n38
'
99 call SEARCH_PROG 'spell_command
%ispell
'
100 /* call SEARCH_PROG 'fax_command
%fsend
-p$$Phone
-i$$i
-d$$Name
-m$$Comment
' */
101 call SEARCH_PROG 'print_spool_command
%lp|lpr
'
103 if pos('lpr
',A_.i)>0 then
106 A_.i='print_spool_printerprefix
"-P"'
111 A_.i='print_spool_printerprefix
"-d "'
113 /* call SysFileTree 'reLyX
\reLyX.
cmd', 'found
', 'F
' */
115 \nonstopmode\makeatletter
116 \ifx\undefined\documentclass\else
117 \message{ThisIsLaTeX2e}
121 call WRITE_FILE 'chklatex.ltx
' '$ChkLaTeX
'
122 'cmd /c
'LATEX' chklatex.ltx
>nul
'
123 call SysFileSearch 'NotLaTeX2e
', 'chklatex.log
', chklatex
124 if chklatex.0 > 0 then LATEX=''
126 rc=SysFileDelete('textclass.lst
')
127 rc=SysFileDelete('packages.lst
')
128 rc=SysFileDelete('chkconfig.sed
')
129 if \(lyx_check_config='no
') then
131 rc=SysFileTree(srcdir'\layouts\
*.layout
',found,'FO
')
132 rc=SysFileDelete('chklayouts.tex
')
133 rc=SysFileDelete('chkconfig.vars
')
136 parse value filespec('name
',found.num) with DocClass '.layout
'
137 parse value DocClass with mainClass '_
' subClass
139 rc=lineout('chklayouts.tex
','\TestDocClass
{'DocClass'}')
140 else /* Not used, or must be empty? */
141 rc=lineout('chklayouts.tex
','\TestDocClass
['mainClass'.
cls]{'DocClass'}')
143 rc=lineout('chklayouts.tex
')
146 if SGMLTOOLS='sgml2lyx
' then
149 sgmltools_cmd='\def\hassgmltools
{}'
151 rc=SysFileDelete('wrap_chkconfig.ltx
')
152 rc=lineout('wrap_chkconfig.ltx
','\newcommand\srcdir
{'srcdir'}')
153 rc=lineout('wrap_chkconfig.ltx
',sgmltools_cmd)
154 rc=lineout('wrap_chkconfig.ltx
','\input
{'srcdir'/chkconfig.ltx
}')
155 rc=lineout('wrap_chkconfig.ltx
')
156 'cmd /c
'LATEX' wrap_chkconfig.ltx
'
157 size=stream('chkconfig.sed
','c
','query size
')
158 rc=stream('chkconfig.sed
','c
','open
')
159 if rxfuncquery(SysAddRexxMacro) then
160 rc=stream('chkconfig.sed
','c
','seek
+'size)
162 rc=stream('chkconfig.sed
','c
','seek
+ 'size' write
')
163 rc=lineout('chkconfig.sed
','s
/@chk_sgmltools@
/'chk_sgmltools'/g
')
164 rc=lineout('chkconfig.sed
')
165 call SysFileSearch 'chk_fontenc
=', 'chkconfig.vars
', fontenc
166 if fontenc.0 > 0 then parse var fontenc.1 chk"='"rc_fontenc"'"
169 call SysFileTree 'textclass.lst
', 'file
', 'FO
'
173 # This file declares layouts and their associated definition files
174 # (include dir. relative to the place where this file is).
175 # It contains only default values, since chkconfig.ltx could not be run
176 # for some reason. Run ./configure if you need to update it after a
177 # configuration change.
178 "article" "article" "article"
179 "report" "report" "report"
181 "linuxdoc" "linuxdoc" "linuxdoc"
182 "letter" "letter" "letter"
184 call WRITE_FILE 'textclass.lst
' '$TextClass
'
185 rc=lineout('chkconfig.sed
','s
/@.
*@
/???
/g
')
186 rc=lineout('chkconfig.sed
')
190 call SysFileTree 'chkconfig.sed
', 'file
', 'FO
'
193 rc=lineout('chkconfig.sed
','s
/@.
*@
/???
/g
')
194 rc=lineout('chkconfig.sed
')
197 call SysFileTree 'packages.lst
', 'file
', 'FO
'
201 # This file should contain the list of LaTeX packages that have been
202 # recognized by LyX. Unfortunately, since configure could not find
203 # your LaTeX2e program, the tests have not been run. Run configure
204 # if you need to update it after a configuration change.
206 call WRITE_FILE 'packages.lst
' '$Packages
'
209 say 'creating doc
/LaTeXConfig.lyx
'
210 'sed
-f chkconfig.sed
'srcdir'/doc
/LaTeXConfig.lyx.in
>doc\LaTeXConfig.lyx
'
211 call SysFileDelete 'chkconfig.sed
'
212 call SysFileDelete 'chkconfig.vars
'
213 call SysFileDelete 'wrap_chkconfig.ltx
'
214 call SysFileDelete 'wrap_chkconfig.log
'
215 call SysFileDelete 'chklatex.ltx
'
216 call SysFileDelete 'chklatex.log
'
217 call SysFileDelete 'chklayouts.tex
'
218 call SysFileDelete 'missfont.log
'
220 say 'creating
'lyxrc_defaults
221 if rxfuncquery(SysAddRexxMacro) then
222 rc=stream(lyxrc_defaults,'c
','seek
=0')
223 rc=SysFileDelete(X11ROOT'\XFree86
\bin
\fsend
2.
cmd')
225 # This file has been automatically generated by LyX' lib
/configure
226 # script. It contains default settings that have been determined by
227 # examining your system. PLEASE
DO NOT MODIFY ANYTHING HERE
! If you
228 # want to customize LyX
, make a
copy of the file LYXDIR
/lyxrc as
229 # ~
/.lyx
/lyxrc and edit this file instead. Any setting in lyxrc will
230 # override the values given here.
231 \
Format text txt ASCII A
232 \
Format textparagraph txt ASCII
(paragraphs
) ""
233 \
Format docbook sgml DocBook B
234 \
Format dvi dvi DVI D
235 \
Format eps eps EPS
""
236 \
Format fax
"" Fax
""
237 \
Format gif gif GIF
""
238 \
Format html html HTML H
239 \
Format jpg jpg JPEG
""
240 \
Format latex tex LaTeX L
241 \
Format linuxdoc sgml LinuxDoc x
242 \
Format lyx lyx LyX
""
243 \
Format literate nw NoWeb N
244 \
Format pdf pdf PDF P
245 \
Format pdf2 pdf
"PDF (pdflatex)" F
246 \
Format png png PNG
""
247 \
Format ps ps Postscript t
248 \
Format program
"" Program
""
249 \
Format word doc Word W
253 call WRITE_FILE lyxrc_defaults
'$LyXRC_Default'
255 A_.i
='font_encoding "'||rc_fontenc||
'"'
257 if A_.i\
='' then A_.i
='\'||A_.i
258 call lineout lyxrc_defaults,A_.i
260 call lineout lyxrc_defaults
264 SEARCH_PROG: procedure expose A_.
265 parse arg LABEL '%' COMMANDS '%' ROUTE
268 A_.i=LABEL||' "none" '||ROUTE
269 do while COMMANDS\=''
270 parse value COMMANDS with COMMAND '|
' COMMANDS
271 parse upper value COMMAND with CMD ARGV
272 if (\(''=SysSearchPath('PATH',CMD||'.EXE
'))|\(''=SysSearchPath('PATH',CMD||'.
CMD'))) then
274 A_.i=LABEL||' "'||COMMAND||'" '||ROUTE
280 WRITE_FILE: procedure expose script
282 call SysFileDelete FILE
284 do while pos(TAG,C_)=0
288 do while pos('EOF
',C_)=0
293 /*call lineout script*/