Commit Graph

97 Commits

Author SHA1 Message Date
Alexis La Goutte 48c818f3af ConfigureChecks (cmake): Fix indent (use tabs) and modelines
Change-Id: I905c10583baf71b105c65c25f43fb09dd2279b8e
Reviewed-on: https://code.wireshark.org/review/12609
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-15 04:45:23 +00:00
Guy Harris ca495768c0 $, not %, is used to introduce a variable reference in CMake.
Change-Id: Ib4af3c5cee9bd2e1adb5758b9389611165e62b62
Reviewed-on: https://code.wireshark.org/review/10619
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-09-23 05:48:44 +00:00
Guy Harris 7181ae4713 Work around a Linux bonding driver bug (and the lack of a libpcap workaround).
The bonding driver does not properly handle unknown ioctls; it returns
ENODEV rather than ENOTSUP, EOPNOTSUPP, ENOTTY, or a "not supported"
error of that type.  This causes problems detailed in bug 11058.

On Linux, check for bonding devices before checking for monitor-mode
support.

While we're at it, get rid of a commented-out include of
CheckCSourceCompiles (it's presumably already been implicitly included
by other functions that use it).

Bug: 11058
Change-Id: I13035de0650634c51a52f262829b2b6fb86b39e9
Reviewed-on: https://code.wireshark.org/review/7856
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-30 19:44:36 +00:00
Jeff Morriss a308aef89d Look for and use gethostbyname() if we don't have getaddrinfo(). Fail to
configure if we can't find any name resolver (autotools only).

