configure.in
author Sam Lantinga <slouken@libsdl.org>
Fri, 20 Jul 2007 02:37:47 +0000
changeset 370 56cfd885bb2a
parent 369 5f98121182be
child 372 4bc4ba77f1a1
permissions -rw-r--r--
This didn't fix Torsten's problem
slouken@0
     1
dnl Process this file with autoconf to produce a configure script.
slouken@0
     2
AC_INIT(README)
slouken@0
     3
slouken@0
     4
dnl Set various version strings - taken gratefully from the GTk sources
slouken@0
     5
slouken@0
     6
# Making releases:
slouken@0
     7
#   MICRO_VERSION += 1;
slouken@0
     8
#   INTERFACE_AGE += 1;
slouken@0
     9
#   BINARY_AGE += 1;
slouken@0
    10
# if any functions have been added, set INTERFACE_AGE to 0.
slouken@0
    11
# if backwards compatibility has been broken,
slouken@0
    12
# set BINARY_AGE and INTERFACE_AGE to 0.
slouken@294
    13
#
slouken@0
    14
MAJOR_VERSION=1
slouken@81
    15
MINOR_VERSION=2
slouken@349
    16
MICRO_VERSION=8
slouken@349
    17
INTERFACE_AGE=6
slouken@349
    18
BINARY_AGE=8
slouken@0
    19
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
slouken@0
    20
slouken@0
    21
AC_SUBST(MAJOR_VERSION)
slouken@0
    22
AC_SUBST(MINOR_VERSION)
slouken@0
    23
AC_SUBST(MICRO_VERSION)
slouken@0
    24
AC_SUBST(INTERFACE_AGE)
slouken@0
    25
AC_SUBST(BINARY_AGE)
slouken@0
    26
AC_SUBST(VERSION)
slouken@0
    27
slouken@0
    28
# libtool versioning
slouken@0
    29
LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
slouken@0
    30
LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
slouken@0
    31
LT_REVISION=$INTERFACE_AGE
slouken@0
    32
LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
slouken@0
    33
slouken@0
    34
AC_SUBST(LT_RELEASE)
slouken@0
    35
AC_SUBST(LT_CURRENT)
slouken@0
    36
AC_SUBST(LT_REVISION)
slouken@0
    37
AC_SUBST(LT_AGE)
slouken@0
    38
slouken@289
    39
dnl Detect the canonical build and host environments
slouken@294
    40
AC_CONFIG_AUX_DIRS($srcdir/build-scripts)
slouken@289
    41
AC_CANONICAL_HOST
slouken@68
    42
slouken@294
    43
dnl Set up the compiler and linker flags
slouken@294
    44
case "$host" in
slouken@294
    45
    *-*-cygwin*)
slouken@294
    46
        # We build SDL on cygwin without the UNIX emulation layer
slouken@294
    47
        BASE_CFLAGS="-I/usr/include/mingw -mno-cygwin"
slouken@294
    48
        BASE_LDFLAGS="-mno-cygwin"
slouken@294
    49
        ;;
slouken@294
    50
    *)
slouken@294
    51
        BASE_CFLAGS="-D_GNU_SOURCE=1"
slouken@294
    52
        BASE_LDFLAGS=""
slouken@294
    53
        ;;
slouken@294
    54
esac
slouken@294
    55
BUILD_CFLAGS="$CFLAGS $CPPFLAGS"
slouken@294
    56
EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
slouken@294
    57
BUILD_LDFLAGS="$LDFLAGS"
slouken@294
    58
EXTRA_LDFLAGS="$BASE_LDFLAGS"
slouken@368
    59
## These are common directories to find software packages
slouken@368
    60
#for path in /usr/freeware /usr/pkg /usr/local; do
slouken@368
    61
#    if test -d $path/include; then
slouken@368
    62
#        EXTRA_CFLAGS="$EXTRA_CFLAGS -I$path/include"
slouken@368
    63
#    fi
slouken@368
    64
#    if test -d $path/lib; then
slouken@368
    65
#        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$path/lib"
slouken@368
    66
#    fi
slouken@368
    67
#done
slouken@294
    68
CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
slouken@294
    69
CFLAGS="$CFLAGS $EXTRA_CFLAGS"
slouken@294
    70
LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
slouken@91
    71
slouken@0
    72
