SDL_rtf: libtool upgrade to 2.4.6 - 17/n: SDL customizations

From 98d8da1c26cf4aeae70357bc6055ba43c12b1fde Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Thu, 2 Dec 2021 20:55:32 +0300
Subject: [PATCH] libtool upgrade to 2.4.6 - 17/n: SDL customizations

fixes Windows linkage and the DLL name convention.
---
 acinclude/libtool.m4 | 8 ++++++--
 ltmain.sh            | 6 ++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/acinclude/libtool.m4 b/acinclude/libtool.m4
index 151b10b..4817905 100644
--- a/acinclude/libtool.m4
+++ b/acinclude/libtool.m4
@@ -2553,13 +2553,15 @@ cygwin* | mingw* | pw32* | cegcc*)
     case $host_os in
     cygwin*)
       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+      #soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+      soname_spec='`echo $libname | sed -e 's/^lib//'`$shared_ext' # SDL customization
 m4_if([$1], [],[
       sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
       ;;
     mingw* | cegcc*)
       # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+      #soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+      soname_spec='`echo $libname | $SED -e 's/^lib//'`$shared_ext' # SDL customization
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
@@ -3469,6 +3471,7 @@ cygwin*)
   # func_win32_libid is a shell function defined in ltmain.sh
   lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
   lt_cv_file_magic_cmd='func_win32_libid'
+  lt_cv_deplibs_check_method=pass_all # SDL customization
   ;;
 
 mingw* | pw32*)
@@ -3483,6 +3486,7 @@ mingw* | pw32*)
     lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
     lt_cv_file_magic_cmd='$OBJDUMP -f'
   fi
+  lt_cv_deplibs_check_method=pass_all # SDL customization
   ;;
 
 cegcc*)
diff --git a/ltmain.sh b/ltmain.sh
index 5060468..cefb8e3 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -6500,14 +6500,16 @@ func_mode_link ()
       # we shouldn't force the makefile maintainer to figure out
       # what system we are compiling for in order to pass an extra
       # flag for every libtool invocation.
-      # allow_undefined=no
+      # SDL customization: SDL code doesn't have any undefined symbols
+      allow_undefined=no
 
       # FIXME: Unfortunately, there are problems with the above when trying
       # to make a dll that has undefined symbols, in which case not
       # even a static library is built.  For now, we need to specify
       # -no-undefined on the libtool link line when we can be certain
       # that all symbols are satisfied, otherwise we get a static library.
-      allow_undefined=yes
+      # SDL customization: SDL code doesn't have any undefined symbols
+      # allow_undefined=yes
       ;;
     *)
       allow_undefined=yes