8000 GNUMakefile: install libstdbuf · uutils/coreutils@5070e5f · GitHub
[go: up one dir, main page]

Skip to content

Commit 5070e5f

Browse files
committed
GNUMakefile: install libstdbuf
When installing with GNUMakefile, enabling feat_external_libstdbuf is the better option, because embedding libstdbuf inside the stdbuf binary is advantageous only for working around limitations of "cargo install", which can't install C shared libraries. Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
1 parent f825409 commit 5070e5f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

GNUmakefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,19 @@ else
436436
install-locales:
437437
endif
438438

439+
ifneq ($(OS),Windows_NT)
440+
CARGOFLAGS += --features feat_external_libstdbuf
441+
endif
442+
443+
# Use the same default as in .cargo/config.toml
444+
LIBSTDBUF_DIR ?= /usr/lib
445+
439446
install: build install-manpages install-completions install-locales
440447
mkdir -p $(INSTALLDIR_BIN)
448+
ifneq ($(OS),Windows_NT)
449+
mkdir -p $(DESTDIR)$(LIBSTDBUF_DIR)
450+
cp $(BUILDDIR)/deps/libstdbuf* $(DESTDIR)$(LIBSTDBUF_DIR)/
451+
endif
441452
ifeq (${MULTICALL}, y)
442453
$(INSTALL) $(BUILDDIR)/coreutils $(INSTALLDIR_BIN)/$(PROG_PREFIX)coreutils
443454
$(foreach prog, $(filter-out coreutils, $(INSTALLEES)), \
@@ -452,6 +463,10 @@ else
452463
endif
453464

454465
uninstall:
466+
ifneq ($(OS),Windows_NT)
467+
rm -f $(DESTDIR)$(LIBSTDBUF_DIR)/libstdbuf*
468+
-rmdir $(DESTDIR)$(LIBSTDBUF_DIR) 2>/dev/null || true
469+
endif
455470
ifeq (${MULTICALL}, y)
456471
rm -f $(addprefix $(INSTALLDIR_BIN)/,$(PROG_PREFIX)coreutils)
457472
endif

0 commit comments

Comments
 (0)
0