1 # ===========================================================================
2 # https://www.gnu.org/software/autoconf-archive/ax_path_lib_pcre.html
3 # ===========================================================================
7 # AX_PATH_LIB_PCRE [(A/NA)]
11 # check for pcre lib and set PCRE_LIBS and PCRE_CFLAGS accordingly.
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.
17 # the usual two ACTION-IF-FOUND / ACTION-IF-NOT-FOUND are supported and
18 # they can take advantage of the LIBS/CFLAGS additions.
22 # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
24 # Copying and distribution of this file, with or without modification, are
25 # permitted in any medium without royalty provided the copyright notice
26 # and this notice are preserved. This file is offered as-is, without any
31 AC_DEFUN([AX_PATH_LIB_PCRE],[dnl
32 AC_MSG_CHECKING([lib pcre])
34 [ --with-pcre[[=prefix]] compile xmlpcre part (via libpcre check)],,
36 if test ".$with_pcre" = ".no" ; then
37 AC_MSG_RESULT([disabled])
40 AC_MSG_RESULT([(testing)])
41 AC_CHECK_LIB(pcre, pcre_study)
42 if test "$ac_cv_lib_pcre_pcre_study" = "yes" ; then
44 AC_MSG_CHECKING([lib pcre])
45 AC_MSG_RESULT([$PCRE_LIBS])
48 OLDLDFLAGS="$LDFLAGS" ; LDFLAGS="$LDFLAGS -L$with_pcre/lib"
49 OLDCPPFLAGS="$CPPFLAGS" ; CPPFLAGS="$CPPFLAGS -I$with_pcre/include"
50 AC_CHECK_LIB(pcre, pcre_compile)
51 CPPFLAGS="$OLDCPPFLAGS"
53 if test "$ac_cv_lib_pcre_pcre_compile" = "yes" ; then
54 AC_MSG_RESULT(.setting PCRE_LIBS -L$with_pcre/lib -lpcre)
55 PCRE_LIBS="-L$with_pcre/lib -lpcre"
56 test -d "$with_pcre/include" && PCRE_CFLAGS="-I$with_pcre/include"
57 AC_MSG_CHECKING([lib pcre])
58 AC_MSG_RESULT([$PCRE_LIBS])
61 AC_MSG_CHECKING([lib pcre])
62 AC_MSG_RESULT([no, (WARNING)])
68 AC_SUBST([PCRE_CFLAGS])