pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedUsing pg_config
4+ messages / 2 participants
[nested] [flat]
* Using pg_config
@ 2005-10-11 09:16 Peter Eisentraut <peter_e@gmx.net>
0 siblings, 0 replies; 4+ messages in thread
From: Peter Eisentraut @ 2005-10-11 09:16 UTC (permalink / raw)
To: pgsql-odbc
I was unable to build the libpq-based driver because it apparently makes some
hard-coded assumptions about the installation paths which did not work on my
system. It'd be better if pg_config were used to detect the installation
paths. I've attached a patch for that here. I'm not sure how that works on
Windows, though. Comments?
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
Attachments:
psqlodbc-pgconfig.patch (text/x-diff, 3.4K) download
diff -cr ../cvs-psqlodbc/configure.ac ./configure.ac
*** ../cvs-psqlodbc/configure.ac 2005-09-19 15:31:58.000000000 +0200
--- ./configure.ac 2005-10-11 11:07:00.000000000 +0200
***************
*** 118,208 ****
AC_TYPE_SIZE_T
AC_STRUCT_TM
-
- #
- #Options for pgsql headers and libraries
- #
-
- AC_MSG_CHECKING(for pgsql include files)
- AC_ARG_WITH(pgsql-include,
- [ --with-pgsql-include=DIR Look for postgreSQL include files in DIR],
- [if test "$withval" != no; then
- AC_MSG_RESULT(yes)
- pgsql_include="$withval"
- else
- AC_MSG_RESULT(no)
- AC_MSG_ERROR([you must specify a directory when using --with-pgsql-include=DIR])
- fi])
#
! # Library directories
#
! AC_MSG_CHECKING(for pgsql)
! AC_ARG_WITH(pgsql,
! [ --with-pgsql=DIR look for PostgreSQL libraries and headers in DIR],
! [if test "$withval" != no
! then
! AC_MSG_RESULT(yes)
! LIBPQ_HOME="$withval"
! else
! AC_MSG_RESULT(no)
! fi], [
! AC_MSG_RESULT(yes)
! LIBPQ_HOME="/usr/local/pgsql"
! if test "$pgsql_include" = ""
! then
! if test ! -f "${LIBPQ_HOME}/include/libpq-fe.h"
! then
! LIBPQ_HOME=/usr/local
! if test ! -f "${LIBPQ_HOME}/include/libpq-fe.h"
! then
! LIBPQ_HOME=/usr
! fi
! fi
! if test -f "/usr/include/libpq-fe.h"
! then
! pgsql_include="/usr/include"
! else
! if test -f "/usr/include/pgsql/libpq-fe.h"
! then
! pgsql_include="/usr/include/pgsql"
! fi
! fi
fi
! ])
! #
! # Check for libpq libraries and headers
! #
! if test -n "${LIBPQ_HOME}"
! then
! OLD_LDFLAGS="$LDFLAGS"
! OLD_CPPFLAGS="$CPPFLAGS"
! LDFLAGS="$LDFLAGS -L${LIBPQ_HOME}/lib"
! AC_CHECK_LIB(pq, PQexec, [pgsql_cv_libpq=yes], [pgsql_cv_libpq=no])
- if test "$pgsql_include" != ""
- then
- CPPFLAGS="$CPPFLAGS -I${pgsql_include}"
- else
- CPPFLAGS="$CPPFLAGS -I${LIBPQ_HOME}/include"
- fi
- AC_CHECK_HEADER(libpq-fe.h, [pgsql_cv_libpqfe_h=yes], [pgsql_cv_libpqfe_h=no])
-
- if test "$pgsql_cv_libpq" = "yes" -a "$pgsql_cv_libpqfe_h" = "yes"
- then
- AC_MSG_CHECKING(pgsql in ${LIBPQ_HOME})
- AC_MSG_RESULT(ok)
- else
- AC_MSG_CHECKING(pgsql in ${LIBPQ_HOME})
- AC_MSG_RESULT(failed)
- LDFLAGS="$OLD_LDFLAGS"
- CPPFLAGS="$OLD_CPPFLAGS"
- AC_MSG_ERROR([you must specify a valid pgsql installation with --with-pgsql=DIR])
- fi
- LIBS="$LIBS -lpq"
- CPPFLAGS="$CPPFLAGS "
-
- fi
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
--- 118,136 ----
AC_TYPE_SIZE_T
AC_STRUCT_TM
#
! # Find libpq headers and libraries
#
! AC_PATH_PROGS(PG_CONFIG, pg_config)
! if test -z "$PG_CONFIG" ; then
! AC_MSG_ERROR([pg_config not found])
fi
! pg_includedir=`$PG_CONFIG --includedir`
! pg_libdir=`$PG_CONFIG --libdir`
! CPPFLAGS="$CPPFLAGS -I$pg_includedir"
! LDFLAGS="$LDFLAGS -L$pg_libdir"
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
diff -cr ../cvs-psqlodbc/Makefile.am ./Makefile.am
*** ../cvs-psqlodbc/Makefile.am 2005-09-19 15:31:58.000000000 +0200
--- ./Makefile.am 2005-10-11 10:49:51.000000000 +0200
***************
*** 12,17 ****
--- 12,19 ----
psqlodbc_la_LDFLAGS = -module -no-undefined -avoid-version
+ psqlodbc_la_LIBADD = -lpq
+
psqlodbc_la_SOURCES = \
info.c bind.c columninfo.c connection.c convert.c drvconn.c \
environ.c execute.c win_md5.c misc.c options.c \
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Using pg_config
@ 2005-10-11 13:37 Dave Page <dpage@vale-housing.co.uk>
2005-10-12 08:16 ` Re: Using pg_config Peter Eisentraut <peter_e@gmx.net>
0 siblings, 1 reply; 4+ messages in thread
From: Dave Page @ 2005-10-11 13:37 UTC (permalink / raw)
To: Peter Eisentraut <peter_e@gmx.net>; pgsql-odbc
-----Original Message-----
From: pgsql-odbc-owner@postgresql.org on behalf of Peter Eisentraut
Sent: Tue 10/11/2005 10:16 AM
To: pgsql-odbc@postgresql.org
Subject: [ODBC] Using pg_config
> I was unable to build the libpq-based driver because it apparently makes some
> hard-coded assumptions about the installation paths which did not work on my
> system. It'd be better if pg_config were used to detect the installation
> paths. I've attached a patch for that here. I'm not sure how that works on
> Windows, though. Comments?
It's not a problem on Windows as we build using VC++ with win32.mak. We don't support Mingw builds as we don't currently have any configure code to allow the use of the Microsoft DM instead of iODBC or unixODBC.
Can you apply the patch, or shall I?
Regards, Dave.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Using pg_config
2005-10-11 13:37 Re: Using pg_config Dave Page <dpage@vale-housing.co.uk>
@ 2005-10-12 08:16 ` Peter Eisentraut <peter_e@gmx.net>
0 siblings, 0 replies; 4+ messages in thread
From: Peter Eisentraut @ 2005-10-12 08:16 UTC (permalink / raw)
To: Dave Page <dpage@vale-housing.co.uk>; +Cc: pgsql-odbc
Dave Page wrote:
> It's not a problem on Windows as we build using VC++ with win32.mak.
> We don't support Mingw builds as we don't currently have any
> configure code to allow the use of the Microsoft DM instead of iODBC
> or unixODBC.
I think this could be made to work if there is interest. It seems that
the current driver manager detection code might be pretty useless
anyway. Note that we don't even link with libodbcinst. All we need
are the header files <sql.h> etc., which are the same everywhere.
> Can you apply the patch, or shall I?
I just did.
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Using pg_config
@ 2005-10-12 09:58 Dave Page <dpage@vale-housing.co.uk>
0 siblings, 0 replies; 4+ messages in thread
From: Dave Page @ 2005-10-12 09:58 UTC (permalink / raw)
To: Peter Eisentraut <peter_e@gmx.net>; +Cc: pgsql-odbc
> -----Original Message-----
> From: Peter Eisentraut [mailto:peter_e@gmx.net]
> Sent: 12 October 2005 09:16
> To: Dave Page
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] Using pg_config
>
> Dave Page wrote:
> > It's not a problem on Windows as we build using VC++ with win32.mak.
> > We don't support Mingw builds as we don't currently have any
> > configure code to allow the use of the Microsoft DM instead of iODBC
> > or unixODBC.
>
> I think this could be made to work if there is interest. It
> seems that
> the current driver manager detection code might be pretty useless
> anyway. Note that we don't even link with libodbcinst. All we need
> are the header files <sql.h> etc., which are the same everywhere.
I think it is worth doing given that we build PostgreSQL and Slony in
mingw now. As you say, it shouldn't be too difficult.
> > Can you apply the patch, or shall I?
>
> I just did.
Thanks. Just in time for 08.01.0005 which was just tagged!
Regards, Dave
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2005-10-12 09:58 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-10-11 09:16 Using pg_config Peter Eisentraut <peter_e@gmx.net>
2005-10-11 13:37 Re: Using pg_config Dave Page <dpage@vale-housing.co.uk>
2005-10-12 08:16 ` Peter Eisentraut <peter_e@gmx.net>
2005-10-12 09:58 Re: Using pg_config Dave Page <dpage@vale-housing.co.uk>
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