1
2#!/bin/sh -ue
3NAME=toybox
4VERSION=git
5RELEASE=1
6SOURCE="https://github.com/landley/${NAME}.git
7 config"
8BUILD_STYLE=gmake
9build(){
10 echo 'cc -static $@' > ./cc.sh
11 chmod 755 ./cc.sh
12 export CC=`pwd`/cc.sh
13 export HOSTCC=$CC
14 mv config .config
15
16 sed -i 's/-o/-static -o/g' scripts/install.sh
17 sed -i 's/cc/cc -static/g' kconfig/Makefile
18 sed -i 's#scripts/install.sh#scripts/install.sh --static#g' Makefile
19 sed -i 's/\$HOSTCC/$HOSTCC -static/g' scripts/make.sh
20
21 gmake CFLAGS='-static' LDFLAGS='-static' PREFIX="$PKG" || die "gmake failed"
22 gmake CFLAGS='-static' LDFLAGS='-static' PREFIX="$PKG" install || die "install failed"
23
24 # remove cmds that dont work with spc lowk
25 rm -v $PKG/bin/ps $PKG/bin/tar || true
26}
27. ${0%/*}/../../libsh/libdmake.sh