Browse Source

make iproute compilable on FreeBSD host

make an extra linux-headers dir in STAGING_DIR for special
cases, where host gcc is used, but kernel headers from Linux
are needed. Move GNU make specific export to GNUMakefile.
Waldemar Brodkorb 14 years ago
parent
commit
5de4c2949b

+ 3 - 0
GNUmakefile

@@ -4,6 +4,9 @@
 TOPDIR:=	$(shell pwd)
 PWD:=		${TOPDIR}
 
+ADKVERSION=	0.1.0
+export ADKVERSION
+
 ifneq (${package},)
 subdir:=	package/${package}
 _subdir_dep:=	${TOPDIR}/.cfg/ADK_HAVE_DOT_CONFIG

+ 0 - 3
Makefile

@@ -1,9 +1,6 @@
 # This file is part of the OpenADK project. OpenADK is copyrighted
 # material, please see the LICENCE file in the top-level directory.
 
-ADKVERSION=	0.1.0
-export ADKVERSION
-
 CC=		gcc
 GMAKE?=		$(PWD)/scripts/make
 GMAKE_FMK=	${GMAKE} -f $(PWD)/mk/build.mk

+ 1 - 0
mk/vars.mk

@@ -54,6 +54,7 @@ TARGET_LDFLAGS+=	-Wl,-O2
 PATCH=			${BASH} $(SCRIPT_DIR)/patch.sh
 SED:=			sed -i -e
 LINUX_DIR:=		$(BUILD_DIR)/linux
+LINUX_HEADER_DIR:=	$(STAGING_DIR)/linux-header
 
 TARGET_CONFIGURE_OPTS=	PATH='${TARGET_PATH}' \
 			AR=$(TARGET_CROSS)ar \

+ 2 - 1
package/iproute2/Makefile

@@ -36,7 +36,8 @@ $(eval $(call PKG_template,RTMON,rtmon,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPEN
 $(eval $(call PKG_template,SS,ss,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS_SS},${PKG_DESCR_SS},${PKG_SECTION}))
 
 TCFLAGS+=		-D_GNU_SOURCE
-XAKE_FLAGS+=		CCOPTS="${TCFLAGS}" MFLAGS="CC=${TARGET_CC}"
+XAKE_FLAGS+=		CCOPTS="${TCFLAGS}" MFLAGS="CC=${TARGET_CC}" \
+			HOSTCFLAGS="-I${LINUX_HEADER_DIR}/include"
 
 CONFIGURE_STYLE:=	gnu
 CONFIGURE_FLAGS+=	KERNEL_INCLUDE="${LINUX_DIR}/include"

+ 27 - 0
package/iproute2/patches/patch-netem_Makefile

@@ -0,0 +1,27 @@
+--- iproute2-2.6.29-1.orig/netem/Makefile	2009-03-24 23:40:54.000000000 +0100
++++ iproute2-2.6.29-1/netem/Makefile	2009-12-11 16:39:15.000000000 +0100
+@@ -2,13 +2,13 @@ DISTGEN = maketable normal pareto pareto
+ DISTDATA = normal.dist pareto.dist paretonormal.dist experimental.dist
+ 
+ HOSTCC ?= $(CC)
+-CCOPTS  = $(CBUILD_CFLAGS)
++HOSTCFLAGS ?= 
+ LDLIBS += -lm 
+ 
+ all: $(DISTGEN) $(DISTDATA)
+ 
+ $(DISTGEN):
+-	$(HOSTCC) $(CCOPTS) -I../include -o $@ $@.c -lm
++	$(HOSTCC) $(HOSTCFLAGS) -I../include -o $@ $@.c -lm
+ 
+ %.dist: %
+ 	./$* > $@
+@@ -17,7 +17,7 @@ experimental.dist: maketable experimenta
+ 	./maketable experimental.dat > experimental.dist
+ 
+ stats: stats.c
+-	$(HOSTCC) $(CCOPTS) -I../include -o $@ $@.c -lm
++	$(HOSTCC) $(HOSTCFLAGS) -I../include -o $@ $@.c -lm
+ 
+ install: all
+ 	mkdir -p $(DESTDIR)/lib/tc

+ 11 - 0
package/iproute2/patches/patch-netem_maketable_c

@@ -0,0 +1,11 @@
+--- iproute2-2.6.29-1.orig/netem/maketable.c	2009-03-24 23:40:54.000000000 +0100
++++ iproute2-2.6.29-1/netem/maketable.c	2009-12-11 16:32:33.000000000 +0100
+@@ -10,7 +10,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <math.h>
+-#include <malloc.h>
++#include <stdlib.h>
+ #include <string.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>

+ 10 - 0
package/iproute2/patches/patch-netem_normal_c

@@ -0,0 +1,10 @@
+--- iproute2-2.6.29-1.orig/netem/normal.c	2009-03-24 23:40:54.000000000 +0100
++++ iproute2-2.6.29-1/netem/normal.c	2009-12-11 16:35:38.000000000 +0100
+@@ -8,7 +8,6 @@
+ #include <string.h>
+ #include <limits.h>
+ 
+-#include <linux/types.h>
+ #include <linux/pkt_sched.h>
+ 
+ #define TABLESIZE 16384

+ 14 - 0
package/iproute2/patches/patch-netem_paretonormal_c

@@ -0,0 +1,14 @@
+--- iproute2-2.6.29-1.orig/netem/paretonormal.c	2009-03-24 23:40:54.000000000 +0100
++++ iproute2-2.6.29-1/netem/paretonormal.c	2009-12-11 16:59:02.000000000 +0100
+@@ -11,11 +11,9 @@
+  */
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <stdlib.h>
+ #include <string.h>
+ #include <math.h>
+ #include <limits.h>
+-#include <malloc.h>
+ 
+ #include <linux/types.h>
+ #include <linux/pkt_sched.h>

+ 11 - 0
package/linux-atm/patches/patch-src_Makefile_in

@@ -0,0 +1,11 @@
+--- linux-atm-2.5.0.orig/src/Makefile.in	2007-12-29 21:31:30.000000000 +0100
++++ linux-atm-2.5.0/src/Makefile.in	2009-12-11 15:54:54.000000000 +0100
+@@ -179,7 +179,7 @@ target_os = @target_os@
+ target_vendor = @target_vendor@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+-SUBDIRS = include lib test debug qgen saal sigd maint arpd ilmid man led lane \
++SUBDIRS = include lib debug qgen saal sigd maint arpd ilmid man led lane \
+ 		mpoad oamd switch config extra br2684
+ 
+ all: all-recursive

+ 3 - 0
toolchain/kernel-headers/Makefile

@@ -13,6 +13,9 @@ $(WRKBUILD)/.headers:
 	$(MAKE) -C $(WRKBUILD) ARCH=$(ARCH) V=1 \
 		INSTALL_HDR_PATH=$(TOOLCHAIN_SYSROOT)/usr \
 		headers_install
+	$(MAKE) -C $(WRKBUILD) ARCH=$(ARCH) V=1 \
+		INSTALL_HDR_PATH=$(LINUX_HEADER_DIR) \
+		headers_install
 	# cryptodev.h from ocf-linux-20080917
 	mkdir -p ${STAGING_DIR}/usr/include/crypto
 	cp files/cryptodev.h ${STAGING_DIR}/usr/include/crypto/