]> git.lyx.org Git - lyx.git/blobdiff - lib/configure
Fix xforms home page URL; small bug in lib/configure when layout files are not readable
[lyx.git] / lib / configure
index 35951e5fccd0e6ba70e7ab57e194d539e4a24a5d..a1192e247c0ee05cd7391aa2937a75a54cbe8ee6 100755 (executable)
@@ -78,7 +78,7 @@ done
 #### Searching some useful programs
 # Search LaTeX2e
 echo $ac_n "checking for a LaTeX2e program""... $ac_c"
-echo "$ac_t"""
+echo "$ac_t""(latex latex2e)"
 LATEX=
 for ac_prog in latex latex2e
 do
@@ -86,7 +86,7 @@ do
 set dummy $ac_prog ; ac_word=$2
 if test -n "$ac_word"; then
   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
-  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
@@ -129,12 +129,65 @@ if test -z "$LATEX" ; then
     lyx_check_config=no
 fi
 
+if test x$lyx_check_config != x ; then
+echo $ac_n "checking for the pdflatex program""... $ac_c"
+echo "$ac_t""(pdflatex)"
+PDFLATEX=
+for ac_prog in pdflatex
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog ; ac_word=$2
+if test -n "$ac_word"; then
+  echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
+  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
+      PDFLATEX="$ac_prog"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+
+  if test -n "$PDFLATEX"; then
+    ac_result=yes
+  else
+    ac_result=no
+  fi
+  
+## Check whether this is really LaTeX2e
+rm -f chklatex.ltx
+cat >chklatex.ltx <<EOF
+\\nonstopmode\\makeatletter
+\\ifx\\undefined\\documentclass\\else
+  \\message{ThisIsLaTeX2e}
+\\fi
+\\@@end
+EOF
+if eval ${LATEX} chklatex.ltx </dev/null 2>/dev/null \
+                       | grep 'ThisIsLaTeX2e' >/dev/null; then
+  :
+else
+  LATEX=
+  ac_result="not useable"
+fi
+rm -f chklatex.ltx chklatex.log
+  echo "$ac_t""$ac_result"
+  test -n "$PDFLATEX" && break
+fi
+done
+
+if test -z "$PDFLATEX" ; then
+  PDFLATEX=none
+fi
+
+fi
 
 # Search for an installed reLyX or a ready-to-install one
 save_PATH=${PATH}
 PATH=${PATH}:./reLyX/
 echo $ac_n "checking for reLyX LaTeX-to-LyX translator""... $ac_c"
-echo "$ac_t"""
+echo "$ac_t""(reLyX)"
 RELYX=
 for ac_prog in reLyX
 do
@@ -142,7 +195,7 @@ do
 set dummy $ac_prog ; ac_word=$2
 if test -n "$ac_word"; then
   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
-  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
@@ -171,7 +224,7 @@ PATH=${save_PATH}
 
 # Search something to process a literate document
 echo $ac_n "checking for a Literate programming processor""... $ac_c"
-echo "$ac_t"""
+echo "$ac_t""("noweave -delay -index")"
 LITERATE=
 for ac_prog in "noweave -delay -index"
 do
@@ -179,7 +232,7 @@ do
 set dummy $ac_prog ; ac_word=$2
 if test -n "$ac_word"; then
   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
-  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
@@ -208,7 +261,7 @@ if test "$LITERATE" = "none"; then LITERATE_EXT="none"; else LITERATE_EXT=".nw";
 
 # Search for a Postscript interpreter
 echo $ac_n "checking for a Postscript interpreter""... $ac_c"
-echo "$ac_t"""
+echo "$ac_t""(gs)"
 GS=
 for ac_prog in gs
 do
@@ -216,7 +269,7 @@ do
 set dummy $ac_prog ; ac_word=$2
 if test -n "$ac_word"; then
   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
-  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
@@ -244,7 +297,7 @@ fi
 
 # Search something to preview postscript
 echo $ac_n "checking for a Postscript previewer""... $ac_c"
-echo "$ac_t"""
+echo "$ac_t""(gv ghostview)"
 GHOSTVIEW=
 for ac_prog in gv ghostview
 do
@@ -252,7 +305,7 @@ do
 set dummy $ac_prog ; ac_word=$2
 if test -n "$ac_word"; then
   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
-  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
@@ -278,9 +331,117 @@ if test -z "$GHOSTVIEW" ; then
 fi
 
 
