2 dnl Use 'make' to create configure from this m4 script.
3 # This script is a hand-made configure script. It contains a lot of
4 # code stolen from GNU autoconf. I removed all the code that was not
5 # useful for configuring a LyX installation.
8 dnl ######### Begin M4 macros #########################################
9 dnl This is a template for my stripped-down configure script.
10 dnl First, a few convenient macros.
14 dnl MSG_CHECKING(FEATURE-DESCRIPTION,PREFIX)
17 [echo $ac_n "$2checking $1""... $ac_c"])dnl
20 dnl MSG_RESULT(RESULT-DESCRIPTION)
23 [echo "$ac_t""$1"])dnl
26 dnl SEARCH_PROG(FEATURE-DESCRIPTION,VARIABLE-NAME,PROGRAMS-LIST,
27 dnl ACTION-IF-FOUND,ACTION-IF-NOT-FOUND)
29 define(SEARCH_PROG,[dnl
36 # Extract the first word of "$ac_prog", so it can be a program name with args.
37 set dummy $ac_prog ; ac_word=$[2]
38 if test -n "$ac_word"; then
39 MSG_CHECKING([for \"$ac_word\"],[+])
40 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
41 for ac_dir in $PATH; do
42 test -z "$ac_dir" && ac_dir=.
43 if test -x [$ac_dir/$ac_word]; then
50 if test -n "[$]$2"; then
56 MSG_RESULT($ac_result)
57 test -n "[$]$2" && break
61 if test -z "[$]$2" ; then
70 dnl LYXRC_VAR(VARIABLE_NAME, VALUE)
72 rc_entries="$rc_entries
76 dnl LYXRC_PROG(FEATURE-DESCRIPTION,VARIABLE-NAME,PROGRAMS-LIST,
77 dnl ACTION-IF-FOUND,ACTION-IF-NOT-FOUND)
78 define(LYXRC_PROG,[dnl
79 SEARCH_PROG($1,prog,$3,$4,$5)
83 dnl PROVIDE_DEFAULT_FILE(FILE, DEFAULT-VALUE)
85 define(PROVIDE_DEFAULT_FILE,[dnl
86 # if $1 does not exist (because LaTeX did not run),
87 # then provide a standard version.
88 if test ! -f $1 ; then
94 dnl ######### End M4 macros #############################################
97 # Be Bourne compatible (taken from autoconf 2.53)
98 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
101 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
107 ####some configuration variables
108 outfile=lyxrc.defaults
115 #### Parse the command line
120 Usage: configure [options]
122 --help show this help lines
123 --keep-temps keep temporary files (for debug. purposes)
124 --without-latex-config do not run LaTeX to determine configuration
125 --with-version-suffix=suffix suffix of binary installed files
128 --without-latex-config)
129 lyx_check_config=no ;;
131 lyx_keep_temps=yes ;;
132 --with-version-suffix*)
133 version_suffix=`echo "$ac_option" | sed 's,--with-version-suffix=,,'`
138 #### Checking for some echo oddities
139 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
140 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
141 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
148 ac_n= ac_c='\c' ac_t=
152 #### I do not really know why this is useful, but we might as well keep it.
154 # Only set these to C if already set. These must not be set unconditionally
155 # because not all systems understand e.g. LANG=C (notably SCO).
156 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
157 # Non-C LC_CTYPE values break the ctype check.
158 if test "${LANG+set}" = set; then LANG=C; export LANG; fi
159 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
160 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
161 if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
164 #### Guess the directory in which configure is located.
168 srcdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
169 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
170 test "x${srcdir}" = "x$ac_prog" && srcdir=.
171 if test ! -r "${srcdir}"/chkconfig.ltx ; then
172 echo "configure: error: cannot find chkconfig.ltx script"
176 #### Adjust PATH for Win32 (Cygwin)
179 tmpfname="/tmp/x$$.ltx";
180 echo "\\documentstyle{article}" > $tmpfname
181 echo "\\begin{document}\\end{document}" >> $tmpfname
182 inpname=`cygpath -w $tmpfname | tr '\\\\' /`
183 echo "\\input{$inpname}" > wrap_temp$$.ltx
184 check_err=`latex wrap_temp$$.ltx 2>&1 < /dev/null | grep Error`
185 rm -f wrap_temp$$.* /tmp/x$$.*
186 if [ x"$check_err" = "x" ]
188 echo "configure: cygwin detected; path correction"
189 srcdir=`cygpath -w "${srcdir}" | tr '\\\\' /`
190 echo "srcdir=${srcdir}"
192 echo "configure: cygwin detected; path correction is not needed"
197 #### Create the build directories if necessary
198 for dir in bind clipart doc examples help images kbd layouts reLyX \
199 scripts templates ui xfonts; do
200 test ! -d $dir && mkdir $dir
204 #### Searching some useful programs
205 define(CHECKLATEX2E,[
206 ## Check whether this is really LaTeX2e
208 cat >chklatex.ltx <<EOF
209 \\nonstopmode\\makeatletter
210 \\ifx\\undefined\\documentclass\\else
211 \\message{ThisIsLaTeX2e}
215 if eval ${LATEX} chklatex.ltx </dev/null 2>/dev/null \
216 | grep 'ThisIsLaTeX2e' >/dev/null; then
220 ac_result="not useable"
222 rm -f chklatex.ltx chklatex.log])dnl
225 SEARCH_PROG([for a LaTeX2e program],LATEX,pplatex latex2e latex,CHECKLATEX2E,dnl
226 [lyx_check_config=no])
228 test -z "$latex_to_dvi" && latex_to_dvi="none"
230 # Search for pdflatex
231 if test ${lyx_check_config} = no ; then
234 SEARCH_PROG([for the pdflatex program],latex_to_pdf,pdflatex)
237 test $latex_to_dvi != "none" && latex_to_dvi="$latex_to_dvi \$\$i"
238 test $latex_to_pdf != "none" && latex_to_pdf="$latex_to_pdf \$\$i"
240 SEARCH_PROG([for a TGIF viewer and editor], TGIF_EDITOR, tgif)
241 TGIF_VIEWER="$TGIF_EDITOR"
243 SEARCH_PROG([for a FIG viewer and editor], FIG_EDITOR, xfig)
244 FIG_VIEWER="$FIG_EDITOR"
246 SEARCH_PROG([for a GRACE viewer and editor], GRACE_EDITOR, xmgrace)
247 GRACE_VIEWER="$GRACE_EDITOR"
249 SEARCH_PROG([for a FEN viewer and editor], FEN_EDITOR, xboard)
250 test "$FEN" = "xboard" && FEN_EDITOR="xboard -lpf \$\$i -mode EditPosition"
251 FEN_VIEWER="$FEN_EDITOR"
253 SEARCH_PROG([for a raster image viewer], RASTERIMAGE_VIEWER, xv kview gimp)
255 SEARCH_PROG([for a raster image editor], RASTERIMAGE_EDITOR, gimp)
257 SEARCH_PROG([for a text editor], TEXT_EDITOR, xemacs gvim kedit kwrite kate nedit gedit)
259 # Search for an installed reLyX or a ready-to-install one
261 PATH=${PATH}:./reLyX/
262 SEARCH_PROG([for a LaTeX -> LyX converter],tex_to_lyx_command,reLyX)
264 test $tex_to_lyx_command = "reLyX" && tex_to_lyx_command="reLyX -f \$\$i"
265 tex_to_lyx_command=`echo $tex_to_lyx_command | sed "s,reLyX,reLyX$version_suffix,"`
267 SEARCH_PROG([for a Noweb -> LyX converter],literate_to_lyx_command,noweb2lyx)
268 test $literate_to_lyx_command = "noweb2lyx" && literate_to_lyx_command="noweb2lyx \$\$i \$\$o"
269 literate_to_lyx_command=`echo $literate_to_lyx_command | sed "s,noweb2lyx,noweb2lyx$version_suffix,"`
271 # Search something to process a literate document
272 SEARCH_PROG([for a Noweb -> LaTeX converter],literate_to_tex_command,noweave)
273 test $literate_to_tex_command = "noweave" && literate_to_tex_command="noweave -delay -index \$\$i > \$\$o"
275 SEARCH_PROG([for a HTML -> Latex converter],html_to_latex_command,html2latex)
276 test $html_to_latex_command = "html2latex" && html_to_latex_command="html2latex \$\$i"
278 SEARCH_PROG([for a MSWord -> Latex converter],word_to_latex_command,wvCleanLatex word2x)
279 test "$word_to_latex_command" = "wvCleanLatex" && word_to_latex_command="wvCleanLatex \$\$i \$\$o"
280 test "$word_to_latex_command" = "word2x" && word_to_latex_command="word2x -f latex \$\$i"
282 SEARCH_PROG([for Image converter],image_command,convert)
283 test $image_command = "convert" && image_command="convert \$\$i \$\$o"
285 SEARCH_PROG([for an OpenOffice.org -> Latex converter],sxw_to_latex_command,w2l)
286 test "$sxw_to_latex_command" = "w2l" && sxw_to_latex_command="w2l -clean \$\$i"
288 # oolatex is the original name, SuSE has oolatex.sh
289 SEARCH_PROG([for an Latex -> OpenOffice.org converter],latex_to_sxw_command,oolatex oolatex.sh)
290 test "$latex_to_sxw_command" != "none" && latex_to_sxw_command="$latex_to_sxw_command \$\$i"
292 # Search something to preview postscript
293 SEARCH_PROG([for a Postscript previewer],GHOSTVIEW,gsview32 gv ghostview kghostview)
295 gv|ghostview) PS_VIEWER="$GHOSTVIEW -swap" ;;
296 *) PS_VIEWER="$GHOSTVIEW";;
298 EPS_VIEWER=$GHOSTVIEW
300 # Search for a program to preview pdf
301 SEARCH_PROG([for a PDF preview],PDF_VIEWER, acrobat acrord32 gsview32 acroread gv ghostview xpdf kpdf kghostview)
303 # Search something to preview dvi
304 SEARCH_PROG([for a DVI previewer],DVI_VIEWER, xdvi windvi yap kdvi)
306 # Search something to preview html
307 SEARCH_PROG([for a HTML previewer],HTML_VIEWER, "mozilla file://\$\$p\$\$i" netscape)
309 # Search for a program to convert ps to pdf
310 SEARCH_PROG([for a PS to PDF converter],ps_to_pdf_command,ps2pdf)
311 test $ps_to_pdf_command = "ps2pdf" && ps_to_pdf_command="ps2pdf -dCompatibilityLevel=1.3 \$\$i"
313 # Search for a program to convert dvi to ps
314 SEARCH_PROG([for a DVI to PS converter],dvi_to_ps_command,dvips)
315 test $dvi_to_ps_command = "dvips" && dvi_to_ps_command="dvips -o \$\$o \$\$i"
317 # Search for a program to convert dvi to pdf
318 SEARCH_PROG([for a DVI to PDF converter],dvi_to_pdf_command,dvipdfm)
319 test $dvi_to_pdf_command = "dvipdfm" && dvi_to_pdf_command="dvipdfm \$\$i"
321 # We have a script to convert previewlyx to ppm or to png
322 lyxpreview_to_bitmap_command='python $$s/lyxpreview2bitmap.py'
324 # Search for 'dvipng'. Only enable the conversion from lyxpreview -> png
325 # if dvipng is found.
326 SEARCH_PROG([for dvipng],DVIPNG,dvipng)
328 test "$DVIPNG" = "dvipng" && \
329 lyxpreview_to_png_command=$lyxpreview_to_bitmap_command
331 # Search a *roff program (used to translate tables in ASCII export)
332 LYXRC_PROG([for a *roff formatter], \ascii_roff_command, dnl
333 'groff -t -Tlatin1 $$FName' nroff,dnl
334 test "$prog" = "nroff" && prog='tbl $$FName | nroff')
336 # Search the ChkTeX program
337 LYXRC_PROG([for ChkTeX], \chktex_command,dnl
338 "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38")
340 # Search for a spellchecker
341 LYXRC_PROG([for a spell-checker], \spell_command, ispell)
343 # Search for computer algebra systems
344 SEARCH_PROG([for Octave],OCTAVE,octave)
345 SEARCH_PROG([for Maple],MAPLE,maple)
347 dnl # Search a Fax handling program
348 dnl SEARCH_PROG([for a fax driver], FAX, sendfax faxsend fax)
349 dnl if test $FAX = sendfax ; then
350 dnl fax_command="sendfax -n -h '\$\$Host' -c '\$\$Comment' -x '\$\$Enterprise' -d '\$\$Name'@'\$\$Phone' '\$\$FName'"
351 dnl elif test $FAX = faxsend ; then
352 dnl fax_command="faxsend '\$\$Phone' '\$\$FName'"
353 dnl elif test $FAX = fax ; then
354 dnl fax_command="fax send '\$\$Phone' '\$\$FName'"
356 dnl fax_command="none"
359 # Search a GUI Fax program
360 SEARCH_PROG([for a fax program], fax_command, kdeprintfax ksendfax)
361 test $fax_command != "none" && fax_command="$fax_command \$\$i"
363 # Search for LinuxDoc support
364 SEARCH_PROG([for SGML-tools 1.x (LinuxDoc)], LINUXDOC, sgml2lyx)
365 if test $LINUXDOC != none; then
368 linuxdoc_cmd="\\def\\haslinuxdoc{yes}"
376 linuxdoc_to_latex_command="sgml2latex \$\$i"
377 linuxdoc_to_dvi_command="sgml2latex -o dvi \$\$i"
378 linuxdoc_to_html_command="sgml2html \$\$i"
379 linuxdoc_to_lyx_command="sgml2lyx \$\$i";;
381 linuxdoc_to_latex_command="none"
382 linuxdoc_to_dvi_command="none"
383 linuxdoc_to_html_command="none"
384 linuxdoc_to_lyx_command="none";;
387 # Search for DocBook support
388 SEARCH_PROG([for SGML-tools 2.x (DocBook) or db2x scripts], DOCBOOK, sgmltools db2dvi)
389 if test $DOCBOOK != none; then
392 docbook_cmd="\\def\\hasdocbook{yes}"
400 docbook_to_dvi_command="sgmltools -b dvi \$\$i"
401 docbook_to_html_command="sgmltools -b html \$\$i";;
403 docbook_to_dvi_command="db2dvi \$\$i"
404 docbook_to_html_command="db2html \$\$i";;
406 docbook_to_dvi_command="none"
407 docbook_to_html_command="none";;
410 # Search for a spool command
411 LYXRC_PROG([for a spool command], \print_spool_command, lp lpr)
413 lp) print_spool_printerprefix="-d ";;
414 lpr) print_spool_printerprefix="-P";;
415 *) :;; # leave to empty values
417 LYXRC_VAR(\print_spool_printerprefix, $print_spool_printerprefix)
419 SEARCH_PROG([for a LaTeX -> HTML converter], TOHTML, tth latex2html hevea)
420 latex_to_html_command=$TOHTML
422 tth) latex_to_html_command="tth -t -e2 -L\$\$b < \$\$i > \$\$o";;
423 latex2html) latex_to_html_command="latex2html -no_subdir -split 0 -show_section_numbers \$\$i";;
424 hevea) latex_to_html_command="hevea -s \$\$i";;
427 #### Explore the LaTeX configuration
428 MSG_CHECKING(LaTeX configuration)
429 # First, remove the files that we want to re-create
430 rm -f textclass.lst packages.lst chkconfig.sed
431 if test ${lyx_check_config} = no ; then
432 MSG_RESULT(default values)
433 MSG_CHECKING(list of textclasses,+)
434 cat >textclass.lst <<EOF
435 # This file declares layouts and their associated definition files
436 # (include dir. relative to the place where this file is).
437 # It contains only default values, since chkconfig.ltx could not be run
438 # for some reason. Run ./configure if you need to update it after a
439 # configuration change.
441 # build the list of available layout files and convert it to entries
442 # for the default textclass.lst file
443 for file in ./layouts/*.layout "${srcdir}"/layouts/*.layout ; do
446 *) if test -r "$file" ; then
447 class=`echo $file | sed -e 's%^.*layouts/\(.*\)\.layout$%\1%'`
448 cleanclass=`echo $class | tr ' -' '__'`
450 # make sure the same class is not considered twice
451 if test x`[eval] echo $ac_n '${found_'$cleanclass'}'` = x ; then
452 [eval] "found_$cleanclass=yes"
454 # The sed commands below are a bit scary. Here is what they do:
455 # 1-3: remove the \DeclareFOO macro and add the correct boolean
456 # at the end of the line telling whether the class is
458 # 4: if the macro had an optional argument with several
459 # parameters, only keep the first one
460 # 5: if the macro did not have an optional argument, provide one
461 # (equal to the class name)
462 # 6: remove brackets and replace with correctly quoted entries
463 grep '\\Declare\(LaTeX\|DocBook\|LinuxDoc\)Class' "$file" \
464 | sed -e 's/^.*\DeclareLaTeXClass *\(.*\)/\1 "false"/' \
465 -e 's/^.*\DeclareDocBookClass *\(.*\)/\1 "'$bool_docbook'"/' \
466 -e 's/^.*\DeclareLinuxDocClass *\(.*\)/\1 "'$bool_linuxdoc'"/' \
467 -e 's/\[\([^,]*\),[^]]*\]/[\1]/' \
468 -e 's/^{/['$class']{/' \
469 -e 's/\[\([^]]*\)\] *{\([^}]*\)}/"'$class'" "\1" "\2"/' \
478 rm -f wrap_chkconfig.ltx chkconfig.vars chkconfig.classes chklayouts.tex
479 if ! test -r "chkconfig.ltx" ; then
480 ln -s "${srcdir}"/chkconfig.ltx .
483 cat >wrap_chkconfig.ltx <<EOF
486 \\input{chkconfig.ltx}
488 ## Construct the list of classes to test for.
489 # build the list of available layout files and convert it to commands
491 for file in ./layouts/*.layout "${srcdir}"/layouts/*.layout ; do
494 *) if test -r "$file" ; then
495 class=`echo $file | sed -e 's%^.*layouts/\(.*\)\.layout$%\1%'`
496 # Generate the proper TestDocClass command for this layout
497 grep '\\Declare\(LaTeX\|DocBook\|LinuxDoc\)Class' "$file" \
498 | sed -e 's/^\# *\(.*\)$/\\TestDocClass{'${class}'}{\1}/'
501 done > chklayouts.tex
503 [eval] ${LATEX} wrap_chkconfig.ltx 2>/dev/null | grep '^\+'
504 [eval] `cat chkconfig.vars | sed 's/-/_/g'`
506 test -n "${rmlink}" && rm -f chkconfig.ltx
509 # Do we have all the files we need? Useful if latex did not run
512 PROVIDE_DEFAULT_FILE(chkconfig.sed,[s/@.*@/???/g])
514 echo "creating packages.lst"
515 PROVIDE_DEFAULT_FILE(packages.lst,dnl
516 [# This file should contain the list of LaTeX packages that have been
517 # recognized by LyX. Unfortunately, since configure could not find
518 # your LaTeX2e program, the tests have not been run. Run ./configure
519 # if you need to update it after a configuration change.
523 echo "creating doc/LaTeXConfig.lyx"
524 echo "s/@chk_linuxdoc@/$chk_linuxdoc/g" >> chkconfig.sed
525 echo "s/@chk_docbook@/$chk_docbook/g" >> chkconfig.sed
526 sed -f chkconfig.sed "${srcdir}"/doc/LaTeXConfig.lyx.in >doc/LaTeXConfig.lyx
528 echo "creating $outfile"
530 # This file has been automatically generated by LyX' lib/configure
531 # script. It contains default settings that have been determined by
532 # examining your system. PLEASE DO NOT MODIFY ANYTHING HERE! If you
533 # want to customize LyX, make a copy of the file LYXDIR/lyxrc as
534 # ~/.lyx/lyxrc and edit this file instead. Any setting in lyxrc will
535 # override the values given here.
536 \\Format asciichess asc "ASCII (chess output)" "" "" "$TEXT_EDITOR"
537 \\Format asciiimage asc "ASCII (image)" "" "" "$TEXT_EDITOR"
538 \\Format asciixfig asc "ASCII (xfig output)" "" "" "$TEXT_EDITOR"
539 \\Format agr agr GRACE "" "$GRACE_VIEWER" "$GRACE_EDITOR"
540 \\Format bmp bmp BMP "" "$RASTERIMAGE_VIEWER" "$RASTERIMAGE_EDITOR"
541 \\Format date "" "date command" "" "" ""
542 \\Format dateout tmp "date (output)" "" "" "$TEXT_EDITOR"
543 \\Format docbook sgml DocBook B "" "$TEXT_EDITOR"
544 \\Format docbook-xml xml "Docbook (xml)" "" "" "$TEXT_EDITOR"
545 \\Format dvi dvi DVI D "$DVI_VIEWER" ""
546 \\Format eps eps EPS "" "$EPS_VIEWER" ""
547 \\Format fax "" Fax "" "" ""
548 \\Format fen fen FEN "" "$FEN_VIEWER" "$FEN_EDITOR"
549 \\Format fig fig XFig "" "$FIG_VIEWER" "$FIG_EDITOR"
550 \\Format gif gif GIF "" "$RASTERIMAGE_VIEWER" "$RASTERIMAGE_EDITOR"
551 \\Format html html HTML H "$HTML_VIEWER" ""
552 \\Format jpg jpg JPG "" "$RASTERIMAGE_VIEWER" "$RASTERIMAGE_EDITOR"
553 \\Format latex tex LaTeX L "" "$TEXT_EDITOR"
554 \\Format linuxdoc sgml LinuxDoc x "" "$TEXT_EDITOR"
555 \\Format lyx lyx LyX "" "lyx" "lyx"
556 \\Format lyxpreview lyxpreview "LyX Preview" "" "" ""
557 \\Format literate nw NoWeb N "" "$TEXT_EDITOR"
558 \\Format pbm pbm PBM "" "$RASTERIMAGE_VIEWER" "$RASTERIMAGE_EDITOR"
559 \\Format pdf pdf "PDF (ps2pdf)" P "$PDF_VIEWER" ""
560 \\Format pdf2 pdf "PDF (pdflatex)" F "$PDF_VIEWER" ""
561 \\Format pdf3 pdf "PDF (dvipdfm)" m "$PDF_VIEWER" ""
562 \\Format pdftex pdftex_t PDFTEX "" "" ""
563 \\Format pgm pgm PGM "" "$RASTERIMAGE_VIEWER" "$RASTERIMAGE_EDITOR"
564 \\Format png png PNG "" "$RASTERIMAGE_VIEWER" "$RASTERIMAGE_EDITOR"
565 \\Format ppm ppm PPM "" "$RASTERIMAGE_VIEWER" "$RASTERIMAGE_EDITOR"
566 \\Format program "" Program "" "" ""
567 \\Format ps ps Postscript t "$PS_VIEWER" ""
568 \\Format pstex pstex_t PSTEX "" "" ""
569 \\Format tgif obj TGIF "" "$TGIF_VIEWER" "$TGIF_EDITOR"
570 \\Format sxw sxw "OpenOffice.Org Writer" O "" ""
571 \\Format text txt ASCII A "" "$TEXT_EDITOR"
572 \\Format textparagraph txt "ASCII (paragraphs)" "" "" "$TEXT_EDITOR"
573 \\Format tiff tif TIFF "" "$RASTERIMAGE_VIEWER" "$RASTERIMAGE_EDITOR"
574 \\Format word doc Word W "" ""
575 \\Format xbm xbm XBM "" "$RASTERIMAGE_VIEWER" "$RASTERIMAGE_EDITOR"
576 \\Format xpm xpm XPM "" "$RASTERIMAGE_VIEWER" "$RASTERIMAGE_EDITOR"
578 \\converter date dateout "date +%d-%m-%Y > \$\$o" ""
579 \\converter docbook docbook-xml "cp \$\$i \$\$o" "xml"
580 \\converter docbook dvi "$docbook_to_dvi_command" ""
581 \\converter docbook html "$docbook_to_html_command" ""
582 \\converter dvi pdf3 "$dvi_to_pdf_command" ""
583 \\converter dvi ps "$dvi_to_ps_command" ""
584 \\converter fen asciichess "python \$\$s/fen2ascii.py \$\$i \$\$o" ""
585 \\converter fig pdftex "sh \$\$s/fig2pdftex.sh \$\$i \$\$o" ""
586 \\converter fig pstex "sh \$\$s/fig2pstex.sh \$\$i \$\$o" ""
587 \\converter html latex "$html_to_latex_command" ""
588 \\converter latex html "$latex_to_html_command" "originaldir,needaux"
589 \\converter latex dvi "$latex_to_dvi" "latex"
590 \\converter latex lyx "$tex_to_lyx_command" ""
591 \\converter latex pdf2 "$latex_to_pdf" "latex"
592 \\converter latex sxw "$latex_to_sxw_command" "latex"
593 \\converter linuxdoc dvi "$linuxdoc_to_dvi_command" ""
594 \\converter linuxdoc html "$linuxdoc_to_html_command" ""
595 \\converter linuxdoc latex "$linuxdoc_to_latex_command" ""
596 \\converter linuxdoc lyx "$linuxdoc_to_lyx_command" ""
597 \\converter literate latex "$literate_to_tex_command" ""
598 \\converter literate lyx "$literate_to_lyx_command" ""
599 \\converter lyxpreview png "$lyxpreview_to_png_command" ""
600 \\converter lyxpreview ppm "$lyxpreview_to_bitmap_command" ""
601 \\converter ps fax "$fax_command" ""
602 \\converter ps pdf "$ps_to_pdf_command" ""
603 \\converter sxw latex "$sxw_to_latex_command" ""
604 \\converter word latex "$word_to_latex_command" ""
607 ### the graphic converter part with the predefined ones
608 #### Search for the nonstandard converting progs
610 SEARCH_PROG([for an FIG -> EPS/PPM converter], FIG2DEV, fig2dev)
611 if test "$FIG2DEV" = "fig2dev"; then
613 \\converter fig eps "fig2dev -L eps \$\$i \$\$o" ""
614 \\converter fig ppm "fig2dev -L ppm \$\$i \$\$o" ""
615 \\converter fig png "fig2dev -L png \$\$i \$\$o" ""
619 SEARCH_PROG([for an TIFF -> PS converter], TIFF2PS, tiff2ps)
620 if test "$TIFF2PS" = "tiff2ps"; then
622 \\converter tiff eps "tiff2ps \$\$i > \$\$o" ""
626 SEARCH_PROG([for an TGIF -> EPS/PPM converter], TGIF, tgif)
627 if test "$TGIF" = "tgif"; then
629 \\converter tgif eps "tgif -stdout -print -color -eps \$\$i > \$\$o" ""
630 \\converter tgif pdf "tgif -stdout -print -color -pdf \$\$i > \$\$o" ""
634 SEARCH_PROG([for an EPS -> PDF converter], EPSTOPDF, epstopdf)
635 if test "$EPSTOPDF" = "epstopdf"; then
637 \\converter eps pdf "epstopdf --outfile=\$\$o \$\$i" ""
641 #### Add Grace conversions (xmgrace needs an Xserver, gracebat doesn't.)
642 SEARCH_PROG([for a Grace -> Image converter], GRACE, gracebat)
643 if test "$GRACE" = "gracebat"; then
645 \\converter agr eps "gracebat -hardcopy -printfile \$\$o -hdevice EPS \$\$i 2>/dev/null" ""
646 \\converter agr png "gracebat -hardcopy -printfile \$\$o -hdevice PNG \$\$i 2>/dev/null" ""
647 \\converter agr jpg "gracebat -hardcopy -printfile \$\$o -hdevice JPEG \$\$i 2>/dev/null" ""
648 \\converter agr ppm "gracebat -hardcopy -printfile \$\$o -hdevice PNM \$\$i 2>/dev/null" ""
654 \\copier fig "sh \$\$s/fig_copy.sh \$\$i \$\$o"
655 \\copier pstex "python \$\$s/tex_copy.py \$\$i \$\$o \$\$l"
656 \\copier pdftex "python \$\$s/tex_copy.py \$\$i \$\$o \$\$l"
659 \\font_encoding "$chk_fontenc"
663 # create a fonts.dir file to make X fonts available to LyX
664 echo "checking for TeX fonts"
666 fontlist="cmex10 cmmi10 cmr10 cmsy10 eufm10 msam10 msbm10 wasy10"
667 rm -f xfonts/fonts.dir xfonts/fonts.scale xfonts/tmpfonts
670 touch xfonts/tmpfonts
671 for font in $fontlist ; do
672 MSG_CHECKING(for $font,+)
674 for ext in pfb pfa ttf ; do
675 if filepath=`kpsewhich $font.$ext` ; then
677 rm -f xfonts/$font.$ext
678 ln -s $filepath xfonts 2>/dev/null
679 echo "$font.$ext -unknown-$font-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific" >>xfonts/tmpfonts
687 if test ! $num = 0 ; then
688 echo $num >xfonts/fonts.scale
689 cat xfonts/tmpfonts >>xfonts/fonts.scale
690 cp xfonts/fonts.scale xfonts/fonts.dir
691 # create a resource list file for Display Postscript
692 (cd xfonts ; rm -f PSres.upr ; makepsres) 2>/dev/null || true
694 rm -f xfonts/tmpfonts
697 # Remove superfluous files if we are not writing in the main lib
699 for file in $outfile textclass.lst packages.lst \
700 doc/LaTeXConfig.lyx xfonts/fonts.dir ; do
701 # we rename the file first, so that we avoid comparing a file with itself
703 if test -r "${srcdir}"/$file && diff $file.new "${srcdir}"/$file >/dev/null 2>/dev/null ;
705 echo "removing $file, which is identical to the system global version"
711 if test ! -r xfonts/fonts.dir ; then
712 echo "removing font links"
713 rm -f xfonts/*.pfb xfonts/fonts.scale
717 if test $lyx_keep_temps = no ; then
718 rm -f chkconfig.sed chkconfig.vars wrap_chkconfig.* chklayouts.tex \