OS X version -- Issues

I've been working on getting the libraw library going with OS X and have hit several issues. If I build a simple test app and use the pre-built library, I can get things working just fine. The samples run as well. The issue comes when I try to build on Tiger and yet have support for Leopard.

The pre-built library appears to have been built on Leopard and wasn't built with support for 10.4. I modified the Makefile to add the required flags and build as a Universal Binary:

UBFLAGS = -arch i386 -arch ppc -I/Developer/SDKs/MacOSX10.4u.sdk/usr/include -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4
CFLAGS=${UBFLAGS} -O3 -I. -w

With a minor edit to libraw_internals.h to include one more file (to define off_t), we compile as a Universal Binary just fine:
#ifdef __APPLE__
#include // CELS
#endif

Now, I have a library that can be compiled against 10.4 or 10.5 along with the original library.

So, if I compile against the supplied binary and 10.5, and run my small test program (opens, unpacks, and processes an image), I get the expected output:

g++ -o test -Ilibraw -Llib -lraw test.cpp
./test
0.6.1-Release
Canon
Image size: 4290 x 2856

If I compile against 10.5 or 10.4 with my library (built for both), I get:
10.5: g++ -o test -Ilibraw -Llib -lraw test.cpp
10.4: g++ -o test -Ilibraw -Llib -lraw -mmacosx-version-min=10.4 -I/Developer/SDKs/MacOSX10.4u.sdk/usr/include -isysroot /Xcode2.5/SDKs/MacOSX10.4u.sdk test.cpp

./test
0.6.1-Release
Error unpacking: Unknown error code

It's not just my code. Here's the output of the "identify" sample with the stock library and with my compile to include 10.4 support:
./identify /Users/stark/temp/canon/IMG_0007.CR2
/Users/stark/temp/canon/IMG_0007.CR2 is a Canon EOS DIGITAL REBEL XSi image.

./identify /Users/stark/temp/canon/IMG_0007.CR2
/Users/stark/temp/canon/IMG_0007.CR2 is a image.

Has anyone tried anything compiling against 10.4 here? It seems something is clearly amok...

Craig

Forums: 

Unfortunately, I've no Mac

Unfortunately, I've no Mac with Mac OS X Tiger. Will try to find VMWare image to test.

-- Alex Tutubalin @LibRaw LLC