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"
75 #### Adjust PATH for Win32 (Cygwin)
76 if test "x$OSTYPE" = xcygwin; then
77 echo "configure: cygwin detected; path correction"
78 srcdir=`cygpath -w "${srcdir}" | tr '\\\\' /`
79 echo "srcdir=${srcdir}"
82 #### Create the build directories if necessary
83 for dir in bind clipart doc examples images kbd layouts reLyX \
84 scripts templates ui ; do
85 test ! -d $dir && mkdir $dir
89 #### Searching some useful programs
91 echo $ac_n "checking for a LaTeX2e program""... $ac_c"
92 echo "$ac_t""(latex latex2e)"
94 for ac_prog in latex latex2e
96 # Extract the first word of "$ac_prog", so it can be a program name with args.
97 set dummy $ac_prog ; ac_word=$2
98 if test -n "$ac_word"; then
99 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
100 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
101 for ac_dir in $PATH; do
102 test -z "$ac_dir" && ac_dir=.
103 if test -x $ac_dir/$ac_word; then
110 if test -n "$LATEX"; then
113 ## Check whether this is really LaTeX2e
115 cat >chklatex.ltx <<EOF
116 \\nonstopmode\\makeatletter
117 \\ifx\\undefined\\documentclass\\else
118 \\message{ThisIsLaTeX2e}
122 if eval ${LATEX} chklatex.ltx </dev/null 2>/dev/null \
123 | grep 'ThisIsLaTeX2e' >/dev/null; then
127 ac_result="not useable"
129 rm -f chklatex.ltx chklatex.log
133 echo "$ac_t""$ac_result"
134 test -n "$LATEX" && break
138 if test -z "$LATEX" ; then
144 test -z "$latex_to_dvi" && latex_to_dvi="none"
146 # Search for pdflatex
147 if test ${lyx_check_config} = no ; then
150 echo $ac_n "checking for the pdflatex program""... $ac_c"
151 echo "$ac_t""(pdflatex)"
153 for ac_prog in pdflatex
155 # Extract the first word of "$ac_prog", so it can be a program name with args.
156 set dummy $ac_prog ; ac_word=$2
157 if test -n "$ac_word"; then
158 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
159 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
160 for ac_dir in $PATH; do
161 test -z "$ac_dir" && ac_dir=.
162 if test -x $ac_dir/$ac_word; then
163 latex_to_pdf="$ac_prog"
169 if test -n "$latex_to_pdf"; then
175 echo "$ac_t""$ac_result"
176 test -n "$latex_to_pdf" && break
180 if test -z "$latex_to_pdf" ; then
186 test $latex_to_dvi != "none" && latex_to_dvi="$latex_to_dvi \$\$i"
187 test $latex_to_pdf != "none" && latex_to_pdf="$latex_to_pdf \$\$i"
189 # Search for an installed reLyX or a ready-to-install one
191 PATH=${PATH}:./reLyX/
192 echo $ac_n "checking for a LaTeX -> LyX converter""... $ac_c"
193 echo "$ac_t""(reLyX)"
197 # Extract the first word of "$ac_prog", so it can be a program name with args.
198 set dummy $ac_prog ; ac_word=$2
199 if test -n "$ac_word"; then
200 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
201 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
202 for ac_dir in $PATH; do
203 test -z "$ac_dir" && ac_dir=.
204 if test -x $ac_dir/$ac_word; then
205 tex_to_lyx_command="$ac_prog"
211 if test -n "$tex_to_lyx_command"; then
217 echo "$ac_t""$ac_result"
218 test -n "$tex_to_lyx_command" && break
222 if test -z "$tex_to_lyx_command" ; then
223 tex_to_lyx_command=none
227 test $tex_to_lyx_command = "reLyX" && tex_to_lyx_command="reLyX -f \$\$i"
228 tex_to_lyx_command=`echo $tex_to_lyx_command | sed "s,reLyX,reLyX$lyx_suffix,"`
230 echo $ac_n "checking for a Noweb -> LyX converter""... $ac_c"
231 echo "$ac_t""(noweb2lyx)"
232 literate_to_lyx_command=
233 for ac_prog in noweb2lyx
235 # Extract the first word of "$ac_prog", so it can be a program name with args.
236 set dummy $ac_prog ; ac_word=$2
237 if test -n "$ac_word"; then
238 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
239 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
240 for ac_dir in $PATH; do
241 test -z "$ac_dir" && ac_dir=.
242 if test -x $ac_dir/$ac_word; then
243 literate_to_lyx_command="$ac_prog"
249 if test -n "$literate_to_lyx_command"; then
255 echo "$ac_t""$ac_result"
256 test -n "$literate_to_lyx_command" && break
260 if test -z "$literate_to_lyx_command" ; then
261 literate_to_lyx_command=none
264 test $literate_to_lyx_command = "noweb2lyx" && literate_to_lyx_command="noweb2lyx \$\$i \$\$o"
265 literate_to_lyx_command=`echo $literate_to_lyx_command | sed "s,noweb2lyx,noweb2lyx$lyx_suffix,"`
267 # Search something to process a literate document
268 echo $ac_n "checking for a Noweb -> LaTeX converter""... $ac_c"
269 echo "$ac_t""(noweave)"
270 literate_to_tex_command=
271 for ac_prog in noweave
273 # Extract the first word of "$ac_prog", so it can be a program name with args.
274 set dummy $ac_prog ; ac_word=$2
275 if test -n "$ac_word"; then
276 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
277 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
278 for ac_dir in $PATH; do
279 test -z "$ac_dir" && ac_dir=.
280 if test -x $ac_dir/$ac_word; then
281 literate_to_tex_command="$ac_prog"
287 if test -n "$literate_to_tex_command"; then
293 echo "$ac_t""$ac_result"
294 test -n "$literate_to_tex_command" && break
298 if test -z "$literate_to_tex_command" ; then
299 literate_to_tex_command=none
302 test $literate_to_tex_command = "noweave" && literate_to_tex_command="noweave -delay -index \$\$i > \$\$o"
304 echo $ac_n "checking for a HTML -> Latex converter""... $ac_c"
305 echo "$ac_t""(html2latex)"
306 html_to_latex_command=
307 for ac_prog in html2latex
309 # Extract the first word of "$ac_prog", so it can be a program name with args.
310 set dummy $ac_prog ; ac_word=$2
311 if test -n "$ac_word"; then
312 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
313 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
314 for ac_dir in $PATH; do
315 test -z "$ac_dir" && ac_dir=.
316 if test -x $ac_dir/$ac_word; then
317 html_to_latex_command="$ac_prog"
323 if test -n "$html_to_latex_command"; then
329 echo "$ac_t""$ac_result"
330 test -n "$html_to_latex_command" && break
334 if test -z "$html_to_latex_command" ; then
335 html_to_latex_command=none
338 test $html_to_latex_command = "html2latex" && html_to_latex_command="html2latex \$\$i"
340 echo $ac_n "checking for a MSWord -> Latex converter""... $ac_c"
341 echo "$ac_t""(wvCleanLatex word2x)"
342 word_to_latex_command=
343 for ac_prog in wvCleanLatex word2x
345 # Extract the first word of "$ac_prog", so it can be a program name with args.
346 set dummy $ac_prog ; ac_word=$2
347 if test -n "$ac_word"; then
348 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
349 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
350 for ac_dir in $PATH; do
351 test -z "$ac_dir" && ac_dir=.
352 if test -x $ac_dir/$ac_word; then
353 word_to_latex_command="$ac_prog"
359 if test -n "$word_to_latex_command"; then
365 echo "$ac_t""$ac_result"
366 test -n "$word_to_latex_command" && break
370 if test -z "$word_to_latex_command" ; then
371 word_to_latex_command=none
374 test "$word_to_latex_command" = "wvCleanLatex" && word_to_latex_command="wvCleanLatex \$\$i \$\$o"
375 test "$word_to_latex_command" = "word2x" && word_to_latex_command="word2x -f latex \$\$i"
377 echo $ac_n "checking for Image converter""... $ac_c"
378 echo "$ac_t""(convert)"
380 for ac_prog in convert
382 # Extract the first word of "$ac_prog", so it can be a program name with args.
383 set dummy $ac_prog ; ac_word=$2
384 if test -n "$ac_word"; then
385 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
386 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
387 for ac_dir in $PATH; do
388 test -z "$ac_dir" && ac_dir=.
389 if test -x $ac_dir/$ac_word; then
390 image_command="$ac_prog"
396 if test -n "$image_command"; then
402 echo "$ac_t""$ac_result"
403 test -n "$image_command" && break
407 if test -z "$image_command" ; then
411 test $image_command = "convert" && image_command="convert \$\$i \$\$o"
413 # Search for a Postscript interpreter
414 echo $ac_n "checking for a Postscript interpreter""... $ac_c"
419 # Extract the first word of "$ac_prog", so it can be a program name with args.
420 set dummy $ac_prog ; ac_word=$2
421 if test -n "$ac_word"; then
422 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
423 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
424 for ac_dir in $PATH; do
425 test -z "$ac_dir" && ac_dir=.
426 if test -x $ac_dir/$ac_word; then
433 if test -n "$GS"; then
439 echo "$ac_t""$ac_result"
440 test -n "$GS" && break
444 if test -z "$GS" ; then
449 # Search something to preview postscript
450 echo $ac_n "checking for a Postscript previewer""... $ac_c"
451 echo "$ac_t""(gv ghostview)"
453 for ac_prog in gv ghostview
455 # Extract the first word of "$ac_prog", so it can be a program name with args.
456 set dummy $ac_prog ; ac_word=$2
457 if test -n "$ac_word"; then
458 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
459 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
460 for ac_dir in $PATH; do
461 test -z "$ac_dir" && ac_dir=.
462 if test -x $ac_dir/$ac_word; then
469 if test -n "$GHOSTVIEW"; then
475 echo "$ac_t""$ac_result"
476 test -n "$GHOSTVIEW" && break
480 if test -z "$GHOSTVIEW" ; then
485 # Search for a program to preview pdf
486 echo $ac_n "checking for a PDF preview""... $ac_c"
487 echo "$ac_t""(acroread gv ghostview xpdf)"
489 for ac_prog in acroread gv ghostview xpdf
491 # Extract the first word of "$ac_prog", so it can be a program name with args.
492 set dummy $ac_prog ; ac_word=$2
493 if test -n "$ac_word"; then
494 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
495 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
496 for ac_dir in $PATH; do
497 test -z "$ac_dir" && ac_dir=.
498 if test -x $ac_dir/$ac_word; then
499 PDF_VIEWER="$ac_prog"
505 if test -n "$PDF_VIEWER"; then
511 echo "$ac_t""$ac_result"
512 test -n "$PDF_VIEWER" && break
516 if test -z "$PDF_VIEWER" ; then
521 # Search something to preview dvi
522 echo $ac_n "checking for a DVI previewer""... $ac_c"
523 echo "$ac_t""(xdvi windvi yap)"
525 for ac_prog in xdvi windvi yap
527 # Extract the first word of "$ac_prog", so it can be a program name with args.
528 set dummy $ac_prog ; ac_word=$2
529 if test -n "$ac_word"; then
530 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
531 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
532 for ac_dir in $PATH; do
533 test -z "$ac_dir" && ac_dir=.
534 if test -x $ac_dir/$ac_word; then
535 DVI_VIEWER="$ac_prog"
541 if test -n "$DVI_VIEWER"; then
547 echo "$ac_t""$ac_result"
548 test -n "$DVI_VIEWER" && break
552 if test -z "$DVI_VIEWER" ; then
557 # Search something to preview html
558 echo $ac_n "checking for a HTML previewer""... $ac_c"
559 echo "$ac_t""(netscape)"
561 for ac_prog in netscape
563 # Extract the first word of "$ac_prog", so it can be a program name with args.
564 set dummy $ac_prog ; ac_word=$2
565 if test -n "$ac_word"; then
566 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
567 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
568 for ac_dir in $PATH; do
569 test -z "$ac_dir" && ac_dir=.
570 if test -x $ac_dir/$ac_word; then
571 HTML_VIEWER="$ac_prog"
577 if test -n "$HTML_VIEWER"; then
583 echo "$ac_t""$ac_result"
584 test -n "$HTML_VIEWER" && break
588 if test -z "$HTML_VIEWER" ; then
593 # Search for a program to convert ps to pdf
594 echo $ac_n "checking for a PS to PDF converter""... $ac_c"
595 echo "$ac_t""(ps2pdf)"
597 for ac_prog in ps2pdf
599 # Extract the first word of "$ac_prog", so it can be a program name with args.
600 set dummy $ac_prog ; ac_word=$2
601 if test -n "$ac_word"; then
602 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
603 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
604 for ac_dir in $PATH; do
605 test -z "$ac_dir" && ac_dir=.
606 if test -x $ac_dir/$ac_word; then
607 ps_to_pdf_command="$ac_prog"
613 if test -n "$ps_to_pdf_command"; then
619 echo "$ac_t""$ac_result"
620 test -n "$ps_to_pdf_command" && break
624 if test -z "$ps_to_pdf_command" ; then
625 ps_to_pdf_command=none
628 test $ps_to_pdf_command = "ps2pdf" && ps_to_pdf_command="ps2pdf \$\$i"
630 # Search for a program to convert dvi to ps
631 echo $ac_n "checking for a DVI to PS converter""... $ac_c"
632 echo "$ac_t""(dvips)"
636 # Extract the first word of "$ac_prog", so it can be a program name with args.
637 set dummy $ac_prog ; ac_word=$2
638 if test -n "$ac_word"; then
639 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
640 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
641 for ac_dir in $PATH; do
642 test -z "$ac_dir" && ac_dir=.
643 if test -x $ac_dir/$ac_word; then
644 dvi_to_ps_command="$ac_prog"
650 if test -n "$dvi_to_ps_command"; then
656 echo "$ac_t""$ac_result"
657 test -n "$dvi_to_ps_command" && break
661 if test -z "$dvi_to_ps_command" ; then
662 dvi_to_ps_command=none
665 test $dvi_to_ps_command = "dvips" && dvi_to_ps_command="dvips -o \$\$o \$\$i"
667 # Search for a program to convert dvi to pdf
668 echo $ac_n "checking for a DVI to PDF converter""... $ac_c"
669 echo "$ac_t""(dvipdfm)"
671 for ac_prog in dvipdfm
673 # Extract the first word of "$ac_prog", so it can be a program name with args.
674 set dummy $ac_prog ; ac_word=$2
675 if test -n "$ac_word"; then
676 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
677 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
678 for ac_dir in $PATH; do
679 test -z "$ac_dir" && ac_dir=.
680 if test -x $ac_dir/$ac_word; then
681 dvi_to_pdf_command="$ac_prog"
687 if test -n "$dvi_to_pdf_command"; then
693 echo "$ac_t""$ac_result"
694 test -n "$dvi_to_pdf_command" && break
698 if test -z "$dvi_to_pdf_command" ; then
699 dvi_to_pdf_command=none
702 test $dvi_to_pdf_command = "dvipdfm" && dvi_to_pdf_command="dvipdfm \$\$i"
704 # Search a *roff program (used to translate tables in ASCII export)
705 echo $ac_n "checking for a *roff formatter""... $ac_c"
706 echo "$ac_t""(groff nroff)"
708 for ac_prog in groff nroff
710 # Extract the first word of "$ac_prog", so it can be a program name with args.
711 set dummy $ac_prog ; ac_word=$2
712 if test -n "$ac_word"; then
713 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
714 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
715 for ac_dir in $PATH; do
716 test -z "$ac_dir" && ac_dir=.
717 if test -x $ac_dir/$ac_word; then
724 if test -n "$ROFF"; then
730 echo "$ac_t""$ac_result"
731 test -n "$ROFF" && break
735 if test -z "$ROFF" ; then
739 ascii_roff_command=$ROFF
740 test $ROFF = "groff" && ascii_roff_command="groff -t -Tlatin1 \$\$FName"
741 test $ROFF = "nroff" && ascii_roff_command="tbl \$\$FName | nroff"
743 # Search the ChkTeX program
744 echo $ac_n "checking for ChkTeX""... $ac_c"
745 echo "$ac_t""(chktex)"
747 for ac_prog in chktex
749 # Extract the first word of "$ac_prog", so it can be a program name with args.
750 set dummy $ac_prog ; ac_word=$2
751 if test -n "$ac_word"; then
752 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
753 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
754 for ac_dir in $PATH; do
755 test -z "$ac_dir" && ac_dir=.
756 if test -x $ac_dir/$ac_word; then
763 if test -n "$CHKTEX"; then
769 echo "$ac_t""$ac_result"
770 test -n "$CHKTEX" && break
774 if test -z "$CHKTEX" ; then
778 chktex_command=$CHKTEX
779 test $CHKTEX = "chktex" && chktex_command="$CHKTEX -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38"
781 # Search for a spellchecker
782 echo $ac_n "checking for a spell-checker""... $ac_c"
783 echo "$ac_t""(ispell)"
785 for ac_prog in ispell
787 # Extract the first word of "$ac_prog", so it can be a program name with args.
788 set dummy $ac_prog ; ac_word=$2
789 if test -n "$ac_word"; then
790 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
791 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
792 for ac_dir in $PATH; do
793 test -z "$ac_dir" && ac_dir=.
794 if test -x $ac_dir/$ac_word; then
801 if test -n "$SPELL"; then
807 echo "$ac_t""$ac_result"
808 test -n "$SPELL" && break
812 if test -z "$SPELL" ; then
818 # Search a GUI Fax program
819 echo $ac_n "checking for a fax program""... $ac_c"
820 echo "$ac_t""(ksendfax)"
822 for ac_prog in ksendfax
824 # Extract the first word of "$ac_prog", so it can be a program name with args.
825 set dummy $ac_prog ; ac_word=$2
826 if test -n "$ac_word"; then
827 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
828 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
829 for ac_dir in $PATH; do
830 test -z "$ac_dir" && ac_dir=.
831 if test -x $ac_dir/$ac_word; then
832 fax_command="$ac_prog"
838 if test -n "$fax_command"; then
844 echo "$ac_t""$ac_result"
845 test -n "$fax_command" && break
849 if test -z "$fax_command" ; then
853 test $fax_command = "ksendfax" && fax_command="ksendfax \$\$i"
855 # Search for LinuxDoc support
856 echo $ac_n "checking for SGML-tools 1.x (LinuxDoc)""... $ac_c"
857 echo "$ac_t""(sgml2lyx)"
859 for ac_prog in sgml2lyx
861 # Extract the first word of "$ac_prog", so it can be a program name with args.
862 set dummy $ac_prog ; ac_word=$2
863 if test -n "$ac_word"; then
864 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
865 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
866 for ac_dir in $PATH; do
867 test -z "$ac_dir" && ac_dir=.
868 if test -x $ac_dir/$ac_word; then
875 if test -n "$LINUXDOC"; then
881 echo "$ac_t""$ac_result"
882 test -n "$LINUXDOC" && break
886 if test -z "$LINUXDOC" ; then
891 if test $LINUXDOC != none; then
893 linuxdoc_cmd="\\def\\haslinuxdoc{yes}"
898 linuxdoc_to_latex_command="sgml2latex \$\$i"
899 linuxdoc_to_dvi_command="sgml2latex -o dvi \$\$i"
900 linuxdoc_to_html_command="sgml2html \$\$i"
901 linuxdoc_to_lyx_command="sgml2lyx \$\$i";;
903 linuxdoc_to_latex_command="none"
904 linuxdoc_to_dvi_command="none"
905 linuxdoc_to_html_command="none"
906 linuxdoc_to_lyx_command="none";;
909 # Search for DocBook support
910 echo $ac_n "checking for SGML-tools 2.x (DocBook) or db2x scripts""... $ac_c"
911 echo "$ac_t""(sgmltools db2dvi)"
913 for ac_prog in sgmltools db2dvi
915 # Extract the first word of "$ac_prog", so it can be a program name with args.
916 set dummy $ac_prog ; ac_word=$2
917 if test -n "$ac_word"; then
918 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
919 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
920 for ac_dir in $PATH; do
921 test -z "$ac_dir" && ac_dir=.
922 if test -x $ac_dir/$ac_word; then
929 if test -n "$DOCBOOK"; then
935 echo "$ac_t""$ac_result"
936 test -n "$DOCBOOK" && break
940 if test -z "$DOCBOOK" ; then
945 if test $DOCBOOK != none; then
947 docbook_cmd="\\def\\hasdocbook{yes}"
952 docbook_to_dvi_command="sgmltools -b dvi \$\$i"
953 docbook_to_html_command="sgmltools -b html \$\$i";;
955 docbook_to_dvi_command="db2dvi \$\$i"
956 docbook_to_html_command="db2html \$\$i";;
958 docbook_to_dvi_command="none"
959 docbook_to_html_command="none";;
962 # Search for a spool command
963 echo $ac_n "checking for a spool command""... $ac_c"
964 echo "$ac_t""(lp lpr)"
966 for ac_prog in lp lpr
968 # Extract the first word of "$ac_prog", so it can be a program name with args.
969 set dummy $ac_prog ; ac_word=$2
970 if test -n "$ac_word"; then
971 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
972 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
973 for ac_dir in $PATH; do
974 test -z "$ac_dir" && ac_dir=.
975 if test -x $ac_dir/$ac_word; then
982 if test -n "$LPR"; then
988 echo "$ac_t""$ac_result"
989 test -n "$LPR" && break
993 if test -z "$LPR" ; then
998 lp) print_spool_command=lp
999 print_spool_printerprefix="-d ";;
1000 lpr) print_spool_command=lpr
1001 print_spool_printerprefix="-P";;
1002 *) :;; # leave to empty values
1005 echo $ac_n "checking for a LaTeX -> HTML converter""... $ac_c"
1006 echo "$ac_t""(tth latex2html hevea)"
1008 for ac_prog in tth latex2html hevea
1010 # Extract the first word of "$ac_prog", so it can be a program name with args.
1011 set dummy $ac_prog ; ac_word=$2
1012 if test -n "$ac_word"; then
1013 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
1014 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1015 for ac_dir in $PATH; do
1016 test -z "$ac_dir" && ac_dir=.
1017 if test -x $ac_dir/$ac_word; then
1024 if test -n "$TOHTML"; then
1030 echo "$ac_t""$ac_result"
1031 test -n "$TOHTML" && break
1035 if test -z "$TOHTML" ; then
1039 latex_to_html_command=$TOHTML
1041 tth) latex_to_html_command="tth -t -e2 -L\$\$b < \$\$i > \$\$o";;
1042 latex2html) latex_to_html_command="latex2html -no_subdir -split 0 -show_section_numbers \$\$i";;
1043 hevea) latex_to_html_command="hevea -s \$\$i";;
1046 #### Search for image conversion ####
1047 echo $ac_n "checking for an Image -> EPS converter""... $ac_c"
1048 echo "$ac_t""(convert pnmtops)"
1050 for ac_prog in convert pnmtops
1052 # Extract the first word of "$ac_prog", so it can be a program name with args.
1053 set dummy $ac_prog ; ac_word=$2
1054 if test -n "$ac_word"; then
1055 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
1056 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1057 for ac_dir in $PATH; do
1058 test -z "$ac_dir" && ac_dir=.
1059 if test -x $ac_dir/$ac_word; then
1066 if test -n "$TOEPS"; then
1072 echo "$ac_t""$ac_result"
1073 test -n "$TOEPS" && break
1077 if test -z "$TOEPS" ; then
1082 convert) gif_to_eps="convert GIF:\$\$i EPS:\$\$o" png_to_eps="convert PNG:\$\$i EPS:\$\$o" jpg_to_eps="convert JPG:\$\$i EPS:\$\$o";;
1083 pnmtops) gif_to_eps="giftopnm \$\$i | pnmtops > \$\$o" png_to_eps="pngtopnm \$\$i | pnmtops >\$\$o" jpg_to_eps="jpegtopnm \$\$i | pnmtops >\$\$o";;
1086 echo $ac_n "checking for a Image -> PNG converter""... $ac_c"
1087 echo "$ac_t""(convert pnmtopng)"
1089 for ac_prog in convert pnmtopng
1091 # Extract the first word of "$ac_prog", so it can be a program name with args.
1092 set dummy $ac_prog ; ac_word=$2
1093 if test -n "$ac_word"; then
1094 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
1095 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1096 for ac_dir in $PATH; do
1097 test -z "$ac_dir" && ac_dir=.
1098 if test -x $ac_dir/$ac_word; then
1105 if test -n "$TOPNG"; then
1111 echo "$ac_t""$ac_result"
1112 test -n "$TOPNG" && break
1116 if test -z "$TOPNG" ; then
1121 convert) gif_to_png="convert GIF:\$\$i PNG:\$\$o" eps_to_png="convert EPS:\$\$i PNG:\$\$o" jpg_to_png="convert JPG:\$\$i PNG:\$\$o";;
1122 pnmtopng) gif_to_png="giftopnm \$\$i | pnmtopng >\$\$o" eps_to_png="pstopnm \$\$i| pnmtopng >\$\$o" jpg_to_png="jpegtopnm \$\$i | pnmtopng >\$\$o";;
1125 echo $ac_n "checking for a Image -> XPM converter""... $ac_c"
1126 echo "$ac_t""(convert)"
1128 for ac_prog in convert
1130 # Extract the first word of "$ac_prog", so it can be a program name with args.
1131 set dummy $ac_prog ; ac_word=$2
1132 if test -n "$ac_word"; then
1133 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
1134 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1135 for ac_dir in $PATH; do
1136 test -z "$ac_dir" && ac_dir=.
1137 if test -x $ac_dir/$ac_word; then
1144 if test -n "$TOXPM"; then
1150 echo "$ac_t""$ac_result"
1151 test -n "$TOXPM" && break
1155 if test -z "$TOXPM" ; then
1159 if test "$TOXPM" = "convert"; then
1160 gif_to_xpm="convert GIF:\$\$i XPM:\$\$o"
1161 eps_to_xpm="convert EPS:\$\$i XPM:\$\$o"
1162 jpg_to_xpm="convert JPG:\$\$i XPM:\$\$o"
1163 png_to_xpm="convert PNG:\$\$i XPM:\$\$o"
1166 echo $ac_n "checking For an EPS -> PDF converter""... $ac_c"
1167 echo "$ac_t""(epstopdf)"
1169 for ac_prog in epstopdf
1171 # Extract the first word of "$ac_prog", so it can be a program name with args.
1172 set dummy $ac_prog ; ac_word=$2
1173 if test -n "$ac_word"; then
1174 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
1175 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1176 for ac_dir in $PATH; do
1177 test -z "$ac_dir" && ac_dir=.
1178 if test -x $ac_dir/$ac_word; then
1185 if test -n "$EPSTOPDF"; then
1191 echo "$ac_t""$ac_result"
1192 test -n "$EPSTOPDF" && break
1196 if test -z "$EPSTOPDF" ; then
1201 epstopdf) eps_to_pdf="epstopdf --outfile=\$\$o \$\$i";;
1204 #### Explore the LaTeX configuration
1205 echo $ac_n "checking LaTeX configuration""... $ac_c"
1206 # First, remove the files that we want to re-create
1207 rm -f textclass.lst packages.lst chkconfig.sed
1208 if test ${lyx_check_config} = no ; then
1209 echo "$ac_t""default values"
1212 rm -f wrap_chkconfig.ltx chkconfig.vars chkconfig.classes chklayouts.tex
1213 cat >wrap_chkconfig.ltx <<EOF
1214 \\newcommand\\srcdir{${srcdir}}
1217 \\input{${srcdir}/chkconfig.ltx}
1219 ## Construct the list of classes to test for.
1220 # build the list of available layout files and convert it to commands
1222 for file in ./layouts/*.layout ${srcdir}/layouts/*.layout ; do
1225 *) test -r "$file" && echo $file ;;
1227 done | sed -e 's%^.*layouts/\(.*\)\.layout$%\\TestDocClass{\1}%'\
1229 eval ${LATEX} wrap_chkconfig.ltx 2>/dev/null | grep '^\+'
1230 eval `cat chkconfig.vars | sed 's/-/_/g'`
1233 # Do we have all the files we need? Useful if latex did not run
1234 echo creating textclass.lst
1235 # if textclass.lst does not exist (because LaTeX did not run),
1236 # then provide a standard version.
1237 if test ! -f textclass.lst ; then
1238 cat >textclass.lst <<EOF
1239 # This file declares layouts and their associated definition files
1240 # (include dir. relative to the place where this file is).
1241 # It contains only default values, since chkconfig.ltx could not be run
1242 # for some reason. Run ./configure if you need to update it after a
1243 # configuration change.
1244 article article article
1245 report report report
1247 linuxdoc linuxdoc linuxdoc
1248 letter letter letter
1252 # if chkconfig.sed does not exist (because LaTeX did not run),
1253 # then provide a standard version.
1254 if test ! -f chkconfig.sed ; then
1255 cat >chkconfig.sed <<EOF
1260 echo creating packages.lst
1261 # if packages.lst does not exist (because LaTeX did not run),
1262 # then provide a standard version.
1263 if test ! -f packages.lst ; then
1264 cat >packages.lst <<EOF
1265 # This file should contain the list of LaTeX packages that have been
1266 # recognized by LyX. Unfortunately, since configure could not find
1267 # your LaTeX2e program, the tests have not been run. Run ./configure
1268 # if you need to update it after a configuration change.
1273 echo creating doc/LaTeXConfig.lyx
1274 echo "s/@chk_linuxdoc@/$chk_linuxdoc/g" >> chkconfig.sed
1275 echo "s/@chk_docbook@/$chk_docbook/g" >> chkconfig.sed
1276 sed -f chkconfig.sed ${srcdir}/doc/LaTeXConfig.lyx.in >doc/LaTeXConfig.lyx
1278 echo creating lyxrc.defaults
1279 rm -f lyxrc.defaults
1280 cat >lyxrc.defaults <<EOF
1281 # This file has been automatically generated by LyX' lib/configure
1282 # script. It contains default settings that have been determined by
1283 # examining your system. PLEASE DO NOT MODIFY ANYTHING HERE! If you
1284 # want to customize LyX, make a copy of the file LYXDIR/lyxrc as
1285 # ~/.lyx/lyxrc and edit this file instead. Any setting in lyxrc will
1286 # override the values given here.
1287 \\Format text txt ASCII A
1288 \\Format textparagraph txt ASCII(paragraphs) ""
1289 \\Format docbook sgml DocBook B
1290 \\Format dvi dvi DVI D
1291 \\Format eps eps EPS ""
1292 \\Format epsi epsi EPSI ""
1293 \\Format fax "" Fax ""
1294 \\Format gif gif GIF ""
1295 \\Format html html HTML H
1296 \\Format jpg jpg JPEG ""
1297 \\Format latex tex LaTeX L
1298 \\Format linuxdoc sgml LinuxDoc x
1299 \\Format lyx lyx LyX ""
1300 \\Format literate nw NoWeb N
1301 \\Format pdf pdf PDF P
1302 \\Format pdf2 pdf "PDF (pdflatex)" F
1303 \\Format pdf3 pdf "PDF (dvipdfm)" m
1304 \\Format png png PNG ""
1305 \\Format ps ps Postscript t
1306 \\Format program "" Program ""
1307 \\Format xpm xpm XPM ""
1308 \\Format word doc Word W
1310 \\converter latex dvi "$latex_to_dvi" "latex"
1311 \\converter latex pdf2 "$latex_to_pdf" "latex"
1312 \\converter latex html "$latex_to_html_command" "originaldir,needaux"
1313 \\converter literate latex "$literate_to_tex_command" ""
1314 \\converter dvi pdf3 "$dvi_to_pdf_command" ""
1315 \\converter dvi ps "$dvi_to_ps_command" ""
1316 \\converter ps pdf "$ps_to_pdf_command" ""
1317 \\converter ps fax "$fax_command" ""
1318 \\converter linuxdoc lyx "$linuxdoc_to_lyx_command" ""
1319 \\converter linuxdoc latex "$linuxdoc_to_latex_command" ""
1320 \\converter linuxdoc dvi "$linuxdoc_to_dvi_command" ""
1321 \\converter linuxdoc html "$linuxdoc_to_html_command" ""
1322 \\converter docbook dvi "$docbook_to_dvi_command" ""
1323 \\converter docbook html "$docbook_to_html_command" ""
1325 \\converter latex lyx "$tex_to_lyx_command" ""
1326 \\converter literate lyx "$literate_to_lyx_command" ""
1327 \\converter html latex "$html_to_latex_command" ""
1328 \\converter word latex "$word_to_latex_command" ""
1330 \\converter gif eps "$gif_to_eps" ""
1331 \\converter png eps "$png_to_eps" ""
1332 \\converter jpg eps "$jpg_to_eps" ""
1334 \\converter gif png "$gif_to_png" ""
1335 \\converter eps png "$eps_to_png" ""
1336 \\converter epsi png "$eps_to_png" ""
1337 \\converter jpg png "$jpg_to_png" ""
1339 \\converter gif xpm "$gif_to_xpm" ""
1340 \\converter eps xpm "$eps_to_xpm" ""
1341 \\converter epsi xpm "$eps_to_xpm" ""
1342 \\converter jpg xpm "$jpg_to_xpm" ""
1343 \\converter png xpm "$png_to_xpm" ""
1345 \\converter eps pdf "$eps_to_pdf" ""
1346 \\converter epsi pdf "$eps_to_pdf" ""
1348 \\viewer dvi "$DVI_VIEWER"
1349 \\viewer html "$HTML_VIEWER"
1350 \\viewer pdf "$PDF_VIEWER"
1351 \\viewer ps "$GHOSTVIEW -swap"
1352 \\viewer eps "$GHOSTVIEW"
1355 \\ascii_roff_command "$ascii_roff_command"
1356 \\chktex_command "$chktex_command"
1357 \\spell_command "$SPELL"
1358 \\print_spool_command "$print_spool_command"
1359 \\print_spool_printerprefix "$print_spool_printerprefix"
1360 \\font_encoding "$chk_fontenc"
1363 # Remove superfluous files if we are not writing in the main lib
1365 for file in lyxrc.defaults textclass.lst packages.lst \
1366 doc/LaTeXConfig.lyx ; do
1367 # we rename the file first, so that we avoid comparing a file with itself
1369 if test -r $srcdir/$file && diff $file.new $srcdir/$file >/dev/null 2>/dev/null ;
1371 echo "removing $file, which is identical to the system global version"
1380 if test $lyx_keep_temps = no ; then
1381 rm -f chkconfig.sed chkconfig.vars wrap_chkconfig.* chklayouts.tex \