configure.in
author Sam Lantinga <slouken@libsdl.org>
Mon, 20 Aug 2001 02:42:46 +0000
changeset 104 18fc2e4ef29b
parent 99 06246f9170dc
child 106 ba6a6039e158
permissions -rw-r--r--
*** empty log message ***
     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=1
    17 INTERFACE_AGE=1
    18 BINARY_AGE=1
    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 Detect the canonical host and target build environment
    40 AC_CANONICAL_HOST
    41 AC_CANONICAL_TARGET
    42 
    43 dnl Setup for automake
    44 AM_INIT_AUTOMAKE(SDL_mixer, $VERSION)
    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             # Default cross-compile location
    65             ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
    66         else
    67             # Look for the location of the tools and install there
    68             if [ "$BUILD_PREFIX" != "" ]; then
    69                 ac_default_prefix=$BUILD_PREFIX
    70             fi
    71         fi
    72         ;;
    73 esac
    74 
    75 dnl Check for SDL
    76 SDL_VERSION=1.2.0
    77 AM_PATH_SDL($SDL_VERSION,
    78             :,
    79 	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
    80 )
    81 CFLAGS="$CFLAGS $SDL_CFLAGS"
    82 LIBS="$LIBS $SDL_LIBS"
    83 
    84 dnl Flag for using SDL_RWops
    85 dnl Matt Campbell (matt@campbellhome.dhs.org)
    86 CFLAGS="$CFLAGS -DUSE_RWOPS"
    87 
    88 dnl Check command-line options
    89 
    90 dnl rcg06052001 VOC file support by Ryan C. Gordon (icculus@linuxgames.com).
    91 AC_ARG_ENABLE(samples-voc,
    92 [  --enable-samples-voc    enable support for VOC samples [default=yes]],
    93               , enable_samples_voc=yes)
    94 if test x$enable_samples_voc = xyes; then
    95     CFLAGS="$CFLAGS -DVOC_SAMPLES"
    96 fi
    97 
    98 AC_ARG_ENABLE(music-cmd,
    99 [  --enable-music-cmd      support an external music player [default=yes]],
   100               , enable_music_cmd=yes)
   101 if test x$enable_music_cmd = xyes; then
   102     CFLAGS="$CFLAGS -DCMD_MUSIC"
   103 fi
   104 AC_ARG_ENABLE(music-wave,
   105 [  --enable-music-wave     enable streaming WAVE music [default=yes]],
   106               , enable_music_wave=yes)
   107 if test x$enable_music_wave = xyes; then
   108     CFLAGS="$CFLAGS -DWAV_MUSIC"
   109 fi
   110 AC_ARG_ENABLE(music-mod,
   111 [  --enable-music-mod      enable MOD music via mikmod [default=yes]],
   112               , enable_music_mod=yes)
   113 if test x$enable_music_mod = xyes; then
   114     CFLAGS="$CFLAGS -DMOD_MUSIC -I\$(top_srcdir)/mikmod"
   115     MUSIC_SUBDIRS="$MUSIC_SUBDIRS mikmod"
   116 fi
   117 AC_ARG_ENABLE(music-midi,
   118 [  --enable-music-midi     enable MIDI music via timidity [default=yes]],
   119               , enable_music_midi=yes)
   120 if test x$enable_music_midi = xyes; then
   121     CFLAGS="$CFLAGS -DMID_MUSIC -I\$(top_srcdir)/timidity"
   122     MUSIC_SUBDIRS="$MUSIC_SUBDIRS timidity"
   123     AC_ARG_ENABLE(music-native-midi,
   124 [  --enable-music-native-midi  enable native MIDI music output [default=yes]],
   125                   , enable_music_native_midi=yes)
   126     if test x$enable_music_native_midi = xyes; then
   127         use_music_native_midi=no
   128         case "$target" in
   129             *-*-cygwin* | *-*-mingw32*)
   130                 use_music_native_midi=yes
   131                 LIBS="$LIBS -lwinmm"
   132                 ;;
   133         esac
   134         if test x$use_music_native_midi = xyes; then
   135             CFLAGS="$CFLAGS -DUSE_NATIVE_MIDI -I\$(top_srcdir)/native_midi"
   136             MUSIC_SUBDIRS="$MUSIC_SUBDIRS native_midi"
   137         fi
   138     fi
   139 fi
   140 AC_ARG_ENABLE(music-ogg,
   141 [  --enable-music-ogg      enable Ogg Vorbis music [default=yes]],
   142               , enable_music_ogg=yes)
   143 if test x$enable_music_ogg = xyes; then
   144     AC_MSG_CHECKING(for Ogg Vorbis headers and libraries)
   145     have_vorbis=no
   146     AC_TRY_COMPILE([
   147      #include <vorbis/vorbisfile.h>
   148     ],[
   149     ],[
   150     have_vorbis=yes
   151     ])
   152     AC_MSG_RESULT($have_vorbis)
   153     if test x$have_vorbis = xyes; then
   154         CFLAGS="$CFLAGS -DOGG_MUSIC"
   155         LIBS="$LIBS -lvorbisfile -lvorbis"
   156     fi
   157 fi
   158 AC_ARG_ENABLE(music-mp3,
   159 [  --enable-music-mp3      enable MP3 music via smpeg [default=yes]],
   160               , enable_music_mp3=yes)
   161 if test x$enable_music_mp3 = xyes; then
   162     SMPEG_VERSION=0.4.3
   163     AM_PATH_SMPEG($SMPEG_VERSION, have_smpeg=yes, have_smpeg=no)
   164     if test x$have_smpeg = xyes; then
   165         CFLAGS="$CFLAGS -DMP3_MUSIC $SMPEG_CFLAGS"
   166         LIBS="$LIBS $SMPEG_LIBS"
   167     fi
   168 fi
   169 
   170 dnl Add Makefile conditionals
   171 AC_SUBST(MUSIC_SUBDIRS)
   172 AM_CONDITIONAL(USE_MIKMOD, test x$enable_music_mod = xyes)
   173 AM_CONDITIONAL(USE_TIMIDITY, test x$enable_music_midi = xyes)
   174 AM_CONDITIONAL(USE_NATIVE_MIDI, test x$use_music_native_midi = xyes)
   175 
   176 # Finally create all the generated files
   177 AC_OUTPUT([
   178 Makefile
   179 mikmod/Makefile
   180 timidity/Makefile
   181 native_midi/Makefile
   182 SDL_mixer.spec
   183 ])