The attached patch enables building of JOGL on HP-UX 11.11 (PA-RISC 2.0), using HP’s “aCC” compiler. Here’s an overview of what I changed:
- Updated gluegen files
gluegen-cpptasks.xml,StructLayout.java, andCPU.javato detect and flag HP-UX. - Updated jogl’s
build.xmlfile for the platform, including linker and compilation settings for HP’s “aCC” (which the ant<cc>task already had support for). I tried getting the build to work with gcc but didn’t make much progress (which may have had more to do with my install of gcc than the platform… not sure). - Added
_HPUXpreprocessor directive toglx-CustomCCode.cto ignorexf98vmode.h(like Solaris). - Added macro definitions for
RTLD_DEFAULTtoglx-CustomCCode.candInternalBufferUtils.c, as HP-UX doesn’t define that macro (used in calls todylsym). Taking a cue from other projects, defining it toNULLseems to elicit the desired behavior on HP-UX (incidentally, I learned thatRTLD_DEFAULTis not an official part of the POSIX standard, but only considered a reserved name). - Via
_HPUXpreprocessor test, modifiedInternalBufferUtils.cto (like Solaris) to use a proxy for the extension functionglXGetProcAddressARB, usingdlsyminstead. - Added
_HPUXto the preprocessor test inJAWT_DrawingSurfaceInfo.cfor definingplatformDSIClassName.
Some notes on the experience:
- The glugen file
CPU.javacaused me some confusion, as it claims to be there as a check for 32/64 bit architectures, but HP-UX/PA-RISC2.0 (and apparently Solaris/SPARC) need to be marked as 32 bit, despite their 64 bit capabilities. Otherwise, structure unpacking doesn’t work (e.g. XVisualInfo). The abstraction should convey something about specific data type sizes rather than general architecture (is it there for native pointer sizes?). Overall, there’s opportunity for some nice refactoring across the source via a “PlatformProperties” type of class. The number of calls toSystem.getProperty("os.name")should be of long-term concern, particularly some of the ones for MacOS X specific code. I’d be open to taking a stab at such a class if there is interest. Let me know. - I’m guessing the use of
glXGetProcAddressARB–an OpenGL 1.3 feature–is used as the default mechanism for OpenGL function pointer lookup overdlsymbecause it’s more specific to the task. But I’d argue, for the sake of true OpenGL 1.1 compliance, thatdlsymshould be used throughout the X11 implementation to eliminate hacks for HP and Sun (supported on Linux and FreeBSD via xf86/Mesa)?? But then again, I don’t know the design history here. - My installation of HP-UX required me to add
libjvm.so(and the search directory for it) to linking oflibjogl_awt.sl. Otherwise the platform linker got confused and looked for it in the wrong place. My version of Java is 1.4.2_10-b03. The modification inbuild.xmlfor this may or may not be neccessary in the long term.
I hope someone else finds this helpful. There’s a 50/50 chance I’ll need to repeat this exercise for SGI/IRIX, so hopefully the process will be quicker for me.
Ken, thanks for all yoru help! You really gave me the clues I needed! Let me know if other changes are neccessary before it’s considered for inclusion in the versioned source.
Simeon