From: Alejandro Colomar Date: Mon, 10 Feb 2025 10:56:01 +0000 (+0100) Subject: share/mk/: Escape '#' in regexes X-Git-Tag: man-pages-6.11~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76f12e3fd3eab022f4f4d608c9a8e4d80cb81fd2;p=thirdparty%2Fman-pages.git share/mk/: Escape '#' in regexes GNU make(1) 4.2 seems to be interpreting those characters as the start of a comment, so we need to escape them. That seems to calm those old versions of make(1), and doesn't affect negatively the newer ones, and doesn't affect negatively grep(1) either. Fixes: 35a780a99bd8 (2024-07-20; "share/mk/: CPPFLAGS: Only define _FORTIFY_SOURCE if it's not already defined") Fixes: 2130162900ab (2024-11-03; "share/mk/, etc/shellcheck/: lint-sh: Add target to lint shell scripts") Reported-by: Boris Pigin Cc: Sam James Signed-off-by: Alejandro Colomar --- diff --git a/share/mk/configure/build-depends/cpp/cpp.mk b/share/mk/configure/build-depends/cpp/cpp.mk index 367be0c5c..01b209d9c 100644 --- a/share/mk/configure/build-depends/cpp/cpp.mk +++ b/share/mk/configure/build-depends/cpp/cpp.mk @@ -19,7 +19,7 @@ CPP := $(CC) $(CFLAGS_) -E CPP_HAS_ALREADY_D_FORTIFY_SOURCE := \ $(shell \ $(CPP) -dM - -Wno-error /dev/null \ + | $(GREP) '\#define _FORTIFY_SOURCE ' >/dev/null \ && $(ECHO) yes \ || $(ECHO) no; \ ) diff --git a/share/mk/src/sh.mk b/share/mk/src/sh.mk index 487eaf14d..05c9e0449 100644 --- a/share/mk/src/sh.mk +++ b/share/mk/src/sh.mk @@ -14,7 +14,7 @@ include $(MAKEFILEDIR)/configure/directory_variables/src.mk BIN_sh := $(shell $(FIND) $(SRCBINDIR) -type f \ - | $(XARGS) $(GREP) -l '^#!/bin/\(sh\|bash\)\>' \ + | $(XARGS) $(GREP) -l '^\#!/bin/\(sh\|bash\)\>' \ | $(SORT))