2008.05.30 17:18 "[Tiff] Re: [gdal-dev] Problem with libTiff on Solaris 10", by Even Rouault

2008.07.10 01:54 "[Tiff] Building a four way universal libtiff under OS X", by David Hoerl

Previously, i was able to build libtiff as a two-way 32bit/64bit library on either a Intel or a PPC machine. I could build it fully 4-way universal too, but it failed on the non-build platform.

I posted about this in Feb 2007.

What I found was that two tiff header files ended up with the wrong ENDIAN defines - these end up set to the build machine's values and not the architecture you are trying to build.

I'm almost certain that the root cause is this snippet from configure.ac:

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

dnl Configure legacy tifconf.h HOST_BIGENDIAN.

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

if test "$ac_cv_c_bigendian" = yes ; then
     HOST_BIGENDIAN=1
else
     HOST_BIGENDIAN=0
fi

AC_DEFINE_UNQUOTED(HOST_BIGENDIAN,$HOST_BIGENDIAN,[Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian (Intel)])

The variable ac_cv_c_bigendian is set in the configure script itself and reflects the host machine.

So, what I did was hacked my ksh script to run the affected header files through "sed" to properly set these values. The script builds 4-way Universal library (both a .a and a .dylib), but I have not yet verified that it functions properly on the alternate build machine (it should given the fix to the previously identified problem).

If anyone wants to download the script and try it, you can get it from: http://web.mac.com/dhoerl/Home/Tech_Blog/Tech_Blog.html

All you have to do is move it to the libtiff (3.8.2) top level directory and run it as ./UniBld.sh

David

PS: The 32 / 64 bit library has been working for me just fine for a few months now.