<div dir="ltr"><font face="georgia, serif">Hi</font><div><font face="georgia, serif"><br></font></div><div><font face="georgia, serif">I'm building ffmpeg-2.2.2 with libspeex on Mac.</font></div><div><font face="georgia, serif"><br>

</font></div><div><font face="georgia, serif">Libspeex is built using <span style="font-size:12px;background-color:rgb(255,255,255)"><font color="#ff0000">./configure --enable-shared --prefix=/Users/liyiran/test/libs</font></span></font></div>

<div><span style="color:rgb(41,249,20);font-size:12px;background-color:rgb(255,255,255)"><font face="georgia, serif"><br></font></span></div><div><span style="background-color:rgb(255,255,255)"><font face="georgia, serif"><span style="font-size:12px"><font color="#000000">Ffmpeg is built using</font><font color="#29f914"> </font></span><span style="font-size:12px"><font color="#ff0000">./configure --enable-shared --disable-static --extra-cflags="-I/Users/liyiran/test/libs/include" --extra-ldflags="-L/Users/liyiran/test/libs/lib" --enable-libspeex</font></span></font></span></div>

<div><span style="background-color:rgb(0,0,0);color:rgb(41,249,20);font-size:12px"><font face="georgia, serif"><br></font></span></div><div><font face="georgia, serif">But the problem is, every dylib generated depends on libspeex (When I built on Windows, only libavcodec.dll depends on libspeex instead).</font></div>

<div><font color="#ff0000" style="background-color:rgb(243,243,243)" face="georgia, serif"><br></font></div><div><font style="background-color:rgb(255,255,255)" color="#000000" face="georgia, serif">For example</font></div>

<div><font color="#ff0000" style="background-color:rgb(255,255,255)" face="georgia, serif"><br></font></div><div><p style="margin:0px;font-size:12px"><font color="#ff0000" style="background-color:rgb(255,255,255)" face="georgia, serif">libswresample.0.dylib:</font></p>


<p style="margin:0px;font-size:12px"><font color="#ff0000" style="background-color:rgb(255,255,255)" face="georgia, serif"><span class="" style="white-space:pre">        </span>/usr/local/lib/libswresample.0.dylib (compatibility version 0.0.0, current version 0.18.100)</font></p>


<p style="margin:0px;font-size:12px"><font color="#ff0000" style="background-color:rgb(255,255,255)" face="georgia, serif"><span class="" style="white-space:pre">        </span>/usr/local/lib/libavutil.52.dylib (compatibility version 52.0.0, current version 52.66.100)</font></p>


<p style="margin:0px;font-size:12px"><font color="#ff0000" style="background-color:rgb(255,255,255)" face="georgia, serif"><span class="" style="white-space:pre">        </span>/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 855.14.0)</font></p>


<p style="margin:0px;font-size:12px"><font color="#ff0000" style="background-color:rgb(255,255,255)" face="georgia, serif"><span class="" style="white-space:pre">        </span>/System/Library/Frameworks/VideoDecodeAcceleration.framework/Versions/A/VideoDecodeAcceleration (compatibility version 1.0.0, current version 1.0.0)</font></p>


<p style="margin:0px;font-size:12px"><font color="#ff0000" style="background-color:rgb(255,255,255)" face="georgia, serif"><span class="" style="white-space:pre">        </span>/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.8.0)</font></p>


<p style="margin:0px;font-size:12px"><font color="#ff0000" style="background-color:rgb(255,255,255)" face="georgia, serif"><span class="" style="white-space:pre">        </span>/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)</font></p>


<p style="margin:0px;font-size:12px"><font face="georgia, serif"><font style="background-color:rgb(255,255,255)"><span class="" style="color:rgb(255,0,0);white-space:pre">   </span><font color="#000000">/Users/liyiran/test/libs/lib/libspeex.1.dylib</font></font><font color="#ff0000" style="background-color:rgb(255,255,255)"> (compatibility version 7.0.0, current version 7.0.0)</font></font></p>


<p style="margin:0px;font-size:12px"><font color="#ff0000" style="background-color:rgb(255,255,255)" face="georgia, serif"><span class="" style="white-space:pre">        </span>/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)</font></p>


<p style="margin:0px;font-size:12px"><font color="#ff0000" style="background-color:rgb(255,255,255)" face="georgia, serif"><span class="" style="white-space:pre">        </span>/usr/lib/libbz2.1.0.dylib (compatibility version 1.0.0, current version 1.0.5)</font></p>


<p style="margin:0px;font-size:12px"><font color="#ff0000" style="background-color:rgb(255,255,255)" face="georgia, serif"><span class="" style="white-space:pre">        </span>/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)</font></p>

<p style="margin:0px;font-size:12px"><font color="#ff0000" style="background-color:rgb(255,255,255)" face="georgia, serif"><br></font></p><p style="margin:0px;font-size:12px"><font style="background-color:rgb(255,255,255)" color="#000000" face="georgia, serif">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:</font></p>

<p style="margin:0px;font-size:12px"><font style="background-color:rgb(255,255,255)" color="#000000" face="georgia, serif"><br></font></p><p style="margin:0px;font-size:12px"><span style="background-color:rgb(255,255,255)"><font color="#ff0000" face="georgia, serif">gcc is unable to create an executable file.</font></span></p>

<p style="margin:0px;font-size:12px"><span style="background-color:rgb(255,255,255)"><font color="#ff0000" face="georgia, serif">If gcc is a cross-compiler, use the --enable-cross-compile option.</font></span></p><p style="margin:0px;font-size:12px">

<span style="background-color:rgb(255,255,255)"><font color="#ff0000" face="georgia, serif">Only do this if you know what cross compiling means.</font></span></p><p style="margin:0px;font-size:12px">


</p><p style="margin:0px;font-size:12px"><span style="background-color:rgb(255,255,255)"><font color="#ff0000" face="georgia, serif">C compiler test failed.</font></span></p><p style="margin:0px;font-size:12px"><span style="background-color:rgb(255,255,255)"><font color="#ff0000" face="georgia, serif"><br>

</font></span></p><p style="margin:0px"><font face="georgia, serif"><font color="#000000"><span style="font-size:12px">And I found an article here saying that "-Wl,-as-needed has bug when using in auto tools project". </span></font><a href="https://sigquit.wordpress.com/2011/02/16/why-asneeded-doesnt-work-as-expected-for-your-libraries-on-your-autotools-project/">https://sigquit.wordpress.com/2011/02/16/why-asneeded-doesnt-work-as-expected-for-your-libraries-on-your-autotools-project/</a>  <span style="color:rgb(0,0,0);font-size:12px">I know ffmpeg is not an auto tool project, but is it possible to have the similar problem?</span></font></p>

<p style="margin:0px"><font face="georgia, serif"><span style="color:rgb(0,0,0);font-size:12px"><br></span></font></p><p style="margin:0px"><font face="georgia, serif"><span style="color:rgb(0,0,0);font-size:12px">Thanks</span></font></p>

</div></div>