`AC_CHECK_FUNCS` can not properly check `getaddrinfo` because this
function requires some special headers on mingw.
Using `AC_CHECK_DECL` can effectively solve this issue.
Same for
- getnameinfo
- getprotobynumber
- getservbyname
- inet_ntop
- inet_pton
Since sysctl() is deprecated for a long-long time, according to
sysctl(2):
Since Linux 2.6.24, uses of this system call result in warnings in the kernel log.
Fixes: #890
Suggested-by: Pierce Lopez
- AC_PROG_SED
- AC_USE_SYSTEM_EXTENSIONS
- AC_TRY_COMPILE -> AC_COMPILE_IFELSE
- AC_TRY_RUN -> AC_RUN_IFELSE
...
Also use:
- AC_CONFIG_AUX_DIR
Refs: #870
Fixes: 3f09e923 ("Change the minimum version of automake to 1.13 and autoconf to 2.67")
When I run make check via automake with a version of 1.12.6 or lower, I got this error:
/bin/sh: line 9: ./test_runner_epoll: No such file or directory
FAIL: test_runner_epoll
/bin/sh: line 9: ./test_runner_select: No such file or directory
FAIL: test_runner_select
/bin/sh: line 9: ./test_runner_kqueue: No such file or directory
FAIL: test_runner_kqueue
/bin/sh: line 9: ./test_runner_evport: No such file or directory
FAIL: test_runner_evport
/bin/sh: line 9: ./test_runner_devpoll: No such file or directory
FAIL: test_runner_devpoll
/bin/sh: line 9: ./test_runner_poll: No such file or directory
FAIL: test_runner_poll
/bin/sh: line 9: ./test_runner_win32: No such file or directory
FAIL: test_runner_win32
/bin/sh: line 9: ./test_runner_timerfd: No such file or directory
FAIL: test_runner_timerfd
/bin/sh: line 9: ./test_runner_changelist: No such file or directory
FAIL: test_runner_changelist
/bin/sh: line 9: ./test_runner_timerfd_changelist: No such file or directory
FAIL: test_runner_timerfd_changelist
Open the Makefile generated by command ./autogen.sh && ./configure
I can see the errors are caused by this line:
if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then
$${dir}$$tst will expand to ./test_runner_epoll, but test_runner_epoll is only a target in test/include.am,
not a file, so it print:
/bin/sh: line 9: ./test_runner_epoll: No such file or directory.
It seems like a bug in automake 1.12.6.
The errors will disappear if I simply upgrade automake to 1.13, and upgrade autoconf to 2.65
(2.65 is the lowest version dependent by automake-1.13).
When I build with automake-1.13 and autoconf-2.66, I got another error:
configure.ac:667: error: AC_CHECK_SIZEOF: requires literal arguments
The code in configure.ac line 667 is :
AC_CHECK_SIZEOF(void *)
It is a bug in autoconf-2.66 :
http://gnu-autoconf.7623.n7.nabble.com/AC-CHECK-SIZEOF-int-is-error-in-autoconf-2-66-td13537.html
Finally, everything works fine when using automake-1.13 and autoconf-2.67.
Refs: #858
On my computer, the version of autoconf is 2.59 and automake is 1.9
I build with autogen.sh & configure & make and failed.
I find In Makefile.am:
include/event2/event-config.h: config.h make-event-config.sed
$(AM_V_GEN)test -d include/event2 || $(MKDIR_P) include/event2
$(AM_V_at)$(SED) -f $(srcdir)/make-event-config.sed < config.h > $@T
$(AM_V_at)mv -f $@T $@
There are three undefined variables: MKDIR_P, AM_V_GEN and AM_V_at.
Then I tried:
- autoconf-2.60 / automake-1.10
- autoconf-2.61 / automake-1.11
- autoconf-2.62 / automake-1.11.2
And only autoconf-2.62 & automake-1.11.2 is ok.
Therefore, I recommend changing the autoconf version from 2.59 to 2.62
and automake version from 1.9 to 1.11.2.
Plus autoconf 2.59 is too old - 2003.12.16 [1], so as automake 1.9 -
2004.08.11 [2], while $(AM_V_GEN)/$(AM_V_at) had been introduced in
371a1237 back in 2012.
[1]: http://ftp.gnu.org/gnu/autoconf/
[1]: http://ftp.gnu.org/gnu/automake/
Fixes: 371a1237 ("Make quiet build even quieter")
Although `_GNU_SOURCE` can be defined as an arbitrary #define per the
glibc docs [1], it's best to define it in a manner consistent with the way
that autoconf defines it, i.e., `1`.
While this shouldn't matter in most cases, it does when the headers from
other projects follow the poorly defined GNU convention implemented by
autoconf and are included after the libevent's util.h header. An example
failure with clang, similar to the failure I encountered, is as follows:
```
$ printf "#define _GNU_SOURCE\n#define _GNU_SOURCE 1" | clang -c -x c -
<stdin>:2:9: warning: '_GNU_SOURCE' macro redefined [-Wmacro-redefined]
^
<stdin>:1:9: note: previous definition is here
^
1 warning generated.
```
This happened when compiling python [2] with a stale homebrew util.h file from
libevent (which admittedly would not happen in a correct libevent install, as the
header should be installed under /usr/local/include/event2/util.h). However, if
both headers had been combined (which is more likely), it would have failed as
shown above.
Removing the ad hoc definition unbreaks compiling python's pyconfig.h.in header
when included after util.h from libevent.
1. http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html
2. https://github.com/python/cpython/blob/master/configure.ac#L126Closes: #773 (cherry-picked)
Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
First of all __func__ is not a macro, it is char[] array, so the code
that we had before in cmake, was incorrect, i.e.:
#if defined (__func__)
#define EVENT____func__ __func__
#elif defined(__FUNCTION__)
#define EVENT____func__ __FUNCTION__
#else
#define EVENT____func__ __FILE__
#endif
So just detect do we have __func__/__FUNCTION__ in configure/cmake
before build and define EVENT__HAVE___func__/EVENT__HAVE___FUNCTION__
to use the later to choose which should be used as a __func__ (if it is
not presented).
Closes: #644
by default, the max buffer size is 16K and histeresis is at 50%, so
a bigger read is needed to unlock writes than you would expect from
other BSD (512 bytes)
this doesn't introduce any regression on FreeBSD 11.1, OpenBSD 6.1, NetBSD 7.1,
macOS 10.12.6 and of course DragonFlyBSD 4.8.1, and most of them show
a max pipe size of 64K, so the read call should drain them all regardless
of how conservative they are on the free pipe space they will require
(usually 512 bytes) before kevent reports the fd as ready for write.
I couldn't find a reference to which bug this code was trying to look for
and it seems to be there from the beginning of git history so it might be
no longer relevant.
Issue: #548
Because checking in cmake breaks cross-compiling.
Introduced-in: 43eb56c7c738e3642f0981e3dd6ab9e082eec798.
Fixes: #482Fixes: #462
Refs: #475
v2: use waitid() with WNOWAIT
v3: use WNOWAIT only if it available in waitpid(), because not all netbsd
supports it
This reverts commit c4e9d9bd662de7f575f2172c160795d452ebe709
("sample/https-client: check for ERR_remove_thread_state() existence").
Calling AC_SEARCH_LIBS() modifies LIBS - -lcrypto incorrectly
ends up in LIBS, and thus linked to by libevent_core.so.
Checking for ERR_remove_thread_state should no longer be needed
because it was introduced in openssl 1.0.0, and the previous line
0.9.8 had support discontinued at the end of 2015.
Fixes: #473
And according to f8d80a285cf941505277d9060d0357b5b7e543d2 ("Bump version
to 2.1.3-alpha-dev") numeric version have 1 at the end, since it means
"-dev".
P.S. in referenced commit I made a mistake and instead of *-rc* I wrote
*-beta*.
See-also: f4489b8323cda0bf8eed7c1353911a852d7a947c ("Bump version to
2.1.7-beta everywhere")
Revert: 61179dec7716975a151c6dae4524ae504d05780e ("automake: define
serial-tests only if automake have this option") Revert:
Revert: 44d755e00e249c09914cf35089c16735df82e270 ("test/automake: don't
use paralell test harness (since automake 1.12)")
macOS 10.12 introduced `clock_gettime` to libsystem. This means, built
on OS X 10.12 application would crash on earlier versions of OS X
because it will try to call clock_gettime. This options is useful to
make backwards compatible macOS apps.
Fixes: #398Fixes: #399Fixes: #400
According to solaris docs:
"One instance of a SIGCHLD signal is queued for each child process whose
status has changed. If waitpid() returns because the status of a child
process is available, and WNOWAIT was not specified in options, any pending
SIGCHLD signal associated with the process ID of that child process is
discarded. Any other pending SIGCHLD signals remain pending."
And interesting thing that it works if you add sleep(1) before waitpid(), and
also if you run with --verbose (some race or what).
But linux doesn't support WNOWAIT in waitpid() so add detection into
cmake/autotools.
Fixes: #387
Link: https://bugzilla.redhat.com/show_bug.cgi?id=840782
According to https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html:
-Wswitch-enum
Warn whenever a switch statement has an index of enumerated type and lacks a
case for one or more of the named codes of that enumeration. case labels
outside the enumeration range also provoke warnings when this option is used.
The only difference between -Wswitch and this option is that this option
gives a warning about an omitted enumeration code even if there is a *default
label*.
The mentioned commit adds this check under-the-else of the previous condition
between getaddrinfo()/gethostbyname_r(), so this check is triggered only when
we don't have getaddrinfo() which is wrong, fix this by move it upper.
Fixes [CI] since it uses getservbyname() and it failed with autotools only
(cmake detection is ok).
CI: https://travis-ci.org/libevent/libevent/builds/93125954
Fixes: af08a94085e49e6942835b4c6b50a774536d5b5b ("Check for getservbyname even
if not on win32.")
The clang compiler provided with macosx emits warnings like:
CC bufferevent.lo
clang: warning: argument unused during compilation: '-I .'
clang: warning: argument unused during compilation: '-I ./compat'
clang: warning: argument unused during compilation: '-I ./include'
clang: warning: argument unused during compilation: '-I ./include'
for each file being compiled. This generates a lot of noise during
compilation making it hard to see "real" errors. This patch mute
those warnings.
We had cmake and autoconf tests for the inet_aton function... but we
never actually use it any more.
(The autoconf tests still use the callability of inet_aton to decide
whether we need to link against -lresolv)
Reported by Harlan Stenn.