summaryrefslogtreecommitdiff
path: root/toolchain
diff options
context:
space:
mode:
authorwbx <wbx@hydrogenium.(none)>2009-05-17 14:41:34 +0200
committerwbx <wbx@hydrogenium.(none)>2009-05-17 14:41:34 +0200
commit219a6dab8995aad9ac4860cc1a84d6f3509a03a4 (patch)
treeb9c0f3c43aebba2fcfef777592d0add39f2072f4 /toolchain
Initial import
Diffstat (limited to 'toolchain')
-rw-r--r--toolchain/Makefile92
-rw-r--r--toolchain/binutils/Makefile43
-rw-r--r--toolchain/binutils/Makefile.inc11
-rw-r--r--toolchain/gcc/Makefile100
-rw-r--r--toolchain/gcc/Makefile.inc11
-rw-r--r--toolchain/gcc/patches/arm-softfloat-libgcc.patch29
-rw-r--r--toolchain/gdb/Config.in8
-rw-r--r--toolchain/gdb/Makefile47
-rw-r--r--toolchain/gdb/Makefile.inc11
-rw-r--r--toolchain/glibc/Makefile99
-rw-r--r--toolchain/glibc/Makefile.inc10
-rw-r--r--toolchain/glibc/patches/binutils.patch12
-rw-r--r--toolchain/glibc/patches/gcc43.patch18
-rw-r--r--toolchain/glibc/patches/i586-chk.patch15
-rw-r--r--toolchain/glibc/patches/install-extra.patch84
-rw-r--r--toolchain/glibc/patches/make-install-lib.patch17
-rw-r--r--toolchain/gmp/Makefile32
-rw-r--r--toolchain/gmp/Makefile.inc12
-rw-r--r--toolchain/kernel-headers/Makefile32
-rw-r--r--toolchain/kernel-headers/files/cryptodev.h478
-rw-r--r--toolchain/kernel-headers/patches/cleankernel.patch11
-rw-r--r--toolchain/kernel-headers/patches/etrax-header.patch68
-rw-r--r--toolchain/mpfr/Makefile33
-rw-r--r--toolchain/mpfr/Makefile.inc11
-rw-r--r--toolchain/rules.mk7
-rw-r--r--toolchain/uClibc/Makefile72
-rw-r--r--toolchain/uClibc/Makefile.inc11
27 files changed, 1374 insertions, 0 deletions
diff --git a/toolchain/Makefile b/toolchain/Makefile
new file mode 100644
index 000000000..de1c19024
--- /dev/null
+++ b/toolchain/Makefile
@@ -0,0 +1,92 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+TARGETS:=binutils gmp mpfr gcc
+ifeq ($(ADK_TARGET_LIB_GLIBC),y)
+TARGETS+=glibc
+LIBC:=glibc
+else
+TARGETS+=uClibc
+LIBC:=uClibc
+endif
+TARGETS+=gdb
+
+DOWNLOAD:=kernel-headers-download $(patsubst %,%-download,$(TARGETS))
+TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS))
+TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
+
+all: install
+install: $(TARGETS_INSTALL)
+clean: $(TARGETS_CLEAN)
+download: $(DOWNLOAD)
+
+$(LIBC)-prepare: kernel-headers-prepare
+binutils-prepare: $(LIBC)-prepare
+gcc-configure: binutils-install gmp-install mpfr-install
+$(LIBC)-compile: gcc-configure
+gcc-compile: $(LIBC)-install
+
+$(STAGING_TOOLS):
+ @mkdir -p $(STAGING_TOOLS)/lib
+ @mkdir -p $(STAGING_TOOLS)/include
+ @mkdir -p $(STAGING_TOOLS)/$(REAL_GNU_TARGET_NAME)
+ @ln -sf ../lib $(STAGING_TOOLS)/$(REAL_GNU_TARGET_NAME)/lib
+
+$(TOOLCHAIN_BUILD_DIR):
+ @mkdir -p $(TOOLCHAIN_BUILD_DIR)
+
+%-download:
+ $(TRACE) toolchain/$(patsubst %-download,%,$@)/download
+ $(MAKE) -C $(patsubst %-download,%,$@) fetch
+
+%-prepare: $(STAGING_TOOLS) $(TOOLCHAIN_BUILD_DIR)
+ $(TRACE) toolchain/$(patsubst %-prepare,%,$@)/prepare
+ @if test x"$(patsubst %-prepare,%,$@)" = x"$(LIBC)"; then \
+ $(MAKE) -C $(patsubst %-prepare,%,$@) prepare \
+ $(MAKE_TRACE); \
+ else \
+ $(MAKE) -C $(patsubst %-prepare,%,$@) prepare \
+ CC='$(HOSTCC)' CFLAGS='$(HOSTCFLAGS)' \
+ $(MAKE_TRACE); \
+ fi
+
+%-configure: %-prepare
+ $(TRACE) toolchain/$(patsubst %-configure,%,$@)/configure
+ @if test x"$(patsubst %-configure,%,$@)" = x"$(LIBC)"; then \
+ $(MAKE) -C $(patsubst %-configure,%,$@) configure \
+ $(MAKE_TRACE); \
+ else \
+ $(MAKE) -C $(patsubst %-configure,%,$@) configure \
+ CC='$(HOSTCC)' CFLAGS='$(HOSTCFLAGS)' \
+ $(MAKE_TRACE); \
+ fi
+
+%-compile: %-configure
+ $(TRACE) toolchain/$(patsubst %-compile,%,$@)/compile
+ @if test x"$(patsubst %-compile,%,$@)" = x"$(LIBC)"; then \
+ $(MAKE) -C $(patsubst %-compile,%,$@) compile \
+ $(MAKE_TRACE); \
+ else \
+ $(MAKE) -C $(patsubst %-compile,%,$@) compile \
+ CC='$(HOSTCC)' CFLAGS='$(HOSTCFLAGS)' \
+ $(MAKE_TRACE); \
+ fi
+
+%-install: %-compile
+ $(TRACE) toolchain/$(patsubst %-install,%,$@)/install
+ @if test x"$(patsubst %-install,%,$@)" = x"$(LIBC)"; then \
+ $(MAKE) -C $(patsubst %-install,%,$@) install \
+ $(MAKE_TRACE); \
+ else \
+ $(MAKE) -C $(patsubst %-install,%,$@) install \
+ CC='$(HOSTCC)' CFLAGS='$(HOSTCFLAGS)' \
+ $(MAKE_TRACE); \
+ fi
+
+%-clean:
+ $(TRACE) toolchain/$(patsubst %-clean,%,$@)/clean
+ @$(MAKE) -C $(patsubst %-clean,%,$@) clean $(MAKE_TRACE)
diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile
new file mode 100644
index 000000000..217b8e77b
--- /dev/null
+++ b/toolchain/binutils/Makefile
@@ -0,0 +1,43 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include ../rules.mk
+include Makefile.inc
+include ${TOPDIR}/mk/buildhlp.mk
+
+ifeq ($(ADK_SSP),y)
+CONFOPTS+= --enable-libssp
+else
+CONFOPTS+= --disable-libssp
+endif
+
+$(WRKBUILD)/.headers:
+$(WRKBUILD)/.configure_done:
+ (cd $(WRKBUILD); \
+ $(WRKBUILD)/configure \
+ --prefix=$(STAGING_TOOLS) \
+ --build=$(GNU_HOST_NAME) \
+ --host=$(GNU_HOST_NAME) \
+ --target=$(REAL_GNU_TARGET_NAME) \
+ --disable-nls \
+ --with-sysroot=$(TOOLCHAIN_SYSROOT) \
+ --with-sysroot=$(STAGING_DIR) \
+ ${CONFOPTS} \
+ --disable-dependency-tracking \
+ --disable-libtool-lock \
+ --disable-werror \
+ );
+ touch $@
+
+$(WRKBUILD)/.compiled: $(WRKBUILD)/.configure_done
+ $(MAKE) -C $(WRKBUILD) all
+ touch $@
+
+$(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
+ $(MAKE) -C $(WRKBUILD) install
+ touch $@
+
+include ${TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/binutils/Makefile.inc b/toolchain/binutils/Makefile.inc
new file mode 100644
index 000000000..bf6a71bdf
--- /dev/null
+++ b/toolchain/binutils/Makefile.inc
@@ -0,0 +1,11 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+PKG_NAME:= binutils
+PKG_VERSION:= 2.19.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 09a8c5821a2dfdbb20665bc0bd680791
+MASTER_SITES:= ${MASTER_SITE_GNU:=binutils/}
+DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.bz2
diff --git a/toolchain/gcc/Makefile b/toolchain/gcc/Makefile
new file mode 100644
index 000000000..a85e4fa74
--- /dev/null
+++ b/toolchain/gcc/Makefile
@@ -0,0 +1,100 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include ../rules.mk
+include Makefile.inc
+
+
+ifeq ($(ADK_CXX),y)
+TARGET_LANGUAGES:= c,c++
+else
+TARGET_LANGUAGES:= c
+endif
+
+GCC_CONFOPTS= --prefix=$(STAGING_TOOLS) \
+ --build=$(GNU_HOST_NAME) \
+ --host=$(GNU_HOST_NAME) \
+ --target=$(REAL_GNU_TARGET_NAME) \
+ --with-gmp=$(STAGING_TOOLS) \
+ --with-mpfr=$(STAGING_TOOLS) \
+ --disable-__cxa_atexit \
+ --enable-target-optspace \
+ --with-gnu-ld \
+ --disable-libmudflap \
+ --disable-libgomp \
+ --disable-multilib \
+ --disable-nls
+
+ifeq ($(ADK_SSP),y)
+GCC_CONFOPTS+= --enable-libssp
+else
+GCC_CONFOPTS+= --disable-libssp
+endif
+
+ifeq ($(ADK_NO_FPU),y)
+GCC_CONFOPTS+= --with-float=soft
+endif
+
+include ${TOPDIR}/mk/buildhlp.mk
+
+GCC_BUILD_DIR1:= $(WRKBUILD)-initial
+GCC_BUILD_DIR2:= $(WRKBUILD)-final
+
+$(WRKBUILD)/.headers:
+$(GCC_BUILD_DIR1)/.configured:
+ rm -rf $(STAGING_TOOLS)/$(REAL_GNU_TARGET_NAME)/sys-include
+ ln -sf ${STAGING_DIR}/include $(STAGING_TOOLS)/$(REAL_GNU_TARGET_NAME)/sys-include
+ rm -rf ${STAGING_TOOLS}/$(REAL_GNU_TARGET_NAME)/lib
+ ln -sf ${STAGING_DIR}/lib $(STAGING_TOOLS)/$(REAL_GNU_TARGET_NAME)/lib
+ mkdir -p $(GCC_BUILD_DIR1)
+ (cd $(GCC_BUILD_DIR1); rm -f config.cache; PATH=$(TARGET_PATH) \
+ $(WRKBUILD)/configure \
+ ${GCC_CONFOPTS} \
+ --enable-languages=c \
+ --disable-shared \
+ --with-sysroot=$(TOOLCHAIN_SYSROOT) \
+ );
+ touch $@
+
+$(GCC_BUILD_DIR1)/.compiled: $(GCC_BUILD_DIR1)/.configured
+ PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) all-gcc all-target-libgcc
+ touch $@
+
+$(WRKBUILD)/.configure_done: $(GCC_BUILD_DIR1)/.compiled
+ PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) install-gcc install-target-libgcc
+ touch $@
+
+$(GCC_BUILD_DIR2)/.configured:
+ mkdir -p $(GCC_BUILD_DIR2)
+ (cd $(GCC_BUILD_DIR2); rm -f config.cache; PATH=$(TARGET_PATH) \
+ $(WRKBUILD)/configure \
+ ${GCC_CONFOPTS} \
+ --enable-languages=$(TARGET_LANGUAGES) \
+ --with-sysroot=$(STAGING_DIR) \
+ --enable-shared \
+ );
+ touch $@
+
+$(WRKBUILD)/.compiled: $(GCC_BUILD_DIR2)/.configured
+ PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR2) all
+ touch $@
+
+$(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
+ PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR2) install
+ echo $(GCC_VERSION) > $(STAGING_TOOLS)/gcc_version
+ # Set up the symlinks to enable lying about target name.
+ set -e; \
+ (cd $(STAGING_TOOLS); \
+ ln -sf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \
+ cd bin; \
+ for app in $(REAL_GNU_TARGET_NAME)-* ; do \
+ ln -sf $${app} \
+ $(GNU_TARGET_NAME)$${app##$(REAL_GNU_TARGET_NAME)}; \
+ done; \
+ )
+ touch $@
+
+include ${TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/gcc/Makefile.inc b/toolchain/gcc/Makefile.inc
new file mode 100644
index 000000000..6d8be0f9d
--- /dev/null
+++ b/toolchain/gcc/Makefile.inc
@@ -0,0 +1,11 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+PKG_NAME:= gcc
+PKG_VERSION:= 4.3.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= cc3c5565fdb9ab87a05ddb106ba0bd1f
+MASTER_SITES:= ${MASTER_SITE_GNU:=gcc/gcc-${PKG_VERSION}/}
+DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.bz2
diff --git a/toolchain/gcc/patches/arm-softfloat-libgcc.patch b/toolchain/gcc/patches/arm-softfloat-libgcc.patch
new file mode 100644
index 000000000..1639c39a8
--- /dev/null
+++ b/toolchain/gcc/patches/arm-softfloat-libgcc.patch
@@ -0,0 +1,29 @@
+Index: gcc-4.3.0/gcc/config/arm/t-linux
+===================================================================
+--- gcc-4.3.0/gcc/config/arm/t-linux (revision 129896)
++++ gcc-4.3.0/gcc/config/arm/t-linux (working copy)
+@@ -3,7 +3,10 @@
+ TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
+
+ LIB1ASMSRC = arm/lib1funcs.asm
+-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
++LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
++ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
++ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
++ _fixsfsi _fixunssfsi _floatdidf _floatundidf _floatdisf _floatundisf
+
+ # MULTILIB_OPTIONS = mhard-float/msoft-float
+ # MULTILIB_DIRNAMES = hard-float soft-float
+Index: gcc-4.3.0/gcc/config/arm/linux-elf.h
+===================================================================
+--- gcc-4.3.0/gcc/config/arm/linux-elf.h (revision 129896)
++++ gcc-4.3.0/gcc/config/arm/linux-elf.h (working copy)
+@@ -48,7 +62,7 @@
+ %{shared:-lc} \
+ %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
+
+-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
++#define LIBGCC_SPEC "-lgcc"
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+
diff --git a/toolchain/gdb/Config.in b/toolchain/gdb/Config.in
new file mode 100644
index 000000000..03ceced0e
--- /dev/null
+++ b/toolchain/gdb/Config.in
@@ -0,0 +1,8 @@
+comment "Gdb Options"
+
+config ADK_PACKAGE_GDB_CLIENT
+ bool "Build gdb client for the Host"
+ default n
+ help
+ Build gdb to run on the host to debug programs running on the target.
+
diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile
new file mode 100644
index 000000000..32e059334
--- /dev/null
+++ b/toolchain/gdb/Makefile
@@ -0,0 +1,47 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include ../rules.mk
+include Makefile.inc
+
+include ${TOPDIR}/mk/buildhlp.mk
+
+$(WRKBUILD)/.headers:
+$(WRKBUILD)/.configure_done:
+ (cd $(WRKBUILD); \
+ gdb_cv_func_sigsetjmp=yes \
+ ./configure \
+ --prefix=$(STAGING_TOOLS) \
+ --build=$(GNU_HOST_NAME) \
+ --host=$(GNU_HOST_NAME) \
+ --target=$(REAL_GNU_TARGET_NAME) \
+ --disable-dependency-tracking \
+ --without-uiout \
+ --enable-gdbmi \
+ --disable-gdbtk \
+ --without-included-gettext \
+ --disable-libtool-lock \
+ --disable-nls \
+ --with-curses \
+ --enable-threads \
+ --disable-sim \
+ --disable-tui \
+ --disable-werror \
+ --without-x \
+ );
+ touch $@
+
+$(WRKBUILD)/.compiled:
+ $(MAKE) -C $(WRKBUILD) CFLAGS="-fPIC ${HOSTCFLAGS}"
+ touch $@
+
+$(WRKBUILD)/.installed:
+ install -c $(WRKBUILD)/gdb/gdb $(TARGET_CROSS)gdb
+ cd $(STAGING_TOOLS)/bin && \
+ ln -fs $(TARGET_CROSS)gdb $(GNU_TARGET_NAME)-gdb
+ touch $@
+
+include ${TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/gdb/Makefile.inc b/toolchain/gdb/Makefile.inc
new file mode 100644
index 000000000..106ca30b8
--- /dev/null
+++ b/toolchain/gdb/Makefile.inc
@@ -0,0 +1,11 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+PKG_NAME:= gdb
+PKG_VERSION:= 6.8
+PKG_MD5SUM:= c9da266b884fb8fa54df786dfaadbc7a
+PKG_RELEASE:= 1
+MASTER_SITES:= ${MASTER_SITE_GNU:=gdb/}
+DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.bz2
diff --git a/toolchain/glibc/Makefile b/toolchain/glibc/Makefile
new file mode 100644
index 000000000..a819c65d9
--- /dev/null
+++ b/toolchain/glibc/Makefile
@@ -0,0 +1,99 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+_IN_CVTC= 1
+
+include $(TOPDIR)/rules.mk
+include ../rules.mk
+include Makefile.inc
+
+include ${TOPDIR}/mk/buildhlp.mk
+
+ifeq ($(ADK_NO_FPU),y)
+GLIBC_CONFOPTS:= --without-fp
+endif
+
+GLIBC_BUILD_DIR:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-headers
+GLIBC_BUILD_DIR2:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-final
+
+$(WRKBUILD)/.headers_configure:
+ mkdir -p $(GLIBC_BUILD_DIR)
+ (cd $(GLIBC_BUILD_DIR); \
+ $(WRKBUILD)/configure \
+ --prefix=/usr \
+ --build=$(GNU_HOST_NAME) \
+ --host=$(GNU_HOST_NAME) \
+ --target=$(REAL_GNU_TARGET_NAME) \
+ --disable-nls \
+ --without-cvs \
+ --disable-sanity-checks \
+ ${GLIBC_CONFOPTS} \
+ --with-headers=$(TOOLCHAIN_SYSROOT)/usr/include \
+ --with-sysroot=$(TOOLCHAIN_SYSROOT) \
+ );
+ touch $@
+
+$(WRKBUILD)/.headers: $(WRKBUILD)/.headers_configure
+ $(MAKE) -C $(GLIBC_BUILD_DIR) \
+ cross-compiling=yes \
+ install_root=$(TOOLCHAIN_SYSROOT) \
+ CFLAGS="-DBOOTSTRAP_GCC" install-headers
+ touch $(TOOLCHAIN_SYSROOT)/usr/include/gnu/stubs.h
+ $(CP) $(GLIBC_BUILD_DIR)/bits/stdio_lim.h \
+ $(TOOLCHAIN_SYSROOT)/usr/include/bits
+ touch $@
+
+$(WRKBUILD)/.configure_done:
+ mkdir -p $(GLIBC_BUILD_DIR2)
+ (cd $(GLIBC_BUILD_DIR2); \
+ PATH='${TARGET_PATH}' \
+ BUILD_CC=gcc \
+ CFLAGS="$(TARGET_CFLAGS_ARCH) -O2 -pipe" \
+ CC=${REAL_GNU_TARGET_NAME}-gcc \
+ AR=${REAL_GNU_TARGET_NAME}-ar \
+ RANLIB=${REAL_GNU_TARGET_NAME}-ranlib \
+ LD=${REAL_GNU_TARGET_NAME}-ld \
+ libc_cv_forced_unwind=yes \
+ libc_cv_c_cleanup=yes \
+ $(WRKBUILD)/configure \
+ --prefix=/usr \
+ --build=$(GNU_TARGET_NAME) \
+ --host=$(REAL_GNU_TARGET_NAME) \
+ --disable-nls \
+ --without-cvs \
+ --disable-profile \
+ --disable-debug \
+ --without-gd \
+ --enable-shared \
+ --enable-stackguard-randomization \
+ --enable-add-ons=nptl --with-__thread \
+ --with-tls \
+ --enable-tls \
+ ${GLIBC_CONFOPTS} \
+ --with-headers=$(TOOLCHAIN_SYSROOT)/usr/include \
+ );
+ touch $@
+
+$(WRKBUILD)/.compiled:
+ PATH='${TARGET_PATH}' \
+ CFLAGS="$(TARGET_CFLAGS_ARCH) -O2 -pipe" \
+ CC=${REAL_GNU_TARGET_NAME}-gcc \
+ LD=${REAL_GNU_TARGET_NAME}-ld \
+ RANLIB=${REAL_GNU_TARGET_NAME}-ranlib \
+ $(MAKE) -C $(GLIBC_BUILD_DIR2) lib \
+ cross-compiling=yes
+ touch $@
+
+$(WRKBUILD)/.installed:
+ PATH='${TARGET_PATH}' \
+ #CFLAGS="$(TARGET_CFLAGS_ARCH) $(TARGET_CFLAGS)" \
+ $(MAKE) -C $(GLIBC_BUILD_DIR2) \
+ install_root=$(STAGING_DIR) \
+ install-lib-all install-headers \
+ install-others cross-compiling=yes
+ touch $(STAGING_DIR)/usr/include/gnu/stubs.h
+ touch $@
+
+include ${TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/glibc/Makefile.inc b/toolchain/glibc/Makefile.inc
new file mode 100644
index 000000000..b2784a195
--- /dev/null
+++ b/toolchain/glibc/Makefile.inc
@@ -0,0 +1,10 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+PKG_NAME:= glibc
+PKG_VERSION:= 2.7
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 0b4bc75fb7413bbd7e43c0a0e7c672b6
+MASTER_SITES:= ${MASTER_SITE_GNU:=glibc/}
diff --git a/toolchain/glibc/patches/binutils.patch b/toolchain/glibc/patches/binutils.patch
new file mode 100644
index 000000000..5b1bd763e
--- /dev/null
+++ b/toolchain/glibc/patches/binutils.patch
@@ -0,0 +1,12 @@
+diff -Nur glibc-2.7.orig/sysdeps/i386/fpu/ftestexcept.c glibc-2.7/sysdeps/i386/fpu/ftestexcept.c
+--- glibc-2.7.orig/sysdeps/i386/fpu/ftestexcept.c 2004-03-05 11:14:48.000000000 +0100
++++ glibc-2.7/sysdeps/i386/fpu/ftestexcept.c 2008-12-22 01:03:19.000000000 +0100
+@@ -26,7 +26,7 @@
+ int
+ fetestexcept (int excepts)
+ {
+- int temp;
++ short temp;
+ int xtemp = 0;
+
+ /* Get current exceptions. */
diff --git a/toolchain/glibc/patches/gcc43.patch b/toolchain/glibc/patches/gcc43.patch
new file mode 100644
index 000000000..8bd45ee8c
--- /dev/null
+++ b/toolchain/glibc/patches/gcc43.patch
@@ -0,0 +1,18 @@
+diff -Nur glibc-2.7.orig/configure glibc-2.7/configure
+--- glibc-2.7.orig/configure 2007-10-18 13:22:23.000000000 +0200
++++ glibc-2.7/configure 2008-11-29 23:48:57.461566623 +0100
+@@ -5062,8 +5062,12 @@
+ # header directory and add that to the list. NOTE: Only does the right
+ # thing on a system that doesn't need fixincludes. (Not presently a problem.)
+ if test -n "$sysheaders"; then
+- ccheaders=`$CC -print-file-name=include`
+- SYSINCLUDES="-nostdinc -isystem $ccheaders \
++ SYSINCLUDES=-nostdinc
++ for d in include include-fixed; do
++ i=`$CC -print-file-name="$d"` && test "x$i" != "x$d" &&
++ SYSINCLUDES="$SYSINCLUDES -isystem $i"
++ done
++ SYSINCLUDES="$SYSINCLUDES \
+ -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
+ if test -n "$CXX"; then
+ cxxversion=`$CXX -dumpversion 2>&5` &&
diff --git a/toolchain/glibc/patches/i586-chk.patch b/toolchain/glibc/patches/i586-chk.patch
new file mode 100644
index 000000000..8ebc182e0
--- /dev/null
+++ b/toolchain/glibc/patches/i586-chk.patch
@@ -0,0 +1,15 @@
+diff -Nur glibc-2.7.orig/sysdeps/i386/i586/memcpy_chk.S glibc-2.7/sysdeps/i386/i586/memcpy_chk.S
+--- glibc-2.7.orig/sysdeps/i386/i586/memcpy_chk.S 1970-01-01 01:00:00.000000000 +0100
++++ glibc-2.7/sysdeps/i386/i586/memcpy_chk.S 2008-09-17 12:22:02.000000000 +0200
+@@ -0,0 +1 @@
++#include <sysdeps/i386/i686/memcpy_chk.S>
+diff -Nur glibc-2.7.orig/sysdeps/i386/i586/mempcpy_chk.S glibc-2.7/sysdeps/i386/i586/mempcpy_chk.S
+--- glibc-2.7.orig/sysdeps/i386/i586/mempcpy_chk.S 1970-01-01 01:00:00.000000000 +0100
++++ glibc-2.7/sysdeps/i386/i586/mempcpy_chk.S 2008-09-17 12:22:02.000000000 +0200
+@@ -0,0 +1 @@
++#include <sysdeps/i386/i686/mempcpy_chk.S>
+diff -Nur glibc-2.7.orig/sysdeps/i386/i586/memset_chk.S glibc-2.7/sysdeps/i386/i586/memset_chk.S
+--- glibc-2.7.orig/sysdeps/i386/i586/memset_chk.S 1970-01-01 01:00:00.000000000 +0100
++++ glibc-2.7/sysdeps/i386/i586/memset_chk.S 2008-09-17 12:22:02.000000000 +0200
+@@ -0,0 +1 @@
++#include <sysdeps/i386/i686/memset_chk.S>
diff --git a/toolchain/glibc/patches/install-extra.patch b/toolchain/glibc/patches/install-extra.patch
new file mode 100644
index 000000000..790bafc17
--- /dev/null
+++ b/toolchain/glibc/patches/install-extra.patch
@@ -0,0 +1,84 @@
+diff -Nur glibc-2.7.orig/elf/Makefile glibc-2.7/elf/Makefile
+--- glibc-2.7.orig/elf/Makefile 2007-08-16 23:20:11.000000000 +0200
++++ glibc-2.7/elf/Makefile 2008-09-17 08:57:12.000000000 +0200
+@@ -116,7 +116,7 @@
+ ifeq (yes,$(build-shared))
+ extra-objs = $(all-rtld-routines:%=%.os) soinit.os sofini.os interp.os
+ generated += librtld.os dl-allobjs.os ld.so ldd
+-install-others = $(inst_slibdir)/$(rtld-installed-name)
++install-extra = $(inst_slibdir)/$(rtld-installed-name)
+ install-bin-script = ldd
+ endif
+
+diff -Nur glibc-2.7.orig/iconvdata/Makefile glibc-2.7/iconvdata/Makefile
+--- glibc-2.7.orig/iconvdata/Makefile 2007-09-30 06:00:02.000000000 +0200
++++ glibc-2.7/iconvdata/Makefile 2008-09-17 08:56:57.000000000 +0200
+@@ -211,7 +211,7 @@
+
+
+ extra-objs += $(modules.so)
+-install-others = $(addprefix $(inst_gconvdir)/, $(modules.so)) \
++install-extra = $(addprefix $(inst_gconvdir)/, $(modules.so)) \
+ $(inst_gconvdir)/gconv-modules
+
+ # We can build the conversion tables for numerous charsets automatically.
+diff -Nur glibc-2.7.orig/intl/Makefile glibc-2.7/intl/Makefile
+--- glibc-2.7.orig/intl/Makefile 2005-05-04 19:53:42.000000000 +0200
++++ glibc-2.7/intl/Makefile 2008-09-17 08:55:58.000000000 +0200
+@@ -45,7 +45,7 @@
+
+ before-compile = $(objpfx)msgs.h
+
+-install-others = $(inst_msgcatdir)/locale.alias
++install-extra = $(inst_msgcatdir)/locale.alias
+
+ generated = msgs.h mtrace-tst-gettext tst-gettext.mtrace
+ generated-dirs := domaindir localedir
+diff -Nur glibc-2.7.orig/localedata/Makefile glibc-2.7/localedata/Makefile
+--- glibc-2.7.orig/localedata/Makefile 2007-10-02 19:19:40.000000000 +0200
++++ glibc-2.7/localedata/Makefile 2008-09-17 08:55:35.000000000 +0200
+@@ -102,7 +102,7 @@
+ endif
+
+ # Files to install.
+-install-others := $(addprefix $(inst_i18ndir)/, \
++install-extra := $(addprefix $(inst_i18ndir)/, \
+ $(addsuffix .gz, $(charmaps)) \
+ $(locales))
+
+diff -Nur glibc-2.7.orig/po/Makefile glibc-2.7/po/Makefile
+--- glibc-2.7.orig/po/Makefile 2007-05-29 20:08:41.000000000 +0200
++++ glibc-2.7/po/Makefile 2008-09-17 08:55:15.000000000 +0200
+@@ -46,7 +46,7 @@
+ mo-installed = $(inst_msgcatdir)/%/LC_MESSAGES/$(domainname).mo
+
+ # Files to install: a $(domainname).mo file for each language.
+-install-others = $(LINGUAS:%=$(mo-installed))
++install-extra = $(LINGUAS:%=$(mo-installed))
+
+ # Files to distribute: all the source and compiled binary translation files.
+ distribute = $(ALL_LINGUAS:=.po) $(BROKEN_LINGUAS:=.po) $(ALL_LINGUAS:=.mo) \
+diff -Nur glibc-2.7.orig/sunrpc/Makefile glibc-2.7/sunrpc/Makefile
+--- glibc-2.7.orig/sunrpc/Makefile 2006-10-18 21:25:38.000000000 +0200
++++ glibc-2.7/sunrpc/Makefile 2008-09-17 08:54:26.000000000 +0200
+@@ -52,7 +52,7 @@
+ svc_auth.h types.h xdr.h auth_des.h \
+ des_crypt.h key_prot.h rpc_des.h) \
+ $(rpcsvc:%=rpcsvc/%) rpcsvc/bootparam.h
+-install-others = $(inst_sysconfdir)/rpc
++install-extra = $(inst_sysconfdir)/rpc
+ generated = $(rpcsvc:%.x=rpcsvc/%.h) $(rpcsvc:%.x=x%.c) $(rpcsvc:%.x=x%.stmp) \
+ $(rpcsvc:%.x=rpcsvc/%.stmp) rpcgen
+ generated-dirs := rpcsvc
+diff -Nur glibc-2.7.orig/timezone/Makefile glibc-2.7/timezone/Makefile
+--- glibc-2.7.orig/timezone/Makefile 2007-07-28 22:33:11.000000000 +0200
++++ glibc-2.7/timezone/Makefile 2008-09-17 08:54:43.000000000 +0200
+@@ -71,7 +71,7 @@
+
+ ifeq ($(cross-compiling),no)
+ # Don't try to install the zoneinfo files since we can't run zic.
+-install-others = $(addprefix $(inst_zonedir)/,$(zonenames) \
++install-extra = $(addprefix $(inst_zonedir)/,$(zonenames) \
+ $(zonenames:%=posix/%) \
+ $(zonenames:%=right/%)) \
+ $(installed-localtime-file) $(installed-posixrules-file)
diff --git a/toolchain/glibc/patches/make-install-lib.patch b/toolchain/glibc/patches/make-install-lib.patch
new file mode 100644
index 000000000..b5fb9295a
--- /dev/null
+++ b/toolchain/glibc/patches/make-install-lib.patch
@@ -0,0 +1,17 @@
+diff -Nur glibc-2.7.orig/Makerules glibc-2.7/Makerules
+--- glibc-2.7.orig/Makerules 2007-08-26 04:18:03.000000000 +0200
++++ glibc-2.7/Makerules 2008-09-12 11:35:40.000000000 +0200
+@@ -867,6 +867,13 @@
+ installed-libcs := $(foreach o,$(filter-out .os,$(object-suffixes-for-libc)),\
+ $(inst_libdir)/$(patsubst %,$(libtype$o),\
+ $(libprefix)$(libc-name)))
++
++install-lib-all: $(inst_slibdir)/libc.so$(libc.so-version) \
++ $(inst_slibdir)/libc-$(version).so \
++ $(inst_libdir)/libc.so \
++ $(inst_libdir)/libc.a \
++ install-lib
++
+ install: $(installed-libcs)
+ $(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib $(+force)
+ $(make-target-directory)
diff --git a/toolchain/gmp/Makefile b/toolchain/gmp/Makefile
new file mode 100644
index 000000000..937f1b411
--- /dev/null
+++ b/toolchain/gmp/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include ../rules.mk
+include Makefile.inc
+include ${TOPDIR}/mk/buildhlp.mk
+
+$(WRKBUILD)/.headers:
+$(WRKBUILD)/.configure_done:
+ (cd $(WRKBUILD); \
+ $(WRKBUILD)/configure \
+ --prefix=$(STAGING_TOOLS) \
+ --build=$(GNU_HOST_NAME) \
+ --host=$(GNU_HOST_NAME) \
+ --disable-shared \
+ --enable-static \
+ --disable-nls \
+ );
+ touch $@
+
+$(WRKBUILD)/.compiled: $(WRKBUILD)/.configure_done
+ $(MAKE) -C $(WRKBUILD) all
+ touch $@
+
+$(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
+ $(MAKE) -C $(WRKBUILD) install
+ touch $@
+
+include ${TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/gmp/Makefile.inc b/toolchain/gmp/Makefile.inc
new file mode 100644
index 000000000..f0db3fb5b
--- /dev/null
+++ b/toolchain/gmp/Makefile.inc
@@ -0,0 +1,12 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+PKG_NAME:= gmp
+PKG_VERSION:= 4.2.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 7ce52531644e6d12f16911b7e3151f3f
+MASTER_SITES:= ${MASTER_SITE_GNU:=gmp/}
+DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.bz2
+GMP_BUILD_DIR:= $(TOOLCHAIN_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
diff --git a/toolchain/kernel-headers/Makefile b/toolchain/kernel-headers/Makefile
new file mode 100644
index 000000000..add626b94
--- /dev/null
+++ b/toolchain/kernel-headers/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include ../rules.mk
+include $(TOPDIR)/mk/linux.mk
+include ${TOPDIR}/mk/buildhlp.mk
+
+$(WRKBUILD)/.headers:
+ $(MAKE) -C $(WRKBUILD) ARCH=$(ARCH) V=1 \
+ INSTALL_HDR_PATH=$(STAGING_DIR)/usr \
+ headers_install
+ $(MAKE) -C $(WRKBUILD) ARCH=$(ARCH) V=1 \
+ INSTALL_HDR_PATH=$(TOOLCHAIN_SYSROOT)/usr \
+ headers_install
+ # cryptodev.h from ocf-linux-20080917
+ mkdir -p ${STAGING_DIR}/include/crypto
+ cp files/cryptodev.h ${STAGING_DIR}/include/crypto/
+ifeq ($(ARCH),cris)
+ifeq ($(CPU_ARCH),crisv32)
+ cd $(STAGING_DIR)/usr/include && ln -sf arch-v32/arch arch
+ cd $(TOOLCHAIN_SYSROOT)/usr/include && ln -sf arch-v32/arch arch
+else
+ cd $(STAGING_DIR)/usr/include && ln -sf arch-v10/arch arch
+ cd $(TOOLCHAIN_SYSROOT)/usr/include && ln -sf arch-v10/arch arch
+endif
+endif
+ touch $@
+
+include ${TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/kernel-headers/files/cryptodev.h b/toolchain/kernel-headers/files/cryptodev.h
new file mode 100644
index 000000000..fa1a57b4f
--- /dev/null
+++ b/toolchain/kernel-headers/files/cryptodev.h
@@ -0,0 +1,478 @@
+/* $FreeBSD: src/sys/opencrypto/cryptodev.h,v 1.25 2007/05/09 19:37:02 gnn Exp $ */
+/* $OpenBSD: cryptodev.h,v 1.31 2002/06/11 11:14:29 beck Exp $ */
+
+/*-
+ * Linux port done by David McCullough <david_mccullough@securecomputing.com>
+ * Copyright (C) 2006-2007 David McCullough
+ * Copyright (C) 2004-2005 Intel Corporation.
+ * The license and original author are listed below.
+ *
+ * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
+ * Copyright (c) 2002-2006 Sam Leffler, Errno Consulting
+ *
+ * This code was written by Angelos D. Keromytis in Athens, Greece, in
+ * February 2000. Network Security Technologies Inc. (NSTI) kindly
+ * supported the development of this code.
+ *
+ * Copyright (c) 2000 Angelos D. Keromytis
+ *
+ * Permission to use, copy, and modify this software with or without fee
+ * is hereby granted, provided that this entire notice is included in
+ * all source code copies of any software which is or includes a copy or
+ * modification of this software.
+ *
+ * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY
+ * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
+ * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
+ * PURPOSE.
+ *
+ * Copyright (c) 2001 Theo de Raadt
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Effort sponsored in part by the Defense Advanced Research Projects
+ * Agency (DARPA) and Air Force Research Laboratory, Air Force
+ * Materiel Command, USAF, under agreement number F30602-01-2-0537.
+ *
+ */
+
+#ifndef _CRYPTO_CRYPTO_H_
+#define _CRYPTO_CRYPTO_H_
+
+/* Some initial values */
+#define CRYPTO_DRIVERS_INITIAL 4
+#define CRYPTO_SW_SESSIONS 32
+
+/* Hash values */
+#define NULL_HASH_LEN 0
+#define MD5_HASH_LEN 16
+#define SHA1_HASH_LEN 20
+#define RIPEMD160_HASH_LEN 20
+#define SHA2_256_HASH_LEN 32
+#define SHA2_384_HASH_LEN 48
+#define SHA2_512_HASH_LEN 64
+#define MD5_KPDK_HASH_LEN 16
+#define SHA1_KPDK_HASH_LEN 20
+/* Maximum hash algorithm result length */
+#define HASH_MAX_LEN SHA2_512_HASH_LEN /* Keep this updated */
+
+/* HMAC values */
+#define NULL_HMAC_BLOCK_LEN 1
+#define MD5_HMAC_BLOCK_LEN 64
+#define SHA1_HMAC_BLOCK_LEN 64
+#define RIPEMD160_HMAC_BLOCK_LEN 64
+#define SHA2_256_HMAC_BLOCK_LEN 64
+#define SHA2_384_HMAC_BLOCK_LEN 128
+#define SHA2_512_HMAC_BLOCK_LEN 128
+/* Maximum HMAC block length */
+#define HMAC_MAX_BLOCK_LEN SHA2_512_HMAC_BLOCK_LEN /* Keep this updated */
+#define HMAC_IPAD_VAL 0x36
+#define HMAC_OPAD_VAL 0x5C
+
+/* Encryption algorithm block sizes */
+#define NULL_BLOCK_LEN 1
+#define DES_BLOCK_LEN 8
+#define DES3_BLOCK_LEN 8
+#define BLOWFISH_BLOCK_LEN 8
+#define SKIPJACK_BLOCK_LEN 8
+#define CAST128_BLOCK_LEN 8
+#define RIJNDAEL128_BLOCK_LEN 16
+#define AES_BLOCK_LEN RIJNDAEL128_BLOCK_LEN
+#define CAMELLIA_BLOCK_LEN 16
+#define ARC4_BLOCK_LEN 1
+#define EALG_MAX_BLOCK_LEN AES_BLOCK_LEN /* Keep this updated */
+
+/* Encryption algorithm min and max key sizes */
+#define NULL_MIN_KEY_LEN 0
+#define NULL_MAX_KEY_LEN 0
+#define DES_MIN_KEY_LEN 8
+#define DES_MAX_KEY_LEN 8
+#define DES3_MIN_KEY_LEN 24
+#define DES3_MAX_KEY_LEN 24
+#define BLOWFISH_MIN_KEY_LEN 4
+#define BLOWFISH_MAX_KEY_LEN 56
+#define SKIPJACK_MIN_KEY_LEN 10
+#define SKIPJACK_MAX_KEY_LEN 10
+#define CAST128_MIN_KEY_LEN 5
+#define CAST128_MAX_KEY_LEN 16
+#define RIJNDAEL128_MIN_KEY_LEN 16
+#define RIJNDAEL128_MAX_KEY_LEN 32
+#define AES_MIN_KEY_LEN RIJNDAEL128_MIN_KEY_LEN
+#define AES_MAX_KEY_LEN RIJNDAEL128_MAX_KEY_LEN
+#define CAMELLIA_MIN_KEY_LEN 16
+#define CAMELLIA_MAX_KEY_LEN 32
+#define ARC4_MIN_KEY_LEN 1
+#define ARC4_MAX_KEY_LEN 256
+
+/* Max size of data that can be processed */
+#define CRYPTO_MAX_DATA_LEN 64*1024 - 1
+
+#define CRYPTO_ALGORITHM_MIN 1
+#define CRYPTO_DES_CBC 1
+#define CRYPTO_3DES_CBC 2
+#define CRYPTO_BLF_CBC 3
+#define CRYPTO_CAST_CBC 4
+#define CRYPTO_SKIPJACK_CBC 5
+#define CRYPTO_MD5_HMAC 6
+#define CRYPTO_SHA1_HMAC 7
+#define CRYPTO_RIPEMD160_HMAC 8
+#define CRYPTO_MD5_KPDK 9
+#define CRYPTO_SHA1_KPDK 10
+#define CRYPTO_RIJNDAEL128_CBC 11 /* 128 bit blocksize */
+#define CRYPTO_AES_CBC 11 /* 128 bit blocksize -- the same as above */
+#define CRYPTO_ARC4 12
+#define CRYPTO_MD5 13
+#define CRYPTO_SHA1 14
+#define CRYPTO_NULL_HMAC 15
+#define CRYPTO_NULL_CBC 16
+#define CRYPTO_DEFLATE_COMP 17 /* Deflate compression algorithm */
+#define CRYPTO_SHA2_256_HMAC 18
+#define CRYPTO_SHA2_384_HMAC 19
+#define CRYPTO_SHA2_512_HMAC 20
+#define CRYPTO_CAMELLIA_CBC 21
+#define CRYPTO_SHA2_256 22
+#define CRYPTO_SHA2_384 23
+#define CRYPTO_SHA2_512 24
+#define CRYPTO_RIPEMD160 25
+#define CRYPTO_ALGORITHM_MAX 25 /* Keep updated - see below */
+
+/* Algorithm flags */
+#define CRYPTO_ALG_FLAG_SUPPORTED 0x01 /* Algorithm is supported */
+#define CRYPTO_ALG_FLAG_RNG_ENABLE 0x02 /* Has HW RNG for DH/DSA */
+#define CRYPTO_ALG_FLAG_DSA_SHA 0x04 /* Can do SHA on msg */
+
+/*
+ * Crypto driver/device flags. They can set in the crid
+ * parameter when creating a session or submitting a key
+ * op to affect the device/driver assigned. If neither
+ * of these are specified then the crid is assumed to hold
+ * the driver id of an existing (and suitable) device that
+ * must be used to satisfy the request.
+ */
+#define CRYPTO_FLAG_HARDWARE 0x01000000 /* hardware accelerated */
+#define CRYPTO_FLAG_SOFTWARE 0x02000000 /* software implementation */
+
+/* NB: deprecated */
+struct session_op {
+ u_int32_t cipher; /* ie. CRYPTO_DES_CBC */
+ u_int32_t mac; /* ie. CRYPTO_MD5_HMAC */
+
+ u_int32_t keylen; /* cipher key */
+ caddr_t key;
+ int mackeylen; /* mac key */
+ caddr_t mackey;
+
+ u_int32_t ses; /* returns: session # */
+};
+
+struct session2_op {
+ u_int32_t cipher; /* ie. CRYPTO_DES_CBC */
+ u_int32_t mac; /* ie. CRYPTO_MD5_HMAC */
+
+ u_int32_t keylen; /* cipher key */
+ caddr_t key;
+ int mackeylen; /* mac key */
+ caddr_t mackey;
+
+ u_int32_t ses; /* returns: session # */
+ int crid; /* driver id + flags (rw) */
+ int pad[4]; /* for future expansion */
+};
+
+struct crypt_op {
+ u_int32_t ses;
+ u_int16_t op; /* i.e. COP_ENCRYPT */
+#define COP_NONE 0
+#define COP_ENCRYPT 1
+#define COP_DECRYPT 2
+ u_int16_t flags;
+#define COP_F_BATCH 0x0008 /* Batch op if possible */
+ u_int len;
+ caddr_t src, dst; /* become iov[] inside kernel */
+ caddr_t mac; /* must be big enough for chosen MAC */
+ caddr_t iv;
+};
+
+/*
+ * Parameters for looking up a crypto driver/device by
+ * device name or by id. The latter are returned for
+ * created sessions (crid) and completed key operations.
+ */
+struct crypt_find_op {
+ int crid; /* driver id + flags */
+ char name[32]; /* device/driver name */
+};
+
+/* bignum parameter, in packed bytes, ... */
+struct crparam {
+ caddr_t crp_p;
+ u_int crp_nbits;
+};
+
+#define CRK_MAXPARAM 8
+
+struct crypt_kop {
+ u_int crk_op; /* ie. CRK_MOD_EXP or other */
+ u_int crk_status; /* return status */
+ u_short crk_iparams; /* # of input parameters */
+ u_short crk_oparams; /* # of output parameters */
+ u_int crk_crid; /* NB: only used by CIOCKEY2 (rw) */
+ struct crparam crk_param[CRK_MAXPARAM];
+};
+#define CRK_ALGORITM_MIN 0
+#define CRK_MOD_EXP 0
+#define CRK_MOD_EXP_CRT 1
+#define CRK_DSA_SIGN 2
+#define CRK_DSA_VERIFY 3
+#define CRK_DH_COMPUTE_KEY 4
+#define CRK_ALGORITHM_MAX 4 /* Keep updated - see below */
+
+#define CRF_MOD_EXP (1 << CRK_MOD_EXP)
+#define CRF_MOD_EXP_CRT (1 << CRK_MOD_EXP_CRT)
+#define CRF_DSA_SIGN (1 << CRK_DSA_SIGN)
+#define CRF_DSA_VERIFY (1 << CRK_DSA_VERIFY)
+#define CRF_DH_COMPUTE_KEY (1 << CRK_DH_COMPUTE_KEY)
+
+/*
+ * done against open of /dev/crypto, to get a cloned descriptor.
+ * Please use F_SETFD against the cloned descriptor.
+ */
+#define CRIOGET _IOWR('c', 100, u_int32_t)
+#define CRIOASYMFEAT CIOCASYMFEAT
+#define CRIOFINDDEV CIOCFINDDEV
+
+/* the following are done against the cloned descriptor */
+#define CIOCGSESSION _IOWR('c', 101, struct session_op)
+#define CIOCFSESSION _IOW('c', 102, u_int32_t)
+#define CIOCCRYPT _IOWR('c', 103, struct crypt_op)
+#define CIOCKEY _IOWR('c', 104, struct crypt_kop)
+#define CIOCASYMFEAT _IOR('c', 105, u_int32_t)
+#define CIOCGSESSION2 _IOWR('c', 106, struct session2_op)
+#define CIOCKEY2 _IOWR('c', 107, struct crypt_kop)
+#define CIOCFINDDEV _IOWR('c', 108, struct crypt_find_op)
+
+struct cryptotstat {
+ struct timespec acc; /* total accumulated time */
+ struct timespec min; /* min time */
+ struct timespec max; /* max time */
+ u_int32_t count; /* number of observations */
+};
+
+struct cryptostats {
+ u_int32_t cs_ops; /* symmetric crypto ops submitted */
+ u_int32_t cs_errs; /* symmetric crypto ops that failed */
+ u_int32_t cs_kops; /* asymetric/key ops submitted */
+ u_int32_t cs_kerrs; /* asymetric/key ops that failed */
+ u_int32_t cs_intrs; /* crypto swi thread activations */
+ u_int32_t cs_rets; /* crypto return thread activations */
+ u_int32_t cs_blocks; /* symmetric op driver block */
+ u_int32_t cs_kblocks; /* symmetric op driver block */
+ /*
+ * When CRYPTO_TIMING is defined at compile time and the
+ * sysctl debug.crypto is set to 1, the crypto system will
+ * accumulate statistics about how long it takes to process
+ * crypto requests at various points during processing.
+ */
+ struct cryptotstat cs_invoke; /* crypto_dipsatch -> crypto_invoke */
+ struct cryptotstat cs_done; /* crypto_invoke -> crypto_done */
+ struct cryptotstat cs_cb; /* crypto_done -> callback */
+ struct cryptotstat cs_finis; /* callback -> callback return */
+
+ u_int32_t cs_drops; /* crypto ops dropped due to congestion */
+};
+
+#ifdef __KERNEL__
+
+/* Standard initialization structure beginning */
+struct cryptoini {
+ int cri_alg; /* Algorithm to use */
+ int cri_klen; /* Key length, in bits */
+ int cri_mlen; /* Number of bytes we want from the
+ entire hash. 0 means all. */
+ caddr_t cri_key; /* key to use */
+ u_int8_t cri_iv[EALG_MAX_BLOCK_LEN]; /* IV to use */
+ struct cryptoini *cri_next;
+};
+
+/* Describe boundaries of a single crypto operation */
+struct cryptodesc {
+ int crd_skip; /* How many bytes to ignore from start */
+ int crd_len; /* How many bytes to process */
+ int crd_inject; /* Where to inject results, if applicable */
+ int crd_flags;
+
+#define CRD_F_ENCRYPT 0x01 /* Set when doing encryption */
+#define CRD_F_IV_PRESENT 0x02 /* When encrypting, IV is already in
+ place, so don't copy. */
+#define CRD_F_IV_EXPLICIT 0x04 /* IV explicitly provided */
+#define CRD_F_DSA_SHA_NEEDED 0x08 /* Compute SHA-1 of buffer for DSA */
+#define CRD_F_KEY_EXPLICIT 0x10 /* Key explicitly provided */
+#define CRD_F_COMP 0x0f /* Set when doing compression */
+
+ struct cryptoini CRD_INI; /* Initialization/context data */
+#define crd_iv CRD_INI.cri_iv
+#define crd_key CRD_INI.cri_key
+#define crd_alg CRD_INI.cri_alg
+#define crd_klen CRD_INI.cri_klen
+
+ struct cryptodesc *crd_next;
+};
+
+/* Structure describing complete operation */
+struct cryptop {
+ struct list_head crp_next;
+ wait_queue_head_t crp_waitq;
+
+ u_int64_t crp_sid; /* Session ID */
+ int crp_ilen; /* Input data total length */
+ int crp_olen; /* Result total length */
+
+ int crp_etype; /*
+ * Error type (zero means no error).
+ * All error codes except EAGAIN
+ * indicate possible data corruption (as in,
+ * the data have been touched). On all
+ * errors, the crp_sid may have changed
+ * (reset to a new one), so the caller
+ * should always check and use the new
+ * value on future requests.
+ */
+ int crp_flags;
+
+#define CRYPTO_F_SKBUF 0x0001 /* Input/output are skbuf chains */
+#define CRYPTO_F_IOV 0x0002 /* Input/output are uio */
+#define CRYPTO_F_REL 0x0004 /* Must return data in same place */
+#define CRYPTO_F_BATCH 0x0008 /* Batch op if possible */
+#define CRYPTO_F_CBIMM 0x0010 /* Do callback immediately */
+#define CRYPTO_F_DONE 0x0020 /* Operation completed */
+#define CRYPTO_F_CBIFSYNC 0x0040 /* Do CBIMM if op is synchronous */
+
+ caddr_t crp_buf; /* Data to be processed */
+ caddr_t crp_opaque; /* Opaque pointer, passed along */
+ struct cryptodesc *crp_desc; /* Linked list of processing descriptors */
+
+ int (*crp_callback)(struct cryptop *); /* Callback function */
+};
+
+#define CRYPTO_BUF_CONTIG 0x0
+#define CRYPTO_BUF_IOV 0x1
+#define CRYPTO_BUF_SKBUF 0x2
+
+#define CRYPTO_OP_DECRYPT 0x0
+#define CRYPTO_OP_ENCRYPT 0x1
+
+/*
+ * Hints passed to process methods.
+ */
+#define CRYPTO_HINT_MORE 0x1 /* more ops coming shortly */
+
+struct cryptkop {
+ struct list_head krp_next;
+ wait_queue_head_t krp_waitq;
+
+ int krp_flags;
+#define CRYPTO_KF_DONE 0x0001 /* Operation completed */
+#define CRYPTO_KF_CBIMM 0x0002 /* Do callback immediately */
+
+ u_int krp_op; /* ie. CRK_MOD_EXP or other */
+ u_int krp_status; /* return status */
+ u_short krp_iparams; /* # of input parameters */
+ u_short krp_oparams; /* # of output parameters */
+ u_int krp_crid; /* desired device, etc. */
+ u_int32_t krp_hid;
+ struct crparam krp_param[CRK_MAXPARAM]; /* kvm */
+ int (*krp_callback)(struct cryptkop *);
+};
+
+#include <ocf-compat.h>
+
+/*
+ * Session ids are 64 bits. The lower 32 bits contain a "local id" which
+ * is a driver-private session identifier. The upper 32 bits contain a
+ * "hardware id" used by the core crypto code to identify the driver and
+ * a copy of the driver's capabilities that can be used by client code to
+ * optimize operation.
+ */
+#define CRYPTO_SESID2HID(_sid) (((_sid) >> 32) & 0x00ffffff)
+#define CRYPTO_SESID2CAPS(_sid) (((_sid) >> 32) & 0xff000000)
+#define CRYPTO_SESID2LID(_sid) (((u_int32_t) (_sid)) & 0xffffffff)
+
+extern int crypto_newsession(u_int64_t *sid, struct cryptoini *cri, int hard);
+extern int crypto_freesession(u_int64_t sid);
+#define CRYPTOCAP_F_HARDWARE CRYPTO_FLAG_HARDWARE
+#define CRYPTOCAP_F_SOFTWARE CRYPTO_FLAG_SOFTWARE
+#define CRYPTOCAP_F_SYNC 0x04000000 /* operates synchronously */
+extern int32_t crypto_get_driverid(device_t dev, int flags);
+extern int crypto_find_driver(const char *);
+extern device_t crypto_find_device_byhid(int hid);
+extern int crypto_getcaps(int hid);
+extern int crypto_register(u_int32_t driverid, int alg, u_int16_t maxoplen,
+ u_int32_t flags);
+extern int crypto_kregister(u_int32_t, int, u_int32_t);
+extern int crypto_unregister(u_int32_t driverid, int alg);
+extern int crypto_unregister_all(u_int32_t driverid);
+extern int crypto_dispatch(struct cryptop *crp);
+extern int crypto_kdispatch(struct cryptkop *);
+#define CRYPTO_SYMQ 0x1
+#define CRYPTO_ASYMQ 0x2
+extern int crypto_unblock(u_int32_t, int);
+extern void crypto_done(struct cryptop *crp);
+extern void crypto_kdone(struct cryptkop *);
+extern int crypto_getfeat(int *);
+
+extern void crypto_freereq(struct cryptop *crp);
+extern struct cryptop *crypto_getreq(int num);
+
+extern int crypto_usercrypto; /* userland may do crypto requests */
+extern int crypto_userasymcrypto; /* userland may do asym crypto reqs */
+extern int crypto_devallowsoft; /* only use hardware crypto */
+
+/*
+ * random number support, crypto_unregister_all will unregister
+ */
+extern int crypto_rregister(u_int32_t driverid,
+ int (*read_random)(void *arg, u_int32_t *buf, int len), void *arg);
+extern int crypto_runregister_all(u_int32_t driverid);
+
+/*
+ * Crypto-related utility routines used mainly by drivers.
+ *
+ * XXX these don't really belong here; but for now they're
+ * kept apart from the rest of the system.
+ */
+struct uio;
+extern void cuio_copydata(struct uio* uio, int off, int len, caddr_t cp);
+extern void cuio_copyback(struct uio* uio, int off, int len, caddr_t cp);
+extern struct iovec *cuio_getptr(struct uio *uio, int loc, int *off);
+
+extern void crypto_copyback(int flags, caddr_t buf, int off, int size,
+ caddr_t in);
+extern void crypto_copydata(int flags, caddr_t buf, int off, int size,
+ caddr_t out);
+extern int crypto_apply(int flags, caddr_t buf, int off, int len,
+ int (*f)(void *, void *, u_int), void *arg);
+
+#endif /* __KERNEL__ */
+#endif /* _CRYPTO_CRYPTO_H_ */
diff --git a/toolchain/kernel-headers/patches/cleankernel.patch b/toolchain/kernel-headers/patches/cleankernel.patch
new file mode 100644
index 000000000..f8d5448ee
--- /dev/null
+++ b/toolchain/kernel-headers/patches/cleankernel.patch
@@ -0,0 +1,11 @@
+diff -Nur linux-2.6.29.1.orig/scripts/Makefile.headersinst linux-2.6.29.1/scripts/Makefile.headersinst
+--- linux-2.6.29.1.orig/scripts/Makefile.headersinst 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/scripts/Makefile.headersinst 2009-04-17 20:56:09.143476927 +0200
+@@ -65,7 +65,6 @@
+
+ targets += $(install-file)
+ $(install-file): scripts/headers_install.pl $(input-files) FORCE
+- $(if $(unwanted),$(call cmd,remove),)
+ $(if $(wildcard $(dir $@)),,$(shell mkdir -p $(dir $@)))
+ $(call if_changed,install)
+
diff --git a/toolchain/kernel-headers/patches/etrax-header.patch b/toolchain/kernel-headers/patches/etrax-header.patch
new file mode 100644
index 000000000..fadcf5d53
--- /dev/null
+++ b/toolchain/kernel-headers/patches/etrax-header.patch
@@ -0,0 +1,68 @@
+diff -Nur linux-2.6.28.orig/arch/cris/include/arch-v10/arch/Kbuild linux-2.6.28/arch/cris/include/arch-v10/arch/Kbuild
+--- linux-2.6.28.orig/arch/cris/include/arch-v10/arch/Kbuild 2008-12-25 00:26:37.000000000 +0100
++++ linux-2.6.28/arch/cris/include/arch-v10/arch/Kbuild 2008-12-29 20:49:24.000000000 +0100
+@@ -1,4 +1,9 @@
++header-y += dma.h
++header-y += io_interface_mux.h
+ header-y += user.h
+ header-y += svinto.h
+ header-y += sv_addr_ag.h
+ header-y += sv_addr.agh
++header-y += elf.h
++header-y += page.h
++header-y += ptrace.h
+diff -Nur linux-2.6.28.orig/arch/cris/include/arch-v32/arch/Kbuild linux-2.6.28/arch/cris/include/arch-v32/arch/Kbuild
+--- linux-2.6.28.orig/arch/cris/include/arch-v32/arch/Kbuild 2008-12-25 00:26:37.000000000 +0100
++++ linux-2.6.28/arch/cris/include/arch-v32/arch/Kbuild 2008-12-29 20:48:51.000000000 +0100
+@@ -1,2 +1,6 @@
+ header-y += user.h
+ header-y += cryptocop.h
++header-y += elf.h
++header-y += page.h
++header-y += ptrace.h
++
+diff -Nur linux-2.6.28.orig/arch/cris/include/asm/Kbuild linux-2.6.28/arch/cris/include/asm/Kbuild
+--- linux-2.6.28.orig/arch/cris/include/asm/Kbuild 2008-12-25 00:26:37.000000000 +0100
++++ linux-2.6.28/arch/cris/include/asm/Kbuild 2008-12-29 20:48:51.000000000 +0100
+@@ -1,11 +1,14 @@
+ include include/asm-generic/Kbuild.asm
+
+-header-y += arch-v10/
+-header-y += arch-v32/
++header-y += ../arch-v10/arch/
++header-y += ../arch-v32/arch/
+
++header-y += elf.h
+ header-y += ethernet.h
+ header-y += rtc.h
+ header-y += sync_serial.h
++header-y += page.h
++header-y += user.h
+
+ unifdef-y += etraxgpio.h
+ unifdef-y += rs485.h
+diff -Nur linux-2.6.28.orig/include/asm-generic/Kbuild linux-2.6.28/include/asm-generic/Kbuild
+--- linux-2.6.28.orig/include/asm-generic/Kbuild 2008-12-25 00:26:37.000000000 +0100
++++ linux-2.6.28/include/asm-generic/Kbuild 2008-12-29 20:48:51.000000000 +0100
+@@ -2,8 +2,10 @@
+ header-y += errno.h
+ header-y += fcntl.h
+ header-y += ioctl.h
++header-y += memory_model.h
+ header-y += mman.h
+ header-y += poll.h
++header-y += page.h
+ header-y += signal.h
+ header-y += statfs.h
+
+diff -Nur linux-2.6.28.orig/include/linux/Kbuild linux-2.6.28/include/linux/Kbuild
+--- linux-2.6.28.orig/include/linux/Kbuild 2008-12-25 00:26:37.000000000 +0100
++++ linux-2.6.28/include/linux/Kbuild 2008-12-29 20:48:51.000000000 +0100
+@@ -158,6 +158,7 @@
+ header-y += udf_fs_i.h
+ header-y += ultrasound.h
+ header-y += un.h
++header-y += user.h
+ header-y += utime.h
+ header-y += veth.h
+ header-y += video_decoder.h
diff --git a/toolchain/mpfr/Makefile b/toolchain/mpfr/Makefile
new file mode 100644
index 000000000..8009c3acf
--- /dev/null
+++ b/toolchain/mpfr/Makefile
@@ -0,0 +1,33 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include ../rules.mk
+include $(TOPDIR)/toolchain/gmp/Makefile.inc
+include Makefile.inc
+include ${TOPDIR}/mk/buildhlp.mk
+
+$(WRKBUILD)/.headers:
+$(WRKBUILD)/.configure_done:
+ (cd $(WRKBUILD); \
+ $(WRKBUILD)/configure \
+ --prefix=$(STAGING_TOOLS) \
+ --build=$(GNU_HOST_NAME) \
+ --host=$(GNU_HOST_NAME) \
+ --with-gmp-build=$(GMP_BUILD_DIR) \
+ --disable-shared \
+ --enable-static \
+ );
+ touch $@
+
+$(WRKBUILD)/.compiled: $(WRKBUILD)/.configure_done
+ $(MAKE) -C $(WRKBUILD) all
+ touch $@
+
+$(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
+ $(MAKE) -C $(WRKBUILD) install
+ touch $@
+
+include ${TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/mpfr/Makefile.inc b/toolchain/mpfr/Makefile.inc
new file mode 100644
index 000000000..a30ff5c5b
--- /dev/null
+++ b/toolchain/mpfr/Makefile.inc
@@ -0,0 +1,11 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+PKG_NAME:= mpfr
+PKG_VERSION:= 2.4.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= c5ee0a8ce82ad55fe29ac57edd35d09e
+MASTER_SITES:= http://www.mpfr.org/mpfr-current/
+DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.bz2
diff --git a/toolchain/rules.mk b/toolchain/rules.mk
new file mode 100644
index 000000000..bfe168d17
--- /dev/null
+++ b/toolchain/rules.mk
@@ -0,0 +1,7 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+WRKDIR_BASE= ${TOOLCHAIN_BUILD_DIR}
+WRKDIR= ${WRKDIR_BASE}
diff --git a/toolchain/uClibc/Makefile b/toolchain/uClibc/Makefile
new file mode 100644
index 000000000..8bf81f309
--- /dev/null
+++ b/toolchain/uClibc/Makefile
@@ -0,0 +1,72 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+_IN_CVTC= 1
+
+include $(TOPDIR)/rules.mk
+include ../rules.mk
+include Makefile.inc
+include ${TOPDIR}/mk/buildhlp.mk
+
+$(WRKBUILD)/.headers:
+ $(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(WRKBUILD)/Rules.mak
+ sed -e 's^KERNEL_HEADERS.*$$KERNEL_HEADERS=\"${TOOLCHAIN_SYSROOT}/usr/include\"' \
+ $(TOPDIR)/target/$(DEVICE)/uclibc.config >${WRKBUILD}/.config
+ifeq ($(ADK_IPV6),y)
+ $(SED) 's,# UCLIBC_HAS_IPV6.*,UCLIBC_HAS_IPV6=y,' \
+ ${WRKBUILD}/.config
+endif
+ifeq ($(ADK_SSP),y)
+ $(SED) 's,# UCLIBC_HAS_SSP.*,UCLIBC_HAS_SSP=y,' \
+ ${WRKBUILD}/.config
+ echo 'UCLIBC_BUILD_SSP=y' >> ${WRKBUILD}/.config
+ echo '# UCLIBC_HAS_SSP_COMPAT is not set' >> ${WRKBUILD}/.config
+ echo '# SSP_QUICK_CANARY is not set' >> ${WRKBUILD}/.config
+ echo 'PROPOLICE_BLOCK_ABRT=y' >> ${WRKBUILD}/.config
+ echo '# PROPOLICE_BLOCK_SEGV is not set' >> ${WRKBUILD}/.config
+endif
+ifeq ($(DEBUG),1)
+ $(SED) 's,DOSTRIP,DODEBUG,' ${WRKBUILD}/.config
+endif
+ $(MAKE) -C $(WRKBUILD) \
+ PREFIX=$(TOOLCHAIN_SYSROOT)/ \
+ DEVEL_PREFIX=/usr/ \
+ RUNTIME_PREFIX=$(TOOLCHAIN_SYSROOT)/ \
+ HOSTCC="$(HOSTCC)" \
+ CPU_CFLAGS="$(TARGET_CFLAGS)" \
+ install_headers
+ touch $(WRKBUILD)/.configure_done
+ touch $@
+
+$(WRKBUILD)/.compiled:
+ $(MAKE) -C $(WRKBUILD) \
+ PREFIX= \
+ DEVEL_PREFIX=/ \
+ RUNTIME_PREFIX=/ \
+ HOSTCC="$(HOSTCC)" \
+ CPU_CFLAGS="$(TARGET_CFLAGS)" \
+ all
+ touch $@
+
+$(WRKBUILD)/.install_headers: $(WRKBUILD)/.compiled
+ $(MAKE) -C $(WRKBUILD) \
+ PREFIX=$(STAGING_DIR) \
+ DEVEL_PREFIX=/ \
+ RUNTIME_PREFIX=/ \
+ install_dev
+ touch $@
+
+$(WRKBUILD)/.installed: $(WRKBUILD)/.install_headers
+ $(MAKE) -C $(WRKBUILD) \
+ PREFIX=$(STAGING_DIR) \
+ DEVEL_PREFIX=/ \
+ RUNTIME_PREFIX=/ \
+ install_runtime
+ echo $(PKG_VERSION) >$(STAGING_DIR)/uclibc_version
+ rm -rf $(STAGING_DIR)/lib/libc.so
+ ln -s libc.so.0 $(STAGING_DIR)/lib/libc.so
+ touch $@
+
+include ${TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/uClibc/Makefile.inc b/toolchain/uClibc/Makefile.inc
new file mode 100644
index 000000000..b047ea910
--- /dev/null
+++ b/toolchain/uClibc/Makefile.inc
@@ -0,0 +1,11 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+PKG_NAME:= uClibc
+PKG_VERSION:= 0.9.30.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 1a4b84e5536ad8170563ffa88c34679c
+MASTER_SITES:= http://uclibc.org/downloads/
+DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.bz2