Commit Graph

208 Commits

Author SHA1 Message Date
Guy Harris 70075fa70f Rename AC_WIRESHARK_GCC_CFLAGS_CHECK to
AC_WIRESHARK_COMPILER_FLAGS_CHECK, because it doesn't just affect CFLAGS
and it doesn't just affect the flags for GCC.

svn path=/trunk/; revision=50222
2013-06-28 22:00:52 +00:00
Guy Harris eea87ac6e7 Change formatting in the hopes of making the code a bit easier to figure
out, and update a comment.

svn path=/trunk/; revision=50221
2013-06-28 21:51:31 +00:00
Guy Harris 623cca3634 When checking whether a given option should be added to the compiler
flags, if the option should be added to the flags for both C and C++,
test both the C and C++ compilers and, if the answers are different,
print a warning; the user might have (intentionally or unintentionally)
selected mismatched compilers, e.g. clang and g++ on OS X.

svn path=/trunk/; revision=50219
2013-06-28 21:38:51 +00:00
Guy Harris 04cc1e2fb5 Don't assume that compilers not named "clang" will, by default, report
an error, or not issue warnings, by default if you give them an unknown
-f flag.  Instead, test that flag with all compilers, and use -Werror to
force it to error out.

As with C/C++ flags, so with C++-only flags.

svn path=/trunk/; revision=50178
2013-06-27 00:45:39 +00:00
Guy Harris eaf5e3fd1f Don't assume that compilers that need an extra option to report errors,
rather than just warnings, for unknown warning options are named
"clang"; they might not be.

svn path=/trunk/; revision=50177
2013-06-26 22:43:51 +00:00
Jeff Morriss ffc5183fd2 (Attempt to) fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8813 :
Enable INET6 checking on Solaris versions other than 5.8.

