pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedpsqlodbc build with libpq on OS X
4+ messages / 2 participants
[nested] [flat]
* psqlodbc build with libpq on OS X
@ 2014-08-18 11:50 Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2014-08-18 12:21 ` Re: psqlodbc build with libpq on OS X Heikki Linnakangas <hlinnakangas@vmware.com>
0 siblings, 1 reply; 4+ messages in thread
From: Sandeep Thakkar @ 2014-08-18 11:50 UTC (permalink / raw)
To: pgsql-odbc
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"
To make sure it picks the libpq from the Server installation that we built,
I had to patch configure script:
--
inline patch 1: configure (+1/-1 lines) download inline-1.patch
--- 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?
--
Sandeep Thakkar
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: psqlodbc build with libpq on OS X
2014-08-18 11:50 psqlodbc build with libpq on OS X Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
@ 2014-08-18 12:21 ` Heikki Linnakangas <hlinnakangas@vmware.com>
2014-08-18 12:49 ` Re: psqlodbc build with libpq on OS X Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
0 siblings, 1 reply; 4+ messages in thread
From: Heikki Linnakangas @ 2014-08-18 12:21 UTC (permalink / raw)
To: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; pgsql-odbc
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
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: psqlodbc build with libpq on OS X
2014-08-18 11:50 psqlodbc build with libpq on OS X Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2014-08-18 12:21 ` Re: psqlodbc build with libpq on OS X Heikki Linnakangas <hlinnakangas@vmware.com>
@ 2014-08-18 12:49 ` Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2014-08-18 13:29 ` Re: psqlodbc build with libpq on OS X Heikki Linnakangas <hlinnakangas@vmware.com>
0 siblings, 1 reply; 4+ messages in thread
From: Sandeep Thakkar @ 2014-08-18 12:49 UTC (permalink / raw)
To: Heikki Linnakangas <hlinnakangas@vmware.com>; +Cc: 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@vmware.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
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: psqlodbc build with libpq on OS X
2014-08-18 11:50 psqlodbc build with libpq on OS X Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2014-08-18 12:21 ` Re: psqlodbc build with libpq on OS X Heikki Linnakangas <hlinnakangas@vmware.com>
2014-08-18 12:49 ` Re: psqlodbc build with libpq on OS X Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
@ 2014-08-18 13:29 ` Heikki Linnakangas <hlinnakangas@vmware.com>
0 siblings, 0 replies; 4+ messages in thread
From: Heikki Linnakangas @ 2014-08-18 13:29 UTC (permalink / raw)
To: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>; +Cc: pgsql-odbc
On 08/18/2014 03:49 PM, Sandeep Thakkar wrote:
> 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?
Well, yeah, but iodbc-config returning "-L/usr/lib" screws that up.
What's your point?
Looking closer at configure.ac, we actually have a similar issue with
pg_config. If you had libpq in the standard location, in /usr/lib/, and
libiodbc in a non-standard location, with your patch that case would go
wrong. No matter which way you order the -L's, it's going to be wrong in
the other direction. The solution is to not include standard paths like
/usr/lib in the output.
Perhaps it would be better to not use odbc_config / pg_config at all, at
least if the ./configure option is just "--with-libpq" and not
"--with-libpq=<path>". We could add just -lodbcinst and -lpq to LDFLAGS
directly, and assume that the required headers and libraries are in the
default system paths, without any -L or -I options. With that, you could
do "--with-iodbc" without a path and "--with-libpq=<PATH>", and it would
work, I think. Want to try writing a patch for that?
- Heikki
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2014-08-18 13:29 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-08-18 11:50 psqlodbc build with libpq on OS X Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2014-08-18 12:21 ` Heikki Linnakangas <hlinnakangas@vmware.com>
2014-08-18 12:49 ` Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
2014-08-18 13:29 ` Heikki Linnakangas <hlinnakangas@vmware.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox