Author Topic: Games with older SDL and FSLIB  (Read 6878 times)

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5487
  • Karma: +133/-1
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #45 on: July 19, 2025, 06:55:02 am »
Hi Martin, pushed my changes. The package looks fine except I've updated the executable to use -Zhigh-mem, attached.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5381
  • Karma: +45/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Games with older SDL and FSLIB
« Reply #46 on: July 19, 2025, 07:14:04 pm »
Hello Dave

The older one is working fine, this new one gives me an error that can not find data/sounds.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5487
  • Karma: +133/-1
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #47 on: July 20, 2025, 01:14:10 am »
Hello Dave

The older one is working fine, this new one gives me an error that can not find data/sounds.

Regards

Guess I should have tested :)
It's weird as the error is,
Code: [Select]
H:\cuyo-2.1.0>cuyo.exe
Error: Could not find "sounds/leftright.wav".
Tried the following places:
  ./data/sounds/leftright.wav
And
Code: [Select]
H:\cuyo-2.1.0>ls ./data/sounds/leftright.wav
./data/sounds/leftright.wav

So it is there and should work.
Hmm, rebuilding without -Zhigh-mem and it works. Just use the original binary as it seems the -Zhigh-mem is breaking something, perhaps the combination of a GCC binary and OW DLL.
Edit: updated compile.os2 removing the -Zhigh-mem
« Last Edit: July 20, 2025, 01:24:33 am by Dave Yeo »

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5381
  • Karma: +45/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Games with older SDL and FSLIB
« Reply #48 on: July 20, 2025, 06:04:50 pm »
Thanks Dave

I uploaded the package to Hobbes (the version that was working fine).

Just for my own learning, how do you run the automake script for this case? In case I want to have a compile.cmd command, what would you include there?

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5487
  • Karma: +133/-1
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #49 on: July 20, 2025, 09:05:32 pm »
In this case and many others, simply
Code: [Select]
sh autogen.shSometimes autogen.sh runs configure at the end so you can pass the configure arguments to autogen.sh.
If you look at Cuyo's autogen.sh, you see the usual minimal autotools series of commands. Some also have libtool.
Once it has been run to use our autotools port, it usually doesn't need to be run again and configure takes care of creating the makefile's from the makefile.in's, which were created by automake from the makefile.am's
So basically configure --arguments, then make for Cuyo and most autotools projects.
for GAME-SDL-PUZZLE-Cuyo, see compile.os2,
Code: [Select]
sh ./configure --disable-nls --with-sdl-prefix=H:/tmp/SDL 'LDFLAGS=-Zomf' 'LIBS=-lz -lintl'
make pkgdatadir=./data
Of course SDL needs to be setup for GCC as explained earlier in the thread and the above adjusted for your environment.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5381
  • Karma: +45/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Games with older SDL and FSLIB
« Reply #50 on: July 21, 2025, 05:07:03 pm »
Thanks Dave

I tried this:
Code: [Select]
[E:\DEV\5TRYING\GAME-SDL-PUZZLE-CUYO]sh ./configure --disable-nls --with-sdl-pre
fix=C:/usr/include/SDL1 'LDFLAGS=-Zomf' 'LIBS=-lz -lintl'
checking for a BSD-compatible install... /@unixroot/usr/bin/install.exe -c
checking whether build environment is sane... yes
./configure: 1: eval: /bin/sh: not found
configure: WARNING: 'missing' script is too old or missing
checking for a race-free mkdir -p... /@unixroot/usr/bin/mkdir.exe -p
checking for gawk... gawk
checking whether make sets $(MAKE)... no
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for g++... g++
checking whether the C++ compiler works... no
configure: error: in 'E:/DEV/5TRYING/GAME-SDL-PUZZLE-CUYO':
configure: error: C++ compiler cannot create executables
See 'config.log' for more details

[E:\DEV\5TRYING\GAME-SDL-PUZZLE-CUYO]make pkgdatadir=./data
make: *** No targets specified and no makefile found.  Stop.

I'm not sure what can be wrong. I have a different SDL1 path just in case.

Regards
« Last Edit: July 21, 2025, 05:09:51 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5487
  • Karma: +133/-1
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #51 on: July 21, 2025, 05:48:06 pm »
Hi Martin, here is the error,
Code: [Select]
configure:3256: checking whether the C++ compiler works
configure:3278: eval g++ -Wall -W -ansi   -Zomf conftest.cpp -lz -lintl >&5
weakld: cannot open library file 'C:\usr\lib\intl_s.a'.
emxomfld: weak prelinker failed. (rc=8)
configure:3282: $? = 1
configure:3323: result: no

No -lintl, or rather intl_dll.a. Libintl is part of gettext so you need to install the gettext-devel package. You will also need the zlib-devel package for libz (libz_dll.a)
Missing libraries on our system usually result in weakld looking for the static version in /usr/lib.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5487
  • Karma: +133/-1
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #52 on: July 21, 2025, 05:58:36 pm »
Thanks Dave

