comparison dev/bmake/bmake.sh @ 758:9a065a72dcad

dev/bmake: initial import, closes #1217
author David Demelier <markand@malikania.fr>
date Thu, 08 Aug 2019 20:15:00 +0200
parents
children ddab65a5b3f5
comparison
equal deleted inserted replaced
757:c7c11c87efd3 758:9a065a72dcad
1 #!/bin/sh
2 #
3 # Copyright (c) 2019 David Demelier <markand@malikania.fr>
4 #
5 # Permission to use, copy, modify, and/or distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
8 #
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 #
17
18 PKGNAME=bmake
19 PKGVERSION=20181221
20 PKGREVISION=1
21 PKGLICENSE="BSD3CLAUSE"
22 PKGSUMMARY="portable version of NetBSD make"
23 PKGDOWNLOAD="http://www.crufty.net/ftp/pub/sjg/$PKGNAME-$PKGVERSION.tar.gz"
24
25 : ${CHOST:=$(uname -m)-linux-musl}
26 : ${CBUILD:=$(uname -m)-linux-musl}
27 : ${CC:=clang}
28 : ${CFLAGS:=-O2}
29 : ${CXX:=clang++}
30 : ${CXXFLAGS:=-O2}
31 : ${LDFLAGS:=}
32 : ${LIBS:=}
33
34 build()
35 {
36 rm -rf $PKGNAME
37 tar xvf $PKGNAME-$PKGVERSION.tar.gz
38 cd $PKGNAME
39
40 sed -i "1s,:,#!/bin/sh,g" install-sh
41 mkdir build && cd build
42 CC="$CC" \
43 CFLAGS="$CFLAGS" \
44 CXX="$CXX" \
45 CXXFLAGS="$CXXFLAGS" \
46 LDFLAGS="$LDFLAGS" \
47 LIBS="$LIBS" \
48 ../boot-strap \
49 --build=$CBUILD \
50 --host=$CHOST \
51 --prefix= op=build
52 ../boot-strap --install-destdir=$DESTDIR --prefix= op=install
53 cd ..
54
55 cd ..
56 rm -rf $PKGNAME
57 }