configure.in
author James Le Cuirot <chewi@aura-online.co.uk>
Sun, 20 Mar 2011 14:34:18 +0000
changeset 506 586ae09f8176
parent 502 209152025a0e
child 517 db215583bdcb
permissions -rw-r--r--
Add FluidSynth backend and generic SoundFont functions. No FluidSynth DLL or headers for MSVC in this commit.
slouken@0
     1
dnl Process this file with autoconf to produce a configure script.
slouken@0
     2
AC_INIT(README)
slouken@426
     3
AC_CONFIG_AUX_DIRS($srcdir/build-scripts)
slouken@0
     4
slouken@0
     5
dnl Set various version strings - taken gratefully from the GTk sources
slouken@0
     6
slouken@0
     7
# Making releases:
slouken@0
     8
#   MICRO_VERSION += 1;
slouken@0
     9
#   INTERFACE_AGE += 1;
slouken@0
    10
#   BINARY_AGE += 1;
slouken@0
    11
# if any functions have been added, set INTERFACE_AGE to 0.
slouken@0
    12
# if backwards compatibility has been broken,
slouken@0
    13
# set BINARY_AGE and INTERFACE_AGE to 0.
slouken@294
    14
#
slouken@0
    15
MAJOR_VERSION=1
slouken@81
    16
MINOR_VERSION=2
slouken@495
    17
MICRO_VERSION=12
slouken@495
    18
INTERFACE_AGE=2
slouken@495
    19
BINARY_AGE=12
slouken@0
    20
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
slouken@0
    21
slouken@0
    22
AC_SUBST(MAJOR_VERSION)
slouken@0
    23
AC_SUBST(MINOR_VERSION)
slouken@0
    24
AC_SUBST(MICRO_VERSION)
slouken@0
    25
AC_SUBST(INTERFACE_AGE)
slouken@0
    26
AC_SUBST(BINARY_AGE)
slouken@0
    27
AC_SUBST(VERSION)
slouken@0
    28
slouken@0
    29
# libtool versioning
slouken@426
    30
LT_INIT([win32-dll])
slouken@426
    31
slouken@0
    32
LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
slouken@0
    33
LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
slouken@0
    34
LT_REVISION=$INTERFACE_AGE
slouken@0
    35
LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
slouken@435
    36
m4_pattern_allow([^LT_])
slouken@0
    37
slouken@0
    38
AC_SUBST(LT_RELEASE)
slouken@0
    39
AC_SUBST(LT_CURRENT)
slouken@0
    40
AC_SUBST(LT_REVISION)
slouken@0
    41
AC_SUBST(LT_AGE)
slouken@0
    42
slouken@289
    43
dnl Detect the canonical build and host environments
slouken@294
    44
AC_CONFIG_AUX_DIRS($srcdir/build-scripts)
slouken@435
    45
dnl AC_CANONICAL_HOST
slouken@68
    46
slouken@406
    47
dnl Check for tools
slouken@406
    48
AC_PROG_LIBTOOL
slouken@406
    49
AC_PROG_CC
slouken@406
    50
AC_PROG_INSTALL
slouken@406
    51
AC_PROG_MAKE_SET
slouken@406
    52
if test -z "$host_alias"; then
slouken@406
    53
    hostaliaswindres=
slouken@406
    54
else
slouken@406
    55
    hostaliaswindres="$host_alias-windres"
slouken@406
    56
fi
slouken@406
    57
AC_CHECK_PROGS(WINDRES, [windres $hostaliaswindres $host_os-windres])
slouken@406
    58
slouken@294
    59
dnl Set up the compiler and linker flags
slouken@294
    60
case "$host" in
slouken@294
    61
    *-*-cygwin*)
slouken@294
    62
        # We build SDL on cygwin without the UNIX emulation layer
slouken@294
    63
        BASE_CFLAGS="-I/usr/include/mingw -mno-cygwin"
slouken@294
    64
        BASE_LDFLAGS="-mno-cygwin"
slouken@294
    65
        ;;
slouken@294
    66
    *)
slouken@294
    67
        BASE_CFLAGS="-D_GNU_SOURCE=1"
slouken@294
    68
        BASE_LDFLAGS=""
slouken@294
    69
        ;;
slouken@294
    70
esac
slouken@294
    71
BUILD_CFLAGS="$CFLAGS $CPPFLAGS"
slouken@294
    72
EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
slouken@294
    73
BUILD_LDFLAGS="$LDFLAGS"
slouken@294
    74
EXTRA_LDFLAGS="$BASE_LDFLAGS"
slouken@368
    75
## These are common directories to find software packages
slouken@368
    76
#for path in /usr/freeware /usr/pkg /usr/local; do
slouken@368
    77
#    if test -d $path/include; then
slouken@368
    78
#        EXTRA_CFLAGS="$EXTRA_CFLAGS -I$path/include"
slouken@368
    79
#    fi
slouken@368
    80
#    if test -d $path/lib; then
slouken@368
    81
#        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$path/lib"
slouken@368
    82
#    fi
slouken@368
    83
#done
slouken@294
    84
CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
slouken@294
    85
CFLAGS="$CFLAGS $EXTRA_CFLAGS"
slouken@294
    86
LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
slouken@91
    87
slouken@294
    88
dnl Check for compiler characteristics
slouken@294
    89
AC_C_CONST
slouken@0
    90
slouken@432
    91
dnl See whether we can use gcc style dependency tracking
slouken@432
    92
AC_ARG_ENABLE(dependency-tracking,
slouken@432
    93
AC_HELP_STRING([--enable-dependency-tracking],
slouken@432
    94
               [Use gcc -MMD -MT dependency tracking [[default=yes]]]),
slouken@432
    95
              , enable_dependency_tracking=yes)
slouken@432
    96
if test x$enable_dependency_tracking = xyes; then
slouken@432
    97
    have_gcc_mmd_mt=no
slouken@432
    98
    AC_MSG_CHECKING(for GCC -MMD -MT option)
