This macro tries to find the headers and libraries for the PostgreSQL database to build client applications.
If includes are found, the variable PQINCPATH will be set, and have_pqinc will be ’yes’. If libraries are found, the variable PQLIBPATH will be set, and have_pqlib will be ’yes’. If both PQINCPATH and PQLIBPATH are found, HAVE_LIBPQ will be set to ’yes’ (and AC_DEFINEd), and -lpq will be added to the beginning of LIBS. If their respective conditions are not met, have_pqinc, have_pqlib, HAVE_LIBPQ, will be ’no’.
This macro does fails if either the headers or the library are not found, unless ACTION-IF-NOT-FOUND is not empty. When both are found, ACTION-IF-FOUND, if defined, is exectued after the variables have been defined. If –with-pgsql=no (or equivalents) is given, nothing happens.
An automake conditional can be subsequently defined as
AM_CONDITIONAL([HAVE_LIBPQ], [test x$HAVE_LIBPQ = x$yes])
Download the latest version of ax_check_postgres_db.m4 or browse the macro’s revision history.
Copyright © 2008 Christian Toepp firstname.lastname@example.org
Copyright © 2012 Olivier Mehani email@example.com
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.