Commit 3cbf70a6 authored by Patrice Mandin's avatar Patrice Mandin

pmandin: Added Atari LDG shared object loader

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40652
parent fe168ed1
...@@ -51,6 +51,7 @@ Timer (VBL vector, GNU pth library) ...@@ -51,6 +51,7 @@ Timer (VBL vector, GNU pth library)
Joystick and joypad support (Ikbd, Hardware) Joystick and joypad support (Ikbd, Hardware)
Audio support (Hardware, XBIOS, GSXB, MCSN, STFA, /dev/audio if threads enabled) Audio support (Hardware, XBIOS, GSXB, MCSN, STFA, /dev/audio if threads enabled)
Threads support (Multitasking OS only via GNU pth library) Threads support (Multitasking OS only via GNU pth library)
Shared object support (using LDG library from http://ldg.atari.org/)
- What is missing: - What is missing:
CDROM support (Metados, /dev/cdrom) CDROM support (Metados, /dev/cdrom)
......
...@@ -1577,6 +1577,22 @@ CheckDLOPEN() ...@@ -1577,6 +1577,22 @@ CheckDLOPEN()
fi fi
} }
dnl Set up the Atari LDG (shared object loader)
CheckAtariLdg()
{
AC_ARG_ENABLE(atari-ldg,
[ --enable-atari-ldg use Atari LDG for shared object loading [default=yes]],
, enable_atari_ldg=yes)
if test x$video_gem = xyes -a x$enable_atari_ldg = xyes; then
AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes)
AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem)
if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then
CFLAGS="$CFLAGS -DENABLE_LDG"
SYSTEM_LIBS="$SYSTEM_LIBS -lldg"
fi
fi
}
dnl Check for the usbhid(3) library on *BSD dnl Check for the usbhid(3) library on *BSD
CheckUSBHID() CheckUSBHID()
{ {
...@@ -2429,6 +2445,7 @@ case "$target" in ...@@ -2429,6 +2445,7 @@ case "$target" in
CheckAtariXbiosVideo CheckAtariXbiosVideo
CheckAtariGemVideo CheckAtariGemVideo
CheckAtariAudio CheckAtariAudio
CheckAtariLdg
CheckPTH CheckPTH
# Set up files for the main() stub # Set up files for the main() stub
COPY_ARCH_SRC(src/main, linux, SDL_main.c) COPY_ARCH_SRC(src/main, linux, SDL_main.c)
......
...@@ -40,6 +40,9 @@ static char rcsid = ...@@ -40,6 +40,9 @@ static char rcsid =
# include <Strings.h> # include <Strings.h>
# include <CodeFragments.h> # include <CodeFragments.h>
# include <Errors.h> # include <Errors.h>
#elif defined(__MINT__) && defined(ENABLE_LDG)
# include <gem.h>
# include <ldg.h>
#else #else
/*#error Unsupported dynamic link environment*/ /*#error Unsupported dynamic link environment*/
#endif /* system type */ #endif /* system type */
...@@ -113,6 +116,9 @@ void *SDL_LoadObject(const char *sofile) ...@@ -113,6 +116,9 @@ void *SDL_LoadObject(const char *sofile)
if ( loaderror == NULL ) { if ( loaderror == NULL ) {
handle = (void *)(library_id); handle = (void *)(library_id);
} }
#elif defined(__MINT__) && defined(ENABLE_LDG)
/* * */
handle = (void *)ldg_open((char *)sofile, ldg_global);
#endif /* system type */ #endif /* system type */
if ( handle == NULL ) { if ( handle == NULL ) {
...@@ -163,6 +169,9 @@ void *SDL_LoadFunction(void *handle, const char *name) ...@@ -163,6 +169,9 @@ void *SDL_LoadFunction(void *handle, const char *name)
(char **)&symbol, &class) != noErr ) { (char **)&symbol, &class) != noErr ) {
loaderror = "Symbol not found"; loaderror = "Symbol not found";
} }
#elif defined(__MINT__) && defined(ENABLE_LDG)
/* * */
symbol = (void *)ldg_find((char *)name, (LDG *)handle);
#endif /* system type */ #endif /* system type */
if ( symbol == NULL ) { if ( symbol == NULL ) {
...@@ -193,5 +202,8 @@ void SDL_UnloadObject(void *handle) ...@@ -193,5 +202,8 @@ void SDL_UnloadObject(void *handle)
/* * */ /* * */
CFragConnectionID library_id = (CFragConnectionID)handle; CFragConnectionID library_id = (CFragConnectionID)handle;
CloseConnection(library_id); CloseConnection(library_id);
#elif defined(__MINT__) && defined(ENABLE_LDG)
/* * */
ldg_close((LDG *)handle, ldg_global);
#endif /* system type */ #endif /* system type */
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment