configure.in
author Sam Lantinga <slouken@lokigames.com>
Thu, 20 Jan 2000 05:44:29 +0000
changeset 38 d6f9745b780b
parent 37 7e477cb285c5
child 43 2ada52ee12e7
permissions -rw-r--r--
Added mixer rpm spec file, by Hakan Tandogan
     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=0
    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 Setup for automake
    40 AM_INIT_AUTOMAKE(SDL_mixer, $VERSION)
    41 
    42 dnl Check for tools
    43 
    44 AC_PROG_MAKE_SET
    45 AC_PROG_CC
    46 AC_LIBTOOL_WIN32_DLL
    47 AM_PROG_LIBTOOL
    48 AC_PROG_INSTALL
    49 
    50 dnl The alpha architecture needs special flags for binary portability
    51 AC_CANONICAL_TARGET
    52 case "$target" in
    53     alpha*-*-linux*)
    54         CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
    55         ;;
    56 esac
    57 
    58 dnl Check for SDL
    59 SDL_VERSION=1.0.1
    60 AM_PATH_SDL($SDL_VERSION,
    61             :,
    62 	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
    63 )
    64 CFLAGS="$CFLAGS $SDL_CFLAGS"
    65 LIBS="$LIBS $SDL_LIBS"
    66 
    67 dnl Check command-line options
    68 AC_ARG_ENABLE(music-cmd,
    69 [  --enable-music-cmd      support an external music player [default=yes]],
    70               , enable_music_cmd=yes)
    71 if test x$enable_music_cmd = xyes; then
    72     CFLAGS="$CFLAGS -DCMD_MUSIC"
    73 fi
    74 AC_ARG_ENABLE(music-wave,
    75 [  --enable-music-wave     enable streaming WAVE music [default=yes]],
    76               , enable_music_wave=yes)
    77 if test x$enable_music_wave = xyes; then
    78     CFLAGS="$CFLAGS -DWAV_MUSIC"
    79 fi
    80 AC_ARG_ENABLE(music-mod,
    81 [  --enable-music-mod      enable MOD music via mikmod [default=yes]],
    82               , enable_music_mod=yes)
    83 if test x$enable_music_mod = xyes; then
    84     CFLAGS="$CFLAGS -DMOD_MUSIC -I\$(top_srcdir)/mikmod"
    85     MUSIC_SUBDIRS="$MUSIC_SUBDIRS mikmod"
    86 fi
    87 AC_ARG_ENABLE(music-midi,
    88 [  --enable-music-midi     enable MIDI music via timidity [default=yes]],
    89               , enable_music_midi=yes)
    90 if test x$enable_music_midi = xyes; then
    91     CFLAGS="$CFLAGS -DMID_MUSIC -I\$(top_srcdir)/timidity"
    92     MUSIC_SUBDIRS="$MUSIC_SUBDIRS timidity"
    93 fi
    94 AC_ARG_ENABLE(music-mp3,
    95 [  --enable-music-mp3      enable MP3 music via smpeg [default=yes]],
    96               , enable_music_mp3=yes)
    97 if test x$enable_music_mp3 = xyes; then
    98     AC_MSG_CHECKING(for SMPEG headers and libraries)
    99     have_smpeg=no
   100     AC_TRY_COMPILE([
   101      #include <smpeg/smpeg.h>
   102     ],[
   103     ],[
   104     have_smpeg=yes
   105     ])
   106     AC_MSG_RESULT($have_smpeg)
   107     if test x$have_smpeg = xyes; then
   108         CFLAGS="$CFLAGS -DMP3_MUSIC"
   109         LIBS="$LIBS -lsmpeg"
   110     fi
   111 fi
   112 
   113 dnl Add Makefile conditionals
   114 AC_SUBST(MUSIC_SUBDIRS)
   115 AM_CONDITIONAL(USE_MIKMOD, test x$enable_music_mod = xyes)
   116 AM_CONDITIONAL(USE_TIMIDITY, test x$enable_music_midi = xyes)
   117 
   118 # Finally create all the generated files
   119 AC_OUTPUT([
   120 Makefile
   121 mikmod/Makefile
   122 timidity/Makefile
   123 SDL_mixer.spec
   124 ])