home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Divers / lyx-0.13.2.tar.gz / lyx-0.13.2.tar / lyx-0.13.2 / lib / configure.cmd < prev    next >
OS/2 REXX Batch file  |  1998-04-23  |  6KB  |  155 lines

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