configure.in
author Sam Lantinga <slouken@lokigames.com>
Thu, 05 Apr 2001 21:25:56 +0000
changeset 83 c95d43cc6d38
parent 81 763eb10dd564
child 85 834fceca3d7d
permissions -rw-r--r--
Cross platform cleanups
     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     *-*-cygwin* | *-*-mingw32*)
    60         if test "$build" != "$target"; then # cross-compiling
    61             ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
    62         fi
    63         ;;
    64 esac
    65 
    66 dnl Check for SDL
    67 SDL_VERSION=1.2.0
    68 AM_PATH_SDL($SDL_VERSION,
    69             :,
    70 	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
    71 )
    72 CFLAGS="$CFLAGS $SDL_CFLAGS"
    73 LIBS="$LIBS $SDL_LIBS"
    74 
    75 dnl Flag for using SDL_RWops
    76 dnl Matt Campbell (matt@campbellhome.dhs.org)
    77 CFLAGS="$CFLAGS -DUSE_RWOPS"
    78 
    79 dnl Check command-line options
    80 AC_ARG_ENABLE(music-cmd,
    81 [  --enable-music-cmd      support an external music player [default=yes]],
    82               , enable_music_cmd=yes)
    83 if test x$enable_music_cmd = xyes; then
    84     CFLAGS="$CFLAGS -DCMD_MUSIC"
    85 fi
    86 AC_ARG_ENABLE(music-wave,
    87 [  --enable-music-wave     enable streaming WAVE music [default=yes]],
    88               , enable_music_wave=yes)
    89 if test x$enable_music_wave = xyes; then
    90     CFLAGS="$CFLAGS -DWAV_MUSIC"
    91 fi
    92 AC_ARG_ENABLE(music-mod,
    93 [  --enable-music-mod      enable MOD music via mikmod [default=yes]],
    94               , enable_music_mod=yes)
    95 if test x$enable_music_mod = xyes; then
    96     CFLAGS="$CFLAGS -DMOD_MUSIC -I\$(top_srcdir)/mikmod"
    97     MUSIC_SUBDIRS="$MUSIC_SUBDIRS mikmod"
    98 fi
    99 AC_ARG_ENABLE(music-midi,
   100 [  --enable-music-midi     enable MIDI music via timidity [default=yes]],
   101               , enable_music_midi=yes)
   102 if test x$enable_music_midi = xyes; then
   103     CFLAGS="$CFLAGS -DMID_MUSIC -I\$(top_srcdir)/timidity"
   104     MUSIC_SUBDIRS="$MUSIC_SUBDIRS timidity"
   105 fi
   106 AC_ARG_ENABLE(music-ogg,
   107 [  --enable-music-ogg      enable Ogg Vorbis music [default=yes]],
   108               , enable_music_ogg=yes)
   109 if test x$enable_music_ogg = xyes; then
   110     AC_MSG_CHECKING(for Ogg Vorbis headers and libraries)
   111     have_vorbis=no
   112     AC_TRY_COMPILE([
   113      #include <vorbis/vorbisfile.h>
   114     ],[
   115     ],[
   116     have_vorbis=yes
   117     ])
   118     AC_MSG_RESULT($have_vorbis)
   119     if test x$have_vorbis = xyes; then
   120         CFLAGS="$CFLAGS -DOGG_MUSIC"
   121         LIBS="$LIBS -lvorbisfile -lvorbis"
   122     fi
   123 fi
   124 AC_ARG_ENABLE(music-mp3,
   125 [  --enable-music-mp3      enable MP3 music via smpeg [default=yes]],
   126               , enable_music_mp3=yes)
   127 if test x$enable_music_mp3 = xyes; then
   128     SMPEG_VERSION=0.4.3
   129     AM_PATH_SMPEG($SMPEG_VERSION, have_smpeg=yes, have_smpeg=no)
   130     if test x$have_smpeg = xyes; then
   131         CFLAGS="$CFLAGS $SMPEG_CFLAGS"
   132         LIBS="$LIBS $SMPEG_LIBS"
   133     fi
   134 fi
   135 
   136 dnl Add Makefile conditionals
   137 AC_SUBST(MUSIC_SUBDIRS)
   138 AM_CONDITIONAL(USE_MIKMOD, test x$enable_music_mod = xyes)
   139 AM_CONDITIONAL(USE_TIMIDITY, test x$enable_music_midi = xyes)
   140 
   141 # Finally create all the generated files
   142 AC_OUTPUT([
   143 Makefile
   144 mikmod/Makefile
   145 timidity/Makefile
   146 SDL_mixer.spec
   147 ])