This puts back the gethostbyname()/gethostbyname2() code removed in
I3348179626e97daaddfbc89e3ed21e39915e3de4 and
If59ce8a038776eadd6cd1794ed0e2dad8bf8a22c but as a last-resort option (only
if we don't have a better or more modern name resolver).

As suggested/requested by Guy in https://code.wireshark.org/review/#/c/7423/

Change-Id: I706dbbd65135f47c67d3d8d88a61ad7273914c47
Reviewed-on: https://code.wireshark.org/review/7447
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2015-03-03 15:02:08 +00:00
Guy Harris dbbb1d3d61 We don't need to check for strings.h.
We never use it; the autoconf script does, but that's as a result of
some macros that checks for various standard and non-standard-but-common
headers.  It's been ages since strings.h was anything other than a BSD
source-compatibility hack, not even needed these days when writing code
for *BSD-flavored OSes, as they have <string.h>.

Change-Id: Iad2dc6e55207b52fc8af494ddfca4089c2eb426b
Reviewed-on: https://code.wireshark.org/review/7434
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-27 23:49:28 +00:00
Guy Harris 8c86fbc0be <string.h>, not <memory.h>, is the header file for memcpy().
Don't include <memory.h> when using memcpy(), include <string.h>.

We don't need to check for memory.h, so don't do it in CMake (we don't
explicitly check for it in autoconf, but it's checked for by some macro
we do use).

Change-Id: I7aa93d4ea93bab9beff597939d3c24aecda3d52e
Reviewed-on: https://code.wireshark.org/review/7433
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-27 22:55:53 +00:00
Guy Harris 81fa9e05ff wmem, unlike emem, doesn't use mmap(); remove some no-longer-needed checks.
Change-Id: Ic9b57c7c7042fadf938bfa48a3aabe23ad33370f
Reviewed-on: https://code.wireshark.org/review/7432
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-27 22:18:23 +00:00
Peter Wu 0ce7fd4be6 Trivial Dead assignment fixes in configure
Fixes a Dead assignment and unused variable warning.

With this patch and http://www.cmake.org/Bug/view.php?id=15203,
`scan-build cmake` will give zero warnings!

Change-Id: Idc7a03fbf1e8196bc139a2c6663ec48b897f2897
Reviewed-on: https://code.wireshark.org/review/7144
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-02-16 08:27:24 +00:00
Guy Harris a64fc6cf44 Don't check for C89 headers.
1988 called, they want their lack of a C standard back.  We don't need
to check whether we have stdarg.h, stddef.h, stdlib.h, or string.h, as
they're specified by C89 and I don't think there are any platforms we
care about that don't have a C89 environment in which we could be built.

Change-Id: I447551181284fab7722354b62774625ed8ee94bc
Reviewed-on: https://code.wireshark.org/review/7110
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-14 09:10:56 +00:00
Guy Harris f62353755b We use GLib's directory-reading routines, so we don't need <dire[cn]t.h>.
Change-Id: Id86e5d6d0ab24adb1bfff0688f33a40f2fdaed8d
Reviewed-on: https://code.wireshark.org/review/7108
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-14 07:23:20 +00:00
Gerald Combs 881ff5df92 Remove gethostbyaddr and gethostbyaddr2.
They've been deprecated for a very long time. Replace them with
getaddrinfo. Note that we might not want to do synchronous name
resolution at all.

Add HAVE_GETADDRINFO to the KfW win-mac.h collision list.

Change-Id: If59ce8a038776eadd6cd1794ed0e2dad8bf8a22c
Reviewed-on: https://code.wireshark.org/review/6958
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-06 08:07:10 +00:00
Guy Harris 087723adb0 Suppress the check for ' as a formatting character on Windows.
Change-Id: I006359faeeeb5d01ecdb57878c599c5e8a93a77f
Reviewed-on: https://code.wireshark.org/review/6319
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-05 04:07:37 +00:00
Guy Harris fc39b9b151 In CMake, check for thousands-grouping support in the GLib printf routines.
We do that with the autotools; do it with CMake as well.

We could, in theory, handle thosands-grouping ourselves, on all
platforms supporting ANSI C (for which read "all platforms we care
about") by using localeconv()'s thousands_sep and grouping items, but
that's a bit more work.

Fix autotools' comment for that item while we're at it (it checks the
GLib printf routines, not the system printf routines).

Change-Id: I000f0f3b955d9b192ade15e3fabc46d6b48a052e
Reviewed-on: https://code.wireshark.org/review/6317
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-05 01:44:12 +00:00
Guy Harris 533f85785b Don't check for nl80211 stuff if we don't have libnl.
While we're at it, do the checks in the same order that we do in
autotools.

Change-Id: Ie253cdeb740a5be4a5817ce4f7ed683aeea868c8
Reviewed-on: https://code.wireshark.org/review/6316
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-05 00:32:10 +00:00
Guy Harris 05fd11ee3d Add a check for NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP.
Just as we check for it in autotools, check for it in CMake.

Change-Id: I342a3fcde6a5f8190dac67260f25c070b6f5430f
Reviewed-on: https://code.wireshark.org/review/6314
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-05 00:12:31 +00:00
Guy Harris 0a0ce2b78f Check for optreset in CMake as well.
Change-Id: I74aae1d68f48702b0cd1289cdafdfff8d817b5f4
Reviewed-on: https://code.wireshark.org/review/6068
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-27 02:21:35 +00:00
Guy Harris 20503c7047 Check for getopt_long(), not getopt().
We support three types of platforms:

	1) UN*Xes that have both getopt() and getopt_long();

	2) UN*Xes that have getopt() but not getopt_long();

	3) Windows, which has neither.

Checking for getopt_long() lets us distinguish between 1) and 2) and
build getopt_long() for them.

Change-Id: Iaf0f142f9bebaa2eed2128d544ec9786711def45
Reviewed-on: https://code.wireshark.org/review/6045
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-25 01:11:10 +00:00
Guy Harris 1b37f4c5ef Cmake: check for popcount, and build it from wsutil/popcount.c if missing.
Change-Id: Id646a9f0b1fc6acafa99a78725e3f0ec8a48c170
Reviewed-on: https://code.wireshark.org/review/6006
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-23 05:04:17 +00:00
Guy Harris 79b5bb418b Fix typo.
One position off on the keyboard and everything falls apart.

Change-Id: I00909ca3344642d3eeaae0d8563403b56cc62f79
Reviewed-on: https://code.wireshark.org/review/5912
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-20 08:58:04 +00:00
Guy Harris a61f6e4745 When checking for floorl(), include math.h.
It's not being found with MSVC, but is apparently present; perhaps
math.h does something magic, e.g. defining it as a macro, so try using
check_symbol_exists with "math.h".

