From b14f29ab5b4af971796adc89f292032d124f1c5d Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 24 Apr 2024 13:42:05 +0200 Subject: [PATCH] makefiles: comman escape needs this trick --- libdm/make.tmpl.in | 9 +++++---- make.tmpl.in | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/libdm/make.tmpl.in b/libdm/make.tmpl.in index d545a316a..14e7ee873 100644 --- a/libdm/make.tmpl.in +++ b/libdm/make.tmpl.in @@ -233,19 +233,20 @@ endif endif ifeq ("@HAVE_FULL_RELRO@", "yes") +comma := , ifneq ("@STATIC_LINK@", "yes") -ifeq (,$(findstring -z\,relro,$(LDFLAGS))) +ifeq (,$(findstring -z$(comma)relro,$(LDFLAGS))) LDFLAGS += -Wl,-z,relro endif -ifeq (,$(findstring -z\,now,$(LDFLAGS))) +ifeq (,$(findstring -z$(comma)now,$(LDFLAGS))) LDFLAGS += -Wl,-z,now endif -ifeq (,$(findstring -z\,pack-relative-relocs,$(LDFLAGS))) +ifeq (,$(findstring -z$(comma)pack-relative-relocs,$(LDFLAGS))) LDFLAGS += -Wl,-z,pack-relative-relocs endif # For systems with old readline library that requires extra libs to link with # we stick to default --no-as-needed and we avoid adding --as-needed flag -ifneq (2,$(words $(findstring -l,$(READLINE_LIBS)))) +ifneq (2,$(words $(findstring -l%,$(READLINE_LIBS)))) ifeq (,$(findstring --as-needed,$(LDFLAGS))) LDFLAGS += -Wl,--as-needed endif diff --git a/make.tmpl.in b/make.tmpl.in index 0ac51c292..c1014145d 100644 --- a/make.tmpl.in +++ b/make.tmpl.in @@ -270,19 +270,20 @@ endif endif ifeq ("@HAVE_FULL_RELRO@", "yes") +comma := , ifneq ("@STATIC_LINK@", "yes") -ifeq (,$(findstring -z\,relro,$(LDFLAGS))) +ifeq (,$(findstring -z$(comma)relro,$(LDFLAGS))) LDFLAGS += -Wl,-z,relro endif -ifeq (,$(findstring -z\,now,$(LDFLAGS))) +ifeq (,$(findstring -z$(comma)now,$(LDFLAGS))) LDFLAGS += -Wl,-z,now endif -ifeq (,$(findstring -z\,pack-relative-relocs,$(LDFLAGS))) +ifeq (,$(findstring -z$(comma)pack-relative-relocs,$(LDFLAGS))) LDFLAGS += -Wl,-z,pack-relative-relocs endif # For systems with old readline library that requires extra libs to link with # we stick to default --no-as-needed and we avoid adding --as-needed flag -ifneq (2,$(words $(findstring -l,$(READLINE_LIBS)))) +ifneq (2,$(words $(findstring -l%,$(READLINE_LIBS)))) ifeq (,$(findstring --as-needed,$(LDFLAGS))) LDFLAGS += -Wl,--as-needed endif