slouken@432
    99
    AC_TRY_COMPILE([
slouken@432
   100
    #if !defined(__GNUC__) || __GNUC__ < 3
slouken@432
   101
    #error Dependency tracking requires GCC 3.0 or newer
slouken@432
   102
    #endif
slouken@432
   103
    ],[
slouken@432
   104
    ],[
slouken@432
   105
    have_gcc_mmd_mt=yes
slouken@432
   106
    ])
slouken@432
   107
    AC_MSG_RESULT($have_gcc_mmd_mt)
slouken@432
   108
slouken@432
   109
    if test x$have_gcc_mmd_mt = xyes; then
slouken@432
   110
        DEPENDENCY_TRACKING_OPTIONS="-MMD -MT \$@"
slouken@432
   111
    fi
slouken@432
   112
fi
slouken@432
   113
    
slouken@289
   114
case "$host" in
slouken@488
   115
    *mingw32ce*)
slouken@488
   116
        #VERSION_SOURCES="$srcdir/version.rc"
slouken@488
   117
        EXE=".exe"
slouken@488
   118
	;;
slouken@294
   119
    *-*-cygwin* | *-*-mingw32*)
slouken@422
   120
        VERSION_SOURCES="$srcdir/version.rc"
slouken@294
   121
        EXE=".exe"
slouken@368
   122
        if test "$build" != "$host"; then # cross-compiling
slouken@368
   123
            # Default cross-compile location
slouken@368
   124
            ac_default_prefix=/usr/local/cross-tools/i386-mingw32
slouken@368
   125
        else
slouken@368
   126
            # Look for the location of the tools and install there
slouken@368
   127
            if test "$BUILD_PREFIX" != ""; then
slouken@368
   128
                ac_default_prefix=$BUILD_PREFIX
slouken@368
   129
            fi
slouken@368
   130
        fi
slouken@6
   131
        ;;
slouken@294
   132
    *)
slouken@368
   133
        SOURCES=""
slouken@294
   134
        EXE=""
slouken@208
   135
        ;;
slouken@6
   136
esac
slouken@6
   137
slouken@294
   138
# Standard C sources
slouken@294
   139
SOURCES="$SOURCES \
slouken@294
   140
$srcdir/effect_position.c \
slouken@294
   141
$srcdir/effect_stereoreverse.c \
slouken@294
   142
$srcdir/effects_internal.c \
slouken@294
   143
$srcdir/load_aiff.c \
slouken@294
   144
$srcdir/load_voc.c \
slouken@294
   145
$srcdir/mixer.c \
slouken@294
   146
$srcdir/music.c"
slouken@294
   147
slouken@451
   148
dnl set this to use on systems that use lib64 instead of lib
slouken@451
   149
base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
slouken@451
   150
icculus@482
   151
dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually).
icculus@482
   152
dnl  Details of this flag are here: http://gcc.gnu.org/wiki/Visibility
icculus@482
   153
CheckVisibilityHidden()
icculus@482
   154
{
icculus@482
   155
    AC_MSG_CHECKING(for GCC -fvisibility=hidden option)
icculus@482
   156
    have_gcc_fvisibility=no
icculus@482
   157
icculus@482
   158
    visibility_CFLAGS="-fvisibility=hidden"
icculus@482
   159
    save_CFLAGS="$CFLAGS"
icculus@482
   160
    CFLAGS="$save_CFLAGS $visibility_CFLAGS -Werror"
icculus@482
   161
    AC_TRY_COMPILE([
icculus@482
   162
    #if !defined(__GNUC__) || __GNUC__ < 4
icculus@482
   163
    #error SDL only uses visibility attributes in GCC 4 or newer
icculus@482
   164
    #endif
icculus@482
   165
    ],[
icculus@482
   166
    ],[
icculus@482
   167
    have_gcc_fvisibility=yes
icculus@482
   168
    ])
icculus@482
   169
    AC_MSG_RESULT($have_gcc_fvisibility)
icculus@482
   170
    CFLAGS="$save_CFLAGS"
icculus@482
   171
icculus@482
   172
    if test x$have_gcc_fvisibility = xyes; then
icculus@482
   173
        EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS"
icculus@482
   174
    fi
icculus@482
   175
}
icculus@482
   176
icculus@482
   177
slouken@451
   178
dnl Function to find a library in the compiler search path
slouken@368
   179
