~posulliv/drizzle/memcached_applier

« back to all changes in this revision

Viewing changes to m4/pandora_have_libpq.m4

  • Committer: Jay Pipes
  • Date: 2009-08-03 14:23:22 UTC
  • mfrom: (1039.2.68 staging)
  • mto: This revision was merged to the branch mainline in revision 1078.
  • Revision ID: jpipes@serialcoder-20090803142322-1g67h7su9mocg9ig
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
  AC_CHECK_HEADERS([libpq-fe.h])
 
10
  dnl --------------------------------------------------------------------
 
11
  dnl  Check for libpq
 
12
  dnl --------------------------------------------------------------------
 
13
 
 
14
  AC_LIB_HAVE_LINKFLAGS(pq,,[
 
15
    #ifdef HAVE_LIBPQ_FE_H
 
16
    # include <libpq-fe.h>
 
17
    #else
 
18
    # include <postgresql/libpq-fe.h>
 
19
    #endif
 
20
  ], [
 
21
    PGconn *conn;
 
22
    conn = PQconnectdb(NULL);
 
23
  ])
 
24
  
 
25
  AM_CONDITIONAL(HAVE_LIBPQ, [test "x${ac_cv_libpq}" = "xyes"])
 
26
])
 
27
 
 
28
AC_DEFUN([PANDORA_HAVE_LIBPQ],[
 
29
  AC_REQUIRE([_PANDORA_SEARCH_LIBPQ])
 
30
])
 
31
 
 
32
AC_DEFUN([PANDORA_REQUIRE_LIBPQ],[
 
33
  AC_REQUIRE([PANDORA_HAVE_LIBPQ])
 
34
  AS_IF([test x$ac_cv_libpq = xno],
 
35
      AC_MSG_ERROR([libpq is required for ${PACKAGE}]))
 
36
])