source: scripts/patch/gcc-specs-patch.sh @ 2a7925b

clfs-1.2clfs-2.1clfs-3.0.0-systemdclfs-3.0.0-sysvinitsystemdsysvinit
Last change on this file since 2a7925b was 2a7925b, checked in by Jim Gifford <clfs@…>, 12 years ago

Added: gcc-specs-patch.sh

  • Property mode set to 100755
File size: 1.7 KB
Line 
1#!/bin/bash
2# Create a GCC Specs Patch
3
4# Get Version #
5#
6VERSION=$1
7
8# Check Input
9#
10if [ "${VERSION}" = "" ]; then
11        echo "$0 - GCC_Version"
12        echo "This will Create a Patch for GCC Specs GCC_Version"
13fi
14
15# Download GCC Source
16#
17cd /usr/src
18if ! [ -e gcc-${VERSION}.tar.bz2  ]; then
19        wget ftp://ftp.gnu.org/gnu/gcc/gcc-${VERSION}/gcc-${VERSION}.tar.bz2
20fi
21
22# Cleanup Directory
23#
24rm -rf gcc-${VERSION} gcc-${VERSION}.orig
25tar xvf gcc-${VERSION}.tar.bz2
26cp -ar gcc-${VERSION} gcc-${VERSION}.orig
27CURRENTDIR=$(pwd -P)
28
29# Modify the Data
30#
31cd /usr/src/gcc-${VERSION}
32for file in $(find gcc/config -name "*.h"); do
33        if [ "$(echo ${file} | grep -c bsd)" = "0" ]; then
34                if [ "$(cat ${file} | grep -c DYNAMIC_LINKER)" != "0" ]; then
35                        echo "Modifying ${file}..."
36                        sed -i '/DYNAMIC_LINKER/s@"/lib@"/tools/lib@' ${file}
37                fi
38                if [ "$(cat ${file} | grep -c DYNAMIC_LINKER)" != "0" ]; then
39                        echo "Modifying ${file}..."
40                        sed -i '/-dynamic-linker/s@ /lib@ /tools/lib@' ${file}
41                fi
42        fi
43done
44
45
46# Create Patch
47#
48cd /usr/src
49echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > gcc-${VERSION}-specs-x.patch
50echo "Date: `date +%m-%d-%Y`" >> gcc-${VERSION}-specs-x.patch
51echo "Initial Package Version: ${VERSION}" >> gcc-${VERSION}-specs-x.patch
52echo "Origin: Idea originally developed by Ryan Oliver and Greg Schafer for" >> gcc-${VERSION}-specs-x.patch
53echo "        the Pure LFS project." >> gcc-${VERSION}-specs-x.patch
54echo "Upstream Status: Not Applied" >> gcc-${VERSION}-specs-x.patch
55echo "Description: This patch modifies the location of the dynamic linker for gcc-${VERSION}." >> gcc-${VERSION}-specs-x.patch
56echo "" >> gcc-${VERSION}-specs-x.patch
57diff -Naur gcc-${VERSION}.orig gcc-${VERSION} >> gcc-${VERSION}-specs-x.patch
58echo "Created /usr/src/gcc-${VERSION}-specs-x.patch."
Note: See TracBrowser for help on using the repository browser.