From patchwork Mon May 7 16:39:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 157349 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 5E4A5B6FA7 for ; Tue, 8 May 2012 02:39:51 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 4A82720259; Mon, 7 May 2012 16:39:50 +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 BX2u7s+xLXO9; Mon, 7 May 2012 16:39:49 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id E2A65300BD; Mon, 7 May 2012 16:39:48 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id F3F028F753 for ; Mon, 7 May 2012 16:39:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id EDE6A300BD for ; Mon, 7 May 2012 16:39:46 +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 ss+SuZGGauGg for ; Mon, 7 May 2012 16:39:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [88.190.12.23]) by silver.osuosl.org (Postfix) with ESMTP id 8213A20259 for ; Mon, 7 May 2012 16:39:45 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id D644F18A; Mon, 7 May 2012 18:39:43 +0200 (CEST) Received: from localhost (humanoidz.org [82.247.183.72]) by mail.free-electrons.com (Postfix) with ESMTPSA id D8BC9142 for ; Mon, 7 May 2012 18:39:35 +0200 (CEST) From: Thomas Petazzoni To: buildroot@uclibc.org Date: Mon, 7 May 2012 18:39:31 +0200 Message-Id: <1336408773-27312-1-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 1.7.9.5 Subject: [Buildroot] [PATCH 1/2] iperf: fix build on !MMU platforms 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 Build tested on sh2a and blackfin architectures. Signed-off-by: Thomas Petazzoni --- package/iperf/iperf-add-pthread.patch | 25 +++++++++++++++ package/iperf/iperf-man-installation.patch | 15 +++++++++ package/iperf/iperf-no-mmu.patch | 48 ++++++++++++++++++++++++++++ package/iperf/iperf.mk | 2 +- 4 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 package/iperf/iperf-add-pthread.patch create mode 100644 package/iperf/iperf-man-installation.patch create mode 100644 package/iperf/iperf-no-mmu.patch diff --git a/package/iperf/iperf-add-pthread.patch b/package/iperf/iperf-add-pthread.patch new file mode 100644 index 0000000..4997b75 --- /dev/null +++ b/package/iperf/iperf-add-pthread.patch @@ -0,0 +1,25 @@ +Fix pthread link problem + +Some toolchains support linking against pthread by passing +-pthread. For such toolchains, iperf was working because +@PTHREAD_CFLAGS@ was used. + +However, some other toolchains (ex: Renesas 2010.09) requires passing +-lpthread to link against the pthread library. And this was breaking +in iperf because @PTHREAD_LIBS@ wasn't used. We fix this here. + +Signed-off-by: Thomas Petazzoni + +Index: b/src/Makefile.am +=================================================================== +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -12,7 +12,7 @@ + AM_CXXFLAGS = -Wall + AM_CFLAGS = -Wall + +-iperf_LDFLAGS = @CFLAGS@ @PTHREAD_CFLAGS@ @WEB100_CFLAGS@ @DEFS@ ++iperf_LDFLAGS = @CFLAGS@ @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ @WEB100_CFLAGS@ @DEFS@ + + iperf_SOURCES = \ + Client.cpp \ diff --git a/package/iperf/iperf-man-installation.patch b/package/iperf/iperf-man-installation.patch new file mode 100644 index 0000000..7c63b2d --- /dev/null +++ b/package/iperf/iperf-man-installation.patch @@ -0,0 +1,15 @@ +Fix man installation + +Using man_MANS and dist_man_MANS is redundant, and makes the Makefile +try to install twice the iperf.1 manpage, which fails. + +Signed-off-by: Thomas Petazzoni + +Index: b/man/Makefile.am +=================================================================== +--- a/man/Makefile.am ++++ b/man/Makefile.am +@@ -1,2 +1 @@ +-man_MANS = iperf.1 +-dist_man_MANS = $(man_MANS) ++dist_man_MANS = iperf.1 diff --git a/package/iperf/iperf-no-mmu.patch b/package/iperf/iperf-no-mmu.patch new file mode 100644 index 0000000..b9f89b2 --- /dev/null +++ b/package/iperf/iperf-no-mmu.patch @@ -0,0 +1,48 @@ +Add support for building in no-MMU mode + +This adds a check for the fork() function in configure.ac, then +conditionnally calls either fork() or vfork() depending on which one +is available. + +Signed-off-by: Thomas Petazzoni + +Index: b/configure.ac +=================================================================== +--- a/configure.ac ++++ b/configure.ac +@@ -66,6 +66,7 @@ + dnl check for -lnsl, -lsocket + AC_CHECK_FUNC(gethostbyname,,AC_CHECK_LIB(nsl, gethostbyname)) + AC_CHECK_FUNC(socket,,AC_CHECK_LIB(socket, socket)) ++AC_CHECK_FUNC(fork) + + dnl Checks for header files. + AC_HEADER_STDC +Index: b/src/Listener.cpp +=================================================================== +--- a/src/Listener.cpp ++++ b/src/Listener.cpp +@@ -679,7 +679,11 @@ + pid_t pid; + + /* Create a child process & if successful, exit from the parent process */ ++#ifndef HAVE_FORK ++ if ( (pid = vfork()) == -1 ) { ++#else + if ( (pid = fork()) == -1 ) { ++#endif + fprintf( stderr, "error in first child create\n"); + exit(0); + } else if ( pid != 0 ) { +@@ -695,7 +699,11 @@ + + + /* Now fork() and get released from the terminal */ ++#ifndef HAVE_FORK ++ if ( (pid = vfork()) == -1 ) { ++#else + if ( (pid = fork()) == -1 ) { ++#endif + fprintf( stderr, "error\n"); + exit(0); + } else if ( pid != 0 ) { diff --git a/package/iperf/iperf.mk b/package/iperf/iperf.mk index 26cd3fb..614f8f6 100644 --- a/package/iperf/iperf.mk +++ b/package/iperf/iperf.mk @@ -6,7 +6,7 @@ IPERF_VERSION = 2.0.5 IPERF_SOURCE = iperf-$(IPERF_VERSION).tar.gz IPERF_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/iperf - +IPERF_AUTORECONF = YES IPERF_CONF_ENV = \ ac_cv_func_malloc_0_nonnull=yes \ ac_cv_type_bool=yes \