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.

82 lines
2.3KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_lib_ev.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_LIB_EV([VERSION],[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
  8. #
  9. # DESCRIPTION
  10. #
  11. # Checks for libev mimicking pkg-config's way of doing things for as long
  12. # as upstream doesn't provide a .pc file. If successful and provided
  13. # expand ACTION-IF-FOUND, otherwise expand ACTION-IF-NOT-FOUND, or, if
  14. # omitted, error out like pkg-config does.
  15. #
  16. # Defines libev_LIBS and libev_CFLAGS.
  17. #
  18. # LICENSE
  19. #
  20. # Copyright (c) 2012 Sebastian Freundt <freundt@fresse.org>
  21. #
  22. # Copying and distribution of this file, with or without modification, are
  23. # permitted in any medium without royalty provided the copyright notice
  24. # and this notice are preserved. This file is offered as-is, without any
  25. # warranty.
  26. #serial 3
  27. AC_DEFUN([AX_CHECK_EV_H], [
  28. dnl AX_CHECK_EV_H([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  29. dnl defs: ax_cv_header_ev_h yes|no
  30. ## assume libev_CFLAGS have been set
  31. saved_CPPFLAGS="${CPPFLAGS}"
  32. CPPFLAGS="${CPPFLAGS} ${libev_CFLAGS}"
  33. ## not so fast, we need ev.h checks
  34. AC_CHECK_HEADER([ev.h], [
  35. ax_cv_header_ev_h="yes"
  36. $1
  37. ], [$2])
  38. CPPFLAGS="${saved_CPPFLAGS}"
  39. ])
  40. AU_ALIAS([AC_CHECK_LIBEV], [AX_LIB_EV])
  41. AC_DEFUN([AX_LIB_EV], [
  42. pushdef([VERSION], [m4_default([$1], [>= 4.0])])
  43. pushdef([ACTION_IF_FOUND], [$2])
  44. pushdef([ACTION_IF_NOT_FOUND], [$3])
  45. AC_CACHE_VAL([ax_cv_feat_libev], [
  46. ## assume failure
  47. ax_cv_feat_libev="no"
  48. PKG_CHECK_MODULES([libev], [libev ]VERSION[], [:], [:])
  49. ## CHECK_MODULES' if_found case
  50. AX_CHECK_EV_H([
  51. ax_cv_feat_libev="yes"
  52. if test -z "${pkg_cv_libev_LIBS}"; then
  53. libev_LIBS="${libev_LIBS} -lev"
  54. fi
  55. ACTION_IF_FOUND
  56. ], [
  57. m4_default([]ACTION_IF_NOT_FOUND[], [AC_MSG_ERROR([dnl
  58. Package requirements (libev version) were not met.
  59. Consider adjusting the PKG_CONFIG_PATH environment variable if you
  60. installed software in a non-standard prefix.
  61. Alternatively, you may set the environment variables libev_CFLAGS
  62. and libev_LIBS to avoid the need to call pkg-config.
  63. See the pkg-config man page for more details.])
  64. ])
  65. ])
  66. ])
  67. popdef([ACTION_IF_NOT_FOUND])
  68. popdef([ACTION_IF_FOUND])
  69. popdef([VERSION])
  70. ])dnl AX_LIB_EV