Skip to content

Commit 3c5681d

Browse files
committed
unix: use standard prefix for libedit
Back in 2019 we made libedit's install prefix `/tools/deps/libedit` so we could have both readline and libedit installed side-by-side. This was all to support multiple extension module variants for `_readline` - one compiling against readline and another against libedit. The extension module variants were removed in commit ba9fe19. But this one-off install prefix to support simultaneous readline and libedit presence still lingered. This commit removes the one-off install prefix and makes libedit like every other dependency.
1 parent 9b83db4 commit 3c5681d

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

cpython-unix/build-cpython.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,6 @@ fi
273273
# Always build against libedit instead of the default of readline.
274274
# macOS always uses the system libedit, so no tweaks are needed.
275275
if [ "${PYBUILD_PLATFORM}" != "macos" ]; then
276-
# On Linux, we need to add our custom libedit to search paths.
277-
CFLAGS="${CFLAGS} -I${TOOLS_PATH}/deps/libedit/include"
278-
LDFLAGS="${LDFLAGS} -L${TOOLS_PATH}/deps/libedit/lib"
279-
280276
# CPython 3.10 introduced proper configure support for libedit, so add configure
281277
# flag there.
282278
if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_10}" ]; then
@@ -605,8 +601,6 @@ tools_path = os.environ["TOOLS_PATH"]
605601
replace_in_all("-I%s/deps/include/ncursesw" % tools_path, "")
606602
replace_in_all("-I%s/deps/include/uuid" % tools_path, "")
607603
replace_in_all("-I%s/deps/include" % tools_path, "")
608-
replace_in_all("-I%s/deps/libedit/include" % tools_path, "")
609-
replace_in_all("-L%s/deps/libedit/lib" % tools_path, "")
610604
replace_in_all("-L%s/deps/lib" % tools_path, "")
611605
612606
EOF
@@ -856,10 +850,6 @@ done
856850
mkdir ${ROOT}/out/python/build/lib
857851
cp -av ${TOOLS_PATH}/deps/lib/*.a ${ROOT}/out/python/build/lib/
858852

859-
if [ -d "${TOOLS_PATH}/deps/libedit" ]; then
860-
cp -av ${TOOLS_PATH}/deps/libedit/lib/*.a ${ROOT}/out/python/build/lib/
861-
fi
862-
863853
# On Apple, Python 3.9+ uses __builtin_available() to sniff for feature
864854
# availability. This symbol is defined by clang_rt, which isn't linked
865855
# by default. When building a static library, one must explicitly link

cpython-unix/build-libedit.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,19 @@ if [ "${CC}" = "musl-clang" ]; then
8888
cflags="${cflags} -D__STDC_ISO_10646__=201103L"
8989
fi
9090

91-
# Install to /tools/deps/libedit so it doesn't conflict with readline's files.
9291
CFLAGS="${cflags}" CPPFLAGS="${cflags}" LDFLAGS="${ldflags}" \
9392
./configure \
9493
--build=${BUILD_TRIPLE} \
9594
--host=${TARGET_TRIPLE} \
96-
--prefix=/tools/deps/libedit \
95+
--prefix=/tools/deps \
9796
--disable-shared
9897

9998
make -j ${NUM_CPUS}
10099
make -j ${NUM_CPUS} install DESTDIR=${ROOT}/out
101100

102101
# Alias readline/{history.h, readline.h} for readline compatibility.
103-
if [ -e ${ROOT}/out/tools/deps/libedit/include ]; then
104-
mkdir ${ROOT}/out/tools/deps/libedit/include/readline
105-
ln -s ../editline/readline.h ${ROOT}/out/tools/deps/libedit/include/readline/readline.h
106-
ln -s ../editline/readline.h ${ROOT}/out/tools/deps/libedit/include/readline/history.h
102+
if [ -e ${ROOT}/out/tools/deps/include ]; then
103+
mkdir ${ROOT}/out/tools/deps/include/readline
104+
ln -s ../editline/readline.h ${ROOT}/out/tools/deps/include/readline/readline.h
105+
ln -s ../editline/readline.h ${ROOT}/out/tools/deps/include/readline/history.h
107106
fi

0 commit comments

Comments
 (0)