1

I want to compile jpeg-8b in universal binary (ppc,i386). It should be supported in 10.4 and later OSs. I could do it in 10.5 and 10.6, but the binary is not compatible with 10.4. Thus I tried to compile it in 10.4, but it fails.

This is my code

cd jpeg-8b

sudo ./configure CC="gcc -arch i386  -arch ppc" CXX="g++ -arch i386 -arch ppc" CPP="gcc -E" CXXCPP="g++ -E" -enable-static=yes -enable-shared=no

It fails with the error configure: error: C compiler cannot create executables

How can I compile jpeg-8b in MacOS 10.4?

Adriaan
  • 17,741
  • 7
  • 42
  • 75
Dhanaraj
  • 987
  • 1
  • 10
  • 26

2 Answers2

3

Can you try compiling it on 10.5/10.6 with 10.4 SDK installed and using:

export MACOSX_DEPLOYMENT_TARGET="10.4"
export OSX_SDK="/Developer/SDKs/MacOSX10.4.sdk"
export OSX_CFLAGS="-isysroot $OSX_SDK -arch ppc -arch i386"
export OSX_LDFLAGS="-Wl,-syslibroot,$OSX_SDK -arch ppc -arch i386"
export CFLAGS="$CFLAGS $OSX_CFLAGS"
export CXXFLAGS="$CXXFLAGS $OSX_CFLAGS"
export LDFLAGS="$LDFLAGS $OSX_LDFLAGS"
export ARCHFLAGS="-arch ppc -arch i386"

and try adding --disable-dependency-tracking to ./configure

atopuzov
  • 76
  • 3
  • Do i have to set the GCC to 4.0, as only 10.5 and above supports gcc 4.2 – Dhanaraj Dec 24 '10 at 05:53
  • I don't think so, you are running it on 10.5/10.6 and only _compiling_ for 10.4. But if it fails with 4.2 you can always try with 4.0. – atopuzov Dec 28 '10 at 23:37
0

It worked for me after adding export CFLAGS="-arch x86_64 -arch arm64" before calling config. See GitHub gist

alexb
  • 1
  • 1