Collection of DPF-based plugins for packaging
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.

87 lines
2.5KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_zmq.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_ZMQ([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  8. #
  9. # DESCRIPTION
  10. #
  11. # Test for the ZMQ libraries of a particular version (or newer). The
  12. # default version tested for is 4.0.0.
  13. #
  14. # The macro tests for ZMQ libraries in the library/include path, and, when
  15. # provided, also in the path given by --with-zmq.
  16. #
  17. # This macro calls:
  18. #
  19. # AC_SUBST(ZMQ_CPPFLAGS) / AC_SUBST(ZMQ_LDFLAGS) / AC_SUBST(ZMQ_LIBS)
  20. #
  21. # And sets:
  22. #
  23. # HAVE_ZMQ
  24. #
  25. # LICENSE
  26. #
  27. # Copyright (c) 2016 Jeroen Meijer <jjgmeijer@gmail.com>
  28. #
  29. # Copying and distribution of this file, with or without modification, are
  30. # permitted in any medium without royalty provided the copyright notice
  31. # and this notice are preserved. This file is offered as-is, without any
  32. # warranty.
  33. #serial 2
  34. AC_DEFUN([AX_ZMQ], [
  35. AC_ARG_WITH([zmq], [AS_HELP_STRING([--with-zmq=<prefix>],[ZMQ prefix directory])], [
  36. ZMQ_LDFLAGS="-L${with_zmq}/lib"
  37. ZMQ_CPPFLAGS="-I${with_zmq}/include"
  38. ])
  39. HAVE_ZMQ=0
  40. if test "$with_zmq" != "no"; then
  41. LD_FLAGS="$LDFLAGS $ZMQ_LDFLAGS"
  42. CPPFLAGS="$CPPFLAGS $ZMQ_CPPFLAGS"
  43. AC_LANG_SAVE
  44. AC_LANG_C
  45. AC_CHECK_HEADER(zmq.h, [zmq_h=yes], [zmq_h=no])
  46. AC_LANG_RESTORE
  47. if test "$zmq_h" = "yes"; then
  48. version=ifelse([$1], ,4.0.0,$1)
  49. AC_MSG_CHECKING([for ZMQ version >= $version])
  50. version=$(echo $version | tr '.' ',')
  51. AC_EGREP_CPP([version_ok], [
  52. #include <zmq.h>
  53. #if defined(ZMQ_VERSION) && ZMQ_VERSION >= ZMQ_MAKE_VERSION($version)
  54. version_ok
  55. #endif
  56. ],[
  57. AC_MSG_RESULT(yes)
  58. HAVE_ZMQ=1
  59. ZMQ_LIBS="-lzmq"
  60. AC_SUBST(ZMQ_LDFLAGS)
  61. AC_SUBST(ZMQ_CPPFLAGS)
  62. AC_SUBST(ZMQ_LIBS)
  63. ], AC_MSG_RESULT([no valid ZMQ version was found]))
  64. else
  65. AC_MSG_WARN([no valid ZMQ installation was found])
  66. fi
  67. if test $HAVE_ZMQ = 1; then
  68. # execute ACTION-IF-FOUND (if present):
  69. ifelse([$2], , :, [$2])
  70. else
  71. # execute ACTION-IF-NOT-FOUND (if present):
  72. ifelse([$3], , :, [$3])
  73. fi
  74. else
  75. AC_MSG_NOTICE([not checking for ZMQ])
  76. fi
  77. AC_DEFINE(HAVE_ZMQ,,[define if the ZMQ library is available])
  78. ])