https://github.com/libsdl-org/SDL_image/commit/78b623e908c1a2e0c181f89e82bbb7d56daaf0c0
From 78b623e908c1a2e0c181f89e82bbb7d56daaf0c0 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.am | 2 +-
configure.ac | 12 +++++++++++-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 4ba3618..de59b51 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -61,7 +61,7 @@ else
libSDL2_image_la_LDFLAGS = \
-no-undefined \
-release $(LT_RELEASE) \
- -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
+ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) $(LT_EXTRA)
libSDL2_image_la_LIBADD = $(IMG_LIBS)
endif
diff --git a/configure.ac b/configure.ac
index bd415ac..2b32767 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,18 +27,20 @@ AC_SUBST([MICRO_VERSION], MICRO_VERSION_MACRO)
AC_SUBST([INTERFACE_AGE], INTERFACE_AGE_MACRO)
AC_SUBST([BINARY_AGE], BINARY_AGE_MACRO)
-# 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
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
AC_CANONICAL_HOST
@@ -89,6 +91,14 @@ case "$host" in
CFLAGS="$CFLAGS -DSDL_IMAGE_USE_COMMON_BACKEND"
fi
;;
+ *-*-os2*)
+ # disable static builds on os/2
+ enable_static=no
+ # -DBUILD_SDL is needed for DECLSPEC
+ CFLAGS="$CFLAGS -DBUILD_SDL"
+ # OS/2 does not support a DLL name longer than 8 characters.
+ LT_EXTRA="-os2dllname SDL2img"
+ ;;
esac
AM_CONDITIONAL(USE_IMAGEIO, test x$enable_imageio = xyes)
AM_CONDITIONAL(USE_VERSION_RC, test x$use_version_rc = xtrue)