configure.in
author Sam Lantinga <slouken@lokigames.com>
Wed, 04 Apr 2001 20:00:34 +0000
changeset 81 763eb10dd564
parent 76 1d974913b859
child 83 c95d43cc6d38
permissions -rw-r--r--
Sam Lantinga - Wed Apr 4 12:42:20 PDT 2001
* Synchronized release version with SDL 1.2.0
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@81
    16
MICRO_VERSION=0
slouken@81
    17
INTERFACE_AGE=0
slouken@81
    18
BINARY_AGE=0
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@0
    39
dnl Setup for automake
slouken@36
    40
AM_INIT_AUTOMAKE(SDL_mixer, $VERSION)
slouken@0
    41
slouken@68
    42
dnl Detect the canonical host and target build environment
slouken@68
    43
AC_CANONICAL_HOST
slouken@68
    44
AC_CANONICAL_TARGET
slouken@68
    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@68
    59
    *-*-cygwin* | *-*-mingw32*)
slouken@68
    60
        if test "$build" != "$target"; then # cross-compiling
slouken@68
    61
            ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
slouken@68
    62
        fi
slouken@68
    63
        ;;
slouken@6
    64
esac
slouken@6
    65
slouken@20
    66
dnl Check for SDL
slouken@81
    67
SDL_VERSION=1.2.0
slouken@20
    68
AM_PATH_SDL($SDL_VERSION,
slouken@20
    69
            :,
slouken@20
    70
	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
slouken@20
    71
)
slouken@0
    72
CFLAGS="$CFLAGS $SDL_CFLAGS"
slouken@0
    73
LIBS="$LIBS $SDL_LIBS"
slouken@0
    74
slouken@59
    75
dnl Flag for using SDL_RWops
slouken@59
    76
dnl Matt Campbell (matt@campbellhome.dhs.org)
slouken@59
    77
CFLAGS="$CFLAGS -DUSE_RWOPS"
slouken@59
    78
slouken@0
    79
dnl Check command-line options
slouken@0
    80
AC_ARG_ENABLE(music-cmd,
slouken@0
    81
[  --enable-music-cmd      support an external music player [default=yes]],
slouken@0
    82
              , enable_music_cmd=yes)
slouken@0
    83
if test x$enable_music_cmd = xyes; then
slouken@0
    84
    CFLAGS="$CFLAGS -DCMD_MUSIC"
slouken@0
    85
fi
slouken@0
    86
AC_ARG_ENABLE(music-wave,
slouken@0
    87
[  --enable-music-wave     enable streaming WAVE music [default=yes]],
slouken@0
    88
              , enable_music_wave=yes)
slouken@0
    89
if test x$enable_music_wave = xyes; then
slouken@0
    90
    CFLAGS="$CFLAGS -DWAV_MUSIC"
slouken@0
    91
fi
slouken@1
    92
AC_ARG_ENABLE(music-mod,
slouken@1
    93
[  --enable-music-mod      enable MOD music via mikmod [default=yes]],
slouken@1
    94
              , enable_music_mod=yes)
slouken@1
    95
if test x$enable_music_mod = xyes; then
slouken@1
    96
    CFLAGS="$CFLAGS -DMOD_MUSIC -I\$(top_srcdir)/mikmod"
slouken@1
    97
    MUSIC_SUBDIRS="$MUSIC_SUBDIRS mikmod"
slouken@1
    98
fi
slouken@0
    99
AC_ARG_ENABLE(music-midi,
slouken@0
   100
[  --enable-music-midi     enable MIDI music via timidity [default=yes]],
slouken@0
   101
              , enable_music_midi=yes)
slouken@0
   102
if test x$enable_music_midi = xyes; then
slouken@0
   103
    CFLAGS="$CFLAGS -DMID_MUSIC -I\$(top_srcdir)/timidity"
slouken@1
   104
    MUSIC_SUBDIRS="$MUSIC_SUBDIRS timidity"
slouken@0
   105
fi
slouken@63
   106
AC_ARG_ENABLE(music-ogg,
slouken@63
   107
[  --enable-music-ogg      enable Ogg Vorbis music [default=yes]],
slouken@63
   108
              , enable_music_ogg=yes)
slouken@63
   109
if test x$enable_music_ogg = xyes; then
slouken@63
   110
    AC_MSG_CHECKING(for Ogg Vorbis headers and libraries)
slouken@63
   111
    have_vorbis=no
slouken@63
   112
    AC_TRY_COMPILE([
slouken@63
   113
     #include <vorbis/vorbisfile.h>
slouken@63
   114
    ],[
slouken@63
   115
    ],[
slouken@63
   116
    have_vorbis=yes
slouken@63
   117
    ])
slouken@63
   118
    AC_MSG_RESULT($have_vorbis)
slouken@63
   119
    if test x$have_vorbis = xyes; then
slouken@63
   120
        CFLAGS="$CFLAGS -DOGG_MUSIC"
slouken@63
   121
        LIBS="$LIBS -lvorbisfile -lvorbis"
slouken@63
   122
    fi
slouken@63
   123
fi
slouken@0
   124
AC_ARG_ENABLE(music-mp3,
slouken@0
   125
[  --enable-music-mp3      enable MP3 music via smpeg [default=yes]],
slouken@0
   126
              , enable_music_mp3=yes)
slouken@0
   127
if test x$enable_music_mp3 = xyes; then
slouken@0
   128
    AC_MSG_CHECKING(for SMPEG headers and libraries)
slouken@0
   129
    have_smpeg=no
slouken@0
   130
    AC_TRY_COMPILE([
slouken@0
   131
     #include <smpeg/smpeg.h>
slouken@0
   132
    ],[
slouken@0
   133
    ],[
slouken@0
   134
    have_smpeg=yes
slouken@0
   135
    ])
slouken@0
   136
    AC_MSG_RESULT($have_smpeg)
slouken@0
   137
    if test x$have_smpeg = xyes; then
slouken@0
   138
        CFLAGS="$CFLAGS -DMP3_MUSIC"
slouken@0
   139
        LIBS="$LIBS -lsmpeg"
slouken@0
   140
    fi
slouken@0
   141
fi
slouken@0
   142
slouken@1
   143
dnl Add Makefile conditionals
slouken@1
   144
AC_SUBST(MUSIC_SUBDIRS)
slouken@1
   145
AM_CONDITIONAL(USE_MIKMOD, test x$enable_music_mod = xyes)
slouken@1
   146
AM_CONDITIONAL(USE_TIMIDITY, test x$enable_music_midi = xyes)
slouken@1
   147
slouken@0
   148
# Finally create all the generated files
slouken@0
   149
AC_OUTPUT([
slouken@0
   150
Makefile
slouken@0
   151
mikmod/Makefile
slouken@0
   152
timidity/Makefile
slouken@38
   153
SDL_mixer.spec
slouken@0
   154
])