Bug 344 - Configure fails to find libpgport
Summary: Configure fails to find libpgport
Status: NEW
Alias: None
Product: Slony-I
Classification: Unclassified
Component: other scripts (show other bugs)
Version: devel
Hardware: PC Linux
: low normal
Assignee: Slony Bugs List
URL:
Depends on:
Blocks:
 
Reported: 2014-06-30 01:36 UTC by EngineeredVirus
Modified: 2016-06-15 13:14 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description EngineeredVirus 2014-06-30 01:36:04 UTC
Configure fails with the following error:
configure: error: "pgport was not found. build without --with-pgport=yes to disable"


Looking at the configure's conftest for libpgport test, I see that the libraries libpgcommon and libpgport are being linked in the wrong order.

This would cause configure to fail for some versions of gcc; e.g. in my case on CentOS 5.x 32-bit it fails with the above error.
===========================
[root@blinux ~]# uname -a
Linux blinux 2.6.18-371.8.1.el5 #1 SMP Thu Apr 24 18:23:07 EDT 2014 i686 i686 i386 GNU/Linux

[root@blinux ~]# gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-54)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
===========================

To fix this, all we need to do is correct the order of linking for libpgport and libpgcommon. Following is the patch for configure:

===========================
--- a/configure
+++ b/configure
@@ -5741,7 +5741,7 @@ rm -f core conftest.err conftest.$ac_objext \
    if test $HAVE_PGCOMMON = 1  ; then
        EXTRALIBS=" -lpgcommon"
    fi
-   LIBS="$LIBS $EXTRALIBS -lpgport"
+   LIBS="$LIBS -lpgport $EXTRALIBS"
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
===========================
Comment 1 Steve Singer 2014-06-30 05:48:18 UTC
I am finding your diff a bit confusing.

Your diff says that the link order should be

LIBS="$LIBS -lpgport $EXTRALIBS"

but this IS what the link order is in config/acx_libpq.m4 both REL_2_1_STABLE and REL_2_2_STABLE


I agree that the link order should list pgport before libpgcommon.  

What version of slony did you hit this on? Was it from a release tar that includes 'configure' or a checkout of git (configure isn't committed in source control but gets generated by autoconf from the m4 files).