Skip to content

Commit e3d270b

Browse files
committed
Policycoreutils: Make pkg-config work for more types of builds
To support static builds, pkg-config is used to add the libraries needed for libselinux and libsemanage during the build. Unforunately, pkg-config will always use the installed pc files for libselinux and libsemanage. Instead set PKG_CONFIG_PATH when invoking pkg-config so that it searches in order: 1) The directory specified by PKG_CONFIG_PATH, if already set. 2) The local src directories of libselinux and libsemaange. 3) The default directories specified by the system. Signed-off-by: James Carter <[email protected]>
1 parent 7381603 commit e3d270b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

policycoreutils/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ SUBDIRS = setfiles load_policy newrole run_init secon sestatus semodule setseboo
22

33
PKG_CONFIG ?= pkg-config
44

5-
LIBSELINUX_LDLIBS := $(shell $(PKG_CONFIG) --libs libselinux)
6-
LIBSEMANAGE_LDLIBS := $(shell $(PKG_CONFIG) --libs libsemanage)
5+
LIBSELINUX_LDLIBS := $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH):../libselinux/src" $(PKG_CONFIG) --libs libselinux)
6+
LIBSEMANAGE_LDLIBS := $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH):../libsemanage/src" $(PKG_CONFIG) --libs libsemanage)
77
export LIBSELINUX_LDLIBS LIBSEMANAGE_LDLIBS
88

99
all install relabel clean indent:

0 commit comments

Comments
 (0)