[gnome-university] add various autoconf related helpers for latex.



commit 7092565242e4f89da528513df8bb1ee306c06628
Author: Christian Hergert <christian hergert me>
Date:   Sun Jan 13 17:01:34 2013 -0800

    add various autoconf related helpers for latex.

 Makefile.am                             |    2 +
 configure.ac                            |   21 ++++----
 m4/_ac_latex_test.m4                    |   46 +++++++++++++++++
 m4/ac_latex_class.m4                    |   69 +++++++++++++++++++++++++
 m4/ac_latex_class_article.m4            |   35 +++++++++++++
 m4/ac_latex_class_book.m4               |   35 +++++++++++++
 m4/ac_latex_class_report.m4             |   35 +++++++++++++
 m4/ac_latex_classes.m4                  |   52 +++++++++++++++++++
 m4/ac_latex_dvips_o_stdout.m4           |   55 ++++++++++++++++++++
 m4/ac_latex_dvips_t.m4                  |   59 ++++++++++++++++++++++
 m4/ac_latex_dvips_t_a4.m4               |   37 ++++++++++++++
 m4/ac_latex_dvips_t_a4_landscape.m4     |   38 ++++++++++++++
 m4/ac_latex_dvips_t_letter.m4           |   38 ++++++++++++++
 m4/ac_latex_dvips_t_letter_landscape.m4 |   38 ++++++++++++++
 m4/ac_latex_package.m4                  |   83 +++++++++++++++++++++++++++++++
 m4/ac_latex_package_amsmath.m4          |   66 ++++++++++++++++++++++++
 m4/ac_latex_package_fontenc.m4          |   74 +++++++++++++++++++++++++++
 m4/ac_latex_package_input.m4            |   58 +++++++++++++++++++++
 m4/ac_latex_package_opt.m4              |   64 ++++++++++++++++++++++++
 m4/ac_latex_packages.m4                 |   54 ++++++++++++++++++++
 m4/ac_prog_bibtex.m4                    |   41 +++++++++++++++
 m4/ac_prog_dvibook.m4                   |   41 +++++++++++++++
 m4/ac_prog_dvipdf.m4                    |   41 +++++++++++++++
 m4/ac_prog_dvips.m4                     |   41 +++++++++++++++
 m4/ac_prog_fig2dev.m4                   |   41 +++++++++++++++
 m4/ac_prog_gnuplot.m4                   |   41 +++++++++++++++
 m4/ac_prog_gunzip.m4                    |   41 +++++++++++++++
 m4/ac_prog_gzip.m4                      |   41 +++++++++++++++
 m4/ac_prog_jpeg2ps.m4                   |   41 +++++++++++++++
 m4/ac_prog_jpegtopnm.m4                 |   41 +++++++++++++++
 m4/ac_prog_kpsewhich.m4                 |   41 +++++++++++++++
 m4/ac_prog_latex.m4                     |   41 +++++++++++++++
 m4/ac_prog_latex2html.m4                |   41 +++++++++++++++
 m4/ac_prog_latex2man.m4                 |   41 +++++++++++++++
 m4/ac_prog_latex2png.m4                 |   41 +++++++++++++++
 m4/ac_prog_latex2rtf.m4                 |   41 +++++++++++++++
 m4/ac_prog_makeindex.m4                 |   41 +++++++++++++++
 m4/ac_prog_mf.m4                        |   41 +++++++++++++++
 m4/ac_prog_mktexpk.m4                   |   41 +++++++++++++++
 m4/ac_prog_pdflatex.m4                  |   41 +++++++++++++++
 m4/ac_prog_pngtopnm.m4                  |   41 +++++++++++++++
 m4/ac_prog_pnmtops.m4                   |   41 +++++++++++++++
 m4/ac_prog_ps2pdf.m4                    |   41 +++++++++++++++
 m4/ac_prog_psbook.m4                    |   41 +++++++++++++++
 m4/ac_prog_psnup.m4                     |   41 +++++++++++++++
 m4/ac_prog_psresize.m4                  |   41 +++++++++++++++
 m4/ac_prog_psselect.m4                  |   41 +++++++++++++++
 m4/ac_prog_texhash.m4                   |   41 +++++++++++++++
 m4/ac_texmf_path.m4                     |   72 ++++++++++++++++++++++++++
 49 files changed, 2169 insertions(+), 10 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index edff3ba..69a5afa 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1 +1,3 @@
 SUBDIRS = c101
+
+ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
diff --git a/configure.ac b/configure.ac
index 3ccab3f..3b8e973 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,21 +4,22 @@ dnl ************************************************************************
 AC_PREREQ([2.69])
 AC_INIT([gnome-university],[0.1.0])
 AM_INIT_AUTOMAKE([1.11.1 no-dist-gzip dist-xz])
+AC_CONFIG_MACRO_DIR([m4])
 
 
 dnl ************************************************************************
-dnl Check for required programs.
+dnl Check for latex dependencies.
 dnl ************************************************************************
-AC_PATH_PROG([PDFLATEX], [pdflatex], [])
-if test "$PDFLATEX" = ""; then
-	AC_MSG_ERROR([pdflatex could not be found, please install texlive-latex.])
-fi
+AC_LATEX_CLASS_ARTICLE
+AC_LATEX_PACKAGE_AMSMATH
+AC_LATEX_PACKAGE_FONTENC
+AC_PROG_MF
+AC_PROG_PDFLATEX
 
-AC_PATH_PROG([MF2PT1], [mf2pt1], [])
-if test "$MF2PT1" = ""; then
-	AC_MSG_ERROR([mf2pt1 could not be found, please install texlive-mf2pt1.])
-fi
 
+dnl ************************************************************************
+dnl Check for other required programs.
+dnl ************************************************************************
 AC_PATH_PROG([DIA], [dia], [])
 if test "$DIA" = ""; then
 	AC_MSG_ERROR([dia could not be found, please install dia.])
@@ -45,5 +46,5 @@ echo "  Prefix .................: ${prefix}"
 echo ""
 echo "  Programs"
 echo "    dia ..................: ${DIA}"
-echo "    pdflatex .............: ${PDFLATEX}"
+echo "    pdflatex .............: ${pdflatex}"
 echo ""
