ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] rev 50749: /trunk/ /trunk/: CMakeLists.txt

From: Michael Tuexen <Michael.Tuexen@xxxxxxxxxxxxxxxxx>
Date: Sun, 21 Jul 2013 18:45:11 +0200
On Jul 21, 2013, at 5:33 PM, Joerg Mayer <jmayer@xxxxxxxxx> wrote:

> looks like there is no clang++ on that system but clang is there, and (using cmake),
> I have _U_ properly defined in config.h
> 
> So the question is what is different on your system.
> 
> What I did to build (relative to svn/trunk/):
> rm -rf build
> mkdir build
> cd build
> CC=clang cmake ..
> less config.h <== _U_ is now defined as it should
> make (still compiling).
> 
> Can you please check that there is nothing cached, then you build config.h
> and then check that?

Here is what you get on MountainLion with the latest released XCode version:

[mba:~/Documents/wireshark/trunk] tuexen% svn info
Path: .
URL: svn+ssh://svn.wireshark.org/svn/wireshark/trunk
Repository Root: svn+ssh://svn.wireshark.org/svn/wireshark
Repository UUID: f5534014-38df-0310-8fa8-9805f1628bb7
Revision: 50757
Node Kind: directory
Schedule: normal
Last Changed Author: jmayer
Last Changed Rev: 50756
Last Changed Date: 2013-07-21 16:28:08 +0200 (Sun, 21 Jul 2013)

