[or-cvs] Big libevent patch: make logging use a callback-based syste...
Nick Mathewson
nickm at seul.org
Tue Mar 1 00:22:56 UTC 2005
Update of /home/or/cvsroot/libevent
In directory moria.mit.edu:/tmp/cvs-serv19082
Modified Files:
Makefile.am Makefile.in aclocal.m4 buffer.c configure
configure.in devpoll.c epoll.c event.c event.h kqueue.c poll.c
rtsig.c select.c signal.c
Added Files:
log.c log.h
Removed Files:
err.c
Log Message:
Big libevent patch: make logging use a callback-based system, and never stderr.
Index: Makefile.am
===================================================================
RCS file: /home/or/cvsroot/libevent/Makefile.am,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Makefile.am 22 Feb 2005 03:43:50 -0000 1.1
+++ Makefile.am 1 Mar 2005 00:22:52 -0000 1.2
@@ -2,7 +2,7 @@
SUBDIRS = . sample test
-EXTRA_DIST = acconfig.h err.c event.h event-internal.h evsignal.h event.3 \
+EXTRA_DIST = acconfig.h event.h event-internal.h log.h evsignal.h event.3 \
kqueue.c epoll_sub.c epoll.c select.c rtsig.c poll.c signal.c \
devpoll.c \
sample/Makefile.am sample/Makefile.in sample/event-test.c \
@@ -10,7 +10,7 @@
test/Makefile.am test/Makefile.in test/bench.c test/regress.c \
test/test-eof.c test/test-weof.c test/test-time.c \
test/test-init.c test/test.sh \
- compat/err.h compat/sys/queue.h compat/sys/tree.h compat/sys/_time.h \
+ compat/sys/queue.h compat/sys/tree.h compat/sys/_time.h \
WIN32-Code WIN32-Code/config.h WIN32-Code/misc.c \
WIN32-Code/win32.c WIN32-Code/misc.h \
WIN32-Prj WIN32-Prj/event_test WIN32-Prj/event_test/event_test.dsp \
@@ -21,7 +21,7 @@
lib_LIBRARIES = libevent.a
-libevent_a_SOURCES = event.c buffer.c evbuffer.c
+libevent_a_SOURCES = event.c buffer.c evbuffer.c log.c
libevent_a_LIBADD = @LIBOBJS@
include_HEADERS = event.h
Index: Makefile.in
===================================================================
RCS file: /home/or/cvsroot/libevent/Makefile.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Makefile.in 22 Feb 2005 03:43:50 -0000 1.1
+++ Makefile.in 1 Mar 2005 00:22:52 -0000 1.2
@@ -1,6 +1,8 @@
-# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+# Makefile.in generated by automake 1.8.3 from Makefile.am.
+# @configure_input@
-# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -10,222 +12,298 @@
[...998 lines suppressed...]
+ distclean-recursive distclean-tags distcleancheck distdir \
+ distuninstallcheck dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-includeHEADERS install-info \
+ install-info-am install-libLIBRARIES install-man install-man3 \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ maintainer-clean-recursive mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-recursive pdf pdf-am ps ps-am \
+ tags tags-recursive uninstall uninstall-am \
+ uninstall-includeHEADERS uninstall-info-am \
+ uninstall-libLIBRARIES uninstall-man uninstall-man3
verify: libevent.a
cd $(srcdir)/test && make verify
-
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
Index: aclocal.m4
===================================================================
RCS file: /home/or/cvsroot/libevent/aclocal.m4,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- aclocal.m4 22 Feb 2005 03:43:50 -0000 1.1
+++ aclocal.m4 1 Mar 2005 00:22:52 -0000 1.2
@@ -1,50 +1,19 @@
-dnl aclocal.m4 generated automatically by aclocal 1.4-p6
-
-dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-dnl PARTICULAR PURPOSE.
[...1041 lines suppressed...]
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
Index: buffer.c
===================================================================
RCS file: /home/or/cvsroot/libevent/buffer.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- buffer.c 22 Feb 2005 03:43:50 -0000 1.1
+++ buffer.c 1 Mar 2005 00:22:52 -0000 1.2
@@ -39,7 +39,6 @@
#include <sys/ioctl.h>
#endif
-#include <err.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
Index: configure
===================================================================
RCS file: /home/or/cvsroot/libevent/configure,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- configure 22 Feb 2005 05:31:33 -0000 1.3
+++ configure 1 Mar 2005 00:22:52 -0000 1.4
@@ -309,7 +309,7 @@
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO SET_MAKE MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT RANLIB ac_ct_RANLIB LN_S CPP EGREP LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB LN_S CPP EGREP LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -845,8 +845,10 @@
Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-maintainer-mode enable make rules and dependencies not useful
- (and sometimes confusing) to the casual installer
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer
+ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -1301,7 +1303,7 @@
-am__api_version="1.4"
+am__api_version="1.8"
ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
@@ -1410,20 +1412,21 @@
echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
# Just in case
sleep 1
-echo timestamp > conftestfile
+echo timestamp > conftest.file
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
- set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
if test "$*" = "X"; then
# -L didn't work.
- set X `ls -t $srcdir/configure conftestfile`
+ set X `ls -t $srcdir/configure conftest.file`
fi
- if test "$*" != "X $srcdir/configure conftestfile" \
- && test "$*" != "X conftestfile $srcdir/configure"; then
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
@@ -1436,7 +1439,7 @@
{ (exit 1); exit 1; }; }
fi
- test "$2" = conftestfile
+ test "$2" = conftest.file
)
then
# Ok.
@@ -1448,7 +1451,6 @@
Check your system clock" >&2;}
{ (exit 1); exit 1; }; }
fi
-rm -f conftest*
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
test "$program_prefix" != NONE &&
@@ -1464,6 +1466,84 @@
program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
rm conftest.sed
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ # Keeping the `.' argument allows $(mkdir_p) to be used without
+ # argument. Indeed, we sometimes output rules like
+ # $(mkdir_p) $(somedir)
+ # where $(somedir) is conditionally defined.
+ # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more
+ # expensive solution, as it forces Make to start a sub-shell.)
+ mkdir_p='mkdir -p -- .'
+else
+ # On NextStep and OpenStep, the `mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because `.' already
+ # exists.
+ for d in ./-p ./--version;
+ do
+ test -d $d && rmdir $d
+ done
+ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+ if test -f "$ac_aux_dir/mkinstalldirs"; then
+ mkdir_p='$(mkinstalldirs)'
+ else
+ mkdir_p='$(install_sh) -d'
+ fi
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$AWK" && break
+done
+
echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
@@ -1493,17 +1573,38 @@
SET_MAKE="MAKE=${MAKE-make}"
fi
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
-PACKAGE=libevent
-
-VERSION=1.0b
-
-if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
{ { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
{ (exit 1); exit 1; }; }
fi
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE=libevent
+ VERSION=1.0b
+
+
cat >>confdefs.h <<_ACEOF
#define PACKAGE "$PACKAGE"
_ACEOF
@@ -1513,89 +1614,121 @@
#define VERSION "$VERSION"
_ACEOF
+# Some tools Automake needs.
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
-missing_dir=`cd $ac_aux_dir && pwd`
-echo "$as_me:$LINENO: checking for working aclocal-${am__api_version}" >&5
-echo $ECHO_N "checking for working aclocal-${am__api_version}... $ECHO_C" >&6
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if (aclocal-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then
- ACLOCAL=aclocal-${am__api_version}
- echo "$as_me:$LINENO: result: found" >&5
-echo "${ECHO_T}found" >&6
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ACLOCAL="$missing_dir/missing aclocal-${am__api_version}"
- echo "$as_me:$LINENO: result: missing" >&5
-echo "${ECHO_T}missing" >&6
-fi
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
-echo "$as_me:$LINENO: checking for working autoconf" >&5
-echo $ECHO_N "checking for working autoconf... $ECHO_C" >&6
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if (autoconf --version) < /dev/null > /dev/null 2>&1; then
- AUTOCONF=autoconf
- echo "$as_me:$LINENO: result: found" >&5
-echo "${ECHO_T}found" >&6
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
else
- AUTOCONF="$missing_dir/missing autoconf"
- echo "$as_me:$LINENO: result: missing" >&5
-echo "${ECHO_T}missing" >&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-echo "$as_me:$LINENO: checking for working automake-${am__api_version}" >&5
-echo $ECHO_N "checking for working automake-${am__api_version}... $ECHO_C" >&6
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if (automake-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then
- AUTOMAKE=automake-${am__api_version}
- echo "$as_me:$LINENO: result: found" >&5
-echo "${ECHO_T}found" >&6
-else
- AUTOMAKE="$missing_dir/missing automake-${am__api_version}"
- echo "$as_me:$LINENO: result: missing" >&5
-echo "${ECHO_T}missing" >&6
fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
-echo "$as_me:$LINENO: checking for working autoheader" >&5
-echo $ECHO_N "checking for working autoheader... $ECHO_C" >&6
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if (autoheader --version) < /dev/null > /dev/null 2>&1; then
- AUTOHEADER=autoheader
- echo "$as_me:$LINENO: result: found" >&5
-echo "${ECHO_T}found" >&6
+ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
else
- AUTOHEADER="$missing_dir/missing autoheader"
- echo "$as_me:$LINENO: result: missing" >&5
-echo "${ECHO_T}missing" >&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-echo "$as_me:$LINENO: checking for working makeinfo" >&5
-echo $ECHO_N "checking for working makeinfo... $ECHO_C" >&6
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
- MAKEINFO=makeinfo
- echo "$as_me:$LINENO: result: found" >&5
-echo "${ECHO_T}found" >&6
+ STRIP=$ac_ct_STRIP
else
- MAKEINFO="$missing_dir/missing makeinfo"
- echo "$as_me:$LINENO: result: missing" >&5
-echo "${ECHO_T}missing" >&6
+ STRIP="$ac_cv_prog_STRIP"
fi
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
- ac_config_headers="$ac_config_headers config.h"
- ac_config_commands="$ac_config_commands default-1"
+
+ ac_config_headers="$ac_config_headers config.h"
echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6
@@ -1617,6 +1750,7 @@
MAINTAINER_MODE_TRUE='#'
MAINTAINER_MODE_FALSE=
fi
+
MAINT=$MAINTAINER_MODE_TRUE
@@ -2554,6 +2688,175 @@
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+ ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+
+
+echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+ enableval="$enable_dependency_tracking"
+
+fi;
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+
+
+if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+
+
+depcc="$CC" am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored.
+ if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+
+
+if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
@@ -4953,119 +5256,6 @@
fi
-
-for ac_func in err
-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
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-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 $ac_func ();
-/* 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_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-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
- case $LIBOBJS in
- "$ac_func.$ac_objext" | \
- *" $ac_func.$ac_objext" | \
- "$ac_func.$ac_objext "* | \
- *" $ac_func.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
-esac
-
-fi
-done
-
-
-
echo "$as_me:$LINENO: checking for pid_t" >&5
echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
if test "${ac_cv_type_pid_t+set}" = set; then
@@ -5722,6 +5912,27 @@
LTLIBOBJS=$ac_ltlibobjs
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
: ${CONFIG_STATUS=./config.status}
ac_clean_files_save=$ac_clean_files
@@ -6155,7 +6366,7 @@
# INIT-COMMANDS section.
#
-
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
_ACEOF
@@ -6169,7 +6380,7 @@
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"test/Makefile" ) CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
"sample/Makefile" ) CONFIG_FILES="$CONFIG_FILES sample/Makefile" ;;
- "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
+ "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
@@ -6259,6 +6470,7 @@
s, at INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
s, at INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
s, at INSTALL_DATA@,$INSTALL_DATA,;t t
+s, at CYGPATH_W@,$CYGPATH_W,;t t
s, at PACKAGE@,$PACKAGE,;t t
s, at VERSION@,$VERSION,;t t
s, at ACLOCAL@,$ACLOCAL,;t t
@@ -6266,7 +6478,15 @@
s, at AUTOMAKE@,$AUTOMAKE,;t t
s, at AUTOHEADER@,$AUTOHEADER,;t t
s, at MAKEINFO@,$MAKEINFO,;t t
+s, at AMTAR@,$AMTAR,;t t
+s, at install_sh@,$install_sh,;t t
+s, at STRIP@,$STRIP,;t t
+s, at ac_ct_STRIP@,$ac_ct_STRIP,;t t
+s, at INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
+s, at mkdir_p@,$mkdir_p,;t t
+s, at AWK@,$AWK,;t t
s, at SET_MAKE@,$SET_MAKE,;t t
+s, at am__leading_dot@,$am__leading_dot,;t t
s, at MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
s, at MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
s, at MAINT@,$MAINT,;t t
@@ -6277,6 +6497,15 @@
s, at ac_ct_CC@,$ac_ct_CC,;t t
s, at EXEEXT@,$EXEEXT,;t t
s, at OBJEXT@,$OBJEXT,;t t
+s, at DEPDIR@,$DEPDIR,;t t
+s, at am__include@,$am__include,;t t
+s, at am__quote@,$am__quote,;t t
+s, at AMDEP_TRUE@,$AMDEP_TRUE,;t t
+s, at AMDEP_FALSE@,$AMDEP_FALSE,;t t
+s, at AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
+s, at CCDEPMODE@,$CCDEPMODE,;t t
+s, at am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
+s, at am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
s, at RANLIB@,$RANLIB,;t t
s, at ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
s, at LN_S@,$LN_S,;t t
@@ -6743,6 +6972,28 @@
cat $tmp/config.h
rm -f $tmp/config.h
fi
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $ac_file | $ac_file:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X$ac_file : 'X\(//\)[^/]' \| \
+ X$ac_file : 'X\(//\)$' \| \
+ X$ac_file : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X$ac_file |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
done
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
@@ -6859,7 +7110,97 @@
{ echo "$as_me:$LINENO: executing $ac_dest commands" >&5
echo "$as_me: executing $ac_dest commands" >&6;}
case $ac_dest in
- default-1 ) test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h ;;
+ depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`(dirname "$mf") 2>/dev/null ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
+ # Extract the definition of DEP_FILES from the Makefile without
+ # running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
+ # We invoke sed twice because it is the simplest approach to
+ # changing $(DEPDIR) to its actual value in the expansion.
+ for file in `sed -n '
+ /^DEP_FILES = .*\\\\$/ {
+ s/^DEP_FILES = //
+ :loop
+ s/\\\\$//
+ p
+ n
+ /\\\\$/ b loop
+ p
+ }
+ /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`(dirname "$file") 2>/dev/null ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p $dirpart/$fdir
+ else
+ as_dir=$dirpart/$fdir
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
+echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+ ;;
esac
done
_ACEOF
Index: configure.in
===================================================================
RCS file: /home/or/cvsroot/libevent/configure.in,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- configure.in 22 Feb 2005 05:31:33 -0000 1.3
+++ configure.in 1 Mar 2005 00:22:52 -0000 1.4
@@ -299,8 +299,6 @@
AC_LIBOBJ(signal)
fi
-AC_REPLACE_FUNCS(err)
-
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_CHECK_TYPE(u_int64_t, unsigned long long)
Index: devpoll.c
===================================================================
RCS file: /home/or/cvsroot/libevent/devpoll.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- devpoll.c 22 Feb 2005 03:43:50 -0000 1.1
+++ devpoll.c 1 Mar 2005 00:22:52 -0000 1.2
@@ -44,18 +44,11 @@
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
-#include <err.h>
#include <assert.h>
-#ifdef USE_LOG
-#include "log.h"
-#else
-#define LOG_DBG(x)
-#define log_error warn
-#endif
-
#include "event.h"
#include "evsignal.h"
+#include "log.h"
extern volatile sig_atomic_t evsignal_caught;
@@ -113,7 +106,7 @@
/* Initialize the kernel queue */
if ((dpfd = open("/dev/poll", O_RDWR)) == -1) {
- log_error("open: /dev/poll");
+ event_warn("open: /dev/poll");
free(devpollop);
return (NULL);
}
@@ -158,7 +151,7 @@
fds = realloc(devpollop->fds, nfds * sizeof(struct evdevpoll));
if (fds == NULL) {
- log_error("realloc");
+ event_warn("realloc");
return (-1);
}
devpollop->fds = fds;
@@ -195,7 +188,7 @@
if (res == -1) {
if (errno != EINTR) {
- log_error("ioctl: DP_POLL");
+ event_warn("ioctl: DP_POLL");
return (-1);
}
@@ -204,7 +197,7 @@
} else if (evsignal_caught)
evsignal_process();
- LOG_DBG((LOG_MISC, 80, "%s: devpoll_wait reports %d", __func__, res));
+ event_debug(("%s: devpoll_wait reports %d", __func__, res));
for (i = 0; i < res; i++) {
int which = 0;
Index: epoll.c
===================================================================
RCS file: /home/or/cvsroot/libevent/epoll.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- epoll.c 22 Feb 2005 03:43:50 -0000 1.1
+++ epoll.c 1 Mar 2005 00:22:52 -0000 1.2
@@ -44,20 +44,13 @@
#include <string.h>
#include <unistd.h>
#include <errno.h>
-#include <err.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
-#ifdef USE_LOG
-#include "log.h"
-#else
-#define LOG_DBG(x)
-#define log_error warn
-#endif
-
#include "event.h"
#include "evsignal.h"
+#include "log.h"
extern volatile sig_atomic_t evsignal_caught;
@@ -96,7 +89,7 @@
#ifdef HAVE_SETFD
#define FD_CLOSEONEXEC(x) do { \
if (fcntl(x, F_SETFD, 1) == -1) \
- warn("fcntl(%d, F_SETFD)", x); \
+ event_warn("fcntl(%d, F_SETFD)", x); \
} while (0)
#else
#define FD_CLOSEONEXEC(x)
@@ -122,7 +115,7 @@
/* Initalize the kernel queue */
if ((epfd = epoll_create(nfiles)) == -1) {
- log_error("epoll_create");
+ event_warn("epoll_create");
return (NULL);
}
@@ -169,7 +162,7 @@
fds = realloc(epollop->fds, nfds * sizeof(struct evepoll));
if (fds == NULL) {
- log_error("realloc");
+ event_warn("realloc");
return (-1);
}
epollop->fds = fds;
@@ -200,7 +193,7 @@
if (res == -1) {
if (errno != EINTR) {
- log_error("epoll_wait");
+ event_warn("epoll_wait");
return (-1);
}
@@ -209,7 +202,7 @@
} else if (evsignal_caught)
evsignal_process();
- LOG_DBG((LOG_MISC, 80, "%s: epoll_wait reports %d", __func__, res));
+ event_debug(("%s: epoll_wait reports %d", __func__, res));
for (i = 0; i < res; i++) {
int which = 0;
--- err.c DELETED ---
Index: event.c
===================================================================
RCS file: /home/or/cvsroot/libevent/event.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- event.c 25 Feb 2005 05:38:38 -0000 1.3
+++ event.c 1 Mar 2005 00:22:52 -0000 1.4
@@ -49,18 +49,11 @@
#endif
#include <errno.h>
#include <string.h>
-#include <err.h>
#include <assert.h>
-#ifdef USE_LOG
-#include "log.h"
-#else
-#define LOG_DBG(x)
-#define log_error(x) perror(x)
-#endif
-
#include "event.h"
#include "event-internal.h"
+#include "log.h"
#ifdef HAVE_SELECT
extern const struct eventop selectops;
@@ -155,17 +148,12 @@
int i;
if ((current_base = calloc(1, sizeof(struct event_base))) == NULL)
- err(1, "%s: calloc");
+ event_err(1, "%s: calloc");
event_sigcb = NULL;
event_gotsig = 0;
gettimeofday(¤t_base->event_tv, NULL);
-#if defined(USE_LOG) && defined(USE_DEBUG)
- log_to(stderr);
- log_debug_cmd(LOG_MISC, 80);
-#endif
-
RB_INIT(¤t_base->timetree);
TAILQ_INIT(¤t_base->eventqueue);
TAILQ_INIT(&signalqueue);
@@ -178,11 +166,11 @@
}
if (current_base->evbase == NULL)
- errx(1, "%s: no event mechanism available", __func__);
+ event_errx(1, "%s: no event mechanism available", __func__);
if (getenv("EVENT_SHOW_METHOD"))
- fprintf(stderr, "libevent using: %s\n",
- current_base->evsel->name);
+ event_msgx("libevent using: %s\n",
+ current_base->evsel->name);
/* allocate a single active event queue */
event_base_priority_init(current_base, 1);
@@ -216,12 +204,12 @@
base->activequeues = (struct event_list **)calloc(base->nactivequeues,
npriorities * sizeof(struct event_list *));
if (base->activequeues == NULL)
- err(1, "%s: calloc", __func__);
+ event_err(1, "%s: calloc", __func__);
for (i = 0; i < base->nactivequeues; ++i) {
base->activequeues[i] = malloc(sizeof(struct event_list));
if (base->activequeues[i] == NULL)
- err(1, "%s: malloc", __func__);
+ event_err(1, "%s: malloc", __func__);
TAILQ_INIT(base->activequeues[i]);
}
@@ -348,10 +336,8 @@
gettimeofday(&tv, NULL);
if (timercmp(&tv, &base->event_tv, <)) {
struct timeval off;
- LOG_DBG((LOG_MISC, 10,
- "%s: time is running backwards, corrected",
+ event_debug(("%s: time is running backwards, corrected",
__func__));
-
timersub(&base->event_tv, &tv, &off);
timeout_correct(base, &off);
}
@@ -531,7 +517,7 @@
const struct eventop *evsel = base->evsel;
void *evbase = base->evbase;
- LOG_DBG((LOG_MISC, 55,
+ event_debug((
"event_add: event: %p, %s%s%scall %p",
ev,
ev->ev_events & EV_READ ? "EV_READ " : " ",
@@ -566,7 +552,7 @@
gettimeofday(&now, NULL);
timeradd(&now, tv, &ev->ev_timeout);
- LOG_DBG((LOG_MISC, 55,
+ event_debug((
"event_add: timeout in %d seconds, call %p",
tv->tv_sec, ev->ev_callback));
@@ -595,7 +581,7 @@
const struct eventop *evsel;
void *evbase;
- LOG_DBG((LOG_MISC, 80, "event_del: %p, callback %p",
+ event_debug(("event_del: %p, callback %p",
ev, ev->ev_callback));
/* An event without a base has not been added */
@@ -672,7 +658,7 @@
assert(tv->tv_sec >= 0);
assert(tv->tv_usec >= 0);
- LOG_DBG((LOG_MISC, 60, "timeout_next: in %d seconds", tv->tv_sec));
+ event_debug(("timeout_next: in %d seconds", tv->tv_sec));
return (0);
}
@@ -707,7 +693,7 @@
/* delete this event from the I/O queues */
event_del(ev);
- LOG_DBG((LOG_MISC, 60, "timeout_process: call %p",
+ event_debug(("timeout_process: call %p",
ev->ev_callback));
event_active(ev, EV_TIMEOUT, 1);
}
@@ -719,8 +705,8 @@
int docount = 1;
if (!(ev->ev_flags & queue))
- errx(1, "%s: %p(fd %d) not on queue %x", __func__,
- ev, ev->ev_fd, queue);
+ event_errx(1, "%s: %p(fd %d) not on queue %x", __func__,
+ ev, ev->ev_fd, queue);
if (ev->ev_flags & EVLIST_INTERNAL)
docount = 0;
@@ -746,7 +732,7 @@
TAILQ_REMOVE(&base->eventqueue, ev, ev_next);
break;
default:
- errx(1, "%s: unknown queue %x", __func__, queue);
+ event_errx(1, "%s: unknown queue %x", __func__, queue);
}
}
@@ -760,8 +746,8 @@
if (queue & EVLIST_ACTIVE)
return;
- errx(1, "%s: %p(fd %d) already on queue %x", __func__,
- ev, ev->ev_fd, queue);
+ event_errx(1, "%s: %p(fd %d) already on queue %x", __func__,
+ ev, ev->ev_fd, queue);
}
if (ev->ev_flags & EVLIST_INTERNAL)
@@ -790,7 +776,7 @@
TAILQ_INSERT_TAIL(&base->eventqueue, ev, ev_next);
break;
default:
- errx(1, "%s: unknown queue %x", __func__, queue);
+ event_errx(1, "%s: unknown queue %x", __func__, queue);
}
}
Index: event.h
===================================================================
RCS file: /home/or/cvsroot/libevent/event.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- event.h 25 Feb 2005 05:38:38 -0000 1.4
+++ event.h 1 Mar 2005 00:22:52 -0000 1.5
@@ -129,6 +129,13 @@
int event_dispatch(void);
int event_base_dispatch(struct event_base *);
+#define _EVENT_LOG_DEBUG 0
+#define _EVENT_LOG_MSG 1
+#define _EVENT_LOG_WARN 2
+#define _EVENT_LOG_ERR 3
+typedef void (*event_log_cb)(int severity, const char *msg);
+void event_set_log_callback(event_log_cb cb);
+
/* Associate a different event base with an event */
int event_base_set(struct event_base *, struct event *);
Index: kqueue.c
===================================================================
RCS file: /home/or/cvsroot/libevent/kqueue.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- kqueue.c 22 Feb 2005 03:43:50 -0000 1.1
+++ kqueue.c 1 Mar 2005 00:22:52 -0000 1.2
@@ -44,18 +44,10 @@
#include <string.h>
#include <unistd.h>
#include <errno.h>
-#include <err.h>
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
-#ifdef USE_LOG
-#include "log.h"
-#else
-#define LOG_DBG(x)
-#define log_error warn
-#endif
-
#if defined(HAVE_INTTYPES_H) && !defined(__OpenBSD__) && !defined(__FreeBSD__)
#define INTPTR(x) (intptr_t)x
#else
@@ -63,6 +55,7 @@
#endif
#include "event.h"
+#include "log.h"
#define EVLIST_X_KQINKERNEL 0x1000
@@ -108,7 +101,7 @@
/* Initalize the kernel queue */
if ((kq = kqueue()) == -1) {
- log_error("kqueue");
+ event_warn("kqueue");
free (kqueueop);
return (NULL);
}
@@ -152,7 +145,7 @@
newchange = realloc(kqop->changes,
nevents * sizeof(struct kevent));
if (newchange == NULL) {
- log_error("%s: malloc", __func__);
+ event_warn("%s: malloc", __func__);
return (-1);
}
kqop->changes = newchange;
@@ -165,7 +158,7 @@
* the next realloc will pick it up.
*/
if (newresult == NULL) {
- log_error("%s: malloc", __func__);
+ event_warn("%s: malloc", __func__);
return (-1);
}
kqop->events = newresult;
@@ -175,7 +168,7 @@
memcpy(&kqop->changes[kqop->nchanges++], kev, sizeof(struct kevent));
- LOG_DBG((LOG_MISC, 70, "%s: fd %d %s%s",
+ event_debug(("%s: fd %d %s%s",
__func__, kev->ident,
kev->filter == EVFILT_READ ? "EVFILT_READ" : "EVFILT_WRITE",
kev->flags == EV_DELETE ? " (del)" : ""));
@@ -206,14 +199,14 @@
kqop->nchanges = 0;
if (res == -1) {
if (errno != EINTR) {
- log_error("kevent");
+ event_warn("kevent");
return (-1);
}
return (0);
}
- LOG_DBG((LOG_MISC, 80, "%s: kevent reports %d", __func__, res));
+ event_debug((LOG_MISC, 80, "%s: kevent reports %d", __func__, res));
for (i = 0; i < res; i++) {
int which = 0;
--- NEW FILE: log.c ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: log.h ---
/*
* Copyright (c) 2000-2004 Niels Provos <provos at citi.umich.edu>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _LOG_H_
#define _LOG_H_
void event_err(int eval, const char *fmt, ...);
void event_warn(const char *fmt, ...);
void event_errx(int eval, const char *fmt, ...);
void event_warnx(const char *fmt, ...);
void event_msgx(const char *fmt, ...);
void _event_debugx(const char *fmt, ...);
#define USE_DEBUG
#ifdef USE_DEBUG
#define event_debug(x) _event_debugx x
#else
#define event_debug(x)
#endif
#endif
Index: poll.c
===================================================================
RCS file: /home/or/cvsroot/libevent/poll.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- poll.c 22 Feb 2005 03:43:50 -0000 1.1
+++ poll.c 1 Mar 2005 00:22:52 -0000 1.2
@@ -45,18 +45,11 @@
#include <string.h>
#include <unistd.h>
#include <errno.h>
-#include <err.h>
-
-#ifdef USE_LOG
-#include "log.h"
-#else
-#define LOG_DBG(x)
-#define log_error(x) perror(x)
-#endif
#include "event.h"
#include "event-internal.h"
#include "evsignal.h"
+#include "log.h"
extern volatile sig_atomic_t evsignal_caught;
@@ -132,13 +125,13 @@
pop->event_set = realloc(pop->event_set,
count * sizeof(struct pollfd));
if (pop->event_set == NULL) {
- log_error("realloc");
+ event_warn("realloc");
return (-1);
}
pop->event_back = realloc(pop->event_back,
count * sizeof(struct event *));
if (pop->event_back == NULL) {
- log_error("realloc");
+ event_warn("realloc");
return (-1);
}
pop->event_count = count;
@@ -177,7 +170,7 @@
if (res == -1) {
if (errno != EINTR) {
- log_error("poll");
+ event_warn("poll");
return (-1);
}
@@ -186,7 +179,7 @@
} else if (evsignal_caught)
evsignal_process();
- LOG_DBG((LOG_MISC, 80, "%s: poll reports %d", __func__, res));
+ event_debug(("%s: poll reports %d", __func__, res));
if (res == 0)
return (0);
Index: rtsig.c
===================================================================
RCS file: /home/or/cvsroot/libevent/rtsig.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- rtsig.c 22 Feb 2005 03:43:50 -0000 1.1
+++ rtsig.c 1 Mar 2005 00:22:52 -0000 1.2
@@ -28,6 +28,7 @@
#define EVLIST_X_NORT 0x1000 /* Skip RT signals (internal) */
#include "event.h"
+#include "log.h"
extern struct event_list signalqueue;
struct rtsigop {
@@ -427,7 +428,7 @@
op->toev = malloc(sizeof(*op->toev) * op->max);
if (op->poll == NULL || op->toev == NULL)
- err(1, "%s: malloc");
+ event_err(1, "%s: malloc");
}
return (0);
Index: select.c
===================================================================
RCS file: /home/or/cvsroot/libevent/select.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- select.c 22 Feb 2005 03:43:50 -0000 1.1
+++ select.c 1 Mar 2005 00:22:52 -0000 1.2
@@ -46,16 +46,10 @@
#include <errno.h>
#include <err.h>
-#ifdef USE_LOG
-#include "log.h"
-#else
-#define LOG_DBG(x)
-#define log_error(x) perror(x)
-#endif
-
#include "event.h"
#include "event-internal.h"
#include "evsignal.h"
+#include "log.h"
#ifndef howmany
#define howmany(x, y) (((x)+((y)-1))/(y))
@@ -128,12 +122,12 @@
fdsz = howmany(sop->event_fds + 1, NFDBITS) * sizeof(fd_mask);
if (fdsz > sop->event_fdsz) {
if ((readset = realloc(sop->event_readset, fdsz)) == NULL) {
- log_error("malloc");
+ event_warn("malloc");
return (-1);
}
if ((writeset = realloc(sop->event_writeset, fdsz)) == NULL) {
- log_error("malloc");
+ event_warn("malloc");
free(readset);
return (-1);
}
@@ -179,7 +173,7 @@
if (res == -1) {
if (errno != EINTR) {
- log_error("select");
+ event_warn("select");
return (-1);
}
@@ -188,7 +182,7 @@
} else if (evsignal_caught)
evsignal_process();
- LOG_DBG((LOG_MISC, 80, "%s: select reports %d", __func__, res));
+ event_debug(("%s: select reports %d", __func__, res));
maxfd = 0;
for (ev = TAILQ_FIRST(&base->eventqueue); ev != NULL; ev = next) {
Index: signal.c
===================================================================
RCS file: /home/or/cvsroot/libevent/signal.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- signal.c 22 Feb 2005 03:43:50 -0000 1.1
+++ signal.c 1 Mar 2005 00:22:52 -0000 1.2
@@ -42,20 +42,13 @@
#include <string.h>
#include <unistd.h>
#include <errno.h>
-#include <err.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
-#ifdef USE_LOG
-#include "log.h"
-#else
-#define LOG_DBG(x)
-#define log_error(x) perror(x)
-#endif
-
#include "event.h"
#include "evsignal.h"
+#include "log.h"
extern struct event_list signalqueue;
@@ -80,14 +73,14 @@
n = read(fd, signals, sizeof(signals));
if (n == -1)
- err(1, "%s: read", __func__);
+ event_err(1, "%s: read", __func__);
event_add(ev, NULL);
}
#ifdef HAVE_SETFD
#define FD_CLOSEONEXEC(x) do { \
if (fcntl(x, F_SETFD, 1) == -1) \
- warn("fcntl(%d, F_SETFD)", x); \
+ event_warn("fcntl(%d, F_SETFD)", x); \
} while (0)
#else
#define FD_CLOSEONEXEC(x)
@@ -104,7 +97,7 @@
* signals that got delivered.
*/
if (socketpair(AF_UNIX, SOCK_STREAM, 0, ev_signal_pair) == -1)
- err(1, "%s: socketpair", __func__);
+ event_err(1, "%s: socketpair", __func__);
FD_CLOSEONEXEC(ev_signal_pair[0]);
FD_CLOSEONEXEC(ev_signal_pair[1]);
@@ -120,7 +113,7 @@
int evsignal;
if (ev->ev_events & (EV_READ|EV_WRITE))
- errx(1, "%s: EV_SIGNAL incompatible use", __func__);
+ event_errx(1, "%s: EV_SIGNAL incompatible use", __func__);
evsignal = EVENT_SIGNAL(ev);
sigaddset(evsigmask, evsignal);
More information about the tor-commits
mailing list