Wireshark-dev: Re: [Wireshark-dev] Compilation issue on Mac OS

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Sat, 22 Apr 2017 12:51:39 -0700
On Apr 21, 2017, at 8:50 PM, ajay saxena <aileronajay@xxxxxxxxx> wrote:

> Here is the verbose output from that compile
> 
> Ajays-MacBook-Pro:scripts ajasaxen$ gcc -v importtest.c -o importtest
> Apple LLVM version 8.1.0 (clang-802.0.42)
> Target: x86_64-apple-darwin16.5.0
> Thread model: posix
> InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
>  "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.12.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name importtest.c -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu penryn -target-linker-version 278.4 -v -dwarf-column-info -debugger-tuning=lldb -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.1.0 -fdebug-compilation-dir /Users/ajasaxen/scripts -ferror-limit 19 -fmessage-length 169 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.12.0 -fencode-extended-block-signature -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o /var/folders/c4/55pxmrx11s720rx49cxb3brc0000gn/T/importtest-8e4727.o -x c importtest.c
> clang -cc1 version 8.1.0 (clang-802.0.42) default target x86_64-apple-darwin16.5.0
> #include "..." search starts here:
> #include <...> search starts here:
>  /usr/local/include
>  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.1.0/include
>  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
>  /usr/include
>  /System/Library/Frameworks (framework directory)
>  /Library/Frameworks (framework directory)
> End of search list.
>  "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -no_deduplicate -dynamic -arch x86_64 -macosx_version_min 10.12.0 -o importtest /var/folders/c4/55pxmrx11s720rx49cxb3brc0000gn/T/importtest-8e4727.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.1.0/lib/darwin/libclang_rt.osx.a
> 
> and in this compile /usr/local/include was searched. Whereas when it compiles wireshark, it does not search in /usr/local/include.

Try modifying epan/dissectors/Makefile to pass the -v flag to gcc, and then touch epan/dissectors/packet-ip.c and run a make, so we can see the gcc -v output when trying to compile it.