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 a MSWord -> Latex converter""... $ac_c"
337 echo "$ac_t""(wvCleanLatex word2x)"
338 word_to_latex_command=
339 for ac_prog in wvCleanLatex word2x
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 word_to_latex_command="$ac_prog"
355 if test -n "$word_to_latex_command"; then
361 echo "$ac_t""$ac_result"
362 test -n "$word_to_latex_command" && break
366 if test -z "$word_to_latex_command" ; then
367 word_to_latex_command=none
370 test $word_to_latex_command = "wvCleanLatex" && word_to_latex_command="wvCleanLatex \$\$FName \$\$OutName"
371 test $word_to_latex_command = "word2x" && word_to_latex_command="word2x -f latex \$\$FName"
373 echo $ac_n "checking for Image converter""... $ac_c"
374 echo "$ac_t""(convert)"
376 for ac_prog in convert
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
386 image_command="$ac_prog"
392 if test -n "$image_command"; then
398 echo "$ac_t""$ac_result"
399 test -n "$image_command" && break
403 if test -z "$image_command" ; then
407 test $image_command = "convert" && image_command="convert \$\$FName \$\$OutName"
409 # Search for a Postscript interpreter
410 echo $ac_n "checking for a Postscript interpreter""... $ac_c"
415 # Extract the first word of "$ac_prog", so it can be a program name with args.
416 set dummy $ac_prog ; ac_word=$2
417 if test -n "$ac_word"; then
418 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
419 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
420 for ac_dir in $PATH; do
421 test -z "$ac_dir" && ac_dir=.
422 if test -x $ac_dir/$ac_word; then
429 if test -n "$GS"; then
435 echo "$ac_t""$ac_result"
436 test -n "$GS" && break
440 if test -z "$GS" ; then
445 # Search something to preview postscript
446 echo $ac_n "checking for a Postscript previewer""... $ac_c"
447 echo "$ac_t""(gv ghostview)"
449 for ac_prog in gv ghostview
451 # Extract the first word of "$ac_prog", so it can be a program name with args.
452 set dummy $ac_prog ; ac_word=$2
453 if test -n "$ac_word"; then
454 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
455 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
456 for ac_dir in $PATH; do
457 test -z "$ac_dir" && ac_dir=.
458 if test -x $ac_dir/$ac_word; then
465 if test -n "$GHOSTVIEW"; then
471 echo "$ac_t""$ac_result"
472 test -n "$GHOSTVIEW" && break
476 if test -z "$GHOSTVIEW" ; then
481 # Search for a program to preview pdf
482 echo $ac_n "checking for a PDF preview""... $ac_c"
483 echo "$ac_t""(acroread gv ghostview xpdf)"
485 for ac_prog in acroread gv ghostview xpdf
487 # Extract the first word of "$ac_prog", so it can be a program name with args.
488 set dummy $ac_prog ; ac_word=$2
489 if test -n "$ac_word"; then
490 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
491 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
492 for ac_dir in $PATH; do
493 test -z "$ac_dir" && ac_dir=.
494 if test -x $ac_dir/$ac_word; then
495 PDF_VIEWER="$ac_prog"
501 if test -n "$PDF_VIEWER"; then
507 echo "$ac_t""$ac_result"
508 test -n "$PDF_VIEWER" && break
512 if test -z "$PDF_VIEWER" ; then
517 # Search something to preview dvi
518 echo $ac_n "checking for a DVI previewer""... $ac_c"
523 # Extract the first word of "$ac_prog", so it can be a program name with args.
524 set dummy $ac_prog ; ac_word=$2
525 if test -n "$ac_word"; then
526 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
527 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
528 for ac_dir in $PATH; do
529 test -z "$ac_dir" && ac_dir=.
530 if test -x $ac_dir/$ac_word; then
531 DVI_VIEWER="$ac_prog"
537 if test -n "$DVI_VIEWER"; then
543 echo "$ac_t""$ac_result"
544 test -n "$DVI_VIEWER" && break
548 if test -z "$DVI_VIEWER" ; then
553 # Search something to preview html
554 echo $ac_n "checking for a HTML previewer""... $ac_c"
555 echo "$ac_t""(netscape)"
557 for ac_prog in netscape
559 # Extract the first word of "$ac_prog", so it can be a program name with args.
560 set dummy $ac_prog ; ac_word=$2
561 if test -n "$ac_word"; then
562 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
563 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
564 for ac_dir in $PATH; do
565 test -z "$ac_dir" && ac_dir=.
566 if test -x $ac_dir/$ac_word; then
567 HTML_VIEWER="$ac_prog"
573 if test -n "$HTML_VIEWER"; then
579 echo "$ac_t""$ac_result"
580 test -n "$HTML_VIEWER" && break
584 if test -z "$HTML_VIEWER" ; then
589 # Search for a program to convert ps to pdf
590 echo $ac_n "checking for a PS to PDF converter""... $ac_c"
591 echo "$ac_t""(ps2pdf)"
593 for ac_prog in ps2pdf
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 ps_to_pdf_command="$ac_prog"
609 if test -n "$ps_to_pdf_command"; then
615 echo "$ac_t""$ac_result"
616 test -n "$ps_to_pdf_command" && break
620 if test -z "$ps_to_pdf_command" ; then
621 ps_to_pdf_command=none
624 test $ps_to_pdf_command = "ps2pdf" && ps_to_pdf_command="ps2pdf \$\$FName"
626 # Search for a program to convert dvi to ps
627 echo $ac_n "checking for a DVI to PS converter""... $ac_c"
628 echo "$ac_t""(dvips)"
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
640 dvi_to_ps_command="$ac_prog"
646 if test -n "$dvi_to_ps_command"; then
652 echo "$ac_t""$ac_result"
653 test -n "$dvi_to_ps_command" && break
657 if test -z "$dvi_to_ps_command" ; then
658 dvi_to_ps_command=none
661 test $dvi_to_ps_command = "dvips" && dvi_to_ps_command="dvips -o \$\$OutName \$\$FName"
663 # Search a *roff program (used to translate tables in ASCII export)
664 echo $ac_n "checking for a *roff formatter""... $ac_c"
665 echo "$ac_t""(groff nroff)"
667 for ac_prog in groff nroff
669 # Extract the first word of "$ac_prog", so it can be a program name with args.
670 set dummy $ac_prog ; ac_word=$2
671 if test -n "$ac_word"; then
672 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
673 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
674 for ac_dir in $PATH; do
675 test -z "$ac_dir" && ac_dir=.
676 if test -x $ac_dir/$ac_word; then
683 if test -n "$ROFF"; then
689 echo "$ac_t""$ac_result"
690 test -n "$ROFF" && break
694 if test -z "$ROFF" ; then
698 ascii_roff_command=$ROFF
699 test $ROFF = "groff" && ascii_roff_command="groff -t -Tlatin1 \$\$FName"
700 test $ROFF = "nroff" && ascii_roff_command="tbl \$\$FName | nroff"
702 # Search the ChkTeX program
703 echo $ac_n "checking for ChkTeX""... $ac_c"
704 echo "$ac_t""(chktex)"
706 for ac_prog in chktex
708 # Extract the first word of "$ac_prog", so it can be a program name with args.
709 set dummy $ac_prog ; ac_word=$2
710 if test -n "$ac_word"; then
711 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
712 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
713 for ac_dir in $PATH; do
714 test -z "$ac_dir" && ac_dir=.
715 if test -x $ac_dir/$ac_word; then
722 if test -n "$CHKTEX"; then
728 echo "$ac_t""$ac_result"
729 test -n "$CHKTEX" && break
733 if test -z "$CHKTEX" ; then
737 chktex_command=$CHKTEX
738 test $CHKTEX = "chktex" && chktex_command="$CHKTEX -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38"
740 # Search for a spellchecker
741 echo $ac_n "checking for a spell-checker""... $ac_c"
742 echo "$ac_t""(ispell)"
744 for ac_prog in ispell
746 # Extract the first word of "$ac_prog", so it can be a program name with args.
747 set dummy $ac_prog ; ac_word=$2
748 if test -n "$ac_word"; then
749 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
750 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
751 for ac_dir in $PATH; do
752 test -z "$ac_dir" && ac_dir=.
753 if test -x $ac_dir/$ac_word; then
760 if test -n "$SPELL"; then
766 echo "$ac_t""$ac_result"
767 test -n "$SPELL" && break
771 if test -z "$SPELL" ; then
777 # Search a GUI Fax program
778 echo $ac_n "checking for a fax program""... $ac_c"
779 echo "$ac_t""(ksendfax)"
781 for ac_prog in ksendfax
783 # Extract the first word of "$ac_prog", so it can be a program name with args.
784 set dummy $ac_prog ; ac_word=$2
785 if test -n "$ac_word"; then
786 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
787 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
788 for ac_dir in $PATH; do
789 test -z "$ac_dir" && ac_dir=.
790 if test -x $ac_dir/$ac_word; then
791 fax_command="$ac_prog"
797 if test -n "$fax_command"; then
803 echo "$ac_t""$ac_result"
804 test -n "$fax_command" && break
808 if test -z "$fax_command" ; then
812 test $fax_command = "ksendfax" && fax_command="ksendfax \$\$FName"
814 # Search for LinuxDoc support
815 echo $ac_n "checking for SGML-tools 1.x (LinuxDoc)""... $ac_c"
816 echo "$ac_t""(sgml2lyx)"
818 for ac_prog in sgml2lyx
820 # Extract the first word of "$ac_prog", so it can be a program name with args.
821 set dummy $ac_prog ; ac_word=$2
822 if test -n "$ac_word"; then
823 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
824 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
825 for ac_dir in $PATH; do
826 test -z "$ac_dir" && ac_dir=.
827 if test -x $ac_dir/$ac_word; then
834 if test -n "$LINUXDOC"; then
840 echo "$ac_t""$ac_result"
841 test -n "$LINUXDOC" && break
845 if test -z "$LINUXDOC" ; then
850 if test $LINUXDOC != none; then
852 linuxdoc_cmd="\\def\\haslinuxdoc{yes}"
857 linuxdoc_to_latex_command="sgml2latex \$\$FName"
858 linuxdoc_to_dvi_command="sgml2latex -o dvi \$\$FName"
859 linuxdoc_to_html_command="sgml2html \$\$FName"
860 linuxdoc_to_lyx_command="sgml2lyx \$\$FName";;
862 linuxdoc_to_latex_command="none"
863 linuxdoc_to_dvi_command="none"
864 linuxdoc_to_html_command="none"
865 linuxdoc_to_lyx_command="none";;
868 # Search for DocBook support
869 echo $ac_n "checking for SGML-tools 2.x (DocBook) or db2x scripts""... $ac_c"
870 echo "$ac_t""(sgmltools db2dvi)"
872 for ac_prog in sgmltools db2dvi
874 # Extract the first word of "$ac_prog", so it can be a program name with args.
875 set dummy $ac_prog ; ac_word=$2
876 if test -n "$ac_word"; then
877 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
878 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
879 for ac_dir in $PATH; do
880 test -z "$ac_dir" && ac_dir=.
881 if test -x $ac_dir/$ac_word; then
888 if test -n "$DOCBOOK"; then
894 echo "$ac_t""$ac_result"
895 test -n "$DOCBOOK" && break
899 if test -z "$DOCBOOK" ; then
904 if test $DOCBOOK != none; then
906 docbook_cmd="\\def\\hasdocbook{yes}"
911 docbook_to_dvi_command="sgmltools -b dvi \$\$FName"
912 docbook_to_html_command="sgmltools -b html \$\$FName";;
914 docbook_to_dvi_command="db2dvi \$\$FName"
915 docbook_to_html_command="db2html \$\$FName";;
917 docbook_to_dvi_command="none"
918 docbook_to_html_command="none";;
921 # Search for a spool command
922 echo $ac_n "checking for a spool command""... $ac_c"
923 echo "$ac_t""(lp lpr)"
925 for ac_prog in lp lpr
927 # Extract the first word of "$ac_prog", so it can be a program name with args.
928 set dummy $ac_prog ; ac_word=$2
929 if test -n "$ac_word"; then
930 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
931 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
932 for ac_dir in $PATH; do
933 test -z "$ac_dir" && ac_dir=.
934 if test -x $ac_dir/$ac_word; then
941 if test -n "$LPR"; then
947 echo "$ac_t""$ac_result"
948 test -n "$LPR" && break
952 if test -z "$LPR" ; then
957 lp) print_spool_command=lp
958 print_spool_printerprefix="-d ";;
959 lpr) print_spool_command=lpr
960 print_spool_printerprefix="-P";;
961 *) :;; # leave to empty values
964 echo $ac_n "checking for a LaTeX -> HTML converter""... $ac_c"
965 echo "$ac_t""(tth latex2html hevea)"
967 for ac_prog in tth latex2html hevea
969 # Extract the first word of "$ac_prog", so it can be a program name with args.
970 set dummy $ac_prog ; ac_word=$2
971 if test -n "$ac_word"; then
972 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
973 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
974 for ac_dir in $PATH; do
975 test -z "$ac_dir" && ac_dir=.
976 if test -x $ac_dir/$ac_word; then
983 if test -n "$TOHTML"; then
989 echo "$ac_t""$ac_result"
990 test -n "$TOHTML" && break
994 if test -z "$TOHTML" ; then
998 latex_to_html_command = $TOHTML
1000 tth) latex_to_html_command="tth -t -e2 -L\$\$BaseName < \$\$FName > \$\$OutName";;
1001 latex2html) latex_to_html_command="latex2html -no_subdir -split 0 -show_section_numbers \$\$FName";;
1002 hevea) latex_to_html_command="hevea -s \$\$FName";;
1005 #### Explore the LaTeX configuration
1006 echo $ac_n "checking LaTeX configuration""... $ac_c"
1007 # First, remove the files that we want to re-create
1008 rm -f textclass.lst packages.lst chkconfig.sed
1009 if test ${lyx_check_config} = no ; then
1010 echo "$ac_t""default values"
1013 rm -f wrap_chkconfig.ltx chkconfig.vars chkconfig.classes chklayouts.tex
1014 cat >wrap_chkconfig.ltx <<EOF
1015 \\newcommand\\srcdir{${srcdir}}
1018 \\input{${srcdir}/chkconfig.ltx}
1020 ## Construct the list of classes to test for.
1021 # build the list of available layout files and convert it to commands
1023 for file in ./layouts/*.layout ${srcdir}/layouts/*.layout ; do
1026 *) test -r "$file" && echo $file ;;
1028 done | sed -e 's%^.*layouts/\(.*\)\.layout$%\\TestDocClass{\1}%'\
1030 eval ${LATEX} wrap_chkconfig.ltx 2>/dev/null | grep '^\+'
1031 eval `cat chkconfig.vars | sed 's/-/_/g'`
1034 # Do we have all the files we need? Useful if latex did not run
1035 echo creating textclass.lst
1036 # if textclass.lst does not exist (because LaTeX did not run),
1037 # then provide a standard version.
1038 if test ! -f textclass.lst ; then
1039 cat >textclass.lst <<EOF
1040 # This file declares layouts and their associated definition files
1041 # (include dir. relative to the place where this file is).
1042 # It contains only default values, since chkconfig.ltx could not be run
1043 # for some reason. Run ./configure if you need to update it after a
1044 # configuration change.
1045 article article article
1046 report report report
1048 linuxdoc linuxdoc linuxdoc
1049 letter letter letter
1053 # if chkconfig.sed does not exist (because LaTeX did not run),
1054 # then provide a standard version.
1055 if test ! -f chkconfig.sed ; then
1056 cat >chkconfig.sed <<EOF
1061 echo creating packages.lst
1062 # if packages.lst does not exist (because LaTeX did not run),
1063 # then provide a standard version.
1064 if test ! -f packages.lst ; then
1065 cat >packages.lst <<EOF
1066 # This file should contain the list of LaTeX packages that have been
1067 # recognized by LyX. Unfortunately, since configure could not find
1068 # your LaTeX2e program, the tests have not been run. Run ./configure
1069 # if you need to update it after a configuration change.
1074 echo creating doc/LaTeXConfig.lyx
1075 echo "s/@chk_linuxdoc@/$chk_linuxdoc/g" >> chkconfig.sed
1076 echo "s/@chk_docbook@/$chk_docbook/g" >> chkconfig.sed
1077 sed -f chkconfig.sed ${srcdir}/doc/LaTeXConfig.lyx.in >doc/LaTeXConfig.lyx
1079 echo creating lyxrc.defaults
1080 rm -f lyxrc.defaults
1081 cat >lyxrc.defaults <<EOF
1082 # This file has been automatically generated by LyX' lib/configure
1083 # script. It contains default settings that have been determined by
1084 # examining your system. PLEASE DO NOT MODIFY ANYTHING HERE! If you
1085 # want to customize LyX, make a copy of the file LYXDIR/lyxrc as
1086 # ~/.lyx/lyxrc and edit this file instead. Any setting in lyxrc will
1087 # override the values given here.
1088 \\Format latex tex LaTeX L
1089 \\Format dvi dvi DVI D
1090 \\Format ps ps Postscript t
1091 \\Format pdf pdf PDF P
1092 \\Format html html HTML H
1093 \\Format text txt ASCII A
1094 \\Format word doc Word W
1095 \\Format literate nw NoWeb N
1096 \\Format linuxdoc sgml LinuxDoc x
1097 \\Format docbook sgml DocBook B
1098 \\Format program "" Program ""
1099 \\Format fax "" Fax ""
1101 \\converter latex dvi "$LATEX" "latex,disable=linuxdoc&docbook"
1102 \\converter latex pdf "$PDFLATEX" "latex,disable=linuxdoc&docbook"
1103 \\converter latex html "$latex_to_html_command"
1104 "originaldir,needaux,disable=linuxdoc&docbook"
1105 \\converter literate latex "$literate_to_tex_command" ""
1106 \\converter dvi ps "$dvi_to_ps_command" ""
1107 \\converter ps pdf "$ps_to_pdf_command" ""
1108 \\converter ps fax "$fax_command" ""
1109 \\converter linuxdoc lyx "$linuxdoc_to_lyx_command" ""
1110 \\converter linuxdoc latex "$linuxdoc_to_latex_command" ""
1111 \\converter linuxdoc dvi "$linuxdoc_to_dvi_command" ""
1112 \\converter linuxdoc html "$linuxdoc_to_html_command" ""
1113 \\converter docbook dvi "$docbook_to_dvi_command" ""
1114 \\converter docbook html "$docbook_to_html_command" ""
1116 \\converter latex lyx "$tex_to_lyx_command" "importer"
1117 \\converter literate lyx "$literate_to_lyx_command" "importer"
1118 \\converter html latex "$html_to_latex_command" "importer"
1119 \\converter word latex "$word_to_latex_command" "importer"
1121 \converter gif eps "$image_command" ""
1122 \converter png eps "$image_command" ""
1123 \converter jpg eps "$image_command" ""
1124 \converter gif png "$image_command" ""
1126 \\viewer dvi "$DVI_VIEWER"
1127 \\viewer html "$HTML_VIEWER"
1128 \\viewer pdf "$PDF_VIEWER"
1129 \\viewer ps "$GHOSTVIEW -swap"
1130 \\viewer eps "$GHOSTVIEW"
1133 \\ascii_roff_command "$ascii_roff_command"
1134 \\chktex_command "$chktex_command"
1135 \\spell_command "$SPELL"
1136 \\print_spool_command "$print_spool_command"
1137 \\print_spool_printerprefix "$print_spool_printerprefix"
1138 \\font_encoding "$chk_fontenc"
1141 # Remove superfluous files if we are not writing in the main lib
1143 for file in lyxrc.defaults textclass.lst packages.lst \
1144 doc/LaTeXConfig.lyx ; do
1145 # we rename the file first, so that we avoid comparing a file with itself
1147 if test -r $srcdir/$file && diff $file.new $srcdir/$file >/dev/null 2>/dev/null ;
1149 echo "removing $file, which is identical to the system global version"
1158 if test $lyx_keep_temps = no ; then
1159 rm -f chkconfig.sed chkconfig.vars wrap_chkconfig.* chklayouts.tex \