--- /dev/null
+#
+# Copyright (C) 2006-2009 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=mgen
+PKG_VERSION:=5.01b
+PKG_RELEASE:=1
+PKG_SOURCE:=src-$(PKG_NAME)-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=http://downloads.pf.itd.nrl.navy.mil/mgen/
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/mgen
+ TITLE:=Multi-Generator
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=+libpthread +uclibcxx
+ URL:=http://cs.itd.nrl.navy.mil/work/mgen/
+endef
+
+define Package/mgen/Description
+ The Multi-Generator (MGEN) is open source software developed by
+ the Naval Research Laboratory (NRL) PROTocol Engineering Advanced
+ Networking (PROTEAN) Research Group. MGEN provides the ability to
+ perform IP network performance tests and measurements using UDP/IP
+ traffic (TCP is currently being developed).
+endef
+
+define Build/Compile
+ $(MAKE) -C $(PKG_BUILD_DIR)/unix \
+ CC="$(TARGET_CXX)" \
+ CPPFLAGS="$(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/include/uClibc++ -fno-builtin -fno-rtti -nostdinc++" \
+ LDFLAGS="$(TARGET_LDFLAGS)" \
+ SYSTEM_LIBS="-ldl -lpthread -luClibc++" \
+ -f Makefile.linux mgen
+endef
+
+define Package/mgen/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) $(PKG_BUILD_DIR)/unix/mgen $(1)/usr/bin/mgen
+endef
+
+$(eval $(call BuildPackage,mgen))
--- /dev/null
+diff -urN mgen.old/protolib/unix/Makefile.linux mgen/protolib/unix/Makefile.linux
+--- mgen.old/protolib/unix/Makefile.linux 2008-03-07 22:23:06.000000000 +0100
++++ mgen/protolib/unix/Makefile.linux 2009-06-06 20:40:29.000000000 +0200
+@@ -39,7 +39,7 @@
+ # (We export these for other Makefiles as needed)
+ #
+
+-SYSTEM_HAVES = -DLINUX -DHAVE_IPV6 -DHAVE_GETLOGIN -D_FILE_OFFSET_BITS=64 -DHAVE_LOCKF \
++SYSTEM_HAVES = -DLINUX -DHAVE_GETLOGIN -D_FILE_OFFSET_BITS=64 -DHAVE_LOCKF \
+ -DHAVE_OLD_SIGNALHANDLER -DHAVE_DIRFD -DHAVE_ASSERT -DNO_SCM_RIGHTS -DHAVE_SCHED
+
+ # (TBD) Move ProtoRouteMgr to ProtokitEx ??
+diff -urN mgen.old/unix/Makefile.linux mgen/unix/Makefile.linux
+--- mgen.old/unix/Makefile.linux 2007-06-22 21:16:20.000000000 +0200
++++ mgen/unix/Makefile.linux 2009-06-06 20:40:10.000000000 +0200
+@@ -35,7 +35,7 @@
+ # (We export these for other Makefiles as needed)
+ #
+
+-SYSTEM_HAVES = -DLINUX -DHAVE_PSELECT -DHAVE_SCHED -DHAVE_IPV6 -DHAVE_GETLOGIN -DHAVE_LOCKF -DHAVE_DIRFD \
++SYSTEM_HAVES = -DLINUX -DHAVE_PSELECT -DHAVE_SCHED -DHAVE_GETLOGIN -DHAVE_LOCKF -DHAVE_DIRFD \
+ -DHAVE_ASSERT $(NETSEC)
+
+ SYSTEM = linux