configure.in
branchSDL-1.2
changeset 902 6c862e733898
parent 885 dd251a0ec666
child 905 a31a903d1f72
     1.1 --- a/configure.in	Sun Oct 07 17:56:56 2018 +0300
     1.2 +++ b/configure.in	Thu Oct 11 11:50:10 2018 +0300
     1.3 @@ -560,39 +560,40 @@
     1.4  AC_CHECK_FUNCS(setbuf, [EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_SETBUF"])
     1.5  
     1.6  AC_ARG_ENABLE(music-mp3,
     1.7 -AC_HELP_STRING([--enable-music-mp3], [enable MP3 music via smpeg [[default=yes]]]),
     1.8 +AC_HELP_STRING([--enable-music-mp3], [enable MP3 music via libmpg123 [[default=yes]]]),
     1.9                [], enable_music_mp3=yes)
    1.10  AC_ARG_ENABLE([music-mp3-shared],
    1.11  AC_HELP_STRING([--enable-music-mp3-shared], [dynamically load MP3 support [[default=yes]]]),
    1.12                [], [enable_music_mp3_shared=yes])
    1.13  if test x$enable_music_mp3 = xyes; then
    1.14 -    SMPEG_VERSION=0.4.3
    1.15 -    AM_PATH_SMPEG($SMPEG_VERSION, have_smpeg=yes, have_smpeg=no)
    1.16 -    if test x$have_smpeg = xyes; then
    1.17 +    AC_CHECK_HEADER([mpg123.h], [have_mpg123_hdr=yes])
    1.18 +    AC_CHECK_LIB([mpg123], [mpg123_replace_reader_handle], [have_mpg123_lib=yes])
    1.19 +    if test x$have_mpg123_hdr = xyes -a x$have_mpg123_lib = xyes; then
    1.20 +        have_mpg123=yes
    1.21          case "$host" in
    1.22              *-*-darwin*)
    1.23 -                smpeg_lib=[`find_lib libsmpeg.dylib`]
    1.24 +                mpg123_lib=[`find_lib libmpg123.dylib`]
    1.25                  ;;
    1.26              *-*-cygwin* | *-*-mingw32*)
    1.27 -                smpeg_lib=[`find_lib "smpeg*.dll"`]
    1.28 +                mpg123_lib=[`find_lib "libmpg123*.dll"`]
    1.29                  ;;
    1.30              *)
    1.31 -                smpeg_lib=[`find_lib "libsmpeg*.so.[0-9]"`]
    1.32 -                if test x$smpeg_lib = x; then
    1.33 -                    smpeg_lib=[`find_lib "libsmpeg*.so.[0-9]*"`]
    1.34 +                mpg123_lib=[`find_lib "libmpg123*.so.[0-9]"`]
    1.35 +                if test x$mpg123_lib = x; then
    1.36 +                    mpg123_lib=[`find_lib "libmpg123*.so.[0-9]*"`]
    1.37                  fi
    1.38                  ;;
    1.39          esac
    1.40 -        SOURCES="$SOURCES $srcdir/*_mp3.c"
    1.41 -        EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MUSIC $SMPEG_CFLAGS"
    1.42 -        if test x$enable_music_mp3_shared = xyes && test x$smpeg_lib != x; then
    1.43 -            echo "-- dynamic libsmpeg -> $smpeg_lib"
    1.44 -            EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_DYNAMIC=\\\"$smpeg_lib\\\""
    1.45 +        SOURCES="$SOURCES $srcdir/*_mp3.c $srcdir/*_mpg.c"
    1.46 +        EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MUSIC"
    1.47 +        if test x$enable_music_mp3_shared = xyes && test x$mpg123_lib != x; then
    1.48 +            echo "-- dynamic libmpg123 -> $mpg123_lib"
    1.49 +            EXTRA_CFLAGS="$EXTRA_CFLAGS -DMPG123_DYNAMIC=\\\"$mpg123_lib\\\""
    1.50          else
    1.51 -            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SMPEG_LIBS"
    1.52 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmpg123"
    1.53          fi
    1.54      else
    1.55 -        AC_MSG_WARN([*** Unable to find SMPEG library (http://icculus.org/smpeg/)])
    1.56 +        AC_MSG_WARN([*** Unable to find mpg123 library (https://www.mpg123.de)])
    1.57      fi
    1.58  fi
    1.59  
    1.60 @@ -618,7 +619,7 @@
    1.61      fi
    1.62  fi
    1.63  
    1.64 -if test x$have_smpeg != xyes -a x$have_libmad != xyes; then
    1.65 +if test x$have_mpg123 != xyes -a x$have_libmad != xyes; then
    1.66      AC_MSG_WARN([MP3 support disabled])
    1.67  fi
    1.68