]> git.lyx.org Git - lyx.git/blob - lib/configure
partial cleanup to the lib/configure script
[lyx.git] / lib / configure
1 #! /bin/sh
2 # This script is a hand-made configure script. It contains a lot of
3 # code stolen from GNU autoconf. I removed all the code that was not
4 # useful for configuring a LyX installation.
5
6
7
8
9
10
11
12 ####some configuration variables
13 outfile=lyxrc.defaults
14 rc_entries=
15 lyx_check_config=yes
16 lyx_keep_temps=no
17 srcdir=
18 lyx_suffix=
19
20 #### Parse the command line
21 for ac_option do
22   case "$ac_option" in
23     -help | --help | -h)
24       cat << EOF
25 Usage: configure [options] 
26 Options: 
27   --help                   show this help lines
28   --keep-temps             keep temporary files (for debug. purposes)
29   --without-latex-config   do not run LaTeX to determine configuration
30   --with-lyx-suffix=suffix suffix of binary installed files
31 EOF
32       exit 0;;
33     --without-latex-config)
34       lyx_check_config=no ;;
35     --keep-temps)
36       lyx_keep_temps=yes ;;
37     --with-lyx-suffix*)
38       lyx_suffix=`echo "$ac_option" | sed 's,--with-lyx-suffix=,,;s,^,-,'`
39   esac 
40 done
41
42
43 #### Checking for some echo oddities
44 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
45   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
46   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
47     ac_n= ac_c='
48 ' ac_t='        '
49   else
50     ac_n=-n ac_c= ac_t=
51   fi
52 else
53   ac_n= ac_c='\c' ac_t=
54 fi
55
56
57 #### I do not really know why this is useful, but we might as well keep it.
58 # NLS nuisances.
59 # Only set these to C if already set.  These must not be set unconditionally
60 # because not all systems understand e.g. LANG=C (notably SCO).
61 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
62 # Non-C LC_CTYPE values break the ctype check.
63 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
64 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
65 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
66 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
67
68
69 #### Guess the directory in which configure is located.
70 ac_prog=$0
71 srcdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` 
72 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
73 test "x$srcdir" = "x$ac_prog" && srcdir=.
74 if test ! -r ${srcdir}/chkconfig.ltx ; then
75   echo "configure: error: cannot find chkconfig.ltx script"
76   exit 1
77 fi
78
79 #### Adjust PATH for Win32 (Cygwin)
80 if test "x$OSTYPE" = xcygwin; then
81   echo "configure: cygwin detected; path correction"
82   srcdir=`cygpath -w "${srcdir}" | tr '\\\\' /`
83   echo "srcdir=${srcdir}"
84 fi
85
86 #### Create the build directories if necessary
87 for dir in bind clipart doc examples help images kbd layouts reLyX \
88     scripts templates ui ; do
89   test ! -d $dir && mkdir $dir
90 done
91
92
93 #### Searching some useful programs
94 # Search LaTeX2e
95 echo $ac_n "checking for a LaTeX2e program""... $ac_c"
96 echo "$ac_t""(latex latex2e)"
97 LATEX=
98 for ac_prog in latex latex2e
99 do
100 # Extract the first word of "$ac_prog", so it can be a program name with args.
101 set dummy $ac_prog ; ac_word=$2
102 if test -n "$ac_word"; then
103   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
104   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
105   for ac_dir in $PATH; do
106     test -z "$ac_dir" && ac_dir=.
107     if test -x $ac_dir/$ac_word; then
108       LATEX="$ac_prog"
109       break
110     fi
111   done
112   IFS="$ac_save_ifs"
113
114   if test -n "$LATEX"; then
115     ac_result=yes
116     
117 ## Check whether this is really LaTeX2e
118 rm -f chklatex.ltx
119 cat >chklatex.ltx <<EOF
120 \\nonstopmode\\makeatletter
121 \\ifx\\undefined\\documentclass\\else
122   \\message{ThisIsLaTeX2e}
123 \\fi
124 \\@@end
125 EOF
126 if eval ${LATEX} chklatex.ltx </dev/null 2>/dev/null \
127                        | grep 'ThisIsLaTeX2e' >/dev/null; then
128   :
129 else
130   LATEX=
131   ac_result="not useable"
132 fi
133 rm -f chklatex.ltx chklatex.log
134   else
135     ac_result=no
136   fi
137   echo "$ac_t""$ac_result"
138   test -n "$LATEX" && break
139 fi
140 done
141
142 if test -z "$LATEX" ; then
143   LATEX=none
144     lyx_check_config=no
145 fi
146
147 latex_to_dvi=$LATEX
148 test -z "$latex_to_dvi" && latex_to_dvi="none"
149
150 # Search for pdflatex
151 if test ${lyx_check_config} = no ; then
152   latex_to_pdf=none
153 else
154   echo $ac_n "checking for the pdflatex program""... $ac_c"
155 echo "$ac_t""(pdflatex)"
156 latex_to_pdf=
157 for ac_prog in pdflatex
158 do
159 # Extract the first word of "$ac_prog", so it can be a program name with args.
160 set dummy $ac_prog ; ac_word=$2
161 if test -n "$ac_word"; then
162   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
163   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
164   for ac_dir in $PATH; do
165     test -z "$ac_dir" && ac_dir=.
166     if test -x $ac_dir/$ac_word; then
167       latex_to_pdf="$ac_prog"
168       break
169     fi
170   done
171   IFS="$ac_save_ifs"
172
173   if test -n "$latex_to_pdf"; then
174     ac_result=yes
175     
176   else
177     ac_result=no
178   fi
179   echo "$ac_t""$ac_result"
180   test -n "$latex_to_pdf" && break
181 fi
182 done
183
184 if test -z "$latex_to_pdf" ; then
185   latex_to_pdf=none
186 fi
187
188 fi
189
190 test $latex_to_dvi != "none" && latex_to_dvi="$latex_to_dvi \$\$i"
191 test $latex_to_pdf != "none" && latex_to_pdf="$latex_to_pdf \$\$i"
192
193 # Search for an installed reLyX or a ready-to-install one
194 save_PATH=${PATH}
195 PATH=${PATH}:./reLyX/
196 echo $ac_n "checking for a LaTeX -> LyX converter""... $ac_c"
197 echo "$ac_t""(reLyX)"
198 tex_to_lyx_command=
199 for ac_prog in reLyX
200 do
201 # Extract the first word of "$ac_prog", so it can be a program name with args.
202 set dummy $ac_prog ; ac_word=$2
203 if test -n "$ac_word"; then
204   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
205   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
206   for ac_dir in $PATH; do
207     test -z "$ac_dir" && ac_dir=.
208     if test -x $ac_dir/$ac_word; then
209       tex_to_lyx_command="$ac_prog"
210       break
211     fi
212   done
213   IFS="$ac_save_ifs"
214
215   if test -n "$tex_to_lyx_command"; then
216     ac_result=yes
217     
218   else
219     ac_result=no
220   fi
221   echo "$ac_t""$ac_result"
222   test -n "$tex_to_lyx_command" && break
223 fi
224 done
225
226 if test -z "$tex_to_lyx_command" ; then
227   tex_to_lyx_command=none
228 fi
229
230 PATH=${save_PATH}
231 test $tex_to_lyx_command = "reLyX" && tex_to_lyx_command="reLyX -f \$\$i"
232 tex_to_lyx_command=`echo $tex_to_lyx_command | sed "s,reLyX,reLyX$lyx_suffix,"`
233
234 echo $ac_n "checking for a Noweb -> LyX converter""... $ac_c"
235 echo "$ac_t""(noweb2lyx)"
236 literate_to_lyx_command=
237 for ac_prog in noweb2lyx
238 do
239 # Extract the first word of "$ac_prog", so it can be a program name with args.
240 set dummy $ac_prog ; ac_word=$2
241 if test -n "$ac_word"; then
242   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
243   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
244   for ac_dir in $PATH; do
245     test -z "$ac_dir" && ac_dir=.
246     if test -x $ac_dir/$ac_word; then
247       literate_to_lyx_command="$ac_prog"
248       break
249     fi
250   done
251   IFS="$ac_save_ifs"
252
253   if test -n "$literate_to_lyx_command"; then
254     ac_result=yes
255     
256   else
257     ac_result=no
258   fi
259   echo "$ac_t""$ac_result"
260   test -n "$literate_to_lyx_command" && break
261 fi
262 done
263
264 if test -z "$literate_to_lyx_command" ; then
265   literate_to_lyx_command=none
266 fi
267
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$lyx_suffix,"`
270
271 # Search something to process a literate document
272 echo $ac_n "checking for a Noweb -> LaTeX converter""... $ac_c"
273 echo "$ac_t""(noweave)"
274 literate_to_tex_command=
275 for ac_prog in noweave
276 do
277 # Extract the first word of "$ac_prog", so it can be a program name with args.
278 set dummy $ac_prog ; ac_word=$2
279 if test -n "$ac_word"; then
280   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
281   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
282   for ac_dir in $PATH; do
283     test -z "$ac_dir" && ac_dir=.
284     if test -x $ac_dir/$ac_word; then
285       literate_to_tex_command="$ac_prog"
286       break
287     fi
288   done
289   IFS="$ac_save_ifs"
290
291   if test -n "$literate_to_tex_command"; then
292     ac_result=yes
293     
294   else
295     ac_result=no
296   fi
297   echo "$ac_t""$ac_result"
298   test -n "$literate_to_tex_command" && break
299 fi
300 done
301
302 if test -z "$literate_to_tex_command" ; then
303   literate_to_tex_command=none
304 fi
305
306 test $literate_to_tex_command = "noweave" && literate_to_tex_command="noweave -delay -index \$\$i > \$\$o"
307
308 echo $ac_n "checking for a HTML -> Latex converter""... $ac_c"
309 echo "$ac_t""(html2latex)"
310 html_to_latex_command=
311 for ac_prog in html2latex
312 do
313 # Extract the first word of "$ac_prog", so it can be a program name with args.
314 set dummy $ac_prog ; ac_word=$2
315 if test -n "$ac_word"; then
316   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
317   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
318   for ac_dir in $PATH; do
319     test -z "$ac_dir" && ac_dir=.
320     if test -x $ac_dir/$ac_word; then
321       html_to_latex_command="$ac_prog"
322       break
323     fi
324   done
325   IFS="$ac_save_ifs"
326
327   if test -n "$html_to_latex_command"; then
328     ac_result=yes
329     
330   else
331     ac_result=no
332   fi
333   echo "$ac_t""$ac_result"
334   test -n "$html_to_latex_command" && break
335 fi
336 done
337
338 if test -z "$html_to_latex_command" ; then
339   html_to_latex_command=none
340 fi
341
342 test $html_to_latex_command = "html2latex" && html_to_latex_command="html2latex \$\$i"
343
344 echo $ac_n "checking for a MSWord -> Latex converter""... $ac_c"
345 echo "$ac_t""(wvCleanLatex word2x)"
346 word_to_latex_command=
347 for ac_prog in wvCleanLatex word2x
348 do
349 # Extract the first word of "$ac_prog", so it can be a program name with args.
350 set dummy $ac_prog ; ac_word=$2
351 if test -n "$ac_word"; then
352   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
353   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
354   for ac_dir in $PATH; do
355     test -z "$ac_dir" && ac_dir=.
356     if test -x $ac_dir/$ac_word; then
357       word_to_latex_command="$ac_prog"
358       break
359     fi
360   done
361   IFS="$ac_save_ifs"
362
363   if test -n "$word_to_latex_command"; then
364     ac_result=yes
365     
366   else
367     ac_result=no
368   fi
369   echo "$ac_t""$ac_result"
370   test -n "$word_to_latex_command" && break
371 fi
372 done
373
374 if test -z "$word_to_latex_command" ; then
375   word_to_latex_command=none
376 fi
377
378 test "$word_to_latex_command" = "wvCleanLatex" && word_to_latex_command="wvCleanLatex \$\$i \$\$o"
379 test "$word_to_latex_command" = "word2x" && word_to_latex_command="word2x -f latex \$\$i"
380
381 echo $ac_n "checking for Image converter""... $ac_c"
382 echo "$ac_t""(convert)"
383 image_command=
384 for ac_prog in convert
385 do
386 # Extract the first word of "$ac_prog", so it can be a program name with args.
387 set dummy $ac_prog ; ac_word=$2
388 if test -n "$ac_word"; then
389   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
390   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
391   for ac_dir in $PATH; do
392     test -z "$ac_dir" && ac_dir=.
393     if test -x $ac_dir/$ac_word; then
394       image_command="$ac_prog"
395       break
396     fi
397   done
398   IFS="$ac_save_ifs"
399
400   if test -n "$image_command"; then
401     ac_result=yes
402     
403   else
404     ac_result=no
405   fi
406   echo "$ac_t""$ac_result"
407   test -n "$image_command" && break
408 fi
409 done
410
411 if test -z "$image_command" ; then
412   image_command=none
413 fi
414
415 test $image_command = "convert" && image_command="convert \$\$i \$\$o"
416
417 # Search for a Postscript interpreter
418 echo $ac_n "checking for a Postscript interpreter""... $ac_c"
419 echo "$ac_t""(gs)"
420 prog=
421 for ac_prog in gs
422 do
423 # Extract the first word of "$ac_prog", so it can be a program name with args.
424 set dummy $ac_prog ; ac_word=$2
425 if test -n "$ac_word"; then
426   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
427   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
428   for ac_dir in $PATH; do
429     test -z "$ac_dir" && ac_dir=.
430     if test -x $ac_dir/$ac_word; then
431       prog="$ac_prog"
432       break
433     fi
434   done
435   IFS="$ac_save_ifs"
436
437   if test -n "$prog"; then
438     ac_result=yes
439     
440   else
441     ac_result=no
442   fi
443   echo "$ac_t""$ac_result"
444   test -n "$prog" && break
445 fi
446 done
447
448 if test -z "$prog" ; then
449   prog=none
450 fi
451
452 rc_entries="$rc_entries
453 \ps_command \"$prog\""
454
455 # Search something to preview postscript
456 echo $ac_n "checking for a Postscript previewer""... $ac_c"
457 echo "$ac_t""(gv ghostview)"
458 GHOSTVIEW=
459 for ac_prog in gv ghostview
460 do
461 # Extract the first word of "$ac_prog", so it can be a program name with args.
462 set dummy $ac_prog ; ac_word=$2
463 if test -n "$ac_word"; then
464   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
465   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
466   for ac_dir in $PATH; do
467     test -z "$ac_dir" && ac_dir=.
468     if test -x $ac_dir/$ac_word; then
469       GHOSTVIEW="$ac_prog"
470       break
471     fi
472   done
473   IFS="$ac_save_ifs"
474
475   if test -n "$GHOSTVIEW"; then
476     ac_result=yes
477     
478   else
479     ac_result=no
480   fi
481   echo "$ac_t""$ac_result"
482   test -n "$GHOSTVIEW" && break
483 fi
484 done
485
486 if test -z "$GHOSTVIEW" ; then
487   GHOSTVIEW=none
488 fi
489
490
491 # Search for a program to preview pdf
492 echo $ac_n "checking for a PDF preview""... $ac_c"
493 echo "$ac_t""(acroread gv ghostview xpdf)"
494 PDF_VIEWER=
495 for ac_prog in acroread gv ghostview xpdf
496 do
497 # Extract the first word of "$ac_prog", so it can be a program name with args.
498 set dummy $ac_prog ; ac_word=$2
499 if test -n "$ac_word"; then
500   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
501   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
502   for ac_dir in $PATH; do
503     test -z "$ac_dir" && ac_dir=.
504     if test -x $ac_dir/$ac_word; then
505       PDF_VIEWER="$ac_prog"
506       break
507     fi
508   done
509   IFS="$ac_save_ifs"
510
511   if test -n "$PDF_VIEWER"; then
512     ac_result=yes
513     
514   else
515     ac_result=no
516   fi
517   echo "$ac_t""$ac_result"
518   test -n "$PDF_VIEWER" && break
519 fi
520 done
521
522 if test -z "$PDF_VIEWER" ; then
523   PDF_VIEWER=none
524 fi
525
526
527 # Search something to preview dvi
528 echo $ac_n "checking for a DVI previewer""... $ac_c"
529 echo "$ac_t""(xdvi windvi yap)"
530 DVI_VIEWER=
531 for ac_prog in xdvi windvi yap
532 do
533 # Extract the first word of "$ac_prog", so it can be a program name with args.
534 set dummy $ac_prog ; ac_word=$2
535 if test -n "$ac_word"; then
536   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
537   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
538   for ac_dir in $PATH; do
539     test -z "$ac_dir" && ac_dir=.
540     if test -x $ac_dir/$ac_word; then
541       DVI_VIEWER="$ac_prog"
542       break
543     fi
544   done
545   IFS="$ac_save_ifs"
546
547   if test -n "$DVI_VIEWER"; then
548     ac_result=yes
549     
550   else
551     ac_result=no
552   fi
553   echo "$ac_t""$ac_result"
554   test -n "$DVI_VIEWER" && break
555 fi
556 done
557
558 if test -z "$DVI_VIEWER" ; then
559   DVI_VIEWER=none
560 fi
561
562
563 # Search something to preview html
564 echo $ac_n "checking for a HTML previewer""... $ac_c"
565 echo "$ac_t""(netscape)"
566 HTML_VIEWER=
567 for ac_prog in netscape
568 do
569 # Extract the first word of "$ac_prog", so it can be a program name with args.
570 set dummy $ac_prog ; ac_word=$2
571 if test -n "$ac_word"; then
572   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
573   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
574   for ac_dir in $PATH; do
575     test -z "$ac_dir" && ac_dir=.
576     if test -x $ac_dir/$ac_word; then
577       HTML_VIEWER="$ac_prog"
578       break
579     fi
580   done
581   IFS="$ac_save_ifs"
582
583   if test -n "$HTML_VIEWER"; then
584     ac_result=yes
585     
586   else
587     ac_result=no
588   fi
589   echo "$ac_t""$ac_result"
590   test -n "$HTML_VIEWER" && break
591 fi
592 done
593
594 if test -z "$HTML_VIEWER" ; then
595   HTML_VIEWER=none
596 fi
597
598
599 # Search for a program to convert ps to pdf
600 echo $ac_n "checking for a PS to PDF converter""... $ac_c"
601 echo "$ac_t""(ps2pdf)"
602 ps_to_pdf_command=
603 for ac_prog in ps2pdf
604 do
605 # Extract the first word of "$ac_prog", so it can be a program name with args.
606 set dummy $ac_prog ; ac_word=$2
607 if test -n "$ac_word"; then
608   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
609   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
610   for ac_dir in $PATH; do
611     test -z "$ac_dir" && ac_dir=.
612     if test -x $ac_dir/$ac_word; then
613       ps_to_pdf_command="$ac_prog"
614       break
615     fi
616   done
617   IFS="$ac_save_ifs"
618
619   if test -n "$ps_to_pdf_command"; then
620     ac_result=yes
621     
622   else
623     ac_result=no
624   fi
625   echo "$ac_t""$ac_result"
626   test -n "$ps_to_pdf_command" && break
627 fi
628 done
629
630 if test -z "$ps_to_pdf_command" ; then
631   ps_to_pdf_command=none
632 fi
633
634 test $ps_to_pdf_command = "ps2pdf" && ps_to_pdf_command="ps2pdf \$\$i"
635
636 # Search for a program to convert dvi to ps
637 echo $ac_n "checking for a DVI to PS converter""... $ac_c"
638 echo "$ac_t""(dvips)"
639 dvi_to_ps_command=
640 for ac_prog in dvips
641 do
642 # Extract the first word of "$ac_prog", so it can be a program name with args.
643 set dummy $ac_prog ; ac_word=$2
644 if test -n "$ac_word"; then
645   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
646   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
647   for ac_dir in $PATH; do
648     test -z "$ac_dir" && ac_dir=.
649     if test -x $ac_dir/$ac_word; then
650       dvi_to_ps_command="$ac_prog"
651       break
652     fi
653   done
654   IFS="$ac_save_ifs"
655
656   if test -n "$dvi_to_ps_command"; then
657     ac_result=yes
658     
659   else
660     ac_result=no
661   fi
662   echo "$ac_t""$ac_result"
663   test -n "$dvi_to_ps_command" && break
664 fi
665 done
666
667 if test -z "$dvi_to_ps_command" ; then
668   dvi_to_ps_command=none
669 fi
670
671 test $dvi_to_ps_command = "dvips" && dvi_to_ps_command="dvips -o \$\$o \$\$i"
672
673 # Search for a program to convert dvi to pdf
674 echo $ac_n "checking for a DVI to PDF converter""... $ac_c"
675 echo "$ac_t""(dvipdfm)"
676 dvi_to_pdf_command=
677 for ac_prog in dvipdfm
678 do
679 # Extract the first word of "$ac_prog", so it can be a program name with args.
680 set dummy $ac_prog ; ac_word=$2
681 if test -n "$ac_word"; then
682   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
683   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
684   for ac_dir in $PATH; do
685     test -z "$ac_dir" && ac_dir=.
686     if test -x $ac_dir/$ac_word; then
687       dvi_to_pdf_command="$ac_prog"
688       break
689     fi
690   done
691   IFS="$ac_save_ifs"
692
693   if test -n "$dvi_to_pdf_command"; then
694     ac_result=yes
695     
696   else
697     ac_result=no
698   fi
699   echo "$ac_t""$ac_result"
700   test -n "$dvi_to_pdf_command" && break
701 fi
702 done
703
704 if test -z "$dvi_to_pdf_command" ; then
705   dvi_to_pdf_command=none
706 fi
707
708 test $dvi_to_pdf_command = "dvipdfm" && dvi_to_pdf_command="dvipdfm \$\$i"
709
710 # Search a *roff program (used to translate tables in ASCII export)
711 echo $ac_n "checking for a *roff formatter""... $ac_c"
712 echo "$ac_t""('groff -t -Tlatin1 $$FName' nroff)"
713 prog=
714 for ac_prog in 'groff -t -Tlatin1 $$FName' nroff
715 do
716 # Extract the first word of "$ac_prog", so it can be a program name with args.
717 set dummy $ac_prog ; ac_word=$2
718 if test -n "$ac_word"; then
719   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
720   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
721   for ac_dir in $PATH; do
722     test -z "$ac_dir" && ac_dir=.
723     if test -x $ac_dir/$ac_word; then
724       prog="$ac_prog"
725       break
726     fi
727   done
728   IFS="$ac_save_ifs"
729
730   if test -n "$prog"; then
731     ac_result=yes
732     test $prog = "nroff" && prog='tbl $$FName | nroff'
733   else
734     ac_result=no
735   fi
736   echo "$ac_t""$ac_result"
737   test -n "$prog" && break
738 fi
739 done
740
741 if test -z "$prog" ; then
742   prog=none
743 fi
744
745 rc_entries="$rc_entries
746 \ascii_roff_command \"$prog\""
747
748 # Search the ChkTeX program
749 echo $ac_n "checking for ChkTeX""... $ac_c"
750 echo "$ac_t""("chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38")"
751 prog=
752 for ac_prog in "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38"
753 do
754 # Extract the first word of "$ac_prog", so it can be a program name with args.
755 set dummy $ac_prog ; ac_word=$2
756 if test -n "$ac_word"; then
757   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
758   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
759   for ac_dir in $PATH; do
760     test -z "$ac_dir" && ac_dir=.
761     if test -x $ac_dir/$ac_word; then
762       prog="$ac_prog"
763       break
764     fi
765   done
766   IFS="$ac_save_ifs"
767
768   if test -n "$prog"; then
769     ac_result=yes
770     
771   else
772     ac_result=no
773   fi
774   echo "$ac_t""$ac_result"
775   test -n "$prog" && break
776 fi
777 done
778
779 if test -z "$prog" ; then
780   prog=none
781 fi
782
783 rc_entries="$rc_entries
784 \chktex_command \"$prog\""
785
786 # Search for a spellchecker
787 echo $ac_n "checking for a spell-checker""... $ac_c"
788 echo "$ac_t""(ispell)"
789 prog=
790 for ac_prog in ispell
791 do
792 # Extract the first word of "$ac_prog", so it can be a program name with args.
793 set dummy $ac_prog ; ac_word=$2
794 if test -n "$ac_word"; then
795   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
796   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
797   for ac_dir in $PATH; do
798     test -z "$ac_dir" && ac_dir=.
799     if test -x $ac_dir/$ac_word; then
800       prog="$ac_prog"
801       break
802     fi
803   done
804   IFS="$ac_save_ifs"
805
806   if test -n "$prog"; then
807     ac_result=yes
808     
809   else
810     ac_result=no
811   fi
812   echo "$ac_t""$ac_result"
813   test -n "$prog" && break
814 fi
815 done
816
817 if test -z "$prog" ; then
818   prog=none
819 fi
820
821 rc_entries="$rc_entries
822 \spell_command \"$prog\""
823
824
825 # Search a GUI Fax program
826 echo $ac_n "checking for a fax program""... $ac_c"
827 echo "$ac_t""(ksendfax)"
828 fax_command=
829 for ac_prog in ksendfax
830 do
831 # Extract the first word of "$ac_prog", so it can be a program name with args.
832 set dummy $ac_prog ; ac_word=$2
833 if test -n "$ac_word"; then
834   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
835   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
836   for ac_dir in $PATH; do
837     test -z "$ac_dir" && ac_dir=.
838     if test -x $ac_dir/$ac_word; then
839       fax_command="$ac_prog"
840       break
841     fi
842   done
843   IFS="$ac_save_ifs"
844
845   if test -n "$fax_command"; then
846     ac_result=yes
847     
848   else
849     ac_result=no
850   fi
851   echo "$ac_t""$ac_result"
852   test -n "$fax_command" && break
853 fi
854 done
855
856 if test -z "$fax_command" ; then
857   fax_command=none
858 fi
859
860 test $fax_command = "ksendfax" && fax_command="ksendfax \$\$i"
861
862 # Search for LinuxDoc support
863 echo $ac_n "checking for SGML-tools 1.x (LinuxDoc)""... $ac_c"
864 echo "$ac_t""(sgml2lyx)"
865 LINUXDOC=
866 for ac_prog in sgml2lyx
867 do
868 # Extract the first word of "$ac_prog", so it can be a program name with args.
869 set dummy $ac_prog ; ac_word=$2
870 if test -n "$ac_word"; then
871   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
872   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
873   for ac_dir in $PATH; do
874     test -z "$ac_dir" && ac_dir=.
875     if test -x $ac_dir/$ac_word; then
876       LINUXDOC="$ac_prog"
877       break
878     fi
879   done
880   IFS="$ac_save_ifs"
881
882   if test -n "$LINUXDOC"; then
883     ac_result=yes
884     
885   else
886     ac_result=no
887   fi
888   echo "$ac_t""$ac_result"
889   test -n "$LINUXDOC" && break
890 fi
891 done
892
893 if test -z "$LINUXDOC" ; then
894   LINUXDOC=none
895 fi
896
897 chk_linuxdoc=no
898 if test $LINUXDOC != none; then
899   chk_linuxdoc=yes
900   linuxdoc_cmd="\\def\\haslinuxdoc{yes}"
901 fi
902
903 case $LINUXDOC in
904   sgml2lyx)
905     linuxdoc_to_latex_command="sgml2latex \$\$i"
906     linuxdoc_to_dvi_command="sgml2latex -o dvi \$\$i"
907     linuxdoc_to_html_command="sgml2html \$\$i"
908     linuxdoc_to_lyx_command="sgml2lyx \$\$i";;
909   none)
910     linuxdoc_to_latex_command="none"
911     linuxdoc_to_dvi_command="none"
912     linuxdoc_to_html_command="none"
913     linuxdoc_to_lyx_command="none";;
914 esac
915
916 # Search for DocBook support
917 echo $ac_n "checking for SGML-tools 2.x (DocBook) or db2x scripts""... $ac_c"
918 echo "$ac_t""(sgmltools db2dvi)"
919 DOCBOOK=
920 for ac_prog in sgmltools db2dvi
921 do
922 # Extract the first word of "$ac_prog", so it can be a program name with args.
923 set dummy $ac_prog ; ac_word=$2
924 if test -n "$ac_word"; then
925   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
926   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
927   for ac_dir in $PATH; do
928     test -z "$ac_dir" && ac_dir=.
929     if test -x $ac_dir/$ac_word; then
930       DOCBOOK="$ac_prog"
931       break
932     fi
933   done
934   IFS="$ac_save_ifs"
935
936   if test -n "$DOCBOOK"; then
937     ac_result=yes
938     
939   else
940     ac_result=no
941   fi
942   echo "$ac_t""$ac_result"
943   test -n "$DOCBOOK" && break
944 fi
945 done
946
947 if test -z "$DOCBOOK" ; then
948   DOCBOOK=none
949 fi
950
951 chk_docbook=no
952 if test $DOCBOOK != none; then
953   chk_docbook=yes
954   docbook_cmd="\\def\\hasdocbook{yes}"
955 fi
956
957 case $DOCBOOK in
958   sgmltools)
959     docbook_to_dvi_command="sgmltools -b dvi \$\$i"
960     docbook_to_html_command="sgmltools -b html \$\$i";;
961   db2dvi)
962     docbook_to_dvi_command="db2dvi \$\$i"
963     docbook_to_html_command="db2html \$\$i";;
964   none)
965     docbook_to_dvi_command="none"
966     docbook_to_html_command="none";;
967 esac
968
969 # Search for a spool command
970 echo $ac_n "checking for a spool command""... $ac_c"
971 echo "$ac_t""(lp lpr)"
972 prog=
973 for ac_prog in lp lpr
974 do
975 # Extract the first word of "$ac_prog", so it can be a program name with args.
976 set dummy $ac_prog ; ac_word=$2
977 if test -n "$ac_word"; then
978   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
979   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
980   for ac_dir in $PATH; do
981     test -z "$ac_dir" && ac_dir=.
982     if test -x $ac_dir/$ac_word; then
983       prog="$ac_prog"
984       break
985     fi
986   done
987   IFS="$ac_save_ifs"
988
989   if test -n "$prog"; then
990     ac_result=yes
991     
992   else
993     ac_result=no
994   fi
995   echo "$ac_t""$ac_result"
996   test -n "$prog" && break
997 fi
998 done
999
1000 if test -z "$prog" ; then
1001   prog=none
1002 fi
1003
1004 rc_entries="$rc_entries
1005 \printspool_command \"$prog\""
1006 case $prog in
1007   lp) print_spool_printerprefix="-d ";;
1008  lpr) print_spool_printerprefix="-P";;
1009    *) :;; # leave to empty values
1010 esac
1011 rc_entries="$rc_entries
1012 \print_spool_printerprefix \"$print_spool_printerprefix\""
1013
1014 echo $ac_n "checking for a LaTeX -> HTML converter""... $ac_c"
1015 echo "$ac_t""(tth latex2html hevea)"
1016 TOHTML=
1017 for ac_prog in tth latex2html hevea
1018 do
1019 # Extract the first word of "$ac_prog", so it can be a program name with args.
1020 set dummy $ac_prog ; ac_word=$2
1021 if test -n "$ac_word"; then
1022   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
1023   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1024   for ac_dir in $PATH; do
1025     test -z "$ac_dir" && ac_dir=.
1026     if test -x $ac_dir/$ac_word; then
1027       TOHTML="$ac_prog"
1028       break
1029     fi
1030   done
1031   IFS="$ac_save_ifs"
1032
1033   if test -n "$TOHTML"; then
1034     ac_result=yes
1035     
1036   else
1037     ac_result=no
1038   fi
1039   echo "$ac_t""$ac_result"
1040   test -n "$TOHTML" && break
1041 fi
1042 done
1043
1044 if test -z "$TOHTML" ; then
1045   TOHTML=none
1046 fi
1047
1048 latex_to_html_command=$TOHTML
1049 case $TOHTML in
1050         tth) latex_to_html_command="tth -t -e2 -L\$\$b < \$\$i > \$\$o";;
1051  latex2html) latex_to_html_command="latex2html -no_subdir -split 0 -show_section_numbers \$\$i";;
1052       hevea) latex_to_html_command="hevea -s \$\$i";;
1053 esac
1054
1055 #### Search for image conversion ####
1056 echo $ac_n "checking for an Image -> EPS converter""... $ac_c"
1057 echo "$ac_t""(convert pnmtops)"
1058 TOEPS=
1059 for ac_prog in convert pnmtops
1060 do
1061 # Extract the first word of "$ac_prog", so it can be a program name with args.
1062 set dummy $ac_prog ; ac_word=$2
1063 if test -n "$ac_word"; then
1064   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
1065   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1066   for ac_dir in $PATH; do
1067     test -z "$ac_dir" && ac_dir=.
1068     if test -x $ac_dir/$ac_word; then
1069       TOEPS="$ac_prog"
1070       break
1071     fi
1072   done
1073   IFS="$ac_save_ifs"
1074
1075   if test -n "$TOEPS"; then
1076     ac_result=yes
1077     
1078   else
1079     ac_result=no
1080   fi
1081   echo "$ac_t""$ac_result"
1082   test -n "$TOEPS" && break
1083 fi
1084 done
1085
1086 if test -z "$TOEPS" ; then
1087   TOEPS=none
1088 fi
1089
1090 case $TOEPS in
1091         convert) gif_to_eps="convert GIF:\$\$i EPS:\$\$o" png_to_eps="convert PNG:\$\$i EPS:\$\$o" jpg_to_eps="convert JPG:\$\$i EPS:\$\$o";;
1092         pnmtops) gif_to_eps="giftopnm \$\$i | pnmtops > \$\$o" png_to_eps="pngtopnm \$\$i | pnmtops >\$\$o" jpg_to_eps="jpegtopnm \$\$i | pnmtops >\$\$o";;
1093 esac
1094
1095 echo $ac_n "checking for a Image -> PNG converter""... $ac_c"
1096 echo "$ac_t""(convert pnmtopng)"
1097 TOPNG=
1098 for ac_prog in convert pnmtopng
1099 do
1100 # Extract the first word of "$ac_prog", so it can be a program name with args.
1101 set dummy $ac_prog ; ac_word=$2
1102 if test -n "$ac_word"; then
1103   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
1104   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1105   for ac_dir in $PATH; do
1106     test -z "$ac_dir" && ac_dir=.
1107     if test -x $ac_dir/$ac_word; then
1108       TOPNG="$ac_prog"
1109       break
1110     fi
1111   done
1112   IFS="$ac_save_ifs"
1113
1114   if test -n "$TOPNG"; then
1115     ac_result=yes
1116     
1117   else
1118     ac_result=no
1119   fi
1120   echo "$ac_t""$ac_result"
1121   test -n "$TOPNG" && break
1122 fi
1123 done
1124
1125 if test -z "$TOPNG" ; then
1126   TOPNG=none
1127 fi
1128
1129 case $TOPNG in
1130         convert) gif_to_png="convert GIF:\$\$i PNG:\$\$o" eps_to_png="convert EPS:\$\$i PNG:\$\$o" jpg_to_png="convert JPG:\$\$i PNG:\$\$o";;
1131         pnmtopng) gif_to_png="giftopnm \$\$i | pnmtopng >\$\$o" eps_to_png="pstopnm \$\$i| pnmtopng >\$\$o" jpg_to_png="jpegtopnm \$\$i | pnmtopng >\$\$o";;
1132 esac
1133
1134 echo $ac_n "checking for a Image -> XPM converter""... $ac_c"
1135 echo "$ac_t""(convert)"
1136 TOXPM=
1137 for ac_prog in convert
1138 do
1139 # Extract the first word of "$ac_prog", so it can be a program name with args.
1140 set dummy $ac_prog ; ac_word=$2
1141 if test -n "$ac_word"; then
1142   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
1143   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1144   for ac_dir in $PATH; do
1145     test -z "$ac_dir" && ac_dir=.
1146     if test -x $ac_dir/$ac_word; then
1147       TOXPM="$ac_prog"
1148       break
1149     fi
1150   done
1151   IFS="$ac_save_ifs"
1152
1153   if test -n "$TOXPM"; then
1154     ac_result=yes
1155     
1156   else
1157     ac_result=no
1158   fi
1159   echo "$ac_t""$ac_result"
1160   test -n "$TOXPM" && break
1161 fi
1162 done
1163
1164 if test -z "$TOXPM" ; then
1165   TOXPM=none
1166 fi
1167
1168 if test "$TOXPM" = "convert"; then
1169         gif_to_xpm="convert GIF:\$\$i XPM:\$\$o"
1170         eps_to_xpm="convert EPS:\$\$i XPM:\$\$o" 
1171         jpg_to_xpm="convert JPG:\$\$i XPM:\$\$o"
1172         png_to_xpm="convert PNG:\$\$i XPM:\$\$o"
1173 fi
1174
1175 echo $ac_n "checking For an EPS -> PDF converter""... $ac_c"
1176 echo "$ac_t""(epstopdf)"
1177 EPSTOPDF=
1178 for ac_prog in epstopdf
1179 do
1180 # Extract the first word of "$ac_prog", so it can be a program name with args.
1181 set dummy $ac_prog ; ac_word=$2
1182 if test -n "$ac_word"; then
1183   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
1184   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1185   for ac_dir in $PATH; do
1186     test -z "$ac_dir" && ac_dir=.
1187     if test -x $ac_dir/$ac_word; then
1188       EPSTOPDF="$ac_prog"
1189       break
1190     fi
1191   done
1192   IFS="$ac_save_ifs"
1193
1194   if test -n "$EPSTOPDF"; then
1195     ac_result=yes
1196     
1197   else
1198     ac_result=no
1199   fi
1200   echo "$ac_t""$ac_result"
1201   test -n "$EPSTOPDF" && break
1202 fi
1203 done
1204
1205 if test -z "$EPSTOPDF" ; then
1206   EPSTOPDF=none
1207 fi
1208
1209 case $EPSTOPDF in
1210         epstopdf) eps_to_pdf="epstopdf --outfile=\$\$o \$\$i";;
1211 esac
1212
1213 #### Explore the LaTeX configuration
1214 echo $ac_n "checking LaTeX configuration""... $ac_c"
1215 # First, remove the files that we want to re-create
1216 rm -f textclass.lst packages.lst chkconfig.sed
1217 if test ${lyx_check_config} = no ; then
1218   echo "$ac_t""default values"
1219 else
1220   echo "$ac_t""auto"
1221   rm -f wrap_chkconfig.ltx chkconfig.vars chkconfig.classes chklayouts.tex
1222   cat >wrap_chkconfig.ltx <<EOF
1223 \\newcommand\\srcdir{${srcdir}}
1224 ${linuxdoc_cmd}
1225 ${docbook_cmd}
1226 \\input{${srcdir}/chkconfig.ltx}
1227 EOF
1228   ## Construct the list of classes to test for.
1229   # build the list of available layout files and convert it to commands 
1230   # for chkconfig.ltx 
1231   for file in ./layouts/*.layout ${srcdir}/layouts/*.layout ; do 
1232     case $file in
1233       */\*.layout) ;;
1234       *) test -r "$file" && echo $file ;;
1235     esac
1236   done | sed -e 's%^.*layouts/\(.*\)\.layout$%\\TestDocClass{\1}%'\
1237              > chklayouts.tex
1238   eval ${LATEX} wrap_chkconfig.ltx 2>/dev/null | grep '^\+'
1239   eval `cat chkconfig.vars | sed 's/-/_/g'`
1240 fi
1241
1242 # Do we have all the files we need? Useful if latex did not run
1243 echo creating textclass.lst 
1244 # if textclass.lst does not exist (because LaTeX did not run), 
1245 # then provide a standard version.
1246 if test ! -f textclass.lst ; then
1247   cat >textclass.lst <<EOF
1248 # This file declares layouts and their associated definition files
1249 # (include dir. relative to the place where this file is).
1250 # It contains only default values, since chkconfig.ltx could not be run 
1251 # for some reason. Run ./configure if you need to update it after a
1252 # configuration change.  
1253 article article article
1254 report  report  report
1255 book    book    book
1256 linuxdoc        linuxdoc        linuxdoc
1257 letter  letter  letter
1258 EOF
1259 fi
1260
1261 # if chkconfig.sed does not exist (because LaTeX did not run), 
1262 # then provide a standard version.
1263 if test ! -f chkconfig.sed ; then
1264   cat >chkconfig.sed <<EOF
1265 s/@.*@/???/g
1266 EOF
1267 fi
1268
1269 echo creating packages.lst
1270 # if packages.lst does not exist (because LaTeX did not run), 
1271 # then provide a standard version.
1272 if test ! -f packages.lst ; then
1273   cat >packages.lst <<EOF
1274 # This file should contain the list of LaTeX packages that have been
1275 # recognized by LyX. Unfortunately, since configure could not find
1276 # your LaTeX2e program, the tests have not been run. Run ./configure
1277 # if you need to update it after a configuration change.
1278
1279 EOF
1280 fi
1281
1282 echo creating doc/LaTeXConfig.lyx
1283 echo "s/@chk_linuxdoc@/$chk_linuxdoc/g" >> chkconfig.sed
1284 echo "s/@chk_docbook@/$chk_docbook/g" >> chkconfig.sed
1285 sed -f chkconfig.sed ${srcdir}/doc/LaTeXConfig.lyx.in >doc/LaTeXConfig.lyx
1286
1287 echo creating $outfile
1288 cat >$outfile <<EOF
1289 # This file has been automatically generated by LyX' lib/configure
1290 # script. It contains default settings that have been determined by
1291 # examining your system. PLEASE DO NOT MODIFY ANYTHING HERE! If you
1292 # want to customize LyX, make a copy of the file LYXDIR/lyxrc as
1293 # ~/.lyx/lyxrc and edit this file instead. Any setting in lyxrc will
1294 # override the values given here.
1295 \\Format text     txt   ASCII           A
1296 \\Format textparagraph txt ASCII(paragraphs)    ""
1297 \\Format docbook  sgml  DocBook         B
1298 \\Format dvi      dvi   DVI             D
1299 \\Format eps      eps   EPS             ""
1300 \\Format epsi     epsi  EPSI    ""
1301 \\Format fax      ""    Fax             ""
1302 \\Format gif      gif   GIF             ""
1303 \\Format html     html  HTML            H
1304 \\Format jpg      jpg   JPEG            ""
1305 \\Format latex    tex   LaTeX           L
1306 \\Format linuxdoc sgml  LinuxDoc        x
1307 \\Format lyx      lyx   LyX             ""
1308 \\Format literate nw    NoWeb           N
1309 \\Format pdf      pdf   PDF             P
1310 \\Format pdf2     pdf  "PDF (pdflatex)" F
1311 \\Format pdf3     pdf  "PDF (dvipdfm)"  m
1312 \\Format png      png   PNG             ""
1313 \\Format ps       ps    Postscript      t
1314 \\Format program  ""    Program         ""
1315 \\Format xpm      xpm   XPM             ""
1316 \\Format word     doc   Word            W
1317
1318 \\converter latex dvi "$latex_to_dvi" "latex"
1319 \\converter latex pdf2 "$latex_to_pdf" "latex"
1320 \\converter latex html "$latex_to_html_command" "originaldir,needaux"
1321 \\converter literate latex "$literate_to_tex_command" ""
1322 \\converter dvi pdf3 "$dvi_to_pdf_command" ""
1323 \\converter dvi ps "$dvi_to_ps_command" ""
1324 \\converter ps pdf "$ps_to_pdf_command" ""
1325 \\converter ps fax "$fax_command" ""
1326 \\converter linuxdoc lyx "$linuxdoc_to_lyx_command" ""
1327 \\converter linuxdoc latex "$linuxdoc_to_latex_command" ""
1328 \\converter linuxdoc dvi "$linuxdoc_to_dvi_command" ""
1329 \\converter linuxdoc html "$linuxdoc_to_html_command" ""
1330 \\converter docbook dvi "$docbook_to_dvi_command" ""
1331 \\converter docbook html "$docbook_to_html_command" ""
1332
1333 \\converter latex lyx "$tex_to_lyx_command" ""
1334 \\converter literate lyx "$literate_to_lyx_command" ""
1335 \\converter html latex "$html_to_latex_command" ""
1336 \\converter word latex "$word_to_latex_command" ""
1337
1338 \\converter gif  eps "$gif_to_eps" ""
1339 \\converter png  eps "$png_to_eps" ""
1340 \\converter jpg  eps "$jpg_to_eps" ""
1341
1342 \\converter gif  png "$gif_to_png" ""
1343 \\converter eps  png "$eps_to_png" ""
1344 \\converter epsi png "$eps_to_png" ""
1345 \\converter jpg  png "$jpg_to_png" ""
1346
1347 \\converter gif  xpm "$gif_to_xpm" ""
1348 \\converter eps  xpm "$eps_to_xpm" ""
1349 \\converter epsi xpm "$eps_to_xpm" ""
1350 \\converter jpg  xpm "$jpg_to_xpm" ""
1351 \\converter png  xpm "$png_to_xpm" ""
1352  
1353 \\converter eps  pdf "$eps_to_pdf" ""
1354 \\converter epsi pdf "$eps_to_pdf" ""
1355
1356 \\viewer dvi "$DVI_VIEWER"
1357 \\viewer html "$HTML_VIEWER"
1358 \\viewer pdf "$PDF_VIEWER"
1359 \\viewer ps "$GHOSTVIEW -swap"
1360 \\viewer eps "$GHOSTVIEW"
1361
1362 $rc_entries
1363 \\font_encoding "$chk_fontenc"
1364 EOF
1365
1366 # Remove superfluous files if we are not writing in the main lib
1367 # directory 
1368 for file in $outfile textclass.lst packages.lst \
1369             doc/LaTeXConfig.lyx ; do
1370   # we rename the file first, so that we avoid comparing a file with itself
1371   mv $file $file.new
1372   if test -r $srcdir/$file && diff $file.new $srcdir/$file >/dev/null 2>/dev/null ; 
1373   then 
1374     echo "removing $file, which is identical to the system global version"
1375     rm -f $file.new
1376   else
1377     mv $file.new $file
1378   fi
1379 done
1380
1381
1382 # Final clean-up
1383 if test $lyx_keep_temps = no ; then
1384 rm -f chkconfig.sed chkconfig.vars wrap_chkconfig.* chklayouts.tex \
1385       missfont.log
1386 fi