[anjuta] build: Unscrew the whole interfaces build process...



commit 3c5e91470c0ee1fefdc135ae5c7948721c9b85f9
Author: Johannes Schmid <jhs gnome org>
Date:   Fri Feb 18 20:00:11 2011 +0100

    build: Unscrew the whole interfaces build process...

 configure.ac                                |    1 +
 libanjuta/Makefile.am                       |   53 ++++------------------
 libanjuta/interfaces/Makefile.am            |   65 +++++++++++++++++++++++++++
 libanjuta/interfaces/anjuta-idl-compiler.pl |   22 ++++++++-
 4 files changed, 94 insertions(+), 47 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 1c3a3d3..1f45d55 100644
--- a/configure.ac
+++ b/configure.ac
@@ -783,6 +783,7 @@ AC_CONFIG_FILES([
 Makefile
 po/Makefile.in
 libanjuta/Makefile
+libanjuta/interfaces/Makefile
 libanjuta/libanjuta-3.0.pc
 libanjuta/anjuta-version.h
 src/Makefile
diff --git a/libanjuta/Makefile.am b/libanjuta/Makefile.am
index 9a7a4ca..642b460 100644
--- a/libanjuta/Makefile.am
+++ b/libanjuta/Makefile.am
@@ -1,4 +1,6 @@
-include interfaces/Makefile.am.iface
+include interfaces/Makefile.am.gir
+
+SUBDIRS = interfaces
 
 AM_CPPFLAGS = \
 	-I$(top_srcdir) \
@@ -18,7 +20,7 @@ AM_CPPFLAGS = \
 lib_LTLIBRARIES = libanjuta-3.la 
 libanjuta_3_la_LDFLAGS = $(ANJUTA_LDFLAGS) 
 libanjuta_3_la_LIBADD = \
-	libanjuta-interfaces.la \
+	interfaces/libanjuta-interfaces.la \
 	$(ANJUTA_LIBS) \
 	$(XML_LIBS) \
 	$(GDL_LIBS)
@@ -123,43 +125,6 @@ libanjuta_3_la_SOURCES= \
 	anjuta-entry.h \
 	anjuta-entry.c
 
-# interfaces
-noinst_LTLIBRARIES = libanjuta-interfaces.la
-libanjuta_interfaces_la_LIBADD = $(ANJUTA_LIBS) $(XML_LIBS)
-
-libanjuta_interfaces_includedir = $(includedir)/libanjuta-3.0/libanjuta/interfaces
-libanjuta_interfaces_include_HEADERS =  $(libanjuta_interfaces_include)
-
-BUILT_SOURCES = iface-built.stamp
-
-iface-built.stamp: interfaces/libanjuta.idl interfaces/anjuta-idl-compiler.pl
-	savedir=`pwd` && \
-	cd $(srcdir) && perl interfaces/anjuta-idl-compiler.pl libanjuta  interfaces/libanjuta.idl && \
-	echo 'GInterface' > hierarchy.txt && grep -e '^[[:space:]|\t]*interface' \
-	interfaces/libanjuta.idl  | sed -e 's/\binterface\b\s*/\t/' | sed -e 's/\t/    /g' \
-	>> hierarchy.txt && \
-	touch iface-built.stamp && \
-	echo "changing to $$savedir" && \
-	cd $$savedir && \
-	make
-
-files_idl = interfaces/libanjuta.idl
-idldir = $(libanjuta_interfaces_includedir)
-idl_HEADERS = $(files_idl)
-
-ianjuta-marshal.h: interfaces/ianjuta-marshal.list
-	$(AM_V_GEN)@GLIB_GENMARSHAL@ \
-	        --prefix=anjuta_cclosure_marshal $(srcdir)/interfaces/ianjuta-marshal.list --header > xgen-gmc \
-	&& cp xgen-gmc $(@F) \
-	&& rm -f xgen-gmc
-
-ianjuta-marshal.c: interfaces/ianjuta-marshal.h interfaces/ianjuta-marshal.list
-	$(AM_V_GEN)echo "#include \"ianjuta-marshal.h\"" > xgenc-gmc \
-	&& @GLIB_GENMARSHAL@ \
-	        --prefix=anjuta_cclosure_marshal $(srcdir)/interfaces/ianjuta-marshal.list --body >> xgenc-gmc \
-	&& cp xgenc-gmc $(@F) \
-	&& rm -f xgenc-gmc
-
 # Glade module
 if HAVE_PLUGIN_GLADE
 
@@ -237,7 +202,7 @@ libanjutainclude_HEADERS = \
 	anjuta-enum-types.h \
 	anjuta-marshal.h
 
-BUILT_SOURCES += anjuta-marshal.c anjuta-marshal.h  anjuta-enum-types.h anjuta-enum-types.c
+BUILT_SOURCES = anjuta-marshal.c anjuta-marshal.h  anjuta-enum-types.h anjuta-enum-types.c
 
 anjuta-marshal.h: anjuta-marshal.list
 	$(AM_V_GEN)@GLIB_GENMARSHAL@ \
@@ -299,7 +264,7 @@ INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
 
 if HAVE_INTROSPECTION
 anjuta_introspection_sources = $(libanjuta_3_la_SOURCES)
-ianjuta_introspection_sources = $(libanjuta_interfaces_la_SOURCES) $(libanjuta_interfaces_include)
+ianjuta_introspection_sources = $(libanjuta_source_files) $(libanjuta_header_files)
 
 Anjuta-3.0.gir: libanjuta-3.la
 Anjuta_3_0_gir_INCLUDES = GObject-2.0 Gtk-3.0
@@ -309,10 +274,10 @@ Anjuta_3_0_gir_FILES = $(anjuta_introspection_sources)
 Anjuta_3_0_gir_SCANNERFLAGS = --c-include=libanjuta/libanjuta.h
 INTROSPECTION_GIRS += Anjuta-3.0.gir
 
-IAnjuta-3.0.gir: libanjuta-interfaces.la libanjuta-3.la Anjuta-3.0.gir
+IAnjuta-3.0.gir: interfaces/libanjuta-interfaces.la libanjuta-3.la Anjuta-3.0.gir
 IAnjuta_3_0_gir_INCLUDES = GObject-2.0 Gtk-3.0 Anjuta-3.0
 IAnjuta_3_0_gir_CFLAGS = $(ANJUTA_CFLAGS) $(XML_CFLAGS) -I$(top_srcdir)
-IAnjuta_3_0_gir_LIBS = libanjuta-interfaces.la libanjuta-3.la
+IAnjuta_3_0_gir_LIBS = interfaces/libanjuta-interfaces.la libanjuta-3.la
 IAnjuta_3_0_gir_FILES = $(ianjuta_introspection_sources)
 IAnjuta_3_0_gir_SCANNERFLAGS = --add-include-path=$(top_srcdir)/libanjuta/ --symbol-prefix=ianjuta --c-include=libanjuta/interfaces/libanjuta-interfaces.h
 INTROSPECTION_GIRS += IAnjuta-3.0.gir
@@ -323,7 +288,7 @@ gir_DATA = $(INTROSPECTION_GIRS)
 typelibdir = $(libdir)/girepository-1.0
 typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
 
-CLEANFILES = $(dist_gir_DATA) $(typelib_DATA) interfaces/libanjuta-interfaces.h
+CLEANFILES = $(dist_gir_DATA) $(typelib_DATA)
 endif
 
 
diff --git a/libanjuta/interfaces/Makefile.am b/libanjuta/interfaces/Makefile.am
new file mode 100644
index 0000000..6ceaab6
--- /dev/null
+++ b/libanjuta/interfaces/Makefile.am
@@ -0,0 +1,65 @@
+include Makefile.am.iface
+
+AM_CPPFLAGS = \
+	-I$(top_srcdir) \
+	-I . \
+	$(WARN_CFLAGS) \
+	$(DEPRECATED_FLAGS) \
+	$(ANJUTA_CFLAGS) \
+	$(XML_CFLAGS) \
+	$(GDL_CFLAGS) \
+	-DDATADIR="\"$(datadir)\"" \
+	-DPACKAGE_PIXMAPS_DIR="\"$(datadir)/pixmaps/$(PACKAGE)\"" \
+	-DPACKAGE_DATA_DIR="\"$(datadir)/$(PACKAGE)\"" \
+	-DPACKAGE_HELP_DIR="\"$(datadir)/gnome/help/$(PACKAGE)\"" \
+	-DPACKAGE_DOC_DIR="\"$(docdir)\"" \
+	-DG_LOG_DOMAIN=\"libanjuta-interfaces\"
+
+# interfaces
+noinst_LTLIBRARIES = libanjuta-interfaces.la
+libanjuta_interfaces_la_LIBADD = $(ANJUTA_LIBS) $(XML_LIBS)
+
+libanjuta_interfaces_includedir = $(includedir)/libanjuta-3.0/libanjuta/interfaces
+libanjuta_interfaces_include_HEADERS =  $(libanjuta_interfaces_include)
+
+BUILT_SOURCES = iface-built.stamp
+
+libanjuta-interfaces.h: iface-built.stamp
+
+iface-built.stamp: libanjuta.idl anjuta-idl-compiler.pl
+	savedir=`pwd` && \
+	cd $(srcdir) && perl anjuta-idl-compiler.pl libanjuta && \
+	echo 'GInterface' > hierarchy.txt && grep -e '^[[:space:]|\t]*interface' \
+	libanjuta.idl  | sed -e 's/\binterface\b\s*/\t/' | sed -e 's/\t/    /g' \
+	>> hierarchy.txt && \
+	touch iface-built.stamp && \
+	echo "changing to $$savedir" && \
+	cd $$savedir && \
+	make
+
+files_idl = libanjuta.idl
+idldir = $(libanjuta_interfaces_includedir)
+idl_HEADERS = $(files_idl)
+
+anjuta-marshal.h: interfaces/anjuta-marshal.list
+	$(AM_V_GEN)@GLIB_GENMARSHAL@ \
+	        --prefix=anjuta_cclosure_marshal $(srcdir)/anjuta-marshal.list --header > xgen-gmc \
+	&& cp xgen-gmc $(@F) \
+	&& rm -f xgen-gmc
+
+anjuta-marshal.c: interfaces/anjuta-marshal.h interfaces/anjuta-marshal.list
+	$(AM_V_GEN)echo "#include \"ianjuta-marshal.h\"" > xgenc-gmc \
+	&& @GLIB_GENMARSHAL@ \
+	        --prefix=anjuta_cclosure_marshal $(srcdir)anjuta-marshal.list --body >> xgenc-gmc \
+	&& cp xgenc-gmc $(@F) \
+	&& rm -f xgenc-gmc
+
+EXTRA_DIST = \
+	iface-built.stamp \
+	$(libanjuta_interfaces_include) \
+	$(files_idl) \
+	Makefile.am.iface \
+	anjuta-idl-compiler.pl
+
+
+CLEANFILES = libanjuta-interfaces.h
\ No newline at end of file
diff --git a/libanjuta/interfaces/anjuta-idl-compiler.pl b/libanjuta/interfaces/anjuta-idl-compiler.pl
index 12c2514..0499e24 100755
--- a/libanjuta/interfaces/anjuta-idl-compiler.pl
+++ b/libanjuta/interfaces/anjuta-idl-compiler.pl
@@ -19,9 +19,9 @@
 use strict;
 use Data::Dumper;
 
-if (@ARGV != 2)
+if (@ARGV != 1)
 {
-	die "Usage: perl anjuta-idl-compiler.pl module_name idl_file";
+	die "Usage: perl anjuta-idl-compiler.pl module_name";
 }
 
 ## Types starting with prefix mentioned in
@@ -146,7 +146,7 @@ my $type_map = {
 };
 
 my $module_name = $ARGV[0];
-my $idl_file = $ARGV[1];
+my $idl_file = "$module_name.idl";
 open (INFILE, "<$idl_file")
 	or die "Can not open IDL file for reading";
 
@@ -1551,9 +1551,25 @@ sub write_makefile
     
     my $iface_rules .= "${module_name}_interfaces_la_SOURCES = $iface_sources\n";
     $iface_rules .= "${module_name}_interfaces_include = $iface_headers\n\n";
+
+    my $gir_headers = "";
+    foreach my $h (@header_files)
+    {
+	$gir_headers .= "\\\n\tinterfaces/$h";
+    }
+    my $gir_sources = "";
+    foreach my $s (@source_files)
+    {
+	$gir_sources .= "\\\n\tinterfaces/$s";
+    }
     
+    my $gir_rules .= "${module_name}_source_files = $gir_sources\n";
+    $gir_rules .= "${module_name}_header_files = $gir_headers\n\n";
+
     my $filename = "Makefile.am.iface";
 	write_file ($filename, $iface_rules);
+	my $gir_filename = "Makefile.am.gir";
+	write_file ($gir_filename, $gir_rules);	
 }
 
 sub write_file



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