Skip to content

Commit aa1cdf1

Browse files
committed
remix
1 parent 8f12592 commit aa1cdf1

File tree

4 files changed

+23
-14
lines changed

4 files changed

+23
-14
lines changed

emsdk-cc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ PREFIX = Path(os.environ.get("PREFIX", "/opt/python-wasm-sdk/devices/emsdk/usr")
1616

1717
sys.argv.pop(0)
1818

19-
EXEC = sys.argv.pop(0)
20-
EXEC = f"{EMSDK}/upstream/emscripten/emcc.py"
19+
# point to emscripten cc
20+
if not sys.argv[0].endswith('.py'):
21+
EXEC = f"{EMSDK}/upstream/emscripten/emcc.py"
22+
else:
23+
EXEC = sys.argv.pop(0)
2124

2225
args = sys.argv
2326

@@ -316,7 +319,10 @@ else:
316319
else:
317320
EXE = False
318321

319-
if EXE and not (HTML or USE_RAWFS):
322+
# potentially executable running via js
323+
# TODO: handle js runtimes other than shipped node.
324+
# TODO: full node path
325+
if (EXE and USE_RAWFS) and not HTML:
320326
if AOUT.endswith(".cjs") or AOUT.endswith(".js"):
321327

322328
def make_exe(*argv, **kw):

scripts/cpython-build-emsdk.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,11 @@ END
209209

210210
popd
211211

212+
chmod +x ${SDKROOT}/emsdk-cc
213+
214+
export PYDK_CC=true
212215
PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig" CONFIG_SITE=$ROOT/src/cpython${PYBUILD}/Tools/wasm/config.site-wasm32-pydk \
213-
EMCC_CFLAGS="-fpic" emconfigure $ROOT/src/cpython${PYBUILD}/configure -C --with-emscripten-target=browser $GIL \
216+
emconfigure $ROOT/src/cpython${PYBUILD}/configure -C --with-emscripten-target=browser $GIL \
214217
--cache-file=${PYTHONPYCACHEPREFIX}/config.cache \
215218
--enable-wasm-dynamic-linking $TESTSUITE\
216219
--host=$PYDK_PYTHON_HOST_PLATFORM \
@@ -219,7 +222,6 @@ END
219222
--with-build-python=${PYTHON_FOR_BUILD} \
220223
${EXTRA_PYOPTS}
221224

222-
223225
mkdir -p ${PYTHONPYCACHEPREFIX}/empty
224226
touch ${PYTHONPYCACHEPREFIX}/empty/$($HPY -V|cut -f2 -d' ')
225227

@@ -318,7 +320,7 @@ END
318320
fi
319321
fi
320322

321-
323+
unset PYDK_CC
322324

323325
# FIXME: seems CI cannot locate that one with python3-wasm
324326

scripts/emsdk-fetch.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -217,19 +217,20 @@ END
217217
EMCC_TRACE=\${EMCC_TRACE:-false}
218218
if \$EMCC_TRACE
219219
then
220-
echo "
221-
$@" >> $SDKROOT/emcc.log
222-
220+
echo "
221+
\$0 \$@" >> $SDKROOT/emcc.log
223222
fi
224223
225224
unset _EMCC_CCACHE
226-
227-
#if [ -z "\$_EMCC_CCACHE" ]
228-
#then
229-
230225
unset _PYTHON_SYSCONFIGDATA_NAME
231226
unset PYTHONHOME
232227
unset PYTHONPATH
228+
if \${PYDK_CC:-false}
229+
then
230+
$EMSDK_PYTHON -E $SDKROOT/emsdk-cc \$0.py "\$@"
231+
exit \$?
232+
fi
233+
233234
234235
# -Wwarn-absolute-paths
235236
# --valid-abspath ${SDKROOT}

sources.wasm/5000-ncurses-65.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ NCOPTS="--enable-ext-colors --enable-ext-mouse --prefix=$PREFIX --disable-echo -
1212
--with-pkg-config-libdir=$PREFIX/lib/pkgconfig \
1313
--with-termlib --enable-termcap --disable-database"
1414

15-
15+
export PYDK_CC=true
1616
export NCURSES=${NCURSES:-"ncurses-6.5"}
1717
export URL_NCURSES=${URL_NCURSES:-"https://invisible-mirror.net/archives/ncurses/$NCURSES.tar.gz"}
1818

0 commit comments

Comments
 (0)