[mba:~/Documents/wireshark/trunk] tuexen% svn status 
?       build
M       epan/sctpppids.h
M       epan/dissectors/packet-sctp.c
[mba:~/Documents/wireshark/trunk] tuexen% rm -rf build/
[mba:~/Documents/wireshark/trunk] tuexen% mkdir build
[mba:~/Documents/wireshark/trunk] tuexen% cd build/
[mba:wireshark/trunk/build] tuexen% cc --version
Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.4.0
Thread model: posix
[mba:wireshark/trunk/build] tuexen% clang --version
Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.4.0
Thread model: posix
[mba:wireshark/trunk/build] tuexen% cmake ..
-- The C compiler identification is Clang 4.2.0
-- The CXX compiler identification is Clang 4.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- V: 1.11.0, MaV: 1, MiV: 11, PL: 0, EV: .
-- Performing Test WS_C_FLAG_VALID0
-- Performing Test WS_C_FLAG_VALID0 - Success
-- Performing Test WS_C_FLAG_VALID1
-- Performing Test WS_C_FLAG_VALID1 - Success
-- Performing Test WS_C_FLAG_VALID2
-- Performing Test WS_C_FLAG_VALID2 - Success
-- Performing Test WS_C_FLAG_VALID3
-- Performing Test WS_C_FLAG_VALID3 - Success
-- Performing Test WS_C_FLAG_VALID4
-- Performing Test WS_C_FLAG_VALID4 - Success
-- Performing Test WS_C_FLAG_VALID5
-- Performing Test WS_C_FLAG_VALID5 - Success
-- Performing Test WS_C_FLAG_VALID6
-- Performing Test WS_C_FLAG_VALID6 - Success
-- Performing Test WS_C_FLAG_VALID7
-- Performing Test WS_C_FLAG_VALID7 - Success
-- Performing Test WS_C_FLAG_VALID8
-- Performing Test WS_C_FLAG_VALID8 - Success
-- Performing Test WS_C_FLAG_VALID9
-- Performing Test WS_C_FLAG_VALID9 - Success
-- Performing Test WS_C_FLAG_VALID10
-- Performing Test WS_C_FLAG_VALID10 - Success
-- Performing Test WS_C_FLAG_VALID11
-- Performing Test WS_C_FLAG_VALID11 - Success
-- Performing Test WS_C_FLAG_VALID12
-- Performing Test WS_C_FLAG_VALID12 - Success
-- Performing Test WS_C_FLAG_VALID13
-- Performing Test WS_C_FLAG_VALID13 - Success
-- Performing Test WS_C_FLAG_VALID14
-- Performing Test WS_C_FLAG_VALID14 - Success
-- Performing Test WS_C_FLAG_VALID15
-- Performing Test WS_C_FLAG_VALID15 - Success
-- Performing Test WS_C_FLAG_VALID16
-- Performing Test WS_C_FLAG_VALID16 - Success
-- Performing Test WS_C_FLAG_VALID17
-- Performing Test WS_C_FLAG_VALID17 - Success
-- Performing Test WS_C_FLAG_VALID18
-- Performing Test WS_C_FLAG_VALID18 - Success
-- Performing Test WS_C_FLAG_VALID19
-- Performing Test WS_C_FLAG_VALID19 - Success
-- Performing Test WS_C_FLAG_VALID20
-- Performing Test WS_C_FLAG_VALID20 - Success
-- Performing Test WS_C_FLAG_VALID21
-- Performing Test WS_C_FLAG_VALID21 - Success
-- Performing Test WS_C_FLAG_VALID22
-- Performing Test WS_C_FLAG_VALID22 - Success
-- Performing Test WS_C_FLAG_VALID23
-- Performing Test WS_C_FLAG_VALID23 - Success
-- Performing Test WS_C_FLAG_VALID24
-- Performing Test WS_C_FLAG_VALID24 - Success
-- Performing Test WS_C_FLAG_VALID25
-- Performing Test WS_C_FLAG_VALID25 - Success
-- C-Flags:  -O2 -g -Wall -W -Wextra -Wendif-labels -Wpointer-arith -Warray-bounds -Wformat-security -Wshorten-64-to-32 -Wvla -Waddress -Warray-bounds -Wattributes -Wdiv-by-zero -Wignored-qualifiers -Wno-overlength-strings -Wwrite-strings -Wno-long-long -Wc++-compat -Wdeclaration-after-statement -Wshadow -Wno-pointer-sign -Wold-style-definition -Wshadow -Wstrict-prototypes
CXX-Flags:  -O2 -g -Wall -W -Wextra -Wendif-labels -Wpointer-arith -Warray-bounds -Wformat-security -Wshorten-64-to-32 -Wvla -Waddress -Warray-bounds -Wattributes -Wdiv-by-zero -Wignored-qualifiers -Wno-overlength-strings -Wwrite-strings -Wno-long-long
-- Performing Test FVHIDDEN
-- Performing Test FVHIDDEN - Success
-- Performing Test WERROR
-- Performing Test WERROR - Success
statuscheck linker flag - test linker flags: -Wl,--as-needed
-- Performing Test WS_LD_FLAG_VALID0
-- Performing Test WS_LD_FLAG_VALID0 - Failed
-- Packagelist: CAP;CARES;GCRYPT;GEOIP;GLIB2;GMODULE2;GNUTLS;GTHREAD2;GTK2;HtmlViewer;KERBEROS;LEX;LUA;M;NL;PCAP;POD;PORTAUDIO;Perl;PythonInterp;SH;SMI;YACC;YAPP;ZLIB
-- Could NOT find CAP (missing:  CAP_LIBRARY CAP_INCLUDE_DIR) 
CAP_FOUND
-- Could NOT find CARES (missing:  CARES_LIBRARY CARES_INCLUDE_DIR) 
CARES_FOUND
-- Found GCRYPT: /usr/local/lib/libgcrypt.dylib  
GCRYPT_FOUND
-- GCRYPT includes: 
-- GCRYPT libs: /usr/local/lib/libgcrypt.dylib;/usr/local/lib/libgpg-error.dylib
-- Found GEOIP: /usr/local/lib/libGeoIP.dylib  
-- Looking for GeoIP_country_name_by_ipnum_v6
-- Looking for GeoIP_country_name_by_ipnum_v6 - found
GEOIP_FOUND
-- GEOIP includes: /usr/local/include
-- GEOIP libs: /usr/local/lib/libGeoIP.dylib
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.26") 
-- checking for one of the modules 'glib-2.0>=2.14.0'
-- Found GLib2: /usr/local/lib/libglib-2.0.dylib;/usr/local/lib/libintl.dylib;/usr/lib/libiconv.dylib /usr/local/include/glib-2.0;/usr/local/lib/glib-2.0/include;/usr/local/include;/usr/include
-- Looking for include file glib/gregex.h
-- Looking for include file glib/gregex.h - not found
-- Looking for include file glib/gchecksum.h
-- Looking for include file glib/gchecksum.h - not found
GLIB2_FOUND
-- GLIB2 includes: /usr/local/include/glib-2.0;/usr/local/lib/glib-2.0/include;/usr/local/include;/usr/include
-- GLIB2 libs: /usr/local/lib/libglib-2.0.dylib;/usr/local/lib/libintl.dylib;/usr/lib/libiconv.dylib
-- checking for one of the modules 'gmodule-2.0'
GMODULE2_FOUND
-- GMODULE2 includes: /usr/local/include/glib-2.0;/usr/local/lib/glib-2.0/include
-- GMODULE2 libs: gmodule-2.0;glib-2.0;intl
-- Found GNUTLS: /usr/local/lib/libgnutls.dylib  
GNUTLS_FOUND
-- GNUTLS includes: 
-- GNUTLS libs: /usr/local/lib/libgnutls.dylib
-- checking for one of the modules 'gthread-2.0'
GTHREAD2_FOUND
-- GTHREAD2 includes: /usr/local/include/glib-2.0;/usr/local/lib/glib-2.0/include
-- GTHREAD2 libs: gthread-2.0;glib-2.0;intl
-- Could NOT find Freetype (missing:  FREETYPE_INCLUDE_DIRS) 
-- Found GTK2_GTK: /usr/local/lib/libgtk-x11-2.0.dylib  
GTK2_FOUND
-- GTK2 includes: /usr/local/include/gtk-2.0;/usr/local/include/glib-2.0;/usr/local/lib/glib-2.0/include;/usr/local/include/gdk-pixbuf-2.0;/usr/local/lib/gtk-2.0/include;/usr/X11R6/include/cairo;/usr/X11R6/include;/usr/local/include/pango-1.0;/usr/local/include/atk-1.0
-- GTK2 libs: /usr/X11R6/lib/libfreetype.dylib;/usr/local/lib/libglib-2.0.dylib;/usr/local/lib/libgobject-2.0.dylib;/usr/local/lib/libgdk_pixbuf-2.0.dylib;/usr/local/lib/libgdk-x11-2.0.dylib;/usr/local/lib/libgtk-x11-2.0.dylib;/usr/X11R6/lib/libcairo.dylib;/usr/local/lib/libpango-1.0.dylib;/usr/local/lib/libpangocairo-1.0.dylib;/usr/local/lib/libatk-1.0.dylib
-- Found HtmlViewer: /usr/bin/open  
HtmlViewer_FOUND
-- Found KERBEROS: /usr/lib/libkrb5.dylib  
KERBEROS_FOUND
-- KERBEROS includes: /System/Library/Frameworks/Kerberos.framework/Headers
-- KERBEROS libs: /usr/lib/libkrb5.dylib
-- Found LEX: /usr/bin/flex  
LEX_FOUND
-- LEX includes: 
-- LEX libs: 
-- LEX executable: /usr/bin/flex
LUA INCLUDE SUFFIX: 
-- Found LUA: /usr/local/lib/liblua.a  
LUA INCLUDEs version: 502
LUA_FOUND
-- LUA includes: /usr/local/include
-- LUA libs: /usr/local/lib/liblua.a
-- Found M: /usr/lib/libm.dylib  
M_FOUND
-- M includes: /usr/include
-- M libs: /usr/lib/libm.dylib
-- Could NOT find NL (missing:  NL_LIBRARY NL_INCLUDE_DIR) 
NL_FOUND
-- Pcap include dirs set to /usr/include
-- Pcap library set to  /usr/lib/libpcap.dylib
-- Looking for pcap_version
-- Looking for pcap_version - found
-- Looking for pcap_open_dead
-- Looking for pcap_open_dead - found
-- Looking for pcap_freecode
-- Looking for pcap_freecode - found
-- Looking for pcap_breakloop
-- Looking for pcap_breakloop - found
-- Looking for pcap_create
-- Looking for pcap_create - found
-- Looking for pcap_datalink_name_to_val
-- Looking for pcap_datalink_name_to_val - found
-- Looking for pcap_datalink_val_to_description
-- Looking for pcap_datalink_val_to_description - found
-- Looking for pcap_datalink_val_to_name
-- Looking for pcap_datalink_val_to_name - found
-- Looking for pcap_findalldevs
-- Looking for pcap_findalldevs - found
-- Looking for pcap_free_datalinks
-- Looking for pcap_free_datalinks - found
-- Looking for pcap_get_selectable_fd
-- Looking for pcap_get_selectable_fd - found
-- Looking for pcap_lib_version
-- Looking for pcap_lib_version - found
-- Looking for pcap_list_datalinks
-- Looking for pcap_list_datalinks - found
-- Looking for pcap_set_datalink
-- Looking for pcap_set_datalink - found
-- Looking for pcap_open
-- Looking for pcap_open - not found
-- Looking for pcap_findalldevs_ex
-- Looking for pcap_findalldevs_ex - not found
-- Looking for pcap_createsrcstr
-- Looking for pcap_createsrcstr - not found
-- Found PCAP: /usr/include  
PCAP_FOUND
-- PCAP includes: /usr/include
-- PCAP libs: /usr/lib/libpcap.dylib
-- Found POD: /usr/bin/pod2man  
POD_FOUND
-- POD includes: 
-- POD libs: 
-- Found PORTAUDIO: /usr/local/lib/libportaudio.dylib  
PORTAUDIO_FOUND
-- PORTAUDIO includes: /usr/local/include
-- PORTAUDIO libs: /usr/local/lib/libportaudio.dylib
-- Found Perl: /usr/bin/perl (found version "5.12.4") 
Perl_FOUND
-- Found PythonInterp: /usr/bin/python (found suitable version "2.7.2", minimum required is "2") 
PYTHON_FOUND
-- Found SH: /bin/sh  
SH_FOUND
-- SH includes: 
-- SH libs: 
-- SH executable: /bin/sh
-- Found SMI: /usr/local/lib/libsmi.dylib  
SMI_FOUND
-- SMI includes: /usr/local/include
-- SMI libs: /usr/local/lib/libsmi.dylib
-- Found YACC: /usr/bin/bison  
YACC_FOUND
-- YACC includes: 
-- YACC libs: 
-- YACC executable: /usr/bin/bison
-- Could NOT find YAPP (missing:  YAPP_EXECUTABLE) 
YAPP_FOUND
-- Looking for inflatePrime
-- Looking for inflatePrime - not found
-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.5") 
ZLIB_FOUND
-- ZLIB includes: /usr/include
-- ZLIB libs: /usr/lib/libz.dylib
-- Looking for arpa/inet.h
-- Looking for arpa/inet.h - found
-- Looking for arpa/nameser.h
-- Looking for arpa/nameser.h - found
-- Looking for direct.h
-- Looking for direct.h - not found
-- Looking for dirent.h
-- Looking for dirent.h - found
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Looking for getopt.h
-- Looking for getopt.h - found
-- Looking for grp.h
-- Looking for grp.h - found
-- Looking for g_ascii_strtoull.h
-- Looking for g_ascii_strtoull.h - not found
-- Looking for inet/aton.h
-- Looking for inet/aton.h - not found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for lauxlib.h
-- Looking for lauxlib.h - found
-- Looking for memory.h
-- Looking for memory.h - found
-- Looking for netinet/in.h
-- Looking for netinet/in.h - found
-- Looking for netdb.h
-- Looking for netdb.h - found
-- Looking for Ntddndis.h
-- Looking for Ntddndis.h - not found
-- Looking for portaudio.h
-- Looking for portaudio.h - found
-- Looking for pwd.h
-- Looking for pwd.h - found
-- Looking for stdarg.h
-- Looking for stdarg.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stdlib.h
-- Looking for stdlib.h - found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for sys/ioctl.h
-- Looking for sys/ioctl.h - found
-- Looking for sys/param.h
-- Looking for sys/param.h - found
-- Looking for sys/socket.h
-- Looking for sys/socket.h - found
-- Looking for sys/sockio.h
-- Looking for sys/sockio.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for sys/utsname.h
-- Looking for sys/utsname.h - found
-- Looking for sys/wait.h
-- Looking for sys/wait.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for windows.h
-- Looking for windows.h - not found
-- Looking for winsock2.h
-- Looking for winsock2.h - not found
-- Looking for chown
-- Looking for chown - found
-- Looking for gethostbyname2
-- Looking for gethostbyname2 - found
-- Looking for getopt
-- Looking for getopt - found
-- Looking for getprotobynumber
-- Looking for getprotobynumber - found
-- Looking for inet_ntop
-- Looking for inet_ntop - found
-- Looking for issetugid
-- Looking for issetugid - found
-- Looking for mmap
-- Looking for mmap - found
-- Looking for mprotect
-- Looking for mprotect - found
-- Looking for mkdtemp
-- Looking for mkdtemp - found
-- Looking for mkstemp
-- Looking for mkstemp - found
-- Looking for sysconf
-- Looking for sysconf - found
-- Performing Test HAVE_TM_ZONE
-- Performing Test HAVE_TM_ZONE - Success
-- Looking for tzname
-- Looking for tzname - found
-- Performing Test HAVE_NL80211_CMD_SET_CHANNEL
-- Performing Test HAVE_NL80211_CMD_SET_CHANNEL - Failed
-- Performing Test HAVE_NL80211
-- Performing Test HAVE_NL80211 - Failed
-- Check if the system is big endian
-- Searching 16 bit integer
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- docdir: 
-- Enabled features:

