]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
build: Convert libid3tag detection to new macros.
authorAndre Noll <maan@systemlinux.org>
Tue, 3 Jun 2014 17:42:52 +0000 (19:42 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 30 Mar 2015 16:45:41 +0000 (16:45 +0000)
configure.ac
mp3_afh.c

index 593efefc5a049862dd3637dbf49178b82ed1c2b4..66b4787e4e945e9d7ebfb3a6566f0f77254affce 100644 (file)
@@ -334,40 +334,13 @@ AC_CHECK_LIB([mad], [mad_stream_init], [], HAVE_MAD=no)
 LIB_SUBST_FLAGS(mad)
 UNSTASH_FLAGS
 ###################################################################### libid3tag
-OLD_CPPFLAGS="$CPPFLAGS"
-OLD_LDFLAGS="$LDFLAGS"
-OLD_LIBS="$LIBS"
-
-have_libid3tag="yes"
-AC_ARG_WITH(id3tag_headers, [AS_HELP_STRING(--with-id3tag-headers=dir,
-       [look for id3tag header files also in dir])])
-if test -n "$with_id3tag_headers"; then
-       id3tag_cppflags="-I$with_id3tag_headers"
-       CPPFLAGS="$CPPFLAGS $id3tag_cppflags"
-fi
-AC_ARG_WITH(id3tag_libs, [AS_HELP_STRING(--with-id3tag-libs=dir,
-       [look for id3tag libs also in dir])])
-if test -n "$with_id3tag_libs"; then
-       id3tag_libs="-L$with_id3tag_libs"
-       LDFLAGS="$LDFLAGS $id3tag_libs"
-fi
-
-AC_MSG_CHECKING(for libid3tag)
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-       #include <id3tag.h>
-]], [[
-       struct id3_tag t = {.flags = 0};
-]])],[],[have_libid3tag=no])
-AC_MSG_RESULT($have_libid3tag)
-
-if test ${have_libid3tag} = yes; then
-       AC_DEFINE(HAVE_LIBID3TAG, 1, define to 1 you have libid3tag)
-       AC_SUBST(id3tag_cppflags)
-       AC_SUBST(id3tag_ldflags, "$id3tag_libs -lid3tag -lz")
-fi
-CPPFLAGS="$OLD_CPPFLAGS"
-LDFLAGS="$OLD_LDFLAGS"
-LIBS="$OLD_LIBS"
+STASH_FLAGS
+LIB_ARG_WITH([id3tag], [-lid3tag -lz])
+HAVE_ID3TAG=yes
+AC_CHECK_HEADER(id3tag.h, [], HAVE_ID3TAG=no)
+AC_CHECK_LIB([id3tag], [id3_file_fdopen], [], HAVE_ID3TAG=no)
+LIB_SUBST_FLAGS(id3tag)
+UNSTASH_FLAGS
 ########################################################################### flac
 OLD_CPPFLAGS="$CPPFLAGS"
 OLD_LDFLAGS="$LDFLAGS"
@@ -1340,7 +1313,7 @@ crypto lib: ${CRYPTOLIB:-[none]}
 unix socket credentials: $have_ucred
 readline (interactive CLIs): $have_readline
 audio formats handlers: $audio_format_handlers
-id3 version2 support: $have_libid3tag
+id3 version 2 support: $HAVE_ID3TAG
 filters: $filters
 writers: $writers
 
index 3b540c0b84a8ca081bce71a3dd1015f42fb8b97b..ccd28dadd62b2e37a2b9350414a3036bbd7841d0 100644 (file)
--- a/mp3_afh.c
+++ b/mp3_afh.c
@@ -68,7 +68,7 @@ static const int mp3info_bitrate[2][3][14] = {
 static const int frame_size_index[] = {24000, 72000, 72000};
 static const char *mode_text[] = {"stereo", "joint stereo", "dual channel", "mono", "invalid"};
 
-#ifdef HAVE_LIBID3TAG
+#ifdef HAVE_ID3TAG
 
 #include <id3tag.h>
 
@@ -183,7 +183,7 @@ static int mp3_get_id3(unsigned char *map, size_t numbytes, __a_unused int fd,
        return ret;
 }
 
-#else /* HAVE_LIBID3TAG */
+#else /* HAVE_ID3TAG */
 
 /*
  * Remove trailing whitespace from the end of a string
@@ -233,7 +233,7 @@ static int mp3_get_id3(unsigned char *map, size_t numbytes, __a_unused int fd,
        tags->comment = para_strdup(comment);
        return 1;
 }
-#endif /* HAVE_LIBID3TAG */
+#endif /* HAVE_ID3TAG */
 
 static int header_frequency(struct mp3header *h)
 {