]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
share/mk/: Escape '#' in regexes
authorAlejandro Colomar <alx@kernel.org>
Mon, 10 Feb 2025 10:56:01 +0000 (11:56 +0100)
committerAlejandro Colomar <alx@kernel.org>
Mon, 10 Feb 2025 11:51:03 +0000 (12:51 +0100)
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 <boris.pigin@gmail.com>
Cc: Sam James <sam@gentoo.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
share/mk/configure/build-depends/cpp/cpp.mk
share/mk/src/sh.mk

index 367be0c5c1fb2008cc74c4a6cc8b86ea0db5b239..01b209d9c6c9e3929420e6dacd7159ce0a08db20 100644 (file)
@@ -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 \
+               | $(GREP) '\#define _FORTIFY_SOURCE ' >/dev/null \
                && $(ECHO) yes \
                || $(ECHO) no; \
        )
index 487eaf14d629661b3efac17d3f463a516d6e890b..05c9e0449d8fec1d62e81a0a84f5e9fcafcac8c9 100644 (file)
@@ -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))