summaryrefslogtreecommitdiff
path: root/toolchain/uclibc-ng
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2014-07-05 13:20:32 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2014-07-05 13:21:38 +0200
commit13987e7baab1da72f4187ef90229a8ab45f58e01 (patch)
tree22091ab06506d8f967a2c5ee635fe8ea4761f783 /toolchain/uclibc-ng
parent5ce7c00aadc63e34d8629b36b8c7cf3c9ee0c380 (diff)
add support for uClibc-ng in parallel to uClibc.
This helps to find any regressions made in uClibc-ng.
Diffstat (limited to 'toolchain/uclibc-ng')
-rw-r--r--toolchain/uclibc-ng/Makefile125
-rw-r--r--toolchain/uclibc-ng/Makefile.inc9
-rw-r--r--toolchain/uclibc-ng/arch.lst10
3 files changed, 144 insertions, 0 deletions
diff --git a/toolchain/uclibc-ng/Makefile b/toolchain/uclibc-ng/Makefile
new file mode 100644
index 000000000..d13eeb0cb
--- /dev/null
+++ b/toolchain/uclibc-ng/Makefile
@@ -0,0 +1,125 @@
+# 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 $(ADK_TOPDIR)/rules.mk
+include ../rules.mk
+include Makefile.inc
+include ${ADK_TOPDIR}/mk/buildhlp.mk
+
+TARGET_CFLAGS:=$(filter-out -flto,$(TARGET_CFLAGS))
+TARGET_CFLAGS:=$(filter-out -mtext-section-literals,$(TARGET_CFLAGS))
+
+ifeq (${ADK_MAKE_PARALLEL},y)
+UCLIBC_MAKEOPTS+= -j${ADK_MAKE_JOBS}
+endif
+
+$(WRKBUILD)/.headers:
+ $(SED) 's,^CROSS_COMPILE=.*,CROSS_COMPILE=$(TARGET_CROSS),g' $(WRKBUILD)/Rules.mak
+ sed -e 's^KERNEL_HEADERS.*$$KERNEL_HEADERS=\"${STAGING_TARGET_DIR}/usr/include\"' \
+ $(ADK_TOPDIR)/target/$(ADK_TARGET_ARCH)/uclibc-ng.config >${WRKBUILD}/.config
+ifeq ($(ADK_TARGET_ENDIAN),little)
+ $(SED) 's/.*\(ARCH_LITTLE_ENDIAN\).*/\1=y/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(ARCH_WANTS_LITTLE_ENDIAN\).*/\1=y/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(ARCH_BIG_ENDIAN\).*/# \1 is not set/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(ARCH_WANTS_BIG_ENDIAN\).*/# \1 is not set/' ${WRKBUILD}/.config
+else
+ $(SED) 's/.*\(ARCH_BIG_ENDIAN\).*/\1=y/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(ARCH_WANTS_BIG_ENDIAN\).*/\1=y/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(ARCH_LITTLE_ENDIAN\).*/# \1 is not set/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(ARCH_WANTS_LITTLE_ENDIAN\).*/# \1 is not set/' ${WRKBUILD}/.config
+endif
+ifeq ($(ADK_LINUX_64),y)
+ $(SED) 's/.*\(CONFIG_MIPS_ISA_MIPS64\).*/\1=y/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(CONFIG_MIPS_ISA_MIPS32\).*/# \1 is not set/' ${WRKBUILD}/.config
+else
+ $(SED) 's/.*\(CONFIG_MIPS_ISA_MIPS32\).*/\1=y/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(CONFIG_MIPS_ISA_MIPS64\).*/# \1 is not set/' ${WRKBUILD}/.config
+endif
+ifeq ($(ADK_n64),y)
+ $(SED) 's/.*\(CONFIG_MIPS_N64_ABI\).*/\1=y/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(CONFIG_MIPS_O32_ABI\).*/# \1 is not set/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(CONFIG_MIPS_N32_ABI\).*/# \1 is not set/' ${WRKBUILD}/.config
+endif
+ifeq ($(ADK_n32),y)
+ $(SED) 's/.*\(CONFIG_MIPS_N32_ABI\).*/\1=y/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(CONFIG_MIPS_O32_ABI\).*/# \1 is not set/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(CONFIG_MIPS_N64_ABI\).*/# \1 is not set/' ${WRKBUILD}/.config
+endif
+ifeq ($(ADK_o32),y)
+ $(SED) 's/.*\(CONFIG_MIPS_O32_ABI\).*/\1=y/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(CONFIG_MIPS_N32_ABI\).*/# \1 is not set/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(CONFIG_MIPS_N64_ABI\).*/# \1 is not set/' ${WRKBUILD}/.config
+endif
+ifneq ($(ADK_PACKAGE_GDB),)
+ $(SED) "s/.*\(PTHREADS_DEBUG_SUPPORT\).*/\1=y/" ${WRKBUILD}/.config
+endif
+ifeq ($(ADK_LINUX_ARM_WITH_THUMB),y)
+ $(SED) 's/.*\(COMPILE_IN_THUMB_MODE\).*/\1=y/' ${WRKBUILD}/.config
+endif
+ifeq ($(ADK_TARGET_USE_SSP),y)
+ $(SED) 's,.*UCLIBC_HAS_SSP,UCLIBC_HAS_SSP=y,' ${WRKBUILD}/.config
+ echo "UCLIBC_HAS_SSP_COMPAT=n" >> ${WRKBUILD}/.config
+ echo "SSP_QUICK_CANARY=n" >> ${WRKBUILD}/.config
+ echo "UCLIBC_BUILD_SSP=y" >> ${WRKBUILD}/.config
+endif
+ echo N|$(MAKE) ${UCLIBC_MAKEOPTS} -C $(WRKBUILD) \
+ PREFIX=$(STAGING_TARGET_DIR) \
+ DEVEL_PREFIX=/usr/ \
+ RUNTIME_PREFIX=$(STAGING_TARGET_DIR) \
+ HOSTCC="$(HOST_CC)" \
+ CPU_CFLAGS="$(TARGET_CFLAGS)" \
+ oldconfig
+ $(MAKE) ${UCLIBC_MAKEOPTS} -C $(WRKBUILD) \
+ PREFIX=$(STAGING_TARGET_DIR) \
+ DEVEL_PREFIX=/usr/ \
+ RUNTIME_PREFIX=$(STAGING_TARGET_DIR) \
+ HOSTCC="$(HOST_CC)" \
+ CPU_CFLAGS="$(TARGET_CFLAGS)" \
+ install_headers
+ touch $(WRKBUILD)/.configured
+ touch $@
+
+$(WRKBUILD)/.compiled:
+ $(MAKE) ${UCLIBC_MAKEOPTS} -C $(WRKBUILD) \
+ PREFIX= \
+ DEVEL_PREFIX=/ \
+ RUNTIME_PREFIX=/ \
+ HOSTCC="$(HOST_CC)" \
+ CPU_CFLAGS="$(TARGET_CFLAGS)" \
+ all
+ touch $@
+
+$(WRKBUILD)/.install_headers: $(WRKBUILD)/.compiled
+ $(MAKE) -C $(WRKBUILD) \
+ PREFIX=$(STAGING_TARGET_DIR) \
+ DEVEL_PREFIX=/usr/ \
+ DEVEL_PREFIX_LIB=/ \
+ RUNTIME_PREFIX=/ \
+ CPU_CFLAGS="$(TARGET_CFLAGS)" \
+ install_dev
+ touch $@
+
+$(WRKBUILD)/.installed: $(WRKBUILD)/.install_headers
+ touch $@
+
+$(WRKBUILD)/.fixup:
+ $(MAKE) -C $(WRKBUILD) \
+ PREFIX=$(STAGING_TARGET_DIR) \
+ DEVEL_PREFIX=/usr/ \
+ DEVEL_PREFIX_LIB=/ \
+ RUNTIME_PREFIX=/ \
+ CPU_CFLAGS="$(TARGET_CFLAGS)" \
+ all install_runtime
+ifeq ($(ADK_TARGET_TOOLCHAIN),y)
+ # cleanup toolchain
+ -find $(STAGING_TARGET_DIR) $(STAGING_HOST_DIR) -name \*.la -delete
+ # strip target libs and host tools for toolchain builds
+ PATH="$(TARGET_PATH)" debug='0' prefix='${TARGET_CROSS}' ${BASH} ${SCRIPT_DIR}/rstrip.sh \
+ $(STAGING_TARGET_DIR) $(TOOLCHAIN_DIR)/usr/lib/gcc/$(GNU_TARGET_NAME)
+ debug='0' prefix=' ' ${BASH} ${SCRIPT_DIR}/rstrip.sh $(TOOLCHAIN_DIR)/usr/bin
+endif
+ touch $@
+
+include ${ADK_TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/uclibc-ng/Makefile.inc b/toolchain/uclibc-ng/Makefile.inc
new file mode 100644
index 000000000..984898df9
--- /dev/null
+++ b/toolchain/uclibc-ng/Makefile.inc
@@ -0,0 +1,9 @@
+# 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-ng
+PKG_VERSION:= 1.0.0beta1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= c21e841677bb02ec49f142be131ccb23
+PKG_SITES:= http://downloads.uclibc-ng.org/
+DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.xz
diff --git a/toolchain/uclibc-ng/arch.lst b/toolchain/uclibc-ng/arch.lst
new file mode 100644
index 000000000..4eabdeec5
--- /dev/null
+++ b/toolchain/uclibc-ng/arch.lst
@@ -0,0 +1,10 @@
+alpha
+arm
+mips
+mips64
+ppc
+sh
+sparc
+x86
+x86_64
+xtensa