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

Muhammad Usama m.usama at gmail.com
Thu Dec 10 16:27:02 JST 2015


Hi

I think there is another simpler way. We can just change the Makefile of
the pgpool_adm module to Makefile.in and then configure would substitute
the actual value of prefix in it.
Please see the attached patch

Thanks
Best regards
Muhammad Usama


On Wed, Dec 9, 2015 at 6:50 PM, Muhammad Usama <m.usama at gmail.com> wrote:

>
> 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/20151210/b300528e/attachment.html>
-------------- next part --------------
diff --git a/configure b/configure
index a07225d..5e43282 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/pgpool_adm/Makefile"
+
 
 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/pgpool_adm/Makefile") CONFIG_FILES="$CONFIG_FILES src/sql/pgpool_adm/Makefile" ;;
     "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..0c4fd1d 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/pgpool_adm/Makefile])
 
 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.in b/src/sql/pgpool_adm/Makefile.in
index e90851c..4cdac97 100644
--- a/src/sql/pgpool_adm/Makefile.in
+++ b/src/sql/pgpool_adm/Makefile.in
@@ -1,5 +1,5 @@
 # contrib/pcp/Makefile
-
+prefix := @prefix@
 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