From patchwork Fri Feb 6 09:25:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lionel Orry X-Patchwork-Id: 437129 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id DC1231402A2 for ; Fri, 6 Feb 2015 20:26:42 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2DA86A1957; Fri, 6 Feb 2015 09:26:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CDrcbOzNoVEc; Fri, 6 Feb 2015 09:26:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id DFBB7A1924; Fri, 6 Feb 2015 09:26:39 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 98BD71C24B7 for ; Fri, 6 Feb 2015 09:26:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 92D2893624 for ; Fri, 6 Feb 2015 09:26:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id H0KhAWoCvdCG for ; Fri, 6 Feb 2015 09:26:37 +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 hemlock.osuosl.org (Postfix) with ESMTPS id E034E9361B for ; Fri, 6 Feb 2015 09:26:36 +0000 (UTC) Received: by mail-wg0-f49.google.com with SMTP id k14so12315761wgh.8 for ; Fri, 06 Feb 2015 01:26:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=EFGZCLd8WJ6Fq1KdJA2O3VmyYCe9SGQop8Wq2L5UqV0=; b=mj5b/2/W+1iyN82YXJZJbd7XdyrXyFEXTO/XSpu9kyKcaDuMLmbIoSaku8mU+Zbd5Z wt659cNqhYlApU6kPUievsk95CZafUnvhb61HkDfRnglg0N/u/JA4vGEyPxIph9FM4uc b7Y2EYSvzgRlWtXLn0Ou2P4tEKgF6RmQvINFZtFYKbV4p6LhYLJ4PF1PHJoRM4Y7deHw oiPBwy6gQNVKRbXjyyyc3cyb+fAYuChJBrYcMGHdt4PFuNzfz3LjcCRk89l1REcRe8hB QpNZW1GBoYhx2LxnlUu7a5ZzSpuU7q2bm5MnhmAzAJDQU5OXBhL8rzML3LiegTDN+/a6 imjQ== X-Received: by 10.180.73.241 with SMTP id o17mr1435556wiv.16.1423214794155; Fri, 06 Feb 2015 01:26:34 -0800 (PST) Received: from lor_dev.emsys (mut38-h03-62-34-159-145.dsl.sta.abo.bbox.fr. [62.34.159.145]) by mx.google.com with ESMTPSA id p6sm619512wia.14.2015.02.06.01.26.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Feb 2015 01:26:33 -0800 (PST) From: Lionel Orry To: buildroot@buildroot.org Date: Fri, 6 Feb 2015 10:25:52 +0100 Message-Id: <1423214752-29779-1-git-send-email-lionel.orry@gmail.com> X-Mailer: git-send-email 2.1.0 Subject: [Buildroot] [PATCH 1/1] package/zeromq: enable kernel-based feature flags X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 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" The current configuration system does not check for cached variables for these flags, and thus they are always disabled when cross-compiling. This patch fixes the configuration system to use cached variables and enables them at configuration time. Signed-off-by: Lionel Orry --- ...e.m4-make-kernel-specific-flags-cacheable.patch | 204 +++++++++++++++++++++ package/zeromq/zeromq.mk | 10 + 2 files changed, 214 insertions(+) create mode 100644 package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch diff --git a/package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch b/package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch new file mode 100644 index 0000000..9b6e808 --- /dev/null +++ b/package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch @@ -0,0 +1,204 @@ +From 2eee4dd2b1668124f377f6da1d511249086a1449 Mon Sep 17 00:00:00 2001 +From: Lionel Orry +Date: Fri, 6 Feb 2015 09:45:21 +0100 +Subject: [PATCH 1/1] acinclude.m4: make kernel-specific flags cacheable + +Specifically when cross-compiling, one can be willing to force these +variable values using the environment of a config.cache file. This +commit makes this possible. + +The affected variables are: + +* libzmq_cv_sock_cloexec +* libzmq_cv_so_keepalive +* libzmq_cv_tcp_keepcnt +* libzmq_cv_tcp_keepidle +* libzmq_cv_tcp_keepintvl +* libzmq_cv_tcp_keepalive + +Signed-off-by: Lionel Orry +--- + acinclude.m4 | 84 ++++++++++++++++++++++++++++++++++-------------------------- + 1 file changed, 48 insertions(+), 36 deletions(-) + +diff --git a/acinclude.m4 b/acinclude.m4 +index c5c2748..b40f0c1 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -586,8 +586,8 @@ dnl # LIBZMQ_CHECK_SOCK_CLOEXEC([action-if-found], [action-if-not-found]) + dnl # Check if SOCK_CLOEXEC is supported # + dnl ################################################################################ + AC_DEFUN([LIBZMQ_CHECK_SOCK_CLOEXEC], [{ +- AC_MSG_CHECKING(whether SOCK_CLOEXEC is supported) +- AC_TRY_RUN([/* SOCK_CLOEXEC test */ ++ AC_CACHE_CHECK([whether SOCK_CLOEXEC is supported], [libzmq_cv_sock_cloexec], ++ [AC_TRY_RUN([/* SOCK_CLOEXEC test */ + #include + #include + +@@ -596,11 +596,13 @@ int main (int argc, char *argv []) + int s = socket (PF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0); + return (s == -1); + } +- ], +- [AC_MSG_RESULT(yes) ; libzmq_cv_sock_cloexec="yes" ; $1], +- [AC_MSG_RESULT(no) ; libzmq_cv_sock_cloexec="no" ; $2], +- [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_sock_cloexec="no"] ++ ], ++ [libzmq_cv_sock_cloexec="yes"], ++ [libzmq_cv_sock_cloexec="no"], ++ [libzmq_cv_sock_cloexec="not during cross-compile"] ++ )] + ) ++ AS_IF([test "x$libzmq_cv_sock_cloexec" = "xyes"], [$1], [$2]) + }]) + + dnl ################################################################################ +@@ -608,8 +610,8 @@ dnl # LIBZMQ_CHECK_SO_KEEPALIVE([action-if-found], [action-if-not-found]) + dnl # Check if SO_KEEPALIVE is supported # + dnl ################################################################################ + AC_DEFUN([LIBZMQ_CHECK_SO_KEEPALIVE], [{ +- AC_MSG_CHECKING(whether SO_KEEPALIVE is supported) +- AC_TRY_RUN([/* SO_KEEPALIVE test */ ++ AC_CACHE_CHECK([whether SO_KEEPALIVE is supported], [libzmq_cv_so_keepalive], ++ [AC_TRY_RUN([/* SO_KEEPALIVE test */ + #include + #include + +@@ -621,11 +623,13 @@ int main (int argc, char *argv []) + ((rc = setsockopt (s, SOL_SOCKET, SO_KEEPALIVE, (char*) &opt, sizeof (int))) == -1) + ); + } +- ], +- [AC_MSG_RESULT(yes) ; libzmq_cv_so_keepalive="yes" ; $1], +- [AC_MSG_RESULT(no) ; libzmq_cv_so_keepalive="no" ; $2], +- [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_so_keepalive="no"] ++ ], ++ [libzmq_cv_so_keepalive="yes"], ++ [libzmq_cv_so_keepalive="no"], ++ [libzmq_cv_so_keepalive="not during cross-compile"] ++ )] + ) ++ AS_IF([test "x$libzmq_cv_so_keepalive" = "xyes"], [$1], [$2]) + }]) + + dnl ################################################################################ +@@ -633,8 +637,8 @@ dnl # LIBZMQ_CHECK_TCP_KEEPCNT([action-if-found], [action-if-not-found]) + dnl # Check if TCP_KEEPCNT is supported # + dnl ################################################################################ + AC_DEFUN([LIBZMQ_CHECK_TCP_KEEPCNT], [{ +- AC_MSG_CHECKING(whether TCP_KEEPCNT is supported) +- AC_TRY_RUN([/* TCP_KEEPCNT test */ ++ AC_CACHE_CHECK([whether TCP_KEEPCNT is supported], [libzmq_cv_tcp_keepcnt], ++ [AC_TRY_RUN([/* TCP_KEEPCNT test */ + #include + #include + #include +@@ -649,11 +653,13 @@ int main (int argc, char *argv []) + ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPCNT, (char*) &opt, sizeof (int))) == -1) + ); + } +- ], +- [AC_MSG_RESULT(yes) ; libzmq_cv_tcp_keepcnt="yes" ; $1], +- [AC_MSG_RESULT(no) ; libzmq_cv_tcp_keepcnt="no" ; $2], +- [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_tcp_keepcnt="no"] ++ ], ++ [libzmq_cv_tcp_keepcnt="yes"], ++ [libzmq_cv_tcp_keepcnt="no"], ++ [libzmq_cv_tcp_keepcnt="not during cross-compile"] ++ )] + ) ++ AS_IF([test "x$libzmq_cv_tcp_keepcnt" = "xyes"], [$1], [$2]) + }]) + + dnl ################################################################################ +@@ -661,8 +667,8 @@ dnl # LIBZMQ_CHECK_TCP_KEEPIDLE([action-if-found], [action-if-not-found]) + dnl # Check if TCP_KEEPIDLE is supported # + dnl ################################################################################ + AC_DEFUN([LIBZMQ_CHECK_TCP_KEEPIDLE], [{ +- AC_MSG_CHECKING(whether TCP_KEEPIDLE is supported) +- AC_TRY_RUN([/* TCP_KEEPIDLE test */ ++ AC_CACHE_CHECK([whether TCP_KEEPIDLE is supported], [libzmq_cv_tcp_keepidle], ++ [AC_TRY_RUN([/* TCP_KEEPIDLE test */ + #include + #include + #include +@@ -677,11 +683,13 @@ int main (int argc, char *argv []) + ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPIDLE, (char*) &opt, sizeof (int))) == -1) + ); + } +- ], +- [AC_MSG_RESULT(yes) ; libzmq_cv_tcp_keepidle="yes" ; $1], +- [AC_MSG_RESULT(no) ; libzmq_cv_tcp_keepidle="no" ; $2], +- [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_tcp_keepidle="no"] ++ ], ++ [libzmq_cv_tcp_keepidle="yes"], ++ [libzmq_cv_tcp_keepidle="no"], ++ [libzmq_cv_tcp_keepidle="not during cross-compile"] ++ )] + ) ++ AS_IF([test "x$libzmq_cv_tcp_keepidle" = "xyes"], [$1], [$2]) + }]) + + dnl ################################################################################ +@@ -689,8 +697,8 @@ dnl # LIBZMQ_CHECK_TCP_KEEPINTVL([action-if-found], [action-if-not-found]) + dnl # Check if TCP_KEEPINTVL is supported # + dnl ################################################################################ + AC_DEFUN([LIBZMQ_CHECK_TCP_KEEPINTVL], [{ +- AC_MSG_CHECKING(whether TCP_KEEPINTVL is supported) +- AC_TRY_RUN([/* TCP_KEEPINTVL test */ ++ AC_CACHE_CHECK([whether TCP_KEEPINTVL is supported], [libzmq_cv_tcp_keepintvl], ++ [AC_TRY_RUN([/* TCP_KEEPINTVL test */ + #include + #include + #include +@@ -705,11 +713,13 @@ int main (int argc, char *argv []) + ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPINTVL, (char*) &opt, sizeof (int))) == -1) + ); + } +- ], +- [AC_MSG_RESULT(yes) ; libzmq_cv_tcp_keepintvl="yes" ; $1], +- [AC_MSG_RESULT(no) ; libzmq_cv_tcp_keepintvl="no" ; $2], +- [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_tcp_keepintvl="no"] ++ ], ++ [libzmq_cv_tcp_keepintvl="yes"], ++ [libzmq_cv_tcp_keepintvl="no"], ++ [libzmq_cv_tcp_keepintvl="not during cross-compile"] ++ )] + ) ++ AS_IF([test "x$libzmq_cv_tcp_keepintvl" = "xyes"], [$1], [$2]) + }]) + + dnl ################################################################################ +@@ -717,8 +727,8 @@ dnl # LIBZMQ_CHECK_TCP_KEEPALIVE([action-if-found], [action-if-not-found]) + dnl # Check if TCP_KEEPALIVE is supported # + dnl ################################################################################ + AC_DEFUN([LIBZMQ_CHECK_TCP_KEEPALIVE], [{ +- AC_MSG_CHECKING(whether TCP_KEEPALIVE is supported) +- AC_TRY_RUN([/* TCP_KEEPALIVE test */ ++ AC_CACHE_CHECK([whether TCP_KEEPALIVE is supported], [libzmq_cv_tcp_keepalive], ++ [AC_TRY_RUN([/* TCP_KEEPALIVE test */ + #include + #include + #include +@@ -733,11 +743,13 @@ int main (int argc, char *argv []) + ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPALIVE, (char*) &opt, sizeof (int))) == -1) + ); + } +- ], +- [AC_MSG_RESULT(yes) ; libzmq_cv_tcp_keepalive="yes" ; $1], +- [AC_MSG_RESULT(no) ; libzmq_cv_tcp_keepalive="no" ; $2], +- [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_tcp_keepalive="no"] ++ ], ++ [libzmq_cv_tcp_keepalive="yes"], ++ [libzmq_cv_tcp_keepalive="no"], ++ [libzmq_cv_tcp_keepalive="not during cross-compile"] ++ )] + ) ++ AS_IF([test "x$libzmq_cv_tcp_keepalive" = "xyes"], [$1], [$2]) + }]) + + dnl ################################################################################ +-- +2.1.0 + diff --git a/package/zeromq/zeromq.mk b/package/zeromq/zeromq.mk index e8f7c57..ad41671 100644 --- a/package/zeromq/zeromq.mk +++ b/package/zeromq/zeromq.mk @@ -11,8 +11,18 @@ ZEROMQ_DEPENDENCIES = util-linux ZEROMQ_LICENSE = LGPLv3+ with exceptions ZEROMQ_LICENSE_FILES = COPYING COPYING.LESSER # For 0001-tests-disable-test_fork-if-fork-is-not-available.patch +# and 0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch ZEROMQ_AUTORECONF = YES +# Assume these flags are always available. It is true, at least for +# SOCK_CLOEXEC, since linux v2.6.27. +# Note: the flag TCP_KEEPALIVE is NOT available so we do not include it. +ZEROMQ_CONF_ENV = libzmq_cv_sock_cloexec=yes \ + libzmq_cv_so_keepalive=yes \ + libzmq_cv_tcp_keepcnt=yes \ + libzmq_cv_tcp_keepidle=yes \ + libzmq_cv_tcp_keepintvl=yes + # Only tools/curve_keygen.c needs this, but it doesn't hurt to pass it # for the rest of the build as well (which automatically includes stdc++). ifeq ($(BR2_STATIC_LIBS),y)