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.
10 ####some configuration variables
15 #### Parse the command line
20 Usage: configure [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
27 --without-latex-config)
28 lyx_check_config=no ;;
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
49 #### I do not really know why this is useful, but we might as well keep it.
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
61 #### Guess the directory in which configure is located.
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"
72 #### Create the build directories if necessary
73 for dir in bind clipart doc examples images kbd layouts reLyX \
74 scripts templates ui ; do
75 test ! -d $dir && mkdir $dir
79 #### Searching some useful programs
81 echo $ac_n "checking for a LaTeX2e program""... $ac_c"
82 echo "$ac_t""(latex latex2e)"
84 for ac_prog in latex latex2e
86 # Extract the first word of "$ac_prog", so it can be a program name with args.
87 set dummy $ac_prog ; ac_word=$2
88 if test -n "$ac_word"; then
89 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
90 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
91 for ac_dir in $PATH; do
92 test -z "$ac_dir" && ac_dir=.
93 if test -x $ac_dir/$ac_word; then
100 if test -n "$LATEX"; then
106 ## Check whether this is really LaTeX2e
108 cat >chklatex.ltx <<EOF
109 \\nonstopmode\\makeatletter
110 \\ifx\\undefined\\documentclass\\else
111 \\message{ThisIsLaTeX2e}
115 if eval ${LATEX} chklatex.ltx </dev/null 2>/dev/null \
116 | grep 'ThisIsLaTeX2e' >/dev/null; then
120 ac_result="not useable"
122 rm -f chklatex.ltx chklatex.log
123 echo "$ac_t""$ac_result"
124 test -n "$LATEX" && break
128 if test -z "$LATEX" ; then
133 if test x$lyx_check_config != x ; then
134 echo $ac_n "checking for the pdflatex program""... $ac_c"
135 echo "$ac_t""(pdflatex)"
137 for ac_prog in pdflatex
139 # Extract the first word of "$ac_prog", so it can be a program name with args.
140 set dummy $ac_prog ; ac_word=$2
141 if test -n "$ac_word"; then
142 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
143 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
144 for ac_dir in $PATH; do
145 test -z "$ac_dir" && ac_dir=.
146 if test -x $ac_dir/$ac_word; then
153 if test -n "$PDFLATEX"; then
159 ## Check whether this is really LaTeX2e
161 cat >chklatex.ltx <<EOF
162 \\nonstopmode\\makeatletter
163 \\ifx\\undefined\\documentclass\\else
164 \\message{ThisIsLaTeX2e}
168 if eval ${LATEX} chklatex.ltx </dev/null 2>/dev/null \
169 | grep 'ThisIsLaTeX2e' >/dev/null; then
173 ac_result="not useable"
175 rm -f chklatex.ltx chklatex.log
176 echo "$ac_t""$ac_result"
177 test -n "$PDFLATEX" && break
181 if test -z "$PDFLATEX" ; then
187 # Search for an installed reLyX or a ready-to-install one
189 PATH=${PATH}:./reLyX/
190 echo $ac_n "checking for a LaTeX -> LyX converter""... $ac_c"
191 echo "$ac_t""(reLyX)"
195 # Extract the first word of "$ac_prog", so it can be a program name with args.
196 set dummy $ac_prog ; ac_word=$2
197 if test -n "$ac_word"; then
198 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
199 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
200 for ac_dir in $PATH; do
201 test -z "$ac_dir" && ac_dir=.
202 if test -x $ac_dir/$ac_word; then
203 tex_to_lyx_command="$ac_prog"
209 if test -n "$tex_to_lyx_command"; then
215 echo "$ac_t""$ac_result"
216 test -n "$tex_to_lyx_command" && break
220 if test -z "$tex_to_lyx_command" ; then
221 tex_to_lyx_command=none
225 test $tex_to_lyx_command = "reLyX" && tex_to_lyx_command="reLyX -f \$\$FName"
227 echo $ac_n "checking for a Noweb -> LyX converter""... $ac_c"
228 echo "$ac_t""(noweb2lyx)"
229 literate_to_lyx_command=
230 for ac_prog in noweb2lyx
232 # Extract the first word of "$ac_prog", so it can be a program name with args.
233 set dummy $ac_prog ; ac_word=$2
234 if test -n "$ac_word"; then
235 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
236 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
237 for ac_dir in $PATH; do
238 test -z "$ac_dir" && ac_dir=.
239 if test -x $ac_dir/$ac_word; then
240 literate_to_lyx_command="$ac_prog"
246 if test -n "$literate_to_lyx_command"; then
252 echo "$ac_t""$ac_result"
253 test -n "$literate_to_lyx_command" && break
257 if test -z "$literate_to_lyx_command" ; then
258 literate_to_lyx_command=none
261 test $literate_to_lyx_command = "noweb2lyx" && literate_to_lyx_command="noweb2lyx \$\$FName \$\$OutName"
263 # Search something to process a literate document
264 echo $ac_n "checking for a Noweb -> LaTeX converter""... $ac_c"
265 echo "$ac_t""(noweave)"
266 literate_to_tex_command=
267 for ac_prog in noweave
269 # Extract the first word of "$ac_prog", so it can be a program name with args.
270 set dummy $ac_prog ; ac_word=$2
271 if test -n "$ac_word"; then
272 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
273 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
274 for ac_dir in $PATH; do
275 test -z "$ac_dir" && ac_dir=.
276 if test -x $ac_dir/$ac_word; then
277 literate_to_tex_command="$ac_prog"
283 if test -n "$literate_to_tex_command"; then
289 echo "$ac_t""$ac_result"
290 test -n "$literate_to_tex_command" && break
294 if test -z "$literate_to_tex_command" ; then
295 literate_to_tex_command=none
298 test $literate_to_tex_command = "noweave" && literate_to_tex_command="noweave -delay -index \$\$FName > \$\$OutName"
300 echo $ac_n "checking for a HTML -> Latex converter""... $ac_c"
301 echo "$ac_t""(html2latex)"
302 html_to_latex_command=
303 for ac_prog in html2latex
305 # Extract the first word of "$ac_prog", so it can be a program name with args.
306 set dummy $ac_prog ; ac_word=$2
307 if test -n "$ac_word"; then
308 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
309 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
310 for ac_dir in $PATH; do
311 test -z "$ac_dir" && ac_dir=.
312 if test -x $ac_dir/$ac_word; then
313 html_to_latex_command="$ac_prog"
319 if test -n "$html_to_latex_command"; then
325 echo "$ac_t""$ac_result"
326 test -n "$html_to_latex_command" && break
330 if test -z "$html_to_latex_command" ; then
331 html_to_latex_command=none
334 test $html_to_latex_command = "html2latex" && html_to_latex_command="html2latex \$\$FName"
336 echo $ac_n "checking for Image converter""... $ac_c"
337 echo "$ac_t""(convert)"
339 for ac_prog in convert
341 # Extract the first word of "$ac_prog", so it can be a program name with args.
342 set dummy $ac_prog ; ac_word=$2
343 if test -n "$ac_word"; then
344 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
345 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
346 for ac_dir in $PATH; do
347 test -z "$ac_dir" && ac_dir=.
348 if test -x $ac_dir/$ac_word; then
349 image_command="$ac_prog"
355 if test -n "$image_command"; then
361 echo "$ac_t""$ac_result"
362 test -n "$image_command" && break
366 if test -z "$image_command" ; then
370 test $image_command = "convert" && image_command="convert \$\$FName \$\$OutName"
372 # Search for a Postscript interpreter
373 echo $ac_n "checking for a Postscript interpreter""... $ac_c"
378 # Extract the first word of "$ac_prog", so it can be a program name with args.
379 set dummy $ac_prog ; ac_word=$2
380 if test -n "$ac_word"; then
381 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
382 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
383 for ac_dir in $PATH; do
384 test -z "$ac_dir" && ac_dir=.
385 if test -x $ac_dir/$ac_word; then
392 if test -n "$GS"; then
398 echo "$ac_t""$ac_result"
399 test -n "$GS" && break
403 if test -z "$GS" ; then
408 # Search something to preview postscript
409 echo $ac_n "checking for a Postscript previewer""... $ac_c"
410 echo "$ac_t""(gv ghostview)"
412 for ac_prog in gv ghostview
414 # Extract the first word of "$ac_prog", so it can be a program name with args.
415 set dummy $ac_prog ; ac_word=$2
416 if test -n "$ac_word"; then
417 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
418 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
419 for ac_dir in $PATH; do
420 test -z "$ac_dir" && ac_dir=.
421 if test -x $ac_dir/$ac_word; then
428 if test -n "$GHOSTVIEW"; then
434 echo "$ac_t""$ac_result"
435 test -n "$GHOSTVIEW" && break
439 if test -z "$GHOSTVIEW" ; then
444 # Search for a program to preview pdf
445 echo $ac_n "checking for a PDF preview""... $ac_c"
446 echo "$ac_t""(acroread gv ghostview xpdf)"
448 for ac_prog in acroread gv ghostview xpdf
450 # Extract the first word of "$ac_prog", so it can be a program name with args.
451 set dummy $ac_prog ; ac_word=$2
452 if test -n "$ac_word"; then
453 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
454 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
455 for ac_dir in $PATH; do
456 test -z "$ac_dir" && ac_dir=.
457 if test -x $ac_dir/$ac_word; then
458 PDF_VIEWER="$ac_prog"
464 if test -n "$PDF_VIEWER"; then
470 echo "$ac_t""$ac_result"
471 test -n "$PDF_VIEWER" && break
475 if test -z "$PDF_VIEWER" ; then
480 # Search something to preview dvi
481 echo $ac_n "checking for a DVI previewer""... $ac_c"
486 # Extract the first word of "$ac_prog", so it can be a program name with args.
487 set dummy $ac_prog ; ac_word=$2
488 if test -n "$ac_word"; then
489 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
490 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
491 for ac_dir in $PATH; do
492 test -z "$ac_dir" && ac_dir=.
493 if test -x $ac_dir/$ac_word; then
494 DVI_VIEWER="$ac_prog"
500 if test -n "$DVI_VIEWER"; then
506 echo "$ac_t""$ac_result"
507 test -n "$DVI_VIEWER" && break
511 if test -z "$DVI_VIEWER" ; then
516 # Search something to preview html
517 echo $ac_n "checking for a HTML previewer""... $ac_c"
518 echo "$ac_t""(netscape)"
520 for ac_prog in netscape
522 # Extract the first word of "$ac_prog", so it can be a program name with args.
523 set dummy $ac_prog ; ac_word=$2
524 if test -n "$ac_word"; then
525 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
526 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
527 for ac_dir in $PATH; do
528 test -z "$ac_dir" && ac_dir=.
529 if test -x $ac_dir/$ac_word; then
530 HTML_VIEWER="$ac_prog"
536 if test -n "$HTML_VIEWER"; then
542 echo "$ac_t""$ac_result"
543 test -n "$HTML_VIEWER" && break
547 if test -z "$HTML_VIEWER" ; then
552 # Search for a program to convert ps to pdf
553 echo $ac_n "checking for a PS to PDF converter""... $ac_c"
554 echo "$ac_t""(ps2pdf)"
556 for ac_prog in ps2pdf
558 # Extract the first word of "$ac_prog", so it can be a program name with args.
559 set dummy $ac_prog ; ac_word=$2
560 if test -n "$ac_word"; then
561 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
562 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
563 for ac_dir in $PATH; do
564 test -z "$ac_dir" && ac_dir=.
565 if test -x $ac_dir/$ac_word; then
566 ps_to_pdf_command="$ac_prog"
572 if test -n "$ps_to_pdf_command"; then
578 echo "$ac_t""$ac_result"
579 test -n "$ps_to_pdf_command" && break
583 if test -z "$ps_to_pdf_command" ; then
584 ps_to_pdf_command=none
587 test $ps_to_pdf_command = "ps2pdf" && ps_to_pdf_command="ps2pdf \$\$FName"
589 # Search for a program to convert dvi to ps
590 echo $ac_n "checking for a DVI to PS converter""... $ac_c"
591 echo "$ac_t""(dvips)"
595 # Extract the first word of "$ac_prog", so it can be a program name with args.
596 set dummy $ac_prog ; ac_word=$2
597 if test -n "$ac_word"; then
598 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
599 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
600 for ac_dir in $PATH; do
601 test -z "$ac_dir" && ac_dir=.
602 if test -x $ac_dir/$ac_word; then
603 dvi_to_ps_command="$ac_prog"
609 if test -n "$dvi_to_ps_command"; then
615 echo "$ac_t""$ac_result"
616 test -n "$dvi_to_ps_command" && break
620 if test -z "$dvi_to_ps_command" ; then
621 dvi_to_ps_command=none
624 test $dvi_to_ps_command = "dvips" && dvi_to_ps_command="dvips -o \$\$OutName \$\$FName"
626 # Search a *roff program (used to translate tables in ASCII export)
627 echo $ac_n "checking for a *roff formatter""... $ac_c"
628 echo "$ac_t""(groff nroff)"
630 for ac_prog in groff nroff
632 # Extract the first word of "$ac_prog", so it can be a program name with args.
633 set dummy $ac_prog ; ac_word=$2
634 if test -n "$ac_word"; then
635 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
636 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
637 for ac_dir in $PATH; do
638 test -z "$ac_dir" && ac_dir=.
639 if test -x $ac_dir/$ac_word; then
646 if test -n "$ROFF"; then
652 echo "$ac_t""$ac_result"
653 test -n "$ROFF" && break
657 if test -z "$ROFF" ; then
661 ascii_roff_command=$ROFF
662 test $ROFF = "groff" && ascii_roff_command="groff -t -Tlatin1 \$\$FName"
663 test $ROFF = "nroff" && ascii_roff_command="tbl \$\$FName | nroff"
665 # Search the ChkTeX program
666 echo $ac_n "checking for ChkTeX""... $ac_c"
667 echo "$ac_t""(chktex)"
669 for ac_prog in chktex
671 # Extract the first word of "$ac_prog", so it can be a program name with args.
672 set dummy $ac_prog ; ac_word=$2
673 if test -n "$ac_word"; then
674 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
675 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
676 for ac_dir in $PATH; do
677 test -z "$ac_dir" && ac_dir=.
678 if test -x $ac_dir/$ac_word; then
685 if test -n "$CHKTEX"; then
691 echo "$ac_t""$ac_result"
692 test -n "$CHKTEX" && break
696 if test -z "$CHKTEX" ; then
700 chktex_command=$CHKTEX
701 test $CHKTEX = "chktex" && chktex_command="$CHKTEX -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38"
703 # Search for a spellchecker
704 echo $ac_n "checking for a spell-checker""... $ac_c"
705 echo "$ac_t""(ispell)"
707 for ac_prog in ispell
709 # Extract the first word of "$ac_prog", so it can be a program name with args.
710 set dummy $ac_prog ; ac_word=$2
711 if test -n "$ac_word"; then
712 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
713 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
714 for ac_dir in $PATH; do
715 test -z "$ac_dir" && ac_dir=.
716 if test -x $ac_dir/$ac_word; then
723 if test -n "$SPELL"; then
729 echo "$ac_t""$ac_result"
730 test -n "$SPELL" && break
734 if test -z "$SPELL" ; then
739 # Search a Fax handling program
740 echo $ac_n "checking for a fax driver""... $ac_c"
741 echo "$ac_t""(sendfax faxsend fax)"
743 for ac_prog in sendfax faxsend fax
745 # Extract the first word of "$ac_prog", so it can be a program name with args.
746 set dummy $ac_prog ; ac_word=$2
747 if test -n "$ac_word"; then
748 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
749 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
750 for ac_dir in $PATH; do
751 test -z "$ac_dir" && ac_dir=.
752 if test -x $ac_dir/$ac_word; then
759 if test -n "$FAX"; then
765 echo "$ac_t""$ac_result"
766 test -n "$FAX" && break
770 if test -z "$FAX" ; then
774 if test $FAX = sendfax ; then
775 fax_command="sendfax -n -h '\$\$Host' -c '\$\$Comment' -x '\$\$Enterprise' -d '\$\$Name'@'\$\$Phone' '\$\$FName'"
776 elif test $FAX = faxsend ; then
777 fax_command="faxsend '\$\$Phone' '\$\$FName'"
778 elif test $FAX = fax ; then
779 fax_command="fax send '\$\$Phone' '\$\$FName'"
784 # Search for LinuxDoc support
785 echo $ac_n "checking for SGML-tools 1.x (LinuxDoc)""... $ac_c"
786 echo "$ac_t""(sgml2lyx)"
788 for ac_prog in sgml2lyx
790 # Extract the first word of "$ac_prog", so it can be a program name with args.
791 set dummy $ac_prog ; ac_word=$2
792 if test -n "$ac_word"; then
793 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
794 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
795 for ac_dir in $PATH; do
796 test -z "$ac_dir" && ac_dir=.
797 if test -x $ac_dir/$ac_word; then
804 if test -n "$LINUXDOC"; then
810 echo "$ac_t""$ac_result"
811 test -n "$LINUXDOC" && break
815 if test -z "$LINUXDOC" ; then
820 if test $LINUXDOC != none; then
822 linuxdoc_cmd="\\def\\haslinuxdoc{yes}"
827 linuxdoc_to_latex_command="sgml2latex \$\$FName"
828 linuxdoc_to_dvi_command="sgml2latex -o dvi \$\$FName"
829 linuxdoc_to_html_command="sgml2html \$\$FName"
830 linuxdoc_to_lyx_command="sgml2lyx \$\$FName";;
832 linuxdoc_to_latex_command="none"
833 linuxdoc_to_dvi_command="none"
834 linuxdoc_to_html_command="none"
835 linuxdoc_to_lyx_command="none";;
838 # Search for DocBook support
839 echo $ac_n "checking for SGML-tools 2.x (DocBook) or db2x scripts""... $ac_c"
840 echo "$ac_t""(sgmltools db2dvi)"
842 for ac_prog in sgmltools db2dvi
844 # Extract the first word of "$ac_prog", so it can be a program name with args.
845 set dummy $ac_prog ; ac_word=$2
846 if test -n "$ac_word"; then
847 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
848 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
849 for ac_dir in $PATH; do
850 test -z "$ac_dir" && ac_dir=.
851 if test -x $ac_dir/$ac_word; then
858 if test -n "$DOCBOOK"; then
864 echo "$ac_t""$ac_result"
865 test -n "$DOCBOOK" && break
869 if test -z "$DOCBOOK" ; then
874 if test $DOCBOOK != none; then
876 docbook_cmd="\\def\\hasdocbook{yes}"
881 docbook_to_dvi_command="sgmltools -b dvi \$\$FName"
882 docbook_to_html_command="sgmltools -b html \$\$FName";;
884 docbook_to_dvi_command="db2dvi \$\$FName"
885 docbook_to_html_command="db2html \$\$FName";;
887 docbook_to_dvi_command="none"
888 docbook_to_html_command="none";;
891 # Search for a spool command
892 echo $ac_n "checking for a spool command""... $ac_c"
893 echo "$ac_t""(lp lpr)"
895 for ac_prog in lp lpr
897 # Extract the first word of "$ac_prog", so it can be a program name with args.
898 set dummy $ac_prog ; ac_word=$2
899 if test -n "$ac_word"; then
900 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
901 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
902 for ac_dir in $PATH; do
903 test -z "$ac_dir" && ac_dir=.
904 if test -x $ac_dir/$ac_word; then
911 if test -n "$LPR"; then
917 echo "$ac_t""$ac_result"
918 test -n "$LPR" && break
922 if test -z "$LPR" ; then
927 lp) print_spool_command=lp
928 print_spool_printerprefix="-d ";;
929 lpr) print_spool_command=lpr
930 print_spool_printerprefix="-P";;
931 *) :;; # leave to empty values
934 echo $ac_n "checking for a LaTeX -> HTML converter""... $ac_c"
935 echo "$ac_t""(tth latex2html hevea)"
937 for ac_prog in tth latex2html hevea
939 # Extract the first word of "$ac_prog", so it can be a program name with args.
940 set dummy $ac_prog ; ac_word=$2
941 if test -n "$ac_word"; then
942 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
943 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
944 for ac_dir in $PATH; do
945 test -z "$ac_dir" && ac_dir=.
946 if test -x $ac_dir/$ac_word; then
953 if test -n "$TOHTML"; then
959 echo "$ac_t""$ac_result"
960 test -n "$TOHTML" && break
964 if test -z "$TOHTML" ; then
968 latex_to_html_command = $TOHTML
970 tth) latex_to_html_command="tth -t -e2 -L\$\$BaseName < \$\$FName > \$\$OutName";;
971 latex2html) latex_to_html_command="latex2html -no_subdir -split 0 -show_section_numbers \$\$FName";;
972 hevea) latex_to_html_command="hevea -s \$\$FName";;
975 #### Explore the LaTeX configuration
976 echo $ac_n "checking LaTeX configuration""... $ac_c"
977 # First, remove the files that we want to re-create
978 rm -f textclass.lst packages.lst chkconfig.sed
979 if test ${lyx_check_config} = no ; then
980 echo "$ac_t""default values"
983 rm -f wrap_chkconfig.ltx chkconfig.vars chkconfig.classes chklayouts.tex
984 cat >wrap_chkconfig.ltx <<EOF
985 \\newcommand\\srcdir{${srcdir}}
988 \\input{${srcdir}/chkconfig.ltx}
990 ## Construct the list of classes to test for.
991 # build the list of available layout files and convert it to commands
993 for file in ./layouts/*.layout ${srcdir}/layouts/*.layout ; do
996 *) test -r "$file" && echo $file ;;
998 done | sed -e 's%^.*layouts/\(.*\)\.layout$%\\TestDocClass{\1}%'\
1000 eval ${LATEX} wrap_chkconfig.ltx 2>/dev/null | grep '^\+'
1001 eval `cat chkconfig.vars | sed 's/-/_/g'`
1004 # Do we have all the files we need? Useful if latex did not run
1005 echo creating textclass.lst
1006 # if textclass.lst does not exist (because LaTeX did not run),
1007 # then provide a standard version.
1008 if test ! -f textclass.lst ; then
1009 cat >textclass.lst <<EOF
1010 # This file declares layouts and their associated definition files
1011 # (include dir. relative to the place where this file is).
1012 # It contains only default values, since chkconfig.ltx could not be run
1013 # for some reason. Run ./configure if you need to update it after a
1014 # configuration change.
1015 article article article
1016 report report report
1018 linuxdoc linuxdoc linuxdoc
1019 letter letter letter
1023 # if chkconfig.sed does not exist (because LaTeX did not run),
1024 # then provide a standard version.
1025 if test ! -f chkconfig.sed ; then
1026 cat >chkconfig.sed <<EOF
1031 echo creating packages.lst
1032 # if packages.lst does not exist (because LaTeX did not run),
1033 # then provide a standard version.
1034 if test ! -f packages.lst ; then
1035 cat >packages.lst <<EOF
1036 # This file should contain the list of LaTeX packages that have been
1037 # recognized by LyX. Unfortunately, since configure could not find
1038 # your LaTeX2e program, the tests have not been run. Run ./configure
1039 # if you need to update it after a configuration change.
1044 echo creating doc/LaTeXConfig.lyx
1045 echo "s/@chk_linuxdoc@/$chk_linuxdoc/g" >> chkconfig.sed
1046 echo "s/@chk_docbook@/$chk_docbook/g" >> chkconfig.sed
1047 sed -f chkconfig.sed ${srcdir}/doc/LaTeXConfig.lyx.in >doc/LaTeXConfig.lyx
1049 echo creating lyxrc.defaults
1050 rm -f lyxrc.defaults
1051 cat >lyxrc.defaults <<EOF
1052 # This file has been automatically generated by LyX' lib/configure
1053 # script. It contains default settings that have been determined by
1054 # examining your system. PLEASE DO NOT MODIFY ANYTHING HERE! If you
1055 # want to customize LyX, make a copy of the file LYXDIR/lyxrc as
1056 # ~/.lyx/lyxrc and edit this file instead. Any setting in lyxrc will
1057 # override the values given here.
1058 \\Format latex tex LaTeX L
1059 \\Format dvi dvi DVI D
1060 \\Format ps ps Postscript t
1061 \\Format pdf pdf PDF P
1062 \\Format html html HTML H
1063 \\Format text txt ASCII A
1064 \\Format literate nw NoWeb W
1065 \\Format linuxdoc sgml LinuxDoc x
1066 \\Format docbook sgml DocBook B
1067 \\Format program run Program r
1069 \\converter latex lyx "$tex_to_lyx_command" ""
1070 \\converter latex dvi "$LATEX" "latex,disable=linuxdoc&docbook"
1071 \\converter latex pdf "$PDFLATEX" "latex,disable=linuxdoc&docbook"
1072 \\converter latex html "$latex_to_html_command"
1073 "originaldir,needaux,disable=linuxdoc&docbook"
1074 \\converter literate lyx "$literate_to_lyx_command" ""
1075 \\converter literate latex "$literate_to_tex_command" ""
1076 \\converter dvi ps "$dvi_to_ps_command" ""
1077 \\converter ps pdf "$ps_to_pdf_command" ""
1078 \\converter linuxdoc lyx "$linuxdoc_to_lyx_command" ""
1079 \\converter linuxdoc latex "$linuxdoc_to_latex_command" ""
1080 \\converter linuxdoc dvi "$linuxdoc_to_dvi_command" ""
1081 \\converter linuxdoc html "$linuxdoc_to_html_command" ""
1082 \\converter docbook dvi "$docbook_to_dvi_command" ""
1083 \\converter docbook html "$docbook_to_html_command" ""
1084 \\converter html latex "$html_to_latex_command"
1085 "disable=latex&literate&linuxdoc&docbook"
1087 \converter gif eps "$image_command" ""
1088 \converter png eps "$image_command" ""
1089 \converter jpg eps "$image_command" ""
1090 \converter gif png "$image_command" ""
1092 \\viewer dvi "$DVI_VIEWER"
1093 \\viewer html "$HTML_VIEWER"
1094 \\viewer pdf "$PDF_VIEWER"
1095 \\viewer ps "$GHOSTVIEW -swap"
1096 \\viewer eps "$GHOSTVIEW"
1099 \\ascii_roff_command "$ascii_roff_command"
1100 \\chktex_command "$chktex_command"
1101 \\spell_command "$SPELL"
1102 \\fax_command "$fax_command"
1103 \\print_spool_command "$print_spool_command"
1104 \\print_spool_printerprefix "$print_spool_printerprefix"
1105 \\font_encoding "$chk_fontenc"
1108 # Remove superfluous files if we are not writing in the main lib
1110 for file in lyxrc.defaults textclass.lst packages.lst \
1111 doc/LaTeXConfig.lyx ; do
1112 # we rename the file first, so that we avoid comparing a file with itself
1114 if test -r $srcdir/$file && diff $file.new $srcdir/$file >/dev/null 2>/dev/null ;
1116 echo "removing $file, which is identical to the system global version"
1125 if test $lyx_keep_temps = no ; then
1126 rm -f chkconfig.sed chkconfig.vars wrap_chkconfig.* chklayouts.tex \