mgen: fix build
authorFlorian Fainelli <florian@openwrt.org>
Sat, 8 Mar 2014 00:57:10 +0000 (00:57 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Sat, 8 Mar 2014 00:57:10 +0000 (00:57 +0000)
mgen build was spectacularly broken, not even being cross-compiled for the
target, fix that and make sure that we use the toolchain binaries were
relevant.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
SVN-Revision: 39813

net/mgen/Makefile
net/mgen/patches/100-ipv6.patch
net/mgen/patches/200-cflags_override.patch [new file with mode: 0644]

index 3ad35aedb937f8578790545e80ca681f43f1a839..13ec1b2124d5cc4f5551e072607e4743327643e7 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2010 OpenWrt.org
+# Copyright (C) 2006-2014 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mgen
 PKG_VERSION:=5.01b
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=src-$(PKG_NAME)-$(PKG_VERSION).tgz
 PKG_SOURCE_URL:=http://downloads.pf.itd.nrl.navy.mil/mgen/
@@ -38,9 +38,10 @@ endef
 
 define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR)/unix \
+               $(TARGET_CONFIGURE_OPTS) \
                CC="$(TARGET_CXX)" \
-               CPPFLAGS="$(TARGET_CPPFLAGS)"  \
-               LDFLAGS="$(TARGET_LDFLAGS)" \
+               SYSTEM_INCLUDES="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
+               SYSTEM_LDFLAGS="$(TARGET_LDFLAGS)" \
                SYSTEM_LIBS="-ldl -lpthread" \
                -f Makefile.linux mgen
 endef
index 4878a96976b3aa6b3780003f74fe2e11e13aaa16..2e193ecd4862c64ae7ff76c69493f59c60fe3062 100644 (file)
@@ -1,7 +1,6 @@
-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 @@
+--- a/protolib/unix/Makefile.linux
++++ b/protolib/unix/Makefile.linux
+@@ -39,7 +39,7 @@ SYSTEM_LIBS = -ldl -lrt
  # (We export these for other Makefiles as needed)
  #
  
@@ -10,10 +9,9 @@ diff -urN mgen.old/protolib/unix/Makefile.linux mgen/protolib/unix/Makefile.linu
  -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 @@
+--- a/unix/Makefile.linux
++++ b/unix/Makefile.linux
+@@ -35,7 +35,7 @@ SYSTEM_LIBS = -ldl -lpthread
  # (We export these for other Makefiles as needed)
  #
  
diff --git a/net/mgen/patches/200-cflags_override.patch b/net/mgen/patches/200-cflags_override.patch
new file mode 100644 (file)
index 0000000..0e78d1f
--- /dev/null
@@ -0,0 +1,25 @@
+--- a/unix/Makefile.linux
++++ b/unix/Makefile.linux
+@@ -5,8 +5,8 @@
+ # 1) System specific additional libraries, include paths, etc
+ #    (Where to find X11 libraries, etc)
+ #
+-SYSTEM_INCLUDES = -I/usr/X11R6/include 
+-SYSTEM_LDFLAGS = -L/usr/X11R6/lib 
++SYSTEM_INCLUDES ?= -I/usr/X11R6/include 
++SYSTEM_LDFLAGS ?= -L/usr/X11R6/lib 
+ SYSTEM_LIBS = -ldl -lpthread
+ # 2) System specific capabilities
+@@ -39,8 +39,8 @@ SYSTEM_HAVES = -DLINUX -DHAVE_PSELECT -D
+ -DHAVE_ASSERT $(NETSEC)
+ SYSTEM = linux
+-CC = g++
+-RANLIB = ranlib
+-AR = ar
++CC ?= g++
++RANLIB ?= ranlib
++AR ?= ar
+ include Makefile.common