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 \
