Skip to content

Commit 8c5a5f5

Browse files
committed
linux: build Berkeley DB
It has more favorable licensing terms than GDBM, which is GPLv3.
1 parent 33f84a4 commit 8c5a5f5

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

cpython-linux/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ $(OUTDIR)/gcc-linux64.tar: $(OUTDIR)/binutils-linux64.tar $(HERE)/build-gcc.sh
3131
$(OUTDIR)/clang-linux64.tar: $(OUTDIR)/binutils-linux64.tar $(OUTDIR)/gcc-linux64.tar $(OUTDIR)/image-clang.tar $(HERE)/build-clang.sh
3232
$(BUILD) clang
3333

34+
$(OUTDIR)/bdb-%.tar: $(OUTDIR)/image-build.tar $(TOOLCHAIN_DEPENDS) $(HERE)/build-bdb.sh
35+
$(BUILD) --platform $* bdb
36+
3437
$(OUTDIR)/bzip2-%.tar: $(OUTDIR)/image-build.tar $(TOOLCHAIN_DEPENDS) $(HERE)/build-bzip2.sh
3538
$(BUILD) --platform $* bzip2
3639

@@ -68,6 +71,7 @@ $(OUTDIR)/zlib-$(PLATFORM).tar: $(TOOLCHAIN_DEPENDS) $(HERE)/build-zlib.sh
6871
$(BUILD) --platform $(PLATFORM) zlib
6972

7073
PYTHON_DEPENDS := \
74+
$(OUTDIR)/bdb-$(PLATFORM).tar \
7175
$(OUTDIR)/bzip2-$(PLATFORM).tar \
7276
$(OUTDIR)/gdbm-$(PLATFORM).tar \
7377
$(OUTDIR)/libedit-$(PLATFORM).tar \

cpython-linux/build-bdb.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
# This Source Code Form is subject to the terms of the Mozilla Public
3+
# License, v. 2.0. If a copy of the MPL was not distributed with this
4+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
5+
6+
set -ex
7+
8+
cd /build
9+
10+
export PATH=/tools/${TOOLCHAIN}/bin:/tools/host/bin:$PATH
11+
export CC=clang
12+
export CXX=clang++
13+
14+
tar -xf db-${BDB_VERSION}.tar.gz
15+
16+
pushd db-${BDB_VERSION}/build_unix
17+
18+
CLFAGS="${EXTRA_TARGET_CFLAGS} -fPIC" CPPFLAGS="${EXTRA_TARGET_CFLAGS} -fPIC" ../dist/configure \
19+
--build=x86_64-unknown-linux-gnu \
20+
--target=${TARGET} \
21+
--prefix=/tools/deps \
22+
--enable-dbm
23+
24+
make -j `nproc`
25+
make -j `nproc` install DESTDIR=/build/out

cpython-linux/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ def main():
669669
elif action == 'readline':
670670
build_readline(client, get_image(client, 'build'), platform=args.platform)
671671

672-
elif action in ('bzip2', 'gdbm', 'libffi', 'ncurses', 'openssl', 'sqlite', 'uuid', 'xz', 'zlib'):
672+
elif action in ('bdb', 'bzip2', 'gdbm', 'libffi', 'ncurses', 'openssl', 'sqlite', 'uuid', 'xz', 'zlib'):
673673
simple_build(client, get_image(client, 'build'), action, platform=args.platform)
674674

675675
elif action == 'tcltk':

0 commit comments

Comments
 (0)