Commits

Thayne Harbaugh committed a1135fe

Add installation of Linaro toolchain.

  • Participants
  • Parent commits f9d18a7

Comments (0)

Files changed (1)

File ti-setup-dvsdk

 C64PLUS_DSPLIB|http://software-dl.ti.com/dsps/dsps_public_sw/c6000/web/c64p_dsplib/latest/exports/c64plus-dsplib_2_02_00_00_Linux-x86_Setup.bin|39c915d17666dedf5b460c7ba5337c34
 CGT_ARM|http://www.codesourcery.com/sgpp/lite/arm/portal/package4571/public/arm-none-linux-gnueabi/arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2|1a6e88782f08b09a0e6cef545a1712ec
 IQMATH|http://e2e.ti.com/cfs-file.ashx/__key/CommunityServer-Components-PostAttachments/00-00-34-04-84/IQmath_2D00_2.13_2D00_Linux_2D00_x86_2D00_Install.bin|744b760739c9cf62b3dad3be4e4500f1
+LINARO_DEV|http://releases.linaro.org/platform/linaro-n/developer/beta/linaro-n-developer-tar-20110329-0.tar.gz|8ff762cba7413d193dda9834691c37bb
 "
 
 ##################### No serviceable parts below ##########################
 UNPACK_TOOLS="
 expect
 rsync
+fakeroot
+"
+
+BUILD_TOOLS="
+addr2line
+ar
+as
+c++filt
+elfedit
+g++
+gcc
+gcov
+gold
+gprof
+ld
+nm
+objcopy
+objdump
+ranlib
+readelf
+size
+strings
+strip
 "
 
 
         for tool in $UNPACK_TOOLS; do
             which $tool >/dev/null 2>&1 || missing="${missing:+$missing }$tool"
         done
+
+        if [ -n "$LINARO_EXE" ]; then
+            local prefix="${LINARO_EXE%-gcc*}-"
+            local linaro_missing=
+            for tool in $BUILD_TOOLS; do
+                if ! [ -f "${prefix}$tool" ]; then
+                    linaro_missing="${linaro_missing:+$linaro_missing }$(basename "${prefix}$tool")"
+                fi
+            done
+            if [ -n "$linaro_missing" ]; then
+                printf "ERROR: please install the Linaro ARM toolchain: https://wiki.linaro.org/Resources/ToolchainInstall-10\n" >&2
+            fi
+        fi
     fi
-
+            
     if [ -n "$missing" ]; then
         printf "ERROR: please install the missing tools and try again:\n\t$missing\n" >&2
         exit 1
             #"$TI_INSTALL_DIR/$dvsdk_install_subdir/codec_engine_2_25_02_11/examples/xdcpaths.mak"
     fi
 
+    # Fix warning in source
+    (
+        cd "$TI_INSTALL_DIR/dvsdk/dvsdk_3_01_00_10"
+        patch -p1 <<EOF
+--- dvsdk_3_01_00_10.orig/dmai_2_05_00_12/packages/ti/sdo/dmai/linux/Display_fbdev.c	2011-04-11 23:50:54.871885186 -0600
++++ dvsdk_3_01_00_10/dmai_2_05_00_12/packages/ti/sdo/dmai/linux/Display_fbdev.c	2011-04-11 23:50:41.384211532 -0600
+@@ -134,7 +134,7 @@
+     Int                      displaySize;
+     Int                      bufIdx;
+     Int8                    *virtPtr;
+-    Int32                    physPtr;
++    Int32                    physPtr = 0;
+     Int                      height, width;
+     Display_Handle           hDisplay;
+     Buffer_Handle            hBuf;
+EOF
+    )
+
     cat <<EOF >>"$TI_ENV_SH"
 export DVSDK_INSTALL_DIR="\${TI_INSTALL_DIR}/$dvsdk_install_subdir"
 EOF
 
     if [ -n "$OE_DIR" ]; then
         printf "OpenEmbedded dir selected - not installing CGT_ARM\n"
-        # NOTE - apparently not everything respects $CSTOOL_PREFIX -
-        # this just ensures that the toolchain has a matching binprefix
-        (
-            local cgt_bin=
-            local oet_bin=
-            printf "Linking toolchain to $CGT_BINPREFIX\n"
-            cd "$CGTOOLS_V5T/bin"
-            for oet_bin in $OET_BINPREFIX*; do
-                cgt_bin="$CGT_BINPREFIX${oet_bin#$OET_BINPREFIX}"
-                rm -f "$cgt_bin"
-                ln -s "$oet_bin" "$cgt_bin"
-            done
-        )
         return 0
     elif [ -n "$LINARO_EXE" ]; then
         printf "Linaro toolchain selected - not installing CGT_ARM\n"
 }
 
 
+unpack_LINARO_DEV()
+{
+    local file="$1"
+
+    if [ -z "$LINARO_EXE" ]; then
+        return 0
+    fi
+
+    # Make symlinks for the toolchain
+    local tool=
+    local linaro_exe_prefix="${LINARO_EXE%-gcc*}-"
+    mkdir -p "$TI_INSTALL_DIR/xdir/bin"
+    for tool in $BUILD_TOOLS; do
+        ln -s "${linaro_exe_prefix}$tool" "$TI_INSTALL_DIR/xdir/bin/$CROSS_COMPILE$tool"
+    done
+
+    # Collect development libraries and headers
+    fakeroot tar -C "$TI_INSTALL_DIR" -x -z -f "$file"
+    mv "$TI_INSTALL_DIR/binary/usr/include" "$TI_INSTALL_DIR/xdir/include"
+    mv "$TI_INSTALL_DIR/binary/usr/lib" "$TI_INSTALL_DIR/xdir/lib"
+    rsync -rv "$TI_INSTALL_DIR/binary/lib/" "$TI_INSTALL_DIR/xdir/lib/"
+    # Fix-up symlinks
+    local link=
+    local target=
+    find "$TI_INSTALL_DIR/xdir/lib" -type l | while read link; do
+        target="$(readlink "$link")"
+        local strip="${target#/lib/arm-linux-gnueabi/}"
+        if [ "$strip" = "$target" ]; then
+            continue
+        fi
+        ln -sf "$strip" "$link"
+    done
+    rm -rf "$TI_INSTALL_DIR/binary"
+}
+
+
 fetch_files()
 {
     local dl_info=
     -d DIR          Installation directory
     -D              Download only - do not install
     -h              Print (this) usage information
-    -l EXE          Linaro gcc executable
+    -l EXE          Linaro gcc executable (full path)
     -o DIR          OpenEmbedded directory
     -t              Test TI SDK after installation
     -u URL          URL prefix for fetching packages
         fi
         CROSS_COMPILE="$OET_BINPREFIX-"
     elif [ -n "$LINARO_EXE" ]; then
-        local linaro_bindir="$(cd "$(dirname "$LINARO_EXE")" && pwd)"
         local linaro_basename="$(basename "$LINARO_EXE")"
         CROSS_COMPILE="${linaro_basename%-gcc*}-"
-        CGTOOLS_V5T="${linaro_bindir%/bin*}"
+        CGTOOLS_V5T="$TI_INSTALL_DIR/xdir"
     else
         CROSS_COMPILE="$CGT_BINPREFIX-"
         CGTOOLS_V5T="$TI_INSTALL_DIR/codesourcery/arm-2009q1"