[pgpool-hackers: 1199] Re: [pgpool-committers: 2864] Re: pgpool: Add pgpool_adm docs.

Muhammad Usama m.usama at gmail.com
Wed Dec 9 22:50:21 JST 2015


On Wed, Dec 9, 2015 at 12:51 PM, Tatsuo Ishii <ishii at postgresql.org> wrote:

> Better to post to pgpool-hackers...
>
> > Usama,
> >
> > While installing pgpool_adm extension, I noticed that sometimes
> > pgpool_adm.so failed to load because missing reference to libpcp.so.
> > To fix this, I have changed src/sql/pgpool_adm/Makefile as follows:
> >
> >> SHLIB_LINK = -L../../libs/pcp/.libs -lpcp
> >
> > <S HLIB_LINK =  -L../../libs/pcp/.libs -lpcp -Wl,--as-needed
> -Wl,-rpath,'${libdir}',--enable-new-dtags
> >
> > Problem is, ${libdir} is expanded to the libdir where PostgreSQL's
> > libraries installed (including pgpool_adm.so). But my intention was
> > ${libdir} to point to the libdir which is not necessarily same as
> > PostgreSQL libdir. It's best to point to the directory (prefix/lib
> > where prefix is specified by configure). Any idea how to fix?
>

One way to do this is to add a new Makefile.config.in file in
src/sql/ directory and then make the configure to generate a
Makefile.config by substitute the actual prefix path in it. And then
pgpool_adm module's Makefile can include that Makefile.config
Please see the attached POC patch

Thanks
Best regards
Muhammad Usama



> >
> > Best regards,
> > --
> > Tatsuo Ishii
> > SRA OSS, Inc. Japan
> > English: http://www.sraoss.co.jp/index_en.php
> > Japanese:http://www.sraoss.co.jp
> >
> >> Add pgpool_adm docs.
> >>
> >> Also enhance Makefile of pgpool_adm to replace the SHLIB_LINK to add
> >> modern ld flags. Still have problem though: i.e. ${libdir} should not
> >> be replaced by PostgreSQL's lib dir, rather than pcplib dir installing
> >> dir.
> >>
> >> Branch
> >> ------
> >> master
> >>
> >> Details
> >> -------
> >>
> http://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=f690f9927847c743dfa97dbd3371717a43ea4231
> >>
> >> Modified Files
> >> --------------
> >> doc/pgpool-en.html          |  315
> ++++++++++++++++++++++++++++++++++++++++++-
> >> doc/pgpool_adm.odp          |  Bin 0 -> 17456 bytes
> >> doc/pgpool_adm.png          |  Bin 0 -> 32437 bytes
> >> src/sql/pgpool_adm/Makefile |    5 +-
> >> 4 files changed, 317 insertions(+), 3 deletions(-)
> >>
> >> _______________________________________________
> >> pgpool-committers mailing list
> >> pgpool-committers at pgpool.net
> >> http://www.pgpool.net/mailman/listinfo/pgpool-committers
> > _______________________________________________
> > pgpool-committers mailing list
> > pgpool-committers at pgpool.net
> > http://www.pgpool.net/mailman/listinfo/pgpool-committers
> _______________________________________________
> pgpool-hackers mailing list
> pgpool-hackers at pgpool.net
> http://www.pgpool.net/mailman/listinfo/pgpool-hackers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-hackers/attachments/20151209/f4869fb5/attachment.html>
-------------- next part --------------
diff --git a/src/sql/Makefile.config.in b/src/sql/Makefile.config.in
new file mode 100644
index 0000000..67b6736
--- /dev/null
+++ b/src/sql/Makefile.config.in
@@ -0,0 +1,3 @@
+prefix := @prefix@
+exec_prefix := @exec_prefix@
+
diff --git a/configure b/configure
index a07225d..77255a3 100755
--- a/configure
+++ b/configure
@@ -14622,6 +14622,8 @@ $as_echo "enable cassert = $enable_cassert" >&6; }
 
 ac_config_headers="$ac_config_headers src/include/config.h"
 
+ac_config_files="$ac_config_files src/sql/Makefile.config"
+
 
 ac_config_files="$ac_config_files Makefile doc/Makefile src/Makefile src/include/Makefile src/parser/Makefile src/libs/Makefile src/libs/pcp/Makefile src/tools/Makefile src/tools/pgmd5/Makefile src/tools/pcp/Makefile src/watchdog/Makefile"
 
@@ -15641,6 +15643,7 @@ do
     "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
     "src/include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/config.h" ;;
+    "src/sql/Makefile.config") CONFIG_FILES="$CONFIG_FILES src/sql/Makefile.config" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
     "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
diff --git a/configure.ac b/configure.ac
index 9f07b6c..019140c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -411,5 +411,6 @@ fi
 AC_MSG_RESULT([enable cassert = $enable_cassert])
 
 AM_CONFIG_HEADER(src/include/config.h)
+AC_CONFIG_FILES([src/sql/Makefile.config])
 
 AC_OUTPUT([Makefile doc/Makefile src/Makefile src/include/Makefile src/parser/Makefile src/libs/Makefile src/libs/pcp/Makefile src/tools/Makefile src/tools/pgmd5/Makefile src/tools/pcp/Makefile src/watchdog/Makefile])
diff --git a/src/sql/pgpool_adm/Makefile b/src/sql/pgpool_adm/Makefile
index e90851c..f85549e 100644
--- a/src/sql/pgpool_adm/Makefile
+++ b/src/sql/pgpool_adm/Makefile
@@ -1,5 +1,5 @@
 # contrib/pcp/Makefile
-
+include ../Makefile.config
 MODULE_big = pgpool_adm
 OBJS = pgpool_adm.o
 PG_CPPFLAGS = -I$(libpq_srcdir) -I../../include/pcp
@@ -8,7 +8,7 @@ EXTENSION = pgpool_adm
 DATA = pgpool_adm--1.0.sql
 #SHLIB_LINK = -L../../libs/pcp/.libs -lpcp
 #SHLIB_LINK = -L/home/t-ishii/work/pgpool-II/current/lib -Wl,-rpath '/home/t-ishii/work/pgpool-II/current/lib' -lpcp
-SHLIB_LINK =  -L../../libs/pcp/.libs -lpcp -Wl,--as-needed -Wl,-rpath,'${libdir}',--enable-new-dtags
+SHLIB_LINK =  -L../../libs/pcp/.libs -lpcp -Wl,--as-needed -Wl,-rpath,'${prefix}/lib',--enable-new-dtags
 # if you are using PostgreSQL 8.0 or later,
 # using pg_config is recommended.
 # if you are not, comment out following line and...


More information about the pgpool-hackers mailing list