File: configure.in

package info (click to toggle)
courier 0.60.0-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 52,288 kB
  • ctags: 12,677
  • sloc: ansic: 165,348; cpp: 24,820; sh: 16,410; perl: 6,839; makefile: 3,621; yacc: 289; sed: 16
file content (341 lines) | stat: -rw-r--r-- 7,438 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
dnl Process this file with autoconf to produce a configure script.
dnl $Id: configure.in,v 1.434 2008/07/13 14:54:48 mrsam Exp $
dnl
dnl Copyright 1998 - 2008 Double Precision, Inc.  See COPYING for
dnl distribution information.

AC_PREREQ(2.59)

AC_INIT(courier, 0.60.0, [courier-users@lists.sourceforge.net])
version=$PACKAGE_VERSION
AC_CONFIG_SRCDIR(courier/courier.c)
AM_INIT_AUTOMAKE
>confdefs.h # Kill PACKAGE_ macros.

LPATH="$PATH:/usr/local/bin"

AC_PROG_CC
AM_PROG_LIBTOOL

AC_PROG_MAKE_SET
AC_PROG_CXX
AC_PROG_SYSCONFTOOL
AC_PATH_PROGS(SETENV, env)

AC_ARG_ENABLE(root-check, [  --disable-root-check    Allow build as root (make check will fail)],
	rootcheck="$enableval",
	rootcheck="yes")

if test "$rootcheck" = "yes"
then
if test -w /etc
then
	AC_MSG_WARN(=== Do not compile Courier as root.  Compile)
	AC_MSG_WARN(=== Courier as a non-root user then su to)
	AC_MSG_WARN(=== root before running make install.  You must now)
	AC_MSG_WARN(=== remove this entire directory and then extract the)
	AC_MSG_WARN(=== source code from the tarball as a non-root user)
	AC_MSG_WARN(=== and rerun the configure script.  If you have read)
	AC_MSG_WARN(=== the INSTALL file you should have known this.  So)
	AC_MSG_WARN(=== you better read INSTALL again, as well.)
	AC_MSG_ERROR(aborted.)
fi
fi

AC_CHECK_HEADER([pcre.h],
		[ : ],
		[

		AC_CHECK_HEADER([pcre/pcre.h],
				[ : ],
				[
						AC_MSG_ERROR(pcre.h not found - install PCRE from www.pcre.org)
				])
		]
)

if test x$prefix = xNONE
then
	prefix="/usr/lib/courier"
	ac_configure_args="$ac_configure_args --prefix=$prefix"
fi

if test x$exec_prefix = xNONE
then
	exec_prefix="$prefix"
fi

eval "libexecdir=$libexecdir"
eval "sysconfdir=$sysconfdir"
eval "localstatedir=$localstatedir"
eval "datadir=$datadir"

AC_ARG_WITH(makedatprog, [], ,
	ac_configure_args="$ac_configure_args --with-makedatprog=${libexecdir}/courier/makedatprog")

AC_ARG_WITH(piddir, [], ,
	ac_configure_args="$ac_configure_args --with-piddir=${localstatedir}/tmp")

AC_ARG_WITH(package, [], package="$withval",
	[
		package="$PACKAGE"
		ac_configure_args="$ac_configure_args --with-package=$PACKAGE --with-version=$VERSION"
	])

echo $version >version

AC_PATH_PROGS(COURIERAUTHCONFIG, courierauthconfig)

if test "$COURIERAUTHCONFIG" = ""
then
	hash='#'
	AC_MSG_WARN(=== Courier authentication library not found.)
	AC_MSG_WARN(=== You need to download and install)
	AC_MSG_WARN([=== http://www.courier-mta.org/download.php${hash}authlib first.])
	AC_MSG_WARN(=== If courier-authlib is installed in a non-default)
	AC_MSG_WARN([=== directory, set the COURIERAUTHCONFIG environment])
	AC_MSG_WARN(=== variable to the full path to the courierauthconfig)
	AC_MSG_WARN(=== binary and rerun this configure script.)
	AC_MSG_WARN([])
	AC_MSG_ERROR(courierauthconfig not found)
fi

$COURIERAUTHCONFIG --configfiles | sed 's/^/auth/' >configtmp
. ./configtmp
AC_ARG_WITH(courierlogger, [], : ,
			   [
			   ac_configure_args="$ac_configure_args --with-courierlogger=$authsbindir/courierlogger"])

if test `$COURIERAUTHCONFIG --version=0.61.0` = "no"
then
	AC_MSG_ERROR(Courier authentication library version 0.61 is required.)
fi

dnl Check whether we should use gdbm, or db.

needs_withdb=0

AC_ARG_WITH(db, [  --with-db=gdbm          Use the GDBM library.
  --with-db=db            Use the libdb.a library.],
	db="$withval", db=""; needs_withdb=1)

case "$db" in
gdbm)
	;;
db)
	;;
"")
	;;
*)
	AC_MSG_ERROR(Invalid --with-db option.)
	;;
esac

saveLIBS="$LIBS"

if test "$db" != "db"
then
	AC_CHECK_LIB(gdbm, gdbm_open, [ LIBGDBM=-lgdbm ; LIBS="-lgdbm $LIBS" ])
	AC_CHECK_FUNC(gdbm_open, [ HAVE_GDBM=y ])
fi

LIBS="$saveLIBS"

