summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2015-01-01 17:34:04 +0100
committerAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2015-01-01 19:42:55 +0100
commit68a7c6bccf6b807d103fc2e1ca50cb42d2f875d2 (patch)
tree8ca2e9326c5da6270496a1d43a3afd0352a21417
parente5ec96a546bafab4ec8b78bebb16616156e99c3f (diff)
downloadembtoolkit-68a7c6bccf6b807d103fc2e1ca50cb42d2f875d2.tar.gz
embtoolkit-68a7c6bccf6b807d103fc2e1ca50cb42d2f875d2.tar.bz2
embtoolkit-68a7c6bccf6b807d103fc2e1ca50cb42d2f875d2.tar.xz
Toolchain: linux headers: give ability use a git repository or and custom tarball source tree
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
-rw-r--r--core/kconfig/linux-custom.kconfig87
-rw-r--r--core/kconfig/linux-generic.kconfig242
-rw-r--r--core/kconfig/linux.kconfig222
-rw-r--r--core/mk/pkg-macros/vars.mk17
-rw-r--r--core/toolchain/linux/common.mk25
-rw-r--r--core/toolchain/linux/headers.mk9
-rw-r--r--core/toolchain/linux/linux.mk9
7 files changed, 386 insertions, 225 deletions
diff --git a/core/kconfig/linux-custom.kconfig b/core/kconfig/linux-custom.kconfig
new file mode 100644
index 0000000..76e810d
--- /dev/null
+++ b/core/kconfig/linux-custom.kconfig
@@ -0,0 +1,87 @@
+################################################################################
+# Embtoolkit
+# Copyright(C) 2009-2015 Abdoulaye Walsimou GAYE.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that 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, see <http://www.gnu.org/licenses/>.
+#
+################################################################################
+#
+# \file linux-generic.kconfig
+# \brief linux kernel custom kconfig
+# \author Abdoulaye Walsimou GAYE <awg@embtoolkit.org>
+# \date December 2014
+################################################################################
+
+choice
+ prompt "Custom linux kernel source from"
+
+ config EMBTK_LINUX_SRC_CUSTOM_TARBALL
+ bool "tarball archive"
+ help
+ Download a remote tarball and uncompress it.
+ Note: If if the tarball is in the format linux-x.y.tar.gz,
+ the uncompressed source tree is assumed to be linux-x.y
+
+ config EMBTK_LINUX_SRC_CUSTOM_GIT
+ bool "Git repository"
+ select EMBTK_LINUX_VERSION_GIT
+ help
+ Use linux kernel source tree from a git repository.
+endchoice
+
+#
+# Custom tarball options
+#
+config EMBTK_LINUX_SRC_CUSTOM_URL
+ string "tarball URL (mandatory)"
+ depends on EMBTK_LINUX_SRC_CUSTOM_TARBALL
+ default "https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.27.tar.xz"
+ help
+ Full URL of the tarball to download.
+
+config EMBTK_LINUX_VERSION_STRING
+ string
+ depends on EMBTK_LINUX_SRC_CUSTOM_TARBALL
+ default "custom"
+
+#
+# GIT repository options
+#
+config EMBTK_LINUX_VERSION_GIT
+ bool
+
+config EMBTK_LINUX_GIT_SITE
+ string "Repository URL (mandatory)"
+ depends on EMBTK_LINUX_VERSION_GIT
+ default "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"
+ help
+ The the git repository URL to use.
+
+config EMBTK_LINUX_GIT_BRANCH
+ string "Branch to use"
+ depends on EMBTK_LINUX_VERSION_GIT
+ default "master"
+ help
+ The branch of the git repository to use, the default is master.
+
+config EMBTK_LINUX_GIT_REVISION
+ string "Checkout a specific revision instead of the latest"
+ depends on EMBTK_LINUX_VERSION_GIT
+ help
+ Chechout a specific revision instead of the latest.
+
+config EMBTK_LINUX_REFSPEC
+ string
+ depends on EMBTK_LINUX_VERSION_GIT
+ default "toolchain"
diff --git a/core/kconfig/linux-generic.kconfig b/core/kconfig/linux-generic.kconfig
new file mode 100644
index 0000000..a25e559
--- /dev/null
+++ b/core/kconfig/linux-generic.kconfig
@@ -0,0 +1,242 @@
+################################################################################
+# Embtoolkit
+# Copyright(C) 2009-2015 Abdoulaye Walsimou GAYE.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that 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, see <http://www.gnu.org/licenses/>.
+#
+################################################################################
+#
+# \file linux-generic.kconfig
+# \brief linux kernel generic kconfig
+# \author Abdoulaye Walsimou GAYE <awg@embtoolkit.org>
+# \date December 2014
+################################################################################
+
+choice
+ prompt "Generic linux version to use"
+ help
+ Here you can choose which Linux kernel headers you want to use.
+
+ config EMBTK_LINUX_VERSION_3_16_X
+ bool "linux-3.16.x"
+ help
+ Use a linux-3.16.x version.
+ config EMBTK_LINUX_VERSION_3_15_X
+ bool "linux-3.15.x"
+ help
+ Use a linux-3.15.x version.
+ config EMBTK_LINUX_VERSION_3_14_X
+ bool "linux-3.14.x"
+ help
+ Use a linux-3.14.x version.
+ config EMBTK_LINUX_VERSION_3_13_X
+ bool "linux-3.13.x"
+ help
+ Use a linux-3.13.x version.
+ config EMBTK_LINUX_VERSION_3_12_X
+ bool "linux-3.12.x"
+ help
+ Use a linux-3.12.x version.
+ config EMBTK_LINUX_VERSION_3_11_X
+ bool "linux-3.11.x"
+ help
+ Use a linux-3.11.x version.
+ config EMBTK_LINUX_VERSION_3_10_X
+ bool "linux-3.10.x"
+ help
+ Use a linux-3.10.x version.
+ config EMBTK_LINUX_VERSION_3_9_X
+ bool "linux-3.9.x"
+ help
+ Use a linux-3.9.x version.
+ config EMBTK_LINUX_VERSION_3_8_X
+ bool "linux-3.8.x"
+ help
+ Use a linux-3.8.x version.
+ config EMBTK_LINUX_VERSION_3_7_X
+ bool "linux-3.7.x"
+ help
+ Use a linux-3.7.x version.
+ config EMBTK_LINUX_VERSION_3_6_X
+ bool "linux-3.6.x"
+ help
+ Use a linux-3.6.x version.
+ config EMBTK_LINUX_VERSION_3_5_X
+ bool "linux-3.5.x"
+ help
+ Use a linux-3.5.x version.
+ config EMBTK_LINUX_VERSION_3_4_X
+ bool "linux-3.4.x"
+ help
+ Use a linux-3.4.x version.
+ config EMBTK_LINUX_VERSION_3_3_X
+ bool "linux-3.3.x"
+ help
+ Use a linux-3.3.x version.
+ config EMBTK_LINUX_VERSION_3_2_X
+ bool "linux-3.2.x"
+ help
+ Use a linux-3.2.x version.
+ config EMBTK_LINUX_VERSION_3_1_X
+ bool "linux-3.1.x"
+ help
+ Use a linux-3.1.x version.
+ config EMBTK_LINUX_VERSION_3_0_X
+ bool "linux-3.0.x"
+ help
+ Use a linux-3.0.x version.
+ config EMBTK_LINUX_VERSION_2_6_39_X
+ bool "linux-2.6.39.x"
+ help
+ Use a linux-2.6.39.x version.
+ config EMBTK_LINUX_VERSION_2_6_38_X
+ bool "linux-2.6.38.x"
+ help
+ Use a linux-2.6.38.x version.
+ config EMBTK_LINUX_VERSION_2_6_37_X
+ bool "linux-2.6.37.x"
+ help
+ Use a linux-2.6.37.x version.
+ config EMBTK_LINUX_VERSION_2_6_36_X
+ bool "linux-2.6.36.x"
+ help
+ Use a linux-2.6.36.x version.
+ config EMBTK_LINUX_VERSION_2_6_35_X
+ bool "linux-2.6.35.x"
+ help
+ Use a linux-2.6.35.x version.
+ config EMBTK_LINUX_VERSION_2_6_34_X
+ bool "linux-2.6.34.x"
+ help
+ Use a linux-2.6.34.x version.
+ config EMBTK_LINUX_VERSION_2_6_33_X
+ bool "linux-2.6.33.x"
+ help
+ Use a linux-2.6.33.x version.
+ config EMBTK_LINUX_VERSION_2_6_32_X
+ bool "linux-2.6.32.x"
+ help
+ Use a linux-2.6.32.x version.
+endchoice
+
+if EMBTK_LINUX_VERSION_3_16_X
+source core/kconfig/linux-kconfigs/linux-3.16.kconfig
+endif
+
+if EMBTK_LINUX_VERSION_3_15_X
+source core/kconfig/linux-kconfigs/linux-3.15.kconfig
+endif
+
+if EMBTK_LINUX_VERSION_3_14_X
+source core/kconfig/linux-kconfigs/linux-3.14.kconfig
+endif
+
+if EMBTK_LINUX_VERSION_3_13_X
+source core/kconfig/linux-kconfigs/linux-3.13.kconfig
+endif
+
+if EMBTK_LINUX_VERSION_3_12_X
+source core/kconfig/linux-kconfigs/linux-3.12.kconfig
+endif
+
+if EMBTK_LINUX_VERSION_3_11_X
+source core/kconfig/linux-kconfigs/linux-3.11.kconfig
+endif
+
+if EMBTK_LINUX_VERSION_3_10_X
+source core/kconfig/linux-kconfigs/linux-3.10.kconfig
+endif
+
+if EMBTK_LINUX_VERSION_3_9_X
+source core/kconfig/linux-kconfigs/linux-3.9.kconfig
+endif
+
+if EMBTK_LINUX_VERSION_3_8_X
+source core/kconfig/linux-kconfigs/linux-3.8.kconfig
+endif
+
+if EMBTK_LINUX_VERSION_3_7_X
+source core/kconfig/linux-kconfigs/linux-3.7.kconfig
+endif
+
+if EMBTK_LINUX_VERSION_3_6_X
+source core/kconfig/linux-kconfigs/linux-3.6.kconfig
+endif
+
+if EMBTK_LINUX_VERSION_3_5_X
+source core/kconfig/linux-kconfigs/linux-3.5.kconfig
+endif
+
+if EMBTK_LINUX_VERSION_3_4_X
+source core/kconfig/linux-kconfigs/linux-3.4.kconfig
+endif
+
+if EMBTK_LINUX_VERSION_3_3_X
+source core/kconfig/linux-kconfigs/linux-3.3.kconfig
+endif
+
+if EMBTK_LINUX_VERSION_3_2_X
+source core/kconfig/linux-kconfigs/linux-3.2.kconfig
+endif
+
+if EMBTK_LINUX_VERSION_3_1_X
+source core/kconfig/linux-kconfigs/linux-3.1.kconfig
+endif
+
+if EMBTK_LINUX_VERSION_3_0_X
+source core/kconfig/linux-kconfigs/linux-3.0.kconfig
+endif
+
+if EMBTK_LINUX_VERSION_2_6_39_X
+source core/kconfig/linux-kconfigs/linux-2.6.39.kconfig
+endif
+
+if EMBTK_LINUX_VERSION_2_6_38_X
+source core/kconfig/linux-kconfigs/linux-2.6.38.kconfig
+endif
+
+if EMBTK_LINUX_VERSION_2_6_37_X
+source core/kconfig/linux-kconfigs/linux-2.6.37.kconfig
+endif
+
+if EMBTK_LINUX_VERSION_2_6_36_X
+source core/kconfig/linux-kconfigs/linux-2.6.36.kconfig
+endif
+
+if EMBTK_LINUX_VERSION_2_6_35_X
+source core/kconfig/linux-kconfigs/linux-2.6.35.kconfig
+endif
+
+if EMBTK_LINUX_VERSION_2_6_34_X
+source core/kconfig/linux-kconfigs/linux-2.6.34.kconfig
+endif
+
+if EMBTK_LINUX_VERSION_2_6_33_X
+source core/kconfig/linux-kconfigs/linux-2.6.33.kconfig
+endif
+
+if EMBTK_LINUX_VERSION_2_6_32_X
+source core/kconfig/linux-kconfigs/linux-2.6.32.kconfig
+endif
+
+config EMBTK_LINUX_HAVE_MIRROR
+ bool "Use a linux mirror"
+ help
+ specify an alternate location where to download linux sources.
+config EMBTK_LINUX_HAVE_MIRROR_SITE
+ depends on EMBTK_LINUX_HAVE_MIRROR
+ string "Mirror site"
+ default "ftp://ftp.embtoolkit.org/embtoolkit.org/packages-mirror"
+ help
+ specify an alternate location where to download linux sources
diff --git a/core/kconfig/linux.kconfig b/core/kconfig/linux.kconfig
index abefb70..7abcb95 100644
--- a/core/kconfig/linux.kconfig
+++ b/core/kconfig/linux.kconfig
@@ -1,6 +1,6 @@
#################################################################################
# Embtoolkit
-# Copyright(C) 2009-2014 Abdoulaye Walsimou GAYE.
+# Copyright(C) 2009-2015 Abdoulaye Walsimou GAYE.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -24,222 +24,28 @@
################################################################################
choice
- prompt "Linux series to use"
+ prompt "Linux kernel source"
help
- Here you can choose which Linux kernel headers you want to use.
+ Which linux kernel to use and where to find it.
- config EMBTK_LINUX_VERSION_3_16_X
- bool "linux-3.16.x"
+ config EMBTK_LINUX_SRC_GENERIC
+ bool "Generic"
help
- Use a linux-3.16.x version.
- config EMBTK_LINUX_VERSION_3_15_X
- bool "linux-3.15.x"
+ To build the toolchain, use generic kernel source tree from
+ kernel.org.
+ config EMBTK_LINUX_SRC_CUSTOM
+ bool "Custom"
help
- Use a linux-3.15.x version.
- config EMBTK_LINUX_VERSION_3_14_X
- bool "linux-3.14.x"
- help
- Use a linux-3.14.x version.
- config EMBTK_LINUX_VERSION_3_13_X
- bool "linux-3.13.x"
- help
- Use a linux-3.13.x version.
- config EMBTK_LINUX_VERSION_3_12_X
- bool "linux-3.12.x"
- help
- Use a linux-3.12.x version.
- config EMBTK_LINUX_VERSION_3_11_X
- bool "linux-3.11.x"
- help
- Use a linux-3.11.x version.
- config EMBTK_LINUX_VERSION_3_10_X
- bool "linux-3.10.x"
- help
- Use a linux-3.10.x version.
- config EMBTK_LINUX_VERSION_3_9_X
- bool "linux-3.9.x"
- help
- Use a linux-3.9.x version.
- config EMBTK_LINUX_VERSION_3_8_X
- bool "linux-3.8.x"
- help
- Use a linux-3.8.x version.
- config EMBTK_LINUX_VERSION_3_7_X
- bool "linux-3.7.x"
- help
- Use a linux-3.7.x version.
- config EMBTK_LINUX_VERSION_3_6_X
- bool "linux-3.6.x"
- help
- Use a linux-3.6.x version.
- config EMBTK_LINUX_VERSION_3_5_X
- bool "linux-3.5.x"
- help
- Use a linux-3.5.x version.
- config EMBTK_LINUX_VERSION_3_4_X
- bool "linux-3.4.x"
- help
- Use a linux-3.4.x version.
- config EMBTK_LINUX_VERSION_3_3_X
- bool "linux-3.3.x"
- help
- Use a linux-3.3.x version.
- config EMBTK_LINUX_VERSION_3_2_X
- bool "linux-3.2.x"
- help
- Use a linux-3.2.x version.
- config EMBTK_LINUX_VERSION_3_1_X
- bool "linux-3.1.x"
- help
- Use a linux-3.1.x version.
- config EMBTK_LINUX_VERSION_3_0_X
- bool "linux-3.0.x"
- help
- Use a linux-3.0.x version.
- config EMBTK_LINUX_VERSION_2_6_39_X
- bool "linux-2.6.39.x"
- help
- Use a linux-2.6.39.x version.
- config EMBTK_LINUX_VERSION_2_6_38_X
- bool "linux-2.6.38.x"
- help
- Use a linux-2.6.38.x version.
- config EMBTK_LINUX_VERSION_2_6_37_X
- bool "linux-2.6.37.x"
- help
- Use a linux-2.6.37.x version.
- config EMBTK_LINUX_VERSION_2_6_36_X
- bool "linux-2.6.36.x"
- help
- Use a linux-2.6.36.x version.
- config EMBTK_LINUX_VERSION_2_6_35_X
- bool "linux-2.6.35.x"
- help
- Use a linux-2.6.35.x version.
- config EMBTK_LINUX_VERSION_2_6_34_X
- bool "linux-2.6.34.x"
- help
- Use a linux-2.6.34.x version.
- config EMBTK_LINUX_VERSION_2_6_33_X
- bool "linux-2.6.33.x"
- help
- Use a linux-2.6.33.x version.
- config EMBTK_LINUX_VERSION_2_6_32_X
- bool "linux-2.6.32.x"
- help
- Use a linux-2.6.32.x version.
+ Use your own custom linux kernel source tree.
endchoice
-if EMBTK_LINUX_VERSION_3_16_X
-source core/kconfig/linux-kconfigs/linux-3.16.kconfig
-endif
-
-if EMBTK_LINUX_VERSION_3_15_X
-source core/kconfig/linux-kconfigs/linux-3.15.kconfig
-endif
-
-if EMBTK_LINUX_VERSION_3_14_X
-source core/kconfig/linux-kconfigs/linux-3.14.kconfig
-endif
-
-if EMBTK_LINUX_VERSION_3_13_X
-source core/kconfig/linux-kconfigs/linux-3.13.kconfig
-endif
-
-if EMBTK_LINUX_VERSION_3_12_X
-source core/kconfig/linux-kconfigs/linux-3.12.kconfig
-endif
-
-if EMBTK_LINUX_VERSION_3_11_X
-source core/kconfig/linux-kconfigs/linux-3.11.kconfig
-endif
-
-if EMBTK_LINUX_VERSION_3_10_X
-source core/kconfig/linux-kconfigs/linux-3.10.kconfig
-endif
-
-if EMBTK_LINUX_VERSION_3_9_X
-source core/kconfig/linux-kconfigs/linux-3.9.kconfig
-endif
-
-if EMBTK_LINUX_VERSION_3_8_X
-source core/kconfig/linux-kconfigs/linux-3.8.kconfig
-endif
-
-if EMBTK_LINUX_VERSION_3_7_X
-source core/kconfig/linux-kconfigs/linux-3.7.kconfig
-endif
-
-if EMBTK_LINUX_VERSION_3_6_X
-source core/kconfig/linux-kconfigs/linux-3.6.kconfig
-endif
-
-if EMBTK_LINUX_VERSION_3_5_X
-source core/kconfig/linux-kconfigs/linux-3.5.kconfig
-endif
-
-if EMBTK_LINUX_VERSION_3_4_X
-source core/kconfig/linux-kconfigs/linux-3.4.kconfig
-endif
-
-if EMBTK_LINUX_VERSION_3_3_X
-source core/kconfig/linux-kconfigs/linux-3.3.kconfig
-endif
-
-if EMBTK_LINUX_VERSION_3_2_X
-source core/kconfig/linux-kconfigs/linux-3.2.kconfig
-endif
-
-if EMBTK_LINUX_VERSION_3_1_X
-source core/kconfig/linux-kconfigs/linux-3.1.kconfig
-endif
-
-if EMBTK_LINUX_VERSION_3_0_X
-source core/kconfig/linux-kconfigs/linux-3.0.kconfig
-endif
-
-if EMBTK_LINUX_VERSION_2_6_39_X
-source core/kconfig/linux-kconfigs/linux-2.6.39.kconfig
-endif
-
-if EMBTK_LINUX_VERSION_2_6_38_X
-source core/kconfig/linux-kconfigs/linux-2.6.38.kconfig
-endif
-
-if EMBTK_LINUX_VERSION_2_6_37_X
-source core/kconfig/linux-kconfigs/linux-2.6.37.kconfig
-endif
-
-if EMBTK_LINUX_VERSION_2_6_36_X
-source core/kconfig/linux-kconfigs/linux-2.6.36.kconfig
+if EMBTK_LINUX_SRC_GENERIC
+source "core/kconfig/linux-generic.kconfig"
endif
-if EMBTK_LINUX_VERSION_2_6_35_X
-source core/kconfig/linux-kconfigs/linux-2.6.35.kconfig
+if EMBTK_LINUX_SRC_CUSTOM
+source "core/kconfig/linux-custom.kconfig"
endif
-if EMBTK_LINUX_VERSION_2_6_34_X
-source core/kconfig/linux-kconfigs/linux-2.6.34.kconfig
-endif
-
-if EMBTK_LINUX_VERSION_2_6_33_X
-source core/kconfig/linux-kconfigs/linux-2.6.33.kconfig
-endif
-
-if EMBTK_LINUX_VERSION_2_6_32_X
-source core/kconfig/linux-kconfigs/linux-2.6.32.kconfig
-endif
-
-config EMBTK_LINUX_HAVE_MIRROR
- bool "Use a linux mirror"
- help
- specify an alternate location where to download linux sources.
-config EMBTK_LINUX_HAVE_MIRROR_SITE
- depends on EMBTK_LINUX_HAVE_MIRROR
- string "Mirror site"
- default "ftp://ftp.embtoolkit.org/embtoolkit.org/packages-mirror"
- help
- specify an alternate location where to download linux sources
-
config EMBTK_LINUX_NEED_PATCH
bool
diff --git a/core/mk/pkg-macros/vars.mk b/core/mk/pkg-macros/vars.mk
index 0dcbf2f..e622c1c 100644
--- a/core/mk/pkg-macros/vars.mk
+++ b/core/mk/pkg-macros/vars.mk
@@ -1,6 +1,6 @@
################################################################################
# Embtoolkit
-# Copyright(C) 2014 Abdoulaye Walsimou GAYE.
+# Copyright(C) 2009-2015 Abdoulaye Walsimou GAYE.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -64,6 +64,20 @@ __embtk_pkg_mirror2 = $(strip $($(PKGV)_MIRROR2))
__embtk_pkg_mirror3 = $(strip $($(PKGV)_MIRROR3))
__embtk_pkg_package = $(strip $($(PKGV)_PACKAGE))
__embtk_pkg_package_remote = $(or $(strip $($(PKGV)_PACKAGE_REMOTE)),$(__embtk_pkg_package))
+__embtk_pkg_tarball_fmt = $(or $(__embtk_pkg_tarball_targz),\
+ $(__embtk_pkg_tarball_tgz),\
+ $(__embtk_pkg_tarball_tarbz2),\
+ $(__embtk_pkg_tarball_tbz2),\
+ $(__embtk_pkg_tarball_tarxz),\
+ $(__embtk_pkg_tarball_txz),\
+ $(__embtk_pkg_tarball_tar))
+__embtk_pkg_tarball_targz = $(if $(filter %.tar.gz,$(__embtk_pkg_package)),tar.gz)
+__embtk_pkg_tarball_tgz = $(if $(filter %.tgz,$(__embtk_pkg_package)),tgz)
+__embtk_pkg_tarball_tarbz2 = $(if $(filter %.tar.bz2,$(__embtk_pkg_package)),tar.bz2)
+__embtk_pkg_tarball_tbz2 = $(if $(filter %.tbz2,$(__embtk_pkg_package)),tbz2)
+__embtk_pkg_tarball_tarxz = $(if $(filter %.tar.xz,$(__embtk_pkg_package)),tar.xz)
+__embtk_pkg_tarball_txz = $(if $(filter %.txz,$(__embtk_pkg_package)),txz)
+__embtk_pkg_tarball_tar = $(if $(filter %.tar,$(__embtk_pkg_package)),tar)
__embtk_pkg_refspec = $(or $(call __embtk_mk_uquote,$(CONFIG_EMBTK_$(PKGV)_REFSPEC)),$(__embtk_$(pkgv)_category))
@@ -144,3 +158,4 @@ __embtk_pkg_usewaf-y = $(CONFIG_EMBTK_$(PKGV)_USE_WAF)
# Variables/macros defined here exported for use externally
#
embtk_pkg_srcdir = $(__embtk_pkg_srcdir)
+embtk_pkg_tarball_fmt = $(__embtk_pkg_tarball_fmt)
diff --git a/core/toolchain/linux/common.mk b/core/toolchain/linux/common.mk
index 61c8917..7b3accb 100644
--- a/core/toolchain/linux/common.mk
+++ b/core/toolchain/linux/common.mk
@@ -1,6 +1,6 @@
################################################################################
# Embtoolkit
-# Copyright(C) 2009-2014 Abdoulaye Walsimou GAYE.
+# Copyright(C) 2009-2015 Abdoulaye Walsimou GAYE.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -23,19 +23,28 @@
# \date May 2009
################################################################################
-pembtk_linux_site = $(or $(pembtk_linux_site_mirror),$(pembtk_linux_site_full))
-pembtk_linux_site_mirror = $(call embtk_uquote,$(CONFIG_EMBTK_LINUX_HAVE_MIRROR))
-pembtk_linux_site_full = $(pembtk_linux_site_base)/$(LINUX_MAJORV)$(pembtk_linux_longterm_v)
-pembtk_linux_site_base = http://ftp.kernel.org/pub/linux/kernel
-pembtk_linux_longterm_v = $(if $(LINUX_LONGTERMV),/longterm/$(LINUX_LONGTERMV))
+pembtk_linux_site = $(or $(pembtk_linux_site_mirror),$(pembtk_linux_site_custom),$(pembtk_linux_site_full))
+pembtk_linux_site_mirror = $(call embtk_uquote,$(CONFIG_EMBTK_LINUX_HAVE_MIRROR))
+pembtk_linux_site_custom = $(dir $(call embtk_uquote,$(CONFIG_EMBTK_LINUX_SRC_CUSTOM_URL)))
+pembtk_linux_site_full = $(pembtk_linux_site_base)/$(LINUX_MAJORV)$(pembtk_linux_longterm_v)
+pembtk_linux_site_base = http://ftp.kernel.org/pub/linux/kernel
+pembtk_linux_longterm_v = $(if $(LINUX_LONGTERMV),/longterm/$(LINUX_LONGTERMV))
+
+pembtk_linux_package = $(or $(pembtk_linux_package_custom),$(pembtk_linux_package_generic))
+pembtk_linux_package_custom = $(notdir $(call embtk_uquote,$(CONFIG_EMBTK_LINUX_SRC_CUSTOM_URL)))
+pembtk_linux_package_generic = linux-$(LINUX_VERSION).tar.xz
+
+pembtk_commonlinux_srcdir = $(or $(pembtk_linux_srcdir_custom),$(pembtk_linux_srcdir_generic))
+pembtk_linux_srcdir_custom = $(patsubst %.$(call embtk_pkg_tarball_fmt,linux),%,$(pembtk_linux_package_custom))
+pembtk_linux_srcdir_generic = linux-$(LINUX_VERSION)
LINUX_NAME := linux
LINUX_MAJORV := $(call embtk_pkg_version,linux_major)
LINUX_LONGTERMV := $(call embtk_pkg_version,linux_longterm)
LINUX_VERSION := $(call embtk_pkg_version,linux)
LINUX_SITE := $(pembtk_linux_site)
-LINUX_PACKAGE := linux-$(LINUX_VERSION).tar.xz
-LINUX_SRC_DIR := $(embtk_toolsb)/linux-$(LINUX_VERSION)
+LINUX_PACKAGE := $(pembtk_linux_package)
+LINUX_SRC_DIR := $(embtk_toolsb)/$(pembtk_commonlinux_srcdir)
LINUX_BUILD_DIR := $(call embtk_pkg_srcdir,linux)
LINUX_KEEP_SRC_DIR := $(CONFIG_EMBTK_BUILD_LINUX_KERNEL)
diff --git a/core/toolchain/linux/headers.mk b/core/toolchain/linux/headers.mk
index 866d039..0a4518b 100644
--- a/core/toolchain/linux/headers.mk
+++ b/core/toolchain/linux/headers.mk
@@ -1,6 +1,6 @@
################################################################################
# Embtoolkit
-# Copyright(C) 2009-2014 Abdoulaye Walsimou GAYE.
+# Copyright(C) 2009-2015 Abdoulaye Walsimou GAYE.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -27,8 +27,9 @@ LINUX_HEADERS_NAME := linux
LINUX_HEADERS_VERSION := $(LINUX_VERSION)
LINUX_HEADERS_SITE := $(LINUX_SITE)
LINUX_HEADERS_PACKAGE := $(LINUX_PACKAGE)
-LINUX_HEADERS_SRC_DIR := $(LINUX_SRC_DIR)
-LINUX_HEADERS_BUILD_DIR := $(LINUX_BUILD_DIR)
+LINUX_HEADERS_SRC_DIR := $(call embtk_pkg_srcdir,linux)
+LINUX_HEADERS_BUILD_DIR := $(call embtk_pkg_srcdir,linux)
+
LINUX_HEADERS_KEEP_SRC_DIR := $(LINUX_KEEP_SRC_DIR)
LINUX_HEADERS_KCONFIGS_NAME := LINUX
@@ -48,5 +49,5 @@ define embtk_install_linux_headers
endef
define embtk_cleanup_linux_headers
- [ -d $(LINUX_BUILD_DIR) ] && $(call __embtk_unsetinstalled_pkg,linux_headers) ||:
+ [ -d $(LINUX_HEADERS_BUILD_DIR) ] && $(call __embtk_unsetinstalled_pkg,linux_headers) ||:
endef
diff --git a/core/toolchain/linux/linux.mk b/core/toolchain/linux/linux.mk
index 1fe8fcc..d3d2ede 100644
--- a/core/toolchain/linux/linux.mk
+++ b/core/toolchain/linux/linux.mk
@@ -1,6 +1,6 @@
#################################################################################
# Embtoolkit
-# Copyright(C) 2009-2014 Abdoulaye Walsimou GAYE.
+# Copyright(C) 2009-2015 Abdoulaye Walsimou GAYE.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -64,7 +64,7 @@ endef
ifeq ($(embtk_buildhost_os),macos)
define embtk_beforeinstall_linux
cp $(EMBTK_ROOT)/scripts/unifdef.c \
- $(LINUX_SRC_DIR)/scripts/unifdef.c
+ $(pembtk_linux_srcdir)/scripts/unifdef.c
endef
endif
@@ -114,8 +114,9 @@ LINUX_MODULES_NAME := linux
LINUX_MODULES_VERSION := $(LINUX_VERSION)
LINUX_MODULES_SITE := $(LINUX_SITE)
LINUX_MODULES_PACKAGE := $(LINUX_PACKAGE)
-LINUX_MODULES_SRC_DIR := $(LINUX_SRC_DIR)
-LINUX_MODULES_BUILD_DIR := $(LINUX_BUILD_DIR)
+LINUX_MODULES_SRC_DIR := $(pembtk_linux_srcdir)
+LINUX_MODULES_BUILD_DIR := $(pembtk_linux_srcdir)
+
LINUX_MODULES_KCONFIGS_NAME := LINUX
LINUX_MODULES_KEEP_SRC_DIR := $(LINUX_KEEP_SRC_DIR)