1dnl $Id: configure.ac,v 1.52.2.1 2010/12/28 22:27:20 dan Exp $
2dnl Process this file with autoconf to produce a configure script.
3dnl
4dnl Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2010 Dan McMahill
5dnl All rights reserved.
6dnl
7dnl This code is derived from software written by Dan McMahill
8dnl
9dnl Redistribution and use in source and binary forms, with or without
10dnl modification, are permitted provided that the following conditions
11dnl are met:
12dnl 1. Redistributions of source code must retain the above copyright
13dnl    notice, this list of conditions and the following disclaimer.
14dnl 2. Redistributions in binary form must reproduce the above copyright
15dnl    notice, this list of conditions and the following disclaimer in the
16dnl    documentation and/or other materials provided with the distribution.
17dnl 3. All advertising materials mentioning features or use of this software
18dnl    must display the following acknowledgement:
19dnl        This product includes software developed by Dan McMahill
20dnl  4. The name of the author may not be used to endorse or promote products
21dnl     derived from this software without specific prior written permission.
22dnl
23dnl  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
24dnl  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25dnl  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26dnl  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
27dnl  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28dnl  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29dnl  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
30dnl  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31dnl  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32dnl  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33dnl  SUCH DAMAGE.
34dnl
35
36AC_INIT(latex.mk.in.in)
37AM_INIT_AUTOMAKE(latex-mk, 2.1)
38
39AM_MAINTAINER_MODE
40
41#
42# determine host type
43#
44AC_CANONICAL_HOST
45
46#
47# an install program
48#
49AC_PROG_INSTALL
50
51#
52# general
53#
54AC_PATH_PROG(AWK, awk nawk gawk mawk, awk)
55AC_PATH_PROG(ENV_PROG, env, env)
56AC_PATH_PROG(FALSE, false, false)
57AC_PATH_PROG(GREP, grep, grep)
58AC_PATH_PROG(GZCAT, gzcat, gzcat)
59AC_PATH_PROG(GZIP, gzip, gzip)
60AC_PATH_PROG(RM, rm, rm)
61AC_PATH_PROG(RMDIR, rmdir, rmdir)
62AC_PATH_PROG(TAR, tar, tar)
63
64#
65# for latex.mk
66#
67AC_PATH_PROG(BIBTEX, bibtex, bibtex)
68# for converting graphics file formats (from ImageMagick)
69AC_PATH_PROG(CONVERT, convert, convert)
70AC_PATH_PROG(DVIPDFM, dvipdfm, dvipdfm)
71AC_PATH_PROG(DVIPS, dvips, dvips)
72AC_PATH_PROG(ECHO, echo, echo)
73AC_PATH_PROG(FIND, find, find)
74AC_PATH_PROG(GV, gv, gv)
75AC_PATH_PROG(HEVEA, hevea, hevea)
76AC_PATH_PROG(HACHA, hacha, hacha)
77AC_PATH_PROG(IMAGEN, imagen, imagen)
78AC_PATH_PROG(LATEX, latex, latex)
79AC_PATH_PROG(LATEX2HTML, latex2html, latex2html)
80AC_PATH_PROG(LATEX2RTF, latex2rtf, latex2rtf)
81AC_PATH_PROG(LPR, lpr, lpr)
82AC_PATH_PROG(MAKEIDX, makeindex, makeindex)
83AC_PATH_PROG(PDFLATEX, pdflatex, pdflatex)
84AC_PATH_PROG(PS2PDF, ps2pdf, ps2pdf)
85AC_PATH_PROG(TEX2PAGE, tex2page, tex2page)
86AC_PATH_PROG(XDVI, xdvi, xdvi)
87
88#
89# for lgrind.mk
90#
91AC_PATH_PROG(LGRIND, lgrind, lgrind)
92
93#
94# for mpost.mk
95#
96AC_PATH_PROG(MPOST, mpost mp, mpost)
97
98#
99# for tgif.mk
100#
101AC_PATH_PROG(TGIF, tgif, tgif)
102
103#
104# for xfig.mk
105#
106AC_PATH_PROG(FIG2DEV, fig2dev, fig2dev)
107
108#
109# Look for a GNU make program and a BSD make program
110# This is used by the testsuite
111#
112
113AC_PATH_GNU_MAKE
114AC_PATH_BSD_MAKE
115
116if test "X${BMAKE}" = "Xnone" -a "X${GMAKE}" = "Xnone" ; then
117	AC_MSG_NOTICE([
118
119************************ WARNING ************************
120I could not find GNU make >= version 3.80 _or_
121a suitable BSD make on your system.  This package
122will still install correctly, but you will not actually
123be able to use it or run the testsuite until you
124install a suitable make program.
125************************ WARNING ************************
126
127]
128)
129fi
130
131#
132# system config files
133#
134
135AC_ARG_WITH([mkconf],
136[  --with-mkconf=mkconf    Use the specified file as the site configuration
137                          file for BSD make.  [default = /etc/latex-mk.conf]],
138[
139if test "X$with_mkconf" = "Xno" ; then
140        AC_ERROR([--without-mkconf is not supported])
141else
142        MAKECONF="$with_mkconf"
143fi
144],
145[
146MAKECONF=@latexmkconfdir@/latex-mk.conf
147])
148AC_SUBST(MAKECONF)
149
150AC_ARG_WITH([gmkconf],
151[  --with-gmkconf=gmkconf  Use the specified file as the site configuration
152                          file for GNU make.  [default = /etc/latex-gmk.conf]],
153[
154if test "X$with_gmkconf" = "Xno" ; then
155        AC_ERROR([--without-gmkconf is not supported])
156else
157        GMAKECONF="$with_gmkconf"
158fi
159],
160[
161GMAKECONF=@latexmkconfdir@/latex-gmk.conf
162])
163AC_SUBST(GMAKECONF)
164
165
166AC_ARG_WITH([usermkconf],
167[  --with-mkconf=usermkconf
168                          Use the specified file as the site configuration
169                          file for BSD make.  [default = $HOME/.latex-mk.conf]],
170[
171if test "X$with_usermkconf" = "Xno" ; then
172        AC_ERROR([--without-usermkconf is not supported])
173else
174        USERMAKECONF="$with_usermkconf"
175fi
176],
177[
178USERMAKECONF="\${HOME}/.latex-mk.conf"
179])
180AC_SUBST(USERMAKECONF)
181
182AC_ARG_WITH([usergmkconf],
183[  --with-usergmkconf=usergmkconf
184                          Use the specified file as the user configuration
185                          file for GNU make.  [default = $HOME/.latex-gmk.conf]],
186[
187if test "X$with_usergmkconf" = "Xno" ; then
188        AC_ERROR([--without-usergmkconf is not supported])
189else
190        USERGMAKECONF="$with_usergmkconf"
191fi
192],
193[
194USERGMAKECONF="\${HOME}/.latex-gmk.conf"
195])
196AC_SUBST(USERGMAKECONF)
197
198
199AC_OUTPUT(
200	Makefile
201	doc/Makefile
202	doc/prefix.texi
203	example/Makefile
204	example/tgif/Makefile
205	ieee-copyout
206	latex-mk
207	latex.mk.in
208	latex.subdir.mk.in
209	lgrind.mk.in
210	mpost.mk.in
211	testsuite/Makefile
212	testsuite/bmake_ref/Makefile
213	testsuite/gmake_ref/Makefile
214	testsuite/latex_mk_ref/Makefile
215	tgif.mk.in
216	xfig.mk.in
217)
218