configure.in
author Sam Lantinga <slouken@libsdl.org>
Sat, 03 May 2003 20:15:25 +0000
changeset 225 0ce0217441fc
parent 208 f505a60109ef
child 232 f974cb06ba25
permissions -rw-r--r--
Kyle Davenport - Sat, 19 Apr 2003 17:13:31 -0500
* Added .la files to the development RPM, fixing RPM build on RedHat 8
     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=6
    17 INTERFACE_AGE=4
    18 BINARY_AGE=6
    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_SYSTEM
    41 
    42 dnl Setup for automake
    43 AM_INIT_AUTOMAKE(SDL_mixer, $VERSION)
    44 
    45 dnl Check for tools
    46 
    47 AC_PROG_MAKE_SET
    48 AC_PROG_CC
    49 AC_LIBTOOL_WIN32_DLL
    50 AM_PROG_LIBTOOL
    51 AC_PROG_INSTALL
    52 
    53 dnl The alpha architecture needs special flags for binary portability
    54 case "$target" in
    55     alpha*-*-linux*)
    56         CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
    57         ;;
    58     *-*-beos*)
    59         ac_default_prefix=/boot/develop/tools/gnupro
    60         ;;
    61     *-*-cygwin* | *-*-mingw32*)
    62         if test "$build" != "$target"; then # cross-compiling
    63             # Default cross-compile location
    64             ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
    65         else
    66             # Look for the location of the tools and install there
    67             if [ "$BUILD_PREFIX" != "" ]; then
    68                 ac_default_prefix=$BUILD_PREFIX
    69             fi
    70         fi
    71         ;;
    72     *-*-darwin*)
    73         AC_DEFINE(MACOSX)
    74         ;;
    75     m68k-atari-mint*)
    76         CFLAGS="$CFLAGS -Dunix"
    77         ;;
    78 esac
    79 
    80 dnl Check for SDL
    81 SDL_VERSION=1.2.4
    82 AM_PATH_SDL($SDL_VERSION,
    83             :,
    84 	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
    85 )
    86 CFLAGS="$CFLAGS $SDL_CFLAGS"
    87 
    88 dnl Flag for using SDL_RWops
    89 dnl Matt Campbell (matt@campbellhome.dhs.org)
    90 CFLAGS="$CFLAGS -DUSE_RWOPS"
    91 
    92 dnl Check command-line options
    93 
    94 AC_ARG_ENABLE(music-cmd,
    95 [  --enable-music-cmd      support an external music player [default=yes]],
    96               , enable_music_cmd=yes)
    97 if test x$enable_music_cmd = xyes; then
    98     CFLAGS="$CFLAGS -DCMD_MUSIC"
    99 fi
   100 AC_ARG_ENABLE(music-wave,
   101 [  --enable-music-wave     enable streaming WAVE music [default=yes]],
   102               , enable_music_wave=yes)
   103 if test x$enable_music_wave = xyes; then
   104     CFLAGS="$CFLAGS -DWAV_MUSIC"
   105 fi
   106 AC_ARG_ENABLE(music-mod,
   107 [  --enable-music-mod      enable MOD music via mikmod [default=yes]],
   108               , enable_music_mod=yes)
   109 if test x$enable_music_mod = xyes; then
   110     CFLAGS="$CFLAGS -DMOD_MUSIC -I\$(top_srcdir)/mikmod"
   111     MUSIC_SUBDIRS="$MUSIC_SUBDIRS mikmod"
   112 fi
   113 AC_ARG_ENABLE(music-midi,
   114 [  --enable-music-midi     enable MIDI music via timidity [default=yes]],
   115               , enable_music_midi=yes)
   116 if test x$enable_music_midi = xyes; then
   117     CFLAGS="$CFLAGS -DMID_MUSIC"
   118     AC_ARG_ENABLE(music-timidity-midi,
   119 [  --enable-music-timidity-midi  enable timidity MIDI output [default=yes]],
   120                   , enable_music_timidity_midi=yes)
   121     if test x$enable_music_timidity_midi = xyes; then
   122         CFLAGS="$CFLAGS -DUSE_TIMIDITY_MIDI -I\$(top_srcdir)/timidity"
   123         MUSIC_SUBDIRS="$MUSIC_SUBDIRS timidity"
   124     fi
   125     AC_ARG_ENABLE(music-native-midi,
   126 [  --enable-music-native-midi  enable native MIDI music output [default=yes]],
   127                   , enable_music_native_midi=yes)
   128     if test x$enable_music_native_midi = xyes; then
   129         use_music_native_midi=no
   130         case "$target" in
   131             *-*-cygwin* | *-*-mingw32*)
   132                 use_music_native_midi=yes
   133                 SYSTEM_LIBS="$SYSTEM_LIBS -lwinmm"
   134                 ;;
   135             *-*-darwin*)
   136                 use_music_native_midi=yes
   137                 SYSTEM_LIBS="$SYSTEM_LIBS -framework QuickTime"
   138                 ;;
   139         esac
   140         if test x$use_music_native_midi = xyes; then
   141             CFLAGS="$CFLAGS -DUSE_NATIVE_MIDI -I\$(top_srcdir)/native_midi"
   142             MUSIC_SUBDIRS="$MUSIC_SUBDIRS native_midi"
   143         fi
   144     fi
   145     AC_ARG_ENABLE(music-native-midi-gpl,
   146 [  --enable-music-native-midi-gpl  enable native MIDI on UNIX using GPL code [default=no]],
   147                   , enable_music_native_midi_gpl=no)
   148     if test x$enable_music_native_midi_gpl = xyes; then
   149         use_music_native_midi_gpl=no
   150         case "$target" in
   151             *-*-linux* | *-*-freebsd*)
   152                 use_music_native_midi_gpl=yes
   153                 ;;
   154         esac
   155         if test x$use_music_native_midi_gpl = xyes; then
   156             CFLAGS="$CFLAGS -DUSE_NATIVE_MIDI -I\$(top_srcdir)/native_midi"
   157             MUSIC_SUBDIRS="$MUSIC_SUBDIRS native_midi_gpl"
   158         fi
   159     fi
   160 fi
   161 AC_ARG_ENABLE(music-ogg,
   162 [  --enable-music-ogg      enable Ogg Vorbis music [default=yes]],
   163               , enable_music_ogg=yes)
   164 if test x$enable_music_ogg = xyes; then
   165     AC_MSG_CHECKING(for Ogg Vorbis headers and libraries)
   166     have_vorbis=no
   167     AC_TRY_COMPILE([
   168      #include <vorbis/vorbisfile.h>
   169     ],[
   170     ],[
   171     have_vorbis=yes
   172     ])
   173     AC_MSG_RESULT($have_vorbis)
   174     if test x$have_vorbis = xyes; then
   175         CFLAGS="$CFLAGS -DOGG_MUSIC"
   176         SYSTEM_LIBS="$SYSTEM_LIBS -lvorbisfile -lvorbis -logg"
   177     fi
   178 fi
   179 AC_ARG_ENABLE(music-mp3,
   180 [  --enable-music-mp3      enable MP3 music via smpeg [default=yes]],
   181               , enable_music_mp3=yes)
   182 if test x$enable_music_mp3 = xyes; then
   183     SMPEG_VERSION=0.4.3
   184     AM_PATH_SMPEG($SMPEG_VERSION, have_smpeg=yes, have_smpeg=no)
   185     if test x$have_smpeg = xyes; then
   186         CFLAGS="$CFLAGS -DMP3_MUSIC $SMPEG_CFLAGS"
   187         SYSTEM_LIBS="$SYSTEM_LIBS $SMPEG_LIBS"
   188     fi
   189 fi
   190 
   191 dnl Add Makefile conditionals
   192 AC_SUBST(MUSIC_SUBDIRS)
   193 AM_CONDITIONAL(USE_MIKMOD, test x$enable_music_mod = xyes)
   194 AM_CONDITIONAL(USE_TIMIDITY, test x$enable_music_timidity_midi = xyes)
   195 AM_CONDITIONAL(USE_NATIVE_MIDI, test x$use_music_native_midi = xyes || test x$use_music_native_midi_gpl = xyes)
   196 AM_CONDITIONAL(USE_NATIVE_MIDI_GPL, test x$use_music_native_midi_gpl = xyes)
   197 
   198 dnl Expand the libraries needed for static and dynamic linking
   199 AC_SUBST(SYSTEM_LIBS)
   200 
   201 # Finally create all the generated files
   202 AC_OUTPUT([
   203 Makefile
   204 mikmod/Makefile
   205 timidity/Makefile
   206 native_midi/Makefile
   207 native_midi_gpl/Makefile
   208 SDL_mixer.spec
   209 ])