master chld/ports-heresy / shells / dash / ndmake.sh
 1#!/bin/sh -ue
 2NAME=dash
 3VERSION=0.5.13
 4RELEASE=1
 5SOURCE="http://gondor.apana.org.au/~herbert/${NAME}/files/${NAME}-${VERSION}.tar.gz"
 6
 7build(){
 8    CFLAGS="$CFLAGS -Oz -static" LDFLAGS='-static' PREFIX="$PREFIX" ./configure \
 9	   --prefix="$PREFIX" \
10		--bindir=/bin \
11		--sbindir=/bin \
12		--libdir=/lib \
13		--includedir=/include \
14		--sysconfdir=/etc \
15		--disable-lto \
16		--disable-largefile \
17		--without-gnu-ld \
18		--disable-dependency-tracking \
19		--disable-fnmatch \
20		--disable-glob \
21		--disable-shared \
22		--enable-static \
23		--disable-nls \
24	|| die "configure failed"
25    
26    # for some reason, when building .o files it doesnt use our static flags im yelling for it to use
27    sed -i 's/gcc/clang -static/g' Makefile
28    sed -i 's/gcc/clang -static/g' src/Makefile
29    LDFLAGS='-static' CFLAGS='-static -Oz' gmake || die "gmake failed"
30    LDFLAGS='-static' CFLAGS='-static -Oz' PREFIX="$PREFIX" DESTDIR="$PKG" gmake install || die "gmake install failed"
31}
32
33. ${0%/*}/../../libsh/libdmake.sh