125 Commits

Author SHA1 Message Date
Azat Khuzhin
fe2c2622c3 Make EVENT_STAGE_NAME non cached
It did not work before correctly anyway, since cmake do not reset cache
entries by default, so that reset to "beta" didn't work.

But I don't think that making this variable cached is useful, so let's
remove this.
2017-01-29 20:35:57 +03:00
Azat Khuzhin
efcfa046ae Bump version in master to 2.2.0-alpha-dev
And according to f8d80a285cf941505277d9060d0357b5b7e543d2 ("Bump version
to 2.1.3-alpha-dev") numeric version have 1 at the end, since it means
"-dev".
2017-01-29 20:33:55 +03:00
Azat Khuzhin
9b63b5d410 Bump version to 2.1.8-stable everywhere
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")
2017-01-26 02:36:00 +03:00
Azat Khuzhin
f4489b8323 Bump version to 2.1.7-beta everywhere
- cmake basic
- cmake detecting from git -- event_fuzzy_version_from_git()
- autotools
- win32
- appveyor
2016-11-04 23:05:20 +03:00
Azat Khuzhin
40fbffc0df Fix cmake -DEVENT__COVERAGE=ON
- do not use compiler check from the root cmake rules with syntax error,
  let CodeCoverage check it
- fix CodeCoverage to check C compiler not CXX
- case insensitive checking of CMAKE_BUILD_TYPE
- replace flags with --coverage, and fix flags with linking with
  --coverate, otherwise it will not compile during checking flags and
  fails.
2016-11-02 11:36:24 +03:00
Azat Khuzhin
3453c0815f cmake: fix finding python2, and check that it is really 2
python version check removed in a4d044c0cd97f68b4b3dde414b83d609719d33d7
("cmake: use PYTHON_EXECUTABLE to find python2"), but in
bcb990ab7cf4921c2c30a1aa4fcb4c0131fffe94 ("cmake/win32: fix running
regress, but fixing finding python2 interpreter") we set
PYTHON_EXECUTABLE only if it exists.
2016-10-31 02:25:43 +03:00
Zonr Chang
dc624adf42 cmake: cleanup
- Remove a redundant check on netdb.h (EVENT__HAVE_NETDB_H).
- Properly setup EVENT__SIZEOF_SSIZE_T for the case where "ssize_t" is
  not "int".
- Remove unused EVENT__HAVE_PTHREAD.
- Set EVENT__HAVE_LIBZ instead of EVENT__HAVE_ZLIB (and remove the
  latter).

Closes: #391 (cherry-picked from PR)
2016-10-26 18:48:41 +03:00
Azat Khuzhin
bcb990ab7c cmake/win32: fix running regress, but fixing finding python2 interpreter
Could not find executable C:/projects/libevent/build/bin/regress
  Looked in the following places:
  C:/projects/libevent/build/bin/regress
  C:/projects/libevent/build/bin/regress.exe
  ...
   9/13 Test  #9: regress__WIN32_debug ................***Not Run   0.00 sec

Link: https://ci.appveyor.com/project/nmathewson/libevent/build/2.1.6.271/job/wvy2jp7uojcut5cx#L1256
Fixes: #411
2016-10-26 01:41:07 +03:00
Azat Khuzhin
a4d044c0cd cmake: use PYTHON_EXECUTABLE to find python2
Since most of the distros have symlinks for this.
2016-10-04 23:22:34 +03:00
Azat Khuzhin
91559607fd Add -DEVENT__DISABLE_CLOCK_GETTIME switch for cmake
See-also: adc402ba5f0e15f4c77505852507f33b50f37ab6 ("Adding option to
ignore clock_gettime: --disable-clock-gettime")
2016-10-03 03:20:07 +03:00
Azat Khuzhin
51019e9460 Bump version to 2.1.6-beta everywhere
- cmake basic
- cmake detecting from git -- event_fuzzy_version_from_git()
- autotools
- win32
- appveyor
2016-08-27 01:28:36 +03:00
Azat Khuzhin
43eb56c7c7 tests: use waitpid(..., WNOWAIT) to fix failing of main/fork under solaris
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
2016-08-11 17:08:35 +03:00
Azat Khuzhin
dc95823cd7 cmake/solaris: set CMAKE_REQUIRED_LIBRARIES to fix functions detections
Otherwise we will not detect next functions for instance:
- gethostbyname_r # and related

And now both autotools/cmake builds passes all regress tests in basic env (on
solaris of course).

Fixes: dns/client_fail_requests_getaddrinfo
2016-08-10 00:34:44 +03:00
Azat Khuzhin
050bfc7fc6 cmake/solaris: fix building (link with socket,nsl) 2016-08-10 00:17:01 +03:00
Azat Khuzhin
c4dfb93ff2 cmake: check for ZLIB_INCLUDE_DIR, since we can have only library without headers 2016-08-09 15:47:58 +03:00
Azat Khuzhin
de0c1965ca cmake/win32: do not compile regress_thread on -DEVENT__DISABLE_THREAD_SUPPORT=ON 2016-08-09 15:47:58 +03:00
Azat Khuzhin
ecb0ec821a cmake/win32: do not compile evthread_win32 on -DEVENT__DISABLE_THREAD_SUPPORT=ON
There is duplicated "evthread_win32.c" appending to ${SRC_CORE} list, leave
only one that under if EVENT__DISABLE_THREAD_SUPPORT

Fixes: https://ci.appveyor.com/project/azat/libevent/build/2.1.5.96/job/44q3rgifasny7gek
2016-08-09 15:47:58 +03:00
Azat Khuzhin
e35f22416a cmake: fix -DEVENT__ENABLE_VERBOSE_DEBUG (typo on -DUSE_DEBUG)
Fixes: 8b228e27f57300be61b57a41a2ec8666b726dc34 ("Lot's of cmake updates")
2016-08-09 15:47:58 +03:00
Azat Khuzhin
38716c653d cmake: do not use stderr for notifications/version-info
For all except "STATUS" message() will write to stderr, and this also includes
case when you does not have <mode> at all. Plus for every message in stderr
powershell generates exception and make appveyor fails.

Fixes: https://ci.appveyor.com/project/azat/libevent/build/2.1.5.85/job/i10k7m0t80330mtr
2016-08-09 15:47:58 +03:00
Mark Ellzey
303161777d
[#372] check for errno.h 2016-06-28 10:37:24 -07:00
Azat Khuzhin
87f7238f33 cmake: require 3.1 only for win32 to make it work under ubunty precise
Also I [TRIED] wily but ubuntu can't upgrade transparently.

TRIED: https://travis-ci.org/azat/libevent/jobs/114924723
Fixes: https://travis-ci.org/libevent/libevent/jobs/114917275
2016-03-10 01:54:33 +03:00
Azat Khuzhin
c46ead5dc7 cmake: require at least 3.1 for target_sources() 2016-03-10 01:07:54 +03:00
Azat Khuzhin
36588e169d cmake: fix adding of compiler flags, and now it will
- add_compiler_flags() must accept array IOW just ARGN will be enoough
- add_compiler_flags() called with variable name instead of it's value

P.S. and fix some alignments issues
P.P.S. more cmake issues expected since now CFLAGS actually works
P.P.P.S. some issues with cmake cache is possible, so just reset it
2016-03-10 00:48:16 +03:00
Azat Khuzhin
f29f59e811 Replace -Wswitch-enum with -Wswitch, and add it into cmake rules too
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*.
2016-03-10 00:48:09 +03:00
Azat Khuzhin
a1609a87d7 cmake: fix building dns-example under win32 (missing getopt) 2016-01-14 11:58:39 +03:00
Azat Khuzhin
7707f6b03a cmake: Fix detection of ssize_t/SSIZE_T
Since ssize_it is POSIX, windows/VS also have this but with BaseTsd.h, plus the
logic prefers "ssize_t" (lower) instead of "SSIZE_T" (upper) when the latest
only available -- fix this too.

Refs: #311
2016-01-07 20:40:22 +03:00
Mark Ellzey
d56efd94b0 Fixed issue with cmake version generation 2015-12-21 17:43:00 -08:00
Mark Ellzey
7f9646d23a Cmake is now officially working.
Though I am currently breaking out things that seem to be repetitive, and a
cooler version macro and changelog updater.

More to come.
2015-12-21 04:36:24 -08:00
Mark Ellzey
49a53811a6 More cmake updates, lot's of missing definitions 2015-12-20 21:44:04 -08:00
Mark Ellzey
a9db46aec2 CMAKE CMAKE CMAKE CLEANUPS
It's almost useful.
2015-12-20 00:43:46 -08:00
Mark Ellzey
8b228e27f5 Lot's of cmake updates
This is still not done, cmake here was a horrid mess, but we're
getting our act together now.
2015-12-19 01:47:49 -08:00
Azat Khuzhin
c4e9d9bd66 sample/https-client: check for ERR_remove_thread_state() existence
Fixes: freebsd 9.2 build
2015-11-24 01:19:25 +03:00
Azat Khuzhin
cf2cf2a01a test: run regress with EVENT_DEBUG_MODE=1 and without
This could show some bugs like "event_assign called on an already added event",
and some others that debugging mode could track.
2015-09-02 19:38:30 +03:00
Azat Khuzhin
1d34498ea3 sample: add HTTP CONNECT tunnelling example using libevent http layer 2015-08-18 12:59:50 +03:00
Joakim Söderberg
19ba454317 This fixes a bug introduced in 27bd9faf498b91923296cc91643e03ec4055c230
CMake configuration files are intended to be used by other projects to find the library. Specifically the CMake find_package command can use it to find all files related to the project.

The idea is to support 2 different CMake configuration files for Libevent. One if you simply build libevent that is generated for the build tree.
And a second one that is generated for an install target that will be installed on the system and point to where on the system the lib files and such can be find.

So for instance, in the build tree the config would set the cmake variable `LIBEVENT_INCLUDE_DIRS` to `/path/to/libevent/build/include`.
And for the system config it would be set to `/usr/local/include` (or whatever target the user chose when running cmake).

27bd9faf498b91923296cc91643e03ec4055c230 changed this behavior so that both configs would point to the system wide path `/usr/local/include`

This meant that projects just wanting to import directly for the build tree would fail.
2015-02-05 17:34:50 +01:00
Nick Mathewson
683f5568ab Increment version to 2.1.5-beta 2015-01-05 09:16:12 -05:00
Nobuaki Sukegawa
e69d910948 Fix CMake shared library build
This fixes following problems in shared library build:
* visibility=hidden was not enabled for gcc because of incorrect variable name
* test programs that need internal APIs caused link errors
2015-01-03 02:28:08 +09:00
Joakim Soderberg
5c7282f7a5 Fix compilation for older OpenSSL versions.
For instance OpenSSL 0.9.7 does not have SSL_set_tlsext_host_name.

Also add the missing EVENT__DISABLE_SAMPLES CMake option.
2014-09-24 13:46:09 +02:00
Sergey Nikulov
27bd9faf49 updates in cmake build 2014-09-02 18:25:52 +04:00
Trond Norbye
15d90cce39 Add missing headerfile for cmake 2014-03-24 15:01:59 +01:00
Nick Mathewson
de268feb67 Increment version to 2.1.4-alpha-dev 2014-03-21 13:20:34 -04:00
Trond Norbye
73474042fe Fixup make install for cmake projects
Install all of the public headers and put the dll's in the
same directory as the binaries.
2014-03-21 14:27:21 +01:00
Nick Mathewson
d08273eca8 Increment version to 2.1.4-alpha 2014-03-16 12:09:24 -04:00
Nick Mathewson
8896a92b07 Merge remote-tracking branch 'origin/pr/110' 2014-03-03 13:47:21 -05:00
Trond Norbye
4545fa9b68 Add option to build shared library 2014-02-25 14:57:24 +01:00
Nick Mathewson
f665d5cb27 Stop checking for inet_aton; we don't use it.
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.
2014-02-24 10:33:16 -05:00
Trond Norbye
a0dd5df20a Rename event_extras to event_extra
The library event_extras is named event_extra when building with
GNU autotools
2014-02-19 06:38:00 +01:00
Trond Norbye
ed99d92c01 Added -Qunused-arguments for clang on macosx
The CLang provided through Xcode on Mac OSX emits warnings for
all unused include paths making the compilation extremely verbose.
2014-02-14 09:15:27 +01:00
Joakim Soderberg
f1715b471d Guard against EVENT_NOWIN32 being set during testing.
On windows all tests will fail if EVENT_NOWIN32 is set, since then there
will be no backend available.

Question is if we should simply disable the environment variable check on
Windows, since there's only one backend available anyway?
2014-01-22 12:12:51 +01:00
Joakim Söderberg
d38d798b25 CMake: Get rid of python not found warning when regress tests turned off.
It would warn that python wasn't found when it was, just because the regress tests where turned off... confusing.
2014-01-22 00:06:21 +01:00