Work in progress, dynamically loading SMPEG
authorSam Lantinga <slouken@libsdl.org>
Fri, 12 May 2006 08:31:36 +0000
changeset 313db79bfffb09b
parent 312 8a536296ef3d
child 314 8c791a6ba872
Work in progress, dynamically loading SMPEG
CHANGES
configure.in
     1.1 --- a/CHANGES	Fri May 12 06:14:15 2006 +0000
     1.2 +++ b/CHANGES	Fri May 12 08:31:36 2006 +0000
     1.3 @@ -1,4 +1,6 @@
     1.4  1.2.7:
     1.5 +Sam Lantinga - Fri May 12 00:04:32 PDT 2006
     1.6 + * Added support for dynamically loading SMPEG library
     1.7  Sam Lantinga - Thu May 11 22:22:43 PDT 2006
     1.8   * Added support for dynamically loading Ogg Vorbis library
     1.9  Sam Lantinga - Sun Apr 30 09:01:44 PDT 2006
     2.1 --- a/configure.in	Fri May 12 06:14:15 2006 +0000
     2.2 +++ b/configure.in	Fri May 12 08:31:36 2006 +0000
     2.3 @@ -264,8 +264,31 @@
     2.4      SMPEG_VERSION=0.4.3
     2.5      AM_PATH_SMPEG($SMPEG_VERSION, have_smpeg=yes, have_smpeg=no)
     2.6      if test x$have_smpeg = xyes; then
     2.7 +        AC_ARG_ENABLE([music-mp3-shared],
     2.8 +AC_HELP_STRING([--enable-music-mp3-shared], [dynamically load MP3 support [[default=no]]]),
     2.9 +                      [], [enable_music_mp3_shared=no])
    2.10 +        case "$host" in
    2.11 +            *-*-darwin*)
    2.12 +                smpeg_lib=''
    2.13 +                ;;
    2.14 +            *-*-cygwin* | *-*-mingw32*)
    2.15 +                smpeg_lib='smpeg.dll'
    2.16 +                ;;
    2.17 +            *)
    2.18 +                for path in /usr/lib /usr/local/lib; do
    2.19 +                    if test x$smpeg_lib = x; then
    2.20 +                        smpeg_lib=[`ls -- $path/libsmpeg*.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
    2.21 +                    fi
    2.22 +                done
    2.23 +                ;;
    2.24 +        esac
    2.25          EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MUSIC $SMPEG_CFLAGS"
    2.26 -        EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SMPEG_LIBS"
    2.27 +        if test x$enable_music_mp3_shared = xyes && test x$smpeg_lib != x; then
    2.28 +            echo "-- dynamic libsmpeg -> $smpeg_lib"
    2.29 +            EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_DYNAMIC=\\\"$smpeg_lib\\\""
    2.30 +        else
    2.31 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SMPEG_LIBS"
    2.32 +        fi
    2.33      fi
    2.34  fi
    2.35