Source: freeipmi
Version: 1.4.11-1.1
Tags: upstream patch
User: [email protected]
Usertags: rebootstrap
freeipmi fails to cross build from source, because configure misdetects
some features, because it uses the build architecture cpp rather than
the host architecture one. This leads to compilation failures down the
road. The culprit is setting CPP with AC_PATH_PROG. After replacing path
with AC_PROG_CPP, the build succeeds, but the generation of manual pages
now fails, because that $(CPP) invocation assumes cpp semantics while
configure sets it to $ac_tool_prefix-gcc -E. So the attached patch also
sets up a CPP_FOR_BUILD to cover the manual pages. After applying it
freeipmi cross builds successfully. Please use it.
Helmut
Index: freeipmi-1.4.11/configure.ac
===================================================================
--- freeipmi-1.4.11.orig/configure.ac
+++ freeipmi-1.4.11/configure.ac
@@ -283,10 +283,12 @@
dnl Needed for per-target flags
AM_PROG_CC_C_O
AC_PROG_LIBTOOL
-AC_PATH_PROG([CPP], [cpp])
-if test -z "${CPP}"; then
+AC_PROG_CPP
+AC_PATH_PROG([CPP_FOR_BUILD], [cpp])
+if test -z "${CPP_FOR_BUILD}"; then
AC_MSG_ERROR([cannot find cpp])
fi
+AC_SUBST([CPP_FOR_BUILD])
AM_CONDITIONAL(WITH_GNU_LD, test "$with_gnu_ld" = "yes")
AC_PROG_MAKE_SET
AC_PROG_LN_S
Index: freeipmi-1.4.11/man/Makefile.am
===================================================================
--- freeipmi-1.4.11.orig/man/Makefile.am
+++ freeipmi-1.4.11/man/Makefile.am
@@ -189,7 +189,7 @@
manpage-common-legacy-output.man
$(MANS_CPP): $(MANS_CPP:%=%.pre)
- $(CPP) -nostdinc -w -C -P -I$(top_srcdir)/man [email protected] $@
+ $(CPP_FOR_BUILD) -nostdinc -w -C -P -I$(top_srcdir)/man [email protected] $@
CLEANFILES = $(MANS_CPP) *~
DISTCLEANFILES = $(MANS_CPP) $(MANS_CPP:%=%.pre) .deps/*.P