configure.in
author Ozkan Sezer
Wed, 18 Dec 2019 18:55:50 +0300
changeset 1097 b8a083ebef5f
parent 1086 89f446aae9b5
permissions -rw-r--r--
timidity/readmidi.c: tidy-up the dumpstring thing for text events.

avoids a warning too, as a side effect.
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@915
    17
MICRO_VERSION=4
slouken@915
    18
INTERFACE_AGE=2
slouken@915
    19
BINARY_AGE=4
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
admin@999
    71
BUILD_CFLAGS="$CFLAGS $CPPFLAGS -I$srcdir/include -I$srcdir/src -I$srcdir/src/codecs"
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@294
    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
sezeroz@910
   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@710
   118
    ;;
slouken@68
   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@68
   131
        ;;
slouken@294
   132
    *)
slouken@294
   133
        EXE=""
slouken@208
   134
        ;;
slouken@6
   135
esac
slouken@6
   136
slouken@294
   137
# Standard C sources
admin@999
   138
SOURCES=`ls $srcdir/src/*.c $srcdir/src/codecs/*.c | fgrep -v playwave.c | fgrep -v playmus.c`
slouken@294
   139
slouken@451
   140
dnl set this to use on systems that use lib64 instead of lib
slouken@451
   141
base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
slouken@451
   142
icculus@482
   143
dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually).
icculus@482
   144
dnl  Details of this flag are here: http://gcc.gnu.org/wiki/Visibility
icculus@482
   145
CheckVisibilityHidden()
icculus@482
   146
{
icculus@482
   147
    AC_MSG_CHECKING(for GCC -fvisibility=hidden option)
icculus@482
   148
    have_gcc_fvisibility=no
icculus@482
   149
icculus@482
   150
    visibility_CFLAGS="-fvisibility=hidden"
icculus@482
   151
    save_CFLAGS="$CFLAGS"
icculus@482
   152
    CFLAGS="$save_CFLAGS $visibility_CFLAGS -Werror"
icculus@482
   153
    AC_TRY_COMPILE([
icculus@482
   154
    #if !defined(__GNUC__) || __GNUC__ < 4
icculus@482
   155
    #error SDL only uses visibility attributes in GCC 4 or newer
icculus@482
   156
    #endif
icculus@482
   157
    ],[
icculus@482
   158
    ],[
icculus@482
   159
    have_gcc_fvisibility=yes
icculus@482
   160
    ])
icculus@482
   161
    AC_MSG_RESULT($have_gcc_fvisibility)
icculus@482
   162
    CFLAGS="$save_CFLAGS"
icculus@482
   163
icculus@482
   164
    if test x$have_gcc_fvisibility = xyes; then
icculus@482
   165
        EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS"
icculus@482
   166
    fi
icculus@482
   167
}
icculus@482
   168
icculus@482
   169
slouken@451
   170
dnl Function to find a library in the compiler search path
slouken@368
   171
