-
Notifications
You must be signed in to change notification settings - Fork 381
Open
Description
Hi SELinux maintainers,
While cross-compiling libsepol for an embedded target, I noticed an inconsistency in the installation paths defined in the top-level Makefile:
- Static library (
libsepol.a
) and.pc
file are installed to:
$(DESTDIR)$(LIBDIR)
→ typically/usr/lib
underPREFIX
- Shared library (
libsepol.so.X.Y
) is installed to:
$(DESTDIR)$(SHLIBDIR)
→ hardcoded as/lib
, outside ofPREFIX
This causes the actual .so
file to be installed into my host system’s /lib
, rather than under the intended staging directory ($(PREFIX)/lib
), which breaks packaging and pollutes the host system during cross-compilation.
Here's the Makefile in the src directory of the libsepol source:
PREFIX ?= /usr
INCLUDEDIR ?= $(PREFIX)/include
LIBDIR ?= $(PREFIX)/lib
SHLIBDIR ?= /lib
RANLIB ?= ranlib
CILDIR ?= ../cil
......
install: all
test -d $(DESTDIR)$(LIBDIR) || install -m 755 -d $(DESTDIR)$(LIBDIR)
install -m 644 $(LIBA) $(DESTDIR)$(LIBDIR)
test -d $(DESTDIR)$(LIBDIR)/pkgconfig || install -m 755 -d $(DESTDIR)$(LIBDIR)/pkgconfig
install -m 644 $(LIBPC) $(DESTDIR)$(LIBDIR)/pkgconfig
ifneq ($(DISABLE_SHARED),y)
test -d $(DESTDIR)$(SHLIBDIR) || install -m 755 -d $(DESTDIR)$(SHLIBDIR)
install -m 755 $(LIBSO) $(DESTDIR)$(SHLIBDIR)
$(LN) -sf --relative $(DESTDIR)$(SHLIBDIR)/$(LIBSO) $(DESTDIR)$(LIBDIR)/$(TARGET)
endif
Metadata
Metadata
Assignees
Labels
No labels