pmandin: Added Atari LDG shared object loader
authorPatrice Mandin <patmandin@gmail.com>
Wed, 16 Jul 2003 11:54:13 +0000
changeset 65135ff0890ac4e
parent 650 fe445b59d307
child 652 a3bb929c9e2f
pmandin: Added Atari LDG shared object loader
README.MiNT
configure.in
src/SDL_loadso.c
     1.1 --- a/README.MiNT	Sat Jul 12 13:30:30 2003 +0000
     1.2 +++ b/README.MiNT	Wed Jul 16 11:54:13 2003 +0000
     1.3 @@ -51,6 +51,7 @@
     1.4  Joystick and joypad support (Ikbd, Hardware)
     1.5  Audio support (Hardware, XBIOS, GSXB, MCSN, STFA, /dev/audio if threads enabled)
     1.6  Threads support (Multitasking OS only via GNU pth library)
     1.7 +Shared object support (using LDG library from http://ldg.atari.org/)
     1.8  
     1.9  - What is missing:
    1.10  CDROM support (Metados, /dev/cdrom)
     2.1 --- a/configure.in	Sat Jul 12 13:30:30 2003 +0000
     2.2 +++ b/configure.in	Wed Jul 16 11:54:13 2003 +0000
     2.3 @@ -380,7 +380,7 @@
     2.4              AC_MSG_RESULT($audio_arts)
     2.5              if test x$audio_arts = xyes; then
     2.6                  AC_ARG_ENABLE(arts-shared,
     2.7 -[  --enable-arts-shared     dynamically load aRts audio support [default=no]],
     2.8 +[  --enable-arts-shared    dynamically load aRts audio support [default=no]],
     2.9                                , enable_arts_shared=no)
    2.10                  arts_lib_spec=`echo $ARTSC_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libartsc.so.*/'`
    2.11                  arts_lib=`ls $arts_lib_spec | head -1 | sed 's/.*\/\(.*\)/\1/'`
    2.12 @@ -408,7 +408,7 @@
    2.13  CheckNAS()
    2.14  {
    2.15      AC_ARG_ENABLE(nas,
    2.16 -[  --enable-nas                  support the NAS audio API [default=yes]],
    2.17 +[  --enable-nas            support the NAS audio API [default=yes]],
    2.18                    , enable_nas=yes)
    2.19      if test x$enable_audio = xyes -a x$enable_nas = xyes; then
    2.20          AC_MSG_CHECKING(for NAS audio support)
    2.21 @@ -438,7 +438,7 @@
    2.22  CheckDiskAudio()
    2.23  {
    2.24      AC_ARG_ENABLE(diskaudio,
    2.25 -[  --enable-diskaudio            support the disk writer audio driver [default=yes]],
    2.26 +[  --enable-diskaudio      support the disk writer audio driver [default=yes]],
    2.27                    , enable_diskaudio=yes)
    2.28      if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
    2.29          CFLAGS="$CFLAGS -DDISKAUD_SUPPORT"
    2.30 @@ -776,7 +776,7 @@
    2.31  CheckDirectFB()
    2.32  {
    2.33      AC_ARG_ENABLE(video-directfb,
    2.34 -[  --enable-video-directfb    use DirectFB video driver [default=yes]],
    2.35 +[  --enable-video-directfb use DirectFB video driver [default=yes]],
    2.36                    , enable_video_directfb=yes)
    2.37      if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
    2.38          video_directfb=no
    2.39 @@ -899,7 +899,7 @@
    2.40  CheckVGL()
    2.41  {
    2.42      AC_ARG_ENABLE(video-vgl,
    2.43 -[  --enable-video-vgl     use VGL video driver [default=no]],
    2.44 +[  --enable-video-vgl      use VGL video driver [default=no]],
    2.45                    , enable_video_vgl=no)
    2.46      if test x$enable_video = xyes -a x$enable_video_vgl = xyes; then
    2.47          AC_MSG_CHECKING(for libVGL support)
    2.48 @@ -1577,6 +1577,22 @@
    2.49      fi
    2.50  }
    2.51  
    2.52 +dnl Set up the Atari LDG (shared object loader)
    2.53 +CheckAtariLdg()
    2.54 +{
    2.55 +    AC_ARG_ENABLE(atari-ldg,
    2.56 +[  --enable-atari-ldg      use Atari LDG for shared object loading [default=yes]],
    2.57 +                  , enable_atari_ldg=yes)
    2.58 +    if test x$video_gem = xyes -a x$enable_atari_ldg = xyes; then
    2.59 +        AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes)
    2.60 +        AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem)
    2.61 +        if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then
    2.62 +            CFLAGS="$CFLAGS -DENABLE_LDG"
    2.63 +            SYSTEM_LIBS="$SYSTEM_LIBS -lldg"
    2.64 +        fi
    2.65 +    fi
    2.66 +}
    2.67 +
    2.68  dnl Check for the usbhid(3) library on *BSD
    2.69  CheckUSBHID()
    2.70  {
    2.71 @@ -2429,6 +2445,7 @@
    2.72          CheckAtariXbiosVideo
    2.73          CheckAtariGemVideo
    2.74          CheckAtariAudio
    2.75 +        CheckAtariLdg
    2.76          CheckPTH
    2.77          # Set up files for the main() stub
    2.78          COPY_ARCH_SRC(src/main, linux, SDL_main.c)
     3.1 --- a/src/SDL_loadso.c	Sat Jul 12 13:30:30 2003 +0000
     3.2 +++ b/src/SDL_loadso.c	Wed Jul 16 11:54:13 2003 +0000
     3.3 @@ -40,6 +40,9 @@
     3.4  # include <Strings.h>
     3.5  # include <CodeFragments.h>
     3.6  # include <Errors.h>
     3.7 +#elif defined(__MINT__) && defined(ENABLE_LDG)
     3.8 +# include <gem.h>
     3.9 +# include <ldg.h>
    3.10  #else
    3.11  /*#error Unsupported dynamic link environment*/
    3.12  #endif /* system type */
    3.13 @@ -113,6 +116,9 @@
    3.14  	if ( loaderror == NULL ) {
    3.15  		handle = (void *)(library_id);
    3.16  	}
    3.17 +#elif defined(__MINT__) && defined(ENABLE_LDG)
    3.18 +/* * */
    3.19 +	handle = (void *)ldg_open((char *)sofile, ldg_global);
    3.20  #endif /* system type */
    3.21  
    3.22  	if ( handle == NULL ) {
    3.23 @@ -163,6 +169,9 @@
    3.24  	                (char **)&symbol, &class) != noErr ) {
    3.25  		loaderror = "Symbol not found";
    3.26  	}
    3.27 +#elif defined(__MINT__) && defined(ENABLE_LDG)
    3.28 +/* * */
    3.29 +	symbol = (void *)ldg_find((char *)name, (LDG *)handle);
    3.30  #endif /* system type */
    3.31  
    3.32  	if ( symbol == NULL ) {
    3.33 @@ -193,5 +202,8 @@
    3.34  /* * */
    3.35  	CFragConnectionID library_id = (CFragConnectionID)handle;
    3.36  	CloseConnection(library_id);
    3.37 +#elif defined(__MINT__) && defined(ENABLE_LDG)
    3.38 +/* * */
    3.39 +	ldg_close((LDG *)handle, ldg_global);
    3.40  #endif /* system type */
    3.41  }