Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#2 Mac OS X port (universal binary for ppc,ppc64,i386,x86_64)

open
nobody
None
5
2010-01-24
2010-01-24
Andreas Lohr
No

Hi, here's my attempt to port jnetpcap to the Mac. One difference to Michael's patch is that this builds the native shared library as a universal binary for both the powerpc and x86 architectures and builds for 32 and 64 bit.

$ file jnetpcap.jnilib
libjnetpcap.jnilib: Mach-O universal binary with 4 architectures
libjnetpcap.jnilib (for architecture i386): Mach-O dynamically linked shared library i386
libjnetpcap.jnilib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
libjnetpcap.jnilib (for architecture ppc7400): Mach-O dynamically linked shared library ppc
libjnetpcap.jnilib (for architecture ppc64): Mach-O 64-bit dynamically linked shared library ppc64

Here's what I changed:

$ svn status
? Mac OS X.properties
M src/c/jnetpcap_utils.cpp
M build.xml
? lib/cpptasks-1.0b5-patched
? lib/hyperic-sigar-1.6.3/libsigar-universal64-macosx.dylib
? lib/hyperic-sigar-1.6.3/libsigar-universal-macosx.dylib

All additional files you need are in missing.zip and trunk.diff changes build.xml and jnetpcap_utils.cpp. I wasn't able to get linker to work without patching cpptasks. See my patch ID 2929327 in the Ant Contrib project.

The libsigar files are needed in some unit tests.

Apply both files in the root directory of the jnetpcap sources:

unzip /tmp/missing.zip
patch -p0 /tmp/trunk.diff

Discussion

  • Andreas Lohr
    Andreas Lohr
    2010-01-24

    diff against trunk

     
    Attachments
  • Andreas Lohr
    Andreas Lohr
    2010-01-24

    missing.zip part 1

     
    Attachments
    xaa
  • Andreas Lohr
    Andreas Lohr
    2010-01-24

    missing.zip part 2

     
    Attachments
    xab
  • Andreas Lohr
    Andreas Lohr
    2010-01-24

    missing.zip part 3

     
    Attachments
    xac
  • Andreas Lohr
    Andreas Lohr
    2010-01-24

    Due to size restrictions I had to split missing.zip into three parts. Please use "cat xaa xab xac > missing.zip" to recreate it.