Daniel Cassidy wrote:
As an aside, I am quite tempted to move away from autotools and
friends because, while they are very flexible, few people seem to
really understand how they work. If I am honest I am not one of those
few. At the very least swfmill's build system needs some serious work
-- although that isn't related to this problem :)

How about a switch all the way to... *non-recursive* automake?

I wanted to teach myself, so I put together a patch (attached, based on current bzr head, which is 256). Basically what you'll see in it is: move everything from all the Makefile.ams into the top-level Makefile.am (which will then be made into one top-level Makefile). There are also some changes to the test harness, and a few files got #include <> changed to #include "".

The caveat that this was a learning experience for me applies doubly so, because any build system change like this could screw things up for everyone. That said, this does pass make check, and even passes make distcheck, which the old system never did.

Also, the non-recursive version seems a lot simpler to me. That may just be because I wrote it, but it is 72 lines shorter.

--
dolphinling
<http://dolphinling.net/>
=== modified file 'Makefile.am'
--- Makefile.am 2009-06-24 17:20:01 +0000
+++ Makefile.am 2009-08-24 16:06:42 +0000
@@ -2,14 +2,178 @@
 
 NULL=
 
-SUBDIRS = \
-       src \
-       test \
-       $(NULL)
+bin_PROGRAMS = swfmill
+lib_LTLIBRARIES = libswft.la libswfmillxslt.la
+
+## XXX TODO: Are those really just convenience libraries that shouldn't have 
been installed?
+
+if IS_WINDOWS
+STATICCFLAGS = -DLIBXML_STATIC -DLIBXSLT_STATIC -DLIBEXSLT_STATIC
+STATICLDFLAGS = -all-static
+endif
+if IS_OSX
+STATICCFLAGS = -DLIBXML_STATIC -DLIBXSLT_STATIC -DLIBEXSLT_STATIC
+STATICLDFLAGS = -all-static
+endif
+
+swfmill_CFLAGS = $(XML_CFLAGS) $(XSLT_CFLAGS) $(STATICCFLAGS) 
-I$(builddir)/src -I$(srcdir)/src -I$(srcdir)/src/swft -I$(srcdir)/src/xslt
+swfmill_CXXFLAGS = $(swfmill_CFLAGS)
+swfmill_LDADD = $(XML_LIBS) $(XSLT_LIBS) libswft.la libswfmillxslt.la
+swfmill_LDFLAGS = $(STATICLDFLAGS)
+
+swfmill_SOURCES = \
+       src/base64.c \
+       src/base64.h \
+       src/Geom.cpp \
+       src/Geom.h \
+       src/SWFReader.cpp \
+       src/SWFReader.h \
+       src/SWFWriter.cpp \
+       src/SWFWriter.h \
+       src/SWFFile.cpp \
+       src/SWFFile.h \
+       src/SWFItem.cpp \
+       src/SWFItem.h \
+       src/SWFTag.cpp \
+       src/SWFTag.h \
+       src/SWFAction.cpp \
+       src/SWFAction.h \
+       src/SWFFilter.cpp \
+       src/SWFFilter.h \
+       src/SWFTrait.cpp \
+       src/SWFTrait.h \
+       src/SWFShapeItem.cpp \
+       src/SWFShapeItem.h \
+       src/SWFGlyphList.cpp \
+       src/SWFGlyphList.h \
+       src/SWFShapeMaker.cpp \
+       src/SWFShapeMaker.h \
+       src/SWFBasic.h \
+       src/SWFIdItem.h \
+       src/SWFIdItems.h \
+       src/SWFList.h \
+       src/swfmill.cpp \
+       $(NULL)
+nodist_swfmill_SOURCES = $(GENERATED_FILES_SRC)
+
+GENERATED_FILES_SRC = \
+       src/gSWFParseXML.cpp \
+       src/gSWFWriteXML.cpp \
+       src/gSWFParser.cpp \
+       src/gSWFWriter.cpp \
+       src/gSWFDumper.cpp \
+       src/gSWFBasics.cpp \
+       src/gSWFSize.cpp \
+       src/SWF.h \
+       $(NULL)
+
+GENERATOR_FILES_SRC = \
+       src/codegen/basics.xsl \
+       src/codegen/basic.xsl \
+       src/codegen/dumper.xsl \
+       src/codegen/header.xsl \
+       src/codegen/mk.xsl \
+       src/codegen/parser.xsl \
+       src/codegen/parsexml.xsl \
+       src/codegen/size.xsl \
+       src/codegen/source.xml \
+       src/codegen/writer.xsl \
+       src/codegen/writexml.xsl \
+       $(NULL)
+
+$(GENERATED_FILES_SRC): $(GENERATOR_FILES_SRC)
+       xsltproc -o $(builddir)/src/ $(srcdir)/src/codegen/mk.xsl 
$(srcdir)/src/codegen/source.xml
+
+libswft_la_CFLAGS = $(XML_CFLAGS) $(XSLT_CFLAGS) $(FREETYPE_CFLAGS) 
$(PNG_CFLAGS) $(STATICCFLAGS) -I$(srcdir)/src -I$(builddir)/src
+libswft_la_CXXFLAGS = $(libswft_la_CFLAGS)
+libswft_la_LIBADD = $(XML_LIBS) $(XSLT_LIBS) $(FREETYPE_LIBS) $(PNG_LIBS)
+libswft_la_LDFLAGS = $(STATICLDFLAGS)
+
+libswft_la_SOURCES = \
+       src/swft/swft.cpp \
+       src/swft/swft_document.cpp \
+       src/swft/swft_path.cpp \
+       src/swft/swft_import.cpp \
+       src/swft/swft_import_jpeg.cpp \
+       src/swft/swft_import_png.cpp \
+       src/swft/swft_import_ttf.cpp \
+       src/swft/swft_import_mp3.cpp \
+       src/swft/swft_import_wav.cpp \
+       src/swft/swft_import_binary.cpp \
+       src/swft/Parser.cpp \
+       src/swft/SVGStyle.cpp \
+       src/swft/SVGGradient.cpp \
+       src/swft/SVGColor.cpp \
+       src/swft/SVGPathParser.cpp \
+       src/swft/SVGPointsParser.cpp \
+       src/swft/SVGTransformParser.cpp \
+       src/swft/SVGAttributeParser.cpp \
+       src/swft/readpng.c \
+       src/swft/swft.h \
+       src/swft/Parser.h \
+       src/swft/SVGStyle.h \
+       src/swft/SVGGradient.h \
+       src/swft/SVGColor.h \
+       src/swft/SVGColors.h \
+       src/swft/SVGPathParser.h \
+       src/swft/SVGPointsParser.h \
+       src/swft/SVGTransformParser.h \
+       src/swft/SVGAttributeParser.h \
+       src/swft/readpng.h \
+       $(NULL)
+
+libswfmillxslt_la_CFLAGS = -I$(srcdir)/src/xslt
+libswfmillxslt_la_CXXFLAGS = $(libswfmillxslt_la_CFLAGS)
+
+libswfmillxslt_la_SOURCES = \
+       src/xslt/xslt.h \
+       $(NULL)
+nodist_libswfmillxslt_la_SOURCES = \
+       $(GENERATED_FILES_SRC_XSLT) \
+       $(NULL)
+
+GENERATED_FILES_SRC_XSLT = \
+       src/xslt/simple.cpp \
+       $(NULL)
+
+GENERATOR_FILES_SRC_XSLT = \
+       src/xslt/simple-tools.xslt \
+       src/xslt/simple-elements.xslt \
+       src/xslt/simple-import.xslt \
+       src/xslt/simple-deprecated.xslt \
+       src/xslt/simple-svg.xslt \
+       src/xslt/assemble.xsl \
+       src/xslt/simple.xml \
+       $(NULL)
+
+$(GENERATED_FILES_SRC_XSLT): $(GENERATOR_FILES_SRC_XSLT)
+       xsltproc -o $(builddir)/src/xslt/simple.xsl 
$(srcdir)/src/xslt/assemble.xsl $(srcdir)/src/xslt/simple.xml 
+       echo "#include \"xslt.h\"" > $(builddir)/src/xslt/simple.cpp
+       echo "const char *xslt_simple = " >> $(builddir)/src/xslt/simple.cpp
+       sed -e 
"s/namespaces=\\\"hack\\\"/xmlns:swft=\"http:\/\/subsignal.org\/swfml\/swft\" 
xmlns:str=\"http:\/\/exslt.org\/strings\" 
xmlns:math=\"http:\/\/exslt.org\/math\"/" -e "s/\"/\\\\\"/g" -e 
"s/\(.*\)/\"\1\\\\n\"/g" $(builddir)/src/xslt/simple.xsl >> 
$(builddir)/src/xslt/simple.cpp
+       echo ";" >> $(builddir)/src/xslt/simple.cpp
+
+
+GENERATED_FILES = $(GENERATED_FILES_SRC) $(GENERATED_FILES_SRC_XSLT)
+BUILT_SOURCES = $(GENERATED_FILES)
+
+CLEANFILES = $(GENERATED_FILES) $(CHECKCLEANFILES) 
$(builddir)/src/xslt/simple.xsl
 
 EXTRA_DIST = \
