Next: , Previous: , Up: The Macros  


ax_check_postgres_db

Synopsis

AX_CHECK_POSTGRES_DB([ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])

Description

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 executed 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])

in configure.ac.

Source Code

Download the latest version of ax_check_postgres_db.m4 or browse the macro’s revision history.

License

Copyright © 2008 Christian Toepp c.toepp@gmail.com
Copyright © 2012 Olivier Mehani shtrom-ax@ssji.net

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.