have_libpq.m4 688 B

1234567891011121314151617181920212223
  1. dnl Copyright (C) 2011 Brian Aker (brian@tangent.org)
  2. AC_DEFUN([AX_HAVE_LIBPQ],[
  3. AC_ARG_ENABLE([libpq],
  4. [AS_HELP_STRING([--disable-libpq],
  5. [Build with libpq, ie Postgres, support @<:@default=on@:>@])],
  6. [ac_cv_libpq="$enableval"],
  7. [ac_cv_libpq="yes"])
  8. AC_REQUIRE([AX_LIB_POSTGRESQL])
  9. AS_IF([test "x$ac_cv_libpq" = "xyes" -a "x$found_postgresql" = "xyes"],
  10. [
  11. AC_DEFINE([HAVE_LIBPQ], [ 1 ], [Enable libpq support])
  12. ],
  13. [
  14. AC_DEFINE([HAVE_LIBPQ], [ 0 ], [Enable libpq support])
  15. # if --enable-libpq, but no Postgres, force --disable-libpq
  16. ac_cv_libpq="no"
  17. ])
  18. AM_CONDITIONAL(HAVE_LIBPQ, [test "x$ac_cv_libpq" = "xyes"])
  19. ])