Peter Eisentraut wrote:
> Sorry, the last patch couldn't have worked, because CC and CXX are never
> undefined.  Try this patch instead; the logic is the same.
> 
> Index: 1/class/autotools-vars.mk.in
> ===================================================================
> --- 1/class/autotools-vars.mk.in        (Revision 175)
> +++ 1/class/autotools-vars.mk.in        (Arbeitskopie)
> @@ -31,7 +31,13 @@
>  DEB_AC_AUX_DIR = $(DEB_SRCDIR)
> 
>  DEB_CONFIGURE_SCRIPT = $(CURDIR)/$(DEB_SRCDIR)/configure
> -DEB_CONFIGURE_SCRIPT_ENV = CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" 
> CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
> +DEB_CONFIGURE_SCRIPT_ENV = CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" 
> CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
> +ifeq "" "$(findstring $(origin CC),empty default)"
> +DEB_CONFIGURE_SCRIPT_ENV += CC="$(CC)"
> +endif
> +ifeq "" "$(findstring $(origin CXX),empty default)"
> +DEB_CONFIGURE_SCRIPT_ENV += CXX="$(CXX)"
> +endif
>  DEB_CONFIGURE_NORMAL_ARGS = --build=$(DEB_BUILD_GNU_TYPE) 
> --prefix=$(DEB_CONFIGURE_PREFIX) --includedir=$(DEB_CONFIGURE_INCLUDEDIR) 
> --mandir=$(DEB_CONFIGURE_MANDIR) --infodir=$(DEB_CONFIGURE_INFODIR) 
> --sysconfdir=$(DEB_CONFIGURE_SYSCONFDIR) 
> --localstatedir=$(DEB_CONFIGURE_LOCALSTATEDIR) 
> --libexecdir=$(DEB_CONFIGURE_LIBEXECDIR) --disable-maintainer-mode 
> --disable-dependency-tracking
> 
>  # Provide --host only if different from --build, as recommended in
> 

Excellent - this is fine.

Thanks for your help with this one.

Before you make an upload to fix this one though, I've come across a
different perspective on the same issue, when not using autotools, just
using the CDBS make support (/usr/share/cdbs/1/class/makefile.mk). I
need to add this rule:

ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
DEB_MAKE_ENVVARS=CC=$(DEB_HOST_GNU_TYPE)-gcc
endif

This change is needed with or without any patch to autotools-vars.mk.in
so I'm thinking of reporting a new bug and there's probably a similar
fix that can be made in makefile-vars.mk.in ?

It could be as simple as the attached patch.

What do you think - do both in the same hit or would you prefer a new
bug report and fix it separately?

With these two patches, I'm able to cross build all the CDBS packages
that I need for Emdebian.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

--- cdbs.old/1/class/makefile-vars.mk.in	2007-05-18 17:01:14.000000000 +0100
+++ cdbs-0.4.50/1/class/makefile-vars.mk.in	2007-11-24 11:43:20.000000000 +0000
@@ -25,7 +25,11 @@
 include $(_cdbs_class_path)/langcore.mk$(_cdbs_makefile_suffix)
 
 DEB_MAKE_MAKEFILE =
+ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+DEB_MAKE_ENVVARS=CC=$(DEB_HOST_GNU_TYPE)-gcc
+else
 DEB_MAKE_ENVVARS = 
+endif
 DEB_MAKE_INVOKE = $(DEB_MAKE_ENVVARS) $(MAKE) $(if $(DEB_MAKE_MAKEFILE), -f $(DEB_MAKE_MAKEFILE),) -C $(DEB_BUILDDIR) CFLAGS=$(if $(CFLAGS_$(cdbs_curpkg)),"$(CFLAGS_$(cdbs_curpkg))","$(CFLAGS)") CXXFLAGS=$(if $(CXXFLAGS_$(cdbs_curpkg)),"$(CXXFLAGS_$(cdbs_curpkg))","$(CXXFLAGS)") CPPFLAGS=$(if $(CPPFLAGS_$(cdbs_curpkg)),"$(CPPFLAGS_$(cdbs_curpkg))","$(CPPFLAGS)") LDFLAGS=$(if $(LDFLAGS_$(cdbs_curpkg)),"$(LDFLAGS_$(cdbs_curpkg))","$(LDFLAGS)") 
 
 # This variable is deprecated.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to