libevent migration: discarded, make this libev
authorWilfried Goesgens <dothebart@citadel.org>
Sat, 1 Jan 2011 16:59:50 +0000 (17:59 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Sat, 1 Jan 2011 16:59:50 +0000 (17:59 +0100)
  - detect c-ares
  - detect libev

citadel/configure.ac

index baa179e45421d06cfde066793b9fc4d69c7b3836..8c45d53406d8a495155988c2bebd9de5499ac9a1 100644 (file)
@@ -578,40 +578,59 @@ AC_CHECK_HEADER(libcitadel.h,
 CFLAGS="$saved_CFLAGS"
 
 
-dnl experimental libevent smtp client remove this to...
-AC_ARG_WITH(experimental_eventsmtp, 
-                   [  --with-experimental_eventsmtp        enable experimental event smtp clients],
-                       [ if test "x$withval" != "xno" ; then
-                            CFLAGS="$CFLAGS  -rdynamic "
-                            LDFLAGS="$LDFLAGS  -rdynamic "
-                            SERVER_LDFLAGS="$SERVER_LDFLAGS  -rdynamic "
-
+dnl experimental libev smtp client remove this to...
 AC_DEFINE(EXPERIMENTAL_SMTP_EVENT_CLIENT, [], [should we use the experimental libevent smtp client?])
 dnl here...
+
+
+
+
+                AC_CHECK_LIB(cares, ares_init,
+                  [
+                    C_ARES_LIBS=-lcares
+                AC_DEFINE(HAVE_C_ARES, 1, [Define to use c-ares library])
+                have_good_c_ares=yes
+                  ],, $SOCKET_LIBS $NSL_LIBS
+                )
+
+
+
 saved_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS $SERVER_LIBS"
 dnl Check for libevent
-AC_CHECK_HEADER(event.h,
-       [AC_CHECK_LIB(event, libcitadel_version_string,
+AC_CHECK_HEADER(ares.h,
+       [AC_CHECK_LIB(cares, ares_init,
                [
-                       LIBS="-levent $LIBS $SERVER_LIBS"
+                       LIBS="-lcares $LIBS $SERVER_LIBS"
                ],
                [
-                       AC_MSG_ERROR(libevent was not found or is not usable.  Please install libevent.)
+                       AC_MSG_ERROR(libc-ares was not found or is not usable.  Please install libc-ares.)
                ]
-       ,
        )],
        [
-               AC_MSG_ERROR(event.h was not found or is not usable.  Please install libevent.)
+               AC_MSG_ERROR(ares.h was not found or is not usable.  Please install libc-ares.)
        ]
 )
-
 CFLAGS="$saved_CFLAGS"
-dnl and from here to...
-                         fi
-                       ]
+
+saved_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $SERVER_LIBS"
+dnl Check for libevent
+AC_CHECK_HEADER(ev.h,
+       [AC_CHECK_LIB(ev, libcitadel_version_string,
+               [
+                       LIBS="-lev $LIBS $SERVER_LIBS"
+               ],
+               [
+                       AC_MSG_ERROR(libev was not found or is not usable.  Please install libev.)
+               ]
+       ,
+       )],
+       [
+               AC_MSG_ERROR(ev.h was not found or is not usable.  Please install libev.)
+       ]
 )
-dnl here to make it final.
+CFLAGS="$saved_CFLAGS"
 
 # The big search for OpenSSL
 if test "$with_ssl" != "no"; then