From: Sébastien Noel <sebastien@twolife.be>
Last-Update: 2025-03-15
Forwarded: no-needed
Description: fix python module build (it needs the tcl headers)
--- a/src/mod/python.mod/Makefile.in
+++ b/src/mod/python.mod/Makefile.in
@@ -1,7 +1,7 @@
 # Makefile for src/mod/python.mod/
 
 srcdir = .
-PYTHON_CFLAGS = @PYTHON_CFLAGS@
+PYTHON_CFLAGS = @PYTHON_CFLAGS@ @TCL_INCLUDE_SPEC@
 PYTHON_LDFLAGS = @PYTHON_LDFLAGS@
 
 doofus:
--- a/src/mod/python.mod/configure.ac
+++ b/src/mod/python.mod/configure.ac
@@ -17,6 +17,26 @@
 AC_PROG_FGREP
 EGG_PYTHON_WITHCONFIG
 
+AC_ARG_WITH(tclinc, [  --with-tclinc=PATH      full path to Tcl header (e.g. /usr/include/tcl.h)],  [tclincname="$withval"])
+AC_MSG_CHECKING([for Tcl header flags])
+if test "x$tclincname" != x; then
+  if test -f "$tclincname" && test -r "$tclincname"; then
+    TCL_INCLUDE_SPEC=-I`echo $tclincname | sed 's%/[[^/]][[^/]]*$%%'`
+  else
+    cat << EOF >&2
+configure: WARNING:
+
+  The file '$tclincname' given to option --with-tclinc is not valid.
+  Specify the full path including the file name (e.g. /usr/include/tcl.h)
+
+  configure will now attempt to autodetect both the Tcl library and header.
+
+EOF
+  fi
+fi
+AC_MSG_RESULT([$TCL_INCLUDE_SPEC])
+AC_SUBST(TCL_INCLUDE_SPEC)
+
 python_avail="false"
 
 if test "x$egg_enable_python" != "xno"; then
