Mangle framework names into ObjC class names so that '-' can be used

in a framework name


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@21454 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2005-07-12 14:09:13 +00:00
parent 47d70b98a3
commit 6b5df04544
2 changed files with 28 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2005-07-12 Nicola Pero <n.pero@mi.flashnet.it>
* Instance/framework.make (DUMMY_FRAMEWORK): Mangle
framework names into valid ObjC class names.
2005-07-12 Nicola Pero <n.pero@mi.flashnet.it>
* Documentation/README.MinGW: Updated.

View file

@ -137,9 +137,30 @@ INTERNAL_LIBRARIES_DEPEND_UPON = \
libext=$(LIBEXT) shared_libext=$(SHARED_LIBEXT))
ifeq ($(FOUNDATION_LIB),gnu)
# On GNUstep, build our dummy class to store information which
# gnustep-base can find at run time
DUMMY_FRAMEWORK = NSFramework_$(GNUSTEP_INSTANCE)
# gnustep-base can find at run time.
# An ObjC class name can not contain '-', but some people '-' this
# in framework names. So we need to encode the '-' in some way
# into an ObjC class name. (since we're there, we also encode '+'
# even if that's not really common).
# What we do is, we use '_' as an escape character, and encode (in the
# order) as follows:
#
# '_' is converted to '__'
# '-' is converted to '_0'
# '+' is converted to '_1'
#
# For example, 'Renaissance-Experimental' becomes
# 'Renaissance_0Experimental'.
# GNUstep-base will convert the name back by applying the reverse rules
# in the reverse order.
DUMMY_FRAMEWORK = NSFramework_$(subst +,_1,$(subst -,_0,$(subst _,__,$(GNUSTEP_INSTANCE))))
DUMMY_FRAMEWORK_FILE = $(DERIVED_SOURCES_DIR)/$(DUMMY_FRAMEWORK).m
DUMMY_FRAMEWORK_OBJ_FILE = $(addprefix $(GNUSTEP_OBJ_DIR)/,$(DUMMY_FRAMEWORK).o)