Welcome to little lamb

Code » comain » commit 05290fb

Fix installing empty so/a file with --no-shared/--no-static

author Olivier Brunel
2023-07-18 13:00:37 UTC
committer Olivier Brunel
2023-07-18 16:29:11 UTC
parent 6ce13ccccb20b452ff23db8364cb7912dffeecda

Fix installing empty so/a file with --no-shared/--no-static

common.mk +7 -2
configure +3 -0

diff --git a/common.mk b/common.mk
index 9b1b655..4fa0126 100644
--- a/common.mk
+++ b/common.mk
@@ -26,8 +26,6 @@ BLD_BINS =
 # and we don't expect to go any deeper than that.
 DEPS = $(wildcard build/*/*.d) $(wildcard build/*/*/*.d)
 LIBS =
-STATIC_LIBS = $(LIBS:%=lib%.a)
-SHARED_LIBS = $(LIBS:%=lib%.so)
 BINS =
 PRIV_LIBS =
 PRIV_STATIC_LIBS = $(PRIV_LIBS:%=lib%.a)
@@ -132,6 +130,13 @@ include project.mk
 # binary-specific deps
 DEPS += $(BLD_BINS:%=%.d)
 
+ifeq ($(NOSTATIC),0)
+STATIC_LIBS = $(LIBS:%=lib%.a)
+endif
+ifeq ($(NOSHARED),0)
+SHARED_LIBS = $(LIBS:%=lib%.so)
+endif
+
 # install binaries
 $(DESTDIR)$(BINDIR)/%: %
 	$(_INST) install -D -m 755 $< $@
diff --git a/configure b/configure
index 3492174..c75b3b9 100755
--- a/configure
+++ b/configure
@@ -802,6 +802,9 @@ CC = $CC
 AR = $AR
 RANLIB = $RANLIB
 
+NOSHARED := $noshared
+NOSTATIC := $nostatic
+
 EOF
 
 if test -n "$BITS"; then