(Yes, theoretically this should be checking for Solaris 5.7 or later.  I'm
going to go out on a limb and assume that no one is actually still using 5.7
or, if they are, they aren't trying to compile a modern Wireshark on it...)

svn path=/trunk/; revision=50173
2013-06-26 18:19:43 +00:00
Martin Kaiser 43db810318 look for /usr/include/lua5.x directories to determine the lua version
(Debian squeeze installs lua includes in /usr/include/lua5.1 and libs
 under /usr/lib, there's no --with-lua=<dir> setting for this
 configuration)

see also https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8438

svn path=/trunk/; revision=48146
2013-03-06 21:48:30 +00:00
Guy Harris 1d3e62c025 Add the warning flags to CFLAGS_FOR_BUILD, so any build tools we build
are built with warnings.

Also add compiler-specific flags (in this case, just the flags to enable
ANSI C compilation) to CFLAGS_FOR_BUILD.

svn path=/trunk/; revision=47479
2013-02-04 22:23:19 +00:00
Jeff Morriss 3be49bedd1 In AC_WIRESHARK_GCC_CFLAGS_CHECK() don't check if $3 (the program to be run)
exists by doing:

	if test "x$3" != "x" ; then

because if the program contains quotes it breaks the shell's parsing.
Instead test for the existence of $4 (which is mandatory if $3 is given).


Fix up the test program for -Wlogical-op so that it actually compiles
warning-free (at least on my system) when the compiler doesn't have the bug
we're checking for.

svn path=/trunk/; revision=46926
2013-01-04 02:12:51 +00:00
Guy Harris b961881fb3 Add some additional arguments to AC_WIRESHARK_GCC_CFLAGS_CHECK() to make
it do an additional check, if it finds that a given compiler option is
supported by the compiler, to see whether it's supported but
undesirable.  The arguments are a chunk of code to try to compile with
-Werror, and a string to be used in the "checking..." message printed
when trying to compile the cunk of code.

Try enabling -Wshadow again, but have it check whether

	extern int atoi(char *p);

	int
	foo(char *p)
	{
		int (*fptr)(char *p) = atoi;

		return fptr(p) * 2;
	}

compiles with -Wshadow and -Werror, so that we don't use -Wshadow with
compilers that complain about that; some older versions of GCC complain
about that, and it's really not worth our effort to eliminate or rename
arguments in function prototypes to make -Wshadow work even with those
compilers.

svn path=/trunk/; revision=46475
2012-12-09 02:52:33 +00:00
Anders Broman d54b681f84 From Jim Young and updated by Max Romanov:
The modification to acinclude.m4 adds a new test in the
AC_WIRESHARK_OSX_INTEGRATION_CHECK section to first look for the library
gtkmacintegration.  "gtkmacintegration" is the new internal name for GTK+ MAC
OSX library after the project was moved to www.gtk.org.  Previously this
library was known as igemacintegration.

The patches to the three gtk/*.c files update the conditional #include
<gtkmacintegration/gtkosxapplication.h> to use the new folder name.   The
Option 1 patch will break any build environment that expects to find the
gtkosapplication.h file in the older igemacintegration folder.  
In addition the patch includes updates to
gtk/main.c and gtk/main_menubar.c for a more standard looking App menu.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6702

svn path=/trunk/; revision=45869
2012-11-02 09:58:43 +00:00
Bill Meier 88c8b9218d Use -D_FORTIFY_SOURCE=2 only if the gc optimization level is greater than 0.
Fixes Bug #7449: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7449

-----
Issue:

Building Wireshark with '-O0 -D_FORTIFY_SOURCE=2 ...' fails

The warning [error] message:

/usr/include/features.h:314:4: error: #warning _FORTIFY_SOURCE requires
compiling with optimization (-O) [-Werror=cpp]`


A bit of research shows that this warning was added to a recent version of
glibc (on at least Fedora).

 See: http://sourceware.org/bugzilla/show_bug.cgi?id=13979

The warning message occurs if -D_FORTIFY_SOURCE=... is used and the gcc
'optimization level' == 0 (-O0).

Unfortunately when building with -O0 this warning message:

1. Causes compiles to fail (if -Werror [stop  on warning])
2. Causes ./configure to fail with an (incorrect) message
   about the pcap header being older than the libpcap version.


svn path=/trunk/; revision=43601
2012-07-07 22:35:55 +00:00
Anders Broman e6e6d6217b From Tony Trinh:
Update Lua from 5.1 to 5.2

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7400

svn path=/trunk/; revision=43482
2012-06-25 20:42:07 +00:00
Anders Broman aeceb172a4 From Tony Trinh:
Update autoconf script to check for Lua 5.2 

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7400

svn path=/trunk/; revision=43480
2012-06-25 20:31:24 +00:00
Jörg Mayer 7e10804902 Whitespace fix
svn path=/trunk/; revision=43305
2012-06-17 12:07:08 +00:00
Guy Harris 68a4971594 If the user tries to save a capture file atop a file that has all its
write bits turned off or, on 4.4-Lite-based systems, has its "user
immutable" bit turned on, ask them if they really want to overwrite the
file (as those are both used to say "this file is precious, don't let me
easily accidentally trash it") and, if the "user immutable" bit is set,
turn it off first so that the move in the "safe save" won't fail.

svn path=/trunk/; revision=43006
2012-06-02 18:53:13 +00:00
Guy Harris 931acaff3e Fix some comments and some indentation.
svn path=/trunk/; revision=41596
2012-03-16 08:02:35 +00:00
Guy Harris 04acb74936 Put -D and -I flags into CPPFLAGS rather than into CFLAGS; that should
make them apply to C++ as well as C.  That seems to be what the autoconf
documentation suggests:

- Variable: CFLAGS
  Debugging and optimization options for the C compiler. If it is not set
  in the environment when configure runs, the default value is set when
  you call AC_PROG_CC (or empty if you don't). configure uses this
  variable when compiling or linking programs to test for C features.

  If a compiler option affects only the behavior of the preprocessor
  (e.g., -Dname), it should be put into CPPFLAGS instead. If it affects
  only the linker (e.g., -Ldirectory), it should be put into LDFLAGS
  instead. If it affects only the compiler proper, CFLAGS is the natural
  home for it. If an option affects multiple phases of the compiler,
  though, matters get tricky. One approach to put such options directly
  into CC, e.g., CC='gcc -m64'. Another is to put them into both CPPFLAGS
  and LDFLAGS, but not into CFLAGS.

	...

- Variable: CPPFLAGS
  Preprocessor options for the C, C++, Objective C, and Objective C++
  preprocessors and compilers. If it is not set in the environment when
  configure runs, the default value is empty. configure uses this variable
  when preprocessing or compiling programs to test for C, C++, Objective
  C, and Objective C++ features.

  This variable's contents should contain options like -I, -D, and -U that
  affect only the behavior of the preprocessor. Please see the explanation
  of CFLAGS for what you can do if an option affects other phases of the
  compiler as well.

svn path=/trunk/; revision=41593
2012-03-16 03:27:45 +00:00
Guy Harris b53e379447 Have AC_WIRESHARK_GCC_CFLAGS_CHECK take an optional second flag to
indicate whether the flag is C-only, C++-only, or for both compilers;
pass the appropriate value for C-only flags.  Have the "Checking for..."
message indicate whether we're adding to CFLAGS, CXXFLAGS, or both.

(Yes, the macro should probably be renamed.  "GCC" refers to the GNU
Compiler Collection, which includes a C++ compiler, although that's also
used for compilers that are more-or-less compatible with the ones from
the GNU Compiler Collection, such as the clang compilers.)

We set -Wformat-security whether or not --enable-extra-gcc-checks was
specified, so we don't need to do it again if it was specified.

svn path=/trunk/; revision=41586
2012-03-16 00:49:01 +00:00
Guy Harris e42d0d35d8 Referring to pcap_version[] doesn't do what you want on at least some
UN*Xes (Fedora 16 and probably other Linux distributions, probably at
least some if not all other ELF-based systems, and perhaps also Mac OS
X), and causes problems if pcap_version[] has a different length in the
libpcap with which the executable was built and the libpcap with which
it's run, so we avoid using it for now.

svn path=/trunk/; revision=40138
2011-12-09 21:15:48 +00:00
Anders Broman 0b41604bad From Kevin Hildebrand:
Typo in acinclude.m4 breaks Heimdal kerberos builds

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6512

svn path=/trunk/; revision=39677
2011-10-30 16:19:05 +00:00
Gerald Combs b9b05239f1 Add GeoIP IPv6 database support. Tested with GeoIP 1.4.7, but older
versions *should* be supported.

svn path=/trunk/; revision=39280
2011-10-05 22:27:51 +00:00
Stig Bjørlykke 5603cef9f2 Remove support for libpcre, we use GRegex in GLib.
svn path=/trunk/; revision=38683
2011-08-23 09:25:06 +00:00
Jeff Morriss 3ba6316a06 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5607 :
When testing if we can add things to LDFLAGS, don't set LDFLAGS to CFLAGS
if the test determines that the flag cannot be added to LDFLAGS.

(Simple typo: LDFLAGS_saved was being set to CFLAGS instead of LDFLAGS.)

svn path=/trunk/; revision=38434
2011-08-09 19:49:08 +00:00
Guy Harris 0bd4a1ac3f Use spaces uniformly in AC_WIRESHARK_PYTHON_CHECK.
If we don't find python-config, set want_python to no, so the
end-of-configuration message says we're not using the Python
interpreter.  Also fix some cases where we were setting want_zlib rather
than want_python (cut-and-pasteo).

svn path=/trunk/; revision=37654
2011-06-11 21:49:24 +00:00
Guy Harris 350ec69e9a Do the Python embedding similarly to other "default = yes, if available"
items.

Add some quoting to the zlib tests, just in case the argument contains
white space.

Clean up capitalization of Lua and Python.

Link programs that use libwireshark with the Python libraries, and build
Epan with the Python cflags.

svn path=/trunk/; revision=37652
2011-06-11 19:05:17 +00:00
Guy Harris 7eb4723184 Don't bother checking for gzgets(), as we don't use it, and don't even
need to use its presence in zlib as a proxy for "not the crufty old zlib
that comes with some versions of X11".

Do, however, check for inflatePrime() there, instead, just in case the
crufty old zlib that comes with some versions of X11 lack it; this is to
prevent the configure script from assuming a shiny new zlib by testing
with a non-X11 program, causing the build to fail when you build
Wireshark.

svn path=/trunk/; revision=36969
2011-05-03 04:48:02 +00:00
Jeff Morriss ed8ea7bb34 After testing for the presence of python-config, fix typo so that we actually
test whether we found it or not.

If the user asked for Python support, error out if we find we can't use it.

svn path=/trunk/; revision=36924
2011-04-28 02:24:46 +00:00
Guy Harris f4ed7e8927 By default, clang only warns about unknown -W options, it doesn't
generate an error for them.  Force them to be treated as errors, so we
correctly test whether an option is supported.

svn path=/trunk/; revision=36732
2011-04-20 09:16:44 +00:00
Guy Harris b9d4c025d1 Instead of having GCC and CLANG variables, just have
ac_supports_gcc_flags and ac_supports_W_linker_passthrough flags, the
first of which, for now, we set for GCC and clang, and the latter of
which we set for GCC, clang, and xlc (probably true for some other
compilers as well).

Rename AC_WIRESHARK_GCC_LDFLAGS_CHECK to AC_WIRESHARK_LDFLAGS_CHECK, as
it's not checking for anything GCC-specific.  (Leave
AC_WIRESHARK_GCC_CFLAGS_CHECK unrenamed for now, as the flags we test
with it are originally GCC flags that clang also supports for GCC
compatibility.)

Fix some string-equality tests to use = rather than ==; the former is
what the test/[ command uses.

Don't turn on "-no-cpp-precomp" for clang - it whines if you do.

svn path=/trunk/; revision=36731
2011-04-20 08:37:45 +00:00
Guy Harris 05e06f7a7a First cut at support for clang. We may want to have specific items for
"supports GCC-style -W flags", etc., and may want to improve the check
for "is this clang", as well as deciding what other stuff should be done
if we have clang as well.  clang should, I think, largely be
gcc-compatible at the command line.

svn path=/trunk/; revision=36729
2011-04-20 03:22:19 +00:00
Guy Harris 4d6cb744df Add a "-d" flag to dumpcap, to print out the generated code for the
capture filter in human-readable form.  (Well, readable by humans who
know BPF machine language, at least. :-))

svn path=/trunk/; revision=33509
2010-07-13 23:26:07 +00:00
Guy Harris 22c9dd27f7 First check for the new GTK+/OS X integration functions, then the old
ones; it appears that at least one user's -ligemacintegration has both
(see bug 4823), and we should choose the new ones in that case.

Also, always set have_ige_mac if we have the functions.

Fix tpyoes while we're at it.

svn path=/trunk/; revision=33106
2010-06-05 22:04:28 +00:00
Guy Harris 36623bcb71 From H.sivank: GtkOSXApplication support.
Call the various flavors of OS X integration just "OS X integration",
not anything with "IGE" in it - it appears that, in some places,
"ige-mac-integration" refers only to the older Carbon-based functions,
although the library still appears to be called -ligemacintegration.

Update the URLs for the information about the OS X integration
libraries.

Clean up help message for --with-pcap-remote.

Clean up white space a bit.

Speaking of white space, it's "Mac OS X", not "MacOS X".

svn path=/trunk/; revision=32941
2010-05-25 00:35:44 +00:00
Stephen Fisher 3e3cb2d6a3 As of release 1.5, MIT Kerberos moved krb5.h to krb5/krb5.h. Check both
places.  Fix prompted by report on -dev from Jeff Blaine using MIT Kerberos
1.8.


svn path=/trunk/; revision=32727
2010-05-09 06:33:03 +00:00
Guy Harris 7dbbb8c572 Just check for pcap_create(); it first appeared in libpcap 1.0.0, and
pcap_set_buffer_size() did as well, so there aren't any libpcap releases
with pcap_create() but not pcap_set_buffer_size().

Only do one check for pcap_create.

svn path=/trunk/; revision=32695
2010-05-06 23:33:41 +00:00
Anders Broman f9981411f1 Checking in Stigs changes from
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=475
BUT not activating the check for 
pcap_create()
pcap_set_buffer_size()
This should make it possible to build with support for setting the buffersize if not capturing 802.11 traffic.

The code for handling the 'B' option should be OK in any case.

svn path=/trunk/; revision=32688
2010-05-06 18:34:30 +00:00
Anders Broman c911b0101b Check for pcap_create
Using pcap create and pcap_activate should make it possible
to set the capture buffer size on Linux systems as well as Windows.
Help to implement it would be apreciated :-)

Ref:
http://seclists.org/tcpdump/2009/q3/151

svn path=/trunk/; revision=32687
2010-05-06 15:39:08 +00:00
Guy Harris 980ac5960e Don't say "Checking for broken pcap-config" if we don't have a
pcap-config to check for brokenness.

svn path=/trunk/; revision=31919
2010-02-19 00:15:29 +00:00
Guy Harris 56cffa1135 Put in missing comma.
svn path=/trunk/; revision=31241
2009-12-11 09:11:42 +00:00
Guy Harris 488253bfe7 Add the time zone abbreviation to the result of abs_time_to_str() and
abs_time_secs_to_str().

svn path=/trunk/; revision=31234
2009-12-11 03:39:17 +00:00
Jörg Mayer b6cffe4050 - Add an AC macro to test linker flags.
- Test whether the linker supports --as-needed and if so,
  adds it to LDFLAGS

svn path=/trunk/; revision=29327
2009-08-07 18:49:24 +00:00
Guy Harris e411397ef8 Check for libpcap 1.0's broken pcap-config, which put a space between -L
and its argument - that doesn't work on some platforms (e.g., OS X).

svn path=/trunk/; revision=28664
2009-06-08 17:23:00 +00:00
Guy Harris 923b8ae800 Check for a pcap-config script (as provided by libpcap 1.x) and, if we
find it, use it to determine where to find libpcap and what additional
libraries it requires.

svn path=/trunk/; revision=28653
2009-06-08 02:12:23 +00:00
Stig Bjørlykke 31a2a3065d Don't reuse lua_dir in a for loop.
svn path=/trunk/; revision=28625
2009-06-03 15:40:12 +00:00
Stig Bjørlykke 863e456e78 Fixed setting of LUA_INCLUDES when having extraneous lua heder directory.
Fixed resetting flags after negative check for Lua.

svn path=/trunk/; revision=28624
2009-06-03 15:28:30 +00:00
Stig Bjørlykke d861a1a6dc Only give a failure message if configuring with --with-lua=yes.
svn path=/trunk/; revision=28623
2009-06-03 13:45:48 +00:00
Stig Bjørlykke 76520bcc34 Added check for extraneous lua header directories, as some systems
apparently put the headers in a "lua5.1" subdirectory.

svn path=/trunk/; revision=28622
2009-06-03 13:21:48 +00:00
Stig Bjørlykke 39d713806f Use liblua by default, if available.
svn path=/trunk/; revision=28621
2009-06-03 12:13:07 +00:00
Sebastien Tandel 52cc5fb1e8 python binding for wireshark (first commit)
* ability to write dissectors with python for wireshark.
        documentation (http://wiki.wireshark.org/Python)


svn path=/trunk/; revision=28529
2009-05-29 21:10:40 +00:00