source: scripts/patch/gcc-specs-patch.sh@ f698c15d

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since f698c15d was 9676bac, checked in by Jim Gifford <clfs@…>, 16 years ago

Added Perl Patch and cleaned up

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