Skip to content

Commit

Permalink
Install internal ivykis headers when necessary
Browse files Browse the repository at this point in the history
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 syslog-ng#124.

Requested-by: Viktor Tusa <[email protected]>
Signed-off-by: Gergely Nagy <[email protected]>
  • Loading branch information
algernon committed Jun 2, 2014
1 parent 23ee521 commit dce683c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion syslog-ng.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@

0 comments on commit dce683c

Please sign in to comment.