Commit 654329ef authored by Denis Bilenko's avatar Denis Bilenko

update libev to latest CVS + our patches:

 - install SIGCHLD lazily when first child watcher started
 - properly call WSARecv
 - log WSARecv's and WSASend's errors;
 - install periodic timer for waitpid()
 - ev_loop_destroy(): do not stop childev watcher when destroing non-default loop
parent ecb22bfc
Revision history for libev, a high-performance and full-featured event loop. Revision history for libev, a high-performance and full-featured event loop.
TODO: ev_loop_wakeup TODO: ev_loop_wakeup
TODO: EV_NO_THREADS/NO_SMP and/or EV_USE_PTHREADS or so. also document.
TODO: #define EV_API_DECL static? ev_default_loop_ptr?
TODO: EV_STANDALONE == NO_HASSEL (do not use clock_gettime in ev_standalone) TODO: EV_STANDALONE == NO_HASSEL (do not use clock_gettime in ev_standalone)
TODO: memory fences for clang TODO: faq, process a thing in each iteration
4.10 TODO: dbeugging tips, ev_verify, ev_init twice
- queueing pending watchers of higher priority from a watcher now invokes
them in a timely fashion (reported by Denis Bilenko).
- add throw() to all libev functions that cannot throw exceptions, for
further code size decrease when compiling for C++.
- add throw () to callbacks that must not throw exceptions (allocator,
syserr, loop acquire/release, periodic reschedule cbs).
- fix event_base_loop return code, add event_get_callback, event_base_new,
event_base_get_method calls to improve libevent 1.x emulation and add
some libevent 2.x funcitonality (based on a patch by Jeff Davey).
- add more memory fences to fix a bug reported by Jeff Davey. Better
be overfenced than underprotected.
- ev_run now returns a boolean status (true meaning watchers are
still active).
- ev_once: undef EV_ERROR in ev_kqueue.c, to avoid clashing with
libev's EV_ERROR (reported by 191919).
- (ecb) add memory fence support for xlC (Darin McBride).
- (ecb) add memory fence support for gcc-mips (Anton Kirilov).
- (ecb) add memory fence support for gcc-alpha (Christian Weisgerber).
- work around some kernels losing file descriptors by leaking
the kqueue descriptor in the child.
- include sys/syscall.h instead of plain syscall.h.
- check for io watcher loops in ev_verify, check for the most
common reported usage bug in ev_io_start.
- chose socket vs. WSASocket at compiletime using EV_USE_WSASOCKET.
- always use WSASend/WSARecv directly on windows, hoping that this
works in all cases (unlike read/write/send/recv...).
4.11 Sat Feb 4 19:52:39 CET 2012
- INCOMPATIBLE CHANGE: ev_timer_again now clears the pending status, as
was documented already, but not implemented in the repeating case.
- new compiletime symbols: EV_NO_SMP and EV_NO_THREADS.
- fix a race where the workaround against the epoll fork bugs - fix a race where the workaround against the epoll fork bugs
caused signals to not be handled anymore. caused signals to not be handled anymore.
- correct backend_fudge for most backends, and implement a windows - correct backend_fudge for most backends, and implement a windows
...@@ -23,6 +52,14 @@ TODO: memory fences for clang ...@@ -23,6 +52,14 @@ TODO: memory fences for clang
- strategically import macros from libecb and mark rarely-used functions - strategically import macros from libecb and mark rarely-used functions
as cache-cold (saving almost 2k code size on typical amd64 setups). as cache-cold (saving almost 2k code size on typical amd64 setups).
- add Symbols.ev and Symbols.event files, that were missing. - add Symbols.ev and Symbols.event files, that were missing.
- fix backend_mintime value for epoll (was 1/1024, is 1/1000 now).
- fix #3 "be smart about timeouts" to not "deadlock" when
timeout == now, also improve the section overall.
- avoid "AVOIDING FINISHING BEFORE RETURNING" idiom.
- support new EV_API_STATIC mode to make all libev symbols
static.
- supply default CFLAGS of -g -O3 with gcc when original CFLAGS
were empty.
4.04 Wed Feb 16 09:01:51 CET 2011 4.04 Wed Feb 16 09:01:51 CET 2011
- fix two problems in the native win32 backend, where reuse of fd's - fix two problems in the native win32 backend, where reuse of fd's
......
All files in libev are Copyright (C)2007,2008,2009 Marc Alexander Lehmann. All files in libev are
Copyright (c)2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are modification, are permitted provided that the following conditions are
......
...@@ -39,7 +39,7 @@ subdir = . ...@@ -39,7 +39,7 @@ subdir = .
DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \ DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/config.h.in $(top_srcdir)/configure config.guess \ $(srcdir)/config.h.in $(top_srcdir)/configure config.guess \
config.sub depcomp install-sh ltmain.sh missing config.sub depcomp install-sh ltmain.sh missing mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/libev.m4 \ am__aclocal_m4_deps = $(top_srcdir)/libev.m4 \
$(top_srcdir)/configure.ac $(top_srcdir)/configure.ac
...@@ -47,7 +47,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ ...@@ -47,7 +47,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4) $(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES = CONFIG_CLEAN_VPATH_FILES =
...@@ -766,6 +766,9 @@ uninstall-man: uninstall-man3 ...@@ -766,6 +766,9 @@ uninstall-man: uninstall-man3
uninstall-libLTLIBRARIES uninstall-man uninstall-man3 uninstall-libLTLIBRARIES uninstall-man uninstall-man3
ev.3: ev.pod
pod2man -n LIBEV -r "libev-$(VERSION)" -c "libev - high performance full featured event loop" -s3 <$< >$@
# Tell versions [3.59,3.63) of GNU make to not export all variables. # 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. # Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT: .NOEXPORT:
...@@ -24,23 +24,23 @@ ABOUT ...@@ -24,23 +24,23 @@ ABOUT
- relative timers/timeouts (handle time jumps). - relative timers/timeouts (handle time jumps).
- fast intra-thread communication between multiple - fast intra-thread communication between multiple
event loops (with optional fast linux eventfd backend). event loops (with optional fast linux eventfd backend).
- extremely easy to embed. - extremely easy to embed (fully documented, no dependencies,
- very small codebase, no bloated library. autoconf supported but optional).
- very small codebase, no bloated library, simple code.
- fully extensible by being able to plug into the event loop, - fully extensible by being able to plug into the event loop,
integrate other event loops, integrate other event loop users. integrate other event loops, integrate other event loop users.
- very little memory use (small watchers, small event loop data). - very little memory use (small watchers, small event loop data).
- optional C++ interface allowing method and function callbacks - optional C++ interface allowing method and function callbacks
at no extra memory or runtime overhead. at no extra memory or runtime overhead.
- optional Perl interface with similar characteristics (capable - optional Perl interface with similar characteristics (capable
of running Glib/Gtk2 on libev, interfaces with Net::SNMP and of running Glib/Gtk2 on libev).
libadns).
- support for other languages (multiple C++ interfaces, D, Ruby, - support for other languages (multiple C++ interfaces, D, Ruby,
Python) available from third-parties. Python) available from third-parties.
Examples of programs that embed libev: the EV perl module, Examples of programs that embed libev: the EV perl module, node.js,
rxvt-unicode, gvpe (GNU Virtual Private Ethernet), the Deliantra MMORPG auditd, rxvt-unicode, gvpe (GNU Virtual Private Ethernet), the
server (http://www.deliantra.net/), Rubinius (a next-generation Ruby Deliantra MMORPG server (http://www.deliantra.net/), Rubinius (a
VM), the Ebb web server, the Rev event toolkit. next-generation Ruby VM), the Ebb web server, the Rev event toolkit.
CONTRIBUTORS CONTRIBUTORS
......
#! /bin/sh #! /bin/sh
# Attempt to guess a canonical system name. # Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
timestamp='2009-12-30' timestamp='2008-01-23'
# This file is free software; you can redistribute it and/or modify it # This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by # under the terms of the GNU General Public License as published by
...@@ -27,16 +27,16 @@ timestamp='2009-12-30' ...@@ -27,16 +27,16 @@ timestamp='2009-12-30'
# the same distribution terms that you use for the rest of that program. # the same distribution terms that you use for the rest of that program.
# Originally written by Per Bothner. Please send patches (context # Originally written by Per Bothner <per@bothner.com>.
# diff format) to <config-patches@gnu.org> and include a ChangeLog # Please send patches to <config-patches@gnu.org>. Submit a context
# entry. # diff and a properly formatted ChangeLog entry.
# #
# This script attempts to guess a canonical system name similar to # This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and # config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1. # exits with 0. Otherwise, it exits with 1.
# #
# You can get the latest version of this script from: # The plan is that this can be called by configure scripts if you
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # don't specify an explicit build system type.
me=`echo "$0" | sed -e 's,.*/,,'` me=`echo "$0" | sed -e 's,.*/,,'`
...@@ -56,9 +56,8 @@ version="\ ...@@ -56,9 +56,8 @@ version="\
GNU config.guess ($timestamp) GNU config.guess ($timestamp)
Originally written by Per Bothner. Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
...@@ -171,7 +170,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ...@@ -171,7 +170,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
arm*|i386|m68k|ns32k|sh3*|sparc|vax) arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__ | grep __ELF__ >/dev/null
then then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX? # Return netbsd for either. FIX?
...@@ -325,33 +324,14 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ...@@ -325,33 +324,14 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
case `/usr/bin/uname -p` in case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7; exit ;; sparc) echo sparc-icl-nx7; exit ;;
esac ;; esac ;;
s390x:SunOS:*:*)
echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4H:SunOS:5.*:*) sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;; exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;; exit ;;
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
echo i386-pc-auroraux${UNAME_RELEASE}
exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
eval $set_cc_for_build echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
SUN_ARCH="i386"
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
SUN_ARCH="x86_64"
fi
fi
echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;; exit ;;
sun4*:SunOS:6*:*) sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize # According to config.sub, this is the proper way to canonicalize
...@@ -660,7 +640,7 @@ EOF ...@@ -660,7 +640,7 @@ EOF
# => hppa64-hp-hpux11.23 # => hppa64-hp-hpux11.23
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
grep -q __LP64__ grep __LP64__ >/dev/null
then then
HP_ARCH="hppa2.0w" HP_ARCH="hppa2.0w"
else else
...@@ -811,12 +791,12 @@ EOF ...@@ -811,12 +791,12 @@ EOF
i*:PW*:*) i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32 echo ${UNAME_MACHINE}-pc-pw32
exit ;; exit ;;
*:Interix*:*) *:Interix*:[3456]*)
case ${UNAME_MACHINE} in case ${UNAME_MACHINE} in
x86) x86)
echo i586-pc-interix${UNAME_RELEASE} echo i586-pc-interix${UNAME_RELEASE}
exit ;; exit ;;
authenticamd | genuineintel | EM64T) EM64T | authenticamd)
echo x86_64-unknown-interix${UNAME_RELEASE} echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;; exit ;;
IA64) IA64)
...@@ -826,9 +806,6 @@ EOF ...@@ -826,9 +806,6 @@ EOF
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks echo i${UNAME_MACHINE}-pc-mks
exit ;; exit ;;
8664:Windows_NT:*)
echo x86_64-pc-mks
exit ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*) i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem? # How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
...@@ -858,20 +835,6 @@ EOF ...@@ -858,20 +835,6 @@ EOF
i*86:Minix:*:*) i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix echo ${UNAME_MACHINE}-pc-minix
exit ;; exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
PCA57) UNAME_MACHINE=alphapca56 ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit ;;
arm*:Linux:*:*) arm*:Linux:*:*)
eval $set_cc_for_build eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
...@@ -894,17 +857,6 @@ EOF ...@@ -894,17 +857,6 @@ EOF
frv:Linux:*:*) frv:Linux:*:*)
echo frv-unknown-linux-gnu echo frv-unknown-linux-gnu
exit ;; exit ;;
i*86:Linux:*:*)
LIBC=gnu
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#ifdef __dietlibc__
LIBC=dietlibc
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
exit ;;
ia64:Linux:*:*) ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;; exit ;;
...@@ -914,33 +866,74 @@ EOF ...@@ -914,33 +866,74 @@ EOF
m68*:Linux:*:*) m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;; exit ;;
mips:Linux:*:* | mips64:Linux:*:*) mips:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
#undef mips
#undef mipsel
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=mipsel
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=mips
#else
CPU=
#endif
#endif
EOF
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^CPU/{
s: ::g
p
}'`"
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
mips64:Linux:*:*)
eval $set_cc_for_build eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c sed 's/^ //' << EOF >$dummy.c
#undef CPU #undef CPU
#undef ${UNAME_MACHINE} #undef mips64
#undef ${UNAME_MACHINE}el #undef mips64el
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=${UNAME_MACHINE}el CPU=mips64el
#else #else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=${UNAME_MACHINE} CPU=mips64
#else #else
CPU= CPU=
#endif #endif
#endif #endif
EOF EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^CPU/{
s: ::g
p
}'`"
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;; ;;
or32:Linux:*:*) or32:Linux:*:*)
echo or32-unknown-linux-gnu echo or32-unknown-linux-gnu
exit ;; exit ;;
padre:Linux:*:*) ppc:Linux:*:*)
echo sparc-unknown-linux-gnu echo powerpc-unknown-linux-gnu
exit ;; exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*) ppc64:Linux:*:*)
echo hppa64-unknown-linux-gnu echo powerpc64-unknown-linux-gnu
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
PCA57) UNAME_MACHINE=alphapca56 ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit ;; exit ;;
parisc:Linux:*:* | hppa:Linux:*:*) parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level # Look for CPU level
...@@ -950,11 +943,8 @@ EOF ...@@ -950,11 +943,8 @@ EOF
*) echo hppa-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;;
esac esac
exit ;; exit ;;
ppc64:Linux:*:*) parisc64:Linux:*:* | hppa64:Linux:*:*)
echo powerpc64-unknown-linux-gnu echo hppa64-unknown-linux-gnu
exit ;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
exit ;; exit ;;
s390:Linux:*:* | s390x:Linux:*:*) s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux echo ${UNAME_MACHINE}-ibm-linux
...@@ -977,6 +967,69 @@ EOF ...@@ -977,6 +967,69 @@ EOF
xtensa*:Linux:*:*) xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;; exit ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
# problems with other programs or directories called `ld' in the path.
# Set LC_ALL=C to ensure ld outputs messages in English.
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
| sed -ne '/supported targets:/!d
s/[ ][ ]*/ /g
s/.*supported targets: *//
s/ .*//
p'`
case "$ld_supported_targets" in
elf32-i386)
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
;;
a.out-i386-linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit ;;
coff-i386)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit ;;
"")
# Either a pre-BFD a.out linker (linux-gnuoldld) or
# one that does not give us useful --help.
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
exit ;;
esac
# Determine whether the default compiler is a.out or elf
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include <features.h>
#ifdef __ELF__
# ifdef __GLIBC__
# if __GLIBC__ >= 2
LIBC=gnu
# else
LIBC=gnulibc1
# endif
# else
LIBC=gnulibc1
# endif
#else
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
LIBC=gnu
#else
LIBC=gnuaout
#endif
#endif
#ifdef __dietlibc__
LIBC=dietlibc
#endif
EOF
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^LIBC/{
s: ::g
p
}'`"
test x"${LIBC}" != x && {
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
exit
}
test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
;;
i*86:DYNIX/ptx:4*:*) i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both # earlier versions are messed up and put the nodename in both
...@@ -1005,7 +1058,7 @@ EOF ...@@ -1005,7 +1058,7 @@ EOF
i*86:syllable:*:*) i*86:syllable:*:*)
echo ${UNAME_MACHINE}-pc-syllable echo ${UNAME_MACHINE}-pc-syllable
exit ;; exit ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE} echo i386-unknown-lynxos${UNAME_RELEASE}
exit ;; exit ;;
i*86:*DOS:*:*) i*86:*DOS:*:*)
...@@ -1049,11 +1102,8 @@ EOF ...@@ -1049,11 +1102,8 @@ EOF
pc:*:*:*) pc:*:*:*)
# Left here for compatibility: # Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about # uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586. # the processor, so we play safe by assuming i386.
# Note: whatever this is, it MUST be the same as what config.sub echo i386-pc-msdosdjgpp
# prints for the "djgpp" host, or else GDB configury will decide that
# this is a cross-build.
echo i586-pc-msdosdjgpp
exit ;; exit ;;
Intel:Mach:3*:*) Intel:Mach:3*:*)
echo i386-pc-mach3 echo i386-pc-mach3
...@@ -1091,16 +1141,6 @@ EOF ...@@ -1091,16 +1141,6 @@ EOF
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;; && { echo i486-ncr-sysv4; exit; } ;;
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3'
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE} echo m68k-unknown-lynxos${UNAME_RELEASE}
exit ;; exit ;;
...@@ -1113,7 +1153,7 @@ EOF ...@@ -1113,7 +1153,7 @@ EOF
rs6000:LynxOS:2.*:*) rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE} echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit ;; exit ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE} echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit ;; exit ;;
SM[BE]S:UNIX_SV:*:*) SM[BE]S:UNIX_SV:*:*)
...@@ -1176,9 +1216,6 @@ EOF ...@@ -1176,9 +1216,6 @@ EOF
BePC:BeOS:*:*) # BeOS running on Intel PC compatible. BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos echo i586-pc-beos
exit ;; exit ;;
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
echo i586-pc-haiku
exit ;;
SX-4:SUPER-UX:*:*) SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE} echo sx4-nec-superux${UNAME_RELEASE}
exit ;; exit ;;
...@@ -1206,16 +1243,6 @@ EOF ...@@ -1206,16 +1243,6 @@ EOF
*:Darwin:*:*) *:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
case $UNAME_PROCESSOR in case $UNAME_PROCESSOR in
i386)
eval $set_cc_for_build
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
UNAME_PROCESSOR="x86_64"
fi
fi ;;
unknown) UNAME_PROCESSOR=powerpc ;; unknown) UNAME_PROCESSOR=powerpc ;;
esac esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
...@@ -1297,9 +1324,6 @@ EOF ...@@ -1297,9 +1324,6 @@ EOF
i*86:rdos:*:*) i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos echo ${UNAME_MACHINE}-pc-rdos
exit ;; exit ;;
i*86:AROS:*:*)
echo ${UNAME_MACHINE}-pc-aros
exit ;;
esac esac
#echo '(No uname command or uname output not recognized.)' 1>&2 #echo '(No uname command or uname output not recognized.)' 1>&2
......
#! /bin/sh #! /bin/sh
# Configuration validation subroutine script. # Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
timestamp='2010-01-22' timestamp='2008-01-16'
# This file is (in principle) common to ALL GNU software. # This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software # The presence of a machine in this file suggests that SOME GNU software
...@@ -32,16 +32,13 @@ timestamp='2010-01-22' ...@@ -32,16 +32,13 @@ timestamp='2010-01-22'
# Please send patches to <config-patches@gnu.org>. Submit a context # Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted GNU ChangeLog entry. # diff and a properly formatted ChangeLog entry.
# #
# Configuration subroutine to validate and canonicalize a configuration type. # Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument. # Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1. # If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed. # Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
# This file is supposed to be the same for all GNU packages # This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases # and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software. # that are meaningful with *any* GNU software.
...@@ -75,9 +72,8 @@ Report bugs and patches to <config-patches@gnu.org>." ...@@ -75,9 +72,8 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\ version="\
GNU config.sub ($timestamp) GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
...@@ -126,7 +122,6 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` ...@@ -126,7 +122,6 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in case $maybe_os in
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*) storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
...@@ -153,13 +148,10 @@ case $os in ...@@ -153,13 +148,10 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple | -axis | -knuth | -cray | -microblaze) -apple | -axis | -knuth | -cray)
os= os=
basic_machine=$1 basic_machine=$1
;; ;;
-bluegene*)
os=-cnk
;;
-sim | -cisco | -oki | -wec | -winbond) -sim | -cisco | -oki | -wec | -winbond)
os= os=
basic_machine=$1 basic_machine=$1
...@@ -257,16 +249,13 @@ case $basic_machine in ...@@ -257,16 +249,13 @@ case $basic_machine in
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \ | i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \ | ip2k | iq2000 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \ | m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | mcore | mep | metag \ | maxq | mb | microblaze | mcore | mep \
| mips | mipsbe | mipseb | mipsel | mipsle \ | mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \ | mips16 \
| mips64 | mips64el \ | mips64 | mips64el \
| mips64octeon | mips64octeonel \
| mips64orion | mips64orionel \
| mips64r5900 | mips64r5900el \
| mips64vr | mips64vrel \ | mips64vr | mips64vrel \
| mips64orion | mips64orionel \
| mips64vr4100 | mips64vr4100el \ | mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \ | mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \ | mips64vr5000 | mips64vr5000el \
...@@ -279,7 +268,6 @@ case $basic_machine in ...@@ -279,7 +268,6 @@ case $basic_machine in
| mipsisa64sr71k | mipsisa64sr71kel \ | mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \ | mipstx39 | mipstx39el \
| mn10200 | mn10300 \ | mn10200 | mn10300 \
| moxie \
| mt \ | mt \
| msp430 \ | msp430 \
| nios | nios2 \ | nios | nios2 \
...@@ -288,22 +276,20 @@ case $basic_machine in ...@@ -288,22 +276,20 @@ case $basic_machine in
| pdp10 | pdp11 | pj | pjl \ | pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \ | pyramid \
| rx \
| score \ | score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \ | sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
| spu | strongarm \ | spu | strongarm \
| tahoe | thumb | tic4x | tic80 | tron \ | tahoe | thumb | tic4x | tic80 | tron \
| ubicom32 \
| v850 | v850e \ | v850 | v850e \
| we32k \ | we32k \
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
| z8k | z80) | z8k)
basic_machine=$basic_machine-unknown basic_machine=$basic_machine-unknown
;; ;;
m6811 | m68hc11 | m6812 | m68hc12 | picochip) m6811 | m68hc11 | m6812 | m68hc12)
# Motorola 68HC11/12. # Motorola 68HC11/12.
basic_machine=$basic_machine-unknown basic_machine=$basic_machine-unknown
os=-none os=-none
...@@ -343,17 +329,14 @@ case $basic_machine in ...@@ -343,17 +329,14 @@ case $basic_machine in
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \ | i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \ | ip2k-* | iq2000-* \
| lm32-* \
| m32c-* | m32r-* | m32rle-* \ | m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | m88110-* | m88k-* | maxq-* | mcore-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \ | mips16-* \
| mips64-* | mips64el-* \ | mips64-* | mips64el-* \
| mips64octeon-* | mips64octeonel-* \
| mips64orion-* | mips64orionel-* \
| mips64r5900-* | mips64r5900el-* \
| mips64vr-* | mips64vrel-* \ | mips64vr-* | mips64vrel-* \
| mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* \ | mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \ | mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \ | mips64vr5000-* | mips64vr5000el-* \
...@@ -374,23 +357,21 @@ case $basic_machine in ...@@ -374,23 +357,21 @@ case $basic_machine in
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \ | pyramid-* \
| romp-* | rs6000-* | rx-* \ | romp-* | rs6000-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \ | sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \ | tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile-* | tilegx-* \
| tron-* \ | tron-* \
| ubicom32-* \
| v850-* | v850e-* | vax-* \ | v850-* | v850e-* | vax-* \
| we32k-* \ | we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
| xstormy16-* | xtensa*-* \ | xstormy16-* | xtensa*-* \
| ymp-* \ | ymp-* \
| z8k-* | z80-*) | z8k-*)
;; ;;
# Recognize the basic CPU types without company name, with glob match. # Recognize the basic CPU types without company name, with glob match.
xtensa*) xtensa*)
...@@ -458,10 +439,6 @@ case $basic_machine in ...@@ -458,10 +439,6 @@ case $basic_machine in
basic_machine=m68k-apollo basic_machine=m68k-apollo
os=-bsd os=-bsd
;; ;;
aros)
basic_machine=i386-pc
os=-aros
;;
aux) aux)
basic_machine=m68k-apple basic_machine=m68k-apple
os=-aux os=-aux
...@@ -478,18 +455,10 @@ case $basic_machine in ...@@ -478,18 +455,10 @@ case $basic_machine in
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux os=-linux
;; ;;
bluegene*)
basic_machine=powerpc-ibm
os=-cnk
;;
c90) c90)
basic_machine=c90-cray basic_machine=c90-cray
os=-unicos os=-unicos
;; ;;
cegcc)
basic_machine=arm-unknown
os=-cegcc
;;
convex-c1) convex-c1)
basic_machine=c1-convex basic_machine=c1-convex
os=-bsd os=-bsd
...@@ -557,10 +526,6 @@ case $basic_machine in ...@@ -557,10 +526,6 @@ case $basic_machine in
basic_machine=m88k-motorola basic_machine=m88k-motorola
os=-sysv3 os=-sysv3
;; ;;
dicos)
basic_machine=i686-pc
os=-dicos
;;
djgpp) djgpp)
basic_machine=i586-pc basic_machine=i586-pc
os=-msdosdjgpp os=-msdosdjgpp
...@@ -734,9 +699,6 @@ case $basic_machine in ...@@ -734,9 +699,6 @@ case $basic_machine in
basic_machine=ns32k-utek basic_machine=ns32k-utek
os=-sysv os=-sysv
;; ;;
microblaze)
basic_machine=microblaze-xilinx
;;
mingw32) mingw32)
basic_machine=i386-pc basic_machine=i386-pc
os=-mingw32 os=-mingw32
...@@ -1087,11 +1049,6 @@ case $basic_machine in ...@@ -1087,11 +1049,6 @@ case $basic_machine in
basic_machine=tic6x-unknown basic_machine=tic6x-unknown
os=-coff os=-coff
;; ;;
# This must be matched before tile*.
tilegx*)
basic_machine=tilegx-unknown
os=-linux-gnu
;;
tile*) tile*)
basic_machine=tile-unknown basic_machine=tile-unknown
os=-linux-gnu os=-linux-gnu
...@@ -1171,10 +1128,6 @@ case $basic_machine in ...@@ -1171,10 +1128,6 @@ case $basic_machine in
basic_machine=z8k-unknown basic_machine=z8k-unknown
os=-sim os=-sim
;; ;;
z80-*-coff)
basic_machine=z80-unknown
os=-sim
;;
none) none)
basic_machine=none-none basic_machine=none-none
os=-none os=-none
...@@ -1213,7 +1166,7 @@ case $basic_machine in ...@@ -1213,7 +1166,7 @@ case $basic_machine in
we32k) we32k)
basic_machine=we32k-att basic_machine=we32k-att
;; ;;
sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown basic_machine=sh-unknown
;; ;;
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
...@@ -1263,9 +1216,6 @@ case $os in ...@@ -1263,9 +1216,6 @@ case $os in
# First match some system type aliases # First match some system type aliases
# that might get confused with valid system types. # that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception. # -solaris* is a basic system type, with this one exception.
-auroraux)
os=-auroraux
;;
-solaris1 | -solaris1.*) -solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'` os=`echo $os | sed -e 's|solaris1|sunos4|'`
;; ;;
...@@ -1286,11 +1236,10 @@ case $os in ...@@ -1286,11 +1236,10 @@ case $os in
# Each alternative MUST END IN A *, to match a version number. # Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4. # -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
| -sym* | -kopensolaris* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* \ | -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
...@@ -1299,7 +1248,7 @@ case $os in ...@@ -1299,7 +1248,7 @@ case $os in
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \ | -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \ | -uxpv* | -beos* | -mpeix* | -udk* \
...@@ -1309,7 +1258,7 @@ case $os in ...@@ -1309,7 +1258,7 @@ case $os in
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
# Remember, each alternative MUST END IN *, to match a version number. # Remember, each alternative MUST END IN *, to match a version number.
;; ;;
-qnx*) -qnx*)
...@@ -1439,11 +1388,6 @@ case $os in ...@@ -1439,11 +1388,6 @@ case $os in
-zvmoe) -zvmoe)
os=-zvmoe os=-zvmoe
;; ;;
-dicos*)
os=-dicos
;;
-nacl*)
;;
-none) -none)
;; ;;
*) *)
...@@ -1641,7 +1585,7 @@ case $basic_machine in ...@@ -1641,7 +1585,7 @@ case $basic_machine in
-sunos*) -sunos*)
vendor=sun vendor=sun
;; ;;
-cnk*|-aix*) -aix*)
vendor=ibm vendor=ibm
;; ;;
-beos*) -beos*)
......
...@@ -763,6 +763,15 @@ FGREP ...@@ -763,6 +763,15 @@ FGREP
EGREP EGREP
GREP GREP
SED SED
host_os
host_vendor
host_cpu
host
build_os
build_vendor
build_cpu
build
LIBTOOL
am__fastdepCC_FALSE am__fastdepCC_FALSE
am__fastdepCC_TRUE am__fastdepCC_TRUE
CCDEPMODE CCDEPMODE
...@@ -779,15 +788,6 @@ CPPFLAGS ...@@ -779,15 +788,6 @@ CPPFLAGS
LDFLAGS LDFLAGS
CFLAGS CFLAGS
CC CC
host_os
host_vendor
host_cpu
host
build_os
build_vendor
build_cpu
build
LIBTOOL
MAINT MAINT
MAINTAINER_MODE_FALSE MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE MAINTAINER_MODE_TRUE
...@@ -856,11 +856,11 @@ ac_subst_files='' ...@@ -856,11 +856,11 @@ ac_subst_files=''
ac_user_opts=' ac_user_opts='
enable_option_checking enable_option_checking
enable_maintainer_mode enable_maintainer_mode
enable_dependency_tracking
enable_shared enable_shared
enable_static enable_static
with_pic with_pic
enable_fast_install enable_fast_install
enable_dependency_tracking
with_gnu_ld with_gnu_ld
enable_libtool_lock enable_libtool_lock
' '
...@@ -1493,12 +1493,12 @@ Optional Features: ...@@ -1493,12 +1493,12 @@ Optional Features:
--enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-maintainer-mode enable make rules and dependencies not useful --enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer (and sometimes confusing) to the casual installer
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
--enable-shared[=PKGS] build shared libraries [default=yes] --enable-shared[=PKGS] build shared libraries [default=yes]
--enable-static[=PKGS] build static libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes]
--enable-fast-install[=PKGS] --enable-fast-install[=PKGS]
optimize for fast installation [default=yes] optimize for fast installation [default=yes]
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
--disable-libtool-lock avoid locking (might break parallel builds) --disable-libtool-lock avoid locking (might break parallel builds)
Optional Packages: Optional Packages:
...@@ -2766,7 +2766,7 @@ fi ...@@ -2766,7 +2766,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE=libev PACKAGE=libev
VERSION=4.09 VERSION=4.11
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
...@@ -2831,165 +2831,6 @@ fi ...@@ -2831,165 +2831,6 @@ fi
case `pwd` in
*\ * | *\ *)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
esac
macro_version='2.2.6b'
macro_revision='1.3017'
ltmain="$ac_aux_dir/ltmain.sh"
# Make sure we can run config.sub.
$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
$as_echo_n "checking build system type... " >&6; }
if test "${ac_cv_build+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_build_alias=$build_alias
test "x$ac_build_alias" = x &&
ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
test "x$ac_build_alias" = x &&
as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
$as_echo "$ac_cv_build" >&6; }
case $ac_cv_build in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
esac
build=$ac_cv_build
ac_save_IFS=$IFS; IFS='-'
set x $ac_cv_build
shift
build_cpu=$1
build_vendor=$2
shift; shift
# Remember, the first character of IFS is used to create $*,
# except with old shells:
build_os=$*
IFS=$ac_save_IFS
case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
$as_echo_n "checking host system type... " >&6; }
if test "${ac_cv_host+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test "x$host_alias" = x; then
ac_cv_host=$ac_cv_build
else
ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
$as_echo "$ac_cv_host" >&6; }
case $ac_cv_host in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
esac
host=$ac_cv_host
ac_save_IFS=$IFS; IFS='-'
set x $ac_cv_host
shift
host_cpu=$1
host_vendor=$2
shift; shift
# Remember, the first character of IFS is used to create $*,
# except with old shells:
host_os=$*
IFS=$ac_save_IFS
case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
DEPDIR="${am__leading_dot}deps"
ac_config_commands="$ac_config_commands depfiles"
am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
@echo this is the am__doit target
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
$as_echo_n "checking for style of include used by $am_make... " >&6; }
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# Ignore all kinds of additional output from `make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
am__quote=
_am_result=GNU
;;
esac
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=.include
am__quote="\""
_am_result=BSD
;;
esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
$as_echo "$_am_result" >&6; }
rm -f confinc confmf
# Check whether --enable-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
ac_ext=c ac_ext=c
ac_cpp='$CPP $CPPFLAGS' ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
...@@ -3779,6 +3620,68 @@ ac_cpp='$CPP $CPPFLAGS' ...@@ -3779,6 +3620,68 @@ ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 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_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu 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 this is the am__doit target
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
$as_echo_n "checking for style of include used by $am_make... " >&6; }
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# Ignore all kinds of additional output from `make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
am__quote=
_am_result=GNU
;;
esac
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=.include
am__quote="\""
_am_result=BSD
;;
esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
$as_echo "$_am_result" >&6; }
rm -f confinc confmf
# Check whether --enable-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= depcc="$CC" am_compiler_list=
...@@ -3907,6 +3810,110 @@ else ...@@ -3907,6 +3810,110 @@ else
fi fi
if test -z "$orig_CFLAGS"; then
if test x$GCC = xyes; then
CFLAGS="-g -O3"
fi
fi
case `pwd` in
*\ * | *\ *)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
esac
macro_version='2.2.6b'
macro_revision='1.3017'
ltmain="$ac_aux_dir/ltmain.sh"
# Make sure we can run config.sub.
$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
$as_echo_n "checking build system type... " >&6; }
if test "${ac_cv_build+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_build_alias=$build_alias
test "x$ac_build_alias" = x &&
ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
test "x$ac_build_alias" = x &&
as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
$as_echo "$ac_cv_build" >&6; }
case $ac_cv_build in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
esac
build=$ac_cv_build
ac_save_IFS=$IFS; IFS='-'
set x $ac_cv_build
shift
build_cpu=$1
build_vendor=$2
shift; shift
# Remember, the first character of IFS is used to create $*,
# except with old shells:
build_os=$*
IFS=$ac_save_IFS
case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
$as_echo_n "checking host system type... " >&6; }
if test "${ac_cv_host+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test "x$host_alias" = x; then
ac_cv_host=$ac_cv_build
else
ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
$as_echo "$ac_cv_host" >&6; }
case $ac_cv_host in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
esac
host=$ac_cv_host
ac_save_IFS=$IFS; IFS='-'
set x $ac_cv_host
shift
host_cpu=$1
host_vendor=$2
shift; shift
# Remember, the first character of IFS is used to create $*,
# except with old shells:
host_os=$*
IFS=$ac_save_IFS
case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
$as_echo_n "checking for a sed that does not truncate output... " >&6; } $as_echo_n "checking for a sed that does not truncate output... " >&6; }
if test "${ac_cv_path_SED+set}" = set; then : if test "${ac_cv_path_SED+set}" = set; then :
...@@ -4491,13 +4498,13 @@ if test "${lt_cv_nm_interface+set}" = set; then : ...@@ -4491,13 +4498,13 @@ if test "${lt_cv_nm_interface+set}" = set; then :
else else
lt_cv_nm_interface="BSD nm" lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext echo "int some_variable = 0;" > conftest.$ac_ext
(eval echo "\"\$as_me:4494: $ac_compile\"" >&5) (eval echo "\"\$as_me:4501: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err) (eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5 cat conftest.err >&5
(eval echo "\"\$as_me:4497: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval echo "\"\$as_me:4504: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5 cat conftest.err >&5
(eval echo "\"\$as_me:4500: output\"" >&5) (eval echo "\"\$as_me:4507: output\"" >&5)
cat conftest.out >&5 cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin" lt_cv_nm_interface="MS dumpbin"
...@@ -5703,7 +5710,7 @@ ia64-*-hpux*) ...@@ -5703,7 +5710,7 @@ ia64-*-hpux*)
;; ;;
*-*-irix6*) *-*-irix6*)
# Find out which ABI we are using. # Find out which ABI we are using.
echo '#line 5706 "configure"' > conftest.$ac_ext echo '#line 5713 "configure"' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5 (eval $ac_compile) 2>&5
ac_status=$? ac_status=$?
...@@ -7228,11 +7235,11 @@ else ...@@ -7228,11 +7235,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'` -e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7231: $lt_compile\"" >&5) (eval echo "\"\$as_me:7238: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err) (eval "$lt_compile" 2>conftest.err)
ac_status=$? ac_status=$?
cat conftest.err >&5 cat conftest.err >&5
echo "$as_me:7235: \$? = $ac_status" >&5 echo "$as_me:7242: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized # The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output. # So say no if there are warnings other than the usual output.
...@@ -7567,11 +7574,11 @@ else ...@@ -7567,11 +7574,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'` -e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7570: $lt_compile\"" >&5) (eval echo "\"\$as_me:7577: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err) (eval "$lt_compile" 2>conftest.err)
ac_status=$? ac_status=$?
cat conftest.err >&5 cat conftest.err >&5
echo "$as_me:7574: \$? = $ac_status" >&5 echo "$as_me:7581: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized # The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output. # So say no if there are warnings other than the usual output.
...@@ -7672,11 +7679,11 @@ else ...@@ -7672,11 +7679,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'` -e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7675: $lt_compile\"" >&5) (eval echo "\"\$as_me:7682: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err) (eval "$lt_compile" 2>out/conftest.err)
ac_status=$? ac_status=$?
cat out/conftest.err >&5 cat out/conftest.err >&5
echo "$as_me:7679: \$? = $ac_status" >&5 echo "$as_me:7686: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext if (exit $ac_status) && test -s out/conftest2.$ac_objext
then then
# The compiler can only warn and ignore the option if not recognized # The compiler can only warn and ignore the option if not recognized
...@@ -7727,11 +7734,11 @@ else ...@@ -7727,11 +7734,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'` -e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7730: $lt_compile\"" >&5) (eval echo "\"\$as_me:7737: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err) (eval "$lt_compile" 2>out/conftest.err)
ac_status=$? ac_status=$?
cat out/conftest.err >&5 cat out/conftest.err >&5
echo "$as_me:7734: \$? = $ac_status" >&5 echo "$as_me:7741: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext if (exit $ac_status) && test -s out/conftest2.$ac_objext
then then
# The compiler can only warn and ignore the option if not recognized # The compiler can only warn and ignore the option if not recognized
...@@ -10111,7 +10118,7 @@ else ...@@ -10111,7 +10118,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF cat > conftest.$ac_ext <<_LT_EOF
#line 10114 "configure" #line 10121 "configure"
#include "confdefs.h" #include "confdefs.h"
#if HAVE_DLFCN_H #if HAVE_DLFCN_H
...@@ -10207,7 +10214,7 @@ else ...@@ -10207,7 +10214,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF cat > conftest.$ac_ext <<_LT_EOF
#line 10210 "configure" #line 10217 "configure"
#include "confdefs.h" #include "confdefs.h"
#if HAVE_DLFCN_H #if HAVE_DLFCN_H
...@@ -10435,10 +10442,6 @@ CC="$lt_save_CC" ...@@ -10435,10 +10442,6 @@ CC="$lt_save_CC"
if test "x$GCC" = xyes ; then
CFLAGS="-O3 $CFLAGS"
fi
for ac_header in sys/inotify.h sys/epoll.h sys/event.h port.h poll.h sys/select.h sys/eventfd.h sys/signalfd.h for ac_header in sys/inotify.h sys/epoll.h sys/event.h port.h poll.h sys/select.h sys/eventfd.h sys/signalfd.h
do : do :
......
/* /*
* libev event processing core, watcher management * libev event processing core, watcher management
* *
* Copyright (c) 2007,2008,2009,2010,2011 Marc Alexander Lehmann <libev@schmorp.de> * Copyright (c) 2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann <libev@schmorp.de>
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modifica- * Redistribution and use in source and binary forms, with or without modifica-
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
# define EV_USE_MONOTONIC 1 # define EV_USE_MONOTONIC 1
# endif # endif
# endif # endif
# elif !defined(EV_USE_CLOCK_SYSCALL) # elif !defined EV_USE_CLOCK_SYSCALL
# define EV_USE_CLOCK_SYSCALL 0 # define EV_USE_CLOCK_SYSCALL 0
# endif # endif
...@@ -185,6 +185,17 @@ ...@@ -185,6 +185,17 @@
# include "ev.h" # include "ev.h"
#endif #endif
#if EV_NO_THREADS
# undef EV_NO_SMP
# define EV_NO_SMP 1
# undef ECB_NO_THREADS
# define ECB_NO_THREADS 1
#endif
#if EV_NO_SMP
# undef EV_NO_SMP
# define ECB_NO_SMP 1
#endif
#ifndef _WIN32 #ifndef _WIN32
# include <sys/time.h> # include <sys/time.h>
# include <sys/wait.h> # include <sys/wait.h>
...@@ -192,6 +203,7 @@ ...@@ -192,6 +203,7 @@
#else #else
# include <io.h> # include <io.h>
# define WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN
# include <winsock2.h>
# include <windows.h> # include <windows.h>
# ifndef EV_SELECT_IS_WINSOCKET # ifndef EV_SELECT_IS_WINSOCKET
# define EV_SELECT_IS_WINSOCKET 1 # define EV_SELECT_IS_WINSOCKET 1
...@@ -210,25 +222,25 @@ ...@@ -210,25 +222,25 @@
/* this block tries to deduce configuration from header-defined symbols and defaults */ /* this block tries to deduce configuration from header-defined symbols and defaults */
/* try to deduce the maximum number of signals on this platform */ /* try to deduce the maximum number of signals on this platform */
#if defined (EV_NSIG) #if defined EV_NSIG
/* use what's provided */ /* use what's provided */
#elif defined (NSIG) #elif defined NSIG
# define EV_NSIG (NSIG) # define EV_NSIG (NSIG)
#elif defined(_NSIG) #elif defined _NSIG
# define EV_NSIG (_NSIG) # define EV_NSIG (_NSIG)
#elif defined (SIGMAX) #elif defined SIGMAX
# define EV_NSIG (SIGMAX+1) # define EV_NSIG (SIGMAX+1)
#elif defined (SIG_MAX) #elif defined SIG_MAX
# define EV_NSIG (SIG_MAX+1) # define EV_NSIG (SIG_MAX+1)
#elif defined (_SIG_MAX) #elif defined _SIG_MAX
# define EV_NSIG (_SIG_MAX+1) # define EV_NSIG (_SIG_MAX+1)
#elif defined (MAXSIG) #elif defined MAXSIG
# define EV_NSIG (MAXSIG+1) # define EV_NSIG (MAXSIG+1)
#elif defined (MAX_SIG) #elif defined MAX_SIG
# define EV_NSIG (MAX_SIG+1) # define EV_NSIG (MAX_SIG+1)
#elif defined (SIGARRAYSIZE) #elif defined SIGARRAYSIZE
# define EV_NSIG (SIGARRAYSIZE) /* Assume ary[SIGARRAYSIZE] */ # define EV_NSIG (SIGARRAYSIZE) /* Assume ary[SIGARRAYSIZE] */
#elif defined (_sys_nsig) #elif defined _sys_nsig
# define EV_NSIG (_sys_nsig) /* Solaris 2.5 */ # define EV_NSIG (_sys_nsig) /* Solaris 2.5 */
#else #else
# error "unable to find value for NSIG, please report" # error "unable to find value for NSIG, please report"
...@@ -250,7 +262,7 @@ ...@@ -250,7 +262,7 @@
#endif #endif
#ifndef EV_USE_MONOTONIC #ifndef EV_USE_MONOTONIC
# if defined (_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 # if defined _POSIX_MONOTONIC_CLOCK && _POSIX_MONOTONIC_CLOCK >= 0
# define EV_USE_MONOTONIC EV_FEATURE_OS # define EV_USE_MONOTONIC EV_FEATURE_OS
# else # else
# define EV_USE_MONOTONIC 0 # define EV_USE_MONOTONIC 0
...@@ -350,7 +362,7 @@ ...@@ -350,7 +362,7 @@
/* on linux, we can use a (slow) syscall to avoid a dependency on pthread, */ /* on linux, we can use a (slow) syscall to avoid a dependency on pthread, */
/* which makes programs even slower. might work on other unices, too. */ /* which makes programs even slower. might work on other unices, too. */
#if EV_USE_CLOCK_SYSCALL #if EV_USE_CLOCK_SYSCALL
# include <syscall.h> # include <sys/syscall.h>
# ifdef SYS_clock_gettime # ifdef SYS_clock_gettime
# define clock_gettime(id, ts) syscall (SYS_clock_gettime, (id), (ts)) # define clock_gettime(id, ts) syscall (SYS_clock_gettime, (id), (ts))
# undef EV_USE_MONOTONIC # undef EV_USE_MONOTONIC
...@@ -386,7 +398,7 @@ ...@@ -386,7 +398,7 @@
#if !EV_USE_NANOSLEEP #if !EV_USE_NANOSLEEP
/* hp-ux has it in sys/time.h, which we unconditionally include above */ /* hp-ux has it in sys/time.h, which we unconditionally include above */
# if !defined(_WIN32) && !defined(__hpux) # if !defined _WIN32 && !defined __hpux
# include <sys/select.h> # include <sys/select.h>
# endif # endif
#endif #endif
...@@ -401,10 +413,6 @@ ...@@ -401,10 +413,6 @@
# endif # endif
#endif #endif
#if EV_SELECT_IS_WINSOCKET
# include <winsock.h>
#endif
#if EV_USE_EVENTFD #if EV_USE_EVENTFD
/* our minimum requirement is glibc 2.7 which has the stub, but not the header */ /* our minimum requirement is glibc 2.7 which has the stub, but not the header */
# include <stdint.h> # include <stdint.h>
...@@ -469,7 +477,7 @@ struct signalfd_siginfo ...@@ -469,7 +477,7 @@ struct signalfd_siginfo
/* /*
* libecb - http://software.schmorp.de/pkg/libecb * libecb - http://software.schmorp.de/pkg/libecb
* *
* Copyright (©) 2009-2011 Marc Alexander Lehmann <libecb@schmorp.de> * Copyright (©) 2009-2012 Marc Alexander Lehmann <libecb@schmorp.de>
* Copyright (©) 2011 Emanuele Giaquinta * Copyright (©) 2011 Emanuele Giaquinta
* All rights reserved. * All rights reserved.
* *
...@@ -524,7 +532,7 @@ struct signalfd_siginfo ...@@ -524,7 +532,7 @@ struct signalfd_siginfo
* an issue with that they should have done it right in the first place. * an issue with that they should have done it right in the first place.
*/ */
#ifndef ECB_GCC_VERSION #ifndef ECB_GCC_VERSION
#if !defined(__GNUC_MINOR__) || defined(__INTEL_COMPILER) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(__llvm__) || defined(__clang__) #if !defined __GNUC_MINOR__ || defined __INTEL_COMPILER || defined __SUNPRO_C || defined __SUNPRO_CC || defined __llvm__ || defined __clang__
#define ECB_GCC_VERSION(major,minor) 0 #define ECB_GCC_VERSION(major,minor) 0
#else #else
#define ECB_GCC_VERSION(major,minor) (__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor))) #define ECB_GCC_VERSION(major,minor) (__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))
...@@ -536,34 +544,48 @@ struct signalfd_siginfo ...@@ -536,34 +544,48 @@ struct signalfd_siginfo
/* ECB_NO_THREADS - ecb is not used by multiple threads, ever */ /* ECB_NO_THREADS - ecb is not used by multiple threads, ever */
/* ECB_NO_SMP - ecb might be used in multiple threads, but only on a single cpu */ /* ECB_NO_SMP - ecb might be used in multiple threads, but only on a single cpu */
#if ECB_NO_THREADS
# define ECB_NO_SMP 1
#endif
#if ECB_NO_THREADS || ECB_NO_SMP #if ECB_NO_THREADS || ECB_NO_SMP
#define ECB_MEMORY_FENCE do { } while (0) #define ECB_MEMORY_FENCE do { } while (0)
#endif #endif
#ifndef ECB_MEMORY_FENCE #ifndef ECB_MEMORY_FENCE
#if ECB_GCC_VERSION(2,5) || defined(__INTEL_COMPILER) || defined(__clang__) #if ECB_GCC_VERSION(2,5) || defined __INTEL_COMPILER || (__llvm__ && __GNUC__) || __SUNPRO_C >= 0x5110 || __SUNPRO_CC >= 0x5110
#if __i386__ #if __i386 || __i386__
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("lock; orb $0, -1(%%esp)" : : : "memory") #define ECB_MEMORY_FENCE __asm__ __volatile__ ("lock; orb $0, -1(%%esp)" : : : "memory")
#define ECB_MEMORY_FENCE_ACQUIRE ECB_MEMORY_FENCE /* non-lock xchg might be enough */ #define ECB_MEMORY_FENCE_ACQUIRE ECB_MEMORY_FENCE /* non-lock xchg might be enough */
#define ECB_MEMORY_FENCE_RELEASE do { } while (0) /* unlikely to change in future cpus */ #define ECB_MEMORY_FENCE_RELEASE do { } while (0) /* unlikely to change in future cpus */
#elif __amd64 #elif __amd64 || __amd64__ || __x86_64 || __x86_64__
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("mfence" : : : "memory") #define ECB_MEMORY_FENCE __asm__ __volatile__ ("mfence" : : : "memory")
#define ECB_MEMORY_FENCE_ACQUIRE __asm__ __volatile__ ("lfence" : : : "memory") #define ECB_MEMORY_FENCE_ACQUIRE __asm__ __volatile__ ("lfence" : : : "memory")
#define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("sfence") /* play safe - not needed in any current cpu */ #define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("sfence") /* play safe - not needed in any current cpu */
#elif __powerpc__ || __ppc__ || __powerpc64__ || __ppc64__ #elif __powerpc__ || __ppc__ || __powerpc64__ || __ppc64__
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("sync" : : : "memory") #define ECB_MEMORY_FENCE __asm__ __volatile__ ("sync" : : : "memory")
#elif defined(__ARM_ARCH_6__ ) || defined(__ARM_ARCH_6J__ ) \ #elif defined __ARM_ARCH_6__ || defined __ARM_ARCH_6J__ \
|| defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6ZK__) || defined __ARM_ARCH_6K__ || defined __ARM_ARCH_6ZK__
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("mcr p15,0,%0,c7,c10,5" : : "r" (0) : "memory") #define ECB_MEMORY_FENCE __asm__ __volatile__ ("mcr p15,0,%0,c7,c10,5" : : "r" (0) : "memory")
#elif defined(__ARM_ARCH_7__ ) || defined(__ARM_ARCH_7A__ ) \ #elif defined __ARM_ARCH_7__ || defined __ARM_ARCH_7A__ \
|| defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7R__ ) || defined __ARM_ARCH_7M__ || defined __ARM_ARCH_7R__
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("dmb" : : : "memory") #define ECB_MEMORY_FENCE __asm__ __volatile__ ("dmb" : : : "memory")
#elif __sparc || __sparc__
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("membar #LoadStore | #LoadLoad | #StoreStore | #StoreLoad | " : : : "memory")
#define ECB_MEMORY_FENCE_ACQUIRE __asm__ __volatile__ ("membar #LoadStore | #LoadLoad" : : : "memory")
#define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("membar #LoadStore | #StoreStore")
#elif defined __s390__ || defined __s390x__
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("bcr 15,0" : : : "memory")
#elif defined __mips__
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("sync" : : : "memory")
#elif defined __alpha__
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("mb" : : : "memory")
#endif #endif
#endif #endif
#endif #endif
#ifndef ECB_MEMORY_FENCE #ifndef ECB_MEMORY_FENCE
#if ECB_GCC_VERSION(4,4) || defined(__INTEL_COMPILER) || defined(__clang__) #if ECB_GCC_VERSION(4,4) || defined __INTEL_COMPILER || defined __clang__
#define ECB_MEMORY_FENCE __sync_synchronize () #define ECB_MEMORY_FENCE __sync_synchronize ()
/*#define ECB_MEMORY_FENCE_ACQUIRE ({ char dummy = 0; __sync_lock_test_and_set (&dummy, 1); }) */ /*#define ECB_MEMORY_FENCE_ACQUIRE ({ char dummy = 0; __sync_lock_test_and_set (&dummy, 1); }) */
/*#define ECB_MEMORY_FENCE_RELEASE ({ char dummy = 1; __sync_lock_release (&dummy ); }) */ /*#define ECB_MEMORY_FENCE_RELEASE ({ char dummy = 1; __sync_lock_release (&dummy ); }) */
...@@ -572,9 +594,16 @@ struct signalfd_siginfo ...@@ -572,9 +594,16 @@ struct signalfd_siginfo
#define ECB_MEMORY_FENCE _ReadWriteBarrier () #define ECB_MEMORY_FENCE _ReadWriteBarrier ()
#define ECB_MEMORY_FENCE_ACQUIRE _ReadWriteBarrier () /* according to msdn, _ReadBarrier is not a load fence */ #define ECB_MEMORY_FENCE_ACQUIRE _ReadWriteBarrier () /* according to msdn, _ReadBarrier is not a load fence */
#define ECB_MEMORY_FENCE_RELEASE _WriteBarrier () #define ECB_MEMORY_FENCE_RELEASE _WriteBarrier ()
#elif defined(_WIN32) #elif defined _WIN32
#include <WinNT.h> #include <WinNT.h>
#define ECB_MEMORY_FENCE MemoryBarrier () /* actually just xchg on x86... scary */ #define ECB_MEMORY_FENCE MemoryBarrier () /* actually just xchg on x86... scary */
#elif __SUNPRO_C >= 0x5110 || __SUNPRO_CC >= 0x5110
#include <mbarrier.h>
#define ECB_MEMORY_FENCE __machine_rw_barrier ()
#define ECB_MEMORY_FENCE_ACQUIRE __machine_r_barrier ()
#define ECB_MEMORY_FENCE_RELEASE __machine_w_barrier ()
#elif __xlC__
#define ECB_MEMORY_FENCE __sync ()
#endif #endif
#endif #endif
...@@ -596,11 +625,11 @@ struct signalfd_siginfo ...@@ -596,11 +625,11 @@ struct signalfd_siginfo
#endif #endif
#endif #endif
#if !defined(ECB_MEMORY_FENCE_ACQUIRE) && defined(ECB_MEMORY_FENCE) #if !defined ECB_MEMORY_FENCE_ACQUIRE && defined ECB_MEMORY_FENCE
#define ECB_MEMORY_FENCE_ACQUIRE ECB_MEMORY_FENCE #define ECB_MEMORY_FENCE_ACQUIRE ECB_MEMORY_FENCE
#endif #endif
#if !defined(ECB_MEMORY_FENCE_RELEASE) && defined(ECB_MEMORY_FENCE) #if !defined ECB_MEMORY_FENCE_RELEASE && defined ECB_MEMORY_FENCE
#define ECB_MEMORY_FENCE_RELEASE ECB_MEMORY_FENCE #define ECB_MEMORY_FENCE_RELEASE ECB_MEMORY_FENCE
#endif #endif
...@@ -759,6 +788,36 @@ typedef int ecb_bool; ...@@ -759,6 +788,36 @@ typedef int ecb_bool;
} }
#endif #endif
ecb_function_ uint8_t ecb_bitrev8 (uint8_t x) ecb_const;
ecb_function_ uint8_t ecb_bitrev8 (uint8_t x)
{
return ( (x * 0x0802U & 0x22110U)
| (x * 0x8020U & 0x88440U)) * 0x10101U >> 16;
}
ecb_function_ uint16_t ecb_bitrev16 (uint16_t x) ecb_const;
ecb_function_ uint16_t ecb_bitrev16 (uint16_t x)
{
x = ((x >> 1) & 0x5555) | ((x & 0x5555) << 1);
x = ((x >> 2) & 0x3333) | ((x & 0x3333) << 2);
x = ((x >> 4) & 0x0f0f) | ((x & 0x0f0f) << 4);
x = ( x >> 8 ) | ( x << 8);
return x;
}
ecb_function_ uint32_t ecb_bitrev32 (uint32_t x) ecb_const;
ecb_function_ uint32_t ecb_bitrev32 (uint32_t x)
{
x = ((x >> 1) & 0x55555555) | ((x & 0x55555555) << 1);
x = ((x >> 2) & 0x33333333) | ((x & 0x33333333) << 2);
x = ((x >> 4) & 0x0f0f0f0f) | ((x & 0x0f0f0f0f) << 4);
x = ((x >> 8) & 0x00ff00ff) | ((x & 0x00ff00ff) << 8);
x = ( x >> 16 ) | ( x << 16);
return x;
}
/* popcount64 is only available on 64 bit cpus as gcc builtin */ /* popcount64 is only available on 64 bit cpus as gcc builtin */
/* so for this version we are lazy */ /* so for this version we are lazy */
ecb_function_ int ecb_popcount64 (uint64_t x) ecb_const; ecb_function_ int ecb_popcount64 (uint64_t x) ecb_const;
...@@ -817,25 +876,25 @@ ecb_inline uint64_t ecb_rotr64 (uint64_t x, unsigned int count) { return (x << ( ...@@ -817,25 +876,25 @@ ecb_inline uint64_t ecb_rotr64 (uint64_t x, unsigned int count) { return (x << (
#define ecb_unreachable() __builtin_unreachable () #define ecb_unreachable() __builtin_unreachable ()
#else #else
/* this seems to work fine, but gcc always emits a warning for it :/ */ /* this seems to work fine, but gcc always emits a warning for it :/ */
ecb_function_ void ecb_unreachable (void) ecb_noreturn; ecb_inline void ecb_unreachable (void) ecb_noreturn;
ecb_function_ void ecb_unreachable (void) { } ecb_inline void ecb_unreachable (void) { }
#endif #endif
/* try to tell the compiler that some condition is definitely true */ /* try to tell the compiler that some condition is definitely true */
#define ecb_assume(cond) do { if (!(cond)) ecb_unreachable (); } while (0) #define ecb_assume(cond) do { if (!(cond)) ecb_unreachable (); } while (0)
ecb_function_ unsigned char ecb_byteorder_helper (void) ecb_const; ecb_inline unsigned char ecb_byteorder_helper (void) ecb_const;
ecb_function_ unsigned char ecb_inline unsigned char
ecb_byteorder_helper (void) ecb_byteorder_helper (void)
{ {
const uint32_t u = 0x11223344; const uint32_t u = 0x11223344;
return *(unsigned char *)&u; return *(unsigned char *)&u;
} }
ecb_function_ ecb_bool ecb_big_endian (void) ecb_const; ecb_inline ecb_bool ecb_big_endian (void) ecb_const;
ecb_function_ ecb_bool ecb_big_endian (void) { return ecb_byteorder_helper () == 0x11; } ecb_inline ecb_bool ecb_big_endian (void) { return ecb_byteorder_helper () == 0x11; }
ecb_function_ ecb_bool ecb_little_endian (void) ecb_const; ecb_inline ecb_bool ecb_little_endian (void) ecb_const;
ecb_function_ ecb_bool ecb_little_endian (void) { return ecb_byteorder_helper () == 0x44; } ecb_inline ecb_bool ecb_little_endian (void) { return ecb_byteorder_helper () == 0x44; }
#if ECB_GCC_VERSION(3,0) || ECB_C99 #if ECB_GCC_VERSION(3,0) || ECB_C99
#define ecb_mod(m,n) ((m) % (n) + ((m) % (n) < 0 ? (n) : 0)) #define ecb_mod(m,n) ((m) % (n) + ((m) % (n) < 0 ? (n) : 0))
...@@ -878,7 +937,7 @@ ecb_function_ ecb_bool ecb_little_endian (void) { return ecb_byteorder_helper () ...@@ -878,7 +937,7 @@ ecb_function_ ecb_bool ecb_little_endian (void) { return ecb_byteorder_helper ()
/* if your architecture doesn't need memory fences, e.g. because it is /* if your architecture doesn't need memory fences, e.g. because it is
* single-cpu/core, or if you use libev in a project that doesn't use libev * single-cpu/core, or if you use libev in a project that doesn't use libev
* from multiple threads, then you can define ECB_AVOID_PTHREADS when compiling * from multiple threads, then you can define ECB_AVOID_PTHREADS when compiling
* libev, in which casess the memory fences become nops. * libev, in which cases the memory fences become nops.
* alternatively, you can remove this #error and link against libpthread, * alternatively, you can remove this #error and link against libpthread,
* which will then provide the memory fences. * which will then provide the memory fences.
*/ */
...@@ -1045,10 +1104,10 @@ ev_printerr (const char *msg) ...@@ -1045,10 +1104,10 @@ ev_printerr (const char *msg)
} }
#endif #endif
static void (*syserr_cb)(const char *msg); static void (*syserr_cb)(const char *msg) EV_THROW;
void ecb_cold void ecb_cold
ev_set_syserr_cb (void (*cb)(const char *msg)) ev_set_syserr_cb (void (*cb)(const char *msg)) EV_THROW
{ {
syserr_cb = cb; syserr_cb = cb;
} }
...@@ -1094,10 +1153,10 @@ ev_realloc_emul (void *ptr, long size) ...@@ -1094,10 +1153,10 @@ ev_realloc_emul (void *ptr, long size)
#endif #endif
} }
static void *(*alloc)(void *ptr, long size) = ev_realloc_emul; static void *(*alloc)(void *ptr, long size) EV_THROW = ev_realloc_emul;
void ecb_cold void ecb_cold
ev_set_allocator (void *(*cb)(void *ptr, long size)) ev_set_allocator (void *(*cb)(void *ptr, long size)) EV_THROW
{ {
alloc = cb; alloc = cb;
} }
...@@ -1195,11 +1254,11 @@ typedef struct ...@@ -1195,11 +1254,11 @@ typedef struct
#include "ev_wrap.h" #include "ev_wrap.h"
static struct ev_loop default_loop_struct; static struct ev_loop default_loop_struct;
struct ev_loop *ev_default_loop_ptr; EV_API_DECL struct ev_loop *ev_default_loop_ptr = 0; /* needs to be initialised to make it a definition despite extern */
#else #else
ev_tstamp ev_rt_now; EV_API_DECL ev_tstamp ev_rt_now = 0; /* needs to be initialised to make it a definition despite extern */
#define VAR(name,decl) static decl; #define VAR(name,decl) static decl;
#include "ev_vars.h" #include "ev_vars.h"
#undef VAR #undef VAR
...@@ -1224,7 +1283,7 @@ typedef struct ...@@ -1224,7 +1283,7 @@ typedef struct
#ifndef EV_HAVE_EV_TIME #ifndef EV_HAVE_EV_TIME
ev_tstamp ev_tstamp
ev_time (void) ev_time (void) EV_THROW
{ {
#if EV_USE_REALTIME #if EV_USE_REALTIME
if (expect_true (have_realtime)) if (expect_true (have_realtime))
...@@ -1258,14 +1317,14 @@ get_clock (void) ...@@ -1258,14 +1317,14 @@ get_clock (void)
#if EV_MULTIPLICITY #if EV_MULTIPLICITY
ev_tstamp ev_tstamp
ev_now (EV_P) ev_now (EV_P) EV_THROW
{ {
return ev_rt_now; return ev_rt_now;
} }
#endif #endif
void void
ev_sleep (ev_tstamp delay) ev_sleep (ev_tstamp delay) EV_THROW
{ {
if (delay > 0.) if (delay > 0.)
{ {
...@@ -1274,7 +1333,7 @@ ev_sleep (ev_tstamp delay) ...@@ -1274,7 +1333,7 @@ ev_sleep (ev_tstamp delay)
EV_TS_SET (ts, delay); EV_TS_SET (ts, delay);
nanosleep (&ts, 0); nanosleep (&ts, 0);
#elif defined(_WIN32) #elif defined _WIN32
Sleep ((unsigned long)(delay * 1e3)); Sleep ((unsigned long)(delay * 1e3));
#else #else
struct timeval tv; struct timeval tv;
...@@ -1356,7 +1415,7 @@ pendingcb (EV_P_ ev_prepare *w, int revents) ...@@ -1356,7 +1415,7 @@ pendingcb (EV_P_ ev_prepare *w, int revents)
} }
void noinline void noinline
ev_feed_event (EV_P_ void *w, int revents) ev_feed_event (EV_P_ void *w, int revents) EV_THROW
{ {
W w_ = (W)w; W w_ = (W)w;
int pri = ABSPRI (w_); int pri = ABSPRI (w_);
...@@ -1370,6 +1429,8 @@ ev_feed_event (EV_P_ void *w, int revents) ...@@ -1370,6 +1429,8 @@ ev_feed_event (EV_P_ void *w, int revents)
pendings [pri][w_->pending - 1].w = w_; pendings [pri][w_->pending - 1].w = w_;
pendings [pri][w_->pending - 1].events = revents; pendings [pri][w_->pending - 1].events = revents;
} }
pendingpri = NUMPRI - 1;
} }
inline_speed void inline_speed void
...@@ -1425,7 +1486,7 @@ fd_event (EV_P_ int fd, int revents) ...@@ -1425,7 +1486,7 @@ fd_event (EV_P_ int fd, int revents)
} }
void void
ev_feed_fd_event (EV_P_ int fd, int revents) ev_feed_fd_event (EV_P_ int fd, int revents) EV_THROW
{ {
if (fd >= 0 && fd < anfdmax) if (fd >= 0 && fd < anfdmax)
fd_event_nocheck (EV_A_ fd, revents); fd_event_nocheck (EV_A_ fd, revents);
...@@ -1784,6 +1845,8 @@ evpipe_init (EV_P) ...@@ -1784,6 +1845,8 @@ evpipe_init (EV_P)
inline_speed void inline_speed void
evpipe_write (EV_P_ EV_ATOMIC_T *flag) evpipe_write (EV_P_ EV_ATOMIC_T *flag)
{ {
ECB_MEMORY_FENCE; /* push out the write before this function was called, acquire flag */
if (expect_true (*flag)) if (expect_true (*flag))
return; return;
...@@ -1812,25 +1875,23 @@ evpipe_write (EV_P_ EV_ATOMIC_T *flag) ...@@ -1812,25 +1875,23 @@ evpipe_write (EV_P_ EV_ATOMIC_T *flag)
else else
#endif #endif
{ {
#ifdef GEVENT_VFD_MODE #ifdef _WIN32
/* in gevent VFD mode, a file descriptor is a meaningless number, WSABUF buf;
* so we'll convert it to proper Windows handle */ DWORD sent;
if (send(EV_FD_TO_WIN32_HANDLE(evpipe[1]), &(evpipe[1]), 1, 0) < 0) { buf.buf = &buf;
buf.len = 1;
if (WSASend(EV_FD_TO_WIN32_HANDLE (evpipe [1]), &buf, 1, &sent, 0, 0, 0))
{
int error;
error = GetLastError();
if (error != WSAEWOULDBLOCK)
#if EV_AVOID_STDIO #if EV_AVOID_STDIO
ev_printerr ("(libev) send error"); ev_printerr ("(libev) WSASend failed.\n");
ev_printerr (": ");
ev_printerr (strerror (errno));
ev_printerr ("\n");
#else #else
perror ("(libev) send error"); fprintf(stderr, "(libev) WSASend failed with error %d\n", error);
#endif #endif
} }
#else #else
/* win32 people keep sending patches that change this write() to send() */
/* and then run away. but send() is wrong, it wants a socket handle on win32 */
/* so when you think this write should be a send instead, please find out */
/* where your send() is from - it's definitely not the microsoft send, and */
/* tell me. thank you. */
write (evpipe [1], &(evpipe [1]), 1); write (evpipe [1], &(evpipe [1]), 1);
#endif #endif
} }
...@@ -1857,23 +1918,43 @@ pipecb (EV_P_ ev_io *iow, int revents) ...@@ -1857,23 +1918,43 @@ pipecb (EV_P_ ev_io *iow, int revents)
else else
#endif #endif
{ {
char dummy; char dummy[4];
#ifdef GEVENT_VFD_MODE #ifdef _WIN32
recv(EV_FD_TO_WIN32_HANDLE(evpipe[0]), &dummy, 1, 0); WSABUF buf;
DWORD recvd;
DWORD flags;
buf.buf = dummy;
buf.len = sizeof (dummy);
flags = 0;
if (WSARecv(EV_FD_TO_WIN32_HANDLE(evpipe[0]), &buf, 1, &recvd, &flags, 0, 0))
{
int error;
error = GetLastError();
if (error != WSAEWOULDBLOCK)
#if EV_AVOID_STDIO
ev_printerr ("(libev) WSARecv failed.\n");
#else #else
/* see discussion in evpipe_write when you think this read should be recv in win32 */ fprintf(stderr, "(libev) WSARecv failed with error %d\n", error);
read (evpipe [0], &dummy, 1); #endif
}
#else
read (evpipe [0], &dummy, sizeof (dummy));
#endif #endif
} }
} }
pipe_write_skipped = 0; pipe_write_skipped = 0;
ECB_MEMORY_FENCE; /* push out skipped, acquire flags */
#if EV_SIGNAL_ENABLE #if EV_SIGNAL_ENABLE
if (sig_pending) if (sig_pending)
{ {
sig_pending = 0; sig_pending = 0;
ECB_MEMORY_FENCE_RELEASE;
for (i = EV_NSIG - 1; i--; ) for (i = EV_NSIG - 1; i--; )
if (expect_false (signals [i].pending)) if (expect_false (signals [i].pending))
ev_feed_signal_event (EV_A_ i + 1); ev_feed_signal_event (EV_A_ i + 1);
...@@ -1885,6 +1966,8 @@ pipecb (EV_P_ ev_io *iow, int revents) ...@@ -1885,6 +1966,8 @@ pipecb (EV_P_ ev_io *iow, int revents)
{ {
async_pending = 0; async_pending = 0;
ECB_MEMORY_FENCE_RELEASE;
for (i = asynccnt; i--; ) for (i = asynccnt; i--; )
if (asyncs [i]->sent) if (asyncs [i]->sent)
{ {
...@@ -1898,7 +1981,7 @@ pipecb (EV_P_ ev_io *iow, int revents) ...@@ -1898,7 +1981,7 @@ pipecb (EV_P_ ev_io *iow, int revents)
/*****************************************************************************/ /*****************************************************************************/
void void
ev_feed_signal (int signum) ev_feed_signal (int signum) EV_THROW
{ {
#if EV_MULTIPLICITY #if EV_MULTIPLICITY
EV_P = signals [signum - 1].loop; EV_P = signals [signum - 1].loop;
...@@ -1925,7 +2008,7 @@ ev_sighandler (int signum) ...@@ -1925,7 +2008,7 @@ ev_sighandler (int signum)
} }
void noinline void noinline
ev_feed_signal_event (EV_P_ int signum) ev_feed_signal_event (EV_P_ int signum) EV_THROW
{ {
WL w; WL w;
...@@ -2052,13 +2135,13 @@ childcb (EV_P_ ev_signal *sw, int revents) ...@@ -2052,13 +2135,13 @@ childcb (EV_P_ ev_signal *sw, int revents)
#endif #endif
int ecb_cold int ecb_cold
ev_version_major (void) ev_version_major (void) EV_THROW
{ {
return EV_VERSION_MAJOR; return EV_VERSION_MAJOR;
} }
int ecb_cold int ecb_cold
ev_version_minor (void) ev_version_minor (void) EV_THROW
{ {
return EV_VERSION_MINOR; return EV_VERSION_MINOR;
} }
...@@ -2076,7 +2159,7 @@ enable_secure (void) ...@@ -2076,7 +2159,7 @@ enable_secure (void)
} }
unsigned int ecb_cold unsigned int ecb_cold
ev_supported_backends (void) ev_supported_backends (void) EV_THROW
{ {
unsigned int flags = 0; unsigned int flags = 0;
...@@ -2090,7 +2173,7 @@ ev_supported_backends (void) ...@@ -2090,7 +2173,7 @@ ev_supported_backends (void)
} }
unsigned int ecb_cold unsigned int ecb_cold
ev_recommended_backends (void) ev_recommended_backends (void) EV_THROW
{ {
unsigned int flags = ev_supported_backends (); unsigned int flags = ev_supported_backends ();
...@@ -2112,7 +2195,7 @@ ev_recommended_backends (void) ...@@ -2112,7 +2195,7 @@ ev_recommended_backends (void)
} }
unsigned int ecb_cold unsigned int ecb_cold
ev_embeddable_backends (void) ev_embeddable_backends (void) EV_THROW
{ {
int flags = EVBACKEND_EPOLL | EVBACKEND_KQUEUE | EVBACKEND_PORT; int flags = EVBACKEND_EPOLL | EVBACKEND_KQUEUE | EVBACKEND_PORT;
...@@ -2124,56 +2207,56 @@ ev_embeddable_backends (void) ...@@ -2124,56 +2207,56 @@ ev_embeddable_backends (void)
} }
unsigned int unsigned int
ev_backend (EV_P) ev_backend (EV_P) EV_THROW
{ {
return backend; return backend;
} }
#if EV_FEATURE_API #if EV_FEATURE_API
unsigned int unsigned int
ev_iteration (EV_P) ev_iteration (EV_P) EV_THROW
{ {
return loop_count; return loop_count;
} }
unsigned int unsigned int
ev_depth (EV_P) ev_depth (EV_P) EV_THROW
{ {
return loop_depth; return loop_depth;
} }
void void
ev_set_io_collect_interval (EV_P_ ev_tstamp interval) ev_set_io_collect_interval (EV_P_ ev_tstamp interval) EV_THROW
{ {
io_blocktime = interval; io_blocktime = interval;
} }
void void
ev_set_timeout_collect_interval (EV_P_ ev_tstamp interval) ev_set_timeout_collect_interval (EV_P_ ev_tstamp interval) EV_THROW
{ {
timeout_blocktime = interval; timeout_blocktime = interval;
} }
void void
ev_set_userdata (EV_P_ void *data) ev_set_userdata (EV_P_ void *data) EV_THROW
{ {
userdata = data; userdata = data;
} }
void * void *
ev_userdata (EV_P) ev_userdata (EV_P) EV_THROW
{ {
return userdata; return userdata;
} }
void void
ev_set_invoke_pending_cb (EV_P_ void (*invoke_pending_cb)(EV_P)) ev_set_invoke_pending_cb (EV_P_ void (*invoke_pending_cb)(EV_P)) EV_THROW
{ {
invoke_cb = invoke_pending_cb; invoke_cb = invoke_pending_cb;
} }
void void
ev_set_loop_release_cb (EV_P_ void (*release)(EV_P), void (*acquire)(EV_P)) ev_set_loop_release_cb (EV_P_ void (*release)(EV_P) EV_THROW, void (*acquire)(EV_P) EV_THROW) EV_THROW
{ {
release_cb = release; release_cb = release;
acquire_cb = acquire; acquire_cb = acquire;
...@@ -2182,7 +2265,7 @@ ev_set_loop_release_cb (EV_P_ void (*release)(EV_P), void (*acquire)(EV_P)) ...@@ -2182,7 +2265,7 @@ ev_set_loop_release_cb (EV_P_ void (*release)(EV_P), void (*acquire)(EV_P))
/* initialise a loop structure, must be zero-initialised */ /* initialise a loop structure, must be zero-initialised */
static void noinline ecb_cold static void noinline ecb_cold
loop_init (EV_P_ unsigned int flags) loop_init (EV_P_ unsigned int flags) EV_THROW
{ {
if (!backend) if (!backend)
{ {
...@@ -2297,15 +2380,18 @@ ev_loop_destroy (EV_P) ...@@ -2297,15 +2380,18 @@ ev_loop_destroy (EV_P)
#endif #endif
#if EV_CHILD_ENABLE #if EV_CHILD_ENABLE
if (ev_is_active (&childev)) if (ev_default_loop_ptr == EV_A)
{
ev_ref (EV_A); /* child watcher */
ev_signal_stop (EV_A_ &childev);
}
if (ev_is_active (&childpollev))
{ {
ev_ref (EV_A); /* child watcher */ if (ev_is_active (&childev))
ev_timer_stop (EV_A_ &childpollev); {
ev_ref (EV_A); /* child watcher */
ev_signal_stop (EV_A_ &childev);
}
if (ev_is_active (&childpollev))
{
ev_ref (EV_A); /* child watcher */
ev_timer_stop (EV_A_ &childpollev);
}
} }
#endif #endif
...@@ -2450,7 +2536,7 @@ loop_fork (EV_P) ...@@ -2450,7 +2536,7 @@ loop_fork (EV_P)
#if EV_MULTIPLICITY #if EV_MULTIPLICITY
struct ev_loop * ecb_cold struct ev_loop * ecb_cold
ev_loop_new (unsigned int flags) ev_loop_new (unsigned int flags) EV_THROW
{ {
EV_P = (struct ev_loop *)ev_malloc (sizeof (struct ev_loop)); EV_P = (struct ev_loop *)ev_malloc (sizeof (struct ev_loop));
...@@ -2504,11 +2590,11 @@ array_verify (EV_P_ W *ws, int cnt) ...@@ -2504,11 +2590,11 @@ array_verify (EV_P_ W *ws, int cnt)
#if EV_FEATURE_API #if EV_FEATURE_API
void ecb_cold void ecb_cold
ev_verify (EV_P) ev_verify (EV_P) EV_THROW
{ {
#if EV_VERIFY #if EV_VERIFY
int i; int i;
WL w; WL w, w2;
assert (activecnt >= -1); assert (activecnt >= -1);
...@@ -2518,12 +2604,23 @@ ev_verify (EV_P) ...@@ -2518,12 +2604,23 @@ ev_verify (EV_P)
assert (anfdmax >= 0); assert (anfdmax >= 0);
for (i = 0; i < anfdmax; ++i) for (i = 0; i < anfdmax; ++i)
for (w = anfds [i].head; w; w = w->next) {
{ int j = 0;
verify_watcher (EV_A_ (W)w);
assert (("libev: inactive fd watcher on anfd list", ev_active (w) == 1)); for (w = w2 = anfds [i].head; w; w = w->next)
assert (("libev: fd mismatch between watcher and anfd", ((ev_io *)w)->fd == i)); {
} verify_watcher (EV_A_ (W)w);
if (j++ & 1)
{
assert (("libev: io watcher list contains a loop", w != w2));
w2 = w2->next;
}
assert (("libev: inactive fd watcher on anfd list", ev_active (w) == 1));
assert (("libev: fd mismatch between watcher and anfd", ((ev_io *)w)->fd == i));
}
}
assert (timermax >= timercnt); assert (timermax >= timercnt);
verify_heap (EV_A_ timers, timercnt); verify_heap (EV_A_ timers, timercnt);
...@@ -2583,7 +2680,7 @@ struct ev_loop * ecb_cold ...@@ -2583,7 +2680,7 @@ struct ev_loop * ecb_cold
#else #else
int int
#endif #endif
ev_default_loop (unsigned int flags) ev_default_loop (unsigned int flags) EV_THROW
{ {
if (!ev_default_loop_ptr) if (!ev_default_loop_ptr)
{ {
...@@ -2600,9 +2697,8 @@ ev_default_loop (unsigned int flags) ...@@ -2600,9 +2697,8 @@ ev_default_loop (unsigned int flags)
#if EV_CHILD_ENABLE #if EV_CHILD_ENABLE
ev_signal_init (&childev, childcb, SIGCHLD); ev_signal_init (&childev, childcb, SIGCHLD);
ev_set_priority (&childev, EV_MAXPRI); ev_set_priority (&childev, EV_MAXPRI);
ev_signal_start (EV_A_ &childev);
ev_unref (EV_A); /* child watcher should not keep loop alive */
ev_timer_init (&childpollev, childcb, 1.0, 1.0); ev_timer_init (&childpollev, childcb, 1.0, 1.0);
ev_set_priority (&childpollev, EV_MAXPRI);
#endif #endif
} }
else else
...@@ -2613,7 +2709,7 @@ ev_default_loop (unsigned int flags) ...@@ -2613,7 +2709,7 @@ ev_default_loop (unsigned int flags)
} }
void void
ev_loop_fork (EV_P) ev_loop_fork (EV_P) EV_THROW
{ {
postfork = 1; /* must be in line with ev_default_fork */ postfork = 1; /* must be in line with ev_default_fork */
} }
...@@ -2627,7 +2723,7 @@ ev_invoke (EV_P_ void *w, int revents) ...@@ -2627,7 +2723,7 @@ ev_invoke (EV_P_ void *w, int revents)
} }
unsigned int unsigned int
ev_pending_count (EV_P) ev_pending_count (EV_P) EV_THROW
{ {
int pri; int pri;
unsigned int count = 0; unsigned int count = 0;
...@@ -2641,12 +2737,10 @@ ev_pending_count (EV_P) ...@@ -2641,12 +2737,10 @@ ev_pending_count (EV_P)
void noinline void noinline
ev_invoke_pending (EV_P) ev_invoke_pending (EV_P)
{ {
int pri; for (pendingpri = NUMPRI; pendingpri--; ) /* pendingpri is modified during the loop */
while (pendingcnt [pendingpri])
for (pri = NUMPRI; pri--; )
while (pendingcnt [pri])
{ {
ANPENDING *p = pendings [pri] + --pendingcnt [pri]; ANPENDING *p = pendings [pendingpri] + --pendingcnt [pendingpri];
p->w->pending = 0; p->w->pending = 0;
EV_CB_INVOKE (p->w, p->events); EV_CB_INVOKE (p->w, p->events);
...@@ -2896,20 +2990,7 @@ time_update (EV_P_ ev_tstamp max_block) ...@@ -2896,20 +2990,7 @@ time_update (EV_P_ ev_tstamp max_block)
} }
} }
inline_speed int int
has_pending (EV_P)
{
int pri;
for (pri = NUMPRI; pri--; )
if (pendingcnt [pri])
return 1;
return 0;
}
void
ev_run (EV_P_ int flags) ev_run (EV_P_ int flags)
{ {
#if EV_FEATURE_API #if EV_FEATURE_API
...@@ -3032,7 +3113,7 @@ ev_run (EV_P_ int flags) ...@@ -3032,7 +3113,7 @@ ev_run (EV_P_ int flags)
backend_poll (EV_A_ waittime); backend_poll (EV_A_ waittime);
assert ((loop_done = EVBREAK_CANCEL, 1)); /* assert for side effect */ assert ((loop_done = EVBREAK_CANCEL, 1)); /* assert for side effect */
pipe_write_wanted = 0; /* just an optimsiation, no fence needed */ pipe_write_wanted = 0; /* just an optimisation, no fence needed */
if (pipe_write_skipped) if (pipe_write_skipped)
{ {
...@@ -3065,7 +3146,7 @@ ev_run (EV_P_ int flags) ...@@ -3065,7 +3146,7 @@ ev_run (EV_P_ int flags)
EV_INVOKE_PENDING; EV_INVOKE_PENDING;
} }
while (expect_true ( while (expect_true (
(activecnt || has_pending(EV_A)) activecnt
&& !loop_done && !loop_done
&& !(flags & (EVRUN_ONCE | EVRUN_NOWAIT)) && !(flags & (EVRUN_ONCE | EVRUN_NOWAIT))
)); ));
...@@ -3076,40 +3157,42 @@ ev_run (EV_P_ int flags) ...@@ -3076,40 +3157,42 @@ ev_run (EV_P_ int flags)
#if EV_FEATURE_API #if EV_FEATURE_API
--loop_depth; --loop_depth;
#endif #endif
return activecnt;
} }
void void
ev_break (EV_P_ int how) ev_break (EV_P_ int how) EV_THROW
{ {
loop_done = how; loop_done = how;
} }
void void
ev_ref (EV_P) ev_ref (EV_P) EV_THROW
{ {
++activecnt; ++activecnt;
} }
void void
ev_unref (EV_P) ev_unref (EV_P) EV_THROW
{ {
--activecnt; --activecnt;
} }
void void
ev_now_update (EV_P) ev_now_update (EV_P) EV_THROW
{ {
time_update (EV_A_ 1e100); time_update (EV_A_ 1e100);
} }
void void
ev_suspend (EV_P) ev_suspend (EV_P) EV_THROW
{ {
ev_now_update (EV_A); ev_now_update (EV_A);
} }
void void
ev_resume (EV_P) ev_resume (EV_P) EV_THROW
{ {
ev_tstamp mn_prev = mn_now; ev_tstamp mn_prev = mn_now;
...@@ -3158,7 +3241,7 @@ clear_pending (EV_P_ W w) ...@@ -3158,7 +3241,7 @@ clear_pending (EV_P_ W w)
} }
int int
ev_clear_pending (EV_P_ void *w) ev_clear_pending (EV_P_ void *w) EV_THROW
{ {
W w_ = (W)w; W w_ = (W)w;
int pending = w_->pending; int pending = w_->pending;
...@@ -3201,7 +3284,7 @@ ev_stop (EV_P_ W w) ...@@ -3201,7 +3284,7 @@ ev_stop (EV_P_ W w)
/*****************************************************************************/ /*****************************************************************************/
void noinline void noinline
ev_io_start (EV_P_ ev_io *w) ev_io_start (EV_P_ ev_io *w) EV_THROW
{ {
int fd = w->fd; int fd = w->fd;
...@@ -3217,6 +3300,9 @@ ev_io_start (EV_P_ ev_io *w) ...@@ -3217,6 +3300,9 @@ ev_io_start (EV_P_ ev_io *w)
array_needsize (ANFD, anfds, anfdmax, fd + 1, array_init_zero); array_needsize (ANFD, anfds, anfdmax, fd + 1, array_init_zero);
wlist_add (&anfds[fd].head, (WL)w); wlist_add (&anfds[fd].head, (WL)w);
/* common bug, apparently */
assert (("libev: ev_io_start called with corrupted watcher", ((WL)w)->next != (WL)w));
fd_change (EV_A_ fd, w->events & EV__IOFDSET | EV_ANFD_REIFY); fd_change (EV_A_ fd, w->events & EV__IOFDSET | EV_ANFD_REIFY);
w->events &= ~EV__IOFDSET; w->events &= ~EV__IOFDSET;
...@@ -3224,7 +3310,7 @@ ev_io_start (EV_P_ ev_io *w) ...@@ -3224,7 +3310,7 @@ ev_io_start (EV_P_ ev_io *w)
} }
void noinline void noinline
ev_io_stop (EV_P_ ev_io *w) ev_io_stop (EV_P_ ev_io *w) EV_THROW
{ {
clear_pending (EV_A_ (W)w); clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w))) if (expect_false (!ev_is_active (w)))
...@@ -3243,7 +3329,7 @@ ev_io_stop (EV_P_ ev_io *w) ...@@ -3243,7 +3329,7 @@ ev_io_stop (EV_P_ ev_io *w)
} }
void noinline void noinline
ev_timer_start (EV_P_ ev_timer *w) ev_timer_start (EV_P_ ev_timer *w) EV_THROW
{ {
if (expect_false (ev_is_active (w))) if (expect_false (ev_is_active (w)))
return; return;
...@@ -3267,7 +3353,7 @@ ev_timer_start (EV_P_ ev_timer *w) ...@@ -3267,7 +3353,7 @@ ev_timer_start (EV_P_ ev_timer *w)
} }
void noinline void noinline
ev_timer_stop (EV_P_ ev_timer *w) ev_timer_stop (EV_P_ ev_timer *w) EV_THROW
{ {
clear_pending (EV_A_ (W)w); clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w))) if (expect_false (!ev_is_active (w)))
...@@ -3297,10 +3383,12 @@ ev_timer_stop (EV_P_ ev_timer *w) ...@@ -3297,10 +3383,12 @@ ev_timer_stop (EV_P_ ev_timer *w)
} }
void noinline void noinline
ev_timer_again (EV_P_ ev_timer *w) ev_timer_again (EV_P_ ev_timer *w) EV_THROW
{ {
EV_FREQUENT_CHECK; EV_FREQUENT_CHECK;
clear_pending (EV_A_ (W)w);
if (ev_is_active (w)) if (ev_is_active (w))
{ {
if (w->repeat) if (w->repeat)
...@@ -3322,14 +3410,14 @@ ev_timer_again (EV_P_ ev_timer *w) ...@@ -3322,14 +3410,14 @@ ev_timer_again (EV_P_ ev_timer *w)
} }
ev_tstamp ev_tstamp
ev_timer_remaining (EV_P_ ev_timer *w) ev_timer_remaining (EV_P_ ev_timer *w) EV_THROW
{ {
return ev_at (w) - (ev_is_active (w) ? mn_now : 0.); return ev_at (w) - (ev_is_active (w) ? mn_now : 0.);
} }
#if EV_PERIODIC_ENABLE #if EV_PERIODIC_ENABLE
void noinline void noinline
ev_periodic_start (EV_P_ ev_periodic *w) ev_periodic_start (EV_P_ ev_periodic *w) EV_THROW
{ {
if (expect_false (ev_is_active (w))) if (expect_false (ev_is_active (w)))
return; return;
...@@ -3359,7 +3447,7 @@ ev_periodic_start (EV_P_ ev_periodic *w) ...@@ -3359,7 +3447,7 @@ ev_periodic_start (EV_P_ ev_periodic *w)
} }
void noinline void noinline
ev_periodic_stop (EV_P_ ev_periodic *w) ev_periodic_stop (EV_P_ ev_periodic *w) EV_THROW
{ {
clear_pending (EV_A_ (W)w); clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w))) if (expect_false (!ev_is_active (w)))
...@@ -3387,7 +3475,7 @@ ev_periodic_stop (EV_P_ ev_periodic *w) ...@@ -3387,7 +3475,7 @@ ev_periodic_stop (EV_P_ ev_periodic *w)
} }
void noinline void noinline
ev_periodic_again (EV_P_ ev_periodic *w) ev_periodic_again (EV_P_ ev_periodic *w) EV_THROW
{ {
/* TODO: use adjustheap and recalculation */ /* TODO: use adjustheap and recalculation */
ev_periodic_stop (EV_A_ w); ev_periodic_stop (EV_A_ w);
...@@ -3402,7 +3490,7 @@ ev_periodic_again (EV_P_ ev_periodic *w) ...@@ -3402,7 +3490,7 @@ ev_periodic_again (EV_P_ ev_periodic *w)
#if EV_SIGNAL_ENABLE #if EV_SIGNAL_ENABLE
void noinline void noinline
ev_signal_start (EV_P_ ev_signal *w) ev_signal_start (EV_P_ ev_signal *w) EV_THROW
{ {
if (expect_false (ev_is_active (w))) if (expect_false (ev_is_active (w)))
return; return;
...@@ -3483,7 +3571,7 @@ ev_signal_start (EV_P_ ev_signal *w) ...@@ -3483,7 +3571,7 @@ ev_signal_start (EV_P_ ev_signal *w)
} }
void noinline void noinline
ev_signal_stop (EV_P_ ev_signal *w) ev_signal_stop (EV_P_ ev_signal *w) EV_THROW
{ {
clear_pending (EV_A_ (W)w); clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w))) if (expect_false (!ev_is_active (w)))
...@@ -3524,7 +3612,7 @@ ev_signal_stop (EV_P_ ev_signal *w) ...@@ -3524,7 +3612,7 @@ ev_signal_stop (EV_P_ ev_signal *w)
#if EV_CHILD_ENABLE #if EV_CHILD_ENABLE
void void
ev_child_start (EV_P_ ev_child *w) ev_child_start (EV_P_ ev_child *w) EV_THROW
{ {
#if EV_MULTIPLICITY #if EV_MULTIPLICITY
assert (("libev: child watchers are only supported in the default loop", loop == ev_default_loop_ptr)); assert (("libev: child watchers are only supported in the default loop", loop == ev_default_loop_ptr));
...@@ -3539,6 +3627,13 @@ ev_child_start (EV_P_ ev_child *w) ...@@ -3539,6 +3627,13 @@ ev_child_start (EV_P_ ev_child *w)
ev_start (EV_A_ (W)w, 1); ev_start (EV_A_ (W)w, 1);
wlist_add (&childs [w->pid & ((EV_PID_HASHSIZE) - 1)], (WL)w); wlist_add (&childs [w->pid & ((EV_PID_HASHSIZE) - 1)], (WL)w);
if (!ev_is_active(&childev))
{
ev_signal_start (EV_A_ &childev);
ev_unref (EV_A); /* child watcher should not keep loop alive */
ev_feed_event (EV_A_ (W)&childev, EV_SIGNAL);
}
if (!ev_is_active (&childpollev)) if (!ev_is_active (&childpollev))
{ {
ev_timer_start (EV_A_ &childpollev); ev_timer_start (EV_A_ &childpollev);
...@@ -3549,7 +3644,7 @@ ev_child_start (EV_P_ ev_child *w) ...@@ -3549,7 +3644,7 @@ ev_child_start (EV_P_ ev_child *w)
} }
void void
ev_child_stop (EV_P_ ev_child *w) ev_child_stop (EV_P_ ev_child *w) EV_THROW
{ {
clear_pending (EV_A_ (W)w); clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w))) if (expect_false (!ev_is_active (w)))
...@@ -3732,7 +3827,7 @@ ev_check_2625 (EV_P) ...@@ -3732,7 +3827,7 @@ ev_check_2625 (EV_P)
inline_size int inline_size int
infy_newfd (void) infy_newfd (void)
{ {
#if defined (IN_CLOEXEC) && defined (IN_NONBLOCK) #if defined IN_CLOEXEC && defined IN_NONBLOCK
int fd = inotify_init1 (IN_CLOEXEC | IN_NONBLOCK); int fd = inotify_init1 (IN_CLOEXEC | IN_NONBLOCK);
if (fd >= 0) if (fd >= 0)
return fd; return fd;
...@@ -3817,7 +3912,7 @@ infy_fork (EV_P) ...@@ -3817,7 +3912,7 @@ infy_fork (EV_P)
#endif #endif
void void
ev_stat_stat (EV_P_ ev_stat *w) ev_stat_stat (EV_P_ ev_stat *w) EV_THROW
{ {
if (lstat (w->path, &w->attr) < 0) if (lstat (w->path, &w->attr) < 0)
w->attr.st_nlink = 0; w->attr.st_nlink = 0;
...@@ -3866,7 +3961,7 @@ stat_timer_cb (EV_P_ ev_timer *w_, int revents) ...@@ -3866,7 +3961,7 @@ stat_timer_cb (EV_P_ ev_timer *w_, int revents)
} }
void void
ev_stat_start (EV_P_ ev_stat *w) ev_stat_start (EV_P_ ev_stat *w) EV_THROW
{ {
if (expect_false (ev_is_active (w))) if (expect_false (ev_is_active (w)))
return; return;
...@@ -3897,7 +3992,7 @@ ev_stat_start (EV_P_ ev_stat *w) ...@@ -3897,7 +3992,7 @@ ev_stat_start (EV_P_ ev_stat *w)
} }
void void
ev_stat_stop (EV_P_ ev_stat *w) ev_stat_stop (EV_P_ ev_stat *w) EV_THROW
{ {
clear_pending (EV_A_ (W)w); clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w))) if (expect_false (!ev_is_active (w)))
...@@ -3923,7 +4018,7 @@ ev_stat_stop (EV_P_ ev_stat *w) ...@@ -3923,7 +4018,7 @@ ev_stat_stop (EV_P_ ev_stat *w)
#if EV_IDLE_ENABLE #if EV_IDLE_ENABLE
void void
ev_idle_start (EV_P_ ev_idle *w) ev_idle_start (EV_P_ ev_idle *w) EV_THROW
{ {
if (expect_false (ev_is_active (w))) if (expect_false (ev_is_active (w)))
return; return;
...@@ -3946,7 +4041,7 @@ ev_idle_start (EV_P_ ev_idle *w) ...@@ -3946,7 +4041,7 @@ ev_idle_start (EV_P_ ev_idle *w)
} }
void void
ev_idle_stop (EV_P_ ev_idle *w) ev_idle_stop (EV_P_ ev_idle *w) EV_THROW
{ {
clear_pending (EV_A_ (W)w); clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w))) if (expect_false (!ev_is_active (w)))
...@@ -3970,7 +4065,7 @@ ev_idle_stop (EV_P_ ev_idle *w) ...@@ -3970,7 +4065,7 @@ ev_idle_stop (EV_P_ ev_idle *w)
#if EV_PREPARE_ENABLE #if EV_PREPARE_ENABLE
void void
ev_prepare_start (EV_P_ ev_prepare *w) ev_prepare_start (EV_P_ ev_prepare *w) EV_THROW
{ {
if (expect_false (ev_is_active (w))) if (expect_false (ev_is_active (w)))
return; return;
...@@ -3985,7 +4080,7 @@ ev_prepare_start (EV_P_ ev_prepare *w) ...@@ -3985,7 +4080,7 @@ ev_prepare_start (EV_P_ ev_prepare *w)
} }
void void
ev_prepare_stop (EV_P_ ev_prepare *w) ev_prepare_stop (EV_P_ ev_prepare *w) EV_THROW
{ {
clear_pending (EV_A_ (W)w); clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w))) if (expect_false (!ev_is_active (w)))
...@@ -4008,7 +4103,7 @@ ev_prepare_stop (EV_P_ ev_prepare *w) ...@@ -4008,7 +4103,7 @@ ev_prepare_stop (EV_P_ ev_prepare *w)
#if EV_CHECK_ENABLE #if EV_CHECK_ENABLE
void void
ev_check_start (EV_P_ ev_check *w) ev_check_start (EV_P_ ev_check *w) EV_THROW
{ {
if (expect_false (ev_is_active (w))) if (expect_false (ev_is_active (w)))
return; return;
...@@ -4023,7 +4118,7 @@ ev_check_start (EV_P_ ev_check *w) ...@@ -4023,7 +4118,7 @@ ev_check_start (EV_P_ ev_check *w)
} }
void void
ev_check_stop (EV_P_ ev_check *w) ev_check_stop (EV_P_ ev_check *w) EV_THROW
{ {
clear_pending (EV_A_ (W)w); clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w))) if (expect_false (!ev_is_active (w)))
...@@ -4046,7 +4141,7 @@ ev_check_stop (EV_P_ ev_check *w) ...@@ -4046,7 +4141,7 @@ ev_check_stop (EV_P_ ev_check *w)
#if EV_EMBED_ENABLE #if EV_EMBED_ENABLE
void noinline void noinline
ev_embed_sweep (EV_P_ ev_embed *w) ev_embed_sweep (EV_P_ ev_embed *w) EV_THROW
{ {
ev_run (w->other, EVRUN_NOWAIT); ev_run (w->other, EVRUN_NOWAIT);
} }
...@@ -4104,7 +4199,7 @@ embed_idle_cb (EV_P_ ev_idle *idle, int revents) ...@@ -4104,7 +4199,7 @@ embed_idle_cb (EV_P_ ev_idle *idle, int revents)
#endif #endif
void void
ev_embed_start (EV_P_ ev_embed *w) ev_embed_start (EV_P_ ev_embed *w) EV_THROW
{ {
if (expect_false (ev_is_active (w))) if (expect_false (ev_is_active (w)))
return; return;
...@@ -4135,7 +4230,7 @@ ev_embed_start (EV_P_ ev_embed *w) ...@@ -4135,7 +4230,7 @@ ev_embed_start (EV_P_ ev_embed *w)
} }
void void
ev_embed_stop (EV_P_ ev_embed *w) ev_embed_stop (EV_P_ ev_embed *w) EV_THROW
{ {
clear_pending (EV_A_ (W)w); clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w))) if (expect_false (!ev_is_active (w)))
...@@ -4155,7 +4250,7 @@ ev_embed_stop (EV_P_ ev_embed *w) ...@@ -4155,7 +4250,7 @@ ev_embed_stop (EV_P_ ev_embed *w)
#if EV_FORK_ENABLE #if EV_FORK_ENABLE
void void
ev_fork_start (EV_P_ ev_fork *w) ev_fork_start (EV_P_ ev_fork *w) EV_THROW
{ {
if (expect_false (ev_is_active (w))) if (expect_false (ev_is_active (w)))
return; return;
...@@ -4170,7 +4265,7 @@ ev_fork_start (EV_P_ ev_fork *w) ...@@ -4170,7 +4265,7 @@ ev_fork_start (EV_P_ ev_fork *w)
} }
void void
ev_fork_stop (EV_P_ ev_fork *w) ev_fork_stop (EV_P_ ev_fork *w) EV_THROW
{ {
clear_pending (EV_A_ (W)w); clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w))) if (expect_false (!ev_is_active (w)))
...@@ -4193,7 +4288,7 @@ ev_fork_stop (EV_P_ ev_fork *w) ...@@ -4193,7 +4288,7 @@ ev_fork_stop (EV_P_ ev_fork *w)
#if EV_CLEANUP_ENABLE #if EV_CLEANUP_ENABLE
void void
ev_cleanup_start (EV_P_ ev_cleanup *w) ev_cleanup_start (EV_P_ ev_cleanup *w) EV_THROW
{ {
if (expect_false (ev_is_active (w))) if (expect_false (ev_is_active (w)))
return; return;
...@@ -4210,7 +4305,7 @@ ev_cleanup_start (EV_P_ ev_cleanup *w) ...@@ -4210,7 +4305,7 @@ ev_cleanup_start (EV_P_ ev_cleanup *w)
} }
void void
ev_cleanup_stop (EV_P_ ev_cleanup *w) ev_cleanup_stop (EV_P_ ev_cleanup *w) EV_THROW
{ {
clear_pending (EV_A_ (W)w); clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w))) if (expect_false (!ev_is_active (w)))
...@@ -4234,7 +4329,7 @@ ev_cleanup_stop (EV_P_ ev_cleanup *w) ...@@ -4234,7 +4329,7 @@ ev_cleanup_stop (EV_P_ ev_cleanup *w)
#if EV_ASYNC_ENABLE #if EV_ASYNC_ENABLE
void void
ev_async_start (EV_P_ ev_async *w) ev_async_start (EV_P_ ev_async *w) EV_THROW
{ {
if (expect_false (ev_is_active (w))) if (expect_false (ev_is_active (w)))
return; return;
...@@ -4253,7 +4348,7 @@ ev_async_start (EV_P_ ev_async *w) ...@@ -4253,7 +4348,7 @@ ev_async_start (EV_P_ ev_async *w)
} }
void void
ev_async_stop (EV_P_ ev_async *w) ev_async_stop (EV_P_ ev_async *w) EV_THROW
{ {
clear_pending (EV_A_ (W)w); clear_pending (EV_A_ (W)w);
if (expect_false (!ev_is_active (w))) if (expect_false (!ev_is_active (w)))
...@@ -4274,7 +4369,7 @@ ev_async_stop (EV_P_ ev_async *w) ...@@ -4274,7 +4369,7 @@ ev_async_stop (EV_P_ ev_async *w)
} }
void void
ev_async_send (EV_P_ ev_async *w) ev_async_send (EV_P_ ev_async *w) EV_THROW
{ {
w->sent = 1; w->sent = 1;
evpipe_write (EV_A_ &async_pending); evpipe_write (EV_A_ &async_pending);
...@@ -4321,7 +4416,7 @@ once_cb_to (EV_P_ ev_timer *w, int revents) ...@@ -4321,7 +4416,7 @@ once_cb_to (EV_P_ ev_timer *w, int revents)
} }
void void
ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg) ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg) EV_THROW
{ {
struct ev_once *once = (struct ev_once *)ev_malloc (sizeof (struct ev_once)); struct ev_once *once = (struct ev_once *)ev_malloc (sizeof (struct ev_once));
...@@ -4353,7 +4448,7 @@ ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, vo ...@@ -4353,7 +4448,7 @@ ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, vo
#if EV_WALK_ENABLE #if EV_WALK_ENABLE
void ecb_cold void ecb_cold
ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w)) ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w)) EV_THROW
{ {
int i, j; int i, j;
ev_watcher_list *wl, *wn; ev_watcher_list *wl, *wn;
......
/* /*
* libev native API header * libev native API header
* *
* Copyright (c) 2007,2008,2009,2010,2011 Marc Alexander Lehmann <libev@schmorp.de> * Copyright (c) 2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann <libev@schmorp.de>
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modifica- * Redistribution and use in source and binary forms, with or without modifica-
...@@ -46,6 +46,8 @@ ...@@ -46,6 +46,8 @@
# define EV_CPP(x) # define EV_CPP(x)
#endif #endif
#define EV_THROW EV_CPP(throw())
EV_CPP(extern "C" {) EV_CPP(extern "C" {)
/*****************************************************************************/ /*****************************************************************************/
...@@ -56,7 +58,11 @@ EV_CPP(extern "C" {) ...@@ -56,7 +58,11 @@ EV_CPP(extern "C" {)
#endif #endif
#ifndef EV_FEATURES #ifndef EV_FEATURES
# define EV_FEATURES 0x7f # if defined __OPTIMIZE_SIZE__
# define EV_FEATURES 0x7c
# else
# define EV_FEATURES 0x7f
# endif
#endif #endif
#define EV_FEATURE_CODE ((EV_FEATURES) & 1) #define EV_FEATURE_CODE ((EV_FEATURES) & 1)
...@@ -185,6 +191,12 @@ struct ev_loop; ...@@ -185,6 +191,12 @@ struct ev_loop;
# define EV_INLINE static # define EV_INLINE static
#endif #endif
#ifdef EV_API_STATIC
# define EV_API_DECL static
#else
# define EV_API_DECL extern
#endif
/* EV_PROTOTYPES can be used to switch of prototype declarations */ /* EV_PROTOTYPES can be used to switch of prototype declarations */
#ifndef EV_PROTOTYPES #ifndef EV_PROTOTYPES
# define EV_PROTOTYPES 1 # define EV_PROTOTYPES 1
...@@ -193,7 +205,7 @@ struct ev_loop; ...@@ -193,7 +205,7 @@ struct ev_loop;
/*****************************************************************************/ /*****************************************************************************/
#define EV_VERSION_MAJOR 4 #define EV_VERSION_MAJOR 4
#define EV_VERSION_MINOR 4 #define EV_VERSION_MINOR 11
/* eventmask, revents, events... */ /* eventmask, revents, events... */
enum { enum {
...@@ -321,7 +333,7 @@ typedef struct ev_periodic ...@@ -321,7 +333,7 @@ typedef struct ev_periodic
ev_tstamp offset; /* rw */ ev_tstamp offset; /* rw */
ev_tstamp interval; /* rw */ ev_tstamp interval; /* rw */
ev_tstamp (*reschedule_cb)(struct ev_periodic *w, ev_tstamp now); /* rw */ ev_tstamp (*reschedule_cb)(struct ev_periodic *w, ev_tstamp now) EV_THROW; /* rw */
} ev_periodic; } ev_periodic;
/* invoked when the given signal has been received */ /* invoked when the given signal has been received */
...@@ -508,15 +520,15 @@ enum { ...@@ -508,15 +520,15 @@ enum {
}; };
#if EV_PROTOTYPES #if EV_PROTOTYPES
int ev_version_major (void); EV_API_DECL int ev_version_major (void) EV_THROW;
int ev_version_minor (void); EV_API_DECL int ev_version_minor (void) EV_THROW;
unsigned int ev_supported_backends (void); EV_API_DECL unsigned int ev_supported_backends (void) EV_THROW;
unsigned int ev_recommended_backends (void); EV_API_DECL unsigned int ev_recommended_backends (void) EV_THROW;
unsigned int ev_embeddable_backends (void); EV_API_DECL unsigned int ev_embeddable_backends (void) EV_THROW;
ev_tstamp ev_time (void); EV_API_DECL ev_tstamp ev_time (void) EV_THROW;
void ev_sleep (ev_tstamp delay); /* sleep for a while */ EV_API_DECL void ev_sleep (ev_tstamp delay) EV_THROW; /* sleep for a while */
/* Sets the allocation function to use, works like realloc. /* Sets the allocation function to use, works like realloc.
* It is used to allocate and free memory. * It is used to allocate and free memory.
...@@ -524,22 +536,26 @@ void ev_sleep (ev_tstamp delay); /* sleep for a while */ ...@@ -524,22 +536,26 @@ void ev_sleep (ev_tstamp delay); /* sleep for a while */
* or take some potentially destructive action. * or take some potentially destructive action.
* The default is your system realloc function. * The default is your system realloc function.
*/ */
void ev_set_allocator (void *(*cb)(void *ptr, long size)); EV_API_DECL void ev_set_allocator (void *(*cb)(void *ptr, long size) EV_THROW) EV_THROW;
/* set the callback function to call on a /* set the callback function to call on a
* retryable syscall error * retryable syscall error
* (such as failed select, poll, epoll_wait) * (such as failed select, poll, epoll_wait)
*/ */
void ev_set_syserr_cb (void (*cb)(const char *msg)); EV_API_DECL void ev_set_syserr_cb (void (*cb)(const char *msg) EV_THROW) EV_THROW;
#if EV_MULTIPLICITY #if EV_MULTIPLICITY
/* the default loop is the only one that handles signals and child watchers */ /* the default loop is the only one that handles signals and child watchers */
/* you can call this as often as you like */ /* you can call this as often as you like */
struct ev_loop *ev_default_loop (unsigned int flags EV_CPP (= 0)); EV_API_DECL struct ev_loop *ev_default_loop (unsigned int flags EV_CPP (= 0)) EV_THROW;
#ifdef EV_API_STATIC
EV_API_DECL struct ev_loop *ev_default_loop_ptr;
#endif
EV_INLINE struct ev_loop * EV_INLINE struct ev_loop *
ev_default_loop_uc_ (void) ev_default_loop_uc_ (void) EV_THROW
{ {
extern struct ev_loop *ev_default_loop_ptr; extern struct ev_loop *ev_default_loop_ptr;
...@@ -547,31 +563,31 @@ ev_default_loop_uc_ (void) ...@@ -547,31 +563,31 @@ ev_default_loop_uc_ (void)
} }
EV_INLINE int EV_INLINE int
ev_is_default_loop (EV_P) ev_is_default_loop (EV_P) EV_THROW
{ {
return EV_A == EV_DEFAULT_UC; return EV_A == EV_DEFAULT_UC;
} }
/* create and destroy alternative loops that don't handle signals */ /* create and destroy alternative loops that don't handle signals */
struct ev_loop *ev_loop_new (unsigned int flags EV_CPP (= 0)); EV_API_DECL struct ev_loop *ev_loop_new (unsigned int flags EV_CPP (= 0)) EV_THROW;
ev_tstamp ev_now (EV_P); /* time w.r.t. timers and the eventloop, updated after each poll */ EV_API_DECL ev_tstamp ev_now (EV_P) EV_THROW; /* time w.r.t. timers and the eventloop, updated after each poll */
#else #else
int ev_default_loop (unsigned int flags EV_CPP (= 0)); /* returns true when successful */ EV_API_DECL int ev_default_loop (unsigned int flags EV_CPP (= 0)) EV_THROW; /* returns true when successful */
EV_API_DECL ev_tstamp ev_rt_now;
EV_INLINE ev_tstamp EV_INLINE ev_tstamp
ev_now (void) ev_now (void) EV_THROW
{ {
extern ev_tstamp ev_rt_now;
return ev_rt_now; return ev_rt_now;
} }
/* looks weird, but ev_is_default_loop (EV_A) still works if this exists */ /* looks weird, but ev_is_default_loop (EV_A) still works if this exists */
EV_INLINE int EV_INLINE int
ev_is_default_loop (void) ev_is_default_loop (void) EV_THROW
{ {
return 1; return 1;
} }
...@@ -579,23 +595,23 @@ ev_is_default_loop (void) ...@@ -579,23 +595,23 @@ ev_is_default_loop (void)
#endif /* multiplicity */ #endif /* multiplicity */
/* destroy event loops, also works for the default loop */ /* destroy event loops, also works for the default loop */
void ev_loop_destroy (EV_P); EV_API_DECL void ev_loop_destroy (EV_P);
/* this needs to be called after fork, to duplicate the loop */ /* this needs to be called after fork, to duplicate the loop */
/* when you want to re-use it in the child */ /* when you want to re-use it in the child */
/* you can call it in either the parent or the child */ /* you can call it in either the parent or the child */
/* you can actually call it at any time, anywhere :) */ /* you can actually call it at any time, anywhere :) */
void ev_loop_fork (EV_P); EV_API_DECL void ev_loop_fork (EV_P) EV_THROW;
unsigned int ev_backend (EV_P); /* backend in use by loop */ EV_API_DECL unsigned int ev_backend (EV_P) EV_THROW; /* backend in use by loop */
void ev_now_update (EV_P); /* update event loop time */ EV_API_DECL void ev_now_update (EV_P) EV_THROW; /* update event loop time */
#if EV_WALK_ENABLE #if EV_WALK_ENABLE
/* walk (almost) all watchers in the loop of a given type, invoking the */ /* walk (almost) all watchers in the loop of a given type, invoking the */
/* callback on every such watcher. The callback might stop the watcher, */ /* callback on every such watcher. The callback might stop the watcher, */
/* but do nothing else with the loop */ /* but do nothing else with the loop */
void ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w)); EV_API_DECL void ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w)) EV_THROW;
#endif #endif
#endif /* prototypes */ #endif /* prototypes */
...@@ -614,45 +630,45 @@ enum { ...@@ -614,45 +630,45 @@ enum {
}; };
#if EV_PROTOTYPES #if EV_PROTOTYPES
void ev_run (EV_P_ int flags EV_CPP (= 0)); EV_API_DECL int ev_run (EV_P_ int flags EV_CPP (= 0));
void ev_break (EV_P_ int how EV_CPP (= EVBREAK_ONE)); /* break out of the loop */ EV_API_DECL void ev_break (EV_P_ int how EV_CPP (= EVBREAK_ONE)) EV_THROW; /* break out of the loop */
/* /*
* ref/unref can be used to add or remove a refcount on the mainloop. every watcher * ref/unref can be used to add or remove a refcount on the mainloop. every watcher
* keeps one reference. if you have a long-running watcher you never unregister that * keeps one reference. if you have a long-running watcher you never unregister that
* should not keep ev_loop from running, unref() after starting, and ref() before stopping. * should not keep ev_loop from running, unref() after starting, and ref() before stopping.
*/ */
void ev_ref (EV_P); EV_API_DECL void ev_ref (EV_P) EV_THROW;
void ev_unref (EV_P); EV_API_DECL void ev_unref (EV_P) EV_THROW;
/* /*
* convenience function, wait for a single event, without registering an event watcher * convenience function, wait for a single event, without registering an event watcher
* if timeout is < 0, do wait indefinitely * if timeout is < 0, do wait indefinitely
*/ */
void ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg); EV_API_DECL void ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg) EV_THROW;
# if EV_FEATURE_API # if EV_FEATURE_API
unsigned int ev_iteration (EV_P); /* number of loop iterations */ EV_API_DECL unsigned int ev_iteration (EV_P) EV_THROW; /* number of loop iterations */
unsigned int ev_depth (EV_P); /* #ev_loop enters - #ev_loop leaves */ EV_API_DECL unsigned int ev_depth (EV_P) EV_THROW; /* #ev_loop enters - #ev_loop leaves */
void ev_verify (EV_P); /* abort if loop data corrupted */ EV_API_DECL void ev_verify (EV_P) EV_THROW; /* abort if loop data corrupted */
void ev_set_io_collect_interval (EV_P_ ev_tstamp interval); /* sleep at least this time, default 0 */ EV_API_DECL void ev_set_io_collect_interval (EV_P_ ev_tstamp interval) EV_THROW; /* sleep at least this time, default 0 */
void ev_set_timeout_collect_interval (EV_P_ ev_tstamp interval); /* sleep at least this time, default 0 */ EV_API_DECL void ev_set_timeout_collect_interval (EV_P_ ev_tstamp interval) EV_THROW; /* sleep at least this time, default 0 */
/* advanced stuff for threading etc. support, see docs */ /* advanced stuff for threading etc. support, see docs */
void ev_set_userdata (EV_P_ void *data); EV_API_DECL void ev_set_userdata (EV_P_ void *data) EV_THROW;
void *ev_userdata (EV_P); EV_API_DECL void *ev_userdata (EV_P) EV_THROW;
void ev_set_invoke_pending_cb (EV_P_ void (*invoke_pending_cb)(EV_P)); EV_API_DECL void ev_set_invoke_pending_cb (EV_P_ void (*invoke_pending_cb)(EV_P)) EV_THROW;
void ev_set_loop_release_cb (EV_P_ void (*release)(EV_P), void (*acquire)(EV_P)); EV_API_DECL void ev_set_loop_release_cb (EV_P_ void (*release)(EV_P), void (*acquire)(EV_P) EV_THROW) EV_THROW;
unsigned int ev_pending_count (EV_P); /* number of pending events, if any */ EV_API_DECL unsigned int ev_pending_count (EV_P) EV_THROW; /* number of pending events, if any */
void ev_invoke_pending (EV_P); /* invoke all pending watchers */ EV_API_DECL void ev_invoke_pending (EV_P); /* invoke all pending watchers */
/* /*
* stop/start the timer handling. * stop/start the timer handling.
*/ */
void ev_suspend (EV_P); EV_API_DECL void ev_suspend (EV_P) EV_THROW;
void ev_resume (EV_P); EV_API_DECL void ev_resume (EV_P) EV_THROW;
#endif #endif
#endif #endif
...@@ -719,85 +735,85 @@ void ev_resume (EV_P); ...@@ -719,85 +735,85 @@ void ev_resume (EV_P);
/* feeds an event into a watcher as if the event actually occurred */ /* feeds an event into a watcher as if the event actually occurred */
/* accepts any ev_watcher type */ /* accepts any ev_watcher type */
void ev_feed_event (EV_P_ void *w, int revents); EV_API_DECL void ev_feed_event (EV_P_ void *w, int revents) EV_THROW;
void ev_feed_fd_event (EV_P_ int fd, int revents); EV_API_DECL void ev_feed_fd_event (EV_P_ int fd, int revents) EV_THROW;
#if EV_SIGNAL_ENABLE #if EV_SIGNAL_ENABLE
void ev_feed_signal (int signum); EV_API_DECL void ev_feed_signal (int signum) EV_THROW;
void ev_feed_signal_event (EV_P_ int signum); EV_API_DECL void ev_feed_signal_event (EV_P_ int signum) EV_THROW;
#endif #endif
void ev_invoke (EV_P_ void *w, int revents); EV_API_DECL void ev_invoke (EV_P_ void *w, int revents);
int ev_clear_pending (EV_P_ void *w); EV_API_DECL int ev_clear_pending (EV_P_ void *w) EV_THROW;
void ev_io_start (EV_P_ ev_io *w); EV_API_DECL void ev_io_start (EV_P_ ev_io *w) EV_THROW;
void ev_io_stop (EV_P_ ev_io *w); EV_API_DECL void ev_io_stop (EV_P_ ev_io *w) EV_THROW;
void ev_timer_start (EV_P_ ev_timer *w); EV_API_DECL void ev_timer_start (EV_P_ ev_timer *w) EV_THROW;
void ev_timer_stop (EV_P_ ev_timer *w); EV_API_DECL void ev_timer_stop (EV_P_ ev_timer *w) EV_THROW;
/* stops if active and no repeat, restarts if active and repeating, starts if inactive and repeating */ /* stops if active and no repeat, restarts if active and repeating, starts if inactive and repeating */
void ev_timer_again (EV_P_ ev_timer *w); EV_API_DECL void ev_timer_again (EV_P_ ev_timer *w) EV_THROW;
/* return remaining time */ /* return remaining time */
ev_tstamp ev_timer_remaining (EV_P_ ev_timer *w); EV_API_DECL ev_tstamp ev_timer_remaining (EV_P_ ev_timer *w) EV_THROW;
#if EV_PERIODIC_ENABLE #if EV_PERIODIC_ENABLE
void ev_periodic_start (EV_P_ ev_periodic *w); EV_API_DECL void ev_periodic_start (EV_P_ ev_periodic *w) EV_THROW;
void ev_periodic_stop (EV_P_ ev_periodic *w); EV_API_DECL void ev_periodic_stop (EV_P_ ev_periodic *w) EV_THROW;
void ev_periodic_again (EV_P_ ev_periodic *w); EV_API_DECL void ev_periodic_again (EV_P_ ev_periodic *w) EV_THROW;
#endif #endif
/* only supported in the default loop */ /* only supported in the default loop */
#if EV_SIGNAL_ENABLE #if EV_SIGNAL_ENABLE
void ev_signal_start (EV_P_ ev_signal *w); EV_API_DECL void ev_signal_start (EV_P_ ev_signal *w) EV_THROW;
void ev_signal_stop (EV_P_ ev_signal *w); EV_API_DECL void ev_signal_stop (EV_P_ ev_signal *w) EV_THROW;
#endif #endif
/* only supported in the default loop */ /* only supported in the default loop */
# if EV_CHILD_ENABLE # if EV_CHILD_ENABLE
void ev_child_start (EV_P_ ev_child *w); EV_API_DECL void ev_child_start (EV_P_ ev_child *w) EV_THROW;
void ev_child_stop (EV_P_ ev_child *w); EV_API_DECL void ev_child_stop (EV_P_ ev_child *w) EV_THROW;
# endif # endif
# if EV_STAT_ENABLE # if EV_STAT_ENABLE
void ev_stat_start (EV_P_ ev_stat *w); EV_API_DECL void ev_stat_start (EV_P_ ev_stat *w) EV_THROW;
void ev_stat_stop (EV_P_ ev_stat *w); EV_API_DECL void ev_stat_stop (EV_P_ ev_stat *w) EV_THROW;
void ev_stat_stat (EV_P_ ev_stat *w); EV_API_DECL void ev_stat_stat (EV_P_ ev_stat *w) EV_THROW;
# endif # endif
# if EV_IDLE_ENABLE # if EV_IDLE_ENABLE
void ev_idle_start (EV_P_ ev_idle *w); EV_API_DECL void ev_idle_start (EV_P_ ev_idle *w) EV_THROW;
void ev_idle_stop (EV_P_ ev_idle *w); EV_API_DECL void ev_idle_stop (EV_P_ ev_idle *w) EV_THROW;
# endif # endif
#if EV_PREPARE_ENABLE #if EV_PREPARE_ENABLE
void ev_prepare_start (EV_P_ ev_prepare *w); EV_API_DECL void ev_prepare_start (EV_P_ ev_prepare *w) EV_THROW;
void ev_prepare_stop (EV_P_ ev_prepare *w); EV_API_DECL void ev_prepare_stop (EV_P_ ev_prepare *w) EV_THROW;
#endif #endif
#if EV_CHECK_ENABLE #if EV_CHECK_ENABLE
void ev_check_start (EV_P_ ev_check *w); EV_API_DECL void ev_check_start (EV_P_ ev_check *w) EV_THROW;
void ev_check_stop (EV_P_ ev_check *w); EV_API_DECL void ev_check_stop (EV_P_ ev_check *w) EV_THROW;
#endif #endif
# if EV_FORK_ENABLE # if EV_FORK_ENABLE
void ev_fork_start (EV_P_ ev_fork *w); EV_API_DECL void ev_fork_start (EV_P_ ev_fork *w) EV_THROW;
void ev_fork_stop (EV_P_ ev_fork *w); EV_API_DECL void ev_fork_stop (EV_P_ ev_fork *w) EV_THROW;
# endif # endif
# if EV_CLEANUP_ENABLE # if EV_CLEANUP_ENABLE
void ev_cleanup_start (EV_P_ ev_cleanup *w); EV_API_DECL void ev_cleanup_start (EV_P_ ev_cleanup *w) EV_THROW;
void ev_cleanup_stop (EV_P_ ev_cleanup *w); EV_API_DECL void ev_cleanup_stop (EV_P_ ev_cleanup *w) EV_THROW;
# endif # endif
# if EV_EMBED_ENABLE # if EV_EMBED_ENABLE
/* only supported when loop to be embedded is in fact embeddable */ /* only supported when loop to be embedded is in fact embeddable */
void ev_embed_start (EV_P_ ev_embed *w); EV_API_DECL void ev_embed_start (EV_P_ ev_embed *w) EV_THROW;
void ev_embed_stop (EV_P_ ev_embed *w); EV_API_DECL void ev_embed_stop (EV_P_ ev_embed *w) EV_THROW;
void ev_embed_sweep (EV_P_ ev_embed *w); EV_API_DECL void ev_embed_sweep (EV_P_ ev_embed *w) EV_THROW;
# endif # endif
# if EV_ASYNC_ENABLE # if EV_ASYNC_ENABLE
void ev_async_start (EV_P_ ev_async *w); EV_API_DECL void ev_async_start (EV_P_ ev_async *w) EV_THROW;
void ev_async_stop (EV_P_ ev_async *w); EV_API_DECL void ev_async_stop (EV_P_ ev_async *w) EV_THROW;
void ev_async_send (EV_P_ ev_async *w); EV_API_DECL void ev_async_send (EV_P_ ev_async *w) EV_THROW;
# endif # endif
#if EV_COMPAT3 #if EV_COMPAT3
......
...@@ -247,7 +247,7 @@ epoll_init (EV_P_ int flags) ...@@ -247,7 +247,7 @@ epoll_init (EV_P_ int flags)
fcntl (backend_fd, F_SETFD, FD_CLOEXEC); fcntl (backend_fd, F_SETFD, FD_CLOEXEC);
backend_mintime = 1./1024.; /* epoll does sometimes return early, this is just to avoid the worst */ backend_mintime = 1e-3; /* epoll does sometimes return early, this is just to avoid the worst */
backend_modify = epoll_modify; backend_modify = epoll_modify;
backend_poll = epoll_poll; backend_poll = epoll_poll;
......
/* /*
* libev kqueue backend * libev kqueue backend
* *
* Copyright (c) 2007,2008,2009,2010,2011 Marc Alexander Lehmann <libev@schmorp.de> * Copyright (c) 2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann <libev@schmorp.de>
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modifica- * Redistribution and use in source and binary forms, with or without modifica-
...@@ -155,7 +155,8 @@ kqueue_poll (EV_P_ ev_tstamp timeout) ...@@ -155,7 +155,8 @@ kqueue_poll (EV_P_ ev_tstamp timeout)
int inline_size int inline_size
kqueue_init (EV_P_ int flags) kqueue_init (EV_P_ int flags)
{ {
/* Initialize the kernel queue */ /* initialize the kernel queue */
kqueue_fd_pid = getpid ();
if ((backend_fd = kqueue ()) < 0) if ((backend_fd = kqueue ()) < 0)
return 0; return 0;
...@@ -185,8 +186,20 @@ kqueue_destroy (EV_P) ...@@ -185,8 +186,20 @@ kqueue_destroy (EV_P)
void inline_size void inline_size
kqueue_fork (EV_P) kqueue_fork (EV_P)
{ {
close (backend_fd); /* some BSD kernels don't just destroy the kqueue itself,
* but also close the fd, which isn't documented, and
* impossible to support properly.
* we remember the pid of the kqueue call and only close
* the fd if the pid is still the same.
* this leaks fds on sane kernels, but BSD interfaces are
* notoriously buggy and rarely get fixed.
*/
pid_t newpid = getpid ();
if (newpid == kqueue_fd_pid)
close (backend_fd);
kqueue_fd_pid = newpid;
while ((backend_fd = kqueue ()) < 0) while ((backend_fd = kqueue ()) < 0)
ev_syserr ("(libev) kqueue"); ev_syserr ("(libev) kqueue");
...@@ -196,3 +209,6 @@ kqueue_fork (EV_P) ...@@ -196,3 +209,6 @@ kqueue_fork (EV_P)
fd_rearm_all (EV_A); fd_rearm_all (EV_A);
} }
/* sys/event.h defines EV_ERROR */
#undef EV_ERROR
/* /*
* loop member variable declarations * loop member variable declarations
* *
* Copyright (c) 2007,2008,2009,2010,2011 Marc Alexander Lehmann <libev@schmorp.de> * Copyright (c) 2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann <libev@schmorp.de>
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modifica- * Redistribution and use in source and binary forms, with or without modifica-
...@@ -43,6 +43,17 @@ VARx(ev_tstamp, now_floor) /* last time we refreshed rt_time */ ...@@ -43,6 +43,17 @@ VARx(ev_tstamp, now_floor) /* last time we refreshed rt_time */
VARx(ev_tstamp, mn_now) /* monotonic clock "now" */ VARx(ev_tstamp, mn_now) /* monotonic clock "now" */
VARx(ev_tstamp, rtmn_diff) /* difference realtime - monotonic time */ VARx(ev_tstamp, rtmn_diff) /* difference realtime - monotonic time */
/* for reverse feeding of events */
VARx(W *, rfeeds)
VARx(int, rfeedmax)
VARx(int, rfeedcnt)
VAR (pendings, ANPENDING *pendings [NUMPRI])
VAR (pendingmax, int pendingmax [NUMPRI])
VAR (pendingcnt, int pendingcnt [NUMPRI])
VARx(int, pendingpri) /* highest priority currently pending */
VARx(ev_prepare, pending_w) /* dummy pending watcher */
VARx(ev_tstamp, io_blocktime) VARx(ev_tstamp, io_blocktime)
VARx(ev_tstamp, timeout_blocktime) VARx(ev_tstamp, timeout_blocktime)
...@@ -58,16 +69,6 @@ VAR (backend_poll , void (*backend_poll)(EV_P_ ev_tstamp timeout)) ...@@ -58,16 +69,6 @@ VAR (backend_poll , void (*backend_poll)(EV_P_ ev_tstamp timeout))
VARx(ANFD *, anfds) VARx(ANFD *, anfds)
VARx(int, anfdmax) VARx(int, anfdmax)
VAR (pendings, ANPENDING *pendings [NUMPRI])
VAR (pendingmax, int pendingmax [NUMPRI])
VAR (pendingcnt, int pendingcnt [NUMPRI])
VARx(ev_prepare, pending_w) /* dummy pending watcher */
/* for reverse feeding of events */
VARx(W *, rfeeds)
VARx(int, rfeedmax)
VARx(int, rfeedcnt)
#if EV_USE_EVENTFD || EV_GENWRAP #if EV_USE_EVENTFD || EV_GENWRAP
VARx(int, evfd) VARx(int, evfd)
#endif #endif
...@@ -110,6 +111,7 @@ VARx(int, epoll_epermmax) ...@@ -110,6 +111,7 @@ VARx(int, epoll_epermmax)
#endif #endif
#if EV_USE_KQUEUE || EV_GENWRAP #if EV_USE_KQUEUE || EV_GENWRAP
VARx(pid_t, kqueue_fd_pid)
VARx(struct kevent *, kqueue_changes) VARx(struct kevent *, kqueue_changes)
VARx(int, kqueue_changemax) VARx(int, kqueue_changemax)
VARx(int, kqueue_changecnt) VARx(int, kqueue_changecnt)
...@@ -199,8 +201,8 @@ VARx(unsigned int, loop_count) /* total number of loop iterations/blocks */ ...@@ -199,8 +201,8 @@ VARx(unsigned int, loop_count) /* total number of loop iterations/blocks */
VARx(unsigned int, loop_depth) /* #ev_run enters - #ev_run leaves */ VARx(unsigned int, loop_depth) /* #ev_run enters - #ev_run leaves */
VARx(void *, userdata) VARx(void *, userdata)
VAR (release_cb, void (*release_cb)(EV_P)) VAR (release_cb, void (*release_cb)(EV_P) EV_THROW)
VAR (acquire_cb, void (*acquire_cb)(EV_P)) VAR (acquire_cb, void (*acquire_cb)(EV_P) EV_THROW)
VAR (invoke_cb , void (*invoke_cb) (EV_P)) VAR (invoke_cb , void (*invoke_cb) (EV_P))
#endif #endif
......
...@@ -48,6 +48,16 @@ ...@@ -48,6 +48,16 @@
/* for the crt to do something about it */ /* for the crt to do something about it */
volatile double SIGFPE_REQ = 0.0f; volatile double SIGFPE_REQ = 0.0f;
static SOCKET
ev_tcp_socket (void)
{
#if EV_USE_WSASOCKET
return WSASocket (AF_INET, SOCK_STREAM, 0, 0, 0, 0);
#else
return socket (AF_INET, SOCK_STREAM, 0);
#endif
}
/* oh, the humanity! */ /* oh, the humanity! */
static int static int
ev_pipe (int filedes [2]) ev_pipe (int filedes [2])
...@@ -59,7 +69,7 @@ ev_pipe (int filedes [2]) ...@@ -59,7 +69,7 @@ ev_pipe (int filedes [2])
SOCKET listener; SOCKET listener;
SOCKET sock [2] = { -1, -1 }; SOCKET sock [2] = { -1, -1 };
if ((listener = socket (AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) if ((listener = ev_tcp_socket ()) == INVALID_SOCKET)
return -1; return -1;
addr.sin_family = AF_INET; addr.sin_family = AF_INET;
...@@ -75,7 +85,7 @@ ev_pipe (int filedes [2]) ...@@ -75,7 +85,7 @@ ev_pipe (int filedes [2])
if (listen (listener, 1)) if (listen (listener, 1))
goto fail; goto fail;
if ((sock [0] = socket (AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) if ((sock [0] = ev_tcp_socket ()) == INVALID_SOCKET)
goto fail; goto fail;
if (connect (sock [0], (struct sockaddr *)&addr, addr_size)) if (connect (sock [0], (struct sockaddr *)&addr, addr_size))
......
/* DO NOT EDIT, automatically generated by update_ev_wrap */ /* DO NOT EDIT, automatically generated by update_ev_wrap */
#ifndef EV_WRAP_H #ifndef EV_WRAP_H
#define EV_WRAP_H #define EV_WRAP_H
#define now_floor ((loop)->now_floor) #define acquire_cb ((loop)->acquire_cb)
#define mn_now ((loop)->mn_now)
#define rtmn_diff ((loop)->rtmn_diff)
#define io_blocktime ((loop)->io_blocktime)
#define timeout_blocktime ((loop)->timeout_blocktime)
#define backend ((loop)->backend)
#define activecnt ((loop)->activecnt) #define activecnt ((loop)->activecnt)
#define loop_done ((loop)->loop_done) #define anfdmax ((loop)->anfdmax)
#define anfds ((loop)->anfds)
#define async_pending ((loop)->async_pending)
#define asynccnt ((loop)->asynccnt)
#define asyncmax ((loop)->asyncmax)
#define asyncs ((loop)->asyncs)
#define backend ((loop)->backend)
#define backend_fd ((loop)->backend_fd) #define backend_fd ((loop)->backend_fd)
#define backend_mintime ((loop)->backend_mintime) #define backend_mintime ((loop)->backend_mintime)
#define backend_modify ((loop)->backend_modify) #define backend_modify ((loop)->backend_modify)
#define backend_poll ((loop)->backend_poll) #define backend_poll ((loop)->backend_poll)
#define anfds ((loop)->anfds) #define checkcnt ((loop)->checkcnt)
#define anfdmax ((loop)->anfdmax) #define checkmax ((loop)->checkmax)
#define pendings ((loop)->pendings) #define checks ((loop)->checks)
#define pendingmax ((loop)->pendingmax) #define childall ((loop)->childall)
#define pendingcnt ((loop)->pendingcnt) #define cleanupcnt ((loop)->cleanupcnt)
#define pending_w ((loop)->pending_w) #define cleanupmax ((loop)->cleanupmax)
#define rfeeds ((loop)->rfeeds) #define cleanups ((loop)->cleanups)
#define rfeedmax ((loop)->rfeedmax) #define curpid ((loop)->curpid)
#define rfeedcnt ((loop)->rfeedcnt) #define epoll_epermcnt ((loop)->epoll_epermcnt)
#define epoll_epermmax ((loop)->epoll_epermmax)
#define epoll_eperms ((loop)->epoll_eperms)
#define epoll_eventmax ((loop)->epoll_eventmax)
#define epoll_events ((loop)->epoll_events)
#define evfd ((loop)->evfd) #define evfd ((loop)->evfd)
#define evpipe ((loop)->evpipe) #define evpipe ((loop)->evpipe)
#define fdchangecnt ((loop)->fdchangecnt)
#define fdchangemax ((loop)->fdchangemax)
#define fdchanges ((loop)->fdchanges)
#define forkcnt ((loop)->forkcnt)
#define forkmax ((loop)->forkmax)
#define forks ((loop)->forks)
#define fs_2625 ((loop)->fs_2625)
#define fs_fd ((loop)->fs_fd)
#define fs_hash ((loop)->fs_hash)
#define fs_w ((loop)->fs_w)
#define idleall ((loop)->idleall)
#define idlecnt ((loop)->idlecnt)
#define idlemax ((loop)->idlemax)
#define idles ((loop)->idles)
#define invoke_cb ((loop)->invoke_cb)
#define io_blocktime ((loop)->io_blocktime)
#define iocp ((loop)->iocp)
#define kqueue_changecnt ((loop)->kqueue_changecnt)
#define kqueue_changemax ((loop)->kqueue_changemax)
#define kqueue_changes ((loop)->kqueue_changes)
#define kqueue_eventmax ((loop)->kqueue_eventmax)
#define kqueue_events ((loop)->kqueue_events)
#define kqueue_fd_pid ((loop)->kqueue_fd_pid)
#define loop_count ((loop)->loop_count)
#define loop_depth ((loop)->loop_depth)
#define loop_done ((loop)->loop_done)
#define mn_now ((loop)->mn_now)
#define now_floor ((loop)->now_floor)
#define origflags ((loop)->origflags)
#define pending_w ((loop)->pending_w)
#define pendingcnt ((loop)->pendingcnt)
#define pendingmax ((loop)->pendingmax)
#define pendingpri ((loop)->pendingpri)
#define pendings ((loop)->pendings)
#define periodiccnt ((loop)->periodiccnt)
#define periodicmax ((loop)->periodicmax)
#define periodics ((loop)->periodics)
#define pipe_w ((loop)->pipe_w) #define pipe_w ((loop)->pipe_w)
#define pipe_write_wanted ((loop)->pipe_write_wanted)
#define pipe_write_skipped ((loop)->pipe_write_skipped) #define pipe_write_skipped ((loop)->pipe_write_skipped)
#define curpid ((loop)->curpid) #define pipe_write_wanted ((loop)->pipe_write_wanted)
#define postfork ((loop)->postfork)
#define vec_ri ((loop)->vec_ri)
#define vec_ro ((loop)->vec_ro)
#define vec_wi ((loop)->vec_wi)
#define vec_wo ((loop)->vec_wo)
#define vec_eo ((loop)->vec_eo)
#define vec_max ((loop)->vec_max)
#define polls ((loop)->polls)
#define pollmax ((loop)->pollmax)
#define pollcnt ((loop)->pollcnt) #define pollcnt ((loop)->pollcnt)
#define pollidxs ((loop)->pollidxs)
#define pollidxmax ((loop)->pollidxmax) #define pollidxmax ((loop)->pollidxmax)
#define epoll_events ((loop)->epoll_events) #define pollidxs ((loop)->pollidxs)
#define epoll_eventmax ((loop)->epoll_eventmax) #define pollmax ((loop)->pollmax)
#define epoll_eperms ((loop)->epoll_eperms) #define polls ((loop)->polls)
#define epoll_epermcnt ((loop)->epoll_epermcnt)
#define epoll_epermmax ((loop)->epoll_epermmax)
#define kqueue_changes ((loop)->kqueue_changes)
#define kqueue_changemax ((loop)->kqueue_changemax)
#define kqueue_changecnt ((loop)->kqueue_changecnt)
#define kqueue_events ((loop)->kqueue_events)
#define kqueue_eventmax ((loop)->kqueue_eventmax)
#define port_events ((loop)->port_events)
#define port_eventmax ((loop)->port_eventmax) #define port_eventmax ((loop)->port_eventmax)
#define iocp ((loop)->iocp) #define port_events ((loop)->port_events)
#define fdchanges ((loop)->fdchanges) #define postfork ((loop)->postfork)
#define fdchangemax ((loop)->fdchangemax)
#define fdchangecnt ((loop)->fdchangecnt)
#define timers ((loop)->timers)
#define timermax ((loop)->timermax)
#define timercnt ((loop)->timercnt)
#define periodics ((loop)->periodics)
#define periodicmax ((loop)->periodicmax)
#define periodiccnt ((loop)->periodiccnt)
#define idles ((loop)->idles)
#define idlemax ((loop)->idlemax)
#define idlecnt ((loop)->idlecnt)
#define idleall ((loop)->idleall)
#define prepares ((loop)->prepares)
#define preparemax ((loop)->preparemax)
#define preparecnt ((loop)->preparecnt) #define preparecnt ((loop)->preparecnt)
#define checks ((loop)->checks) #define preparemax ((loop)->preparemax)
#define checkmax ((loop)->checkmax) #define prepares ((loop)->prepares)
#define checkcnt ((loop)->checkcnt) #define release_cb ((loop)->release_cb)
#define forks ((loop)->forks) #define rfeedcnt ((loop)->rfeedcnt)
#define forkmax ((loop)->forkmax) #define rfeedmax ((loop)->rfeedmax)
#define forkcnt ((loop)->forkcnt) #define rfeeds ((loop)->rfeeds)
#define cleanups ((loop)->cleanups) #define rtmn_diff ((loop)->rtmn_diff)
#define cleanupmax ((loop)->cleanupmax)
#define cleanupcnt ((loop)->cleanupcnt)
#define async_pending ((loop)->async_pending)
#define asyncs ((loop)->asyncs)
#define asyncmax ((loop)->asyncmax)
#define asynccnt ((loop)->asynccnt)
#define childall ((loop)->childall)
#define fs_fd ((loop)->fs_fd)
#define fs_w ((loop)->fs_w)
#define fs_2625 ((loop)->fs_2625)
#define fs_hash ((loop)->fs_hash)
#define sig_pending ((loop)->sig_pending) #define sig_pending ((loop)->sig_pending)
#define sigfd ((loop)->sigfd) #define sigfd ((loop)->sigfd)
#define sigfd_w ((loop)->sigfd_w)
#define sigfd_set ((loop)->sigfd_set) #define sigfd_set ((loop)->sigfd_set)
#define origflags ((loop)->origflags) #define sigfd_w ((loop)->sigfd_w)
#define loop_count ((loop)->loop_count) #define timeout_blocktime ((loop)->timeout_blocktime)
#define loop_depth ((loop)->loop_depth) #define timercnt ((loop)->timercnt)
#define timermax ((loop)->timermax)
#define timers ((loop)->timers)
#define userdata ((loop)->userdata) #define userdata ((loop)->userdata)
#define release_cb ((loop)->release_cb) #define vec_eo ((loop)->vec_eo)
#define acquire_cb ((loop)->acquire_cb) #define vec_max ((loop)->vec_max)
#define invoke_cb ((loop)->invoke_cb) #define vec_ri ((loop)->vec_ri)
#define vec_ro ((loop)->vec_ro)
#define vec_wi ((loop)->vec_wi)
#define vec_wo ((loop)->vec_wo)
#else #else
#undef EV_WRAP_H #undef EV_WRAP_H
#undef now_floor #undef acquire_cb
#undef mn_now
#undef rtmn_diff
#undef io_blocktime
#undef timeout_blocktime
#undef backend
#undef activecnt #undef activecnt
#undef loop_done #undef anfdmax
#undef anfds
#undef async_pending
#undef asynccnt
#undef asyncmax
#undef asyncs
#undef backend
#undef backend_fd #undef backend_fd
#undef backend_mintime #undef backend_mintime
#undef backend_modify #undef backend_modify
#undef backend_poll #undef backend_poll
#undef anfds #undef checkcnt
#undef anfdmax #undef checkmax
#undef pendings #undef checks
#undef pendingmax #undef childall
#undef pendingcnt #undef cleanupcnt
#undef pending_w #undef cleanupmax
#undef rfeeds #undef cleanups
#undef rfeedmax #undef curpid
#undef rfeedcnt #undef epoll_epermcnt
#undef epoll_epermmax
#undef epoll_eperms
#undef epoll_eventmax
#undef epoll_events
#undef evfd #undef evfd
#undef evpipe #undef evpipe
#undef fdchangecnt
#undef fdchangemax
#undef fdchanges
#undef forkcnt
#undef forkmax
#undef forks
#undef fs_2625
#undef fs_fd
#undef fs_hash
#undef fs_w
#undef idleall
#undef idlecnt
#undef idlemax
#undef idles
#undef invoke_cb
#undef io_blocktime
#undef iocp
#undef kqueue_changecnt
#undef kqueue_changemax
#undef kqueue_changes
#undef kqueue_eventmax
#undef kqueue_events
#undef kqueue_fd_pid
#undef loop_count
#undef loop_depth
#undef loop_done
#undef mn_now
#undef now_floor
#undef origflags
#undef pending_w
#undef pendingcnt
#undef pendingmax
#undef pendingpri
#undef pendings
#undef periodiccnt
#undef periodicmax
#undef periodics
#undef pipe_w #undef pipe_w
#undef pipe_write_wanted
#undef pipe_write_skipped #undef pipe_write_skipped
#undef curpid #undef pipe_write_wanted
#undef postfork
#undef vec_ri
#undef vec_ro
#undef vec_wi
#undef vec_wo
#undef vec_eo
#undef vec_max
#undef polls
#undef pollmax
#undef pollcnt #undef pollcnt
#undef pollidxs
#undef pollidxmax #undef pollidxmax
#undef epoll_events #undef pollidxs
#undef epoll_eventmax #undef pollmax
#undef epoll_eperms #undef polls
#undef epoll_epermcnt
#undef epoll_epermmax
#undef kqueue_changes
#undef kqueue_changemax
#undef kqueue_changecnt
#undef kqueue_events
#undef kqueue_eventmax
#undef port_events
#undef port_eventmax #undef port_eventmax
#undef iocp #undef port_events
#undef fdchanges #undef postfork
#undef fdchangemax
#undef fdchangecnt
#undef timers
#undef timermax
#undef timercnt
#undef periodics
#undef periodicmax
#undef periodiccnt
#undef idles
#undef idlemax
#undef idlecnt
#undef idleall
#undef prepares
#undef preparemax
#undef preparecnt #undef preparecnt
#undef checks #undef preparemax
#undef checkmax #undef prepares
#undef checkcnt #undef release_cb
#undef forks #undef rfeedcnt
#undef forkmax #undef rfeedmax
#undef forkcnt #undef rfeeds
#undef cleanups #undef rtmn_diff
#undef cleanupmax
#undef cleanupcnt
#undef async_pending
#undef asyncs
#undef asyncmax
#undef asynccnt
#undef childall
#undef fs_fd
#undef fs_w
#undef fs_2625
#undef fs_hash
#undef sig_pending #undef sig_pending
#undef sigfd #undef sigfd
#undef sigfd_w
#undef sigfd_set #undef sigfd_set
#undef origflags #undef sigfd_w
#undef loop_count #undef timeout_blocktime
#undef loop_depth #undef timercnt
#undef timermax
#undef timers
#undef userdata #undef userdata
#undef release_cb #undef vec_eo
#undef acquire_cb #undef vec_max
#undef invoke_cb #undef vec_ri
#undef vec_ro
#undef vec_wi
#undef vec_wo
#endif #endif
#!/bin/sh #!/bin/sh
#
# install - install a program, script, or datafile # install - install a program, script, or datafile
#
scriptversion=2009-04-28.21; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was # This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the # later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license. # following copyright and license.
...@@ -39,482 +38,257 @@ scriptversion=2009-04-28.21; # UTC ...@@ -39,482 +38,257 @@ scriptversion=2009-04-28.21; # UTC
# when there is no Makefile. # when there is no Makefile.
# #
# This script is compatible with the BSD install script, but was written # This script is compatible with the BSD install script, but was written
# from scratch. # from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script # set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it. # Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-} doit="${DOITPROG-}"
if test -z "$doit"; then
doit_exec=exec
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd=$cpprog
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd=$stripprog
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "$0: no input file specified" >&2
exit 1
else else
doit_exec=$doit :
fi fi
# Put in absolute file names if you don't have them in your path; if [ x"$dir_arg" != x ]; then
# or use environment vars. dst=$src
src=""
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src= if [ -d "$dst" ]; then
dst= instcmd=:
dir_arg= chmodcmd=""
dst_arg= else
instcmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f "$src" ] || [ -d "$src" ]
then
:
else
echo "$0: $src does not exist" >&2
exit 1
fi
if [ x"$dst" = x ]
then
echo "$0: no destination specified" >&2
exit 1
else
:
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d "$dst" ]
then
dst=$dst/`basename "$src"`
else
:
fi
fi
copy_on_change=false ## this sed command emulates the dirname command
no_target_directory= dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
usage="\ # Make sure that the destination directory exists.
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE # this part is taken from Noah Friedman's mkinstalldirs script
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE. # Skip lots of stat calls in the usual case.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. if [ ! -d "$dstdir" ]; then
In the 4th, create DIRECTORIES. defaultIFS='
'
IFS="${IFS-$defaultIFS}"
Options: oIFS=$IFS
--help display this help and exit. # Some sh's can't handle IFS=/ for some reason.
--version display version info and exit. IFS='%'
set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS=$oIFS
-c (ignored) pathcomp=''
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands: while [ $# -ne 0 ] ; do
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG pathcomp=$pathcomp$1
RMPROG STRIPPROG shift
"
while test $# -ne 0; do if [ ! -d "$pathcomp" ] ;
case $1 in then
-c) ;; $mkdirprog "$pathcomp"
else
:
fi
-C) copy_on_change=true;; pathcomp=$pathcomp/
done
fi
-d) dir_arg=true;; if [ x"$dir_arg" != x ]
then
$doit $instcmd "$dst" &&
-g) chgrpcmd="$chgrpprog $2" if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
shift;; if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
else
--help) echo "$usage"; exit $?;; # If we're going to rename the final executable, determine the name now.
-m) mode=$2 if [ x"$transformarg" = x ]
case $mode in then
*' '* | *' '* | *' dstfile=`basename "$dst"`
'* | *'*'* | *'?'* | *'['*) else
echo "$0: invalid mode: $mode" >&2 dstfile=`basename "$dst" $transformbasename |
exit 1;; sed $transformarg`$transformbasename
esac fi
shift;;
-o) chowncmd="$chownprog $2" # don't allow the sed command to completely eliminate the filename
shift;;
-s) stripcmd=$stripprog;; if [ x"$dstfile" = x ]
then
dstfile=`basename "$dst"`
else
:
fi
-t) dst_arg=$2 # Make a couple of temp file names in the proper directory.
shift;;
-T) no_target_directory=true;; dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
--version) echo "$0 $scriptversion"; exit $?;; # Trap to clean up temp files at exit.
--) shift trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
break;; trap '(exit $?); exit' 1 2 13 15
-*) echo "$0: invalid option: $1" >&2 # Move or copy the file name to the temp name
exit 1;;
*) break;; $doit $instcmd "$src" "$dsttmp" &&
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # and set any options; do chmod last to preserve setuid bits
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
done
fi
if test $# -eq 0; then # If any of these fail, we abort the whole thing. If we want to
if test -z "$dir_arg"; then # ignore errors from any of these, just make sure not to ignore
echo "$0: no input file specified." >&2 # errors from the above "$doit $instcmd $src $dsttmp" command.
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
trap '(exit $?); exit' 1 2 13 15 if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
# Set umask so as not to create temps with too-generous modes. if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src # Now remove or move aside any old file at destination location. We try this
do # two ways since rm can't unlink itself on some systems and the destination
# Protect names starting with `-'. # file might be busy for other reasons. In this case, the final cleanup
case $src in # might fail but the new file should still install successfully.
-*) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst;;
esac
# If destination is a directory, append the input filename; won't work {
# if double slashes aren't ignored. if [ -f "$dstdir/$dstfile" ]
if test -d "$dst"; then then
if test -n "$no_target_directory"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
echo "$0: $dst_arg: Is a directory" >&2 $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
exit 1 {
fi echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
dstdir=$dst (exit 1); exit
dst=$dstdir/`basename "$src"` }
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else else
mkdir_mode= :
fi fi
} &&
posix_mkdir=false # Now rename the file to the real destination.
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
$posix_mkdir && (
umask $mkdir_umask && fi &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
) # The final little trick to "correctly" pass the exit status to the exit trap.
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
-*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test -z "$d" && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables: {
# eval: (add-hook 'write-file-hooks 'time-stamp) (exit 0); exit
# time-stamp-start: "scriptversion=" }
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
# compiler: $LTCC # compiler: $LTCC
# compiler flags: $LTCFLAGS # compiler flags: $LTCFLAGS
# linker: $LD (gnu? $with_gnu_ld) # linker: $LD (gnu? $with_gnu_ld)
# $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu3 # $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2
# automake: $automake_version # automake: $automake_version
# autoconf: $autoconf_version # autoconf: $autoconf_version
# #
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
PROGRAM=ltmain.sh PROGRAM=ltmain.sh
PACKAGE=libtool PACKAGE=libtool
VERSION="2.2.6b Debian-2.2.6b-2ubuntu3" VERSION="2.2.6b Debian-2.2.6b-2"
TIMESTAMP="" TIMESTAMP=""
package_revision=1.3017 package_revision=1.3017
......
#! /bin/sh #! /bin/sh
# Common stub for a few missing GNU programs while installing. # Common stub for a few missing GNU programs while installing.
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
scriptversion=2009-04-28.21; # UTC
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
# 2008, 2009 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
...@@ -18,7 +14,9 @@ scriptversion=2009-04-28.21; # UTC ...@@ -18,7 +14,9 @@ scriptversion=2009-04-28.21; # UTC
# GNU General Public License for more details. # GNU General Public License for more details.
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# As a special exception to the GNU General Public License, if you # As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a # distribute this file as part of a program that contains a
...@@ -31,8 +29,6 @@ if test $# -eq 0; then ...@@ -31,8 +29,6 @@ if test $# -eq 0; then
fi fi
run=: run=:
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the # In the cases where this matters, `missing' is being run in the
# srcdir already. # srcdir already.
...@@ -42,24 +38,18 @@ else ...@@ -42,24 +38,18 @@ else
configure_ac=configure.in configure_ac=configure.in
fi fi
msg="missing on your system" case "$1" in
case $1 in
--run) --run)
# Try to run requested program, and just exit if it succeeds. # Try to run requested program, and just exit if it succeeds.
run= run=
shift shift
"$@" && exit 0 "$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;; ;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
-h|--h|--he|--hel|--help) -h|--h|--he|--hel|--help)
echo "\ echo "\
...@@ -77,7 +67,6 @@ Supported PROGRAM values: ...@@ -77,7 +67,6 @@ Supported PROGRAM values:
aclocal touch file \`aclocal.m4' aclocal touch file \`aclocal.m4'
autoconf touch file \`configure' autoconf touch file \`configure'
autoheader touch file \`config.h.in' autoheader touch file \`config.h.in'
autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch] bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c flex create \`lex.yy.c', if possible, from existing .c
...@@ -85,18 +74,11 @@ Supported PROGRAM values: ...@@ -85,18 +74,11 @@ Supported PROGRAM values:
lex create \`lex.yy.c', if possible, from existing .c lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch] yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
\`g' are ignored when checking the name.
Send bug reports to <bug-automake@gnu.org>."
exit $?
;; ;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version) -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)" echo "missing 0.4 - GNU automake"
exit $?
;; ;;
-*) -*)
...@@ -105,69 +87,42 @@ Send bug reports to <bug-automake@gnu.org>." ...@@ -105,69 +87,42 @@ Send bug reports to <bug-automake@gnu.org>."
exit 1 exit 1
;; ;;
esac aclocal*)
# normalize program name to check for.
program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program). This is about non-GNU programs, so use $1 not
# $program.
case $1 in
lex*|yacc*)
# Not GNU programs, they don't have --version.
;;
tar*)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed. # We have it, but it failed.
exit 1 exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case $program in
aclocal*)
echo 1>&2 "\ echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site." any GNU archive site."
touch aclocal.m4 touch aclocal.m4
;; ;;
autoconf*) autoconf)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\ echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if WARNING: \`$1' is missing on your system. You should only need it if
you modified \`${configure_ac}'. You might want to install the you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site." archive site."
touch configure touch configure
;; ;;
autoheader*) autoheader)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\ echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site." from any GNU archive site."
...@@ -175,7 +130,7 @@ WARNING: \`$1' is $msg. You should only need it if ...@@ -175,7 +130,7 @@ WARNING: \`$1' is $msg. You should only need it if
test -z "$files" && files="config.h" test -z "$files" && files="config.h"
touch_files= touch_files=
for f in $files; do for f in $files; do
case $f in case "$f" in
*:*) touch_files="$touch_files "`echo "$f" | *:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;; sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";; *) touch_files="$touch_files $f.in";;
...@@ -185,8 +140,13 @@ WARNING: \`$1' is $msg. You should only need it if ...@@ -185,8 +140,13 @@ WARNING: \`$1' is $msg. You should only need it if
;; ;;
automake*) automake*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\ echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if WARNING: \`$1' is missing on your system. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages. You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site." Grab them from any GNU archive site."
...@@ -195,16 +155,21 @@ WARNING: \`$1' is $msg. You should only need it if ...@@ -195,16 +155,21 @@ WARNING: \`$1' is $msg. You should only need it if
while read f; do touch "$f"; done while read f; do touch "$f"; done
;; ;;
autom4te*) autom4te)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\ echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg. WARNING: \`$1' is needed, and you do not seem to have it handy on your
You might have modified some files without having the system. You might have modified some files without having the
proper tools for further handling them. proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU You can get \`$1' as part of \`Autoconf' from any GNU
archive site." archive site."
file=`echo "$*" | sed -n "$sed_output"` file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
if test -f "$file"; then if test -f "$file"; then
touch $file touch $file
else else
...@@ -218,108 +183,111 @@ WARNING: \`$1' is needed, but is $msg. ...@@ -218,108 +183,111 @@ WARNING: \`$1' is needed, but is $msg.
fi fi
;; ;;
bison*|yacc*) bison|yacc)
echo 1>&2 "\ echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site." \`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h rm -f y.tab.c y.tab.h
if test $# -ne 1; then if [ $# -ne 1 ]; then
eval LASTARG="\${$#}" eval LASTARG="\${$#}"
case $LASTARG in case "$LASTARG" in
*.y) *.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if test -f "$SRCFILE"; then if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c cp "$SRCFILE" y.tab.c
fi fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if test -f "$SRCFILE"; then if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h cp "$SRCFILE" y.tab.h
fi fi
;; ;;
esac esac
fi fi
if test ! -f y.tab.h; then if [ ! -f y.tab.h ]; then
echo >y.tab.h echo >y.tab.h
fi fi
if test ! -f y.tab.c; then if [ ! -f y.tab.c ]; then
echo 'main() { return 0; }' >y.tab.c echo 'main() { return 0; }' >y.tab.c
fi fi
;; ;;
lex*|flex*) lex|flex)
echo 1>&2 "\ echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site." \`Flex' from any GNU archive site."
rm -f lex.yy.c rm -f lex.yy.c
if test $# -ne 1; then if [ $# -ne 1 ]; then
eval LASTARG="\${$#}" eval LASTARG="\${$#}"
case $LASTARG in case "$LASTARG" in
*.l) *.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if test -f "$SRCFILE"; then if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c cp "$SRCFILE" lex.yy.c
fi fi
;; ;;
esac esac
fi fi
if test ! -f lex.yy.c; then if [ ! -f lex.yy.c ]; then
echo 'main() { return 0; }' >lex.yy.c echo 'main() { return 0; }' >lex.yy.c
fi fi
;; ;;
help2man*) help2man)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\ echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if WARNING: \`$1' is missing on your system. You should only need it if
you modified a dependency of a manual page. You may need the you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take \`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site." effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n "$sed_output"` file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then
if test -f "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
fi
if [ -f "$file" ]; then
touch $file touch $file
else else
test -z "$file" || exec >$file test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page" echo ".ab help2man is required to generate this page"
exit $? exit 1
fi fi
;; ;;
makeinfo*) makeinfo)
if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
# We have makeinfo, but it failed.
exit 1
fi
echo 1>&2 "\ echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX, call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site." the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ... file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then if test -z "$file"; then
# ... or it is the one specified with @setfilename ... file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
file=`sed -n '
/^@setfilename/{
s/.* \([^ ]*\) *$/\1/
p
q
}' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file touch $file
;; ;;
tar*) tar)
shift shift
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
fi
# We have already tried tar in the generic part. # We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error # Look for gnutar/gtar before invocation to avoid ugly error
...@@ -332,13 +300,13 @@ WARNING: \`$1' is $msg. You should only need it if ...@@ -332,13 +300,13 @@ WARNING: \`$1' is $msg. You should only need it if
fi fi
firstarg="$1" firstarg="$1"
if shift; then if shift; then
case $firstarg in case "$firstarg" in
*o*) *o*)
firstarg=`echo "$firstarg" | sed s/o//` firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0 tar "$firstarg" "$@" && exit 0
;; ;;
esac esac
case $firstarg in case "$firstarg" in
*h*) *h*)
firstarg=`echo "$firstarg" | sed s/h//` firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0 tar "$firstarg" "$@" && exit 0
...@@ -355,8 +323,8 @@ WARNING: I can't seem to be able to run \`tar' with the given arguments. ...@@ -355,8 +323,8 @@ WARNING: I can't seem to be able to run \`tar' with the given arguments.
*) *)
echo 1>&2 "\ echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg. WARNING: \`$1' is needed, and you do not seem to have it handy on your
You might have modified some files without having the system. You might have modified some files without having the
proper tools for further handling them. Check the \`README' file, proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case this package. You may also peek at any GNU archive site, in case
...@@ -366,11 +334,3 @@ WARNING: \`$1' is needed, and is $msg. ...@@ -366,11 +334,3 @@ WARNING: \`$1' is needed, and is $msg.
esac esac
exit 0 exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment