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
16 #### Parse the command line
21 Usage: configure [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
29 --without-latex-config)
30 lyx_check_config=no ;;
34 lyx_suffix=`echo "$ac_option" | sed 's,--with-lyx-suffix=,,;s,^,-,'`
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
53 #### I do not really know why this is useful, but we might as well keep it.
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
65 #### Guess the directory in which configure is located.
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"
76 #### Create the build directories if necessary
77 for dir in bind clipart doc examples images kbd layouts reLyX \
78 scripts templates ui ; do
79 test ! -d $dir && mkdir $dir
83 #### Searching some useful programs
85 echo $ac_n "checking for a LaTeX2e program""... $ac_c"
86 echo "$ac_t""(latex latex2e)"
88 for ac_prog in latex latex2e
90 # Extract the first word of "$ac_prog", so it can be a program name with args.
91 set dummy $ac_prog ; ac_word=$2
92 if test -n "$ac_word"; then
93 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
94 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
95 for ac_dir in $PATH; do
96 test -z "$ac_dir" && ac_dir=.
97 if test -x $ac_dir/$ac_word; then
104 if test -n "$LATEX"; then
110 ## Check whether this is really LaTeX2e
112 cat >chklatex.ltx <<EOF
113 \\nonstopmode\\makeatletter
114 \\ifx\\undefined\\documentclass\\else
115 \\message{ThisIsLaTeX2e}
119 if eval ${LATEX} chklatex.ltx </dev/null 2>/dev/null \
120 | grep 'ThisIsLaTeX2e' >/dev/null; then
124 ac_result="not useable"
126 rm -f chklatex.ltx chklatex.log
127 echo "$ac_t""$ac_result"
128 test -n "$LATEX" && break
132 if test -z "$LATEX" ; then
137 if test x$lyx_check_config != x ; then
138 echo $ac_n "checking for the pdflatex program""... $ac_c"
139 echo "$ac_t""(pdflatex)"
141 for ac_prog in pdflatex
143 # Extract the first word of "$ac_prog", so it can be a program name with args.
144 set dummy $ac_prog ; ac_word=$2
145 if test -n "$ac_word"; then
146 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
147 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
148 for ac_dir in $PATH; do
149 test -z "$ac_dir" && ac_dir=.
150 if test -x $ac_dir/$ac_word; then
157 if test -n "$PDFLATEX"; then
163 ## Check whether this is really LaTeX2e
165 cat >chklatex.ltx <<EOF
166 \\nonstopmode\\makeatletter
167 \\ifx\\undefined\\documentclass\\else
168 \\message{ThisIsLaTeX2e}
172 if eval ${LATEX} chklatex.ltx </dev/null 2>/dev/null \
173 | grep 'ThisIsLaTeX2e' >/dev/null; then
177 ac_result="not useable"
179 rm -f chklatex.ltx chklatex.log
180 echo "$ac_t""$ac_result"
181 test -n "$PDFLATEX" && break
185 if test -z "$PDFLATEX" ; then
191 # Search for an installed reLyX or a ready-to-install one
193 PATH=${PATH}:./reLyX/
194 echo $ac_n "checking for a LaTeX -> LyX converter""... $ac_c"
195 echo "$ac_t""(reLyX)"
199 # Extract the first word of "$ac_prog", so it can be a program name with args.
200 set dummy $ac_prog ; ac_word=$2
201 if test -n "$ac_word"; then
202 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
203 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
204 for ac_dir in $PATH; do
205 test -z "$ac_dir" && ac_dir=.
206 if test -x $ac_dir/$ac_word; then
207 tex_to_lyx_command="$ac_prog"
213 if test -n "$tex_to_lyx_command"; then
219 echo "$ac_t""$ac_result"
220 test -n "$tex_to_lyx_command" && break
224 if test -z "$tex_to_lyx_command" ; then
225 tex_to_lyx_command=none
229 test $tex_to_lyx_command = "reLyX" && tex_to_lyx_command="reLyX -f \$\$i"
230 tex_to_lyx_command=`echo $tex_to_lyx_command | sed "s,reLyX,reLyX$lyx_suffix,"`
232 echo $ac_n "checking for a Noweb -> LyX converter""... $ac_c"
233 echo "$ac_t""(noweb2lyx)"
234 literate_to_lyx_command=
235 for ac_prog in noweb2lyx
237 # Extract the first word of "$ac_prog", so it can be a program name with args.
238 set dummy $ac_prog ; ac_word=$2
239 if test -n "$ac_word"; then
240 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
241 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
242 for ac_dir in $PATH; do
243 test -z "$ac_dir" && ac_dir=.
244 if test -x $ac_dir/$ac_word; then
245 literate_to_lyx_command="$ac_prog"
251 if test -n "$literate_to_lyx_command"; then
257 echo "$ac_t""$ac_result"
258 test -n "$literate_to_lyx_command" && break
262 if test -z "$literate_to_lyx_command" ; then
263 literate_to_lyx_command=none
266 test $literate_to_lyx_command = "noweb2lyx" && literate_to_lyx_command="noweb2lyx \$\$i \$\$o"
267 literate_to_lyx_command=`echo $literate_to_lyx_command | sed "s,noweb2lyx,noweb2lyx$lyx_suffix,"`
269 # Search something to process a literate document
270 echo $ac_n "checking for a Noweb -> LaTeX converter""... $ac_c"
271 echo "$ac_t""(noweave)"
272 literate_to_tex_command=
273 for ac_prog in noweave
275 # Extract the first word of "$ac_prog", so it can be a program name with args.
276 set dummy $ac_prog ; ac_word=$2
277 if test -n "$ac_word"; then
278 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
279 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
280 for ac_dir in $PATH; do
281 test -z "$ac_dir" && ac_dir=.
282 if test -x $ac_dir/$ac_word; then
283 literate_to_tex_command="$ac_prog"
289 if test -n "$literate_to_tex_command"; then
295 echo "$ac_t""$ac_result"
296 test -n "$literate_to_tex_command" && break
300 if test -z "$literate_to_tex_command" ; then
301 literate_to_tex_command=none
304 test $literate_to_tex_command = "noweave" && literate_to_tex_command="noweave -delay -index \$\$i > \$\$o"
306 echo $ac_n "checking for a HTML -> Latex converter""... $ac_c"
307 echo "$ac_t""(html2latex)"
308 html_to_latex_command=
309 for ac_prog in html2latex
311 # Extract the first word of "$ac_prog", so it can be a program name with args.
312 set dummy $ac_prog ; ac_word=$2
313 if test -n "$ac_word"; then
314 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
315 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
316 for ac_dir in $PATH; do
317 test -z "$ac_dir" && ac_dir=.
318 if test -x $ac_dir/$ac_word; then
319 html_to_latex_command="$ac_prog"
325 if test -n "$html_to_latex_command"; then
331 echo "$ac_t""$ac_result"
332 test -n "$html_to_latex_command" && break
336 if test -z "$html_to_latex_command" ; then
337 html_to_latex_command=none
340 test $html_to_latex_command = "html2latex" && html_to_latex_command="html2latex \$\$i"
342 echo $ac_n "checking for a MSWord -> Latex converter""... $ac_c"
343 echo "$ac_t""(wvCleanLatex word2x)"
344 word_to_latex_command=
345 for ac_prog in wvCleanLatex word2x
347 # Extract the first word of "$ac_prog", so it can be a program name with args.
348 set dummy $ac_prog ; ac_word=$2
349 if test -n "$ac_word"; then
350 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
351 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
352 for ac_dir in $PATH; do
353 test -z "$ac_dir" && ac_dir=.
354 if test -x $ac_dir/$ac_word; then
355 word_to_latex_command="$ac_prog"
361 if test -n "$word_to_latex_command"; then
367 echo "$ac_t""$ac_result"
368 test -n "$word_to_latex_command" && break
372 if test -z "$word_to_latex_command" ; then
373 word_to_latex_command=none
376 test "$word_to_latex_command" = "wvCleanLatex" && word_to_latex_command="wvCleanLatex \$\$i \$\$o"
377 test "$word_to_latex_command" = "word2x" && word_to_latex_command="word2x -f latex \$\$i"
379 echo $ac_n "checking for Image converter""... $ac_c"
380 echo "$ac_t""(convert)"
382 for ac_prog in convert
384 # Extract the first word of "$ac_prog", so it can be a program name with args.
385 set dummy $ac_prog ; ac_word=$2
386 if test -n "$ac_word"; then
387 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
388 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
389 for ac_dir in $PATH; do
390 test -z "$ac_dir" && ac_dir=.
391 if test -x $ac_dir/$ac_word; then
392 image_command="$ac_prog"
398 if test -n "$image_command"; then
404 echo "$ac_t""$ac_result"
405 test -n "$image_command" && break
409 if test -z "$image_command" ; then
413 test $image_command = "convert" && image_command="convert \$\$i \$\$o"
415 # Search for a Postscript interpreter
416 echo $ac_n "checking for a Postscript interpreter""... $ac_c"
421 # Extract the first word of "$ac_prog", so it can be a program name with args.
422 set dummy $ac_prog ; ac_word=$2
423 if test -n "$ac_word"; then
424 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
425 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
426 for ac_dir in $PATH; do
427 test -z "$ac_dir" && ac_dir=.
428 if test -x $ac_dir/$ac_word; then
435 if test -n "$GS"; then
441 echo "$ac_t""$ac_result"
442 test -n "$GS" && break
446 if test -z "$GS" ; then
451 # Search something to preview postscript
452 echo $ac_n "checking for a Postscript previewer""... $ac_c"
453 echo "$ac_t""(gv ghostview)"
455 for ac_prog in gv ghostview
457 # Extract the first word of "$ac_prog", so it can be a program name with args.
458 set dummy $ac_prog ; ac_word=$2
459 if test -n "$ac_word"; then
460 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
461 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
462 for ac_dir in $PATH; do
463 test -z "$ac_dir" && ac_dir=.
464 if test -x $ac_dir/$ac_word; then
471 if test -n "$GHOSTVIEW"; then
477 echo "$ac_t""$ac_result"
478 test -n "$GHOSTVIEW" && break
482 if test -z "$GHOSTVIEW" ; then
487 # Search for a program to preview pdf
488 echo $ac_n "checking for a PDF preview""... $ac_c"
489 echo "$ac_t""(acroread gv ghostview xpdf)"
491 for ac_prog in acroread gv ghostview xpdf
493 # Extract the first word of "$ac_prog", so it can be a program name with args.
494 set dummy $ac_prog ; ac_word=$2
495 if test -n "$ac_word"; then
496 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
497 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
498 for ac_dir in $PATH; do
499 test -z "$ac_dir" && ac_dir=.
500 if test -x $ac_dir/$ac_word; then
501 PDF_VIEWER="$ac_prog"
507 if test -n "$PDF_VIEWER"; then
513 echo "$ac_t""$ac_result"
514 test -n "$PDF_VIEWER" && break
518 if test -z "$PDF_VIEWER" ; then
523 # Search something to preview dvi
524 echo $ac_n "checking for a DVI previewer""... $ac_c"
529 # Extract the first word of "$ac_prog", so it can be a program name with args.
530 set dummy $ac_prog ; ac_word=$2
531 if test -n "$ac_word"; then
532 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
533 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
534 for ac_dir in $PATH; do
535 test -z "$ac_dir" && ac_dir=.
536 if test -x $ac_dir/$ac_word; then
537 DVI_VIEWER="$ac_prog"
543 if test -n "$DVI_VIEWER"; then
549 echo "$ac_t""$ac_result"
550 test -n "$DVI_VIEWER" && break
554 if test -z "$DVI_VIEWER" ; then
559 # Search something to preview html
560 echo $ac_n "checking for a HTML previewer""... $ac_c"
561 echo "$ac_t""(netscape)"
563 for ac_prog in netscape
565 # Extract the first word of "$ac_prog", so it can be a program name with args.
566 set dummy $ac_prog ; ac_word=$2
567 if test -n "$ac_word"; then
568 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
569 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
570 for ac_dir in $PATH; do
571 test -z "$ac_dir" && ac_dir=.
572 if test -x $ac_dir/$ac_word; then
573 HTML_VIEWER="$ac_prog"
579 if test -n "$HTML_VIEWER"; then
585 echo "$ac_t""$ac_result"
586 test -n "$HTML_VIEWER" && break
590 if test -z "$HTML_VIEWER" ; then
595 # Search for a program to convert ps to pdf
596 echo $ac_n "checking for a PS to PDF converter""... $ac_c"
597 echo "$ac_t""(ps2pdf)"
599 for ac_prog in ps2pdf
601 # Extract the first word of "$ac_prog", so it can be a program name with args.
602 set dummy $ac_prog ; ac_word=$2
603 if test -n "$ac_word"; then
604 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
605 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
606 for ac_dir in $PATH; do
607 test -z "$ac_dir" && ac_dir=.
608 if test -x $ac_dir/$ac_word; then
609 ps_to_pdf_command="$ac_prog"
615 if test -n "$ps_to_pdf_command"; then
621 echo "$ac_t""$ac_result"
622 test -n "$ps_to_pdf_command" && break
626 if test -z "$ps_to_pdf_command" ; then
627 ps_to_pdf_command=none
630 test $ps_to_pdf_command = "ps2pdf" && ps_to_pdf_command="ps2pdf \$\$i"
632 # Search for a program to convert dvi to ps
633 echo $ac_n "checking for a DVI to PS converter""... $ac_c"
634 echo "$ac_t""(dvips)"
638 # Extract the first word of "$ac_prog", so it can be a program name with args.
639 set dummy $ac_prog ; ac_word=$2
640 if test -n "$ac_word"; then
641 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
642 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
643 for ac_dir in $PATH; do
644 test -z "$ac_dir" && ac_dir=.
645 if test -x $ac_dir/$ac_word; then
646 dvi_to_ps_command="$ac_prog"
652 if test -n "$dvi_to_ps_command"; then
658 echo "$ac_t""$ac_result"
659 test -n "$dvi_to_ps_command" && break
663 if test -z "$dvi_to_ps_command" ; then
664 dvi_to_ps_command=none
667 test $dvi_to_ps_command = "dvips" && dvi_to_ps_command="dvips -o \$\$o \$\$i"
669 # Search a *roff program (used to translate tables in ASCII export)
670 echo $ac_n "checking for a *roff formatter""... $ac_c"
671 echo "$ac_t""(groff nroff)"
673 for ac_prog in groff nroff
675 # Extract the first word of "$ac_prog", so it can be a program name with args.
676 set dummy $ac_prog ; ac_word=$2
677 if test -n "$ac_word"; then
678 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
679 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
680 for ac_dir in $PATH; do
681 test -z "$ac_dir" && ac_dir=.
682 if test -x $ac_dir/$ac_word; then
689 if test -n "$ROFF"; then
695 echo "$ac_t""$ac_result"
696 test -n "$ROFF" && break
700 if test -z "$ROFF" ; then
704 ascii_roff_command=$ROFF
705 test $ROFF = "groff" && ascii_roff_command="groff -t -Tlatin1 \$\$FName"
706 test $ROFF = "nroff" && ascii_roff_command="tbl \$\$FName | nroff"
708 # Search the ChkTeX program
709 echo $ac_n "checking for ChkTeX""... $ac_c"
710 echo "$ac_t""(chktex)"
712 for ac_prog in chktex
714 # Extract the first word of "$ac_prog", so it can be a program name with args.
715 set dummy $ac_prog ; ac_word=$2
716 if test -n "$ac_word"; then
717 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
718 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
719 for ac_dir in $PATH; do
720 test -z "$ac_dir" && ac_dir=.
721 if test -x $ac_dir/$ac_word; then
728 if test -n "$CHKTEX"; then
734 echo "$ac_t""$ac_result"
735 test -n "$CHKTEX" && break
739 if test -z "$CHKTEX" ; then
743 chktex_command=$CHKTEX
744 test $CHKTEX = "chktex" && chktex_command="$CHKTEX -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38"
746 # Search for a spellchecker
747 echo $ac_n "checking for a spell-checker""... $ac_c"
748 echo "$ac_t""(ispell)"
750 for ac_prog in ispell
752 # Extract the first word of "$ac_prog", so it can be a program name with args.
753 set dummy $ac_prog ; ac_word=$2
754 if test -n "$ac_word"; then
755 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
756 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
757 for ac_dir in $PATH; do
758 test -z "$ac_dir" && ac_dir=.
759 if test -x $ac_dir/$ac_word; then
766 if test -n "$SPELL"; then
772 echo "$ac_t""$ac_result"
773 test -n "$SPELL" && break
777 if test -z "$SPELL" ; then
783 # Search a GUI Fax program
784 echo $ac_n "checking for a fax program""... $ac_c"
785 echo "$ac_t""(ksendfax)"
787 for ac_prog in ksendfax
789 # Extract the first word of "$ac_prog", so it can be a program name with args.
790 set dummy $ac_prog ; ac_word=$2
791 if test -n "$ac_word"; then
792 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
793 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
794 for ac_dir in $PATH; do
795 test -z "$ac_dir" && ac_dir=.
796 if test -x $ac_dir/$ac_word; then
797 fax_command="$ac_prog"
803 if test -n "$fax_command"; then
809 echo "$ac_t""$ac_result"
810 test -n "$fax_command" && break
814 if test -z "$fax_command" ; then
818 test $fax_command = "ksendfax" && fax_command="ksendfax \$\$i"
820 # Search for LinuxDoc support
821 echo $ac_n "checking for SGML-tools 1.x (LinuxDoc)""... $ac_c"
822 echo "$ac_t""(sgml2lyx)"
824 for ac_prog in sgml2lyx
826 # Extract the first word of "$ac_prog", so it can be a program name with args.
827 set dummy $ac_prog ; ac_word=$2
828 if test -n "$ac_word"; then
829 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
830 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
831 for ac_dir in $PATH; do
832 test -z "$ac_dir" && ac_dir=.
833 if test -x $ac_dir/$ac_word; then
840 if test -n "$LINUXDOC"; then
846 echo "$ac_t""$ac_result"
847 test -n "$LINUXDOC" && break
851 if test -z "$LINUXDOC" ; then
856 if test $LINUXDOC != none; then
858 linuxdoc_cmd="\\def\\haslinuxdoc{yes}"
863 linuxdoc_to_latex_command="sgml2latex \$\$i"
864 linuxdoc_to_dvi_command="sgml2latex -o dvi \$\$i"
865 linuxdoc_to_html_command="sgml2html \$\$i"
866 linuxdoc_to_lyx_command="sgml2lyx \$\$i";;
868 linuxdoc_to_latex_command="none"
869 linuxdoc_to_dvi_command="none"
870 linuxdoc_to_html_command="none"
871 linuxdoc_to_lyx_command="none";;
874 # Search for DocBook support
875 echo $ac_n "checking for SGML-tools 2.x (DocBook) or db2x scripts""... $ac_c"
876 echo "$ac_t""(sgmltools db2dvi)"
878 for ac_prog in sgmltools db2dvi
880 # Extract the first word of "$ac_prog", so it can be a program name with args.
881 set dummy $ac_prog ; ac_word=$2
882 if test -n "$ac_word"; then
883 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
884 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
885 for ac_dir in $PATH; do
886 test -z "$ac_dir" && ac_dir=.
887 if test -x $ac_dir/$ac_word; then
894 if test -n "$DOCBOOK"; then
900 echo "$ac_t""$ac_result"
901 test -n "$DOCBOOK" && break
905 if test -z "$DOCBOOK" ; then
910 if test $DOCBOOK != none; then
912 docbook_cmd="\\def\\hasdocbook{yes}"
917 docbook_to_dvi_command="sgmltools -b dvi \$\$i"
918 docbook_to_html_command="sgmltools -b html \$\$i";;
920 docbook_to_dvi_command="db2dvi \$\$i"
921 docbook_to_html_command="db2html \$\$i";;
923 docbook_to_dvi_command="none"
924 docbook_to_html_command="none";;
927 # Search for a spool command
928 echo $ac_n "checking for a spool command""... $ac_c"
929 echo "$ac_t""(lp lpr)"
931 for ac_prog in lp lpr
933 # Extract the first word of "$ac_prog", so it can be a program name with args.
934 set dummy $ac_prog ; ac_word=$2
935 if test -n "$ac_word"; then
936 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
937 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
938 for ac_dir in $PATH; do
939 test -z "$ac_dir" && ac_dir=.
940 if test -x $ac_dir/$ac_word; then
947 if test -n "$LPR"; then
953 echo "$ac_t""$ac_result"
954 test -n "$LPR" && break
958 if test -z "$LPR" ; then
963 lp) print_spool_command=lp
964 print_spool_printerprefix="-d ";;
965 lpr) print_spool_command=lpr
966 print_spool_printerprefix="-P";;
967 *) :;; # leave to empty values
970 echo $ac_n "checking for a LaTeX -> HTML converter""... $ac_c"
971 echo "$ac_t""(tth latex2html hevea)"
973 for ac_prog in tth latex2html hevea
975 # Extract the first word of "$ac_prog", so it can be a program name with args.
976 set dummy $ac_prog ; ac_word=$2
977 if test -n "$ac_word"; then
978 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
979 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
980 for ac_dir in $PATH; do
981 test -z "$ac_dir" && ac_dir=.
982 if test -x $ac_dir/$ac_word; then
989 if test -n "$TOHTML"; then
995 echo "$ac_t""$ac_result"
996 test -n "$TOHTML" && break
1000 if test -z "$TOHTML" ; then
1004 latex_to_html_command=$TOHTML
1006 tth) latex_to_html_command="tth -t -e2 -L\$\$b < \$\$i > \$\$o";;
1007 latex2html) latex_to_html_command="latex2html -no_subdir -split 0 -show_section_numbers \$\$i";;
1008 hevea) latex_to_html_command="hevea -s \$\$i";;
1011 #### Explore the LaTeX configuration
1012 echo $ac_n "checking LaTeX configuration""... $ac_c"
1013 # First, remove the files that we want to re-create
1014 rm -f textclass.lst packages.lst chkconfig.sed
1015 if test ${lyx_check_config} = no ; then
1016 echo "$ac_t""default values"
1019 rm -f wrap_chkconfig.ltx chkconfig.vars chkconfig.classes chklayouts.tex
1020 cat >wrap_chkconfig.ltx <<EOF
1021 \\newcommand\\srcdir{${srcdir}}
1024 \\input{${srcdir}/chkconfig.ltx}
1026 ## Construct the list of classes to test for.
1027 # build the list of available layout files and convert it to commands
1029 for file in ./layouts/*.layout ${srcdir}/layouts/*.layout ; do
1032 *) test -r "$file" && echo $file ;;
1034 done | sed -e 's%^.*layouts/\(.*\)\.layout$%\\TestDocClass{\1}%'\
1036 eval ${LATEX} wrap_chkconfig.ltx 2>/dev/null | grep '^\+'
1037 eval `cat chkconfig.vars | sed 's/-/_/g'`
1040 # Do we have all the files we need? Useful if latex did not run
1041 echo creating textclass.lst
1042 # if textclass.lst does not exist (because LaTeX did not run),
1043 # then provide a standard version.
1044 if test ! -f textclass.lst ; then
1045 cat >textclass.lst <<EOF
1046 # This file declares layouts and their associated definition files
1047 # (include dir. relative to the place where this file is).
1048 # It contains only default values, since chkconfig.ltx could not be run
1049 # for some reason. Run ./configure if you need to update it after a
1050 # configuration change.
1051 article article article
1052 report report report
1054 linuxdoc linuxdoc linuxdoc
1055 letter letter letter
1059 # if chkconfig.sed does not exist (because LaTeX did not run),
1060 # then provide a standard version.
1061 if test ! -f chkconfig.sed ; then
1062 cat >chkconfig.sed <<EOF
1067 echo creating packages.lst
1068 # if packages.lst does not exist (because LaTeX did not run),
1069 # then provide a standard version.
1070 if test ! -f packages.lst ; then
1071 cat >packages.lst <<EOF
1072 # This file should contain the list of LaTeX packages that have been
1073 # recognized by LyX. Unfortunately, since configure could not find
1074 # your LaTeX2e program, the tests have not been run. Run ./configure
1075 # if you need to update it after a configuration change.
1080 echo creating doc/LaTeXConfig.lyx
1081 echo "s/@chk_linuxdoc@/$chk_linuxdoc/g" >> chkconfig.sed
1082 echo "s/@chk_docbook@/$chk_docbook/g" >> chkconfig.sed
1083 sed -f chkconfig.sed ${srcdir}/doc/LaTeXConfig.lyx.in >doc/LaTeXConfig.lyx
1085 echo creating lyxrc.defaults
1086 rm -f lyxrc.defaults
1087 cat >lyxrc.defaults <<EOF
1088 # This file has been automatically generated by LyX' lib/configure
1089 # script. It contains default settings that have been determined by
1090 # examining your system. PLEASE DO NOT MODIFY ANYTHING HERE! If you
1091 # want to customize LyX, make a copy of the file LYXDIR/lyxrc as
1092 # ~/.lyx/lyxrc and edit this file instead. Any setting in lyxrc will
1093 # override the values given here.
1094 \\Format text txt ASCII A
1095 \\Format textparagraph txt ASCII(paragraphs) ""
1096 \\Format docbook sgml DocBook B
1097 \\Format dvi dvi DVI D
1098 \\Format eps eps EPS ""
1099 \\Format fax "" Fax ""
1100 \\Format gif gif GIF ""
1101 \\Format html html HTML H
1102 \\Format jpg jpg JPEG ""
1103 \\Format latex tex LaTeX L
1104 \\Format linuxdoc sgml LinuxDoc x
1105 \\Format lyx lyx LyX ""
1106 \\Format literate nw NoWeb N
1107 \\Format pdf pdf PDF P
1108 \\Format pdf2 pdf "PDF (pdflatex)" F
1109 \\Format png png PNG ""
1110 \\Format ps ps Postscript t
1111 \\Format program "" Program ""
1112 \\Format word doc Word W
1115 \\converter latex dvi "$LATEX \$\$i" "latex"
1116 \\converter latex pdf2 "$PDFLATEX \$\$i" "latex"
1117 \\converter latex html "$latex_to_html_command" "originaldir,needaux"
1118 \\converter literate latex "$literate_to_tex_command" ""
1119 \\converter dvi ps "$dvi_to_ps_command" ""
1120 \\converter ps pdf "$ps_to_pdf_command" ""
1121 \\converter ps fax "$fax_command" ""
1122 \\converter linuxdoc lyx "$linuxdoc_to_lyx_command" ""
1123 \\converter linuxdoc latex "$linuxdoc_to_latex_command" ""
1124 \\converter linuxdoc dvi "$linuxdoc_to_dvi_command" ""
1125 \\converter linuxdoc html "$linuxdoc_to_html_command" ""
1126 \\converter docbook dvi "$docbook_to_dvi_command" ""
1127 \\converter docbook html "$docbook_to_html_command" ""
1129 \\converter latex lyx "$tex_to_lyx_command" ""
1130 \\converter literate lyx "$literate_to_lyx_command" ""
1131 \\converter html latex "$html_to_latex_command" ""
1132 \\converter word latex "$word_to_latex_command" ""
1134 \converter gif eps "$image_command" ""
1135 \converter png eps "$image_command" ""
1136 \converter jpg eps "$image_command" ""
1137 \converter gif png "$image_command" ""
1139 \\viewer dvi "$DVI_VIEWER"
1140 \\viewer html "$HTML_VIEWER"
1141 \\viewer pdf "$PDF_VIEWER"
1142 \\viewer ps "$GHOSTVIEW -swap"
1143 \\viewer eps "$GHOSTVIEW"
1146 \\ascii_roff_command "$ascii_roff_command"
1147 \\chktex_command "$chktex_command"
1148 \\spell_command "$SPELL"
1149 \\print_spool_command "$print_spool_command"
1150 \\print_spool_printerprefix "$print_spool_printerprefix"
1151 \\font_encoding "$chk_fontenc"
1154 # Remove superfluous files if we are not writing in the main lib
1156 for file in lyxrc.defaults textclass.lst packages.lst \
1157 doc/LaTeXConfig.lyx ; do
1158 # we rename the file first, so that we avoid comparing a file with itself
1160 if test -r $srcdir/$file && diff $file.new $srcdir/$file >/dev/null 2>/dev/null ;
1162 echo "removing $file, which is identical to the system global version"
1171 if test $lyx_keep_temps = no ; then
1172 rm -f chkconfig.sed chkconfig.vars wrap_chkconfig.* chklayouts.tex \