find_lib()
slouken@368
   180
{
slouken@372
   181
    gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
slouken@372
   182
    gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
slouken@451
   183
    env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`]
slouken@405
   184
    if test "$cross_compiling" = yes; then
slouken@405
   185
        host_lib_path=""
slouken@405
   186
    else
slouken@451
   187
        host_lib_path="/usr/$base_libdir /usr/local/$base_libdir"
slouken@405
   188
    fi
slouken@405
   189
    for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do
slouken@451
   190
        lib=[`ls -- $path/$1 2>/dev/null | sort | sed 's/.*\/\(.*\)/\1/; q'`]
slouken@368
   191
        if test x$lib != x; then
slouken@368
   192
            echo $lib
slouken@368
   193
            return
slouken@368
   194
        fi
slouken@368
   195
    done
slouken@368
   196
}
slouken@368
   197
slouken@20
   198
dnl Check for SDL
slouken@308
   199
SDL_VERSION=1.2.10
slouken@20
   200
AM_PATH_SDL($SDL_VERSION,
slouken@20
   201
            :,
slouken@368
   202
            AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
slouken@20
   203
)
slouken@294
   204
EXTRA_CFLAGS="$EXTRA_CFLAGS $SDL_CFLAGS"
slouken@294
   205
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SDL_LIBS"
slouken@0
   206
patmandin@464
   207
dnl Check for math library
patmandin@464
   208
AC_CHECK_LIB(m, pow, [LIBM="-lm"])
patmandin@464
   209
slouken@0
   210
dnl Check command-line options
slouken@91
   211
icculus@482
   212
CheckVisibilityHidden
icculus@482
   213
slouken@312
   214
AC_ARG_ENABLE([music-cmd],
slouken@312
   215
AC_HELP_STRING([--enable-music-cmd], [support an external music player [[default=yes]]]),
slouken@467
   216
              [], [enable_music_cmd=detect])
slouken@467
   217
if test "x$enable_music_cmd" != xno; then
slouken@467
   218
    AC_CHECK_FUNCS([fork vfork])
slouken@467
   219
    if test "x$ac_cv_func_fork" = "xyes"; then
slouken@467
   220
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_FORK"
slouken@467
   221
    elif test "x$ac_cv_func_vfork" = "xyes"; then
slouken@467
   222
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_VFORK"
slouken@467
   223
    elif test "x$enable_music_cmd" = "xyes"; then
slouken@467
   224
        AC_MSG_ERROR([external music player not available on your platform])
slouken@467
   225
    else
slouken@467
   226
        enable_music_cmd=no
slouken@467
   227
    fi
slouken@467
   228
    if test "x$enable_music_cmd" != xno; then
slouken@467
   229
        SOURCES="$SOURCES $srcdir/music_cmd.c"
slouken@467
   230
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DCMD_MUSIC"
slouken@467
   231
    fi
slouken@0
   232
fi
slouken@419
   233
slouken@312
   234
AC_ARG_ENABLE([music-wave],
slouken@312
   235
AC_HELP_STRING([--enable-music-wave], [enable streaming WAVE music [[default=yes]]]),
slouken@312
   236
              [], [enable_music_wave=yes])
slouken@0
   237
if test x$enable_music_wave = xyes; then
slouken@294
   238
    SOURCES="$SOURCES $srcdir/wavestream.c"
slouken@294
   239
    EXTRA_CFLAGS="$EXTRA_CFLAGS -DWAV_MUSIC"
slouken@0
   240
fi
slouken@419
   241
slouken@419
   242
AC_ARG_ENABLE([music-mod],
slouken@419
   243
AC_HELP_STRING([--enable-music-mod], [enable MOD music via mikmod [[default=yes]]]),
slouken@419
   244
              [], [enable_music_mod=yes])
slouken@419
   245
AC_ARG_ENABLE([music-mod-shared],
slouken@419
   246
AC_HELP_STRING([--enable-music-mod-shared], [dynamically load MOD support [[default=yes]]]),
slouken@419
   247
              [], [enable_music_mod_shared=yes])
slouken@419
   248
if test x$enable_music_mod = xyes; then
slouken@419
   249
    have_libmikmod=no
slouken@419
   250
    libmikmod_maj=3
slouken@419
   251
    libmikmod_min=1
slouken@419
   252
    libmikmod_rev=10
slouken@419
   253
    libmikmod_ver="$libmikmod_maj.$libmikmod_min.$libmikmod_rev"
slouken@368
   254
    AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no, [$PATH])
slouken@368
   255
    if test "$LIBMIKMOD_CONFIG" != "no" ; then
slouken@419
   256
        
slouken@368
   257
        CFLAGS_SAVED="$CFLAGS"
slouken@368
   258
        LIBS_SAVED="$LIBS"
slouken@368
   259
        CFLAGS="$CFLAGS -DLIBMIKMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`"
slouken@368
   260
        LIBS="$LIBS `$LIBMIKMOD_CONFIG --libs`"
slouken@419
   261
        have_libmikmod=yes
slouken@368
   262
        AC_MSG_CHECKING([for libmikmod - version >= $libmikmod_ver])
slouken@368
   263
        AC_TRY_RUN([
slouken@249
   264
#include "mikmod.h"
slouken@249
   265
#include "stdio.h"
slouken@249
   266
slouken@249
   267
int main(int argc, char **argv)
slouken@249
   268
{
slouken@419
   269
long maj=$libmikmod_maj,min=$libmikmod_min,rev=$libmikmod_rev,ver=MikMod_GetVersion();
slouken@419
   270
/*printf("(%d.%d.%d) ",ver>>16,(ver>>8)&0xff,ver&0xff);*/
slouken@419
   271
if(ver>=((maj<<16)|(min<<8)|(rev))) {
slouken@419
   272
    printf("yes\n");
slouken@419
   273
    return 0;
slouken@249
   274
}
slouken@419
   275
printf("no\n*** libmikmod is older than %d.%d.%d, not using.\n",maj,min,rev);
slouken@419
   276
return 1;
slouken@419
   277
}
slouken@419
   278
], [], have_libmikmod=no; CFLAGS="$CFLAGS_SAVED"; LIBS="$LIBS_SAVED",
slouken@419
   279
        [echo $ac_n "cross compiling; assumed OK... $ac_c"])
slouken@368
   280
    fi
slouken@419
   281
slouken@419
   282
    if test x$have_libmikmod = xyes; then
slouken@419
   283
        case "$host" in
slouken@419
   284
            *-*-darwin*)
slouken@456
   285
                mikmod_lib=[`find_lib libmikmod.dylib`]
slouken@419
   286
                ;;
slouken@419
   287
            *-*-cygwin* | *-*-mingw32*)
slouken@419
   288
                mikmod_lib=[`find_lib "mikmod*.dll"`]
slouken@419
   289
                ;;
slouken@419
   290
            *)
slouken@419
   291
                mikmod_lib=[`find_lib "libmikmod*.so.[0-9]"`]
slouken@419
   292
                if test x$mikmod_lib = x; then
slouken@419
   293
                    mikmod_lib=[`find_lib "libmikmod*.so.[0-9]*"`]
slouken@419
   294
                fi
slouken@419
   295
                ;;
slouken@419
   296
        esac
slouken@419
   297
        SOURCES="$SOURCES $srcdir/*_mod.c"
