FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Simplify Python compilation a bit · python-emscripten/python@a91c6b3 · GitHub

Repository navigation

Commit a91c6b3

Browse files
committed
Simplify Python compilation a bit
1 parent c3ddd63 commit a91c6b3

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

‎2.7.10/python.sh‎

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ hostpython () {
4747

4848
make -j$(nproc)
4949
make install DESTDIR=$BUILD/hostpython
50-
51-
# emcc should disregard '-fPIC' during non-SIDE_MODULE builds,
52-
# otherwise _sysconfigdata.build_time_vars['CCSHARED'] is the culprit:
53-
# sed -i -e 's/-fPIC//' $BUILD/hostpython/lib/python2.7/_sysconfigdata.py
5450
)
5551

5652
# setuptools for 3rd-party module installers
@@ -70,29 +66,29 @@ emscripten () {
7066
# OPT=-Oz: TODO
7167
# CONFIG_SITE: deals with cross-compilation https://bugs.python.org/msg136962
7268
# not needed as emcc has a single arch: BASECFLAGS=-m32 LDFLAGS=-m32
73-
# --without-threads: pthreads experimental as of 2019-11
69+
# --without-threads: pthreads experimental as of 2020-05
7470
# cf. https://emscripten.org/docs/porting/pthreads.html
75-
71+
# --without-signal-module: no process signals in Emscripten
72+
# --without-pymalloc: ?
73+
# --disable-ipv6: browser-side networking
74+
# --disable-shared: compile statically for Emscripten perfs + incomplete PIC support
7675
if [ ! -e config.status ]; then
7776
CONFIG_SITE=../config.site BASECFLAGS='-s USE_ZLIB=1' \
77+
PYTHON_FOR_BUILD=$BUILD/Python-$VERSION/native/python \
7878
emconfigure ../configure \
7979
--host=asmjs-unknown-emscripten --build=$(../config.guess) \
8080
--prefix='' \
8181
--without-threads --without-pymalloc --without-signal-module --disable-ipv6 \
8282
--disable-shared
8383
fi
84+
# Fix bad detection
8485
sed -i -e 's,^#define HAVE_GCC_ASM_FOR_X87.*,/* & */,' pyconfig.h
8586

8687
# pgen native setup
8788
# note: need to build 'pgen' once before overwriting it with the native one
8889
# note: PGEN=../native/Parser/pgen doesn't work, make overwrites it
8990
emmake make Parser/pgen
9091
\cp --preserve=mode ../native/Parser/pgen Parser/
91-
# python native setup
92-
# note: PATH=... doesn't work, it breaks emcc's /usr/bin/env python
93-
# note: PYTHON_FOR_BUILD=../native/python neither, it's a more complex call
94-
#emmake env PATH=../../hostpython/bin:$PATH make -j$(nproc)
95-
sed -i -e 's,\(PYTHON_FOR_BUILD=.*\) python2.7,\1 $(abs_srcdir)/native/python,' Makefile
9692

9793
# Modules/Setup.local
9894
echo '*static*' > Modules/Setup.local

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL