build: Use AX for pkg config
Use an autoconf archive macro for pkg config so autoconf can fill
out Requires.private in phosphor-dbus-interfaces.pc.in.
Change-Id: Ica803a0f758871b192502be5c2cdc6e166337df2
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/Makefile.am b/Makefile.am
index 464c668..6927ce4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,8 +5,8 @@
libphosphor_dbusdir = ${libdir}
libphosphor_dbus_LTLIBRARIES = libphosphor_dbus.la
-libphosphor_dbus_la_LDFLAGS = $(SYSTEMD_LIBS) -version-info 0:0:0 -shared
-libphosphor_dbus_la_CXXFLAGS = $(SYSTEMD_CFLAGS)
+libphosphor_dbus_la_LDFLAGS = $(SYSTEMD_LIBS) $(SDBUSPLUS_LIBS) -version-info 0:0:0 -shared
+libphosphor_dbus_la_CXXFLAGS = $(SYSTEMD_CFLAGS) $(SDBUSPLUS_CFLAGS)
BUILT_SOURCES = libphosphor_dbus.cpp
CLEANFILES = libphosphor_dbus.cpp
diff --git a/configure.ac b/configure.ac
index 64c28bc..ee42dbe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,8 +28,8 @@
AC_MSG_ERROR([Cannot find sdbus++]))
# Checks for libraries.
- PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 221],,
- [AC_MSG_ERROR(["systemd required and not found."])])
+ AX_PKG_CHECK_MODULES([SYSTEMD], [], [libsystemd >= 221], [], [AC_MSG_ERROR(["systemd required and not found."])])
+ AX_PKG_CHECK_MODULES([SDBUSPLUS], [], [sdbusplus], [], [AC_MSG_ERROR(["sdbusplus required and not found."])])
# Checks for typedefs, structures, and compiler characteristics.
AX_CXX_COMPILE_STDCXX_14([noext])
diff --git a/phosphor-dbus-interfaces.pc.in b/phosphor-dbus-interfaces.pc.in
index 3240872..c669aa7 100644
--- a/phosphor-dbus-interfaces.pc.in
+++ b/phosphor-dbus-interfaces.pc.in
@@ -7,5 +7,6 @@
Description: Generated sdbusplus bindings for phosphor-dbus-interfaces.
URL: https://github.com/openbmc/phosphor-dbus-interfaces
Version: @VERSION@
+Requires.private: @AX_PACKAGE_REQUIRES_PRIVATE@
Libs: -L@libdir@ -lphosphor_dbus
Cflags: -I@includedir@