On Wed, Sep 17, 07:48, Helmut Grohne wrote:

> liblopsub fails to cross build from source, because it builds for the 
> build architecture. The easiest way of fixing this usually is using 
> dh_auto_build, but this package appears to avoid debhelper where 
> possible. Hence, I propose using dpkg's buildtools.mk instead. Then, the 
> upstream build system needs reworking to support cross compilation. It 
> builds two intermediate binaries run during build. For lopsubgen-stage1, 
> we may just build it for the build architecture as it is not installed. 
> lopsubgen however is both run and installed. I suggest building it twice 
> (but only during cross compilation) and am attaching a patch to this 
> end. Please propose this patch to upstream as it will enable cross 
> building liblopsub on other distributions such as Yocto or PtxDist.

I'm OK with this approach. IIUC, the first step is to rework Makefile as
per your patch. I've applied this change, but adjusted it slightly to fix
two minor issues:

First, the new rule for the %.build.o target caused warnings from gcc because
lex(1) creates a couple of unused -C functions, resulting in e.g.:

        lopsubgen.c:3009:16: warning: 'yy_top_state' defined but not used 
[-Wunused-function]
 3009 |     static int yy_top_state  (void)

This was easy to fix by dropping $(STRICT_CFLAGS) for this target.

Second, re-running make(1) after a successful build no longer was a no-op but
regenerated everything. I've worked around this by prepending an independent
patch which instructs make(1) to never remove any intermediate files.

Please have a look at the current "pu" branch of the public repo, in particular
the "Rework Makefile to support cross compilation." commit which has your
authorship. If you have no objections, I'll merge the topic branch which
contains this commit into master.

Thanks
Andre
-- 
Max Planck Institute for Biology
Max-Planck-Ring 5, 72076 Tübingen, Germany. Phone: (+49) 7071 601 829
https://people.tuebingen.mpg.de/maan/

Reply via email to