[Pkg-samba-maint] Bug#971249: waf: CHECK_VALUEOF does not work during cross compilation
Helmut Grohne
helmut at subdivi.de
Mon Sep 28 05:53:03 BST 2020
Source: tevent
Version: 0.10.2-1
Tags: patch upstream
User: debian-cross at lists.debian.org
Usertags: ftcbfs
Thank you for applying my previous cross build patches. My previous
installment ended with:
> 5. waf has a mandatory run test for determining whether mkstemp works.
> 6. probably more
I've now looked into this and think that there are two bigger steps to
solve these. In the "probably more" department, there is a recurring
scheme of using a "CHECK_VALUEOF". It is used to determine the value of
an integer. If that value happens to be a compile time constant, it can
be determined using bisection. waf already does something similar in
CHECK_SIZEOF. I've implemented it for CHECK_VALUEOF and it now works
similar to autoconf's AC_COMPUTE_INT. In particular, it only does the
expensive bisection during cross compilation. In a native build, it
continues to use the quick run test it did before. I've attached a patch
for this.
For the mkstemp thingy there is little we can do. You cannot check this
property without running code. So during cross compilation, all you can
do is assume that it works. I think the solution will be adding
--cross-compile --cross-answers=somefile
to the waf invocation and having it tell that mkstemp works. This is
also is similar to what autoconf does except that autoconf has
centralized this answer file into a cross-config package. Does that work
for you?
Therefore please consider applying this patch for CHECK_VALUEOF,
preferrably upstream it. For making it work in the packaging, one must
pass --cross-compile to waf. You can do so using the following snippet:
$(if $(filter $(DEB_BUILD_ARCH),$(DEB_HOST_ARCH)),,--cross-compile)
Thank you
Helmut
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cross2.patch
Type: text/x-diff
Size: 3596 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-samba-maint/attachments/20200928/d07d84d7/attachment.patch>
More information about the Pkg-samba-maint
mailing list