X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id BB0FDD6ECE for ; Tue, 11 Oct 2005 06:16:54 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 77664-04 for ; Tue, 11 Oct 2005 09:16:49 +0000 (GMT) Received: from gauss.credativ.com (ipx11302.ipxserver.de [212.112.227.254]) by svr1.postgresql.org (Postfix) with ESMTP id D35BCD6E97 for ; Tue, 11 Oct 2005 06:16:50 -0300 (ADT) Received: from bell.credativ.de (p50894A9C.dip.t-dialin.net [80.137.74.156]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by gauss.credativ.com (Postfix) with ESMTP id ADA11D7657 for ; Tue, 11 Oct 2005 11:16:51 +0200 (CEST) From: Peter Eisentraut To: pgsql-odbc@postgresql.org Subject: Using pg_config Date: Tue, 11 Oct 2005 11:16:50 +0200 User-Agent: KMail/1.8.1 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_CM4SDOMtwR4YKXy" Message-Id: <200510111116.50621.peter_e@gmx.net> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.159 required=5 tests=[AWL=-0.098, FORGED_RCVD_HELO=0.05, UPPERCASE_25_50=0.207] X-Spam-Level: X-Archive-Number: 200510/43 X-Sequence-Number: 6145 --Boundary-00=_CM4SDOMtwR4YKXy Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline 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/ --Boundary-00=_CM4SDOMtwR4YKXy Content-Type: text/x-diff; charset="us-ascii"; name="psqlodbc-pgconfig.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="psqlodbc-pgconfig.patch" 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 \ --Boundary-00=_CM4SDOMtwR4YKXy--