find_lib()
slouken@368
   172
{
slouken@372
   173
    gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
slouken@372
   174
    gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
slouken@451
   175
    env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`]
slouken@405
   176
    if test "$cross_compiling" = yes; then
slouken@405
   177
        host_lib_path=""
slouken@405
   178
    else
slouken@451
   179
        host_lib_path="/usr/$base_libdir /usr/local/$base_libdir"
slouken@405
   180
    fi
slouken@697
   181
    for path in $env_lib_path $gcc_bin_path $gcc_lib_path $host_lib_path; do
slouken@636
   182
        lib=[`ls -- $path/$1 2>/dev/null | sed -e '/\.so\..*\./d' -e 's,.*/,,' | sort | tail -1`]
slouken@368
   183
        if test x$lib != x; then
slouken@368
   184
            echo $lib
slouken@368
   185
            return
slouken@368
   186
        fi
slouken@368
   187
    done
slouken@368
   188
}
slouken@368
   189
slouken@20
   190
dnl Check for SDL
slouken@797
   191
SDL_VERSION=2.0.7
slouken@582
   192
AM_PATH_SDL2($SDL_VERSION,
slouken@20
   193
            :,
slouken@368
   194
            AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
slouken@20
   195
)
slouken@294
   196
EXTRA_CFLAGS="$EXTRA_CFLAGS $SDL_CFLAGS"
slouken@294
   197
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SDL_LIBS"
slouken@0
   198
patmandin@464
   199
dnl Check for math library
patmandin@464
   200
AC_CHECK_LIB(m, pow, [LIBM="-lm"])
patmandin@464
   201
slouken@639
   202
AC_CHECK_HEADERS([signal.h], [EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_SIGNAL_H"])
slouken@639
   203
AC_CHECK_FUNCS(setbuf, [EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_SETBUF"])
slouken@639
   204
slouken@0
   205
dnl Check command-line options
slouken@91
   206
icculus@482
   207
CheckVisibilityHidden
icculus@482
   208
slouken@312
   209
AC_ARG_ENABLE([music-cmd],
slouken@312
   210
AC_HELP_STRING([--enable-music-cmd], [support an external music player [[default=yes]]]),
slouken@467
   211
              [], [enable_music_cmd=detect])
slouken@467
   212
if test "x$enable_music_cmd" != xno; then
slouken@467
   213
    AC_CHECK_FUNCS([fork vfork])
slouken@467
   214
    if test "x$ac_cv_func_fork" = "xyes"; then
slouken@467
   215
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_FORK"
slouken@467
   216
    elif test "x$ac_cv_func_vfork" = "xyes"; then
slouken@467
   217
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_VFORK"
slouken@467
   218
    elif test "x$enable_music_cmd" = "xyes"; then
slouken@467
   219
        AC_MSG_ERROR([external music player not available on your platform])
slouken@467
   220
    else
slouken@467
   221
        enable_music_cmd=no
slouken@467
   222
    fi
slouken@467
   223
    if test "x$enable_music_cmd" != xno; then
slouken@777
   224
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_CMD"
slouken@467
   225
    fi
slouken@0
   226
fi
slouken@419
   227
slouken@312
   228
AC_ARG_ENABLE([music-wave],
slouken@312
   229
AC_HELP_STRING([--enable-music-wave], [enable streaming WAVE music [[default=yes]]]),
slouken@312
   230
              [], [enable_music_wave=yes])
slouken@0
   231
if test x$enable_music_wave = xyes; then
slouken@777
   232
    EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_WAV"
slouken@0
   233
fi
slouken@419
   234
slouken@419
   235
AC_ARG_ENABLE([music-mod],
slouken@639
   236
AC_HELP_STRING([--enable-music-mod], [enable MOD music [[default=yes]]]),
slouken@419
   237
              [], [enable_music_mod=yes])
slouken@639
   238
slouken@639
   239
AC_ARG_ENABLE([music-mod-modplug],
slouken@639
   240
AC_HELP_STRING([--enable-music-mod-modplug], [enable MOD music via modplug [[default=yes]]]),
slouken@639
   241
              [], [enable_music_mod_modplug=yes])
slouken@639
   242
AC_ARG_ENABLE([music-mod-modplug-shared],
slouken@639
   243
AC_HELP_STRING([--enable-music-mod-modplug-shared], [dynamically load modplug library [[default=yes]]]),
slouken@639
   244
              [], [enable_music_mod_modplug_shared=yes])
slouken@639
   245
if test x$enable_music_mod = xyes -a x$enable_music_mod_modplug = xyes; then
slouken@639
   246
    PKG_CHECK_MODULES([MODPLUG], [libmodplug >= 0.8.8], [dnl
slouken@639
   247
            have_libmodplug_hdr=yes
slouken@639
   248
            have_libmodplug_lib=yes
slouken@639
   249
        ], [dnl
slouken@695
   250
            AC_CHECK_HEADER([libmodplug/modplug.h], [have_libmodplug_hdr=yes])
sezeroz@910
   251
            AC_CHECK_LIB([modplug], [ModPlug_Load], [have_libmodplug_lib=yes;MODPLUG_LIBS="-lmodplug"])
slouken@639
   252
        ])
slouken@639
   253
slouken@639
   254
    if test x$have_libmodplug_hdr = xyes -a x$have_libmodplug_lib = xyes; then
slouken@639
   255
        have_libmodplug=yes
slouken@639
   256
        case "$host" in
slouken@639
   257
            *-*-darwin*)
slouken@639
   258
                modplug_lib=[`find_lib libmodplug.dylib`]
slouken@639
   259
                ;;
slouken@639
   260
            *-*-cygwin* | *-*-mingw32*)
slouken@639
   261
                modplug_lib=[`find_lib "libmodplug*.dll"`]
slouken@639
   262
                ;;
slouken@639
   263
            *)
slouken@639
   264
                modplug_lib=[`find_lib "libmodplug[0-9]*.so.*"`]
slouken@639
   265
                if test x$modplug_lib = x; then
slouken@639
   266
                    modplug_lib=[`find_lib "libmodplug.so.*"`]
slouken@639
   267
                fi
slouken@639
   268
                ;;
slouken@639
   269
        esac
slouken@777
   270
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MOD_MODPLUG $MODPLUG_CFLAGS"
slouken@639
   271
        if test x$enable_music_mod_modplug_shared = xyes && test x$modplug_lib != x; then
slouken@639
   272
            echo "-- dynamic libmodplug -> $modplug_lib"
slouken@639
   273
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DMODPLUG_DYNAMIC=\\\"$modplug_lib\\\""
slouken@639
   274
        else
slouken@710
   275
            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MODPLUG_LIBS"
slouken@639
   276
        fi
slouken@639
   277
    else
slouken@639
   278
        AC_MSG_WARN([*** Unable to find ModPlug library (http://modplug-xmms.sourceforge.net/)])
slouken@639
   279
    fi
slouken@639
   280
fi
slouken@639
   281
slouken@639
   282
AC_ARG_ENABLE([music-mod-mikmod],
slouken@639
   283
AC_HELP_STRING([--enable-music-mod-mikmod], [enable MOD music via mikmod [[default=no]]]),
slouken@639
   284
              [], [enable_music_mod_mikmod=no])
slouken@639
   285
AC_ARG_ENABLE([music-mod-mikmod-shared],
slouken@639
   286
AC_HELP_STRING([--enable-music-mod-mikmod-shared], [dynamically load mikmod library [[default=yes]]]),
slouken@639
   287
              [], [enable_music_mod_mikmod_shared=yes])
slouken@639
   288
if test x$enable_music_mod = xyes -a x$enable_music_mod_mikmod = xyes; then
slouken@419
   289
    have_libmikmod=no
slouken@419
   290
    libmikmod_maj=3
slouken@419
   291
    libmikmod_min=1
slouken@419
   292
    libmikmod_rev=10
slouken@419
   293
    libmikmod_ver="$libmikmod_maj.$libmikmod_min.$libmikmod_rev"
sezeroz@910
   294
    CFLAGS_SAVED="$CFLAGS"
sezeroz@910
   295
    LIBS_SAVED="$LIBS"
slouken@368
   296
    AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no, [$PATH])
slouken@368
   297
    if test "$LIBMIKMOD_CONFIG" != "no" ; then
slouken@777
   298
        CFLAGS="$CFLAGS `$LIBMIKMOD_CONFIG --cflags`"
slouken@368
   299
        LIBS="$LIBS `$LIBMIKMOD_CONFIG --libs`"
slouken@419
   300
        have_libmikmod=yes
slouken@368
   301
        AC_MSG_CHECKING([for libmikmod - version >= $libmikmod_ver])
slouken@368
   302
        AC_TRY_RUN([
slouken@249
   303
#include "mikmod.h"
slouken@249
   304
#include "stdio.h"
slouken@249
   305
slouken@249
   306
int main(int argc, char **argv)
slouken@249
   307
{
slouken@419
   308
long maj=$libmikmod_maj,min=$libmikmod_min,rev=$libmikmod_rev,ver=MikMod_GetVersion();
slouken@419
   309
/*printf("(%d.%d.%d) ",ver>>16,(ver>>8)&0xff,ver&0xff);*/
slouken@419
   310
if(ver>=((maj<<16)|(min<<8)|(rev))) {
slouken@419
   311
    printf("yes\n");
slouken@419
   312
    return 0;
slouken@419
   313
}
slouken@419
   314
printf("no\n*** libmikmod is older than %d.%d.%d, not using.\n",maj,min,rev);
slouken@419
   315
return 1;
slouken@249
   316
}
sezeroz@910
   317
], [], [have_libmikmod=no], [echo $ac_n "cross compiling; assumed OK... $ac_c"])
slouken@368
   318
    fi
slouken@419
   319
slouken@419
   320
    if test x$have_libmikmod = xyes; then
slouken@419
   321
        case "$host" in
slouken@419
   322
            *-*-darwin*)
slouken@456
   323
                mikmod_lib=[`find_lib libmikmod.dylib`]
slouken@419
   324
                ;;
slouken@419
   325
            *-*-cygwin* | *-*-mingw32*)
slouken@556
   326
                mikmod_lib=[`find_lib "libmikmod*.dll"`]
slouken@419
   327
                ;;
slouken@419
   328
            *)
slouken@639
   329
                mikmod_lib=[`find_lib "libmikmod[0-9]*.so.*"`]
slouken@419
   330
                if test x$mikmod_lib = x; then
slouken@636
   331
                    mikmod_lib=[`find_lib "libmikmod.so.*"`]
slouken@419
   332
                fi
slouken@419
   333
                ;;
slouken@419
   334
        esac
slouken@777
   335
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MOD_MIKMOD `$LIBMIKMOD_CONFIG --cflags`"
slouken@639
   336
        if test x$enable_music_mod_mikmod_shared = xyes && test x$mikmod_lib != x; then
slouken@419
   337
            echo "-- dynamic libmikmod -> $mikmod_lib"
slouken@798
   338
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DMIKMOD_DYNAMIC=\\\"$mikmod_lib\\\""
slouken@419
   339
        else
slouken@419
   340
            EXTRA_LDFLAGS="$EXTRA_LDFLAGS `$LIBMIKMOD_CONFIG --libs`"
slouken@419
   341
        fi
slouken@419
   342
    else
slouken@419
   343
        AC_MSG_WARN([*** Unable to find MikMod library (http://mikmod.raphnet.net/)])
slouken@419
   344
    fi
sezeroz@910
   345
    LIBS="$LIBS_SAVED"
sezeroz@910
   346
    CFLAGS="$CFLAGS_SAVED"
slouken@249
   347
fi
slouken@249
   348
slouken@639
   349
if test x$have_libmodplug != xyes -a x$have_libmikmod != xyes ; then
slouken@710
   350
    AC_MSG_WARN([MOD support disabled])
slouken@481
   351
fi
slouken@481
   352
slouken@312
   353
AC_ARG_ENABLE([music-midi],
slouken@639
   354
AC_HELP_STRING([--enable-music-midi], [enable MIDI music [[default=yes]]]),
slouken@312
   355
              [], [enable_music_midi=yes])
slouken@0
   356
if test x$enable_music_midi = xyes; then
slouken@777
   357
    EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MID"
slouken@639
   358
    AC_ARG_ENABLE([music-midi-timidity],
slouken@639
   359
AC_HELP_STRING([--enable-music-midi-timidity], [enable timidity MIDI output [[default=yes]]]),
slouken@639
   360
                  [], [enable_music_midi_timidity=yes])
slouken@639
   361
    if test x$enable_music_midi_timidity = xyes; then
admin@999
   362
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MID_TIMIDITY -I\$(srcdir)/src/codecs/timidity"
admin@999
   363
        SOURCES="$SOURCES $srcdir/src/codecs/timidity/*.c"
sezeroz@1086
   364
        timidity_cfg=no
sezeroz@1086
   365
        AC_ARG_WITH([timidity-cfg],
sezeroz@1086
   366
AC_HELP_STRING([--with-timidity-cfg=FILE], [Specify full path to timidity.cfg]), timidity_cfg="$withval", [])
sezeroz@1086
   367
        if test x$timidity_cfg != xyes -a x$timidity_cfg != xno; then
sezeroz@1086
   368
                EXTRA_CFLAGS="$EXTRA_CFLAGS -DTIMIDITY_CFG=\\\"$timidity_cfg\\\""
sezeroz@1086
   369
        fi
slouken@106
   370
    fi
slouken@639
   371
    AC_ARG_ENABLE([music-midi-native],
slouken@639
   372
AC_HELP_STRING([--enable-music-midi-native], [enable native MIDI music output [[default=yes]]]),
slouken@639
   373
                  [], [enable_music_midi_native=yes])
slouken@639
   374
    if test x$enable_music_midi_native = xyes; then
slouken@639
   375
        use_music_midi_native=no
slouken@289
   376
        case "$host" in
slouken@488
   377
            *mingw32ce*)
slouken@639
   378
                use_music_midi_native=no
slouken@488
   379
                ;;
slouken@99
   380
            *-*-cygwin* | *-*-mingw32*)
slouken@639
   381
                use_music_midi_native=yes
slouken@294
   382
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lwinmm"
slouken@99
   383
                ;;
slouken@107
   384
            *-*-darwin*)
slouken@639
   385
                use_music_midi_native=yes
icculus@461
   386
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,CoreServices"
slouken@107
   387
                ;;
slouken@494
   388
            *-*-haiku*)
slouken@639
   389
                use_music_midi_native=yes_cpp
admin@999
   390
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmidi"
slouken@494
   391
                ;;
slouken@99
   392
        esac
slouken@639
   393
        if test x$use_music_midi_native = xyes; then
admin@999
   394
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MID_NATIVE -I\$(srcdir)/src/codecs/native_midi"
admin@999
   395
            SOURCES="$SOURCES $srcdir/src/codecs/native_midi/*.c"
slouken@639
   396
        elif test x$use_music_midi_native = xyes_cpp; then
admin@999
   397
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MID_NATIVE -I\$(srcdir)/src/codecs/native_midi"
admin@999
   398
            SOURCES="$SOURCES $srcdir/src/codecs/native_midi/*.c"
admin@999
   399
            SOURCES_CXX="$SOURCES_CXX $srcdir/src/codecs/native_midi/*.cpp"
slouken@99
   400
        fi
slouken@99
   401
    fi
slouken@639
   402
    AC_ARG_ENABLE([music-midi-fluidsynth],
slouken@639
   403
AC_HELP_STRING([--enable-music-midi-fluidsynth], [enable FluidSynth MIDI output [[default=yes]]]),
slouken@639
   404
                  [], [enable_music_midi_fluidsynth=yes])
slouken@683
   405
    AC_ARG_ENABLE([music-midi-fluidsynth-shared],
slouken@639
   406
AC_HELP_STRING([--enable-music-midi-fluidsynth-shared], [dynamically load FluidSynth library [[default=yes]]]),
slouken@639
   407
                  [], [enable_music_midi_fluidsynth_shared=yes])
slouken@639
   408
    if test x$enable_music_midi_fluidsynth = xyes; then
chewi@506
   409
        AC_CHECK_HEADER([fluidsynth.h], [have_fluidsynth_hdr=yes])
chewi@506
   410
        AC_CHECK_LIB([fluidsynth], [fluid_player_add_mem], [have_fluidsynth_lib=yes])
chewi@506
   411
        if test x$have_fluidsynth_hdr = xyes -a x$have_fluidsynth_lib = xyes; then
slouken@639
   412
            have_fluidsynth=yes
chewi@506
   413
            case "$host" in
chewi@506
   414
                *-*-darwin*)
chewi@506
   415
                    fluidsynth_lib=[`find_lib libfluidsynth.dylib`]
chewi@506
   416
                    ;;
chewi@506
   417
                *-*-cygwin* | *-*-mingw32*)
chewi@506
   418
                    fluidsynth_lib=[`find_lib "fluidsynth*.dll"`]
chewi@506
   419
                    ;;
chewi@506
   420
                *)
slouken@636
   421
                    fluidsynth_lib=[`find_lib "libfluidsynth[0-9]*.so.*"`]
chewi@506
   422
                    if test x$fluidsynth_lib = x; then
slouken@636
   423
                        fluidsynth_lib=[`find_lib "libfluidsynth.so.*"`]
chewi@506
   424
                    fi
chewi@506
   425
                    ;;
chewi@506
   426
            esac
slouken@777
   427
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MID_FLUIDSYNTH"
slouken@639
   428
            if test x$enable_music_midi_fluidsynth_shared = xyes && test x$fluidsynth_lib != x; then
slouken@787
   429
                echo "-- dynamic libfluidsynth -> $fluidsynth_lib"
chewi@506
   430
                EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLUIDSYNTH_DYNAMIC=\\\"$fluidsynth_lib\\\""
chewi@506
   431
            else
chewi@506
   432
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lfluidsynth"
chewi@506
   433
            fi
chewi@506
   434
        else
chewi@506
   435
            AC_MSG_WARN([*** Unable to find FluidSynth library (http://www.fluidsynth.org/)])
chewi@506
   436
            AC_MSG_WARN([FluidSynth support disabled])
chewi@506
   437
        fi
chewi@506
   438
    fi
slouken@0
   439
fi
slouken@419
   440
slouken@639
   441
if test x$enable_music_midi_timidity != xyes -a \
slouken@639
   442
        x$use_music_midi_native != xyes -a x$use_music_midi_native != xyes_cpp -a \
slouken@639
   443
        x$have_fluidsynth != xyes; then
slouken@710
   444
    AC_MSG_WARN([MIDI support disabled])
slouken@639
   445
fi
slouken@639
   446
slouken@312
   447
AC_ARG_ENABLE([music-ogg],
slouken@312
   448
AC_HELP_STRING([--enable-music-ogg], [enable Ogg Vorbis music [[default=yes]]]),
slouken@312
   449
              [], [enable_music_ogg=yes])
slouken@353
   450
AC_ARG_ENABLE(music-ogg-tremor,
slouken@419
   451
AC_HELP_STRING([--enable-music-ogg-tremor], [enable OGG Vorbis music via libtremor [[default=no]]]),
slouken@368
   452
              [], enable_music_ogg_tremor=no)
slouken@368
   453
AC_ARG_ENABLE([music-ogg-shared],
slouken@639
   454
AC_HELP_STRING([--enable-music-ogg-shared], [dynamically load Ogg Vorbis library [[default=yes]]]),
slouken@368
   455
              [], [enable_music_ogg_shared=yes])
slouken@368
   456
if test x$enable_music_ogg = xyes; then
sezeroz@910
   457
    LIBS_SAVED="$LIBS"
slouken@368
   458
    if test x$enable_music_ogg_tremor = xyes; then
slouken@368
   459
        AC_CHECK_HEADER([tremor/ivorbisfile.h], [have_tremor_hdr=yes])
sezeroz@910
   460
        AC_CHECK_LIB([vorbisidec], [ov_open_callbacks], [have_tremor_lib=yes], [], [-logg])
slouken@368
   461
        if test x$have_tremor_hdr = xyes -a x$have_tremor_lib = xyes; then
slouken@368
   462
            case "$host" in
slouken@368
   463
                *-*-darwin*)
slouken@456
   464
                    ogg_lib=[`find_lib libvorbisidec.dylib`]
slouken@368
   465
                    ;;
slouken@368
   466
                *-*-cygwin* | *-*-mingw32*)
slouken@372
   467
                    ogg_lib=[`find_lib "vorbisidec*.dll"`]
slouken@368
   468
                    ;;
slouken@368
   469
                *)
slouken@636
   470
                    ogg_lib=[`find_lib "libvorbisidec[0-9]*.so.*"`]
slouken@368
   471
                    if test x$ogg_lib = x; then
slouken@636
   472
                        ogg_lib=[`find_lib "libvorbisidec.so.*"`]
slouken@368
   473
                    fi
slouken@368
   474
                    ;;
slouken@368
   475
            esac
slouken@777
   476
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_OGG -DOGG_USE_TREMOR"
slouken@368
   477
            if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then
slouken@368
   478
                echo "-- dynamic libvorbisidec -> $ogg_lib"
slouken@368
   479
                EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\""
slouken@368
   480
            else
slouken@572
   481
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisidec -lvorbis"
slouken@368
   482
            fi
slouken@419
   483
        else
slouken@419
   484
            AC_MSG_WARN([*** Unable to find Ogg Vorbis Tremor library (http://www.xiph.org/)])
slouken@419
   485
            AC_MSG_WARN([Ogg Vorbis support disabled])
slouken@368
   486
        fi
slouken@368
   487
    else
slouken@368
   488
        AC_CHECK_HEADER([vorbis/vorbisfile.h], [have_ogg_hdr=yes])
sezeroz@910
   489
        AC_CHECK_LIB([vorbisfile], [ov_open_callbacks], [have_ogg_lib=yes], [], [-lvorbis -logg -lm])
slouken@368
   490
        if test x$have_ogg_hdr = xyes -a x$have_ogg_lib = xyes; then
slouken@368
   491
            case "$host" in
slouken@368
   492
                *-*-darwin*)
slouken@456
   493
                    ogg_lib=[`find_lib libvorbisfile.dylib`]
slouken@368
   494
                    ;;
slouken@368
   495
                *-*-cygwin* | *-*-mingw32*)
slouken@372
   496
                    ogg_lib=[`find_lib "libvorbisfile*.dll"`]
slouken@368
   497
                    ;;
slouken@368
   498
                *)
slouken@636
   499
                    ogg_lib=[`find_lib "libvorbisfile[0-9]*.so.*"`]
slouken@368
   500
                    if test x$ogg_lib = x; then
slouken@636
   501
                        ogg_lib=[`find_lib "libvorbisfile.so.*"`]
slouken@368
   502
                    fi
slouken@368
   503
                    ;;
slouken@368
   504
            esac
slouken@777
   505
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_OGG"
slouken@368
   506
            if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then
slouken@368
   507
                echo "-- dynamic libvorbisfile -> $ogg_lib"
slouken@368
   508
                EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\""
slouken@368
   509
            else
slouken@602
   510
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisfile -lvorbis"
slouken@368
   511
            fi
slouken@419
   512
        else
slouken@419
   513
            AC_MSG_WARN([*** Unable to find Ogg Vorbis library (http://www.xiph.org/)])
slouken@419
   514
            AC_MSG_WARN([Ogg Vorbis support disabled])
slouken@368
   515
        fi
slouken@353
   516
    fi
sezeroz@910
   517
    LIBS="$LIBS_SAVED"
slouken@353
   518
fi
slouken@419
   519
slouken@396
   520
libflac_ver=8
slouken@382
   521
AC_ARG_ENABLE([music-flac],
slouken@382
   522
AC_HELP_STRING([--enable-music-flac], [enable FLAC music [[default=yes]]]),
slouken@382
   523
              [], [enable_music_flac=yes])
slouken@382
   524
AC_ARG_ENABLE([music-flac-shared],
slouken@382
   525
AC_HELP_STRING([--enable-music-flac-shared],
slouken@639
   526
              [dynamically load FLAC library [[default=yes]]]),
slouken@382
   527
              [], [enable_music_flac_shared=yes])
slouken@382
   528
if test x$enable_music_flac = xyes; then
slouken@452
   529
    AC_CHECK_HEADER([FLAC/export.h], [have_flac_export=yes])
slouken@452
   530
    if test x$have_flac_export = xyes; then
slouken@452
   531
        LIBS_SAVED="$LIBS"
slouken@452
   532
        LIBS="-lFLAC"
slouken@452
   533
        AC_MSG_CHECKING([for libflac so-name version >= $libflac_ver])
slouken@502
   534
        AC_TRY_COMPILE([
slouken@396
   535
#include "FLAC/export.h"
slouken@396
   536
#include "stdio.h"
slouken@502
   537
],[
slouken@396
   538
#if defined(FLAC_API_VERSION_CURRENT) && (FLAC_API_VERSION_CURRENT >= $libflac_ver)
slouken@396
   539
#else
slouken@502
   540
#error "old-flac"
slouken@396
   541
#endif
slouken@396
   542
], have_flac_ver=yes, have_flac_ver=no)
slouken@419
   543
        LIBS="$LIBS_SAVED"
slouken@419
   544
        AC_MSG_RESULT($have_flac_ver)
slouken@419
   545
    fi
slouken@419
   546
slouken@419
   547
    if test x$have_flac_ver = xyes; then
slouken@419
   548
        AC_CHECK_HEADER([FLAC/stream_decoder.h], [have_flac_hdr=yes])
slouken@419
   549
        AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_new], [have_flac_lib=yes])
admin@999
   550
        if test x$have_flac_hdr = xyes -a x$have_flac_lib = xyes; then
slouken@419
   551
            case "$host" in
slouken@419
   552
                *-*-darwin*)
slouken@456
   553
                    flac_lib=[`find_lib libFLAC.dylib`]
slouken@419
   554
                    ;;
slouken@419
   555
                *-*-cygwin* | *-*-mingw32*)
slouken@636
   556
                    flac_lib=[`find_lib "libFLAC-*.dll"`]
slouken@419
   557
                    ;;
slouken@419
   558
                *)
slouken@636
   559
                    flac_lib=[`find_lib "libFLAC[0-9]*.so.*"`]
slouken@419
   560
                    if test x$flac_lib = x; then
slouken@636
   561
                        flac_lib=[`find_lib "libFLAC.so.*"`]
slouken@419
   562
                    fi
slouken@419
   563
                    ;;
slouken@419
   564
            esac
slouken@777
   565
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_FLAC"
slouken@419
   566
            if test x$enable_music_flac_shared = xyes && test x$flac_lib != x; then
slouken@419
   567
                echo "-- dynamic libFLAC -> $flac_lib"
slouken@419
   568
                EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLAC_DYNAMIC=\\\"$flac_lib\\\""
slouken@419
   569
            else
slouken@419
   570
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lFLAC"
slouken@419
   571
            fi
slouken@419
   572
        fi
slouken@419
   573
    else
slouken@419
   574
        AC_MSG_WARN([*** Unable to find FLAC library (http://flac.sourceforge.net/)])
slouken@419
   575
        AC_MSG_WARN([FLAC support disabled])
slouken@419
   576
    fi
slouken@382
   577
fi
slouken@419
   578
slouken@639
   579
AC_ARG_ENABLE(music-mp3,
slouken@639
   580
AC_HELP_STRING([--enable-music-mp3], [enable MP3 music [[default=yes]]]),
slouken@639
   581
              [], enable_music_mp3=yes)
slouken@488
   582
slouken@357
   583
AC_ARG_ENABLE(music-mp3-mad-gpl,
slouken@357
   584
AC_HELP_STRING([--enable-music-mp3-mad-gpl], [enable MP3 music via libmad GPL code [[default=no]]]),
slouken@357
   585
                  [], [enable_music_mp3_mad_gpl=no])
slouken@797
   586
AC_ARG_ENABLE(music-mp3-mad-gpl-dithering,
slouken@797
   587
AC_HELP_STRING([--enable-music-mp3-mad-gpl-dithering], [enable MP3 music via libmad GPL code [[default=yes]]]),
slouken@797
   588
                  [], [enable_music_mp3_mad_gpl_dithering=yes])
slouken@639
   589
if test x$enable_music_mp3 = xyes -a x$enable_music_mp3_mad_gpl = xyes; then
slouken@357
   590
    AC_MSG_CHECKING(for libmad headers)
slouken@357
   591
    have_libmad=no
slouken@357
   592
    AC_TRY_COMPILE([
slouken@357
   593
     #include "mad.h"
slouken@357
   594
    ],[
slouken@357
   595
    ],[
slouken@357
   596
    have_libmad=yes
slouken@357
   597
    ])
slouken@357
   598
    AC_MSG_RESULT($have_libmad)
slouken@357
   599
    if test x$have_libmad = xyes; then
slouken@777
   600
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MP3_MAD"
sezeroz@910
   601
        if test x$enable_music_mp3_mad_gpl_dithering = xyes; then
slouken@797
   602
            AC_MSG_WARN([*** Using GPL libmad and MP3 dithering routines, this build of SDL_mixer is now under the GPL])
sezeroz@910
   603
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MP3_MAD_GPL_DITHERING"
slouken@797
   604
        fi
slouken@357
   605
        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmad"
slouken@419
   606
    else
slouken@419
   607
        AC_MSG_WARN([*** Unable to find MAD library (http://www.underbit.com/products/mad/)])
slouken@357
   608
    fi
slouken@357
   609
fi
slouken@0
   610
lolisamurai@757
   611
AC_ARG_ENABLE(music-mp3-mpg123,
slouken@787
   612
AC_HELP_STRING([--enable-music-mp3-mpg123], [enable MP3 music via libmpg123 [[default=yes]]]),
slouken@787
   613
                  [], [enable_music_mp3_mpg123=yes])
slouken@787
   614
AC_ARG_ENABLE([music-mp3-mpg123-shared],
slouken@787
   615
AC_HELP_STRING([--enable-music-mp3-mpg123-shared], [dynamically load libmpg123 library [[default=yes]]]),
slouken@787
   616
              [], [enable_music_mp3_mpg123_shared=yes])
slouken@787
   617
if test x$enable_music_mp3_mpg123 = xyes; then
slouken@787
   618
    AC_CHECK_HEADER([mpg123.h], [have_mpg123_hdr=yes])
slouken@829
   619
    AC_CHECK_LIB([mpg123], [mpg123_replace_reader_handle], [have_mpg123_lib=yes])
slouken@787
   620
    if test x$have_mpg123_hdr = xyes -a x$have_mpg123_lib = xyes; then
sezeroz@904
   621
        have_libmpg123=yes
slouken@787
   622
        case "$host" in
slouken@787
   623
            *-*-darwin*)
slouken@787
   624
                mpg123_lib=[`find_lib libmpg123.dylib`]
slouken@787
   625
                ;;
slouken@787
   626
            *-*-cygwin* | *-*-mingw32*)
slouken@787
   627
                mpg123_lib=[`find_lib "libmpg123*.dll"`]
slouken@787
   628
                ;;
slouken@787
   629
            *)
sezeroz@906
   630
                mpg123_lib=[`find_lib "libmpg123.so.*"`]
slouken@787
   631
                ;;
slouken@787
   632
        esac
slouken@777
   633
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_MP3_MPG123"
slouken@787
   634
        if test x$enable_music_mp3_mpg123_shared = xyes && test x$mpg123_lib != x; then
slouken@787
   635
            echo "-- dynamic libmpg123 -> $mpg123_lib"
slouken@787
   636
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DMPG123_DYNAMIC=\\\"$mpg123_lib\\\""
slouken@787
   637
        else
slouken@787
   638
            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmpg123"
slouken@787
   639
        fi
lolisamurai@757
   640
    else
lolisamurai@757
   641
        AC_MSG_WARN([*** Unable to find mpg123 library (https://www.mpg123.de)])
slouken@787
   642
        AC_MSG_WARN([mpg123 support disabled])
lolisamurai@757
   643
    fi
lolisamurai@757
   644
fi
lolisamurai@757
   645
sezeroz@904
   646
if test x$have_libmad = xyes -o x$have_libmpg123 = xyes; then
slouken@780
   647
    :
slouken@714
   648
else
slouken@419
   649
    AC_MSG_WARN([MP3 support disabled])
slouken@419
   650
fi
slouken@419
   651
sezeroz@855
   652
AC_ARG_ENABLE([music-opus],
sezeroz@855
   653
AC_HELP_STRING([--enable-music-opus], [enable Opus music [[default=yes]]]),
sezeroz@855
   654
              [], [enable_music_opus=yes])
sezeroz@855
   655
sezeroz@855
   656
AC_ARG_ENABLE([music-opus-shared],
sezeroz@855
   657
AC_HELP_STRING([--enable-music-opus-shared], [dynamically load opusfile library [[default=yes]]]),
sezeroz@855
   658
              [], [enable_music_opus_shared=yes])
sezeroz@855
   659
if test x$enable_music_opus = xyes; then
sezeroz@910
   660
    LIBS_SAVED="$LIBS"
sezeroz@855
   661
    PKG_CHECK_MODULES([OPUSFILE], [opusfile >= 0.2], [dnl
sezeroz@855
   662
            have_opusfile_hdr=yes
sezeroz@855
   663
            have_opusfile_lib=yes
sezeroz@855
   664
        ], [dnl
sezeroz@855
   665
            AC_CHECK_HEADER([opus/opusfile.h], [have_opusfile_hdr=yes])
sezeroz@910
   666
            AC_CHECK_LIB([opusfile], [op_open_callbacks], [have_opusfile_lib=yes;OPUSFILE_LIBS="-lopusfile -lopus"], [], [-lopus -logg -lm])
sezeroz@855
   667
        ])
sezeroz@910
   668
    LIBS="$LIBS_SAVED"
sezeroz@855
   669
sezeroz@855
   670
    if test x$have_opusfile_hdr = xyes -a x$have_opusfile_lib = xyes; then
sezeroz@855
   671
        have_opusfile=yes
sezeroz@855
   672
        case "$host" in
sezeroz@855
   673
            *-*-darwin*)
sezeroz@855
   674
                opusfile_lib=[`find_lib libopusfile.dylib`]
sezeroz@855
   675
                ;;
sezeroz@855
   676
            *-*-cygwin* | *-*-mingw32*)
sezeroz@855
   677
                opusfile_lib=[`find_lib "libopusfile*.dll"`]
sezeroz@855
   678
                ;;
sezeroz@855
   679
            *)
sezeroz@855
   680
                opusfile_lib=[`find_lib "libopusfile[0-9]*.so.*"`]
sezeroz@855
   681
                if test x$opusfile_lib = x; then
sezeroz@855
   682
                    opusfile_lib=[`find_lib "libopusfile.so.*"`]
sezeroz@855
   683
                fi
sezeroz@855
   684
                ;;
sezeroz@855
   685
        esac
sezeroz@855
   686
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DMUSIC_OPUS $OPUSFILE_CFLAGS"
sezeroz@855
   687
        if test x$enable_music_opus_shared = xyes && test x$opusfile_lib != x; then
sezeroz@855
   688
            echo "-- dynamic opusfile -> $opusfile_lib"
sezeroz@855
   689
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DOPUS_DYNAMIC=\\\"$opusfile_lib\\\""
sezeroz@855
   690
        else
sezeroz@855
   691
            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $OPUSFILE_LIBS"
sezeroz@855
   692
        fi
sezeroz@855
   693
    else
sezeroz@855
   694
        AC_MSG_WARN([*** Unable to find opusfile library (http://opus-codec.org/)])
sezeroz@855
   695
    fi
sezeroz@855
   696
fi
sezeroz@855
   697
slouken@501
   698
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBM"
slouken@422
   699
slouken@422
   700
OBJECTS=`echo $SOURCES`
slouken@422
   701
DEPENDS=`echo $SOURCES`
slouken@422
   702
OBJECTS=`echo "$OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
slouken@422
   703
DEPENDS=`echo "$DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
slouken@422
   704
$(objects)/\2.lo: \1/\2.c\\
slouken@432
   705
	\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
slouken@422
   706
slouken@494
   707
OBJECTS_CXX=`echo $SOURCES_CXX`
slouken@494
   708
DEPENDS_CXX=`echo $SOURCES_CXX`
slouken@494
   709
OBJECTS_CXX=`echo "$OBJECTS_CXX" | sed 's,[[^ ]]*/\([[^ ]]*\)\.cpp,$(objects)/\1.lo,g'`
slouken@494
   710
DEPENDS_CXX=`echo "$DEPENDS_CXX" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.cpp,\\
slouken@494
   711
$(objects)/\2.lo: \1/\2.cpp\\
slouken@494
   712
	\$(LIBTOOL) --mode=compile \$(CXX) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
slouken@494
   713
OBJECTS="$OBJECTS $OBJECTS_CXX"
slouken@494
   714
DEPENDS="$DEPENDS $DEPENDS_CXX"
slouken@497
   715
DEPENDS=`echo "$DEPENDS" | sed 's,\\$,\\\\$,g'`
slouken@494
   716
slouken@422
   717
VERSION_OBJECTS=`echo $VERSION_SOURCES`
slouken@422
   718
VERSION_DEPENDS=`echo $VERSION_SOURCES`
slouken@422
   719
VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
slouken@422
   720
VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.rc,\\
slouken@422
   721
$(objects)/\2.o: \1/\2.rc\\
slouken@422
   722
	\$(WINDRES) \$< \$@,g'`
slouken@497
   723
VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed 's,\\$,\\\\$,g'`
slouken@422
   724
slouken@422
   725
PLAYWAVE_SOURCES="$srcdir/playwave.c"
slouken@422
   726
PLAYWAVE_OBJECTS=`echo $PLAYWAVE_SOURCES`
slouken@422
   727
PLAYWAVE_DEPENDS=`echo $PLAYWAVE_SOURCES`
slouken@422
   728
PLAYWAVE_OBJECTS=`echo "$PLAYWAVE_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
slouken@422
   729
PLAYWAVE_DEPENDS=`echo "$PLAYWAVE_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
slouken@422
   730
$(objects)/\2.lo: \1/\2.c\\
slouken@432
   731
	\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
slouken@497
   732
PLAYWAVE_DEPENDS=`echo "$PLAYWAVE_DEPENDS" | sed 's,\\$,\\\\$,g'`
slouken@422
   733
slouken@422
   734
PLAYMUS_SOURCES="$srcdir/playmus.c"
slouken@422
   735
PLAYMUS_OBJECTS=`echo $PLAYMUS_SOURCES`
slouken@422
   736
PLAYMUS_DEPENDS=`echo $PLAYMUS_SOURCES`
slouken@422
   737
PLAYMUS_OBJECTS=`echo "$PLAYMUS_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
slouken@422
   738
PLAYMUS_DEPENDS=`echo "$PLAYMUS_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
slouken@422
   739
$(objects)/\2.lo: \1/\2.c\\
slouken@432
   740
	\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
slouken@497
   741
PLAYMUS_DEPENDS=`echo "$PLAYMUS_DEPENDS" | sed 's,\\$,\\\\$,g'`
slouken@206
   742
slouken@294
   743
dnl Expand the sources and objects needed to build the library
slouken@294
   744
AC_SUBST(ac_aux_dir)
slouken@294
   745
AC_SUBST(OBJECTS)
slouken@422
   746
AC_SUBST(VERSION_OBJECTS)
slouken@422
   747
AC_SUBST(PLAYWAVE_OBJECTS)
slouken@422
   748
AC_SUBST(PLAYMUS_OBJECTS)
slouken@294
   749
AC_SUBST(BUILD_CFLAGS)
slouken@294
   750
AC_SUBST(EXTRA_CFLAGS)
slouken@294
   751
AC_SUBST(BUILD_LDFLAGS)
slouken@294
   752
AC_SUBST(EXTRA_LDFLAGS)
slouken@294
   753
AC_SUBST(EXE)
slouken@368
   754
AC_SUBST(WINDRES)
slouken@392
   755
AC_SUBST(SDL_VERSION)
slouken@294
   756
AC_SUBST(SDL_CFLAGS)
slouken@294
   757
AC_SUBST(SDL_LIBS)
slouken@294
   758
slouken@0
   759
AC_OUTPUT([
slouken@497
   760
])
slouken@497
   761
AC_CONFIG_FILES([
slouken@578
   762
    Makefile SDL2_mixer.spec SDL2_mixer.pc
slouken@0
   763
])
slouken@497
   764
AC_CONFIG_COMMANDS([default],
slouken@497
   765
                   [cat >>Makefile <<__EOF__
slouken@497
   766
slouken@497
   767
# Build rules for objects
slouken@497
   768
-include \$(OBJECTS:.lo=.d)
slouken@497
   769
$DEPENDS
slouken@497
   770
$VERSION_DEPENDS
slouken@497
   771
slouken@497
   772
-include \$(PLAYWAVE_OBJECTS:.lo=.d)
slouken@497
   773
$PLAYWAVE_DEPENDS
slouken@497
   774
slouken@497
   775
-include \$(PLAYMUS_OBJECTS:.lo=.d)
slouken@497
   776
$PLAYMUS_DEPENDS
admin@999
   777
__EOF__
slouken@497
   778
], [
slouken@497
   779
DEPENDS="$DEPENDS"
slouken@497
   780
VERSION_DEPENDS="$VERSION_DEPENDS"
slouken@497
   781
PLAYWAVE_DEPENDS="$PLAYWAVE_DEPENDS"
slouken@497
   782
PLAYMUS_DEPENDS="$PLAYMUS_DEPENDS"
slouken@497
   783
])
slouken@497
   784
AC_OUTPUT