Contents of /trunk/toolchain/toolchain-grep/toolchain-grep-2.5.1-r3.smage2
Parent Directory | Revision Log
Revision 153 -
(show annotations)
(download)
Mon Jul 4 00:41:38 2005 UTC (19 years, 2 months ago) by niro
File size: 1520 byte(s)
Mon Jul 4 00:41:38 2005 UTC (19 years, 2 months ago) by niro
File size: 1520 byte(s)
new toolchain create utilities and smages
1 | # $Header: /home/cvsd/magellan-cvs/magellan-src/toolchain/toolchain-grep/toolchain-grep-2.5.1-r3.smage2,v 1.1 2005-07-04 00:41:38 niro Exp $ |
2 | |
3 | PNAME="toolchain-grep" |
4 | PVER="2.5.1" |
5 | PBUILD="r3" |
6 | |
7 | SRCFILE="grep-${PVER}.tar.gz" |
8 | SRCDIR="${BUILDDIR}/grep-${PVER}" |
9 | |
10 | SRC_URI=( |
11 | mirror://grep/${SRCFILE} |
12 | ) |
13 | |
14 | |
15 | #needs: to run: glibc |
16 | # to build: glibc, gettext |
17 | |
18 | ## global toolchain var ## |
19 | # export CFLAGS, CHOST, TOOLCHAIN_PREFIX |
20 | export CFLAGS="-mtune=i486 -Os -pipe" |
21 | export CXXFLAGS="${CFLAGS}" |
22 | export TOOLCHAIN_PREFIX="/tools" |
23 | |
24 | zapmost() { |
25 | local rootdir |
26 | rootdir="${1}/" |
27 | [ ! -e "$rootdir" ] && echo "zapmost: $rootdir not found; skipping..." && return 1 |
28 | install -d ${BUILDDIR}/zap |
29 | local dirs |
30 | shift |
31 | local x |
32 | for x in ${*} |
33 | do |
34 | if [ "${x##*/}" = "${x}" ] |
35 | then |
36 | #one deep |
37 | mv ${rootdir}${x} ${BUILDDIR}/zap |
38 | else |
39 | #more than one deep; create intermediate directories |
40 | dirs=${x%/*} |
41 | install -d ${BUILDDIR}/zap/${dirs} |
42 | mv ${rootdir}${x} ${BUILDDIR}/zap/${x} |
43 | fi |
44 | done |
45 | rm -rf ${rootdir}* |
46 | mv ${BUILDDIR}/zap/* ${rootdir} |
47 | } |
48 | |
49 | |
50 | src_prepare() { |
51 | munpack ${SRCFILE} || die |
52 | } |
53 | |
54 | src_compile() { |
55 | cd ${SRCDIR} |
56 | |
57 | #--disable-perl-regexp disables build with libpcre |
58 | ./configure \ |
59 | --host=${CHOST} \ |
60 | --prefix=${TOOLCHAIN_PREFIX} \ |
61 | --with-included-regex \ |
62 | --disable-perl-regexp \ |
63 | --disable-nls || die |
64 | |
65 | mmake || die |
66 | } |
67 | |
68 | src_install() { |
69 | cd ${SRCDIR} |
70 | |
71 | make DESTDIR=${BINDIR} install || die |
72 | |
73 | # remove unwanted stuff |
74 | KEEPFILES="bin/grep bin/fgrep bin/egrep" |
75 | zapmost ${BINDIR}/${TOOLCHAIN_PREFIX} ${KEEPFILES} || die |
76 | } |