dnl Check for tools
slouken@294
    73
AC_LIBTOOL_WIN32_DLL
slouken@294
    74
AC_PROG_LIBTOOL
slouken@294
    75
AC_PROG_CC
slouken@294
    76
AC_PROG_INSTALL
slouken@294
    77
AC_PROG_MAKE_SET
slouken@368
    78
if test -z "$host_alias"; then
slouken@368
    79
    hostaliaswindres=
slouken@368
    80
else
slouken@368
    81
    hostaliaswindres="$host_alias-windres"
slouken@368
    82
fi
slouken@368
    83
AC_CHECK_PROGS(WINDRES, [windres $hostaliaswindres $host_os-windres])
slouken@0
    84
slouken@294
    85
dnl Check for compiler characteristics
slouken@294
    86
AC_C_CONST
slouken@0
    87
slouken@289
    88
case "$host" in
slouken@294
    89
    *-*-cygwin* | *-*-mingw32*)
slouken@368
    90
        SOURCES="$srcdir/version.rc"
slouken@294
    91
        EXE=".exe"
slouken@368
    92
        if test "$build" != "$host"; then # cross-compiling
slouken@368
    93
            # Default cross-compile location
slouken@368
    94
            ac_default_prefix=/usr/local/cross-tools/i386-mingw32
slouken@368
    95
        else
slouken@368
    96
            # Look for the location of the tools and install there
slouken@368
    97
            if test "$BUILD_PREFIX" != ""; then
slouken@368
    98
                ac_default_prefix=$BUILD_PREFIX
slouken@368
    99
            fi
slouken@368
   100
        fi
slouken@6
   101
        ;;
slouken@294
   102
    *)
slouken@368
   103
        SOURCES=""
slouken@294
   104
        EXE=""
slouken@208
   105
        ;;
slouken@6
   106
esac
slouken@6
   107
slouken@294
   108
# Standard C sources
slouken@294
   109
SOURCES="$SOURCES \
slouken@294
   110
$srcdir/effect_position.c \
slouken@294
   111
$srcdir/effect_stereoreverse.c \
slouken@294
   112
$srcdir/effects_internal.c \
slouken@294
   113
$srcdir/load_aiff.c \
slouken@294
   114
$srcdir/load_voc.c \
slouken@294
   115
$srcdir/mixer.c \
slouken@294
   116
$srcdir/music.c"
slouken@294
   117
slouken@368
   118
