Skip to content

Commit d59fafa

Browse files
committed
Build libtcl and libtk as shared objects
1 parent c742dca commit d59fafa

File tree

3 files changed

+2
-53
lines changed

3 files changed

+2
-53
lines changed

cpython-unix/build-tcl.sh

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,6 @@ if [ -n "${STATIC}" ]; then
2222
fi
2323
fi
2424

25-
patch -p1 << 'EOF'
26-
diff --git a/unix/Makefile.in b/unix/Makefile.in
27-
--- a/unix/Makefile.in
28-
+++ b/unix/Makefile.in
29-
@@ -1813,7 +1813,7 @@ configure-packages:
30-
$$i/configure --with-tcl=../.. \
31-
--with-tclinclude=$(GENERIC_DIR) \
32-
$(PKG_CFG_ARGS) --libdir=$(PACKAGE_DIR) \
33-
- --enable-shared --enable-threads; ) || exit $$?; \
34-
+ --enable-shared=no --enable-threads; ) || exit $$?; \
35-
fi; \
36-
fi; \
37-
fi; \
38-
EOF
39-
4025
# Remove packages we don't care about and can pull in unwanted symbols.
4126
rm -rf pkgs/sqlite* pkgs/tdbc*
4227

@@ -48,12 +33,9 @@ CFLAGS="${CFLAGS}" CPPFLAGS="${CFLAGS}" LDFLAGS="${EXTRA_TARGET_LDFLAGS}" ./conf
4833
--build=${BUILD_TRIPLE} \
4934
--host=${TARGET_TRIPLE} \
5035
--prefix=/tools/deps \
51-
--enable-shared=no \
36+
--enable-shared \
5237
--enable-threads
5338

5439
make -j ${NUM_CPUS}
5540
make -j ${NUM_CPUS} install DESTDIR=${ROOT}/out
5641
make -j ${NUM_CPUS} install-private-headers DESTDIR=${ROOT}/out
57-
58-
# For some reason libtcl*.a have weird permissions. Fix that.
59-
chmod 644 ${ROOT}/out/tools/deps/lib/libtcl*.a

cpython-unix/build-tk.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ CFLAGS="${CFLAGS}" CPPFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" ./configure \
3131
--host=${TARGET_TRIPLE} \
3232
--prefix=/tools/deps \
3333
--with-tcl=${TOOLS_PATH}/deps/lib \
34-
--enable-shared=no \
34+
--enable-shared \
3535
--enable-threads \
3636
${EXTRA_CONFIGURE_FLAGS}
3737

@@ -53,7 +53,4 @@ touch wish
5353
make -j ${NUM_CPUS} install DESTDIR=${ROOT}/out
5454
make -j ${NUM_CPUS} install-private-headers DESTDIR=${ROOT}/out
5555

56-
# For some reason libtk*.a have weird permissions. Fix that.
57-
chmod 644 /${ROOT}/out/tools/deps/lib/libtk*.a
58-
5956
rm ${ROOT}/out/tools/deps/bin/wish*

cpython-unix/extension-modules.yml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -681,36 +681,6 @@ _tkinter:
681681
- tcl8.6
682682
- tk8.6
683683

684-
# Without -ObjC, we get a crash: -[TKApplication tkProcessEvent:]: unrecognized selector sent to instance.
685-
# See also https://core.tcl-lang.org/tk/tktview/85f316beb15108ac43b03fa6c8608e31f3ae5f92.
686-
# This is apparently an issue with static linking Objective-C binaries.
687-
linker-args:
688-
- args: ["-ObjC"]
689-
targets:
690-
- .*-apple-darwin
691-
links-conditional:
692-
- name: X11
693-
targets:
694-
- .*-unknown-linux-.*
695-
- name: xcb
696-
targets:
697-
- .*-unknown-linux-.*
698-
- name: Xau
699-
targets:
700-
- .*-unknown-linux-.*
701-
# Many of these are dependencies of libtcl and libtk.
702-
frameworks:
703-
- AppKit
704-
- ApplicationServices
705-
- Carbon
706-
- Cocoa
707-
- CoreFoundation
708-
- CoreServices
709-
- CoreGraphics
710-
- IOKit
711-
- QuartzCore
712-
- UniformTypeIdentifiers
713-
714684
_tokenize:
715685
minimum-python-version: "3.11"
716686
config-c-only: true

0 commit comments

Comments
 (0)