configure.in
branchSDL-1.2
changeset 902 6c862e733898
parent 885 dd251a0ec666
child 905 a31a903d1f72
equal deleted inserted replaced
898:b5d14516f1df 902:6c862e733898
   558 
   558 
   559 AC_CHECK_HEADERS([signal.h], [EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_SIGNAL_H"])
   559 AC_CHECK_HEADERS([signal.h], [EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_SIGNAL_H"])
   560 AC_CHECK_FUNCS(setbuf, [EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_SETBUF"])
   560 AC_CHECK_FUNCS(setbuf, [EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_SETBUF"])
   561 
   561 
   562 AC_ARG_ENABLE(music-mp3,
   562 AC_ARG_ENABLE(music-mp3,
   563 AC_HELP_STRING([--enable-music-mp3], [enable MP3 music via smpeg [[default=yes]]]),
   563 AC_HELP_STRING([--enable-music-mp3], [enable MP3 music via libmpg123 [[default=yes]]]),
   564               [], enable_music_mp3=yes)
   564               [], enable_music_mp3=yes)
   565 AC_ARG_ENABLE([music-mp3-shared],
   565 AC_ARG_ENABLE([music-mp3-shared],
   566 AC_HELP_STRING([--enable-music-mp3-shared], [dynamically load MP3 support [[default=yes]]]),
   566 AC_HELP_STRING([--enable-music-mp3-shared], [dynamically load MP3 support [[default=yes]]]),
   567               [], [enable_music_mp3_shared=yes])
   567               [], [enable_music_mp3_shared=yes])
   568 if test x$enable_music_mp3 = xyes; then
   568 if test x$enable_music_mp3 = xyes; then
   569     SMPEG_VERSION=0.4.3
   569     AC_CHECK_HEADER([mpg123.h], [have_mpg123_hdr=yes])
   570     AM_PATH_SMPEG($SMPEG_VERSION, have_smpeg=yes, have_smpeg=no)
   570     AC_CHECK_LIB([mpg123], [mpg123_replace_reader_handle], [have_mpg123_lib=yes])
   571     if test x$have_smpeg = xyes; then
   571     if test x$have_mpg123_hdr = xyes -a x$have_mpg123_lib = xyes; then
       
   572         have_mpg123=yes
   572         case "$host" in
   573         case "$host" in
   573             *-*-darwin*)
   574             *-*-darwin*)
   574                 smpeg_lib=[`find_lib libsmpeg.dylib`]
   575                 mpg123_lib=[`find_lib libmpg123.dylib`]
   575                 ;;
   576                 ;;
   576             *-*-cygwin* | *-*-mingw32*)
   577             *-*-cygwin* | *-*-mingw32*)
   577                 smpeg_lib=[`find_lib "smpeg*.dll"`]
   578                 mpg123_lib=[`find_lib "libmpg123*.dll"`]
   578                 ;;
   579                 ;;
   579             *)
   580             *)
   580                 smpeg_lib=[`find_lib "libsmpeg*.so.[0-9]"`]
   581                 mpg123_lib=[`find_lib "libmpg123*.so.[0-9]"`]
   581                 if test x$smpeg_lib = x; then
   582                 if test x$mpg123_lib = x; then
   582                     smpeg_lib=[`find_lib "libsmpeg*.so.[0-9]*"`]
   583                     mpg123_lib=[`find_lib "libmpg123*.so.[0-9]*"`]
   583                 fi
   584                 fi
   584                 ;;
   585                 ;;
   585         esac
   586         esac
   586         SOURCES="$SOURCES $srcdir/*_mp3.c"
   587         SOURCES="$SOURCES $srcdir/*_mp3.c $srcdir/*_mpg.c"
   587         EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MUSIC $SMPEG_CFLAGS"
   588         EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MUSIC"
   588         if test x$enable_music_mp3_shared = xyes && test x$smpeg_lib != x; then
   589         if test x$enable_music_mp3_shared = xyes && test x$mpg123_lib != x; then
   589             echo "-- dynamic libsmpeg -> $smpeg_lib"
   590             echo "-- dynamic libmpg123 -> $mpg123_lib"
   590             EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_DYNAMIC=\\\"$smpeg_lib\\\""
   591             EXTRA_CFLAGS="$EXTRA_CFLAGS -DMPG123_DYNAMIC=\\\"$mpg123_lib\\\""
   591         else
   592         else
   592             EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SMPEG_LIBS"
   593             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmpg123"
   593         fi
   594         fi
   594     else
   595     else
   595         AC_MSG_WARN([*** Unable to find SMPEG library (http://icculus.org/smpeg/)])
   596         AC_MSG_WARN([*** Unable to find mpg123 library (https://www.mpg123.de)])
   596     fi
   597     fi
   597 fi
   598 fi
   598 
   599 
   599 AC_ARG_ENABLE(music-mp3-mad-gpl,
   600 AC_ARG_ENABLE(music-mp3-mad-gpl,
   600 AC_HELP_STRING([--enable-music-mp3-mad-gpl], [enable MP3 music via libmad GPL code [[default=no]]]),
   601 AC_HELP_STRING([--enable-music-mp3-mad-gpl], [enable MP3 music via libmad GPL code [[default=no]]]),
   616     else
   617     else
   617         AC_MSG_WARN([*** Unable to find MAD library (http://www.underbit.com/products/mad/)])
   618         AC_MSG_WARN([*** Unable to find MAD library (http://www.underbit.com/products/mad/)])
   618     fi
   619     fi
   619 fi
   620 fi
   620 
   621 
   621 if test x$have_smpeg != xyes -a x$have_libmad != xyes; then
   622 if test x$have_mpg123 != xyes -a x$have_libmad != xyes; then
   622     AC_MSG_WARN([MP3 support disabled])
   623     AC_MSG_WARN([MP3 support disabled])
   623 fi
   624 fi
   624 
   625 
   625 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBM"
   626 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBM"
   626 
   627