SDL_mixer: initial attempt at adding os2 support to autotools:

https://github.com/libsdl-org/SDL_mixer/commit/f8342b0bc8faed86ac4974e0a2c966b2b9b16664

From f8342b0bc8faed86ac4974e0a2c966b2b9b16664 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Thu, 2 Dec 2021 20:56:10 +0300
Subject: [PATCH] initial attempt at adding os2 support to autotools:

invented 'LT_EXTRA' for -os2dllname libtool option
---
 Makefile.in  |  3 ++-
 configure.ac | 16 +++++++++++++++-
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index be07abcb..5c7abfc4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -45,7 +45,8 @@ LT_AGE      = @LT_AGE@
 LT_CURRENT  = @LT_CURRENT@
 LT_RELEASE  = @LT_RELEASE@
 LT_REVISION = @LT_REVISION@
-LT_LDFLAGS  = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
+LT_EXTRA    = @LT_EXTRA@
+LT_LDFLAGS  = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) $(LT_EXTRA)
 
 all: $(srcdir)/configure Makefile $(objects)/$(TARGET) $(objects)/playwave$(EXE) $(objects)/playmus$(EXE)
 
diff --git a/configure.ac b/configure.ac
index 8350b7bb..32e1f8aa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,19 +27,21 @@ AC_SUBST(INTERFACE_AGE)
 AC_SUBST(BINARY_AGE)
 AC_SUBST(VERSION)
 
-# libtool versioning
+dnl libtool versioning
 LT_INIT([win32-dll])
 
 LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
 LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
 LT_REVISION=$INTERFACE_AGE
 LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
+LT_EXTRA="" dnl for OS2 dll name
 m4_pattern_allow([^LT_])
 
 AC_SUBST(LT_RELEASE)
 AC_SUBST(LT_CURRENT)
 AC_SUBST(LT_REVISION)
 AC_SUBST(LT_AGE)
+AC_SUBST(LT_EXTRA)
 
 dnl Detect the canonical build and host environments
 dnl AC_CANONICAL_HOST
@@ -67,6 +69,15 @@ case "$host" in
             BASE_LDFLAGS="-mno-cygwin"
         fi
         ;;
+    *-*-os2*)
+        # disable static builds on os/2
+        enable_static=no
+        # -DBUILD_SDL is needed for DECLSPEC
+        BASE_CFLAGS="-DBUILD_SDL"
+        BASE_LDFLAGS=""
+        # OS/2 does not support a DLL name longer than 8 characters.
+        LT_EXTRA="-os2dllname SDL2mix"
+        ;;
     *)
         BASE_CFLAGS="-D_GNU_SOURCE=1"
         BASE_LDFLAGS=""
@@ -129,6 +140,9 @@ case "$host" in
             fi
         fi
         ;;
+    *-*-os2*)
+        EXE=".exe"
+        ;;
     *)
         EXE=""
         ;;