| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
| Eric, and all, Sorry this has taken a while to respond to, but I wanted to have something useful to say. I finally got this working pretty nicely. I can use the same code and makefile on either my tiPowerbook (PPC) or my loaner IntelMini, build and link and run the JNI lib, and it seems to work fine. This is good. Thanks to you guys for your help. Oh, yeah, I also figured out how to do it as a universal binary, which is a definite good. (Our application, written in Java, loads a JNI lib that does math functions for us. One interesting feature of the JNI is that it compiles the user's inputted expressions into assembly language and executes that code on the fly. I had some headscratching to do when we started the Intel thing, since we could no longer assume that all Macs were running PPC (we already had x86 code generating for the Windows version). This made it necessary to rework the makefile, as well as changing around some of the preprocessor directives.) Here is the compile/link part (which does the ppc/x86 universal thing I am so happy about, note that there are 2 -arch options): $(TARGET): $(OBJECTS) g++ -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -o $@ -dynamiclib -install_name $(DESTDIR)/$@ $^ strip -x $@ %.o: %.cpp g++ -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -c -O2 -o $@ $^ -I /System/Library/Frameworks/JavaVM.framework/Headers I had some trouble getting the output to work on the machine that the lib was not built on, so the lib build on the PPCPowerbook would not work on the IntelMini The solution was to be sure that the code generation line in the makefile used the universal SDK (MacOSX10.4u.sdk), as well as the liker line. I think this is the main lesson to learn: If you want a universal jni, compilable on either platform, amke sure you have the universal SDK included for both the compiler and linker. Thanks to Eric and Kevin. Paul Archibald A society of sheep must in time beget a government of wolves. -- Henry de Jouvenel On May 5, 2006, at 1:22 PM, Eric Albert wrote:
|
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/email@hidden This email sent to email@hidden
| References: | |
| >compile for i86 on my PPC? (From: Paul Archibald <email@hidden>) | |
| >Re: compile for i86 on my PPC? (From: Kevin Van Vechten <email@hidden>) | |
| >Re: compile for i86 on my PPC? (From: Eric Albert <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.