Skip to content

Commit 565846b

Browse files
committed
fixup libtcl - and drop this seems wrong
1 parent fbd7957 commit 565846b

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

cpython-unix/build-tk.sh

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,15 @@ fi
5050
sed "${sed_args[@]}" 's/all: binaries libraries doc/all: libraries/' Makefile
5151
sed "${sed_args[@]}" 's/install-binaries: $(TK_STUB_LIB_FILE) $(TK_LIB_FILE) ${WISH_EXE}/install-binaries: $(TK_STUB_LIB_FILE) $(TK_LIB_FILE)/' Makefile
5252

53-
# For some reason musl isn't link libXau and libxcb. So we hack the Makefile
54-
# to do what we want.
55-
#if [ "${CC}" = "musl-clang" ]; then
56-
sed "${sed_args[@]}" 's/-ldl -lpthread /-ldl -lpthread -lXau -lxcb/' tkConfig.sh
57-
sed "${sed_args[@]}" 's/-lpthread $(X11_LIB_SWITCHES) -ldl -lpthread/-lpthread $(X11_LIB_SWITCHES) -ldl -lpthread -lXau -lxcb/' Makefile
58-
#fi
53+
# We are statically linking libX11, and static libraries do not carry
54+
# information about dependencies. pkg-config --static does, but Tcl/Tk's
55+
# build system apparently is too old for that. So we need to inform the
56+
# build system that libX11.a needs libXau.a and libxcb.a.
57+
MAKE_VARS=(DYLIB_INSTALL_DIR=@rpath X11_LIB_SWITCHES="-lX11 -lXau -lxcb")
5958

60-
make -j ${NUM_CPUS} DYLIB_INSTALL_DIR=@rpath
59+
make -j ${NUM_CPUS} "${MAKE_VARS[@]}"
6160
touch wish
62-
make -j ${NUM_CPUS} install DESTDIR=${ROOT}/out DYLIB_INSTALL_DIR=@rpath
61+
make -j ${NUM_CPUS} install DESTDIR=${ROOT}/out "${MAKE_VARS[@]}"
6362
make -j ${NUM_CPUS} install-private-headers DESTDIR=${ROOT}/out
6463

6564
# For some reason libtk*.a have weird permissions. Fix that.

0 commit comments

Comments
 (0)