find_lib()
slouken@368
   119
{
slouken@368
   120
    gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
slouken@368
   121
    env_lib_path=[`echo $LIBS $LDFLAGS | sed 's/-L[ ]*//g'`]
slouken@368
   122
    for path in $gcc_lib_path $env_lib_path /usr/lib /usr/local/lib; do
slouken@368
   123
        lib=[`ls -- $path/$1 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
slouken@368
   124
        if test x$lib != x; then
slouken@368
   125
            echo $lib
slouken@368
   126
            return
slouken@368
   127
        fi
slouken@368
   128
    done
slouken@368
   129
}
slouken@368
   130
slouken@20
   131
dnl Check for SDL
slouken@308
   132
SDL_VERSION=1.2.10
slouken@20
   133
AM_PATH_SDL($SDL_VERSION,
slouken@20
   134
            :,
slouken@368
   135
            AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
slouken@20
   136
)
slouken@294
   137
EXTRA_CFLAGS="$EXTRA_CFLAGS $SDL_CFLAGS"
slouken@294
   138
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SDL_LIBS"
slouken@0
   139
slouken@0
   140
dnl Check command-line options
slouken@91
   141
slouken@312
   142
AC_ARG_ENABLE([music-cmd],
slouken@312
   143
AC_HELP_STRING([--enable-music-cmd], [support an external music player [[default=yes]]]),
slouken@312
   144
              [], [enable_music_cmd=yes])
slouken@0
   145
if test x$enable_music_cmd = xyes; then
slouken@294
   146
    SOURCES="$SOURCES $srcdir/music_cmd.c"
slouken@294
   147
    EXTRA_CFLAGS="$EXTRA_CFLAGS -DCMD_MUSIC"
slouken@0
   148
fi
slouken@312
   149
AC_ARG_ENABLE([music-wave],
slouken@312
   150
AC_HELP_STRING([--enable-music-wave], [enable streaming WAVE music [[default=yes]]]),
slouken@312
   151
              [], [enable_music_wave=yes])
slouken@0
   152
if test x$enable_music_wave = xyes; then
slouken@294
   153
    SOURCES="$SOURCES $srcdir/wavestream.c"
slouken@294
   154
    EXTRA_CFLAGS="$EXTRA_CFLAGS -DWAV_MUSIC"
slouken@0
   155
fi
slouken@257
   156
no_libmikmod=yes
slouken@249
   157
libmikmod_maj=3
slouken@249
   158
libmikmod_min=1
slouken@249
   159
libmikmod_rev=10
slouken@249
   160
libmikmod_ver="$libmikmod_maj.$libmikmod_min.$libmikmod_rev"
slouken@312
   161
AC_ARG_ENABLE([music-libmikmod],
slouken@312
   162
AC_HELP_STRING([--enable-music-libmikmod], [enable MOD music via external libmikmod [[default=no]]]),
slouken@312
   163
              [], [enable_music_libmikmod=no])
slouken@249
   164
if test x$enable_music_libmikmod = xyes; then
slouken@368
   165
    AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no, [$PATH])
slouken@368
   166
    if test "$LIBMIKMOD_CONFIG" != "no" ; then
slouken@368
   167
        no_libmikmod=no
slouken@368
   168
        CFLAGS_SAVED="$CFLAGS"
slouken@368
   169
        LIBS_SAVED="$LIBS"
slouken@368
   170
        CFLAGS="$CFLAGS -DLIBMIKMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`"
slouken@368
   171
        LIBS="$LIBS `$LIBMIKMOD_CONFIG --libs`"
slouken@368
   172
        AC_MSG_CHECKING([for libmikmod - version >= $libmikmod_ver])
slouken@368
   173
        AC_TRY_RUN([
slouken@249
   174
#include "mikmod.h"
slouken@249
   175
#include "stdio.h"
slouken@249
   176
slouken@249
   177
int main(int argc, char **argv)
slouken@249
   178
{
slouken@368
   179
    long maj=$libmikmod_maj,min=$libmikmod_min,rev=$libmikmod_rev,ver=MikMod_GetVersion();
slouken@368
   180
    /*printf("(%d.%d.%d) ",ver>>16,(ver>>8)&0xff,ver&0xff);*/
slouken@368
   181
    if(ver>=((maj<<16)|(min<<8)|(rev))) {
slouken@368
   182
        printf("yes\n");
slouken@368
   183
        return 0;
slouken@368
   184
    }
slouken@368
   185
    printf("no\n*** libmikmod is older than %d.%d.%d, not using.\n",maj,min,rev);
slouken@368
   186
    return 1;
slouken@249
   187
}
slouken@332
   188
], EXTRA_CFLAGS="$EXTRA_CFLAGS -DLIBMIKMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`";EXTRA_LDFLAGS="$EXTRA_LDFLAGS `$LIBMIKMOD_CONFIG --libs`", CFLAGS="$CFLAGS_SAVED";LIBS="$LIBS_SAVED",
slouken@249
   189
[echo $ac_n "cross compiling; assumed OK... $ac_c"])
slouken@368
   190
    fi
slouken@249
   191
fi
slouken@249
   192
slouken@312
   193
AC_ARG_ENABLE([music-mod],
slouken@312
   194
AC_HELP_STRING([--enable-music-mod], [enable MOD music via mikmod [[default=yes]]]),
slouken@312
   195
              [], [enable_music_mod=$no_libmikmod])
slouken@332
   196
if test x$enable_music_mod = xyes -a x$enable_music_libmikmod = xno; then
slouken@294
   197
    EXTRA_CFLAGS="$EXTRA_CFLAGS -DMOD_MUSIC -I\$(srcdir)/mikmod"
slouken@294
   198
    SOURCES="$SOURCES $srcdir/mikmod/*.c"
slouken@1
   199
fi
slouken@312
   200
AC_ARG_ENABLE([music-midi],
slouken@312
   201
AC_HELP_STRING([--enable-music-midi], [enable MIDI music via timidity [[default=yes]]]),
slouken@312
   202
              [], [enable_music_midi=yes])
slouken@0
   203
if test x$enable_music_midi = xyes; then
slouken@294
   204
    EXTRA_CFLAGS="$EXTRA_CFLAGS -DMID_MUSIC"
slouken@312
   205
    AC_ARG_ENABLE([music-timidity-midi],
slouken@312
   206
AC_HELP_STRING([--enable-music-timidity-midi], [enable timidity MIDI output [[default=yes]]]),
slouken@312
   207
                  [], [enable_music_timidity_midi=yes])
slouken@106
   208
    if test x$enable_music_timidity_midi = xyes; then
slouken@294
   209
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_TIMIDITY_MIDI -I\$(srcdir)/timidity"
slouken@294
   210
        SOURCES="$SOURCES $srcdir/timidity/*.c"
slouken@106
   211
    fi
slouken@312
   212
    AC_ARG_ENABLE([music-native-midi],
slouken@312
   213
AC_HELP_STRING([--enable-music-native-midi], [enable native MIDI music output [[default=yes]]]),
slouken@312
   214
                  [], [enable_music_native_midi=yes])
slouken@99
   215
    if test x$enable_music_native_midi = xyes; then
slouken@99
   216
        use_music_native_midi=no
slouken@289
   217
        case "$host" in
slouken@99
   218
            *-*-cygwin* | *-*-mingw32*)
slouken@99
   219
                use_music_native_midi=yes
slouken@294
   220
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lwinmm"
slouken@99
   221
                ;;
slouken@107
   222
            *-*-darwin*)
