configure.in
author Sam Lantinga <slouken@libsdl.org>
Wed, 05 Sep 2001 03:38:51 +0000
changeset 106 ba6a6039e158
parent 104 18fc2e4ef29b
child 107 2a03845b2d28
permissions -rw-r--r--
Added native MIDI music support on MacOS and MacOS X
slouken@0
     1
dnl Process this file with autoconf to produce a configure script.
slouken@0
     2
AC_INIT(README)
slouken@0
     3
slouken@0
     4
dnl Set various version strings - taken gratefully from the GTk sources
slouken@0
     5
slouken@0
     6
# Making releases:
slouken@0
     7
#   MICRO_VERSION += 1;
slouken@0
     8
#   INTERFACE_AGE += 1;
slouken@0
     9
#   BINARY_AGE += 1;
slouken@0
    10
# if any functions have been added, set INTERFACE_AGE to 0.
slouken@0
    11
# if backwards compatibility has been broken,
slouken@0
    12
# set BINARY_AGE and INTERFACE_AGE to 0.
slouken@0
    13
slouken@0
    14
MAJOR_VERSION=1
slouken@81
    15
MINOR_VERSION=2
slouken@88
    16
MICRO_VERSION=1
slouken@88
    17
INTERFACE_AGE=1
slouken@88
    18
BINARY_AGE=1
slouken@0
    19
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
slouken@0
    20
slouken@0
    21
AC_SUBST(MAJOR_VERSION)
slouken@0
    22
AC_SUBST(MINOR_VERSION)
slouken@0
    23
AC_SUBST(MICRO_VERSION)
slouken@0
    24
AC_SUBST(INTERFACE_AGE)
slouken@0
    25
AC_SUBST(BINARY_AGE)
slouken@0
    26
AC_SUBST(VERSION)
slouken@0
    27
slouken@0
    28
# libtool versioning
slouken@0
    29
LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
slouken@0
    30
LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
slouken@0
    31
LT_REVISION=$INTERFACE_AGE
slouken@0
    32
LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
slouken@0
    33
slouken@0
    34
AC_SUBST(LT_RELEASE)
slouken@0
    35
AC_SUBST(LT_CURRENT)
slouken@0
    36
AC_SUBST(LT_REVISION)
slouken@0
    37
AC_SUBST(LT_AGE)
slouken@0
    38
slouken@68
    39
dnl Detect the canonical host and target build environment
slouken@68
    40
AC_CANONICAL_HOST
slouken@68
    41
AC_CANONICAL_TARGET
slouken@68
    42
slouken@91
    43
dnl Setup for automake
slouken@91
    44
AM_INIT_AUTOMAKE(SDL_mixer, $VERSION)
slouken@91
    45
slouken@0
    46
dnl Check for tools
slouken@0
    47
slouken@0
    48
AC_PROG_MAKE_SET
slouken@0
    49
AC_PROG_CC
slouken@26
    50
AC_LIBTOOL_WIN32_DLL
slouken@0
    51
AM_PROG_LIBTOOL
slouken@0
    52
AC_PROG_INSTALL
slouken@0
    53
slouken@6
    54
dnl The alpha architecture needs special flags for binary portability
slouken@6
    55
case "$target" in
slouken@6
    56
    alpha*-*-linux*)
slouken@6
    57
        CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
slouken@6
    58
        ;;
slouken@85
    59
    *-*-beos*)
slouken@85
    60
        ac_default_prefix=/boot/develop/tools/gnupro
slouken@85
    61
        ;;
slouken@68
    62
    *-*-cygwin* | *-*-mingw32*)
slouken@68
    63
        if test "$build" != "$target"; then # cross-compiling
slouken@104
    64
            # Default cross-compile location
slouken@68
    65
            ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
slouken@104
    66
        else
slouken@104
    67
            # Look for the location of the tools and install there
slouken@104
    68
            if [ "$BUILD_PREFIX" != "" ]; then
slouken@104
    69
                ac_default_prefix=$BUILD_PREFIX
