Re: psqlodbc build with libpq on OS X

From: Sandeep Thakkar <sandeep(dot)thakkar(at)enterprisedb(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: psqlodbc build with libpq on OS X
Date: 2014-08-18 12:49:45
Message-ID: CANFyU94Qiu4fQ-ZRdQgCA0_h5=xAbUw7CBhYwiyuAUYTWu3t3w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

May be you are right that iodbc-config should not return "-L/usr/lib". But,
when I provide, --with-libpq=<PG_INSTALL_PATH> switch specifically,
shoudn't it pick the libpq from there?

On Mon, Aug 18, 2014 at 5:51 PM, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com
> wrote:

> On 08/18/2014 02:50 PM, Sandeep Thakkar wrote:
>
>> Hi
>>
>> We were building psqlodbc-09.03.0300 on OS X with configure options as
>> "--disable-dependency-tracking --with-iodbc --with-libpq=<PG_INSTALL_PATH>
>> --prefix=<INSTALL_PATH>
>> " and found that libpq was being linked from /usr/lib and not from the
>> $PG_INSTALL_PATH.. May be because the system iodbc-config returns:
>>
>> $ iodbc-config --libs
>> -L/usr/lib -liodbc -liodbcinst"
>>
>
> Hmm. It seems bogus for iodbc-config to return "-L/usr/lib" in the first
> place. Surely /usr/lib is in the default library path, so shouldn't be
> printed.
>
>
> To make sure it picks the libpq from the Server installation that we
>> built,
>> I had to patch configure script:
>>
>> --
>> --- configure.org 2014-08-18 16:22:19.484004002 +0500
>> +++ configure 2014-08-18 16:22:55.537736693 +0500
>> @@ -4301,7 +4301,7 @@
>> if test -d "$with_libpq"; then
>> PATH="$PATH:$with_libpq/bin"
>> CPPFLAGS="$CPPFLAGS -I$with_libpq/include"
>> - LDFLAGS="$LDFLAGS -L$with_libpq/lib"
>> + LDFLAGS="-L$with_libpq/lib $LDFLAGS"
>> else
>> if test -x "$with_libpq"; then
>> PG_CONFIG=$with_libpq
>> --
>>
>> Does this looks fine?
>>
>
> Well, you'd need to patch "configure.ac", because "configure" is
> auto-generated from "configure.ac". However, since this seems like an
> iodbc bug to me, I'd suggest that you contact the iodbc people to get it
> fixed upstream. Meanwhile, you could write your own iodbc-config
> replacement/wrapper script that returns the correct string, "-liodbc
> -liodbcinst".
>
> - Heikki
>

--
Sandeep Thakkar

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Heikki Linnakangas 2014-08-18 13:29:38 Re: psqlodbc build with libpq on OS X
Previous Message Heikki Linnakangas 2014-08-18 12:21:15 Re: psqlodbc build with libpq on OS X