configure.in
author Sam Lantinga <slouken@libsdl.org>
Mon, 14 Jan 2002 19:35:45 +0000
changeset 158 954c719d0359
parent 154 f1a9d3e178d3
child 160 c62666b42573
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=3
    17 INTERFACE_AGE=1
    18 BINARY_AGE=3
    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 AC_ARG_ENABLE(music-cmd,
    94 [  --enable-music-cmd      support an external music player [default=yes]],
    95               , enable_music_cmd=yes)
    96 if test x$enable_music_cmd = xyes; then
    97     CFLAGS="$CFLAGS -DCMD_MUSIC"
    98 fi
    99 AC_ARG_ENABLE(music-wave,
   100 [  --enable-music-wave     enable streaming WAVE music [default=yes]],
   101               , enable_music_wave=yes)
   102 if test x$enable_music_wave = xyes; then
   103     CFLAGS="$CFLAGS -DWAV_MUSIC"
   104 fi
   105 AC_ARG_ENABLE(music-mod,
   106 [  --enable-music-mod      enable MOD music via mikmod [default=yes]],
   107               , enable_music_mod=yes)
   108 if test x$enable_music_mod = xyes; then
   109     CFLAGS="$CFLAGS -DMOD_MUSIC -I\$(top_srcdir)/mikmod"
   110     MUSIC_SUBDIRS="$MUSIC_SUBDIRS mikmod"
   111 fi
   112 AC_ARG_ENABLE(music-midi,
   113 [  --enable-music-midi     enable MIDI music via timidity [default=yes]],
   114               , enable_music_midi=yes)
   115 if test x$enable_music_midi = xyes; then
   116     CFLAGS="$CFLAGS -DMID_MUSIC"
   117     AC_ARG_ENABLE(music-timidity-midi,
   118 [  --enable-music-timidity-midi  enable timidity MIDI output [default=yes]],
   119                   , enable_music_timidity_midi=yes)
   120     if test x$enable_music_timidity_midi = xyes; then
   121         CFLAGS="$CFLAGS -DUSE_TIMIDITY_MIDI -I\$(top_srcdir)/timidity"
   122         MUSIC_SUBDIRS="$MUSIC_SUBDIRS timidity"
   123     fi
   124     AC_ARG_ENABLE(music-native-midi,
   125 [  --enable-music-native-midi  enable native MIDI music output [default=yes]],
   126                   , enable_music_native_midi=yes)
   127     if test x$enable_music_native_midi = xyes; then
   128         use_music_native_midi=no
   129         case "$target" in
   130             *-*-cygwin* | *-*-mingw32*)
   131                 use_music_native_midi=yes
   132                 LIBS="$LIBS -lwinmm"
   133                 ;;
   134             *-*-darwin*)
   135                 use_music_native_midi=yes
   136                 LIBS="$LIBS -framework QuickTime"
   137                 ;;
   138         esac
   139         if test x$use_music_native_midi = xyes; then
   140             CFLAGS="$CFLAGS -DUSE_NATIVE_MIDI -I\$(top_srcdir)/native_midi"
   141             MUSIC_SUBDIRS="$MUSIC_SUBDIRS native_midi"
   142         fi
   143     fi
   144 fi
   145 AC_ARG_ENABLE(music-ogg,
   146 [  --enable-music-ogg      enable Ogg Vorbis music [default=yes]],
   147               , enable_music_ogg=yes)
   148 if test x$enable_music_ogg = xyes; then
   149     AC_MSG_CHECKING(for Ogg Vorbis headers and libraries)
   150     have_vorbis=no
   151     AC_TRY_COMPILE([
   152      #include <vorbis/vorbisfile.h>
   153     ],[
   154     ],[
   155     have_vorbis=yes
   156     ])
   157     AC_MSG_RESULT($have_vorbis)
   158     if test x$have_vorbis = xyes; then
   159         CFLAGS="$CFLAGS -DOGG_MUSIC"
   160         LIBS="$LIBS -lvorbisfile -lvorbis -logg"
   161     fi
   162 fi
   163 AC_ARG_ENABLE(music-mp3,
   164 [  --enable-music-mp3      enable MP3 music via smpeg [default=yes]],
   165               , enable_music_mp3=yes)
   166 if test x$enable_music_mp3 = xyes; then
   167     SMPEG_VERSION=0.4.3
   168     AM_PATH_SMPEG($SMPEG_VERSION, have_smpeg=yes, have_smpeg=no)
   169     if test x$have_smpeg = xyes; then
   170         CFLAGS="$CFLAGS -DMP3_MUSIC $SMPEG_CFLAGS"
   171         LIBS="$LIBS $SMPEG_LIBS"
   172     fi
   173 fi
   174 
   175 dnl Add Makefile conditionals
   176 AC_SUBST(MUSIC_SUBDIRS)
   177 AM_CONDITIONAL(USE_MIKMOD, test x$enable_music_mod = xyes)
   178 AM_CONDITIONAL(USE_TIMIDITY, test x$enable_music_timidity_midi = xyes)
   179 AM_CONDITIONAL(USE_NATIVE_MIDI, test x$use_music_native_midi = xyes)
   180 
   181 # Finally create all the generated files
   182 AC_OUTPUT([
   183 Makefile
   184 mikmod/Makefile
   185 timidity/Makefile
   186 native_midi/Makefile
   187 SDL_mixer.spec
   188 ])