]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Add variable for sed extended RE option (defaults to -E) 2220/head
authordkcasset <dkcasset@del9400.local>
Mon, 29 Jun 2020 20:44:23 +0000 (13:44 -0700)
committerdkcasset <dkcasset@del9400.local>
Mon, 29 Jun 2020 20:44:23 +0000 (13:44 -0700)
lib/Makefile

index 551d3de5b34efcdcc7c128488367c8af79786ffa..4a9ab799ef01e7d4bfd12322e08d5b6d08f5a372 100644 (file)
@@ -49,6 +49,7 @@ ifeq ($HAVE_COLORNEVER, 1)
 GREP_OPTIONS += --color=never
 endif
 GREP = grep $(GREP_OPTIONS)
+SED_ERE_OPT ?= -E
 
 ZSTDCOMMON_FILES := $(sort $(wildcard common/*.c))
 ZSTDCOMP_FILES := $(sort $(wildcard compress/*.c))
@@ -269,13 +270,13 @@ LIBDIR      ?= $(libdir)
 includedir  ?= $(PREFIX)/include
 INCLUDEDIR  ?= $(includedir)
 
-PCLIBDIR ?= $(shell echo "$(LIBDIR)" | sed -n -r -e "s@^$(EXEC_PREFIX)(/|$$)@@p")
-PCINCDIR ?= $(shell echo "$(INCLUDEDIR)" | sed -n -r -e "s@^$(PREFIX)(/|$$)@@p")
+PCLIBDIR ?= $(shell echo "$(LIBDIR)" | sed -n $(SED_ERE_OPT) -e "s@^$(EXEC_PREFIX)(/|$$)@@p")
+PCINCDIR ?= $(shell echo "$(INCLUDEDIR)" | sed -n $(SED_ERE_OPT) -e "s@^$(PREFIX)(/|$$)@@p")
 
 ifeq (,$(PCLIBDIR))
 # Additional prefix check is required, since the empty string is technically a
 # valid PCLIBDIR
-ifeq (,$(shell echo "$(LIBDIR)" | sed -n -r -e "\\@^$(EXEC_PREFIX)(/|$$)@ p"))
+ifeq (,$(shell echo "$(LIBDIR)" | sed -n $(SED_ERE_OPT) -e "\\@^$(EXEC_PREFIX)(/|$$)@ p"))
 $(error configured libdir ($(LIBDIR)) is outside of prefix ($(PREFIX)), can't generate pkg-config file)
 endif
 endif
@@ -283,7 +284,7 @@ endif
 ifeq (,$(PCINCDIR))
 # Additional prefix check is required, since the empty string is technically a
 # valid PCINCDIR
-ifeq (,$(shell echo "$(INCLUDEDIR)" | sed -n -r -e "\\@^$(PREFIX)(/|$$)@ p"))
+ifeq (,$(shell echo "$(INCLUDEDIR)" | sed -n $(SED_ERE_OPT) -e "\\@^$(PREFIX)(/|$$)@ p"))
 $(error configured includedir ($(INCLUDEDIR)) is outside of exec_prefix ($(EXEC_PREFIX)), can't generate pkg-config file)
 endif
 endif
@@ -307,7 +308,7 @@ INSTALL_DATA    ?= $(INSTALL) -m 644
 libzstd.pc:
 libzstd.pc: libzstd.pc.in
        @echo creating pkgconfig
-       $(Q)@sed -r -e 's|@PREFIX@|$(PREFIX)|' \
+       $(Q)@sed $(SED_ERE_OPT) -e 's|@PREFIX@|$(PREFIX)|' \
           -e 's|@LIBDIR@|$(PCLIBDIR)|' \
           -e 's|@INCLUDEDIR@|$(PCINCDIR)|' \
           -e 's|@VERSION@|$(VERSION)|' \