On 'make distcheck', autotools try to package the source tree with 'make dist' first, then extract it and try to build it out-of-tree.
Unfortunately, treecc has no option which says "the source is $here, but put the output to $there". -d looks like that, but seems to work only for Java. This patch works around this problem by finding out if we are doing an out-of-tree build and copying the sources into the build dir in that case, then running treecc and removing the .tc files afterwards. It is a little bit hacky, but I don't see a better solution as long as treecc doesn't support a proper -d option for all languages. Signed-off-by: Robert Schwebel <[EMAIL PROTECTED]> codegen/Makefile.am | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) Index: codegen/Makefile.am =================================================================== --- codegen/Makefile.am.orig +++ codegen/Makefile.am @@ -89,7 +89,17 @@ BUILT_SOURCES = $(STAMP) $(TREECC_OUTPUT libILCodeGen_a_DEPENDENCIES = $(STAMP) +# Hack alert: if we build out of tree, copy sources to here, +# because treecc has no option to define the output directory + $(STAMP): $(TREECC_INPUTS) - $(TREECC) $(srcdir)/cg_all.tc && touch $@ + if [ "`cd $(srcdir) && pwd`" != "`pwd`" ]; then \ + cp $(srcdir)/*.tc .; \ + fi + $(TREECC) cg_all.tc && touch $@ + if [ "`cd $(srcdir) && pwd`" != "`pwd`" ]; then \ + rm -f *.tc; \ + fi CLEANFILES = $(TREECC_OUTPUT) $(STAMP) + -- Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de Pengutronix - Linux Solutions for Science and Industry Handelsregister: Amtsgericht Hildesheim, HRA 2686 Hannoversche Str. 2, 31134 Hildesheim, Germany Phone: +49-5121-206917-0 | Fax: +49-5121-206917-9 _______________________________________________ Developers mailing list [email protected] http://dotgnu.org/mailman/listinfo/developers
