开发者

How to compile LibJpeg in universal binary in Mac OSX 10.4

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=&qu开发者_C百科ot;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?


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