You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

247 lines
7.0 KiB

  1. AC_PREREQ(2.62)
  2. m4_define(xplayer_version_major, 1)
  3. m4_define(xplayer_version_minor, 0)
  4. m4_define(xplayer_version_micro, 2)
  5. AC_INIT([xplayer-pl-parser],
  6. [xplayer_version_major.xplayer_version_minor.xplayer_version_micro],
  7. [http://github.com/linuxmint/xplayer-plparser])
  8. AC_CONFIG_SRCDIR([plparse/xplayer-pl-parser.c])
  9. AC_CONFIG_HEADERS([config.h])
  10. AC_CONFIG_MACRO_DIR([m4])
  11. AM_INIT_AUTOMAKE([1.9 dist-xz no-dist-gzip check-news subdir-objects])
  12. AM_MAINTAINER_MODE([enable])
  13. AC_USE_SYSTEM_EXTENSIONS
  14. # Enable silent build when available (Automake 1.11)
  15. m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
  16. dnl Add the languages which your application supports to po/LINGUAS
  17. GETTEXT_PACKAGE=xplayer-pl-parser
  18. AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], [Define to the Gettext package name])
  19. AC_SUBST(GETTEXT_PACKAGE)
  20. IT_PROG_INTLTOOL([0.35.0])
  21. AC_PROG_CXX
  22. AM_PROG_CC_C_O
  23. # Initialize libtool
  24. LT_PREREQ([2.2])
  25. LT_INIT([])
  26. PKG_PROG_PKG_CONFIG
  27. dnl Use local version of asprintf when not on the current system.
  28. AC_CHECK_FUNCS(asprintf)
  29. AC_CONFIG_LIBOBJ_DIR([lib])
  30. AC_REPLACE_FUNCS([asprintf])
  31. AC_PATH_PROG([GLIB_GENMARSHAL],[glib-genmarshal])
  32. AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
  33. # Requirements
  34. GLIB_REQS=2.31.0
  35. GIO_REQS=2.24.0
  36. QUVI_REQS=0.9.1
  37. LIBARCHIVE_REQS=3.0
  38. LIBSOUP_REQS=2.43.0
  39. # Before making a release, the PLPARSER_LT_VERSION string should be modified.
  40. # The string is of the form C:R:A.
  41. # - If interfaces have been changed or added, but binary compatibility has
  42. # been preserved, change to C+1:0:A+1
  43. # - If binary compatibility has been broken (eg removed or changed interfaces)
  44. # change to C+1:0:0
  45. # - If the interface is the same as the previous version, change to C:R+1:A
  46. PLPARSER_LT_VERSION=19:0:1
  47. AC_SUBST(PLPARSER_LT_VERSION)
  48. XPLAYER_PL_PARSER_VERSION_MAJOR=xplayer_version_major
  49. XPLAYER_PL_PARSER_VERSION_MINOR=xplayer_version_minor
  50. XPLAYER_PL_PARSER_VERSION_MICRO=xplayer_version_micro
  51. AC_SUBST(XPLAYER_PL_PARSER_VERSION_MAJOR)
  52. AC_SUBST(XPLAYER_PL_PARSER_VERSION_MINOR)
  53. AC_SUBST(XPLAYER_PL_PARSER_VERSION_MICRO)
  54. pkg_modules="glib-2.0 >= $GLIB_REQS libxml-2.0 gthread-2.0 gio-2.0 >= $GIO_REQS libsoup-2.4 >= $LIBSOUP_REQS"
  55. ##################################
  56. # Checking libgmime dependency
  57. ##################################
  58. gmime_message=""
  59. AC_ARG_ENABLE(gmime-i-know-what-im-doing,
  60. AS_HELP_STRING([--disable-gmime-i-know-what-im-doing],
  61. [Disable libgmime (Unsupported, breaks Podcast support).]),
  62. [enable_gmime=no],
  63. [enable_gmime=yes])
  64. if test "x$enable_gmime" = "xyes" ; then
  65. PKG_CHECK_MODULES(GMIME,
  66. gmime-2.6,
  67. [have_gmime=yes GMIME=gmime-2.6],
  68. [have_gmime=no])
  69. if test "x$have_gmime" = "xyes" ; then
  70. AC_SUBST(GMIME, $GMIME)
  71. AC_SUBST(USEGMIME, yes)
  72. AC_DEFINE(HAVE_GMIME, 1, [GMime available in the system])
  73. pkg_modules="$pkg_modules $GMIME"
  74. else
  75. AC_MSG_ERROR([libgmime is required to compile xplayer-pl-parser.])
  76. fi
  77. else
  78. AC_SUBST(USEGMIME, no)
  79. gmime_message="
  80. **************************************************************
  81. Compiling xplayer-pl-parser without libgmime.
  82. This will break podcast support and is completely unsupported.
  83. **************************************************************"
  84. fi
  85. ##################################
  86. # Checking quvi dependency
  87. ##################################
  88. QUVI=""
  89. AC_ARG_ENABLE(quvi,
  90. AS_HELP_STRING([--enable-quvi],
  91. [Enable libquvi support (default is auto).]),
  92. [],
  93. [enable_quvi=auto])
  94. if test "x$enable_quvi" != "xno" ; then
  95. PKG_CHECK_MODULES(QUVI,
  96. libquvi-0.9 >= $QUVI_REQS glib-2.0,
  97. [have_quvi=yes], [have_quvi=no])
  98. if test "x$enable_quvi" = "xyes" -a "x$have_quvi" = "xno" ; then
  99. AC_MSG_ERROR([Quvi support requested but not available.])
  100. fi
  101. if test "x$have_quvi" = "xyes" ; then
  102. QUVI="libquvi-0.9"
  103. AC_DEFINE(HAVE_QUVI, 1, [libquvi available in the system])
  104. fi
  105. fi
  106. AC_SUBST(QUVI, $QUVI)
  107. AM_CONDITIONAL([HAVE_QUVI], [test "$have_quvi" = "yes"])
  108. ##################################
  109. # Checking libarchive dependency
  110. ##################################
  111. ARCHIVE=""
  112. AC_ARG_ENABLE(libarchive,
  113. AS_HELP_STRING([--enable-libarchive],
  114. [Enable libarchive support (default is auto).]),
  115. [],
  116. [enable_libarchive=auto])
  117. if test "x$enable_libarchive" != "xno" ; then
  118. PKG_CHECK_MODULES(ARCHIVE,
  119. libarchive >= $LIBARCHIVE_REQS,
  120. [have_libarchive=yes], [have_libarchive=no])
  121. if test "x$enable_libarchive" = "xyes" -a "x$have_libarchive" = "xno" ; then
  122. AC_MSG_ERROR([Libarchive support requested but not available.])
  123. fi
  124. if test "x$have_libarchive" = "xyes" ; then
  125. pkg_modules="$pkg_modules libarchive"
  126. ARCHIVE="libarchive"
  127. AC_DEFINE(HAVE_LIBARCHIVE, 1, [libarchive available in the system])
  128. fi
  129. fi
  130. AC_SUBST(ARCHIVE, $ARCHIVE)
  131. ################################
  132. # Checking libgcrypt dependency
  133. ################################
  134. AM_PATH_LIBGCRYPT([],[have_libgcrypt=yes],[have_libgcrypt=no])
  135. ARCHIVE=""
  136. AC_ARG_ENABLE(libgcrypt,
  137. AS_HELP_STRING([--enable-libgcrypt],
  138. [Enable libgcrypt support (default is auto).]),
  139. [],
  140. [enable_libgcrypt=auto])
  141. if test "x$enable_libgcrypt" != "xno" ; then
  142. if test "x$enable_libgcrypt" = "xyes" -a "x$have_libgcrypt" = "xno" ; then
  143. AC_MSG_ERROR([Libgcrypt support requested but not available.])
  144. fi
  145. if test "x$have_libgcrypt" = "xyes" ; then
  146. AC_DEFINE(HAVE_LIBGCRYPT, 1, [libgcrypt available in the system])
  147. use_libgcrypt=yes
  148. fi
  149. fi
  150. dnl Check for packages for building libxplayer-plparser.la
  151. PKG_CHECK_MODULES(XPLAYER_PLPARSER, [$pkg_modules])
  152. AC_SUBST(XPLAYER_PLPARSER_CFLAGS)
  153. AC_SUBST(XPLAYER_PLPARSER_LIBS)
  154. PKG_CHECK_MODULES([XPLAYER_PLPARSER_MINI], [gio-2.0])
  155. GNOME_DEBUG_CHECK
  156. GNOME_COMPILE_WARNINGS([maximum])
  157. GNOME_CXX_WARNINGS
  158. GNOME_MAINTAINER_MODE_DEFINES
  159. if test "$GCC" = "yes" ; then
  160. CFLAGS="\
  161. -Wall \
  162. -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
  163. -Wnested-externs -Wpointer-arith \
  164. -Wcast-align -Wsign-compare \
  165. -fno-strict-aliasing \
  166. $CFLAGS"
  167. fi
  168. AC_SUBST([AM_CPPFLAGS])
  169. AC_SUBST([AM_CFLAGS])
  170. AC_SUBST([AM_CXXFLAGS])
  171. AC_SUBST([AM_LDFLAGS])
  172. GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
  173. GOBJECT_INTROSPECTION_CHECK([0.9.5])
  174. GNOME_CODE_COVERAGE
  175. AC_CONFIG_FILES([
  176. Makefile
  177. xplayer-plparser.pc
  178. xplayer-plparser-uninstalled.pc
  179. xplayer-plparser-mini.pc
  180. xplayer-plparser-mini-uninstalled.pc
  181. xplayer-pl-parser.spec
  182. lib/Makefile
  183. plparse/Makefile
  184. plparse/tests/Makefile
  185. plparse/xplayer-pl-parser-features.h
  186. po/Makefile.in
  187. docs/Makefile
  188. docs/reference/Makefile
  189. docs/reference/version.xml
  190. ])
  191. AC_OUTPUT
  192. if test "x$have_quvi" = "xyes"; then
  193. AC_MSG_NOTICE([** Quvi video link parsing enabled])
  194. else
  195. AC_MSG_NOTICE([ Quvi video link parsing disabled])
  196. fi
  197. if test "x$have_libarchive" = "xyes"; then
  198. AC_MSG_NOTICE([** ISO detection with libarchive enabled])
  199. else
  200. AC_MSG_NOTICE([ ISO detection with libarchive disabled])
  201. fi
  202. if test "x$use_libgcrypt" = "xyes"; then
  203. AC_MSG_NOTICE([** AmazonAMZ decoding with libgcrypt enabled])
  204. else
  205. AC_MSG_NOTICE([ AmazonAMZ decoding with libgcrypt disabled])
  206. fi
  207. echo "
  208. $gmime_message
  209. "