Annotation of /trunk/toolchain/toolchain-bash/toolchain-bash-2.05b-r5.smage2
Parent Directory | Revision Log
Revision 153 -
(hide annotations)
(download)
Mon Jul 4 00:41:38 2005 UTC (19 years, 2 months ago) by niro
File size: 3163 byte(s)
Mon Jul 4 00:41:38 2005 UTC (19 years, 2 months ago) by niro
File size: 3163 byte(s)
new toolchain create utilities and smages
1 | niro | 153 | # $Header: /home/cvsd/magellan-cvs/magellan-src/toolchain/toolchain-bash/toolchain-bash-2.05b-r5.smage2,v 1.1 2005-07-04 00:41:38 niro Exp $ |
2 | |||
3 | PNAME="toolchain-bash" | ||
4 | PVER="2.05b" | ||
5 | PBUILD="r5" | ||
6 | |||
7 | SRCFILE="bash-${PVER}.tar.gz" | ||
8 | SRCDIR="${BUILDDIR}/bash-${PVER}" | ||
9 | |||
10 | SRC_URI=( | ||
11 | mirror://bash/${SRCFILE} | ||
12 | mirror://bash/bash205b-001 | ||
13 | mirror://bash/bash205b-002 | ||
14 | mirror://bash/bash205b-003 | ||
15 | mirror://bash/bash205b-004 | ||
16 | mirror://bash/bash205b-005 | ||
17 | mirror://bash/bash205b-006 | ||
18 | mirror://bash/bash205b-007 | ||
19 | mirror://bash/bash-${PVER}-multibyte-locale.patch | ||
20 | mirror://bash/bash-${PVER}-empty-herestring.patch | ||
21 | mirror://bash/bash-${PVER}-rbash.patch | ||
22 | mirror://bash/bash-${PVER}-parallel-build.patch | ||
23 | mirror://bash/bash-${PVER}-jobs.patch | ||
24 | ) | ||
25 | |||
26 | # needs: ncurses-5.1 | ||
27 | |||
28 | ## global toolchain var ## | ||
29 | # export CFLAGS, CHOST, TOOLCHAIN_PREFIX | ||
30 | export CFLAGS="-mtune=i486 -Os -pipe" | ||
31 | export CXXFLAGS="${CFLAGS}" | ||
32 | export TOOLCHAIN_PREFIX="/tools" | ||
33 | |||
34 | zapmost() { | ||
35 | local rootdir | ||
36 | rootdir="${1}/" | ||
37 | [ ! -e "$rootdir" ] && echo "zapmost: $rootdir not found; skipping..." && return 1 | ||
38 | install -d ${BUILDDIR}/zap | ||
39 | local dirs | ||
40 | shift | ||
41 | local x | ||
42 | for x in ${*} | ||
43 | do | ||
44 | if [ "${x##*/}" = "${x}" ] | ||
45 | then | ||
46 | #one deep | ||
47 | mv ${rootdir}${x} ${BUILDDIR}/zap | ||
48 | else | ||
49 | #more than one deep; create intermediate directories | ||
50 | dirs=${x%/*} | ||
51 | install -d ${BUILDDIR}/zap/${dirs} | ||
52 | mv ${rootdir}${x} ${BUILDDIR}/zap/${x} | ||
53 | fi | ||
54 | done | ||
55 | rm -rf ${rootdir}* | ||
56 | mv ${BUILDDIR}/zap/* ${rootdir} | ||
57 | } | ||
58 | |||
59 | |||
60 | src_prepare() { | ||
61 | munpack ${SRCFILE} || die | ||
62 | cd ${SRCDIR} | ||
63 | |||
64 | # official patches: | ||
65 | mpatch -Np0 bash205b-001 || die | ||
66 | mpatch -Np0 bash205b-002 || die | ||
67 | mpatch -Np0 bash205b-003 || die | ||
68 | mpatch -Np0 bash205b-004 || die | ||
69 | mpatch -Np0 bash205b-005 || die | ||
70 | mpatch -Np0 bash205b-006 || die | ||
71 | mpatch -Np0 bash205b-007 || die | ||
72 | |||
73 | # readline is slow with multibyte locale | ||
74 | mpatch -Np1 bash-${PVER}-multibyte-locale.patch || die | ||
75 | # segfault on empty herestring | ||
76 | mpatch -Np1 bash-${PVER}-empty-herestring.patch || die | ||
77 | # fix broken rbash functionality | ||
78 | mpatch -Np1 bash-${PVER}-rbash.patch || die | ||
79 | # fix parallel make | ||
80 | mpatch -Np0 bash-${PVER}-parallel-build.patch || die | ||
81 | |||
82 | # fix using bash with post-20040808 glibc | ||
83 | mpatch -Np1 bash-${PVER}-jobs.patch || die | ||
84 | |||
85 | # enable SSH_SOURCE_BASHRC | ||
86 | sed -e 's:^.*\(#define SSH_SOURCE_BASHRC\).*$:\1:' \ | ||
87 | -i config-top.h || die | ||
88 | |||
89 | # Force pgrp synchronization | ||
90 | # (https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=81653) | ||
91 | # | ||
92 | # The session will hang cases where you 'su' (not 'su -') and | ||
93 | # then run a piped command in emacs. | ||
94 | # This problem seem to happen due to scheduler changes kernel | ||
95 | # side - although reproduceble with later 2.4 kernels, it is | ||
96 | # especially easy with 2.6 kernels. | ||
97 | echo '#define PGRP_PIPE 1' >> config-bot.h || die | ||
98 | } | ||
99 | |||
100 | src_compile() { | ||
101 | cd ${SRCDIR} | ||
102 | |||
103 | ./configure \ | ||
104 | --host=${CHOST} \ | ||
105 | --prefix=${TOOLCHAIN_PREFIX} \ | ||
106 | --disable-profiling \ | ||
107 | --with-curses \ | ||
108 | --without-gnu-malloc \ | ||
109 | --disable-nls \ | ||
110 | || die | ||
111 | |||
112 | mmake || die | ||
113 | } | ||
114 | |||
115 | src_install() { | ||
116 | cd ${SRCDIR} | ||
117 | |||
118 | make DESTDIR=${BINDIR} install || die | ||
119 | |||
120 | # needed symlink | ||
121 | ln -snf bash ${BINDIR}/${TOOLCHAIN_PREFIX}/bin/sh || die | ||
122 | |||
123 | # remove unwanted stuff | ||
124 | KEEPFILES="bin/bash bin/sh" | ||
125 | zapmost ${BINDIR}${TOOLCHAIN_PREFIX} ${KEEPFILES} || die | ||
126 | } |