changeset 392:54465fca8b9e

Use PKG_CHECK_MODULES to find the gsf-1 library It uses the architecture-prefixed pkg-config binary, so cross-compiling libpst on multi-arch systems works. Fixes: https://bugs.debian.org/838390
author Paul Wise <pabs3@bonedaddy.net>
date Mon, 23 Dec 2019 12:23:22 +0800
parents f2742d1160a4
children ffbb5e3f2551
files configure.ac src/Makefile.am
diffstat 2 files changed, 2 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Sat Dec 21 21:25:45 2019 +0800
+++ b/configure.ac	Mon Dec 23 12:23:22 2019 +0800
@@ -371,14 +371,7 @@
 AC_MSG_RESULT([$enable_profiling])
 AM_CONDITIONAL(GPROF_PROFILING, [test "$enable_profiling" = "yes"])
 
-gsf_flags="`pkg-config libgsf-1 --cflags`"
-gsf_libs="`pkg-config libgsf-1 --libs`"
-if test "$gsf_flags" = ""; then
-    AC_MSG_ERROR(libgsf not found)
-fi
-
-AC_SUBST(GSF_FLAGS, [$gsf_flags])
-AC_SUBST(GSF_LIBS, [$gsf_libs])
+PKG_CHECK_MODULES([GSF], [libgsf-1])
 
 PKG_CHECK_MODULES([ZLIB], [zlib])
 
--- a/src/Makefile.am	Sat Dec 21 21:25:45 2019 +0800
+++ b/src/Makefile.am	Mon Dec 23 12:23:22 2019 +0800
@@ -53,7 +53,7 @@
 getidblock_SOURCES  = getidblock.c     $(common_header)
 nick2ldif_SOURCES   = nick2ldif.cpp    $(common_header)
 
-readpst_CPPFLAGS    = $(AM_CPPFLAGS) $(GSF_FLAGS)
+readpst_CPPFLAGS    = $(AM_CPPFLAGS) $(GSF_CFLAGS)
 
 lspst_DEPENDENCIES        = libpst.la
 readpst_DEPENDENCIES      = libpst.la