On Mon, Aug 2, 2010 at 9:57 PM, John Yeary <johnye...@gmail.com> wrote: > I could not get the tip to build using Soylatte. I tried using my JDK7 build > as the ALT_BOOTDIR from two days ago, and it fails to build from it too. Has > anyone successfully built it since the code updates today? What did you use > for your build script?
I pulled in all of today's bsd-port changes, ran a clean build using [1] and encountered the following error [2] related to recent changes to bsd-port/jdk/src/solaris/native/java/net/NetworkInterface.c [3]: ../../../src/solaris/native/java/net/NetworkInterface.c: In function 'getIndex': ../../../src/solaris/native/java/net/NetworkInterface.c:1832: error: 'SIOCGIFINDEX' undeclared (first use in this function) ../../../src/solaris/native/java/net/NetworkInterface.c:1832: error: (Each undeclared identifier is reported only once ../../../src/solaris/native/java/net/NetworkInterface.c:1832: error: for each function it appears in.) ../../../src/solaris/native/java/net/NetworkInterface.c:1836: error: 'struct ifreq' has no member named 'ifr_index' make[5]: *** [/Users/david/Documents/dev/jdk/bsd-port/build/bsd-i586/tmp/sun/java.net/net/obj/NetworkInterface.o] Error 1 make[5]: *** Waiting for unfinished jobs.... make[4]: *** [library_parallel_compile] Error 2 make[3]: *** [all] Error 1 make[2]: *** [all] Error 1 make[1]: *** [jdk-build] Error 2 make: *** [build_product_image] Error 2 I then made the following small change [4] to bsd-port/jdk/src/solaris/native/java/net/NetworkInterface.c in the BSD specific getIndex function to use if_nametoindex [5] along the lines of the BSD specific changeset 5df63dc24cfe [6], and was able to build successfully on Mac OS X 10.6.4 with Intel i7. I haven't had a chance to really test the fix or to setup jtreg yet, so feel free to give it a thorough workout especially on other BSDs. diff --git a/src/solaris/native/java/net/NetworkInterface.c b/src/solaris/native/java/net/NetworkInterface.c --- a/src/solaris/native/java/net/NetworkInterface.c +++ b/src/solaris/native/java/net/NetworkInterface.c @@ -1823,17 +1823,12 @@ static int getIndex(int sock, const char *name){ /* - * Try to get the interface index - * (Not supported on Solaris 2.6 or 7) + * Try to get the interface index using BSD specific if_nametoindex */ - struct ifreq if2; - strcpy(if2.ifr_name, name); - - if (ioctl(sock, SIOCGIFINDEX, (char *)&if2) < 0) { - return -1; - } - - return if2.ifr_index; + int index = if_nametoindex(name); + if (index == 0) + index = -1; + return index; } [1]: http://gist.github.com/505787#file_compile.sh [2]: http://gist.github.com/505787#file_gistfile2.sh [3]: http://hg.openjdk.java.net/bsd-port/bsd-port/jdk/rev/ab6dd1a45471 [4]: http://gist.github.com/505787#file_gistfile3.diff [5]: http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man3/if_nameindex.3.html [6]: http://hg.openjdk.java.net/bsd-port/bsd-port/jdk/diff/5df63dc24cfe/src/solaris/native/java/net/NetworkInterface.c Hope that helps, Dave