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

To hack around this issue, i added 

AM_CPPFLAGS = $(INCLUDEDIRS) -I$(top_srcdir)/epan $(WS_CPPFLAGS) \
$(GLIB_CFLAGS) $(LIBGNUTLS_CFLAGS) $(LIBGCRYPT_CFLAGS) \
$(LIBGEOIP_CFLAGS) $(KRB5_CFLAGS) $(LIBXML2_CFLAGS) -I/usr/local/include

/usr/local/include to the makefile of epan/dissectors. 

After which I did not get a compile issue

Though the compile failed at a different file

addr_resolv.c:91:11: fatal error: 'ares.h' file not found

# include <ares.h>


and this file too is present in the /usr/local/include. So i think AM_CPPFLAGS is not searching my /usr/local/include. Could there be an issue with my script that generates these makefiles? I assumed that script that would generate these make files would add /usr/local/include in the search path by default


On Fri, Apr 21, 2017 at 7:15 PM, ajay saxena <aileronajay@xxxxxxxxx> wrote:
I think the difference is when compiling using make, /usr/local/include is not present in the search path. Whereas when compiling with cmake /usr/local/include is present in the search path

On Fri, Apr 21, 2017 at 7:12 PM, ajay saxena <aileronajay@xxxxxxxxx> wrote:
Using cmake, this is the compilation for packet-ip.c

[ 25%] Building C object epan/dissectors/CMakeFiles/dissectors.dir/packet-ip.c.o
cd /Users/ajasaxen/gitHubProjects/wireshark-official/wireshark/build/epan/dissectors && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc  -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES -DWS_BUILD_DLL -I/Users/ajasaxen/gitHubProjects/wireshark-official/wireshark/build -I/Users/ajasaxen/gitHubProjects/wireshark-official/wireshark -I/Users/ajasaxen/gitHubProjects/wireshark-official/wireshark/epan -I/Users/ajasaxen/gitHubProjects/wireshark-official/wireshark/tools/lemon -isystem /usr/local/opt/gettext/include -isystem /usr/local/include -isystem /usr/local/Cellar/geoip/1.6.9/include -isystem /usr/local/Cellar/glib/2.50.3/include/glib-2.0 -isystem /usr/local/Cellar/glib/2.50.3/lib/glib-2.0/include -isystem /usr/local/Cellar/pcre/8.39/include -isystem /usr/local/Cellar/gnutls/3.5.8/include -isystem /System/Library/Frameworks/Kerberos.framework/Headers -isystem /usr/local/opt/lua/include -isystem /usr/include/libxml2 -iframework /usr/local/Cellar/qt@5.5/5.5.1_1/lib -isystem /usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtCore.framework/Headers -isystem /usr/local/Cellar/qt@5.5/5.5.1_1/./mkspecs/macx-clang -isystem /usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtMacExtras.framework/Headers -isystem /usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtGui.framework/Headers -isystem /System/Library/Frameworks/OpenGL.framework/Headers -isystem /usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtMultimedia.framework/Headers -isystem /usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtNetwork.framework/Headers -isystem /usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtPrintSupport.framework/Headers -isystem /usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtWidgets.framework/Headers -isystem /usr/local/Cellar/qt@5.5/5.5.1_1/lib/QtSvg.framework/Headers -I/Users/ajasaxen/gitHubProjects/wireshark-official/wireshark/build/epan/dissectors -I/Users/ajasaxen/gitHubProjects/wireshark-official/wireshark/epan/dissectors  -Qunused-arguments  -fvisibility=hidden -O2 -g -DNDEBUG -fPIC   -Wall -Wextra -Wendif-labels -Wpointer-arith -Wformat-security -fwrapv -fno-strict-overflow -Wvla -Waddress -Wattributes -Wdiv-by-zero -Wignored-qualifiers -Wpragmas -Wno-overlength-strings -Wno-long-long -Wheader-guard -Wframe-larger-than=16384 -Wc++-compat -Wshadow -Wno-pointer-sign -Wold-style-definition -Wstrict-prototypes -Wunused-const-variable -Wshorten-64-to-32 -Werror=implicit -std=gnu99 -Werror -o CMakeFiles/dissectors.dir/packet-ip.c.o   -c /Users/ajasaxen/gitHubProjects/wireshark-official/wireshark/epan/dissectors/packet-ip.c

