AC_SUBST(core_audio_ldflags)
AC_DEFINE(HAVE_CORE_AUDIO, 1, define to 1 on Mac Os X)
fi
+########################################################################### ogg
+STASH_FLAGS
+LIB_ARG_WITH([ogg], [-logg])
+HAVE_OGG=yes
+AC_CHECK_HEADERS([ogg/ogg.h], [], [HAVE_OGG=no])
+AC_CHECK_LIB([ogg], [ogg_stream_init], [], [HAVE_OGG=no])
+LIB_SUBST_FLAGS(ogg)
+UNSTASH_FLAGS
####################################################### ogg/vorbis/speex/opus
-have_ogg="yes"
-OLD_CPPFLAGS="$CPPFLAGS"
-OLD_LDFLAGS="$LDFLAGS"
-OLD_LIBS="$LIBS"
-AC_ARG_WITH(ogg_headers, [AS_HELP_STRING(--with-ogg-headers=dir,
- [look for ogg headers also in dir])])
-AC_ARG_WITH(ogg_libs, [AS_HELP_STRING(--with-ogg-libs=dir,
- [look for ogg libs also in dir])])
AC_ARG_WITH(vorbis_headers, [AS_HELP_STRING(--with-vorbis-headers=dir,
[look for vorbis headers also in dir])])
AC_ARG_WITH(vorbis_libs, [AS_HELP_STRING(--with-vorbis-libs=dir,
AC_ARG_WITH(opus_libs, [AS_HELP_STRING(--with-opus-libs=dir,
[look for opus libs also in dir])])
-if test -n "$with_ogg_headers"; then
- ogg_cppflags="-I$with_ogg_headers"
- CPPFLAGS="$CPPFLAGS $ogg_cppflags"
-fi
-if test -n "$with_ogg_libs"; then
- ogg_libs="-L$with_ogg_libs"
- LDFLAGS="$LDFLAGS $ogg_libs"
-fi
-AC_CHECK_HEADERS([ogg/ogg.h], [], [ have_ogg="no"; ])
-AC_CHECK_LIB([ogg], [ogg_stream_init], [], [ have_ogg="no" ])
-CPPFLAGS="$OLD_CPPFLAGS"
-LDFLAGS="$OLD_LDFLAGS"
-LIBS="$OLD_LIBS"
-
have_vorbis="yes"
have_speex="yes"
have_opus="yes"
-if test "$have_ogg" = "yes"; then
+if test "$HAVE_OGG" = 'yes'; then
OLD_CPPFLAGS="$CPPFLAGS"
OLD_LDFLAGS="$LDFLAGS"
OLD_LIBS="$LIBS"