gpg-error.m4 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # gpg-error.m4 - autoconf macro to detect libgpg-error.
  2. # Copyright (C) 2002, 2003, 2004, 2011, 2014 g10 Code GmbH
  3. #
  4. # This file is free software; as a special exception the author gives
  5. # unlimited permission to copy and/or distribute it, with or without
  6. # modifications, as long as this notice is preserved.
  7. #
  8. # This file is distributed in the hope that it will be useful, but
  9. # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
  10. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. #
  12. # Last-changed: 2014-10-02
  13. dnl AM_PATH_GPG_ERROR([MINIMUM-VERSION,
  14. dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
  15. dnl
  16. dnl Test for libgpg-error and define GPG_ERROR_CFLAGS, GPG_ERROR_LIBS,
  17. dnl GPG_ERROR_MT_CFLAGS, and GPG_ERROR_MT_LIBS. The _MT_ variants are
  18. dnl used for programs requireing real multi thread support.
  19. dnl
  20. dnl If a prefix option is not used, the config script is first
  21. dnl searched in $SYSROOT/bin and then along $PATH. If the used
  22. dnl config script does not match the host specification the script
  23. dnl is added to the gpg_config_script_warn variable.
  24. dnl
  25. AC_DEFUN([AM_PATH_GPG_ERROR],
  26. [ AC_REQUIRE([AC_CANONICAL_HOST])
  27. min_gpg_error_version=ifelse([$1], ,0.0,$1)
  28. PKG_CHECK_MODULES(GPG_ERROR, [gpg-error >= $min_gpg_error_version], [ok=yes], [ok=no])
  29. if test $ok = yes; then
  30. ifelse([$2], , :, [$2])
  31. gpg_error_config_host=`$PKG_CONFIG --variable=host gpg-error`
  32. if test x"$gpg_error_config_host" != xnone ; then
  33. if test x"$gpg_error_config_host" != x"$host" ; then
  34. AC_MSG_WARN([[
  35. ***
  36. *** The config script $GPG_ERROR_CONFIG was
  37. *** built for $gpg_error_config_host and thus may not match the
  38. *** used host $host.
  39. *** You may want to use the configure option --with-gpg-error-prefix
  40. *** to specify a matching config script or use \$SYSROOT.
  41. ***]])
  42. gpg_config_script_warn="$gpg_config_script_warn libgpg-error"
  43. fi
  44. fi
  45. else
  46. ifelse([$3], , :, [$3])
  47. fi
  48. AC_SUBST(GPG_ERROR_CFLAGS)
  49. AC_SUBST(GPG_ERROR_LIBS)
  50. AC_SUBST(GPG_ERROR_MT_CFLAGS)
  51. AC_SUBST(GPG_ERROR_MT_LIBS)
  52. ])