slouken@419
   298
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`"
slouken@419
   299
        if test x$enable_music_mod_shared = xyes && test x$mikmod_lib != x; then
slouken@419
   300
            echo "-- dynamic libmikmod -> $mikmod_lib"
slouken@419
   301
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DMOD_DYNAMIC=\\\"$mikmod_lib\\\""
slouken@419
   302
        else
slouken@419
   303
            EXTRA_LDFLAGS="$EXTRA_LDFLAGS `$LIBMIKMOD_CONFIG --libs`"
slouken@419
   304
        fi
slouken@419
   305
    else
slouken@419
   306
        AC_MSG_WARN([*** Unable to find MikMod library (http://mikmod.raphnet.net/)])
slouken@419
   307
    fi
slouken@249
   308
fi
slouken@249
   309
slouken@481
   310
AC_ARG_ENABLE([music-mod-modplug],
slouken@481
   311
AC_HELP_STRING([--enable-music-mod-modplug], [enable MOD music via modplug [[default=no]]]),
slouken@481
   312
              [], [enable_music_mod_modplug=no])
slouken@481
   313
if test x$enable_music_mod_modplug = xyes; then
slouken@481
   314
	PKG_CHECK_MODULES([MODPLUG], [libmodplug >= 0.8.7])
slouken@481
   315
	EXTRA_CFLAGS="$EXTRA_CFLAGS -DMODPLUG_MUSIC  $MODPLUG_CFLAGS"
slouken@481
   316
	EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MODPLUG_LIBS"
slouken@481
   317
dnl	AC_TRY_COMPILE([
slouken@481
   318
dnl     #include "modplug.h"
slouken@481
   319
dnl    ],[
slouken@481
   320
dnl    ],[
slouken@481
   321
    have_libmodplug=yes
icculus@483
   322
    SOURCES="$SOURCES $srcdir/music_modplug.c"
slouken@481
   323
dnl    ])
slouken@481
   324
else
slouken@481
   325
	have_libmodplug=no
slouken@481
   326
fi
slouken@481
   327
slouken@481
   328
if test x$have_libmikmod != xyes -a x$have_libmodplug != xyes ; then
slouken@481
   329
	AC_MSG_WARN([MOD support disabled])
slouken@481
   330
fi
slouken@481
   331
slouken@312
   332
AC_ARG_ENABLE([music-midi],
slouken@312
   333
AC_HELP_STRING([--enable-music-midi], [enable MIDI music via timidity [[default=yes]]]),
slouken@312
   334
              [], [enable_music_midi=yes])
slouken@0
   335
if test x$enable_music_midi = xyes; then
slouken@294
   336
    EXTRA_CFLAGS="$EXTRA_CFLAGS -DMID_MUSIC"
slouken@312
   337
    AC_ARG_ENABLE([music-timidity-midi],
slouken@312
   338
AC_HELP_STRING([--enable-music-timidity-midi], [enable timidity MIDI output [[default=yes]]]),
slouken@312
   339
                  [], [enable_music_timidity_midi=yes])
slouken@106
   340
    if test x$enable_music_timidity_midi = xyes; then
slouken@294
   341
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_TIMIDITY_MIDI -I\$(srcdir)/timidity"
slouken@294
   342
        SOURCES="$SOURCES $srcdir/timidity/*.c"
slouken@106
   343
    fi
slouken@312
   344
    AC_ARG_ENABLE([music-native-midi],
slouken@312
   345
AC_HELP_STRING([--enable-music-native-midi], [enable native MIDI music output [[default=yes]]]),
slouken@312
   346
                  [], [enable_music_native_midi=yes])
slouken@99
   347
    if test x$enable_music_native_midi = xyes; then
slouken@99
   348
        use_music_native_midi=no
slouken@289
   349
        case "$host" in
slouken@488
   350
            *mingw32ce*)
slouken@488
   351
                use_music_native_midi=no
slouken@488
   352
                ;;
slouken@99
   353
            *-*-cygwin* | *-*-mingw32*)
slouken@99
   354
                use_music_native_midi=yes
slouken@294
   355
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lwinmm"
slouken@99
   356
                ;;
slouken@107
   357
            *-*-darwin*)
icculus@458
   358
                use_music_native_midi=yes
icculus@461
   359
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,CoreServices"
slouken@107
   360
                ;;
slouken@494
   361
            *-*-haiku*)
slouken@494
   362
                use_music_native_midi=yes_cpp
slouken@494
   363
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmidi" 
slouken@494
   364
                ;;
slouken@99
   365
        esac
slouken@99
   366
        if test x$use_music_native_midi = xyes; then
slouken@294
   367
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_NATIVE_MIDI -I\$(srcdir)/native_midi"
slouken@294
   368
            SOURCES="$SOURCES $srcdir/native_midi/*.c"
slouken@494
   369
        elif test x$use_music_native_midi = xyes_cpp; then
slouken@494
   370
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_NATIVE_MIDI -I\$(srcdir)/native_midi"
slouken@494
   371
            SOURCES="$SOURCES $srcdir/native_midi/*.c"
slouken@494
   372
            SOURCES_CXX="$SOURCES_CXX $srcdir/native_midi/*.cpp"
slouken@99
   373
        fi
slouken@99
   374
    fi
slouken@312
   375
    AC_ARG_ENABLE([music-native-midi-gpl],
slouken@312
   376
AC_HELP_STRING([--enable-music-native-midi-gpl], [enable native MIDI on UNIX using GPL code [[default=no]]]),
slouken@312
   377
                  [], [enable_music_native_midi_gpl=no])
slouken@160
   378
    if test x$enable_music_native_midi_gpl = xyes; then
slouken@160
   379
        use_music_native_midi_gpl=no
slouken@289
   380
        case "$host" in
slouken@160
   381
            *-*-linux* | *-*-freebsd*)
slouken@160
   382
                use_music_native_midi_gpl=yes
slouken@160
   383
                ;;
slouken@160
   384
        esac
slouken@160
   385
        if test x$use_music_native_midi_gpl = xyes; then
slouken@294
   386
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_NATIVE_MIDI -I\$(srcdir)/native_midi"
slouken@294
   387
            SOURCES="$SOURCES $srcdir/native_midi_gpl/*.c"
slouken@160
   388
        fi
slouken@160
   389
    fi
chewi@506
   390
    AC_ARG_ENABLE([music-fluidsynth-midi],
chewi@506
   391
AC_HELP_STRING([--enable-music-fluidsynth-midi], [enable FluidSynth MIDI output [[default=yes]]]),
chewi@506
   392
                  [], [enable_music_fluidsynth_midi=yes])
chewi@506
   393
    AC_ARG_ENABLE([music-fluidsynth-shared],
chewi@506
   394
AC_HELP_STRING([--enable-music-fluidsynth-shared], [dynamically load FluidSynth support [[default=yes]]]),
chewi@506
   395
                  [], [enable_music_fluidsynth_shared=yes])
chewi@506
   396
    if test x$enable_music_fluidsynth_midi = xyes; then
chewi@506
   397
        AC_CHECK_HEADER([fluidsynth.h], [have_fluidsynth_hdr=yes])
chewi@506
   398
        AC_CHECK_LIB([fluidsynth], [fluid_player_add_mem], [have_fluidsynth_lib=yes])
chewi@506
   399
        if test x$have_fluidsynth_hdr = xyes -a x$have_fluidsynth_lib = xyes; then
chewi@506
   400
            case "$host" in
chewi@506
   401
                *-*-darwin*)
chewi@506
   402
                    fluidsynth_lib=[`find_lib libfluidsynth.dylib`]
chewi@506
   403
                    if test x$fluidsynth_lib = x; then
chewi@506
   404
                        fluidsynth_lib=[`find_lib libfluidsynth.[0-9]`]
chewi@506
   405
                    fi
chewi@506
   406
                    if test x$fluidsynth_lib = x; then
chewi@506
   407
                        fluidsynth_lib=[`find_lib libfluidsynth.[0-9]*`]
chewi@506
   408
                    fi
chewi@506
   409
                    ;;
chewi@506
   410
                *-*-cygwin* | *-*-mingw32*)
chewi@506
   411
                    fluidsynth_lib=[`find_lib "fluidsynth*.dll"`]
chewi@506
   412
                    ;;
chewi@506
   413
                *)
chewi@506
   414
                    fluidsynth_lib=[`find_lib "libfluidsynth.so.[0-9]"`]
chewi@506
   415
                    if test x$fluidsynth_lib = x; then
chewi@506
   416
                        fluidsynth_lib=[`find_lib "libfluidsynth.so.[0-9]*"`]
chewi@506
   417
                    fi
chewi@506
   418
                    ;;
chewi@506
   419
            esac
chewi@506
   420
            SOURCES="$SOURCES $srcdir/dynamic_fluidsynth.c $srcdir/fluidsynth.c"
chewi@506
   421
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_FLUIDSYNTH_MIDI"
chewi@506
   422
            if test x$enable_music_fluidsynth_shared = xyes && test x$fluidsynth_lib != x; then
chewi@506
   423
                echo "-- dynamic libfluidsyth -> $fluidsynth_lib"
chewi@506
   424
                EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLUIDSYNTH_DYNAMIC=\\\"$fluidsynth_lib\\\""
chewi@506
   425
            else
chewi@506
   426
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lfluidsynth"
chewi@506
   427
            fi
chewi@506
   428
        else
chewi@506
   429
            AC_MSG_WARN([*** Unable to find FluidSynth library (http://www.fluidsynth.org/)])
chewi@506
   430
            AC_MSG_WARN([FluidSynth support disabled])
chewi@506
   431
        fi
chewi@506
   432
    fi
slouken@0
   433
fi
slouken@419
   434
slouken@312
   435
AC_ARG_ENABLE([music-ogg],
slouken@312
   436
AC_HELP_STRING([--enable-music-ogg], [enable Ogg Vorbis music [[default=yes]]]),
slouken@312
   437
              [], [enable_music_ogg=yes])
slouken@353
   438
AC_ARG_ENABLE(music-ogg-tremor,
slouken@419
   439
AC_HELP_STRING([--enable-music-ogg-tremor], [enable OGG Vorbis music via libtremor [[default=no]]]),
slouken@368
   440
              [], enable_music_ogg_tremor=no)
slouken@368
   441
AC_ARG_ENABLE([music-ogg-shared],
slouken@368
   442
AC_HELP_STRING([--enable-music-ogg-shared], [dynamically load Ogg Vorbis support [[default=yes]]]),
slouken@368
   443
              [], [enable_music_ogg_shared=yes])
slouken@368
   444
if test x$enable_music_ogg = xyes; then
slouken@368
   445
    if test x$enable_music_ogg_tremor = xyes; then
slouken@368
   446
        AC_CHECK_HEADER([tremor/ivorbisfile.h], [have_tremor_hdr=yes])
slouken@468
   447
        AC_CHECK_LIB([vorbisidec], [ov_open_callbacks], [have_tremor_lib=yes])
slouken@368
   448
        if test x$have_tremor_hdr = xyes -a x$have_tremor_lib = xyes; then
slouken@368
   449
            case "$host" in
slouken@368
   450
                *-*-darwin*)
slouken@456
   451
                    ogg_lib=[`find_lib libvorbisidec.dylib`]
slouken@368
   452
                    if test x$ogg_lib = x; then
slouken@368
   453
                        ogg_lib=[`find_lib libvorbisidec.[0-9]`]
slouken@368
   454
                    fi
slouken@368
   455
                    if test x$ogg_lib = x; then
slouken@368
   456
                        ogg_lib=[`find_lib libvorbisidec.[0-9]*`]
slouken@368
   457
                    fi
slouken@368
   458
                    ;;
slouken@368
   459
                *-*-cygwin* | *-*-mingw32*)
slouken@372
   460
                    ogg_lib=[`find_lib "vorbisidec*.dll"`]
slouken@368
   461
                    ;;
slouken@368
   462
                *)
slouken@368
   463
                    ogg_lib=[`find_lib "libvorbisidec.so.[0-9]"`]
slouken@368
   464
                    if test x$ogg_lib = x; then
slouken@368
   465
                        ogg_lib=[`find_lib "libvorbisidec.so.[0-9]*"`]
slouken@368
   466
                    fi
slouken@368
   467
                    ;;
slouken@368
   468
            esac
slouken@368
   469
            SOURCES="$SOURCES $srcdir/*_ogg.c"
slouken@368
   470
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_MUSIC -DOGG_USE_TREMOR"
slouken@368
   471
            if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then
slouken@368
   472
                echo "-- dynamic libvorbisidec -> $ogg_lib"
slouken@368
   473
                EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\""
slouken@368
   474
            else
slouken@501
   475
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisidec -lvorbis -logg"
slouken@368
   476
            fi
slouken@419
   477
        else
slouken@419
   478
            AC_MSG_WARN([*** Unable to find Ogg Vorbis Tremor library (http://www.xiph.org/)])
slouken@419
   479
            AC_MSG_WARN([Ogg Vorbis support disabled])
slouken@368
   480
        fi
slouken@368
   481
    else
slouken@368
   482
        AC_CHECK_HEADER([vorbis/vorbisfile.h], [have_ogg_hdr=yes])
slouken@468
   483
        AC_CHECK_LIB([vorbisfile], [ov_open_callbacks], [have_ogg_lib=yes])
slouken@368
   484
        if test x$have_ogg_hdr = xyes -a x$have_ogg_lib = xyes; then
slouken@368
   485
            case "$host" in
slouken@368
   486
                *-*-darwin*)
slouken@456
   487
                    ogg_lib=[`find_lib libvorbisfile.dylib`]
slouken@368
   488
                    ;;
slouken@368
   489
                *-*-cygwin* | *-*-mingw32*)
slouken@372
   490
                    ogg_lib=[`find_lib "libvorbisfile*.dll"`]
slouken@368
   491
                    ;;
slouken@368
   492
                *)
slouken@368
   493
                    ogg_lib=[`find_lib "libvorbisfile.so.[0-9]"`]
slouken@368
   494
                    if test x$ogg_lib = x; then
slouken@368
   495
                        ogg_lib=[`find_lib "libvorbisfile.so.[0-9]*"`]
slouken@368
   496
                    fi
slouken@368
   497
                    ;;
slouken@368
   498
            esac
slouken@368
   499
            SOURCES="$SOURCES $srcdir/*_ogg.c"
slouken@368
   500
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_MUSIC"
slouken@368
   501
            if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then
slouken@368
   502
                echo "-- dynamic libvorbisfile -> $ogg_lib"
slouken@368
   503
                EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\""
slouken@368
   504
            else
slouken@501
   505
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisfile -lvorbis -logg"
slouken@368
   506
            fi
slouken@419
   507
        else
slouken@419
   508
            AC_MSG_WARN([*** Unable to find Ogg Vorbis library (http://www.xiph.org/)])
slouken@419
   509
            AC_MSG_WARN([Ogg Vorbis support disabled])
slouken@368
   510
        fi
slouken@353
   511
    fi
slouken@353
   512
fi
slouken@419
   513
slouken@396
   514
libflac_ver=8
slouken@382
   515
AC_ARG_ENABLE([music-flac],
slouken@382
   516
AC_HELP_STRING([--enable-music-flac], [enable FLAC music [[default=yes]]]),
slouken@382
   517
              [], [enable_music_flac=yes])
slouken@382
   518
AC_ARG_ENABLE([music-flac-shared],
slouken@382
   519
AC_HELP_STRING([--enable-music-flac-shared],
slouken@382
   520
              [dynamically load FLAC support [[default=yes]]]),
slouken@382
   521
              [], [enable_music_flac_shared=yes])
slouken@382
   522
if test x$enable_music_flac = xyes; then
slouken@452
   523
    AC_CHECK_HEADER([FLAC/export.h], [have_flac_export=yes])
slouken@452
   524
    if test x$have_flac_export = xyes; then
slouken@452
   525
        LIBS_SAVED="$LIBS"
slouken@452
   526
        LIBS="-lFLAC"
slouken@452
   527
        AC_MSG_CHECKING([for libflac so-name version >= $libflac_ver])
slouken@502
   528
        AC_TRY_COMPILE([
slouken@396
   529
#include "FLAC/export.h"
slouken@396
   530
#include "stdio.h"
slouken@502
   531
],[
slouken@396
   532
#if defined(FLAC_API_VERSION_CURRENT) && (FLAC_API_VERSION_CURRENT >= $libflac_ver)
slouken@396
   533
#else
slouken@502
   534
#error "old-flac"
slouken@396
   535
#endif
slouken@396
   536
], have_flac_ver=yes, have_flac_ver=no)
slouken@419
   537
        LIBS="$LIBS_SAVED"
slouken@419
   538
        AC_MSG_RESULT($have_flac_ver)
slouken@419
   539
    fi
slouken@419
   540
slouken@419
   541
    if test x$have_flac_ver = xyes; then
slouken@419
   542
        AC_CHECK_HEADER([FLAC/stream_decoder.h], [have_flac_hdr=yes])
slouken@419
   543
        AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_new], [have_flac_lib=yes])
slouken@419
   544
        if test x$have_flac_hdr = xyes -a x$have_flac_lib = xyes; then    
slouken@419
   545
            case "$host" in
slouken@419
   546
                *-*-darwin*)
slouken@456
   547
                    flac_lib=[`find_lib libFLAC.dylib`]
slouken@419
   548
                    ;;
slouken@419
   549
                *-*-cygwin* | *-*-mingw32*)
slouken@419
   550
                    flac_lib=[`find_lib "libFLAC*.dll"`]
slouken@419
   551
                    ;;
slouken@419
   552
                *)
slouken@419
   553
                    flac_lib=[`find_lib "libFLAC.so.[0-9]"`]
slouken@419
   554
                    if test x$flac_lib = x; then
slouken@419
   555
                        flac_lib=[`find_lib "libFLAC.so.[0-9]*"`]
slouken@419
   556
                    fi
slouken@419
   557
                    ;;
slouken@419
   558
            esac
slouken@419
   559
            SOURCES="$SOURCES $srcdir/*_flac.c"
slouken@419
   560
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLAC_MUSIC"
slouken@419
   561
            if test x$enable_music_flac_shared = xyes && test x$flac_lib != x; then
slouken@419
   562
                echo "-- dynamic libFLAC -> $flac_lib"
slouken@419
   563
                EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLAC_DYNAMIC=\\\"$flac_lib\\\""
slouken@419
   564
            else
slouken@419
   565
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lFLAC"
slouken@419
   566
            fi
slouken@419
   567
        fi
slouken@419
   568
    else
slouken@419
   569
        AC_MSG_WARN([*** Unable to find FLAC library (http://flac.sourceforge.net/)])
slouken@419
   570
        AC_MSG_WARN([FLAC support disabled])
slouken@419
   571
    fi
slouken@382
   572
fi
slouken@419
   573
slouken@488
   574
AC_CHECK_HEADERS([signal.h], [EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_SIGNAL_H"])
slouken@488
   575
AC_CHECK_FUNCS(setbuf, [EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_SETBUF"])
slouken@488
   576
slouken@0
   577
AC_ARG_ENABLE(music-mp3,
slouken@419
   578
AC_HELP_STRING([--enable-music-mp3], [enable MP3 music via smpeg [[default=yes]]]),
slouken@419
   579
              [], enable_music_mp3=yes)
slouken@419
   580
AC_ARG_ENABLE([music-mp3-shared],
slouken@419
   581
AC_HELP_STRING([--enable-music-mp3-shared], [dynamically load MP3 support [[default=yes]]]),
slouken@419
   582
              [], [enable_music_mp3_shared=yes])
slouken@0
   583
if test x$enable_music_mp3 = xyes; then
slouken@83
   584
    SMPEG_VERSION=0.4.3
slouken@83
   585
    AM_PATH_SMPEG($SMPEG_VERSION, have_smpeg=yes, have_smpeg=no)
slouken@0
   586
    if test x$have_smpeg = xyes; then
slouken@313
   587
        case "$host" in
slouken@313
   588
            *-*-darwin*)
slouken@456
   589
                smpeg_lib=[`find_lib libsmpeg.dylib`]
slouken@313
   590
                ;;
slouken@313
   591
            *-*-cygwin* | *-*-mingw32*)
slouken@372
   592
                smpeg_lib=[`find_lib "smpeg*.dll"`]
slouken@313
   593
                ;;
slouken@313
   594
            *)
slouken@374
   595
                smpeg_lib=[`find_lib "libsmpeg*.so.[0-9]"`]
slouken@368
   596
                if test x$smpeg_lib = x; then
slouken@374
   597
                    smpeg_lib=[`find_lib "libsmpeg*.so.[0-9]*"`]
slouken@368
   598
                fi
slouken@313
   599
                ;;
slouken@313
   600
        esac
slouken@314
   601
        SOURCES="$SOURCES $srcdir/*_mp3.c"
slouken@294
   602
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MUSIC $SMPEG_CFLAGS"
slouken@313
   603
        if test x$enable_music_mp3_shared = xyes && test x$smpeg_lib != x; then
slouken@313
   604
            echo "-- dynamic libsmpeg -> $smpeg_lib"
slouken@313
   605
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_DYNAMIC=\\\"$smpeg_lib\\\""
slouken@313
   606
        else
slouken@313
   607
            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SMPEG_LIBS"
slouken@313
   608
        fi
slouken@419
   609
    else
slouken@419
   610
        AC_MSG_WARN([*** Unable to find SMPEG library (http://icculus.org/smpeg/)])
slouken@0
   611
    fi
slouken@0
   612
fi
slouken@419
   613
slouken@357
   614
AC_ARG_ENABLE(music-mp3-mad-gpl,
slouken@357
   615
AC_HELP_STRING([--enable-music-mp3-mad-gpl], [enable MP3 music via libmad GPL code [[default=no]]]),
slouken@357
   616
                  [], [enable_music_mp3_mad_gpl=no])
slouken@357
   617
if test x$enable_music_mp3_mad_gpl = xyes; then
slouken@357
   618
    AC_MSG_CHECKING(for libmad headers)
slouken@357
   619
    have_libmad=no
slouken@357
   620
    AC_TRY_COMPILE([
slouken@357
   621
     #include "mad.h"
slouken@357
   622
    ],[
slouken@357
   623
    ],[
slouken@357
   624
    have_libmad=yes
slouken@357
   625
    ])
slouken@357
   626
    AC_MSG_RESULT($have_libmad)
slouken@357
   627
    if test x$have_libmad = xyes; then
slouken@357
   628
        SOURCES="$SOURCES $srcdir/music_mad.c"
slouken@357
   629
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MAD_MUSIC"
slouken@357
   630
        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmad"
slouken@419
   631
    else
slouken@419
   632
        AC_MSG_WARN([*** Unable to find MAD library (http://www.underbit.com/products/mad/)])
slouken@357
   633
    fi
slouken@357
   634
fi
slouken@0
   635
slouken@419
   636
if test x$have_smpeg != xyes -a x$have_libmad != xyes; then
slouken@419
   637
    AC_MSG_WARN([MP3 support disabled])
slouken@419
   638
fi
slouken@419
   639
slouken@501
   640
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBM"
slouken@422
   641
slouken@422
   642
OBJECTS=`echo $SOURCES`
slouken@422
   643
DEPENDS=`echo $SOURCES`
slouken@422
   644
OBJECTS=`echo "$OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
slouken@422
   645
