2014-07-05 14:37:52 +00:00
|
|
|
AC_INIT([isync], [1.2.0])
|
2013-12-08 19:46:40 +00:00
|
|
|
AC_CONFIG_HEADERS([autodefs.h])
|
2013-04-07 14:53:31 +00:00
|
|
|
AM_INIT_AUTOMAKE
|
2003-05-05 13:41:04 +00:00
|
|
|
|
2004-01-27 00:11:27 +00:00
|
|
|
AM_MAINTAINER_MODE
|
|
|
|
|
2013-04-07 14:53:31 +00:00
|
|
|
AC_PROG_CC
|
2003-05-05 13:41:04 +00:00
|
|
|
if test "$GCC" = yes; then
|
2011-03-13 14:03:59 +00:00
|
|
|
CFLAGS="$CFLAGS -pipe -W -Wall -Wshadow -Wstrict-prototypes -ansi -pedantic -Wno-overlength-strings"
|
2003-05-05 13:41:04 +00:00
|
|
|
fi
|
|
|
|
|
2012-09-01 19:14:53 +00:00
|
|
|
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
|
|
|
|
|
2013-07-28 13:55:13 +00:00
|
|
|
AC_CACHE_CHECK([whether strftime supports %z], ob_cv_strftime_z,
|
|
|
|
[AC_TRY_RUN(
|
|
|
|
[#include <time.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
time_t t = 0;
|
|
|
|
char buf[32];
|
2013-11-09 12:50:48 +00:00
|
|
|
strftime(buf, sizeof(buf), "%z", localtime(&t));
|
|
|
|
return !(buf[0] == '+' || buf[0] == '-');
|
2013-07-28 13:55:13 +00:00
|
|
|
}
|
|
|
|
], [ob_cv_strftime_z=yes], [ob_cv_strftime_z=no], [ob_cv_strftime_z="yes (assumed)"])])
|
|
|
|
if test "x$ob_cv_strftime_z" = x"no"; then
|
|
|
|
AC_MSG_ERROR([libc lacks necessary feature])
|
|
|
|
fi
|
|
|
|
|
2012-08-25 16:26:23 +00:00
|
|
|
AC_CHECK_HEADERS(sys/poll.h sys/select.h)
|
2014-10-04 15:07:17 +00:00
|
|
|
AC_CHECK_FUNCS(vasprintf strnlen memrchr timegm)
|
2003-05-07 00:06:37 +00:00
|
|
|
|
2004-03-27 16:07:20 +00:00
|
|
|
AC_CHECK_LIB(socket, socket, [SOCK_LIBS="-lsocket"])
|
|
|
|
AC_CHECK_LIB(nsl, inet_ntoa, [SOCK_LIBS="$SOCK_LIBS -lnsl"])
|
|
|
|
AC_SUBST(SOCK_LIBS)
|
2003-05-07 00:06:37 +00:00
|
|
|
|
2013-09-01 15:35:31 +00:00
|
|
|
have_ipv6=true
|
|
|
|
sav_LDFLAGS=$LDFLAGS
|
|
|
|
LDFLAGS="$LDFLAGS $SOCK_LIBS"
|
|
|
|
AC_CHECK_FUNCS(getaddrinfo inet_ntop, , [have_ipv6=false])
|
|
|
|
LDFLAGS=$sav_LDFLAGS
|
|
|
|
if $have_ipv6; then
|
|
|
|
AC_DEFINE(HAVE_IPV6, 1, [if your libc has IPv6 support])
|
|
|
|
fi
|
|
|
|
|
2004-09-08 16:28:13 +00:00
|
|
|
have_ssl_paths=
|
2003-05-07 00:06:37 +00:00
|
|
|
AC_ARG_WITH(ssl,
|
2013-04-07 14:53:31 +00:00
|
|
|
AC_HELP_STRING([--with-ssl[=PATH]], [where to look for SSL [detect]]),
|
2003-05-07 00:06:37 +00:00
|
|
|
[ob_cv_with_ssl=$withval])
|
|
|
|
if test "x$ob_cv_with_ssl" != xno; then
|
2004-09-08 16:28:13 +00:00
|
|
|
case $ob_cv_with_ssl in
|
|
|
|
""|yes)
|
|
|
|
dnl Detect the pkg-config tool, as it may have extra info about the openssl
|
|
|
|
dnl installation we can use. I *believe* this is what we are expected to do
|
|
|
|
dnl on really recent Redhat Linux hosts.
|
|
|
|
AC_PATH_PROG(PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
|
|
|
|
if test "$PKGCONFIG" != "no" ; then
|
|
|
|
AC_MSG_CHECKING([OpenSSL presence with pkg-config])
|
|
|
|
if $PKGCONFIG --exists openssl; then
|
|
|
|
SSL_LIBS=`$PKGCONFIG --libs-only-l openssl`
|
|
|
|
SSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl`
|
|
|
|
SSL_CPPFLAGS=`$PKGCONFIG --cflags-only-I openssl`
|
|
|
|
have_ssl_paths=yes
|
|
|
|
AC_MSG_RESULT([found])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([not found])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
SSL_LDFLAGS=-L$ob_cv_with_ssl/lib$libsuff
|
|
|
|
SSL_CPPFLAGS=-I$ob_cv_with_ssl/include
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
if test -z "$have_ssl_paths"; then
|
|
|
|
sav_LDFLAGS=$LDFLAGS
|
|
|
|
LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
|
|
|
|
AC_CHECK_LIB(dl, dlopen, [LIBDL=-ldl])
|
|
|
|
AC_CHECK_LIB(crypto, CRYPTO_lock, [LIBCRYPTO=-lcrypto])
|
|
|
|
AC_CHECK_LIB(ssl, SSL_connect,
|
|
|
|
[SSL_LIBS="-lssl $LIBCRYPTO $LIBDL" have_ssl_paths=yes])
|
|
|
|
LDFLAGS=$sav_LDFLAGS
|
|
|
|
fi
|
|
|
|
|
|
|
|
sav_CPPFLAGS=$CPPFLAGS
|
|
|
|
CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
|
|
|
|
AC_CHECK_HEADER(openssl/ssl.h, , [have_ssl_paths=])
|
|
|
|
CPPFLAGS=$sav_CPPFLAGS
|
|
|
|
|
|
|
|
if test -z "$have_ssl_paths"; then
|
|
|
|
if test -n "$ob_cv_with_ssl"; then
|
|
|
|
AC_MSG_ERROR([OpenSSL libs and/or includes were not found where specified])
|
2003-05-07 00:06:37 +00:00
|
|
|
fi
|
2004-09-08 16:28:13 +00:00
|
|
|
else
|
2004-09-15 08:44:13 +00:00
|
|
|
AC_DEFINE(HAVE_LIBSSL, 1, [if you have the OpenSSL libraries])
|
2004-09-08 16:28:13 +00:00
|
|
|
CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
|
|
|
|
LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
|
|
|
|
fi
|
2003-05-07 00:06:37 +00:00
|
|
|
fi
|
2004-03-27 16:07:20 +00:00
|
|
|
AC_SUBST(SSL_LIBS)
|
2002-01-28 19:34:22 +00:00
|
|
|
|
2014-07-27 16:41:22 +00:00
|
|
|
have_sasl_paths=
|
|
|
|
AC_ARG_WITH(sasl,
|
|
|
|
AS_HELP_STRING([--with-sasl[=PATH]], [where to look for SASL [detect]]),
|
|
|
|
[ob_cv_with_sasl=$withval])
|
|
|
|
if test "x$ob_cv_with_sasl" != xno; then
|
|
|
|
case $ob_cv_with_sasl in
|
|
|
|
""|yes)
|
|
|
|
dnl FIXME: Try various possible paths here...
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
SASL_LDFLAGS=-L$ob_cv_with_sasl/lib$libsuff
|
|
|
|
SASL_CPPFLAGS=-I$ob_cv_with_sasl/include
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
if test -z "$have_sasl_paths"; then
|
|
|
|
sav_LDFLAGS=$LDFLAGS
|
|
|
|
LDFLAGS="$LDFLAGS $SASL_LDFLAGS"
|
|
|
|
AC_CHECK_LIB(sasl2, sasl_client_init,
|
|
|
|
[SASL_LIBS="-lsasl2" have_sasl_paths=yes])
|
|
|
|
LDFLAGS=$sav_LDFLAGS
|
|
|
|
fi
|
|
|
|
|
|
|
|
sav_CPPFLAGS=$CPPFLAGS
|
|
|
|
CPPFLAGS="$CPPFLAGS $SASL_CPPFLAGS"
|
|
|
|
AC_CHECK_HEADER(sasl/sasl.h, , [have_sasl_paths=])
|
|
|
|
CPPFLAGS=$sav_CPPFLAGS
|
|
|
|
|
|
|
|
if test -z "$have_sasl_paths"; then
|
|
|
|
if test -n "$ob_cv_with_sasl"; then
|
|
|
|
AC_MSG_ERROR([SASL libs and/or includes were not found where specified])
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
AC_DEFINE(HAVE_LIBSASL, 1, [if you have the SASL libraries])
|
|
|
|
CPPFLAGS="$CPPFLAGS $SASL_CPPFLAGS"
|
|
|
|
LDFLAGS="$LDFLAGS $SASL_LDFLAGS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
AC_SUBST(SASL_LIBS)
|
|
|
|
|
2015-05-01 09:55:27 +00:00
|
|
|
AC_CACHE_CHECK([for Berkeley DB >= 4.1], ac_cv_berkdb4,
|
2004-03-27 16:07:20 +00:00
|
|
|
[ac_cv_berkdb4=no
|
2015-05-01 09:45:06 +00:00
|
|
|
sav_LDFLAGS=$LDFLAGS
|
|
|
|
LDFLAGS="$LDFLAGS -ldb"
|
2004-03-27 16:07:20 +00:00
|
|
|
AC_TRY_LINK([#include <db.h>],
|
|
|
|
[DB *db;
|
2015-05-01 09:45:06 +00:00
|
|
|
db_create(&db, 0, 0);
|
2004-03-27 16:07:20 +00:00
|
|
|
db->truncate(db, 0, 0, 0);
|
|
|
|
db->open(db, 0, "foo", "foo", DB_HASH, DB_CREATE, 0)],
|
2015-05-01 09:45:06 +00:00
|
|
|
[ac_cv_berkdb4=yes])
|
|
|
|
LDFLAGS=$sav_LDFLAGS
|
|
|
|
])
|
2015-04-11 18:06:30 +00:00
|
|
|
if test "x$ac_cv_berkdb4" = xyes; then
|
|
|
|
AC_SUBST([DB_LIBS], ["-ldb"])
|
2015-05-01 09:55:27 +00:00
|
|
|
AC_DEFINE(USE_DB, 1, [if Berkeley DB should be used])
|
2004-03-27 16:07:20 +00:00
|
|
|
fi
|
|
|
|
|
2014-12-13 11:09:15 +00:00
|
|
|
have_zlib=
|
|
|
|
AC_CHECK_LIB([z], [deflate],
|
|
|
|
[AC_CHECK_HEADER(zlib.h,
|
|
|
|
[have_zlib=1
|
|
|
|
AC_SUBST([Z_LIBS], ["-lz"])
|
|
|
|
AC_DEFINE([HAVE_LIBZ], 1, [if you have the zlib library])]
|
|
|
|
)]
|
|
|
|
)
|
|
|
|
|
2004-03-27 16:07:20 +00:00
|
|
|
AC_ARG_ENABLE(compat,
|
2013-04-07 14:53:31 +00:00
|
|
|
AC_HELP_STRING([--disable-compat], [don't include isync compatibility wrapper [no]]),
|
2004-03-27 16:07:20 +00:00
|
|
|
[ob_cv_enable_compat=$enableval])
|
|
|
|
if test "x$ob_cv_enable_compat" != xno; then
|
|
|
|
AC_CHECK_FUNCS(getopt_long)
|
2004-01-13 03:56:52 +00:00
|
|
|
fi
|
2015-04-11 18:06:30 +00:00
|
|
|
AM_CONDITIONAL(with_compat, test "x$ob_cv_enable_compat" != xno -a "x$ac_cv_berkdb4" = xyes)
|
|
|
|
AM_CONDITIONAL(with_mdconvert, test "x$ac_cv_berkdb4" = xyes)
|
2002-01-28 19:34:22 +00:00
|
|
|
|
2013-04-07 14:53:31 +00:00
|
|
|
AC_CONFIG_FILES([Makefile src/Makefile src/compat/Makefile isync.spec])
|
|
|
|
AC_OUTPUT
|
2003-05-07 00:06:37 +00:00
|
|
|
|
2014-07-27 16:41:22 +00:00
|
|
|
AC_MSG_RESULT()
|
2004-09-08 16:28:13 +00:00
|
|
|
if test -n "$have_ssl_paths"; then
|
2014-07-27 16:41:22 +00:00
|
|
|
AC_MSG_RESULT([Using SSL])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([Not using SSL])
|
|
|
|
fi
|
|
|
|
if test -n "$have_sasl_paths"; then
|
|
|
|
AC_MSG_RESULT([Using SASL])
|
2003-05-07 00:06:37 +00:00
|
|
|
else
|
2014-07-27 16:41:22 +00:00
|
|
|
AC_MSG_RESULT([Not using SASL])
|
2003-05-07 00:06:37 +00:00
|
|
|
fi
|
2014-12-13 11:09:15 +00:00
|
|
|
if test -n "$have_zlib"; then
|
|
|
|
AC_MSG_RESULT([Using zlib])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([Not using zlib])
|
|
|
|
fi
|
2015-04-11 18:06:30 +00:00
|
|
|
if test "x$ac_cv_berkdb4" = xyes; then
|
2015-05-01 09:55:27 +00:00
|
|
|
AC_MSG_RESULT([Using Berkeley DB])
|
2015-04-11 18:06:30 +00:00
|
|
|
else
|
2015-05-01 09:55:27 +00:00
|
|
|
AC_MSG_RESULT([Not using Berkeley DB])
|
2015-04-11 18:06:30 +00:00
|
|
|
fi
|
2014-07-27 16:41:22 +00:00
|
|
|
AC_MSG_RESULT()
|