slouken@107
   223
                use_music_native_midi=yes
icculus@344
   224
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,QuickTime -Wl,-framework,CoreServices"
slouken@107
   225
                ;;
slouken@99
   226
        esac
slouken@99
   227
        if test x$use_music_native_midi = xyes; then
slouken@294
   228
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_NATIVE_MIDI -I\$(srcdir)/native_midi"
slouken@294
   229
            SOURCES="$SOURCES $srcdir/native_midi/*.c"
slouken@99
   230
        fi
slouken@99
   231
    fi
slouken@312
   232
    AC_ARG_ENABLE([music-native-midi-gpl],
slouken@312
   233
AC_HELP_STRING([--enable-music-native-midi-gpl], [enable native MIDI on UNIX using GPL code [[default=no]]]),
slouken@312
   234
                  [], [enable_music_native_midi_gpl=no])
slouken@160
   235
    if test x$enable_music_native_midi_gpl = xyes; then
slouken@160
   236
        use_music_native_midi_gpl=no
slouken@289
   237
        case "$host" in
slouken@160
   238
            *-*-linux* | *-*-freebsd*)
slouken@160
   239
                use_music_native_midi_gpl=yes
slouken@160
   240
                ;;
slouken@160
   241
        esac
slouken@160
   242
        if test x$use_music_native_midi_gpl = xyes; then
slouken@294
   243
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_NATIVE_MIDI -I\$(srcdir)/native_midi"
slouken@294
   244
            SOURCES="$SOURCES $srcdir/native_midi_gpl/*.c"
slouken@160
   245
        fi
slouken@160
   246
    fi
slouken@0
   247
fi
slouken@312
   248
AC_ARG_ENABLE([music-ogg],
slouken@312
   249
AC_HELP_STRING([--enable-music-ogg], [enable Ogg Vorbis music [[default=yes]]]),
slouken@312
   250
              [], [enable_music_ogg=yes])
slouken@353
   251
AC_ARG_ENABLE(music-ogg-tremor,
slouken@353
   252
[  --enable-music-ogg-tremor   enable OGG music via libtremor [[default=no]]],
slouken@368
   253
              [], enable_music_ogg_tremor=no)
slouken@368
   254
AC_ARG_ENABLE([music-ogg-shared],
slouken@368
   255
AC_HELP_STRING([--enable-music-ogg-shared], [dynamically load Ogg Vorbis support [[default=yes]]]),
slouken@368
   256
              [], [enable_music_ogg_shared=yes])
slouken@368
   257
if test x$enable_music_ogg = xyes; then
slouken@368
   258
    if test x$enable_music_ogg_tremor = xyes; then
slouken@368
   259
        AC_CHECK_HEADER([tremor/ivorbisfile.h], [have_tremor_hdr=yes])
slouken@368
   260
        AC_CHECK_LIB([vorbisidec], [ov_open_callbacks], [have_tremor_lib=yes])