On Fri, Apr 21, 2017 at 6:38 PM, ajay saxena <aileronajay@xxxxxxxxx> wrote:
for make V = 1, i get this output

make[6]: Nothing to be done for `all'.

depbase=`echo packet-ip.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\

/bin/sh ../../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../..  -I../.. -I../../epan -D_FORTIFY_SOURCE=2 -DG_DISABLE_SINGLE_INCLUDES -DG_DISABLE_DEPRECATED -D_REENTRANT -isystem/usr/local/Cellar/glib/2.50.3/include/glib-2.0 -isystem/usr/local/Cellar/glib/2.50.3/lib/glib-2.0/include -isystem/usr/local/opt/gettext/include -isystem/usr/local/Cellar/pcre/8.39/include -I/usr/local/Cellar/gnutls/3.5.8/include -I/usr/local/Cellar/nettle/3.3/include -I/usr/local/Cellar/libtasn1/4.10/include -I/usr/local/Cellar/p11-kit/0.23.3/include/p11-kit-1 -I/usr/local/opt/libgcrypt/include -I/usr/local/opt/libgpg-error/include   -I/usr/include/libxml2  -Werror -mmacosx-version-min=10.12 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk  -Wall -Wextra -Wendif-labels -Wpointer-arith -Wformat-security -fwrapv -Wvla -Waddress -Wattributes -Wdiv-by-zero -Wignored-qualifiers -Wpragmas -Wno-overlength-strings -Wno-long-long -Wheader-guard -Wc++-compat -Wunused-const-variable -Wshadow -Wno-pointer-sign -Wold-style-definition -Wstrict-prototypes -Wshorten-64-to-32 -Werror=implicit -Qunused-arguments -fvisibility=hidden -g -O2 -MT packet-ip.lo -MD -MP -MF $depbase.Tpo -c -o packet-ip.lo packet-ip.c &&\

mv -f $depbase.Tpo $depbase.Plo

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../epan -D_FORTIFY_SOURCE=2 -DG_DISABLE_SINGLE_INCLUDES -DG_DISABLE_DEPRECATED -D_REENTRANT -isystem/usr/local/Cellar/glib/2.50.3/include/glib-2.0 -isystem/usr/local/Cellar/glib/2.50.3/lib/glib-2.0/include -isystem/usr/local/opt/gettext/include -isystem/usr/local/Cellar/pcre/8.39/include -I/usr/local/Cellar/gnutls/3.5.8/include -I/usr/local/Cellar/nettle/3.3/include -I/usr/local/Cellar/libtasn1/4.10/include -I/usr/local/Cellar/p11-kit/0.23.3/include/p11-kit-1 -I/usr/local/opt/libgcrypt/include -I/usr/local/opt/libgpg-error/include -I/usr/include/libxml2 -Werror -mmacosx-version-min=10.12 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -Wall -Wextra -Wendif-labels -Wpointer-arith -Wformat-security -fwrapv -Wvla -Waddress -Wattributes -Wdiv-by-zero -Wignored-qualifiers -Wpragmas -Wno-overlength-strings -Wno-long-long -Wheader-guard -Wc++-compat -Wunused-const-variable -Wshadow -Wno-pointer-sign -Wold-style-definition -Wstrict-prototypes -Wshorten-64-to-32 -Werror=implicit -Qunused-arguments -fvisibility=hidden -g -O2 -MT packet-ip.lo -MD -MP -MF .deps/packet-ip.Tpo -c packet-ip.c  -fno-common -DPIC -o .libs/packet-ip.o

packet-ip.c:63:10: fatal error: 'GeoIP.h' file not found

#include <GeoIP.h>

         ^



On Fri, Apr 21, 2017 at 5:38 PM, Guy Harris <guy@xxxxxxxxxxxx> wrote:
On Apr 21, 2017, at 2:33 PM, ajay saxena <aileronajay@xxxxxxxxx> wrote:

> Also cmake on the same source works, I would assume that it reads the header files from same locations unless it uses a fundamentally different resolution mechanism.

In both build processes, the resolution mechanism is in clang; the difference would be in what arguments (and environment variables?) it's passed.

Try doing

        make V=1

with autotools and

        make VERBOSE=1

with CMake, and show what the command used to build packet-ip.c is in both cases.
___________________________________________________________________________
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