]> git.lyx.org Git - lyx.git/blob - lib/configure.m4
df123826d959c72ef6ddeea316703884527b230f
[lyx.git] / lib / configure.m4
1 #! /bin/sh
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.
6
7
8 dnl ######### Begin M4 macros #########################################
9 dnl This is a template for my stripped-down configure script.
10 dnl First, a few convenient macros.
11 changequote([,])dnl
12 dnl
13 dnl
14 dnl MSG_CHECKING(FEATURE-DESCRIPTION,PREFIX)
15 dnl
16 define(MSG_CHECKING,
17 [echo $ac_n "$2checking $1""... $ac_c"])dnl
18 dnl
19 dnl
20 dnl MSG_RESULT(RESULT-DESCRIPTION)
21 dnl
22 define(MSG_RESULT,
23 [echo "$ac_t""$1"])dnl
24 dnl
25 dnl
26 dnl SEARCH_PROG(FEATURE-DESCRIPTION,VARIABLE-NAME,PROGRAMS-LIST,
27 dnl             ACTION-IF-FOUND,ACTION-IF-NOT-FOUND)
28 dnl
29 define(SEARCH_PROG,[dnl
30 changequote([,])dnl
31 MSG_CHECKING($1)
32 MSG_RESULT(($3))
33 $2=
34 for ac_prog in $3
35 do
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
44       $2="$ac_prog"
45       break
46     fi
47   done
48   IFS="$ac_save_ifs"
49
50   if test -n "[$]$2"; then
51     ac_result=yes
52     ifelse($4,,,[$4])
53   else
54     ac_result=no
55   fi
56   MSG_RESULT($ac_result)
57   test -n "[$]$2" && break
58 fi
59 done
60
61 if test -z "[$]$2" ; then
62   $2=none
63 ifelse($5,,,[  $5
64 ])dnl
65 fi
66 changequote(,)dnl
67 ])dnl
68 dnl
69 dnl
70 dnl LYXRC_VAR(VARIABLE_NAME, VALUE)
71 define(LYXRC_VAR,[dnl
72 rc_entries="$rc_entries
73 $1 \"$2\""])
74 dnl
75 dnl
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)
80 LYXRC_VAR($2,$prog)])
81 dnl
82 dnl
83 dnl PROVIDE_DEFAULT_FILE(FILE, DEFAULT-VALUE)
84 dnl
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
89   cat >$1 <<EOF
90 $2
91 EOF
92 fi])
93 changequote(,)dnl
94 dnl ######### End M4 macros #############################################
95
96
97 ####some configuration variables
98 outfile=lyxrc.defaults
99 rc_entries=
100 lyx_check_config=yes
101 lyx_keep_temps=no
102 srcdir=
103 version_suffix=
104
105 #### Parse the command line
106 for ac_option do
107   case "$ac_option" in
108     -help | --help | -h)
109       cat << EOF
110 Usage: configure [options]
111 Options:
112   --help                   show this help lines
113   --keep-temps             keep temporary files (for debug. purposes)
114   --without-latex-config   do not run LaTeX to determine configuration
115   --with-version-suffix=suffix suffix of binary installed files
116 EOF
117       exit 0;;
118     --without-latex-config)
119       lyx_check_config=no ;;
120     --keep-temps)
121       lyx_keep_temps=yes ;;
122     --with-version-suffix*)
123       version_suffix=`echo "$ac_option" | sed 's,--with-version-suffix=,,'`
124   esac
125 done
126
127
128 #### Checking for some echo oddities
129 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
130   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
131   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
132     ac_n= ac_c='
133 ' ac_t='        '
134   else
135     ac_n=-n ac_c= ac_t=
136   fi
137 else
138   ac_n= ac_c='\c' ac_t=
139 fi
140
141
142 #### I do not really know why this is useful, but we might as well keep it.
143 # NLS nuisances.
144 # Only set these to C if already set.  These must not be set unconditionally
145 # because not all systems understand e.g. LANG=C (notably SCO).
146 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
147 # Non-C LC_CTYPE values break the ctype check.
148 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
149 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
150 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
151 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
152
153
154 #### Guess the directory in which configure is located.
155 changequote([,])dnl
156 ac_prog=[$]0
157 changequote(,)dnl
158 srcdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
159 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
160 test "x$srcdir" = "x$ac_prog" && srcdir=.
161 if test ! -r ${srcdir}/chkconfig.ltx ; then
162   echo "configure: error: cannot find chkconfig.ltx script"
163   exit 1
164 fi
165
166 #### Adjust PATH for Win32 (Cygwin)
167 if test "x$OSTYPE" = xcygwin; then
168   echo "configure: cygwin detected; path correction"
169   srcdir=`cygpath -w "${srcdir}" | tr '\\\\' /`
170   echo "srcdir=${srcdir}"
171 fi
172
173 #### Create the build directories if necessary
174 for dir in bind clipart doc examples help images kbd layouts reLyX \
175     scripts templates ui xfonts; do
176   test ! -d $dir && mkdir $dir
177 done
178
179
180 #### Searching some useful programs
181 define(CHECKLATEX2E,[
182 ## Check whether this is really LaTeX2e
183 rm -f chklatex.ltx
184 cat >chklatex.ltx <<EOF
185 \\nonstopmode\\makeatletter
186 \\ifx\\undefined\\documentclass\\else
187   \\message{ThisIsLaTeX2e}
188 \\fi
189 \\@@end
190 EOF
191 if eval ${LATEX} chklatex.ltx </dev/null 2>/dev/null \
192                        | grep 'ThisIsLaTeX2e' >/dev/null; then
193   :
194 else
195   LATEX=
196   ac_result="not useable"
197 fi
198 rm -f chklatex.ltx chklatex.log])dnl
199 dnl
200 # Search LaTeX2e
201 SEARCH_PROG([for a LaTeX2e program],LATEX,latex latex2e,CHECKLATEX2E,dnl
202   [lyx_check_config=no])
203 latex_to_dvi=$LATEX
204 test -z "$latex_to_dvi" && latex_to_dvi="none"
205
206 # Search for pdflatex
207 if test ${lyx_check_config} = no ; then
208   latex_to_pdf=none
209 else
210   SEARCH_PROG([for the pdflatex program],latex_to_pdf,pdflatex)
211 fi
212
213 test $latex_to_dvi != "none" && latex_to_dvi="$latex_to_dvi \$\$i"
214 test $latex_to_pdf != "none" && latex_to_pdf="$latex_to_pdf \$\$i"
215
216 # Search for an installed reLyX or a ready-to-install one
217 save_PATH=${PATH}
218 PATH=${PATH}:./reLyX/
219 SEARCH_PROG([for a LaTeX -> LyX converter],tex_to_lyx_command,reLyX)
220 PATH=${save_PATH}
221 test $tex_to_lyx_command = "reLyX" && tex_to_lyx_command="reLyX -f \$\$i"
222 tex_to_lyx_command=`echo $tex_to_lyx_command | sed "s,reLyX,reLyX$version_suffix,"`
223
224 SEARCH_PROG([for a Noweb -> LyX converter],literate_to_lyx_command,noweb2lyx)
225 test $literate_to_lyx_command = "noweb2lyx" && literate_to_lyx_command="noweb2lyx \$\$i \$\$o"
226 literate_to_lyx_command=`echo $literate_to_lyx_command | sed "s,noweb2lyx,noweb2lyx$version_suffix,"`
227
228 # Search something to process a literate document
229 SEARCH_PROG([for a Noweb -> LaTeX converter],literate_to_tex_command,noweave)
230 test $literate_to_tex_command = "noweave" && literate_to_tex_command="noweave -delay -index \$\$i > \$\$o"
231
232 SEARCH_PROG([for a HTML -> Latex converter],html_to_latex_command,html2latex)
233 test $html_to_latex_command = "html2latex" && html_to_latex_command="html2latex \$\$i"
234
235 SEARCH_PROG([for a MSWord -> Latex converter],word_to_latex_command,wvCleanLatex word2x)
236 test "$word_to_latex_command" = "wvCleanLatex" && word_to_latex_command="wvCleanLatex \$\$i \$\$o"
237 test "$word_to_latex_command" = "word2x" && word_to_latex_command="word2x -f latex \$\$i"
238
239 SEARCH_PROG([for Image converter],image_command,convert)
240 test $image_command = "convert" && image_command="convert \$\$i \$\$o"
241
242 # Search for a Postscript interpreter
243 LYXRC_PROG([for a Postscript interpreter], \ps_command, gs)
244
245 # Search something to preview postscript
246 SEARCH_PROG([for a Postscript previewer],GHOSTVIEW,gv ghostview)
247
248 # Search for a program to preview pdf
249 SEARCH_PROG([for a PDF preview],PDF_VIEWER,acroread gv ghostview xpdf)
250
251 # Search something to preview dvi
252 SEARCH_PROG([for a DVI previewer],DVI_VIEWER, xdvi windvi yap)
253
254 # Search something to preview html
255 SEARCH_PROG([for a HTML previewer],HTML_VIEWER, netscape)
256
257 # Search for a program to convert ps to pdf
258 SEARCH_PROG([for a PS to PDF converter],ps_to_pdf_command,ps2pdf)
259 test $ps_to_pdf_command = "ps2pdf" && ps_to_pdf_command="ps2pdf \$\$i"
260
261 # Search for a program to convert dvi to ps
262 SEARCH_PROG([for a DVI to PS converter],dvi_to_ps_command,dvips)
263 test $dvi_to_ps_command = "dvips" && dvi_to_ps_command="dvips -o \$\$o \$\$i"
264
265 # Search for a program to convert dvi to pdf
266 SEARCH_PROG([for a DVI to PDF converter],dvi_to_pdf_command,dvipdfm)
267 test $dvi_to_pdf_command = "dvipdfm" && dvi_to_pdf_command="dvipdfm \$\$i"
268
269 # Search a *roff program (used to translate tables in ASCII export)
270 LYXRC_PROG([for a *roff formatter], \ascii_roff_command, dnl
271   'groff -t -Tlatin1 $$FName' nroff,dnl
272   test "$prog" = "nroff" && prog='tbl $$FName | nroff')
273
274 # Search the ChkTeX program
275 LYXRC_PROG([for ChkTeX], \chktex_command,dnl
276    "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38")
277
278 # Search for a spellchecker
279 LYXRC_PROG([for a spell-checker], \spell_command, ispell)
280
281 dnl # Search a Fax handling program
282 dnl SEARCH_PROG([for a fax driver], FAX, sendfax faxsend fax)
283 dnl if test $FAX = sendfax ; then
284 dnl   fax_command="sendfax -n -h '\$\$Host' -c '\$\$Comment' -x '\$\$Enterprise' -d '\$\$Name'@'\$\$Phone' '\$\$FName'"
285 dnl elif test $FAX = faxsend ; then
286 dnl   fax_command="faxsend '\$\$Phone' '\$\$FName'"
287 dnl elif test $FAX = fax ; then
288 dnl   fax_command="fax send '\$\$Phone' '\$\$FName'"
289 dnl else
290 dnl   fax_command="none"
291 dnl fi
292
293 # Search a GUI Fax program
294 SEARCH_PROG([for a fax program], fax_command, ksendfax)
295 test $fax_command = "ksendfax" && fax_command="ksendfax \$\$i"
296
297 # Search for LinuxDoc support
298 SEARCH_PROG([for SGML-tools 1.x (LinuxDoc)], LINUXDOC, sgml2lyx)
299 chk_linuxdoc=no
300 if test $LINUXDOC != none; then
301   chk_linuxdoc=yes
302   linuxdoc_cmd="\\def\\haslinuxdoc{yes}"
303 fi
304
305 case $LINUXDOC in
306   sgml2lyx)
307     linuxdoc_to_latex_command="sgml2latex \$\$i"
308     linuxdoc_to_dvi_command="sgml2latex -o dvi \$\$i"
309     linuxdoc_to_html_command="sgml2html \$\$i"
310     linuxdoc_to_lyx_command="sgml2lyx \$\$i";;
311   none)
312     linuxdoc_to_latex_command="none"
313     linuxdoc_to_dvi_command="none"
314     linuxdoc_to_html_command="none"
315     linuxdoc_to_lyx_command="none";;
316 esac
317
318 # Search for DocBook support
319 SEARCH_PROG([for SGML-tools 2.x (DocBook) or db2x scripts], DOCBOOK, sgmltools db2dvi)
320 chk_docbook=no
321 if test $DOCBOOK != none; then
322   chk_docbook=yes
323   docbook_cmd="\\def\\hasdocbook{yes}"
324 fi
325
326 case $DOCBOOK in
327   sgmltools)
328     docbook_to_dvi_command="sgmltools -b dvi \$\$i"
329     docbook_to_html_command="sgmltools -b html \$\$i";;
330   db2dvi)
331     docbook_to_dvi_command="db2dvi \$\$i"
332     docbook_to_html_command="db2html \$\$i";;
333   none)
334     docbook_to_dvi_command="none"
335     docbook_to_html_command="none";;
336 esac
337
338 # Search for a spool command
339 LYXRC_PROG([for a spool command], \print_spool_command, lp lpr)
340 case $prog in
341   lp) print_spool_printerprefix="-d ";;
342  lpr) print_spool_printerprefix="-P";;
343    *) :;; # leave to empty values
344 esac
345 LYXRC_VAR(\print_spool_printerprefix, $print_spool_printerprefix)
346
347 SEARCH_PROG([for a LaTeX -> HTML converter], TOHTML, tth latex2html hevea)
348 latex_to_html_command=$TOHTML
349 case $TOHTML in
350         tth) latex_to_html_command="tth -t -e2 -L\$\$b < \$\$i > \$\$o";;
351  latex2html) latex_to_html_command="latex2html -no_subdir -split 0 -show_section_numbers \$\$i";;
352       hevea) latex_to_html_command="hevea -s \$\$i";;
353 esac
354
355 #### Search for image conversion ####
356 SEARCH_PROG([for an Image -> EPS converter], TOEPS, convert pnmtops)
357 case $TOEPS in
358   convert)
359     bmp_to_eps="convert BMP:\$\$i EPS:\$\$o"
360     fits_to_eps="convert FITS:\$\$i EPS:\$\$o"
361     gif_to_eps="convert GIF:\$\$i EPS:\$\$o"
362     jpg_to_eps="convert JPG:\$\$i EPS:\$\$o"
363     pbm_to_eps="convert PBM:\$\$i EPS:\$\$o"
364     pgm_to_eps="convert PGM:\$\$i EPS:\$\$o"
365     png_to_eps="convert PNG:\$\$i EPS:\$\$o"
366     ppm_to_eps="convert PPM:\$\$i EPS:\$\$o"
367     sgi_to_eps="convert SGI:\$\$i EPS:\$\$o"
368     xbm_to_eps="convert XBM:\$\$i EPS:\$\$o"
369     xwd_to_eps="convert XWD:\$\$i EPS:\$\$o"
370     xpm_to_eps="convert XPM:\$\$i EPS:\$\$o" ;;
371   pnmtops) gif_to_eps="giftopnm \$\$i | pnmtops > \$\$o"
372     png_to_eps="pngtopnm \$\$i | pnmtops >\$\$o"
373     jpg_to_eps="jpegtopnm \$\$i | pnmtops >\$\$o";;
374 esac
375
376 SEARCH_PROG([for an Image -> PNG converter], TOPNG, convert pnmtopng)
377 case $TOPNG in
378   convert)
379     gif_to_png="convert GIF:\$\$i PNG:\$\$o"
380     eps_to_png="convert EPS:\$\$i PNG:\$\$o"
381     jpg_to_png="convert JPG:\$\$i PNG:\$\$o";;
382   pnmtopng)
383     gif_to_png="giftopnm \$\$i | pnmtopng >\$\$o"
384     eps_to_png="pstopnm \$\$i| pnmtopng >\$\$o"
385     jpg_to_png="jpegtopnm \$\$i | pnmtopng >\$\$o";;
386 esac
387
388 SEARCH_PROG([for an Image -> XPM converter], TOXPM, convert)
389 if test "$TOXPM" = "convert"; then
390   gif_to_xpm="convert GIF:\$\$i XPM:\$\$o"
391   eps_to_xpm="convert EPS:\$\$i XPM:\$\$o"
392   jpg_to_xpm="convert JPG:\$\$i XPM:\$\$o"
393   png_to_xpm="convert PNG:\$\$i XPM:\$\$o"
394   ps_to_xpm="convert PS:\$\$i XPM:\$\$o"
395   xbm_to_xpm="convert XBM:\$\$i XPM:\$\$o"
396 fi
397
398 SEARCH_PROG([for an EPS -> PDF converter], EPSTOPDF, epstopdf)
399 case $EPSTOPDF in
400   epstopdf) eps_to_pdf="epstopdf --outfile=\$\$o \$\$i";;
401 esac
402
403 #### Add Grace conversions (xmgrace needs an Xserver, gracebat doesn't.)
404 SEARCH_PROG([for a Grace -> Image converter], GRACE, gracebat)
405 case $GRACE in
406  gracebat) 
407    for device in `gracebat -version 2>/dev/null | grep "^Dummy"` ; do
408      case $device in
409        EPS) agr_to_eps="gracebat -hardcopy -printfile \$\$o -hdevice $device \$\$i 2>/dev/null";;
410        PDF) agr_to_pdf="gracebat -hardcopy -printfile \$\$o -hdevice $device \$\$i 2>/dev/null";;
411        PNG) agr_to_png="gracebat -hardcopy -printfile \$\$o -hdevice $device \$\$i 2>/dev/null";;
412      esac
413    done 
414 esac
415
416 #### Explore the LaTeX configuration
417 MSG_CHECKING(LaTeX configuration)
418 # First, remove the files that we want to re-create
419 rm -f textclass.lst packages.lst chkconfig.sed
420 if test ${lyx_check_config} = no ; then
421   MSG_RESULT(default values)
422 else
423   MSG_RESULT(auto)
424   rm -f wrap_chkconfig.ltx chkconfig.vars chkconfig.classes chklayouts.tex
425   cat >wrap_chkconfig.ltx <<EOF
426 \\newcommand\\srcdir{${srcdir}}
427 ${linuxdoc_cmd}
428 ${docbook_cmd}
429 \\input{${srcdir}/chkconfig.ltx}
430 EOF
431   ## Construct the list of classes to test for.
432   # build the list of available layout files and convert it to commands
433   # for chkconfig.ltx
434   for file in ./layouts/*.layout ${srcdir}/layouts/*.layout ; do
435     case $file in
436       */\*.layout) ;;
437       *) test -r "$file" && echo $file ;;
438     esac
439   done | sed -e 's%^.*layouts/\(.*\)\.layout$%\\TestDocClass{\1}%'\
440              > chklayouts.tex
441 changequote([,])dnl
442   [eval] ${LATEX} wrap_chkconfig.ltx 2>/dev/null | grep '^\+'
443   [eval] `cat chkconfig.vars | sed 's/-/_/g'`
444 changequote(,)dnl
445 fi
446
447 # Do we have all the files we need? Useful if latex did not run
448 changequote([,])dnl
449 echo "creating textclass.lst"
450 PROVIDE_DEFAULT_FILE(textclass.lst,dnl
451 [# This file declares layouts and their associated definition files
452 # (include dir. relative to the place where this file is).
453 # It contains only default values, since chkconfig.ltx could not be run
454 # for some reason. Run ./configure if you need to update it after a
455 # configuration change.
456 article article article
457 report  report  report
458 book    book    book
459 linuxdoc        linuxdoc        linuxdoc
460 letter  letter  letter])
461
462 PROVIDE_DEFAULT_FILE(chkconfig.sed,[s/@.*@/???/g])
463
464 echo "creating packages.lst"
465 PROVIDE_DEFAULT_FILE(packages.lst,dnl
466 [# This file should contain the list of LaTeX packages that have been
467 # recognized by LyX. Unfortunately, since configure could not find
468 # your LaTeX2e program, the tests have not been run. Run ./configure
469 # if you need to update it after a configuration change.
470 ])
471 changequote(,)dnl
472
473 echo "creating doc/LaTeXConfig.lyx"
474 echo "s/@chk_linuxdoc@/$chk_linuxdoc/g" >> chkconfig.sed
475 echo "s/@chk_docbook@/$chk_docbook/g" >> chkconfig.sed
476 sed -f chkconfig.sed ${srcdir}/doc/LaTeXConfig.lyx.in >doc/LaTeXConfig.lyx
477
478 echo "creating $outfile"
479 cat >$outfile <<EOF
480 # This file has been automatically generated by LyX' lib/configure
481 # script. It contains default settings that have been determined by
482 # examining your system. PLEASE DO NOT MODIFY ANYTHING HERE! If you
483 # want to customize LyX, make a copy of the file LYXDIR/lyxrc as
484 # ~/.lyx/lyxrc and edit this file instead. Any setting in lyxrc will
485 # override the values given here.
486 \\Format text     txt   ASCII           A
487 \\Format textparagraph txt ASCII(paragraphs)    ""
488 \\Format docbook  sgml  DocBook         B
489 \\Format bmp      bmp   BMP             ""
490 \\Format dvi      dvi   DVI             D
491 \\Format eps      eps   EPS             ""
492 \\Format epsi     epsi  EPSI            ""
493 \\Format fax      ""    Fax             ""
494 \\Format fits     fits  FITS            ""
495 \\Format gif      gif   GIF             ""
496 \\Format agr      agr   GRACE           ""
497 \\Format html     html  HTML            H
498 \\Format jpg      jpg   JPEG            ""
499 \\Format latex    tex   LaTeX           L
500 \\Format linuxdoc sgml  LinuxDoc        x
501 \\Format lyx      lyx   LyX             ""
502 \\Format literate nw    NoWeb           N
503 \\Format pdf      pdf   PDF             P
504 \\Format pdf2     pdf  "PDF (pdflatex)" F
505 \\Format pdf3     pdf  "PDF (dvipdfm)"  m
506 \\Format pbm      pbm   PBM             ""
507 \\Format pgm      pgm   PGM             ""
508 \\Format png      png   PNG             ""
509 \\Format ppm      ppm   PPM             ""
510 \\Format ps       ps    Postscript      t
511 \\Format program  ""    Program         ""
512 \\Format sgi      sgi   SGI             ""
513 \\Format tgif     tgif  TGIF            ""
514 \\Format tiff     tif   TIFF            ""
515 \\Format xbm      xbm   XBM             ""
516 \\Format xpm      xpm   XPM             ""
517 \\Format xwd      xwd   XWD             ""
518 \\Format word     doc   Word            W
519
520 \\converter latex dvi "$latex_to_dvi" "latex"
521 \\converter latex pdf2 "$latex_to_pdf" "latex"
522 \\converter latex html "$latex_to_html_command" "originaldir,needaux"
523 \\converter literate latex "$literate_to_tex_command" ""
524 \\converter dvi pdf3 "$dvi_to_pdf_command" ""
525 \\converter dvi ps "$dvi_to_ps_command" ""
526 \\converter ps pdf "$ps_to_pdf_command" ""
527 \\converter ps fax "$fax_command" ""
528 \\converter linuxdoc lyx "$linuxdoc_to_lyx_command" ""
529 \\converter linuxdoc latex "$linuxdoc_to_latex_command" ""
530 \\converter linuxdoc dvi "$linuxdoc_to_dvi_command" ""
531 \\converter linuxdoc html "$linuxdoc_to_html_command" ""
532 \\converter docbook dvi "$docbook_to_dvi_command" ""
533 \\converter docbook html "$docbook_to_html_command" ""
534
535 \\converter latex lyx "$tex_to_lyx_command" ""
536 \\converter literate lyx "$literate_to_lyx_command" ""
537 \\converter html latex "$html_to_latex_command" ""
538 \\converter word latex "$word_to_latex_command" ""
539
540 \\converter bmp  eps "$bmp_to_eps" ""
541 \\converter fits  eps "$fits_to_eps" ""
542 \\converter gif  eps "$gif_to_eps" ""
543 \\converter jpg  eps "$jpg_to_eps" ""
544 \\converter pbm  eps "$pbm_to_eps" ""
545 \\converter pgm  eps "$pgm_to_eps" ""
546 \\converter png  eps "$png_to_eps" ""
547 \\converter ppm  eps "$ppm_to_eps" ""
548 \\converter sgi  eps "$sgi_to_eps" ""
549 \\converter tgif eps "tgif -print -eps \$\$i" ""
550 \\converter tiff eps "tiff2ps \$\$i > \$\$o" ""
551 \\converter xbm  eps "$xbm_to_eps" ""
552 \\converter xpm  eps "$xpm_to_eps" ""
553 \\converter xwd  eps "$xwd_to_eps" ""
554
555 \\converter tgif xpm "tgif -print -stdout -xpm \$\$i > \$\$o" ""
556 \\converter tgif png "tgif -print -stdout -png \$\$i > \$\$o" ""
557 \\converter tgif pdf "tgif -print -stdout -pdf \$\$i > \$\$o" ""
558
559 \\converter gif  png "$gif_to_png" ""
560 \\converter eps  png "$eps_to_png" ""
561 \\converter epsi png "$eps_to_png" ""
562 \\converter jpg  png "$jpg_to_png" ""
563
564 \\converter gif  xpm "$gif_to_xpm" ""
565 \\converter eps  xpm "$eps_to_xpm" ""
566 \\converter epsi xpm "$eps_to_xpm" ""
567 \\converter jpg  xpm "$jpg_to_xpm" ""
568 \\converter png  xpm "$png_to_xpm" ""
569 \\converter ps  xpm "$ps_to_xpm" ""
570 \\converter xbm  xpm "$xbm_to_xpm" ""
571
572 \\converter eps  pdf "$eps_to_pdf" ""
573 \\converter epsi pdf "$eps_to_pdf" ""
574
575 \\converter agr  eps "$agr_to_eps" ""
576 \\converter agr  pdf "$agr_to_pdf" ""
577 \\converter agr  png "$agr_to_png" ""
578
579 \\viewer dvi "$DVI_VIEWER"
580 \\viewer html "$HTML_VIEWER"
581 \\viewer pdf "$PDF_VIEWER"
582 \\viewer ps "$GHOSTVIEW -swap"
583 \\viewer eps "$GHOSTVIEW"
584
585 $rc_entries
586 \\font_encoding "$chk_fontenc"
587 EOF
588
589 ######## X FONTS
590 # create a fonts.dir file to make X fonts available to LyX
591 echo "checking for TeX fonts"
592
593 fontlist="cmex10 cmmi10 cmr10 cmsy10 eufm10 msam10 msbm10"
594 rm -f xfonts/fonts.dir xfonts/fonts.scale xfonts/tmpfonts
595
596 num=0
597 touch xfonts/tmpfonts
598 for font in $fontlist ; do
599   MSG_CHECKING([for $font])
600   result=no
601   for ext in pfb pfa ttf ; do
602     if filepath=`kpsewhich $font.$ext` ; then
603       result="yes ($ext)"
604       rm -f xfonts/$font.$ext
605       ln -s $filepath xfonts 2>/dev/null
606       echo "$font.$ext -unknown-$font-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific" >>xfonts/tmpfonts
607       num=`expr $num + 1`
608       break
609     fi
610   done
611   MSG_RESULT($result)
612 done
613
614 if test ! $num = 0 ; then
615   echo $num >xfonts/fonts.scale
616   cat xfonts/tmpfonts >>xfonts/fonts.scale
617   cp xfonts/fonts.scale xfonts/fonts.dir
618 fi
619 rm -f xfonts/tmpfonts
620
621
622 # Remove superfluous files if we are not writing in the main lib
623 # directory
624 for file in $outfile textclass.lst packages.lst \
625             doc/LaTeXConfig.lyx xfonts/fonts.dir ; do
626   # we rename the file first, so that we avoid comparing a file with itself
627   mv $file $file.new
628   if test -r $srcdir/$file && diff $file.new $srcdir/$file >/dev/null 2>/dev/null ;
629   then
630     echo "removing $file, which is identical to the system global version"
631     rm -f $file.new
632   else
633     mv $file.new $file
634   fi
635 done
636
637
638 # Final clean-up
639 if test $lyx_keep_temps = no ; then
640 rm -f chkconfig.sed chkconfig.vars wrap_chkconfig.* chklayouts.tex \
641       missfont.log
642 fi