[cogl/wip/sparse: 5/5] Autotoolize the deps/sparse Makefile



commit 91052df7dc84177274abc134cbaf97cd0de862c3
Author: Robert Bragg <robert linux intel com>
Date:   Tue Apr 10 11:03:00 2012 +0100

    Autotoolize the deps/sparse Makefile
    
    Since we have imported an internal snapshot of sparse under deps/sparse
    this patch hooks it into the Cogl build scripts by converting the gnu
    makefile to use automake instead.
    
    We currently just build the c2xml and dump-gtk-doc tools.

 Makefile.am             |    2 +-
 configure.ac            |   19 ++++++++++-
 deps/Makefile.am        |    3 ++
 deps/sparse/Makefile.am |   81 +++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 103 insertions(+), 2 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 845f332..bae1f87 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = cogl tests
+SUBDIRS = deps cogl tests
 
 if BUILD_COGL_PANGO
 SUBDIRS += cogl-pango
diff --git a/configure.ac b/configure.ac
index c7bf9a9..fcaf202 100644
--- a/configure.ac
+++ b/configure.ac
@@ -925,6 +925,7 @@ AM_CONDITIONAL(X11_TESTS, [test "x$SUPPORT_X11" = "xyes"])
 AM_CONDITIONAL(SUPPORT_X11, [test "x$SUPPORT_X11" = "xyes"])
 AM_CONDITIONAL(SUPPORT_XLIB, [test "x$SUPPORT_XLIB" = "xyes"])
 
+NEED_SPARSE=no
 dnl     ============================================================
 dnl     Check for v8 JavaScript bindings support
 dnl     ============================================================
@@ -940,11 +941,25 @@ AS_IF([test "x$enable_v8_bindings" == "xyes"],
       [
         AX_LIB_V8(3.3.10)
         AS_IF([test "$V8_CPPFLAGS" != ""],
-              [SUPPORT_V8_BINDINGS=yes])
+              [
+                SUPPORT_V8_BINDINGS=yes
+                NEED_SPARSE=yes
+              ])
       ])
 AM_CONDITIONAL(SUPPORT_V8_BINDINGS, [test "x$SUPPORT_V8_BINDINGS" == "xyes"])
 
 
+dnl     ============================================================
+dnl     Check if internal deps/sparse project should be built
+dnl     ============================================================
+AS_IF([test "x$NEED_SPARSE" == "xyes"],
+      [
+        PKG_CHECK_MODULES(LIBXML, [libxml-2.0], [],
+                          [AC_MSG_ERROR([Can not find libxml-2.0 required at build time for deps/sparse/c2xml for bindings and documentation])])
+      ])
+AM_CONDITIONAL(BUILD_SPARSE, [test "x$NEED_SPARSE" == "xyes"])
+
+
 dnl ================================================================
 dnl Compiler stuff.
 dnl ================================================================
@@ -1135,6 +1150,8 @@ build/Makefile
 build/win32/Makefile
 build/win32/vs9/Makefile
 build/win32/vs10/Makefile
+deps/Makefile
+deps/sparse/Makefile
 cogl/Makefile
 cogl/cogl-1.0.pc
 cogl/cogl-2.0-experimental.pc
diff --git a/deps/Makefile.am b/deps/Makefile.am
new file mode 100644
index 0000000..6423545
--- /dev/null
+++ b/deps/Makefile.am
@@ -0,0 +1,3 @@
+if BUILD_SPARSE
+SUBDIRS = sparse
+endif
diff --git a/deps/sparse/Makefile.am b/deps/sparse/Makefile.am
new file mode 100644
index 0000000..3153484
--- /dev/null
+++ b/deps/sparse/Makefile.am
@@ -0,0 +1,81 @@
+include $(top_srcdir)/build/autotools/Makefile.am.silent
+
+# preamble
+
+NULL =
+
+GCC_BASE = $(shell $(CC) --print-file-name=)
+AM_CFLAGS = -DGCC_BASE=\"$(GCC_BASE)\"
+
+noinst_LIBRARIES = libsparse.a
+
+libsparse_a_SOURCES = \
+	token.h \
+	parse.h \
+	lib.h \
+	symbol.h \
+	scope.h \
+	expression.h \
+	target.h \
+	linearize.h \
+	bitmap.h \
+	ident-list.h \
+	compat.h \
+	flow.h \
+	allocate.h \
+	storage.h \
+	ptrlist.h \
+	dissect.h \
+	target.c \
+	parse.c \
+	tokenize.c \
+	pre-process.c \
+	symbol.c \
+	lib.c \
+	scope.c \
+	expression.c \
+	show-parse.c \
+	evaluate.c \
+	expand.c \
+	inline.c \
+	linearize.c \
+	sort.c \
+	allocate.c \
+	compat-linux.c \
+	ptrlist.c \
+	flow.c \
+	cse.c \
+	simplify.c \
+	memops.c \
+	liveness.c \
+	storage.c \
+	unssa.c \
+	dissect.c \
+	$(NULL)
+
+noinst_PROGRAMS = dump-gtk-doc c2xml
+
+dump_gtk_doc_SOURCES=dump-gtk-doc.c
+dump_gtk_doc_LDADD=libsparse.la
+
+c2xml_SOURCES=c2xml.c
+c2xml_LDADD=libsparse.la
+c2xml_CFLAGS=$(LIBXML_CFLAGS)
+c2xml_LDFLAGS=$(LIBXML_LIBS)
+
+#compile_EXTRA_DEPS = compile-i386.o
+#
+#compat-linux.o: compat/strtold.c compat/mmap-blob.c $(LIB_H)
+#
+#clean: clean-check
+#	rm -f *.[oa] .*.d *.so $(PROGRAMS) $(SLIB_FILE) pre-process.h sparse.pc
+#
+#dist:
+#	@if test "`git describe`" != "v$(VERSION)" ; then \
+#		echo 'Update VERSION in the Makefile before running "make dist".' ; \
+#		exit 1 ; \
+#	fi
+#	git archive --format=tar --prefix=sparse-$(VERSION)/ HEAD^{tree} | gzip -9 > sparse-$(VERSION).tar.gz
+#
+#check: all
+#	$(Q)cd validation && ./test-suite



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]