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.

77 lines
2.3KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_lib_nokalva.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_LIB_NOKALVA([ACTION-IF-TRUE], [ACTION-IF-FALSE])
  8. #
  9. # DESCRIPTION
  10. #
  11. # This macro will check for the existence of OSS Nokalva
  12. # (http://www.oss.com/products/). It does this by checking for the header
  13. # file asn1.h and the cppsoed library object file. A --with-nokalva option
  14. # is supported as well. The following output variables are set with
  15. # AC_SUBST:
  16. #
  17. # NOKALVA_CPPFLAGS
  18. # NOKALVA_LDFLAGS
  19. # NOKALVA_LIBS
  20. #
  21. # You can use them like this in Makefile.am:
  22. #
  23. # AM_CPPFLAGS = $(NOKALVA_CPPFLAGS)
  24. # AM_LDFLAGS = $(NOKALVA_LDFLAGS)
  25. # program_LDADD = $(NOKALVA_LIBS)
  26. #
  27. # Additionally, the C preprocessor symbol HAVE_NOKALVA will be defined
  28. # with AC_DEFINE if Nokalva is available.
  29. #
  30. # LICENSE
  31. #
  32. # Copyright (c) 2009 Krzysztof Burghardt <krzysztof@burghardt.pl>
  33. #
  34. # Copying and distribution of this file, with or without modification, are
  35. # permitted in any medium without royalty provided the copyright notice
  36. # and this notice are preserved. This file is offered as-is, without any
  37. # warranty.
  38. #serial 5
  39. AC_DEFUN([AX_LIB_NOKALVA], [
  40. AH_TEMPLATE([HAVE_NOKALVA], [Define if Nokalva is available])
  41. AC_ARG_WITH(nokalva, [ --with-nokalva=DIR prefix for Nokalva library files and headers], [
  42. if test "$withval" = "no"; then
  43. ac_nokalva_path=
  44. $2
  45. elif test "$withval" = "yes"; then
  46. ac_nokalva_path=/usr
  47. else
  48. ac_nokalva_path="$withval"
  49. fi
  50. ],[ac_nokalva_path=/usr])
  51. if test "$ac_nokalva_path" != ""; then
  52. saved_CPPFLAGS="$CPPFLAGS"
  53. CPPFLAGS="$CPPFLAGS -I$ac_nokalva_path/include"
  54. AC_CHECK_HEADER([asn1.h], [
  55. saved_LDFLAGS="$LDFLAGS"
  56. LDFLAGS="$LDFLAGS -L$ac_nokalva_path/lib"
  57. AC_CHECK_LIB(cppsoed, ossMalloc, [
  58. AC_SUBST(NOKALVA_CPPFLAGS, [-I$ac_nokalva_path/include])
  59. AC_SUBST(NOKALVA_LDFLAGS, [-L$ac_nokalva_path/lib])
  60. AC_SUBST(NOKALVA_LIBS, ["-ldl -lcppsoed -losscpp"])
  61. AC_DEFINE([HAVE_NOKALVA])
  62. $1
  63. ], [
  64. :
  65. $2
  66. ], [-ldl])
  67. LDFLAGS="$saved_LDFLAGS"
  68. ], [
  69. AC_MSG_RESULT([not found])
  70. $2
  71. ])
  72. CPPFLAGS="$saved_CPPFLAGS"
  73. fi
  74. ])