slouken@368
   261
        if test x$have_tremor_hdr = xyes -a x$have_tremor_lib = xyes; then
slouken@368
   262
            case "$host" in
slouken@368
   263
                *-*-darwin*)
slouken@368
   264
                    ogg_lib=[`find_lib libvorbisidec*.dylib`]
slouken@368
   265
                    if test x$ogg_lib = x; then
slouken@368
   266
                        ogg_lib=[`find_lib libvorbisidec.[0-9]`]
slouken@368
   267
                    fi
slouken@368
   268
                    if test x$ogg_lib = x; then
slouken@368
   269
                        ogg_lib=[`find_lib libvorbisidec.[0-9]*`]
slouken@368
   270
                    fi
slouken@368
   271
                    ;;
slouken@368
   272
                *-*-cygwin* | *-*-mingw32*)
slouken@368
   273
                    ogg_lib=[`find_lib "vorbisidec*dll"`]
slouken@368
   274
                    ;;
slouken@368
   275
                *)
slouken@368
   276
                    ogg_lib=[`find_lib "libvorbisidec.so.[0-9]"`]
slouken@368
   277
                    if test x$ogg_lib = x; then
slouken@368
   278
                        ogg_lib=[`find_lib "libvorbisidec.so.[0-9]*"`]
slouken@368
   279
                    fi
slouken@368
   280
                    ;;
slouken@368
   281
            esac
slouken@368
   282
            SOURCES="$SOURCES $srcdir/*_ogg.c"
slouken@368
   283
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_MUSIC -DOGG_USE_TREMOR"
slouken@368
   284
            if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then
slouken@368
   285
                echo "-- dynamic libvorbisidec -> $ogg_lib"
slouken@368
   286
                EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\""
slouken@368
   287
            else
slouken@368
   288
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisidec"
slouken@368
   289
            fi
slouken@368
   290
        fi
slouken@368
   291
    else
slouken@368
   292
        AC_CHECK_HEADER([vorbis/vorbisfile.h], [have_ogg_hdr=yes])
slouken@368
   293
        AC_CHECK_LIB([vorbisfile], [ov_open_callbacks], [have_ogg_lib=yes])
slouken@368
   294
        if test x$have_ogg_hdr = xyes -a x$have_ogg_lib = xyes; then
slouken@368
   295
            case "$host" in
slouken@368
   296
                *-*-darwin*)
slouken@368
   297
                    ogg_lib=[`find_lib libvorbisfile*.dylib`]
slouken@368
   298
                    ;;
slouken@368
   299
                *-*-cygwin* | *-*-mingw32*)
slouken@368
   300
                    ogg_lib=[`find_lib "vorbisfile*dll"`]
slouken@368
   301
                    ;;
slouken@368
   302
                *)
slouken@368
   303
                    ogg_lib=[`find_lib "libvorbisfile.so.[0-9]"`]
slouken@368
   304
                    if test x$ogg_lib = x; then
slouken@368
   305
                        ogg_lib=[`find_lib "libvorbisfile.so.[0-9]*"`]
slouken@368
   306
                    fi
slouken@368
   307
                    ;;
slouken@368
   308
            esac
slouken@368
   309
            SOURCES="$SOURCES $srcdir/*_ogg.c"
slouken@368
   310
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_MUSIC"
slouken@368
   311
            if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then
slouken@368
   312
                echo "-- dynamic libvorbisfile -> $ogg_lib"
slouken@368
   313
                EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\""
slouken@368
   314
            else
slouken@368
   315
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisfile -lvorbis -logg"
slouken@368
   316
            fi
slouken@368
   317
        fi
slouken@353
   318
    fi
slouken@353
   319
fi
slouken@0
   320
AC_ARG_ENABLE(music-mp3,
slouken@312
   321
[  --enable-music-mp3      enable MP3 music via smpeg [[default=yes]]],
slouken@0
   322
              , enable_music_mp3=yes)
slouken@0
   323
if test x$enable_music_mp3 = xyes; then
slouken@83
   324
    SMPEG_VERSION=0.4.3
slouken@83
   325
    AM_PATH_SMPEG($SMPEG_VERSION, have_smpeg=yes, have_smpeg=no)
slouken@0
   326
    if test x$have_smpeg = xyes; then
