ACLOCAL_AMFLAGS = -I macros
AUTOMAKE_OPTIONS = foreign
+if USE_BUILTIN_LIBEVENT
+ SUBDIRS += libevent
+endif
+
if RUN_LDCONFIG
install-exec-hook:
@printf "Running ldconfig to ensure libraries installed in system library directories are added to the dynamic linker cache ... "
dnl Check for sendfile()
AC_NETATALK_SENDFILE
+dnl Check whether bundled libevent shall not be used
+AC_NETATALK_LIBEVENT
+
dnl FHS stuff has to be done last because it overrides other defaults
AC_NETATALK_FHS
AM_CONDITIONAL(USE_BDB, test x$bdb_required = xyes)
AM_CONDITIONAL(HAVE_ATFUNCS, test x"$ac_neta_haveatfuncs" = x"yes")
-dnl --------------------- configure subpackages
-AC_CONFIG_SUBDIRS([libevent])
-
dnl --------------------- generate files
AC_OUTPUT([Makefile
bin/Makefile
netatalk_SOURCES = netatalk.c
netatalk_CFLAGS = \
- -I$(top_srcdir)/libevent/include \
- -I$(top_builddir)/libevent/include \
-D_PATH_CONFDIR=\"$(pkgconfdir)/\" \
-D_PATH_AFPD=\"$(sbindir)/afpd\" \
-D_PATH_CNID_METAD=\"$(sbindir)/cnid_metad\"
netatalk_LDADD = \
- $(top_builddir)/libatalk/libatalk.la \
+ $(top_builddir)/libatalk/libatalk.la
+
+if USE_BUILTIN_LIBEVENT
+netatalk_CFLAGS += \
+ -I$(top_srcdir)/libevent/include \
+ -I$(top_builddir)/libevent/include
+
+netatalk_LDADD += \
$(top_builddir)/libevent/libevent.la
+endif
\ No newline at end of file
dnl Kitchen sink for configuration macros
+dnl Whether to disable bundled libevent
+AC_DEFUN([AC_NETATALK_LIBEVENT], [
+ AC_MSG_CHECKING([whether to disable bundled libevent (define CPPFLAGS and LDFLAGS otherwise appropiately to pick up installed version)])
+ AC_ARG_ENABLE(
+ bundled-libevent,
+ [AC_HELP_STRING(
+ [--disable-bundled-libevent],
+ [whether the bundled version of libevent shall not be used (define CPPFLAGS and LDFLAGS otherwise appropiately to pick up installed version)]
+ )],
+ use_bundled_libevent=$enableval,
+ use_bundled_libevent=yes
+ )
+
+ if test x"$use_bundled_libevent" = x"yes" ; then
+ AC_CONFIG_SUBDIRS([libevent])
+ fi
+ AM_CONDITIONAL(USE_BUILTIN_LIBEVENT, test x"$use_bundled_libevent" = x"yes")
+])
+
dnl Filesystem Hierarchy Standard (FHS) compatibility
AC_DEFUN([AC_NETATALK_FHS], [
AC_MSG_CHECKING([whether to use Filesystem Hierarchy Standard (FHS) compatibility])