mgen: fix build

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>

git-svn-id: svn://svn.openwrt.org/openwrt/packages@39813 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
florian 2014-03-08 00:57:10 +00:00
parent cd3b652fff
commit d1fbde20fc
3 changed files with 36 additions and 12 deletions

View 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

View 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)
#

View File

@ -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