~drizzle-trunk/drizzle/development

1099.1.1 by Monty Taylor
pandora-build v0.23
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
1093.9.2 by Monty Taylor
pandora-build v0.35
13
  AC_ARG_ENABLE([libpq],
14
    [AS_HELP_STRING([--disable-libpq],
15
      [Build with libpq support @<:@default=on@:>@])],
16
    [ac_enable_libpq="$enableval"],
17
    [ac_enable_libpq="yes"])
18
19
  AS_IF([test "x$ac_enable_libpq" = "xyes"],[
20
    AC_CHECK_HEADERS([libpq-fe.h])
21
    AC_LIB_HAVE_LINKFLAGS(pq,,[
22
      #ifdef HAVE_LIBPQ_FE_H
23
      # include <libpq-fe.h>
24
      #else
25
      # include <postgresql/libpq-fe.h>
26
      #endif
27
    ], [
28
      PGconn *conn;
29
      conn = PQconnectdb(NULL);
30
    ])
31
  ],[
32
    ac_cv_libpq="no"
1099.1.1 by Monty Taylor
pandora-build v0.23
33
  ])
34
  
35
  AM_CONDITIONAL(HAVE_LIBPQ, [test "x${ac_cv_libpq}" = "xyes"])
36
])
37
38
AC_DEFUN([PANDORA_HAVE_LIBPQ],[
39
  AC_REQUIRE([_PANDORA_SEARCH_LIBPQ])
40
])
41
42
AC_DEFUN([PANDORA_REQUIRE_LIBPQ],[
43
  AC_REQUIRE([PANDORA_HAVE_LIBPQ])
1093.9.2 by Monty Taylor
pandora-build v0.35
44
  AS_IF([test "x${ac_cv_libpq}" = "xno"],
45
    AC_MSG_ERROR([libpq is required for ${PACKAGE}]))
1099.1.1 by Monty Taylor
pandora-build v0.23
46
])