[x264-devel] Re: Build issue

Peter Grayson jpgrayson at gmail.com
Fri Dec 8 21:53:59 CET 2006


On 12/8/06, David Rosenstiehl <trendywanabee at free.fr> wrote:
> Ok, so I downloaded the latest xcode this night, and now ./configure
> && make works.
>
> Except that if I do a ./configure --enable-shared, it doesn't :
>
> nasm -O2 -f macho -DPREFIX -Icommon/i386/ -o common/i386/deblock-a.o
> common/i386/deblock-a.asm
> gcc -shared -o libx264.so.54 common/mc.o common/predict.o common/
> pixel.o common/macroblock.o common/frame.o common/dct.o common/cpu.o
> common/cabac.o common/common.o common/mdate.o common/csp.o common/
> set.o common/quant.o encoder/analyse.o encoder/me.o encoder/
> ratecontrol.o encoder/set.o encoder/macroblock.o encoder/cabac.o
> encoder/cavlc.o encoder/encoder.o encoder/eval.o common/i386/mc-c.o
> common/i386/predict-c.o common/i386/dct-a.o common/i386/cpu-a.o
> common/i386/pixel-a.o common/i386/mc-a.o common/i386/mc-a2.o common/
> i386/predict-a.o common/i386/pixel-sse2.o common/i386/quant-a.o
> common/i386/deblock-a.o -Wl,-soname,libx264.so.54 -lm -lmx -lpthread -s
> i686-apple-darwin8-gcc-4.0.1: unrecognized option '-shared'
> /usr/bin/ld: unknown flag: -soname
> collect2: ld returned 1 exit status
> make: *** [libx264.so.54] Error 1
>
> Any idea on this one ?

I have run into this one also. The x264 has a number of problems
surrounding building as a dynamic library on mac. The primary one is
the one you ran into -- on mac, the correct gcc option to build a
shared library is "-dynamic" not "-shared". But that's just the tip of
the iceberg.

The next problem is that "-fno-common" is needed to make the link step work.

Also, it seems that -fPIC must be used when building a dynamic
library, but the configure script does not enforce this dependency.

The other obvious problem is that the library is called libx264.so.54.
On mac, the library should be called libx264.54.dylib and the symlink
libx264.dylib. The dynamic link editor (dyld) won't find the library.

Fixing this requires changes to the Makefile and configure script. I
have a patch that partially resolves this issue. I did not yet address
the symlink being ill-named.

Pete
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x264-darwin-build.patch
Type: application/octet-stream
Size: 1590 bytes
Desc: not available
Url : http://mailman.videolan.org/pipermail/x264-devel/attachments/20061208/c606b196/attachment.obj 


More information about the x264-devel mailing list