File: configure.ac

package info (click to toggle)
courier 1.0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 49,084 kB
  • sloc: ansic: 126,176; cpp: 24,278; sh: 8,957; perl: 4,127; makefile: 3,192; sed: 16
file content (374 lines) | stat: -rw-r--r-- 8,916 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
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
dnl Process this file with autoconf to produce a configure script.
dnl
dnl Copyright 1998 - 2018 Double Precision, Inc.  See COPYING for
dnl distribution information.

AC_PREREQ(2.59)

AC_INIT(courier, 1.0.6, [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_CONFIG_MACRO_DIRS([m4])
AC_PROG_SYSCONFTOOL
AC_PATH_PROGS(SETENV, env)
AX_COURIER_UNICODE_VERSION
AC_ARG_ENABLE(root-check, [  --disable-root-check    Allow build as root (make check will fail)],
	rootcheck="$enableval",
	rootcheck="yes")
AC_ARG_WITH(notice,[AS_HELP_STRING([--with-notice=unicode],
[The --with-notice=unicode option is required, and indicates that you
are aware of the instructions in INSTALL for upgrading to this
version])], [notice="$withval"], [])

case "$notice" in
unicode)
	;;
*)
	AC_MSG_ERROR([
************************************************************************
Please rerun configure and add the

      --with-notice=unicode

option.

This indicates that you've read the instructions in INSTALL about
updating from earlier versions; specifically the need to convert any
existing maildirs to a Unicode naming scheme, and the need to update
any other Courier packages together with updating this one.

If you are building RPMs directly using the spec file from the source
tarball, add a

      --define 'notice_option --with-notice=unicode'

option to the rpmbuild command:

$ rpmbuild -ta --define 'notice_option --with-notice=unicode'

This message is only meant to make sure you are aware of the contents
of INSTALL about updating from earlier versions, and the need for
manual steps to update any existing maildirs.

If you are installing for the first time, you can simply rerun configure
with this option.
************************************************************************])
	;;
esac

if test "$rootcheck" = "yes"
then
if test `id -u` = 0
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(certsdir, [ --with-certsdir Directory where certs are created ],
		      certsdir="$withval", certsdir=$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.65.0.20130910` = "no"
then
	AC_MSG_ERROR(Courier authentication library version 0.66 is required.)
fi

PKG_CHECK_MODULES(LIBIDN, libidn >= 0.0.0, [libidn=yes], [libidn=no])
if test "$libidn" != "yes"
then
	AC_MSG_ERROR([libidn not found])
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=libs/gdbmobj
	if test "$needs_withdb" = 1
	then
		ac_configure_args="$ac_configure_args --with-db=gdbm"
	fi
	dblibrary=libs/gdbmobj/libgdbmobj.la
else
	USE_DB=1
	DBSUBDIR=libs/bdbobj
	if test "$needs_withdb" = 1
	then
		ac_configure_args="$ac_configure_args --with-db=db"
	fi
	dblibrary=libs/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_PROGS(GPG, gpg gpg2, /usr/bin/gpg, $LPATH)

#
# 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 libs/gdbmobj libs/bdbobj libs/cgi libs/http11 libs/numlib libs/soxwrap libs/md5 libs/sha1 libs/libhmac libs/random128 libs/rfc822 libs/rfc1035 libs/rfc2045 libs/liblock libs/maildir libs/waitlib libs/threadlib libs/makedat libs/tcpd libs/rootcerts libs/imap libs/maildrop libs/ldapaddressbook libs/gpglib libs/pcp libs/sqwebmail webadmin courier)

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