Source: newt Version: 0.52.24-2 User: debian-cr...@lists.debian.org Usertags: ftcbfs Tags: patch upstream
Hi, thanks for quickly fixing the error trapping. newt also fails to cross build from source, because it fails finding some Python stuff. This is rooted in Makefile.in hard coding the build architecture python-config, which works badly when combined with a host architecture compiler. Fixing this is rather tricky. In principle, we'd want to use AC_PATH_TOOL to disocver python-config, but it really is python$ver-config and we cannot loop over all available Python versions and call AC_PATH_TOOL for each as AC_PATH_TOOL needs to know the program name at autoconf time rather than at configure time. So what I'm proposing here is to emulate AC_PATH_TOOL in the Makefile.in by passing ac_tool_prefix to the Makefile.in and there trying the prefixed python-config before the plain one. In a cross build, the prefixed one will be selected and things work. When the prefixed one does is not exist, it'll fall back to the unprefixed one and work as before. Is that something you're willing to apply? Do you have other ideas for solving this? Helmut
--- newt-0.52.24.orig/Makefile.in +++ newt-0.52.24/Makefile.in @@ -49,6 +49,7 @@ datadir = @datadir@ datarootdir = @datarootdir@ mandir = @mandir@ +ac_tool_prefix = @ac_tool_prefix@ man1dir = $(mandir)/man1 pkgconfigdir = $(libdir)/pkgconfig instroot ?= $(DESTDIR) @@ -85,7 +86,7 @@ _snack.$(SOEXT): snack.c $(LIBNEWTSH) @[ -n "$(PYTHONVERS)" ] && for ver in $(PYTHONVERS) $(PYTHONDBG); do \ - pyconfig=$$ver-config; \ + pyconfig=`command -v $(ac_tool_prefix)$$ver-config || echo $$ver-config`; \ mkdir -p $$ver; \ PCFLAGS=`$$pyconfig --cflags`; \ PIFLAGS=`$$pyconfig --includes`; \ --- newt-0.52.24.orig/configure.ac +++ newt-0.52.24/configure.ac @@ -77,6 +77,7 @@ AC_MSG_RESULT([$PYTHONVERS]) fi AC_SUBST([PYTHONVERS]) +AC_SUBST([ac_tool_prefix]) AC_ARG_WITH([tcl], [ --without-tcl do not compile whiptcl.so]) if test "x$with_tcl" = "xno"; then