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



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


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.