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
116 ## Check whether this is really LaTeX2e
118 cat >chklatex.ltx <<EOF
119 \\nonstopmode\\makeatletter
120 \\ifx\\undefined\\documentclass\\else
121 \\message{ThisIsLaTeX2e}
125 if eval ${LATEX} chklatex.ltx </dev/null 2>/dev/null \
126 | grep 'ThisIsLaTeX2e' >/dev/null; then
130 ac_result="not useable"
132 rm -f chklatex.ltx chklatex.log
133 echo "$ac_t""$ac_result"
134 test -n "$LATEX" && break
138 if test -z "$LATEX" ; then
143 if test x$lyx_check_config != x ; then
144 echo $ac_n "checking for the pdflatex program""... $ac_c"
145 echo "$ac_t""(pdflatex)"
147 for ac_prog in pdflatex
149 # Extract the first word of "$ac_prog", so it can be a program name with args.
150 set dummy $ac_prog ; ac_word=$2
151 if test -n "$ac_word"; then
152 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
153 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
154 for ac_dir in $PATH; do
155 test -z "$ac_dir" && ac_dir=.
156 if test -x $ac_dir/$ac_word; then
163 if test -n "$PDFLATEX"; then
169 ## Check whether this is really LaTeX2e
171 cat >chklatex.ltx <<EOF
172 \\nonstopmode\\makeatletter
173 \\ifx\\undefined\\documentclass\\else
174 \\message{ThisIsLaTeX2e}
178 if eval ${LATEX} chklatex.ltx </dev/null 2>/dev/null \
179 | grep 'ThisIsLaTeX2e' >/dev/null; then
183 ac_result="not useable"
185 rm -f chklatex.ltx chklatex.log
186 echo "$ac_t""$ac_result"
187 test -n "$PDFLATEX" && break
191 if test -z "$PDFLATEX" ; then
197 # Search for an installed reLyX or a ready-to-install one
199 PATH=${PATH}:./reLyX/
200 echo $ac_n "checking for a LaTeX -> LyX converter""... $ac_c"
201 echo "$ac_t""(reLyX)"
205 # Extract the first word of "$ac_prog", so it can be a program name with args.
206 set dummy $ac_prog ; ac_word=$2
207 if test -n "$ac_word"; then
208 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
209 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
210 for ac_dir in $PATH; do
211 test -z "$ac_dir" && ac_dir=.
212 if test -x $ac_dir/$ac_word; then
213 tex_to_lyx_command="$ac_prog"
219 if test -n "$tex_to_lyx_command"; then
225 echo "$ac_t""$ac_result"
226 test -n "$tex_to_lyx_command" && break
230 if test -z "$tex_to_lyx_command" ; then
231 tex_to_lyx_command=none
235 test $tex_to_lyx_command = "reLyX" && tex_to_lyx_command="reLyX -f \$\$i"
236 tex_to_lyx_command=`echo $tex_to_lyx_command | sed "s,reLyX,reLyX$lyx_suffix,"`
238 echo $ac_n "checking for a Noweb -> LyX converter""... $ac_c"
239 echo "$ac_t""(noweb2lyx)"
240 literate_to_lyx_command=
241 for ac_prog in noweb2lyx
243 # Extract the first word of "$ac_prog", so it can be a program name with args.
244 set dummy $ac_prog ; ac_word=$2
245 if test -n "$ac_word"; then
246 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
247 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
248 for ac_dir in $PATH; do
249 test -z "$ac_dir" && ac_dir=.
250 if test -x $ac_dir/$ac_word; then
251 literate_to_lyx_command="$ac_prog"
257 if test -n "$literate_to_lyx_command"; then
263 echo "$ac_t""$ac_result"
264 test -n "$literate_to_lyx_command" && break
268 if test -z "$literate_to_lyx_command" ; then
269 literate_to_lyx_command=none
272 test $literate_to_lyx_command = "noweb2lyx" && literate_to_lyx_command="noweb2lyx \$\$i \$\$o"
273 literate_to_lyx_command=`echo $literate_to_lyx_command | sed "s,noweb2lyx,noweb2lyx$lyx_suffix,"`
275 # Search something to process a literate document
276 echo $ac_n "checking for a Noweb -> LaTeX converter""... $ac_c"
277 echo "$ac_t""(noweave)"
278 literate_to_tex_command=
279 for ac_prog in noweave
281 # Extract the first word of "$ac_prog", so it can be a program name with args.
282 set dummy $ac_prog ; ac_word=$2
283 if test -n "$ac_word"; then
284 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
285 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
286 for ac_dir in $PATH; do
287 test -z "$ac_dir" && ac_dir=.
288 if test -x $ac_dir/$ac_word; then
289 literate_to_tex_command="$ac_prog"
295 if test -n "$literate_to_tex_command"; then
301 echo "$ac_t""$ac_result"
302 test -n "$literate_to_tex_command" && break
306 if test -z "$literate_to_tex_command" ; then
307 literate_to_tex_command=none
310 test $literate_to_tex_command = "noweave" && literate_to_tex_command="noweave -delay -index \$\$i > \$\$o"
312 echo $ac_n "checking for a HTML -> Latex converter""... $ac_c"
313 echo "$ac_t""(html2latex)"
314 html_to_latex_command=
315 for ac_prog in html2latex
317 # Extract the first word of "$ac_prog", so it can be a program name with args.
318 set dummy $ac_prog ; ac_word=$2
319 if test -n "$ac_word"; then
320 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
321 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
322 for ac_dir in $PATH; do
323 test -z "$ac_dir" && ac_dir=.
324 if test -x $ac_dir/$ac_word; then
325 html_to_latex_command="$ac_prog"
331 if test -n "$html_to_latex_command"; then
337 echo "$ac_t""$ac_result"
338 test -n "$html_to_latex_command" && break
342 if test -z "$html_to_latex_command" ; then
343 html_to_latex_command=none
346 test $html_to_latex_command = "html2latex" && html_to_latex_command="html2latex \$\$i"
348 echo $ac_n "checking for a MSWord -> Latex converter""... $ac_c"
349 echo "$ac_t""(wvCleanLatex word2x)"
350 word_to_latex_command=
351 for ac_prog in wvCleanLatex word2x
353 # Extract the first word of "$ac_prog", so it can be a program name with args.
354 set dummy $ac_prog ; ac_word=$2
355 if test -n "$ac_word"; then
356 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
357 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
358 for ac_dir in $PATH; do
359 test -z "$ac_dir" && ac_dir=.
360 if test -x $ac_dir/$ac_word; then
361 word_to_latex_command="$ac_prog"
367 if test -n "$word_to_latex_command"; then
373 echo "$ac_t""$ac_result"
374 test -n "$word_to_latex_command" && break
378 if test -z "$word_to_latex_command" ; then
379 word_to_latex_command=none
382 test "$word_to_latex_command" = "wvCleanLatex" && word_to_latex_command="wvCleanLatex \$\$i \$\$o"
383 test "$word_to_latex_command" = "word2x" && word_to_latex_command="word2x -f latex \$\$i"
385 echo $ac_n "checking for Image converter""... $ac_c"
386 echo "$ac_t""(convert)"
388 for ac_prog in convert
390 # Extract the first word of "$ac_prog", so it can be a program name with args.
391 set dummy $ac_prog ; ac_word=$2
392 if test -n "$ac_word"; then
393 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
394 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
395 for ac_dir in $PATH; do
396 test -z "$ac_dir" && ac_dir=.
397 if test -x $ac_dir/$ac_word; then
398 image_command="$ac_prog"
404 if test -n "$image_command"; then
410 echo "$ac_t""$ac_result"
411 test -n "$image_command" && break
415 if test -z "$image_command" ; then
419 test $image_command = "convert" && image_command="convert \$\$i \$\$o"
421 # Search for a Postscript interpreter
422 echo $ac_n "checking for a Postscript interpreter""... $ac_c"
427 # Extract the first word of "$ac_prog", so it can be a program name with args.
428 set dummy $ac_prog ; ac_word=$2
429 if test -n "$ac_word"; then
430 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
431 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
432 for ac_dir in $PATH; do
433 test -z "$ac_dir" && ac_dir=.
434 if test -x $ac_dir/$ac_word; then
441 if test -n "$GS"; then
447 echo "$ac_t""$ac_result"
448 test -n "$GS" && break
452 if test -z "$GS" ; then
457 # Search something to preview postscript
458 echo $ac_n "checking for a Postscript previewer""... $ac_c"
459 echo "$ac_t""(gv ghostview)"
461 for ac_prog in gv ghostview
463 # Extract the first word of "$ac_prog", so it can be a program name with args.
464 set dummy $ac_prog ; ac_word=$2
465 if test -n "$ac_word"; then
466 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
467 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
468 for ac_dir in $PATH; do
469 test -z "$ac_dir" && ac_dir=.
470 if test -x $ac_dir/$ac_word; then
477 if test -n "$GHOSTVIEW"; then
483 echo "$ac_t""$ac_result"
484 test -n "$GHOSTVIEW" && break
488 if test -z "$GHOSTVIEW" ; then
493 # Search for a program to preview pdf
494 echo $ac_n "checking for a PDF preview""... $ac_c"
495 echo "$ac_t""(acroread gv ghostview xpdf)"
497 for ac_prog in acroread gv ghostview xpdf
499 # Extract the first word of "$ac_prog", so it can be a program name with args.
500 set dummy $ac_prog ; ac_word=$2
501 if test -n "$ac_word"; then
502 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
503 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
504 for ac_dir in $PATH; do
505 test -z "$ac_dir" && ac_dir=.
506 if test -x $ac_dir/$ac_word; then
507 PDF_VIEWER="$ac_prog"
513 if test -n "$PDF_VIEWER"; then
519 echo "$ac_t""$ac_result"
520 test -n "$PDF_VIEWER" && break
524 if test -z "$PDF_VIEWER" ; then
529 # Search something to preview dvi
530 echo $ac_n "checking for a DVI previewer""... $ac_c"
531 echo "$ac_t""(xdvi windvi yap)"
533 for ac_prog in xdvi windvi yap
535 # Extract the first word of "$ac_prog", so it can be a program name with args.
536 set dummy $ac_prog ; ac_word=$2
537 if test -n "$ac_word"; then
538 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
539 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
540 for ac_dir in $PATH; do
541 test -z "$ac_dir" && ac_dir=.
542 if test -x $ac_dir/$ac_word; then
543 DVI_VIEWER="$ac_prog"
549 if test -n "$DVI_VIEWER"; then
555 echo "$ac_t""$ac_result"
556 test -n "$DVI_VIEWER" && break
560 if test -z "$DVI_VIEWER" ; then
565 # Search something to preview html
566 echo $ac_n "checking for a HTML previewer""... $ac_c"
567 echo "$ac_t""(netscape)"
569 for ac_prog in netscape
571 # Extract the first word of "$ac_prog", so it can be a program name with args.
572 set dummy $ac_prog ; ac_word=$2
573 if test -n "$ac_word"; then
574 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
575 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
576 for ac_dir in $PATH; do
577 test -z "$ac_dir" && ac_dir=.
578 if test -x $ac_dir/$ac_word; then
579 HTML_VIEWER="$ac_prog"
585 if test -n "$HTML_VIEWER"; then
591 echo "$ac_t""$ac_result"
592 test -n "$HTML_VIEWER" && break
596 if test -z "$HTML_VIEWER" ; then
601 # Search for a program to convert ps to pdf
602 echo $ac_n "checking for a PS to PDF converter""... $ac_c"
603 echo "$ac_t""(ps2pdf)"
605 for ac_prog in ps2pdf
607 # Extract the first word of "$ac_prog", so it can be a program name with args.
608 set dummy $ac_prog ; ac_word=$2
609 if test -n "$ac_word"; then
610 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
611 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
612 for ac_dir in $PATH; do
613 test -z "$ac_dir" && ac_dir=.
614 if test -x $ac_dir/$ac_word; then
615 ps_to_pdf_command="$ac_prog"
621 if test -n "$ps_to_pdf_command"; then
627 echo "$ac_t""$ac_result"
628 test -n "$ps_to_pdf_command" && break
632 if test -z "$ps_to_pdf_command" ; then
633 ps_to_pdf_command=none
636 test $ps_to_pdf_command = "ps2pdf" && ps_to_pdf_command="ps2pdf \$\$i"
638 # Search for a program to convert dvi to ps
639 echo $ac_n "checking for a DVI to PS converter""... $ac_c"
640 echo "$ac_t""(dvips)"
644 # Extract the first word of "$ac_prog", so it can be a program name with args.
645 set dummy $ac_prog ; ac_word=$2
646 if test -n "$ac_word"; then
647 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
648 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
649 for ac_dir in $PATH; do
650 test -z "$ac_dir" && ac_dir=.
651 if test -x $ac_dir/$ac_word; then
652 dvi_to_ps_command="$ac_prog"
658 if test -n "$dvi_to_ps_command"; then
664 echo "$ac_t""$ac_result"
665 test -n "$dvi_to_ps_command" && break
669 if test -z "$dvi_to_ps_command" ; then
670 dvi_to_ps_command=none
673 test $dvi_to_ps_command = "dvips" && dvi_to_ps_command="dvips -o \$\$o \$\$i"
675 # Search for a program to convert dvi to pdf
676 echo $ac_n "checking for a DVI to PDF converter""... $ac_c"
677 echo "$ac_t""(dvipdfm)"
679 for ac_prog in dvipdfm
681 # Extract the first word of "$ac_prog", so it can be a program name with args.
682 set dummy $ac_prog ; ac_word=$2
683 if test -n "$ac_word"; then
684 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
685 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
686 for ac_dir in $PATH; do
687 test -z "$ac_dir" && ac_dir=.
688 if test -x $ac_dir/$ac_word; then
689 dvi_to_pdf_command="$ac_prog"
695 if test -n "$dvi_to_pdf_command"; then
701 echo "$ac_t""$ac_result"
702 test -n "$dvi_to_pdf_command" && break
706 if test -z "$dvi_to_pdf_command" ; then
707 dvi_to_pdf_command=none
710 test $dvi_to_pdf_command = "dvipdfm" && dvi_to_pdf_command="dvipdfm \$\$i"
712 # Search a *roff program (used to translate tables in ASCII export)
713 echo $ac_n "checking for a *roff formatter""... $ac_c"
714 echo "$ac_t""(groff nroff)"
716 for ac_prog in groff nroff
718 # Extract the first word of "$ac_prog", so it can be a program name with args.
719 set dummy $ac_prog ; ac_word=$2
720 if test -n "$ac_word"; then
721 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
722 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
723 for ac_dir in $PATH; do
724 test -z "$ac_dir" && ac_dir=.
725 if test -x $ac_dir/$ac_word; then
732 if test -n "$ROFF"; then
738 echo "$ac_t""$ac_result"
739 test -n "$ROFF" && break
743 if test -z "$ROFF" ; then
747 ascii_roff_command=$ROFF
748 test $ROFF = "groff" && ascii_roff_command="groff -t -Tlatin1 \$\$FName"
749 test $ROFF = "nroff" && ascii_roff_command="tbl \$\$FName | nroff"
751 # Search the ChkTeX program
752 echo $ac_n "checking for ChkTeX""... $ac_c"
753 echo "$ac_t""(chktex)"
755 for ac_prog in chktex
757 # Extract the first word of "$ac_prog", so it can be a program name with args.
758 set dummy $ac_prog ; ac_word=$2
759 if test -n "$ac_word"; then
760 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
761 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
762 for ac_dir in $PATH; do
763 test -z "$ac_dir" && ac_dir=.
764 if test -x $ac_dir/$ac_word; then
771 if test -n "$CHKTEX"; then
777 echo "$ac_t""$ac_result"
778 test -n "$CHKTEX" && break
782 if test -z "$CHKTEX" ; then
786 chktex_command=$CHKTEX
787 test $CHKTEX = "chktex" && chktex_command="$CHKTEX -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38"
789 # Search for a spellchecker
790 echo $ac_n "checking for a spell-checker""... $ac_c"
791 echo "$ac_t""(ispell)"
793 for ac_prog in ispell
795 # Extract the first word of "$ac_prog", so it can be a program name with args.
796 set dummy $ac_prog ; ac_word=$2
797 if test -n "$ac_word"; then
798 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
799 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
800 for ac_dir in $PATH; do
801 test -z "$ac_dir" && ac_dir=.
802 if test -x $ac_dir/$ac_word; then
809 if test -n "$SPELL"; then
815 echo "$ac_t""$ac_result"
816 test -n "$SPELL" && break
820 if test -z "$SPELL" ; then
826 # Search a GUI Fax program
827 echo $ac_n "checking for a fax program""... $ac_c"
828 echo "$ac_t""(ksendfax)"
830 for ac_prog in ksendfax
832 # Extract the first word of "$ac_prog", so it can be a program name with args.
833 set dummy $ac_prog ; ac_word=$2
834 if test -n "$ac_word"; then
835 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
836 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
837 for ac_dir in $PATH; do
838 test -z "$ac_dir" && ac_dir=.
839 if test -x $ac_dir/$ac_word; then
840 fax_command="$ac_prog"
846 if test -n "$fax_command"; then
852 echo "$ac_t""$ac_result"
853 test -n "$fax_command" && break
857 if test -z "$fax_command" ; then
861 test $fax_command = "ksendfax" && fax_command="ksendfax \$\$i"
863 # Search for LinuxDoc support
864 echo $ac_n "checking for SGML-tools 1.x (LinuxDoc)""... $ac_c"
865 echo "$ac_t""(sgml2lyx)"
867 for ac_prog in sgml2lyx
869 # Extract the first word of "$ac_prog", so it can be a program name with args.
870 set dummy $ac_prog ; ac_word=$2
871 if test -n "$ac_word"; then
872 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
873 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
874 for ac_dir in $PATH; do
875 test -z "$ac_dir" && ac_dir=.
876 if test -x $ac_dir/$ac_word; then
883 if test -n "$LINUXDOC"; then
889 echo "$ac_t""$ac_result"
890 test -n "$LINUXDOC" && break
894 if test -z "$LINUXDOC" ; then
899 if test $LINUXDOC != none; then
901 linuxdoc_cmd="\\def\\haslinuxdoc{yes}"
906 linuxdoc_to_latex_command="sgml2latex \$\$i"
907 linuxdoc_to_dvi_command="sgml2latex -o dvi \$\$i"
908 linuxdoc_to_html_command="sgml2html \$\$i"
909 linuxdoc_to_lyx_command="sgml2lyx \$\$i";;
911 linuxdoc_to_latex_command="none"
912 linuxdoc_to_dvi_command="none"
913 linuxdoc_to_html_command="none"
914 linuxdoc_to_lyx_command="none";;
917 # Search for DocBook support
918 echo $ac_n "checking for SGML-tools 2.x (DocBook) or db2x scripts""... $ac_c"
919 echo "$ac_t""(sgmltools db2dvi)"
921 for ac_prog in sgmltools db2dvi
923 # Extract the first word of "$ac_prog", so it can be a program name with args.
924 set dummy $ac_prog ; ac_word=$2
925 if test -n "$ac_word"; then
926 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
927 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
928 for ac_dir in $PATH; do
929 test -z "$ac_dir" && ac_dir=.
930 if test -x $ac_dir/$ac_word; then
937 if test -n "$DOCBOOK"; then
943 echo "$ac_t""$ac_result"
944 test -n "$DOCBOOK" && break
948 if test -z "$DOCBOOK" ; then
953 if test $DOCBOOK != none; then
955 docbook_cmd="\\def\\hasdocbook{yes}"
960 docbook_to_dvi_command="sgmltools -b dvi \$\$i"
961 docbook_to_html_command="sgmltools -b html \$\$i";;
963 docbook_to_dvi_command="db2dvi \$\$i"
964 docbook_to_html_command="db2html \$\$i";;
966 docbook_to_dvi_command="none"
967 docbook_to_html_command="none";;
970 # Search for a spool command
971 echo $ac_n "checking for a spool command""... $ac_c"
972 echo "$ac_t""(lp lpr)"
974 for ac_prog in lp lpr
976 # Extract the first word of "$ac_prog", so it can be a program name with args.
977 set dummy $ac_prog ; ac_word=$2
978 if test -n "$ac_word"; then
979 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
980 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
981 for ac_dir in $PATH; do
982 test -z "$ac_dir" && ac_dir=.
983 if test -x $ac_dir/$ac_word; then
990 if test -n "$LPR"; then
996 echo "$ac_t""$ac_result"
997 test -n "$LPR" && break
1001 if test -z "$LPR" ; then
1006 lp) print_spool_command=lp
1007 print_spool_printerprefix="-d ";;
1008 lpr) print_spool_command=lpr
1009 print_spool_printerprefix="-P";;
1010 *) :;; # leave to empty values
1013 echo $ac_n "checking for a LaTeX -> HTML converter""... $ac_c"
1014 echo "$ac_t""(tth latex2html hevea)"
1016 for ac_prog in tth latex2html hevea
1018 # Extract the first word of "$ac_prog", so it can be a program name with args.
1019 set dummy $ac_prog ; ac_word=$2
1020 if test -n "$ac_word"; then
1021 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
1022 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1023 for ac_dir in $PATH; do
1024 test -z "$ac_dir" && ac_dir=.
1025 if test -x $ac_dir/$ac_word; then
1032 if test -n "$TOHTML"; then
1038 echo "$ac_t""$ac_result"
1039 test -n "$TOHTML" && break
1043 if test -z "$TOHTML" ; then
1047 latex_to_html_command=$TOHTML
1049 tth) latex_to_html_command="tth -t -e2 -L\$\$b < \$\$i > \$\$o";;
1050 latex2html) latex_to_html_command="latex2html -no_subdir -split 0 -show_section_numbers \$\$i";;
1051 hevea) latex_to_html_command="hevea -s \$\$i";;
1054 #### Explore the LaTeX configuration
1055 echo $ac_n "checking LaTeX configuration""... $ac_c"
1056 # First, remove the files that we want to re-create
1057 rm -f textclass.lst packages.lst chkconfig.sed
1058 if test ${lyx_check_config} = no ; then
1059 echo "$ac_t""default values"
1062 rm -f wrap_chkconfig.ltx chkconfig.vars chkconfig.classes chklayouts.tex
1063 cat >wrap_chkconfig.ltx <<EOF
1064 \\newcommand\\srcdir{${srcdir}}
1067 \\input{${srcdir}/chkconfig.ltx}
1069 ## Construct the list of classes to test for.
1070 # build the list of available layout files and convert it to commands
1072 for file in ./layouts/*.layout ${srcdir}/layouts/*.layout ; do
1075 *) test -r "$file" && echo $file ;;
1077 done | sed -e 's%^.*layouts/\(.*\)\.layout$%\\TestDocClass{\1}%'\
1079 eval ${LATEX} wrap_chkconfig.ltx 2>/dev/null | grep '^\+'
1080 eval `cat chkconfig.vars | sed 's/-/_/g'`
1083 # Do we have all the files we need? Useful if latex did not run
1084 echo creating textclass.lst
1085 # if textclass.lst does not exist (because LaTeX did not run),
1086 # then provide a standard version.
1087 if test ! -f textclass.lst ; then
1088 cat >textclass.lst <<EOF
1089 # This file declares layouts and their associated definition files
1090 # (include dir. relative to the place where this file is).
1091 # It contains only default values, since chkconfig.ltx could not be run
1092 # for some reason. Run ./configure if you need to update it after a
1093 # configuration change.
1094 article article article
1095 report report report
1097 linuxdoc linuxdoc linuxdoc
1098 letter letter letter
1102 # if chkconfig.sed does not exist (because LaTeX did not run),
1103 # then provide a standard version.
1104 if test ! -f chkconfig.sed ; then
1105 cat >chkconfig.sed <<EOF
1110 echo creating packages.lst
1111 # if packages.lst does not exist (because LaTeX did not run),
1112 # then provide a standard version.
1113 if test ! -f packages.lst ; then
1114 cat >packages.lst <<EOF
1115 # This file should contain the list of LaTeX packages that have been
1116 # recognized by LyX. Unfortunately, since configure could not find
1117 # your LaTeX2e program, the tests have not been run. Run ./configure
1118 # if you need to update it after a configuration change.
1123 echo creating doc/LaTeXConfig.lyx
1124 echo "s/@chk_linuxdoc@/$chk_linuxdoc/g" >> chkconfig.sed
1125 echo "s/@chk_docbook@/$chk_docbook/g" >> chkconfig.sed
1126 sed -f chkconfig.sed ${srcdir}/doc/LaTeXConfig.lyx.in >doc/LaTeXConfig.lyx
1128 echo creating lyxrc.defaults
1129 rm -f lyxrc.defaults
1130 cat >lyxrc.defaults <<EOF
1131 # This file has been automatically generated by LyX' lib/configure
1132 # script. It contains default settings that have been determined by
1133 # examining your system. PLEASE DO NOT MODIFY ANYTHING HERE! If you
1134 # want to customize LyX, make a copy of the file LYXDIR/lyxrc as
1135 # ~/.lyx/lyxrc and edit this file instead. Any setting in lyxrc will
1136 # override the values given here.
1137 \\Format text txt ASCII A
1138 \\Format textparagraph txt ASCII(paragraphs) ""
1139 \\Format docbook sgml DocBook B
1140 \\Format dvi dvi DVI D
1141 \\Format eps eps EPS ""
1142 \\Format fax "" Fax ""
1143 \\Format gif gif GIF ""
1144 \\Format html html HTML H
1145 \\Format jpg jpg JPEG ""
1146 \\Format latex tex LaTeX L
1147 \\Format linuxdoc sgml LinuxDoc x
1148 \\Format lyx lyx LyX ""
1149 \\Format literate nw NoWeb N
1150 \\Format pdf pdf PDF P
1151 \\Format pdf2 pdf "PDF (pdflatex)" F
1152 \\Format pdf3 pdf "PDF (dvipdfm)" m
1153 \\Format png png PNG ""
1154 \\Format ps ps Postscript t
1155 \\Format program "" Program ""
1156 \\Format word doc Word W
1159 \\converter latex dvi "$LATEX \$\$i" "latex"
1160 \\converter latex pdf2 "$PDFLATEX \$\$i" "latex"
1161 \\converter latex html "$latex_to_html_command" "originaldir,needaux"
1162 \\converter literate latex "$literate_to_tex_command" ""
1163 \\converter dvi pdf3 "$dvi_to_pdf_command" ""
1164 \\converter dvi ps "$dvi_to_ps_command" ""
1165 \\converter ps pdf "$ps_to_pdf_command" ""
1166 \\converter ps fax "$fax_command" ""
1167 \\converter linuxdoc lyx "$linuxdoc_to_lyx_command" ""
1168 \\converter linuxdoc latex "$linuxdoc_to_latex_command" ""
1169 \\converter linuxdoc dvi "$linuxdoc_to_dvi_command" ""
1170 \\converter linuxdoc html "$linuxdoc_to_html_command" ""
1171 \\converter docbook dvi "$docbook_to_dvi_command" ""
1172 \\converter docbook html "$docbook_to_html_command" ""
1174 \\converter latex lyx "$tex_to_lyx_command" ""
1175 \\converter literate lyx "$literate_to_lyx_command" ""
1176 \\converter html latex "$html_to_latex_command" ""
1177 \\converter word latex "$word_to_latex_command" ""
1179 \converter gif eps "$image_command" ""
1180 \converter png eps "$image_command" ""
1181 \converter jpg eps "$image_command" ""
1182 \converter gif png "$image_command" ""
1184 \\viewer dvi "$DVI_VIEWER"
1185 \\viewer html "$HTML_VIEWER"
1186 \\viewer pdf "$PDF_VIEWER"
1187 \\viewer ps "$GHOSTVIEW -swap"
1188 \\viewer eps "$GHOSTVIEW"
1191 \\ascii_roff_command "$ascii_roff_command"
1192 \\chktex_command "$chktex_command"
1193 \\spell_command "$SPELL"
1194 \\print_spool_command "$print_spool_command"
1195 \\print_spool_printerprefix "$print_spool_printerprefix"
1196 \\font_encoding "$chk_fontenc"
1199 # Remove superfluous files if we are not writing in the main lib
1201 for file in lyxrc.defaults textclass.lst packages.lst \
1202 doc/LaTeXConfig.lyx ; do
1203 # we rename the file first, so that we avoid comparing a file with itself
1205 if test -r $srcdir/$file && diff $file.new $srcdir/$file >/dev/null 2>/dev/null ;
1207 echo "removing $file, which is identical to the system global version"
1216 if test $lyx_keep_temps = no ; then
1217 rm -f chkconfig.sed chkconfig.vars wrap_chkconfig.* chklayouts.tex \