]> git.lyx.org Git - lyx.git/blobdiff - lib/configure.m4
Baruchs latest graphics patch
[lyx.git] / lib / configure.m4
index e6a63490608c1e62ad8a3d98cedf21bd4cef99b9..6f051d0dffe73b627b96fc7308ff01faddbdcc3e 100644 (file)
@@ -85,6 +85,7 @@ dnl ######### End M4 macros #############################################
 lyx_check_config=yes
 lyx_keep_temps=no
 srcdir=
+lyx_suffix=
 
 #### Parse the command line
 for ac_option do
@@ -96,12 +97,15 @@ Options:
   --help                   show this help lines
   --keep-temps             keep temporary files (for debug. purposes)
   --without-latex-config   do not run LaTeX to determine configuration
+  --with-lyx-suffix=suffix suffix of binary installed files
 EOF
       exit 0;;
     --without-latex-config)
       lyx_check_config=no ;;
     --keep-temps)
       lyx_keep_temps=yes ;;
+    --with-lyx-suffix*)
+      lyx_suffix=`echo "$ac_option" | sed 's,--with-lyx-suffix=,,;s,^,-,'`
   esac 
 done
 
@@ -144,6 +148,12 @@ if test ! -r ${srcdir}/chkconfig.ltx ; then
   exit 1
 fi
 
+#### Adjust PATH for Win32 (Cygwin)
+if test "x$OSTYPE" = xcygwin; then
+  echo "configure: cygwin detected; path correction"
+  srcdir=`cygpath -w "${srcdir}" | tr '\\\\' /`
+  echo "srcdir=${srcdir}"
+fi
 
 #### Create the build directories if necessary
 for dir in bind clipart doc examples images kbd layouts reLyX \
@@ -185,9 +195,11 @@ PATH=${PATH}:./reLyX/
 SEARCH_PROG([for a LaTeX -> LyX converter],tex_to_lyx_command,reLyX)
 PATH=${save_PATH}
 test $tex_to_lyx_command = "reLyX" && tex_to_lyx_command="reLyX -f \$\$i"
+tex_to_lyx_command=`echo $tex_to_lyx_command | sed "s,reLyX,reLyX$lyx_suffix,"`
 
 SEARCH_PROG([for a Noweb -> LyX converter],literate_to_lyx_command,noweb2lyx)
 test $literate_to_lyx_command = "noweb2lyx" && literate_to_lyx_command="noweb2lyx \$\$i \$\$o"
+literate_to_lyx_command=`echo $literate_to_lyx_command | sed "s,noweb2lyx,noweb2lyx$lyx_suffix,"`
 
 # Search something to process a literate document
 SEARCH_PROG([for a Noweb -> LaTeX converter],literate_to_tex_command,noweave)
@@ -197,8 +209,8 @@ SEARCH_PROG([for a HTML -> Latex converter],html_to_latex_command,html2latex)
 test $html_to_latex_command = "html2latex" && html_to_latex_command="html2latex \$\$i"
 
 SEARCH_PROG([for a MSWord -> Latex converter],word_to_latex_command,wvCleanLatex word2x)
-test $word_to_latex_command = "wvCleanLatex" && word_to_latex_command="wvCleanLatex \$\$i \$\$o"
-test $word_to_latex_command = "word2x" && word_to_latex_command="word2x -f latex \$\$i"
+test "$word_to_latex_command" = "wvCleanLatex" && word_to_latex_command="wvCleanLatex \$\$i \$\$o"
+test "$word_to_latex_command" = "word2x" && word_to_latex_command="word2x -f latex \$\$i"
 
 SEARCH_PROG([for Image converter],image_command,convert)
 test $image_command = "convert" && image_command="convert \$\$i \$\$o"
@@ -213,7 +225,7 @@ SEARCH_PROG([for a Postscript previewer],GHOSTVIEW,gv ghostview)
 SEARCH_PROG([for a PDF preview],PDF_VIEWER,acroread gv ghostview xpdf)
 
 # Search something to preview dvi
-SEARCH_PROG([for a DVI previewer],DVI_VIEWER, xdvi)
+SEARCH_PROG([for a DVI previewer],DVI_VIEWER, xdvi windvi yap)
 
 # Search something to preview html
 SEARCH_PROG([for a HTML previewer],HTML_VIEWER, netscape)
@@ -226,6 +238,10 @@ test $ps_to_pdf_command = "ps2pdf" && ps_to_pdf_command="ps2pdf \$\$i"
 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 \$\$o \$\$i"
 