-- Disabled features:

-- Configuring done
-- Generating done
-- Build files have been written to: /Users/tuexen/Documents/wireshark/trunk/build
[mba:wireshark/trunk/build] tuexen% tail config.h
#define WS_MSVC_NORETURN  

/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
   `char[]'. */
/* Note: not use in the code */
/* #undef YYTEXT_POINTER */

/* _U_ isn't needed for C++, simply don't name the variable.
   However, we do need it for some headers that are shared between C and C++. */
#define _U_ 
[mba:wireshark/trunk/build] tuexen% 

So: It doesn't work. Is there a way I can print the value of CMAKE_C_COMPILER?

Best regards
Michael
> 
> Thanks
>     Jörg
> 
> On Sun, Jul 21, 2013 at 05:10:03PM +0200, Michael Tuexen wrote:
>>>>> http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=50749
>>>>> 
>>>>> User: jmayer
>>>>> Date: 2013/07/21 05:53 AM
>>>>> 
>>>>> Log:
>>>>> Don't check for "APPLE" if what you really mean is "clang"
>>>> Except for this doesn't work. At least on Mac OS X 10.8.4 with XCode 4.6.3
>>>> I get now tons of warnings like
>>>> [ 38%] Building C object epan/CMakeFiles/epan.dir/dissectors/packet-ieee80211-netmon.c.o
>>>> /Users/tuexen/Documents/wireshark/trunk/epan/dissectors/packet-ieee80211-netmon.c:70:82: warning: 
>>>>    unused parameter 'data' [-Wunused-parameter]
>>>> ...*tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
>>>>                                                     ^
>>>> 1 warning generated.
>>>> 
>>>> That is why I checked for APPLE in
>>>> http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=49305
>>>> However, I agree it is not perfect.
>>> 
>>> Hmm, I assume you are using clang with that xcode version.
>> Yes.
>>> Are you working in a completely clean environment?
>> Can't guarantee, but I think so. At least I don't have any other compilers installed.
>>> 
>>> I will try on my wifes snow leopard (whatever xcode version that is).
>> That is pretty old... But you can give it a try.
> 
> -- 
> Joerg Mayer                                           <jmayer@xxxxxxxxx>
> We are stuck with technology when what we really want is just stuff that
> works. Some say that should read Microsoft instead of technology.
> ___________________________________________________________________________
> Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
> Archives:    http://www.wireshark.org/lists/wireshark-dev
> Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
>             mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe