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.

91 lines
3.4KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_path_lib_pcre.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_PATH_LIB_PCRE [(A/NA)]
  8. #
  9. # DESCRIPTION
  10. #
  11. # check for pcre lib and set PCRE_LIBS and PCRE_CFLAGS accordingly.
  12. #
  13. # also provide --with-pcre option that may point to the $prefix of the
  14. # pcre installation - the macro will check $pcre/include and $pcre/lib to
  15. # contain the necessary files.
  16. #
  17. # the usual two ACTION-IF-FOUND / ACTION-IF-NOT-FOUND are supported and
  18. # they can take advantage of the LIBS/CFLAGS additions.
  19. #
  20. # LICENSE
  21. #
  22. # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
  23. #
  24. # This program is free software; you can redistribute it and/or modify it
  25. # under the terms of the GNU General Public License as published by the
  26. # Free Software Foundation; either version 3 of the License, or (at your
  27. # option) any later version.
  28. #
  29. # This program is distributed in the hope that it will be useful, but
  30. # WITHOUT ANY WARRANTY; without even the implied warranty of
  31. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  32. # Public License for more details.
  33. #
  34. # You should have received a copy of the GNU General Public License along
  35. # with this program. If not, see <https://www.gnu.org/licenses/>.
  36. #
  37. # As a special exception, the respective Autoconf Macro's copyright owner
  38. # gives unlimited permission to copy, distribute and modify the configure
  39. # scripts that are the output of Autoconf when processing the Macro. You
  40. # need not follow the terms of the GNU General Public License when using
  41. # or distributing such scripts, even though portions of the text of the
  42. # Macro appear in them. The GNU General Public License (GPL) does govern
  43. # all other use of the material that constitutes the Autoconf Macro.
  44. #
  45. # This special exception to the GPL applies to versions of the Autoconf
  46. # Macro released by the Autoconf Archive. When you make and distribute a
  47. # modified version of the Autoconf Macro, you may extend this special
  48. # exception to the GPL to apply to your modified version as well.
  49. #serial 8
  50. AC_DEFUN([AX_PATH_LIB_PCRE],[dnl
  51. AC_MSG_CHECKING([lib pcre])
  52. AC_ARG_WITH(pcre,
  53. [ --with-pcre[[=prefix]] compile xmlpcre part (via libpcre check)],,
  54. with_pcre="yes")
  55. if test ".$with_pcre" = ".no" ; then
  56. AC_MSG_RESULT([disabled])
  57. m4_ifval($2,$2)
  58. else
  59. AC_MSG_RESULT([(testing)])
  60. AC_CHECK_LIB(pcre, pcre_study)
  61. if test "$ac_cv_lib_pcre_pcre_study" = "yes" ; then
  62. PCRE_LIBS="-lpcre"
  63. AC_MSG_CHECKING([lib pcre])
  64. AC_MSG_RESULT([$PCRE_LIBS])
  65. m4_ifval($1,$1)
  66. else
  67. OLDLDFLAGS="$LDFLAGS" ; LDFLAGS="$LDFLAGS -L$with_pcre/lib"
  68. OLDCPPFLAGS="$CPPFLAGS" ; CPPFLAGS="$CPPFLAGS -I$with_pcre/include"
  69. AC_CHECK_LIB(pcre, pcre_compile)
  70. CPPFLAGS="$OLDCPPFLAGS"
  71. LDFLAGS="$OLDLDFLAGS"
  72. if test "$ac_cv_lib_pcre_pcre_compile" = "yes" ; then
  73. AC_MSG_RESULT(.setting PCRE_LIBS -L$with_pcre/lib -lpcre)
  74. PCRE_LIBS="-L$with_pcre/lib -lpcre"
  75. test -d "$with_pcre/include" && PCRE_CFLAGS="-I$with_pcre/include"
  76. AC_MSG_CHECKING([lib pcre])
  77. AC_MSG_RESULT([$PCRE_LIBS])
  78. m4_ifval($1,$1)
  79. else
  80. AC_MSG_CHECKING([lib pcre])
  81. AC_MSG_RESULT([no, (WARNING)])
  82. m4_ifval($2,$2)
  83. fi
  84. fi
  85. fi
  86. AC_SUBST([PCRE_LIBS])
  87. AC_SUBST([PCRE_CFLAGS])
  88. ])