+       $(GENERATOR_FILES_SRC) \
+       $(GENERATOR_FILES_SRC_XSLT) \
        depcomp \
        autogen.sh \
        $(NULL)
 
-MAINTAINERCLEANFILES   = Makefile.in config.log config.status configure 
stamp-h.in config-h.in aclocal.m4
+MAINTAINERCLEANFILES = Makefile.in config.log config.status configure 
stamp-h.in config-h.in aclocal.m4
+
+check-local:
+       sh $(srcdir)/test/xml/run-xml-tests $(builddir)/swfmill 
$(srcdir)/test/xml
+
+dist_check_SCRIPTS = \
+       test/xml/test-xml \
+       test/xml/run-xml-tests \
+       $(NULL)
+
+CHECKCLEANFILES = *.swf *.xml.swf

=== modified file 'configure.ac'
--- configure.ac        2009-08-21 00:45:30 +0000
+++ configure.ac        2009-08-24 13:37:19 +0000
@@ -47,10 +47,4 @@
 
 AC_OUTPUT([
        Makefile
-       src/Makefile
-       src/swft/Makefile
-       src/xslt/Makefile
-       src/codegen/Makefile
-       test/Makefile
-       test/xml/Makefile
        ])

=== removed file 'src/Makefile.am'
--- src/Makefile.am     2009-08-21 00:45:30 +0000
+++ src/Makefile.am     1970-01-01 00:00:00 +0000
@@ -1,87 +0,0 @@
-# $Header: /home/dan/cvs/swfmill/src/Makefile.am,v 1.15 2005/05/22 16:18:42 
dan Exp $
-
-NULL = 
-MAINTAINERCLEANFILES = Makefile.in
-       
-bin_PROGRAMS = swfmill
-
-if IS_WINDOWS
-ADDCFLAGS = -DLIBXML_STATIC -DLIBXSLT_STATIC -DLIBEXSLT_STATIC
-ADDLDFLAGS = -all-static
-endif
-if IS_OSX
-ADDCFLAGS = -DLIBXML_STATIC -DLIBXSLT_STATIC -DLIBEXSLT_STATIC
-ADDLDFLAGS = -all-static
-endif
-
-swfmill_CFLAGS = $(XML_CFLAGS) $(XSLT_CFLAGS) $(ADDCFLAGS) -I$(srcdir)/swft/ 
-I$(srcdir)/xslt/
-swfmill_CXXFLAGS = $(swfmill_CFLAGS)
-swfmill_LDADD = $(XML_LIBS) $(XSLT_LIBS) swft/libswft.la xslt/libswfmillxslt.la
-swfmill_LDFLAGS = $(ADDLDFLAGS)
-
-BUILT_SOURCES = \
-       SWF.h \
-       $(NULL)
-
-GENERATED_FILES = \
-       gSWFParseXML.cpp \
-       gSWFWriteXML.cpp \
-       gSWFParser.cpp \
-       gSWFWriter.cpp \
-       gSWFDumper.cpp \
-       gSWFBasics.cpp \
-       gSWFSize.cpp \
-       $(NULL)
-       
-$(GENERATED_FILES) $(BUILT_SOURCES):
-       xsltproc $(srcdir)/codegen/mk.xsl $(srcdir)/codegen/source.xml
-
-swfmill_SOURCES = \
-       base64.c \
-       Geom.cpp \
-       SWFReader.cpp \
-       SWFWriter.cpp \
-       SWFFile.cpp \
-       SWFItem.cpp \
-       SWFTag.cpp \
-       SWFAction.cpp \
-       SWFFilter.cpp \
-       SWFTrait.cpp \
-       SWFShapeItem.cpp \
-       SWFGlyphList.cpp \
-       SWFShapeMaker.cpp \
-       \
-       swfmill.cpp \
-       $(NULL)
-
-nodist_swfmill_SOURCES = $(GENERATED_FILES)
-
-noinst_HEADERS = \
-       base64.h \
-       Geom.h \
-       SWFBasic.h \
-       SWFReader.h \
-       SWFWriter.h \
-       SWFFile.h \
-       SWFItem.h \
-       SWFIdItem.h \
-       SWFIdItems.h \
-       SWFTag.h \
-       SWFAction.h \
-       SWFFilter.h \
-       SWFTrait.h \
-       SWFShapeItem.h \
-       SWFGlyphList.h \
-       SWFList.h \
-       SWFShapeMaker.h \
-       SWF.h \
-       $(NULL)
-
-SUBDIRS = \
-       swft \
-       xslt \
-       codegen \
-       $(NULL)
-
-
-CLEANFILES = $(BUILT_SOURCES) $(GENERATED_FILES)

