Bug 364

Summary: Config option --with-pgport is broken on Linux
Product: Slony-I Reporter: Jan Wieck <jan>
Component: core scriptsAssignee: Jan Wieck <jan>
Status: ASSIGNED ---    
Severity: normal CC: slony1-bugs
Priority: low    
Version: devel   
Hardware: PC   
OS: Linux   
Attachments: Patch to fix ./configure --with-pgport on Linux
Updated v2 of configure patch.

Description Jan Wieck 2016-06-13 17:45:39 UTC
The ./config/acx_libpq.m4 is broken. The test compile to check
if find_my_exec() can be compiled puts -lpgport before -lpgcommon.
Since both are .a libraries (at least in 9.5), this doesn't work
because -lpgcommon is referencing objects in -lpgport. Linking
in -lpgport first doesn't pull those objects in, so the link
fails and ./configure complains that it cannot find pgport.

The attached patch fixes configure.
Comment 1 Jan Wieck 2016-06-13 17:46:43 UTC
Created attachment 214 [details]
Patch to fix ./configure --with-pgport on Linux
Comment 2 Jan Wieck 2016-07-16 11:48:38 UTC
Created attachment 215 [details]
Updated v2 of configure patch.

Apparently some modules have shifted around between -lpgcommon and -lpgport, making the link order dependent on the major PostgreSQL version. Since these are old style .a libraries during ./configure, the link order matters. To not overcomplicate the acx_libpq check, we can specify each library twice.
Comment 3 Steve Singer 2016-08-21 14:24:29 UTC
This patch looks fine.
You can commit it