dnl Process this file with autoconf to produce a configure script. AC_INIT(include/tunepimp-0.5/tunepimp.h) AM_CONFIG_HEADER(config.h) VERSION="0.5.3" AM_INIT_AUTOMAKE(libtunepimp, "$VERSION") dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION") CFLAGS="$CFLAGS -Wall -O2" CPPFLAGS="$CPPFLAGS -Wall -O2" LIBS="$LDFLAGS" TP_PLUGINS="" dnl Canonicalize host. AC_CANONICAL_HOST case "${host_cpu}-${host_os}" in *-beos*) os=beos; LIBS="$LIBS -lbe -lroot" ;; *-cygwin*) os=cygwin; LIBS="$LIBS -lwinmm" ;; *-freebsd*) os=freebsd ;; *-darwin*) os=darwin ;; *-irix*) os=irix; CXXFLAGS="$CFLAGS -fsquangle"; LIBS="$LIBS -lcdaudio -lmediad -lds" ;; *-linux*) os=linux ;; *-netbsd*) os=netbsd ;; *-openbsd*) os=openbsd ;; *-os2_emx*) os=os2 ;; *-solaris*) os=solaris; LIBS="$LIBS -lsocket -lnsl" ;; *-qnx*) os=qnx; LIBS="$LIBS -lsocket" ;; *) AC_MSG_RESULT([WARNING: unknown system]) ;; esac AM_CONDITIONAL(DARWIN, test x$os = xdarwin) AM_CONDITIONAL(FREEBSD, test x$os = xfreebsd) dnl Checks for programs. AC_PREREQ(2.52) AC_PROG_CC AC_LIBLTDL_CONVENIENCE AC_SUBST(INCLTDL) AC_SUBST(LIBLTDL) AC_LIBTOOL_DLOPEN AC_PROG_LIBTOOL AC_SUBST(LIBTOOL_DEPS) PREFIX="${prefix}" AC_SUBST(PREFIX) AC_PROG_CXX AC_PROG_INSTALL if test "x$os" = "xdarwin"; then LIBS="$LIBS -framework CoreFoundation" fi if test "${prefix}" = "NONE"; then prefix="/usr/local" fi AC_ARG_ENABLE([lgpl], [ --enable--lgpl Use LGPL license (no mp3 support)], [use_lgpl=yes], [use_lgpl=no]) AC_CHECK_LIB(z, compress, [LIB="$LIB -lz"], [echo "*" echo "* The zlib compression library is not installed." echo "* download the library here:" echo "* http://www.gzip.org/zlib/" echo "*" AC_MSG_ERROR([Cannot build. Stop.]) ],) dnl libexpat check AC_CHECK_LIB(expat, XML_ExpatVersion, [LIBS="$LIBS -lexpat"], [ echo "*" echo "* expat is needed to build this library. It is either not" echo "* installed on your system or it is too old." echo "* Please download it from http://expat.sourceforge.net." echo "*" AC_MSG_ERROR("Cannot build. Stop.")], -lexpat) dnl libcurl check AC_CHECK_LIB(curl, curl_global_init, [LIBS="$LIBS -lcurl"], [ echo "*" echo "* libcurl is needed to build this library. It is either not" echo "* installed on your system or it is too old." echo "* Please download it http://curl.haxx.se/" echo "*" AC_MSG_ERROR("Cannot build. Stop.")], -lcurl) AC_CHECK_LIB(ofa, ofa_get_version,, [ echo "*" echo "* The Open Fingerprint Architecture library library needs " echo "* to be installed. Please download the library from " echo "* http://www.musicdns.org/downloads " echo "*" AC_MSG_ERROR("Cannot build. Stop.")] ,) AC_TRY_RUN([ #include int main () { int major, minor, rev; ofa_get_version(&major, &minor, &rev); if (major == 0 && minor >= 4) return 0; return -1; } ],have_ofaver=true,have_odaver=false,have_ofaver=false) AC_MSG_CHECKING([for version >= 0.4.0 in -lofa]) if test "$have_ofaver" = "true"; then AC_MSG_RESULT([yes]) LIBS="$LIBS -lofa" else AC_MSG_RESULT([no]) echo "*" echo "* Version 0.4.0 or higher of the the Open Fingerprint " echo "* Architecture library library needs to be installed. " echo "* Please download the library from " echo "* http://www.musicdns.org/downloads " echo "*" AC_MSG_ERROR([Cannot build. Stop.]) fi AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_CHECK_LIB(musicbrainz, mb_GetVersion, [LIBS="$LIBS -lmusicbrainz"],[ echo "*" echo "* The MusicBrainz client library needs to be installed " echo "* to build this plugin. Please download the library from " echo "* http://musicbrainz.org/products/client/download.html " echo "*" AC_MSG_ERROR("Cannot build. Stop.") ],) AC_TRY_RUN([ #include int main () { int major, minor, rev; musicbrainz_t o; o = mb_New(); mb_GetVersion(o, &major, &minor, &rev); mb_Delete(o); if (major == 2 && minor >= 1) return 0; return -1; } ],have_mbver=true,have_mbver=false,have_mbver=false) AC_MSG_CHECKING([for version >= 2.1.0 in -lmusicbrainz]) if test "$have_mbver" = "false"; then AC_MSG_RESULT([no]) echo "*" echo "* Version 2.1.0 or higher of the MusicBrainz " echo "* client library needs to be installed to build this application. " echo "* Please download the library from: " echo "* http://musicbrainz.org/products/client/download.html " echo "*" AC_MSG_ERROR([Cannot build. Stop.]) else AC_MSG_RESULT([yes]) fi AC_LANG_RESTORE AC_CHECK_HEADERS(iconv.h) dnl Find iconv. It may be in libiconv and may be iconv() or libiconv() if test "x$ac_cv_header_iconv_h" = "xyes"; then AC_CHECK_FUNC(iconv, ac_found_iconv=yes, ac_found_iconv=no) if test "x$ac_found_iconv" = "xno"; then AC_CHECK_LIB(iconv, iconv, ac_found_iconv=yes) if test "x$ac_found_iconv" = "xno"; then AC_CHECK_LIB(iconv, libiconv, ac_found_iconv=yes) fi if test "x$ac_found_iconv" != "xno"; then LIBS="-liconv $LIBS" fi else dnl Handle case where there is a native iconv but iconv.h is from libiconv AC_CHECK_DECL(_libiconv_version, [ AC_CHECK_LIB(iconv, libiconv, LIBS="-liconv $LIBS") ],, [ #include ]) fi fi if test "x$ac_found_iconv" = xyes; then AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) fi dnl Check for TagLib 1.4 AC_CHECK_TAGLIB(1.4, have_taglib=yes, have_taglib=no) dnl Check for libmpcdec AC_CHECK_LIB(mpcdec, mpc_decoder_decode, have_mpcdec=yes,) dnl Check if we can build TagLib-based plugins if test "x$have_taglib" = "xyes"; then TP_PLUGINS="$TP_PLUGINS wma mpc wv speex tta" with_wma=yes with_wv=yes with_speex=yes with_tta=yes if test "x$have_mpcdec" = "xyes"; then AC_C_BIGENDIAN with_mpc="yes" else with_mpc="yes (without decoder)" fi else with_wma=no with_mpc=no with_wv=no with_speex=no with_tta=no fi AM_CONDITIONAL(HAVE_MPCDEC, test "x$with_mpc" = "xyes") dnl Check for mp4v2 AC_CHECK_LIB(mp4v2, MP4Read, [ TP_PLUGINS="$TP_PLUGINS mp4" AC_DEFINE(HAVE_MP4,1,[MP4 Support]) with_mp4=yes ], [ with_mp4=no ]) if test "x$use_lgpl" = "xno"; then dnl Check for MAD decoder lib for mp3 support AC_CHECK_LIB(mad,mad_version, AC_DEFINE(HAVE_LIBMAD,1,[MP3 Decode Support]) TP_PLUGINS="$TP_PLUGINS mp3" with_mp3=yes, echo "*" echo "* The MAD mp3 decoder is not installed. Please download " echo "* the decoder from http://www.mars.org/home/rob/proj/mpeg" echo "* to include MP3 TRM generation capabilities." echo "*" with_mp3=no ,-lm) else with_mp3=no fi dnl Check for Ogg/Vorbis AC_CHECK_LIB(ogg, ogg_sync_init, have_ogg="yes",) AC_CHECK_LIB(vorbisfile, ov_info, have_vorbis="yes",, -lvorbis -logg) if test "x$have_ogg" = "xyes"; then if test "x$have_vorbis" = "xyes"; then TP_PLUGINS="$TP_PLUGINS vorbis" AC_DEFINE(HAVE_OGGVORBIS,1,[Ogg/Vorbis Support]) with_vorbis=yes else with_vorbis=no fi fi dnl Check for libFLAC dnl as of FLAC 1.1.3 libFLAC supports Ogg FLAC and hence needs -logg AC_CHECK_LIB(FLAC, FLAC__metadata_object_new, have_flac="yes",, -lFLAC -logg -lm) if test "x$have_flac" = "xyes"; then TP_PLUGINS="$TP_PLUGINS flac" AC_DEFINE(HAVE_FLAC,1,[FLAC Support]) with_flac=yes else with_flac=no fi AC_SUBST(TP_PLUGINS) AC_SUBST(CFLAGS) AC_DEFINE_UNQUOTED(PREFIX, "${prefix}", "PREFIX") AS_AC_EXPAND(LIBDIR, $libdir) AC_DEFINE_UNQUOTED(PLUGIN_DIR, "$LIBDIR/tunepimp/plugins", "PLUGIN_DIR") AC_CONFIG_SUBDIRS(libltdl) AC_OUTPUT( Makefile lib/Makefile lib/threads/Makefile lib/threads/posix/Makefile lib/utf8/Makefile plugins/Makefile plugins/common/Makefile plugins/mp3/Makefile plugins/mp3/id3tag/Makefile plugins/mp3/id3tag-2.3/Makefile plugins/wav/Makefile plugins/vorbis/Makefile plugins/flac/Makefile plugins/mpc/Makefile plugins/wma/Makefile plugins/mp4/Makefile plugins/speex/Makefile plugins/tta/Makefile plugins/wv/Makefile examples/Makefile include/Makefile include/tunepimp-0.5/Makefile perl/tunepimp-perl/Makefile.PL python/tunepimp/__init__.py tunepimp.doxy, echo timestamp > stamp-h) echo "" echo "Configuration:" echo " Install path: $prefix" echo " FLAC plugin: $with_flac" echo " MP3 plugin: $with_mp3" echo " MP4 plugin: $with_mp4" echo " Musepack plugin: $with_mpc" echo " Ogg Vorbis plugin: $with_vorbis" echo " Speex plugin: $with_speex" echo " The True Audio plugin: $with_tta" echo " WMA plugin: $with_wma" echo " WavPack plugin: $with_wv" echo ""