=== modified file 'src/SWFAction.h'
--- src/SWFAction.h     2007-07-16 22:38:46 +0000
+++ src/SWFAction.h     2009-08-24 14:34:34 +0000
@@ -1,7 +1,7 @@
 #ifndef SWF_ACTION_H
 #define SWF_ACTION_H
 
-#include <SWFIdItem.h>
+#include "SWFIdItem.h"
 
 namespace SWF {
        

=== modified file 'src/SWFIdItem.h'
--- src/SWFIdItem.h     2009-06-24 17:53:05 +0000
+++ src/SWFIdItem.h     2009-08-24 14:32:56 +0000
@@ -1,7 +1,7 @@
 #ifndef SWF_IDITEM_H
 #define SWF_IDITEM_H
 
-#include <SWFItem.h>
+#include "SWFItem.h"
 #include <cstring>
 
 namespace SWF {

=== modified file 'src/SWFItem.h'
--- src/SWFItem.h       2007-07-03 23:15:13 +0000
+++ src/SWFItem.h       2009-08-24 14:34:25 +0000
@@ -1,8 +1,8 @@
 #ifndef SWF_ITEM_H
 #define SWF_ITEM_H
 
-#include <SWFReader.h>
-#include <SWFWriter.h>
+#include "SWFReader.h"
+#include "SWFWriter.h"
 #include <libxml/tree.h>
 
 namespace SWF {

=== modified file 'src/SWFTag.h'
--- src/SWFTag.h        2007-07-16 22:38:46 +0000
+++ src/SWFTag.h        2009-08-24 14:31:32 +0000
@@ -1,7 +1,7 @@
 #ifndef SWF_TAG_H
 #define SWF_TAG_H
 
-#include <SWFIdItem.h>
+#include "SWFIdItem.h"
 
 namespace SWF {
        

=== removed file 'src/codegen/Makefile.am'
--- src/codegen/Makefile.am     2009-08-21 00:45:30 +0000
+++ src/codegen/Makefile.am     1970-01-01 00:00:00 +0000
@@ -1,15 +0,0 @@
-NULL = 
-
-EXTRA_DIST = \
-       basic.xsl \
-       basics.xsl \
-       dumper.xsl \
-       header.xsl \
-       mk.xsl \
-       parser.xsl \
-       parsexml.xsl \
-       size.xsl \
-       source.xml \
-       writer.xsl \
-       writexml.xsl \
-       $(NULL)

=== removed file 'src/swft/Makefile.am'
--- src/swft/Makefile.am        2009-06-24 17:04:00 +0000
+++ src/swft/Makefile.am        1970-01-01 00:00:00 +0000
@@ -1,56 +0,0 @@
-# $Header: /home/dan/cvs/swfmill/src/Makefile.am,v 1.15 2005/05/22 16:18:42 
dan Exp $
-
-NULL = 
-MAINTAINERCLEANFILES = Makefile.in
-
-if IS_WINDOWS
-ADDCFLAGS = -DLIBXML_STATIC -DLIBXSLT_STATIC -DLIBEXSLT_STATIC
-ADDLDFLAGS = -all-static
-endif
-if IS_OSX
-#ADDCFLAGS = -DLIBXML_STATIC -DLIBXSLT_STATIC -DLIBEXSLT_STATIC
-#ADDLDFLAGS = -all-static
-endif
-
-lib_LTLIBRARIES = libswft.la
-
-libswft_la_CFLAGS = $(XML_CFLAGS) $(XSLT_CFLAGS) $(FREETYPE_CFLAGS) 
$(PNG_CFLAGS) $(ADDCFLAGS) -I$(top_srcdir)/src -I../
-libswft_la_CXXFLAGS = $(libswft_la_CFLAGS)
-libswft_la_LIBADD = $(XML_LIBS) $(XSLT_LIBS) $(FREETYPE_LIBS) $(PNG_LIBS)
-libswft_la_LDFLAGS = $(ADDLDFLAGS)
-
-libswft_la_SOURCES = \
-       swft.cpp \
-       swft_document.cpp \
-       swft_path.cpp \
-       swft_import.cpp \
-       swft_import_jpeg.cpp \
-       swft_import_png.cpp \
-       swft_import_ttf.cpp \
-       swft_import_mp3.cpp \
-       swft_import_wav.cpp \
-       swft_import_binary.cpp \
-       Parser.cpp \
-       SVGStyle.cpp \
-       SVGGradient.cpp \
-       SVGColor.cpp \
-       SVGPathParser.cpp \
-       SVGPointsParser.cpp \
-       SVGTransformParser.cpp \
-       SVGAttributeParser.cpp \
-       readpng.c \
-       $(NULL)
-
-noinst_HEADERS = \
-       swft.h \
-       Parser.h \
-       SVGStyle.h \
-       SVGGradient.h \
-       SVGColor.h \
-       SVGColors.h \
-       SVGPathParser.h \
-       SVGPointsParser.h \
-       SVGTransformParser.h \
-       SVGAttributeParser.h \
-       readpng.h \
-       $(NULL)

=== removed file 'src/xslt/Makefile.am'
--- src/xslt/Makefile.am        2009-08-12 21:31:40 +0000
+++ src/xslt/Makefile.am        1970-01-01 00:00:00 +0000
@@ -1,52 +0,0 @@
-# $Header: /home/dan/cvs/swfmill/src/Makefile.am,v 1.15 2005/05/22 16:18:42 
dan Exp $
-
-NULL = 
-MAINTAINERCLEANFILES = Makefile.in simple.xsl
-
-ALL_XSLT = \
-       simple-tools.xslt \
-       simple-elements.xslt \
-       simple-import.xslt \
-       simple-deprecated.xslt \
-       simple-svg.xslt \
-       $(NULL)
-       
-EXTRA_DIST = \
-       assemble.xsl \
-       simple.xml \
-       $(ALL_XSLT) \
-       $(NULL)
-
-noinst_HEADERS = \
-       xslt.h \
-       $(NULL)
-
-lib_LTLIBRARIES = libswfmillxslt.la
-
-libswfmillxslt_la_CFLAGS =
-libswfmillxslt_la_CXXFLAGS = $(libswfmillxslt_la_CFLAGS)
-libswfmillxslt_la_LIBADD =
-
-BUILT_SOURCES = \
-       simple.cpp \
-       $(NULL)
-       
-#CLEAN_FILES = $(BUILT_SOURCES)
-
-NAMESPACES = xmlns:swft=\"http:\/\/subsignal.org\/swfml\/swft\" \
-                        xmlns:str=\"http:\/\/exslt.org\/strings\" \
-                        xmlns:math=\"http:\/\/exslt.org\/math\"
-
-SUFFIXES = .cpp .xml
-
-.xml.cpp: assemble.xsl $(ALL_XSLT)
-       xsltproc $(srcdir)/assemble.xsl $< > $(@:.cpp=.xsl) 
-       echo "#include \"xslt.h\"" > $@
-       echo "const char *xslt_$* = " >> $@
-       sed -e "s/namespaces=\\\"hack\\\"/$(NAMESPACES)/" -e "s/\"/\\\\\"/g" -e 
"s/\(.*\)/\"\1\\\\n\"/g" $(@:.cpp=.xsl) >> $@
-       echo ";" >> $@
-
-libswfmillxslt_la_SOURCES = \
-       $(BUILT_SOURCES)
-       $(NULL)
-

=== removed file 'test/Makefile.am'
--- test/Makefile.am    2009-06-24 16:53:33 +0000
+++ test/Makefile.am    1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
-SUBDIRS = xml

=== removed file 'test/xml/Makefile.am'
--- test/xml/Makefile.am        2009-06-24 17:15:37 +0000
+++ test/xml/Makefile.am        1970-01-01 00:00:00 +0000
@@ -1,20 +0,0 @@
-
-
-.PHONY: test run-tests
-
-check-local: test
-
-test: run-tests
-
-EXTRA_DIST = \
-       test-xml \
-       $(NULL)
-
-check_SCRIPTS = \
-       run-xml-tests \
-       $(NULL)
-
-run-tests:
-       sh $(srcdir)/run-xml-tests $(srcdir)
-
-CLEANFILES = *.swf *.xml.swf

=== modified file 'test/xml/run-xml-tests'
--- test/xml/run-xml-tests      2009-06-24 17:19:43 +0000
+++ test/xml/run-xml-tests      2009-08-24 14:52:33 +0000
@@ -1,12 +1,13 @@
 #!/bin/bash
 
-testdir=$1
+swfmill=$1
+testdir=$2
 
 passes=0
 fails=0
 
 for testcase in `ls ${testdir}/*.xml`; do
-       sh ${testdir}/test-xml $testcase
+       sh ${testdir}/test-xml swfmill $testcase
        ret=$?
        if [ ${ret} -eq 0 ]; then
                ((passes++))

=== modified file 'test/xml/test-xml'
--- test/xml/test-xml   2009-06-24 17:19:43 +0000
+++ test/xml/test-xml   2009-08-24 14:49:38 +0000
@@ -1,8 +1,8 @@
 #!/bin/bash
 
-SWFMILL=../../src/swfmill
+SWFMILL=$1
 
-file=$1
+file=$2
 swf=`basename ${file}`.swf
 target=${swf}.xml
 

_______________________________________________
swfmill mailing list
[email protected]
http://osflash.org/mailman/listinfo/swfmill_osflash.org

Reply via email to