File: cross-texi-linearize.patch

package info (click to toggle)
fdutils 5.6-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,540 kB
  • sloc: ansic: 6,334; sh: 3,570; makefile: 262; sed: 4
file content (45 lines) | stat: -rw-r--r-- 1,393 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Description: Compile build tool doc/texi-linearize with the build arch compiler
 fdutils fails to cross build from source, because it fails running
 doc/texi-linearize with an Exec format error. That indicates that it is a
 build tool and should be using the build architecture compiler rather than the
 host architecture compiler. The autoconf-archive provides a useful macro
 AX_CC_FOR_BUILD for this task. I'm attaching a patch that makes use of it to
 make fdutils cross buildable.
Author: Helmut Grohne <helmut@subdivi.de>
Bug-Debian: https://bugs.debian.org/981598
Last-Update: 2025-05-10
--- a/configure.in
+++ b/configure.in
@@ -9,6 +9,7 @@
 AC_PROG_GCC_TRADITIONAL
 AC_PROG_INSTALL
 AC_PROG_LN_S
+AX_PROG_CC_FOR_BUILD
 
 AC_PATH_PROG(INSTALL_INFO, install-info, "")
 
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -37,6 +37,8 @@
 CC          = @CC@
 CPPFLAGS    = @CPPFLAGS@
 CFLAGS      = @CFLAGS@
+CC_FOR_BUILD = @CC_FOR_BUILD@
+BUILD_EXEEXT = @BUILD_EXEEXT@
 
 all: info dvi
 
@@ -76,8 +78,11 @@
 %.html: Fdutils.texi
 	$(TEXI2HTML) $<
 
-Fdutils.texi: $(TEXISRC) texi-linearize
-	./texi-linearize $(srcdir) fdutils.texi > $@
+texi-linearize$(BUILD_EXEEXT): texi-linearize.c
+	$(CC_FOR_BUILD) -o $@ $^
+
+Fdutils.texi: $(TEXISRC) texi-linearize$(BUILD_EXEEXT)
+	./texi-linearize$(BUILD_EXEEXT) $(srcdir) fdutils.texi > $@
 
 
 # Don't cd, to avoid breaking install-sh references.