# $HEader$

AC_INIT(dot.el)
AC_PREREQ(2.52)

PACKAGE=gnuplot-mode
GPM_MAJOR=0
GPM_MINOR=6
GPM_REVISION=0
AM_INIT_AUTOMAKE([$PACKAGE], [$GPM_MAJOR.$GPM_MINOR.$GPM_REVISION])

AC_SET_MAKE
AC_PROG_INSTALL
AM_PATH_LISPDIR

AC_CHECK_PROGS(DVIPS, dvips, no)
AC_CHECK_PROGS(LATEX, latex latex2e, no)
AC_PATH_PROG(MAKEINFO, makeinfo, no)

dnl for pdf format docs
AC_CHECK_PROGS(PDFLATEX, pdflatex, no)

if test "$EMACS" = no; then
  LISPFILES=noelcs
  INSTALL_LISP=install-nolisp
else
  LISPFILES=elcs
  INSTALL_LISP=install-lisp
fi

AC_ARG_WITH(lisp-files,dnl
[  --without-lisp-files    do not build emacs lisp files],
  [if test "$with_lisp_files" = no; then
     LISPFILES=noelcs
     INSTALL_LISP=install-nolisp
   fi])

# need to copy some stuff if we compile outside the source disrectory
if test ! -f ./gnuplot.el ; then
  # all except dot.el
  AC_MSG_RESULT([Compiling outside source directory - copying needed .el files])
  cp ${srcdir}/gnuplot.el ${srcdir}/gnuplot-gui.el .
  cp ${srcdir}/gpelcard.tex .
fi

AC_SUBST(LISPFILES)
AC_SUBST(INSTALL_LISP)

AC_OUTPUT(Makefile)
