configure.in
changeset 312 8a536296ef3d
parent 308 02f1dc41d4e7
child 313 db79bfffb09b
     1.1 --- a/configure.in	Fri May 12 02:58:31 2006 +0000
     1.2 +++ b/configure.in	Fri May 12 06:14:15 2006 +0000
     1.3 @@ -109,16 +109,16 @@
     1.4  
     1.5  dnl Check command-line options
     1.6  
     1.7 -AC_ARG_ENABLE(music-cmd,
     1.8 -[  --enable-music-cmd      support an external music player [default=yes]],
     1.9 -              , enable_music_cmd=yes)
    1.10 +AC_ARG_ENABLE([music-cmd],
    1.11 +AC_HELP_STRING([--enable-music-cmd], [support an external music player [[default=yes]]]),
    1.12 +              [], [enable_music_cmd=yes])
    1.13  if test x$enable_music_cmd = xyes; then
    1.14      SOURCES="$SOURCES $srcdir/music_cmd.c"
    1.15      EXTRA_CFLAGS="$EXTRA_CFLAGS -DCMD_MUSIC"
    1.16  fi
    1.17 -AC_ARG_ENABLE(music-wave,
    1.18 -[  --enable-music-wave     enable streaming WAVE music [default=yes]],
    1.19 -              , enable_music_wave=yes)
    1.20 +AC_ARG_ENABLE([music-wave],
    1.21 +AC_HELP_STRING([--enable-music-wave], [enable streaming WAVE music [[default=yes]]]),
    1.22 +              [], [enable_music_wave=yes])
    1.23  if test x$enable_music_wave = xyes; then
    1.24      SOURCES="$SOURCES $srcdir/wavestream.c"
    1.25      EXTRA_CFLAGS="$EXTRA_CFLAGS -DWAV_MUSIC"
    1.26 @@ -128,9 +128,9 @@
    1.27  libmikmod_min=1
    1.28  libmikmod_rev=10
    1.29  libmikmod_ver="$libmikmod_maj.$libmikmod_min.$libmikmod_rev"
    1.30 -AC_ARG_ENABLE(music-libmikmod,
    1.31 -[  --enable-music-libmikmod  enable MOD music via external libmikmod [default=no]],
    1.32 -              , enable_music_libmikmod=no)
    1.33 +AC_ARG_ENABLE([music-libmikmod],
    1.34 +AC_HELP_STRING([--enable-music-libmikmod], [enable MOD music via external libmikmod [[default=no]]]),
    1.35 +              [], [enable_music_libmikmod=no])
    1.36  if test x$enable_music_libmikmod = xyes; then
    1.37  	AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no, [$PATH])
    1.38  	if test "$LIBMIKMOD_CONFIG" != "no" ; then
    1.39 @@ -160,28 +160,28 @@
    1.40  	fi
    1.41  fi
    1.42  
    1.43 -AC_ARG_ENABLE(music-mod,
    1.44 -[  --enable-music-mod      enable MOD music via mikmod [default=yes]],
    1.45 -, enable_music_mod=$no_libmikmod)
    1.46 +AC_ARG_ENABLE([music-mod],
    1.47 +AC_HELP_STRING([--enable-music-mod], [enable MOD music via mikmod [[default=yes]]]),
    1.48 +              [], [enable_music_mod=$no_libmikmod])
    1.49  if test x$enable_music_mod = xyes; then
    1.50      EXTRA_CFLAGS="$EXTRA_CFLAGS -DMOD_MUSIC -I\$(srcdir)/mikmod"
    1.51      SOURCES="$SOURCES $srcdir/mikmod/*.c"
    1.52  fi
    1.53 -AC_ARG_ENABLE(music-midi,
    1.54 -[  --enable-music-midi     enable MIDI music via timidity [default=yes]],
    1.55 -              , enable_music_midi=yes)
    1.56 +AC_ARG_ENABLE([music-midi],
    1.57 +AC_HELP_STRING([--enable-music-midi], [enable MIDI music via timidity [[default=yes]]]),
    1.58 +              [], [enable_music_midi=yes])
    1.59  if test x$enable_music_midi = xyes; then
    1.60      EXTRA_CFLAGS="$EXTRA_CFLAGS -DMID_MUSIC"
    1.61 -    AC_ARG_ENABLE(music-timidity-midi,
    1.62 -[  --enable-music-timidity-midi  enable timidity MIDI output [default=yes]],
    1.63 -                  , enable_music_timidity_midi=yes)
    1.64 +    AC_ARG_ENABLE([music-timidity-midi],
    1.65 +AC_HELP_STRING([--enable-music-timidity-midi], [enable timidity MIDI output [[default=yes]]]),
    1.66 +                  [], [enable_music_timidity_midi=yes])
    1.67      if test x$enable_music_timidity_midi = xyes; then
    1.68          EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_TIMIDITY_MIDI -I\$(srcdir)/timidity"
    1.69          SOURCES="$SOURCES $srcdir/timidity/*.c"
    1.70      fi
    1.71 -    AC_ARG_ENABLE(music-native-midi,
    1.72 -[  --enable-music-native-midi  enable native MIDI music output [default=yes]],
    1.73 -                  , enable_music_native_midi=yes)
    1.74 +    AC_ARG_ENABLE([music-native-midi],
    1.75 +AC_HELP_STRING([--enable-music-native-midi], [enable native MIDI music output [[default=yes]]]),
    1.76 +                  [], [enable_music_native_midi=yes])
    1.77      if test x$enable_music_native_midi = xyes; then
    1.78          use_music_native_midi=no
    1.79          case "$host" in
    1.80 @@ -199,9 +199,9 @@
    1.81              SOURCES="$SOURCES $srcdir/native_midi/*.c"
    1.82          fi
    1.83      fi
    1.84 -    AC_ARG_ENABLE(music-native-midi-gpl,
    1.85 -[  --enable-music-native-midi-gpl  enable native MIDI on UNIX using GPL code [default=no]],
    1.86 -                  , enable_music_native_midi_gpl=no)
    1.87 +    AC_ARG_ENABLE([music-native-midi-gpl],
    1.88 +AC_HELP_STRING([--enable-music-native-midi-gpl], [enable native MIDI on UNIX using GPL code [[default=no]]]),
    1.89 +                  [], [enable_music_native_midi_gpl=no])
    1.90      if test x$enable_music_native_midi_gpl = xyes; then
    1.91          use_music_native_midi_gpl=no
    1.92          case "$host" in
    1.93 @@ -215,9 +215,9 @@
    1.94          fi
    1.95      fi
    1.96  fi
    1.97 -AC_ARG_ENABLE(music-ogg,
    1.98 -[  --enable-music-ogg      enable Ogg Vorbis music [default=yes]],
    1.99 -              , enable_music_ogg=yes)
   1.100 +AC_ARG_ENABLE([music-ogg],
   1.101 +AC_HELP_STRING([--enable-music-ogg], [enable Ogg Vorbis music [[default=yes]]]),
   1.102 +              [], [enable_music_ogg=yes])
   1.103  if test x$enable_music_ogg = xyes; then
   1.104      AC_MSG_CHECKING(for Ogg Vorbis headers and libraries)
   1.105      have_vorbis=no
   1.106 @@ -229,13 +229,36 @@
   1.107      ])
   1.108      AC_MSG_RESULT($have_vorbis)
   1.109      if test x$have_vorbis = xyes; then
   1.110 -        SOURCES="$SOURCES $srcdir/load_ogg.c $srcdir/music_ogg.c"
   1.111 +        AC_ARG_ENABLE([music-ogg-shared],
   1.112 +AC_HELP_STRING([--enable-music-ogg-shared], [dynamically load Ogg Vorbis support [[default=yes]]]),
   1.113 +                      [], [enable_music_ogg_shared=yes])
   1.114 +        case "$host" in
   1.115 +            *-*-darwin*) # FIXME when Mac OS X ships with Ogg Vorbis
   1.116 +                ogg_lib=''
   1.117 +                ;;
   1.118 +            *-*-cygwin* | *-*-mingw32*)
   1.119 +                ogg_lib='vorbisfile.dll'
   1.120 +                ;;
   1.121 +            *)
   1.122 +                for path in /usr/lib /usr/local/lib; do
   1.123 +                    if test x$ogg_lib = x; then
   1.124 +                        ogg_lib=[`ls -- $path/libvorbisfile.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   1.125 +                    fi
   1.126 +                done
   1.127 +                ;;
   1.128 +        esac
   1.129 +        SOURCES="$SOURCES $srcdir/*_ogg.c"
   1.130          EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_MUSIC"
   1.131 -        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisfile -lvorbis -logg"
   1.132 +        if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then
   1.133 +            echo "-- dynamic libvorbisfile -> $ogg_lib"
   1.134 +            EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\""
   1.135 +        else
   1.136 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisfile -lvorbis -logg"
   1.137 +        fi
   1.138      fi
   1.139  fi
   1.140  AC_ARG_ENABLE(music-mp3,
   1.141 -[  --enable-music-mp3      enable MP3 music via smpeg [default=yes]],
   1.142 +[  --enable-music-mp3      enable MP3 music via smpeg [[default=yes]]],
   1.143                , enable_music_mp3=yes)
   1.144  if test x$enable_music_mp3 = xyes; then
   1.145      SMPEG_VERSION=0.4.3