bpo-42603: Use pkg-config to get Tcl/Tk paths for tkinter.

This commit is contained in:
Manolis Stamatogiannakis 2020-12-09 19:03:45 +01:00
parent 550e4673be
commit 83372ca3eb
3 changed files with 17 additions and 4 deletions

View File

@ -0,0 +1,3 @@
When no values are supplied for the ``--with-tcltk-*`` configuration flags,
use pkg-config to detect the location of Tcl/Tk headers and libraries, used
to build tkinter.

9
configure vendored
View File

@ -10697,8 +10697,13 @@ then
then then
as_fn_error $? "use both --with-tcltk-includes='...' and --with-tcltk-libs='...' or neither" "$LINENO" 5 as_fn_error $? "use both --with-tcltk-includes='...' and --with-tcltk-libs='...' or neither" "$LINENO" 5
fi fi
TCLTK_INCLUDES="" if test -n "$PKG_CONFIG" && "$PKG_CONFIG" --exists tcl tk; then
TCLTK_LIBS="" 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 else
TCLTK_INCLUDES="$with_tcltk_includes" TCLTK_INCLUDES="$with_tcltk_includes"
TCLTK_LIBS="$with_tcltk_libs" TCLTK_LIBS="$with_tcltk_libs"

View File

@ -3157,8 +3157,13 @@ then
then then
AC_MSG_ERROR([use both --with-tcltk-includes='...' and --with-tcltk-libs='...' or neither]) AC_MSG_ERROR([use both --with-tcltk-includes='...' and --with-tcltk-libs='...' or neither])
fi fi
TCLTK_INCLUDES="" if test -n "$PKG_CONFIG" && "$PKG_CONFIG" --exists tcl tk; then
TCLTK_LIBS="" 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 else
TCLTK_INCLUDES="$with_tcltk_includes" TCLTK_INCLUDES="$with_tcltk_includes"
TCLTK_LIBS="$with_tcltk_libs" TCLTK_LIBS="$with_tcltk_libs"