]> git.lyx.org Git - features.git/blob - lib/configure
68ee643ee1da0a8b4eb882019b1e72ba43404f8c
[features.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
15 #### Parse the command line
16 for ac_option do
17   case "$ac_option" in
18     -help | --help | -h)
19       cat << EOF
20 Usage: configure [options] 
21 Options: 
22   --help                   show this help lines
23   --keep-temps             keep temporary files (for debug. purposes)
24   --without-latex-config   do not run LaTeX to determine configuration
25 EOF
26       exit 0;;
27     --without-latex-config)
28       lyx_check_config=no ;;
29     --keep-temps)
30       lyx_keep_temps=yes ;;
31   esac 
32 done
33
34
35 #### Checking for some echo oddities
36 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
37   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
38   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
39     ac_n= ac_c='
40 ' ac_t='        '
41   else
42     ac_n=-n ac_c= ac_t=
43   fi
44 else
45   ac_n= ac_c='\c' ac_t=
46 fi
47
48
49 #### I do not really know why this is useful, but we might as well keep it.
50 # NLS nuisances.
51 # Only set these to C if already set.  These must not be set unconditionally
52 # because not all systems understand e.g. LANG=C (notably SCO).
53 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
54 # Non-C LC_CTYPE values break the ctype check.
55 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
56 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
57 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
58 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
59
60
61 #### Guess the directory in which configure is located.
62 ac_prog=$0
63 srcdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` 
64 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
65 test "x$srcdir" = "x$ac_prog" && srcdir=.
66 if test ! -r ${srcdir}/chkconfig.ltx ; then
67   echo "configure: error: cannot find chkconfig.ltx script"
68   exit 1
69 fi
70
71
72 #### Create the build directories if necessary
73 for dir in bind doc kbd layouts templates reLyX ; do
74   test ! -d $dir && mkdir $dir
75 done
76
77
78 #### Searching some useful programs
79 # Search LaTeX2e
80 echo $ac_n "checking for a LaTeX2e program""... $ac_c"
81 echo "$ac_t""(latex latex2e)"
82 LATEX=
83 for ac_prog in latex latex2e
84 do
85 # Extract the first word of "$ac_prog", so it can be a program name with args.
86 set dummy $ac_prog ; ac_word=$2
87 if test -n "$ac_word"; then
88   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
89   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
90   for ac_dir in $PATH; do
91     test -z "$ac_dir" && ac_dir=.
92     if test -x $ac_dir/$ac_word; then
93       LATEX="$ac_prog"
94       break
95     fi
96   done
97   IFS="$ac_save_ifs"
98
99   if test -n "$LATEX"; then
100     ac_result=yes
101   else
102     ac_result=no
103   fi
104   
105 ## Check whether this is really LaTeX2e
106 rm -f chklatex.ltx
107 cat >chklatex.ltx <<EOF
108 \\nonstopmode\\makeatletter
109 \\ifx\\undefined\\documentclass\\else
110   \\message{ThisIsLaTeX2e}
111 \\fi
112 \\@@end
113 EOF
114 if eval ${LATEX} chklatex.ltx </dev/null 2>/dev/null \
115                        | grep 'ThisIsLaTeX2e' >/dev/null; then
116   :
117 else
118   LATEX=
119   ac_result="not useable"
120 fi
121 rm -f chklatex.ltx chklatex.log
122   echo "$ac_t""$ac_result"
123   test -n "$LATEX" && break
124 fi
125 done
126
127 if test -z "$LATEX" ; then
128   LATEX=none
129     lyx_check_config=no
130 fi
131
132 if test x$lyx_check_config != x ; then
133 echo $ac_n "checking for the pdflatex program""... $ac_c"
134 echo "$ac_t""(pdflatex)"
135 PDFLATEX=
136 for ac_prog in pdflatex
137 do
138 # Extract the first word of "$ac_prog", so it can be a program name with args.
139 set dummy $ac_prog ; ac_word=$2
140 if test -n "$ac_word"; then
141   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
142   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
143   for ac_dir in $PATH; do
144     test -z "$ac_dir" && ac_dir=.
145     if test -x $ac_dir/$ac_word; then
146       PDFLATEX="$ac_prog"
147       break
148     fi
149   done
150   IFS="$ac_save_ifs"
151
152   if test -n "$PDFLATEX"; then
153     ac_result=yes
154   else
155     ac_result=no
156   fi
157   
158 ## Check whether this is really LaTeX2e
159 rm -f chklatex.ltx
160 cat >chklatex.ltx <<EOF
161 \\nonstopmode\\makeatletter
162 \\ifx\\undefined\\documentclass\\else
163   \\message{ThisIsLaTeX2e}
164 \\fi
165 \\@@end
166 EOF
167 if eval ${LATEX} chklatex.ltx </dev/null 2>/dev/null \
168                        | grep 'ThisIsLaTeX2e' >/dev/null; then
169   :
170 else
171   LATEX=
172   ac_result="not useable"
173 fi
174 rm -f chklatex.ltx chklatex.log
175   echo "$ac_t""$ac_result"
176   test -n "$PDFLATEX" && break
177 fi
178 done
179
180 if test -z "$PDFLATEX" ; then
181   PDFLATEX=none
182 fi
183
184 fi
185
186 # Search for an installed reLyX or a ready-to-install one
187 save_PATH=${PATH}
188 PATH=${PATH}:./reLyX/
189 echo $ac_n "checking for reLyX LaTeX-to-LyX translator""... $ac_c"
190 echo "$ac_t""(reLyX)"
191 RELYX=
192 for ac_prog in reLyX
193 do
194 # Extract the first word of "$ac_prog", so it can be a program name with args.
195 set dummy $ac_prog ; ac_word=$2
196 if test -n "$ac_word"; then
197   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
198   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
199   for ac_dir in $PATH; do
200     test -z "$ac_dir" && ac_dir=.
201     if test -x $ac_dir/$ac_word; then
202       RELYX="$ac_prog"
203       break
204     fi
205   done
206   IFS="$ac_save_ifs"
207
208   if test -n "$RELYX"; then
209     ac_result=yes
210   else
211     ac_result=no
212   fi
213   
214   echo "$ac_t""$ac_result"
215   test -n "$RELYX" && break
216 fi
217 done
218
219 if test -z "$RELYX" ; then
220   RELYX=none
221 fi
222
223 PATH=${save_PATH}
224
225 # Search something to process a literate document
226 echo $ac_n "checking for a Literate programming processor""... $ac_c"
227 echo "$ac_t""("noweave -delay -index")"
228 LITERATE=
229 for ac_prog in "noweave -delay -index"
230 do
231 # Extract the first word of "$ac_prog", so it can be a program name with args.
232 set dummy $ac_prog ; ac_word=$2
233 if test -n "$ac_word"; then
234   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
235   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
236   for ac_dir in $PATH; do
237     test -z "$ac_dir" && ac_dir=.
238     if test -x $ac_dir/$ac_word; then
239       LITERATE="$ac_prog"
240       break
241     fi
242   done
243   IFS="$ac_save_ifs"
244
245   if test -n "$LITERATE"; then
246     ac_result=yes
247   else
248     ac_result=no
249   fi
250   
251   echo "$ac_t""$ac_result"
252   test -n "$LITERATE" && break
253 fi
254 done
255
256 if test -z "$LITERATE" ; then
257   LITERATE=none
258 fi
259
260 if test "$LITERATE" = "none"; then LITERATE_EXT="none"; else LITERATE_EXT=".nw"; fi
261
262 # Search for a Postscript interpreter
263 echo $ac_n "checking for a Postscript interpreter""... $ac_c"
264 echo "$ac_t""(gs)"
265 GS=
266 for ac_prog in gs
267 do
268 # Extract the first word of "$ac_prog", so it can be a program name with args.
269 set dummy $ac_prog ; ac_word=$2
270 if test -n "$ac_word"; then
271   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
272   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
273   for ac_dir in $PATH; do
274     test -z "$ac_dir" && ac_dir=.
275     if test -x $ac_dir/$ac_word; then
276       GS="$ac_prog"
277       break
278     fi
279   done
280   IFS="$ac_save_ifs"
281
282   if test -n "$GS"; then
283     ac_result=yes
284   else
285     ac_result=no
286   fi
287   
288   echo "$ac_t""$ac_result"
289   test -n "$GS" && break
290 fi
291 done
292
293 if test -z "$GS" ; then
294   GS=none
295 fi
296
297
298 # Search something to preview postscript
299 echo $ac_n "checking for a Postscript previewer""... $ac_c"
300 echo "$ac_t""(gv ghostview)"
301 GHOSTVIEW=
302 for ac_prog in gv ghostview
303 do
304 # Extract the first word of "$ac_prog", so it can be a program name with args.
305 set dummy $ac_prog ; ac_word=$2
306 if test -n "$ac_word"; then
307   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
308   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
309   for ac_dir in $PATH; do
310     test -z "$ac_dir" && ac_dir=.
311     if test -x $ac_dir/$ac_word; then
312       GHOSTVIEW="$ac_prog"
313       break
314     fi
315   done
316   IFS="$ac_save_ifs"
317
318   if test -n "$GHOSTVIEW"; then
319     ac_result=yes
320   else
321     ac_result=no
322   fi
323   
324   echo "$ac_t""$ac_result"
325   test -n "$GHOSTVIEW" && break
326 fi
327 done
328
329 if test -z "$GHOSTVIEW" ; then
330   GHOSTVIEW=none
331 fi
332
333
334 # Search a *roff program (used to translate tables in ASCII export)
335 echo $ac_n "checking for a *roff formatter""... $ac_c"
336 echo "$ac_t""(groff nroff)"
337 ROFF=
338 for ac_prog in groff nroff
339 do
340 # Extract the first word of "$ac_prog", so it can be a program name with args.
341 set dummy $ac_prog ; ac_word=$2
342 if test -n "$ac_word"; then
343   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
344   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
345   for ac_dir in $PATH; do
346     test -z "$ac_dir" && ac_dir=.
347     if test -x $ac_dir/$ac_word; then
348       ROFF="$ac_prog"
349       break
350     fi
351   done
352   IFS="$ac_save_ifs"
353
354   if test -n "$ROFF"; then
355     ac_result=yes
356   else
357     ac_result=no
358   fi
359   
360   echo "$ac_t""$ac_result"
361   test -n "$ROFF" && break
362 fi
363 done
364
365 if test -z "$ROFF" ; then
366   ROFF=none
367 fi
368
369 ascii_roff_command=$ROFF
370 test $ROFF = "groff" && ascii_roff_command="groff -t -Tlatin1 \$\$FName"
371 test $ROFF = "nroff" && ascii_roff_command="tbl \$\$FName | nroff"
372
373 # Search the ChkTeX program
374 echo $ac_n "checking for ChkTeX""... $ac_c"
375 echo "$ac_t""(chktex)"
376 CHKTEX=
377 for ac_prog in chktex
378 do
379 # Extract the first word of "$ac_prog", so it can be a program name with args.
380 set dummy $ac_prog ; ac_word=$2
381 if test -n "$ac_word"; then
382   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
383   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
384   for ac_dir in $PATH; do
385     test -z "$ac_dir" && ac_dir=.
386     if test -x $ac_dir/$ac_word; then
387       CHKTEX="$ac_prog"
388       break
389     fi
390   done
391   IFS="$ac_save_ifs"
392
393   if test -n "$CHKTEX"; then
394     ac_result=yes
395   else
396     ac_result=no
397   fi
398   
399   echo "$ac_t""$ac_result"
400   test -n "$CHKTEX" && break
401 fi
402 done
403
404 if test -z "$CHKTEX" ; then
405   CHKTEX=none
406 fi
407
408 chktex_command=$CHKTEX
409 test $CHKTEX = "chktex" && chktex_command="$CHKTEX -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38"
410
411 # Search for a spellchecker
412 echo $ac_n "checking for a spell-checker""... $ac_c"
413 echo "$ac_t""(ispell)"
414 SPELL=
415 for ac_prog in ispell
416 do
417 # Extract the first word of "$ac_prog", so it can be a program name with args.
418 set dummy $ac_prog ; ac_word=$2
419 if test -n "$ac_word"; then
420   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
421   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
422   for ac_dir in $PATH; do
423     test -z "$ac_dir" && ac_dir=.
424     if test -x $ac_dir/$ac_word; then
425       SPELL="$ac_prog"
426       break
427     fi
428   done
429   IFS="$ac_save_ifs"
430
431   if test -n "$SPELL"; then
432     ac_result=yes
433   else
434     ac_result=no
435   fi
436   
437   echo "$ac_t""$ac_result"
438   test -n "$SPELL" && break
439 fi
440 done
441
442 if test -z "$SPELL" ; then
443   SPELL=none
444 fi
445
446
447 # Search a Fax handling program
448 echo $ac_n "checking for a fax driver""... $ac_c"
449 echo "$ac_t""(sendfax faxsend fax)"
450 FAX=
451 for ac_prog in sendfax faxsend fax
452 do
453 # Extract the first word of "$ac_prog", so it can be a program name with args.
454 set dummy $ac_prog ; ac_word=$2
455 if test -n "$ac_word"; then
456   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
457   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
458   for ac_dir in $PATH; do
459     test -z "$ac_dir" && ac_dir=.
460     if test -x $ac_dir/$ac_word; then
461       FAX="$ac_prog"
462       break
463     fi
464   done
465   IFS="$ac_save_ifs"
466
467   if test -n "$FAX"; then
468     ac_result=yes
469   else
470     ac_result=no
471   fi
472   
473   echo "$ac_t""$ac_result"
474   test -n "$FAX" && break
475 fi
476 done
477
478 if test -z "$FAX" ; then
479   FAX=none
480 fi
481
482 if test $FAX = sendfax ; then
483   fax_command="sendfax -n -h '\$\$Host' -c '\$\$Comment' -x '\$\$Enterprise' -d '\$\$Name'@'\$\$Phone' '\$\$FName'"
484 elif test $FAX = faxsend ; then
485   fax_command="faxsend '\$\$Phone' '\$\$FName'"
486 elif test $FAX = fax ; then
487   fax_command="fax send '\$\$Phone' '\$\$FName'"
488 else
489   fax_command="none"
490 fi
491
492 # Search for LinuxDoc support
493 echo $ac_n "checking for SGML-tools 1.x (LinuxDoc)""... $ac_c"
494 echo "$ac_t""(sgml2lyx)"
495 LINUXDOC=
496 for ac_prog in sgml2lyx
497 do
498 # Extract the first word of "$ac_prog", so it can be a program name with args.
499 set dummy $ac_prog ; ac_word=$2
500 if test -n "$ac_word"; then
501   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
502   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
503   for ac_dir in $PATH; do
504     test -z "$ac_dir" && ac_dir=.
505     if test -x $ac_dir/$ac_word; then
506       LINUXDOC="$ac_prog"
507       break
508     fi
509   done
510   IFS="$ac_save_ifs"
511
512   if test -n "$LINUXDOC"; then
513     ac_result=yes
514   else
515     ac_result=no
516   fi
517   
518   echo "$ac_t""$ac_result"
519   test -n "$LINUXDOC" && break
520 fi
521 done
522
523 if test -z "$LINUXDOC" ; then
524   LINUXDOC=none
525 fi
526
527 chk_linuxdoc=no
528 if test $LINUXDOC != none; then
529   chk_linuxdoc=yes
530   linuxdoc_cmd="\\def\\haslinuxdoc{yes}"
531 fi
532
533 # Search for DocBook support
534 echo $ac_n "checking for SGML-tools 2.x (DocBook)""... $ac_c"
535 echo "$ac_t""(sgmltools)"
536 DOCBOOK=
537 for ac_prog in sgmltools
538 do
539 # Extract the first word of "$ac_prog", so it can be a program name with args.
540 set dummy $ac_prog ; ac_word=$2
541 if test -n "$ac_word"; then
542   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
543   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
544   for ac_dir in $PATH; do
545     test -z "$ac_dir" && ac_dir=.
546     if test -x $ac_dir/$ac_word; then
547       DOCBOOK="$ac_prog"
548       break
549     fi
550   done
551   IFS="$ac_save_ifs"
552
553   if test -n "$DOCBOOK"; then
554     ac_result=yes
555   else
556     ac_result=no
557   fi
558   
559   echo "$ac_t""$ac_result"
560   test -n "$DOCBOOK" && break
561 fi
562 done
563
564 if test -z "$DOCBOOK" ; then
565   DOCBOOK=none
566 fi
567
568 chk_docbook=no
569 if test $DOCBOOK != none; then
570   chk_docbook=yes
571   docbook_cmd="\\def\\hasdocbook{yes}"
572 fi
573
574
575 # Search for a spool command
576 echo $ac_n "checking for a spool command""... $ac_c"
577 echo "$ac_t""(lp lpr)"
578 LPR=
579 for ac_prog in lp lpr
580 do
581 # Extract the first word of "$ac_prog", so it can be a program name with args.
582 set dummy $ac_prog ; ac_word=$2
583 if test -n "$ac_word"; then
584   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
585   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
586   for ac_dir in $PATH; do
587     test -z "$ac_dir" && ac_dir=.
588     if test -x $ac_dir/$ac_word; then
589       LPR="$ac_prog"
590       break
591     fi
592   done
593   IFS="$ac_save_ifs"
594
595   if test -n "$LPR"; then
596     ac_result=yes
597   else
598     ac_result=no
599   fi
600   
601   echo "$ac_t""$ac_result"
602   test -n "$LPR" && break
603 fi
604 done
605
606 if test -z "$LPR" ; then
607   LPR=none
608 fi
609
610 case $LPR in
611   lp) print_spool_command=lp
612       print_spool_printerprefix="-d ";;
613  lpr) print_spool_command=lpr
614       print_spool_printerprefix="-P";;
615    *) :;; # leave to empty values
616 esac
617
618 # Search for a latex to html converter
619 echo $ac_n "checking for an HTML converter""... $ac_c"
620 echo "$ac_t""(tth latex2html hevea)"
621 TOHTML=
622 for ac_prog in tth latex2html hevea
623 do
624 # Extract the first word of "$ac_prog", so it can be a program name with args.
625 set dummy $ac_prog ; ac_word=$2
626 if test -n "$ac_word"; then
627   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
628   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
629   for ac_dir in $PATH; do
630     test -z "$ac_dir" && ac_dir=.
631     if test -x $ac_dir/$ac_word; then
632       TOHTML="$ac_prog"
633       break
634     fi
635   done
636   IFS="$ac_save_ifs"
637
638   if test -n "$TOHTML"; then
639     ac_result=yes
640   else
641     ac_result=no
642   fi
643   
644   echo "$ac_t""$ac_result"
645   test -n "$TOHTML" && break
646 fi
647 done
648
649 if test -z "$TOHTML" ; then
650   TOHTML=none
651 fi
652
653 case $TOHTML in
654         tth) html_command="tth -t < '\$\$FName' > '\$\$OutName'";;
655  latex2html) html_command="latex2html -no_subdir -split 0 -show_section_numbers '\$\$FName'";;
656       hevea) html_command="hevea -s '\$\$FName'";;
657 esac
658
659 #### Explore the LaTeX configuration
660 echo $ac_n "checking LaTeX configuration""... $ac_c"
661 # First, remove the files that we want to re-create
662 rm -f textclass.lst packages.lst chkconfig.sed
663 if test ${lyx_check_config} = no ; then
664   echo "$ac_t""default values"
665 else
666   echo "$ac_t""auto"
667   rm -f wrap_chkconfig.ltx chkconfig.vars chkconfig.classes chklayouts.tex
668   cat >wrap_chkconfig.ltx <<EOF
669 \\newcommand\\srcdir{${srcdir}}
670 ${linuxdoc_cmd}
671 ${docbook_cmd}
672 \\input{${srcdir}/chkconfig.ltx}
673 EOF
674   ## Construct the list of classes to test for.
675   # build the list of available layout files and convert it to commands 
676   # for chkconfig.ltx 
677   for file in ./layouts/*.layout ${srcdir}/layouts/*.layout ; do 
678     case $file in
679       */\*.layout) ;;
680       *) echo $file ;;
681     esac
682   done | sed -e 's%^.*layouts/\(.*\)\.layout$%\\TestDocClass{\1}%'\
683              > chklayouts.tex
684   eval ${LATEX} wrap_chkconfig.ltx 2>/dev/null | grep '^\+'
685   eval `cat chkconfig.vars | sed 's/-/_/g'`
686 fi
687
688 # Do we have all the files we need? Useful if latex did not run
689 echo creating textclass.lst 
690 # if textclass.lst does not exist (because LaTeX did not run), 
691 # then provide a standard version.
692 if test ! -f textclass.lst ; then
693   cat >textclass.lst <<EOF
694 # This file declares layouts and their associated definition files
695 # (include dir. relative to the place where this file is).
696 # It contains only default values, since chkconfig.ltx could not be run 
697 # for some reason. Run ./configure if you need to update it after a
698 # configuration change.  
699 article article article
700 report  report  report
701 book    book    book
702 linuxdoc        linuxdoc        linuxdoc
703 letter  letter  letter
704 EOF
705 fi
706
707 # if chkconfig.sed does not exist (because LaTeX did not run), 
708 # then provide a standard version.
709 if test ! -f chkconfig.sed ; then
710   cat >chkconfig.sed <<EOF
711 s/@.*@/???/g
712 EOF
713 fi
714
715 echo creating packages.lst
716 # if packages.lst does not exist (because LaTeX did not run), 
717 # then provide a standard version.
718 if test ! -f packages.lst ; then
719   cat >packages.lst <<EOF
720 # This file should contain the list of LaTeX packages that have been
721 # recognized by LyX. Unfortunately, since configure could not find
722 # your LaTeX2e program, the tests have not been run. Run ./configure
723 # if you need to update it after a configuration change.
724
725 EOF
726 fi
727
728 echo creating doc/LaTeXConfig.lyx
729 echo "s/@chk_linuxdoc@/$chk_linuxdoc/g" >> chkconfig.sed
730 echo "s/@chk_docbook@/$chk_docbook/g" >> chkconfig.sed
731 sed -f chkconfig.sed ${srcdir}/doc/LaTeXConfig.lyx.in >doc/LaTeXConfig.lyx
732
733 echo creating lyxrc.defaults
734 rm -f lyxrc.defaults
735 cat >lyxrc.defaults <<EOF
736 # This file has been automatically generated by LyX' lib/configure
737 # script. It contains default settings that have been determined by
738 # examining your system. PLEASE DO NOT MODIFY ANYTHING HERE! If you
739 # want to customize LyX, make a copy of the file LYXDIR/lyxrc as
740 # ~/.lyx/lyxrc and edit this file instead. Any setting in lyxrc will
741 # override the values given here.
742 \\latex_command "$LATEX"
743 \\relyx_command "$RELYX"
744 \\literate_command "$LITERATE"
745 \\literate_extension "$LITERATE_EXT"
746 \\ps_command "$GS"
747 \\view_ps_command "$GHOSTVIEW -swap"
748 \\view_pspic_command "$GHOSTVIEW"
749 \\ascii_roff_command "$ascii_roff_command"
750 \\chktex_command "$chktex_command"
751 \\spell_command "$SPELL"
752 \\fax_command "$fax_command"
753 \\html_command "$html_command"
754 \\print_spool_command "$print_spool_command"
755 \\print_spool_printerprefix "$print_spool_printerprefix"
756 \\font_encoding "$chk_fontenc"
757 EOF
758
759 # Remove superfluous files if we are not writing in the main lib
760 # directory 
761 for file in lyxrc.defaults textclass.lst packages.lst \
762             doc/LaTeXConfig.lyx ; do
763   # we rename the file first, so that we avoid comparing a file with itself
764   mv $file $file.new
765   if test -r $srcdir/$file && diff $file.new $srcdir/$file >/dev/null 2>/dev/null ; 
766   then 
767     echo "removing $file, which is identical to the system global version"
768     rm -f $file.new
769   else
770     mv $file.new $file
771   fi
772 done
773
774
775 # Final clean-up
776 if test $lyx_keep_temps = no ; then
777 rm -f chkconfig.sed chkconfig.vars wrap_chkconfig.* chklayouts.tex \
778       missfont.log
779 fi