[GRASS-dev] [grass-code P][291] Add universal portable.h for Mac OS X

grass-codep at wald.intevation.org grass-codep at wald.intevation.org
Tue Feb 13 21:35:35 EST 2007


code P item #291, was opened at 2007-02-13 20:35
Status: Open
Priority: 3
Submitted By: William Kyngesburye (kyngchaos)
Assigned to: Nobody (None)
Summary: Add universal portable.h for Mac OS X 
Patch status: None
Patch type: enhancement
GRASS component: vector
GRASS version: CVS HEAD
GRASS CVS checkout date, if applies (YYMMDD): 070212


Initial Comment:
To build a universal binary on Mac OS X, portable.h must switch between PPC and Intel architectures, independent of the build architecture.  If building on one architecture, you can compile for the other with a simple flag, or more commonly you would build for both at once.  I've been successfully using a custom portable.h that switches based on the OSX GCC compiler macro __LITTLE_ENDIAN__ (companion to __BIG_ENDIAN__).

The diglib makefile needs to copy the custom portable.h instead of generating a new one, much like the MINGW case.  Attached in a patch for that.

This depends on a new variable in Platform.make.in - MACOSX.  I didn't include a patch, as that is simple enough to add.

Lastly, configure needs to set that in Platform.make.  I don't know how to handle that part.  But it would depend on the host being darwin.

This should work at least back to OSX 10.3.  I don't know if __LITTLE_ENDIAN__ or __BIG_ENDIAN__ are defined in earlier versions of OSX, but since it only applies to 10.4+, as previous versions cannot run on Intel architectures, __LITTLE_ENDIAN__ is not defined and the PPC version of portable.h is used as expected.


----------------------------------------------------------------------

You can respond by visiting: 
http://wald.intevation.org/tracker/?func=detail&atid=205&aid=291&group_id=21




More information about the grass-dev mailing list