From a1a3f42ec0f9e23f06b64c48a6e656826270919a Mon Sep 17 00:00:00 2001 From: rfm Date: Fri, 29 Nov 2024 11:55:47 +0000 Subject: [PATCH] Make use of new KVO implementation configurable --- Source/GNUmakefile | 2 +- base.make.in | 3 +++ configure | 31 +++++++++++++++++++++++++++++++ configure.ac | 22 ++++++++++++++++++++++ 4 files changed, 57 insertions(+), 1 deletion(-) diff --git a/Source/GNUmakefile b/Source/GNUmakefile index ccc956b95..8bca407f4 100644 --- a/Source/GNUmakefile +++ b/Source/GNUmakefile @@ -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 diff --git a/base.make.in b/base.make.in index f27ca240c..14581a761 100644 --- a/base.make.in +++ b/base.make.in @@ -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? diff --git a/configure b/configure index ae62e5462..3e0dc053a 100755 --- a/configure +++ b/configure @@ -663,6 +663,7 @@ DOT USE_GMP GS_HAVE_NSURLSESSION HAVE_LIBCURL +HAVE_NEWKVO HAVE_LIBDISPATCH_RUNLOOP HAVE_LIBDISPATCH HAVE_ICU @@ -862,6 +863,7 @@ enable_icu enable_libdispatch with_dispatch_include with_dispatch_library +enable_newkvo with_curl enable_nsurlsession with_gmp_include @@ -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 @@ -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. diff --git a/configure.ac b/configure.ac index 18f06693c..4ffd2ba51 100644 --- a/configure.ac +++ b/configure.ac @@ -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.