configure.in
author Sam Lantinga <slouken@libsdl.org>
Fri, 07 Sep 2001 01:06:20 +0000
changeset 110 1885d27bab6c
parent 107 2a03845b2d28
child 142 59564a17ae18
permissions -rw-r--r--
MacOS X tweaks
     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     *-*-darwin*)
    74         AC_DEFINE(MACOSX)
    75         ;;
    76 esac
    77 
    78 dnl Check for SDL
    79 SDL_VERSION=1.2.0
    80 AM_PATH_SDL($SDL_VERSION,
    81             :,
    82 	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
    83 )
    84 CFLAGS="$CFLAGS $SDL_CFLAGS"
    85 LIBS="$LIBS $SDL_LIBS"
    86 
    87 dnl Flag for using SDL_RWops
    88 dnl Matt Campbell (matt@campbellhome.dhs.org)
    89 CFLAGS="$CFLAGS -DUSE_RWOPS"
    90 
    91 dnl Check command-line options
    92 
    93 dnl rcg06052001 VOC file support by Ryan C. Gordon (icculus@linuxgames.com).
    94 AC_ARG_ENABLE(samples-voc,
    95 [  --enable-samples-voc    enable support for VOC samples [default=yes]],
    96               , enable_samples_voc=yes)
    97 if test x$enable_samples_voc = xyes; then
    98     CFLAGS="$CFLAGS -DVOC_SAMPLES"
    99 fi
   100 
   101 AC_ARG_ENABLE(music-cmd,
   102 [  --enable-music-cmd      support an external music player [default=yes]],
   103               , enable_music_cmd=yes)
   104 if test x$enable_music_cmd = xyes; then
   105     CFLAGS="$CFLAGS -DCMD_MUSIC"
   106 fi
   107 AC_ARG_ENABLE(music-wave,
   108 [  --enable-music-wave     enable streaming WAVE music [default=yes]],
   109               , enable_music_wave=yes)
   110 if test x$enable_music_wave = xyes; then
   111     CFLAGS="$CFLAGS -DWAV_MUSIC"
   112 fi
   113 AC_ARG_ENABLE(music-mod,
   114 [  --enable-music-mod      enable MOD music via mikmod [default=yes]],
   115               , enable_music_mod=yes)
   116 if test x$enable_music_mod = xyes; then
   117     CFLAGS="$CFLAGS -DMOD_MUSIC -I\$(top_srcdir)/mikmod"
   118     MUSIC_SUBDIRS="$MUSIC_SUBDIRS mikmod"
   119 fi
   120 AC_ARG_ENABLE(music-midi,
   121 [  --enable-music-midi     enable MIDI music via timidity [default=yes]],
   122               , enable_music_midi=yes)
   123 if test x$enable_music_midi = xyes; then
   124     CFLAGS="$CFLAGS -DMID_MUSIC"
   125     AC_ARG_ENABLE(music-timidity-midi,
   126 [  --enable-music-timidity-midi  enable timidity MIDI output [default=yes]],
   127                   , enable_music_timidity_midi=yes)
   128     if test x$enable_music_timidity_midi = xyes; then
   129         CFLAGS="$CFLAGS -DUSE_TIMIDITY_MIDI -I\$(top_srcdir)/timidity"
   130         MUSIC_SUBDIRS="$MUSIC_SUBDIRS timidity"
   131     fi
   132     AC_ARG_ENABLE(music-native-midi,
   133 [  --enable-music-native-midi  enable native MIDI music output [default=yes]],
   134                   , enable_music_native_midi=yes)
   135     if test x$enable_music_native_midi = xyes; then
   136         use_music_native_midi=no
   137         case "$target" in
   138             *-*-cygwin* | *-*-mingw32*)
   139                 use_music_native_midi=yes
   140                 LIBS="$LIBS -lwinmm"
   141                 ;;
   142             *-*-darwin*)
   143                 use_music_native_midi=yes
   144                 LIBS="$LIBS -framework QuickTime"
   145                 ;;
   146         esac
   147         if test x$use_music_native_midi = xyes; then
   148             CFLAGS="$CFLAGS -DUSE_NATIVE_MIDI -I\$(top_srcdir)/native_midi"
   149             MUSIC_SUBDIRS="$MUSIC_SUBDIRS native_midi"
   150         fi
   151     fi
   152 fi
   153 AC_ARG_ENABLE(music-ogg,
   154 [  --enable-music-ogg      enable Ogg Vorbis music [default=yes]],
   155               , enable_music_ogg=yes)
   156 if test x$enable_music_ogg = xyes; then
   157     AC_MSG_CHECKING(for Ogg Vorbis headers and libraries)
   158     have_vorbis=no
   159     AC_TRY_COMPILE([
   160      #include <vorbis/vorbisfile.h>
   161     ],[
   162     ],[
   163     have_vorbis=yes
   164     ])
   165     AC_MSG_RESULT($have_vorbis)
   166     if test x$have_vorbis = xyes; then
   167         CFLAGS="$CFLAGS -DOGG_MUSIC"
   168         LIBS="$LIBS -lvorbisfile -lvorbis"
   169     fi
   170 fi
   171 AC_ARG_ENABLE(music-mp3,
   172 [  --enable-music-mp3      enable MP3 music via smpeg [default=yes]],
   173               , enable_music_mp3=yes)
   174 if test x$enable_music_mp3 = xyes; then
   175     SMPEG_VERSION=0.4.3
   176     AM_PATH_SMPEG($SMPEG_VERSION, have_smpeg=yes, have_smpeg=no)
   177     if test x$have_smpeg = xyes; then
   178         CFLAGS="$CFLAGS -DMP3_MUSIC $SMPEG_CFLAGS"
   179         LIBS="$LIBS $SMPEG_LIBS"
   180     fi
   181 fi
   182 
   183 dnl Add Makefile conditionals
   184 AC_SUBST(MUSIC_SUBDIRS)
   185 AM_CONDITIONAL(USE_MIKMOD, test x$enable_music_mod = xyes)
   186 AM_CONDITIONAL(USE_TIMIDITY, test x$enable_music_timidity_midi = xyes)
   187 AM_CONDITIONAL(USE_NATIVE_MIDI, test x$use_music_native_midi = xyes)
   188 
   189 # Finally create all the generated files
   190 AC_OUTPUT([
   191 Makefile
   192 mikmod/Makefile
   193 timidity/Makefile
   194 native_midi/Makefile
   195 SDL_mixer.spec
   196 ])