PageRenderTime 41ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/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
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT(xmms_scrobbler.c)
  3. AC_CANONICAL_HOST
  4. AM_CONFIG_HEADER(config.h)
  5. AM_INIT_AUTOMAKE(xmms-scrobbler, 0.4.0)
  6. AM_MAINTAINER_MODE
  7. AM_DISABLE_STATIC
  8. AC_PROG_CC
  9. AC_PROG_CPP
  10. AM_PROG_CC_STDC
  11. AC_HEADER_STDC
  12. AC_PROG_INSTALL
  13. AC_PROG_LIBTOOL
  14. AC_C_BIGENDIAN
  15. AC_CHECK_SIZEOF(long)
  16. AC_CHECK_HEADERS(sys/time.h)
  17. AC_CHECK_HEADERS(wchar.h)
  18. AC_CHECK_HEADERS(pthread.h)
  19. dnl Checking for XMMS and/or BMP
  20. AC_MSG_CHECKING([if XMMS plugin is to be built])
  21. AC_ARG_ENABLE([xmms-plugin],
  22. AC_HELP_STRING([--disable-xmms-plugin],
  23. [disable building the XMMS plugin (default behavior is enabled)]),
  24. [ case "${enableval}" in
  25. yes)
  26. AC_MSG_RESULT(yes)
  27. make_xmms=true
  28. AM_PATH_GLIB(1.2.2,,
  29. [AC_MSG_WARN([*** GLIB >= 1.2.2 not installed - please install first ***])
  30. make_xmms=false
  31. ])
  32. AM_PATH_XMMS(1.2.4,,
  33. [AC_MSG_WARN([*** XMMS >= 1.2.4 not installed - please install first ***])
  34. make_xmms=false
  35. ])
  36. ;;
  37. *)
  38. AC_MSG_RESULT(no)
  39. make_xmms=false
  40. ;;
  41. esac ],
  42. [ AC_MSG_RESULT(yes)
  43. make_xmms=true
  44. AM_PATH_GLIB(1.2.2,,
  45. [AC_MSG_WARN([*** GLIB >= 1.2.2 not installed - please install first ***])
  46. make_xmms=false
  47. ])
  48. AM_PATH_XMMS(1.2.4,,
  49. [AC_MSG_WARN([*** XMMS >= 1.2.4 not installed - please install first ***])
  50. make_xmms=false
  51. ])
  52. ])
  53. AM_CONDITIONAL(MAKE_XMMS, [ test $make_xmms = true ])
  54. AC_MSG_CHECKING([if BMP plugin is to be built])
  55. AC_ARG_ENABLE([bmp-plugin],
  56. AC_HELP_STRING([--disable-bmp-plugin],
  57. [disable building the BMP plugin (default behavior is enabled)]),
  58. [ case "${enableval}" in
  59. yes)
  60. AC_MSG_RESULT(yes)
  61. make_bmp=true
  62. PKG_CHECK_MODULES(GTK, [glib-2.0 >= 2.4.0 gtk+-2.0 >= 2.4.0],
  63. [],
  64. [ AC_MSG_WARN([*** GLIB >= 2.4.0 or GTK+ >= 2.4.0 not installed - please install first *** ])
  65. make_bmp=false
  66. ]
  67. )
  68. PKG_CHECK_MODULES(BMP, [bmp >= 0.9.7],
  69. [],
  70. [AC_MSG_WARN([*** BMP >= 0.9.7rc2 not installed - please install first ***])
  71. make_bmp=false
  72. ]
  73. )
  74. ;;
  75. *)
  76. AC_MSG_RESULT(no)
  77. make_bmp=false
  78. ;;
  79. esac ],
  80. [ AC_MSG_RESULT(yes)
  81. make_bmp=true
  82. PKG_CHECK_MODULES(GTK, [glib-2.0 >= 2.4.0 gtk+-2.0 >= 2.4.0],
  83. [],
  84. [ AC_MSG_WARN([*** GLIB >= 2.4.0 or GTK+ >= 2.4.0 not installed - please install first *** ])
  85. make_bmp=false
  86. ]
  87. )
  88. PKG_CHECK_MODULES(BMP, [bmp >= 0.9.7],
  89. [],
  90. [AC_MSG_WARN([*** BMP >= 0.9.7rc2 not installed - please install first ***])
  91. make_bmp=false
  92. ]
  93. )
  94. ])
  95. AM_CONDITIONAL(MAKE_BMP, [ test $make_bmp = true ])
  96. if test $make_xmms = false -a $make_bmp = false; then
  97. AC_MSG_ERROR([No media player specified, or none found. Cannot build.])
  98. fi
  99. dnl debug mode
  100. AC_MSG_CHECKING(if debug statements are enabled)
  101. AC_ARG_ENABLE(debug,
  102. AC_HELP_STRING([--enable-debug], [turn on debugging (default is NO)]),
  103. [ case "${enableval}" in
  104. yes)
  105. AC_MSG_RESULT(yes)
  106. AC_DEFINE(DEBUG, 1, Enable debug messages)
  107. debug=true
  108. ;;
  109. *)
  110. AC_MSG_RESULT(no)
  111. AC_DEFINE(DEBUG, 0, Enable debug messages)
  112. debug=false
  113. ;;
  114. esac ],
  115. [ AC_MSG_RESULT(no)
  116. AC_DEFINE(DEBUG, 1, Enable debug messages)
  117. debug=false
  118. ])
  119. AC_MSG_CHECKING(if metadata debug statements are enabled)
  120. AC_ARG_ENABLE(meta_debug,
  121. AC_HELP_STRING([--disable-meta-debug], [turn on metadata debug messages (only works when debugging is enabled. default is YES)]),
  122. [ case "${enableval}" in
  123. yes)
  124. if test $debug = false; then
  125. AC_MSG_RESULT(no)
  126. AC_DEFINE(META_DEBUG, 0, Enable metadata debug messages)
  127. else
  128. AC_MSG_RESULT(yes)
  129. AC_DEFINE(META_DEBUG, 1, Enable metadata debug messages)
  130. fi
  131. ;;
  132. *)
  133. AC_MSG_RESULT(no)
  134. AC_DEFINE(META_DEBUG, 0, Enable metadata debug messages)
  135. esac ],
  136. [ if test $debug = false; then
  137. AC_MSG_RESULT(no)
  138. AC_DEFINE(META_DEBUG, 0, Enable metadata debug messages)
  139. else
  140. AC_MSG_RESULT(yes)
  141. AC_DEFINE(META_DEBUG, 1, Enable metadata debug messages)
  142. fi
  143. ])
  144. AC_MSG_CHECKING(if submission-detection debug statements are enabled)
  145. AC_ARG_ENABLE(sub_debug,
  146. AC_HELP_STRING([--enable-sub-debug], [turn on submission-detection debug messages (only works when debugging is enabled. default is NO)]),
  147. [ case "${enableval}" in
  148. yes)
  149. if test $debug = false; then
  150. AC_MSG_RESULT(no)
  151. AC_DEFINE(SUB_DEBUG, 0, Enable submission-detection debug messages)
  152. else
  153. AC_MSG_RESULT(yes)
  154. AC_DEFINE(SUB_DEBUG, 1, Enable submission-detection debug messages)
  155. fi
  156. ;;
  157. *)
  158. AC_MSG_RESULT(no)
  159. AC_DEFINE(SUB_DEBUG, 0, Enable submission-detection debug messages)
  160. esac ],
  161. [ AC_MSG_RESULT(no)
  162. AC_DEFINE(SUB_DEBUG, 0, Enable submission-detection debug messages)
  163. ])
  164. AC_DEFINE(ALLOW_MULTIPLE, 1, Allow multiple-submissions in one POST to the AudioScrobbler server)
  165. dnl APE Preference check
  166. AC_MSG_CHECKING([whether to prefer APE to ID3v2])
  167. AC_ARG_ENABLE([prefer-ape],
  168. AC_HELP_STRING([--enable-prefer-ape], [prefer APE tags to ID3v2 (default is NO)]),
  169. [ case "${enableval}" in
  170. yes)
  171. AC_MSG_RESULT(yes)
  172. AC_DEFINE([PREFER_APE], 1, [Define if APE tags are preferred to ID3v2 tags])
  173. ;;
  174. *)
  175. AC_MSG_RESULT(no)
  176. ;;
  177. esac ],
  178. AC_MSG_RESULT(no))
  179. dnl Checks for header files
  180. AC_CHECK_HEADER([curl/curl.h],,AC_MSG_ERROR([*** unable to find libcurl headers]))
  181. dnl Checks for libmusicbrainz
  182. AC_CHECK_LIB(musicbrainz, mb_GetVersion,,
  183. echo "*"
  184. echo "* The MusicBrainz client library needs to be installed "
  185. echo "* to build this plugin. Please download the library from "
  186. echo "* http://www.musicbrainz.org/download "
  187. echo "*"
  188. AC_MSG_ERROR("Cannot build. Stop.")
  189. ,-lstdc++)
  190. LIBS="-lmusicbrainz -lstdc++"
  191. AC_TRY_RUN([
  192. #include <musicbrainz/mb_c.h>
  193. int main ()
  194. {
  195. int major, minor, rev;
  196. musicbrainz_t o;
  197. o = mb_New();
  198. mb_GetVersion(o, &major, &minor, &rev);
  199. mb_Delete(o);
  200. if (major >= 2)
  201. {
  202. return 0;
  203. }
  204. return -1;
  205. }
  206. ],have_mbver=true,have_mbver=false,have_mbver=false)
  207. dnl libcurl check
  208. AC_CACHE_VAL(my_cv_curl_vers,[
  209. my_cv_curl_vers=NONE
  210. dnl check is the plain-text version of the required version
  211. check="7.9.7"
  212. dnl check_hex must be UPPERCASE if any hex letters are present
  213. check_hex="070907"
  214. AC_MSG_CHECKING([for curl >= $check])
  215. if eval curl-config --version 2>/dev/null >/dev/null; then
  216. ver=`curl-config --version | sed -e "s/libcurl //g"`
  217. hex_ver=`curl-config --vernum | tr 'a-f' 'A-F'`
  218. ok=`echo "ibase=16; if($hex_ver>=$check_hex) $hex_ver else 0" | bc`
  219. if test x$ok != x0; then
  220. my_cv_curl_vers="$ver"
  221. AC_MSG_RESULT([$my_cv_curl_vers])
  222. else
  223. AC_MSG_RESULT(FAILED)
  224. AC_MSG_WARN([$ver is too old. Need version $check or higher.])
  225. fi
  226. else
  227. AC_MSG_RESULT(FAILED)
  228. AC_MSG_WARN([curl-config was not found])
  229. fi
  230. ])
  231. # AC_CHECK_LIB([curl], [curl_global_init],, AC_MSG_ERROR([*** unable to link with libcurl]))
  232. LIBS="$LIBS $GTKLIBS"
  233. AC_MSG_CHECKING([for version >= 2.0.0 in -lmusicbrainz])
  234. if test "$have_mbver" = "false"; then
  235. AC_MSG_RESULT([no])
  236. echo "*"
  237. echo "* Version 2.0.0 or higher of the MusicBrainz "
  238. echo "* client library needs to be installed to build this application. "
  239. echo "* Please download the library from: "
  240. echo "* http://musicbrainz.org/products/client/download.html "
  241. echo "*"
  242. AC_MSG_ERROR([Cannot build. Stop.])
  243. else
  244. AC_MSG_RESULT([yes])
  245. fi
  246. AC_OUTPUT(Makefile)