diff --git a/m4/_ac_latex_test.m4 b/m4/_ac_latex_test.m4
new file mode 100644
index 0000000..ceee723
--- /dev/null
+++ b/m4/_ac_latex_test.m4
@@ -0,0 +1,46 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# Internal macro to test a latex file
+#
+
+AC_DEFUN([_AC_LATEX_TEST],[
+AC_REQUIRE([AC_PROG_LATEX])
+rm -rf .tmps_latex 
+mkdir .tmps_latex 
+cd .tmps_latex 
+ifelse($#,2,[
+$2="no"; export $2;
+cat > testconf.tex << \EOF
+$1
+EOF
+],$#,3,[
+echo "\\documentclass{$3}" > testconf.tex
+cat >> testconf.tex << \EOF
+$1
+EOF
+],$#,4,[
+echo "\\documentclass{$3}" > testconf.tex
+echo "\\usepackage{$4}" > testconf.tex
+cat >> testconf.tex << \EOF
+$1
+])
+cat testconf.tex | $latex 2>&1 1>/dev/null && $2=yes; export $2;
+cd .. 
+rm -rf .tmps_latex 
+])
diff --git a/m4/ac_latex_class.m4 b/m4/ac_latex_class.m4
new file mode 100644
index 0000000..61c571a
--- /dev/null
+++ b/m4/ac_latex_class.m4
@@ -0,0 +1,69 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_LATEX_CLASS(<class>,<variable>)
+#
+# Test the presences of class and set $<variable> 
+# to yes or no
+#
+#
+dnl @synopsis AC_LATEX_CLASSE(<class1>,<var>)
+dnl
+dnl Test if class1 exists
+dnl and set $var to the right value
+dnl
+dnl  AC_LATEX_CLASSES([book],book)
+dnl  should set $book="yes"
+dnl
+dnl  AC_LATEX_CLASSES(allo,book)
+dnl  should set $book="no"
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_LATEX_CLASS],[
+AC_CACHE_CHECK([for class $1],[ac_cv_latex_class_]translit($1,[-],[_]),[
+_AC_LATEX_TEST([
+\begin{document}
+\end{document}
+],[ac_cv_latex_class_]translit($1,[-],[_]),$1)
+])
+$2=$[ac_cv_latex_class_]translit($1,[-],[_]) ; export $2;
+AC_SUBST($2)
+ifelse($#,2,[],$#,3,[
+    if test "[$]$2" = "yes" ;
+    then
+        $3
+    fi
+],$#,4,[
+    ifelse($3,[],[
+        if test "[$]$2" = "no" ;
+        then
+            $4
+        fi
+    ],[
+        if test "[$]$2" = "yes" ;
+        then
+            $3
+        else
+            $4
+        fi
+    ])
+])
+
+])
\ No newline at end of file
diff --git a/m4/ac_latex_class_article.m4 b/m4/ac_latex_class_article.m4
new file mode 100644
index 0000000..681c1e0
--- /dev/null
+++ b/m4/ac_latex_class_article.m4
@@ -0,0 +1,35 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_LATEX_CLASS_ARTICLE
+#
+# Test the presences class article and
+# set article to yes if exists, 
+# else Error
+#
+#
+dnl @synopsis AC_LATEX_CLASS_ARTICLE
+dnl
+dnl same as AC_LATEX_CLASS(article,article)
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_LATEX_CLASS_ARTICLE],[
+AC_LATEX_CLASS(article,article,[],[AC_MSG_ERROR([Unable to find the article class])])
+])
\ No newline at end of file
diff --git a/m4/ac_latex_class_book.m4 b/m4/ac_latex_class_book.m4
new file mode 100644
index 0000000..7920494
--- /dev/null
+++ b/m4/ac_latex_class_book.m4
@@ -0,0 +1,35 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_LATEX_CLASS_BOOK
+#
+# Test the presences class book and
+# set book to yes if exists, 
+# else Error
+#
+#
+dnl @synopsis AC_LATEX_CLASS_BOOK
+dnl
+dnl same as AC_LATEX_CLASS(book,book)
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_LATEX_CLASS_BOOK],[
+AC_LATEX_CLASS(book,book,[],[AC_MSG_ERROR([Unable to find the book class])])
+])
\ No newline at end of file
diff --git a/m4/ac_latex_class_report.m4 b/m4/ac_latex_class_report.m4
new file mode 100644
index 0000000..982ab11
--- /dev/null
+++ b/m4/ac_latex_class_report.m4
@@ -0,0 +1,35 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_LATEX_CLASS_REPORT
+#
+# Test the presences class report and
+# set report to yes if exists, 
+# else Error
+#
+#
+dnl @synopsis AC_LATEX_CLASS_REPORT
+dnl
+dnl same as AC_LATEX_CLASS(report,report)
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_LATEX_CLASS_REPORT],[
+AC_LATEX_CLASS(report,report,[],[AC_MSG_ERROR([Unable to find the report class])])
+])
\ No newline at end of file
diff --git a/m4/ac_latex_classes.m4 b/m4/ac_latex_classes.m4
new file mode 100644
index 0000000..975c566
--- /dev/null
+++ b/m4/ac_latex_classes.m4
@@ -0,0 +1,52 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_LATEX_CLASSES([<class1>,<class2>,...,<classn>],<variable>)
+#
+# Test the presences of class1 or class2 or ...
+# and set $<variable> to the right value or no if not found
+#
+dnl @synopsis AC_LATEX_CLASSES([<class1>,<class2>,...],<var>)
+dnl
+dnl Test if class1 exists and if not class2 and so
+dnl and set $var to the right value
+dnl
+dnl  AC_LATEX_CLASSES([allo,book,bnjour],book)
+dnl  should set $book="book"
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+define(_AC_LATEX_CLASSES_INTERNE,[
+	ifelse($#,1,[],$#,2,[
+		AC_LATEX_CLASS($2,$1)
+	],[
+		AC_LATEX_CLASS($2,$1)
+		if test "$$1" = "yes";
+		then
+			$1=$2 ; export $1 ;
+		else
+			_AC_LATEX_CLASSES_INTERNE($1,m4_shift(m4_shift($@)))
+		fi;
+	])
+])
+
+AC_DEFUN([AC_LATEX_CLASSES],[
+	_AC_LATEX_CLASSES_INTERNE($2,$1)
+	AC_SUBST($2)
+])
diff --git a/m4/ac_latex_dvips_o_stdout.m4 b/m4/ac_latex_dvips_o_stdout.m4
new file mode 100644
index 0000000..fa620d9
--- /dev/null
+++ b/m4/ac_latex_dvips_o_stdout.m4
@@ -0,0 +1,55 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_LATEX_DVIPS_O_STDOUT
+#
+# Test dvips with option -o- and set $dvips_o_stdout to the right value
+#
+#
+dnl @synopsis AC_LATEX_DVIPS_O_STDOUT
+dnl
+dnl test if dvips -o- works. If so, set $dvips_o_stdout to yes else to no
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_LATEX_DVIPS_O_STDOUT],[
+AC_REQUIRE([AC_LATEX_CLASS_BOOK])
+AC_CACHE_CHECK([for option -o- in dvips],ac_cv_dvips_o_stdout,[
+rm -rf .dvips
+mkdir .dvips
+cd .dvips
+cat > test.tex << EOF
+\documentclass{book}
+\begin{document}
+Test
+\end{document}
+EOF
+$latex test.tex 1>/dev/null 2>&1
+ac_cv_dvips_o_stdout="no"; export ac_cv_dvips_o_stdout;
+$dvips -o- test.dvi   1>/dev/null 2>&1 && ac_cv_dvips_o_stdout="yes"; export ac_cv_dvips_o_stdout 
+cd ..
+rm -rf .dvips
+])
+DVIPS_O_STDOUT=$ac_cv_dvips_o_stdout; export DVIPS_O_STDOUT;
+if test $DVIPS_O_STDOUT = "no" ;
+then
+    AC_MSG_ERROR(Unable to find the option -o- in dvips)
+fi
+AC_SUBST(DVIPS_O_STDOUT)
+])
diff --git a/m4/ac_latex_dvips_t.m4 b/m4/ac_latex_dvips_t.m4
new file mode 100644
index 0000000..dcc3f03
--- /dev/null
+++ b/m4/ac_latex_dvips_t.m4
@@ -0,0 +1,59 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_LATEX_DVIPS_T(<paper>,<var>,[<on|off>])
+#
+# Test dvips with option -o ... -T <paper> et set $<var> to the right value
+#
+#
+dnl @synopsis AC_LATEX_DVIPS_T(<paper>,<var>) or AC_LATEX_DVIPS_T(<paper>,<var>,on|off)
+dnl
+dnl This macro test if dvips -o ... -t <paper> works. When using the on option, test
+dnl if dvips -o ... -t <paper> -t landscape works.
+dnl if it works, set $var to yes, else $var="no"
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_LATEX_DVIPS_T],[
+AC_REQUIRE([AC_LATEX_CLASS_BOOK])
+if test "$3" = "on" ;
+then
+_ac_latex_dvips_local=" -t landscape" ; export _ac_latex_dvips_local ;
+else
+_ac_latex_dvips_local=" " ; export _ac_latex_dvips_local ;
+fi
+AC_CACHE_CHECK([for option -t $1 $_ac_latex_dvips_local with dvips],[ac_cv_dvips_t_]translit($1,[-],[_])[_]translit($3,[-],[_]),[
+rm -rf .dvips
+mkdir .dvips
+cd .dvips
+cat > test.tex << EOF
+\documentclass{book}
+\begin{document}
+Test
+\end{document}
+EOF
+$latex test.tex 1>/dev/null 2>&1
+[ac_cv_dvips_t_]translit($1,[-],[_])[_]translit($3,[-],[_])="yes"; export [ac_cv_dvips_t_]translit($1,[-],[_])[_]translit($3,[-],[_]);
+$dvips -o test.ps test.dvi -t $1 $_ac_latex_dvips_local 2>&1 1>/dev/null | (grep "dvips: no match for papersize" 1>/dev/null 2>&1 && [ac_cv_dvips_t_]translit($1,[-],[_])[_]translit($3,[-],[_])="no"; export [ac_cv_dvips_t_]translit($1,[-],[_])[_]translit($3,[-],[_]))
+cd ..
+rm -rf .dvips
+])
+$2=$[ac_cv_dvips_t_]translit($1,[-],[_])[_]translit($3,[-],[_]); export $2;
+AC_SUBST($2)
+])
diff --git a/m4/ac_latex_dvips_t_a4.m4 b/m4/ac_latex_dvips_t_a4.m4
new file mode 100644
index 0000000..36321ef
--- /dev/null
+++ b/m4/ac_latex_dvips_t_a4.m4
@@ -0,0 +1,37 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_LATEX_DVIPS_T_A4
+#
+# Test dvips -t a4 and set dvips_t_a4
+#
+#
+dnl @synopsis AC_LATEX_DVIPS_T_A4
+dnl
+dnl same as AC_LATEX_DVIPS_T(a4,dvips_t_a4)
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_LATEX_DVIPS_T_A4],[
+AC_LATEX_DVIPS_T(a4,dvips_t_a4)
+if test $dvips_t_a4 = "no";
+then
+    AC_MSG_ERROR([Unable to find the -t a4 option in dvips])
+fi
+])
\ No newline at end of file
diff --git a/m4/ac_latex_dvips_t_a4_landscape.m4 b/m4/ac_latex_dvips_t_a4_landscape.m4
new file mode 100644
index 0000000..0407353
--- /dev/null
+++ b/m4/ac_latex_dvips_t_a4_landscape.m4
@@ -0,0 +1,38 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_LATEX_DVIPS_T_A4_LANDSCAPE
+#
+# Test dvips -t a4 -t landscape and set dvips_t_a4_landscape
+#
+#
+dnl @synopsis AC_LATEX_DVIPS_T_A4_LANDSCAPE
+dnl
+dnl same as AC_LATEX_DVIPS_T(a4,dvips_t_a4_landscape,on)
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_LATEX_DVIPS_T_A4_LANDSCAPE],[
+AC_REQUIRE([AC_LATEX_DVIPS_T_A4])
+AC_LATEX_DVIPS_T(a4,dvips_t_a4_landscape,on)
+if test $dvips_t_a4_landscape = "no";
+then
+    AC_MSG_ERROR([Unable to find the -t a4 -t landscape option in dvips])
+fi
+])
diff --git a/m4/ac_latex_dvips_t_letter.m4 b/m4/ac_latex_dvips_t_letter.m4
new file mode 100644
index 0000000..17f4ad6
--- /dev/null
+++ b/m4/ac_latex_dvips_t_letter.m4
@@ -0,0 +1,38 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_LATEX_DVIPS_T_LETTER
+#
+# Test dvips -t letter and set dvips_t_letter
+#
+#
+dnl @synopsis AC_LATEX_DVIPS_T_LETTER
+dnl
+dnl same as AC_LATEX_DVIPS_T(letter,dvips_t_letter)
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+
+AC_DEFUN([AC_LATEX_DVIPS_T_LETTER],[
+AC_LATEX_DVIPS_T(letter,dvips_t_letter)
+if test $dvips_t_letter = "no";
+then
+    AC_MSG_ERROR([Unable to find the -t letter option in dvips])
+fi
+])
\ No newline at end of file
diff --git a/m4/ac_latex_dvips_t_letter_landscape.m4 b/m4/ac_latex_dvips_t_letter_landscape.m4
new file mode 100644
index 0000000..4f127c2
--- /dev/null
+++ b/m4/ac_latex_dvips_t_letter_landscape.m4
@@ -0,0 +1,38 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_LATEX_DVIPS_T_LETTER_LANDSCAPE
+#
+# Test dvips -t letter -t landscape and set dvips_t_letter_landscape
+#
+#
+dnl @synopsis AC_LATEX_DVIPS_T_LETTER_LANDSCAPE
+dnl
+dnl same as AC_LATEX_DVIPS_T(letter,dvips_t_letter_landscape,on)
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_LATEX_DVIPS_T_LETTER_LANDSCAPE],[
+AC_REQUIRE([AC_LATEX_DVIPS_T_LETTER])
+AC_LATEX_DVIPS_T(letter,dvips_t_letter_landscape,on)
+if test $dvips_t_letter_landscape = "no";
+then
+    AC_MSG_ERROR([Unable to find the -t letter -t landscape option in dvips])
+fi
+])
\ No newline at end of file
diff --git a/m4/ac_latex_package.m4 b/m4/ac_latex_package.m4
new file mode 100644
index 0000000..c303608
--- /dev/null
+++ b/m4/ac_latex_package.m4
@@ -0,0 +1,83 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_LATEX_PACKAGE([<packagen>],<class>,<variable>)
+#
+# Test the presences of package and set $<variable> 
+# to yes or no
+#
+#
+dnl @synopsis AC_LATEX_PACKAGE(<package>,<class>,<variable>)
+dnl
+dnl This macro test if package in <class> exists
+dnl and set <variable> to the right value
+dnl
+dnl  AC_LATEX_PACKAGE(varioref,book,vbook)
+dnl  should set $vbook="yes"
+dnl
+dnl  AC_LATEX_PACKAGE(xyz,book,vbook)
+dnl  should set $vbook="no"
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+
+AC_DEFUN([AC_LATEX_PACKAGE],[
+if test "$[ac_cv_latex_class_]translit($2,[-],[_])" = "" ;
+then
+	AC_LATEX_CLASS($2,boretti_classesansparametre)
+	export boretti_classesansparametre;
+else
+	boretti_classesansparametre=$[ac_cv_latex_class_]translit($2,[-],[_]) ;
+	export boretti_classesansparemetre;
+fi;
+if test $boretti_classesansparametre = "no" ;
+then
+    AC_MSG_ERROR([Unable to find $2 class])
+fi
+AC_CACHE_CHECK([for $1 in class $2],[ac_cv_latex_]translit($1,[-],[_])[_]translit($2,[-],[_]),[
+_AC_LATEX_TEST([
+\documentclass{$2}
+\usepackage{$1}
+\begin{document}
+\end{document}
+],[ac_cv_latex_]translit($1,[-],[_])[_]translit($2,[-],[_]))
+])
+$3=$[ac_cv_latex_]translit($1,[-],[_])[_]translit($2,[-],[_]); export $3;
+AC_SUBST($3)
+ifelse($#,3,[],$#,4,[
+    if test "[$]$3" = "yes" ;
+    then
+        $4
+    fi
+],$#,5,[
+    ifelse($4,[],[
+        if test "[$]$3" = "no" ;
+        then
+            $5
+        fi
+    ],[
+        if test "[$]$3" = "yes" ;
+        then
+            $4
+        else
+            $5
+        fi
+    ])
+])
+])
diff --git a/m4/ac_latex_package_amsmath.m4 b/m4/ac_latex_package_amsmath.m4
new file mode 100644
index 0000000..da8c392
--- /dev/null
+++ b/m4/ac_latex_package_amsmath.m4
@@ -0,0 +1,66 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_LATEX_PACKAGE_AMSMATH
+#
+# Test the presences of amsmath and amsfonts and in case of error
+# amstex and set $amsmath to the right values
+#
+# Use the book class to do the test
+#
+#
+dnl @synopsis AC_LATEX_PACKAGE_AMSMATH
+dnl
+dnl This macro test if \usepackage{amsmath,amsfonts} works. If yes, it set 
+dnl $amsmath="\usepackage{amsmath,amsfonts}"
+dnl Else if \usepackage{amstex} works, set $amsmath="\usepackage{amstex}"
+dnl else ERROR
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_LATEX_PACKAGE_AMSMATH],[
+AC_LATEX_CLASS_BOOK
+AC_CACHE_CHECK([for amsmath],[ac_cv_latex_package_f_amsmath],[
+_AC_LATEX_TEST([
+\documentclass{book}
+\usepackage{amsmath,amsfonts}
+\begin{document}
+\end{document}
+],[ac_cv_latex_package_f_amsmath])
+if test $ac_cv_latex_package_f_amsmath = "yes" ;
+then
+    [ac_cv_latex_package_f_amsmath]="\\usepackage{amsmath,amsfonts}" ; export [ac_cv_latex_package_f_amsmath] ;
+else
+    _AC_LATEX_TEST([
+    \documentclass{book}
+    \usepackage{amstex}
+    \begin{document}
+    \end{document}
+    ],[ac_cv_latex_package_f_amsmath])
+    if test $ac_cv_latex_package_f_amsmath = "yes" ;
+    then
+        [ac_cv_latex_package_f_amsmath]="\\usepackage{amstex}" ; export [ac_cv_latex_package_f_amsmath] ;
+    else
+        AC_MSG_ERROR([Unable to find amsmath])
+    fi
+fi
+])
+amsmath=$[ac_cv_latex_package_f_amsmath]; export amsmath;
+AC_SUBST(amsmath)
+])
diff --git a/m4/ac_latex_package_fontenc.m4 b/m4/ac_latex_package_fontenc.m4
new file mode 100644
index 0000000..8f4c374
--- /dev/null
+++ b/m4/ac_latex_package_fontenc.m4
@@ -0,0 +1,74 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_LATEX_PACKAGE_FONTENC
+#
+# Test if \usepackage[T1]{fontenc}
+# if yes -> $fontenc = T1
+# else
+# Test if \usepckage[OT1]{fontenc}
+# if yes -> $fontenc = OT1
+# else
+# Error
+#
+# Use the book class for the test
+#
+#
+dnl @synopsis AC_LATEX_PACKAGE_FONTENC
+dnl
+dnl This macro test if \usepackage[T1]{fontenc} works. If yes
+dnl it set $fontenc="T1"
+dnl else if \usepackage[OT1]{fontenc} works, set $fontenc="OT1"
+dnl else ERROR
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+define(_AC_LATEX_PACKAGE_FONTENC_INTERNE,[
+changequote(*, !)dnl
+\documentclass{book}
+\usepackage[$1]{fontenc}
+\begin{document}
+\end{document}
+changequote([, ])dnl
+
+])
+
+AC_DEFUN([AC_LATEX_PACKAGE_FONTENC],[
+    AC_LATEX_CLASS_BOOK
+    AC_CACHE_CHECK([for fontenc],[ac_cv_latex_package_fontenc_opt],[
+        _AC_LATEX_TEST([_AC_LATEX_PACKAGE_FONTENC_INTERNE(T1)],[ac_cv_latex_package_fontenc_opt])
+        if test $ac_cv_latex_package_fontenc_opt = "yes" ;
+        then
+            ac_cv_latex_package_fontenc_opt="T1"; export ac_cv_latex_package_fontenc_opt;
+        else
+            _AC_LATEX_TEST([_AC_LATEX_PACKAGE_FONTENC_INTERNE(OT1)],[ac_cv_latex_package_fontenc_opt])
+            if test $ac_cv_latex_package_fontenc_opt = "yes" ;
+            then
+                ac_cv_latex_package_fontenc_opt="OT1"; export ac_cv_latex_package_fontenc_opt;
+            fi
+        fi
+        
+    ])
+    if test $ac_cv_latex_package_fontenc_opt = "no" ;
+    then
+        AC_MSG_ERROR([Unable to use fontenc with T1 nor OT1])
+    fi
+    fontenc=$ac_cv_latex_package_fontenc_opt ; export fontenc ;
+    AC_SUBST(fontenc)
+])
\ No newline at end of file
diff --git a/m4/ac_latex_package_input.m4 b/m4/ac_latex_package_input.m4
new file mode 100644
index 0000000..fd12034
--- /dev/null
+++ b/m4/ac_latex_package_input.m4
@@ -0,0 +1,58 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_LATEX_PACKAGE_INPUT(<packagen>],<class>,<variable>)
+#
+# Test the presences of package using class <class> and
+# using \input instance of \usepackage and set $<variable> 
+# to yes or no
+#
+#
+dnl @synopsis AC_LATEX_INPUT(<package>,<class>,<variable>)
+dnl
+dnl This macro test if package in <class> exists
+dnl and set <variable> to the right value (yes or no)
+dnl Use \input instance of \usepackage
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_LATEX_PACKAGE_INPUT],[
+if test "$[ac_cv_latex_class_]translit($2,[-],[_])" = "" ;
+then
+	AC_LATEX_CLASS($2,boretti_classesansparametre)
+	export boretti_classesansparametre;
+else
+	boretti_classesansparametre=$[ac_cv_latex_class_]translit($2,[-],[_]) ;
+	export boretti_classesansparemetre;
+fi;
+if test $boretti_classesansparametre = "no" ;
+then
+    AC_MSG_ERROR([Unable to find $2 class])
+fi
+AC_CACHE_CHECK([for $1 in class $2, using input insteance of usepackage],[ac_cv_latex_i_]translit($1,[-.],[__])[_]translit($2,[-],[_]),[
+_AC_LATEX_TEST([
+\documentclass{$2}
+\input $1
+\begin{document}
+\end{document}
+],[ac_cv_latex_i_]translit($1,[-.],[__])[_]translit($2,[-],[_]))
+])
+$3=$[ac_cv_latex_i_]translit($1,[-.],[__])[_]translit($2,[-],[_]); export $3;
+AC_SUBST($3)
+])
diff --git a/m4/ac_latex_package_opt.m4 b/m4/ac_latex_package_opt.m4
new file mode 100644
index 0000000..56f7100
--- /dev/null
+++ b/m4/ac_latex_package_opt.m4
@@ -0,0 +1,64 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_LATEX_PACKAGE_OPT(<packagen>,<class>,<variable>,<option>)
+#
+# Test the presences of package using class <class>
+# and option <option> and set $<variable> to yes or no
+#
+#
+dnl @synopsis AC_LATEX_PACKAGE_OPT(<package>,<class>,<variable>,<option>)
+dnl
+dnl This macro test if package in <class> with option <option> exists
+dnl and set <variable> to the right value (yes or no)
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+
+define(_AC_LATEX_PACKAGE_OPT_INTERNE,[
+changequote(*, !)dnl
+\documentclass{$2}
+\usepackage[$3]{$1}
+\begin{document}
+\end{document}
+changequote([, ])dnl
+
+])
+
+AC_DEFUN([AC_LATEX_PACKAGE_OPT],[
+if test "$[ac_cv_latex_class_]translit($2,[-],[_])" = "" ;
+then
+	AC_LATEX_CLASS($2,boretti_classesansparametre)
+	export boretti_classesansparametre;
+else
+	boretti_classesansparametre=$[ac_cv_latex_class_]translit($2,[-],[_]) ;
+	export boretti_classesansparemetre;
+fi;
+if test $boretti_classesansparametre = "no" ;
+then
+    AC_MSG_ERROR([Unable to find $1 class])
+fi
+AC_CACHE_CHECK([for $1 in class $2 with $4 as option],[ac_cv_latex_]translit($1,[-],[_])[_]translit($2,[-],[_])[_]translit($4,[-],[_]),[
+_AC_LATEX_TEST([
+_AC_LATEX_PACKAGE_OPT_INTERNE($1,$2,$4)
+],[ac_cv_latex_]translit($1,[-],[_])[_]translit($2,[-],[_])[_]translit($4,[-],[_]))
+])
+$3=$[ac_cv_latex_]translit($1,[-],[_])[_]translit($2,[-],[_])[_]translit($4,[-],[_]); export $3;
+AC_SUBST($3)
+])
diff --git a/m4/ac_latex_packages.m4 b/m4/ac_latex_packages.m4
new file mode 100644
index 0000000..4cead4e
--- /dev/null
+++ b/m4/ac_latex_packages.m4
@@ -0,0 +1,54 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_LATEX_PACKAGES([<package1>,<package2>,...,<packagen>],<class>,<variable>)
+#
+# Test the presences of package1 or if not package2 and so
+# Using class <class> and set $<variable> to the right value 
+# or no if not found
+#
+#
+dnl @synopsis AC_LATEX_PACKAGES([<package1>,<package2>,<package3>],<class>,<variable>)
+dnl
+dnl This macro test if package1 in <class> exists and if not package2 and so
+dnl and set <variable> to the right value
+dnl
+dnl  AC_LATEX_PACKAGES([allo,varioref,bonjour],book,vbook)
+dnl  should set $vbook="varioref"
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+define(_AC_LATEX_PACKAGE_INTERNE,[
+	ifelse($#,0,[],$#,1,[],$#,2,[],$#,3,[
+		AC_LATEX_PACKAGE($3,$2,$1)
+	],[
+		AC_LATEX_PACKAGE($3,$2,$1)
+		if test "$$1" = "yes";
+		then
+			$1=$3 ; export $1 ;
+		else
+			_AC_LATEX_PACKAGE_INTERNE($1,$2,m4_shift(m4_shift(m4_shift($@))))
+		fi;
+	])
+])
+
+AC_DEFUN(AC_LATEX_PACKAGES,[
+	_AC_LATEX_PACKAGE_INTERNE($3,$2,$1)
+	AC_SUBST($3)
+])
\ No newline at end of file
diff --git a/m4/ac_prog_bibtex.m4 b/m4/ac_prog_bibtex.m4
new file mode 100644
index 0000000..3fd5065
--- /dev/null
+++ b/m4/ac_prog_bibtex.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_BIBTEX
+#
+# Test for bibtex
+# and set $bibtex to the correct value.
+#
+#
+dnl @synopsis AC_PROG_BIBTEX
+dnl
+dnl This macro test if bibtex is installed. If bibtex
+dnl is installed, it set $bibtex to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_BIBTEX],[
+AC_CHECK_PROGS(bibtex,bibtex,no)
+export bibtex;
+if test $bibtex = "no" ;
+then
+	AC_MSG_ERROR([Unable to find a BiTex application]);
+fi
+AC_SUBST(bibtex)
+])
diff --git a/m4/ac_prog_dvibook.m4 b/m4/ac_prog_dvibook.m4
new file mode 100644
index 0000000..d77b6c7
--- /dev/null
+++ b/m4/ac_prog_dvibook.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_DVIBOOK
+#
+# Test for dvibook
+# and set $dvibook to the correct value.
+#
+#
+dnl @synopsis AC_PROG_DVIBOOK
+dnl
+dnl This macro test if dvibook is installed. If dvibook
+dnl is installed, it set $dvibook to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_DVIBOOK],[
+AC_CHECK_PROGS(dvibook,dvibook,no)
+export dvibook;
+if test $dvibook = "no" ;
+then
+	AC_MSG_ERROR([Unable to find a dvibook application]);
+fi;
+AC_SUBST(dvibook)
+])
diff --git a/m4/ac_prog_dvipdf.m4 b/m4/ac_prog_dvipdf.m4
new file mode 100644
index 0000000..ffbf9e4
--- /dev/null
+++ b/m4/ac_prog_dvipdf.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_DVIPS
+#
+# Test for dvipdf
+# and set $dvipdf to the correct value.
+#
+#
+dnl @synopsis AC_PROG_DVIPDF
+dnl
+dnl This macro test if dvipdf is installed. If dvipdf
+dnl is installed, it set $dvipdf to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_DVIPDF],[
+AC_CHECK_PROGS(dvipdf,dvipdf,no)
+export dvipdf;
+if test $dvipdf = "no" ;
+then
+	AC_MSG_ERROR([Unable to find a dvipdf application]);
+fi;
+AC_SUBST(dvipdf)
+])
\ No newline at end of file
diff --git a/m4/ac_prog_dvips.m4 b/m4/ac_prog_dvips.m4
new file mode 100644
index 0000000..309f3df
--- /dev/null
+++ b/m4/ac_prog_dvips.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_DVIPS
+#
+# Test for dvips
+# and set $dvips to the correct value.
+#
+#
+dnl @synopsis AC_PROG_DVIPS
+dnl
+dnl This macro test if dvips is installed. If dvips
+dnl is installed, it set $dvips to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_DVIPS],[
+AC_CHECK_PROGS(dvips,dvips,no)
+export dvips;
+if test $dvips = "no" ;
+then
+	AC_MSG_ERROR([Unable to find a dvips application]);
+fi;
+AC_SUBST(dvips)
+])
diff --git a/m4/ac_prog_fig2dev.m4 b/m4/ac_prog_fig2dev.m4
new file mode 100644
index 0000000..55ae5ff
--- /dev/null
+++ b/m4/ac_prog_fig2dev.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_FIG2DEV
+#
+# Test for fig2dev
+# and set $fig2dev to the correct value.
+#
+#
+dnl @synopsis AC_PROG_FIG2DEV
+dnl
+dnl This macro test if fig2dev is installed. If fig2dev
+dnl is installed, it set $fig2dev to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_FIG2DEV],[
+AC_CHECK_PROGS(fig2dev,[fig2dev],no)
+export fig2dev;
+if test $fig2dev = "no" ;
+then
+	AC_MSG_ERROR([Unable to find a fig2dev application]);
+fi
+AC_SUBST(fig2dev)
+])
\ No newline at end of file
diff --git a/m4/ac_prog_gnuplot.m4 b/m4/ac_prog_gnuplot.m4
new file mode 100644
index 0000000..3857b87
--- /dev/null
+++ b/m4/ac_prog_gnuplot.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_GNUPLOT
+#
+# Test for gnuplot
+# and set $gnuplot to the correct value.
+#
+#
+dnl @synopsis AC_PROG_GNUPLOT
+dnl
+dnl This macro test if gnuplot is installed. If gnuplot
+dnl is installed, it set $gnuplot to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_GNUPLOT],[
+AC_CHECK_PROGS(gnuplot,[gnuplot],no)
+export gnuplot;
+if test $gnuplot = "no" ;
+then
+	AC_MSG_ERROR([Unable to find a gnuplot application]);
+fi
+AC_SUBST(gnuplot)
+])
diff --git a/m4/ac_prog_gunzip.m4 b/m4/ac_prog_gunzip.m4
new file mode 100644
index 0000000..3f39333
--- /dev/null
+++ b/m4/ac_prog_gunzip.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_GUNZIP
+#
+# Test for gunzip
+# and set $gunzip to the correct value.
+#
+#
+dnl @synopsis AC_PROG_GUNZIP
+dnl
+dnl This macro test if gunzip is installed. If gunzip
+dnl is installed, it set $gunzip to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_GUNZIP],[
+AC_CHECK_PROGS(gunzip,[gunzip],no)
+export gunzip;
+if test $gunzip = "no" ;
+then
+	AC_MSG_ERROR([Unable to find the gunzip application]);
+fi
+AC_SUBST(gunzip)
+])
diff --git a/m4/ac_prog_gzip.m4 b/m4/ac_prog_gzip.m4
new file mode 100644
index 0000000..13b1211
--- /dev/null
+++ b/m4/ac_prog_gzip.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_GZIP
+#
+# Test for gzip
+# and set $gzip to the correct value.
+#
+#
+dnl @synopsis AC_PROG_GZIP
+dnl
+dnl This macro test if gzip is installed. If gzip
+dnl is installed, it set $gzip to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_GZIP],[
+AC_CHECK_PROGS(gzip,[gzip],no)
+export gzip;
+if test $gzip = "no" ;
+then
+	AC_MSG_ERROR([Unable to find the gzip application]);
+fi
+AC_SUBST(gzip)
+])
diff --git a/m4/ac_prog_jpeg2ps.m4 b/m4/ac_prog_jpeg2ps.m4
new file mode 100644
index 0000000..0d841f1
--- /dev/null
+++ b/m4/ac_prog_jpeg2ps.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_JPEG2PS
+#
+# Test for jpeg2ps
+# and set $jpeg2ps to the correct value.
+#
+#
+dnl @synopsis AC_PROG_JPEG2PS
+dnl
+dnl This macro test if jpeg2ps is installed. If jpeg2ps
+dnl is installed, it set $jpeg2ps to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_JPEG2PS],[
+AC_CHECK_PROGS(jpeg2ps,[jpeg2ps],no)
+export jpeg2ps;
+if test $jpeg2ps = "no" ;
+then
+	AC_MSG_ERROR([Unable to find a jpeg2ps application]);
+fi
+AC_SUBST(jpeg2ps)
+])
diff --git a/m4/ac_prog_jpegtopnm.m4 b/m4/ac_prog_jpegtopnm.m4
new file mode 100644
index 0000000..f96225f
--- /dev/null
+++ b/m4/ac_prog_jpegtopnm.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_JPEGTOPNM
+#
+# Test for jpegtopnm
+# and set $jpegtopnm to the correct value.
+#
+#
+dnl @synopsis AC_PROG_JPEGTOPNM
+dnl
+dnl This macro test if jpegtopnm is installed. If jpegtopnm
+dnl is installed, it set $jpegtopnm to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_JPEGTOPNM],[
+AC_CHECK_PROGS(jpegtopnm,[jpegtopnm],no)
+export jpegtopnm;
+if test $jpegtopnm = "no" ;
+then
+	AC_MSG_ERROR([Unable to find a jpegtopnm application]);
+fi
+AC_SUBST(jpegtopnm)
+])
diff --git a/m4/ac_prog_kpsewhich.m4 b/m4/ac_prog_kpsewhich.m4
new file mode 100644
index 0000000..b2c2bdc
--- /dev/null
+++ b/m4/ac_prog_kpsewhich.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_KPSEWHICH
+#
+# Test for kpsewhich
+# and set $kpsewhich to the correct value.
+#
+#
+dnl @synopsis AC_PROG_KPSEWHICH
+dnl
+dnl This macro test if kpsewhich is installed. If kpsewhich
+dnl is installed, it set $kpsewhich to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_KPSEWHICH],[
+AC_CHECK_PROGS(kpsewhich,[kpsewhich],no)
+export kpsewhich;
+if test $kpsewhich = "no" ;
+then
+	AC_MSG_ERROR([Unable to find the kpsewhich application]);
+fi
+AC_SUBST(kpsewhich)
+])
diff --git a/m4/ac_prog_latex.m4 b/m4/ac_prog_latex.m4
new file mode 100644
index 0000000..7204471
--- /dev/null
+++ b/m4/ac_prog_latex.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_LATEX
+#
+# Test for latex or elatax or lambda
+# and set $latex to the correct value.
+#
+#
+dnl @synopsis AC_PROG_LATEX
+dnl
+dnl This macro test if latex is installed. If latex
+dnl is installed, it set $latex to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_LATEX],[
+AC_CHECK_PROGS(latex,[latex elatex lambda],no)
+export latex;
+if test $latex = "no" ;
+then
+	AC_MSG_ERROR([Unable to find a LaTeX application]);
+fi
+AC_SUBST(latex)
+])
diff --git a/m4/ac_prog_latex2html.m4 b/m4/ac_prog_latex2html.m4
new file mode 100644
index 0000000..3b96fc4
--- /dev/null
+++ b/m4/ac_prog_latex2html.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_LATEX2HTML
+#
+# Test for latex2html
+# and set $latex2html to the correct value.
+#
+#
+dnl @synopsis AC_PROG_LATEX2HTML
+dnl
+dnl This macro test if latex2html is installed. If latex2html
+dnl is installed, it set $latex2html to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_LATEX2HTML],[
+AC_CHECK_PROGS(latex2html,[latex2html],no)
+export latex2html;
+if test $latex2html = "no" ;
+then
+	AC_MSG_ERROR([Unable to find a LaTeX2html application]);
+fi
+AC_SUBST(latex2html)
+])
diff --git a/m4/ac_prog_latex2man.m4 b/m4/ac_prog_latex2man.m4
new file mode 100644
index 0000000..2c55c06
--- /dev/null
+++ b/m4/ac_prog_latex2man.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_LATEX2MAN
+#
+# Test for latex2man
+# and set $latex2man to the correct value.
+#
+#
+dnl @synopsis AC_PROG_LATEX2MAN
+dnl
+dnl This macro test if latex2man is installed. If latex2man
+dnl is installed, it set $latex2man to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_LATEX2MAN],[
+AC_CHECK_PROGS(latex2man,[latex2man],no)
+export latex2man;
+if test $latex2man = "no" ;
+then
+	AC_MSG_ERROR([Unable to find a LaTeX2man application]);
+fi
+AC_SUBST(latex2man)
+])
diff --git a/m4/ac_prog_latex2png.m4 b/m4/ac_prog_latex2png.m4
new file mode 100644
index 0000000..522f4a7
--- /dev/null
+++ b/m4/ac_prog_latex2png.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_LATEX2PNG
+#
+# Test for latex2png
+# and set $latex2png to the correct value.
+#
+#
+dnl @synopsis AC_PROG_LATEX2PNG
+dnl
+dnl This macro test if latex2png is installed. If latex2png
+dnl is installed, it set $latex2png to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_LATEX2PNG],[
+AC_CHECK_PROGS(latex2png,[latex2png],no)
+export latex2png;
+if test $latex2png = "no" ;
+then
+	AC_MSG_ERROR([Unable to find a LaTeX2png application]);
+fi
+AC_SUBST(latex2png)
+])
diff --git a/m4/ac_prog_latex2rtf.m4 b/m4/ac_prog_latex2rtf.m4
new file mode 100644
index 0000000..cfd7530
--- /dev/null
+++ b/m4/ac_prog_latex2rtf.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_LATEX2RTF
+#
+# Test for latex2rtf
+# and set $latex2rtf to the correct value.
+#
+#
+dnl @synopsis AC_PROG_LATEX2RTF
+dnl
+dnl This macro test if latex2rtf is installed. If latex2rtf
+dnl is installed, it set $latex2rtf to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_LATEX2RTF],[
+AC_CHECK_PROGS(latex2rtf,[latex2rtf],no)
+export latex2rtf;
+if test $latex2rtf = "no" ;
+then
+	AC_MSG_ERROR([Unable to find a LaTeX2rtf application]);
+fi
+AC_SUBST(latex2rtf)
+])
diff --git a/m4/ac_prog_makeindex.m4 b/m4/ac_prog_makeindex.m4
new file mode 100644
index 0000000..90d884a
--- /dev/null
+++ b/m4/ac_prog_makeindex.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_MAKEINDEX
+#
+# Test for makeindex
+# and set $makeindex to the correct value.
+#
+#
+dnl @synopsis AC_PROG_MAKEINDEX
+dnl
+dnl This macro test if makeindex is installed. If makeindex
+dnl is installed, it set $makeindex to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_MAKEINDEX],[
+AC_CHECK_PROGS(makeindex,makeindex,no)
+export makeindex;
+if test $makeindex = "no" ;
+then
+	AC_MSG_ERROR([Unable to find a MakeIndex application]);
+fi
+AC_SUBST(makeindex)
+])
diff --git a/m4/ac_prog_mf.m4 b/m4/ac_prog_mf.m4
new file mode 100644
index 0000000..ca5cd93
--- /dev/null
+++ b/m4/ac_prog_mf.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_MF
+#
+# Test for mf or mfw or mf-nowin
+# and set $mf to the correct value.
+#
+#
+dnl @synopsis AC_PROG_MF
+dnl
+dnl This macro test if mf is installed. If mf
+dnl is installed, it set $mf to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_MF],[
+AC_CHECK_PROGS(mf,[mf mfw mf-nowin],no)
+export mf;
+if test $mf = "no" ;
+then
+	AC_MSG_ERROR([Unable to find a mf application]);
+fi
+AC_SUBST(mf)
+])
diff --git a/m4/ac_prog_mktexpk.m4 b/m4/ac_prog_mktexpk.m4
new file mode 100644
index 0000000..42904f5
--- /dev/null
+++ b/m4/ac_prog_mktexpk.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_MKTEXPK
+#
+# Test for mktexpk
+# and set $mktexpk to the correct value.
+#
+#
+dnl @synopsis AC_PROG_MKTEXPK
+dnl
+dnl This macro test if mktexpk is installed. If mktexpk
+dnl is installed, it set $mktexpk to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_MKTEXPK],[
+AC_CHECK_PROGS(mktexpk,mktexpk,no)
+export mktexpk;
+if test $mktexpk = "no" ;
+then
+	AC_MSG_ERROR([Unable to find a mktexpk application]);
+fi;
+AC_SUBST(mktexpk)
+])
diff --git a/m4/ac_prog_pdflatex.m4 b/m4/ac_prog_pdflatex.m4
new file mode 100644
index 0000000..2b839a1
--- /dev/null
+++ b/m4/ac_prog_pdflatex.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_PDFLATEX
+#
+# Test for pdflatex
+# and set $pdflatex to the correct value.
+#
+#
+dnl @synopsis AC_PROG_PDFLATEX
+dnl
+dnl This macro test if pdflatex is installed. If pdflatex
+dnl is installed, it set $pdflatex to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_PDFLATEX],[
+AC_CHECK_PROGS(pdflatex,[pdflatex],no)
+export pdflatex;
+if test $pdflatex = "no" ;
+then
+	AC_MSG_ERROR([Unable to find a PDFLaTeX application]);
+fi
+AC_SUBST(pdflatex)
+])
diff --git a/m4/ac_prog_pngtopnm.m4 b/m4/ac_prog_pngtopnm.m4
new file mode 100644
index 0000000..dfb95b3
--- /dev/null
+++ b/m4/ac_prog_pngtopnm.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_PNGTOPNM
+#
+# Test for pngtopnm
+# and set $pngtopnm to the correct value.
+#
+#
+dnl @synopsis AC_PROG_PNGTOPNM
+dnl
+dnl This macro test if pngtopnm is installed. If pngtopnm
+dnl is installed, it set $pngtopnm to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_PNGTOPNM],[
+AC_CHECK_PROGS(pngtopnm,[pngtopnm],no)
+export pngtopnm;
+if test $pngtopnm = "no" ;
+then
+	AC_MSG_ERROR([Unable to find a pngtopnm application]);
+fi
+AC_SUBST(pngtopnm)
+])
diff --git a/m4/ac_prog_pnmtops.m4 b/m4/ac_prog_pnmtops.m4
new file mode 100644
index 0000000..da7cffd
--- /dev/null
+++ b/m4/ac_prog_pnmtops.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_PNMTOPS
+#
+# Test for pnmtops
+# and set $pnmtops to the correct value.
+#
+#
+dnl @synopsis AC_PROG_PNMTOPS
+dnl
+dnl This macro test if pnmtops is installed. If pnmtops
+dnl is installed, it set $pnmtops to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_PNMTOPS],[
+AC_CHECK_PROGS(pnmtops,[pnmtops],no)
+export pnmtops;
+if test $pnmtops = "no" ;
+then
+	AC_MSG_ERROR([Unable to find a pnmtops application]);
+fi
+AC_SUBST(pnmtops)
+])
diff --git a/m4/ac_prog_ps2pdf.m4 b/m4/ac_prog_ps2pdf.m4
new file mode 100644
index 0000000..975d594
--- /dev/null
+++ b/m4/ac_prog_ps2pdf.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_PS2PDF
+#
+# Test for ps2pdf14 ou ps2pdf13 or ps2pdf12 or ps2pdf
+# and set $ps2pdf to the correct value.
+#
+#
+dnl @synopsis AC_PROG_PS2PDF
+dnl
+dnl This macro test if ps2pdf is installed. If ps2pdf
+dnl is installed, it set $ps2pdf to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_PS2PDF],[
+AC_CHECK_PROGS(ps2pdf,[ps2pdf14 ps2pdf13 ps2pdf12 ps2pdf],no)
+export ps2pdf;
+if test $ps2pdf = "no" ;
+then
+	AC_MSG_ERROR([Unable to find a ps2pdf application]);
+fi
+AC_SUBST(ps2pdf)
+])
diff --git a/m4/ac_prog_psbook.m4 b/m4/ac_prog_psbook.m4
new file mode 100644
index 0000000..0c5f06f
--- /dev/null
+++ b/m4/ac_prog_psbook.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_PSBOOK
+#
+# Test for psbook
+# and set $psbook to the correct value.
+#
+#
+dnl @synopsis AC_PROG_PSBOOK
+dnl
+dnl This macro test if psbook is installed. If psbook
+dnl is installed, it set $psbook to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_PSBOOK],[
+AC_CHECK_PROGS(psbook,[psbook],no)
+export psbook;
+if test $psbook = "no" ;
+then
+	AC_MSG_ERROR([Unable to find a psbook application]);
+fi
+AC_SUBST(psbook)
+])
diff --git a/m4/ac_prog_psnup.m4 b/m4/ac_prog_psnup.m4
new file mode 100644
index 0000000..d1fcf82
--- /dev/null
+++ b/m4/ac_prog_psnup.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_PSNUP
+#
+# Test for psnup
+# and set $psnup to the correct value.
+#
+#
+dnl @synopsis AC_PROG_PSNUP
+dnl
+dnl This macro test if psnup is installed. If psnup
+dnl is installed, it set $psnup to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_PSNUP],[
+AC_CHECK_PROGS(psnup,[psnup],no)
+export psnup;
+if test $psnup = "no" ;
+then
+	AC_MSG_ERROR([Unable to find a psnup application]);
+fi
+AC_SUBST(psnup)
+])
diff --git a/m4/ac_prog_psresize.m4 b/m4/ac_prog_psresize.m4
new file mode 100644
index 0000000..50ad126
--- /dev/null
+++ b/m4/ac_prog_psresize.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_PSRESIZE
+#
+# Test for psresize
+# and set $psresize to the correct value.
+#
+#
+dnl @synopsis AC_PROG_PSRESIZE
+dnl
+dnl This macro test if psresize is installed. If psresize
+dnl is installed, it set $psresize to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_PSRESIZE],[
+AC_CHECK_PROGS(psresize,[psresize],no)
+export psresize;
+if test $psresize = "no" ;
+then
+	AC_MSG_ERROR([Unable to find a psresize application]);
+fi
+AC_SUBST(psresize)
+])
diff --git a/m4/ac_prog_psselect.m4 b/m4/ac_prog_psselect.m4
new file mode 100644
index 0000000..4ca0b08
--- /dev/null
+++ b/m4/ac_prog_psselect.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_PSSELECT
+#
+# Test for psselect
+# and set $psselect to the correct value.
+#
+#
+dnl @synopsis AC_PROG_PSSELECT
+dnl
+dnl This macro test if psselect is installed. If psselect
+dnl is installed, it set $psselect to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_PSSELECT],[
+AC_CHECK_PROGS(psselect,[psselect],no)
+export psselect;
+if test $psselect = "no" ;
+then
+	AC_MSG_ERROR([Unable to find a psselect application]);
+fi
+AC_SUBST(psselect)
+])
diff --git a/m4/ac_prog_texhash.m4 b/m4/ac_prog_texhash.m4
new file mode 100644
index 0000000..12c8926
--- /dev/null
+++ b/m4/ac_prog_texhash.m4
@@ -0,0 +1,41 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_PROG_TEXHASH
+#
+# Test for texhash
+# and set $texhash to the correct value.
+#
+#
+dnl @synopsis AC_PROG_TEXHASH
+dnl
+dnl This macro test if texhash is installed. If texhash
+dnl is installed, it set $texhash to the right value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_PROG_TEXHASH],[
+AC_CHECK_PROGS(texhash,[texhash],no)
+export texhash;
+if test $texhash = "no" ;
+then
+	AC_MSG_ERROR([Unable to find the texhash application]);
+fi
+AC_SUBST(texhash)
+])
diff --git a/m4/ac_texmf_path.m4 b/m4/ac_texmf_path.m4
new file mode 100644
index 0000000..e599e9c
--- /dev/null
+++ b/m4/ac_texmf_path.m4
@@ -0,0 +1,72 @@
+#
+#   Copyright (C) 2004  Boretti Mathieu
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# AC_TEXMF_PATH
+#
+# Test for a local texmf path
+# and set $texmfpath to the correct value.
+#
+#
+dnl @synopsis AC_TEXMF_PATH
+dnl
+dnl This macro test for a local texmf path and
+dnl set $texmfpath to the correct value
+dnl
+dnl @version 1.3
+dnl @author Mathieu Boretti boretti eig unige ch
+dnl
+AC_DEFUN([AC_TEXMF_PATH],[
+AC_ARG_WITH([texmf-path],AC_HELP_STRING([--with-texmf-path=...],[specify default local texmf path]),[
+    if test ! "$withval" = "yes" ;
+    then
+        ac_cv_texmf_path="$withval" ; export ac_cv_texmf_path;
+    fi;
+],[
+    texmfpath=""; export texmfpath;
+])
+AC_REQUIRE([AC_PROG_LATEX])
+AC_REQUIRE([AC_PROG_AWK])
+AC_REQUIRE([AC_LATEX_CLASS_REPORT])
+AC_CACHE_CHECK([for texmf local path],[ac_cv_texmf_path],[
+    Base=`$kpsewhich report.cls` ; export Base ;
+    Base=`echo $Base | $AWK -F / '{for(i=1;i<NF;i++) {if ($i=="texmf") break; OUT=OUT$i"/";} print OUT}'` ; export Base ;
+    if test -x "$Base/texmf.local" ; 
+    then
+        Base="$Base/texmf.local" ; export Base;
+    else
+        if test -x "$Base/texmf-local" ;
+        then
+            Base="$Base/texmf-local" ; export Base;
+        else
+            if test -x "$Base/texmf" ; 
+            then
+                Base="$Base/texmf" ; export Base;
+            else
+                Base="no"; export Base;
+            fi;
+        fi;
+    fi;
+    ac_cv_texmf_path="$Base" ; export ac_cv_texmf_path;
+])
+texmfpath=$ac_cv_texmf_path ; export texmfpath;
+if test "$texmfpath" = "no" ;
+then
+    AC_MSG_ERROR([Unable to find a local texmf folder. Use --with-texmf-path=... to specify it])
+fi
+AC_SUBST(texmfpath)
+])



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]