From: Dudy K. <ko...@gm...> - 2009-04-17 13:15:50
|
Hi Todd, Thanks for the heads up regarding the summary and conflict markers, but I don't like the other changes and I'll tell you why: 1. Currently, we still need libid3tag since your changes require it, so it won't compile otherwise... 2. It's simpler to redefine something to a different value for debugging code segments than undef\define (easier to follow) 3. I still need to redefine frame IDs that exist in id3tag's headers. (which is not urgent since we still need it for your changes) I have commited a new version of the configure.in that should work. I want someone else to test all this autofoo stuff, both with taglib, un-patched taglib, and patched taglib. (BTW, you need to install only the C bindings dir, not the entire library, so patches made by the destributer still apply on the lib itself) Regarding the relocation, I agree, if you find it all of this working for you, you are welcome to move this to the proper place (which is after libid3tag tests, because taglib tests are heavier and it won't work without libid3tag. Thanks again, David On Fri, Apr 17, 2009 at 2:29 PM, Todd Zullinger <tm...@po...> wrote: > --- > > Dudy, > > How about this? It cleans up some small issues with the autofoo for > the taglib checks and only checks for libid3tag (which, BTW, is not > the same as id3lib) when taglib support is not being used. > > Since the AC_DEFINE will only define HAVE_TAGLIB to 1, I also changed > the #if HAVE_TAGLIB==2, and similar tests to use #ifdef HAVE_TAGLIB. > > Also, some conflict markers slipped into the last checkin (the > <<<<<<<, =======, and >>>>>>>). If you use git, there's a very handy > option for git diff, which can let you know about such problems (git > diff --check). The $have_tablig printed at the end of configure was > also lost in the last checkin, and is restored with this patch. > > If this looks good, I'll commit it after I sleep for a while. :) > > One change I'll probably make on top of this as well is to move the > taglib checking closer to where the other checks are in configure.in. > I avoided doing that in this patch because it would make it harder to > see what I've actually changed. > > I've only tested this briefly using libid3tag, but not with taglib, as > I haven't built a patched taglib yet. > > configure.in | 41 ++++++++++++++++++----------------------- > src/mp3file.c | 31 ++++++++++++++++--------------- > 2 files changed, 34 insertions(+), 38 deletions(-) > > diff --git a/configure.in b/configure.in > index 957c314..53c4e6d 100644 > --- a/configure.in > +++ b/configure.in > @@ -50,34 +50,32 @@ PKG_CHECK_MODULES(LIBGPOD, libgpod-1.0 >= 0.7.0,, > [AC_MSG_FAILURE([*** $LIBGPOD_ > CFLAGS="$CFLAGS $GTK_CFLAGS $GLIB_CFLAGS $GMODULE_CFLAGS $GTHREAD_CFLAGS > $LIBGLADE_CFLAGS $LIBGPOD_CFLAGS" > LIBS="$LIBS $GTK_LIBS $GLIB_LIBS $GMODULE_LIBS $GTHREAD_LIBS > $LIBGLADE_LIBS $LIBGPOD_LIBS" > > -<<<<<<< HEAD:gtkpod/trunk/configure.in > -======= > dnl Check for TagLib's C bindings > -AC_ARG_WITH(taglib, AC_HELP_STRING([--without-taglib],[Disable TagLib, use > only id3lib (has problems writing tags)])) > +AC_ARG_WITH(taglib, AC_HELP_STRING([--without-taglib],[Disable TagLib, use > libid3tag])) > if test "x$with_taglib" != "xno"; then > - PKG_CHECK_MODULES(TAGLIB_C, taglib_c, have_taglib_pkg=yes, > have_taglib_pkg=no) > - if test "x$with_taglib" = "xyes" -a "x$have_taglib_pkg" = "xno"; then > + PKG_CHECK_MODULES(TAGLIB_C, taglib_c, have_taglib=yes, have_taglib=no) > + if test "x$with_taglib" = "xyes" -a "x$have_taglib" = "xno"; then > AC_MSG_ERROR([TagLib support explicitly requested but TagLib > couldn't be found]) > fi > fi > -AM_CONDITIONAL(HAVE_TAGLIB, test "x$have_taglib_pkg" = "xyes") > -if test "x$have_taglib_pkg" = "xyes"; then > - OLD_CFLAGS="$CFLAGS" > +AM_CONDITIONAL(HAVE_TAGLIB, test "x$have_taglib" = "xyes") > +if test "x$have_taglib" = "xyes"; then > + # When a newer taglib is released, this check can be removed and we > can just > + # require taglib >= 1.6 (or whatever version has the needed functions) > + AC_CHECK_LIB([tag_c], [taglib_id3v2_has_lyrics], have_taglib=yes, > have_taglib=no) > +fi > +if test "x$have_taglib" = "xyes"; then > + have_taglib="yes -- will build with TagLib support" > + AC_DEFINE(HAVE_TAGLIB, 1, [Define if you have TagLib support]) > CFLAGS="$CFLAGS $TAGLIB_C_CFLAGS" > - AC_SEARCH_LIBS([taglib_id3v2_has_lyrics], ["tag_c tag"], > taglib_has_lyrics=yes,taglib_has_lyrics=no) > - if test "x$taglib_has_lyrics" = "xyes"; then > - have_taglib="yes -- will build with TagLib support" > - AC_DEFINE(USE_TAGLIB, 1, [Define if you have TagLib support]) > - else > - have_taglib="*no -- will build without taglib support (problems > writing tags, especially lyrics)" > - AC_MSG_WARN([LibTag was found but is missing C bindings, did you > use a patched 1.15 or later version?]) > - CFLAGS="$OLD_CFLAGS" > - fi > + LIBS="$LIBS $TAGLIB_C_LIBS" > else > - have_taglib="*no -- will build without taglib support (problems > writing tags, especially lyrics)" > + have_taglib="*no -- will build without taglib support" > + # Check for libid3tag if taglib is not being used > + AC_SEARCH_LIBS([id3_frame_field], ["id3tag" "id3tag -lz"],, > + AC_MSG_ERROR([*** id3tag >= 0.15 lib not found (0.14 will not > work!)])) > fi > > ->>>>>>> Fixed configure for taglib:gtkpod/trunk/configure.in > dnl we need 'flex' > AM_PROG_LEX > case "$LEX" in > @@ -111,10 +109,6 @@ dnl Check if statvfs() is available (otherwise we fall > back on 'df' to determine > dnl free space on the iPod > AC_CHECK_FUNCS(statvfs) > > -dnl Check for libid3tag > -AC_SEARCH_LIBS([id3_frame_field], ["id3tag" "id3tag -lz"],, > - AC_MSG_ERROR([*** id3tag >= 0.15 lib not found (0.14 will not > work!)])) > - > dnl Check for libcurl > AC_ARG_WITH(curl, AC_HELP_STRING([--without-curl], [Disable coverart > download support])) > if test "x$with_curl" != "xno"; then > @@ -346,6 +340,7 @@ Configuration for $PACKAGE $VERSION : > libgpod version ......: $libgpod_version > gnome-vfs.............: $have_gnome_vfs > hal...................: $have_hal > + TagLib................: $have_taglib > libcurl ..............: $have_curl > mp4v2 ................: $have_mp4v2 > vorbisfile ...........: $have_ogg > diff --git a/src/mp3file.c b/src/mp3file.c > index 0da321a..a87fad0 100644 > --- a/src/mp3file.c > +++ b/src/mp3file.c > @@ -1011,12 +1011,12 @@ static guint get_track_time (const gchar *path) > return result; > } > > -#if USE_TAGLIB > +#ifdef HAVE_TAGLIB > #include <tag_c.h> > +#else > +#include <id3tag.h> > #endif > > -/* libid3tag stuff */ > -#include <id3tag.h> > #include "prefs.h" > > #ifndef ID3_FRAME_GROUP > @@ -1024,7 +1024,7 @@ static guint get_track_time (const gchar *path) > #endif > > > -#if USE_TAGLIB!=1 > +#ifndef HAVE_TAGLIB > > static const gchar* id3_get_binary (struct id3_tag *tag, > char *frame_name, > @@ -1334,7 +1334,8 @@ static void id3_set_string (struct id3_tag *tag, > } > > > -#endif /* USE_TAGLIB */ > +#endif /* HAVE_TAGLIB */ > + > /*** > * Reads id3v1.x / id3v2 apic data > * @returns: TRUE on success, else FALSE. > @@ -1342,7 +1343,7 @@ static void id3_set_string (struct id3_tag *tag, > static gboolean id3_apic_read (const gchar *filename, > guchar **image_data, gsize *image_data_len) > { > -#if USE_TAGLIB > +#if HAVE_TAGLIB > TagLib_File *id3file; > TagLib_Tag *id3tag; > > @@ -1449,7 +1450,7 @@ static gboolean id3_apic_read (const gchar *filename, > *image_data = g_malloc (len); > memcpy (*image_data, coverart, len); > *image_data_len = len; > -#if USE_TAGLIB==2 > +#ifdef HAVE_TAGLIB > g_free(coverart); > #endif > } > @@ -1464,7 +1465,7 @@ static gboolean id3_apic_read (const gchar *filename, > #endif > } > } > -#if USE_TAGLIB!=1 > +#ifndef HAVE_TAGLIB > id3_file_close (id3file); > #endif > return TRUE; > @@ -1571,7 +1572,7 @@ gboolean id3_tag_read (const gchar *filename, > File_Tag *tag) > { > gchar* string; > gchar* string2; > -#if USE_TAGLIB > +#if HAVE_TAGLIB > TagLib_File *id3file; > TagLib_Tag *id3tag; > > @@ -1745,12 +1746,12 @@ gboolean id3_tag_read (const gchar *filename, > File_Tag *tag) > } > > id3_file_close (id3file); > -#endif /*USE_TAGLIB*/ > +#endif /*HAVE_TAGLIB*/ > return TRUE; > } > > > -#if USE_TAGLIB <1 > +#ifndef HAVE_TAGLIB > static enum id3_field_textencoding get_encoding_of (struct id3_tag *tag, > const char *frame_name) > { > struct id3_frame *frame; > @@ -1816,7 +1817,7 @@ void set_uncommon_tag (struct id3_tag *id3tag, > } > > > -#endif /*USE_TAGLIB*/ > +#endif /*HAVE_TAGLIB*/ > > /** > * Write the ID3 tags to the file. > @@ -1824,7 +1825,7 @@ void set_uncommon_tag (struct id3_tag *id3tag, > */ > gboolean mp3_write_file_info (const gchar *filename, Track *track) > { > -#if USE_TAGLIB > +#if HAVE_TAGLIB > TagLib_File *id3file; > TagLib_Tag *id3tag; > > @@ -3225,7 +3226,7 @@ Track *mp3_get_file_info (const gchar *name) > */ > gboolean id3_lyrics_read (const gchar *filename,gchar **lyrics) > { > -#if USE_TAGLIB > +#if HAVE_TAGLIB > TagLib_File *id3file; > char *temp_str=NULL; > > @@ -3280,7 +3281,7 @@ gboolean id3_lyrics_read (const gchar *filename,gchar > **lyrics) > > gboolean id3_lyrics_save (const gchar *filename,const gchar *lyrics) > { > -#if USE_TAGLIB > +#if HAVE_TAGLIB > TagLib_File *id3file; > > g_return_val_if_fail (filename, FALSE); > -- > 1.6.2.3 > > > > > ------------------------------------------------------------------------------ > Stay on top of everything new and different, both inside and > around Java (TM) technology - register by April 22, and save > $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. > 300 plus technical and hands-on sessions. Register today. > Use priority code J9JMT32. http://p.sf.net/sfu/p > _______________________________________________ > Gtkpod-devel mailing list > Gtk...@li... > https://lists.sourceforge.net/lists/listinfo/gtkpod-devel > |