Do you have libpq-dev installed? RPM systems probably call it something different (postgresql-devel?)<div><br></div><div>libpq will just be the runtime libraries, you need the development files to compile software against the library.</div>

<div><br></div><div>-Steve</div><div><br></div><div>
<br></div><div><br><br><div class="gmail_quote">On 13 June 2013 12:34, Claus Andersen <span dir="ltr">&lt;<a href="mailto:clan@wheel.dk" target="_blank">clan@wheel.dk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Hi,<br>
<br>
I am having trouble enabling pgsql support with the configure script and I<br>
will almost (boldly!) claim there might be a problem we the configure<br>
script. Autoconf and friends is however close to black magic and voodoo so<br>
I will try to assert my viewpoint and hopefully someone can point out my<br>
level of cluelessness :-)<br>
<br>
I am able to compile and run Freeswitch 1.2.8 (without core-pgsql),<br>
PostgreSQL 9.2.4 and OpenResty 1.2.8.5 (with libpq!).<br>
<br>
Openresty was configured with:<br>
./configure --with-luajit --with-http_iconv_module<br>
--with-http_postgres_module --with-libpq=/usr/pgsql-9.2<br>
<br>
Hence I know that I have a recent and working libpq. From previous mails<br>
on this list I can see that is the typical response to this issue is to<br>
install postgresql92-devel which I have already done.<br>
<br>
However freeswitch configure fails:<br>
<br>
$ ./configure --enable-core-pgsql-support<br>
&lt;snip&gt;<br>
checking for odbc header in /usr/include... found<br>
checking for SQLDisconnect in -lodbc... yes<br>
checking whether to include odbc... yes<br>
checking for SQLDisconnect in -lodbc... (cached) yes<br>
checking for pg_config... /usr/pgsql-9.2/bin/pg_config<br>
checking for PostgreSQL libraries... checking for PQgetvalue in -lpq... no<br>
configure: error: no usable libpq; please install PostgreSQL devel package<br>
or equivalent<br>
<br>
The part of configure which fails is:<br>
<br>
{ $as_echo &quot;$as_me:$LINENO: checking for PQgetvalue in -lpq&quot; &gt;&amp;5<br>
$as_echo_n &quot;checking for PQgetvalue in -lpq... &quot; &gt;&amp;6; }<br>
if test &quot;${ac_cv_lib_pq_PQgetvalue+set}&quot; = set; then<br>
   $as_echo_n &quot;(cached) &quot; &gt;&amp;6<br>
else<br>
   ac_check_lib_save_LIBS=$LIBS<br>
LIBS=&quot;-lpq  $LIBS&quot;<br>
<br>
I do simply not understand what &quot;${ac_cv_lib_pq_PQgetvalue+set}&quot; actually<br>
is doing and it becomes a dark art for me. If I remove the &quot;if&quot; clause I<br>
assume things would simply work (as LIBS should be correct)!<br>
<br>
My initial thought was to try to make an addition to configure to support<br>
the following options:<br>
   --with-pgsql-lib=dir<br>
   --with-pqsql-include=dir<br>
<br>
My OCD does however not like that I do not understand the test performed<br>
today. To blindly add those options would be too hackish (and stoopid).<br>
<br>
Can anyone explain what happens in the configure script? I would rather<br>
spend some time making sure configure works perfectly rather than tweaking<br>
my environment to match the expectations of the script.<br>
<br>
Kind Regards,<br>
Claus Andersen<br>
<br>
Additional info:<br>
<br>
Freeswitch 1.2.8 with PostgreSQL 9.2.4<br>
<br>
uname -m = x86_64<br>
uname -r = 2.6.32-358.6.1.el6.x86_64<br>
uname -s = Linux<br>
uname -v = #1 SMP Tue Apr 23 19:29:00 UTC 2013<br>
<br>
$ grep PQgetvalue /usr/pgsql-9.2/include/libpq-fe.h<br>
extern char *PQgetvalue(const PGresult *res, int tup_num, int field_num);<br>
<br>
$ pg_config (excerpt)<br>
INCLUDEDIR = /usr/pgsql-9.2/include<br>
LIBDIR = /usr/pgsql-9.2/lib<br>
LDFLAGS = -L/usr/lib64 -Wl,--as-needed<br>
LIBS = -lpgport -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz<br>
-lreadline -lcrypt -ldl -lm<br>
VERSION = PostgreSQL 9.2.4<br>
<br>
$ tail config.log<br>
#define HAVE_ODBC 1<br>
#define HAVE_LIBODBC 1<br>
#define SWITCH_HAVE_PGSQL 1<br>
#define POSTGRESQL_VERSION &quot;9.2.4&quot;<br>
#define POSTGRESQL_MAJOR_VERSION 9<br>
#define POSTGRESQL_MINOR_VERSION 2<br>
#define POSTGRESQL_PATCH_VERSION 4<br>
<br>
configure: exit 1<br>
<br>
$ rpm -ql postgresql92-devel | grep libpq<br>
/usr/pgsql-9.2/include/internal/libpq<br>
/usr/pgsql-9.2/include/internal/libpq-int.h<br>
/usr/pgsql-9.2/include/internal/libpq/pqcomm.h<br>
/usr/pgsql-9.2/include/libpq<br>
/usr/pgsql-9.2/include/libpq-events.h<br>
/usr/pgsql-9.2/include/libpq-fe.h<br>
/usr/pgsql-9.2/include/libpq/libpq-fs.h<br>
/usr/pgsql-9.2/include/server/libpq<br>
/usr/pgsql-9.2/include/server/libpq/auth.h<br>
/usr/pgsql-9.2/include/server/libpq/be-fsstubs.h<br>
/usr/pgsql-9.2/include/server/libpq/crypt.h<br>
/usr/pgsql-9.2/include/server/libpq/hba.h<br>
/usr/pgsql-9.2/include/server/libpq/ip.h<br>
/usr/pgsql-9.2/include/server/libpq/libpq-be.h<br>
/usr/pgsql-9.2/include/server/libpq/libpq-fs.h<br>
/usr/pgsql-9.2/include/server/libpq/libpq.h<br>
/usr/pgsql-9.2/include/server/libpq/md5.h<br>
/usr/pgsql-9.2/include/server/libpq/pqcomm.h<br>
/usr/pgsql-9.2/include/server/libpq/pqformat.h<br>
/usr/pgsql-9.2/include/server/libpq/pqsignal.h<br>
/usr/pgsql-9.2/lib/libpq.a<br>
/usr/pgsql-9.2/lib/libpq.so<br>
<br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br></div>