@@ -87,14 +87,16 @@ QUILT_PATCHES=/patches/3.5 quilt push -a
8787# Specifically EXTRA_CFLAGS="-g -flto -fuse-linker-plugin
8888# -ffat-lto-objects"
8989
90+ PREFIX=/opt/python3.5
91+
9092mkdir build-static
9193cd build-static
9294
9395../configure \
9496 --enable-ipv6 \
9597 --enable-loadable-sqlite-extensions \
9698 --enable-optimizations \
97- --prefix=/opt/python3.5 \
99+ --prefix=" $PREFIX " \
98100 --with-dbmliborder=bdb:gdbm \
99101 --with-computed-gotos \
100102 --with-fpectl \
@@ -117,13 +119,32 @@ cd build-static
117119 RANLIB=" x86_64-linux-gnu-gcc-ranlib" \
118120
119121make profile-opt
120- make altinstall
121122
122123# Run tests
123124# test___all__: Depends on Debian-specific locale changes
125+ # test_dbm: https://bugs.python.org/issue28700
124126# test_imap: https://bugs.python.org/issue30175
125127# test_shutil: https://bugs.python.org/issue29317
126- make test TESTOPTS=" --exclude test___all__ test_imaplib test_shutil"
128+ make test TESTOPTS=" --exclude test___all__ test_dbm test_imaplib test_shutil"
129+
130+ # Install
131+ make altinstall
132+ # We don't expect users to statically link Python into a C/C++ program
133+ rm " $PREFIX " /lib/libpython3.5m.a \
134+ " $PREFIX " /lib/python3.5/config-* /libpython3.5m.a
135+ # Remove opt-mode bytecode
136+ find " $PREFIX " /lib/python3.5/ \
137+ -name \* .opt-\? .pyc \
138+ -exec rm {} \;
139+ # Remove all but a few files in the 'test' subdirectory
140+ find " $PREFIX " /lib/python3.5/test \
141+ -mindepth 1 -maxdepth 1 \
142+ \! -name support \
143+ -a \! -name __init__.py \
144+ -a \! -name pystone.\* \
145+ -a \! -name regrtest.\* \
146+ -a \! -name test_support.py \
147+ -exec rm -rf {} \;
127148
128149# Clean-up sources
129150cd /opt
0 commit comments