Source: yacas
Version: 1.3.6-2
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

yacas fails to cross build from source. The immediate failure is failing
to pass --host to ./configure. This can be solved by running ./configure
through dh_auto_configure. Additional configure flags can be passed to
dh_auto_configure after a "--". Then it tries to run code generators in
the manmake directory for the host architecture. Such generators need to
be built with the built architecture compiler. The autoconf-archive
provides a macro AX_PROG_CXX_FOR_BUILD to discover this compiler and the
attached patch demonstrates how to use it. Unfortunately, LT_INIT and
AX_PROG_CXX_FOR_BUILD don't work well together (#924415), so I'm
providing an additional workaround here. After fixing these, the build
of yacas itself succeeds, but the texdocs target runs yacas. I fear we
won't be able to generate the documentation in a cross build, but since
yacas-doc is an Architecture: all package, that can be avoided in
principle.

This may sound very complicated, but it really boils down to three
things:
 1. Run ./configure through dh_auto_configure.
 2. Apply my patch to make the manpage generators work.
 3. Avoid building documentation in an arch-only build.

I haven't provided a solution for the third part here. Please close this
bug if you fix 1 and 2. If you need help, please ask.

Helmut
--- yacas-1.3.6.orig/configure.ac
+++ yacas-1.3.6/configure.ac
@@ -15,6 +15,8 @@
 AC_PROG_CC
 AC_PROG_CPP
 AC_PROG_CXX
+m4_defun([_LT_LANG_CXX_FOR_BUILD_CONFIG],[])dnl make LT_LANG happy
+AX_PROG_CXX_FOR_BUILD
 
 AC_CHECK_PROG(have_perl, perl, yes, no)
 AC_CHECK_PROG(have_pdflatex, pdflatex, yes, no)
--- yacas-1.3.6.orig/manmake/Makefile.am
+++ yacas-1.3.6/manmake/Makefile.am
@@ -11,13 +11,13 @@
 ## PDF_DOCS   is either "pdf-docs" or empty
 all-am: @BOOKS_HTML@ @PDF_DOCS@ hints
 
-noinst_PROGRAMS = manripper removeduplicates
-
-manripper_SOURCES = manripper.cpp 
+manripper$(BUILD_EXEEXT): manripper.cpp
+	$(CXX_FOR_BUILD) -o $@ $^
 
-removeduplicates_SOURCES = removeduplicates.cpp
+removeduplicates$(BUILD_EXEEXT): removeduplicates.cpp
+	$(CXX_FOR_BUILD) -o $@ $^
 
-hints: manripper removeduplicates $(REFSOURCES) $(REFPROGSOURCES) ref.book.txt refprog.book.txt
+hints: manripper$(BUILD_EXEEXT) removeduplicates$(BUILD_EXEEXT) $(REFSOURCES) $(REFPROGSOURCES) ref.book.txt refprog.book.txt
 	rm -f hints.unsorted
 	for file in ref.book.txt $(REFSOURCES) refprog.book.txt $(REFPROGSOURCES); do \
 	./manripper $(srcdir)/"$$file" >> hints.unsorted ; done

Reply via email to