I tried this:
Code: [Select]
[E:\DEV\5TRYING\GAME-SDL-PUZZLE-CUYO]sh ./configure --disable-nls --with-sdl-pre
fix=C:/usr/include/SDL1 'LDFLAGS=-Zomf' 'LIBS=-lz -lintl'

BTW, did you really install SDL_1-2-15_2020-10-05.zip to /usr/include?
I have,
Code: [Select]
Directory of H:\tmp\SDL

 7-14-25  3:00p         <DIR>    124 ----  .
 7-21-25  8:53a         <DIR>    441 ----  ..
 6-23-25  9:52p         <DIR>      0 a---  bin
 7-14-25  3:00p         <DIR>    124 ----  dll
 7-14-25  3:00p         <DIR>    124 ----  h
 7-14-25  3:00p         <DIR>    124 ----  lib
 2-09-16  2:08a         1,944    124 a---  readme.os2
 3-03-16  3:10p           844    124 a---  SDL-1.2.15-20160303.txt
 3-03-16  3:12p           928    124 a---  SDL-1.2.15-src-20160303.txt
 2-09-16  1:35a         2,615    124 a---  sdl.ini
 4-27-21  8:44p    31,320,734    124 a---  SDL_1-2-15-src-20201005.zip
       11 file(s)  31,327,065 bytes used

Directory of H:\tmp\SDL\bin

 6-23-25  9:52p         <DIR>      0 a---  .
 7-14-25  3:00p         <DIR>    124 ----  ..
 6-29-25  5:27p         1,278    124 a---  sdl-config
        3 file(s)       1,278 bytes used
...
Code: [Select]
Directory of H:\tmp\SDL\lib

 7-14-25  3:00p         <DIR>    124 ----  .
 7-14-25  3:00p         <DIR>    124 ----  ..
10-05-20  9:07a       108,544    124 a---  sdl12.lib
10-05-20  9:07a        21,504    124 a---  sdlimage.lib
10-05-20  9:07a        41,984    124 a---  sdlmixer.lib
10-05-20  9:07a        22,016    124 a---  sdlnet.lib
10-05-20  9:07a        10,240    124 a---  sdlsound.lib
10-05-20  9:07a        25,600    124 a---  sdlttf.lib
 6-23-25  9:23p        21,504    124 a---  SDL_image.lib
 6-23-25  9:23p        41,984    124 a---  SDL_mixer.lib
 6-24-25  8:31p        25,600    124 a---  SDL_ttf.lib
       11 file(s)     318,976 bytes used
...
and my current sdl-config
Code: [Select]
#!/bin/sh

# Edit the prefix below to reflect your environment

prefix=h:/tmp/SDL
exec_prefix=$prefix
exec_prefix_set=no
libdir=$prefix/lib

usage="\
Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]"
#usage="\
#Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]"

if test $# -eq 0; then
      echo "${usage}" 1>&2
      exit 1
fi

while test $# -gt 0; do
  case "$1" in
  -*=*) optarg=`echo "$1" | LC_ALL="C" sed 's/[-_a-zA-Z0-9]*=//'` ;;
  *) optarg= ;;
  esac

  case $1 in
    --prefix=*)
      prefix=$optarg
      if test $exec_prefix_set = no ; then
        exec_prefix=$optarg
      fi
      ;;
    --prefix)
      echo $prefix
      ;;
    --exec-prefix=*)
      exec_prefix=$optarg
      exec_prefix_set=yes
      ;;
    --exec-prefix)
      echo $exec_prefix
      ;;
    --version)
      echo 1.2.15
      ;;
    --cflags)
      echo -I$prefix/h -I$prefix/h/SDL
      ;;
    --libs)
      echo -L$prefix/lib -Zomf -lsdl12
      ;;
#    --static-libs)
##    --libs|--static-libs)
#      echo -L/@unixroot/usr/lib  -lSDL   -lm
#      ;;
    *)
      echo "${usage}" 1>&2
      exit 1
      ;;
  esac
  shift
done

I changed the --cflags section as some projects look for SDL.h and others for SDL/SDL.h
« Last Edit: July 21, 2025, 06:01:30 pm by Dave Yeo »

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5381
  • Karma: +45/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Games with older SDL and FSLIB
« Reply #53 on: July 23, 2025, 05:07:06 pm »
Thanks for the info Dave.

It seems that my SDL into configured right. I will try it your way and see if I can learn something  ;D

If you have the time can you please check the next in line Enigma, to see if it compiles?
- https://github.com/Enigma-Game/Enigma

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5487
  • Karma: +133/-1
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #54 on: July 24, 2025, 01:01:20 am »
If you have the time can you please check the next in line Enigma, to see if it compiles?
- https://github.com/Enigma-Game/Enigma

Hmm, first try,
Code: [Select]
H:\tmp\Enigma>bash autogen.sh
Bootstrapping ./lib-src/enet    autogen.sh: 2: set: Illegal option -o pipefail
ERROR

