comparison lib/argp-standalone/argp-standalone.sh @ 130:140a5a5253f9

lib/argp-standalone: initial import, closes #1182
author David Demelier <markand@malikania.fr>
date Sun, 10 Mar 2019 18:45:44 +0100
parents
children 5f0dfff1e37a
comparison
equal deleted inserted replaced
129:f55c9ef41a9a 130:140a5a5253f9
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 : ${CHOST:=$(uname -m)-linux-musl}
19 : ${CBUILD:=$(uname -m)-linux-musl}
20 : ${CC:=gcc}
21 : ${CFLAGS:=-O2}
22
23 source ./argp-standalone.info
24
25 set -ex
26
27 rm -rf $PKGNAME-$PKGVERSION
28 tar xvaf $PKGNAME-$PKGVERSION.tar.gz
29 pushd $PKGNAME-$PKGVERSION
30
31 # TODO: build as shared instead of static.
32 patch -p1 < ../gnu89-inline.patch
33 patch -p1 < ../throw-in-funcdef.patch
34 autoreconf -if
35 CC="$CC" \
36 CFLAGS="$CFLAGS" \
37 ./configure \
38 --build=$CBUILD \
39 --host=$CHOST \
40 --prefix=/usr
41 make
42 install -D -m 0644 argp.h $DESTDIR/usr/include/argp.h
43 install -D -m 0755 libargp.a $DESTDIR/usr/lib/libargp.a
44
45 popd
46 rm -rf $PKGNAME-$PKGVERSION