Skip to content

Commit

Permalink
build: use libtool for convenience libraries
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
garlick committed Jan 17, 2024
1 parent fe747cb commit 0277aef
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 19 deletions.
8 changes: 4 additions & 4 deletions src/libcommon/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions src/liblsd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion src/plmpower/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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

15 changes: 8 additions & 7 deletions src/powerman/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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

Expand All @@ -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 = \
Expand Down
4 changes: 2 additions & 2 deletions src/redfishpower/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion src/snmppower/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0277aef

Please sign in to comment.