DEPENDS=`echo "$DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
slouken@422
   646
$(objects)/\2.lo: \1/\2.c\\
slouken@432
   647
	\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
slouken@422
   648
slouken@494
   649
OBJECTS_CXX=`echo $SOURCES_CXX`
slouken@494
   650
DEPENDS_CXX=`echo $SOURCES_CXX`
slouken@494
   651
OBJECTS_CXX=`echo "$OBJECTS_CXX" | sed 's,[[^ ]]*/\([[^ ]]*\)\.cpp,$(objects)/\1.lo,g'`
slouken@494
   652
DEPENDS_CXX=`echo "$DEPENDS_CXX" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.cpp,\\
slouken@494
   653
$(objects)/\2.lo: \1/\2.cpp\\
slouken@494
   654
	\$(LIBTOOL) --mode=compile \$(CXX) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
slouken@494
   655
OBJECTS="$OBJECTS $OBJECTS_CXX"
slouken@494
   656
DEPENDS="$DEPENDS $DEPENDS_CXX"
slouken@497
   657
DEPENDS=`echo "$DEPENDS" | sed 's,\\$,\\\\$,g'`
slouken@494
   658
slouken@422
   659
VERSION_OBJECTS=`echo $VERSION_SOURCES`
slouken@422
   660
VERSION_DEPENDS=`echo $VERSION_SOURCES`
slouken@422
   661
VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
slouken@422
   662
VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.rc,\\
slouken@422
   663
$(objects)/\2.o: \1/\2.rc\\
slouken@422
   664
	\$(WINDRES) \$< \$@,g'`
slouken@497
   665
VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed 's,\\$,\\\\$,g'`
slouken@422
   666
slouken@422
   667
PLAYWAVE_SOURCES="$srcdir/playwave.c"
slouken@422
   668
PLAYWAVE_OBJECTS=`echo $PLAYWAVE_SOURCES`
slouken@422
   669
PLAYWAVE_DEPENDS=`echo $PLAYWAVE_SOURCES`
slouken@422
   670
PLAYWAVE_OBJECTS=`echo "$PLAYWAVE_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
slouken@422
   671
PLAYWAVE_DEPENDS=`echo "$PLAYWAVE_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
slouken@422
   672
$(objects)/\2.lo: \1/\2.c\\
slouken@432
   673
	\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
slouken@497
   674
PLAYWAVE_DEPENDS=`echo "$PLAYWAVE_DEPENDS" | sed 's,\\$,\\\\$,g'`
slouken@422
   675
slouken@422
   676
PLAYMUS_SOURCES="$srcdir/playmus.c"
slouken@422
   677
PLAYMUS_OBJECTS=`echo $PLAYMUS_SOURCES`
slouken@422
   678
PLAYMUS_DEPENDS=`echo $PLAYMUS_SOURCES`
slouken@422
   679
PLAYMUS_OBJECTS=`echo "$PLAYMUS_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
slouken@422
   680
