> One thing that I still don't know is how to produce > a universal > binary with an autotools based project. (Update: I > found this link: > http://www.algorithm.com.au/mt/mac_os_x/ > creating_universal_binaries_with_gnu_autotools.html) > But I still can > imagine problems with code that decides e.g. > endianness on configure > time... > Is there anyone on this list who has experience with > this?
Haven't had experience with the universal binaries, but I do have this little jewel of a code snippet to share that might save someone hours of frustration. This comes from my open source game, Pirates Vs Ninjas (http://avastmateys.livejournal.com) You distribute OSX apps as .app files (Bundles). This is really a directory named whatever.app. When you start a program by clicking on whatever.app, MacOSX will run a program inside there somewhere. There is a folder called Resources in there which can hold things (libraries, etc) However, when you start something from a .app file the working directory is set to / and not the path of the executable file. To get to the path of the working dir use this: #include <CoreServices/CoreServices.h> char* GetBundlePath() { CFBundleRef mainBundle = CFBundleGetMainBundle(); CFURLRef url = CFBundleCopyBundleURL(mainBundle); CFStringRef cfStr = CFURLCopyPath(url); char* path = CFStringGetCStringPtr( cfStr, CFStringGetSystemEncoding() ); return path; } If you're porting to MacOSX, you're probably going to need that bit of code if it isn't already there. Also, thanks for the link to the universal binary flags, v. helpful. -Dom Dominic C. [binary1230(AT)yahoo.com] http://einsteinsbreakfast.com __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ Cinelerra mailing list [email protected] https://init.linpro.no/mailman/skolelinux.no/listinfo/cinelerra
