1# $Id: configure.in,v 1.10 2007/02/26 04:13:40 mrsam Exp $
2#
3# Copyright 2002 Double Precision, Inc.  See COPYING for
4# distribution information.
5#
6dnl Process this file with autoconf to produce a configure script.
7AC_INIT(module.fax, 0.10, [courier-users@lists.sourceforge.net])
8
9>confdefs.h  # Kill PACKAGE_ macros
10
11AC_CONFIG_SRCDIR(faxconvert.c)
12AM_INIT_AUTOMAKE([foreign no-define])
13LPATH="$PATH:/usr/local/bin"
14AM_CONFIG_HEADER(config.h)
15
16
17dnl Checks for programs.
18AC_PROG_MAKE_SET
19AC_PROG_CC
20AC_PROG_AWK
21AC_PROG_INSTALL
22AC_PROG_LN_S
23AC_LIBTOOL_DLOPEN
24AM_PROG_LIBTOOL
25
26version=`cat ../../version`
27AC_SUBST(version)
28
29AC_PATH_PROG(CUT, cut, cut, $LPATH)
30AC_PATH_PROG(SED, sed, sed, $LPATH)
31
32AC_PATH_PROGS(PERL, perl5 perl, perl, $LPATH)
33AC_PATH_PROG(TBL, tbl, /usr/bin/tbl, $LPATH)
34AC_PATH_PROG(TROFF, troff, /usr/bin/troff, $LPATH)
35AC_PATH_PROG(GROPS, grops, grops, $LPATH)
36
37DPOST_PATH=$LPATH:/usr/lib/lp/postscript
38
39AC_PATH_PROG(DPOST, dpost, none, $DPOST_PATH)
40
41if test "$DPOST" = "none"
42then
43	if test "$GROPS" = "grops"
44	then
45		AC_MSG_WARN(----------------------------------------------)
46		AC_MSG_WARN(Unable to find troff or groff - assuming groff)
47		AC_MSG_WARN(----------------------------------------------)
48		sleep 5
49		DPOST=/usr/bin/grops
50	else
51		DPOST="$GROPS"
52	fi
53fi
54
55AC_PATH_PROG(PDFTOPS, pdftops, none, $LPATH)
56
57AC_PATH_PROG(GS, gs, none, $LPATH)
58
59if test "$PDFTOPS" = "none"
60then
61	PDFTOPS="/usr/bin/pdftops"
62fi
63
64if test "$GS" = "none"
65then
66	GS="/usr/bin/gs"
67	AC_MSG_WARN(-------------------------------------------------------------)
68	AC_MSG_WARN(Unable to find ghostscript - courierfax will not be available)
69	AC_MSG_WARN(-------------------------------------------------------------)
70	sleep 5
71fi
72
73AC_SUBST(TBL)
74AC_SUBST(TROFF)
75AC_SUBST(DPOST)
76AC_SUBST(GS)
77AC_SUBST(PDFTOPS)
78
79SENDFAX_PATH="$PATH:/usr/sbin:/usr/local/sbin:/usr/local/bin"
80
81AC_PATH_PROG(SENDFAX, sendfax, none, $SENDFAX_PATH)
82
83if test "$SENDFAX" = "none"
84then
85	SENDFAX="/usr/bin/sendfax"
86	GS="/usr/bin/gs"
87	AC_MSG_WARN(---------------------------------------------------------)
88	AC_MSG_WARN(Unable to find sendfax - courierfax will not be available)
89	AC_MSG_WARN(---------------------------------------------------------)
90	sleep 5
91fi
92
93AC_SUBST(SENDFAX)
94
95AC_PATH_PROG(PNMSCALE, pnmscale, none, $LPATH)
96
97if test "$PNMSCALE" = "none"
98then
99	PNMSCALE=/usr/bin/pnmscale
100	AC_MSG_WARN(------------------------------------------------------)
101	AC_MSG_WARN(Unable to find netpbm utilities)
102	AC_MSG_WARN(------------------------------------------------------)
103	sleep 5
104fi
105AC_PATH_PROG(GIFTOPNM, giftopnm, /usr/bin/giftopnm, $LPATH)
106AC_PATH_PROG(JPEGTOPNM, jpegtopnm, /usr/bin/jpegtopnm, $LPATH)
107AC_PATH_PROG(PPMTOPGM, ppmtopgm, /usr/bin/ppmtopgm, $LPATH)
108AC_PATH_PROG(PGMTOPBM, pgmtopbm, /usr/bin/pgmtopbm, $LPATH)
109AC_PATH_PROG(PBMTOG3, pbmtog3, /usr/bin/pbmtog3, $LPATH)
110AC_PATH_PROG(G3TOPBM, g3topbm, /usr/bin/g3topbm, $LPATH)
111AC_PATH_PROG(PNGTOPNM, pngtopnm, /usr/bin/pngtopnm, $LPATH)
112AC_PATH_PROG(PNMTOPNG, pnmtopng, /usr/bin/pnmtopng, $LPATH)
113
114AC_SUBST(PNMSCALE)
115AC_SUBST(GIFTOPNM)
116AC_SUBST(JPEGTOPNM)
117AC_SUBST(PPMTOPGM)
118AC_SUBST(PGMTOPBM)
119AC_SUBST(PBMTOG3)
120AC_SUBST(G3TOPBM)
121AC_SUBST(PNGTOPNM)
122AC_SUBST(PNMTOPNG)
123
124dnl Checks for libraries.
125
126dnl Checks for header files.
127AC_HEADER_STDC
128AC_CHECK_HEADER(sys/wait.h)
129AC_HEADER_DIRENT
130AC_HEADER_SYS_WAIT
131
132dnl Checks for typedefs, structures, and compiler characteristics.
133
134dnl Checks for library functions.
135
136AC_CHECK_FUNCS(setpgrp setpgid)
137AC_CHECK_FUNC(setpgrp,
138        [
139        AC_FUNC_SETPGRP
140        ]
141)
142
143
144if test "$GCC" = "yes"
145then
146	CFLAGS="-Wall $CFLAGS"
147fi
148
149AC_ARG_WITH(courierdir,
150[--with-courierdir         Location of courier source code (main directory)],
151	courierdir="$withval", courierdir="../..")
152
153CPPFLAGS="-I$courierdir/courier -I$srcdir/$courierdir/courier -I$courierdir -I$srcdir/$courierdir -I$courierdir/courier/libs -I$srcdir/$courierdir/courier/libs $CPPFLAGS"
154AC_SUBST(courierdir)
155
156AC_ARG_WITH(mailuser, [--with-mailuser=user      Specify mail user name (defaults to mail)],
157	mailuser="$withval",
158	mailuser=mail
159	)
160AC_ARG_WITH(mailgroup, [--with-mailgroup=group    Specify mail group name (defaults to mail)],
161	mailgroup="$withval",
162	mailgroup=mail
163	)
164AC_SUBST(mailuser)
165AC_SUBST(mailgroup)
166
167test "x$prefix" = xNONE && prefix=$ac_default_prefix
168test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
169
170eval "exec_prefix=$exec_prefix"
171eval "bindir=$bindir"
172eval "datadir=$datadir"
173eval "sysconfdir=$sysconfdir"
174eval "localstatedir=$localstatedir"
175
176filterbindir="$datadir/faxmail"
177faxtmpdir="$localstatedir/faxtmp"
178
179AC_SUBST(filterbindir)
180AC_SUBST(faxtmpdir)
181
182AM_CONDITIONAL(HAVE_SGML, test -d ${srcdir}/../../docbook)
183
184AC_OUTPUT(Makefile
185	init
186	application-postscript.filter
187	application-pdf.filter
188	image-gif.filter
189	image-jpeg.filter
190	image-png.filter
191	text-plain.filter
192	coverpage
193	new_fax
194)
195