Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: translating a build script for JNI for linux to JNI for OS X



Thanks...worked like a charm.

I didn't quite realize I had a Linux to Mac problem rather than a JNI problem...which does kind of make sense in retrospect. Meh, it's been a trying month with no end in sight.

Thanks again to both Mikael and Bill.

Cheers,
Steve

On Aug 25, 2008, at 8:25 PM, Bill Northcott wrote:

On 25/08/2008, at 9:08 PM, Stephyn Butcher wrote:
However, I cannot even begin to figure out how to make this work on OS
X. I have the following command:


echo compiling JNI wrapper
g++ -O3 -DNDEBUG -feliminate-unused-debug-symbols -fpic -s -shared -o
libjsmile.so ../*.cpp -I$JINC -I$JINC/linux -I../cppsmile -L../
cppsmile -lsmilearn -lsmile

and I don't know how to translate it into OS X speak.

As they say, RTFM, which in this case can be found at http://developer.apple.com/unix/ and particularly
http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix/intro/chapter_1_section_1.html


Stuff you need to watch on that command line:
-shared becomes -dynamiclib
-fpic is redundant but should not cause a problem
-o libjsmile.so needs to be -o libjsmile.jnilib (normal shared libraries are ,dylib)


If you want multi-architecture binaries, you will need some -arch options - say '-arch i386 -arch x86_64 -arch ppc' you may also need to point system root at an appropriate SDK.

I$JINC -I$JINC/linux - I would have thought that $JINC should be a path to some header directory.

There are also the excellent O'Reilly books "MacOS X ........ for UNIX Geeks". I don't know if the Leopard one is out yet.

Cheers
Bill Northcott

_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: translating a build script for JNI for linux to JNI for OS X (From: Bill Northcott <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.