GNOME Bugzilla – Bug 669224
Cross-compilation broken by data-to-c
Last modified: 2012-02-02 15:24:36 UTC
The new data-to-c helper introduced in commit 968f4e8 breaks cross-compilation because it is built for the host system instead of the build system.
Created attachment 206605 [details] [review] gio: Fix cross-compilation. This commit replaces the data-to-c helper by an equivalent awk script that can be properly run in a cross-compilation setup.
*** Bug 669235 has been marked as a duplicate of this bug. ***
perl version in bug 669235, not sure which is best. We already have a perl dependency for glib-mkenums which is used in the build. Some Makefile rules seem to use awk, but I don't think its currently hit on make/make install.
Configure has: REBUILD=\# if test "x$enable_rebuilds" = "xyes" && \ test -n "$PERL" && \ $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \ test -n "$AWK" ; then REBUILD= fi Which seem to imply that both perl and awk are required for a rebuild, but i'm not sure exactly where awk is used.
Created attachment 206622 [details] [review] The perl version of data-to-c
Review of attachment 206622 [details] [review]: Two minor comments. ::: gio/Makefile.am @@ +664,3 @@ +gconstructor_as_data.h: $(top_srcdir)/glib/gconstructor.h data-to-c.pl + $(AM_V_GEN) $(srcdir)/data-to-c.pl $(top_srcdir)/glib/gconstructor.h gconstructor_code > $@ Since you're changing this build rule, please make it atomic, i.e.: > $@.tmp && mv $@.tmp $@ ::: gio/data-to-c.pl @@ +1,1 @@ +#!/usr/bin/perl Kind of unhappy about adding more Perl...I'd like to make a slow transition to Python for build scripts. But this script is tiny.
colin: What about the awk version then?
(In reply to comment #7) > colin: What about the awk version then? It's not a big deal...getting perl out of the -devel image is a long term, low priority background task. I was just mentioning it. So it's up to Kalev or whoever is writing code.
(In reply to comment #6) > ::: gio/data-to-c.pl > @@ +1,1 @@ > +#!/usr/bin/perl > > Kind of unhappy about adding more Perl...I'd like to make a slow transition to > Python for build scripts. But this script is tiny. For what it's worth, I originally converted it to Python, but after yesterday's IRC discussion reimplemented it in perl. So if you prefer Python, it's easily doable. Apparently glib currently only needs Python for building the tests (gdbus-codegen has a runtime dep on python, not build time), and the tiny data-to-c.py would have introduced a new build time dep.
pushed the perl version with the atomic fix