| 497 | | AC_HELP_STRING([--enable-pgsql], [enable PostgreSQL auth/reg/storage support (no)]), |
| 498 | | [enable_pgsql=$enableval have_pgsql=no], |
| | 497 | AC_HELP_STRING([--enable-pgsql], |
| | 498 | [enable PostgreSQL auth/reg/storage support, you can provide path to |
| | 499 | pg_config executable (no)]), |
| | 500 | [enable_pgsql="$enableval" have_pgsql=no], |
| 500 | | if test "x-$enable_pgsql" = "x-yes" ; then |
| 501 | | for i in /usr /usr/local /usr/local/pgsql ; do |
| 502 | | for j in include include/pgsql include/postgres include/postgresql "" ; do |
| 503 | | if test -r "$i/$j/libpq-fe.h" ; then |
| 504 | | PGSQL_INCLUDE=$i/$j |
| 505 | | fi |
| 506 | | done |
| 507 | | for lib in lib lib64 ; do |
| 508 | | for j in $lib $lib/pgsql $lib/postgres $lib/postgresql "" ; do |
| 509 | | if test -f "$i/$j/libpq.so" || test -f "$i/$j/libpq.a" ; then |
| 510 | | PGSQL_LIBDIR=$i/$j |
| 511 | | fi |
| 512 | | done |
| 513 | | done |
| 514 | | done |
| 515 | | AC_CHECK_LIB([pq], [PQsetdbLogin], [ |
| 516 | | have_pgsql=yes |
| 517 | | if test "x-$PGSQL_INCLUDE" != "x-"; then |
| 518 | | PGSQL_CFLAGS="-I $PGSQL_INCLUDE" |
| 519 | | fi |
| 520 | | if test "x-$PGSQL_LIBDIR" != "x-"; then |
| 521 | | PGSQL_LIBS="-L$PGSQL_LIBDIR -lpq" |
| 522 | | fi |
| 523 | | AC_DEFINE(STORAGE_POSTGRES, 1, [Define to 1 if you want to use PostgreSQL for storage.]) |
| 524 | | ]) |
| 525 | | if test "x-$have_pgsql" != "x-yes" ; then |
| 526 | | AC_MSG_ERROR([PostgreSQL support requested, but headers/libraries not found.]) |
| 527 | | fi |
| | 502 | if test "x-$enable_pgsql" != "x-no" ; then |
| | 503 | if test -x "$enable_pgsql" ; then |
| | 504 | PGSQL_INCLUDE="$($enable_pgsql --includedir)" |
| | 505 | PGSQL_LIBDIR="$($enable_pgsql --libdir)" |
| | 506 | PGSQL_CFLAGS="-I$PGSQL_INCLUDE" |
| | 507 | PGSQL_LIBS="-L$PGSQL_LIBDIR -lpq" |
| | 508 | have_pgsql=yes |
| | 509 | AC_DEFINE([STORAGE_POSTGRES],[1],[Define to 1 if you want to use PostgreSQL for storage.]) |
| | 510 | else # leave legacy detection intact for now |
| | 511 | for i in /usr /usr/local /usr/local/pgsql ; do |
| | 512 | for j in include include/pgsql include/postgres include/postgresql "" ; do |
| | 513 | if test -r "$i/$j/libpq-fe.h" ; then |
| | 514 | PGSQL_INCLUDE=$i/$j |
| | 515 | fi |
| | 516 | done |
| | 517 | for lib in lib lib64 ; do |
| | 518 | for j in $lib $lib/pgsql $lib/postgres $lib/postgresql "" ; do |
| | 519 | if test -f "$i/$j/libpq.so" || test -f "$i/$j/libpq.a" ; then |
| | 520 | PGSQL_LIBDIR=$i/$j |
| | 521 | fi |
| | 522 | done |
| | 523 | done |
| | 524 | done |
| | 525 | AC_CHECK_LIB([pq], [PQsetdbLogin], [ |
| | 526 | have_pgsql=yes |
| | 527 | if test "x-$PGSQL_INCLUDE" != "x-"; then |
| | 528 | PGSQL_CFLAGS="-I $PGSQL_INCLUDE" |
| | 529 | fi |
| | 530 | if test "x-$PGSQL_LIBDIR" != "x-"; then |
| | 531 | PGSQL_LIBS="-L$PGSQL_LIBDIR -lpq" |
| | 532 | fi |
| | 533 | AC_DEFINE(STORAGE_POSTGRES, 1, [Define to 1 if you want to use PostgreSQL for storage.]) |
| | 534 | ]) |
| | 535 | if test "x-$have_pgsql" != "x-yes" ; then |
| | 536 | AC_MSG_ERROR([PostgreSQL support requested, but headers/libraries not found.]) |
| | 537 | fi |
| | 538 | fi |