]> granicus.if.org Git - postgresql/commitdiff
The attached patch corrects two problems with autoconfiguration of
authorBruce Momjian <bruce@momjian.us>
Tue, 12 May 1998 23:05:12 +0000 (23:05 +0000)
committerBruce Momjian <bruce@momjian.us>
Tue, 12 May 1998 23:05:12 +0000 (23:05 +0000)
psql in Postgres 6.3.2.  Both of these problems were complained of
recently in pgsql-questions:

1. In the right circumstances, psql.c will fail to compile due to
trying
   to include a nonexistent <history.h>.  (Thread "Compile-time
   error" around 17 Apr 98.) 2. In other circumstances, psql will
compile but does not provide
   command history capability, even though the underlying readline
   library supports it.  (Various threads, most recently "query
   repetition in psql" around 29 Apr.)

Tom Lane

src/bin/psql/psql.c
src/include/config.h.in

index 97125d795791bf47b42445459818b20ba73eefd8..a13ac63545e4e1478579c8ac655f8a1dafdc27ef 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.141 1998/05/12 23:04:01 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.142 1998/05/12 23:05:12 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -39,7 +39,7 @@
 #ifdef HAVE_READLINE_H
 #include <readline.h>
 #define USE_READLINE 1
-#if defined(HAVE_HISTORY)
+#if defined(HAVE_HISTORY_H)
 #include <history.h>
 #define USE_HISTORY 1
 #endif
@@ -53,6 +53,9 @@
 #endif
 #endif
 #endif
+#if defined(HAVE_HISTORY) && !defined(USE_HISTORY)
+#define USE_HISTORY 1
+#endif
 #endif
 
 /* This prompt string is assumed to have at least 3 characters by code in MainLoop().
index 9d76e3af6a6e27783cfef802e64af4be24c4c4ef..2293c68f539601e4a50c3c466b4dc6964c070426 100644 (file)
@@ -63,7 +63,7 @@
 #undef HAVE_READLINE_H
 
 /* Set to 1 if you have <history.h> */
-#undef HAVE_HISTORY
+#undef HAVE_HISTORY_H
 
 /* Set to 1 if you have <readline/history.h> */
 #undef HAVE_READLINE_HISTORY_H
@@ -71,6 +71,9 @@
 /* Set to 1 if you have <readline/readline.h> */
 #undef HAVE_READLINE_READLINE_H
 
+/* Set to 1 if you have libreadline and it includes history functions */
+#undef HAVE_HISTORY
+
 /* Set to 1 if you have <dld.h> */
 #undef HAVE_DLD_H