Change-Id: Idaecac641fb0b87d399807d8bf1fcb74e7251a4e
Reviewed-on: https://code.wireshark.org/review/5911
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-20 08:23:53 +00:00
Guy Harris 4b8639f049 Add a check for floorl().
Also, we don't use NEED_STRPTIME_H, we use HAVE_STRPTIME.

Change-Id: I330e8ce408c05b74c50f3369691283e35e68505c
Reviewed-on: https://code.wireshark.org/review/5910
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-20 05:19:04 +00:00
David Ameiss afae2b64e2 Allow building under OSX Yosemite using cmake.
CFPropertyListCreateFromStream() has been deprecated in Yosemite, in favor of CFPropertyListCreateWithStream(). The autotools
build checks for the existence of the new function, but the cmake build does not. So, add a check for it to CMakeLists.txt, and
update cmakeconfig.h.in to provide the "template" for HAVE_CFPROPERTYLISTCREATEWITHSTREAM.

Change-Id: I1a4e3e1ce83092ecf7725527b921eeca80b18d4b
Note: CFPropertyListCreateWithStream() works under Mavericks as well.
Reviewed-on: https://code.wireshark.org/review/5226
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
2014-11-10 22:03:26 +00:00
Jeff Morriss 79c977cf0a Remove the optional strncasecmp.{h,c} target (for systems that don't have that API).
strncasecmp() has been prohibited for years (in favor of the g_ascii_ version).

Change-Id: I64b7c29099b1c5240757e2026fe3490096a84755
Reviewed-on: https://code.wireshark.org/review/4980
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-10-30 13:39:44 +00:00
Guy Harris 5bfc21cf9e Clean up handling of missing functions.
With autotools, CMake, and nmake, if we have a function, #define
HAVE_{function_name_in_all_caps}, otherwise don't #define it.

If we provide our own version of a function in libwsutil, make sure we
have a header that declares it, and *ONLY* include that header if
HAVE_{function_name_in_all_caps} is *NOT* defined, so that we don't have
the system declaration and our declaration colliding.

Check for inet_aton, strncasecmp, and strptime with CMake, just as we do
with autotools.

Simplify the addition of {function_name_in_all_caps}_LO to libwsutil in
autotools.

Change-Id: Id5be5c73f79f81919a3a865324e400eca7b88889
Reviewed-on: https://code.wireshark.org/review/2903
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06 21:03:09 +00:00
Alexis La Goutte 757aa33220 Continue to remove $Id$ from top of file
(Using sed : sed -i '/^\# \$Id\$/,+1 d') (start with dash)

Change-Id: Ia4b5a6c2302f6a531f6a86c1ec3a2f8205c8c2dd
Reviewed-on: https://code.wireshark.org/review/881
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-31 18:48:06 +00:00
Guy Harris a183a4fb62 We don't need to check for lauxlib.h.
svn path=/trunk/; revision=52536
2013-10-11 07:53:17 +00:00
Guy Harris 5db6b8ae20 Check for sa_len in struct sockaddr.
svn path=/trunk/; revision=52534
2013-10-11 06:53:29 +00:00
Guy Harris 2ee9b16466 Note that dladdr() isn't being found on OS X, even though it's
available.

svn path=/trunk/; revision=52524
2013-10-11 00:05:08 +00:00
Guy Harris e5336d281b Move the QT_MACEXTRAS_LIB cmakedefine in cmakeconfig.h.in to the
equivalent location in config.h.in, to simplify comparing the two files.

Add some tests from the autoconf script to CMake:

	check for setresgid() and setresuid();

	check for struct stat having an st_flags member.

Get rid of INTTYPES_H_DEFINES_FORMATS; we don't appear to check for it,
and we don't use it (we're using GLib's formatting functions, which have
their own way of handling 64-bit integers).

Get rid of STDC_HEADERS; it's in autoconf because autoconf was
originally developed back when you couldn't rely in ANSI C and has never
been removed, and something we're using for other purposes checks for
it, not because we explicitly test for it, but we don't test it in the
code, and CMake doesn't even check for it.

