Adjust workaround

pull/615/head
Alex Crichton 6 months ago
parent edec34ba51
commit dffe2c2a5b

@ -109,9 +109,20 @@ if(WASI_SDK_LLDB)
-DLLDB_ENABLE_LINUXPTY=OFF -DLLDB_ENABLE_LINUXPTY=OFF
) )
set(sed_inplace_flag -i) set(extra_configure_commands)
if(CMAKE_SYSTEM_NAME STREQUAL Darwin) if(CMAKE_SYSTEM_NAME STREQUAL Linux)
set(sed_inplace_flag -i "") set(extra_configure_commands
# By default it looks like `libedit` tries to link to `libncurses.so` and
# such on Linux. This is problematic as systems may not have that
# installed. Turns out though at least for AlmaLinux [1] they just edit
# makefile and pkg-config info and it works out. Who knew! I thought
# one of the millions of lines in `./configure` would take care of this
# but apparently we're still resorting to editing things raw...
#
# [1]: https://git.almalinux.org/rpms/libedit/src/commit/3f0893c4cd8e0cbb2f556d2fad48326c9c037a6c/SPECS/libedit.spec#L44-L48
COMMAND sed -i "s/lncurses/ltinfo/" src/Makefile
COMMAND sed -i "s/ -lncurses//" libedit.pc
)
endif() endif()
if (WASI_SDK_LIBEDIT) if (WASI_SDK_LIBEDIT)
@ -138,16 +149,7 @@ if(WASI_SDK_LLDB)
--disable-silent-rules --disable-silent-rules
CC=${CMAKE_C_COMPILER} CC=${CMAKE_C_COMPILER}
LDFLAGS=${libedit_ldflags} LDFLAGS=${libedit_ldflags}
# By default it looks like `libedit` tries to link to `libncurses.so` and ${extra_configure_commands}
# such on Linux. This is problematic as systems may not have that
# installed. Turns out though at least for AlmaLinux [1] they just edit
# makefile and pkg-config info and it works out. Who knew! I thought
# one of the millions of lines in `./configure` would take care of this
# but apparently we're still resorting to editing things raw...
#
# [1]: https://git.almalinux.org/rpms/libedit/src/commit/3f0893c4cd8e0cbb2f556d2fad48326c9c037a6c/SPECS/libedit.spec#L44-L48
COMMAND sed ${sed_inplace_flag} "s/lncurses/ltinfo/" src/Makefile
COMMAND sed ${sed_inplace_flag} "s/ -lncurses//" libedit.pc
BUILD_COMMAND BUILD_COMMAND
${MAKE_EXECUTABLE} -j${nproc} ${MAKE_EXECUTABLE} -j${nproc}

Loading…
Cancel
Save