]> git.lyx.org Git - lyx.git/blobdiff - lib/configure
Dekels arabic patch, + some small things by me
[lyx.git] / lib / configure
index 68ee643ee1da0a8b4eb882019b1e72ba43404f8c..a1192e247c0ee05cd7391aa2937a75a54cbe8ee6 100755 (executable)
@@ -331,6 +331,114 @@ 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""(groff nroff)"
@@ -677,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
@@ -740,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"