Looks to me like a bug in configure.in...<div><br></div><div><div>427: AC_CHECK_LIB([pq], [PQgetvalue],, AC_MSG_ERROR([no usable libpq; please install PostgreSQL devel package or equivalent]))</div><div><br></div><div>Is the test whether it can link to libpq by checking if the PQgetvalue function is available, problem is it doesn't seem to use the pg_config values. So on a system like yours where libpq is installing to somewhere other than the main lib directories it's unable to detect the libary.</div>
<div><br></div><div>File a Jira to track this if you haven't already done so.</div><div><br></div><div>-Steve</div><div><br></div><br><div class="gmail_quote">On 14 June 2013 15:35, Claus Andersen <span dir="ltr"><<a href="mailto:clan@wheel.dk" target="_blank">clan@wheel.dk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, 13 Jun 2013, Steven Ayre wrote:<br>
<br>
</div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
To answer your question of what the test is doing, it'll take the required flags/libs from pg_config (which it<br>
looks like it found) and then try compiling a tiny program linking to it to check if the library exists and when<br>
testing functions if that function is exported by that version of the library. Any compile error means 'no'.<br>
That ac_ variable is checking if its 'set' which'd mean the test passed. Config.log will show all the tests<br>
being run and any error output for them.<br>
-Steve<br>
</blockquote>
<br></div>
Thank you very much. Most helpful!<br>
<br>
I had only tail'ed config.log and further up I found:<br>
<br>
configure:19550: checking for PostgreSQL libraries<br>
configure:19584: checking for PQgetvalue in -lpq<br>
configure:19619: gcc -o conftest -g -O2 conftest.c -lpq -lodbc >&5<br>
/usr/bin/ld: cannot find -lpq<br>
collect2: ld returned 1 exit status<br>
configure:19626: $? = 1<br>
<br>
So the linker is not able to find and include the library. The empty spaces after -O2 and -lpq might indicate that some empty variables might have been inserted.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
>From configure I know that we can find pg_config:<br>
</blockquote><div class="im">
<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 or equivalent<br>
<br></div>
And from the shell I know I get the proper path:<br>
$ pg_config --libdir<br>
/usr/pgsql-9.2/lib<br>
<br>
And from the configure script it looks like the correct parameter is used:<br>
POSTGRESQL_LDFLAGS="`$PG_<u></u>CONFIG --ldflags` -L`$PG_CONFIG --libdir` -lpq"<br>
<br>
It looks like these flags are not passed to gcc/ld when linking conftest.c<br>
<br>
My conclusion is then that pg_config is found and the correct options and path are extracted but they are not used (ignored?) during testing. Or if they should be used - something even more serious is wrong.<br>
<br>
If that conclusion is correct I will file a Jira. The fix should be trivial for people in the know. I cannot determine whether the libdir should be added during the test. Or if pg_config should be ignored completely and replaced with a simple -with-pgsql-lib=dir.<br>
<br>
If I set LDFLAGS before I do a configure it works:<br>
$ LDFLAGS="${LDFLAGS} -L/usr/pgsql-9.2/lib"<br>
$ export LDFLAGS<br>
$./configure --enable-core-pgsql-support<br>
<br>
Configure then runs smoothly. Make does however fail but that is another issue I'll put in a seperate thread.<br>
<br>
With LDFLAGS set the relevant part of config.log now looks like this:<br>
configure:19604: checking for PQgetvalue in -lpq<br>
configure:19639: gcc -o conftest -g -O2 -L/usr/pgsql-9.2/lib conftest.c -lpq -lodbc >&5<br>
configure:19646: $? = 0<br>
configure:19667: result: yes<br>
<br>
Do you agree that this is a "proper" issue?<br>
<br>
Kind Regards,<br>
Claus Andersen<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">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">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>
<br></blockquote></div><br></div>