mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
GNUMakefile: install libstdbuf
Use external libstdbuf.so when building with make, as embedding the library is only needed to work around "cargo install" limitations with shared libraries. Also change default installation directory to /usr/local/libexec/coreutils/ for consistency with GNU coreutils Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
This commit is contained in:
parent
f825409392
commit
e1441eff2c
2 changed files with 14 additions and 1 deletions
13
GNUmakefile
13
GNUmakefile
|
@ -33,6 +33,9 @@ PREFIX ?= /usr/local
|
|||
DESTDIR ?=
|
||||
BINDIR ?= $(PREFIX)/bin
|
||||
DATAROOTDIR ?= $(PREFIX)/share
|
||||
LIBSTDBUF_DIR ?= $(PREFIX)/libexec/coreutils
|
||||
# Export variable so that it is used during the build
|
||||
export LIBSTDBUF_DIR
|
||||
|
||||
INSTALLDIR_BIN=$(DESTDIR)$(BINDIR)
|
||||
|
||||
|
@ -199,6 +202,8 @@ ifneq ($(OS),Windows_NT)
|
|||
PROGS := $(PROGS) $(UNIX_PROGS)
|
||||
# Build the selinux command even if not on the system
|
||||
PROGS := $(PROGS) $(SELINUX_PROGS)
|
||||
# Always use external libstdbuf when building with make (Unix only)
|
||||
CARGOFLAGS += --features feat_external_libstdbuf
|
||||
endif
|
||||
|
||||
UTILS ?= $(PROGS)
|
||||
|
@ -438,6 +443,10 @@ endif
|
|||
|
||||
install: build install-manpages install-completions install-locales
|
||||
mkdir -p $(INSTALLDIR_BIN)
|
||||
ifneq ($(OS),Windows_NT)
|
||||
mkdir -p $(DESTDIR)$(LIBSTDBUF_DIR)
|
||||
$(INSTALL) -m 755 $(BUILDDIR)/deps/libstdbuf* $(DESTDIR)$(LIBSTDBUF_DIR)/
|
||||
endif
|
||||
ifeq (${MULTICALL}, y)
|
||||
$(INSTALL) $(BUILDDIR)/coreutils $(INSTALLDIR_BIN)/$(PROG_PREFIX)coreutils
|
||||
$(foreach prog, $(filter-out coreutils, $(INSTALLEES)), \
|
||||
|
@ -452,6 +461,10 @@ else
|
|||
endif
|
||||
|
||||
uninstall:
|
||||
ifneq ($(OS),Windows_NT)
|
||||
rm -f $(DESTDIR)$(LIBSTDBUF_DIR)/libstdbuf*
|
||||
-rmdir $(DESTDIR)$(LIBSTDBUF_DIR) 2>/dev/null || true
|
||||
endif
|
||||
ifeq (${MULTICALL}, y)
|
||||
rm -f $(addprefix $(INSTALLDIR_BIN)/,$(PROG_PREFIX)coreutils)
|
||||
endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue