diff mbox

[5,of,6] binutils: Add CUSTOM version and CUSTOM_LOCATION config options and GetCustom

Message ID 53e0ec83f0eb86286025.1349849278@localhost.localdomain
State Superseded
Headers show

Commit Message

David Holsgrove Oct. 10, 2012, 6:07 a.m. UTC
# HG changeset patch
# User David Holsgrove <david.holsgrove@xilinx.com>
# Date 1349847855 -36000
# Node ID 53e0ec83f0eb86286025821388cbdb82a8510941
# Parent  e3e4a439914d0d206b08a7bed0245fc4854bc374
binutils: Add CUSTOM version and CUSTOM_LOCATION config options and GetCustom

CUSTOM_LOCATION config options only presented in menuconfig if component
CUSTOM version selected.


--
For unsubscribe information see http://sourceware.org/lists.html#faq

Comments

Yann E. MORIN Oct. 10, 2012, 10:41 p.m. UTC | #1
David, Bryan, All,

On Wednesday 10 October 2012 08:07:58 David Holsgrove wrote:
> binutils: Add CUSTOM version and CUSTOM_LOCATION config options and GetCustom
> 
> CUSTOM_LOCATION config options only presented in menuconfig if component
> CUSTOM version selected.

SoB.

Also, you /forgot/ elf2flt.

Don't bother about sstrip, it's aiming for /dev/null soonish.

Regards,
Yann E. MORIN.
diff mbox

Patch

diff -r e3e4a439914d -r 53e0ec83f0eb config/binutils/binutils.in
--- a/config/binutils/binutils.in	Wed Oct 10 15:44:14 2012 +1000
+++ b/config/binutils/binutils.in	Wed Oct 10 15:44:15 2012 +1000
@@ -50,8 +50,26 @@ 
     prompt "2.16.1a (OBSOLETE)"
     depends on OBSOLETE
 
+config BINUTILS_CUSTOM
+    bool
+    prompt "Custom binutils"
+    depends on EXPERIMENTAL
+    select BINUTILS_2_22_or_later
+
 endchoice
 
+if BINUTILS_CUSTOM
+
+config BINUTILS_CUSTOM_LOCATION
+    string
+    prompt "full path to custom binutils source"
+    default ""
+    help
+      Enter the path to the directory (or tarball) of your source for binutils,
+      or leave blank to use default CT_CUSTOM_LOCATION_ROOT_DIR/binutils
+
+endif # BINUTILS_CUSTOM
+
 config BINUTILS_VERSION
     string
 # Don't remove next line
@@ -64,6 +82,7 @@ 
     default "2.18a" if BINUTILS_V_2_18a
     default "2.17a" if BINUTILS_V_2_17a
     default "2.16.1a" if BINUTILS_V_2_16_1a
+    default "custom" if BINUTILS_CUSTOM
 
 config BINUTILS_2_22_or_later
     bool
diff -r e3e4a439914d -r 53e0ec83f0eb scripts/build/binutils/binutils.sh
--- a/scripts/build/binutils/binutils.sh	Wed Oct 10 15:44:14 2012 +1000
+++ b/scripts/build/binutils/binutils.sh	Wed Oct 10 15:44:15 2012 +1000
@@ -4,14 +4,26 @@ 
 
 # Download binutils
 do_binutils_get() {
-    CT_GetFile "binutils-${CT_BINUTILS_VERSION}"                                        \
-               {ftp,http}://{ftp.gnu.org/gnu,ftp.kernel.org/pub/linux/devel}/binutils   \
-               ftp://gcc.gnu.org/pub/binutils/{releases,snapshots}
+    if [ "${CT_BINUTILS_CUSTOM}" = "y" ]; then
+        CT_TestAndAbort "Custom binutils: CT_CUSTOM_LOCATION_ROOT_DIR or CT_BINUTILS_CUSTOM_LOCATION must be set." \
+        -z "${CT_CUSTOM_LOCATION_ROOT_DIR}" -a -z "${CT_BINUTILS_CUSTOM_LOCATION}"
+        if [ -n "${CT_CUSTOM_LOCATION_ROOT_DIR}" -a -z "${CT_BINUTILS_CUSTOM_LOCATION}" ]; then
+            CT_BINUTILS_CUSTOM_LOCATION="${CT_CUSTOM_LOCATION_ROOT_DIR}/binutils"
+        fi
+        CT_GetCustom "binutils-${CT_BINUTILS_VERSION}" "${CT_BINUTILS_CUSTOM_LOCATION}"
+    else
+        CT_GetFile "binutils-${CT_BINUTILS_VERSION}"                                        \
+                   {ftp,http}://{ftp.gnu.org/gnu,ftp.kernel.org/pub/linux/devel}/binutils   \
+                   ftp://gcc.gnu.org/pub/binutils/{releases,snapshots}
+    fi
 }
 
 # Extract binutils
 do_binutils_extract() {
-    CT_Extract "binutils-${CT_BINUTILS_VERSION}"
+    if [ "${CT_BINUTILS_CUSTOM}" != "y" \
+         -o ! -d "${CT_BINUTILS_CUSTOM_LOCATION}" ]; then
+        CT_Extract "binutils-${CT_BINUTILS_VERSION}"
+    fi
     CT_Patch "binutils" "${CT_BINUTILS_VERSION}"
 }