svn path=/trunk/; revision=52522
2013-10-10 23:54:53 +00:00
Jörg Mayer db512010b3 Set some values for Windows manually where autodetection
does not yet work.

svn path=/trunk/; revision=52406
2013-10-06 16:11:50 +00:00
Jörg Mayer 07a5c7442f Invert NEED_INET_ATON_H to HAVE_INET_ATON_H
Remove unused NEED_G_ASCII_STRTOULL_H

svn path=/trunk/; revision=52385
2013-10-05 21:56:23 +00:00
Jörg Mayer bae2eee028 Implement in cmake:
http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=51322

> User: guy
> Date: 2013/08/12 01:01 PM
>
> Log:
>  Just check whether dladdr() is available; we check in the code whether
>  it succeeds, so there's no point in checking whether it succeeds in a
>  sample program.

svn path=/trunk/; revision=51334
2013-08-13 09:58:09 +00:00
Martin Kaiser cc82d38c8b set HAVE_GETOPT_H and HAVE_GETOPT variables
for both autotools and cmake builds

(in order to use getopt_long(), we have to check if we
 can include getopt.h)

svn path=/trunk/; revision=50680
2013-07-16 21:12:12 +00:00
Jörg Mayer c5548e1077 Add HAVE_TM_ZONE and HAVE_TZNAME detection to fix timezone display
in cmake builds.

svn path=/trunk/; revision=48932
2013-04-19 16:38:28 +00:00
Jörg Mayer 8e66080f1d Copy over HAVE_NL80211 from autofoo
svn path=/trunk/; revision=44853
2012-09-10 20:24:51 +00:00
Jörg Mayer 8363dc43b2 Make the check for NL80211_CMD_SET_CHANNEL work by copying
the logic of the autofoo test.
Using Cmake's check_symbol_exists is not an option as it will
not work for enums and types. As this is documented in the manpage
this is to be considered a feature and not a bug.

svn path=/trunk/; revision=44851
2012-09-10 18:35:56 +00:00
Jörg Mayer d8a7eed0a7 Get netlink detection working with cmake (not complete)
svn path=/trunk/; revision=44791
2012-09-06 10:37:17 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Jörg Mayer 6332e88552 Copy over the commit 38437 to cmake.
svn path=/trunk/; revision=38438
2011-08-09 21:26:33 +00:00
Guy Harris 3788aed199 Set svn:keywords and svn:eol-style. Fix the EOL style.
Add the copyright comment and give it an SVN ID.

svn path=/trunk/; revision=38381
2011-08-06 19:10:25 +00:00
Stig Bjørlykke 8443bbbf75 Replace all strerror() with g_strerror().
Remove our local strerror implementation.
Mark strerror as locale unsafe API.

This fixes bug 5715.

svn path=/trunk/; revision=37812
2011-06-28 09:00:11 +00:00
Stig Bjørlykke 98024a007f Invert check for getopt: NEED_GETOPT_H -> HAVE_GETOPT_H
Rename getopt.[ch] -> wsgetopt.[ch] to avoid name collision.

svn path=/trunk/; revision=30370
2009-10-06 16:01:18 +00:00
Jörg Mayer 7eed375f9d Make building with GeoIP, Python, Capabilities and c-ares
actually work.

svn path=/trunk/; revision=29870
2009-09-12 17:20:08 +00:00
Kovarththanan Rajaratnam f4c7321fc4 Check for mkdtemp()
svn path=/trunk/; revision=29659
2009-09-01 19:19:41 +00:00
Jörg Mayer 1925235323 Add check for HAVE_MKSTEMP to make build work again on
platforms that know about mkstemp().

svn path=/trunk/; revision=29645
2009-08-31 23:11:52 +00:00
Kovarththanan Rajaratnam 983a2d5d2b Add a couple of Windows header files
svn path=/trunk/; revision=29630
2009-08-30 15:06:28 +00:00
Kovarththanan Rajaratnam 9cfa4d529b Add ConfigureChecks.cmake
svn path=/trunk/; revision=29586
2009-08-27 15:35:33 +00:00