[Libav-user] dependency on external libs on Mac

YIRAN LI mrfun.china at gmail.com
Sat May 10 04:35:00 CEST 2014


I'm building ffmpeg-2.2.2 with libspeex on Mac.

Libspeex is built using ./configure --enable-shared

Ffmpeg is built using ./configure --enable-shared --disable-static
--extra-ldflags="-L/Users/liyiran/test/libs/lib" --enable-libspeex

But the problem is, every dylib generated depends on libspeex (When I built
on Windows, only libavcodec.dll depends on libspeex instead).

For example


/usr/local/lib/libswresample.0.dylib (compatibility version 0.0.0, current
version 0.18.100)

/usr/local/lib/libavutil.52.dylib (compatibility version 52.0.0, current
version 52.66.100)

(compatibility version 150.0.0, current version 855.14.0)

(compatibility version 1.0.0, current version 1.0.0)

(compatibility version 1.2.0, current version 1.8.0)

/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version

/Users/liyiran/test/libs/lib/libspeex.1.dylib (compatibility version 7.0.0,
current version 7.0.0)

/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version

/usr/lib/libbz2.1.0.dylib (compatibility version 1.0.0, current version

/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)

Is there any way to configure so that each component only links with
libspeex if it really uses it? I tried --extra-ldflags="-Wl,--as-needed"
but met an error:

gcc is unable to create an executable file.

If gcc is a cross-compiler, use the --enable-cross-compile option.

Only do this if you know what cross compiling means.

C compiler test failed.

And I found an article here saying that "-Wl,-as-needed has bug when using
in auto tools project".
know ffmpeg is not an auto tool project, but is it possible to have the
similar problem?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20140510/62f59697/attachment.html>

More information about the Libav-user mailing list