Fixed bug 1604 - Ogg support detection in static mode
authorSam Lantinga <slouken@libsdl.org>
Wed, 26 Sep 2012 20:34:50 -0700
changeset 5920aadc9b6daac
parent 591 b183a96c627f
child 593 3cbdd1e100b7
Fixed bug 1604 - Ogg support detection in static mode

Gabriel Jacobo 2012-09-20 16:01:32 PDT

When --disable-music-ogg-shared the OGG tests fail when they should pass.
Attached is a crude patch that gets them working (though the changes done to
configure.in, inside AC_CHECK_LIB, will produce ugly status string such as
"checking for ov_open_callbacks in -lvorbisidec -logg", which is mostly a
aesthetic concern)
configure
configure.in
     1.1 --- a/configure	Tue Sep 04 23:17:23 2012 -0700
     1.2 +++ b/configure	Wed Sep 26 20:34:50 2012 -0700
     1.3 @@ -13339,7 +13339,7 @@
     1.4    echo $ECHO_N "(cached) $ECHO_C" >&6
     1.5  else
     1.6    ac_check_lib_save_LIBS=$LIBS
     1.7 -LIBS="-lvorbisidec  $LIBS"
     1.8 +LIBS="-lvorbisidec -logg $LIBS"
     1.9  cat >conftest.$ac_ext <<_ACEOF
    1.10  /* confdefs.h.  */
    1.11  _ACEOF
    1.12 @@ -13425,7 +13425,7 @@
    1.13                  echo "-- dynamic libvorbisidec -> $ogg_lib"
    1.14                  EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\""
    1.15              else
    1.16 -                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisidec -lvorbis"
    1.17 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisidec -lvorbis -logg"
    1.18              fi
    1.19          else
    1.20              { echo "$as_me:$LINENO: WARNING: *** Unable to find Ogg Vorbis Tremor library (http://www.xiph.org/)" >&5
    1.21 @@ -13570,7 +13570,7 @@
    1.22    echo $ECHO_N "(cached) $ECHO_C" >&6
    1.23  else
    1.24    ac_check_lib_save_LIBS=$LIBS
    1.25 -LIBS="-lvorbisfile  $LIBS"
    1.26 +LIBS="-lvorbisfile -lvorbis -logg -lm $LIBS"
    1.27  cat >conftest.$ac_ext <<_ACEOF
    1.28  /* confdefs.h.  */
    1.29  _ACEOF
    1.30 @@ -13650,7 +13650,7 @@
    1.31                  echo "-- dynamic libvorbisfile -> $ogg_lib"
    1.32                  EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\""
    1.33              else
    1.34 -                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisfile -lvorbis"
    1.35 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisfile -lvorbis -logg -lm"
    1.36              fi
    1.37          else
    1.38              { echo "$as_me:$LINENO: WARNING: *** Unable to find Ogg Vorbis library (http://www.xiph.org/)" >&5
     2.1 --- a/configure.in	Tue Sep 04 23:17:23 2012 -0700
     2.2 +++ b/configure.in	Wed Sep 26 20:34:50 2012 -0700
     2.3 @@ -429,7 +429,7 @@
     2.4  if test x$enable_music_ogg = xyes; then
     2.5      if test x$enable_music_ogg_tremor = xyes; then
     2.6          AC_CHECK_HEADER([tremor/ivorbisfile.h], [have_tremor_hdr=yes])
     2.7 -        AC_CHECK_LIB([vorbisidec], [ov_open_callbacks], [have_tremor_lib=yes])
     2.8 +        AC_CHECK_LIB([vorbisidec -logg], [ov_open_callbacks], [have_tremor_lib=yes])
     2.9          if test x$have_tremor_hdr = xyes -a x$have_tremor_lib = xyes; then
    2.10              case "$host" in
    2.11                  *-*-darwin*)
    2.12 @@ -465,7 +465,7 @@
    2.13          fi
    2.14      else
    2.15          AC_CHECK_HEADER([vorbis/vorbisfile.h], [have_ogg_hdr=yes])
    2.16 -        AC_CHECK_LIB([vorbisfile], [ov_open_callbacks], [have_ogg_lib=yes])
    2.17 +        AC_CHECK_LIB([vorbisfile -lvorbis -logg -lm], [ov_open_callbacks], [have_ogg_lib=yes])
    2.18          if test x$have_ogg_hdr = xyes -a x$have_ogg_lib = xyes; then
    2.19              case "$host" in
    2.20                  *-*-darwin*)
    2.21 @@ -487,7 +487,7 @@
    2.22                  echo "-- dynamic libvorbisfile -> $ogg_lib"
    2.23                  EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\""
    2.24              else
    2.25 -                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisfile -lvorbis"
    2.26 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisfile -lvorbis -logg -lm"
    2.27              fi
    2.28          else
    2.29              AC_MSG_WARN([*** Unable to find Ogg Vorbis library (http://www.xiph.org/)])