Source: html-xml-utils
Version: 7.7-1.2
User: [email protected]
Usertags: ftcbfs
X-Debbugs-Cc: [email protected]

html-xml-utils regressed cross building, because it now correctly
rebuilds and runs cexport in the native build. Unfortunately, it builds
it as a host tool, which means that it cannot be run during cross
compilation. Before the NMU, it wasn't run at all.

I'm attaching a patch to correctly rebuild cexport. Note that
AX_CC_FOR_BUILD is defined in the autoconf-archive package. While at it,
I'm also improving support for out-of-tree builds in the Makefile.

Helmut
--- html-xml-utils-7.7.orig/cexport.c
+++ html-xml-utils-7.7/cexport.c
@@ -36,16 +36,8 @@
  * unnecessary recompilations.)
  */
 
-#include "config.h"
 #include <stdio.h>
-#if STDC_HEADERS
-# include <string.h>
-#else
-# ifndef HAVE_STRCHR
-#  define strchr index
-#  define strrchr rindex
-# endif
-#endif
+#include <string.h>
 #include <ctype.h>
 #include <stdlib.h>
 
@@ -305,8 +297,11 @@
     
     if (file) {
         strcpy(outname, file);			/* Construct output file */
-        s = strrchr(outname, '.');		/* Extension becomes .e */
-        if (! s) s = outname + strlen(outname);
+        /* Extension becomes .e */
+	s = outname + strlen(outname);
+        while (s != outname && *--s != '.')
+            ;
+        if (*s != '.') s = outname + strlen(outname);
         strcpy(s, extension);
         out = fopen(outname, "w");
         if (! out) { perror(outname); err++; return; }
--- html-xml-utils-7.7.orig/Makefile.am
+++ html-xml-utils-7.7/Makefile.am
@@ -12,7 +12,7 @@
 			hxunent hxunpipe hxunxmlns hxwls hxxmlns hxref\
 			xml2asc asc2xml
 
-noinst_PROGRAMS =	cexport
+CLEANFILES =		cexport
 bin_SCRIPTS = 		hxcite-mkbib
 
 man_MANS =		hxaddid.1 asc2xml.1 hxcite.1\
@@ -131,7 +131,10 @@
 SUFFIX =		.c:sC .l:sC .y:sC .e:h .h:h
 SUFFIXES =		.1 .e .html
 
-$(EXPORTS): cexport
+$(EXPORTS): $(top_builddir)/cexport
+
+$(top_builddir)/cexport: $(cexport_SOURCES)
+	$(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) -o $@ $^
 
 .c.e:
 	$(top_builddir)/cexport -I. -I$(srcdir) $(CPPFLAGS) -c "@CPP@" <$< >$@
--- html-xml-utils-7.7.orig/configure.ac
+++ html-xml-utils-7.7/configure.ac
@@ -12,6 +12,7 @@
 # Checks for programs.
 AC_PROG_YACC
 AC_PROG_CC
+AX_CC_FOR_BUILD
 AC_PROG_MAKE_SET
 AM_PROG_LEX
 # AC_PROG_INSTALL

Reply via email to