From patchwork Thu Sep 24 15:14:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karl Palsson X-Patchwork-Id: 522377 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 38CD41401AD for ; Fri, 25 Sep 2015 01:14:33 +1000 (AEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id C9F3628BFFF; Thu, 24 Sep 2015 17:12:54 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id B1CCD28BED6 for ; Thu, 24 Sep 2015 17:12:48 +0200 (CEST) X-policyd-weight: using cached result; rate: -8.5 Received: from palmtree.beeroclock.net (palmtree.beeroclock.net [178.79.160.154]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 24 Sep 2015 17:12:48 +0200 (CEST) Received: by palmtree.beeroclock.net (Postfix, from userid 1000) id CF39030034; Thu, 24 Sep 2015 15:14:04 +0000 (UTC) From: Karl Palsson To: openwrt-devel@lists.openwrt.org Date: Thu, 24 Sep 2015 15:14:04 +0000 Message-Id: <1443107644-8160-1-git-send-email-karlp@tweak.net.au> X-Mailer: git-send-email 1.7.9.5 Cc: Karl Palsson Subject: [OpenWrt-Devel] [PATCH] libubox: lua: use pkg-config built in module to search for alternatives X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" From: Karl Palsson Different distributions have different names for the lua 5.1 package. Use cmake's built in pkg-config support to search for the first one, rather than running it explicitly and searching for a single version. Signed-off-by: Karl Palsson --- Resending after running into this again on a fresh Fedora 22 install. There's a line further down that attempts to invoke "lua" that also fails if you have multiple versions of lua installed. I'm not sure how best to fix that though, other than to just remove it as a check. Perhaps if you you want to enable/disable the lua building, use cmake features for that, rather than testing for an executable lua? lua/CMakeLists.txt | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lua/CMakeLists.txt b/lua/CMakeLists.txt index 10c6dc1..34c9ab1 100644 --- a/lua/CMakeLists.txt +++ b/lua/CMakeLists.txt @@ -5,14 +5,7 @@ PROJECT(uloop C) SET(CMAKE_INSTALL_PREFIX /) IF(NOT LUA_CFLAGS) - FIND_PROGRAM(PKG_CONFIG pkg-config) - IF(PKG_CONFIG) - EXECUTE_PROCESS( - COMMAND pkg-config --silence-errors --cflags lua5.1 - OUTPUT_VARIABLE LUA_CFLAGS - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - ENDIF() + pkg_search_module(LUA lua5.1 lua-5.1) ENDIF() ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -I.. ${LUA_CFLAGS})