Merge Monty
[m6w6/libmemcached] / m4 / pandora_have_libpq.m4
1 dnl Copyright (C) 2009 Sun Microsystems
2 dnl This file is free software; Sun Microsystems
3 dnl gives unlimited permission to copy and/or distribute it,
4 dnl with or without modifications, as long as this notice is preserved.
5
6 AC_DEFUN([_PANDORA_SEARCH_LIBPQ],[
7 AC_REQUIRE([AC_LIB_PREFIX])
8
9 dnl --------------------------------------------------------------------
10 dnl Check for libpq
11 dnl --------------------------------------------------------------------
12
13 AC_LIB_HAVE_LINKFLAGS(pq,,[
14 #include <libpq-fe.h>
15 ], [
16 PGconn *conn;
17 conn = PQconnectdb(NULL);
18 ])
19
20 AM_CONDITIONAL(HAVE_LIBPQ, [test "x${ac_cv_libpq}" = "xyes"])
21 ])
22
23 AC_DEFUN([PANDORA_HAVE_LIBPQ],[
24 AC_REQUIRE([_PANDORA_SEARCH_LIBPQ])
25 ])
26
27 AC_DEFUN([PANDORA_REQUIRE_LIBPQ],[
28 AC_REQUIRE([PANDORA_HAVE_LIBPQ])
29 AS_IF([test x$ac_cv_libpq = xno],
30 AC_MSG_ERROR([libpq is required for ${PACKAGE}]))
31 ])