slouken@313
   327
        AC_ARG_ENABLE([music-mp3-shared],
slouken@314
   328
AC_HELP_STRING([--enable-music-mp3-shared], [dynamically load MP3 support [[default=yes]]]),
slouken@314
   329
                      [], [enable_music_mp3_shared=yes])
slouken@313
   330
        case "$host" in
slouken@313
   331
            *-*-darwin*)
slouken@368
   332
                smpeg_lib=[`find_lib libsmpeg*.dylib`]
slouken@313
   333
                ;;
slouken@313
   334
            *-*-cygwin* | *-*-mingw32*)
slouken@368
   335
                smpeg_lib=[`find_lib "smpeg*dll"`]
slouken@313
   336
                ;;
slouken@313
   337
            *)
slouken@368
   338
                smpeg_lib=[`find_lib "libsmpeg.so.[0-9]"`]
slouken@368
   339
                if test x$smpeg_lib = x; then
slouken@368
   340
                    smpeg_lib=[`find_lib "libsmpeg.so.[0-9]*"`]
slouken@368
   341
                fi
slouken@313
   342
                ;;
slouken@313
   343
        esac
slouken@314
   344
        SOURCES="$SOURCES $srcdir/*_mp3.c"
slouken@294
   345
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MUSIC $SMPEG_CFLAGS"
slouken@313
   346
        if test x$enable_music_mp3_shared = xyes && test x$smpeg_lib != x; then
slouken@313
   347
            echo "-- dynamic libsmpeg -> $smpeg_lib"
slouken@313
   348
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_DYNAMIC=\\\"$smpeg_lib\\\""
slouken@313
   349
        else
slouken@313
   350
            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SMPEG_LIBS"
slouken@313
   351
        fi
slouken@0
   352
    fi
slouken@0
   353
fi
slouken@357
   354
AC_ARG_ENABLE(music-mp3-mad-gpl,
slouken@357
   355
AC_HELP_STRING([--enable-music-mp3-mad-gpl], [enable MP3 music via libmad GPL code [[default=no]]]),
slouken@357
   356
                  [], [enable_music_mp3_mad_gpl=no])
slouken@357
   357
if test x$enable_music_mp3_mad_gpl = xyes; then
slouken@357
   358
    AC_MSG_CHECKING(for libmad headers)
slouken@357
   359
    have_libmad=no
slouken@357
   360
    AC_TRY_COMPILE([
slouken@357
   361
     #include "mad.h"
slouken@357
   362
    ],[
slouken@357
   363
    ],[
slouken@357
   364
    have_libmad=yes
slouken@357
   365
    ])
slouken@357
   366
    AC_MSG_RESULT($have_libmad)
slouken@357
   367
    if test x$have_libmad = xyes; then
slouken@357
   368
        SOURCES="$SOURCES $srcdir/music_mad.c"
slouken@357
   369
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MAD_MUSIC"
slouken@357
   370
        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmad"
slouken@357
   371
    fi
slouken@357
   372
fi
slouken@0
   373
slouken@294
   374
OBJECTS=`echo $SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
slouken@368
   375
OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
slouken@1
   376
slouken@294
   377
dnl Expand the sources and objects needed to build the library
slouken@294
   378
AC_SUBST(ac_aux_dir)
slouken@294
   379
AC_SUBST(SOURCES)
slouken@294
   380
AC_SUBST(OBJECTS)
slouken@294
   381
AC_SUBST(BUILD_CFLAGS)
slouken@294
   382
AC_SUBST(EXTRA_CFLAGS)
slouken@294
   383
AC_SUBST(BUILD_LDFLAGS)
slouken@294
   384
AC_SUBST(EXTRA_LDFLAGS)
slouken@294
   385
AC_SUBST(EXE)
slouken@368
   386
AC_SUBST(WINDRES)
slouken@294
   387
AC_SUBST(SDL_CFLAGS)
slouken@294
   388
AC_SUBST(SDL_LIBS)
slouken@206
   389
slouken@0
   390
AC_OUTPUT([
slouken@294
   391
    Makefile SDL_mixer.spec SDL_mixer.qpg
slouken@294
   392
], [
slouken@294
   393
    : >build-deps
slouken@294
   394
    if test x"$MAKE" = x; then MAKE=make; fi; $MAKE depend
slouken@0
   395
])