Skip to content

Commit

Permalink
initial attempt at adding os2 support to autotools:
Browse files Browse the repository at this point in the history
invented 'LT_EXTRA' for -os2dllname libtool option
  • Loading branch information
sezero committed Dec 2, 2021
1 parent e040334 commit f8342b0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
16 changes: 15 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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=""
Expand Down Expand Up @@ -129,6 +140,9 @@ case "$host" in
fi
fi
;;
*-*-os2*)
EXE=".exe"
;;
*)
EXE=""
;;
Expand Down

0 comments on commit f8342b0

Please sign in to comment.