From 01defcade1020f0f149043a722ef8dc440d95546 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Thu, 21 Mar 2019 16:23:12 -0700 Subject: build: Use libnl package config instead of hardcoding We shouldn't be hardcoding paths and link stages against libnl since it provides the needed package config files to do that for us. Tested: Builds and passes unit tests in our unit test container environment. Change-Id: I46277fff25720119c90b827b4a3d7333bbe8766b Signed-off-by: William A. Kennington III --- Makefile.am | 5 ++--- configure.ac | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index fad77d1..726507e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -37,10 +37,9 @@ ncsi_netlink_SOURCES = \ ncsi_netlink_LDFLAGS = \ $(PHOSPHOR_LOGGING_LIBS) \ - -lnl-3 \ - -lnl-genl-3 + $(LIBNL_LIBS) -ncsi_netlink_CPPFLAGS = -isystem /usr/include/libnl3 +ncsi_netlink_CPPFLAGS = $(LIBNL_CFLAGS) ncsi_netlink_CXXFLAGS = -flto diff --git a/configure.ac b/configure.ac index 7035723..8870fcd 100644 --- a/configure.ac +++ b/configure.ac @@ -35,6 +35,7 @@ PKG_CHECK_MODULES([SDEVENTPLUS], [sdeventplus]) AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++]) PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging]) PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces]) +PKG_CHECK_MODULES([LIBNL], [libnl-3.0 libnl-genl-3.0]) # Checks for header files. AC_CHECK_HEADER(systemd/sd-bus.h, ,\ -- cgit v1.2.1