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.
12 ####some configuration variables
13 outfile=lyxrc.defaults
20 #### Parse the command line
25 Usage: configure [options]
27 --help show this help lines
28 --keep-temps keep temporary files (for debug. purposes)
29 --without-latex-config do not run LaTeX to determine configuration
30 --with-lyx-suffix=suffix suffix of binary installed files
33 --without-latex-config)
34 lyx_check_config=no ;;
38 lyx_suffix=`echo "$ac_option" | sed 's,--with-lyx-suffix=,,;s,^,-,'`
43 #### Checking for some echo oddities
44 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
45 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
46 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
57 #### I do not really know why this is useful, but we might as well keep it.
59 # Only set these to C if already set. These must not be set unconditionally
60 # because not all systems understand e.g. LANG=C (notably SCO).
61 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
62 # Non-C LC_CTYPE values break the ctype check.
63 if test "${LANG+set}" = set; then LANG=C; export LANG; fi
64 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
65 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
66 if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
69 #### Guess the directory in which configure is located.
71 srcdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
72 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
73 test "x$srcdir" = "x$ac_prog" && srcdir=.
74 if test ! -r ${srcdir}/chkconfig.ltx ; then
75 echo "configure: error: cannot find chkconfig.ltx script"
79 #### Adjust PATH for Win32 (Cygwin)
80 if test "x$OSTYPE" = xcygwin; then
81 echo "configure: cygwin detected; path correction"
82 srcdir=`cygpath -w "${srcdir}" | tr '\\\\' /`
83 echo "srcdir=${srcdir}"
86 #### Create the build directories if necessary
87 for dir in bind clipart doc examples help images kbd layouts reLyX \
88 scripts templates ui ; do
89 test ! -d $dir && mkdir $dir
93 #### Searching some useful programs
95 echo $ac_n "checking for a LaTeX2e program""... $ac_c"
96 echo "$ac_t""(latex latex2e)"
98 for ac_prog in latex latex2e
100 # Extract the first word of "$ac_prog", so it can be a program name with args.
101 set dummy $ac_prog ; ac_word=$2
102 if test -n "$ac_word"; then
103 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
104 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
105 for ac_dir in $PATH; do
106 test -z "$ac_dir" && ac_dir=.
107 if test -x $ac_dir/$ac_word; then
114 if test -n "$LATEX"; then
117 ## Check whether this is really LaTeX2e
119 cat >chklatex.ltx <<EOF
120 \\nonstopmode\\makeatletter
121 \\ifx\\undefined\\documentclass\\else
122 \\message{ThisIsLaTeX2e}
126 if eval ${LATEX} chklatex.ltx </dev/null 2>/dev/null \
127 | grep 'ThisIsLaTeX2e' >/dev/null; then
131 ac_result="not useable"
133 rm -f chklatex.ltx chklatex.log
137 echo "$ac_t""$ac_result"
138 test -n "$LATEX" && break
142 if test -z "$LATEX" ; then
148 test -z "$latex_to_dvi" && latex_to_dvi="none"
150 # Search for pdflatex
151 if test ${lyx_check_config} = no ; then
154 echo $ac_n "checking for the pdflatex program""... $ac_c"
155 echo "$ac_t""(pdflatex)"
157 for ac_prog in pdflatex
159 # Extract the first word of "$ac_prog", so it can be a program name with args.
160 set dummy $ac_prog ; ac_word=$2
161 if test -n "$ac_word"; then
162 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
163 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
164 for ac_dir in $PATH; do
165 test -z "$ac_dir" && ac_dir=.
166 if test -x $ac_dir/$ac_word; then
167 latex_to_pdf="$ac_prog"
173 if test -n "$latex_to_pdf"; then
179 echo "$ac_t""$ac_result"
180 test -n "$latex_to_pdf" && break
184 if test -z "$latex_to_pdf" ; then
190 test $latex_to_dvi != "none" && latex_to_dvi="$latex_to_dvi \$\$i"
191 test $latex_to_pdf != "none" && latex_to_pdf="$latex_to_pdf \$\$i"
193 # Search for an installed reLyX or a ready-to-install one
195 PATH=${PATH}:./reLyX/
196 echo $ac_n "checking for a LaTeX -> LyX converter""... $ac_c"
197 echo "$ac_t""(reLyX)"
201 # Extract the first word of "$ac_prog", so it can be a program name with args.
202 set dummy $ac_prog ; ac_word=$2
203 if test -n "$ac_word"; then
204 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
205 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
206 for ac_dir in $PATH; do
207 test -z "$ac_dir" && ac_dir=.
208 if test -x $ac_dir/$ac_word; then
209 tex_to_lyx_command="$ac_prog"
215 if test -n "$tex_to_lyx_command"; then
221 echo "$ac_t""$ac_result"
222 test -n "$tex_to_lyx_command" && break
226 if test -z "$tex_to_lyx_command" ; then
227 tex_to_lyx_command=none
231 test $tex_to_lyx_command = "reLyX" && tex_to_lyx_command="reLyX -f \$\$i"
232 tex_to_lyx_command=`echo $tex_to_lyx_command | sed "s,reLyX,reLyX$lyx_suffix,"`
234 echo $ac_n "checking for a Noweb -> LyX converter""... $ac_c"
235 echo "$ac_t""(noweb2lyx)"
236 literate_to_lyx_command=
237 for ac_prog in noweb2lyx
239 # Extract the first word of "$ac_prog", so it can be a program name with args.
240 set dummy $ac_prog ; ac_word=$2
241 if test -n "$ac_word"; then
242 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
243 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
244 for ac_dir in $PATH; do
245 test -z "$ac_dir" && ac_dir=.
246 if test -x $ac_dir/$ac_word; then
247 literate_to_lyx_command="$ac_prog"
253 if test -n "$literate_to_lyx_command"; then
259 echo "$ac_t""$ac_result"
260 test -n "$literate_to_lyx_command" && break
264 if test -z "$literate_to_lyx_command" ; then
265 literate_to_lyx_command=none
268 test $literate_to_lyx_command = "noweb2lyx" && literate_to_lyx_command="noweb2lyx \$\$i \$\$o"
269 literate_to_lyx_command=`echo $literate_to_lyx_command | sed "s,noweb2lyx,noweb2lyx$lyx_suffix,"`
271 # Search something to process a literate document
272 echo $ac_n "checking for a Noweb -> LaTeX converter""... $ac_c"
273 echo "$ac_t""(noweave)"
274 literate_to_tex_command=
275 for ac_prog in noweave
277 # Extract the first word of "$ac_prog", so it can be a program name with args.
278 set dummy $ac_prog ; ac_word=$2
279 if test -n "$ac_word"; then
280 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
281 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
282 for ac_dir in $PATH; do
283 test -z "$ac_dir" && ac_dir=.
284 if test -x $ac_dir/$ac_word; then
285 literate_to_tex_command="$ac_prog"
291 if test -n "$literate_to_tex_command"; then
297 echo "$ac_t""$ac_result"
298 test -n "$literate_to_tex_command" && break
302 if test -z "$literate_to_tex_command" ; then
303 literate_to_tex_command=none
306 test $literate_to_tex_command = "noweave" && literate_to_tex_command="noweave -delay -index \$\$i > \$\$o"
308 echo $ac_n "checking for a HTML -> Latex converter""... $ac_c"
309 echo "$ac_t""(html2latex)"
310 html_to_latex_command=
311 for ac_prog in html2latex
313 # Extract the first word of "$ac_prog", so it can be a program name with args.
314 set dummy $ac_prog ; ac_word=$2
315 if test -n "$ac_word"; then
316 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
317 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
318 for ac_dir in $PATH; do
319 test -z "$ac_dir" && ac_dir=.
320 if test -x $ac_dir/$ac_word; then
321 html_to_latex_command="$ac_prog"
327 if test -n "$html_to_latex_command"; then
333 echo "$ac_t""$ac_result"
334 test -n "$html_to_latex_command" && break
338 if test -z "$html_to_latex_command" ; then
339 html_to_latex_command=none
342 test $html_to_latex_command = "html2latex" && html_to_latex_command="html2latex \$\$i"
344 echo $ac_n "checking for a MSWord -> Latex converter""... $ac_c"
345 echo "$ac_t""(wvCleanLatex word2x)"
346 word_to_latex_command=
347 for ac_prog in wvCleanLatex word2x
349 # Extract the first word of "$ac_prog", so it can be a program name with args.
350 set dummy $ac_prog ; ac_word=$2
351 if test -n "$ac_word"; then
352 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
353 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
354 for ac_dir in $PATH; do
355 test -z "$ac_dir" && ac_dir=.
356 if test -x $ac_dir/$ac_word; then
357 word_to_latex_command="$ac_prog"
363 if test -n "$word_to_latex_command"; then
369 echo "$ac_t""$ac_result"
370 test -n "$word_to_latex_command" && break
374 if test -z "$word_to_latex_command" ; then
375 word_to_latex_command=none
378 test "$word_to_latex_command" = "wvCleanLatex" && word_to_latex_command="wvCleanLatex \$\$i \$\$o"
379 test "$word_to_latex_command" = "word2x" && word_to_latex_command="word2x -f latex \$\$i"
381 echo $ac_n "checking for Image converter""... $ac_c"
382 echo "$ac_t""(convert)"
384 for ac_prog in convert
386 # Extract the first word of "$ac_prog", so it can be a program name with args.
387 set dummy $ac_prog ; ac_word=$2
388 if test -n "$ac_word"; then
389 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
390 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
391 for ac_dir in $PATH; do
392 test -z "$ac_dir" && ac_dir=.
393 if test -x $ac_dir/$ac_word; then
394 image_command="$ac_prog"
400 if test -n "$image_command"; then
406 echo "$ac_t""$ac_result"
407 test -n "$image_command" && break
411 if test -z "$image_command" ; then
415 test $image_command = "convert" && image_command="convert \$\$i \$\$o"
417 # Search for a Postscript interpreter
418 echo $ac_n "checking for a Postscript interpreter""... $ac_c"
423 # Extract the first word of "$ac_prog", so it can be a program name with args.
424 set dummy $ac_prog ; ac_word=$2
425 if test -n "$ac_word"; then
426 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
427 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
428 for ac_dir in $PATH; do
429 test -z "$ac_dir" && ac_dir=.
430 if test -x $ac_dir/$ac_word; then
437 if test -n "$prog"; then
443 echo "$ac_t""$ac_result"
444 test -n "$prog" && break
448 if test -z "$prog" ; then
452 rc_entries="$rc_entries
453 \ps_command \"$prog\""
455 # Search something to preview postscript
456 echo $ac_n "checking for a Postscript previewer""... $ac_c"
457 echo "$ac_t""(gv ghostview)"
459 for ac_prog in gv ghostview
461 # Extract the first word of "$ac_prog", so it can be a program name with args.
462 set dummy $ac_prog ; ac_word=$2
463 if test -n "$ac_word"; then
464 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
465 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
466 for ac_dir in $PATH; do
467 test -z "$ac_dir" && ac_dir=.
468 if test -x $ac_dir/$ac_word; then
475 if test -n "$GHOSTVIEW"; then
481 echo "$ac_t""$ac_result"
482 test -n "$GHOSTVIEW" && break
486 if test -z "$GHOSTVIEW" ; then
491 # Search for a program to preview pdf
492 echo $ac_n "checking for a PDF preview""... $ac_c"
493 echo "$ac_t""(acroread gv ghostview xpdf)"
495 for ac_prog in acroread gv ghostview xpdf
497 # Extract the first word of "$ac_prog", so it can be a program name with args.
498 set dummy $ac_prog ; ac_word=$2
499 if test -n "$ac_word"; then
500 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
501 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
502 for ac_dir in $PATH; do
503 test -z "$ac_dir" && ac_dir=.
504 if test -x $ac_dir/$ac_word; then
505 PDF_VIEWER="$ac_prog"
511 if test -n "$PDF_VIEWER"; then
517 echo "$ac_t""$ac_result"
518 test -n "$PDF_VIEWER" && break
522 if test -z "$PDF_VIEWER" ; then
527 # Search something to preview dvi
528 echo $ac_n "checking for a DVI previewer""... $ac_c"
529 echo "$ac_t""(xdvi windvi yap)"
531 for ac_prog in xdvi windvi yap
533 # Extract the first word of "$ac_prog", so it can be a program name with args.
534 set dummy $ac_prog ; ac_word=$2
535 if test -n "$ac_word"; then
536 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
537 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
538 for ac_dir in $PATH; do
539 test -z "$ac_dir" && ac_dir=.
540 if test -x $ac_dir/$ac_word; then
541 DVI_VIEWER="$ac_prog"
547 if test -n "$DVI_VIEWER"; then
553 echo "$ac_t""$ac_result"
554 test -n "$DVI_VIEWER" && break
558 if test -z "$DVI_VIEWER" ; then
563 # Search something to preview html
564 echo $ac_n "checking for a HTML previewer""... $ac_c"
565 echo "$ac_t""(netscape)"
567 for ac_prog in netscape
569 # Extract the first word of "$ac_prog", so it can be a program name with args.
570 set dummy $ac_prog ; ac_word=$2
571 if test -n "$ac_word"; then
572 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
573 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
574 for ac_dir in $PATH; do
575 test -z "$ac_dir" && ac_dir=.
576 if test -x $ac_dir/$ac_word; then
577 HTML_VIEWER="$ac_prog"
583 if test -n "$HTML_VIEWER"; then
589 echo "$ac_t""$ac_result"
590 test -n "$HTML_VIEWER" && break
594 if test -z "$HTML_VIEWER" ; then
599 # Search for a program to convert ps to pdf
600 echo $ac_n "checking for a PS to PDF converter""... $ac_c"
601 echo "$ac_t""(ps2pdf)"
603 for ac_prog in ps2pdf
605 # Extract the first word of "$ac_prog", so it can be a program name with args.
606 set dummy $ac_prog ; ac_word=$2
607 if test -n "$ac_word"; then
608 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
609 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
610 for ac_dir in $PATH; do
611 test -z "$ac_dir" && ac_dir=.
612 if test -x $ac_dir/$ac_word; then
613 ps_to_pdf_command="$ac_prog"
619 if test -n "$ps_to_pdf_command"; then
625 echo "$ac_t""$ac_result"
626 test -n "$ps_to_pdf_command" && break
630 if test -z "$ps_to_pdf_command" ; then
631 ps_to_pdf_command=none
634 test $ps_to_pdf_command = "ps2pdf" && ps_to_pdf_command="ps2pdf \$\$i"
636 # Search for a program to convert dvi to ps
637 echo $ac_n "checking for a DVI to PS converter""... $ac_c"
638 echo "$ac_t""(dvips)"
642 # Extract the first word of "$ac_prog", so it can be a program name with args.
643 set dummy $ac_prog ; ac_word=$2
644 if test -n "$ac_word"; then
645 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
646 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
647 for ac_dir in $PATH; do
648 test -z "$ac_dir" && ac_dir=.
649 if test -x $ac_dir/$ac_word; then
650 dvi_to_ps_command="$ac_prog"
656 if test -n "$dvi_to_ps_command"; then
662 echo "$ac_t""$ac_result"
663 test -n "$dvi_to_ps_command" && break
667 if test -z "$dvi_to_ps_command" ; then
668 dvi_to_ps_command=none
671 test $dvi_to_ps_command = "dvips" && dvi_to_ps_command="dvips -o \$\$o \$\$i"
673 # Search for a program to convert dvi to pdf
674 echo $ac_n "checking for a DVI to PDF converter""... $ac_c"
675 echo "$ac_t""(dvipdfm)"
677 for ac_prog in dvipdfm
679 # Extract the first word of "$ac_prog", so it can be a program name with args.
680 set dummy $ac_prog ; ac_word=$2
681 if test -n "$ac_word"; then
682 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
683 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
684 for ac_dir in $PATH; do
685 test -z "$ac_dir" && ac_dir=.
686 if test -x $ac_dir/$ac_word; then
687 dvi_to_pdf_command="$ac_prog"
693 if test -n "$dvi_to_pdf_command"; then
699 echo "$ac_t""$ac_result"
700 test -n "$dvi_to_pdf_command" && break
704 if test -z "$dvi_to_pdf_command" ; then
705 dvi_to_pdf_command=none
708 test $dvi_to_pdf_command = "dvipdfm" && dvi_to_pdf_command="dvipdfm \$\$i"
710 # Search a *roff program (used to translate tables in ASCII export)
711 echo $ac_n "checking for a *roff formatter""... $ac_c"
712 echo "$ac_t""('groff -t -Tlatin1 $$FName' nroff)"
714 for ac_prog in 'groff -t -Tlatin1 $$FName' nroff
716 # Extract the first word of "$ac_prog", so it can be a program name with args.
717 set dummy $ac_prog ; ac_word=$2
718 if test -n "$ac_word"; then
719 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
720 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
721 for ac_dir in $PATH; do
722 test -z "$ac_dir" && ac_dir=.
723 if test -x $ac_dir/$ac_word; then
730 if test -n "$prog"; then
732 test "$prog" = "nroff" && prog='tbl $$FName | nroff'
736 echo "$ac_t""$ac_result"
737 test -n "$prog" && break
741 if test -z "$prog" ; then
745 rc_entries="$rc_entries
746 \ascii_roff_command \"$prog\""
748 # Search the ChkTeX program
749 echo $ac_n "checking for ChkTeX""... $ac_c"
750 echo "$ac_t""("chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38")"
752 for ac_prog in "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38"
754 # Extract the first word of "$ac_prog", so it can be a program name with args.
755 set dummy $ac_prog ; ac_word=$2
756 if test -n "$ac_word"; then
757 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
758 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
759 for ac_dir in $PATH; do
760 test -z "$ac_dir" && ac_dir=.
761 if test -x $ac_dir/$ac_word; then
768 if test -n "$prog"; then
774 echo "$ac_t""$ac_result"
775 test -n "$prog" && break
779 if test -z "$prog" ; then
783 rc_entries="$rc_entries
784 \chktex_command \"$prog\""
786 # Search for a spellchecker
787 echo $ac_n "checking for a spell-checker""... $ac_c"
788 echo "$ac_t""(ispell)"
790 for ac_prog in ispell
792 # Extract the first word of "$ac_prog", so it can be a program name with args.
793 set dummy $ac_prog ; ac_word=$2
794 if test -n "$ac_word"; then
795 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
796 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
797 for ac_dir in $PATH; do
798 test -z "$ac_dir" && ac_dir=.
799 if test -x $ac_dir/$ac_word; then
806 if test -n "$prog"; then
812 echo "$ac_t""$ac_result"
813 test -n "$prog" && break
817 if test -z "$prog" ; then
821 rc_entries="$rc_entries
822 \spell_command \"$prog\""
825 # Search a GUI Fax program
826 echo $ac_n "checking for a fax program""... $ac_c"
827 echo "$ac_t""(ksendfax)"
829 for ac_prog in ksendfax
831 # Extract the first word of "$ac_prog", so it can be a program name with args.
832 set dummy $ac_prog ; ac_word=$2
833 if test -n "$ac_word"; then
834 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
835 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
836 for ac_dir in $PATH; do
837 test -z "$ac_dir" && ac_dir=.
838 if test -x $ac_dir/$ac_word; then
839 fax_command="$ac_prog"
845 if test -n "$fax_command"; then
851 echo "$ac_t""$ac_result"
852 test -n "$fax_command" && break
856 if test -z "$fax_command" ; then
860 test $fax_command = "ksendfax" && fax_command="ksendfax \$\$i"
862 # Search for LinuxDoc support
863 echo $ac_n "checking for SGML-tools 1.x (LinuxDoc)""... $ac_c"
864 echo "$ac_t""(sgml2lyx)"
866 for ac_prog in sgml2lyx
868 # Extract the first word of "$ac_prog", so it can be a program name with args.
869 set dummy $ac_prog ; ac_word=$2
870 if test -n "$ac_word"; then
871 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
872 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
873 for ac_dir in $PATH; do
874 test -z "$ac_dir" && ac_dir=.
875 if test -x $ac_dir/$ac_word; then
882 if test -n "$LINUXDOC"; then
888 echo "$ac_t""$ac_result"
889 test -n "$LINUXDOC" && break
893 if test -z "$LINUXDOC" ; then
898 if test $LINUXDOC != none; then
900 linuxdoc_cmd="\\def\\haslinuxdoc{yes}"
905 linuxdoc_to_latex_command="sgml2latex \$\$i"
906 linuxdoc_to_dvi_command="sgml2latex -o dvi \$\$i"
907 linuxdoc_to_html_command="sgml2html \$\$i"
908 linuxdoc_to_lyx_command="sgml2lyx \$\$i";;
910 linuxdoc_to_latex_command="none"
911 linuxdoc_to_dvi_command="none"
912 linuxdoc_to_html_command="none"
913 linuxdoc_to_lyx_command="none";;
916 # Search for DocBook support
917 echo $ac_n "checking for SGML-tools 2.x (DocBook) or db2x scripts""... $ac_c"
918 echo "$ac_t""(sgmltools db2dvi)"
920 for ac_prog in sgmltools db2dvi
922 # Extract the first word of "$ac_prog", so it can be a program name with args.
923 set dummy $ac_prog ; ac_word=$2
924 if test -n "$ac_word"; then
925 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
926 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
927 for ac_dir in $PATH; do
928 test -z "$ac_dir" && ac_dir=.
929 if test -x $ac_dir/$ac_word; then
936 if test -n "$DOCBOOK"; then
942 echo "$ac_t""$ac_result"
943 test -n "$DOCBOOK" && break
947 if test -z "$DOCBOOK" ; then
952 if test $DOCBOOK != none; then
954 docbook_cmd="\\def\\hasdocbook{yes}"
959 docbook_to_dvi_command="sgmltools -b dvi \$\$i"
960 docbook_to_html_command="sgmltools -b html \$\$i";;
962 docbook_to_dvi_command="db2dvi \$\$i"
963 docbook_to_html_command="db2html \$\$i";;
965 docbook_to_dvi_command="none"
966 docbook_to_html_command="none";;
969 # Search for a spool command
970 echo $ac_n "checking for a spool command""... $ac_c"
971 echo "$ac_t""(lp lpr)"
973 for ac_prog in lp lpr
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 "$prog"; then
995 echo "$ac_t""$ac_result"
996 test -n "$prog" && break
1000 if test -z "$prog" ; then
1004 rc_entries="$rc_entries
1005 \print_spool_command \"$prog\""
1007 lp) print_spool_printerprefix="-d ";;
1008 lpr) print_spool_printerprefix="-P";;
1009 *) :;; # leave to empty values
1011 rc_entries="$rc_entries
1012 \print_spool_printerprefix \"$print_spool_printerprefix\""
1014 echo $ac_n "checking for a LaTeX -> HTML converter""... $ac_c"
1015 echo "$ac_t""(tth latex2html hevea)"
1017 for ac_prog in tth latex2html hevea
1019 # Extract the first word of "$ac_prog", so it can be a program name with args.
1020 set dummy $ac_prog ; ac_word=$2
1021 if test -n "$ac_word"; then
1022 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
1023 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1024 for ac_dir in $PATH; do
1025 test -z "$ac_dir" && ac_dir=.
1026 if test -x $ac_dir/$ac_word; then
1033 if test -n "$TOHTML"; then
1039 echo "$ac_t""$ac_result"
1040 test -n "$TOHTML" && break
1044 if test -z "$TOHTML" ; then
1048 latex_to_html_command=$TOHTML
1050 tth) latex_to_html_command="tth -t -e2 -L\$\$b < \$\$i > \$\$o";;
1051 latex2html) latex_to_html_command="latex2html -no_subdir -split 0 -show_section_numbers \$\$i";;
1052 hevea) latex_to_html_command="hevea -s \$\$i";;
1055 #### Search for image conversion ####
1056 echo $ac_n "checking for an Image -> EPS converter""... $ac_c"
1057 echo "$ac_t""(convert pnmtops)"
1059 for ac_prog in convert pnmtops
1061 # Extract the first word of "$ac_prog", so it can be a program name with args.
1062 set dummy $ac_prog ; ac_word=$2
1063 if test -n "$ac_word"; then
1064 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
1065 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1066 for ac_dir in $PATH; do
1067 test -z "$ac_dir" && ac_dir=.
1068 if test -x $ac_dir/$ac_word; then
1075 if test -n "$TOEPS"; then
1081 echo "$ac_t""$ac_result"
1082 test -n "$TOEPS" && break
1086 if test -z "$TOEPS" ; then
1091 convert) bmp_to_eps="convert BMP:\$\$i EPS:\$\$o" fits_to_eps="convert FITS:\$\$i EPS:\$\$o" gif_to_eps="convert GIF:\$\$i EPS:\$\$o" jpg_to_eps="convert JPG:\$\$i EPS:\$\$o" pbm_to_eps="convert PBM:\$\$i EPS:\$\$o" pgm_to_eps="convert PGM:\$\$i EPS:\$\$o" png_to_eps="convert PNG:\$\$i EPS:\$\$o" ppm_to_eps="convert PPM:\$\$i EPS:\$\$o" sgi_to_eps="convert SGI:\$\$i EPS:\$\$o" xbm_to_eps="convert XBM:\$\$i EPS:\$\$o" xwd_to_eps="convert XWD:\$\$i EPS:\$\$o" ;;
1092 pnmtops) gif_to_eps="giftopnm \$\$i | pnmtops > \$\$o" png_to_eps="pngtopnm \$\$i | pnmtops >\$\$o" jpg_to_eps="jpegtopnm \$\$i | pnmtops >\$\$o";;
1095 echo $ac_n "checking for a Image -> PNG converter""... $ac_c"
1096 echo "$ac_t""(convert pnmtopng)"
1098 for ac_prog in convert pnmtopng
1100 # Extract the first word of "$ac_prog", so it can be a program name with args.
1101 set dummy $ac_prog ; ac_word=$2
1102 if test -n "$ac_word"; then
1103 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
1104 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1105 for ac_dir in $PATH; do
1106 test -z "$ac_dir" && ac_dir=.
1107 if test -x $ac_dir/$ac_word; then
1114 if test -n "$TOPNG"; then
1120 echo "$ac_t""$ac_result"
1121 test -n "$TOPNG" && break
1125 if test -z "$TOPNG" ; then
1130 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";;
1131 pnmtopng) gif_to_png="giftopnm \$\$i | pnmtopng >\$\$o" eps_to_png="pstopnm \$\$i| pnmtopng >\$\$o" jpg_to_png="jpegtopnm \$\$i | pnmtopng >\$\$o";;
1134 echo $ac_n "checking for a Image -> XPM converter""... $ac_c"
1135 echo "$ac_t""(convert)"
1137 for ac_prog in convert
1139 # Extract the first word of "$ac_prog", so it can be a program name with args.
1140 set dummy $ac_prog ; ac_word=$2
1141 if test -n "$ac_word"; then
1142 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
1143 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1144 for ac_dir in $PATH; do
1145 test -z "$ac_dir" && ac_dir=.
1146 if test -x $ac_dir/$ac_word; then
1153 if test -n "$TOXPM"; then
1159 echo "$ac_t""$ac_result"
1160 test -n "$TOXPM" && break
1164 if test -z "$TOXPM" ; then
1168 if test "$TOXPM" = "convert"; then
1169 gif_to_xpm="convert GIF:\$\$i XPM:\$\$o"
1170 eps_to_xpm="convert EPS:\$\$i XPM:\$\$o"
1171 jpg_to_xpm="convert JPG:\$\$i XPM:\$\$o"
1172 png_to_xpm="convert PNG:\$\$i XPM:\$\$o"
1173 ps_to_xpm="convert PS:\$\$i XPM:\$\$o"
1174 xbm_to_xpm="convert XBM:\$\$i XPM:\$\$o"
1177 echo $ac_n "checking For an EPS -> PDF converter""... $ac_c"
1178 echo "$ac_t""(epstopdf)"
1180 for ac_prog in epstopdf
1182 # Extract the first word of "$ac_prog", so it can be a program name with args.
1183 set dummy $ac_prog ; ac_word=$2
1184 if test -n "$ac_word"; then
1185 echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
1186 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1187 for ac_dir in $PATH; do
1188 test -z "$ac_dir" && ac_dir=.
1189 if test -x $ac_dir/$ac_word; then
1196 if test -n "$EPSTOPDF"; then
1202 echo "$ac_t""$ac_result"
1203 test -n "$EPSTOPDF" && break
1207 if test -z "$EPSTOPDF" ; then
1212 epstopdf) eps_to_pdf="epstopdf --outfile=\$\$o \$\$i";;
1215 #### Explore the LaTeX configuration
1216 echo $ac_n "checking LaTeX configuration""... $ac_c"
1217 # First, remove the files that we want to re-create
1218 rm -f textclass.lst packages.lst chkconfig.sed
1219 if test ${lyx_check_config} = no ; then
1220 echo "$ac_t""default values"
1223 rm -f wrap_chkconfig.ltx chkconfig.vars chkconfig.classes chklayouts.tex
1224 cat >wrap_chkconfig.ltx <<EOF
1225 \\newcommand\\srcdir{${srcdir}}
1228 \\input{${srcdir}/chkconfig.ltx}
1230 ## Construct the list of classes to test for.
1231 # build the list of available layout files and convert it to commands
1233 for file in ./layouts/*.layout ${srcdir}/layouts/*.layout ; do
1236 *) test -r "$file" && echo $file ;;
1238 done | sed -e 's%^.*layouts/\(.*\)\.layout$%\\TestDocClass{\1}%'\
1240 eval ${LATEX} wrap_chkconfig.ltx 2>/dev/null | grep '^\+'
1241 eval `cat chkconfig.vars | sed 's/-/_/g'`
1244 # Do we have all the files we need? Useful if latex did not run
1245 echo creating textclass.lst
1246 # if textclass.lst does not exist (because LaTeX did not run),
1247 # then provide a standard version.
1248 if test ! -f textclass.lst ; then
1249 cat >textclass.lst <<EOF
1250 # This file declares layouts and their associated definition files
1251 # (include dir. relative to the place where this file is).
1252 # It contains only default values, since chkconfig.ltx could not be run
1253 # for some reason. Run ./configure if you need to update it after a
1254 # configuration change.
1255 article article article
1256 report report report
1258 linuxdoc linuxdoc linuxdoc
1259 letter letter letter
1263 # if chkconfig.sed does not exist (because LaTeX did not run),
1264 # then provide a standard version.
1265 if test ! -f chkconfig.sed ; then
1266 cat >chkconfig.sed <<EOF
1271 echo creating packages.lst
1272 # if packages.lst does not exist (because LaTeX did not run),
1273 # then provide a standard version.
1274 if test ! -f packages.lst ; then
1275 cat >packages.lst <<EOF
1276 # This file should contain the list of LaTeX packages that have been
1277 # recognized by LyX. Unfortunately, since configure could not find
1278 # your LaTeX2e program, the tests have not been run. Run ./configure
1279 # if you need to update it after a configuration change.
1284 echo creating doc/LaTeXConfig.lyx
1285 echo "s/@chk_linuxdoc@/$chk_linuxdoc/g" >> chkconfig.sed
1286 echo "s/@chk_docbook@/$chk_docbook/g" >> chkconfig.sed
1287 sed -f chkconfig.sed ${srcdir}/doc/LaTeXConfig.lyx.in >doc/LaTeXConfig.lyx
1289 echo creating $outfile
1291 # This file has been automatically generated by LyX' lib/configure
1292 # script. It contains default settings that have been determined by
1293 # examining your system. PLEASE DO NOT MODIFY ANYTHING HERE! If you
1294 # want to customize LyX, make a copy of the file LYXDIR/lyxrc as
1295 # ~/.lyx/lyxrc and edit this file instead. Any setting in lyxrc will
1296 # override the values given here.
1297 \\Format text txt ASCII A
1298 \\Format textparagraph txt ASCII(paragraphs) ""
1299 \\Format docbook sgml DocBook B
1300 \\Format bmp bmp BMP ""
1301 \\Format dvi dvi DVI D
1302 \\Format eps eps EPS ""
1303 \\Format epsi epsi EPSI ""
1304 \\Format fax "" Fax ""
1305 \\Format fits fits FITS ""
1306 \\Format gif gif GIF ""
1307 \\Format grace agr GRACE ""
1308 \\Format html html HTML H
1309 \\Format jpg jpg JPEG ""
1310 \\Format latex tex LaTeX L
1311 \\Format linuxdoc sgml LinuxDoc x
1312 \\Format lyx lyx LyX ""
1313 \\Format literate nw NoWeb N
1314 \\Format pdf pdf PDF P
1315 \\Format pdf2 pdf "PDF (pdflatex)" F
1316 \\Format pdf3 pdf "PDF (dvipdfm)" m
1317 \\Format pbm pbm PBM ""
1318 \\Format pgm pgm PGM ""
1319 \\Format png png PNG ""
1320 \\Format ppm ppm PPM ""
1321 \\Format ps ps Postscript t
1322 \\Format program "" Program ""
1323 \\Format sgi sgi SGI ""
1324 \\Format tgif tgif TGIF ""
1325 \\Format tiff tif TIFF ""
1326 \\Format xbm xbm XBM ""
1327 \\Format xpm xpm XPM ""
1328 \\Format xwd xwd XWD ""
1329 \\Format word doc Word W
1331 \\converter latex dvi "$latex_to_dvi" "latex"
1332 \\converter latex pdf2 "$latex_to_pdf" "latex"
1333 \\converter latex html "$latex_to_html_command" "originaldir,needaux"
1334 \\converter literate latex "$literate_to_tex_command" ""
1335 \\converter dvi pdf3 "$dvi_to_pdf_command" ""
1336 \\converter dvi ps "$dvi_to_ps_command" ""
1337 \\converter ps pdf "$ps_to_pdf_command" ""
1338 \\converter ps fax "$fax_command" ""
1339 \\converter linuxdoc lyx "$linuxdoc_to_lyx_command" ""
1340 \\converter linuxdoc latex "$linuxdoc_to_latex_command" ""
1341 \\converter linuxdoc dvi "$linuxdoc_to_dvi_command" ""
1342 \\converter linuxdoc html "$linuxdoc_to_html_command" ""
1343 \\converter docbook dvi "$docbook_to_dvi_command" ""
1344 \\converter docbook html "$docbook_to_html_command" ""
1346 \\converter latex lyx "$tex_to_lyx_command" ""
1347 \\converter literate lyx "$literate_to_lyx_command" ""
1348 \\converter html latex "$html_to_latex_command" ""
1349 \\converter word latex "$word_to_latex_command" ""
1351 \\converter agr eps "xmgrace -hardcopy -hdevice EPS \$\$i" ""
1352 \\converter bmp eps "$bmp_to_eps" ""
1353 \\converter fits eps "$fits_to_eps" ""
1354 \\converter gif eps "$gif_to_eps" ""
1355 \\converter jpg eps "$jpg_to_eps" ""
1356 \\converter pbm eps "$pbm_to_eps" ""
1357 \\converter pgm eps "$pgm_to_eps" ""
1358 \\converter png eps "$png_to_eps" ""
1359 \\converter ppm eps "$ppm_to_eps" ""
1360 \\converter sgi eps "$sgi_to_eps" ""
1361 \\converter tgif eps "tgif -print -eps \$\$i" ""
1362 \\converter tiff eps "tiff2ps \$\$i > \$\$o" ""
1363 \\converter xbm eps "$xbm_to_eps" ""
1364 \\converter xwd eps "$xwd_to_eps" ""
1366 \\converter tgif xpm "tgif -print -stdout -xpm \$\$i > \$\$o" ""
1367 \\converter tgif png "tgif -print -stdout -png \$\$i > \$\$o" ""
1368 \\converter tgif pdf "tgif -print -stdout -pdf \$\$i > \$\$o" ""
1370 \\converter gif png "$gif_to_png" ""
1371 \\converter eps png "$eps_to_png" ""
1372 \\converter epsi png "$eps_to_png" ""
1373 \\converter jpg png "$jpg_to_png" ""
1375 \\converter gif xpm "$gif_to_xpm" ""
1376 \\converter eps xpm "$eps_to_xpm" ""
1377 \\converter epsi xpm "$eps_to_xpm" ""
1378 \\converter jpg xpm "$jpg_to_xpm" ""
1379 \\converter png xpm "$png_to_xpm" ""
1380 \\converter ps xpm "$ps_to_xpm" ""
1381 \\converter xbm xpm "$xbm_to_xpm" ""
1383 \\converter eps pdf "$eps_to_pdf" ""
1384 \\converter epsi pdf "$eps_to_pdf" ""
1386 \\viewer dvi "$DVI_VIEWER"
1387 \\viewer html "$HTML_VIEWER"
1388 \\viewer pdf "$PDF_VIEWER"
1389 \\viewer ps "$GHOSTVIEW -swap"
1390 \\viewer eps "$GHOSTVIEW"
1393 \\font_encoding "$chk_fontenc"
1396 # Remove superfluous files if we are not writing in the main lib
1398 for file in $outfile textclass.lst packages.lst \
1399 doc/LaTeXConfig.lyx ; do
1400 # we rename the file first, so that we avoid comparing a file with itself
1402 if test -r $srcdir/$file && diff $file.new $srcdir/$file >/dev/null 2>/dev/null ;
1404 echo "removing $file, which is identical to the system global version"
1413 if test $lyx_keep_temps = no ; then
1414 rm -f chkconfig.sed chkconfig.vars wrap_chkconfig.* chklayouts.tex \