]> arthur.barton.de Git - netatalk.git/commitdiff
Add --disable-bundled-libevent configure options
authorFrank Lahm <franklahm@googlemail.com>
Sat, 31 Mar 2012 11:38:37 +0000 (13:38 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Sat, 31 Mar 2012 11:38:37 +0000 (13:38 +0200)
When set to yes, we rely on a properly installed version on libevent
CPPFLAGS and LDFLAGS should be set properly to pick that up

Makefile.am
configure.ac
etc/netatalk/Makefile.am
macros/netatalk.m4

index 4cf315dd0d9c1ba4a7a65d64ecfadbd702a2abec..5ee6b85319979f0c1e7f18a6af8fa32497a0e4a3 100644 (file)
@@ -7,6 +7,10 @@ EXTRA_DIST = CONTRIBUTORS COPYRIGHT COPYING NEWS VERSION services.atalk
 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 ... "
index 54530e77921cbb34445b554ac77ea4c8ef763e62..e9b1c072412912dad6fa04c8a7263e7bf0594b1e 100644 (file)
@@ -184,6 +184,9 @@ AC_NETATALK_REALPATH
 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
 
@@ -210,9 +213,6 @@ AM_CONDITIONAL(DEFAULT_HOOK, test x$neta_cv_have_libgcrypt != xyes && test x$net
 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
index 5897e40f0192e0484361b6bdf47c63bd6ec68d92..10f90cefedad7c9de980f5ada4a04cdbc800af73 100644 (file)
@@ -6,12 +6,18 @@ sbin_PROGRAMS = netatalk
 
 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
index d5323380cb6192c9352b1f43b705abe2535ebfde..fb9429f2d22350f482070ffc82510f4c2b9b4a50 100644 (file)
@@ -1,5 +1,24 @@
 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])