dnl Whether to disable bundled libevent
AC_DEFUN([AC_NETATALK_LIBEVENT], [
- use_bundled_libevent=no
- AC_MSG_CHECKING([whether to use bundled or installed libevent])
+ AC_MSG_CHECKING([whether to use bundled libevent])
+ AC_ARG_WITH(
+ libevent,
+ [AS_HELP_STRING([--with-libevent],[whether to use the bundled libevent (default: yes)])],
+ use_bundled_libevent=$withval,
+ use_bundled_libevent=yes
+ )
AC_ARG_WITH(
libevent-header,
[AS_HELP_STRING([--with-libevent-header],[path to libevent header files])],
- LIBEVENT_CFLAGS=-I$withval,
- use_bundled_libevent=yes
+ [use_bundled_libevent=no; LIBEVENT_CFLAGS=-I$withval]
)
AC_ARG_WITH(
libevent-lib,
- [AS_HELP_STRING([--with-libevent-lib],[path to libevent header library])],
- LIBEVENT_LDFLAGS=-L$withval,
- use_bundled_libevent=yes
+ [AS_HELP_STRING([--with-libevent-lib],[path to libevent library])],
+ [use_bundled_libevent=no; LIBEVENT_LDFLAGS=-L$withval]
)
- AC_MSG_RESULT([$use_bundled_libevent])
- if test x"$use_bundled_libevent" = x"yes" ; then
- AC_CONFIG_SUBDIRS([libevent])
+ if test x"$LIBEVENT_CFLAGS" = x"-Iyes" -o x"$LIBEVENT_LDFLAGS" = x"-Lyes" ; then
+ AC_MSG_ERROR([--with-libevent requires a path])
fi
+ AC_MSG_RESULT([$use_bundled_libevent])
+ AC_CONFIG_SUBDIRS([libevent])
AC_SUBST(LIBEVENT_CFLAGS)
AC_SUBST(LIBEVENT_LDFLAGS)
AM_CONDITIONAL(USE_BUILTIN_LIBEVENT, test x"$use_bundled_libevent" = x"yes")
AC_MSG_RESULT([ LIBS = $LDAP_LDLFLAGS $LDAP_LIBS])
AC_MSG_RESULT([ CFLAGS = $LDAP_CFLAGS])
fi
+ AC_MSG_RESULT([ LIBEVENT:])
+ if test x"$use_bundled_libevent" = x"yes"; then
+ AC_MSG_RESULT([ bundled])
+ else
+ AC_MSG_RESULT([ LIBS = $LIBEVENT_CFLAGS])
+ AC_MSG_RESULT([ CFLAGS = $LIBEVENT_LDFLAGS])
+ fi
])