]> git.lyx.org Git - lyx.git/blobdiff - lib/configure.m4
Oops! Forgot to commit a few files.
[lyx.git] / lib / configure.m4
index 0e56d4c6d200e583d90fdd0f85ed113518bc291d..ce3855ddc4d5419db51ceed506428bdcd4665575 100644 (file)
@@ -29,7 +29,7 @@ dnl
 define(SEARCH_PROG,[dnl
 changequote([,])dnl
 MSG_CHECKING($1)
-MSG_RESULT()
+MSG_RESULT(($3))
 $2=
 for ac_prog in $3
 do
@@ -37,7 +37,7 @@ do
 set dummy $ac_prog ; ac_word=$[2]
 if test -n "$ac_word"; then
   MSG_CHECKING([for \"$ac_word\"],[+])
-  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
   for ac_dir in $PATH; do
     test -z "$ac_dir" && ac_dir=.
     if test -x [$ac_dir/$ac_word]; then
@@ -146,7 +146,8 @@ fi
 
 
 #### Create the build directories if necessary
-for dir in bind doc kbd layouts templates reLyX ; do
+for dir in bind clipart doc examples images kbd layouts reLyX \
+    scripts templates ui ; do
   test ! -d $dir && mkdir $dir
 done
 
@@ -185,8 +186,8 @@ SEARCH_PROG([for reLyX LaTeX-to-LyX translator],RELYX,reLyX)
 PATH=${save_PATH}
 
 # Search something to process a literate document
-SEARCH_PROG([for a Literate programming processor],LITERATE,"noweave -delay -index")
-if test "$LITERATE" = "none"; then LITERATE_EXT="none"; else LITERATE_EXT=".nw"; fi
+SEARCH_PROG([for a Literate programming processor],LITERATE,"noweave -delay -index \$\$FName > \$\$OutName")
+if test "$LITERATE" = "none"; then LITERATE_EXT="none"; else LITERATE_EXT="nw"; fi
 
 # Search for a Postscript interpreter
 SEARCH_PROG([for a Postscript interpreter],GS, gs)
@@ -194,6 +195,23 @@ SEARCH_PROG([for a Postscript interpreter],GS, gs)
 # Search something to preview postscript
 SEARCH_PROG([for a Postscript previewer],GHOSTVIEW,gv ghostview)
 
+# Search for a program to preview pdf
+SEARCH_PROG([for a PDF preview],PDF_VIEWER,xpdf acroread gv ghostview)
+
+# Search something to preview dvi
+SEARCH_PROG([for a DVI previewer],DVI_VIEWER, xdvi)
+
+# Search something to preview html
+SEARCH_PROG([for a HTML previewer],HTML_VIEWER, netscape)
+
+# Search for a program to convert ps to pdf
+SEARCH_PROG([for a PS to PDF converter],ps_to_pdf_command,ps2pdf)
+test $ps_to_pdf_command = "ps2pdf" && ps_to_pdf_command="ps2pdf \$\$FName"
+
+# Search for a program to convert dvi to ps
+SEARCH_PROG([for a DVI to PS converter],dvi_to_ps_command,dvips)
+test $dvi_to_ps_command = "dvips" && dvi_to_ps_command="dvips -o \$\$OutName \$\$FName"
+
 # Search a *roff program (used to translate tables in ASCII export)
 SEARCH_PROG([for a *roff formatter],ROFF,groff nroff)
 ascii_roff_command=$ROFF
@@ -228,14 +246,38 @@ if test $LINUXDOC != none; then
   linuxdoc_cmd="\\def\\haslinuxdoc{yes}"
 fi
 
+case $LINUXDOC in
+  sgml2lyx)
+    linuxdoc_to_latex_command="sgml2latex \$\$FName"
+    linuxdoc_to_dvi_command="sgml2latex -o dvi \$\$FName"
+    linuxdoc_to_html_command="sgml2html \$\$FName"
+    linuxdoc_to_lyx_command="sgml2lyx";;
+  none)
+    linuxdoc_to_latex_command="none"
+    linuxdoc_to_dvi_command="none"
+    linuxdoc_to_html_command="none"
+    linuxdoc_to_lyx_command="none";;
+esac
+
 # Search for DocBook support
-SEARCH_PROG([for SGML-tools 2.x (DocBook)], DOCBOOK, sgmltools)
+SEARCH_PROG([for SGML-tools 2.x (DocBook) or db2x scripts], DOCBOOK, sgmltools db2dvi)
 chk_docbook=no
 if test $DOCBOOK != none; then
   chk_docbook=yes
   docbook_cmd="\\def\\hasdocbook{yes}"
 fi
 
+case $DOCBOOK in
+  sgmltools)
+    docbook_to_dvi_command="sgmltools -b dvi \$\$FName"
+    docbook_to_html_command="sgmltools -b html \$\$FName";;
+  db2dvi)
+    docbook_to_dvi_command="db2dvi \$\$FName"
+    docbook_to_html_command="db2html \$\$FName";;
+  none)
+    docbook_to_dvi_command="none"
+    docbook_to_html_command="none";;
+esac
 
 # Search for a spool command
 SEARCH_PROG([for a spool command], LPR, lp lpr)
