I need to throw away the current build.xml file because it absolutely won’t work on OSX and many other platforms. What i need to find now is where the gcc command is defined that the build.xml keeps kicking off so I can edit it for OSX. I don’t see it anywhere in the joal hive
Stuck. Once I can get past this - won’t take long. Have tested out the new OSX OpenAL and its performance doesn’t suck for a change
I’ve updated extal.c & extal.h from the latest version of the LWJGL (from which the original was taken) There have been a number of changes made to the files, especially around OSX, so it may be worth taking another look at getting it working. I don’t currently have a Mac available or I’d try to figure it out myself. Hope this helps!
Great! I can’t promise anything, since 1) I didn’t write extal.c or extal.h, I merely borrowed them from LWJGL and 2) I haven’t really done any development for OS X. That said, I figured it was worth mentioning that the files had been upgraded in the hopes that it will make a difference. Good luck!
[quote]We still need to fix the ant build script. It still thinks the build succeeds even if compile-native-lib throws errors.
[/quote]
I’m open to suggestions. I haven’t figured out a graceful way to let ant know that the gcc compile has failed. I’ll keep looking around on the web, though, maybe somebody’s figured it out already.
I’ve gotten it to build. Haven’t actually tried to do anything with it. I had to make some pretty significant changes to the build scripts in order to make it happen and for now I’m going to leave that as an excercise for the ‘file merge specialists’ to determine. I do know that the “isUnix” thing is problematic because OSX “isUnix” just as Linux is ;D
Here is the build file I used to get the compile for OSX natives
Cannot yet speak to whether or not it works. It should, but there were some warnings that cropped up:
[exec] In file included from extal.c:34:
[exec] extal.h:82: warning: redefinition of `ALCboolean'
[exec] /Library/Frameworks/OpenAL.framework/Headers/alctypes.h:30: warning: `ALCboolean' previously declared here
[exec] extal.h:85: warning: redefinition of `ALCbyte'
[exec] /Library/Frameworks/OpenAL.framework/Headers/alctypes.h:33: warning: `ALCbyte' previously declared here
[exec] extal.h:88: warning: redefinition of `ALCubyte'
[exec] /Library/Frameworks/OpenAL.framework/Headers/alctypes.h:36: warning: `ALCubyte' previously declared here
[exec] extal.h:91: warning: redefinition of `ALCshort'
[exec] /Library/Frameworks/OpenAL.framework/Headers/
[exec] /Library/Frameworks/OpenAL.framework/Headers/alctypes.h:60: warning: `ALCvoid' previously declared here
[exec] ld: warning -prebind has no effect with -bundle
(Note that the list was trimmed to fit within the boundary of legal messages for the forum, bit the trim was done in the middle with the prebind warning being the last in the file)
Once you’ve gotten something that runs (he said crossing his fingers) I’ll take a look at merging the build files. At least this is a step in the right direction!
Note that the runtests task will fail because the OpenALTest code is trying to open up the hardcoded DirectSound3D device. Don’t know enough about OpenAL yet to fix that, but I’ll take a look and report back tonight (this morning) if I find out what OSX expects.
I just updated OpenALTest and Sound3DTest to use null instead of “DirectSound3D”. Once you’ve updated the source, you should be able to call the “runtests” task in the build.xml file.
/**
* Initialize the OpenAL environment
*
* @return true is OpenAL was able to initialize,
* false if OpenAL was not able to intialize
*/
public static boolean initialize() throws OpenALException {
String osProperty = System.getProperty("os.name");
if(osProperty.startsWith("Win")) {
isInitialized = init(new String[] { "OpenAL32.dll" });
} else if(osProperty.startsWith("Linux")) {
isInitialized = init(new String[] { "libopenal.so" });
} else {
// OSX
}
return isInitialized;
}
I believe this is the culprit Naughty naughty piece of code… Clearly there is something here that wants a platform specific. Its evil because its buried fairly deeply in source code. After this I need to figure out that the native init method wants to do with it.