2002-12-28 03:05:43 +00:00
|
|
|
AC_INIT(src/isync.h)
|
2003-05-07 00:06:37 +00:00
|
|
|
AM_CONFIG_HEADER(config.h)
|
2008-02-23 09:41:19 +00:00
|
|
|
AM_INIT_AUTOMAKE(isync, 1.0.4)
|
2003-05-05 13:41:04 +00:00
|
|
|
|
2004-01-27 00:11:27 +00:00
|
|
|
AM_MAINTAINER_MODE
|
|
|
|
|
2000-12-20 21:41:21 +00:00
|
|
|
AM_PROG_CC_STDC
|
2003-05-05 13:41:04 +00:00
|
|
|
if test "$GCC" = yes; then
|
2004-03-27 16:07:20 +00:00
|
|
|
CFLAGS="$CFLAGS -pipe -W -Wall -Wshadow -Wstrict-prototypes"
|
2003-05-05 13:41:04 +00:00
|
|
|
fi
|
|
|
|
|
2006-01-31 15:15:00 +00:00
|
|
|
AC_CHECK_HEADERS([sys/filio.h])
|
2004-03-27 16:07:20 +00:00
|
|
|
AC_CHECK_FUNCS(vasprintf)
|
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
|
|
|
|
2004-06-17 13:44:24 +00:00
|
|
|
m4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))])
|
|
|
|
|
2004-09-08 16:28:13 +00:00
|
|
|
have_ssl_paths=
|
2003-05-07 00:06:37 +00:00
|
|
|
AC_ARG_WITH(ssl,
|
2004-09-08 16:28:13 +00:00
|
|
|
AS_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
|
|
|
|
2004-03-27 16:07:20 +00:00
|
|
|
AC_CACHE_CHECK([for Berkley DB 4.2], ac_cv_berkdb4,
|
|
|
|
[ac_cv_berkdb4=no
|
|
|
|
AC_TRY_LINK([#include <db.h>],
|
|
|
|
[DB *db;
|
|
|
|
db->truncate(db, 0, 0, 0);
|
|
|
|
db->open(db, 0, "foo", "foo", DB_HASH, DB_CREATE, 0)],
|
|
|
|
[ac_cv_berkdb4=yes])])
|
|
|
|
if test "x$ac_cv_berkdb4" = xno; then
|
|
|
|
AC_MSG_ERROR([Berkley DB 4.2 not found.
|
|
|
|
You must install libdb4.2 including the respective development files/headers.])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(compat,
|
|
|
|
AS_HELP_STRING([--disable-compat], [don't include isync compatibility wrapper [no]]),
|
|
|
|
[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
|
2004-03-27 16:07:20 +00:00
|
|
|
AM_CONDITIONAL(with_compat, test "x$ob_cv_enable_compat" != xno)
|
2002-01-28 19:34:22 +00:00
|
|
|
|
2004-03-27 16:07:20 +00:00
|
|
|
AC_OUTPUT(Makefile src/Makefile src/compat/Makefile isync.spec)
|
2003-05-07 00:06:37 +00:00
|
|
|
|
2004-09-08 16:28:13 +00:00
|
|
|
if test -n "$have_ssl_paths"; then
|
2003-05-07 00:06:37 +00:00
|
|
|
AC_MSG_RESULT([
|
|
|
|
Using SSL
|
|
|
|
])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([
|
|
|
|
Not using SSL
|
|
|
|
])
|
|
|
|
fi
|