PLAYMUS_DEPENDS=`echo "$PLAYMUS_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
slouken@422
   681
$(objects)/\2.lo: \1/\2.c\\
slouken@432
   682
	\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
slouken@497
   683
PLAYMUS_DEPENDS=`echo "$PLAYMUS_DEPENDS" | sed 's,\\$,\\\\$,g'`
slouken@1
   684
slouken@294
   685
dnl Expand the sources and objects needed to build the library
slouken@294
   686
AC_SUBST(ac_aux_dir)
slouken@294
   687
AC_SUBST(OBJECTS)
slouken@422
   688
AC_SUBST(VERSION_OBJECTS)
slouken@422
   689
AC_SUBST(PLAYWAVE_OBJECTS)
slouken@422
   690
AC_SUBST(PLAYMUS_OBJECTS)
slouken@294
   691
AC_SUBST(BUILD_CFLAGS)
slouken@294
   692
AC_SUBST(EXTRA_CFLAGS)
slouken@294
   693
AC_SUBST(BUILD_LDFLAGS)
slouken@294
   694
AC_SUBST(EXTRA_LDFLAGS)
slouken@294
   695
AC_SUBST(EXE)
slouken@368
   696
AC_SUBST(WINDRES)
slouken@392
   697
AC_SUBST(SDL_VERSION)
slouken@294
   698
AC_SUBST(SDL_CFLAGS)
slouken@294
   699
AC_SUBST(SDL_LIBS)
slouken@206
   700
slouken@0
   701
AC_OUTPUT([
slouken@497
   702
])
slouken@497
   703
AC_CONFIG_FILES([
slouken@392
   704
    Makefile SDL_mixer.spec SDL_mixer.qpg SDL_mixer.pc
slouken@0
   705
])
slouken@497
   706
AC_CONFIG_COMMANDS([default],
slouken@497
   707
                   [cat >>Makefile <<__EOF__
slouken@497
   708
slouken@497
   709
# Build rules for objects
slouken@497
   710
-include \$(OBJECTS:.lo=.d)
slouken@497
   711
$DEPENDS
slouken@497
   712
$VERSION_DEPENDS
slouken@497
   713
slouken@497
   714
-include \$(PLAYWAVE_OBJECTS:.lo=.d)
slouken@497
   715
$PLAYWAVE_DEPENDS
slouken@497
   716
slouken@497
   717
-include \$(PLAYMUS_OBJECTS:.lo=.d)
slouken@497
   718
$PLAYMUS_DEPENDS
slouken@497
   719
__EOF__ 
slouken@497
   720
], [
slouken@497
   721
DEPENDS="$DEPENDS"
slouken@497
   722
VERSION_DEPENDS="$VERSION_DEPENDS"
slouken@497
   723
PLAYWAVE_DEPENDS="$PLAYWAVE_DEPENDS"
slouken@497
   724
PLAYMUS_DEPENDS="$PLAYMUS_DEPENDS"
slouken@497
   725
])
slouken@497
   726
AC_OUTPUT