From 5f91419a86508125715a306e67fb7f2d3634b7d0 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 18 Feb 2020 00:29:33 +0530 Subject: Rerun pkg-config to find xapian include flags for swig. * configure.ac: Rerun pkg-config to find xapian include flags for swig. Store result in SWIG_FLAGS. * Makefile.am: Use SWIG_CFLAGS. --- Makefile.am | 2 +- configure.ac | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index bb1b74f..e7aed53 100644 --- a/Makefile.am +++ b/Makefile.am @@ -27,7 +27,7 @@ libguilexapian_la_CXXFLAGS = $(GUILE_CFLAGS) $(XAPIAN_CFLAGS) libguilexapian_la_LDFLAGS = $(GUILE_LIBS) $(XAPIAN_LIBS) xapian_wrap.cc: xapian.i xapian-head.i xapian-headers.i - $(SWIG) $(XAPIAN_CFLAGS) -scmstub -o $@ -guile -package xapian -c++ $< + $(SWIG) $(SWIG_FLAGS) -scmstub -o $@ -guile -package xapian -c++ $< xapian_wrap.scm: xapian_wrap.cc diff --git a/configure.ac b/configure.ac index 6814e48..2d9139a 100644 --- a/configure.ac +++ b/configure.ac @@ -29,6 +29,13 @@ GUILE_PROGS PKG_CHECK_MODULES([XAPIAN], [xapian-core]) PKG_CHECK_MODULES([ZLIB], [zlib]) +dnl pkg-config does not output xapian include flags when the include +dnl path is already in CPATH. See +dnl https://unix.stackexchange.com/questions/362289/why-is-pkg-config-cflags-openssl-returning-nothing-on-rhel-6-8 +dnl But, swig does not use CPATH. So, we need to invoke pkg-config +dnl again forcing it to output all include flags. +AC_SUBST([SWIG_FLAGS], [$(PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --cflags xapian-core)]) + AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env]) AC_OUTPUT -- cgit v1.2.3