configure.in
author Sam Lantinga <slouken@libsdl.org>
Sun, 26 Jan 2003 11:41:37 +0000
changeset 206 1b18a75ee35b
parent 182 9e494f7db8d1
child 208 f505a60109ef
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=5
    17 INTERFACE_AGE=3
    18 BINARY_AGE=5
    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.4
    80 AM_PATH_SDL($SDL_VERSION,
    81             :,
    82 	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
    83 )
    84 CFLAGS="$CFLAGS $SDL_CFLAGS"
    85 
    86 dnl Flag for using SDL_RWops
    87 dnl Matt Campbell (matt@campbellhome.dhs.org)
    88 CFLAGS="$CFLAGS -DUSE_RWOPS"
    89 
    90 dnl Check command-line options
    91 
    92 AC_ARG_ENABLE(music-cmd,
    93 [  --enable-music-cmd      support an external music player [default=yes]],
    94               , enable_music_cmd=yes)
    95 if test x$enable_music_cmd = xyes; then
    96     CFLAGS="$CFLAGS -DCMD_MUSIC"
    97 fi
    98 AC_ARG_ENABLE(music-wave,
    99 [  --enable-music-wave     enable streaming WAVE music [default=yes]],
   100               , enable_music_wave=yes)
   101 if test x$enable_music_wave = xyes; then
   102     CFLAGS="$CFLAGS -DWAV_MUSIC"
   103 fi
   104 AC_ARG_ENABLE(music-mod,
   105 [  --enable-music-mod      enable MOD music via mikmod [default=yes]],
   106               , enable_music_mod=yes)
   107 if test x$enable_music_mod = xyes; then
   108     CFLAGS="$CFLAGS -DMOD_MUSIC -I\$(top_srcdir)/mikmod"
   109     MUSIC_SUBDIRS="$MUSIC_SUBDIRS mikmod"
   110 fi
   111 AC_ARG_ENABLE(music-midi,
   112 [  --enable-music-midi     enable MIDI music via timidity [default=yes]],
   113               , enable_music_midi=yes)
   114 if test x$enable_music_midi = xyes; then
   115     CFLAGS="$CFLAGS -DMID_MUSIC"
   116     AC_ARG_ENABLE(music-timidity-midi,
   117 [  --enable-music-timidity-midi  enable timidity MIDI output [default=yes]],
   118                   , enable_music_timidity_midi=yes)
   119     if test x$enable_music_timidity_midi = xyes; then
   120         CFLAGS="$CFLAGS -DUSE_TIMIDITY_MIDI -I\$(top_srcdir)/timidity"
   121         MUSIC_SUBDIRS="$MUSIC_SUBDIRS timidity"
   122     fi
   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                 SYSTEM_LIBS="$SYSTEM_LIBS -lwinmm"
   132                 ;;
   133             *-*-darwin*)
   134                 use_music_native_midi=yes
   135                 SYSTEM_LIBS="$SYSTEM_LIBS -framework QuickTime"
   136                 ;;
   137         esac
   138         if test x$use_music_native_midi = xyes; then
   139             CFLAGS="$CFLAGS -DUSE_NATIVE_MIDI -I\$(top_srcdir)/native_midi"
   140             MUSIC_SUBDIRS="$MUSIC_SUBDIRS native_midi"
   141         fi
   142     fi
   143     AC_ARG_ENABLE(music-native-midi-gpl,
   144 [  --enable-music-native-midi-gpl  enable native MIDI on UNIX using GPL code [default=no]],
   145                   , enable_music_native_midi_gpl=no)
   146     if test x$enable_music_native_midi_gpl = xyes; then
   147         use_music_native_midi_gpl=no
   148         case "$target" in
   149             *-*-linux* | *-*-freebsd*)
   150                 use_music_native_midi_gpl=yes
   151                 ;;
   152         esac
   153         if test x$use_music_native_midi_gpl = xyes; then
   154             CFLAGS="$CFLAGS -DUSE_NATIVE_MIDI -I\$(top_srcdir)/native_midi"
   155             MUSIC_SUBDIRS="$MUSIC_SUBDIRS native_midi_gpl"
   156         fi
   157     fi
   158 fi
   159 AC_ARG_ENABLE(music-ogg,
   160 [  --enable-music-ogg      enable Ogg Vorbis music [default=yes]],
   161               , enable_music_ogg=yes)
   162 if test x$enable_music_ogg = xyes; then
   163     AC_MSG_CHECKING(for Ogg Vorbis headers and libraries)
   164     have_vorbis=no
   165     AC_TRY_COMPILE([
   166      #include <vorbis/vorbisfile.h>
   167     ],[
   168     ],[
   169     have_vorbis=yes
   170     ])
   171     AC_MSG_RESULT($have_vorbis)
   172     if test x$have_vorbis = xyes; then
   173         CFLAGS="$CFLAGS -DOGG_MUSIC"
   174         SYSTEM_LIBS="$SYSTEM_LIBS -lvorbisfile -lvorbis -logg"
   175     fi
   176 fi
   177 AC_ARG_ENABLE(music-mp3,
   178 [  --enable-music-mp3      enable MP3 music via smpeg [default=yes]],
   179               , enable_music_mp3=yes)
   180 if test x$enable_music_mp3 = xyes; then
   181     SMPEG_VERSION=0.4.3
   182     AM_PATH_SMPEG($SMPEG_VERSION, have_smpeg=yes, have_smpeg=no)
   183     if test x$have_smpeg = xyes; then
   184         CFLAGS="$CFLAGS -DMP3_MUSIC $SMPEG_CFLAGS"
   185         SYSTEM_LIBS="$SYSTEM_LIBS $SMPEG_LIBS"
   186     fi
   187 fi
   188 
   189 dnl Add Makefile conditionals
   190 AC_SUBST(MUSIC_SUBDIRS)
   191 AM_CONDITIONAL(USE_MIKMOD, test x$enable_music_mod = xyes)
   192 AM_CONDITIONAL(USE_TIMIDITY, test x$enable_music_timidity_midi = xyes)
   193 AM_CONDITIONAL(USE_NATIVE_MIDI, test x$use_music_native_midi = xyes || test x$use_music_native_midi_gpl = xyes)
   194 AM_CONDITIONAL(USE_NATIVE_MIDI_GPL, test x$use_music_native_midi_gpl = xyes)
   195 
   196 dnl Expand the libraries needed for static and dynamic linking
   197 AC_SUBST(SYSTEM_LIBS)
   198 
   199 # Finally create all the generated files
   200 AC_OUTPUT([
   201 Makefile
   202 mikmod/Makefile
   203 timidity/Makefile
   204 native_midi/Makefile
   205 native_midi_gpl/Makefile
   206 SDL_mixer.spec
   207 ])