]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: makefile: fix build error with GNU make 4.2.1 and /bin/dash
authorWilly Tarreau <w@1wt.eu>
Wed, 3 Jun 2026 10:01:47 +0000 (12:01 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 3 Jun 2026 10:04:21 +0000 (12:04 +0200)
The latest fix in the Makefile in commit 9993688954 ("BUILD: makefile/lua:
use the system's default library before all other variants") broke the
build on a machine with GNU make 4.2.1 and /bin/dash:

  Makefile:690: *** unterminated call to function 'shell': missing ')'.  Stop.

It's caused by the '#' in '#include'. Protecting it with a backslash
fixes the make issue but moves it to the shell where it's echoed in the
output. Printf '\043' works but not sure if it's everywhere yet. At this
point better just revert that tiny part which was made to refine the
presence check for lua.h by checking that it contains valid C code. If
the commit above is backported, this one will have to be as well.

Makefile

index e33f8f4c5342a33698fa71df7e59dcad2ffd23b6..64cce20a8f430d71027a4918a7f4ccacb7a2a483 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -687,7 +687,7 @@ ifneq ($(USE_LUA:0=),)
   check_lua_inc = $(shell if [ ! -e /usr/include/lua.h -a -e $(2)$(1)/lua.h ]; then echo $(2)$(1); fi;)
   LUA_INC      := $(firstword $(foreach lib,lua5.5 lua55 lua5.4 lua54 lua5.3 lua53 lua,$(call check_lua_inc,$(lib),"/usr/include/")))
 
-  check_lua_lib = $(shell (echo "#include <lua.h>";echo "int main(){}") | $(CC) $(if $(LUA_INC),-I$(LUA_INC)) -o /dev/null -x c - $(2) -l$(1) 2>/dev/null && echo $(1))
+  check_lua_lib = $(shell echo "int main(){}" | $(CC) $(if $(LUA_INC),-I$(LUA_INC)) -o /dev/null -x c - $(2) -l$(1) 2>/dev/null && echo $(1))
   LUA_LD_FLAGS := -Wl,$(if $(EXPORT_SYMBOL),$(EXPORT_SYMBOL),--export-dynamic) $(if $(LUA_LIB),-L$(LUA_LIB))
 
   # Try to automatically detect the Lua library if not set