adopt rfm's combined sed that works across runtimes

This commit is contained in:
Patryk Laurent 2020-02-28 03:41:49 +00:00
parent 29d6accada
commit a3bed018c1

View file

@ -157,27 +157,14 @@ endif
# for portability, so we are sure we only print what we want on all
# platforms.
USING_GNUSTEP_RUNTIME_VERSION_GTE_2_0 := false
ifdef RUNTIME_VERSION
RUNTIME_VERSION_NUMBER :=$(shell echo $(RUNTIME_VERSION) | cut -f2 -d"-")
RUNTIME_VERSION_MAJOR := $(shell echo $(RUNTIME_VERSION_NUMBER) | cut -f1 -d.)
RUNTIME_VERSION_MINOR := $(shell echo $(RUNTIME_VERSION_NUMBER) | cut -f2 -d.)
RUNTIME_VERSION_GTE_2_0 := $(shell [ $(RUNTIME_VERSION_MAJOR) -gt 2 -o $(RUNTIME_VERSION_MAJOR) -eq 2 ] && echo true)
ifeq ($(findstring gnustep,$(RUNTIME_VERSION)), gnustep)
ifeq ($(RUNTIME_VERSION_GTE_2_0), true)
USING_GNUSTEP_RUNTIME_VERSION_GTE_2_0 := true
endif
endif
endif
#
# NB. With the gnustep-2.0 ABI the class name prefix is ._OBJC_CLASS_
# rather than __objc_class_name_ so we search for either.
#
EXTRACT_CLASS_NAMES_COMMAND = $(NM) -Pg $$object_file | sed -n -e '/^__objc_class_name_[A-Za-z0-9_.]* [^U]/ {s/^__objc_class_name_\([A-Za-z0-9_.]*\) [^U].*/\1/p;}' -e '/^\._OBJC_CLASS_[A-Za-z0-9_.]* [^U]/ {s/^\._OBJC_CLASS_\([A-Za-z0-9_.]*\) [^U].*/\1/p;}'
ifeq ($(USING_GNUSTEP_RUNTIME_VERSION_GTE_2_0),true)
EXTRACT_CLASS_NAMES_COMMAND = $(NM) -Pg $$object_file | sed -n -e '/^._OBJC_CLASS_[A-Za-z0-9_.]* [^U]/ {s/^._OBJC_CLASS_\([A-Za-z0-9_.]*\) [^U].*/\1/p;}'
else
EXTRACT_CLASS_NAMES_COMMAND = $(NM) -Pg $$object_file | sed -n -e '/^__objc_class_name_[A-Za-z0-9_.]* [^U]/ {s/^__objc_class_name_\([A-Za-z0-9_.]*\) [^U].*/\1/p;}'
endif
#
# This is the generic version - if the target is not in the following list,
# this setup will be used. It the target does not override variables here