mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-12 18:34:36 +08:00
Readline and Zlib now required by default. Add options --without-readline
and --without-zlib to turn them off.
This commit is contained in:
parent
563673e15d
commit
5c1f31d2d4
@ -1,4 +1,4 @@
|
||||
# $Header: /cvsroot/pgsql/config/programs.m4,v 1.9 2002/04/10 16:45:24 petere Exp $
|
||||
# $Header: /cvsroot/pgsql/config/programs.m4,v 1.10 2002/04/10 22:46:33 petere Exp $
|
||||
|
||||
|
||||
# PGAC_PATH_FLEX
|
||||
@ -115,6 +115,27 @@ fi])# PGAC_CHECK_READLINE
|
||||
|
||||
|
||||
|
||||
# PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER
|
||||
# ---------------------------------------
|
||||
# Readline versions < 2.1 don't have rl_completion_append_character
|
||||
|
||||
AC_DEFUN([PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER],
|
||||
[AC_MSG_CHECKING([for rl_completion_append_character])
|
||||
AC_TRY_LINK([#include <stdio.h>
|
||||
#ifdef HAVE_READLINE_READLINE_H
|
||||
# include <readline/readline.h>
|
||||
#elif defined(HAVE_READLINE_H)
|
||||
# include <readline.h>
|
||||
#endif
|
||||
],
|
||||
[rl_completion_append_character = 'x';],
|
||||
[AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER, 1,
|
||||
[Define if you have rl_completion_append_character])],
|
||||
[AC_MSG_RESULT(no)])])# PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER
|
||||
|
||||
|
||||
|
||||
# PGAC_CHECK_GETTEXT
|
||||
# ------------------
|
||||
|
||||
|
87
configure.in
87
configure.in
@ -1,5 +1,5 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl $Header: /cvsroot/pgsql/configure.in,v 1.176 2002/04/10 16:45:24 petere Exp $
|
||||
dnl $Header: /cvsroot/pgsql/configure.in,v 1.177 2002/04/10 22:46:31 petere Exp $
|
||||
|
||||
dnl Developers, please strive to achieve this order:
|
||||
dnl
|
||||
@ -511,6 +511,19 @@ PGAC_ARG_OPTARG(with, openssl,
|
||||
AC_SUBST(with_openssl)
|
||||
|
||||
|
||||
#
|
||||
# Readline
|
||||
#
|
||||
PGAC_ARG_BOOL(with, readline, yes,
|
||||
[ --without-readline do not use Readline])
|
||||
|
||||
#
|
||||
# Zlib
|
||||
#
|
||||
PGAC_ARG_BOOL(with, zlib, yes,
|
||||
[ --without-zlib do not use Zlib])
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Optionally enable the building of the ODBC driver
|
||||
@ -676,11 +689,6 @@ fi
|
||||
## Libraries
|
||||
##
|
||||
|
||||
PGAC_CHECK_READLINE
|
||||
AC_SEARCH_LIBS(using_history, history,
|
||||
[AC_DEFINE(HAVE_HISTORY_FUNCTIONS, 1,
|
||||
[Define if you have the history functions])])
|
||||
|
||||
if test "$PORTNAME" != "aix" -a "$PORTNAME" != "alpha"
|
||||
then
|
||||
AC_CHECK_LIB(bsd, main)
|
||||
@ -705,16 +713,23 @@ AC_CHECK_LIB([[unix]], main)
|
||||
AC_SEARCH_LIBS(crypt, crypt)
|
||||
# BeOS:
|
||||
AC_CHECK_LIB(bind, __inet_ntoa)
|
||||
# Only consider libz to be present if we find <zlib.h> as well;
|
||||
# furthermore, check that <zlib.h> defines z_streamp (versions before
|
||||
# about 1.0.4 did not). While we could work around the lack of z_streamp,
|
||||
# it seems unwise to encourage people to use such old zlib versions...
|
||||
AC_EGREP_HEADER(z_streamp, zlib.h, [
|
||||
AC_CHECK_LIB(z, inflate)
|
||||
])
|
||||
# Solaris:
|
||||
AC_SEARCH_LIBS(fdatasync, [rt posix4])
|
||||
|
||||
if test "$with_readline" = yes; then
|
||||
PGAC_CHECK_READLINE
|
||||
if test x"$pgac_cv_check_readline" = x"no"; then
|
||||
AC_MSG_ERROR([readline library not found
|
||||
Use --without-readline to disable readline support.])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$with_zlib" = yes; then
|
||||
AC_CHECK_LIB(z, inflate, [],
|
||||
[AC_MSG_ERROR([zlib library not found
|
||||
Use --without-zlib to disable zlib support.])])
|
||||
fi
|
||||
|
||||
if test "$with_krb4" = yes ; then
|
||||
AC_CHECK_LIB(des, [des_encrypt], [], [AC_MSG_ERROR([library 'des' is required for Kerberos 4])])
|
||||
AC_CHECK_LIB(krb, [krb_sendauth], [], [AC_MSG_ERROR([library 'krb' is required for Kerberos 4])])
|
||||
@ -756,8 +771,21 @@ AC_CHECK_HEADERS([netinet/tcp.h], [], [],
|
||||
#endif
|
||||
])
|
||||
|
||||
AC_CHECK_HEADERS([readline/readline.h readline.h], [break])
|
||||
AC_CHECK_HEADERS([readline/history.h history.h], [break])
|
||||
if test "$with_readline" = yes; then
|
||||
AC_CHECK_HEADERS([readline/readline.h], [],
|
||||
[AC_CHECK_HEADERS([readline.h], [],
|
||||
[AC_MSG_ERROR([readline header not found
|
||||
Use --without-readline to disable readline support.])])])
|
||||
AC_CHECK_HEADERS([readline/history.h], [],
|
||||
[AC_CHECK_HEADERS([history.h], [],
|
||||
[AC_MSG_ERROR([history header not found
|
||||
Use --without-readline to disable readline support.])])])
|
||||
fi
|
||||
|
||||
if test "$with_zlib" = yes; then
|
||||
AC_CHECK_HEADER(zlib.h, [], [AC_MSG_ERROR([zlib header not found
|
||||
Use --without-zlib to disable zlib support.])])
|
||||
fi
|
||||
|
||||
if test "$with_krb4" = yes ; then
|
||||
AC_CHECK_HEADER(krb.h, [], [AC_MSG_ERROR([header file <krb.h> is required for Kerberos 4])])
|
||||
@ -796,6 +824,15 @@ AC_CHECK_TYPES([struct cmsgcred, struct fcred, struct sockcred], [], [],
|
||||
#include <sys/socket.h>
|
||||
#include <sys/ucred.h>])
|
||||
|
||||
if test "$with_zlib" = yes; then
|
||||
# Check that <zlib.h> defines z_streamp (versions before about 1.0.4
|
||||
# did not). While we could work around the lack of z_streamp, it
|
||||
# seems unwise to encourage people to use such old zlib versions...
|
||||
AC_CHECK_TYPE(z_streamp, [], [AC_MSG_ERROR([zlib version is too old
|
||||
Use --without-zlib to disable zlib support.])],
|
||||
[#include <zlib.h>])
|
||||
fi
|
||||
|
||||
if test "$with_krb5" = yes; then
|
||||
# Check for differences between MIT and Heimdal (KTH) releases
|
||||
AC_CHECK_MEMBERS([krb5_ticket.enc_part2], [],
|
||||
@ -914,22 +951,10 @@ AC_CHECK_FUNCS(rint, [],
|
||||
[AC_CHECK_LIB(m, rint, AC_DEFINE(HAVE_RINT), , $HPUXMATHLIB)])
|
||||
|
||||
|
||||
# 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>
|
||||
#ifdef HAVE_READLINE_READLINE_H
|
||||
# include <readline/readline.h>
|
||||
#elif defined(HAVE_READLINE_H)
|
||||
# include <readline.h>
|
||||
#endif
|
||||
],
|
||||
[rl_completion_append_character = 'x';],
|
||||
[AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER, 1,
|
||||
[Define if you have rl_completion_append_character])],
|
||||
[AC_MSG_RESULT(no)])
|
||||
|
||||
AC_CHECK_FUNCS([rl_completion_matches rl_filename_completion_function])
|
||||
if test "$with_readline" = yes; then
|
||||
PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER
|
||||
AC_CHECK_FUNCS([rl_completion_matches rl_filename_completion_function])
|
||||
fi
|
||||
|
||||
|
||||
dnl Cannot use AC_CHECK_FUNC because finite may be a macro
|
||||
|
@ -1,4 +1,4 @@
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.76 2002/04/10 16:45:25 petere Exp $ -->
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.77 2002/04/10 22:46:33 petere Exp $ -->
|
||||
|
||||
<chapter id="installation">
|
||||
<title><![%standalone-include[<productname>PostgreSQL</>]]>
|
||||
@ -92,11 +92,12 @@ su - postgres
|
||||
<primary>readline</primary>
|
||||
</indexterm>
|
||||
|
||||
The <acronym>GNU</> <productname>Readline</> library (for comfortable
|
||||
line editing and command history retrieval) will automatically be used
|
||||
if found. You might wish to install it before proceeding, but it is not
|
||||
essential. (On <productname>NetBSD</productname>, the
|
||||
<filename>libedit</filename> library is
|
||||
The <acronym>GNU</> <productname>Readline</> library (for
|
||||
comfortable line editing and command history retrieval) will be
|
||||
used by default. If you don't want to use it then you must
|
||||
specify the <option>--without-readline</option> option for
|
||||
<filename>configure</>. (On <productname>NetBSD</productname>,
|
||||
the <filename>libedit</filename> library is
|
||||
<productname>readline</productname>-compatible and is used if
|
||||
<filename>libreadline</filename> is not found.)
|
||||
</para>
|
||||
@ -847,6 +848,29 @@ su - postgres
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>--without-readline</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Prevents the use of the Readline library. This disables
|
||||
command-line editing and history in
|
||||
<application>psql</application>, so it is not recommended.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>--without-zlib</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Prevents the use of the Zlib library. This disables
|
||||
compression support in <application>pg_dump</application>.
|
||||
This option is only intended for those rare systems where this
|
||||
library is not available.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>--enable-debug</option></term>
|
||||
<listitem>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/release.sgml,v 1.131 2002/04/05 00:31:23 tgl Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/release.sgml,v 1.132 2002/04/10 22:46:48 petere Exp $
|
||||
-->
|
||||
|
||||
<appendix id="release">
|
||||
@ -24,6 +24,7 @@ CDATA means the content is "SGML-free", so you can write without
|
||||
worries about funny characters.
|
||||
-->
|
||||
<literallayout><![CDATA[
|
||||
Readline and Zlib are now required by default and must be turned off explicitly if their use is not desired
|
||||
Define a third class of function volatility to allow indexscans in more cases
|
||||
Locale support is now built by default; choice of locale is set by initdb and/or at run-time
|
||||
ALTER TABLE ALTER COLUMN SET/DROP NOT NULL
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright 2000 by PostgreSQL Global Development Group
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/bin/psql/input.c,v 1.18 2001/10/25 05:49:54 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/bin/psql/input.c,v 1.19 2002/04/10 22:46:58 petere Exp $
|
||||
*/
|
||||
#include "postgres_fe.h"
|
||||
#include "input.h"
|
||||
@ -19,8 +19,6 @@
|
||||
/* (of course there is no runtime command for doing that :) */
|
||||
#ifdef USE_READLINE
|
||||
static bool useReadline;
|
||||
#endif
|
||||
#ifdef USE_HISTORY
|
||||
static bool useHistory;
|
||||
#endif
|
||||
|
||||
@ -44,7 +42,7 @@ gets_interactive(char *prompt)
|
||||
{
|
||||
char *s;
|
||||
|
||||
#ifdef USE_HISTORY
|
||||
#ifdef USE_READLINE
|
||||
const char *var;
|
||||
static char *prev_hist = NULL;
|
||||
#endif
|
||||
@ -62,7 +60,7 @@ gets_interactive(char *prompt)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_HISTORY
|
||||
#ifdef USE_READLINE
|
||||
if (useHistory && s && s[0] != '\0')
|
||||
{
|
||||
var = GetVariable(pset.vars, "HISTCONTROL");
|
||||
@ -133,7 +131,7 @@ initializeInput(int flags)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_HISTORY
|
||||
#ifdef USE_READLINE
|
||||
if (flags == 1)
|
||||
{
|
||||
const char *home;
|
||||
@ -168,7 +166,7 @@ initializeInput(int flags)
|
||||
bool
|
||||
saveHistory(char *fname)
|
||||
{
|
||||
#ifdef USE_HISTORY
|
||||
#ifdef USE_READLINE
|
||||
if (useHistory && fname)
|
||||
{
|
||||
if (write_history(fname) != 0)
|
||||
@ -194,7 +192,7 @@ finishInput(void)
|
||||
finishInput(int exitstatus, void *arg)
|
||||
#endif
|
||||
{
|
||||
#ifdef USE_HISTORY
|
||||
#ifdef USE_READLINE
|
||||
if (useHistory)
|
||||
{
|
||||
char *home;
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright 2000 by PostgreSQL Global Development Group
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/bin/psql/input.h,v 1.15 2001/11/05 17:46:31 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/bin/psql/input.h,v 1.16 2002/04/10 22:47:03 petere Exp $
|
||||
*/
|
||||
#ifndef INPUT_H
|
||||
#define INPUT_H
|
||||
@ -12,26 +12,20 @@
|
||||
* If some other file needs to have access to readline/history, include this
|
||||
* file and save yourself all this work.
|
||||
*
|
||||
* USE_READLINE and USE_HISTORY are the definite pointers regarding existence or not.
|
||||
* USE_READLINE is the definite pointers regarding existence or not.
|
||||
*/
|
||||
#ifdef HAVE_LIBREADLINE
|
||||
#if defined(HAVE_READLINE_READLINE_H)
|
||||
#include <readline/readline.h>
|
||||
#define USE_READLINE 1
|
||||
#elif defined(HAVE_READLINE_H)
|
||||
#include <readline.h>
|
||||
#define USE_READLINE 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_HISTORY_FUNCTIONS)
|
||||
#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
|
||||
# define USE_READLINE 1
|
||||
# if defined(HAVE_READLINE_READLINE_H)
|
||||
# include <readline/readline.h>
|
||||
# elif defined(HAVE_READLINE_H)
|
||||
# include <readline.h>
|
||||
# endif
|
||||
# if defined(HAVE_READLINE_HISTORY_H)
|
||||
# include <readline/history.h>
|
||||
# elif defined(HAVE_HISTORY_H)
|
||||
# include <history.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
char *gets_interactive(char *prompt);
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright 2000 by PostgreSQL Global Development Group
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.55 2002/03/27 19:16:13 petere Exp $
|
||||
* $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.56 2002/04/10 22:47:04 petere Exp $
|
||||
*/
|
||||
#include "postgres_fe.h"
|
||||
|
||||
@ -636,7 +636,7 @@ showVersion(void)
|
||||
{
|
||||
puts("psql (PostgreSQL) " PG_VERSION);
|
||||
|
||||
#if defined(USE_READLINE) || defined (USE_HISTORY) || defined(MULTIBYTE)
|
||||
#if defined(USE_READLINE) || defined(MULTIBYTE)
|
||||
fputs(gettext("contains support for: "), stdout);
|
||||
|
||||
#ifdef USE_READLINE
|
||||
@ -644,15 +644,6 @@ showVersion(void)
|
||||
#define _Feature
|
||||
#endif
|
||||
|
||||
#ifdef USE_HISTORY
|
||||
#ifdef _Feature
|
||||
fputs(", ", stdout);
|
||||
#else
|
||||
#define _Feature
|
||||
#endif
|
||||
fputs(gettext("history"), stdout);
|
||||
#endif
|
||||
|
||||
#ifdef MULTIBYTE
|
||||
#ifdef _Feature
|
||||
fputs(", ", stdout);
|
||||
|
@ -8,7 +8,7 @@
|
||||
* or in pg_config.h afterwards. Of course, if you edit pg_config.h, then your
|
||||
* changes will be overwritten the next time you run configure.
|
||||
*
|
||||
* $Id: pg_config.h.in,v 1.20 2002/04/03 05:39:33 petere Exp $
|
||||
* $Id: pg_config.h.in,v 1.21 2002/04/10 22:47:09 petere Exp $
|
||||
*/
|
||||
|
||||
#ifndef PG_CONFIG_H
|
||||
@ -420,9 +420,6 @@
|
||||
/* Define if you have the stricmp function. */
|
||||
#undef HAVE_STRICMP
|
||||
|
||||
/* Set to 1 if you have history functions (either in libhistory or libreadline) */
|
||||
#undef HAVE_HISTORY_FUNCTIONS
|
||||
|
||||
/* Set to 1 if you have <pwd.h> */
|
||||
#undef HAVE_PWD_H
|
||||
|
||||
@ -590,9 +587,6 @@ extern int fdatasync(int fildes);
|
||||
/* Set to 1 if you have libreadline.a */
|
||||
#undef HAVE_LIBREADLINE
|
||||
|
||||
/* Set to 1 if you have libhistory.a */
|
||||
#undef HAVE_LIBHISTORY
|
||||
|
||||
/* Set to 1 if your libreadline defines rl_completion_append_character */
|
||||
#undef HAVE_RL_COMPLETION_APPEND_CHARACTER
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user