]> granicus.if.org Git - postgresql/commitdiff
Remove --enable-syslog option
authorTatsuo Ishii <ishii@postgresql.org>
Sun, 21 Apr 2002 00:22:52 +0000 (00:22 +0000)
committerTatsuo Ishii <ishii@postgresql.org>
Sun, 21 Apr 2002 00:22:52 +0000 (00:22 +0000)
configure
configure.in
src/backend/utils/error/elog.c
src/backend/utils/misc/guc.c
src/include/pg_config.h.in
src/include/utils/elog.h

index 48f018e4a58a134bf67fd8a0451b4bf590b1181f..cbd52429a434b86271c582d027327a1d9b0b7eb5 100755 (executable)
--- 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]
 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 <assert.h>
 /* 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
index 13100c68a71bf5603eae09cd8a9c1c634b041668..3491bbc8550bd4fbc1636196232f29caba08c0f1 100644 (file)
@@ -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 <setjmp.h>],
 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 <unistd.h>],
index ef05d9180c9d68f0b48e4a7520e6ea131f2e9011..dedbb9f68db81f74b327ff4ac89539bf37e46193 100644 (file)
@@ -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 <signal.h>
 #include <sys/time.h>
 #include <ctype.h>
-#ifdef ENABLE_SYSLOG
+#ifdef HAVE_SYSLOG
 #include <syslog.h>
 #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
index 8abf451b630b4bf21585958f83e2272032014422..4d4e9f274da6149acce71e561f0c4d05899a6cfa 100644 (file)
@@ -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 <peter_e@gmx.net>.
@@ -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)
index 2cfe5b16d6a53bce2614ca3db1321f821e53b9ce..2cae99aaefb64d74241ab94e3ff3d305823db457 100644 (file)
@@ -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
 
 /*
  *------------------------------------------------------------------------
index 6a13ff4087028ce46cf1f3ae399e6595a794926c..6e0d58082807492649fa0533229bf44e30311136 100644 (file)
@@ -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;