From dce683cf90ee3e0e2cac18a28b05f5903d6cd799 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Thu, 29 May 2014 12:02:53 +0200 Subject: [PATCH] Install internal ivykis headers when necessary When building with an internal ivykis, and it gets linked into libsyslog-ng, install the headers to ${pkgincludedir}/ivykis, adjust the CFLAGS in the pkg-config control file accordingly, and note the fact with an "ivykis=internal" entry in the same file. This makes it possible to not only detect a syslog-ng with an embedded ivykis, but to build against such a thing, too. This fixes #124. Requested-by: Viktor Tusa Signed-off-by: Gergely Nagy --- configure.ac | 4 ++++ lib/Makefile.am | 8 ++++++++ syslog-ng.pc.in | 3 ++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d85064211d5..a935c4897df 100644 --- a/configure.ac +++ b/configure.ac @@ -827,6 +827,7 @@ dnl *************************************************************************** dnl ivykis headers/libraries dnl *************************************************************************** +INTERNAL_IVYKIS_CFLAGS="" if test "x$with_ivykis" = "xinternal"; then if test -f "$srcdir/lib/ivykis/src/iv_main_posix.c"; then AC_CONFIG_SUBDIRS([lib/ivykis]) @@ -837,6 +838,7 @@ if test "x$with_ivykis" = "xinternal"; then IVYKIS_LIBS="-Wl,--whole-archive -L\$(top_builddir)/lib/ivykis/src -livykis -Wl,--no-whole-archive" IVYKIS_CFLAGS="-I\$(top_srcdir)/lib/ivykis/src/include -I\$(top_builddir)/lib/ivykis/src/include" IVYKIS_SUBDIRS=lib/ivykis + INTERNAL_IVYKIS_CFLAGS="-I\${includedir}/syslog-ng/ivykis" # LIBS to use when libtool is not applicable (when linking the main syslog-ng executable in mixed linking mode) IVYKIS_NO_LIBTOOL_LIBS="-Wl,--whole-archive -L\$(top_builddir)/lib/ivykis/src/.libs -livykis -Wl,--no-whole-archive" @@ -1326,6 +1328,8 @@ AC_SUBST(CURRDATE) AC_SUBST(RELEASE_TAG) AC_SUBST(SNAPSHOT_VERSION) AC_SUBST(SOURCE_REVISION) +AC_SUBST(with_ivykis) +AC_SUBST(INTERNAL_IVYKIS_CFLAGS) AC_OUTPUT(dist.conf Makefile diff --git a/lib/Makefile.am b/lib/Makefile.am index da580893e85..37284b7b88f 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -23,6 +23,14 @@ lib/ivykis/src/libivykis.la: ${MAKE} -C lib/ivykis CLEAN_SUBDIRS += @IVYKIS_SUBDIRS@ + +install-ivykis: + ${MAKE} -C lib/ivykis/src \ + install-includeHEADERS \ + install-nodist_includeHEADERS \ + includedir="${pkgincludedir}/ivykis" + +INSTALL_EXEC_HOOKS += install-ivykis endif if JSON_INTERNAL diff --git a/syslog-ng.pc.in b/syslog-ng.pc.in index 8f4cf6cbc15..d794020350f 100644 --- a/syslog-ng.pc.in +++ b/syslog-ng.pc.in @@ -7,10 +7,11 @@ includedir=@includedir@ toolsdir=@datadir@/tools moduledir=@expanded_moduledir@ scldir=@datadir@/include/scl +ivykis=@with_ivykis@ Name: syslog-ng-dev Description: Dev package for syslog-ng module Version: @VERSION@ Requires: glib-2.0 Libs: -L${libdir} @GLIB_LIBS@ -lsyslog-ng -Cflags: -I${includedir}/syslog-ng +Cflags: -I${includedir}/syslog-ng @INTERNAL_IVYKIS_CFLAGS@