+# Search for a program to convert dvi to pdf
+SEARCH_PROG([for a DVI to PDF converter],dvi_to_pdf_command,dvipdfm)
+test $dvi_to_pdf_command = "dvipdfm" && dvi_to_pdf_command="dvipdfm \$\$i"
+
 # Search a *roff program (used to translate tables in ASCII export)
 SEARCH_PROG([for a *roff formatter],ROFF,groff nroff)
 ascii_roff_command=$ROFF
@@ -315,6 +331,24 @@ case $TOHTML in
       hevea) latex_to_html_command="hevea -s \$\$i";;
 esac
 
+#### Search for image conversion ####
+SEARCH_PROG([for an Image -> EPS converter], TOEPS, convert pnmtops)
+case $TOEPS in
+       convert) gif_to_eps="convert GIF:\$\$i EPS:\$\$o" png_to_eps="convert PNG:\$\$i EPS:\$\$o" jpg_to_eps="convert JPG:\$\$i EPS:\$\$o";;
+       pnmtops) gif_to_eps="giftopnm \$\$i | pnmtops > \$\$o" png_to_eps="pngtopnm \$\$i | pnmtops >\$\$o" jpg_to_eps="jpegtopnm \$\$i | pnmtops >\$\$o";;
+esac
+
+SEARCH_PROG([for a Image -> PNG converter], TOPNG, convert pnmtopng)
+case $TOPNG in
+       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";;
+       pnmtopng) gif_to_png="giftopnm \$\$i | pnmtopng >\$\$o" eps_to_png="pstopnm \$\$i| pnmtopng >\$\$o" jpg_to_png="jpegtopnm \$\$i | pnmtopng >\$\$o";;
+esac
+
+SEARCH_PROG([For an EPS -> PDF converter], EPSTOPDF, epstopdf)
+case $EPSTOPDF in
+       epstopdf) eps_to_pdf="epstopdf --outfile=\$\$o \$\$i";;
+esac
+
 #### Explore the LaTeX configuration
 MSG_CHECKING(LaTeX configuration)
 # First, remove the files that we want to re-create
@@ -391,6 +425,7 @@ cat >lyxrc.defaults <<EOF
 \\Format docbook  sgml DocBook         B
 \\Format dvi     dvi   DVI             D
 \\Format eps     eps   EPS             ""
+\\Format epsi     epsi  EPSI    ""
 \\Format fax     ""    Fax             ""
 \\Format gif      gif  GIF             ""
 \\Format html    html  HTML            H
@@ -401,16 +436,17 @@ cat >lyxrc.defaults <<EOF
 \\Format literate nw   NoWeb           N
 \\Format pdf     pdf   PDF             P
 \\Format pdf2    pdf  "PDF (pdflatex)" F
+\\Format pdf3    pdf  "PDF (dvipdfm)"  m
 \\Format png     png   PNG             ""
 \\Format ps      ps    Postscript      t
 \\Format program  ""   Program         ""
 \\Format word    doc   Word            W
 
-
 \\converter latex dvi "$LATEX \$\$i" "latex"
 \\converter latex pdf2 "$PDFLATEX \$\$i" "latex"
 \\converter latex html "$latex_to_html_command" "originaldir,needaux"
 \\converter literate latex "$literate_to_tex_command" ""
+\\converter dvi pdf3 "$dvi_to_pdf_command" ""
 \\converter dvi ps "$dvi_to_ps_command" ""
 \\converter ps pdf "$ps_to_pdf_command" ""
 \\converter ps fax "$fax_command" ""
@@ -426,10 +462,17 @@ cat >lyxrc.defaults <<EOF
 \\converter html latex "$html_to_latex_command" ""
 \\converter word latex "$word_to_latex_command" ""
 
-\converter gif eps "$image_command" ""
-\converter png eps "$image_command" ""
-\converter jpg eps "$image_command" ""
-\converter gif png "$image_command" ""
+\\converter gif  eps "$gif_to_eps" ""
+\\converter png  eps "$png_to_eps" ""
+\\converter jpg  eps "$jpg_to_eps" ""
+
+\\converter gif  png "$gif_to_png" ""
+\\converter eps  png "$eps_to_png" ""
+\\converter epsi png "$eps_to_png" ""
+\\converter jpg  png "$jpg_to_png" ""
+
+\\converter eps  pdf "$eps_to_pdf" ""
+\\converter epsi pdf "$eps_to_pdf" ""
 
 \\viewer dvi "$DVI_VIEWER"
 \\viewer html "$HTML_VIEWER"