masqmail

diff configure.ac @ 0:08114f7dcc23

this is masqmail-0.2.21 from oliver kurth
author meillo@marmaro.de
date Fri, 26 Sep 2008 17:05:23 +0200
parents
children af25f5c39d90
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/configure.ac	Fri Sep 26 17:05:23 2008 +0200
     1.3 @@ -0,0 +1,289 @@
     1.4 +dnl Process this file with autoconf to produce a configure script.
     1.5 +
     1.6 +AC_PREREQ(2.59)
     1.7 +AC_INIT(masqmail, 0.2.21, oku@debian.org)
     1.8 +AC_CONFIG_SRCDIR([src/masqmail.c])
     1.9 +AM_CONFIG_HEADER(config.h)
    1.10 +AM_INIT_AUTOMAKE()
    1.11 +
    1.12 +AC_PREFIX_DEFAULT(/usr)
    1.13 +
    1.14 +dnl Checks for programs.
    1.15 +
    1.16 +dnl Checks for libraries.
    1.17 +
    1.18 +AC_PROG_CC
    1.19 +AC_ISC_POSIX
    1.20 +AC_STDC_HEADERS
    1.21 +dnl AC_ARG_PROGRAM
    1.22 +AC_PROG_RANLIB
    1.23 +
    1.24 +PKG_CHECK_MODULES(GLIB, glib-2.0)
    1.25 +AC_SUBST(GLIB_LIBS)
    1.26 +AC_SUBST(GLIB_CFLAGS)
    1.27 +
    1.28 +dnl resolver support (default is use it)
    1.29 +AC_ARG_ENABLE(resolver,
    1.30 +	[  --disable-resolver       disable resolver support],
    1.31 +	if test "$enable_resolver" != 'no'; then
    1.32 +		resolver_enabled='yes'
    1.33 +	fi,
    1.34 +	resolver_enabled='yes'
    1.35 +	)
    1.36 +
    1.37 +if test "$resolver_enabled" = yes; then
    1.38 +	AC_DEFINE(ENABLE_RESOLVER, 1, [If the resolver is to be used])
    1.39 +dnl checks necessary for libc5:
    1.40 +dnl if there is res_search in libc, it is probably libc5
    1.41 +dnl if not, it is probably libc6 and we need libresolv
    1.42 +	AC_CHECK_LIB(c, res_search, need_resolv=no, need_resolv=yes)
    1.43 +	if test "$need_resolv" = yes; then
    1.44 +		AC_CHECK_LIB(resolv, res_search,has_resolv=yes,AC_MSG_ERROR("no libresolv"))
    1.45 +		RESOLV_LIBS='-lresolv'
    1.46 +	else
    1.47 +		RESOLV_LIBS=''
    1.48 +	fi
    1.49 +else
    1.50 +	RESOLV_LIBS=''
    1.51 +fi
    1.52 +AC_SUBST(RESOLV_LIBS)
    1.53 +
    1.54 +dnl if there is no getline, we define it using getdelim in src/masqmail.h
    1.55 +AC_CHECK_FUNCS(getline)
    1.56 +
    1.57 +dnl if there is no fdatasync, we define it to fsync in src/masqmail.h
    1.58 +AC_CHECK_FUNCS(fdatasync)
    1.59 +
    1.60 +dnl Checks for header files.
    1.61 +AC_HEADER_STDC
    1.62 +AC_CHECK_HEADERS(fcntl.h sys/time.h syslog.h unistd.h)
    1.63 +
    1.64 +dnl Checks for typedefs, structures, and compiler characteristics.
    1.65 +AC_C_CONST
    1.66 +AC_TYPE_PID_T
    1.67 +AC_TYPE_SIZE_T
    1.68 +AC_HEADER_TIME
    1.69 +AC_STRUCT_TM
    1.70 +
    1.71 +dnl Checks for library functions.
    1.72 +AC_FUNC_FNMATCH
    1.73 +AC_TYPE_SIGNAL
    1.74 +AC_FUNC_STRFTIME
    1.75 +AC_FUNC_VPRINTF
    1.76 +AC_CHECK_FUNCS(select socket strerror strstr)
    1.77 +
    1.78 +dnl user and group configuration
    1.79 +AC_ARG_WITH(user,
    1.80 +	[  --with-user=USER         set user [mail]],
    1.81 +	)
    1.82 +if test "x$with_user" = 'x'; then
    1.83 +	with_user='mail'
    1.84 +fi
    1.85 +
    1.86 +AC_ARG_WITH(group,
    1.87 +	[  --with-group=GROUP       set group [trusted]],
    1.88 +	)
    1.89 +if test "x$with_group" = 'x'; then
    1.90 +	with_group='trusted'
    1.91 +fi
    1.92 +
    1.93 +dnl debugging support (default is use it)
    1.94 +AC_ARG_ENABLE(debug,
    1.95 +	[  --disable-debug          disable debugging],
    1.96 +	if test "x$enable_debug" != 'xno'; then
    1.97 +		debug_enabled='yes'
    1.98 +	fi,
    1.99 +	debug_enabled='yes'
   1.100 +	)
   1.101 +if test "x$debug_enabled" = xyes; then
   1.102 +	AC_DEFINE(ENABLE_DEBUG, 1, [If debugging is enabled])
   1.103 +fi
   1.104 +
   1.105 +AC_DEFINE_UNQUOTED(DEF_MAIL_USER, "${with_user}", [The mail user])
   1.106 +AC_SUBST(with_user)
   1.107 +AC_DEFINE_UNQUOTED(DEF_MAIL_GROUP, "${with_group}", [The mail group])
   1.108 +AC_SUBST(with_group)
   1.109 +
   1.110 +dnl link glib statically?
   1.111 +AC_ARG_WITH(glib_static,
   1.112 +	[  --with-glib-static=path  link glib statically (path mandatory!)],
   1.113 +	)
   1.114 +if test "x$with_glib_static" != 'x'; then
   1.115 +	GLIB_LIBS=$with_glib_static
   1.116 +	AC_SUBST(GLIB_LIBS)
   1.117 +fi
   1.118 +
   1.119 +dnl optional features
   1.120 +MD5_LIBS=''
   1.121 +BASE64_LIBS=''
   1.122 +
   1.123 +dnl smtp server support (default is use it)
   1.124 +AC_ARG_ENABLE(smtp_server,
   1.125 +	[  --disable-smtp-server    disable smtp server support],
   1.126 +	if test "x$enable_smtp_server" != 'xno'; then
   1.127 +		smtp_server_enabled='yes'
   1.128 +	fi,
   1.129 +	smtp_server_enabled='yes'
   1.130 +	)
   1.131 +if test "x$smtp_server_enabled" = xyes; then
   1.132 +	AC_DEFINE(ENABLE_SMTP_SERVER, 1, [If the SMTP server is enabled])
   1.133 +fi
   1.134 +
   1.135 +dnl pop support (default is use it)
   1.136 +AC_ARG_ENABLE(pop3,
   1.137 +	[  --disable-pop3           disable pop3 support],
   1.138 +	if test "x$enable_pop3" != 'xno'; then
   1.139 +		pop3_enabled='yes'
   1.140 +	fi,
   1.141 +	pop3_enabled='yes'
   1.142 +	)
   1.143 +if test "x$pop3_enabled" = xyes; then
   1.144 +	AC_DEFINE(ENABLE_POP3, 1, [If the POP3 support is enabled])
   1.145 +#	MD5_LIBS='md5/libmd5c.a'
   1.146 +	need_md5='yes'
   1.147 +fi
   1.148 +
   1.149 +dnl auth support (default is to not use it)
   1.150 +AC_ARG_ENABLE(auth,
   1.151 +	[  --enable-auth            enable AUTH (RFC 2554) client support],
   1.152 +	if test "x$enable_auth" != 'xno'; then
   1.153 +		auth_enabled='yes'
   1.154 +	fi,
   1.155 +	)
   1.156 +if test "x$auth_enabled" = xyes; then
   1.157 +	AC_DEFINE(ENABLE_AUTH, 1, [If AUTH is enabled])
   1.158 +	BASE64_LIBS='base64/libbase64.a'
   1.159 +#	MD5_LIBS='md5/libmd5c.a'
   1.160 +	need_md5='yes'
   1.161 +fi
   1.162 +AC_SUBST(BASE64_LIBS)
   1.163 +
   1.164 +dnl maildir support (default is to not use it)
   1.165 +AC_ARG_ENABLE(maildir,
   1.166 +	[  --enable-maildir            enable qmail style maildir support],
   1.167 +	if test "x$enable_maildir" != 'xno'; then
   1.168 +		maildir_enabled='yes'
   1.169 +	fi,
   1.170 +	)
   1.171 +if test "x$maildir_enabled" = xyes; then
   1.172 +	AC_DEFINE(ENABLE_MAILDIR, 1, [If Maildirs are enabled])
   1.173 +fi
   1.174 +
   1.175 +dnl libcrypto
   1.176 +AC_ARG_WITH(libcrypto,
   1.177 +	[  --with-libcrypto         use libcrypto],
   1.178 +	)
   1.179 +if test "x$with_libcrypto" != 'xyes'; then
   1.180 +	with_libcrypto='no'
   1.181 +fi
   1.182 +
   1.183 +if test "x$need_md5" = 'xyes'; then
   1.184 +dnl check whether we have md5 in libcrypto if md5 needed and we shall link with libcrypto
   1.185 +	if test "x$with_libcrypto" = "xyes"; then
   1.186 +		AC_CHECK_LIB(crypto, MD5, has_crypto='yes', AC_MSG_ERROR('no libcrypto'))
   1.187 +		if test "x$has_crypto" = 'xyes'; then
   1.188 +			AC_DEFINE(USE_LIB_CRYPTO, 1, [If libcrypto is available])
   1.189 +			MD5_LIBS='-lcrypto'
   1.190 +		fi
   1.191 +	else
   1.192 +		MD5_LIBS='md5/libmd5c.a'
   1.193 +	fi
   1.194 +fi
   1.195 +AC_SUBST(MD5_LIBS)
   1.196 +
   1.197 +dnl ident support (default is to not use it)
   1.198 +IDENT_LIBS=''
   1.199 +AC_ARG_ENABLE(ident,
   1.200 +	[  --enable-ident           enable ident (RFC 1413) support],
   1.201 +	if test "x$enable_ident" != 'xno'; then
   1.202 +		ident_enabled='yes'
   1.203 +	fi,
   1.204 +	)
   1.205 +AC_SUBST(has_ident)
   1.206 +if test "x$ident_enabled" = xyes; then
   1.207 +	AC_DEFINE(ENABLE_IDENT, 1, [If ident is enabled])
   1.208 +	AC_CHECK_LIB(ident, ident_id, IDENT_LIBS='-lident', IDENT_LIBS='libident/libident.a')
   1.209 +fi
   1.210 +AC_SUBST(IDENT_LIBS)
   1.211 +
   1.212 +dnl mserver support (default is to not use it)
   1.213 +AC_ARG_ENABLE(mserver,
   1.214 +	[  --enable-mserver         enable mserver support],
   1.215 +	if test "x$enable_mserver" != 'xno'; then
   1.216 +		mserver_enabled='yes'
   1.217 +	fi,
   1.218 +	)
   1.219 +if test "x$mserver_enabled" = xyes; then
   1.220 +	AC_DEFINE(ENABLE_MSERVER, 1, [If mserver support is enabled])
   1.221 +fi
   1.222 +
   1.223 +dnl liblockfile
   1.224 +AC_ARG_WITH(liblockfile,
   1.225 +	[  --with-liblockfile       use liblock (for Debian)],
   1.226 +	)
   1.227 +if test "x$with_liblockfile" != 'x'; then
   1.228 +	with_liblockfile='yes'
   1.229 +fi
   1.230 +if test "x$with_liblockfile" = xyes; then
   1.231 +	AC_CHECK_LIB(lockfile, maillock, has_lockfile=yes, AC_MSG_ERROR("no liblockfile"))
   1.232 +	LOCKFILE_LIBS='-llockfile'
   1.233 +	AC_DEFINE(USE_LIBLOCKFILE, 1, [If liblockfile is to be used])
   1.234 +else
   1.235 +	LOCKFILE_LIBS=''
   1.236 +fi
   1.237 +AC_SUBST(LOCKFILE_LIBS)
   1.238 +AC_SUBST(USE_LIBLOCKFILE)
   1.239 +
   1.240 +dnl log and spool directories
   1.241 +AC_ARG_WITH(logdir,
   1.242 +	[  --with-logdir=DIR        set log directory [/var/masqmail]],
   1.243 +	,
   1.244 +        with_logdir='/var/log/masqmail/'
   1.245 +	)
   1.246 +AC_SUBST(with_logdir)
   1.247 +
   1.248 +AC_ARG_WITH(spooldir,
   1.249 +	[  --with-spooldir=DIR      set spool directory [/var/spool/masqmail]],
   1.250 +	,
   1.251 +	with_spooldir='/var/spool/masqmail/'
   1.252 +	)
   1.253 +AC_SUBST(with_spooldir)
   1.254 +
   1.255 +dnl configuration file
   1.256 +AC_ARG_WITH(confdir,
   1.257 +	[  --with-confdir           directory for configuration [/etc/masqmail]],
   1.258 +	,
   1.259 +	with_confdir='/etc/masqmail'
   1.260 +	)
   1.261 +AC_DEFINE_UNQUOTED(CONF_DIR, "${with_confdir}", [The configuration file location])
   1.262 +AC_SUBST(with_confdir)
   1.263 +
   1.264 +dnl well, /me/ thought that autoconf should make things _easy_ ...
   1.265 +test "x$prefix" = xNONE && prefix="$ac_default_prefix"
   1.266 +AC_DEFINE_UNQUOTED(DATA_DIR, "`eval echo \""$datadir"\"`/masqmail", [The data directory])
   1.267 +
   1.268 +dnl gymnastics to get the correct path where masqmail should be installed
   1.269 +dnl we need this to call ourselves in failmsg.c
   1.270 +if test "x${exec_prefix}" != 'xNONE'; then
   1.271 +	AC_DEFINE_UNQUOTED(SBINDIR, "${exec_prefix}/sbin", [The sbin directory])
   1.272 +else
   1.273 +	if test "x${prefix}" != 'xNONE'; then
   1.274 +		AC_DEFINE_UNQUOTED(SBINDIR, "${prefix}/sbin")
   1.275 +	else
   1.276 +		AC_DEFINE_UNQUOTED(SBINDIR, "/usr/sbin")
   1.277 +	fi
   1.278 +fi
   1.279 +
   1.280 +AC_OUTPUT(Makefile \
   1.281 +	debian/Makefile \
   1.282 +	docs/Makefile \
   1.283 +	docs/man/Makefile \
   1.284 +	docs/xml/Makefile \
   1.285 +	tests/Makefile \
   1.286 +	src/Makefile \
   1.287 +	src/base64/Makefile \
   1.288 +	src/md5/Makefile \
   1.289 +	src/libident/Makefile \
   1.290 +	suse/masqmail.spec \
   1.291 +	redhat/masqmail.spec
   1.292 +	)