/xmms-scrobbler-0.4.0/configure.in
Autoconf | 276 lines | 235 code | 30 blank | 11 comment | 12 complexity | 08211365d3824a4db7176ae53b605fa8 MD5 | raw file
Possible License(s): LGPL-2.1
- dnl Process this file with autoconf to produce a configure script.
- AC_INIT(xmms_scrobbler.c)
- AC_CANONICAL_HOST
- AM_CONFIG_HEADER(config.h)
- AM_INIT_AUTOMAKE(xmms-scrobbler, 0.4.0)
- AM_MAINTAINER_MODE
- AM_DISABLE_STATIC
- AC_PROG_CC
- AC_PROG_CPP
- AM_PROG_CC_STDC
- AC_HEADER_STDC
- AC_PROG_INSTALL
- AC_PROG_LIBTOOL
- AC_C_BIGENDIAN
- AC_CHECK_SIZEOF(long)
- AC_CHECK_HEADERS(sys/time.h)
- AC_CHECK_HEADERS(wchar.h)
- AC_CHECK_HEADERS(pthread.h)
- dnl Checking for XMMS and/or BMP
- AC_MSG_CHECKING([if XMMS plugin is to be built])
- AC_ARG_ENABLE([xmms-plugin],
- AC_HELP_STRING([--disable-xmms-plugin],
- [disable building the XMMS plugin (default behavior is enabled)]),
- [ case "${enableval}" in
- yes)
- AC_MSG_RESULT(yes)
- make_xmms=true
- AM_PATH_GLIB(1.2.2,,
- [AC_MSG_WARN([*** GLIB >= 1.2.2 not installed - please install first ***])
- make_xmms=false
- ])
- AM_PATH_XMMS(1.2.4,,
- [AC_MSG_WARN([*** XMMS >= 1.2.4 not installed - please install first ***])
- make_xmms=false
- ])
- ;;
- *)
- AC_MSG_RESULT(no)
- make_xmms=false
- ;;
- esac ],
- [ AC_MSG_RESULT(yes)
- make_xmms=true
- AM_PATH_GLIB(1.2.2,,
- [AC_MSG_WARN([*** GLIB >= 1.2.2 not installed - please install first ***])
- make_xmms=false
- ])
- AM_PATH_XMMS(1.2.4,,
- [AC_MSG_WARN([*** XMMS >= 1.2.4 not installed - please install first ***])
- make_xmms=false
- ])
- ])
- AM_CONDITIONAL(MAKE_XMMS, [ test $make_xmms = true ])
- AC_MSG_CHECKING([if BMP plugin is to be built])
- AC_ARG_ENABLE([bmp-plugin],
- AC_HELP_STRING([--disable-bmp-plugin],
- [disable building the BMP plugin (default behavior is enabled)]),
- [ case "${enableval}" in
- yes)
- AC_MSG_RESULT(yes)
- make_bmp=true
- PKG_CHECK_MODULES(GTK, [glib-2.0 >= 2.4.0 gtk+-2.0 >= 2.4.0],
- [],
- [ AC_MSG_WARN([*** GLIB >= 2.4.0 or GTK+ >= 2.4.0 not installed - please install first *** ])
- make_bmp=false
- ]
- )
- PKG_CHECK_MODULES(BMP, [bmp >= 0.9.7],
- [],
- [AC_MSG_WARN([*** BMP >= 0.9.7rc2 not installed - please install first ***])
- make_bmp=false
- ]
- )
- ;;
- *)
- AC_MSG_RESULT(no)
- make_bmp=false
- ;;
- esac ],
- [ AC_MSG_RESULT(yes)
- make_bmp=true
- PKG_CHECK_MODULES(GTK, [glib-2.0 >= 2.4.0 gtk+-2.0 >= 2.4.0],
- [],
- [ AC_MSG_WARN([*** GLIB >= 2.4.0 or GTK+ >= 2.4.0 not installed - please install first *** ])
- make_bmp=false
- ]
- )
- PKG_CHECK_MODULES(BMP, [bmp >= 0.9.7],
- [],
- [AC_MSG_WARN([*** BMP >= 0.9.7rc2 not installed - please install first ***])
- make_bmp=false
- ]
- )
- ])
- AM_CONDITIONAL(MAKE_BMP, [ test $make_bmp = true ])
- if test $make_xmms = false -a $make_bmp = false; then
- AC_MSG_ERROR([No media player specified, or none found. Cannot build.])
- fi
- dnl debug mode
- AC_MSG_CHECKING(if debug statements are enabled)
- AC_ARG_ENABLE(debug,
- AC_HELP_STRING([--enable-debug], [turn on debugging (default is NO)]),
- [ case "${enableval}" in
- yes)
- AC_MSG_RESULT(yes)
- AC_DEFINE(DEBUG, 1, Enable debug messages)
- debug=true
- ;;
- *)
- AC_MSG_RESULT(no)
- AC_DEFINE(DEBUG, 0, Enable debug messages)
- debug=false
- ;;
- esac ],
- [ AC_MSG_RESULT(no)
- AC_DEFINE(DEBUG, 1, Enable debug messages)
- debug=false
- ])
- AC_MSG_CHECKING(if metadata debug statements are enabled)
- AC_ARG_ENABLE(meta_debug,
- AC_HELP_STRING([--disable-meta-debug], [turn on metadata debug messages (only works when debugging is enabled. default is YES)]),
- [ case "${enableval}" in
- yes)
- if test $debug = false; then
- AC_MSG_RESULT(no)
- AC_DEFINE(META_DEBUG, 0, Enable metadata debug messages)
- else
- AC_MSG_RESULT(yes)
- AC_DEFINE(META_DEBUG, 1, Enable metadata debug messages)
- fi
- ;;
- *)
- AC_MSG_RESULT(no)
- AC_DEFINE(META_DEBUG, 0, Enable metadata debug messages)
- esac ],
- [ if test $debug = false; then
- AC_MSG_RESULT(no)
- AC_DEFINE(META_DEBUG, 0, Enable metadata debug messages)
- else
- AC_MSG_RESULT(yes)
- AC_DEFINE(META_DEBUG, 1, Enable metadata debug messages)
- fi
- ])
- AC_MSG_CHECKING(if submission-detection debug statements are enabled)
- AC_ARG_ENABLE(sub_debug,
- AC_HELP_STRING([--enable-sub-debug], [turn on submission-detection debug messages (only works when debugging is enabled. default is NO)]),
- [ case "${enableval}" in
- yes)
- if test $debug = false; then
- AC_MSG_RESULT(no)
- AC_DEFINE(SUB_DEBUG, 0, Enable submission-detection debug messages)
- else
- AC_MSG_RESULT(yes)
- AC_DEFINE(SUB_DEBUG, 1, Enable submission-detection debug messages)
- fi
- ;;
- *)
- AC_MSG_RESULT(no)
- AC_DEFINE(SUB_DEBUG, 0, Enable submission-detection debug messages)
- esac ],
- [ AC_MSG_RESULT(no)
- AC_DEFINE(SUB_DEBUG, 0, Enable submission-detection debug messages)
- ])
- AC_DEFINE(ALLOW_MULTIPLE, 1, Allow multiple-submissions in one POST to the AudioScrobbler server)
- dnl APE Preference check
- AC_MSG_CHECKING([whether to prefer APE to ID3v2])
- AC_ARG_ENABLE([prefer-ape],
- AC_HELP_STRING([--enable-prefer-ape], [prefer APE tags to ID3v2 (default is NO)]),
- [ case "${enableval}" in
- yes)
- AC_MSG_RESULT(yes)
- AC_DEFINE([PREFER_APE], 1, [Define if APE tags are preferred to ID3v2 tags])
- ;;
- *)
- AC_MSG_RESULT(no)
- ;;
- esac ],
- AC_MSG_RESULT(no))
- dnl Checks for header files
- AC_CHECK_HEADER([curl/curl.h],,AC_MSG_ERROR([*** unable to find libcurl headers]))
- dnl Checks for libmusicbrainz
- AC_CHECK_LIB(musicbrainz, mb_GetVersion,,
- echo "*"
- echo "* The MusicBrainz client library needs to be installed "
- echo "* to build this plugin. Please download the library from "
- echo "* http://www.musicbrainz.org/download "
- echo "*"
- AC_MSG_ERROR("Cannot build. Stop.")
- ,-lstdc++)
- LIBS="-lmusicbrainz -lstdc++"
- AC_TRY_RUN([
- #include <musicbrainz/mb_c.h>
- int main ()
- {
- int major, minor, rev;
- musicbrainz_t o;
- o = mb_New();
- mb_GetVersion(o, &major, &minor, &rev);
- mb_Delete(o);
- if (major >= 2)
- {
- return 0;
- }
- return -1;
- }
- ],have_mbver=true,have_mbver=false,have_mbver=false)
- dnl libcurl check
- AC_CACHE_VAL(my_cv_curl_vers,[
- my_cv_curl_vers=NONE
- dnl check is the plain-text version of the required version
- check="7.9.7"
- dnl check_hex must be UPPERCASE if any hex letters are present
- check_hex="070907"
- AC_MSG_CHECKING([for curl >= $check])
- if eval curl-config --version 2>/dev/null >/dev/null; then
- ver=`curl-config --version | sed -e "s/libcurl //g"`
- hex_ver=`curl-config --vernum | tr 'a-f' 'A-F'`
- ok=`echo "ibase=16; if($hex_ver>=$check_hex) $hex_ver else 0" | bc`
- if test x$ok != x0; then
- my_cv_curl_vers="$ver"
- AC_MSG_RESULT([$my_cv_curl_vers])
- else
- AC_MSG_RESULT(FAILED)
- AC_MSG_WARN([$ver is too old. Need version $check or higher.])
- fi
- else
- AC_MSG_RESULT(FAILED)
- AC_MSG_WARN([curl-config was not found])
- fi
- ])
- # AC_CHECK_LIB([curl], [curl_global_init],, AC_MSG_ERROR([*** unable to link with libcurl]))
- LIBS="$LIBS $GTKLIBS"
- AC_MSG_CHECKING([for version >= 2.0.0 in -lmusicbrainz])
- if test "$have_mbver" = "false"; then
- AC_MSG_RESULT([no])
- echo "*"
- echo "* Version 2.0.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_OUTPUT(Makefile)