~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/pandora_have_libpq.m4

  • Committer: Brian Aker
  • Date: 2009-08-06 15:04:21 UTC
  • mfrom: (1093.1.52 captain)
  • Revision ID: brian@gaz-20090806150421-w8yrasl1m8exorxs
Merge Jay

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
AC_DEFUN([_PANDORA_SEARCH_LIBPQ],[
7
7
  AC_REQUIRE([AC_LIB_PREFIX])
8
8
 
9
 
  AC_CHECK_HEADERS([libpq-fe.h])
10
9
  dnl --------------------------------------------------------------------
11
10
  dnl  Check for libpq
12
11
  dnl --------------------------------------------------------------------
13
12
 
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);
 
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"
23
33
  ])
24
34
  
25
35
  AM_CONDITIONAL(HAVE_LIBPQ, [test "x${ac_cv_libpq}" = "xyes"])
31
41
 
32
42
AC_DEFUN([PANDORA_REQUIRE_LIBPQ],[
33
43
  AC_REQUIRE([PANDORA_HAVE_LIBPQ])
34
 
  AS_IF([test x$ac_cv_libpq = xno],
35
 
      AC_MSG_ERROR([libpq is required for ${PACKAGE}]))
 
44
  AS_IF([test "x${ac_cv_libpq}" = "xno"],
 
45
    AC_MSG_ERROR([libpq is required for ${PACKAGE}]))
36
46
])