~vjsamuel/drizzle/bug-616035

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
dnl  Copyright (C) 2009 Sun Microsystems
dnl This file is free software; Sun Microsystems
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.

#--------------------------------------------------------------------
# Check for libpcre
#--------------------------------------------------------------------


AC_DEFUN([_PANDORA_SEARCH_LIBPCRE],[
  AC_REQUIRE([AC_LIB_PREFIX])

  AC_LIB_HAVE_LINKFLAGS(pcre,,
  [#include <pcre.h>],
  [
    pcre *re= NULL;
    pcre_version();
  ])
  AS_IF([test "x$ac_cv_libpcre" = "xno"],
  [
    unset ac_cv_libpcre
    unset HAVE_LIBPCRE
    unset LIBPCRE
    unset LIBPCRE_PREFIX
    unset LTLIBPCRE
    AC_LIB_HAVE_LINKFLAGS(pcre,,
    [#include <pcre/pcre.h>],
    [
      pcre *re= NULL;
      pcre_version();
    ])
    AS_IF([test "x$ac_cv_libpcre" = "xyes"], [
      ac_cv_pcre_location="<pcre/pcre.h>"
    ])
  ],[
    ac_cv_pcre_location="<pcre.h>"
  ])

  AM_CONDITIONAL(HAVE_LIBPCRE, [test "x${ac_cv_libpcre}" = "xyes"])
])

AC_DEFUN([_PANDORA_HAVE_LIBPCRE],[

  AC_ARG_ENABLE([libpcre],
    [AS_HELP_STRING([--disable-libpcre],
      [Build with libpcre support @<:@default=on@:>@])],
    [ac_enable_libpcre="$enableval"],
    [ac_enable_libpcre="yes"])

  _PANDORA_SEARCH_LIBPCRE
])


AC_DEFUN([PANDORA_HAVE_LIBPCRE],[
  AC_REQUIRE([_PANDORA_HAVE_LIBPCRE])
])

AC_DEFUN([_PANDORA_REQUIRE_LIBPCRE],[
  ac_enable_libpcre="yes"
  _PANDORA_SEARCH_LIBPCRE

  AS_IF([test x$ac_cv_libpcre = xno],[
    AC_MSG_ERROR([libpcre is required for ${PACKAGE}. On Debian this can be found in libpcre3-dev. On RedHat this can be found in pcre-devel.])
  ],[
    AC_DEFINE_UNQUOTED(PCRE_HEADER,[${ac_cv_pcre_location}],
                       [Location of pcre header])
  ])
])

AC_DEFUN([PANDORA_REQUIRE_LIBPCRE],[
  AC_REQUIRE([_PANDORA_REQUIRE_LIBPCRE])
])