Wireshark-dev: Re: [Wireshark-dev] Compilation issue on Mac OS
From: ajay saxena <aileronajay@xxxxxxxxx>
Date: Fri, 21 Apr 2017 23:50:56 -0400
Hi Guy,

Though i do think, this might have to do something with the wireshark code base too. For example I created this file

#include <gcrypt.h>
#include <stdio.h>
#include <GeoIP.h>
#include <ares.h>
 int main(){
printf("Hello World");
return 0;
}

as importtest.c and on compiling with gcc (clang), the file does get compiled. 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.

Thanks,
Ajay

On Fri, Apr 21, 2017 at 11:17 PM, ajay saxena <aileronajay@xxxxxxxxx> wrote:

On Fri, Apr 21, 2017 at 11:17 PM, ajay saxena <aileronajay@xxxxxxxxx> wrote:
Hi Guy,

So i found this on stackoverflow


On Fri, Apr 21, 2017 at 11:10 PM, Guy Harris <guy@xxxxxxxxxxxx> wrote:
On Apr 21, 2017, at 8:04 PM, ajay saxena <aileronajay@xxxxxxxxx> wrote:

> This is what i get for gcc --version
>
> Ajays-MacBook-Pro:wireshark ajasaxen$ gcc --version
> Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
> 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

OK, so "gcc" is just another name for Clang, as I suspected.

I'll file a bug asking that the Clang user manual document the way Clang searches for header files, and see if I can figure out what would cause it *not* to search /usr/local/include (by digging through the Clang source, if I have to).
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@wireshark.org?subject=unsubscribe