Source: dateutils Version: 0.4.5-1.1 Tags: patch upstream User: debian-cr...@lists.debian.org Usertags: ftcbfs
dateutils fails to cross build from source, because it attempts to run a number of tools that it built for the host architecture. Such tools need to be built for the build architecture instead. I'm attaching a patch that changes the compiler to the build architecture one for those. Please consider applying it. You'll also need to depend on autoconf-archive or embed AX_CC_FOR_BUILD in the source. Helmut
--- dateutils-0.4.5.orig/m4/yuck.m4 +++ dateutils-0.4.5/m4/yuck.m4 @@ -87,8 +87,11 @@ M4="${YUCK_M4-$M4}" fi fi - AM_CONDITIONAL([HAVE_YUCK], [dnl - test "${with_included_yuck}" != "yes" -a -n "${YUCK}"]) + AS_IF([test "${with_included_yuck}" != "yes" -a -n "${YUCK}"],[dnl + HAVE_YUCK=yes],[HAVE_YUCK=no]) + AS_IF([test "$HAVE_YUCK" = no -a "$cross_compiling" = yes],[dnl + AC_REQUIRE([AX_CC_FOR_BUILD])]) + AM_CONDITIONAL([HAVE_YUCK], [test "$HAVE_YUCK" = yes]) ## further requirement is either getline() or fgetln() AC_CHECK_FUNCS([getline]) --- dateutils-0.4.5.orig/build-aux/yuck.am +++ dateutils-0.4.5/build-aux/yuck.am @@ -15,6 +15,9 @@ yuck_bootstrap_CPPFLAGS = $(yuck_CPPFLAGS) yuck_bootstrap_CPPFLAGS += -DBOOTSTRAP yuck_bootstrap_CPPFLAGS += -DWITH_SCMVER +$(yuck_bootstrap_OBJECTS): CC=$(CC_FOR_BUILD) +yuck-bootstrap$(EXEEXT_FOR_BUILD): $(yuck_bootstrap_OBJECTS) + $(CC_FOR_BUILD) $(yuck_bootstrap_CPPFLAGS) $^ -o $@ noinst_PROGRAMS += yuck yuck_SOURCES = yuck.c yuck.yuck @@ -25,6 +28,9 @@ yuck_CPPFLAGS += -DYUCK_TEMPLATE_PATH='"$(abs_srcdir)"' yuck_CPPFLAGS += -DWITH_SCMVER BUILT_SOURCES += yuck.yucc +$(yuck_OBJECTS): CC=$(CC_FOR_BUILD) +yuck$(EXEEXT_FOR_BUILD): $(yuck_OBJECTS) + $(CC_FOR_BUILD) $(yuck_CPPFLAGS) $^ -o $@ ## aix make wants all prereq's to exist EXTRA_DIST += yuck.m4i --- dateutils-0.4.5.orig/lib/Makefile.am +++ dateutils-0.4.5/lib/Makefile.am @@ -30,6 +30,9 @@ ltrcc_CPPFLAGS += -DDECLF=extern ltrcc_CPPFLAGS += -DSKIP_LEAP_ARITH ltrcc_SOURCES = ltrcc.c ltrcc.yuck +ltrcc$(EXEEXT_FOR_BUILD): $(ltrcc_OBJECTS) + $(CC_FOR_BUILD) $(ltrcc_CPPFLAGS) $^ -o $@ +$(ltrcc_OBJECTS): CC=$(CC_FOR_BUILD) ltrcc_SOURCES += date-core.c date-core.h ltrcc_SOURCES += time-core.c time-core.h