@@ -249,10 +291,11 @@ esac
 
 # Search for a latex to html converter
 SEARCH_PROG([for an HTML converter], TOHTML, tth latex2html hevea)
+latex_to_html_command = $TOHTML
 case $TOHTML in
-       tth) html_command="tth -t < '\$\$FName' > '\$\$OutName'";;
- latex2html) html_command="latex2html -no_subdir -split 0 -show_section_numbers '\$\$FName'";;
-      hevea) html_command="hevea -s '\$\$FName'";;
+       tth) latex_to_html_command="tth -t -e2 -L\$\$BaseName < \$\$FName > \$\$OutName";;
+ latex2html) latex_to_html_command="latex2html -no_subdir -split 0 -show_section_numbers \$\$FName";;
+      hevea) latex_to_html_command="hevea -s \$\$FName";;
 esac
 
 #### Explore the LaTeX configuration
@@ -276,7 +319,7 @@ EOF
   for file in ./layouts/*.layout ${srcdir}/layouts/*.layout ; do 
     case $file in
       */\*.layout) ;;
-      *) echo $file ;;
+      *) test -r "$file" && echo $file ;;
     esac
   done | sed -e 's%^.*layouts/\(.*\)\.layout$%\\TestDocClass{\1}%'\
              > chklayouts.tex
@@ -326,18 +369,33 @@ cat >lyxrc.defaults <<EOF
 # want to customize LyX, make a copy of the file LYXDIR/lyxrc as
 # ~/.lyx/lyxrc and edit this file instead. Any setting in lyxrc will
 # override the values given here.
-\\latex_command "$LATEX"
+\\converter tex dvi "$LATEX" ""
+\\converter tex pdf "$PDFLATEX" ""
+\\converter dvi ps "$dvi_to_ps_command" ""
+\\converter ps pdf "$ps_to_pdf_command" ""
+\\converter sgml tex "$linuxdoc_to_latex_command" ""
+\\converter sgml dvi "$linuxdoc_to_dvi_command" ""
+\\converter sgml html "$linuxdoc_to_html_command" ""
+\\converter docbook dvi "$docbook_to_dvi_command" ""
+\\converter docbook html "$docbook_to_html_command" ""
+\\converter tex html "$latex_to_html_command"
+       "originaldir,needaux"
+\\converter $LITERATE_EXT tex "$LITERATE" ""
+
+\\viewer dvi "$DVI_VIEWER"
+\\viewer html "$HTML_VIEWER"
+\\viewer pdf "$PDF_VIEWER"
+\\viewer ps "$GHOSTVIEW -swap"
+\\viewer eps "$GHOSTVIEW"
+
 \\relyx_command "$RELYX"
-\\literate_command "$LITERATE"
+\\linuxdoc_to_lyx_command "$linuxdoc_to_lyx_command"
 \\literate_extension "$LITERATE_EXT"
 \\ps_command "$GS"
-\\view_ps_command "$GHOSTVIEW -swap"
-\\view_pspic_command "$GHOSTVIEW"
 \\ascii_roff_command "$ascii_roff_command"
 \\chktex_command "$chktex_command"
 \\spell_command "$SPELL"
 \\fax_command "$fax_command"
-\\html_command "$html_command"
 \\print_spool_command "$print_spool_command"
 \\print_spool_printerprefix "$print_spool_printerprefix"
 \\font_encoding "$chk_fontenc"