summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2009-12-11 17:00:39 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2009-12-11 17:00:39 +0100
commit5de4c2949b50992dd7c5063835301e5ff18e66cb (patch)
treeba5ee2fa165c196305264d4cd9dae7f70a5a081a
parent83270395db5c6e016076f0ea593594b057778e05 (diff)
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.
-rw-r--r--GNUmakefile3
-rw-r--r--Makefile3
-rw-r--r--mk/vars.mk1
-rw-r--r--package/iproute2/Makefile3
-rw-r--r--package/iproute2/patches/patch-netem_Makefile27
-rw-r--r--package/iproute2/patches/patch-netem_maketable_c11
-rw-r--r--package/iproute2/patches/patch-netem_normal_c10
-rw-r--r--package/iproute2/patches/patch-netem_paretonormal_c14
-rw-r--r--package/linux-atm/patches/patch-src_Makefile_in11
-rw-r--r--toolchain/kernel-headers/Makefile3
10 files changed, 82 insertions, 4 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 45bcb8e52..5d2279a17 100644
--- a/GNUmakefile
+++ b/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
diff --git a/Makefile b/Makefile
index eaddd6ca3..095336f08 100644
--- a/Makefile
+++ b/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
diff --git a/mk/vars.mk b/mk/vars.mk
index b68cd6297..7661ebb71 100644
--- a/mk/vars.mk
+++ b/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 \
diff --git a/package/iproute2/Makefile b/package/iproute2/Makefile
index 6dcc3947a..feae51b1c 100644
--- a/package/iproute2/Makefile
+++ b/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"
diff --git a/package/iproute2/patches/patch-netem_Makefile b/package/iproute2/patches/patch-netem_Makefile
new file mode 100644
index 000000000..325d01925
--- /dev/null
+++ b/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
diff --git a/package/iproute2/patches/patch-netem_maketable_c b/package/iproute2/patches/patch-netem_maketable_c
new file mode 100644
index 000000000..b6eb03405
--- /dev/null
+++ b/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>
diff --git a/package/iproute2/patches/patch-netem_normal_c b/package/iproute2/patches/patch-netem_normal_c
new file mode 100644
index 000000000..719899301
--- /dev/null
+++ b/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
diff --git a/package/iproute2/patches/patch-netem_paretonormal_c b/package/iproute2/patches/patch-netem_paretonormal_c
new file mode 100644
index 000000000..d2c2ac4b6
--- /dev/null
+++ b/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>
diff --git a/package/linux-atm/patches/patch-src_Makefile_in b/package/linux-atm/patches/patch-src_Makefile_in
new file mode 100644
index 000000000..be1ca26b5
--- /dev/null
+++ b/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
diff --git a/toolchain/kernel-headers/Makefile b/toolchain/kernel-headers/Makefile
index d13da8141..1d07edd2b 100644
--- a/toolchain/kernel-headers/Makefile
+++ b/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/