Skip to content
This repository was archived by the owner on May 29, 2025. It is now read-only.

Commit 8480195

Browse files
committed
Add a script to build gdb
A convenience script that configures and builds gdb the way that Rust wants it to be done.
1 parent af6c2af commit 8480195

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

build-for-rust.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/sh
2+
3+
# Build gdb as appropriate for rust.
4+
5+
srcdir="$1"
6+
builddir="$2"
7+
installdir="$3"
8+
9+
set -e
10+
11+
mkdir -p "$builddir"
12+
mkdir -p "$installdir"
13+
14+
cd "$builddir"
15+
# If Makefile already exists, just use it. It will handle re-running
16+
# config.status as needed, whereas re-running configure will
17+
# needlessly cause most objects to be rebuilt. Also, incremental
18+
# builds typically are fine in gdb.
19+
if ! test -f Makefile; then
20+
"$srcdir"/configure \
21+
CFLAGS=-O2 CXXFLAGS=-O2 \
22+
--prefix="$installdir" \
23+
--with-separate-debug-dir=/usr/lib/debug \
24+
--disable-binutils \
25+
--disable-gas \
26+
--disable-gdbserver \
27+
--disable-gold \
28+
--disable-gprof \
29+
--disable-ld \
30+
--without-guile \
31+
--with-python=python2 \
32+
--enable-targets=all \
33+
--enable-64-bit-bfd
34+
fi
35+
make
36+
make install

0 commit comments

Comments
 (0)