Bug 364 - Config option --with-pgport is broken on Linux
Summary: Config option --with-pgport is broken on Linux
Status: ASSIGNED
Alias: None
Product: Slony-I
Classification: Unclassified
Component: core scripts (show other bugs)
Version: devel
Hardware: PC Linux
: low normal
Assignee: Jan Wieck
URL:
Depends on:
Blocks:
 
Reported: 2016-06-13 17:45 UTC by Jan Wieck
Modified: 2016-08-21 14:24 UTC (History)
1 user (show)

See Also:


Attachments
Patch to fix ./configure --with-pgport on Linux (660 bytes, patch)
2016-06-13 17:46 UTC, Jan Wieck
Details
Updated v2 of configure patch. (692 bytes, patch)
2016-07-16 11:48 UTC, Jan Wieck
Details

Note You need to log in before you can comment on or make changes to this bug.
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