1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

makefiles: change condition

Old system do not work well with -l% in findstring,
so use a different strategy to recognize whether -lreadline needs
another library (-ltinfo, -lncourses...)
(So we don't need to solve this via 'configure')

Also for now comment out -Wl,-z,pack-relative-relocs and leave it
for the package maintainer whether they want to use.
Possibly add some 'configure' autodetection for usable switch,
as it's relatively new feature..
This commit is contained in:
Zdenek Kabelac 2024-04-24 20:48:27 +02:00
parent 68a8555d69
commit b0c0e8bd7a
2 changed files with 12 additions and 8 deletions

View File

@ -241,12 +241,14 @@ endif
ifeq (,$(findstring -z$(comma)now,$(LDFLAGS)))
LDFLAGS += -Wl,-z,now
endif
ifeq (,$(findstring -z$(comma)pack-relative-relocs,$(LDFLAGS)))
LDFLAGS += -Wl,-z,pack-relative-relocs
endif
# TODO: think about configure option for this flag
# for now leave decision on distro maitainer
#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 (-l,$(findstring -l,$(filter-out %readline,$(READLINE_LIBS))))
ifeq (,$(findstring --as-needed,$(LDFLAGS)))
LDFLAGS += -Wl,--as-needed
endif

View File

@ -278,12 +278,14 @@ endif
ifeq (,$(findstring -z$(comma)now,$(LDFLAGS)))
LDFLAGS += -Wl,-z,now
endif
ifeq (,$(findstring -z$(comma)pack-relative-relocs,$(LDFLAGS)))
LDFLAGS += -Wl,-z,pack-relative-relocs
endif
# TODO: think about configure option for this flag
# for now leave decision on distro maitainer
#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 (-l,$(findstring -l,$(filter-out %readline,$(READLINE_LIBS))))
ifeq (,$(findstring --as-needed,$(LDFLAGS)))
LDFLAGS += -Wl,--as-needed
endif