+echo "checking for PostgreSQL" 1>&6
+echo "configure:7182: checking for PostgreSQL" >&5
+postgres_h_path=""
+postgres_includes_found=no
+save_c_switch_site="$c_switch_site"
+
+if test "$with_postgresql" != "no"; then
+ ac_safe=`echo "libpq-fe.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for libpq-fe.h""... $ac_c" 1>&6
+echo "configure:7190: checking for libpq-fe.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7193 "configure"
+#include "confdefs.h"
+#include <libpq-fe.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:7198: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ postgres_includes_found=yes
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+if test "$postgres_includes_found" = "no" -a "$with_postgresql" != "no" -a \
+ -d "/usr/local/pgsql/include"; then
+ c_switch_site="$c_switch_site -I/usr/local/pgsql/include"
+ ac_safe=`echo "libpq-fe.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for libpq-fe.h""... $ac_c" 1>&6
+echo "configure:7225: checking for libpq-fe.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7228 "configure"
+#include "confdefs.h"
+#include <libpq-fe.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:7233: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ postgres_includes_found=yes
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test "$postgres_includes_found" != "yes"; then
+ postgres_h_path="/usr/local/pgsql/include"
+ fi
+ c_switch_site="$save_c_switch_site"
+fi
+if test "$postgres_includes_found" = "no" -a "$with_postgresql" != "no" -a \
+ -d "/usr/include/pgsql"; then
+ c_switch_site="$c_switch_site -I/usr/include/pgsql"
+ ac_safe=`echo "libpq-fe.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for libpq-fe.h""... $ac_c" 1>&6
+echo "configure:7263: checking for libpq-fe.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7266 "configure"
+#include "confdefs.h"
+#include <libpq-fe.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:7271: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ postgres_includes_found=yes
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test "$postgres_includes_found" = "yes"; then
+ postgres_h_path="pgsql"
+ fi
+ c_switch_site="$save_c_switch_site"
+ fi
+if test "$postgres_includes_found" = "no" -a "$with_postgresql" != "no" -a \
+ -d "/usr/include/postgresql"; then
+ c_switch_site="$c_switch_site -I/usr/include/postgresql"
+ ac_safe=`echo "libpq-fe.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for libpq-fe.h""... $ac_c" 1>&6
+echo "configure:7301: checking for libpq-fe.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 7304 "configure"
+#include "confdefs.h"
+#include <libpq-fe.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:7309: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ postgres_includes_found=yes
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test "$postgres_includes_found" = "yes"; then
+ postgres_h_path="postgresql"
+fi
+ c_switch_site="$save_c_switch_site"
+fi
+
+if test "$postgres_includes_found" = "yes"; then
+
+echo $ac_n "checking for PQconnectdb in -lpq""... $ac_c" 1>&6
+echo "configure:7338: checking for PQconnectdb in -lpq" >&5
+ac_lib_var=`echo pq'_'PQconnectdb | sed 'y%./+-%__p_%'`
+
+xe_check_libs=" -lpq "
+cat > conftest.$ac_ext <<EOF
+#line 7343 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char PQconnectdb();
+
+int main() {
+PQconnectdb()
+; return 0; }
+EOF
+if { (eval echo configure:7354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+xe_check_libs=""
+
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
+ echo "$ac_t""yes" 1>&6
+ with_postgresql=yes
+else
+ echo "$ac_t""no" 1>&6
+with_postgresql=no
+fi
+
+
+fi
+if test "$with_postgresql" = "yes"; then
+
+echo $ac_n "checking for PQconnectStart in -lpq""... $ac_c" 1>&6
+echo "configure:7379: checking for PQconnectStart in -lpq" >&5
+ac_lib_var=`echo pq'_'PQconnectStart | sed 'y%./+-%__p_%'`
+
+xe_check_libs=" -lpq "
+cat > conftest.$ac_ext <<EOF
+#line 7384 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char PQconnectStart();
+
+int main() {
+PQconnectStart()
+; return 0; }
+EOF
+if { (eval echo configure:7395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+xe_check_libs=""
+
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
+ echo "$ac_t""yes" 1>&6
+ with_postgresqlv7=yes
+else
+ echo "$ac_t""no" 1>&6
+with_postgresqlv7=no
+fi
+
+
+fi
+if test "$with_postgresql" = "yes"; then
+ if test -n "$postgres_h_path"; then
+ { test "$extra_verbose" = "yes" && cat << EOF
+ Defining POSTGRES_H_PATH = $postgres_h_path
+EOF
+cat >> confdefs.h <<EOF
+#define POSTGRES_H_PATH $postgres_h_path
+EOF
+}
+
+ fi
+ { test "$extra_verbose" = "yes" && cat << \EOF
+ Defining HAVE_POSTGRESQL
+EOF
+cat >> confdefs.h <<\EOF
+#define HAVE_POSTGRESQL 1
+EOF
+}
+
+ if test "$with_postgresqlv7" = "yes"; then
+ { test "$extra_verbose" = "yes" && cat << \EOF
+ Defining HAVE_POSTGRESQLV7
+EOF
+cat >> confdefs.h <<\EOF
+#define HAVE_POSTGRESQLV7 1
+EOF
+}
+
+ fi
+ LIBS="-lpq $LIBS" && if test "$extra_verbose" = "yes"; then echo " Prepending \"-lpq\" to \$LIBS"; fi
+ extra_objs="$extra_objs postgresql.o" && if test "$extra_verbose" = "yes"; then
+ echo " xemacs will be linked with \"postgresql.o\""
+ fi
+fi
+