diff options
-rw-r--r-- | kconfig/mpchost.kconfig | 44 | ||||
-rw-r--r-- | kconfig/toolchain.kconfig | 13 | ||||
-rw-r--r-- | mk/binutils.mk | 1 | ||||
-rw-r--r-- | mk/gcc.mk | 7 | ||||
-rw-r--r-- | mk/mpchost.mk | 70 | ||||
-rw-r--r-- | mk/toolchain.mk | 13 |
6 files changed, 137 insertions, 11 deletions
diff --git a/kconfig/mpchost.kconfig b/kconfig/mpchost.kconfig new file mode 100644 index 0000000..e069e16 --- /dev/null +++ b/kconfig/mpchost.kconfig @@ -0,0 +1,44 @@ +################################################################################ +# GAYE Abdoulaye Walsimou, <walsimou@walsimou.com> +# Copyright(C) 2009 GAYE Abdoulaye Walsimou. All rights reserved. +# +# This program is free software; you can distribute it and/or modify it +# under the terms of the GNU General Public License +# (Version 2 or later) published by the Free Software Foundation. +# +# This program is distributed in the hope it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. +################################################################################ +# +# \file mpchost.kconfig +# \brief mpchost.kconfig of Embtoolkit +# \author GAYE Abdoulaye Walsimou, <walsimou@walsimou.com> +# \date Jan 2010 +################################################################################ + +choice + prompt "Version of mpc you wish" + help + Mpc is a C library for the arithmetic of complex numbers with + arbitrarily high precision and correct rounding of the result. + MPC is mandatory to build GCC + + config EMBTK_MPC_HOST_VERSION_0_8_1 + bool "mpc-0.8.1" +endchoice + +#Version string +config EMBTK_MPC_HOST_VERSION_STRING + string + default "0.8.1" if EMBTK_MPC_HOST_VERSION_0_8_1 + +#Does we need patches? +config EMBTK_MPC_NEED_PATCH + bool + diff --git a/kconfig/toolchain.kconfig b/kconfig/toolchain.kconfig index fca89cf..06540e1 100644 --- a/kconfig/toolchain.kconfig +++ b/kconfig/toolchain.kconfig @@ -61,14 +61,19 @@ menu "Binutils" source "kconfig/binutils.kconfig" endmenu -menu "MPFR" -source "kconfig/mpfrhost.kconfig" +menu "Linux kernel headers" +source "kconfig/linux.kconfig" endmenu menu "GMP" source "kconfig/gmphost.kconfig" endmenu -menu "Linux kernel headers" -source "kconfig/linux.kconfig" +menu "MPFR" +source "kconfig/mpfrhost.kconfig" endmenu + +menu "MPC" +source "kconfig/mpchost.kconfig" +endmenu + diff --git a/mk/binutils.mk b/mk/binutils.mk index e684cf8..bf729e3 100644 --- a/mk/binutils.mk +++ b/mk/binutils.mk @@ -65,5 +65,6 @@ $(BINUTILS_BUILD_DIR)/.configured: --prefix=$(TOOLS) --with-sysroot=$(SYSROOT) --disable-werror \ --disable-nls $(BINUTILS_MULTILIB) \ --with-gmp=$(GMP_HOST_DIR) --with-mpfr=$(MPFR_HOST_DIR) \ + --with-mpc=$(MPC_HOST_DIR) \ --target=$(STRICT_GNU_TARGET) --build=$(HOST_BUILD) --host=$(HOST_ARCH) @touch $@ @@ -100,7 +100,8 @@ $(GCC1_BUILD_DIR)/.configured: --without-headers --with-newlib --disable-shared --disable-threads \ --disable-libssp --disable-libgomp --disable-libmudflap --disable-nls \ --enable-languages=c --enable-target-optspace \ - --with-gmp=$(GMP_HOST_DIR) --with-mpfr=$(MPFR_HOST_DIR) + --with-gmp=$(GMP_HOST_DIR) --with-mpfr=$(MPFR_HOST_DIR) \ + --with-mpc=$(MPC_HOST_DIR) @touch $@ #GCC second stage @@ -120,7 +121,8 @@ $(GCC2_BUILD_DIR)/.configured: --host=$(HOST_ARCH) --build=$(HOST_BUILD) \ --disable-libssp --disable-libgomp --disable-libmudflap --disable-nls \ --enable-languages=c --enable-target-optspace \ - --with-gmp=$(GMP_HOST_DIR) --with-mpfr=$(MPFR_HOST_DIR) + --with-gmp=$(GMP_HOST_DIR) --with-mpfr=$(MPFR_HOST_DIR) \ + --with-mpc=$(MPC_HOST_DIR) @touch $@ #GCC last stage @@ -154,6 +156,7 @@ $(GCC3_BUILD_DIR)/.configured: --disable-libssp --disable-libgomp --disable-libmudflap --disable-nls \ --enable-threads --enable-shared --enable-target-optspace \ --with-gmp=$(GMP_HOST_DIR) --with-mpfr=$(MPFR_HOST_DIR) \ + --with-mpc=$(MPC_HOST_DIR) \ --enable-languages=`echo $(GCC_LANGUAGES) | sed 's/ //g'` \ $(GCC3_CONFIGURE_EXTRA_OPTIONS) \ --with-pkgversion=embtoolkit-$(EMBTK_VERSION) diff --git a/mk/mpchost.mk b/mk/mpchost.mk new file mode 100644 index 0000000..2a984fb --- /dev/null +++ b/mk/mpchost.mk @@ -0,0 +1,70 @@ +################################################################################ +# GAYE Abdoulaye Walsimou, <walsimou@walsimou.com> +# Copyright(C) 2009 GAYE Abdoulaye Walsimou. All rights reserved. +# +# This program is free software; you can distribute it and/or modify it +# under the terms of the GNU General Public License +# (Version 2 or later) published by the Free Software Foundation. +# +# This program is distributed in the hope it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. +################################################################################ +# +# \file mpchost.mk +# \brief mpchost.mk of Embtoolkit. To build gcc, we need mpc. +# \author GAYE Abdoulaye Walsimou, <walsimou@walsimou.com> +# \date Jan 2010 +################################################################################ + +MPC_HOST_VERSION:=$(subst ",,$(strip $(CONFIG_EMBTK_MPC_HOST_VERSION_STRING))) +MPC_HOST_SITE := http://www.multiprecision.org/mpc/download +MPC_PATCH_SITE := ftp://ftp.embtoolkit.org/embtoolkit.org/mpc +MPC_HOST_PACKAGE := mpc-$(MPC_HOST_VERSION).tar.gz +MPC_HOST_BUILD_DIR := $(TOOLS_BUILD)/mpc +MPC_HOST_DIR := $(HOSTTOOLS)/usr/local/mpc-host + +export MPC_HOST_DIR + +mpchost_install: $(MPC_HOST_BUILD_DIR)/.installed + +$(MPC_HOST_BUILD_DIR)/.installed: download_mpc_host \ + $(MPC_HOST_BUILD_DIR)/.decompressed $(MPC_HOST_BUILD_DIR)/.configured + $(Q)$(MAKE) -C $(MPC_HOST_BUILD_DIR) $(J) + $(Q)$(MAKE) -C $(MPC_HOST_BUILD_DIR) install + @touch $@ + +$(MPC_HOST_BUILD_DIR)/.decompressed: + @tar -C $(TOOLS_BUILD) -xzf $(DOWNLOAD_DIR)/$(MPC_HOST_PACKAGE) +ifeq ($(CONFIG_EMBTK_MPC_NEED_PATCH),y) + cd $(TOOLS_BUILD)/mpc-$(MPC_HOST_VERSION); \ + patch -p1 < $(DOWNLOAD_DIR)/mpc-$(MPC_HOST_VERSION).patch +endif + @mkdir -p $(MPC_HOST_BUILD_DIR) + @touch $@ + +download_mpc_host: + @test -e $(DOWNLOAD_DIR)/$(MPC_HOST_PACKAGE) || \ + wget $(MPC_HOST_SITE)/$(MPC_HOST_PACKAGE) \ + -O $(DOWNLOAD_DIR)/$(MPC_HOST_PACKAGE) +ifeq ($(CONFIG_EMBTK_MPC_HOST_VERSION_PATCH),y) + @test -e $(DOWNLOAD_DIR)/mpc-$(MPC_HOST_VERSION).patch || \ + wget $(MPC_PATCH_SITE)/mpc-$(MPC_HOST_VERSION)-*.patch \ + -O $(DOWNLOAD_DIR)/mpc-$(MPC_HOST_VERSION).patch +endif + +$(MPC_HOST_BUILD_DIR)/.configured: + $(call EMBTK_GENERIC_MESSAGE,"Configuring mpc-$(MPC_HOST_VERSION) ...") + cd $(MPC_HOST_BUILD_DIR); \ + CC=$(HOSTCC_CACHED) \ + CXX=$(HOSTCXX_CACHED) \ + $(TOOLS_BUILD)/mpc-$(MPC_HOST_VERSION)/configure \ + --build=$(HOST_BUILD) --host=$(HOST_ARCH) \ + --prefix=$(MPC_HOST_DIR) --disable-shared --enable-static \ + --with-gmp=$(GMP_HOST_DIR) --with-mpfr=$(MPFR_HOST_DIR) + @touch $@ diff --git a/mk/toolchain.mk b/mk/toolchain.mk index acf5eed..088b895 100644 --- a/mk/toolchain.mk +++ b/mk/toolchain.mk @@ -46,6 +46,9 @@ include $(EMBTK_ROOT)/mk/gmphost.mk #MPFR include $(EMBTK_ROOT)/mk/mpfrhost.mk +#MPC +include $(EMBTK_ROOT)/mk/mpchost.mk + #binutils include $(EMBTK_ROOT)/mk/binutils.mk @@ -59,15 +62,15 @@ ifeq ($(CONFIG_EMBTK_CLIB_EGLIBC),y) #EGLIBC include $(EMBTK_ROOT)/mk/eglibc.mk TOOLCHAINBUILD := mkinitialpath kernel-headers_install ccachehost_install \ - gmphost_install mpfrhost_install binutils_install \ - gcc1_install eglibc-headers_install gcc2_install \ - eglibc_install gcc3_install + gmphost_install mpfrhost_install mpchost_install \ + binutils_install gcc1_install eglibc-headers_install \ + gcc2_install eglibc_install gcc3_install else #uClibc include $(EMBTK_ROOT)/mk/uclibc.mk TOOLCHAINBUILD := mkinitialpath kernel-headers_install ccachehost_install \ - gmphost_install mpfrhost_install binutils_install gcc1_install \ - uclibc_install gcc3_install + gmphost_install mpfrhost_install mpchost_install \ + binutils_install gcc1_install uclibc_install gcc3_install endif #targets |