Diff options
Diffstat (limited to '')
-rw-r--r--source/cgit.mk15
1 file changed, 8 insertions, 7 deletions
diff --git a/source/cgit.mk b/source/cgit.mk
index 0786086..66b94d3 100644
--- a/source/cgit.mk
+++ b/source/cgit.mk
@@ -4,9 +4,7 @@
# through CGIT_ROOT. The top level Makefile invokes it roughly as
#
# make -C vendor/git -f ../../source/cgit.mk ../../build/cgit
-#
-# so sources are read from ../../source and all output is written to
-# ../../build.
+
include Makefile
# BUILDDIR is named relative to the project root because the version recipe
@@ -64,8 +62,11 @@ ifdef NO_LUA
LUA_MESSAGE := linking without specified Lua support
CGIT_CFLAGS += -DNO_LUA
else
+# Each system names Lua's package its own way: lua5.4 on Debian and Alpine,
+# lua-5.4 on FreeBSD and NetBSD, lua54 on OpenBSD.
ifeq ($(LUA_PKGCONFIG),)
- LUA_PKGCONFIG := $(shell for pc in luajit lua lua5.5 lua5.4 lua5.3 lua5.2 lua5.1; do \
+ LUA_PKGCONFIG := $(shell for pc in luajit lua lua5.5 lua5.4 lua5.3 lua5.2 lua5.1 \
+ lua-5.5 lua-5.4 lua-5.3 lua-5.2 lua-5.1 lua55 lua54 lua53 lua52 lua51; do \
$(PKG_CONFIG) --exists $$pc 2>/dev/null && echo $$pc && break; \
done)
LUA_MODE := autodetected
@@ -158,9 +159,9 @@ $(CGIT_BUILD)/.depend:
$(CGIT_BUILD)/CGIT-CFLAGS: FORCE
@mkdir -p $(CGIT_BUILD)/
@FLAGS='$(subst ','\'',$(CGIT_CFLAGS))'; \
- OLD=`cat $(CGIT_BUILD)/CGIT-CFLAGS 2>/dev/null`; \
- if test x"$$FLAGS" != x"$$OLD"; then \
- echo 1>&2 " * new CGit build flags"; \
+ OLD=$$(cat $(CGIT_BUILD)/CGIT-CFLAGS 2>/dev/null); \
+ if test "$$FLAGS" != "$$OLD"; then \
+ echo 1>&2 " * new cgit build flags"; \
echo "$$FLAGS" >$(CGIT_BUILD)/CGIT-CFLAGS; \
fi