From patchwork Sat Oct 14 15:59:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 5561 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.90 with SMTP id m26csp1910366jah; Sat, 14 Oct 2017 08:59:50 -0700 (PDT) X-Received: by 10.28.87.13 with SMTP id l13mr3796787wmb.45.1507996790295; Sat, 14 Oct 2017 08:59:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507996790; cv=none; d=google.com; s=arc-20160816; b=NDrV8VKfiX1hxBd24WdemsSwGsOhzxMUkS00N6QvAQPgyGWCItZ7G1tyfQ2j1sdSWK o0UVy1qmxRtbtfV17+vRpJVgSIBoTgKCLTUowILPH4KjPGe9Na/ol5rXzDZSHpOqNCCw JzkntbB0BN7//4muZcMC3+F98TShAdgLVknHYkrP1Z/k/FhfxGJT1dpPT0re+iX5r3ZM 27sKvZUAPVkWW8ZI4yhZiPqHnUJpzSrKp1/XdxPG3JBxho66Ypqwk9kTT7lluzOv4/zW qoW3SM3KaU9zqXfpPUQetFGlXhI1/0N9J3rD8MgMy4ePstu8G8jdTbsF5/ox+eYlTQzZ A/xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=psjD+SN84NZkCSyyopP5SjJjQQHd7VqcyX0SDlUyVGM=; b=C5qSfYQZeUZ1UXiXqV4Vh3FBf6UkHFkBX10yq7goCJn3C0fwa1Gf5cYnIIGdEbsdHm wPWguMzB+xMPxjVfkXcW1xSH6iaTOWLoPxlE142xle1Vt7KbBebA6Wt4NI0v3z7IMPJo zUIwKHE5BnLz8g4RJomplrh2pTjSNlWwQmIWvCELifeIfQNdwUtBUeKp/hZnqPTdvD1b 77Xit1463JMe8ty2wco3fzko/RRokqeWLc6psH84lLPIv+B3vFp2g3O1rxR2q7jNxuKr 8FZcBwgZhKVeruIf48DzvIVFV2MS+63g04yjlaFuQycF0rYTjWBCcBFRMvc1oN3SwUAO 4kvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=D1f7WHSw; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id p2si2751263wme.5.2017.10.14.08.59.49; Sat, 14 Oct 2017 08:59:50 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=D1f7WHSw; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7DA9C68A15C; Sat, 14 Oct 2017 18:59:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qt0-f194.google.com (mail-qt0-f194.google.com [209.85.216.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7F8E5689FCD for ; Sat, 14 Oct 2017 18:59:38 +0300 (EEST) Received: by mail-qt0-f194.google.com with SMTP id z50so24615076qtj.4 for ; Sat, 14 Oct 2017 08:59:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=fPd6asMuqvxc+YiKYwNAMH+Kww+JLPyBU9VlXigg2I8=; b=D1f7WHSwnwfCbaJjDlJsYAzcaEe1dhjanT1IuLEToBG5z1AIQvCEdmGsvQilGNCm// 3ALblnOgt3GJI2TSvMrIzru16lSjVghApdnXnCfh9ZiWr/wSzVsoCPPyPkS03PkRMeAz VyFADKRcErk6mb4OjldWms51EPN6X5myzk3eiDmsZUlYqwAeM+IsGXBJOZIbCzjse9lx PpjZFnXmCmU/xf8O+60it7IdhMHWdWd8xci39tQXC2jTGLgVQlg0qx57Hs84KYZKsoxk 9NJPk08t1g7gS5vZOiOPi2vZtbWqgqjq/2eLY0LyArL68H+WKwJ2d4OyjQ4wcBtluBcn jMvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=fPd6asMuqvxc+YiKYwNAMH+Kww+JLPyBU9VlXigg2I8=; b=Ys3zIyWkl4XjwerH68T1sqtAHWu5ObyQZXVA8vW/9NuWGcuvB6YXgX3a0CD9JJCHPM bNz6r/OIIFDQW0NOIjouavB8BqHsnzbmyOrMzWdGnpspkXIHhIdPkCtbOyi46nR9AAfJ 3QL/+WyHAgO0FmcdRoDlz11KYQ9HogYPBpp0O2tG6N0hYjJtTkhly49hn8JW5RXRnxjv 6pdhnEdKdlsKw0ro7W7sxzpi5DihnQd3lskxQYty3tSpAbKJisVquF7ImGV2W/huuDLC lsAUW/H0vMPSr765fuC4EiX8OHLHs5ZQ5LT6/+6LhcIqm+rLRbLOVS7sM8EfG4guSCqg Nf0Q== X-Gm-Message-State: AMCzsaWvfnOxTcdBl7hKSLUtL3mmkKnU2HGwsYGuko101084Z+vThhWA g37EbBg0KYwRU9zSfLqG8ABGbg== X-Google-Smtp-Source: AOwi7QCcqqlKyrGEouEr9zUI5PI0/e6FXx8HtJ2rjEo/7A6LDGm0+EYEaIYCx8sQ9fsmoQ6kYCmrxw== X-Received: by 10.237.38.36 with SMTP id z33mr7044562qtc.258.1507996780479; Sat, 14 Oct 2017 08:59:40 -0700 (PDT) Received: from localhost.localdomain ([181.231.68.242]) by smtp.gmail.com with ESMTPSA id q82sm2084104qki.34.2017.10.14.08.59.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 14 Oct 2017 08:59:40 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sat, 14 Oct 2017 12:59:26 -0300 Message-Id: <20171014155926.5276-1-jamrial@gmail.com> X-Mailer: git-send-email 2.14.2 Subject: [FFmpeg-devel] [PATCH] configure: add libm ldflags globally X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" It's used by every library, and by making it global we simplify a lot of checks. Signed-off-by: James Almer --- 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