Skip site navigation (1) Skip section navigation (2)

configure.in patch for readline and curses.

From: Jason Schroeder <shrode(at)astanetworks(dot)com>
To: "'pgsql-patches(at)postgresql(dot)org'" <pgsql-patches(at)postgresql(dot)org>
Subject: configure.in patch for readline and curses.
Date: 2001-01-26 22:38:32
Message-ID: 15E6537E180CC545848148F30F6688D80DB3E9@navajo.astanetworks.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
hi,

The following configure.in patch changes the following:
1) It adds --without-readline to control whether the readling package is
used
   Obviously, this could be extended to the general
--with[out]-readline[=DIR] pattern, but this is as far as I got.
2) It permits the termcap library to be used IFF ncurses and curses are not
available.

(Some indenting has not be performed to save maintainer stress.)
The following patch is against cvs tag: REL7_1_BETA3.

*** orig/configure.in	2001/01/10 09:05:42
--- new/configure.in	2001/01/26 22:28:26
***************
*** 354,359 ****
--- 354,365 ----
  done
  IFS=$ac_save_IFS
  
+ #
+ # Readline
+ #
+ AC_MSG_CHECKING([whether to build with readline])
+ PGAC_ARG_BOOL(with, readline, yes, [  --without-readline      do not use
readline])
+ AC_MSG_RESULT([$with_readline])
  
  #
  # Tcl/Tk
***************
*** 654,664 ****
  ##
  
  AC_CHECK_LIB(sfio,     main)
! AC_CHECK_LIB(ncurses,  main, [], [AC_CHECK_LIB(curses, main)])
! AC_CHECK_LIB(termcap,  main)
! AC_SEARCH_LIBS(readline, [readline edit], [AC_DEFINE(HAVE_LIBREADLINE)])
! AC_SEARCH_LIBS(using_history, history,
[AC_DEFINE(HAVE_HISTORY_FUNCTIONS)])
  
  if test "$PORTNAME" != "aix" -a "$PORTNAME" != "alpha"
  then
  	AC_CHECK_LIB(bsd,      main)
--- 660,672 ----
  ##
  
  AC_CHECK_LIB(sfio,     main)
! AC_CHECK_LIB(ncurses,  main, [], [AC_CHECK_LIB(curses, main, [],
[AC_CHECK_LIB(termcap,  main)])])
  
+ if test "$with_readline" = yes; then
+   AC_SEARCH_LIBS(readline, [readline edit], [AC_DEFINE(HAVE_LIBREADLINE)])
+   AC_SEARCH_LIBS(using_history, history,
[AC_DEFINE(HAVE_HISTORY_FUNCTIONS)])
+ fi
+ 
  if test "$PORTNAME" != "aix" -a "$PORTNAME" != "alpha"
  then
  	AC_CHECK_LIB(bsd,      main)
***************
*** 724,731 ****
  
  PGAC_HEADER_STRING
  
! AC_CHECK_HEADERS([readline/readline.h readline.h], [break])
! AC_CHECK_HEADERS([readline/history.h history.h], [break])
  
  if test "$with_krb4" = yes ; then
    AC_CHECK_HEADER(krb.h, [], [AC_MSG_ERROR([header file <krb.h> is
required for Kerberos 4])])
--- 732,741 ----
  
  PGAC_HEADER_STRING
  
! if test "$with_readline" = yes; then
!   AC_CHECK_HEADERS([readline/readline.h readline.h], [break])
!   AC_CHECK_HEADERS([readline/history.h history.h], [break])
! fi
  
  if test "$with_krb4" = yes ; then
    AC_CHECK_HEADER(krb.h, [], [AC_MSG_ERROR([header file <krb.h> is
required for Kerberos 4])])
***************
*** 878,883 ****
--- 888,894 ----
  	      AC_CHECK_LIB(m, rint, AC_DEFINE(HAVE_RINT), , $HPUXMATHLIB))
  
  
+ if test "$with_readline" = yes; then
  # Readline versions < 2.1 don't have rl_completion_append_character
  AC_MSG_CHECKING([for rl_completion_append_character])
  AC_TRY_LINK([#include <stdio.h>
***************
*** 891,902 ****
  [AC_MSG_RESULT(yes)
  AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER)],
  [AC_MSG_RESULT(no)])
! 
  
  # Check whether readline's filename_completion_function is declared.
  # Some prehistoric versions of readline, in particular those shipped
  # with earlier Cygwins don't have this declared, although it's in the
  # library.
  AC_MSG_CHECKING([whether filename_completion_function is declared])
  if test "$ac_cv_header_readline_h" = yes; then
      _readline_header='readline.h'
--- 902,914 ----
  [AC_MSG_RESULT(yes)
  AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER)],
  [AC_MSG_RESULT(no)])
! fi
  
  # Check whether readline's filename_completion_function is declared.
  # Some prehistoric versions of readline, in particular those shipped
  # with earlier Cygwins don't have this declared, although it's in the
  # library.
+ if test "$with_readline" = yes; then
  AC_MSG_CHECKING([whether filename_completion_function is declared])
  if test "$ac_cv_header_readline_h" = yes; then
      _readline_header='readline.h'
***************
*** 909,915 ****
  [AC_DEFINE(HAVE_FILENAME_COMPLETION_FUNCTION_DECL)
  AC_MSG_RESULT(yes)],
  [AC_MSG_RESULT(no)])
! 
  
  
  dnl Cannot use AC_CHECK_FUNC because finite may be a macro
--- 921,927 ----
  [AC_DEFINE(HAVE_FILENAME_COMPLETION_FUNCTION_DECL)
  AC_MSG_RESULT(yes)],
  [AC_MSG_RESULT(no)])
! fi
  
  
  dnl Cannot use AC_CHECK_FUNC because finite may be a macr
jason

Responses

pgsql-hackers by date

Next:From: Hiroshi InoueDate: 2001-01-26 22:43:59
Subject: RE: Bug in FOREIGN KEY
Previous:From: Jan WieckDate: 2001-01-26 22:06:24
Subject: Re: Sure enough, the lock file is gone

pgsql-patches by date

Next:From: Tom LaneDate: 2001-01-27 01:14:58
Subject: Re: configure.in patch for readline and curses.
Previous:From: Achim GottingerDate: 2001-01-26 15:54:52
Subject: patch for src/backends/catalog/genbki.sh.in

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group