mirror of
https://github.com/uutils/coreutils.git
synced 2025-07-07 13:35:00 +00:00
GNUMakefile: install libstdbuf (#8238)
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:
commit
42339fe191
2 changed files with 14 additions and 1 deletions
|
@ -4,7 +4,7 @@ linker = "x86_64-unknown-redox-gcc"
|
|||
[env]
|
||||
PROJECT_NAME_FOR_VERSION_STRING = "uutils coreutils"
|
||||
# See feat_external_libstdbuf in src/uu/stdbuf/Cargo.toml
|
||||
LIBSTDBUF_DIR = "/usr/lib"
|
||||
LIBSTDBUF_DIR = "/usr/local/libexec/coreutils"
|
||||
|
||||
# libstdbuf must be a shared library, so musl libc can't be linked statically
|
||||
# https://github.com/rust-lang/rust/issues/82193
|
||||
|
|
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