aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac103
1 files changed, 46 insertions, 57 deletions
diff --git a/configure.ac b/configure.ac
index 354a80d0..d46aeae7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -173,6 +173,16 @@ AC_CHECK_HEADER([fts.h],
#include <sys/stat.h>
])
+need_libasr=no
+AC_CHECK_HEADER([asr.h],
+ [],
+ [need_libasr=yes],
+ [
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netdb.h>
+])
+AM_CONDITIONAL([NEED_LIBASR], [test x"$need_libasr" = x"yes"])
#
# CHECKS FOR TYPES
@@ -466,6 +476,20 @@ AC_SEARCH_LIBS([fparseln],
[Define if you have the fparseln() function.])
])
+AC_SEARCH_LIBS([res_hnok],
+ [resolv],
+ [
+ AC_DEFINE([HAVE_RES_HNOK], [1],
+ [Define if you have the res_hnok() function.])
+ ])
+
+AC_SEARCH_LIBS([res_randomid],
+ [resolv],
+ [
+ AC_DEFINE([HAVE_RES_RANDOMID], [1],
+ [Define if you have the res_randomid() function.])
+ ])
+
AC_SEARCH_LIBS([res_9_b64_ntop],
[resolv],
[
@@ -526,7 +550,7 @@ AC_SEARCH_LIBS([event_asr_run],
[event],
[
AC_DEFINE([HAVE_EVENT_ASR_RUN], [1],
- [Define if you have the basename() function.])
+ [Define if you have the event_asr_run() function.])
])
AC_CHECK_FUNCS([ \
@@ -563,11 +587,13 @@ AC_CHECK_FUNCS([ \
memmove \
nanosleep \
nsleep \
+ pipe2 \
pidfile \
pledge \
reallocarray \
recallocarray \
res_hnok \
+ res_randomid \
setenv \
seteuid \
setegid \
@@ -864,7 +890,6 @@ fi
#l432 (customized)
# Check for some target-specific stuff
-ASR_LIB=-lasr
case "$host" in
*-*-darwin*)
@@ -894,6 +919,7 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
supported by bsd-setproctitle.c])
AC_DEFINE([BROKEN_STRNVIS], [1],
[OSX strnvis argument order is swapped compared to OpenBSD])
+ BROKEN_STRNVIS=1
;;
*-*-dragonfly*)
;;
@@ -908,11 +934,13 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
fi
AC_DEFINE([BROKEN_STRNVIS], [1],
[NetBSD strnvis argument order is swapped compared to OpenBSD])
+ BROKEN_STRNVIS=1
;;
*-*-freebsd*)
AC_DEFINE([BROKEN_GLOB], [1], [FreeBSD glob does not do what we need])
AC_DEFINE([BROKEN_STRNVIS], [1],
[FreeBSD strnvis argument order is swapped compared to OpenBSD])
+ BROKEN_STRNVIS=1
;;
*-*-openbsd*)
use_pie=auto
@@ -921,6 +949,7 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
AC_DEFINE([BROKEN_STRNVIS], [0],
[FreeBSD strnvis argument order is swapped compared to OpenBSD])
+ BROKEN_STRNVIS=0
YACC='yacc'
ASR_LIB=
AC_DEFINE([NOOP_ASR_FREEADDRINFO], [0], [OpenBSD doesn't need ASR_FREEADDRINFO])
@@ -1615,61 +1644,6 @@ AC_EXEEXT
#l4757
-# Search for asr (based on zlib checks)
-dnl asr is required
-AC_ARG_WITH([libasr],
- [ --with-libasr=PATH Specify path to libasr installation],
- [ if test "x$withval" = "xno"; then
- AC_MSG_ERROR([*** asr is required ***])
- elif test "x$withval" != "xyes"; then
- if test -d "$withval/lib"; then
- if test -n "${need_dash_r}"; then
- LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
- else
- LDFLAGS="-L${withval}/lib ${LDFLAGS}"
- fi
- else
- if test -n "${need_dash_r}"; then
- LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
- else
- LDFLAGS="-L${withval} ${LDFLAGS}"
- fi
- fi
- if test -d "$withval/include"; then
- CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
- else
- CPPFLAGS="-I${withval} ${CPPFLAGS}"
- fi
- fi ]
-)
-
-AC_CHECK_HEADER([asr.h], ,[AC_MSG_ERROR([*** asr.h missing - please install libasr ***])],
-[#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>])
-AC_CHECK_LIB([asr], [asr_run], ,
- [
- saved_CPPFLAGS="$CPPFLAGS"
- saved_LDFLAGS="$LDFLAGS"
- save_LIBS="$LIBS"
- dnl Check default asr install dir
- if test -n "${need_dash_r}"; then
- LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}"
- else
- LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}"
- fi
- CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
-# don't add -lasr to LIBS, it's only added when needed
-# LIBS="$LIBS -lasr"
- AC_TRY_LINK_FUNC([asr_run], ,
- [
- AC_MSG_ERROR([*** libasr missing - please install first or check config.log ***])
- ]
- )
- ]
-)
-
-
# Search for fts
AC_ARG_WITH([libfts],
[ --with-libfts=PATH Specify path to libfts installation (default: none, part of libc)],
@@ -2007,6 +1981,12 @@ AM_CONDITIONAL([HAVE_DB_API], [test "x$use_db_api" = "x1"])
AM_COND_IF([HAVE_DB_API], [AC_DEFINE([HAVE_DB_API], [1], [Define to 1 if HAVE_DB_API])])
+
+if test "$need_libasr" = "no" -a "x$ac_cv_search_event_asr_run" = "xno"; then
+ LIBS="$LIBS -lasr"
+fi
+
+
LIBS="$LIBS ${SMTPDLIBS}"
##end of chl
@@ -2035,6 +2015,7 @@ AM_CONDITIONAL([NEED_GETOPT], [test "x$ac_cv_func_getopt" != "xyes"])
AM_CONDITIONAL([NEED_GETPEEREID], [test "x$ac_cv_func_getpeereid" != "xyes"])
AM_CONDITIONAL([NEED_NANOSLEEP], [test "x$ac_cv_func_nanosleep" != "xyes"])
AM_CONDITIONAL([NEED_PIDFILE], [test "x$ac_cv_func_pidfile" != "xyes"])
+AM_CONDITIONAL([NEED_PIPE2], [test "x$ac_cv_func_pipe2" != "xyes"])
AM_CONDITIONAL([NEED_REALLOCARRAY], [test "x$ac_cv_func_reallocarray" != "xyes"])
AM_CONDITIONAL([NEED_RECALLOCARRAY], [test "x$ac_cv_func_recallocarray" != "xyes"])
AM_CONDITIONAL([NEED_SETPROCTITLE], [test "x$ac_cv_func_setproctitle" != "xyes"])
@@ -2055,6 +2036,9 @@ AM_CONDITIONAL([NEED_WAITPID], [test "x$ac_cv_func_waitpid" != "xyes"])
AM_CONDITIONAL([NEED_VIS], [test "x$ac_cv_func_strnvis" != "xyes" -o "x$BROKEN_STRNVIS" = "x1"])
AM_CONDITIONAL([NEED_USLEEP], [test "x$ac_cv_func_usleep" != "xyes"])
+AM_CONDITIONAL([NEED_RES_HNOK], [test "x$ac_cv_search_res_hnok" = "xno" -a x"$ac_cv_func_res_hnok" != "xyes" -a x"$need_libasr" = x"yes"])
+AM_CONDITIONAL([NEED_RES_RANDOMID], [test "x$ac_cv_search_res_randomid" = "xno" -a x"$ac_cv_func_res_randomid" != "xyes" -a x"$need_libasr" = x"yes"])
+
AM_CONDITIONAL([NEED_ARC4RANDOM], [test "x$ac_cv_func_arc4random" != "xyes" -a "x$ac_cv_have_decl_LIBRESSL_VERSION_NUMBER" != "xyes"])
AM_CONDITIONAL([NEED_SSL_CTX_USE_CERTIFICATE_CHAIN_MEM], [test "x$ac_cv_have_decl_LIBRESSL_VERSION_NUMBER" != "xyes"])
@@ -2062,6 +2046,10 @@ AM_CONDITIONAL([NEED_PROGNAME], [test "x$ac_cv_libc_defines___progname" != "xyes
##
+AM_COND_IF([NEED_PROGNAME], [AC_DEFINE([NEED_PROGNAME], [1], [Define to 1 if NEED_PROGNAME])])
+AM_COND_IF([NEED_SETPROCTITLE], [AC_DEFINE([NEED_SETPROCTITLE], [1], [Define to 1 if NEED_SETPROCTITLE])])
+
+
AC_CONFIG_FILES([Makefile
openbsd-compat/Makefile
mk/Makefile
@@ -2076,6 +2064,7 @@ AC_CONFIG_FILES([Makefile
contrib/Makefile
contrib/libexec/Makefile
contrib/libexec/mail.local/Makefile
+ contrib/libexec/lockspool/Makefile
contrib/libexec/encrypt/Makefile
])