Attempting to build on a Debian Unstable amd64 fails
with:
$ ant
Buildfile: build.xml
init:
[mkdir] Created dir: /home/rchandia/tmp/jpcap/lib
[mkdir] Created
dir: /home/rchandia/tmp/jpcap/include
[mkdir] Created
dir: /home/rchandia/tmp/jpcap/classes
[mkdir] Created
dir: /home/rchandia/tmp/jpcap/jars
java-compile:
[javac] Compiling 94 source files
to /home/rchandia/tmp/jpcap/classes
[javac] Note: Some input files use unchecked or
unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for
details.
jar:
[jar] Building
jar: /home/rchandia/tmp/jpcap/jars/jpcap.jar
[jar] Building
jar: /home/rchandia/tmp/jpcap/jars/jpcap-core.jar
prop-for-capture-class:
check-for-capture-class:
natives:
make-unix-natives:
[exec] makefile:139: warning: overriding
commands for target `clean'
[exec] ../../../../../../make/targets.makefile:7:
warning: ignoring old commands for target `clean'
[exec]
g++ -Wall -O2 -I/usr/include/pcap -I/usr/lib/jvm/java-1.5.0-sun-1.5.0.06//include -I/usr/lib/jvm/java-1.5.0-sun-1.5.0.06//include/linux
jpcap.c process.cpp -fPIC -shared -o
libjpcap.so -lnsl /usr/lib/libpcap.a
[exec] jpcap.c: In function '_jobjectArray*
Java_net_sourceforge_jpcap_capture_PacketCapture_lookupDevices(JNIEnv*,
_jclass*)':
[exec] jpcap.c:646: error: invalid lvalue in
assignment
[exec] jpcap.c: In function '_jobjectArray*
Java_net_sourceforge_jpcap_capture_PacketCapture_lookupDevDescs(JNIEnv*,
_jclass*, _jobject*)':
[exec] jpcap.c:792: error: invalid lvalue in
assignment
[exec] make: *** [libjpcap.so] Error 1
[exec] Result: 2
make-windows-natives:
make-macosx-natives:
check-for-libjpcap:
install-linux-libjpcap:
check-for-jpcap-dll:
install-w2k-jpcap-dll:
check-for-libjpcap:
install-macosx-libjpcap:
build-jpcap:
all:
BUILD SUCCESSFUL
Total time: 7 seconds
Logged In: YES
user_id=1622838
Originator: NO
It fails on Gentoo x86 as well. I guess that modern gcc doesn't like this construction((char*)ifr += ifrSize):
for(;ifr < last; (char*)ifr += ifrSize) {
You can simply replace it with this:
char * ifrptr;
ifrptr = (char *)ifr;
for(;ifr < last; ifrptr += ifrSize) {
ifr = (struct ifreq*)ifrptr;