slouken@104
    70
            fi
slouken@68
    71
        fi
slouken@68
    72
        ;;
slouken@6
    73
esac
slouken@6
    74
slouken@20
    75
dnl Check for SDL
slouken@81
    76
SDL_VERSION=1.2.0
slouken@20
    77
AM_PATH_SDL($SDL_VERSION,
slouken@20
    78
            :,
slouken@20
    79
	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
slouken@20
    80
)
slouken@0
    81
CFLAGS="$CFLAGS $SDL_CFLAGS"
slouken@0
    82
LIBS="$LIBS $SDL_LIBS"
slouken@0
    83
slouken@59
    84
dnl Flag for using SDL_RWops
slouken@59
    85
dnl Matt Campbell (matt@campbellhome.dhs.org)
slouken@59
    86
CFLAGS="$CFLAGS -DUSE_RWOPS"
slouken@59
    87
slouken@0
    88
dnl Check command-line options
slouken@91
    89
slouken@91
    90
dnl rcg06052001 VOC file support by Ryan C. Gordon (icculus@linuxgames.com).
slouken@91
    91
AC_ARG_ENABLE(samples-voc,
slouken@91
    92
[  --enable-samples-voc    enable support for VOC samples [default=yes]],
slouken@91
    93
              , enable_samples_voc=yes)
slouken@91
    94
if test x$enable_samples_voc = xyes; then
slouken@91
    95
    CFLAGS="$CFLAGS -DVOC_SAMPLES"
slouken@91
    96
fi
slouken@91
    97
slouken@0
    98
AC_ARG_ENABLE(music-cmd,
slouken@0
    99
[  --enable-music-cmd      support an external music player [default=yes]],
slouken@0
   100
              , enable_music_cmd=yes)
slouken@0
   101
if test x$enable_music_cmd = xyes; then
slouken@0
   102
    CFLAGS="$CFLAGS -DCMD_MUSIC"
slouken@0
   103
fi
slouken@0
   104
AC_ARG_ENABLE(music-wave,
slouken@0
   105
[  --enable-music-wave     enable streaming WAVE music [default=yes]],
slouken@0
   106
              , enable_music_wave=yes)
slouken@0
   107
if test x$enable_music_wave = xyes; then
slouken@0
   108
    CFLAGS="$CFLAGS -DWAV_MUSIC"
slouken@0
   109
fi
slouken@1
   110
AC_ARG_ENABLE(music-mod,
slouken@1
   111
[  --enable-music-mod      enable MOD music via mikmod [default=yes]],
slouken@1
   112
              , enable_music_mod=yes)
slouken@1
   113
if test x$enable_music_mod = xyes; then
slouken@1
   114
    CFLAGS="$CFLAGS -DMOD_MUSIC -I\$(top_srcdir)/mikmod"
slouken@1
   115
    MUSIC_SUBDIRS="$MUSIC_SUBDIRS mikmod"
slouken@1
   116
fi
slouken@0
   117
AC_ARG_ENABLE(music-midi,
slouken@0
   118
[  --enable-music-midi     enable MIDI music via timidity [default=yes]],
slouken@0
   119
              , enable_music_midi=yes)
slouken@0
   120
if test x$enable_music_midi = xyes; then
slouken@106
   121
    CFLAGS="$CFLAGS -DMID_MUSIC"
slouken@106
   122
    AC_ARG_ENABLE(music-timidity-midi,
slouken@106
   123
[  --enable-music-timidity-midi  enable timidity MIDI output [default=yes]],
slouken@106
   124
                  , enable_music_timidity_midi=yes)
slouken@106
   125
    if test x$enable_music_timidity_midi = xyes; then
slouken@106
   126
        CFLAGS="$CFLAGS -I\$(top_srcdir)/timidity"
slouken@106
   127
        MUSIC_SUBDIRS="$MUSIC_SUBDIRS timidity"
slouken@106
   128
    fi
