summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc G. Fournier1997-01-25 22:16:43 +0000
committerMarc G. Fournier1997-01-25 22:16:43 +0000
commit374b2b06392c7aaaa850eecea8e0f49bc98cc8b8 (patch)
treeb075cd88af50b8bb19e956bfaf189f79b13ab475
parentd049cec4f5628dad8798bc6871721b22a09b3bd2 (diff)
Why can't everyone be standard? :(
Add some code to make psql happy with a system where there is *no* history code available, but there is readline code...
-rw-r--r--src/bin/psql/psql.c6
-rw-r--r--src/include/config.h10
2 files changed, 13 insertions, 3 deletions
diff --git a/src/bin/psql/psql.c b/src/bin/psql/psql.c
index 409705b48c7..8df0998c3e0 100644
--- a/src/bin/psql/psql.c
+++ b/src/bin/psql/psql.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.51 1997/01/25 21:58:08 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.52 1997/01/25 22:16:36 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@@ -35,12 +35,12 @@
#else
# ifdef HAVE_READLINE_H
# include <readline.h>
-# ifdef HAVE_HISTORY_H
+# ifndef NO_HISTORY
# include <history.h>
# endif
# else
# include <readline/readline.h>
-# ifdef HAVE_READLINE_HISTORY_H
+# ifndef NO_HISTORY
# include <readline/history.h>
# endif
# endif
diff --git a/src/include/config.h b/src/include/config.h
index fd74b272815..f34189efec0 100644
--- a/src/include/config.h
+++ b/src/include/config.h
@@ -23,6 +23,16 @@
/* #undef HAVE_HISTORY_H */
/* #undef HAVE_READLINE_HISTORY_H */
+/* this is meant to handle the condition where the system has readline
+ * capabilities, but no history. Unfortunately, it isn't as simple as
+ * testing for the existance of -lhistory, since newer -lreadline seems to
+ * include the -lhistory library, but newer readline.h doesn't
+ */
+#if defined(HAVE_LIBREADLINE)
+# if !defined(HAVE_HISTORY_H) || !defined(HAVE_READLINE_HISTORY_H)
+# define NO_HISTORY_H
+# endif
+#endif
#define HAVE_SYS_SELECT_H
#define HAVE_TERMIOS_H