makefile prefix fixes
PATCH 1/1 makefile prefix fixes
This patch fixes prefix in recently changed Makefiles so that make DESTDIR=somedir will work.
src/Makefile +1 -1
@@ -23,7 +23,7 @@ $(LIBA): $(OBJS) $(RANLIB) $@ $(LIBSO): $(LOBJS) - $(CC) $(LDFLAGS) -shared -o $@ $^ -ldl -lsepol -Wl,-soname,$(LIBSO),-z,defs + $(CC) $(LDFLAGS) -shared -o $@ $^ -ldl -lsepol -L$(LIBDIR) -Wl,-soname,$(LIBSO),-z,defs ln -sf $@ $(TARGET) %.o: %.c policy.h
utils/Makefile +2 -1
@@ -1,10 +1,11 @@ # Installation directories. PREFIX ?= $(DESTDIR)/usr +LIBDIR ?= $(PREFIX)/lib BINDIR ?= $(PREFIX)/sbin CFLAGS ?= -Wall override CFLAGS += -I../include -D_GNU_SOURCE -LDLIBS += -L../src -lselinux +LDLIBS += -L../src -lselinux -lsepol -L$(LIBDIR) TARGETS=$(patsubst %.c,%,$(wildcard *.c))
src/Makefile +1 -1
@@ -35,7 +35,7 @@ $(LIBA): $(OBJS) ranlib $@ $(LIBSO): $(LOBJS) - $(CC) $(LDFLAGS) -shared -o $@ $^ -lsepol -lselinux -Wl,-soname,$(LIBSO),--version-script=libsemanage.map,-z,defs + $(CC) $(LDFLAGS) -shared -o $@ $^ -lsepol -lselinux -L$(LIBDIR) -Wl,-soname,$(LIBSO),--version-script=libsemanage.map,-z,defs ln -sf $@ $(TARGET) conf-scan.c: conf-scan.l conf-parse.h
audit2why/Makefile +1 -1
@@ -9,7 +9,7 @@ INCLUDEDIR ?= ${PREFIX}/include CFLAGS ?= -Werror -Wall -W override CFLAGS += -I$(INCLUDEDIR) -LDLIBS = ${LIBDIR}/libsepol.a -lselinux -L$(LIBDIR) +LDLIBS = ${LIBDIR}/libsepol.a -lselinux -lsepol -L$(LIBDIR) TARGETS=audit2why
newrole/Makefile +1 -1
@@ -8,7 +8,7 @@ PAMH = $(shell ls /usr/include/security/ CFLAGS ?= -Werror -Wall -W override CFLAGS += $(LDFLAGS) -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\"" -LDLIBS += -lselinux -L$(PREFIX)/lib +LDLIBS += -lselinux -lsepol -L$(PREFIX)/lib ifeq (${PAMH}, /usr/include/security/pam_appl.h) override CFLAGS += -DUSE_PAM LDLIBS += -lpam -lpam_misc
restorecon/Makefile +1 -1
@@ -5,7 +5,7 @@ MANDIR = $(PREFIX)/share/man CFLAGS ?= -Werror -Wall -W override CFLAGS += -I$(PREFIX)/include -D_FILE_OFFSET_BITS=64 -LDLIBS += -lselinux -L$(PREFIX)/lib +LDLIBS += -lselinux -lsepol -L$(PREFIX)/lib all: restorecon
run_init/Makefile +1 -1
@@ -9,7 +9,7 @@ PAMH = $(shell ls /usr/include/security/ CFLAGS ?= -Werror -Wall -W override CFLAGS += -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\"" -LDLIBS += -lselinux -L$(PREFIX)/lib +LDLIBS += -lselinux -lsepol -L$(PREFIX)/lib ifeq (${PAMH}, /usr/include/security/pam_appl.h) override CFLAGS += -DUSE_PAM LDLIBS += -lpam -lpam_misc
sestatus/Makefile +1 -1
@@ -7,7 +7,7 @@ LIBDIR ?= ${PREFIX}/lib CFLAGS = -Werror -Wall -W override CFLAGS += -I$(PREFIX)/include -D_FILE_OFFSET_BITS=64 -LDLIBS = -lselinux -L$(LIBDIR) +LDLIBS = -lselinux -lsepol -L$(LIBDIR) all: sestatus
Quoted 2 lines · Joshua Brindle
This patch fixes prefix in recently changed Makefiles so that make DESTDIR=somedir will work.
I noticed this issue as well, but I'm not sure about the right fix. Adding -lsepol after every occurrence of -lselinux in the utility Makefiles seems wrong when the actual dependency on libsepol only exists for load_policy.o in libselinux and none of those utilities require the functions in that object. Do we need to do something different in the libselinux build to isolate the dependency
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 2 lines · Joshua Brindle
This patch fixes prefix in recently changed Makefiles so that make DESTDIR=somedir will work.
Merged for now, but I find it troubling that we have to link with -lsepol for all users of libselinux just because one of its functions is using sepol. Something isn't right there, likely a problem in libselinux.
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.