From ad201b8d18b19d8c7a4a458e078bb555fcc2de74 Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Sun, 21 Apr 2002 00:22:52 +0000 Subject: [PATCH] Remove --enable-syslog option --- configure | 63 ++++++++++------------------------ configure.in | 10 ++---- src/backend/utils/error/elog.c | 14 ++++---- src/backend/utils/misc/guc.c | 10 +++--- src/include/pg_config.h.in | 7 ++-- src/include/utils/elog.h | 4 +-- 6 files changed, 37 insertions(+), 71 deletions(-) diff --git a/configure b/configure index 48f018e4a5..cbd52429a4 100755 --- a/configure +++ b/configure @@ -858,7 +858,6 @@ Optional Features: --enable-depend turn on automatic dependency tracking --enable-cassert enable assertion checks (for debugging) --enable-odbc build the ODBC driver package - --enable-syslog enable logging to syslog Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -12167,24 +12166,19 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - - -# Check whether --enable-syslog or --disable-syslog was given. -if test "${enable_syslog+set}" = set; then - enableval="$enable_syslog" - - case $enableval in - yes) - echo "$as_me:$LINENO: checking for syslog" >&5 -echo $ECHO_N "checking for syslog... $ECHO_C" >&6 -if test "${ac_cv_func_syslog+set}" = set; then +for ac_func in syslog +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char syslog (); below. */ + which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus @@ -12192,7 +12186,7 @@ extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char syslog (); +char $ac_func (); char (*f) (); #ifdef F77_DUMMY_MAIN @@ -12207,10 +12201,10 @@ main () /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_syslog) || defined (__stub___syslog) +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -f = syslog; +f = $ac_func; #endif ; @@ -12229,44 +12223,23 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_func_syslog=yes + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -ac_cv_func_syslog=no +eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_syslog" >&5 -echo "${ECHO_T}$ac_cv_func_syslog" >&6 -if test $ac_cv_func_syslog = yes; then - -cat >>confdefs.h <<\_ACEOF -#define ENABLE_SYSLOG 1 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF -else - { { echo "$as_me:$LINENO: error: no syslog interface found" >&5 -echo "$as_me: error: no syslog interface found" >&2;} - { (exit 1); exit 1; }; } fi - - ;; - no) - : - ;; - *) - { { echo "$as_me:$LINENO: error: no argument expected for --enable-syslog option" >&5 -echo "$as_me: error: no argument expected for --enable-syslog option" >&2;} - { (exit 1); exit 1; }; } - ;; - esac - -else - enable_syslog=no - -fi; - +done echo "$as_me:$LINENO: checking for optreset" >&5 diff --git a/configure.in b/configure.in index 13100c68a7..3491bbc855 100644 --- a/configure.in +++ b/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.178 2002/04/14 17:23:20 petere Exp $ +dnl $Header: /cvsroot/pgsql/configure.in,v 1.179 2002/04/21 00:22:52 ishii Exp $ dnl Developers, please strive to achieve this order: dnl @@ -975,13 +975,7 @@ AC_TRY_LINK([#include ], AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) - -PGAC_ARG_BOOL(enable, syslog, no, [ --enable-syslog enable logging to syslog], - [AC_CHECK_FUNC(syslog, - [AC_DEFINE([ENABLE_SYSLOG], 1, - [Define to 1 if to enable the syslogging code])], - [AC_MSG_ERROR([no syslog interface found])])]) - +AC_CHECK_FUNCS([syslog]) AC_CACHE_CHECK([for optreset], pgac_cv_var_int_optreset, [AC_TRY_LINK([#include ], diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c index ef05d9180c..dedbb9f68d 100644 --- a/src/backend/utils/error/elog.c +++ b/src/backend/utils/error/elog.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.95 2002/04/04 04:43:44 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.96 2002/04/21 00:22:52 ishii Exp $ * *------------------------------------------------------------------------- */ @@ -22,7 +22,7 @@ #include #include #include -#ifdef ENABLE_SYSLOG +#ifdef HAVE_SYSLOG #include #endif @@ -46,7 +46,7 @@ int client_min_messages; char *client_min_messages_str = NULL; const char client_min_messages_str_default[] = "notice"; -#ifdef ENABLE_SYSLOG +#ifdef HAVE_SYSLOG /* * 0 = only stdout/stderr * 1 = stdout+stderr and syslog @@ -351,7 +351,7 @@ elog(int lev, const char *fmt,...) * Message prepared; send it where it should go */ -#ifdef ENABLE_SYSLOG +#ifdef HAVE_SYSLOG /* Write to syslog, if enabled */ if (output_to_server && Use_syslog >= 1) { @@ -389,7 +389,7 @@ elog(int lev, const char *fmt,...) write_syslog(syslog_level, msg_buf + timestamp_size); } -#endif /* ENABLE_SYSLOG */ +#endif /* HAVE_SYSLOG */ /* syslog doesn't want a trailing newline, but other destinations do */ strcat(msg_buf, "\n"); @@ -612,7 +612,7 @@ print_pid(void) -#ifdef ENABLE_SYSLOG +#ifdef HAVE_SYSLOG #ifndef PG_SYSLOG_LIMIT #define PG_SYSLOG_LIMIT 128 @@ -733,7 +733,7 @@ write_syslog(int level, const char *line) syslog(level, "[%lu] %s", seq, line); } } -#endif /* ENABLE_SYSLOG */ +#endif /* HAVE_SYSLOG */ static void diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 8abf451b63..4d4e9f274d 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -4,7 +4,7 @@ * Support for grand unified configuration scheme, including SET * command, configuration file, and command line options. * - * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.65 2002/04/03 05:39:32 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.66 2002/04/21 00:22:52 ishii Exp $ * * Copyright 2000 by PostgreSQL Global Development Group * Written by Peter Eisentraut . @@ -54,7 +54,7 @@ extern int CommitDelay; extern int CommitSiblings; extern bool FixBTree; -#ifdef ENABLE_SYSLOG +#ifdef HAVE_SYSLOG extern char *Syslog_facility; extern char *Syslog_ident; static bool check_facility(const char *facility); @@ -394,7 +394,7 @@ static struct config_int 1000, 0, INT_MAX, NULL, NULL }, -#ifdef ENABLE_SYSLOG +#ifdef HAVE_SYSLOG { "syslog", PGC_SIGHUP, PGC_S_DEFAULT, &Use_syslog, 0, 0, 2, NULL, NULL @@ -612,7 +612,7 @@ static struct config_string assign_server_min_messages }, -#ifdef ENABLE_SYSLOG +#ifdef HAVE_SYSLOG { "syslog_facility", PGC_POSTMASTER, PGC_S_DEFAULT, &Syslog_facility, "LOCAL0", check_facility, NULL @@ -1364,7 +1364,7 @@ ParseLongOption(const char *string, char **name, char **value) -#ifdef ENABLE_SYSLOG +#ifdef HAVE_SYSLOG static bool check_facility(const char *facility) diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in index 2cfe5b16d6..2cae99aaef 100644 --- a/src/include/pg_config.h.in +++ b/src/include/pg_config.h.in @@ -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.21 2002/04/10 22:47:09 petere Exp $ + * $Id: pg_config.h.in,v 1.22 2002/04/21 00:22:52 ishii Exp $ */ #ifndef PG_CONFIG_H @@ -47,9 +47,6 @@ /* Set to 1 if you want ASSERT checking (--enable-cassert) */ #undef USE_ASSERT_CHECKING -/* Set to 1 to use syslog() to write postmaster log (--enable-syslog) */ -#undef ENABLE_SYSLOG - /* Define to build with Kerberos 4 support (--with-krb4[=DIR]) */ #undef KRB4 @@ -708,6 +705,8 @@ extern int fdatasync(int fildes); #undef HAVE_UINT64 #undef HAVE_SIG_ATOMIC_T +/* Define if you have syslog() */ +#undef HAVE_SYSLOG /* *------------------------------------------------------------------------ diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h index 6a13ff4087..6e0d580828 100644 --- a/src/include/utils/elog.h +++ b/src/include/utils/elog.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: elog.h,v 1.35 2002/03/06 06:23:20 momjian Exp $ + * $Id: elog.h,v 1.36 2002/04/21 00:22:52 ishii Exp $ * *------------------------------------------------------------------------- */ @@ -41,7 +41,7 @@ /*#define DEBUG DEBUG1*/ /* Backward compatibility with pre-7.3 */ /* Configurable parameters */ -#ifdef ENABLE_SYSLOG +#ifdef HAVE_SYSLOG extern int Use_syslog; #endif extern bool Log_timestamp; -- 2.40.0