Annotation of /trunk/toolchain/toolchain-bzip2/toolchain-bzip2-1.0.3-r1.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: 1701 byte(s)
Mon Jul 4 00:41:38 2005 UTC (19 years, 2 months ago) by niro
File size: 1701 byte(s)
new toolchain create utilities and smages
1 | niro | 153 | # $Header: /home/cvsd/magellan-cvs/magellan-src/toolchain/toolchain-bzip2/toolchain-bzip2-1.0.3-r1.smage2,v 1.1 2005-07-04 00:41:38 niro Exp $ |
2 | |||
3 | PNAME="toolchain-bzip2" | ||
4 | PVER="1.0.3" | ||
5 | PBUILD="r1" | ||
6 | |||
7 | SRCFILE="bzip2-${PVER}.tar.gz" | ||
8 | SRCDIR="${BUILDDIR}/bzip2-${PVER}" | ||
9 | |||
10 | SRC_URI=( | ||
11 | mirror://bzip2/${SRCFILE} | ||
12 | ) | ||
13 | |||
14 | |||
15 | #needs: glibc | ||
16 | |||
17 | ## global toolchain var ## | ||
18 | # export CFLAGS, CHOST, TOOLCHAIN_PREFIX | ||
19 | export CFLAGS="-mtune=i486 -Os -pipe" | ||
20 | export CXXFLAGS="${CFLAGS}" | ||
21 | export TOOLCHAIN_PREFIX="/tools" | ||
22 | |||
23 | zapmost() { | ||
24 | local rootdir | ||
25 | rootdir="${1}/" | ||
26 | [ ! -e "$rootdir" ] && echo "zapmost: $rootdir not found; skipping..." && return 1 | ||
27 | install -d ${BUILDDIR}/zap | ||
28 | local dirs | ||
29 | shift | ||
30 | local x | ||
31 | for x in ${*} | ||
32 | do | ||
33 | if [ "${x##*/}" = "${x}" ] | ||
34 | then | ||
35 | #one deep | ||
36 | mv ${rootdir}${x} ${BUILDDIR}/zap | ||
37 | else | ||
38 | #more than one deep; create intermediate directories | ||
39 | dirs=${x%/*} | ||
40 | install -d ${BUILDDIR}/zap/${dirs} | ||
41 | mv ${rootdir}${x} ${BUILDDIR}/zap/${x} | ||
42 | fi | ||
43 | done | ||
44 | rm -rf ${rootdir}* | ||
45 | mv ${BUILDDIR}/zap/* ${rootdir} | ||
46 | } | ||
47 | |||
48 | |||
49 | src_prepare() { | ||
50 | munpack ${SRCFILE} || die | ||
51 | cd ${SRCDIR} | ||
52 | |||
53 | # prepare makefiles for our CFLAGS | ||
54 | sed -i -e 's%$(BIGFILES)%$(BIGFILES) $(OPT)%' Makefile || die | ||
55 | sed -i -e 's%$(BIGFILES)%$(BIGFILES) $(OPT)%' Makefile-libbz2_so || die | ||
56 | } | ||
57 | |||
58 | src_compile() { | ||
59 | cd ${SRCDIR} | ||
60 | make -f Makefile-libbz2_so OPT="${CFLAGS}" || die | ||
61 | make clean || die | ||
62 | |||
63 | make OPT="${CFLAGS}" || die | ||
64 | } | ||
65 | |||
66 | src_install() { | ||
67 | cd ${SRCDIR} | ||
68 | |||
69 | # needed directories | ||
70 | install -d ${BINDIR}${TOOLCHAIN_PREFIX}/bin | ||
71 | install -d ${BINDIR}${TOOLCHAIN_PREFIX}/lib | ||
72 | |||
73 | make PREFIX=${BINDIR}${TOOLCHAIN_PREFIX} install || die | ||
74 | |||
75 | # remove unwanted stuff | ||
76 | KEEPFILES="bin/bunzip2 bin/bzcat bin/bzip2" | ||
77 | zapmost ${BINDIR}/${TOOLCHAIN_PREFIX} ${KEEPFILES} || die | ||
78 | } |