#    This file is part of MKF.
#
#    MKF 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.
#
#    MKF 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 MKF; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#    Copyright (c) 2004 Alexandre Becoulet <alexandre.becoulet@epita.fr>

_if_var_eq		cmd_pdflatex
 var_define		cmd_pdflatex	pdflatex
_end_if

_if_in_path		{PVAR,cmd_pdflatex}

 msg_info		pdflatex ({PVAR,cmd_pdflatex}) found
 var_define		use_pdflatex	pdflatex

 _if_var_eq		mkf_pretty_print	yes
  command_add		tex	pdf	echo "   LATEX (pdf)      {SRC,.*\.c} -> {OUT}"
 _end_if
 command_add		tex	pdf	{PVAR,cmd_pdflatex} {JVAR,opt_pdflatex} {SRC,.*\.tex}

_else
  msg_error		can't find pdflatex
_end_if

_if_var_eq		cmd_dia
 var_define		cmd_dia		dia
_end_if

_if_in_path		{PVAR,cmd_dia}

 msg_info		dia ({PVAR,cmd_dia}) found
 var_define		use_dia		dia

 _if_var_eq		mkf_pretty_print	yes
  command_add		dia	eps	echo "   DIA (to eps)     {SRC,.*\.dia} -> {OUT}"
 _end_if
 command_add		dia	eps	dia -n -t eps {SRC,.*\.dia} >& /dev/null

_else
  msg_error		can't find dia
_end_if

_if_var_eq		cmd_epstopdf
 var_define		cmd_epstopdf	epstopdf
_end_if

_if_in_path		{PVAR,cmd_epstopdf}

 msg_info		epstopdf ({PVAR,cmd_epstopdf}) found
 var_define		use_epstopdf	epstopdf

 command_add		eps	pdf	epstopdf {SRC,.*\.eps} --outfile={OUT} >& /dev/null
 _if_var_eq		mkf_pretty_print	yes
  command_add		eps	pdf	echo "   EPSTOPDF         {SRC,.*\.eps} -> {OUT}"
 _end_if

_else
  msg_error		can't find epstopdf
_end_if

