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 for a program to convert dvi to pdf
670 echo $ac_n "checking for a DVI to PDF converter""... $ac_c"
671 echo "$ac_t""(dvipdfm)"
673 for ac_prog in dvipdfm
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
683 dvi_to_pdf_command="$ac_prog"
689 if test -n "$dvi_to_pdf_command"; then
695 echo "$ac_t""$ac_result"
696 test -n "$dvi_to_pdf_command" && break
700 if test -z "$dvi_to_pdf_command" ; then
701 dvi_to_pdf_command=none
704 test $dvi_to_pdf_command = "dvipdfm" && dvi_to_pdf_command="dvipdfm \$\$i"
706 # Search a *roff program (used to translate tables in ASCII export)
707 echo $ac_n "checking for a *roff formatter""... $ac_c"
708 echo "$ac_t""(groff nroff)"
710 for ac_prog in groff nroff
712 # Extract the first word of "$ac_prog", so it can be a program name with args.
713 set dummy $ac_prog ; ac_word=$2
714 if test -n "$ac_word"; then
715 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
716 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
717 for ac_dir in $PATH; do
718 test -z "$ac_dir" && ac_dir=.
719 if test -x $ac_dir/$ac_word; then
726 if test -n "$ROFF"; then
732 echo "$ac_t""$ac_result"
733 test -n "$ROFF" && break
737 if test -z "$ROFF" ; then
741 ascii_roff_command=$ROFF
742 test $ROFF = "groff" && ascii_roff_command="groff -t -Tlatin1 \$\$FName"
743 test $ROFF = "nroff" && ascii_roff_command="tbl \$\$FName | nroff"
745 # Search the ChkTeX program
746 echo $ac_n "checking for ChkTeX""... $ac_c"
747 echo "$ac_t""(chktex)"
749 for ac_prog in chktex
751 # Extract the first word of "$ac_prog", so it can be a program name with args.
752 set dummy $ac_prog ; ac_word=$2
753 if test -n "$ac_word"; then
754 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
755 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
756 for ac_dir in $PATH; do
757 test -z "$ac_dir" && ac_dir=.
758 if test -x $ac_dir/$ac_word; then
765 if test -n "$CHKTEX"; then
771 echo "$ac_t""$ac_result"
772 test -n "$CHKTEX" && break
776 if test -z "$CHKTEX" ; then
780 chktex_command=$CHKTEX
781 test $CHKTEX = "chktex" && chktex_command="$CHKTEX -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38"
783 # Search for a spellchecker
784 echo $ac_n "checking for a spell-checker""... $ac_c"
785 echo "$ac_t""(ispell)"
787 for ac_prog in ispell
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
803 if test -n "$SPELL"; then
809 echo "$ac_t""$ac_result"
810 test -n "$SPELL" && break
814 if test -z "$SPELL" ; then
820 # Search a GUI Fax program
821 echo $ac_n "checking for a fax program""... $ac_c"
822 echo "$ac_t""(ksendfax)"
824 for ac_prog in ksendfax
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
834 fax_command="$ac_prog"
840 if test -n "$fax_command"; then
846 echo "$ac_t""$ac_result"
847 test -n "$fax_command" && break
851 if test -z "$fax_command" ; then
855 test $fax_command = "ksendfax" && fax_command="ksendfax \$\$i"
857 # Search for LinuxDoc support
858 echo $ac_n "checking for SGML-tools 1.x (LinuxDoc)""... $ac_c"
859 echo "$ac_t""(sgml2lyx)"
861 for ac_prog in sgml2lyx
863 # Extract the first word of "$ac_prog", so it can be a program name with args.
864 set dummy $ac_prog ; ac_word=$2
865 if test -n "$ac_word"; then
866 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
867 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
868 for ac_dir in $PATH; do
869 test -z "$ac_dir" && ac_dir=.
870 if test -x $ac_dir/$ac_word; then
877 if test -n "$LINUXDOC"; then
883 echo "$ac_t""$ac_result"
884 test -n "$LINUXDOC" && break
888 if test -z "$LINUXDOC" ; then
893 if test $LINUXDOC != none; then
895 linuxdoc_cmd="\\def\\haslinuxdoc{yes}"
900 linuxdoc_to_latex_command="sgml2latex \$\$i"
901 linuxdoc_to_dvi_command="sgml2latex -o dvi \$\$i"
902 linuxdoc_to_html_command="sgml2html \$\$i"
903 linuxdoc_to_lyx_command="sgml2lyx \$\$i";;
905 linuxdoc_to_latex_command="none"
906 linuxdoc_to_dvi_command="none"
907 linuxdoc_to_html_command="none"
908 linuxdoc_to_lyx_command="none";;
911 # Search for DocBook support
912 echo $ac_n "checking for SGML-tools 2.x (DocBook) or db2x scripts""... $ac_c"
913 echo "$ac_t""(sgmltools db2dvi)"
915 for ac_prog in sgmltools db2dvi
917 # Extract the first word of "$ac_prog", so it can be a program name with args.
918 set dummy $ac_prog ; ac_word=$2
919 if test -n "$ac_word"; then
920 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
921 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
922 for ac_dir in $PATH; do
923 test -z "$ac_dir" && ac_dir=.
924 if test -x $ac_dir/$ac_word; then
931 if test -n "$DOCBOOK"; then
937 echo "$ac_t""$ac_result"
938 test -n "$DOCBOOK" && break
942 if test -z "$DOCBOOK" ; then
947 if test $DOCBOOK != none; then
949 docbook_cmd="\\def\\hasdocbook{yes}"
954 docbook_to_dvi_command="sgmltools -b dvi \$\$i"
955 docbook_to_html_command="sgmltools -b html \$\$i";;
957 docbook_to_dvi_command="db2dvi \$\$i"
958 docbook_to_html_command="db2html \$\$i";;
960 docbook_to_dvi_command="none"
961 docbook_to_html_command="none";;
964 # Search for a spool command
965 echo $ac_n "checking for a spool command""... $ac_c"
966 echo "$ac_t""(lp lpr)"
968 for ac_prog in lp lpr
970 # Extract the first word of "$ac_prog", so it can be a program name with args.
971 set dummy $ac_prog ; ac_word=$2
972 if test -n "$ac_word"; then
973 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
974 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
975 for ac_dir in $PATH; do
976 test -z "$ac_dir" && ac_dir=.
977 if test -x $ac_dir/$ac_word; then
984 if test -n "$LPR"; then
990 echo "$ac_t""$ac_result"
991 test -n "$LPR" && break
995 if test -z "$LPR" ; then
1000 lp) print_spool_command=lp
1001 print_spool_printerprefix="-d ";;
1002 lpr) print_spool_command=lpr
1003 print_spool_printerprefix="-P";;
1004 *) :;; # leave to empty values
1007 echo $ac_n "checking for a LaTeX -> HTML converter""... $ac_c"
1008 echo "$ac_t""(tth latex2html hevea)"
1010 for ac_prog in tth latex2html hevea
1012 # Extract the first word of "$ac_prog", so it can be a program name with args.
1013 set dummy $ac_prog ; ac_word=$2
1014 if test -n "$ac_word"; then
1015 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
1016 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1017 for ac_dir in $PATH; do
1018 test -z "$ac_dir" && ac_dir=.
1019 if test -x $ac_dir/$ac_word; then
1026 if test -n "$TOHTML"; then
1032 echo "$ac_t""$ac_result"
1033 test -n "$TOHTML" && break
1037 if test -z "$TOHTML" ; then
1041 latex_to_html_command=$TOHTML
1043 tth) latex_to_html_command="tth -t -e2 -L\$\$b < \$\$i > \$\$o";;
1044 latex2html) latex_to_html_command="latex2html -no_subdir -split 0 -show_section_numbers \$\$i";;
1045 hevea) latex_to_html_command="hevea -s \$\$i";;
1048 #### Explore the LaTeX configuration
1049 echo $ac_n "checking LaTeX configuration""... $ac_c"
1050 # First, remove the files that we want to re-create
1051 rm -f textclass.lst packages.lst chkconfig.sed
1052 if test ${lyx_check_config} = no ; then
1053 echo "$ac_t""default values"
1056 rm -f wrap_chkconfig.ltx chkconfig.vars chkconfig.classes chklayouts.tex
1057 cat >wrap_chkconfig.ltx <<EOF
1058 \\newcommand\\srcdir{${srcdir}}
1061 \\input{${srcdir}/chkconfig.ltx}
1063 ## Construct the list of classes to test for.
1064 # build the list of available layout files and convert it to commands
1066 for file in ./layouts/*.layout ${srcdir}/layouts/*.layout ; do
1069 *) test -r "$file" && echo $file ;;
1071 done | sed -e 's%^.*layouts/\(.*\)\.layout$%\\TestDocClass{\1}%'\
1073 eval ${LATEX} wrap_chkconfig.ltx 2>/dev/null | grep '^\+'
1074 eval `cat chkconfig.vars | sed 's/-/_/g'`
1077 # Do we have all the files we need? Useful if latex did not run
1078 echo creating textclass.lst
1079 # if textclass.lst does not exist (because LaTeX did not run),
1080 # then provide a standard version.
1081 if test ! -f textclass.lst ; then
1082 cat >textclass.lst <<EOF
1083 # This file declares layouts and their associated definition files
1084 # (include dir. relative to the place where this file is).
1085 # It contains only default values, since chkconfig.ltx could not be run
1086 # for some reason. Run ./configure if you need to update it after a
1087 # configuration change.
1088 article article article
1089 report report report
1091 linuxdoc linuxdoc linuxdoc
1092 letter letter letter
1096 # if chkconfig.sed does not exist (because LaTeX did not run),
1097 # then provide a standard version.
1098 if test ! -f chkconfig.sed ; then
1099 cat >chkconfig.sed <<EOF
1104 echo creating packages.lst
1105 # if packages.lst does not exist (because LaTeX did not run),
1106 # then provide a standard version.
1107 if test ! -f packages.lst ; then
1108 cat >packages.lst <<EOF
1109 # This file should contain the list of LaTeX packages that have been
1110 # recognized by LyX. Unfortunately, since configure could not find
1111 # your LaTeX2e program, the tests have not been run. Run ./configure
1112 # if you need to update it after a configuration change.
1117 echo creating doc/LaTeXConfig.lyx
1118 echo "s/@chk_linuxdoc@/$chk_linuxdoc/g" >> chkconfig.sed
1119 echo "s/@chk_docbook@/$chk_docbook/g" >> chkconfig.sed
1120 sed -f chkconfig.sed ${srcdir}/doc/LaTeXConfig.lyx.in >doc/LaTeXConfig.lyx
1122 echo creating lyxrc.defaults
1123 rm -f lyxrc.defaults
1124 cat >lyxrc.defaults <<EOF
1125 # This file has been automatically generated by LyX' lib/configure
1126 # script. It contains default settings that have been determined by
1127 # examining your system. PLEASE DO NOT MODIFY ANYTHING HERE! If you
1128 # want to customize LyX, make a copy of the file LYXDIR/lyxrc as
1129 # ~/.lyx/lyxrc and edit this file instead. Any setting in lyxrc will
1130 # override the values given here.
1131 \\Format text txt ASCII A
1132 \\Format textparagraph txt ASCII(paragraphs) ""
1133 \\Format docbook sgml DocBook B
1134 \\Format dvi dvi DVI D
1135 \\Format eps eps EPS ""
1136 \\Format fax "" Fax ""
1137 \\Format gif gif GIF ""
1138 \\Format html html HTML H
1139 \\Format jpg jpg JPEG ""
1140 \\Format latex tex LaTeX L
1141 \\Format linuxdoc sgml LinuxDoc x
1142 \\Format lyx lyx LyX ""
1143 \\Format literate nw NoWeb N
1144 \\Format pdf pdf PDF P
1145 \\Format pdf2 pdf "PDF (pdflatex)" F
1146 \\Format pdf3 pdf "PDF (dvipdfm)" m
1147 \\Format png png PNG ""
1148 \\Format ps ps Postscript t
1149 \\Format program "" Program ""
1150 \\Format word doc Word W
1153 \\converter latex dvi "$LATEX \$\$i" "latex"
1154 \\converter latex pdf2 "$PDFLATEX \$\$i" "latex"
1155 \\converter latex html "$latex_to_html_command" "originaldir,needaux"
1156 \\converter literate latex "$literate_to_tex_command" ""
1157 \\converter dvi pdf3 "$dvi_to_pdf_command" ""
1158 \\converter dvi ps "$dvi_to_ps_command" ""
1159 \\converter ps pdf "$ps_to_pdf_command" ""
1160 \\converter ps fax "$fax_command" ""
1161 \\converter linuxdoc lyx "$linuxdoc_to_lyx_command" ""
1162 \\converter linuxdoc latex "$linuxdoc_to_latex_command" ""
1163 \\converter linuxdoc dvi "$linuxdoc_to_dvi_command" ""
1164 \\converter linuxdoc html "$linuxdoc_to_html_command" ""
1165 \\converter docbook dvi "$docbook_to_dvi_command" ""
1166 \\converter docbook html "$docbook_to_html_command" ""
1168 \\converter latex lyx "$tex_to_lyx_command" ""
1169 \\converter literate lyx "$literate_to_lyx_command" ""
1170 \\converter html latex "$html_to_latex_command" ""
1171 \\converter word latex "$word_to_latex_command" ""
1173 \converter gif eps "$image_command" ""
1174 \converter png eps "$image_command" ""
1175 \converter jpg eps "$image_command" ""
1176 \converter gif png "$image_command" ""
1178 \\viewer dvi "$DVI_VIEWER"
1179 \\viewer html "$HTML_VIEWER"
1180 \\viewer pdf "$PDF_VIEWER"
1181 \\viewer ps "$GHOSTVIEW -swap"
1182 \\viewer eps "$GHOSTVIEW"
1185 \\ascii_roff_command "$ascii_roff_command"
1186 \\chktex_command "$chktex_command"
1187 \\spell_command "$SPELL"
1188 \\print_spool_command "$print_spool_command"
1189 \\print_spool_printerprefix "$print_spool_printerprefix"
1190 \\font_encoding "$chk_fontenc"
1193 # Remove superfluous files if we are not writing in the main lib
1195 for file in lyxrc.defaults textclass.lst packages.lst \
1196 doc/LaTeXConfig.lyx ; do
1197 # we rename the file first, so that we avoid comparing a file with itself
1199 if test -r $srcdir/$file && diff $file.new $srcdir/$file >/dev/null 2>/dev/null ;
1201 echo "removing $file, which is identical to the system global version"
1210 if test $lyx_keep_temps = no ; then
1211 rm -f chkconfig.sed chkconfig.vars wrap_chkconfig.* chklayouts.tex \