From patchwork Fri Apr 14 00:56:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Levinson X-Patchwork-Id: 3408 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.3.129 with SMTP id 123csp40244vsd; Thu, 13 Apr 2017 17:56:59 -0700 (PDT) X-Received: by 10.28.91.1 with SMTP id p1mr27032311wmb.63.1492131418979; Thu, 13 Apr 2017 17:56:58 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id y6si15531236wmb.39.2017.04.13.17.56.58; Thu, 13 Apr 2017 17:56:58 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7132F68995A; Fri, 14 Apr 2017 03:56:48 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from white.spiritone.com (white.spiritone.com [216.99.193.38]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D44F0680A80 for ; Fri, 14 Apr 2017 03:56:41 +0300 (EEST) Received: from [192.168.3.100] (184-100-162-109.ptld.qwest.net [184.100.162.109]) by white.spiritone.com (Postfix) with ESMTPSA id 7B46F73402CF for ; Thu, 13 Apr 2017 17:56:46 -0700 (PDT) To: FFmpeg development discussions and patches From: Aaron Levinson Message-ID: <2e3d0aae-32c0-ffc1-d1f5-f76884ab67b2@aracnet.com> Date: Thu, 13 Apr 2017 17:56:44 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] Enhanced require_pkg_config() in configure to fallback to require() if pkg-config is missing 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From 48f7daba16e0fcdb83d9abd254800c7b9f4ab684 Mon Sep 17 00:00:00 2001 From: Aaron Levinson Date: Thu, 13 Apr 2017 17:30:47 -0700 Subject: [PATCH] Enhanced require_pkg_config() in configure to fallback to require() if pkg-config is missing Purpose: Enhanced require_pkg_config() in configure to fallback to require() if pkg-config is missing Notes: This is likely mainly of relevance when building with MSVC on Windows. In my case, I used this approach to get libmfx when invoking configure with --enable-libmfx, which is used for QuickSync (QSV). Comments: -- configure: Enhanced require_pkg_config() function to first check if $pkg_config is not false. If not false, it goes through the standard steps of calling use_pkg_config(), but if false, it issues a log message and then calls require() with all the inputted arguments and an additional argument: -l$1. So, for something like "require_pkg_config libmfx "mfx/mfxvideo.h" MFXInit", this becomes "require libmfx "mfx/mfxvideo.h" MFXInit -llibmfx". This is not a perfect solution, but the previous approach didn't work at all before when require_pkg_config() is used. --- configure | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 7f2b653..ad08b82 100755 --- a/configure +++ b/configure @@ -1347,7 +1347,12 @@ use_pkg_config(){ } require_pkg_config(){ - use_pkg_config "$@" || die "ERROR: $pkg not found using pkg-config$pkg_config_fail_message" + if test $pkg_config != false; then + use_pkg_config "$@" || die "ERROR: $pkg not found using pkg-config$pkg_config_fail_message" + else + log require_pkg_config "No pkg-config, using require for $@" + require "$@ -l$1" + fi } require_libfreetype(){