Reported: PostgreSQL is no longer detected from SVN, while the released
tarball detects it and builds. Alma Linux 8, PostgreSQL 18, invoked as
./configure --with-pg-all=/usr/pgsql-18
--with-pg-all was a shorthand in the old configure.in that pointed every
PostgreSQL component at one prefix. The rewrite dropped it, and autoconf
only WARNS about an unrecognised --with-... - so configure completed,
the option did nothing, and PostgreSQL silently went missing. It is
restored here, setting --with-postgresql and --with-ecpg unless those
were named explicitly.
This did not show up on Debian or Ubuntu because libpq.pc is on the
default pkg-config path there, so detection succeeded anyway and masked
the ignored option. On RHEL, Alma and Rocky the PGDG packages install
under /usr/pgsql-NN with nothing on the default PATH or PKG_CONFIG_PATH,
so both pkg-config and a bare pg_config come up empty.
So detection also gained a fallback chain: pkg-config, then pg_config on
PATH, then pg_config under /usr/pgsql-*, /usr/local/pgsql-* and /opt/*
newest first, then a direct search for libpq-fe.h in the usual include
directories. Whatever answers is then verified by compiling against
libpq-fe.h and linking PQconnectdb, so a stale pg_config reports "not
found" rather than breaking the build later.
Verified: --with-pg-all against a /usr/pgsql-18 style prefix gives
-I<prefix>/include and -L<prefix>/lib -lpq; and with pkg-config unable
to see libpq, the pg_config fallback still finds it.