configure.in
author Sam Lantinga <slouken@libsdl.org>
Sat, 03 Oct 2009 20:43:33 +0000
changeset 419 e27fe0bfe470
parent 411 cade1e3a4cb8
child 422 614c9a2f8279
permissions -rw-r--r--
Sam Lantinga - Sat Oct 3 13:33:36 PDT 2009
* MOD support uses libmikmod and is dynamically loaded by default
     1 dnl Process this file with autoconf to produce a configure script.
     2 AC_INIT(README)
     3 
     4 dnl Set various version strings - taken gratefully from the GTk sources
     5 
     6 # Making releases:
     7 #   MICRO_VERSION += 1;
     8 #   INTERFACE_AGE += 1;
     9 #   BINARY_AGE += 1;
    10 # if any functions have been added, set INTERFACE_AGE to 0.
    11 # if backwards compatibility has been broken,
    12 # set BINARY_AGE and INTERFACE_AGE to 0.
    13 #
    14 MAJOR_VERSION=1
    15 MINOR_VERSION=2
    16 MICRO_VERSION=8
    17 INTERFACE_AGE=6
    18 BINARY_AGE=8
    19 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
    20 
    21 AC_SUBST(MAJOR_VERSION)
    22 AC_SUBST(MINOR_VERSION)
    23 AC_SUBST(MICRO_VERSION)
    24 AC_SUBST(INTERFACE_AGE)
    25 AC_SUBST(BINARY_AGE)
    26 AC_SUBST(VERSION)
    27 
    28 # libtool versioning
    29 LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
    30 LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
    31 LT_REVISION=$INTERFACE_AGE
    32 LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
    33 
    34 AC_SUBST(LT_RELEASE)
    35 AC_SUBST(LT_CURRENT)
    36 AC_SUBST(LT_REVISION)
    37 AC_SUBST(LT_AGE)
    38 
    39 dnl Detect the canonical build and host environments
    40 AC_CONFIG_AUX_DIRS($srcdir/build-scripts)
    41 AC_CANONICAL_HOST
    42 
    43 dnl Check for tools
    44 AC_LIBTOOL_WIN32_DLL
    45 AC_PROG_LIBTOOL
    46 AC_PROG_CC
    47 AC_PROG_INSTALL
    48 AC_PROG_MAKE_SET
    49 if test -z "$host_alias"; then
    50     hostaliaswindres=
    51 else
    52     hostaliaswindres="$host_alias-windres"
    53 fi
    54 AC_CHECK_PROGS(WINDRES, [windres $hostaliaswindres $host_os-windres])
    55 
    56 dnl Set up the compiler and linker flags
    57 case "$host" in
    58     *-*-cygwin*)
    59         # We build SDL on cygwin without the UNIX emulation layer
    60         BASE_CFLAGS="-I/usr/include/mingw -mno-cygwin"
    61         BASE_LDFLAGS="-mno-cygwin"
    62         ;;
    63     *)
    64         BASE_CFLAGS="-D_GNU_SOURCE=1"
    65         BASE_LDFLAGS=""
    66         ;;
    67 esac
    68 BUILD_CFLAGS="$CFLAGS $CPPFLAGS"
    69 EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
    70 BUILD_LDFLAGS="$LDFLAGS"
    71 EXTRA_LDFLAGS="$BASE_LDFLAGS"
    72 ## These are common directories to find software packages
    73 #for path in /usr/freeware /usr/pkg /usr/local; do
    74 #    if test -d $path/include; then
    75 #        EXTRA_CFLAGS="$EXTRA_CFLAGS -I$path/include"
    76 #    fi
    77 #    if test -d $path/lib; then
    78 #        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$path/lib"
    79 #    fi
    80 #done
    81 CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
    82 CFLAGS="$CFLAGS $EXTRA_CFLAGS"
    83 LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
    84 
    85 dnl Check for compiler characteristics
    86 AC_C_CONST
    87 
    88 case "$host" in
    89     *-*-cygwin* | *-*-mingw32*)
    90         SOURCES="$srcdir/version.rc"
    91         EXE=".exe"
    92         if test "$build" != "$host"; then # cross-compiling
    93             # Default cross-compile location
    94             ac_default_prefix=/usr/local/cross-tools/i386-mingw32
    95         else
    96             # Look for the location of the tools and install there
    97             if test "$BUILD_PREFIX" != ""; then
    98                 ac_default_prefix=$BUILD_PREFIX
    99             fi
   100         fi
   101         ;;
   102     *)
   103         SOURCES=""
   104         EXE=""
   105         ;;
   106 esac
   107 
   108 # Standard C sources
   109 SOURCES="$SOURCES \
   110 $srcdir/effect_position.c \
   111 $srcdir/effect_stereoreverse.c \
   112 $srcdir/effects_internal.c \
   113 $srcdir/load_aiff.c \
   114 $srcdir/load_voc.c \
   115 $srcdir/mixer.c \
   116 $srcdir/music.c"
   117 
   118 find_lib()
   119 {
   120     gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
   121     gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
   122     env_lib_path=[`echo $LIBS $LDFLAGS | sed 's/-L[ ]*//g'`]
   123     if test "$cross_compiling" = yes; then
   124         host_lib_path=""
   125     else
   126         host_lib_path="/usr/lib /usr/local/lib"
   127     fi
   128     for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do
   129         lib=[`ls -- $path/$1 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   130         if test x$lib != x; then
   131             echo $lib
   132             return
   133         fi
   134     done
   135 }
   136 
   137 dnl Check for SDL
   138 SDL_VERSION=1.2.10
   139 AM_PATH_SDL($SDL_VERSION,
   140             :,
   141             AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
   142 )
   143 EXTRA_CFLAGS="$EXTRA_CFLAGS $SDL_CFLAGS"
   144 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SDL_LIBS"
   145 
   146 dnl Check command-line options
   147 
   148 AC_ARG_ENABLE([music-cmd],
   149 AC_HELP_STRING([--enable-music-cmd], [support an external music player [[default=yes]]]),
   150               [], [enable_music_cmd=yes])
   151 if test x$enable_music_cmd = xyes; then
   152     SOURCES="$SOURCES $srcdir/music_cmd.c"
   153     EXTRA_CFLAGS="$EXTRA_CFLAGS -DCMD_MUSIC"
   154 fi
   155 
   156 AC_ARG_ENABLE([music-wave],
   157 AC_HELP_STRING([--enable-music-wave], [enable streaming WAVE music [[default=yes]]]),
   158               [], [enable_music_wave=yes])
   159 if test x$enable_music_wave = xyes; then
   160     SOURCES="$SOURCES $srcdir/wavestream.c"
   161     EXTRA_CFLAGS="$EXTRA_CFLAGS -DWAV_MUSIC"
   162 fi
   163 
   164 AC_ARG_ENABLE([music-mod],
   165 AC_HELP_STRING([--enable-music-mod], [enable MOD music via mikmod [[default=yes]]]),
   166               [], [enable_music_mod=yes])
   167 AC_ARG_ENABLE([music-mod-shared],
   168 AC_HELP_STRING([--enable-music-mod-shared], [dynamically load MOD support [[default=yes]]]),
   169               [], [enable_music_mod_shared=yes])
   170 if test x$enable_music_mod = xyes; then
   171     have_libmikmod=no
   172     libmikmod_maj=3
   173     libmikmod_min=1
   174     libmikmod_rev=10
   175     libmikmod_ver="$libmikmod_maj.$libmikmod_min.$libmikmod_rev"
   176     AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no, [$PATH])
   177     if test "$LIBMIKMOD_CONFIG" != "no" ; then
   178         
   179         CFLAGS_SAVED="$CFLAGS"
   180         LIBS_SAVED="$LIBS"
   181         CFLAGS="$CFLAGS -DLIBMIKMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`"
   182         LIBS="$LIBS `$LIBMIKMOD_CONFIG --libs`"
   183         have_libmikmod=yes
   184         AC_MSG_CHECKING([for libmikmod - version >= $libmikmod_ver])
   185         AC_TRY_RUN([
   186 #include "mikmod.h"
   187 #include "stdio.h"
   188 
   189 int main(int argc, char **argv)
   190 {
   191 long maj=$libmikmod_maj,min=$libmikmod_min,rev=$libmikmod_rev,ver=MikMod_GetVersion();
   192 /*printf("(%d.%d.%d) ",ver>>16,(ver>>8)&0xff,ver&0xff);*/
   193 if(ver>=((maj<<16)|(min<<8)|(rev))) {
   194     printf("yes\n");
   195     return 0;
   196 }
   197 printf("no\n*** libmikmod is older than %d.%d.%d, not using.\n",maj,min,rev);
   198 return 1;
   199 }
   200 ], [], have_libmikmod=no; CFLAGS="$CFLAGS_SAVED"; LIBS="$LIBS_SAVED",
   201         [echo $ac_n "cross compiling; assumed OK... $ac_c"])
   202     fi
   203 
   204     if test x$have_libmikmod = xyes; then
   205         case "$host" in
   206             *-*-darwin*)
   207                 mikmod_lib=[`find_lib libmikmod*.dylib`]
   208                 ;;
   209             *-*-cygwin* | *-*-mingw32*)
   210                 mikmod_lib=[`find_lib "mikmod*.dll"`]
   211                 ;;
   212             *)
   213                 mikmod_lib=[`find_lib "libmikmod*.so.[0-9]"`]
   214                 if test x$mikmod_lib = x; then
   215                     mikmod_lib=[`find_lib "libmikmod*.so.[0-9]*"`]
   216                 fi
   217                 ;;
   218         esac
   219         SOURCES="$SOURCES $srcdir/*_mod.c"
   220         EXTRA_CFLAGS="$EXTRA_CFLAGS -DMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`"
   221         if test x$enable_music_mod_shared = xyes && test x$mikmod_lib != x; then
   222             echo "-- dynamic libmikmod -> $mikmod_lib"
   223             EXTRA_CFLAGS="$EXTRA_CFLAGS -DMOD_DYNAMIC=\\\"$mikmod_lib\\\""
   224         else
   225             EXTRA_LDFLAGS="$EXTRA_LDFLAGS `$LIBMIKMOD_CONFIG --libs`"
   226         fi
   227     else
   228         AC_MSG_WARN([*** Unable to find MikMod library (http://mikmod.raphnet.net/)])
   229         AC_MSG_WARN([MOD support disabled])
   230     fi
   231 fi
   232 
   233 AC_ARG_ENABLE([music-midi],
   234 AC_HELP_STRING([--enable-music-midi], [enable MIDI music via timidity [[default=yes]]]),
   235               [], [enable_music_midi=yes])
   236 if test x$enable_music_midi = xyes; then
   237     EXTRA_CFLAGS="$EXTRA_CFLAGS -DMID_MUSIC"
   238     AC_ARG_ENABLE([music-timidity-midi],
   239 AC_HELP_STRING([--enable-music-timidity-midi], [enable timidity MIDI output [[default=yes]]]),
   240                   [], [enable_music_timidity_midi=yes])
   241     if test x$enable_music_timidity_midi = xyes; then
   242         EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_TIMIDITY_MIDI -I\$(srcdir)/timidity"
   243         SOURCES="$SOURCES $srcdir/timidity/*.c"
   244     fi
   245     AC_ARG_ENABLE([music-native-midi],
   246 AC_HELP_STRING([--enable-music-native-midi], [enable native MIDI music output [[default=yes]]]),
   247                   [], [enable_music_native_midi=yes])
   248     if test x$enable_music_native_midi = xyes; then
   249         use_music_native_midi=no
   250         case "$host" in
   251             *-*-cygwin* | *-*-mingw32*)
   252                 use_music_native_midi=yes
   253                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lwinmm"
   254                 ;;
   255             *-*-darwin*)
   256                 # This doesn't work on Mac OS X 10.5+
   257                 # Max Horn (the original author) recommends disabling it for now.
   258                 #use_music_native_midi=yes
   259                 #EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,QuickTime -Wl,-framework,CoreServices"
   260                 ;;
   261         esac
   262         if test x$use_music_native_midi = xyes; then
   263             EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_NATIVE_MIDI -I\$(srcdir)/native_midi"
   264             SOURCES="$SOURCES $srcdir/native_midi/*.c"
   265         fi
   266     fi
   267     AC_ARG_ENABLE([music-native-midi-gpl],
   268 AC_HELP_STRING([--enable-music-native-midi-gpl], [enable native MIDI on UNIX using GPL code [[default=no]]]),
   269                   [], [enable_music_native_midi_gpl=no])
   270     if test x$enable_music_native_midi_gpl = xyes; then
   271         use_music_native_midi_gpl=no
   272         case "$host" in
   273             *-*-linux* | *-*-freebsd*)
   274                 use_music_native_midi_gpl=yes
   275                 ;;
   276         esac
   277         if test x$use_music_native_midi_gpl = xyes; then
   278             EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_NATIVE_MIDI -I\$(srcdir)/native_midi"
   279             SOURCES="$SOURCES $srcdir/native_midi_gpl/*.c"
   280         fi
   281     fi
   282 fi
   283 
   284 AC_ARG_ENABLE([music-ogg],
   285 AC_HELP_STRING([--enable-music-ogg], [enable Ogg Vorbis music [[default=yes]]]),
   286               [], [enable_music_ogg=yes])
   287 AC_ARG_ENABLE(music-ogg-tremor,
   288 AC_HELP_STRING([--enable-music-ogg-tremor], [enable OGG Vorbis music via libtremor [[default=no]]]),
   289               [], enable_music_ogg_tremor=no)
   290 AC_ARG_ENABLE([music-ogg-shared],
   291 AC_HELP_STRING([--enable-music-ogg-shared], [dynamically load Ogg Vorbis support [[default=yes]]]),
   292               [], [enable_music_ogg_shared=yes])
   293 if test x$enable_music_ogg = xyes; then
   294     if test x$enable_music_ogg_tremor = xyes; then
   295         AC_CHECK_HEADER([tremor/ivorbisfile.h], [have_tremor_hdr=yes])
   296         AC_CHECK_LIB([vorbisidec], [ov_open_callbacks], [have_tremor_lib=yes])
   297         if test x$have_tremor_hdr = xyes -a x$have_tremor_lib = xyes; then
   298             case "$host" in
   299                 *-*-darwin*)
   300                     ogg_lib=[`find_lib libvorbisidec*.dylib`]
   301                     if test x$ogg_lib = x; then
   302                         ogg_lib=[`find_lib libvorbisidec.[0-9]`]
   303                     fi
   304                     if test x$ogg_lib = x; then
   305                         ogg_lib=[`find_lib libvorbisidec.[0-9]*`]
   306                     fi
   307                     ;;
   308                 *-*-cygwin* | *-*-mingw32*)
   309                     ogg_lib=[`find_lib "vorbisidec*.dll"`]
   310                     ;;
   311                 *)
   312                     ogg_lib=[`find_lib "libvorbisidec.so.[0-9]"`]
   313                     if test x$ogg_lib = x; then
   314                         ogg_lib=[`find_lib "libvorbisidec.so.[0-9]*"`]
   315                     fi
   316                     ;;
   317             esac
   318             SOURCES="$SOURCES $srcdir/*_ogg.c"
   319             EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_MUSIC -DOGG_USE_TREMOR"
   320             if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then
   321                 echo "-- dynamic libvorbisidec -> $ogg_lib"
   322                 EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\""
   323             else
   324                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisidec"
   325             fi
   326         else
   327             AC_MSG_WARN([*** Unable to find Ogg Vorbis Tremor library (http://www.xiph.org/)])
   328             AC_MSG_WARN([Ogg Vorbis support disabled])
   329         fi
   330     else
   331         AC_CHECK_HEADER([vorbis/vorbisfile.h], [have_ogg_hdr=yes])
   332         AC_CHECK_LIB([vorbisfile], [ov_open_callbacks], [have_ogg_lib=yes])
   333         if test x$have_ogg_hdr = xyes -a x$have_ogg_lib = xyes; then
   334             case "$host" in
   335                 *-*-darwin*)
   336                     ogg_lib=[`find_lib libvorbisfile*.dylib`]
   337                     ;;
   338                 *-*-cygwin* | *-*-mingw32*)
   339                     ogg_lib=[`find_lib "libvorbisfile*.dll"`]
   340                     ;;
   341                 *)
   342                     ogg_lib=[`find_lib "libvorbisfile.so.[0-9]"`]
   343                     if test x$ogg_lib = x; then
   344                         ogg_lib=[`find_lib "libvorbisfile.so.[0-9]*"`]
   345                     fi
   346                     ;;
   347             esac
   348             SOURCES="$SOURCES $srcdir/*_ogg.c"
   349             EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_MUSIC"
   350             if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then
   351                 echo "-- dynamic libvorbisfile -> $ogg_lib"
   352                 EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\""
   353             else
   354                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisfile -lvorbis -logg"
   355             fi
   356         else
   357             AC_MSG_WARN([*** Unable to find Ogg Vorbis library (http://www.xiph.org/)])
   358             AC_MSG_WARN([Ogg Vorbis support disabled])
   359         fi
   360     fi
   361 fi
   362 
   363 libflac_ver=8
   364 AC_ARG_ENABLE([music-flac],
   365 AC_HELP_STRING([--enable-music-flac], [enable FLAC music [[default=yes]]]),
   366               [], [enable_music_flac=yes])
   367 AC_ARG_ENABLE([music-flac-shared],
   368 AC_HELP_STRING([--enable-music-flac-shared],
   369               [dynamically load FLAC support [[default=yes]]]),
   370               [], [enable_music_flac_shared=yes])
   371 if test x$enable_music_flac = xyes; then
   372 	AC_CHECK_HEADER([FLAC/export.h], [have_flac_export=yes])
   373 	if test x$have_flac_export = xyes; then
   374 		LIBS_SAVED="$LIBS"
   375 		LIBS="-lFLAC"
   376 	    AC_MSG_CHECKING([for libflac so-name version >= $libflac_ver])
   377 	    AC_TRY_RUN([
   378 #include "FLAC/export.h"
   379 #include "stdio.h"
   380 int main( int argc, char *argv[] ) {
   381 #if defined(FLAC_API_VERSION_CURRENT) && (FLAC_API_VERSION_CURRENT >= $libflac_ver)
   382 	return 0;
   383 #else
   384 	return 1;
   385 #endif
   386 }
   387 ], have_flac_ver=yes, have_flac_ver=no)
   388         LIBS="$LIBS_SAVED"
   389         AC_MSG_RESULT($have_flac_ver)
   390     fi
   391 
   392     if test x$have_flac_ver = xyes; then
   393         AC_CHECK_HEADER([FLAC/stream_decoder.h], [have_flac_hdr=yes])
   394         AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_new], [have_flac_lib=yes])
   395         if test x$have_flac_hdr = xyes -a x$have_flac_lib = xyes; then    
   396             case "$host" in
   397                 *-*-darwin*)
   398                     flac_lib=[`find_lib libFLAC*.dylib`]
   399                     ;;
   400                 *-*-cygwin* | *-*-mingw32*)
   401                     flac_lib=[`find_lib "libFLAC*.dll"`]
   402                     ;;
   403                 *)
   404                     flac_lib=[`find_lib "libFLAC.so.[0-9]"`]
   405                     if test x$flac_lib = x; then
   406                         flac_lib=[`find_lib "libFLAC.so.[0-9]*"`]
   407                     fi
   408                     ;;
   409             esac
   410             SOURCES="$SOURCES $srcdir/*_flac.c"
   411             EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLAC_MUSIC"
   412             if test x$enable_music_flac_shared = xyes && test x$flac_lib != x; then
   413                 echo "-- dynamic libFLAC -> $flac_lib"
   414                 EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLAC_DYNAMIC=\\\"$flac_lib\\\""
   415             else
   416                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lFLAC"
   417             fi
   418         fi
   419     else
   420         AC_MSG_WARN([*** Unable to find FLAC library (http://flac.sourceforge.net/)])
   421         AC_MSG_WARN([FLAC support disabled])
   422     fi
   423 fi
   424 
   425 AC_ARG_ENABLE(music-mp3,
   426 AC_HELP_STRING([--enable-music-mp3], [enable MP3 music via smpeg [[default=yes]]]),
   427               [], enable_music_mp3=yes)
   428 AC_ARG_ENABLE([music-mp3-shared],
   429 AC_HELP_STRING([--enable-music-mp3-shared], [dynamically load MP3 support [[default=yes]]]),
   430               [], [enable_music_mp3_shared=yes])
   431 if test x$enable_music_mp3 = xyes; then
   432     SMPEG_VERSION=0.4.3
   433     AM_PATH_SMPEG($SMPEG_VERSION, have_smpeg=yes, have_smpeg=no)
   434     if test x$have_smpeg = xyes; then
   435         case "$host" in
   436             *-*-darwin*)
   437                 smpeg_lib=[`find_lib libsmpeg*.dylib`]
   438                 ;;
   439             *-*-cygwin* | *-*-mingw32*)
   440                 smpeg_lib=[`find_lib "smpeg*.dll"`]
   441                 ;;
   442             *)
   443                 smpeg_lib=[`find_lib "libsmpeg*.so.[0-9]"`]
   444                 if test x$smpeg_lib = x; then
   445                     smpeg_lib=[`find_lib "libsmpeg*.so.[0-9]*"`]
   446                 fi
   447                 ;;
   448         esac
   449         SOURCES="$SOURCES $srcdir/*_mp3.c"
   450         EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MUSIC $SMPEG_CFLAGS"
   451         if test x$enable_music_mp3_shared = xyes && test x$smpeg_lib != x; then
   452             echo "-- dynamic libsmpeg -> $smpeg_lib"
   453             EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_DYNAMIC=\\\"$smpeg_lib\\\""
   454         else
   455             EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SMPEG_LIBS"
   456         fi
   457     else
   458         AC_MSG_WARN([*** Unable to find SMPEG library (http://icculus.org/smpeg/)])
   459     fi
   460 fi
   461 
   462 AC_ARG_ENABLE(music-mp3-mad-gpl,
   463 AC_HELP_STRING([--enable-music-mp3-mad-gpl], [enable MP3 music via libmad GPL code [[default=no]]]),
   464                   [], [enable_music_mp3_mad_gpl=no])
   465 if test x$enable_music_mp3_mad_gpl = xyes; then
   466     AC_MSG_CHECKING(for libmad headers)
   467     have_libmad=no
   468     AC_TRY_COMPILE([
   469      #include "mad.h"
   470     ],[
   471     ],[
   472     have_libmad=yes
   473     ])
   474     AC_MSG_RESULT($have_libmad)
   475     if test x$have_libmad = xyes; then
   476         SOURCES="$SOURCES $srcdir/music_mad.c"
   477         EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MAD_MUSIC"
   478         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmad"
   479     else
   480         AC_MSG_WARN([*** Unable to find MAD library (http://www.underbit.com/products/mad/)])
   481     fi
   482 fi
   483 
   484 if test x$have_smpeg != xyes -a x$have_libmad != xyes; then
   485     AC_MSG_WARN([MP3 support disabled])
   486 fi
   487 
   488 OBJECTS=`echo $SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
   489 OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
   490 
   491 dnl Expand the sources and objects needed to build the library
   492 AC_SUBST(ac_aux_dir)
   493 AC_SUBST(SOURCES)
   494 AC_SUBST(OBJECTS)
   495 AC_SUBST(BUILD_CFLAGS)
   496 AC_SUBST(EXTRA_CFLAGS)
   497 AC_SUBST(BUILD_LDFLAGS)
   498 AC_SUBST(EXTRA_LDFLAGS)
   499 AC_SUBST(EXE)
   500 AC_SUBST(WINDRES)
   501 AC_SUBST(SDL_VERSION)
   502 AC_SUBST(SDL_CFLAGS)
   503 AC_SUBST(SDL_LIBS)
   504 
   505 AC_OUTPUT([
   506     Makefile SDL_mixer.spec SDL_mixer.qpg SDL_mixer.pc
   507 ], [
   508     : >build-deps
   509     if test x"$MAKE" = x; then MAKE=make; fi; $MAKE depend
   510 ])