summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac129
1 files changed, 51 insertions, 78 deletions
diff --git a/configure.ac b/configure.ac
index f49f7b34..6d730003 100644
--- a/configure.ac
+++ b/configure.ac
@@ -122,18 +122,16 @@ AC_CHECK_HEADERS([\
sys/uio.h \
sys/un.h \
syslog.h \
- uuid/uuid.h \
])
dnl Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
-AC_CHECK_MEMBER([struct tm.tm_gmtoff],
- [AC_DEFINE([HAVE_STRUCT_TM_GMTOFF], [1], [gmtoff in struct tm])],
+AC_CHECK_MEMBERS([struct tm.tm_gmtoff],
+ [], dnl defines HAVE_STRUCT_TM_TM_GMTOFF
[],
[#include <time.h>]
)
@@ -160,11 +158,7 @@ dnl need dlopen/-ldl to load plugins (when not on windows)
save_LIBS=$LIBS
LIBS=
AC_SEARCH_LIBS([dlopen], [dl], [
- AC_CHECK_HEADERS([dlfcn.h], [
- DL_LIB=$LIBS
- AC_DEFINE([HAVE_LIBDL], [1], [libdl])
- AC_DEFINE([HAVE_DLFCN_H], [1])
- ])
+ AC_CHECK_HEADERS([dlfcn.h], [DL_LIB=$LIBS])
])
LIBS=$save_LIBS
AC_SUBST([DL_LIB])
@@ -198,7 +192,7 @@ if test "$WITH_LIBEV" != no; then
LIBEV_CFLAGS="-I$WITH_LIBEV/include"
LIBEV_LIBS="-L$WITH_LIBEV/lib -lev"
else
- AC_CHECK_HEADERS([ev.h],
+ AC_CHECK_HEADER([ev.h],
[AC_CHECK_LIB([ev], [ev_time],
[
LIBEV_CFLAGS=
@@ -211,7 +205,7 @@ if test "$WITH_LIBEV" != no; then
fi
])
- AC_DEFINE([HAVE_LIBEV], [1], [libev support])
+ AC_DEFINE([WITH_LIBEV], [1], [libev])
fi
AC_SUBST([LIBEV_CFLAGS])
@@ -259,7 +253,7 @@ if test "$WITH_MYSQL" != no; then
AC_MSG_CHECKING([for MySQL libraries at])
AC_MSG_RESULT([$MYSQL_LIBS])
- AC_DEFINE([HAVE_MYSQL], [1], [mysql support])
+ AC_DEFINE([WITH_MYSQL], [1], [mysql])
fi
AM_CONDITIONAL([BUILD_WITH_MYSQL], [test "$WITH_MYSQL" != no])
@@ -304,7 +298,7 @@ if test "$WITH_PGSQL" != no; then
AC_MSG_CHECKING([for PgSQL libraries at])
AC_MSG_RESULT([$PGSQL_LIBS])
- AC_DEFINE([HAVE_PGSQL], [1], [pgsql support])
+ AC_DEFINE([WITH_PGSQL], [1], [pgsql])
fi
AM_CONDITIONAL([BUILD_WITH_PGSQL], [test "$WITH_PGSQL" != no])
@@ -331,7 +325,7 @@ if test "$WITH_DBI" != no; then
DBI_CFLAGS="-I$WITH_LIBDBI/include"
DBI_LIBS="-L$WITH_LIBDBI/lib -ldbi"
else
- AC_CHECK_HEADERS([dbi/dbi.h],
+ AC_CHECK_HEADER([dbi/dbi.h],
[AC_CHECK_LIB([dbi], [dbi_version],
[
DBI_CFLAGS=
@@ -343,7 +337,7 @@ if test "$WITH_DBI" != no; then
)
fi
- AC_DEFINE([HAVE_DBI], [1], [LibDBI support])
+ AC_DEFINE([WITH_DBI], [1], [LibDBI support])
fi
AM_CONDITIONAL([BUILD_WITH_DBI], [test "$WITH_DBI" != no])
@@ -363,30 +357,20 @@ AC_MSG_RESULT([$WITH_LDAP])
if test "$WITH_LDAP" != no; then
AC_CHECK_LIB([ldap], [ldap_bind],
- [AC_CHECK_HEADERS([ldap.h],
- [
- LDAP_LIB=-lldap
- AC_DEFINE([HAVE_LIBLDAP], [1], [libldap])
- AC_DEFINE([HAVE_LDAP_H], [1])
- AC_DEFINE([LDAP_DEPRECATED], [1], [Using deprecated ldap api])
- ],
+ [AC_CHECK_HEADER([ldap.h], [LDAP_LIB=-lldap],
[AC_MSG_ERROR([ldap headers not found, install them or build without --with-ldap])]
)],
[AC_MSG_ERROR([ldap library not found, install it or build without --with-ldap])]
)
AC_SUBST([LDAP_LIB])
AC_CHECK_LIB([lber], [ber_printf],
- [AC_CHECK_HEADERS([lber.h],
- [
- LBER_LIB=-llber
- AC_DEFINE([HAVE_LIBLBER], [1], [liblber])
- AC_DEFINE([HAVE_LBER_H], [1])
- ],
+ [AC_CHECK_HEADER([lber.h], [LBER_LIB=-llber],
[AC_MSG_ERROR([lber headers not found, install them or build without --with-ldap])]
)],
[AC_MSG_ERROR([lber library not found, install it or build without --with-ldap])]
)
AC_SUBST([LBER_LIB])
+ AC_DEFINE([WITH_LDAP], [1], [LDAP])
fi
AM_CONDITIONAL([BUILD_WITH_LDAP], [test "$WITH_LDAP" != no])
@@ -404,10 +388,9 @@ if test "$WITH_ATTR" != no; then
have_xattr=no
# libattr (linux only?)
AC_CHECK_LIB([attr], [attr_get], [
- AC_CHECK_HEADERS([attr/attributes.h], [
+ AC_CHECK_HEADER([attr/attributes.h], [
ATTR_LIB=-lattr
- AC_DEFINE([HAVE_XATTR], [1], [libattr])
- AC_DEFINE([HAVE_ATTR_ATTRIBUTES_H], [1])
+ AC_DEFINE([HAVE_LIBATTR], [1], [libattr])
have_xattr=yes
])
])
@@ -415,9 +398,8 @@ if test "$WITH_ATTR" != no; then
# (Free)BSD extattr
AC_CHECK_FUNC([extattr_get_file], [
- AC_CHECK_HEADERS([sys/extattr.h], [
+ AC_CHECK_HEADER([sys/extattr.h], [
AC_DEFINE([HAVE_EXTATTR], [1], [BSD extended attributes])
- AC_DEFINE([HAVE_SYS_EXTATTR_H], [1])
have_xattr=yes
])
])
@@ -425,6 +407,7 @@ if test "$WITH_ATTR" != no; then
if test "$have_xattr" = no; then
AC_MSG_ERROR([no backend found implementing extended attributes])
fi
+ AC_DEFINE([WITH_XATTR], [1], [xattr])
fi
dnl Check for valgrind
@@ -440,9 +423,10 @@ AC_ARG_WITH([valgrind],
AC_MSG_RESULT([$WITH_VALGRIND])
if test "$WITH_VALGRIND" != no; then
- AC_CHECK_HEADERS([valgrind/valgrind.h], [], [
+ AC_CHECK_HEADER([valgrind/valgrind.h], [], [
AC_MSG_ERROR([valgrind headers not found. install them or build without --with-valgrind])
])
+ AC_DEFINE([WITH_VALGRIND], [1], [valgrind])
fi
dnl Checking for libunwind
@@ -461,7 +445,7 @@ if test "$WITH_LIBUNWIND" != no; then
PKG_CHECK_MODULES([LIBUNWIND], [libunwind], [], [
AC_MSG_ERROR([libunwind not found. install it or build without --with-libunwind])
])
- AC_DEFINE([HAVE_LIBUNWIND], [1], [Have libunwind support])
+ AC_DEFINE([WITH_LIBUNWIND], [1], [libunwind])
fi
dnl Checking for kerberos5
@@ -512,10 +496,9 @@ if test "$WITH_KRB5" != no; then
LDFLAGS="${LDFLAGS}${krb5_append_LDFLAGS}"
AC_CHECK_LIB([gssapi_krb5], [gss_acquire_cred],
- [AC_CHECK_HEADERS([gssapi/gssapi_krb5.h],
+ [AC_CHECK_HEADER([gssapi/gssapi_krb5.h],
[
KRB5_LIB="-lkrb5 -lgssapi_krb5"
- AC_DEFINE([HAVE_KRB5], [1], [libgssapi_krb5])
],
[AC_MSG_ERROR([gssapi_krb5 headers were not found, install them or build without --with-krb5])]
)],
@@ -525,6 +508,8 @@ if test "$WITH_KRB5" != no; then
*darwin*|*cygwin* ) KRB5_LIB="$KRB5_LIB -lcom_err" ;;
* ) ;;
esac
+
+ AC_DEFINE([WITH_KRB5], [1], [krb5])
fi
AM_CONDITIONAL([BUILD_WITH_KRB5], [test "$WITH_KRB5" != no])
@@ -578,27 +563,24 @@ AC_ARG_WITH([openssl-libs],
AM_CONDITIONAL([BUILD_WITH_OPENSSL], [test "$WITH_OPENSSL" != no])
if test "$WITH_OPENSSL" != no; then
- if test "$WITH_KRB5" != no; then
- AC_DEFINE([USE_OPENSSL_KERBEROS], [1], [with kerberos])
- fi
-
CPPFLAGS="${CPPFLAGS}${openssl_append_CPPFLAGS}"
LDFLAGS="${LDFLAGS}${openssl_append_LDFLAGS}"
- AC_CHECK_HEADERS([openssl/ssl.h], [], [
+ AC_CHECK_HEADER([openssl/ssl.h], [], [
AC_MSG_ERROR([openssl headers not found. install them or build without --with-openssl])
])
+
AC_CHECK_LIB([crypto], [BIO_f_base64],
[CRYPTO_LIB="-lcrypto"],
[AC_MSG_ERROR([openssl crypto library not found. install it or build without --with-openssl])]
)
AC_CHECK_LIB([ssl], [SSL_new],
[SSL_LIB="-lssl -lcrypto"],
- [AC_MSG_ERROR([openssl ssl library not found. install it or build without --with-openssl])],
+ [AC_MSG_ERROR([openssl ssl library not found. install it or build without --with-openssl])]
[ -lcrypto "$DL_LIB" ]
)
- AC_DEFINE([HAVE_LIBSSL], [], [Have libssl])
+ AC_DEFINE([WITH_OPENSSL], [], [openssl])
AC_SUBST([SSL_LIB])
AC_SUBST([CRYPTO_LIB])
fi
@@ -629,8 +611,7 @@ if test "$WITH_PCRE" != no; then
AC_MSG_ERROR([pcre-config not found, install the pcre-devel package or build with --without-pcre])
fi
- AC_DEFINE([HAVE_LIBPCRE], [1], [libpcre])
- AC_DEFINE([HAVE_PCRE_H], [1], [pcre.h])
+ AC_DEFINE([WITH_PCRE], [1], [pcre])
AC_SUBST([PCRE_LIB])
fi
@@ -651,7 +632,7 @@ if test "$WITH_ZLIB" != no; then
Z_LIB="-L$WITH_ZLIB -lz"
CPPFLAGS="$CPPFLAGS -I$WITH_ZLIB"
else
- AC_CHECK_HEADERS([zlib.h], [],
+ AC_CHECK_HEADER([zlib.h], [],
[AC_MSG_ERROR([zlib headers not found, install them or build without --with-zlib])]
)
AC_CHECK_LIB([z], [deflate],
@@ -660,8 +641,7 @@ if test "$WITH_ZLIB" != no; then
)
fi
- AC_DEFINE([HAVE_LIBZ], [1], [libz])
- AC_DEFINE([HAVE_ZLIB_H], [1])
+ AC_DEFINE([WITH_ZLIB], [1], [zlib])
AC_SUBST([Z_LIB])
fi
@@ -682,7 +662,7 @@ if test "$WITH_BZIP2" != no; then
BZ_LIB="-L$WITH_BZIP2 -lbz2"
CPPFLAGS="$CPPFLAGS -I$WITH_BZIP2"
else
- AC_CHECK_HEADERS([bzlib.h], [], [
+ AC_CHECK_HEADER([bzlib.h], [], [
AC_MSG_ERROR([bzip2 headers not found, install them or build without --with-bzip2])
])
AC_CHECK_LIB([bz2], [BZ2_bzCompress],
@@ -691,8 +671,7 @@ if test "$WITH_BZIP2" != no; then
)
fi
- AC_DEFINE([HAVE_LIBBZ2], [1], [libbz2])
- AC_DEFINE([HAVE_BZLIB_H], [1])
+ AC_DEFINE([WITH_BZIP], [1], [bzip2])
AC_SUBST([BZ_LIB])
fi
@@ -714,7 +693,7 @@ if test "$WITH_FAM" != no; then
CPPFLAGS="$CPPFLAGS -I$WITH_FAM"
else
AC_CHECK_LIB([fam], [FAMOpen2], [
- AC_CHECK_HEADERS([fam.h], [FAM_LIBS=-lfam])
+ AC_CHECK_HEADER([fam.h], [FAM_LIBS=-lfam])
])
dnl fam has no pkg-config so far, so just search for gamin as fallback
if test -z "$FAM_LIBS"; then
@@ -731,8 +710,7 @@ if test "$WITH_FAM" != no; then
AC_CHECK_FUNCS([FAMNoExists])
LIBS=$OLD_LIBS
- AC_DEFINE([HAVE_LIBFAM], [1], [libfam])
- AC_DEFINE([HAVE_FAM_H], [1], [fam.h])
+ AC_DEFINE([WITH_FAM], [1], [fam])
AC_SUBST([FAM_LIBS])
fi
@@ -770,9 +748,7 @@ if test "$WITH_WEBDAV_PROPS" != no; then
AC_MSG_ERROR([libxml2 not found, install it or build without --with-webdav-props])
])
fi
-
- AC_DEFINE([HAVE_LIBXML2], [1], [libxml2])
- AC_DEFINE([HAVE_LIBXML_H], [1], [libxml.h])
+ AC_DEFINE([WITH_XML], [1], [libxml2])
AC_SUBST([XML_LIBS])
AC_SUBST([XML_CFLAGS])
@@ -799,8 +775,7 @@ if test "$WITH_WEBDAV_PROPS" != no; then
])
fi
- AC_DEFINE([HAVE_SQLITE3], [1], [libsqlite3])
- AC_DEFINE([HAVE_SQLITE3_H], [1], [sqlite3.h])
+ AC_DEFINE([WITH_SQLITE3], [1], [sqlite3])
AC_SUBST([SQLITE_LIBS])
AC_SUBST([SQLITE_CFLAGS])
fi
@@ -843,13 +818,12 @@ if test "$WITH_WEBDAV_LOCKS" != no; then
[UUID_LIBS=-luuid],
[AC_MSG_ERROR([uuid lib not found, install it or build without --with-webdav-locks])]
)
- AC_CHECK_HEADERS([uuid/uuid.h], [],
+ AC_CHECK_HEADER([uuid/uuid.h], [],
[AC_MSG_ERROR([uuid headers not found, install them or build without --with-webdav-locks])]
)
fi
- AC_DEFINE([HAVE_UUID], [1], [libuuid])
- AC_DEFINE([HAVE_UUID_H], [1], [uuid/uuid.h is available])
+ AC_DEFINE([WITH_UUID], [1], [uuid])
AC_SUBST([UUID_LIBS])
fi
@@ -872,13 +846,12 @@ if test "$WITH_GDBM" != no; then
[GDBM_LIB=-lgdbm],
[AC_MSG_ERROR([gdbm lib not found, install it or build without --with-gdbm])]
)
- AC_CHECK_HEADERS([gdbm.h], [],
+ AC_CHECK_HEADER([gdbm.h], [],
[AC_MSG_ERROR([gdbm headers not found, install them or build without --with-gdbm])]
)
fi
- AC_DEFINE([HAVE_GDBM], [1], [libgdbm])
- AC_DEFINE([HAVE_GDBM_H], [1])
+ AC_DEFINE([WITH_GDBM], [1], [gdbm])
AC_SUBST([GDBM_LIB])
fi
AM_CONDITIONAL([BUILD_WITH_GDBM], [test "$WITH_GDBM" != no])
@@ -902,13 +875,12 @@ if test "$WITH_GEOIP" != no; then
[GEOIP_LIB=-lGeoIP],
[AC_MSG_ERROR([GeoIP lib not found, install it or build without --with-geoip])]
)
- AC_CHECK_HEADERS([GeoIP.h], [],
+ AC_CHECK_HEADER([GeoIP.h], [],
[AC_MSG_ERROR([GeoIP headers not found, install them or build without --with-geoip])]
)
fi
- AC_DEFINE([HAVE_GEOIP], [1], [libGeoIP])
- AC_DEFINE([HAVE_GEOIP_H], [1])
+ AC_DEFINE([WITH_GEOIP], [1], [GeoIP])
AC_SUBST([GEOIP_LIB])
fi
AM_CONDITIONAL([BUILD_WITH_GEOIP], [test "$WITH_GEOIP" != no])
@@ -934,12 +906,12 @@ if test "$WITH_MEMCACHED" != no; then
[ MEMCACHED_LIB=-lmemcached ],
[AC_MSG_ERROR([memcached lib not found, install it or build without --with-memcached])]
)
- AC_CHECK_HEADERS([libmemcached/memcached.h], [],
+ AC_CHECK_HEADER([libmemcached/memcached.h], [],
[AC_MSG_ERROR([memcached headers not found, install them or build without --with-memcached])]
)
fi
- AC_DEFINE([USE_MEMCACHED], [1], [libmemcached])
+ AC_DEFINE([WITH_MEMCACHED], [1], [memcached])
AC_SUBST([MEMCACHED_LIB])
fi
AM_CONDITIONAL([BUILD_WITH_MEMCACHED], [test "$WITH_MEMCACHED" != no])
@@ -986,8 +958,7 @@ if test "$WITH_LUA" != no; then
fi
fi
- AC_DEFINE([HAVE_LUA], [1], [liblua])
- AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
+ AC_DEFINE([WITH_LUA], [1], [lua])
AC_SUBST([LUA_LIBS])
AC_SUBST([LUA_CFLAGS])
fi
@@ -1065,7 +1036,6 @@ AC_CHECK_FUNCS([\
localtime_r \
lstat \
madvise \
- memset \
memset_s \
mmap \
pathconf \
@@ -1081,7 +1051,7 @@ AC_CHECK_FUNCS([\
srandom \
writev \
])
-AC_CHECK_HEADERS([sys/random.h], [AC_CHECK_FUNCS([getentropy])])
+AC_CHECK_HEADER([sys/random.h], [AC_CHECK_FUNCS([getentropy])])
AC_CHECK_HEADERS([linux/random.h], [AC_CHECK_FUNCS([getrandom])])
AC_MSG_NOTICE([----------------------------------------])
@@ -1211,9 +1181,12 @@ dnl check for fastcgi lib, for the tests only
AC_MSG_NOTICE([----------------------------------------])
fastcgi_found=no
AC_CHECK_LIB([fcgi], [FCGI_Accept], [
- AC_CHECK_HEADERS([fastcgi.h fastcgi/fastcgi.h], [
- fastcgi_found=yes
- ])
+ AC_CHECK_HEADERS([fcgi_stdio.h fastcgi/fcgi_stdio.h],
+ [
+ fastcgi_found=yes
+ break # only need one header
+ ]
+ )
])
AM_CONDITIONAL([CHECK_WITH_FASTCGI], [test "$fastcgi_found" = yes])