From 5dbc450b0c20f77bc274d17f4c437d579de6800e Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Sun, 7 Jul 2024 20:14:48 +0330 Subject: [PATCH] enable readline and ncurses --- .github/workflows/reusable-wasix.yml | 14 ++++++++++++++ Tools/wasm/wasix-configure-wrapper | 5 ++++- configure | 1 - configure.ac | 1 - 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reusable-wasix.yml b/.github/workflows/reusable-wasix.yml index 5f40e148dfb061..df83624c54fa83 100644 --- a/.github/workflows/reusable-wasix.yml +++ b/.github/workflows/reusable-wasix.yml @@ -20,6 +20,8 @@ jobs: ZLIB_DIR: "/opt/zlib" LIBLZMA_DIR: "/opt/liblzma" UTIL_LINUX_DIR: "/opt/util-linux" + NCURSES_DIR: "/opt/ncurses" + READLINE_DIR: "/opt/readline" CROSS_BUILD_PYTHON: cross-build/build CROSS_BUILD_WASIX: cross-build/wasix WASIX_INSTALL: /opt/wasix_install @@ -71,6 +73,16 @@ jobs: cd ${{ env.UTIL_LINUX_DIR }} ./wasix.sh cp -v .libs/libuuid.a . + - name: "Compile ncurses" + run: | + git clone https://github.com/wasix-org/ncurses -b wasix-support ${{ env.NCURSES_DIR }} + cd ${{ env.NCURSES_DIR }} + ./wasix.sh + - name: "Compile readline" + run: | + git clone https://github.com/wasix-org/readline ${{ env.READLINE_DIR }} + cd ${{ env.READLINE_DIR }} + WASIX_NCURSES=${{ env.NCURSES_DIR }} ./wasix.sh - name: "Install Wasmer" run: | mkdir ${{ env.WASMER_DIR }} @@ -85,6 +97,8 @@ jobs: WASIX_LIBLZMA_LIBS="-L${{ env.LIBLZMA_DIR }} -llzma" \ WASIX_LIBUUID_CFLAGS="-I ${{ env.UTIL_LINUX_DIR }}/libuuid/src" \ WASIX_LIBUUID_LIBS="-L ${{ env.UTIL_LINUX_DIR }} -l uuid" \ + WASIX_LIBREADLINE_CFLAGS="-I ${{ env.READLINE_DIR }}" \ + WASIX_LIBREADLINE_LIBS="-L ${{ env.READLINE_DIR }} -L ${{ env.NCURSES_DIR }}/lib -lreadline -lncurses" python3 Tools/wasm/wasm_build.py wasix build - name: "List dirs" run: | diff --git a/Tools/wasm/wasix-configure-wrapper b/Tools/wasm/wasix-configure-wrapper index c7e9c10d82e5b6..697ce3edb77a08 100755 --- a/Tools/wasm/wasix-configure-wrapper +++ b/Tools/wasm/wasix-configure-wrapper @@ -53,6 +53,9 @@ export ZLIB_LIBS=$WASIX_ZLIB_LIBS export LIBUUID_CFLAGS=$WASIX_LIBUUID_CFLAGS export LIBUUID_LIBS=$WASIX_LIBUUID_LIBS +export LIBREADLINE_CFLAGS=$WASIX_LIBREADLINE_CFLAGS +export LIBREADLINE_LIBS=$WASIX_LIBREADLINE_LIBS + export RANLIB="$WASI_SDK_PATH/bin/ranlib" export AR="$WASI_SDK_PATH/bin/ar" export NM="$WASI_SDK_PATH/bin/nm" @@ -74,7 +77,7 @@ export CFLAGS="\ -D_WASI_EMULATED_MMAN \ -D_WASI_EMULATED_SIGNAL \ -D_WASI_EMULATED_PROCESS_CLOCKS \ --Os -g -flto" +-Os -g -flto" export LIBS="\ -Wl,--shared-memory \ diff --git a/configure b/configure index 08a1790b248f9a..50d2e307344ad5 100755 --- a/configure +++ b/configure @@ -28988,7 +28988,6 @@ case $ac_sys_system in #( py_cv_module__testcapi=n/a py_cv_module__testclinic=n/a py_cv_module_fcntl=n/a - py_cv_module_readline=n/a py_cv_module_mmap=n/a py_cv_module_xxlimited=n/a py_cv_module_xxlimited_35=n/a diff --git a/configure.ac b/configure.ac index 6cd6893bc7bd15..a2172df606bb55 100644 --- a/configure.ac +++ b/configure.ac @@ -7530,7 +7530,6 @@ AS_CASE([$ac_sys_system], [_testcapi], [_testclinic], [fcntl], - [readline], [mmap], [xxlimited], [xxlimited_35],