[FFmpeg-devel] [PATCH] configure: add libm ldflags globally
James Almer
jamrial at gmail.com
Mon Oct 16 19:31:43 EEST 2017
On 10/14/2017 12:59 PM, James Almer wrote:
> It's used by every library, and by making it global we simplify a lot
> of checks.
>
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
> configure | 18 +++++++-----------
> 1 file changed, 7 insertions(+), 11 deletions(-)
>
> diff --git a/configure b/configure
> index 22026ef832..a0bfb269e8 100755
> --- a/configure
> +++ b/configure
> @@ -3332,23 +3332,17 @@ cws2fws_extralibs="zlib_extralibs"
>
> # libraries, in linking order
> avcodec_deps="avutil"
> -avcodec_suggest="libm"
> avcodec_select="null_bsf"
> avdevice_deps="avformat avcodec avutil"
> -avdevice_suggest="libm"
> avfilter_deps="avutil"
> -avfilter_suggest="libm"
> avformat_deps="avcodec avutil"
> -avformat_suggest="libm network"
> +avformat_suggest="network"
> avresample_deps="avutil"
> -avresample_suggest="libm"
> -avutil_suggest="clock_gettime libm libdrm libmfx opencl user32 vaapi videotoolbox corefoundation corevideo coremedia wincrypt"
> +avutil_suggest="clock_gettime libdrm libmfx opencl user32 vaapi videotoolbox corefoundation corevideo coremedia wincrypt"
> postproc_deps="avutil gpl"
> -postproc_suggest="libm"
> swresample_deps="avutil"
> -swresample_suggest="libm libsoxr"
> +swresample_suggest="libsoxr"
> swscale_deps="avutil"
> -swscale_suggest="libm"
>
> avcodec_extralibs="pthreads_extralibs iconv_extralibs"
> avfilter_extralibs="pthreads_extralibs"
> @@ -5944,7 +5938,9 @@ enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma
> # On some systems dynamic loading requires no extra linker flags
> check_lib libdl dlfcn.h "dlopen dlsym" || check_lib libdl dlfcn.h "dlopen dlsym" -ldl
>
> -check_lib libm math.h sin -lm
> +# Add -lm to global extralibs if required. Every library uses it, and it simplifies
> +# several of the external library checks below.
> +check_lib libm math.h sin -lm && add_extralibs $libm_extralibs
>
> atan2f_args=2
> copysign_args=2
> @@ -6098,7 +6094,7 @@ enabled libx264 && { use_pkg_config libx264 x264 "stdint.h x264.h" x26
> enable libx262; }
> enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get &&
> require_cpp_condition x265.h "X265_BUILD >= 68"
> -enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
> +enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs"
> enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
> enabled libzimg && require_pkg_config libzimg "zimg >= 2.3.0" zimg.h zimg_get_api_version
> enabled libzmq && require_pkg_config libzmq libzmq zmq.h zmq_ctx_new
Ping for this and the other two patches in the thread.
More information about the ffmpeg-devel
mailing list