1
# ===========================================================================
2
# http://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
# 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.
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.
34
# You should have received a copy of the GNU General Public License along
35
# with this program. If not, see <http://www.gnu.org/licenses/>.
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.
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.
52
AC_DEFUN([AX_PATH_LIB_PCRE],[dnl
53
AC_MSG_CHECKING([lib pcre])
55
[ --with-pcre[[=prefix]] compile xmlpcre part (via libpcre check)],,
57
if test ".$with_pcre" = ".no" ; then
58
AC_MSG_RESULT([disabled])
61
AC_MSG_RESULT([(testing)])
62
AC_CHECK_LIB(pcre, pcre_study)
63
if test "$ac_cv_lib_pcre_pcre_study" = "yes" ; then
65
AC_MSG_CHECKING([lib pcre])
66
AC_MSG_RESULT([$PCRE_LIBS])
69
OLDLDFLAGS="$LDFLAGS" ; LDFLAGS="$LDFLAGS -L$with_pcre/lib"
70
OLDCPPFLAGS="$CPPFLAGS" ; CPPFLAGS="$CPPFLAGS -I$with_pcre/include"
71
AC_CHECK_LIB(pcre, pcre_compile)
72
CPPFLAGS="$OLDCPPFLAGS"
74
if test "$ac_cv_lib_pcre_pcre_compile" = "yes" ; then
75
AC_MSG_RESULT(.setting PCRE_LIBS -L$with_pcre/lib -lpcre)
76
PCRE_LIBS="-L$with_pcre/lib -lpcre"
77
test -d "$with_pcre/include" && PCRE_CFLAGS="-I$with_pcre/include"
78
AC_MSG_CHECKING([lib pcre])
79
AC_MSG_RESULT([$PCRE_LIBS])
82
AC_MSG_CHECKING([lib pcre])
83
AC_MSG_RESULT([no, (WARNING)])
89
AC_SUBST([PCRE_CFLAGS])