Skip to content

Commit

Permalink
packages/iperf: use libstdcpp when using eglibc.
Browse files Browse the repository at this point in the history
Fix iperf Makefile to use libstdcpp instead of uclibc if compiling with eglibc toolchain.
Fix gnu_getopt.h file to avoid redefining a structure when getopt.h has already been included.
  • Loading branch information
xavileon committed Mar 26, 2012
1 parent 4c682c9 commit 1118352
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/iperf/Makefile
Expand Up @@ -23,7 +23,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/iperf/Default
SECTION:=net
CATEGORY:=Network
DEPENDS:= +uclibcxx
DEPENDS:= +USE_UCLIBC:uclibcxx +!USE_UCLIBC:libstdcpp
TITLE:=Internet Protocol bandwidth measuring tool
URL:=http://sourceforge.net/projects/iperf/
endef
Expand Down Expand Up @@ -67,7 +67,9 @@ else
CONFIGURE_VARS += ac_cv_func_pthread_cancel=no
endif

ifdef CONFIG_USE_UCLIBC
TARGET_CXX=g++-uc
endif

CONFIGURE_VARS += CXXFLAGS="$$$$CXXFLAGS -fno-rtti"

Expand Down
34 changes: 34 additions & 0 deletions net/iperf/patches/002-fix_gnugetopt_h.patch
@@ -0,0 +1,34 @@
--- a/include/gnu_getopt.h
+++ b/include/gnu_getopt.h
@@ -30,8 +30,8 @@
* $Id: gnu_getopt.h,v 1.1.1.1 2004/05/18 01:50:44 kgibbs Exp $
*/

-#ifndef _GETOPT_H
- #define _GETOPT_H 1
+#ifndef _GNU_GETOPT_H
+ #define _GNU_GETOPT_H 1

#ifdef __cplusplus
extern "C" {
@@ -92,12 +92,14 @@ extern int gnu_optopt;
/* has_arg can't be an enum because some compilers complain about
type mismatches in all the code that assumes it is an int. */

+#ifndef _GETOPT_H
struct option {
const char *name;
int has_arg;
int *flag;
int val;
};
+#endif

/* Names for the values of the `has_arg' field of `struct option'. */

@@ -133,4 +135,4 @@ int _gnu_getopt_internal( int argc,
} /* end extern "C" */
#endif

-#endif /* _GETOPT_H */
+#endif /* _GNU_GETOPT_H */

0 comments on commit 1118352

Please sign in to comment.