SDL_ttf: Revert "Fixed handling of DYLIB_COMPATIBILITY_VERSION"

From 80ae2a74b6aed38b2589e1327abc10587f5298ad Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 5 Sep 2022 18:36:28 -0700
Subject: [PATCH] Revert "Fixed handling of DYLIB_COMPATIBILITY_VERSION"

This reverts commit 3d16d58015e1ac858eb6fd8f85fce840efcf98a5.

This was intended to go into the main branch
---
 CMakeLists.txt                          |  3 ++
 Xcode/SDL_ttf.xcodeproj/project.pbxproj |  4 +--
 cmake/PrivateSdlFunctions.cmake         |  1 -
 configure                               | 38 ++++++++++++-------------
 release_checklist.md                    | 26 +++++++++++------
 test-versioning.sh                      | 38 ++++++++-----------------
 6 files changed, 53 insertions(+), 57 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0f2bc7d..ebbe692 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,6 +8,9 @@ set(MINOR_VERSION 20)
 set(MICRO_VERSION 1)
 set(SDL_REQUIRED_VERSION 2.0.10)
 
+# For historical reasons this is 15.0.0 rather than the expected 1.0.0
+set(DYLIB_COMPATIBILITY_VERSION "15.0.0")
+
 include(PrivateSdlFunctions)
 sdl_calculate_derived_version_variables()
 
diff --git a/Xcode/SDL_ttf.xcodeproj/project.pbxproj b/Xcode/SDL_ttf.xcodeproj/project.pbxproj
index 32e22d9..221c3ba 100644
--- a/Xcode/SDL_ttf.xcodeproj/project.pbxproj
+++ b/Xcode/SDL_ttf.xcodeproj/project.pbxproj
@@ -984,7 +984,7 @@
 				CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
 				CLANG_CXX_LIBRARY = "libc++";
 				COPY_PHASE_STRIP = NO;
-				DYLIB_COMPATIBILITY_VERSION = 2001.0.0;
+				DYLIB_COMPATIBILITY_VERSION = 15.0.0;
 				DYLIB_CURRENT_VERSION = 2001.1.0;
 				DYLIB_INSTALL_NAME_BASE = "@rpath";
 				ENABLE_TESTABILITY = YES;
@@ -1024,7 +1024,7 @@
 				CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
 				CLANG_CXX_LIBRARY = "libc++";
 				DEPLOYMENT_POSTPROCESSING = YES;
-				DYLIB_COMPATIBILITY_VERSION = 2001.0.0;
+				DYLIB_COMPATIBILITY_VERSION = 15.0.0;
 				DYLIB_CURRENT_VERSION = 2001.1.0;
 				DYLIB_INSTALL_NAME_BASE = "@rpath";
 				FRAMEWORK_SEARCH_PATHS = "\"$(SRCROOT)/$(PLATFORM)\"";
diff --git a/cmake/PrivateSdlFunctions.cmake b/cmake/PrivateSdlFunctions.cmake
index b22af5c..398770b 100644
--- a/cmake/PrivateSdlFunctions.cmake
+++ b/cmake/PrivateSdlFunctions.cmake
@@ -41,7 +41,6 @@ macro(sdl_calculate_derived_version_variables)
     math(EXPR DYLIB_CURRENT_VERSION_MINOR "${LT_REVISION}")
     math(EXPR DYLIB_COMPAT_VERSION_MAJOR "${LT_MAJOR} + 1")
     set(DYLIB_CURRENT_VERSION "${DYLIB_CURRENT_VERSION_MAJOR}.${DYLIB_CURRENT_VERSION_MINOR}.0")
-    set(DYLIB_COMPATIBILITY_VERSION "${DYLIB_CURRENT_VERSION_MAJOR}.0.0")
 endmacro()
 
 macro(sdl_find_sdl2 TARGET VERSION)
diff --git a/configure b/configure
index 9afa3e1..1cacbbe 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.71 for SDL2_ttf 2.20.1.
+# Generated by GNU Autoconf 2.71 for SDL2_ttf 2.20.0.
 #
 # Report bugs to <https://github.com/libsdl-org/SDL_ttf/issues>.
 #
@@ -760,8 +760,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='SDL2_ttf'
 PACKAGE_TARNAME='SDL2_ttf'
-PACKAGE_VERSION='2.20.1'
-PACKAGE_STRING='SDL2_ttf 2.20.1'
+PACKAGE_VERSION='2.20.0'
+PACKAGE_STRING='SDL2_ttf 2.20.0'
 PACKAGE_BUGREPORT='https://github.com/libsdl-org/SDL_ttf/issues'
 PACKAGE_URL=''
 
