From patchwork Tue Jan 14 21:23:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 310877 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 2E60E2C008F for ; Wed, 15 Jan 2014 08:24:27 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 8A77A32E80; Tue, 14 Jan 2014 21:24:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ztBm20X3aWT2; Tue, 14 Jan 2014 21:24:19 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id D36D132E1C; Tue, 14 Jan 2014 21:24:14 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 5DC6B1BF9A6 for ; Tue, 14 Jan 2014 21:24:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 5734B8459E for ; Tue, 14 Jan 2014 21:24:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fsn1Wa0OQ2Tj for ; Tue, 14 Jan 2014 21:24:09 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f49.google.com (mail-wg0-f49.google.com [74.125.82.49]) by whitealder.osuosl.org (Postfix) with ESMTPS id F1993894D7 for ; Tue, 14 Jan 2014 21:24:08 +0000 (UTC) Received: by mail-wg0-f49.google.com with SMTP id a1so981320wgh.16 for ; Tue, 14 Jan 2014 13:24:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=EvBcqoNonPa4dN/hd992iMv5cRxFN8FNmSwZIpspVZA=; b=AK7PeqQ748XBMjXaPwCAAqf1HxUC578CNrzZ6tVnjr3wO8sGzHOccX9aB17I97vcMX oXf3mUzbwmYPgc6QtvKjp9uQJYWIYhwsg0Wn6yBZyH2IMf0n4LIbfSe0dzrRaTcgObJ8 Pmlmpn8wGXdfSKvz0rseImHWRMHBZTZe5ueUDBSkw5+RRKKo424806u/ONsByzaRpKha 9Zwwh9snwuEJdSpIREbPQCdT9WCrOxTzuAFse64CNIv760Ua2r8cDo/xOaWPw5s01FUV EFviByW/V4nb4Fck+EBPmzaU6qBXFLqfRnMTDUSpHh1gIt3M76tNzgmCfbGkKBxaqymR 3dxA== X-Received: by 10.194.61.133 with SMTP id p5mr439512wjr.73.1389734647538; Tue, 14 Jan 2014 13:24:07 -0800 (PST) Received: from gourin.bzh.lan (ks3095497.kimsufi.com. [94.23.60.27]) by mx.google.com with ESMTPSA id md9sm25090269wic.1.2014.01.14.13.24.06 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 14 Jan 2014 13:24:06 -0800 (PST) From: "Yann E. MORIN" To: Simon Newton , Peter Newman Date: Tue, 14 Jan 2014 22:23:57 +0100 Message-Id: <1389734637-8329-3-git-send-email-yann.morin.1998@free.fr> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1389734637-8329-1-git-send-email-yann.morin.1998@free.fr> References: <1389734637-8329-1-git-send-email-yann.morin.1998@free.fr> Cc: buildroot@busybox.net, "Yann E. MORIN" Subject: [Buildroot] [PATCH 2/2] configure: add option for user to override checks for Python modules X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net From: "Yann E. MORIN" The check for google.protobuf is inherently flawed for cross-compilation, as it uses the host Python to check for target modules. In this case, it is not possible to check for a Pyhon modules altogether, and we need to rely on the user to properly tell us whether we do or do not have google.protobuf. This is done by adding am autoconf cache variable: ac_cv_have_pymod_google_protobuf which can be set to: - yes : force the test to be true - no : force the test to be false - (empty) : let the test decide This is then used in AX_PYTHON_MODULE to override the test. Currently, only the google.protobuf Python module is checked for, but the same could be done later on of other Python modules that may be added in the future, of course. Fixes configure-errors like: http://autobuild.buildroot.net/results/e63/e634d5f0cee3967caffaa6e7ada8c0968e3eff63/build-end.log Also fixes some under-quotation in the python module check. Signed-off-by: "Yann E. MORIN" --- config/ax_python_module.m4 | 11 ++++------- configure.ac | 4 +++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/config/ax_python_module.m4 b/config/ax_python_module.m4 index 96dd1ab..2910e88 100644 --- a/config/ax_python_module.m4 +++ b/config/ax_python_module.m4 @@ -25,20 +25,17 @@ AU_ALIAS([AC_PYTHON_MODULE], [AX_PYTHON_MODULE]) AC_DEFUN([AX_PYTHON_MODULE],[ - AC_MSG_CHECKING($PYTHON_NAME module: $1) $PYTHON -c "import $1" 2>/dev/null if test $? -eq 0; then - AC_MSG_RESULT(yes) - eval AS_TR_CPP(HAVE_PYMOD_$1)=yes + eval AS_TR_CPP([HAVE_PYMOD_$1])=yes else - AC_MSG_RESULT(no) - eval AS_TR_CPP(HAVE_PYMOD_$1)=no + eval AS_TR_CPP([HAVE_PYMOD_$1])=no # if test -n "$2" then - AC_MSG_ERROR(failed to find required module $1) - exit 1 + AC_MSG_ERROR([failed to find required module $1]) fi fi + AC_MSG_RESULT([AS_TR_CPP([HAVE_PYMOD_$1])]) ]) diff --git a/configure.ac b/configure.ac index 5f6f604..5994d06 100644 --- a/configure.ac +++ b/configure.ac @@ -574,7 +574,9 @@ if test "${enable_python_libs}" = "yes"; then PYTHON="python" fi PYTHON_NAME=`basename $PYTHON` - AX_PYTHON_MODULE("google.protobuf", "fatal") + AC_CACHE_CHECK([$PYTHON_NAME module: google.protobuf], + [ac_cv_have_pymod_google_protobuf], + [AX_PYTHON_MODULE([google.protobuf], [fatal])]) fi # Maybe build the logic sniffer tools