slouken@99
   129
    AC_ARG_ENABLE(music-native-midi,
slouken@99
   130
[  --enable-music-native-midi  enable native MIDI music output [default=yes]],
slouken@99
   131
                  , enable_music_native_midi=yes)
slouken@99
   132
    if test x$enable_music_native_midi = xyes; then
slouken@99
   133
        use_music_native_midi=no
slouken@99
   134
        case "$target" in
slouken@99
   135
            *-*-cygwin* | *-*-mingw32*)
slouken@99
   136
                use_music_native_midi=yes
slouken@99
   137
                LIBS="$LIBS -lwinmm"
slouken@99
   138
                ;;
slouken@99
   139
        esac
slouken@99
   140
        if test x$use_music_native_midi = xyes; then
slouken@99
   141
            CFLAGS="$CFLAGS -DUSE_NATIVE_MIDI -I\$(top_srcdir)/native_midi"
slouken@99
   142
            MUSIC_SUBDIRS="$MUSIC_SUBDIRS native_midi"
slouken@99
   143
        fi
slouken@99
   144
    fi
slouken@0
   145
fi
slouken@63
   146
AC_ARG_ENABLE(music-ogg,
slouken@63
   147
[  --enable-music-ogg      enable Ogg Vorbis music [default=yes]],
slouken@63
   148
              , enable_music_ogg=yes)
slouken@63
   149
if test x$enable_music_ogg = xyes; then
slouken@63
   150
    AC_MSG_CHECKING(for Ogg Vorbis headers and libraries)
slouken@63
   151
    have_vorbis=no
slouken@63
   152
    AC_TRY_COMPILE([
slouken@63
   153
     #include <vorbis/vorbisfile.h>
slouken@63
   154
    ],[
slouken@63
   155
    ],[
slouken@63
   156
    have_vorbis=yes
slouken@63
   157
    ])
slouken@63
   158
    AC_MSG_RESULT($have_vorbis)
slouken@63
   159
    if test x$have_vorbis = xyes; then
slouken@63
   160
        CFLAGS="$CFLAGS -DOGG_MUSIC"
slouken@63
   161
        LIBS="$LIBS -lvorbisfile -lvorbis"
slouken@63
   162
    fi
slouken@63
   163
fi
slouken@0
   164
AC_ARG_ENABLE(music-mp3,
slouken@0
   165
[  --enable-music-mp3      enable MP3 music via smpeg [default=yes]],
slouken@0
   166
              , enable_music_mp3=yes)
slouken@0
   167
if test x$enable_music_mp3 = xyes; then
slouken@83
   168
    SMPEG_VERSION=0.4.3
slouken@83
   169
    AM_PATH_SMPEG($SMPEG_VERSION, have_smpeg=yes, have_smpeg=no)
slouken@0
   170
    if test x$have_smpeg = xyes; then
slouken@87
   171
        CFLAGS="$CFLAGS -DMP3_MUSIC $SMPEG_CFLAGS"
slouken@83
   172
        LIBS="$LIBS $SMPEG_LIBS"
slouken@0
   173
    fi
slouken@0
   174
fi
slouken@0
   175
slouken@1
   176
dnl Add Makefile conditionals
slouken@1
   177
AC_SUBST(MUSIC_SUBDIRS)
slouken@1
   178
AM_CONDITIONAL(USE_MIKMOD, test x$enable_music_mod = xyes)
slouken@106
   179
AM_CONDITIONAL(USE_TIMIDITY, test x$enable_music_timidity_midi = xyes)
slouken@99
   180
AM_CONDITIONAL(USE_NATIVE_MIDI, test x$use_music_native_midi = xyes)
slouken@1
   181
slouken@0
   182
# Finally create all the generated files
slouken@0
   183
AC_OUTPUT([
slouken@0
   184
Makefile
slouken@0
   185
mikmod/Makefile
slouken@0
   186
timidity/Makefile
slouken@99
   187
native_midi/Makefile
slouken@38
   188
SDL_mixer.spec
slouken@0
   189
])