Thread: readline and openbsd

readline and openbsd

From
Hal Snyder
Date:
I noticed a change in src/bin/psql/input.h dated 3 weeks ago.

It did not fix the problem that psql builds without command history
support on OpenBSD. Problem is that OpenBSD has history support but no
history.h file. Here's a patch:

*** bin/psql/input.h.orig    Wed Apr 12 12:16:22 2000
--- bin/psql/input.h    Wed Oct 25 13:25:44 2000
***************
*** 25,36 ****
  #endif

  #if defined(HAVE_LIBHISTORY) || (defined(HAVE_LIBREADLINE) && defined(HAVE_HISTORY_IN_READLINE))
  #if defined(HAVE_READLINE_HISTORY_H)
  #include <readline/history.h>
- #define USE_HISTORY 1
  #elif defined(HAVE_HISTORY_H)
  #include <history.h>
- #define USE_HISTORY 1
  #endif
  #endif

--- 25,35 ----
  #endif

  #if defined(HAVE_LIBHISTORY) || (defined(HAVE_LIBREADLINE) && defined(HAVE_HISTORY_IN_READLINE))
+ #define USE_HISTORY 1
  #if defined(HAVE_READLINE_HISTORY_H)
  #include <readline/history.h>
  #elif defined(HAVE_HISTORY_H)
  #include <history.h>
  #endif
  #endif


Re: readline and openbsd

From
Peter Eisentraut
Date:
Hal Snyder writes:

> I noticed a change in src/bin/psql/input.h dated 3 weeks ago.
>
> It did not fix the problem that psql builds without command history
> support on OpenBSD. Problem is that OpenBSD has history support but no
> history.h file. Here's a patch:

There needs to be some header file where the function is declared.  Using
undeclared functions doesn't work for people with C99 compilers.

--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


Re: readline and openbsd

From
Hal Snyder
Date:
Peter Eisentraut <peter_e@gmx.net> writes:

> Hal Snyder writes:
>
> > I noticed a change in src/bin/psql/input.h dated 3 weeks ago.

> > It did not fix the problem that psql builds without command
> > history support on OpenBSD. Problem is that OpenBSD has history
> > support but no history.h file. Here's a patch:

> There needs to be some header file where the function is declared.
> Using undeclared functions doesn't work for people with C99
> compilers.

Right.

With the patch I submitted, psql compiled fine with gcc on several
recent releases of OpenBSD. It's great to get command history working.

But yes, there appears to be a glitch in the OpenBSD build such that
history.h is not installed into /usr/include/readline - will go after
that.

Thanks.