aclocal.m4 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. # generated automatically by aclocal 1.11.1 -*- Autoconf -*-
  2. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
  3. # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
  4. # This file is free software; the Free Software Foundation
  5. # gives unlimited permission to copy and/or distribute it,
  6. # with or without modifications, as long as this notice is preserved.
  7. # This program is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  9. # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  10. # PARTICULAR PURPOSE.
  11. # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
  12. # serial 1 (pkg-config-0.24)
  13. #
  14. # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
  15. #
  16. # This program is free software; you can redistribute it and/or modify
  17. # it under the terms of the GNU General Public License as published by
  18. # the Free Software Foundation; either version 2 of the License, or
  19. # (at your option) any later version.
  20. #
  21. # This program is distributed in the hope that it will be useful, but
  22. # WITHOUT ANY WARRANTY; without even the implied warranty of
  23. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  24. # General Public License for more details.
  25. #
  26. # You should have received a copy of the GNU General Public License
  27. # along with this program; if not, write to the Free Software
  28. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  29. #
  30. # As a special exception to the GNU General Public License, if you
  31. # distribute this file as part of a program that contains a
  32. # configuration script generated by Autoconf, you may include it under
  33. # the same distribution terms that you use for the rest of that program.
  34. # PKG_PROG_PKG_CONFIG([MIN-VERSION])
  35. # ----------------------------------
  36. AC_DEFUN([PKG_PROG_PKG_CONFIG],
  37. [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
  38. m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
  39. m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
  40. AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
  41. AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
  42. AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
  43. if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
  44. AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
  45. fi
  46. if test -n "$PKG_CONFIG"; then
  47. _pkg_min_version=m4_default([$1], [0.9.0])
  48. AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
  49. if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
  50. AC_MSG_RESULT([yes])
  51. else
  52. AC_MSG_RESULT([no])
  53. PKG_CONFIG=""
  54. fi
  55. fi[]dnl
  56. ])# PKG_PROG_PKG_CONFIG
  57. # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  58. #
  59. # Check to see whether a particular set of modules exists. Similar
  60. # to PKG_CHECK_MODULES(), but does not set variables or print errors.
  61. #
  62. # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  63. # only at the first occurence in configure.ac, so if the first place
  64. # it's called might be skipped (such as if it is within an "if", you
  65. # have to call PKG_CHECK_EXISTS manually
  66. # --------------------------------------------------------------
  67. AC_DEFUN([PKG_CHECK_EXISTS],
  68. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  69. if test -n "$PKG_CONFIG" && \
  70. AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
  71. m4_default([$2], [:])
  72. m4_ifvaln([$3], [else
  73. $3])dnl
  74. fi])
  75. # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
  76. # ---------------------------------------------
  77. m4_define([_PKG_CONFIG],
  78. [if test -n "$$1"; then
  79. pkg_cv_[]$1="$$1"
  80. elif test -n "$PKG_CONFIG"; then
  81. PKG_CHECK_EXISTS([$3],
  82. [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
  83. test "x$?" != "x0" && pkg_failed=yes ],
  84. [pkg_failed=yes])
  85. else
  86. pkg_failed=untried
  87. fi[]dnl
  88. ])# _PKG_CONFIG
  89. # _PKG_SHORT_ERRORS_SUPPORTED
  90. # -----------------------------
  91. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
  92. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  93. if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
  94. _pkg_short_errors_supported=yes
  95. else
  96. _pkg_short_errors_supported=no
  97. fi[]dnl
  98. ])# _PKG_SHORT_ERRORS_SUPPORTED
  99. # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
  100. # [ACTION-IF-NOT-FOUND])
  101. #
  102. #
  103. # Note that if there is a possibility the first call to
  104. # PKG_CHECK_MODULES might not happen, you should be sure to include an
  105. # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
  106. #
  107. #
  108. # --------------------------------------------------------------
  109. AC_DEFUN([PKG_CHECK_MODULES],
  110. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  111. AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
  112. AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
  113. pkg_failed=no
  114. AC_MSG_CHECKING([for $1])
  115. _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
  116. _PKG_CONFIG([$1][_LIBS], [libs], [$2])
  117. m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
  118. and $1[]_LIBS to avoid the need to call pkg-config.
  119. See the pkg-config man page for more details.])
  120. if test $pkg_failed = yes; then
  121. AC_MSG_RESULT([no])
  122. _PKG_SHORT_ERRORS_SUPPORTED
  123. if test $_pkg_short_errors_supported = yes; then
  124. $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
  125. else
  126. $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
  127. fi
  128. # Put the nasty error message in config.log where it belongs
  129. echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
  130. m4_default([$4], [AC_MSG_ERROR(
  131. [Package requirements ($2) were not met:
  132. $$1_PKG_ERRORS
  133. Consider adjusting the PKG_CONFIG_PATH environment variable if you
  134. installed software in a non-standard prefix.
  135. _PKG_TEXT])[]dnl
  136. ])
  137. elif test $pkg_failed = untried; then
  138. AC_MSG_RESULT([no])
  139. m4_default([$4], [AC_MSG_FAILURE(
  140. [The pkg-config script could not be found or is too old. Make sure it
  141. is in your PATH or set the PKG_CONFIG environment variable to the full
  142. path to pkg-config.
  143. _PKG_TEXT
  144. To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
  145. ])
  146. else
  147. $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
  148. $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
  149. AC_MSG_RESULT([yes])
  150. $3
  151. fi[]dnl
  152. ])# PKG_CHECK_MODULES
  153. # PKG_INSTALLDIR(DIRECTORY)
  154. # -------------------------
  155. # Substitutes the variable pkgconfigdir as the location where a module
  156. # should install pkg-config .pc files. By default the directory is
  157. # $libdir/pkgconfig, but the default can be changed by passing
  158. # DIRECTORY. The user can override through the --with-pkgconfigdir
  159. # parameter.
  160. AC_DEFUN([PKG_INSTALLDIR],
  161. [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
  162. m4_pushdef([pkg_description],
  163. [pkg-config installation directory @<:@]pkg_default[@:>@])
  164. AC_ARG_WITH([pkgconfigdir],
  165. [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
  166. [with_pkgconfigdir=]pkg_default)
  167. AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
  168. m4_popdef([pkg_default])
  169. m4_popdef([pkg_description])
  170. ]) dnl PKG_INSTALLDIR
  171. # PKG_NOARCH_INSTALLDIR(DIRECTORY)
  172. # -------------------------
  173. # Substitutes the variable noarch_pkgconfigdir as the location where a
  174. # module should install arch-independent pkg-config .pc files. By
  175. # default the directory is $datadir/pkgconfig, but the default can be
  176. # changed by passing DIRECTORY. The user can override through the
  177. # --with-noarch-pkgconfigdir parameter.
  178. AC_DEFUN([PKG_NOARCH_INSTALLDIR],
  179. [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
  180. m4_pushdef([pkg_description],
  181. [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
  182. AC_ARG_WITH([noarch-pkgconfigdir],
  183. [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
  184. [with_noarch_pkgconfigdir=]pkg_default)
  185. AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
  186. m4_popdef([pkg_default])
  187. m4_popdef([pkg_description])
  188. ]) dnl PKG_NOARCH_INSTALLDIR
  189. # PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
  190. # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  191. # -------------------------------------------
  192. # Retrieves the value of the pkg-config variable for the given module.
  193. AC_DEFUN([PKG_CHECK_VAR],
  194. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  195. AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
  196. _PKG_CONFIG([$1], [variable="][$3]["], [$2])
  197. AS_VAR_COPY([$1], [pkg_cv_][$1])
  198. AS_VAR_IF([$1], [""], [$5], [$4])dnl
  199. ])# PKG_CHECK_VAR
  200. # AM_CONDITIONAL -*- Autoconf -*-
  201. # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
  202. # Free Software Foundation, Inc.
  203. #
  204. # This file is free software; the Free Software Foundation
  205. # gives unlimited permission to copy and/or distribute it,
  206. # with or without modifications, as long as this notice is preserved.
  207. # serial 9
  208. # AM_CONDITIONAL(NAME, SHELL-CONDITION)
  209. # -------------------------------------
  210. # Define a conditional.
  211. AC_DEFUN([AM_CONDITIONAL],
  212. [AC_PREREQ(2.52)dnl
  213. ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
  214. [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
  215. AC_SUBST([$1_TRUE])dnl
  216. AC_SUBST([$1_FALSE])dnl
  217. _AM_SUBST_NOTMAKE([$1_TRUE])dnl
  218. _AM_SUBST_NOTMAKE([$1_FALSE])dnl
  219. m4_define([_AM_COND_VALUE_$1], [$2])dnl
  220. if $2; then
  221. $1_TRUE=
  222. $1_FALSE='#'
  223. else
  224. $1_TRUE='#'
  225. $1_FALSE=
  226. fi
  227. AC_CONFIG_COMMANDS_PRE(
  228. [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
  229. AC_MSG_ERROR([[conditional "$1" was never defined.
  230. Usually this means the macro was only invoked conditionally.]])
  231. fi])])
  232. # Copyright (C) 2003, 2005 Free Software Foundation, Inc.
  233. #
  234. # This file is free software; the Free Software Foundation
  235. # gives unlimited permission to copy and/or distribute it,
  236. # with or without modifications, as long as this notice is preserved.
  237. # serial 2
  238. # Check whether the underlying file-system supports filenames
  239. # with a leading dot. For instance MS-DOS doesn't.
  240. AC_DEFUN([AM_SET_LEADING_DOT],
  241. [rm -rf .tst 2>/dev/null
  242. mkdir .tst 2>/dev/null
  243. if test -d .tst; then
  244. am__leading_dot=.
  245. else
  246. am__leading_dot=_
  247. fi
  248. rmdir .tst 2>/dev/null
  249. AC_SUBST([am__leading_dot])])
  250. # Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
  251. # From Jim Meyering
  252. # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
  253. # Free Software Foundation, Inc.
  254. #
  255. # This file is free software; the Free Software Foundation
  256. # gives unlimited permission to copy and/or distribute it,
  257. # with or without modifications, as long as this notice is preserved.
  258. # serial 5
  259. # AM_MAINTAINER_MODE([DEFAULT-MODE])
  260. # ----------------------------------
  261. # Control maintainer-specific portions of Makefiles.
  262. # Default is to disable them, unless `enable' is passed literally.
  263. # For symmetry, `disable' may be passed as well. Anyway, the user
  264. # can override the default with the --enable/--disable switch.
  265. AC_DEFUN([AM_MAINTAINER_MODE],
  266. [m4_case(m4_default([$1], [disable]),
  267. [enable], [m4_define([am_maintainer_other], [disable])],
  268. [disable], [m4_define([am_maintainer_other], [enable])],
  269. [m4_define([am_maintainer_other], [enable])
  270. m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
  271. AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
  272. dnl maintainer-mode's default is 'disable' unless 'enable' is passed
  273. AC_ARG_ENABLE([maintainer-mode],
  274. [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful
  275. (and sometimes confusing) to the casual installer],
  276. [USE_MAINTAINER_MODE=$enableval],
  277. [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
  278. AC_MSG_RESULT([$USE_MAINTAINER_MODE])
  279. AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
  280. MAINT=$MAINTAINER_MODE_TRUE
  281. AC_SUBST([MAINT])dnl
  282. ]
  283. )
  284. AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
  285. # Copyright (C) 2006, 2008 Free Software Foundation, Inc.
  286. #
  287. # This file is free software; the Free Software Foundation
  288. # gives unlimited permission to copy and/or distribute it,
  289. # with or without modifications, as long as this notice is preserved.
  290. # serial 2
  291. # _AM_SUBST_NOTMAKE(VARIABLE)
  292. # ---------------------------
  293. # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
  294. # This macro is traced by Automake.
  295. AC_DEFUN([_AM_SUBST_NOTMAKE])
  296. # AM_SUBST_NOTMAKE(VARIABLE)
  297. # ---------------------------
  298. # Public sister of _AM_SUBST_NOTMAKE.
  299. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])