From patchwork Tue Feb 18 22:31:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Naour X-Patchwork-Id: 321693 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id CEFA92C0232 for ; Wed, 19 Feb 2014 09:32:08 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0BAAA8BB15; Tue, 18 Feb 2014 22:32:08 +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 VXLif3MK3WXp; Tue, 18 Feb 2014 22:32:06 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id B47088B83D; Tue, 18 Feb 2014 22:32:06 +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 3C2651C22FA for ; Tue, 18 Feb 2014 22:32:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 39EC78B83D for ; Tue, 18 Feb 2014 22:32:06 +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 BPiu5Y7GvN1x for ; Tue, 18 Feb 2014 22:32:03 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from smtp3-g21.free.fr (smtp3-g21.free.fr [212.27.42.3]) by whitealder.osuosl.org (Postfix) with ESMTP id E566B8B7B4 for ; Tue, 18 Feb 2014 22:32:01 +0000 (UTC) Received: from localhost.localdomain (unknown [81.57.22.125]) by smtp3-g21.free.fr (Postfix) with ESMTP id 70758A6225; Tue, 18 Feb 2014 23:31:56 +0100 (CET) From: Romain Naour To: buildroot@busybox.net Date: Tue, 18 Feb 2014 23:31:52 +0100 Message-Id: <1392762712-29657-1-git-send-email-romain.naour@openwide.fr> X-Mailer: git-send-email 1.8.5.3 Subject: [Buildroot] [PATCH v2 1/1] ncftp: fix cross-compilation test 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 The cross-compilation test is based on the ability to run a test program on the host, which is wrong. If it runs, then the configure script concludes that we're doing native compilation, if it doesn't run, we're doing cross-compilation. Replace it with a more correct test. Fixes http://autobuild.buildroot.net/results/969/969a49ae97a50634ea846a82b9c360e4fb020ace/build-end.log Signed-off-by: Romain Naour --- v2: Add a cross-compilation test suggested by Thomas Petazzoni. .../ncftp-0001-fix-cross-compilation-test.patch | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 package/ncftp/ncftp-0001-fix-cross-compilation-test.patch diff --git a/package/ncftp/ncftp-0001-fix-cross-compilation-test.patch b/package/ncftp/ncftp-0001-fix-cross-compilation-test.patch new file mode 100644 index 0000000..f92cce9 --- /dev/null +++ b/package/ncftp/ncftp-0001-fix-cross-compilation-test.patch @@ -0,0 +1,51 @@ +From 39396048bee3db9a29ec909aece1bdc6e6880e91 Mon Sep 17 00:00:00 2001 +From: Romain Naour +Date: Fri, 14 Feb 2014 02:21:57 +0100 +Subject: [PATCH 1/1] configure: fix cross-compilation test + +The cross-compilation test is based on the ability to run +a test program on the host, which is wrong. + +If it runs, then the configure script concludes +that we're doing native compilation, +if it doesn't run, we're doing cross-compilation. + +Replace it with a more correct test. + +Fixes +http://autobuild.buildroot.net/results/969/969a49ae97a50634ea846a82b9c360e4fb020ace/build-end.log + +Note: The case where --build and --host are used together is not handled. + +Signed-off-by: Romain Naour +--- + configure | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/configure b/configure +index 2f0fae0..2cfaa65 100755 +--- a/configure ++++ b/configure +@@ -1273,11 +1273,14 @@ main(){return(0);} + EOF + if { (eval echo configure:1275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes +- # If we can't run a trivial program, we are probably using a cross compiler. +- if (./conftest; exit) 2>/dev/null; then +- ac_cv_prog_cc_cross=no +- else +- ac_cv_prog_cc_cross=yes ++ if test "x$host_alias" != x; then ++ if test "x$build_alias" = x; then ++ cross_compiling=maybe ++ $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. ++ If a cross compiler is detected then cross compile mode will be used." >&2 ++ elif test "x$build_alias" != "x$host_alias"; then ++ cross_compiling=yes ++ fi + fi + else + echo "configure: failed program was:" >&5 +-- +1.8.5.3 +