bpo-42603: Use pkg-config to get TCL/TK paths for tkinter. (GH-23721)
diff --git a/configure b/configure
index 8c94825..2d5a61e 100755
--- a/configure
+++ b/configure
@@ -10714,8 +10714,13 @@
then
as_fn_error $? "use both --with-tcltk-includes='...' and --with-tcltk-libs='...' or neither" "$LINENO" 5
fi
- TCLTK_INCLUDES=""
- TCLTK_LIBS=""
+ if test -n "$PKG_CONFIG" && "$PKG_CONFIG" --exists tcl tk; then
+ TCLTK_INCLUDES="`"$PKG_CONFIG" tcl tk --cflags-only-I 2>/dev/null`"
+ TCLTK_LIBS="`"$PKG_CONFIG" tcl tk --libs 2>/dev/null`"
+ else
+ TCLTK_INCLUDES=""
+ TCLTK_LIBS=""
+ fi
else
TCLTK_INCLUDES="$with_tcltk_includes"
TCLTK_LIBS="$with_tcltk_libs"