+# Search for a program to preview pdf
+echo $ac_n "checking for a PDF preview""... $ac_c"
+echo "$ac_t""(xpdf acroread gv ghostview)"
+PDFVIEWER=
+for ac_prog in xpdf acroread gv ghostview
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog ; ac_word=$2
+if test -n "$ac_word"; then
+  echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
+  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
+      PDFVIEWER="$ac_prog"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+
+  if test -n "$PDFVIEWER"; then
+    ac_result=yes
+  else
+    ac_result=no
+  fi
+  
+  echo "$ac_t""$ac_result"
+  test -n "$PDFVIEWER" && break
+fi
+done
+
+if test -z "$PDFVIEWER" ; then
+  PDFVIEWER=none
+fi
+
+
+# Search for a program to convert pdf to ps
+echo $ac_n "checking for a PDF to PS converter""... $ac_c"
+echo "$ac_t""(pdf2ps pdftops)"
+PDFPS=
+for ac_prog in pdf2ps pdftops
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog ; ac_word=$2
+if test -n "$ac_word"; then
+  echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
+  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
+      PDFPS="$ac_prog"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+
+  if test -n "$PDFPS"; then
+    ac_result=yes
+  else
+    ac_result=no
+  fi
+  
+  echo "$ac_t""$ac_result"
+  test -n "$PDFPS" && break
+fi
+done
+
+if test -z "$PDFPS" ; then
+  PDFPS=none
+fi
+
+
+# Search for a program to convert dvi to ps
+echo $ac_n "checking for a DVI to PS converter""... $ac_c"
+echo "$ac_t""(dvips)"
+DVIPS=
+for ac_prog in dvips
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog ; ac_word=$2
+if test -n "$ac_word"; then
+  echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
+  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
+      DVIPS="$ac_prog"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+
+  if test -n "$DVIPS"; then
+    ac_result=yes
+  else
+    ac_result=no
+  fi
+  
+  echo "$ac_t""$ac_result"
+  test -n "$DVIPS" && break
+fi
+done
+
+if test -z "$DVIPS" ; then
+  DVIPS=none
+fi
+
+
 # Search a *roff program (used to translate tables in ASCII export)
 echo $ac_n "checking for a *roff formatter""... $ac_c"
-echo "$ac_t"""
+echo "$ac_t""(groff nroff)"
 ROFF=
 for ac_prog in groff nroff
 do
@@ -288,7 +449,7 @@ do
 set dummy $ac_prog ; ac_word=$2
 if test -n "$ac_word"; then
   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
-  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
@@ -319,7 +480,7 @@ test $ROFF = "nroff" && ascii_roff_command="tbl \$\$FName | nroff"
 
 # Search the ChkTeX program
 echo $ac_n "checking for ChkTeX""... $ac_c"
-echo "$ac_t"""
+echo "$ac_t""(chktex)"
 CHKTEX=
 for ac_prog in chktex
 do
@@ -327,7 +488,7 @@ do
 set dummy $ac_prog ; ac_word=$2
 if test -n "$ac_word"; then
   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
-  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
@@ -357,7 +518,7 @@ test $CHKTEX = "chktex" && chktex_command="$CHKTEX -n1 -n3 -n6 -n9 -n22 -n25 -n3
 
 # Search for a spellchecker
 echo $ac_n "checking for a spell-checker""... $ac_c"
-echo "$ac_t"""
+echo "$ac_t""(ispell)"
 SPELL=
 for ac_prog in ispell
 do
@@ -365,7 +526,7 @@ do
 set dummy $ac_prog ; ac_word=$2
 if test -n "$ac_word"; then
   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
-  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
@@ -393,7 +554,7 @@ fi
 
 # Search a Fax handling program
 echo $ac_n "checking for a fax driver""... $ac_c"
-echo "$ac_t"""
+echo "$ac_t""(sendfax faxsend fax)"
 FAX=
 for ac_prog in sendfax faxsend fax
 do
@@ -401,7 +562,7 @@ do
 set dummy $ac_prog ; ac_word=$2
 if test -n "$ac_word"; then
   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
-  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
@@ -438,7 +599,7 @@ fi
 
 # Search for LinuxDoc support
 echo $ac_n "checking for SGML-tools 1.x (LinuxDoc)""... $ac_c"
-echo "$ac_t"""
+echo "$ac_t""(sgml2lyx)"
 LINUXDOC=
 for ac_prog in sgml2lyx
 do
@@ -446,7 +607,7 @@ do
 set dummy $ac_prog ; ac_word=$2
 if test -n "$ac_word"; then
   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
-  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
@@ -479,7 +640,7 @@ fi
 
 # Search for DocBook support
 echo $ac_n "checking for SGML-tools 2.x (DocBook)""... $ac_c"
-echo "$ac_t"""
+echo "$ac_t""(sgmltools)"
 DOCBOOK=
 for ac_prog in sgmltools
 do
@@ -487,7 +648,7 @@ do
 set dummy $ac_prog ; ac_word=$2
 if test -n "$ac_word"; then
   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
-  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
@@ -521,7 +682,7 @@ fi
 
 # Search for a spool command
 echo $ac_n "checking for a spool command""... $ac_c"
-echo "$ac_t"""
+echo "$ac_t""(lp lpr)"
 LPR=
 for ac_prog in lp lpr
 do
@@ -529,7 +690,7 @@ do
 set dummy $ac_prog ; ac_word=$2
 if test -n "$ac_word"; then
   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
-  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
@@ -564,7 +725,7 @@ esac
 
 # Search for a latex to html converter
 echo $ac_n "checking for an HTML converter""... $ac_c"
-echo "$ac_t"""
+echo "$ac_t""(tth latex2html hevea)"
 TOHTML=
 for ac_prog in tth latex2html hevea
 do
@@ -572,7 +733,7 @@ do
 set dummy $ac_prog ; ac_word=$2
 if test -n "$ac_word"; then
   echo $ac_n "+checking for \"$ac_word\"""... $ac_c"
-  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
@@ -624,7 +785,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
@@ -687,6 +848,10 @@ cat >lyxrc.defaults <<EOF
 # ~/.lyx/lyxrc and edit this file instead. Any setting in lyxrc will
 # override the values given here.
 \\latex_command "$LATEX"
+\\pdflatex_command "$PDFLATEX"
+\\view_pdf_command "$PDFVIEWER"
+\\pdf_to_ps_command "$PDFPS"
+\\dvi_to_ps_command "$DVIPS"
 \\relyx_command "$RELYX"
 \\literate_command "$LITERATE"
 \\literate_extension "$LITERATE_EXT"