@@ -1563,7 +1563,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures SDL2_ttf 2.20.1 to adapt to many kinds of systems.
+\`configure' configures SDL2_ttf 2.20.0 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1638,7 +1638,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of SDL2_ttf 2.20.1:";;
+     short | recursive ) echo "Configuration of SDL2_ttf 2.20.0:";;
    esac
   cat <<\_ACEOF
 
@@ -1772,7 +1772,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-SDL2_ttf configure 2.20.1
+SDL2_ttf configure 2.20.0
 generated by GNU Autoconf 2.71
 
 Copyright (C) 2021 Free Software Foundation, Inc.
@@ -2384,7 +2384,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by SDL2_ttf $as_me 2.20.1, which was
+It was created by SDL2_ttf $as_me 2.20.0, which was
 generated by GNU Autoconf 2.71.  Invocation command line was
 
   $ $0$ac_configure_args_raw
@@ -3362,7 +3362,7 @@ MAJOR_VERSION=2
 
 MINOR_VERSION=20
 
-MICRO_VERSION=1
+MICRO_VERSION=0
 
 
 BINARY_AGE=`expr $MINOR_VERSION \* 100 + $MICRO_VERSION`
@@ -11985,7 +11985,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='SDL2_ttf'
- VERSION='2.20.1'
+ VERSION='2.20.0'
 
 
 printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -13413,11 +13413,11 @@ if test x$ac_prog_cxx_stdcxx = xno
 then :
   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5
 printf %s "checking for $CXX option to enable C++11 features... " >&6; }
-if test ${ac_cv_prog_cxx_11+y}
+if test ${ac_cv_prog_cxx_cxx11+y}
 then :
   printf %s "(cached) " >&6
 else $as_nop
-  ac_cv_prog_cxx_11=no
+  ac_cv_prog_cxx_cxx11=no
 ac_save_CXX=$CXX
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -13459,11 +13459,11 @@ if test x$ac_prog_cxx_stdcxx = xno
 then :
   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5
 printf %s "checking for $CXX option to enable C++98 features... " >&6; }
-if test ${ac_cv_prog_cxx_98+y}
+if test ${ac_cv_prog_cxx_cxx98+y}
 then :
   printf %s "(cached) " >&6
 else $as_nop
-  ac_cv_prog_cxx_98=no
+  ac_cv_prog_cxx_cxx98=no
 ac_save_CXX=$CXX
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -13783,11 +13783,11 @@ if test x$ac_prog_cxx_stdcxx = xno
 then :
   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5
 printf %s "checking for $CXX option to enable C++11 features... " >&6; }
-if test ${ac_cv_prog_cxx_11+y}
+if test ${ac_cv_prog_cxx_cxx11+y}
 then :
   printf %s "(cached) " >&6
 else $as_nop
-  ac_cv_prog_cxx_11=no
+  ac_cv_prog_cxx_cxx11=no
 ac_save_CXX=$CXX
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -13829,11 +13829,11 @@ if test x$ac_prog_cxx_stdcxx = xno
 then :
   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5
 printf %s "checking for $CXX option to enable C++98 features... " >&6; }
-if test ${ac_cv_prog_cxx_98+y}
+if test ${ac_cv_prog_cxx_cxx98+y}
 then :
   printf %s "(cached) " >&6
 else $as_nop
-  ac_cv_prog_cxx_98=no
+  ac_cv_prog_cxx_cxx98=no
 ac_save_CXX=$CXX
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -21736,7 +21736,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by SDL2_ttf $as_me 2.20.1, which was
+This file was extended by SDL2_ttf $as_me 2.20.0, which was
 generated by GNU Autoconf 2.71.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -21795,7 +21795,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config='$ac_cs_config_escaped'
 ac_cs_version="\\
-SDL2_ttf config.status 2.20.1
+SDL2_ttf config.status 2.20.0
 configured by $0, generated by GNU Autoconf 2.71,
   with options \\"\$ac_cs_config\\"
 
diff --git a/release_checklist.md b/release_checklist.md
index f27f2e8..81c5764 100644
--- a/release_checklist.md
+++ b/release_checklist.md
@@ -28,12 +28,16 @@
         * set first number in `DYLIB_CURRENT_VERSION` to
             (100 * *minor*) + 1
         * set second number in `DYLIB_CURRENT_VERSION` to 0
-        * set `DYLIB_COMPATIBILITY_VERSION` to the same value
-
-* Regenerate `configure`
+        * if backwards compatibility has been broken,
+            increase `DYLIB_COMPATIBILITY_VERSION` (?)
+    * `CMakeLists.txt`:
+		* if backwards compatibility has been broken,
+		  increase `DYLIB_COMPATIBILITY_VERSION` (?)
 
 * Run `./test-versioning.sh` to verify that everything is consistent
 
+* Regenerate `configure`
+
 * Do the release
 
 ## New bugfix release
@@ -51,12 +55,11 @@
 	* `Xcode/SDL_ttf.xcodeproj/project.pbxproj`:
 	  `DYLIB_CURRENT_VERSION`, `DYLIB_COMPATIBILITY_VERSION`
 		* set second number in `DYLIB_CURRENT_VERSION` to *patchlevel*
-        * Leave `DYLIB_COMPATIBILITY_VERSION` unchanged
-
-* Regenerate `configure`
 
 * Run test/versioning.sh to verify that everything is consistent
 
+* Regenerate `configure`
+
 * Do the release
 
 ## After a feature release
@@ -87,10 +90,15 @@
 		* set first number in `DYLIB_CURRENT_VERSION` to
 		  (100 * *minor*) + *patchlevel* + 1
 		* set second number in `DYLIB_CURRENT_VERSION` to 0
-        * set `DYLIB_COMPATIBILITY_VERSION` to the same value
-
-* Regenerate `configure`
+		* if backwards compatibility has been broken,
+		  increase `DYLIB_COMPATIBILITY_VERSION` (?)
+	* `CMakeLists.txt`:
+	  `DYLIB_COMPATIBILITY_VERSION`
+		* if backwards compatibility has been broken,
+		  increase `DYLIB_COMPATIBILITY_VERSION` (?)
 
 * Run test/versioning.sh to verify that everything is consistent
 
+* Regenerate `configure`
+
 * Do the release
diff --git a/test-versioning.sh b/test-versioning.sh
index 11e73bf..48f2ab5 100755
--- a/test-versioning.sh
+++ b/test-versioning.sh
@@ -38,17 +38,6 @@ else
     not_ok "configure.ac $version disagrees with SDL_ttf.h $ref_version"
 fi
 
-major=$(sed -ne 's/^MAJOR_VERSION=//p' configure)
-minor=$(sed -ne 's/^MINOR_VERSION=//p' configure)
-micro=$(sed -ne 's/^MICRO_VERSION=//p' configure)
-version="${major}.${minor}.${micro}"
-
-if [ "$ref_version" = "$version" ]; then
-    ok "configure $version"
-else
-    not_ok "configure $version disagrees with SDL_ttf.h $ref_version"
-fi
-
 major=$(sed -ne 's/^set(MAJOR_VERSION \([0-9]*\))$/\1/p' CMakeLists.txt)
 minor=$(sed -ne 's/^set(MINOR_VERSION \([0-9]*\))$/\1/p' CMakeLists.txt)
 micro=$(sed -ne 's/^set(MICRO_VERSION \([0-9]*\))$/\1/p' CMakeLists.txt)
@@ -132,25 +121,22 @@ fi
 
 # For simplicity this assumes we'll never break ABI before SDL 3.
 dylib_compat=$(sed -Ene 's/.*DYLIB_COMPATIBILITY_VERSION = (.*);$/\1/p' Xcode/SDL_ttf.xcodeproj/project.pbxproj)
+ref='15.0.0
+15.0.0'
 
-case "$ref_minor" in
-    (*[02468])
-        major="$(( ref_minor * 100 + 1 ))"
-        minor="0"
-        ;;
-    (*)
-        major="$(( ref_minor * 100 + ref_micro + 1 ))"
-        minor="0"
-        ;;
-esac
+if [ "$ref" = "$dylib_compat" ]; then
+    ok "project.pbxproj DYLIB_COMPATIBILITY_VERSION is consistent"
+else
+    not_ok "project.pbxproj DYLIB_COMPATIBILITY_VERSION is inconsistent"
+fi
 
-ref="${major}.${minor}.0
-${major}.${minor}.0"
+dylib_compat=$(sed -ne 's/^set(DYLIB_COMPATIBILITY_VERSION "\([0-9.]*\)")$/\1/p' CMakeLists.txt)
+ref='15.0.0'
 
 if [ "$ref" = "$dylib_compat" ]; then
-    ok "project.pbxproj DYLIB_COMPATIBILITY_VERSION is consistent"
+    ok "CMakeLists.txt DYLIB_COMPATIBILITY_VERSION is consistent"
 else
-    not_ok "project.pbxproj DYLIB_COMPATIBILITY_VERSION is inconsistent, expected $ref, got $dylib_compat"
+    not_ok "CMakeLists.txt DYLIB_COMPATIBILITY_VERSION is inconsistent"
 fi
 
 dylib_cur=$(sed -Ene 's/.*DYLIB_CURRENT_VERSION = (.*);$/\1/p' Xcode/SDL_ttf.xcodeproj/project.pbxproj)
@@ -172,7 +158,7 @@ ${major}.${minor}.0"
 if [ "$ref" = "$dylib_cur" ]; then
     ok "project.pbxproj DYLIB_CURRENT_VERSION is consistent"
 else
-    not_ok "project.pbxproj DYLIB_CURRENT_VERSION is inconsistent, expected $ref, got $dylib_cur"
+    not_ok "project.pbxproj DYLIB_CURRENT_VERSION is inconsistent"
 fi
 
 sdl_req=$(sed -ne 's/\$sdl2_version = "\([0-9.]*\)"$/\1/p' .github/fetch_sdl_vc.ps1)