[PATCH 1/1] opal: fix tests dependency on libfdt

Erico Nunes ernunes at redhat.com
Thu May 25 15:03:41 UTC 2017


The inclusion of some tests in src/opal/ in the latest fwts release
added a hard dependency on libfdt-devel for all architectures, otherwise
breaking the build.
libfdt-devel may not be available or wanted for all architectures, for
example it is not officially distributed with RHEL x86_64.

fwts already had an optional dependency on libfdt before and this is
handled through the use of HAVE_LIBFDT.
This handling was already done for some of the opal tests but the new
ones were trying to build regardless of HAVE_LIBFDT. This patch moves
the new ones along with the tests which will only be built if
HAVE_LIBFDT gets set during configuration, as they rely heavily on it.

Signed-off-by: Erico Nunes <ernunes at redhat.com>
Cc: Pridhiviraj Paidipeddi <ppaidipe at linux.vnet.ibm.com>
Signed-off-by: Erico Nunes <ernunes at redhat.com>
---
 src/Makefile.am            | 8 +++++---
 src/opal/power_mgmt_info.c | 2 --
 src/opal/reserv_mem.c      | 2 --
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 2c2795e..e5537b4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -25,9 +25,12 @@ dt_tests = \
 	devicetree/dt_base/dt_base.c		\
 	devicetree/dt_sysinfo/dt_sysinfo.c
 mem_tests = \
-	opal/mem_info.c
+	opal/mem_info.c				\
+	opal/reserv_mem.c
 cpu_tests = \
 	opal/cpu_info.c
+power_mgmt_tests = \
+	opal/power_mgmt_info.c
 endif
 
 if HAVE_LIBFDT
@@ -147,8 +150,6 @@ fwts_SOURCES = main.c 				\
 	kernel/version/version.c 		\
 	opal/mtd_info.c				\
 	opal/prd_info.c				\
-	opal/power_mgmt_info.c			\
-	opal/reserv_mem.c			\
 	pci/aspm/aspm.c 			\
 	pci/crs/crs.c 				\
 	pci/maxreadreq/maxreadreq.c 		\
@@ -166,6 +167,7 @@ fwts_SOURCES = main.c 				\
 	$(pci_tests)				\
 	$(mem_tests)				\
 	$(cpu_tests)				\
+	$(power_mgmt_tests)			\
 	$(dt_tests)
 
 fwts_LDFLAGS = -lm `pkg-config --libs glib-2.0 gio-2.0`
diff --git a/src/opal/power_mgmt_info.c b/src/opal/power_mgmt_info.c
index 5456c43..b83b93b 100644
--- a/src/opal/power_mgmt_info.c
+++ b/src/opal/power_mgmt_info.c
@@ -24,9 +24,7 @@
 
 #include "fwts.h"
 
-#ifdef HAVE_LIBFDT
 #include <libfdt.h>
-#endif
 
 #define MAX_PSTATES 256
 
diff --git a/src/opal/reserv_mem.c b/src/opal/reserv_mem.c
index 49e14c4..4199448 100644
--- a/src/opal/reserv_mem.c
+++ b/src/opal/reserv_mem.c
@@ -24,9 +24,7 @@
 
 #include "fwts.h"
 
-#ifdef HAVE_LIBFDT
 #include <libfdt.h>
-#endif
 
 #define CONFIG_FILENAME "/usr/local/share/fwts/platform.conf"
 #define MAXBUF 1024
-- 
2.9.3




More information about the fwts-devel mailing list