From 0277aef46b3a0eb3cee883f23bfa22e209901d61 Mon Sep 17 00:00:00 2001 From: Jim Garlick Date: Tue, 16 Jan 2024 22:19:06 -0800 Subject: [PATCH] build: use libtool for convenience libraries Problem: libtool is used to build the installed libpowerman library, but not convenience libraries which could lead to problems. Right now the API is disjoint from the rest of powerman but if it were to use convenience libraries, we could run into trouble with non-PIC code. Use libtool for the whole project. --- src/libcommon/Makefile.am | 8 ++++---- src/liblsd/Makefile.am | 4 ++-- src/plmpower/Makefile.am | 2 +- src/powerman/Makefile.am | 15 ++++++++------- src/redfishpower/Makefile.am | 4 ++-- src/snmppower/Makefile.am | 2 +- test/Makefile.am | 4 ++-- 7 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am index 1de04a10..f6128cbd 100644 --- a/src/libcommon/Makefile.am +++ b/src/libcommon/Makefile.am @@ -3,9 +3,9 @@ AM_CFLAGS = @WARNING_CFLAGS@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/liblsd -noinst_LIBRARIES = libcommon.a +noinst_LTLIBRARIES = libcommon.la -libcommon_a_SOURCES = \ +libcommon_la_SOURCES = \ argv.c \ argv.h \ debug.c \ @@ -45,12 +45,12 @@ test_argv_t_CPPFLAGS = \ -I$(top_srcdir)/src/libtap test_argv_t_SOURCES = test/argv.c test_argv_t_LDADD = \ - $(builddir)/libcommon.a \ + $(builddir)/libcommon.la \ $(top_builddir)/src/libtap/libtap.la test_xregex_t_CPPFLAGS = \ -I$(top_srcdir)/src/libtap test_xregex_t_SOURCES = test/xregex.c test_xregex_t_LDADD = \ - $(builddir)/libcommon.a \ + $(builddir)/libcommon.la \ $(top_builddir)/src/libtap/libtap.la diff --git a/src/liblsd/Makefile.am b/src/liblsd/Makefile.am index fa4bcb66..d56fa88b 100644 --- a/src/liblsd/Makefile.am +++ b/src/liblsd/Makefile.am @@ -5,9 +5,9 @@ AM_CFLAGS = \ AM_CPPFLAGS = -noinst_LIBRARIES = liblsd.a +noinst_LTLIBRARIES = liblsd.la -liblsd_a_SOURCES = \ +liblsd_la_SOURCES = \ hostlist.c \ hostlist.h \ list.c \ diff --git a/src/plmpower/Makefile.am b/src/plmpower/Makefile.am index 74ae3df5..99916b66 100644 --- a/src/plmpower/Makefile.am +++ b/src/plmpower/Makefile.am @@ -8,5 +8,5 @@ sbin_PROGRAMS = plmpower plmpower_SOURCES = plmpower.c plmpower_LDADD = \ - $(top_builddir)/src/libcommon/libcommon.a + $(top_builddir)/src/libcommon/libcommon.la diff --git a/src/powerman/Makefile.am b/src/powerman/Makefile.am index 90756090..91d37b45 100644 --- a/src/powerman/Makefile.am +++ b/src/powerman/Makefile.am @@ -21,8 +21,8 @@ powerman_SOURCES = \ powerman.c powerman_LDADD = \ - $(top_builddir)/src/liblsd/liblsd.a \ - $(top_builddir)/src/libcommon/libcommon.a \ + $(top_builddir)/src/liblsd/liblsd.la \ + $(top_builddir)/src/libcommon/libcommon.la \ $(LIBGENDERS) \ $(LIBFORKPTY) @@ -57,9 +57,10 @@ powermand_SOURCES = \ powermand.c powermand_LDADD = \ - $(top_builddir)/src/liblsd/liblsd.a \ - $(top_builddir)/src/libcommon/libcommon.a \ - $(LIBWRAP) $(LIBFORKPTY) + $(top_builddir)/src/liblsd/liblsd.la \ + $(top_builddir)/src/libcommon/libcommon.la \ + $(LIBWRAP) \ + $(LIBFORKPTY) AM_YFLAGS = -d @@ -80,8 +81,8 @@ check_PROGRAMS = \ test_pluglist_SOURCES = test/pluglist.c test_pluglist_LDADD = \ $(builddir)/pluglist.o \ - $(top_builddir)/src/libcommon/libcommon.a \ - $(top_builddir)/src/liblsd/liblsd.a + $(top_builddir)/src/libcommon/libcommon.la \ + $(top_builddir)/src/liblsd/liblsd.la test_apiclient_SOURCES = test/apiclient.c test_apiclient_LDADD = \ diff --git a/src/redfishpower/Makefile.am b/src/redfishpower/Makefile.am index 64585318..731d8e45 100644 --- a/src/redfishpower/Makefile.am +++ b/src/redfishpower/Makefile.am @@ -8,7 +8,7 @@ sbin_PROGRAMS = redfishpower redfishpower_SOURCES = redfishpower.c redfishpower_LDADD = \ - $(top_builddir)/src/liblsd/liblsd.a \ - $(top_builddir)/src/libcommon/libcommon.a \ + $(top_builddir)/src/liblsd/liblsd.la \ + $(top_builddir)/src/libcommon/libcommon.la \ $(LIBCURL) \ $(LIBJANSSON) diff --git a/src/snmppower/Makefile.am b/src/snmppower/Makefile.am index b7c6c07b..b972da39 100644 --- a/src/snmppower/Makefile.am +++ b/src/snmppower/Makefile.am @@ -7,6 +7,6 @@ sbin_PROGRAMS = snmppower snmppower_SOURCES = snmppower.c snmppower_LDADD = \ - $(top_builddir)/src/libcommon/libcommon.a \ + $(top_builddir)/src/libcommon/libcommon.la \ $(LIBNETSNMP) \ $(LIBFORKPTY) diff --git a/test/Makefile.am b/test/Makefile.am index 90e983b7..5a3f0372 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -43,8 +43,8 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/powerman common_ldadd = \ - $(top_builddir)/src/liblsd/liblsd.a \ - $(top_builddir)/src/libcommon/libcommon.a \ + $(top_builddir)/src/liblsd/liblsd.la \ + $(top_builddir)/src/libcommon/libcommon.la \ $(LIBFORKPTY) vpcd_SOURCES = vpcd.c