comparison gnu/gdb/gdb.sh @ 1179:73a7fdc6d516

gnu/gdb: initial import, closes #1076
author David Demelier <markand@malikania.fr>
date Wed, 23 Oct 2019 13:58:58 +0200
parents
children 6710613b88b9
comparison
equal deleted inserted replaced
1178:8cbb83c16868 1179:73a7fdc6d516
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=gdb
19 PKGVERSION=8.3.1
20 PKGREVISION=1
21 PKGLICENSE="LGPLv30+ GPLv30+"
22 PKGSUMMARY="GNU debugger"
23 PKGDOWNLOAD="https://ftp.gnu.org/gnu/$PKGNAME/$PKGNAME-$PKGVERSION.tar.xz"
24 PKGDEPENDS="mpfr readline zlib"
25 PKGOPTIONS="GUILE LZMA PYTHON XML"
26
27 : ${CHOST:=$(uname -m)-linux-musl}
28 : ${CBUILD:=$(uname -m)-linux-musl}
29 : ${CC:=clang}
30 : ${CFLAGS:=-O2}
31 : ${CXX:=clang++}
32 : ${CXXFLAGS:=-O2}
33 : ${LDFLAGS:=}
34 : ${LIBS:=}
35 : ${GUILE:=no} # Note: broken, wants 2.0.
36 : ${LZMA:=no}
37 : ${PYTHON:=yes}
38 : ${XML:=no} # Note: XML support through expat.
39
40 if [ "$GUILE" = "yes" ]; then
41 PKGDEPENDS="guile $PKGDEPENDS"
42 with_guile="--with-guile"
43 else
44 with_guile="--without-guile"
45 fi
46
47 if [ "$LZMA" = "yes" ]; then
48 PKGDEPENDS="xz $PKGDEPENDS"
49 with_lzma="--with-lzma"
50 else
51 with_lzma="--without-lzma"
52 fi
53
54 if [ "$PYTHON" = "yes" ]; then
55 PKGDEPENDS="python $PKGDEPENDS"
56 with_python="--with-python"
57 else
58 with_python="--without-python"
59 fi
60
61 if [ "$XML" = "yes" ]; then
62 PKGDEPENDS="expat $PKGDEPENDS"
63 with_xml="--with-expat"
64 else
65 with_xml="--without-expat"
66 fi
67
68 build()
69 {
70 rm -rf $PKGNAME-$PKGVERSION
71 tar xvf $PKGNAME-$PKGVERSION.tar.xz
72 cd $PKGNAME-$PKGVERSION
73
74 # --disable-nls: install files that conflict with binutils.
75 CC="$CC" \
76 CFLAGS="$CFLAGS" \
77 CXX="$CXX" \
78 CXXFLAGS="$CXXFLAGS" \
79 LDFLAGS="$LDFLAGS" \
80 LIBS="$LIBS" \
81 ./configure \
82 --build=$CBUILD \
83 --host=$CHOST \
84 --prefix= \
85 --disable-nls \
86 --with-system-zlib \
87 --with-system-readline \
88 $with_guile \
89 $with_lzma \
90 $with_python \
91 $with_xml
92 make
93 make install DESTDIR=$DESTDIR
94 find $DESTDIR -type f -name "*.la" -delete
95
96 cd ..
97 rm -rf $PKGNAME-$PKGVERSION
98 }