Skip to content

Commit 7381603

Browse files
alyssaisjwcart2
authored andcommitted
policycoreutils: use pkg-config for libsemanage
libaudit and libbz2 are only required to be in the linker path for static builds. For dynamic builds, they'll be discovered through ELF metadata. pkg-config knows how to do the right thing in both cases, so just use it rather than listing libsemanage's dependencies manually. Fixes: da6cd3d ("Support static-only builds") Closes: https://lore.kernel.org/r/[email protected] Signed-off-by: Alyssa Ross <[email protected]> Acked-by: James Carter <[email protected]>
1 parent 5e9c0ee commit 7381603

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

policycoreutils/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ SUBDIRS = setfiles load_policy newrole run_init secon sestatus semodule setseboo
33
PKG_CONFIG ?= pkg-config
44

55
LIBSELINUX_LDLIBS := $(shell $(PKG_CONFIG) --libs libselinux)
6-
export LIBSELINUX_LDLIBS
6+
LIBSEMANAGE_LDLIBS := $(shell $(PKG_CONFIG) --libs libsemanage)
7+
export LIBSELINUX_LDLIBS LIBSEMANAGE_LDLIBS
78

89
all install relabel clean indent:
910
@for subdir in $(SUBDIRS); do \

policycoreutils/semodule/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ MANDIR = $(PREFIX)/share/man
77
CFLAGS ?= -Werror -Wall -W
88
override CFLAGS += -I../../libselinux/include -I../../libsemanage/include
99
override LDFLAGS+= -L../../libselinux/src -L../../libsemanage/src
10-
override LDLIBS += -lsemanage -lsepol $(LIBSELINUX_LDLIBS)
10+
override LDLIBS += $(LIBSEMANAGE_LDLIBS) -lsepol $(LIBSELINUX_LDLIBS)
1111
SEMODULE_OBJS = semodule.o
1212

1313
all: semodule genhomedircon
1414

15-
semodule: LDLIBS += -laudit -lbz2
1615
semodule: $(SEMODULE_OBJS)
1716

1817
genhomedircon:

policycoreutils/setsebool/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ BASHCOMPLETIONDIR ?= $(PREFIX)/share/bash-completion/completions
88
CFLAGS ?= -Werror -Wall -W
99
override CFLAGS += -I../../libselinux/include -I../../libsemanage/include
1010
override LDFLAGS+= -L../../libselinux/src -L../../libsemanage/src
11-
override LDLIBS += -lsemanage $(LIBSELINUX_LDLIBS)
11+
override LDLIBS += $(LIBSEMANAGE_LDLIBS) $(LIBSELINUX_LDLIBS)
1212
SETSEBOOL_OBJS = setsebool.o
1313

1414
BASHCOMPLETIONS=setsebool-bash-completion.sh
1515

1616
all: setsebool
1717

18-
setsebool: LDLIBS += -laudit -lbz2
1918
setsebool: $(SETSEBOOL_OBJS)
2019

2120
install: all

0 commit comments

Comments
 (0)