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