annotate lib/gmp/gmp.sh @ 58:73fe5cec3773

lib/gmp: initial import, closes #1153
author David Demelier <markand@malikania.fr>
date Fri, 01 Mar 2019 19:43:54 +0100
parents
children ef65bd5eb573
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
58
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
1 #!/bin/sh
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
2 #
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
3 # Copyright (c) 2019 David Demelier <markand@malikania.fr>
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
4 #
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
5 # Permission to use, copy, modify, and/or distribute this software for any
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
6 # purpose with or without fee is hereby granted, provided that the above
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
7 # copyright notice and this permission notice appear in all copies.
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
8 #
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
16 #
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
17
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
18 source ./gmp.info
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
19
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
20 case $(uname -m) in
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
21 x86_64)
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
22 CFLAGS="-O2 -fPIC"
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
23 ;;
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
24 *)
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
25 CFLAGS="-O2"
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
26 ;;
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
27 esac
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
28
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
29 set -e
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
30
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
31 rm -rf $PKGNAME-$PKGVERSION
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
32 tar xvaf $PKGNAME-$PKGVERSION.tar.xz
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
33 pushd $PKGNAME-$PKGVERSION
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
34
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
35 CFLAGS="$CFLAGS" ./configure \
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
36 --prefix=/usr \
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
37 --enable-cxx \
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
38 --enable-fat \
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
39 --disable-static
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
40 make
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
41 make install DESTDIR=$DESTDIR
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
42 rm -f $DESTDIR/usr/lib/libgmp{,xx}.la
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
43
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
44 popd
73fe5cec3773 lib/gmp: initial import, closes #1153
David Demelier <markand@malikania.fr>
parents:
diff changeset
45 rm -rf $PKGNAME-$PKGVERSION