configure.in
author Sam Lantinga <slouken@libsdl.org>
Wed, 17 Jun 2015 00:11:41 -0700
changeset 705 fe757163b8f7
parent 697 b28b41b93ba7
child 710 1aca2b6d570f
permissions -rw-r--r--
Fixed bug 3018 - Loading MIDI music using FluidSynth leaks memory.

Philipp Wiesemann

There is a memory leak in fluidsynth.c and fluidsynth_loadsong_RW_internal(). The allocated temporary buffer is not deleted if fluid_player_add_mem() returns FLUID_OK.
slouken@0
     1
dnl Process this file with autoconf to produce a configure script.
slouken@618
     2
AC_INIT(README.txt)
slouken@517
     3
AC_CONFIG_AUX_DIR(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@610
    15
MAJOR_VERSION=2
slouken@610
    16
MINOR_VERSION=0
slouken@610
    17
MICRO_VERSION=0
slouken@610
    18
INTERFACE_AGE=0
slouken@610
    19
BINARY_AGE=0
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@669
   124
            ac_default_prefix=/usr/local/cross-tools/$host
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@697
   189
    for path in $env_lib_path $gcc_bin_path $gcc_lib_path $host_lib_path; do
slouken@636
   190
        lib=[`ls -- $path/$1 2>/dev/null | sed -e '/\.so\..*\./d' -e 's,.*/,,' | sort | tail -1`]
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@578
   199
SDL_VERSION=2.0.0
slouken@582
   200
AM_PATH_SDL2($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@639
   210
AC_CHECK_HEADERS([signal.h], [EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_SIGNAL_H"])
slouken@639
   211
AC_CHECK_FUNCS(setbuf, [EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_SETBUF"])
slouken@639
   212
slouken@0
   213
dnl Check command-line options
slouken@91
   214
icculus@482
   215
CheckVisibilityHidden
icculus@482
   216
slouken@312
   217
AC_ARG_ENABLE([music-cmd],
slouken@312
   218
AC_HELP_STRING([--enable-music-cmd], [support an external music player [[default=yes]]]),
slouken@467
   219
              [], [enable_music_cmd=detect])
slouken@467
   220
if test "x$enable_music_cmd" != xno; then
slouken@467
   221
    AC_CHECK_FUNCS([fork vfork])
slouken@467
   222
    if test "x$ac_cv_func_fork" = "xyes"; then
slouken@467
   223
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_FORK"
slouken@467
   224
    elif test "x$ac_cv_func_vfork" = "xyes"; then
slouken@467
   225
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_VFORK"
slouken@467
   226
    elif test "x$enable_music_cmd" = "xyes"; then
slouken@467
   227
        AC_MSG_ERROR([external music player not available on your platform])
slouken@467
   228
    else
slouken@467
   229
        enable_music_cmd=no
slouken@467
   230
    fi
slouken@467
   231
    if test "x$enable_music_cmd" != xno; then
slouken@467
   232
        SOURCES="$SOURCES $srcdir/music_cmd.c"
slouken@467
   233
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DCMD_MUSIC"
slouken@467
   234
    fi
slouken@0
   235
fi
slouken@419
   236
slouken@312
   237
AC_ARG_ENABLE([music-wave],
slouken@312
   238
AC_HELP_STRING([--enable-music-wave], [enable streaming WAVE music [[default=yes]]]),
slouken@312
   239
              [], [enable_music_wave=yes])
slouken@0
   240
if test x$enable_music_wave = xyes; then
slouken@294
   241
    SOURCES="$SOURCES $srcdir/wavestream.c"
slouken@294
   242
    EXTRA_CFLAGS="$EXTRA_CFLAGS -DWAV_MUSIC"
slouken@0
   243
fi
slouken@419
   244
slouken@419
   245
AC_ARG_ENABLE([music-mod],
slouken@639
   246
AC_HELP_STRING([--enable-music-mod], [enable MOD music [[default=yes]]]),
slouken@419
   247
              [], [enable_music_mod=yes])
slouken@639
   248
slouken@639
   249
AC_ARG_ENABLE([music-mod-modplug],
slouken@639
   250
AC_HELP_STRING([--enable-music-mod-modplug], [enable MOD music via modplug [[default=yes]]]),
slouken@639
   251
              [], [enable_music_mod_modplug=yes])
slouken@639
   252
AC_ARG_ENABLE([music-mod-modplug-shared],
slouken@639
   253
AC_HELP_STRING([--enable-music-mod-modplug-shared], [dynamically load modplug library [[default=yes]]]),
slouken@639
   254
              [], [enable_music_mod_modplug_shared=yes])
slouken@639
   255
if test x$enable_music_mod = xyes -a x$enable_music_mod_modplug = xyes; then
slouken@639
   256
    PKG_CHECK_MODULES([MODPLUG], [libmodplug >= 0.8.8], [dnl
slouken@639
   257
            have_libmodplug_hdr=yes
slouken@639
   258
            have_libmodplug_lib=yes
slouken@639
   259
        ], [dnl
slouken@695
   260
            AC_CHECK_HEADER([libmodplug/modplug.h], [have_libmodplug_hdr=yes])
slouken@640
   261
            AC_CHECK_LIB([modplug], [have_libmodplug_lib=yes])
slouken@639
   262
        ])
slouken@639
   263
slouken@639
   264
    if test x$have_libmodplug_hdr = xyes -a x$have_libmodplug_lib = xyes; then
slouken@639
   265
        have_libmodplug=yes
slouken@639
   266
        case "$host" in
slouken@639
   267
            *-*-darwin*)
slouken@639
   268
                modplug_lib=[`find_lib libmodplug.dylib`]
slouken@639
   269
                ;;
slouken@639
   270
            *-*-cygwin* | *-*-mingw32*)
slouken@639
   271
                modplug_lib=[`find_lib "libmodplug*.dll"`]
slouken@639
   272
                ;;
slouken@639
   273
            *)
slouken@639
   274
                modplug_lib=[`find_lib "libmodplug[0-9]*.so.*"`]
slouken@639
   275
                if test x$modplug_lib = x; then
slouken@639
   276
                    modplug_lib=[`find_lib "libmodplug.so.*"`]
slouken@639
   277
                fi
slouken@639
   278
                ;;
slouken@639
   279
        esac
slouken@639
   280
        SOURCES="$SOURCES $srcdir/*_modplug.c"
slouken@639
   281
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DMODPLUG_MUSIC $MODPLUG_CFLAGS"
slouken@639
   282
        if test x$enable_music_mod_modplug_shared = xyes && test x$modplug_lib != x; then
slouken@639
   283
            echo "-- dynamic libmodplug -> $modplug_lib"
slouken@639
   284
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DMODPLUG_DYNAMIC=\\\"$modplug_lib\\\""
slouken@639
   285
        else
slouken@639
   286
	        EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MODPLUG_LIBS"
slouken@639
   287
        fi
slouken@639
   288
    else
slouken@639
   289
        AC_MSG_WARN([*** Unable to find ModPlug library (http://modplug-xmms.sourceforge.net/)])
slouken@639
   290
    fi
slouken@639
   291
fi
slouken@639
   292
slouken@639
   293
AC_ARG_ENABLE([music-mod-mikmod],
slouken@639
   294
AC_HELP_STRING([--enable-music-mod-mikmod], [enable MOD music via mikmod [[default=no]]]),
slouken@639
   295
              [], [enable_music_mod_mikmod=no])
slouken@639
   296
AC_ARG_ENABLE([music-mod-mikmod-shared],
slouken@639
   297
AC_HELP_STRING([--enable-music-mod-mikmod-shared], [dynamically load mikmod library [[default=yes]]]),
slouken@639
   298
              [], [enable_music_mod_mikmod_shared=yes])
slouken@639
   299
if test x$enable_music_mod = xyes -a x$enable_music_mod_mikmod = xyes; then
slouken@419
   300
    have_libmikmod=no
slouken@419
   301
    libmikmod_maj=3
slouken@419
   302
    libmikmod_min=1
slouken@419
   303
    libmikmod_rev=10
slouken@419
   304
    libmikmod_ver="$libmikmod_maj.$libmikmod_min.$libmikmod_rev"
slouken@368
   305
    AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no, [$PATH])
slouken@368
   306
    if test "$LIBMIKMOD_CONFIG" != "no" ; then
slouken@419
   307
        
slouken@368
   308
        CFLAGS_SAVED="$CFLAGS"
slouken@368
   309
        LIBS_SAVED="$LIBS"
slouken@368
   310
        CFLAGS="$CFLAGS -DLIBMIKMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`"
slouken@368
   311
        LIBS="$LIBS `$LIBMIKMOD_CONFIG --libs`"
slouken@419
   312
        have_libmikmod=yes
slouken@368
   313
        AC_MSG_CHECKING([for libmikmod - version >= $libmikmod_ver])
slouken@368
   314
        AC_TRY_RUN([
slouken@249
   315
#include "mikmod.h"
slouken@249
   316
#include "stdio.h"
slouken@249
   317
slouken@249
   318
int main(int argc, char **argv)
slouken@249
   319
{
slouken@419
   320
long maj=$libmikmod_maj,min=$libmikmod_min,rev=$libmikmod_rev,ver=MikMod_GetVersion();
slouken@419
   321
/*printf("(%d.%d.%d) ",ver>>16,(ver>>8)&0xff,ver&0xff);*/
slouken@419
   322
if(ver>=((maj<<16)|(min<<8)|(rev))) {
slouken@419
   323
    printf("yes\n");
slouken@419
   324
    return 0;
slouken@249
   325
}
slouken@419
   326
printf("no\n*** libmikmod is older than %d.%d.%d, not using.\n",maj,min,rev);
slouken@419
   327
return 1;
slouken@419
   328
}
slouken@419
   329
], [], have_libmikmod=no; CFLAGS="$CFLAGS_SAVED"; LIBS="$LIBS_SAVED",
slouken@419
   330
        [echo $ac_n "cross compiling; assumed OK... $ac_c"])
slouken@368
   331
    fi
slouken@419
   332
slouken@419
   333
    if test x$have_libmikmod = xyes; then
slouken@419
   334
        case "$host" in
slouken@419
   335
            *-*-darwin*)
slouken@456
   336
                mikmod_lib=[`find_lib libmikmod.dylib`]
slouken@419
   337
                ;;
slouken@419
   338
            *-*-cygwin* | *-*-mingw32*)
slouken@556
   339
                mikmod_lib=[`find_lib "libmikmod*.dll"`]
slouken@419
   340
                ;;
slouken@419
   341
            *)
slouken@639
   342
                mikmod_lib=[`find_lib "libmikmod[0-9]*.so.*"`]
slouken@419
   343
                if test x$mikmod_lib = x; then
slouken@636
   344
                    mikmod_lib=[`find_lib "libmikmod.so.*"`]
slouken@419
   345
                fi
slouken@419
   346
                ;;
slouken@419
   347
        esac
slouken@419
   348
        SOURCES="$SOURCES $srcdir/*_mod.c"
slouken@419
   349
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`"
slouken@639
   350
        if test x$enable_music_mod_mikmod_shared = xyes && test x$mikmod_lib != x; then
slouken@419
   351
            echo "-- dynamic libmikmod -> $mikmod_lib"
slouken@419
   352
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DMOD_DYNAMIC=\\\"$mikmod_lib\\\""
slouken@419
   353
        else
slouken@419
   354
            EXTRA_LDFLAGS="$EXTRA_LDFLAGS `$LIBMIKMOD_CONFIG --libs`"
slouken@419
   355
        fi
slouken@419
   356
    else
slouken@419
   357
        AC_MSG_WARN([*** Unable to find MikMod library (http://mikmod.raphnet.net/)])
slouken@419
   358
    fi
slouken@249
   359
fi
slouken@249
   360
slouken@639
   361
if test x$have_libmodplug != xyes -a x$have_libmikmod != xyes ; then
slouken@481
   362
	AC_MSG_WARN([MOD support disabled])
slouken@481
   363
fi
slouken@481
   364
slouken@312
   365
AC_ARG_ENABLE([music-midi],
slouken@639
   366
AC_HELP_STRING([--enable-music-midi], [enable MIDI music [[default=yes]]]),
slouken@312
   367
              [], [enable_music_midi=yes])
slouken@0
   368
if test x$enable_music_midi = xyes; then
slouken@294
   369
    EXTRA_CFLAGS="$EXTRA_CFLAGS -DMID_MUSIC"
slouken@639
   370
    AC_ARG_ENABLE([music-midi-timidity],
slouken@639
   371
AC_HELP_STRING([--enable-music-midi-timidity], [enable timidity MIDI output [[default=yes]]]),
slouken@639
   372
                  [], [enable_music_midi_timidity=yes])
slouken@639
   373
    if test x$enable_music_midi_timidity = xyes; then
slouken@294
   374
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_TIMIDITY_MIDI -I\$(srcdir)/timidity"
slouken@294
   375
        SOURCES="$SOURCES $srcdir/timidity/*.c"
slouken@106
   376
    fi
slouken@639
   377
    AC_ARG_ENABLE([music-midi-native],
slouken@639
   378
AC_HELP_STRING([--enable-music-midi-native], [enable native MIDI music output [[default=yes]]]),
slouken@639
   379
                  [], [enable_music_midi_native=yes])
slouken@639
   380
    if test x$enable_music_midi_native = xyes; then
slouken@639
   381
        use_music_midi_native=no
slouken@289
   382
        case "$host" in
slouken@488
   383
            *mingw32ce*)
slouken@639
   384
                use_music_midi_native=no
slouken@488
   385
                ;;
slouken@99
   386
            *-*-cygwin* | *-*-mingw32*)
slouken@639
   387
                use_music_midi_native=yes
slouken@294
   388
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lwinmm"
slouken@99
   389
                ;;
slouken@107
   390
            *-*-darwin*)
slouken@639
   391
                use_music_midi_native=yes
icculus@461
   392
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,CoreServices"
slouken@107
   393
                ;;
slouken@494
   394
            *-*-haiku*)
slouken@639
   395
                use_music_midi_native=yes_cpp
slouken@494
   396
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmidi" 
slouken@494
   397
                ;;
slouken@99
   398
        esac
slouken@639
   399
        if test x$use_music_midi_native = xyes; then
slouken@294
   400
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_NATIVE_MIDI -I\$(srcdir)/native_midi"
slouken@294
   401
            SOURCES="$SOURCES $srcdir/native_midi/*.c"
slouken@639
   402
        elif test x$use_music_midi_native = xyes_cpp; then
slouken@494
   403
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_NATIVE_MIDI -I\$(srcdir)/native_midi"
slouken@494
   404
            SOURCES="$SOURCES $srcdir/native_midi/*.c"
slouken@494
   405
            SOURCES_CXX="$SOURCES_CXX $srcdir/native_midi/*.cpp"
slouken@99
   406
        fi
slouken@99
   407
    fi
slouken@639
   408
    AC_ARG_ENABLE([music-midi-fluidsynth],
slouken@639
   409
AC_HELP_STRING([--enable-music-midi-fluidsynth], [enable FluidSynth MIDI output [[default=yes]]]),
slouken@639
   410
                  [], [enable_music_midi_fluidsynth=yes])
slouken@683
   411
    AC_ARG_ENABLE([music-midi-fluidsynth-shared],
slouken@639
   412
AC_HELP_STRING([--enable-music-midi-fluidsynth-shared], [dynamically load FluidSynth library [[default=yes]]]),
slouken@639
   413
                  [], [enable_music_midi_fluidsynth_shared=yes])
slouken@639
   414
    if test x$enable_music_midi_fluidsynth = xyes; then
chewi@506
   415
        AC_CHECK_HEADER([fluidsynth.h], [have_fluidsynth_hdr=yes])
chewi@506
   416
        AC_CHECK_LIB([fluidsynth], [fluid_player_add_mem], [have_fluidsynth_lib=yes])
chewi@506
   417
        if test x$have_fluidsynth_hdr = xyes -a x$have_fluidsynth_lib = xyes; then
slouken@639
   418
            have_fluidsynth=yes
chewi@506
   419
            case "$host" in
chewi@506
   420
                *-*-darwin*)
chewi@506
   421
                    fluidsynth_lib=[`find_lib libfluidsynth.dylib`]
chewi@506
   422
                    ;;
chewi@506
   423
                *-*-cygwin* | *-*-mingw32*)
chewi@506
   424
                    fluidsynth_lib=[`find_lib "fluidsynth*.dll"`]
chewi@506
   425
                    ;;
chewi@506
   426
                *)
slouken@636
   427
                    fluidsynth_lib=[`find_lib "libfluidsynth[0-9]*.so.*"`]
chewi@506
   428
                    if test x$fluidsynth_lib = x; then
slouken@636
   429
                        fluidsynth_lib=[`find_lib "libfluidsynth.so.*"`]
chewi@506
   430
                    fi
chewi@506
   431
                    ;;
chewi@506
   432
            esac
chewi@506
   433
            SOURCES="$SOURCES $srcdir/dynamic_fluidsynth.c $srcdir/fluidsynth.c"
chewi@506
   434
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_FLUIDSYNTH_MIDI"
slouken@639
   435
            if test x$enable_music_midi_fluidsynth_shared = xyes && test x$fluidsynth_lib != x; then
chewi@506
   436
                echo "-- dynamic libfluidsyth -> $fluidsynth_lib"
chewi@506
   437
                EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLUIDSYNTH_DYNAMIC=\\\"$fluidsynth_lib\\\""
chewi@506
   438
            else
chewi@506
   439
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lfluidsynth"
chewi@506
   440
            fi
chewi@506
   441
        else
chewi@506
   442
            AC_MSG_WARN([*** Unable to find FluidSynth library (http://www.fluidsynth.org/)])
chewi@506
   443
            AC_MSG_WARN([FluidSynth support disabled])
chewi@506
   444
        fi
chewi@506
   445
    fi
slouken@0
   446
fi
slouken@419
   447
slouken@639
   448
if test x$enable_music_midi_timidity != xyes -a \
slouken@639
   449
        x$use_music_midi_native != xyes -a x$use_music_midi_native != xyes_cpp -a \
slouken@639
   450
        x$have_fluidsynth != xyes; then
slouken@639
   451
	AC_MSG_WARN([MIDI support disabled])
slouken@639
   452
fi
slouken@639
   453
slouken@312
   454
AC_ARG_ENABLE([music-ogg],
slouken@312
   455
AC_HELP_STRING([--enable-music-ogg], [enable Ogg Vorbis music [[default=yes]]]),
slouken@312
   456
              [], [enable_music_ogg=yes])
slouken@353
   457
AC_ARG_ENABLE(music-ogg-tremor,
slouken@419
   458
AC_HELP_STRING([--enable-music-ogg-tremor], [enable OGG Vorbis music via libtremor [[default=no]]]),
slouken@368
   459
              [], enable_music_ogg_tremor=no)
slouken@368
   460
AC_ARG_ENABLE([music-ogg-shared],
slouken@639
   461
AC_HELP_STRING([--enable-music-ogg-shared], [dynamically load Ogg Vorbis library [[default=yes]]]),
slouken@368
   462
              [], [enable_music_ogg_shared=yes])
slouken@368
   463
if test x$enable_music_ogg = xyes; then
slouken@368
   464
    if test x$enable_music_ogg_tremor = xyes; then
slouken@368
   465
        AC_CHECK_HEADER([tremor/ivorbisfile.h], [have_tremor_hdr=yes])
slouken@592
   466
        AC_CHECK_LIB([vorbisidec -logg], [ov_open_callbacks], [have_tremor_lib=yes])
slouken@368
   467
        if test x$have_tremor_hdr = xyes -a x$have_tremor_lib = xyes; then
slouken@368
   468
            case "$host" in
slouken@368
   469
                *-*-darwin*)
slouken@456
   470
                    ogg_lib=[`find_lib libvorbisidec.dylib`]
slouken@368
   471
                    ;;
slouken@368
   472
                *-*-cygwin* | *-*-mingw32*)
slouken@372
   473
                    ogg_lib=[`find_lib "vorbisidec*.dll"`]
slouken@368
   474
                    ;;
slouken@368
   475
                *)
slouken@636
   476
                    ogg_lib=[`find_lib "libvorbisidec[0-9]*.so.*"`]
slouken@368
   477
                    if test x$ogg_lib = x; then
slouken@636
   478
                        ogg_lib=[`find_lib "libvorbisidec.so.*"`]
slouken@368
   479
                    fi
slouken@368
   480
                    ;;
slouken@368
   481
            esac
slouken@368
   482
            SOURCES="$SOURCES $srcdir/*_ogg.c"
slouken@368
   483
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_MUSIC -DOGG_USE_TREMOR"
slouken@368
   484
            if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then
slouken@368
   485
                echo "-- dynamic libvorbisidec -> $ogg_lib"
slouken@368
   486
                EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\""
slouken@368
   487
            else
slouken@572
   488
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisidec -lvorbis"
slouken@368
   489
            fi
slouken@419
   490
        else
slouken@419
   491
            AC_MSG_WARN([*** Unable to find Ogg Vorbis Tremor library (http://www.xiph.org/)])
slouken@419
   492
            AC_MSG_WARN([Ogg Vorbis support disabled])
slouken@368
   493
        fi
slouken@368
   494
    else
slouken@368
   495
        AC_CHECK_HEADER([vorbis/vorbisfile.h], [have_ogg_hdr=yes])
slouken@592
   496
        AC_CHECK_LIB([vorbisfile -lvorbis -logg -lm], [ov_open_callbacks], [have_ogg_lib=yes])
slouken@368
   497
        if test x$have_ogg_hdr = xyes -a x$have_ogg_lib = xyes; then
slouken@368
   498
            case "$host" in
slouken@368
   499
                *-*-darwin*)
slouken@456
   500
                    ogg_lib=[`find_lib libvorbisfile.dylib`]
slouken@368
   501
                    ;;
slouken@368
   502
                *-*-cygwin* | *-*-mingw32*)
slouken@372
   503
                    ogg_lib=[`find_lib "libvorbisfile*.dll"`]
slouken@368
   504
                    ;;
slouken@368
   505
                *)
slouken@636
   506
                    ogg_lib=[`find_lib "libvorbisfile[0-9]*.so.*"`]
slouken@368
   507
                    if test x$ogg_lib = x; then
slouken@636
   508
                        ogg_lib=[`find_lib "libvorbisfile.so.*"`]
slouken@368
   509
                    fi
slouken@368
   510
                    ;;
slouken@368
   511
            esac
slouken@368
   512
            SOURCES="$SOURCES $srcdir/*_ogg.c"
slouken@368
   513
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_MUSIC"
slouken@368
   514
            if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then
slouken@368
   515
                echo "-- dynamic libvorbisfile -> $ogg_lib"
slouken@368
   516
                EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\""
slouken@368
   517
            else
slouken@602
   518
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisfile -lvorbis"
slouken@368
   519
            fi
slouken@419
   520
        else
slouken@419
   521
            AC_MSG_WARN([*** Unable to find Ogg Vorbis library (http://www.xiph.org/)])
slouken@419
   522
            AC_MSG_WARN([Ogg Vorbis support disabled])
slouken@368
   523
        fi
slouken@353
   524
    fi
slouken@353
   525
fi
slouken@419
   526
slouken@396
   527
libflac_ver=8
slouken@382
   528
AC_ARG_ENABLE([music-flac],
slouken@382
   529
AC_HELP_STRING([--enable-music-flac], [enable FLAC music [[default=yes]]]),
slouken@382
   530
              [], [enable_music_flac=yes])
slouken@382
   531
AC_ARG_ENABLE([music-flac-shared],
slouken@382
   532
AC_HELP_STRING([--enable-music-flac-shared],
slouken@639
   533
              [dynamically load FLAC library [[default=yes]]]),
slouken@382
   534
              [], [enable_music_flac_shared=yes])
slouken@382
   535
if test x$enable_music_flac = xyes; then
slouken@452
   536
    AC_CHECK_HEADER([FLAC/export.h], [have_flac_export=yes])
slouken@452
   537
    if test x$have_flac_export = xyes; then
slouken@452
   538
        LIBS_SAVED="$LIBS"
slouken@452
   539
        LIBS="-lFLAC"
slouken@452
   540
        AC_MSG_CHECKING([for libflac so-name version >= $libflac_ver])
slouken@502
   541
        AC_TRY_COMPILE([
slouken@396
   542
#include "FLAC/export.h"
slouken@396
   543
#include "stdio.h"
slouken@502
   544
],[
slouken@396
   545
#if defined(FLAC_API_VERSION_CURRENT) && (FLAC_API_VERSION_CURRENT >= $libflac_ver)
slouken@396
   546
#else
slouken@502
   547
#error "old-flac"
slouken@396
   548
#endif
slouken@396
   549
], have_flac_ver=yes, have_flac_ver=no)
slouken@419
   550
        LIBS="$LIBS_SAVED"
slouken@419
   551
        AC_MSG_RESULT($have_flac_ver)
slouken@419
   552
    fi
slouken@419
   553
slouken@419
   554
    if test x$have_flac_ver = xyes; then
slouken@419
   555
        AC_CHECK_HEADER([FLAC/stream_decoder.h], [have_flac_hdr=yes])
slouken@419
   556
        AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_new], [have_flac_lib=yes])
slouken@419
   557
        if test x$have_flac_hdr = xyes -a x$have_flac_lib = xyes; then    
slouken@419
   558
            case "$host" in
slouken@419
   559
                *-*-darwin*)
slouken@456
   560
                    flac_lib=[`find_lib libFLAC.dylib`]
slouken@419
   561
                    ;;
slouken@419
   562
                *-*-cygwin* | *-*-mingw32*)
slouken@636
   563
                    flac_lib=[`find_lib "libFLAC-*.dll"`]
slouken@419
   564
                    ;;
slouken@419
   565
                *)
slouken@636
   566
                    flac_lib=[`find_lib "libFLAC[0-9]*.so.*"`]
slouken@419
   567
                    if test x$flac_lib = x; then
slouken@636
   568
                        flac_lib=[`find_lib "libFLAC.so.*"`]
slouken@419
   569
                    fi
slouken@419
   570
                    ;;
slouken@419
   571
            esac
slouken@419
   572
            SOURCES="$SOURCES $srcdir/*_flac.c"
slouken@419
   573
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLAC_MUSIC"
slouken@419
   574
            if test x$enable_music_flac_shared = xyes && test x$flac_lib != x; then
slouken@419
   575
                echo "-- dynamic libFLAC -> $flac_lib"
slouken@419
   576
                EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLAC_DYNAMIC=\\\"$flac_lib\\\""
slouken@419
   577
            else
slouken@419
   578
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lFLAC"
slouken@419
   579
            fi
slouken@419
   580
        fi
slouken@419
   581
    else
slouken@419
   582
        AC_MSG_WARN([*** Unable to find FLAC library (http://flac.sourceforge.net/)])
slouken@419
   583
        AC_MSG_WARN([FLAC support disabled])
slouken@419
   584
    fi
slouken@382
   585
fi
slouken@419
   586
slouken@639
   587
AC_ARG_ENABLE(music-mp3,
slouken@639
   588
AC_HELP_STRING([--enable-music-mp3], [enable MP3 music [[default=yes]]]),
slouken@639
   589
              [], enable_music_mp3=yes)
slouken@488
   590
slouken@639
   591
AC_ARG_ENABLE(music-mp3-smpeg,
slouken@639
   592
AC_HELP_STRING([--enable-music-mp3-smpeg], [enable MP3 music via smpeg [[default=yes]]]),
slouken@639
   593
              [], enable_music_mp3_smpeg=yes)
slouken@639
   594
AC_ARG_ENABLE([music-mp3-smpeg-shared],
slouken@639
   595
AC_HELP_STRING([--enable-music-mp3-smpeg-shared], [dynamically load smpeg library [[default=yes]]]),
slouken@639
   596
              [], [enable_music_mp3_smpeg_shared=yes])
slouken@639
   597
if test x$enable_music_mp3 = xyes -a x$enable_music_mp3_smpeg = xyes; then
slouken@621
   598
    SMPEG_VERSION=2.0.0
slouken@621
   599
    AM_PATH_SMPEG2($SMPEG_VERSION, have_smpeg=yes, have_smpeg=no)
slouken@0
   600
    if test x$have_smpeg = xyes; then
slouken@313
   601
        case "$host" in
slouken@313
   602
            *-*-darwin*)
slouken@621
   603
                smpeg_lib=[`find_lib libsmpeg2.dylib`]
slouken@313
   604
                ;;
slouken@313
   605
            *-*-cygwin* | *-*-mingw32*)
slouken@621
   606
                smpeg_lib=[`find_lib "smpeg2*.dll"`]
slouken@313
   607
                ;;
slouken@313
   608
            *)
slouken@636
   609
                smpeg_lib=[`find_lib "libsmpeg2*.so.*"`]
slouken@313
   610
                ;;
slouken@313
   611
        esac
slouken@314
   612
        SOURCES="$SOURCES $srcdir/*_mp3.c"
slouken@294
   613
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MUSIC $SMPEG_CFLAGS"
slouken@639
   614
        if test x$enable_music_mp3_smpeg_shared = xyes && test x$smpeg_lib != x; then
slouken@313
   615
            echo "-- dynamic libsmpeg -> $smpeg_lib"
slouken@313
   616
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_DYNAMIC=\\\"$smpeg_lib\\\""
slouken@313
   617
        else
slouken@313
   618
            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SMPEG_LIBS"
slouken@313
   619
        fi
slouken@419
   620
    else
slouken@419
   621
        AC_MSG_WARN([*** Unable to find SMPEG library (http://icculus.org/smpeg/)])
slouken@0
   622
    fi
slouken@0
   623
fi
slouken@419
   624
slouken@357
   625
AC_ARG_ENABLE(music-mp3-mad-gpl,
slouken@357
   626
AC_HELP_STRING([--enable-music-mp3-mad-gpl], [enable MP3 music via libmad GPL code [[default=no]]]),
slouken@357
   627
                  [], [enable_music_mp3_mad_gpl=no])
slouken@639
   628
if test x$enable_music_mp3 = xyes -a x$enable_music_mp3_mad_gpl = xyes; then
slouken@357
   629
    AC_MSG_CHECKING(for libmad headers)
slouken@357
   630
    have_libmad=no
slouken@357
   631
    AC_TRY_COMPILE([
slouken@357
   632
     #include "mad.h"
slouken@357
   633
    ],[
slouken@357
   634
    ],[
slouken@357
   635
    have_libmad=yes
slouken@357
   636
    ])
slouken@357
   637
    AC_MSG_RESULT($have_libmad)
slouken@357
   638
    if test x$have_libmad = xyes; then
slouken@357
   639
        SOURCES="$SOURCES $srcdir/music_mad.c"
slouken@357
   640
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MAD_MUSIC"
slouken@357
   641
        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmad"
slouken@419
   642
    else
slouken@419
   643
        AC_MSG_WARN([*** Unable to find MAD library (http://www.underbit.com/products/mad/)])
slouken@357
   644
    fi
slouken@357
   645
fi
slouken@0
   646
slouken@419
   647
if test x$have_smpeg != xyes -a x$have_libmad != xyes; then
slouken@419
   648
    AC_MSG_WARN([MP3 support disabled])
slouken@419
   649
fi
slouken@419
   650
slouken@501
   651
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBM"
slouken@422
   652
slouken@422
   653
OBJECTS=`echo $SOURCES`
slouken@422
   654
DEPENDS=`echo $SOURCES`
slouken@422
   655
OBJECTS=`echo "$OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
slouken@422
   656
DEPENDS=`echo "$DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
slouken@422
   657
$(objects)/\2.lo: \1/\2.c\\
slouken@432
   658
	\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
slouken@422
   659
slouken@494
   660
OBJECTS_CXX=`echo $SOURCES_CXX`
slouken@494
   661
DEPENDS_CXX=`echo $SOURCES_CXX`
slouken@494
   662
OBJECTS_CXX=`echo "$OBJECTS_CXX" | sed 's,[[^ ]]*/\([[^ ]]*\)\.cpp,$(objects)/\1.lo,g'`
slouken@494
   663
DEPENDS_CXX=`echo "$DEPENDS_CXX" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.cpp,\\
slouken@494
   664
$(objects)/\2.lo: \1/\2.cpp\\
slouken@494
   665
	\$(LIBTOOL) --mode=compile \$(CXX) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
slouken@494
   666
OBJECTS="$OBJECTS $OBJECTS_CXX"
slouken@494
   667
DEPENDS="$DEPENDS $DEPENDS_CXX"
slouken@497
   668
DEPENDS=`echo "$DEPENDS" | sed 's,\\$,\\\\$,g'`
slouken@494
   669
slouken@422
   670
VERSION_OBJECTS=`echo $VERSION_SOURCES`
slouken@422
   671
VERSION_DEPENDS=`echo $VERSION_SOURCES`
slouken@422
   672
VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
slouken@422
   673
VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.rc,\\
slouken@422
   674
$(objects)/\2.o: \1/\2.rc\\
slouken@422
   675
	\$(WINDRES) \$< \$@,g'`
slouken@497
   676
VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed 's,\\$,\\\\$,g'`
slouken@422
   677
slouken@422
   678
PLAYWAVE_SOURCES="$srcdir/playwave.c"
slouken@422
   679
PLAYWAVE_OBJECTS=`echo $PLAYWAVE_SOURCES`
slouken@422
   680
PLAYWAVE_DEPENDS=`echo $PLAYWAVE_SOURCES`
slouken@422
   681
PLAYWAVE_OBJECTS=`echo "$PLAYWAVE_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
slouken@422
   682
PLAYWAVE_DEPENDS=`echo "$PLAYWAVE_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
slouken@422
   683
$(objects)/\2.lo: \1/\2.c\\
slouken@432
   684
	\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
slouken@497
   685
PLAYWAVE_DEPENDS=`echo "$PLAYWAVE_DEPENDS" | sed 's,\\$,\\\\$,g'`
slouken@422
   686
slouken@422
   687
PLAYMUS_SOURCES="$srcdir/playmus.c"
slouken@422
   688
PLAYMUS_OBJECTS=`echo $PLAYMUS_SOURCES`
slouken@422
   689
PLAYMUS_DEPENDS=`echo $PLAYMUS_SOURCES`
slouken@422
   690
PLAYMUS_OBJECTS=`echo "$PLAYMUS_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
slouken@422
   691
PLAYMUS_DEPENDS=`echo "$PLAYMUS_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
slouken@422
   692
$(objects)/\2.lo: \1/\2.c\\
slouken@432
   693
	\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
slouken@497
   694
PLAYMUS_DEPENDS=`echo "$PLAYMUS_DEPENDS" | sed 's,\\$,\\\\$,g'`
slouken@1
   695
slouken@294
   696
dnl Expand the sources and objects needed to build the library
slouken@294
   697
AC_SUBST(ac_aux_dir)
slouken@294
   698
AC_SUBST(OBJECTS)
slouken@422
   699
AC_SUBST(VERSION_OBJECTS)
slouken@422
   700
AC_SUBST(PLAYWAVE_OBJECTS)
slouken@422
   701
AC_SUBST(PLAYMUS_OBJECTS)
slouken@294
   702
AC_SUBST(BUILD_CFLAGS)
slouken@294
   703
AC_SUBST(EXTRA_CFLAGS)
slouken@294
   704
AC_SUBST(BUILD_LDFLAGS)
slouken@294
   705
AC_SUBST(EXTRA_LDFLAGS)
slouken@294
   706
AC_SUBST(EXE)
slouken@368
   707
AC_SUBST(WINDRES)
slouken@392
   708
AC_SUBST(SDL_VERSION)
slouken@294
   709
AC_SUBST(SDL_CFLAGS)
slouken@294
   710
AC_SUBST(SDL_LIBS)
slouken@206
   711
slouken@0
   712
AC_OUTPUT([
slouken@497
   713
])
slouken@497
   714
AC_CONFIG_FILES([
slouken@578
   715
    Makefile SDL2_mixer.spec SDL2_mixer.pc
slouken@0
   716
])
slouken@497
   717
AC_CONFIG_COMMANDS([default],
slouken@497
   718
                   [cat >>Makefile <<__EOF__
slouken@497
   719
slouken@497
   720
# Build rules for objects
slouken@497
   721
-include \$(OBJECTS:.lo=.d)
slouken@497
   722
$DEPENDS
slouken@497
   723
$VERSION_DEPENDS
slouken@497
   724
slouken@497
   725
-include \$(PLAYWAVE_OBJECTS:.lo=.d)
slouken@497
   726
$PLAYWAVE_DEPENDS
slouken@497
   727
slouken@497
   728
-include \$(PLAYMUS_OBJECTS:.lo=.d)
slouken@497
   729
$PLAYMUS_DEPENDS
slouken@497
   730
__EOF__ 
slouken@497
   731
], [
slouken@497
   732
DEPENDS="$DEPENDS"
slouken@497
   733
VERSION_DEPENDS="$VERSION_DEPENDS"
slouken@497
   734
PLAYWAVE_DEPENDS="$PLAYWAVE_DEPENDS"
slouken@497
   735
PLAYMUS_DEPENDS="$PLAYMUS_DEPENDS"
slouken@497
   736
])
slouken@497
   737
AC_OUTPUT