X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=lib%2Fconfigure.cmd;h=ee9c95ad45c462e0bf42fdef41bfb4762d23583e;hb=0959028211a8a8cfaf56cc2f07ab1c159f2153ff;hp=f7864516a03ef63bfa9463dfb746937fd5580b6a;hpb=cf6dacdb0a3911035c2d1f7beb7bc984f9d4ef62;p=lyx.git diff --git a/lib/configure.cmd b/lib/configure.cmd index f7864516a0..ee9c95ad45 100755 --- a/lib/configure.cmd +++ b/lib/configure.cmd @@ -2,7 +2,6 @@ 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' @@ -41,10 +40,16 @@ if \(curdir=srcdir) then do call SysFileTree 'layouts', 'found', 'D' if found.0 = 0 then do call SysMkDir 'bind' + call SysMkDir 'clipart' call SysMkDir 'doc' + call SysMkDir 'examples' + call SysMkDir 'images' call SysMkDir 'kbd' call SysMkDir 'layouts' + call SysMkDir 'reLyX' + call SysMkDir 'scripts' call SysMkDir 'templates' + call SysMkDir 'ui' end 'cmd /c copy /v' srcdir'\layouts\*.layout layouts' if \(rc=0) then @@ -52,58 +57,68 @@ if \(curdir=srcdir) then do end curdir=translate(curdir,'/','\') srcdir=translate(srcdir,'/','\') -call SysFileTree EMTEXDIR'\bin\latex.cmd', 'found', 'F' -if found.0 = 0 then LATEX='latex2e' -else LATEX='latex' -if \(''=SysSearchPath('PATH','GS.EXE')) then - GS='gs' -else -if \(''=SysSearchPath('PATH','GSOS2.EXE')) then - GS='gsos2' -else - GS='none' -if \(''=SysSearchPath('PATH','GV.EXE')) then - GHOSTVIEW='gv' -else -if \(''=SysSearchPath('PATH','GHOSTVIEW.EXE')) then - GHOSTVIEW='ghostview' -else - GHOSTVIEW='none' -if (''=SysSearchPath('PATH','SGML2LYX.CMD')) 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' -if \(''=SysSearchPath('PATH','ISPELL.EXE')) then - SPELL='ispell' -else - SPELL='none' -if (''=SysSearchPath('PATH','NOWEAVE.EXE')) then do - LITERATE='none' - LITERATE_EXT='none' -end -else do - LITERATE='noweave -delay -index' - LITERATE_EXT='.nw' -end -call SysFileTree 'reLyX\reLyX.cmd', 'found', 'F' -if found.0 = 0 then - if (''=SysSearchPath('PATH','reLyX.cmd')) then - RELYX='none' - else - RELYX='reLyX.cmd' +A_.0=0 +call SEARCH_PROG 'converter latex dvi%latex $$i|latex2e $$i%"latex"' +call SEARCH_PROG 'converter latex pdf2%pdflatex $$i|pdflatex2e $$i%"latex"' +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"' +call SEARCH_PROG 'converter literate latex%noweave -delay -index $$i > $$o%""' +call SEARCH_PROG 'converter dvi ps%dvips -o $$o $$i%""' +call SEARCH_PROG 'converter ps pdf%ps2pdf $$i%""' +call SEARCH_PROG 'converter ps fax%ksendfax $$i%""' +/* call SEARCH_PROG 'converter ps tiff%gs -sDEVICE=tiffg3 -sOutputFile=$$o -dNOPAUSE $$i -c quit|gsos2 -sDEVICE=tiffg3 -sOutputFile=$$o -dNOPAUSE $$i -c quit%""' */ +call SEARCH_PROG 'converter linuxdoc lyx%sgml2lyx $$i%""' +call SEARCH_PROG 'converter linuxdoc latex%sgml2latex $$i%""' +call SEARCH_PROG 'converter linuxdoc dvi%sgml2latex -o dvi $$i%""' +call SEARCH_PROG 'converter linuxdoc html%sgml2html $$i%""' +call SEARCH_PROG 'converter docbook dvi%sgmltools -b dvi $$i|db2dvi $$i%""' +call SEARCH_PROG 'converter docbook html%sgmltools -b html $$i|db2html $$i%""' +A_.0=A_.0+1;i=A_.0 +A_.i='' +call SEARCH_PROG 'converter latex lyx%reLyX -f $$i%""' +call SEARCH_PROG 'converter literate lyx%noweb2lyx $$i $$o%""' +call SEARCH_PROG 'converter html latex%html2latex $$i%""' +call SEARCH_PROG 'converter word latex%wvCleanLatex $$i $$o|word2x -f latex $$i%""' +A_.0=A_.0+1;i=A_.0 +A_.i='' +call SEARCH_PROG 'converter gif eps%convert $$i $$o%""' +call SEARCH_PROG 'converter png eps%convert $$i $$o%""' +call SEARCH_PROG 'converter jpg eps%convert $$i $$o%""' +call SEARCH_PROG 'converter gif png%convert $$i $$o%""' +A_.0=A_.0+1;i=A_.0 +A_.i='' +call SEARCH_PROG 'viewer dvi%xdvi' +call SEARCH_PROG 'viewer html%netscape' +call SEARCH_PROG 'viewer pdf%xpdf gv ghostview acroread' +call SEARCH_PROG 'viewer ps%gv -swap|ghostview -swap|gvpm -swap' +call SEARCH_PROG 'viewer eps%gv|ghostview|gvpm' +A_.0=A_.0+1;i=A_.0 +A_.i='' +call SEARCH_PROG 'ps_command%gs|gsos2' +call SEARCH_PROG 'ascii_roff_command%groff -t -Tlatin1 $$i' +call SEARCH_PROG 'chktex_command%chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38' +call SEARCH_PROG 'spell_command%ispell' +/* call SEARCH_PROG 'fax_command%fsend -p$$Phone -i$$i -d$$Name -m$$Comment' */ +call SEARCH_PROG 'print_spool_command%lp|lpr' +i=A_.0;A_.0=A_.0+1 +if pos('lpr',A_.i)>0 then + do + i=i+1 + A_.i='print_spool_printerprefix "-P"' + end else - RELYX='reLyX.cmd' -call SysFileDelete 'chklatex.ltx' -rc=lineout('chklatex.ltx','\nonstopmode\makeatletter') -rc=lineout('chklatex.ltx','\ifx\undefined\documentclass\else') -rc=lineout('chklatex.ltx',' \message{ThisIsLaTeX2e}') -rc=lineout('chklatex.ltx','\fi') -rc=lineout('chklatex.ltx','\@@end') -rc=lineout('chklatex.ltx') + do + i=i+1 + A_.i='print_spool_printerprefix "-d "' + end +/* call SysFileTree 'reLyX\reLyX.cmd', 'found', 'F' */ +/* $ChkLaTeX +\nonstopmode\makeatletter +\ifx\undefined\documentclass\else + \message{ThisIsLaTeX2e} +\fi +\@@end + EOF */ +call WRITE_FILE 'chklatex.ltx' '$ChkLaTeX' 'cmd /c 'LATEX' chklatex.ltx>nul' call SysFileSearch 'NotLaTeX2e', 'chklatex.log', chklatex if chklatex.0 > 0 then LATEX='' @@ -154,20 +169,22 @@ end call SysFileTree 'textclass.lst', 'file', 'FO' if file.0=0 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' +/* $TextClass +# This file declares layouts and their associated definition files +# (include dir. relative to the place where this file is). +# It contains only default values, since chkconfig.ltx could not be run +# for some reason. Run ./configure if you need to update it after a +# configuration change. +"article" "article" "article" +"report" "report" "report" +"book" "book" "book" +"linuxdoc" "linuxdoc" "linuxdoc" +"letter" "letter" "letter" + EOF */ + call WRITE_FILE 'textclass.lst' '$TextClass' + rc=lineout('chkconfig.sed','s/@.*@/???/g') + rc=lineout('chkconfig.sed') + rc_graphics='none' end call SysFileTree 'chkconfig.sed', 'file', 'FO' @@ -180,11 +197,13 @@ end call SysFileTree 'packages.lst', 'file', 'FO' if file.0=0 then do - rc=lineout('packages.lst','# This file should contain the list of LaTeX packages that have been') - rc=lineout('packages.lst','# recognized by LyX. Unfortunately, since configure could not find') - rc=lineout('packages.lst','# your LaTeX2e program, the tests have not been run. Run configure') - rc=lineout('packages.lst','# if you need to update it after a configuration change.') - rc=lineout('packages.lst') +/* $Packages +# This file should contain the list of LaTeX packages that have been +# recognized by LyX. Unfortunately, since configure could not find +# your LaTeX2e program, the tests have not been run. Run configure +# if you need to update it after a configuration change. + EOF */ + call WRITE_FILE 'packages.lst' '$Packages' end say 'creating doc/LaTeXConfig.lyx' @@ -199,47 +218,77 @@ call SysFileDelete 'chklayouts.tex' call SysFileDelete 'missfont.log' say 'creating 'lyxrc_defaults -rc=SysFileDelete(lyxrc_defaults) if rxfuncquery(SysAddRexxMacro) then 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,'\relyx_command "'RELYX'"') -rc=lineout(lyxrc_defaults,'\literate_command "'LITERATE'"') -rc=lineout(lyxrc_defaults,'\literate_extension "'LITERATE_EXT'"') -rc=lineout(lyxrc_defaults,'\ps_command "'GS'"') -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'"') -rc=lineout(lyxrc_defaults,'\spell_command "'SPELL'"') -/* -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.TIF -dNOPAUSE "fname" -c quit"') - rc=lineout(X11ROOT'\XFree86\bin\fsend2.cmd','"fsend -p"phone" -itemp_tiff.TIF -d"name" -m"comment') - rc=lineout(X11ROOT'\XFree86\bin\fsend2.cmd','"rm -f temp_tiff.TIF"') - rc=lineout(X11ROOT'\XFree86\bin\fsend2.cmd') - rc=lineout(lyxrc_defaults,'\fax_command "fsend2 -p'"'$$Phone' -i'$$FName' -d'$$Name' -m'$$Comment'"'"') -end -*/ -if \(''=SysSearchPath('PATH','lp.exe')) then -do - rc=lineout(lyxrc_defaults,'\print_spool_command "lp"') - rc=lineout(lyxrc_defaults,'\print_spool_printerprefix "-d"') +/* $LyXRC_Default +# This file has been automatically generated by LyX' lib/configure +# script. It contains default settings that have been determined by +# examining your system. PLEASE DO NOT MODIFY ANYTHING HERE! If you +# want to customize LyX, make a copy of the file LYXDIR/lyxrc as +# ~/.lyx/lyxrc and edit this file instead. Any setting in lyxrc will +# override the values given here. +\Format text txt ASCII A +\Format textparagraph txt ASCII(paragraphs) "" +\Format docbook sgml DocBook B +\Format dvi dvi DVI D +\Format eps eps EPS "" +\Format fax "" Fax "" +\Format gif gif GIF "" +\Format html html HTML H +\Format jpg jpg JPEG "" +\Format latex tex LaTeX L +\Format linuxdoc sgml LinuxDoc x +\Format lyx lyx LyX "" +\Format literate nw NoWeb N +\Format pdf pdf PDF P +\Format pdf2 pdf "PDF (pdflatex)" F +\Format png png PNG "" +\Format ps ps Postscript t +\Format program "" Program "" +\Format word doc Word W + + + EOF */ +call WRITE_FILE lyxrc_defaults '$LyXRC_Default' +A_.0=A_.0+1;i=A_.0 +A_.i='font_encoding "'||rc_fontenc||'"' +do i=1 to A_.0 + if A_.i\='' then A_.i='\'||A_.i + call lineout lyxrc_defaults,A_.i end -else -if \(''=SysSearchPath('PATH','lpr.exe')) then -do - rc=lineout(lyxrc_defaults,'\print_spool_command "lpr"') - rc=lineout(lyxrc_defaults,'\print_spool_printerprefix "-P"') +call lineout lyxrc_defaults +call lineout script +exit + +SEARCH_PROG: procedure expose A_. +parse arg LABEL '%' COMMANDS '%' ROUTE + i=A_.0+1 + A_.0=i + A_.i=LABEL||' "none" '||ROUTE + do while COMMANDS\='' + parse value COMMANDS with COMMAND '|' COMMANDS + parse upper value COMMAND with CMD ARGV + if (\(''=SysSearchPath('PATH',CMD||'.EXE'))|\(''=SysSearchPath('PATH',CMD||'.CMD'))) then + do + A_.i=LABEL||' "'||COMMAND||'" '||ROUTE + COMMANDS='' + end + end +return + +WRITE_FILE: procedure expose script +parse arg FILE TAG +call SysFileDelete FILE +C_='' +do while pos(TAG,C_)=0 + C_=linein(script) end -else -do - rc=lineout(lyxrc_defaults,'\print_spool_command ""') - rc=lineout(lyxrc_defaults,'\print_spool_printerprefix ""') +C_=linein(script) +do while pos('EOF',C_)=0 + call lineout FILE,C_ + C_=linein(script) end -rc=lineout(lyxrc_defaults,'\font_encoding "'rc_fontenc'"') -rc=lineout(lyxrc_defaults) +call lineout FILE +/*call lineout script*/ +return