H:\tmp\Enigma>sh
# autoreconf -sfi
configure.ac:5: installing './compile'
configure.ac:3: installing './install-sh'
configure.ac:3: installing './missing'
Makefile.am: error: required file './AUTHORS' not found
Makefile.am: error: required file './ChangeLog' not found
Makefile.am: installing './INSTALL'
Makefile.am: error: required file './NEWS' not found
Makefile.am: installing './COPYING' using GNU General Public License v3 file
Makefile.am:     Consider adding the COPYING file to the version control system
Makefile.am:     for your code, to avoid questions about which license your project uses
Makefile.am: installing './depcomp'
autoreconf: error: failed to run automake: SYS0003=0x3: The system cannot find the path specified
#

Might have to use the original configure script.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5487
  • Karma: +133/-1
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #55 on: July 24, 2025, 03:13:53 am »
Anyways, created the missing files, put them in both directories that had a configure script, autoreconf worked.
Running configure dies at,
Code: [Select]
checking for current Xerces release 3.0... not found
checking for old Xerces release >=2.4... configure: error: Xerces >= 2.4 not found.

Building Xerces 3.3.0 (from https://xerces.apache.org/xerces-c/download.cgi) things went very smooth until the linking stage where I seem to have run into a bug or deficiency in our build system.
I'll attach the build.log, def file and map file.
Using fc/2 to search for one of the symbols copied from the map file also fails though it is there. They're huge symbols.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5487
  • Karma: +133/-1
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #56 on: July 25, 2025, 05:59:55 am »
So continuing to work on Xerces-c. I built a static lib, which succeeded. Enigma's configure wasn't happy with it, no main or was it mainl, I lost the log.
Tried using ilink v5. Got similar weakld errors and 2936 errors, all undefined exports.
Then I tried the cmake build. I've had a recurring problem where after running cmake, the makefile seems to recurse at the beginning and locks the system hard. So I tried using ninja instead of make.
This actually built an xerces33.dll. The import lib unluckily was empty, well 8 bytes containing !<arch>. Trying 
"emximp -o xerces-c_dll.a xerces33.dll" resulted in the same import lib. Looking at the def file, we have,
Code: [Select]
LIBRARY "xerces33" INITINSTANCE TERMINSTANCE
DESCRIPTION "@#cmake build system:3.3#@##1## 24 Jul 2025 17:19:23     ARCAOS-44454C4::::0::@@xerces-c"
DATA MULTIPLE NONSHARED

No exports. Frustrating as the dll seems to have exports. It's 5.2 MB's and I wonder if the build system tried to use declspec(export) or whatever the command is.
Failures were all trying to link executables.
Not sure where the object files are either, they don't seem to be in build/

Silvan Scherrer

  • Full Member
  • ***
  • Posts: 209
  • Karma: +4/-0
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #57 on: July 25, 2025, 12:25:53 pm »
did you adjust

else()
  if(WIN32)
    set(XERCES_PLATFORM_EXPORT "__declspec(dllexport)")
    set(XERCES_PLATFORM_IMPORT "__declspec(dllimport)")
    if (MSVC)
      set(XERCES_TEMPLATE_EXTERN)
    endif()
    set(XERCES_DLL_EXPORT 1)
  endif()

in xerces-c-3.3.0\cmake\XercesDLL.cmake
If not it can't work of course
kind regards
Silvan
CTO bww bitwise works GmbH

Please help us with donations, so we can further work on OS/2 based projects. Our Shop is at https://www.bitwiseworks.com/shop/index.php

TeLLie

  • Sr. Member
  • ****
  • Posts: 279
  • Karma: +16/-0
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #58 on: July 25, 2025, 07:59:27 pm »
Hi all,
Silvan ported xerces-c 3.3.0 to OS2.
This will be available on monday as RPM

Kind regards,  Tellie

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5487
  • Karma: +133/-1
    • View Profile
Re: Games with older SDL and FSLIB
« Reply #59 on: July 25, 2025, 11:03:33 pm »
did you adjust

else()
  if(WIN32)
    set(XERCES_PLATFORM_EXPORT "__declspec(dllexport)")
    set(XERCES_PLATFORM_IMPORT "__declspec(dllimport)")
    if (MSVC)
      set(XERCES_TEMPLATE_EXTERN)
    endif()
    set(XERCES_DLL_EXPORT 1)
  endif()

in xerces-c-3.3.0\cmake\XercesDLL.cmake
If not it can't work of course

I thought there would be a declspec involved. Unluckily I'm obviously missing something as even simplifiing as much as possible and points in between still not working.
Code: [Select]
if(NOT BUILD_SHARED_LIBS)
  set(XERCES_STATIC_LIBRARY 1)
else()
  set(XERCES_PLATFORM_EXPORT "__declspec(dllexport)")
  set(XERCES_DLL_EXPORT 1)
endif()

Anyways as Tellie says you've built an RPM, it doesn't matter much.
Thanks for the RPM