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