if test "$db" != "gdbm"
then
	AC_CHECK_LIB(db, dbopen, [ LIBDB=-ldb ; LIBS="-ldb $LIBS" ],
		[ AC_CHECK_LIB(db, db_open, [ LIBDB=-ldb ; LIBS="-ldb $LIBS"],
		[ AC_CHECK_LIB(db, db_env_create,
				[ LIBDB=-ldb; LIBS="-ldb $LIBS"]) ]
		)])

	AC_CHECK_FUNC(dbopen, HAVE_BDB=1)
	AC_CHECK_FUNC(db_open, HAVE_BDB=1)
	AC_CHECK_FUNC(db_env_create, HAVE_BDB=1)
fi

LIBS="$saveLIBS"

if test "$HAVE_GDBM$HAVE_BDB" = ""
then
	AC_MSG_ERROR(Cannot find either the gdbm or the db library.)
fi

USE_GDBM=0
USE_DB=0

if test "$HAVE_GDBM" = "y"
then
	USE_GDBM=1
	DBSUBDIR=gdbmobj
	if test "$needs_withdb" = 1
	then
		ac_configure_args="$ac_configure_args --with-db=gdbm"
	fi
	dblibrary=gdbmobj/libgdbmobj.la
else
	USE_DB=1
	DBSUBDIR=bdbobj
	if test "$needs_withdb" = 1
	then
		ac_configure_args="$ac_configure_args --with-db=db"
	fi
	dblibrary=bdbobj/libbdbobj.la
fi

AC_SUBST(DBSUBDIR)
AC_SUBST(USE_GDBM)
AC_SUBST(USE_DB)
AC_SUBST(LIBDB)
AC_SUBST(LIBGDBM)
AC_SUBST(dblibrary)

dnl
dnl Need to settle on our uid/gids here
dnl

changequote()

LB='['
RB=']'

changequote([,])

AC_ARG_WITH(mailuser,[],
	mailuser="$withval",
	[ mailuser="$authmailuser"
	ac_configure_args="$ac_configure_args --with-mailuser=$mailuser"]
	)

AC_ARG_WITH(mailgroup, [],
	mailgroup="$withval",
	[ mailgroup="$authmailgroup"
	ac_configure_args="$ac_configure_args --with-mailgroup=$mailgroup"]
	)

AC_ARG_WITH(mailuid,[],
	mailuid="$withval",
	[ mailuid="$authmailuid"
	ac_configure_args="$ac_configure_args --with-mailuid=$mailuid"]
	)

AC_ARG_WITH(mailgid, [],
	mailgid="$withval",
	[ mailgid="$authmailgid"
	ac_configure_args="$ac_configure_args --with-mailgid=$mailgid"]
	)

AC_SUBST(mailuser)
AC_SUBST(mailgroup)
AC_SUBST(mailuid)
AC_SUBST(mailgid)
rm -f configtmp

dnl for maildrop subdir

AC_ARG_ENABLE(trusted-groups,[], ,
	ac_configure_args="$ac_configure_args --enable-trusted-groups='$mailgroup'")

dnl for cgi subdir
AC_ARG_WITH(formdata, [], , ac_configure_args="$ac_configure_args --with-formdata")

#
# Unicode mess
#

AC_ARG_ENABLE(utf7-folder-encoding,
	[],
	[ utf7folder="$enableval"
	if test "$utf7folder" != "yes"
	then
		AC_MSG_ERROR(This option is no longer supported)
	fi
	] , [
	ac_configure_args="$ac_configure_args --enable-utf7-folder-encoding"
	utf7folder="yes"
	]
)

AC_PATH_PROG(GPG, gpg, /usr/bin/gpg, $LPATH)

AC_ARG_ENABLE(unicode,
	[],
	[
	unicode="$enableval"

	if test "$unicode" != "yes"
	then
		AC_MSG_ERROR(This option is no longer supported)
	fi
	],
	[
	ac_configure_args="$ac_configure_args --enable-unicode"
	unicode="yes"
	]
)

#
# Stick webadmin stuff here

AC_ARG_WITH(webadmindir, [] , ,
	ac_configure_args="$ac_configure_args --with-webadmindir=$datadir/courierwebadmin")

#
# autoconf bug
#

ac_given_INSTALL="$INSTALL"

#
# Get rid of internal arguments, save real arguments into configure.args

real_configure_args=""

for arg in $ac_configure_args
do
	case $arg in
	--with-courierlogger*)
		continue
		;;
	--with-makedatprog*)
		continue
		;;
	--with-webadmindir*)
		continue
		;;
	--with-piddir*)
		continue
		;;
	--with-package*)
		continue
		;;
	--with-version*)
		continue
		;;
	--enable-trusted-groups*)
		continue
		;;
	--with-formdata*)
		continue
		;;
	--with-mailuser*)
		;;
	--with-mailgroup*)
		;;
	--with-mailuid*)
		;;
	--with-mailgid*)
		;;
	*)
		real_configure_args="$real_configure_args $arg"
		;;
	esac
done

AC_ARG_WITH(repository, [], REPOSITORY="$withval")
AC_SUBST(REPOSITORY)

echo $real_configure_args >configure.args
AC_CONFIG_SUBDIRS(afx gdbmobj bdbobj cgi http11 numlib soxwrap md5 sha1 libhmac random128 unicode rfc822 rfc1035 rfc2045 liblock maildir waitlib threadlib makedat tcpd rootcerts imap maildrop ldapaddressbook gpglib pcp webmail webadmin courier)

AC_OUTPUT(Makefile courier.spec courier.lpspec dbobj.h dbobj.config courier.sysvinit)