1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
|
/* OS/2 REXX : The lib/configure.cmd; Don't delete this comment. */
call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
call SysLoadFuncs
env='OS2ENVIRONMENT'
EMTEXDIR=value('EMTEXDIR',,env)
X11ROOT=value('X11ROOT',,env)
latex_script='chkconfig.ltx'
lyxrc_defaults='lyxrc.defaults'
lyx_check_config='yes'
parse arg option '=' srcdir
select
when option='-h'|option='-help'|option='--help' then do
say 'Usage: configure [options]'
say 'Options:'
say ' --help show this help lines'
say ' --without-latex-config do not run LaTeX to determine configuration'
exit
end
when option='--without-latex-config' then
lyx_check_config='no'
when option='--srcdir' then
srcdir=translate(srcdir,'\','/')
otherwise
nop
end /* select */
if srcdir='' then do
parse source 'OS/2 COMMAND ' script
say 'script =' script
srcdir=filespec('drive',script)strip(filespec('path',script),'T','\')
end
rc=SysFileTree(srcdir'\'latex_script,found,'F')
if found.0 = 0 then do
say "configure: error: cannot find "srcdir'\'latex_script" script"
exit 1
end
curdir=directory()
if \(curdir=srcdir) then 'xcopy /s 'srcdir' 'curdir'\'
curdir=translate(curdir,'/','\')
srcdir=translate(srcdir,'/','\')
rc=SysFileTree(EMTEXDIR'\bin\latex.cmd',found,'F')
if found.0 = 0 then LATEX='latex2e'
else LATEX='latex'
if \(''=SysSearchPath('PATH','gv.exe')) then
GHOSTVIEW='gv'
else /* Peter Ganten has ported both gv and ghostview to XFree86/OS2 */
if \(''=SysSearchPath('PATH','ghostview.exe')) then
GHOSTVIEW='ghostview'
else
GHOSTVIEW='none'
if (''=SysSearchPath('PATH','sgml2lyx.exe')) then
SGMLTOOLS='none'
else
SGMLTOOLS='sgml2lyx'
if (''=SysSearchPath('PATH','chktex.exe')) then
CHKTEX='none'
else
CHKTEX='chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38'
rc=SysFileDelete('chklatex.ltx')
rc=lineout('chklatex.ltx','\nonstopmode\makeatletter')
rc=lineout('chklatex.ltx','\ifx\undefined\documentclass')
rc=lineout('chklatex.ltx',' \message{NotLaTeX2e}')
rc=lineout('chklatex.ltx','\fi')
rc=lineout('chklatex.ltx','\@@end')
rc=lineout('chklatex.ltx')
'cmd /c 'LATEX' chklatex.ltx>nul'
call SysFileSearch 'NotLaTeX2e', 'chklatex.log', chklatex
if chklatex.0 > 0 then LATEX=''
rc=SysFileDelete('textclass.lst')
rc=SysFileDelete('chkconfig.sed')
if lyx_check_config='no' then
do
rc=lineout('textclass.lst','# This file declares layouts and their associated definition files')
rc=lineout('textclass.lst','# (include dir. relative to the place where this file is).')
rc=lineout('textclass.lst','# It contains only default values, since chkconfig.ltx could not be run')
rc=lineout('textclass.lst','# for some reason. Run ./configure if you need to update it after a')
rc=lineout('textclass.lst','# configuration change.')
rc=lineout('textclass.lst','article article article')
rc=lineout('textclass.lst','report report report')
rc=lineout('textclass.lst','book book book')
rc=lineout('textclass.lst','linuxdoc linuxdoc linuxdoc')
rc=lineout('textclass.lst','letter letter letter')
rc=lineout('textclass.lst')
rc=lineout('chkconfig.sed','s/@.*@/???/g')
rc=lineout('chkconfig.sed')
rc_graphics='none'
end
else
do
rc=SysFileTree(srcdir'\layouts\*.layout',found,'FO')
rc=SysFileDelete('chklayouts.tex')
rc=SysFileDelete('chkconfig.vars')
if found.0>0 then
do num=1 to found.0
parse value filespec('name',found.num) with DocClass '.layout'
parse value DocClass with mainClass '_' subClass
if ''=subClass then
rc=lineout('chklayouts.tex','\TestDocClass{'DocClass'}')
else /* Not used, or must be empty? */
rc=lineout('chklayouts.tex','\TestDocClass['mainClass'.cls]{'DocClass'}')
end
rc=lineout('chklayouts.tex')
sgmltools_cmd=''
chk_sgmltools='no'
if SGMLTOOLS='sgml2lyx' then
do
chk_sgmltools='yes'
sgmltools_cmd='\def\hassgmltools{}'
end
rc=SysFileDelete('wrap_chkconfig.ltx')
rc=lineout('wrap_chkconfig.ltx','\newcommand\srcdir{'srcdir'}')
rc=lineout('wrap_chkconfig.ltx',sgmltools_cmd)
rc=lineout('wrap_chkconfig.ltx','\input{'srcdir'/chkconfig.ltx}')
rc=lineout('wrap_chkconfig.ltx')
'cmd /c 'LATEX' wrap_chkconfig.ltx'
size=stream('chkconfig.sed','c','query size')
rc=stream('chkconfig.sed','c','open')
rc=stream('chkconfig.sed','c','seek +'size)
rc=lineout('chkconfig.sed','s/@chk_sgmltools@/'chk_sgmltools'/g')
rc=lineout('chkconfig.sed')
call SysFileSearch 'chk_graphicsdriver=', 'chkconfig.vars', graphics
if graphics.0 > 0 then parse var graphics.1 chk"='"rc_graphicsdriver"'"
call SysFileSearch 'chk_fontenc=', 'chkconfig.vars', fontenc
if fontenc.0 > 0 then parse var fontenc.1 chk"='"rc_fontenc"'"
end
say 'creating doc/LaTeXConfig.lyx'
'sed -f chkconfig.sed 'curdir'/doc/LaTeXConfig.lyx.in >doc\LaTeXConfig.lyx'
'rm -f chkconfig.sed chkconfig.vars wrap_chkconfig.* chklayouts.tex missfont.log'
say 'creating 'lyxrc_defaults
rc=SysFileDelete(lyxrc_defaults)
rc=stream(lyxrc_defaults,'c','seek=0')
rc=SysFileDelete(X11ROOT'\XFree86\bin\fsend2.cmd')
rc=lineout(lyxrc_defaults,'\latex_command "'LATEX'"')
rc=lineout(lyxrc_defaults,'\view_ps_command "'GHOSTVIEW' -swap"')
rc=lineout(lyxrc_defaults,'\view_pspic_command "'GHOSTVIEW'"')
rc=lineout(lyxrc_defaults,'\ascii_roff_command "groff -t -ms -Tlatin1"')
rc=lineout(lyxrc_defaults,'\chktex_command "'CHKTEX'"')
if \(''=SysSearchPath('PATH','fsend.exe')) then
do
rc=lineout(X11ROOT'\XFree86\bin\fsend2.cmd','/*A wrapper for fsend.exe*/')
rc=lineout(X11ROOT'\XFree86\bin\fsend2.cmd','parse arg "-p" phone "-i" fname "-d" name "-m" comment')
rc=lineout(X11ROOT'\XFree86\bin\fsend2.cmd','"gs -sDEVICE=tiffg3 -sOutputFile=temp_tiff.%d -dNOPAUSE "fname" -c quit"')
rc=lineout(X11ROOT'\XFree86\bin\fsend2.cmd','"ls -1 temp_tiff.*>files.tmp"')
rc=lineout(X11ROOT'\XFree86\bin\fsend2.cmd','"fsend -p"phone" -i@files.tmp -d"name" -m"comment')
rc=lineout(X11ROOT'\XFree86\bin\fsend2.cmd','"rm -f temp_tiff.* files.tmp"')
rc=lineout(X11ROOT'\XFree86\bin\fsend2.cmd')
rc=lineout(lyxrc_defaults,'\fax_command "fsend2 -p'"'$$Phone' -i'$$FName' -d'$$Name' -m'$$Comment'"'"')
end
rc=lineout(lyxrc_defaults,'\font_encoding "'rc_fontenc'"')
rc=lineout(lyxrc_defaults)
|