[vorbis-dev] patch for FLAC
Thomas Vander Stichele
thomas at urgent.rug.ac.be
Wed Sep 11 12:05:04 PDT 2002
Hey,
Sesse asked me to do a patch to the auto* set-up to allow for FLAC to be
added.
The patch touches configure.in and oggenc/Makefile.am
It is disabled by default, use --enable-flac as an arg to configure
to enable it.
You might want to maybe add more checks, since FLAC's API tends to change
more than is good for anyone ;)
Hope that helps,
Thomas
--
The Dave/Dina Project : future TV today ! - http://davedina.apestaart.org/
<-*- -*->
If lovin' you is wrong
then I don't wanna be right
<-*- thomas at apestaart.org -*->
URGent, the best radio on the Internet - 24/7 ! - http://urgent.rug.ac.be/
-------------- next part --------------
Index: configure.in
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/configure.in,v
retrieving revision 1.44
diff -u -p -r1.44 configure.in
--- configure.in 11 Jul 2002 14:10:34 -0000 1.44
+++ configure.in 11 Sep 2002 18:59:44 -0000
@@ -122,6 +122,35 @@ if test "x$build_ogg123" = xyes; then
fi
dnl --------------------------------------------------
+dnl Check for optional libraries
+dnl --------------------------------------------------
+
+dnl check for FLAC
+dnl disabled by default
+dnl defines HAVE_FLAC to 1 for use in source code
+dnl sets FLAC_LIBS to the right libs if found for Makefile.am
+dnl sets HAVE_FLAC to yes or no for Makefile.am
+
+AC_ARG_ENABLE(flac, [ --enable-flac Build in FLAC support],
+ use_flac="$enableval", use_flac="no")
+have_flac="no"
+if test "x$use_flac" = xyes; then
+
+ AC_CHECK_LIB(FLAC, FLAC__stream_decoder_new, have_flac=yes, have_flac=no, -lm)
+ AC_CHECK_HEADER(FLAC/all.h, have_flac=yes, have_flac=no)
+
+ if test "x$have_flac" = xyes; then
+ AC_MSG_RESULT([checked for FLAC, found.])
+ FLAC_LIBS="-lflac"
+ AC_DEFINE(HAVE_FLAC, 1, [whether FLAC should be used or not])
+ else
+ AC_MSG_RESULT([checked for FLAC, not found or not usable.])
+ fi
+fi
+AC_SUBST(FLAC_LIBS)
+AC_SUBST(HAVE_FLAC, $have_flac)
+
+dnl --------------------------------------------------
dnl Check for library functions
dnl --------------------------------------------------
Index: oggenc/Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggenc/Makefile.am,v
retrieving revision 1.21
diff -u -p -r1.21 Makefile.am
--- oggenc/Makefile.am 11 Jul 2002 02:45:38 -0000 1.21
+++ oggenc/Makefile.am 11 Sep 2002 18:59:45 -0000
@@ -19,7 +19,7 @@ INCLUDES = @SHARE_CFLAGS@ @OGG_CFLAGS@ @
oggenc_LDADD = @SHARE_LIBS@ \
@VORBISENC_LIBS@ @VORBIS_LIBS@ @OGG_LIBS@ \
- @LIBICONV@ @I18N_LIBS@
+ @LIBICONV@ @I18N_LIBS@ @FLAC_LIBS@
oggenc_DEPENDENCIES = @SHARE_LIBS@
oggenc_SOURCES = $(oggencsources)
More information about the Vorbis-dev
mailing list