Skip to content

Commit

Permalink
Make use of new KVO implementation configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
rfm committed Nov 29, 2024
1 parent 672fe7f commit a1a3f42
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Source/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ objc-load.m
# We have two implementations for Key Value Observing.
# One highly-optimised one that depends on libobjc2
# and the original implementation.
ifeq ($(OBJC_RUNTIME_LIB), ng)
ifeq ($(GNUSTEP_BASE_HAVE_NEWKVO), 1)
BASE_MFILES += \
NSKVOSupport.m \
NSKVOSwizzling.m
Expand Down
3 changes: 3 additions & 0 deletions base.make.in
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ ifeq ($(BASE_MAKE_LOADED),)
# Has ICU been found (for NSCalendar, NSLocale, and other locale related)?
GNUSTEP_BASE_HAVE_ICU=@HAVE_ICU@

# Has the new KVO implementation been selected.
GNUSTEP_BASE_HAVE_NEWKVO=@HAVE_NEWKVO@


# The next two are a special case ... we should have either one defined
# for netservices. FIXME ... shouldn't these be combined?
Expand Down
31 changes: 31 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,7 @@ DOT
USE_GMP
GS_HAVE_NSURLSESSION
HAVE_LIBCURL
HAVE_NEWKVO
HAVE_LIBDISPATCH_RUNLOOP
HAVE_LIBDISPATCH
HAVE_ICU
Expand Down Expand Up @@ -862,6 +863,7 @@ enable_icu
enable_libdispatch
with_dispatch_include
with_dispatch_library
enable_newkvo
with_curl
enable_nsurlsession
with_gmp_include
Expand Down Expand Up @@ -1556,6 +1558,7 @@ Optional Features:
--disable-zeroconf Disable NSNetServices support
--disable-icu Disable International Components for Unicode
--disable-libdispatch Disable dispatching blocks via libdispatch
--disable-newkvo Disable new KVO implementation
--disable-nsurlsession Disable support for NSURLSession
--enable-setuid-gdomap Enable installing gdomap as a setuid
Expand Down Expand Up @@ -14521,6 +14524,34 @@ fi



#--------------------------------------------------------------------
# Check for whether the new KVO implementation is enabled (only with
# the NG runtime)
#--------------------------------------------------------------------
HAVE_NEWKVO=0
# Check whether --enable-newkvo was given.
if test ${enable_newkvo+y}
then :
enableval=$enable_newkvo;
else $as_nop

if test "$OBJC_RUNTIME_LIB" = "ng"; then
enable_newkvo=yes
else
enable_newkvo=no
fi
fi

if test "x$enable_newkvo" = "xyes"
then
if test "$OBJC_RUNTIME_LIB" = "ng"; then
HAVE_NEWKVO=1
else
echo "You are not using the new runtime ... newkvo not available"
fi
fi


#--------------------------------------------------------------------
# Check for libcurl
# See DEPENDENCIES POLICY at the start of this file.
Expand Down
22 changes: 22 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3686,6 +3686,28 @@ fi
AC_SUBST(HAVE_LIBDISPATCH_RUNLOOP)


#--------------------------------------------------------------------
# Check for whether the new KVO implementation is enabled (only with
# the NG runtime)
#--------------------------------------------------------------------
HAVE_NEWKVO=0
AC_ARG_ENABLE(newkvo,
[ --disable-newkvo Disable new KVO implementation],,[
if test "$OBJC_RUNTIME_LIB" = "ng"; then
enable_newkvo=yes
else
enable_newkvo=no
fi])
if test "x$enable_newkvo" = "xyes"
then
if test "$OBJC_RUNTIME_LIB" = "ng"; then
HAVE_NEWKVO=1
else
echo "You are not using the new runtime ... newkvo not available"
fi
fi
AC_SUBST(HAVE_NEWKVO)

#--------------------------------------------------------------------
# Check for libcurl
# See DEPENDENCIES POLICY at the start of this file.
Expand Down

0 comments on commit a1a3f42

Please sign in to comment.