[hyena] Revamp build system to be compatible with Banshee's



commit 116c6d9cb998ff803bab0a3387173b4332931673
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Tue May 25 15:31:05 2010 -0700

    Revamp build system to be compatible with Banshee's
    
    Can now include hyena as a submodule in Banshee, integrated into its
    build system.

 Makefile.am                                      |   42 +++--
 autogen.sh                                       |    2 +-
 build/AddinXmlStringExtractor.cs                 |   47 ++++
 build/DllMapVerifier.cs                          |  258 ++++++++++++++++++++++
 build/GConfSchemaExtractor.cs                    |  162 ++++++++++++++
 build/GObjectIntPtrCtorVerifier.cs               |   39 ++++
 build/Makefile.am                                |   49 ++++
 build/TranslatorExtractor.cs                     |  125 +++++++++++
 build/build.environment.mk                       |   13 +
 build/build.mk                                   |    3 +
 build/build.rules.mk                             |   91 ++++++++
 build/dll-map-makefile-verifier                  |   10 +
 build/gconf-schema-rules                         |   18 ++
 build/icon-theme-installer                       |  177 +++++++++++++++
 build/m4/Makefile.am                             |    4 +
 expansions.m4 => build/m4/shamrock/expansions.m4 |    0
 build/m4/shamrock/i18n.m4                        |   10 +
 build/m4/shamrock/mono.m4                        |   65 ++++++
 build/m4/shamrock/monodoc.m4                     |   25 ++
 build/m4/shamrock/nunit.m4                       |   29 +++
 build/m4/shamrock/programs.m4                    |   15 ++
 build/m4/shamrock/util.m4                        |   11 +
 build/private-icon-theme-installer               |   23 ++
 configure.ac                                     |   31 ++-
 src/Hyena.Data.Sqlite/Makefile.am                |  115 +---------
 src/Hyena.Gui/Makefile.am                        |  120 +---------
 src/Hyena/Makefile.am                            |   97 +--------
 src/Mono.Data.Sqlite/Makefile.am                 |   81 +-------
 28 files changed, 1252 insertions(+), 410 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index e8500a2..361bdae 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,18 +1,13 @@
 
-EXTRA_DIST = \
-	expansions.m4 \
-	src/Hyena.Gui/Hyena.Gui.dll.config
+SUBDIRS =  \
+    build \
+    src/Hyena \
+	src/Mono.Data.Sqlite \
+	src/Hyena.Data.Sqlite \
+	src/Hyena.Gui
 
-#Warning: This is an automatically generated file, do not edit!
-if ENABLE_DEBUG
- SUBDIRS =  src/Hyena src/Mono.Data.Sqlite src/Hyena.Data.Sqlite src/Hyena.Gui
-endif
-if ENABLE_RELEASE
- SUBDIRS =  src/Hyena src/Mono.Data.Sqlite src/Hyena.Data.Sqlite src/Hyena.Gui
-endif
-if ENABLE_WINDOWS
- SUBDIRS =  src/Hyena src/Mono.Data.Sqlite src/Hyena.Data.Sqlite src/Hyena.Gui
-endif
+clean-local:
+	rm -rf $(top_builddir)/bin
 
 if ENABLE_TESTS
 TEST_ASSEMBLIES = \
@@ -21,7 +16,8 @@ TEST_ASSEMBLIES = \
 	Hyena.Gui.dll
 
 ENV_OPTIONS = TZ=America/Chicago LC_ALL=it_IT LANG=it_IT
-RUNNER = for asm in $${TEST_ASSEMBLIES}; do echo -e "\033[1mRunning tests on $${asm}...\033[0m"; $(ENV_OPTIONS) nunit-console2 -nologo -noshadow $$asm; done
+NUNIT_CONSOLE = $$(echo $$(which nunit-console2 || which nunit-console))
+RUNNER = for asm in $${TEST_ASSEMBLIES}; do echo -e "\033[1mRunning tests on $${asm}...\033[0m"; $(ENV_OPTIONS) $(NUNIT_CONSOLE) -nologo -noshadow $$asm; done
 
 test:
 	@pushd bin &>/dev/null; \
@@ -31,3 +27,21 @@ else
 test:
 	echo "Tests not enabled.  Pass --enable-tests to configure or ./autogen.sh"
 endif
+
+MAINTAINERCLEANFILES = \
+	compile \
+	INSTALL \
+	config.h.in \
+	aclocal.m4 \
+	ltmain.sh \
+	Makefile.in \
+	depcomp \
+	missing \
+	install-sh \
+	configure \
+	config.sub \
+	config.guess \
+	intltool-extract.in \
+	intltool-merge.in   \
+	intltool-update.in  \
+	mkinstalldirs
diff --git a/autogen.sh b/autogen.sh
index a777c64..27e2942 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -17,7 +17,7 @@ test -z "$srcdir" && srcdir=.
 ORIGDIR=`pwd`
 cd $srcdir
 TEST_TYPE=-f
-aclocalinclude="-I . $ACLOCAL_FLAGS"
+aclocalinclude="-I build/m4/shamrock $ACLOCAL_FLAGS"
 
 DIE=0
 
diff --git a/build/AddinXmlStringExtractor.cs b/build/AddinXmlStringExtractor.cs
new file mode 100644
index 0000000..d10a8ac
--- /dev/null
+++ b/build/AddinXmlStringExtractor.cs
@@ -0,0 +1,47 @@
+using System;
+using System.Xml.XPath;
+using System.Collections.Generic;
+
+public static class AddinXmlStringExtract
+{
+    public static void Main (string [] args)
+    {
+        var queries = new [] {
+            "/Addin/@name",
+            "/Addin/@description",
+            "/Addin/@category"
+        };
+
+        Console.WriteLine (@"// Generated - Do Not Edit!
+
+internal static class AddinXmlStringCatalog
+{
+    private static void Strings ()
+    {");
+
+        var paths = new List<string> (args);
+        paths.Sort ();
+
+        foreach (var path in paths) {
+            Console.WriteLine ("        // {0}", path);
+            var xpath = new XPathDocument (path);
+            var nav = xpath.CreateNavigator ();
+            foreach (var query in queries) {
+                var iter = nav.Select (query);
+                while (iter.MoveNext ()) {
+                    var value = iter.Current.Value.Trim ();
+                    if (String.IsNullOrEmpty (value) ||
+                        value[0] == '@' ||
+                        (iter.Current.Name == "category" && value.StartsWith ("required:"))) {
+                        continue;
+                    }
+                    Console.WriteLine (@"        Catalog.GetString (@""{0}"");",
+                        value.Replace (@"""", @""""""));
+                }
+            }
+            Console.WriteLine ();
+        }
+
+        Console.WriteLine ("    }\n}");
+    }
+}
diff --git a/build/DllMapVerifier.cs b/build/DllMapVerifier.cs
new file mode 100644
index 0000000..9acccb6
--- /dev/null
+++ b/build/DllMapVerifier.cs
@@ -0,0 +1,258 @@
+using System;
+using System.IO;
+using System.Xml;
+using System.Text;
+using System.Collections.Generic;
+
+public static class DllMapVerifier
+{
+    private struct DllImportRef
+    {
+        public DllImportRef (string name, int line, int column)
+        {
+            Name = name;
+            Line = line;
+            Column = column;
+        }
+
+        public string Name;
+        public int Line;
+        public int Column;
+    }
+
+    private static Dictionary<string, List<DllImportRef>> dll_imports 
+        = new Dictionary<string, List<DllImportRef>> ();
+    private static List<string> ignore_dlls = new List<string> ();
+    private static List<string> config_dlls = null;
+    
+    public static int Main (string [] args)
+    {
+        LoadConfigDlls (args[0]);
+        foreach (string file in args) {
+            LoadDllImports (file);
+        }
+
+        return VerifyDllImports (args[0]) ? 0 : 1;
+    }
+
+    private static bool VerifyDllImports (string configFile)
+    {
+        int total_unmapped_count = 0;
+
+        foreach (KeyValuePair<string, List<DllImportRef>> dll_import in dll_imports) {
+            int file_unmapped_count = 0;
+            foreach (DllImportRef dll_import_ref in dll_import.Value) {
+                if (config_dlls != null && config_dlls.Contains (dll_import_ref.Name)) {
+                    continue;
+                }
+
+                if (file_unmapped_count++ == 0) {
+                    Console.Error.WriteLine ("Unmapped DLLs in file: {0}", dll_import.Key);
+                }
+
+                Console.Error.WriteLine ("  + {0} : {1},{2}", dll_import_ref.Name, 
+                    dll_import_ref.Line, dll_import_ref.Column);
+            }
+
+            total_unmapped_count += file_unmapped_count;
+        }
+
+        if (total_unmapped_count > 0) {
+            Console.Error.WriteLine ();
+            Console.Error.WriteLine ("  If any DllImport above is explicitly allowed to be unmapped,");
+            Console.Error.WriteLine ("  add an 'willfully unmapped' comment to the inside of the attribute:");
+            Console.Error.WriteLine ();
+            Console.Error.WriteLine ("      [DllImport (\"libX11.so.6\") /* willfully unmapped */]");
+            Console.Error.WriteLine ();
+        }
+
+        if (total_unmapped_count > 0 && config_dlls == null) {
+            Console.Error.WriteLine ("No config file for DLL mapping was found ({0})", configFile);
+        }
+
+        return total_unmapped_count == 0;
+    }
+    
+    private static void LoadDllImports (string csFile)
+    {
+        if (csFile.StartsWith ("-i")) {
+            ignore_dlls.Add (csFile.Substring (2));
+            return;
+        }
+
+        if (Path.GetExtension (csFile) == ".cs" && File.Exists (csFile)) {
+            List<DllImportRef> dll_import_refs = null;
+
+            foreach (DllImportRef dll_import in ParseFileForDllImports (csFile)) {
+                if (ignore_dlls.Contains (dll_import.Name)) {
+                    continue;
+                }
+            
+                if (dll_import_refs == null) {
+                    dll_import_refs = new List<DllImportRef> ();
+                }
+
+                dll_import_refs.Add (dll_import);
+            }
+
+            if (dll_import_refs != null) {
+                dll_imports.Add (csFile, dll_import_refs);
+            }
+        }
+    }
+
+    private static void LoadConfigDlls (string configFile)
+    {
+        try {
+            XmlTextReader config = new XmlTextReader (configFile);
+            config_dlls = new List<string> ();
+            while (config.Read ()) {
+                if (config.NodeType == XmlNodeType.Element && 
+                    config.Name == "dllmap") {
+                    string dll = config.GetAttribute ("dll");
+                    if (!config_dlls.Contains (dll)) {
+                        config_dlls.Add (dll);
+                    }
+                }
+            }
+        } catch {
+        }
+    }
+    
+#region DllImport parser
+
+    private static StreamReader reader;
+    private static int reader_line;
+    private static int reader_col;
+    
+    private static IEnumerable<DllImportRef> ParseFileForDllImports (string file)
+    {
+        reader_line = 1;
+        reader_col = 1;
+
+        using (reader = new StreamReader (file)) {
+            char c;
+            bool in_paren = false;
+            bool in_attr = false;
+            bool in_dll_attr = false;
+            bool in_string = false;
+            bool in_comment = false;
+            int dll_line = 1, dll_col = 1;
+            string dll_string = null;
+            string dll_comment = null;
+            
+            while ((c = (char)reader.Peek ()) != Char.MaxValue) {
+                switch (c) {
+                    case ' ':
+                    case '\t': Read (); break;
+                    case '[': 
+                        in_attr = true;
+                        dll_string = null;
+                        dll_comment = null;
+                        dll_line = reader_line;
+                        dll_col = reader_col;
+                        Read ();
+                        break;
+                    case '(': Read (); in_paren = true; break;
+                    case ')': Read (); in_paren = false; break;
+                    case '"':
+                        Read ();
+                        if (dll_string == null && in_dll_attr && in_paren && !in_string) {
+                            in_string = true;
+                        }
+                        break;
+                    case '/':
+                        Read ();
+                        if ((char)reader.Peek () == '*') {
+                            Read ();
+                            if (in_dll_attr && !in_comment) {
+                                in_comment = true;
+                            }
+                        }
+                        break;
+                    case ']':
+                        if (in_dll_attr && dll_string != null && dll_comment != "willfully unmapped") {
+                            yield return new DllImportRef (dll_string, dll_line, dll_col);
+                        }
+                        in_attr = false;
+                        in_dll_attr = false;
+                        Read ();
+                        break;
+                    default:
+                        if (!in_dll_attr && in_attr && ReadDllAttribute ()) {
+                            in_dll_attr = true;
+                        } else if (in_dll_attr && in_string) {
+                            dll_string = ReadDllString ();
+                            in_string = false;
+                        } else if (in_dll_attr && in_comment) {
+                            dll_comment = ReadDllComment ();
+                            in_comment = false;
+                        } else {
+                            Read ();
+                        }
+                        break;
+                }
+            }
+        }
+    }
+
+    private static bool ReadDllAttribute () 
+    {
+        return
+            Read () == 'D' && 
+            Read () == 'l' &&
+            Read () == 'l' &&
+            Read () == 'I' &&
+            Read () == 'm' &&
+            Read () == 'p' &&
+            Read () == 'o' &&
+            Read () == 'r' &&
+            Read () == 't';
+    }
+
+    private static string ReadDllString ()
+    {
+        StringBuilder builder = new StringBuilder (32);
+        while (true) {
+            char c = Read ();
+            if (Char.IsLetterOrDigit (c) || c == '.' || c == '-' || c == '_') {
+                builder.Append (c);
+            } else {
+                break;
+            }
+        }
+        return builder.ToString ();
+    }
+
+    private static string ReadDllComment ()
+    {
+        StringBuilder builder = new StringBuilder ();
+        char lc = Char.MaxValue;
+        while (true) {
+            char c = Read ();
+            if (c == Char.MaxValue || (c == '/' && lc == '*')) {
+                break;
+            } else if (lc != Char.MaxValue) {
+                builder.Append (lc);
+            }
+            lc = c;
+        }
+        return builder.ToString ().Trim ();
+    }
+    
+    private static char Read ()
+    {
+        char c = (char)reader.Read ();
+        if (c == '\n') {
+            reader_line++;
+            reader_col = 1;
+        } else {
+            reader_col++;
+        }
+        return c;
+    }
+    
+#endregion
+
+}
+
diff --git a/build/GConfSchemaExtractor.cs b/build/GConfSchemaExtractor.cs
new file mode 100644
index 0000000..7eafee1
--- /dev/null
+++ b/build/GConfSchemaExtractor.cs
@@ -0,0 +1,162 @@
+using System;
+using System.IO;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Collections.Generic;
+using System.Reflection;
+
+public class GConfSchemaExtractor
+{
+	private static Dictionary<string, StringBuilder> entries = 
+		new Dictionary<string, StringBuilder>();
+    private static int schema_count = 0;
+
+    public static void Main(string [] args)
+    {
+        Assembly asm = Assembly.LoadFrom(args[0]);
+        foreach(Type type in asm.GetTypes()) {
+            foreach(FieldInfo field in type.GetFields()) {
+                if(field.FieldType.IsGenericType && 
+                    field.FieldType.GetGenericTypeDefinition().Name.StartsWith("SchemaEntry")) {
+                    
+                    if(field.Name == "Zero") {
+                        continue;
+                    }
+
+                    object schema = field.GetValue(null);
+                
+                    AddSchemaEntry(schema.GetType().GetField("DefaultValue").GetValue(schema),
+                        GetString(schema, "Namespace"),
+                        GetString(schema, "Key"),
+                        GetString(schema, "ShortDescription"),
+                        GetString(schema, "LongDescription")
+                    );
+                }
+            }
+        }
+
+        if(schema_count > 0) {
+            StringBuilder final = new StringBuilder();
+            final.Append("<?xml version=\"1.0\"?>\n");
+            final.Append("<gconfschemafile>\n");
+            final.Append("  <schemalist>\n");
+
+			List<string> keys = new List<string>(entries.Keys);
+			keys.Sort();
+
+			foreach(string key in keys) {
+				final.Append(entries[key]);
+			}
+			
+            final.Append("  </schemalist>\n");
+            final.Append("</gconfschemafile>\n");
+
+            using(StreamWriter writer = new StreamWriter(args[1])) {
+                writer.Write(final.ToString());
+            }
+        }
+    }
+
+    private static string GetString(object o, string name)
+    {
+        FieldInfo field = o.GetType().GetField(name);
+        return (string)field.GetValue(o);
+    }
+
+    private static string GetValueString(Type type, object o, out string gctype)
+    {
+        if(type == typeof(bool)) {
+            gctype = "bool";
+            return o == null ? null : o.ToString().ToLower();
+        } else if(type == typeof(int)) {
+            gctype = "int";
+        } else if(type == typeof(float) || type == typeof(double)) {
+            gctype = "float";
+        } else if(type == typeof(string)) {
+            gctype = "string";
+        } else {
+            throw new Exception("Unsupported type '" + type + "'");
+        }
+        
+        return o == null ? null : o.ToString();
+    }
+
+    private static void AddSchemaEntry(object value, string namespce, string key, 
+        string short_desc, string long_desc)
+    {
+        schema_count++;
+        
+        string full_key = CreateKey(namespce, key);
+        
+        bool list = value.GetType().IsArray;
+        Type type = list ? Type.GetTypeArray((object [])value)[0] : value.GetType();
+        string str_val = null;
+        string str_type = null;
+        
+        if(list) {
+            if(value == null || ((object [])value).Length == 0) {
+                GetValueString(type, null, out str_type);
+                str_val = "[]";
+            } else {
+                str_val = "[";
+                object [] arr = (object [])value;
+                for(int i = 0; i < arr.Length; i++) {
+                    str_val += GetValueString(type, arr[i], out str_type).Replace(",", "\\,");
+                    if(i < arr.Length - 1) {
+                        str_val += ",";
+                    }
+                }
+                str_val += "]";
+            }
+        } else {
+            str_val = GetValueString(type, value, out str_type);
+        }
+ 
+ 		StringBuilder builder = new StringBuilder();
+        builder.AppendFormat("    <schema>\n");
+        builder.AppendFormat("      <key>/schemas{0}</key>\n", full_key);
+        builder.AppendFormat("      <applyto>{0}</applyto>\n", full_key);
+        builder.AppendFormat("      <owner>banshee</owner>\n");
+        if(!list) {
+            builder.AppendFormat("      <type>{0}</type>\n", str_type);
+        } else {
+            builder.AppendFormat("      <type>list</type>\n");
+            builder.AppendFormat("      <list_type>{0}</list_type>\n", str_type);
+        }
+        builder.AppendFormat("      <default>{0}</default>\n", str_val);
+        builder.AppendFormat("      <locale name=\"C\">\n");
+        builder.AppendFormat("        <short>{0}</short>\n", short_desc);
+        builder.AppendFormat("        <long>{0}</long>\n", long_desc);
+        builder.AppendFormat("      </locale>\n");
+        builder.AppendFormat("    </schema>\n");
+		entries.Add(full_key, builder);
+    }
+        
+    private static string CamelCaseToUnderCase(string s)
+    {
+        string undercase = String.Empty;
+        string [] tokens = Regex.Split(s, "([A-Z]{1}[a-z]+)");
+        
+        for(int i = 0; i < tokens.Length; i++) {
+            if(tokens[i] == String.Empty) {
+                continue;
+            }
+
+            undercase += tokens[i].ToLower();
+            if(i < tokens.Length - 2) {
+                undercase += "_";
+            }
+        }
+        
+        return undercase;
+    }
+
+    private static string CreateKey(string namespce, string key)
+    {
+        return namespce == null 
+            ? "/apps/banshee/" + CamelCaseToUnderCase(key)
+            : "/apps/banshee/" + CamelCaseToUnderCase(namespce.Replace(".", "/")) 
+                + "/" + CamelCaseToUnderCase(key);
+    } 
+}
+
diff --git a/build/GObjectIntPtrCtorVerifier.cs b/build/GObjectIntPtrCtorVerifier.cs
new file mode 100644
index 0000000..3c3ba9c
--- /dev/null
+++ b/build/GObjectIntPtrCtorVerifier.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Reflection;
+
+public static class GObjectIntPtrCtorVerifier
+{
+    public static void Main (string [] args)
+    {
+        foreach (var path in args) {
+            Verify (path);
+        }
+    }
+
+    private static void Verify (string path)
+    {
+        foreach (var type in Assembly.LoadFrom (path).GetTypes ()) {
+            if (!type.IsSubclassOf (typeof (GLib.Object))) {
+                continue;
+            }
+
+            bool safe = false;
+
+            foreach (var ctor in type.GetConstructors (BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)) {
+                var args = ctor.GetParameters ();
+                if ((safe = (ctor.Attributes & (MethodAttributes.Public |
+                    MethodAttributes.Family)) != 0 &&
+                    args != null &&
+                    args.Length == 1 &&
+                    args[0].ParameterType == typeof (IntPtr))) {
+                    break;
+                }
+            }
+
+            if (!safe) {
+                Console.WriteLine (type);
+            }
+        }
+    }
+}
+
diff --git a/build/Makefile.am b/build/Makefile.am
new file mode 100644
index 0000000..973ddf9
--- /dev/null
+++ b/build/Makefile.am
@@ -0,0 +1,49 @@
+SUBDIRS = m4
+
+GCONF_SCHEMA_EXTRACTOR_ASSEMBLY = gconf-schema-extractor.exe
+TRANSLATOR_EXTRACTOR_ASSEMBLY = translator-extractor.exe
+DLL_MAP_VERIFIER_ASSEMBLY = dll-map-verifier.exe
+ADDIN_XML_STRING_EXTRACTOR_ASSEMBLY = addin-xml-string-extractor.exe
+GOBJECT_INTPTR_CTOR_VERIFIER_ASSEMBLY = gobject-intptr-ctor-verifier.exe
+
+ALL_TARGETS = $(TRANSLATOR_EXTRACTOR_ASSEMBLY) $(DLL_MAP_VERIFIER_ASSEMBLY) $(ADDIN_XML_STRING_EXTRACTOR_ASSEMBLY) $(GOBJECT_INTPTR_CTOR_VERIFIER_ASSEMBLY)
+
+if GCONF_SCHEMAS_INSTALL
+bansheedir = $(pkglibdir)
+banshee_SCRIPTS = $(GCONF_SCHEMA_EXTRACTOR_ASSEMBLY)
+ALL_TARGETS += $(GCONF_SCHEMA_EXTRACTOR_ASSEMBLY)
+$(GCONF_SCHEMA_EXTRACTOR_ASSEMBLY): GConfSchemaExtractor.cs
+	$(MCS) -out:$@ $<
+endif
+
+all: $(ALL_TARGETS)
+
+dnl $(TRANSLATOR_EXTRACTOR_ASSEMBLY): TranslatorExtractor.cs
+dnl	if [ "x$(top_srcdir)" = "x$(top_builddir)" ]; then \
+dnl		$(MCS) -out:$@ $< && LC_ALL=en_US.UTF-8 $(MONO) $@ $(top_builddir)/po > \
+dnl			$(top_srcdir)/src/Core/Banshee.Core/Resources/translators.xml; \
+dnl	fi;
+
+$(DLL_MAP_VERIFIER_ASSEMBLY): DllMapVerifier.cs
+	$(MCS) -out:$@ $<
+
+$(ADDIN_XML_STRING_EXTRACTOR_ASSEMBLY): AddinXmlStringExtractor.cs
+	$(MCS) -r:System.Xml -out:$@ $<
+
+$(GOBJECT_INTPTR_CTOR_VERIFIER_ASSEMBLY): GObjectIntPtrCtorVerifier.cs
+	$(MCS) $(GLIBSHARP_LIBS) -out:$@ $<
+
+EXTRA_DIST = \
+	icon-theme-installer \
+	private-icon-theme-installer \
+	GConfSchemaExtractor.cs \
+	TranslatorExtractor.cs \
+	DllMapVerifier.cs \
+	AddinXmlStringExtractor.cs \
+	GObjectIntPtrCtorVerifier.cs \
+	dll-map-makefile-verifier \
+	gconf-schema-rules
+
+CLEANFILES = *.exe *.mdb
+MAINTAINERCLEANFILES = Makefile.in
+
diff --git a/build/TranslatorExtractor.cs b/build/TranslatorExtractor.cs
new file mode 100644
index 0000000..205cf0c
--- /dev/null
+++ b/build/TranslatorExtractor.cs
@@ -0,0 +1,125 @@
+//
+// Licensed under same license as Banshee
+// Copyright (C) 2006 Novell, Inc.
+// Written by Aaron Bockover <abock gnome org>
+//
+// This tool extracts translator information from .po files
+// to generate information for display in the about dialog
+//
+
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text.RegularExpressions;
+
+public class TranslatorExtractor
+{
+    public static void Main(string [] args)
+    {
+        Console.WriteLine("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); 
+        Console.WriteLine("<!-- AUTOGENERATED - DO NOT EDIT -->");
+        Console.WriteLine("<translators>");
+        foreach(string filename in Directory.GetFiles(args.Length == 0 ? "." : args[0], "*.po")) {
+            using(FileStream stream = new FileStream(filename, FileMode.Open, FileAccess.Read)) {
+                using(StreamReader reader = new StreamReader(stream)) {
+                    ParseFile(filename, reader);
+                }
+            }
+        }
+        Console.WriteLine("</translators>");
+    }
+
+    private static void ParseFile(string file, TextReader reader)
+    {
+        Dictionary<string, string> names = new Dictionary<string, string>();
+        string language_code = Path.GetFileNameWithoutExtension(file);
+        string language_name = null;
+    
+        bool past_plural_forms = false;
+    
+        while(true) {
+            string line = reader.ReadLine();
+            if(line == null || (line.StartsWith("#:") && past_plural_forms)) {
+                break;
+            } else if(line.StartsWith("\"Plural-Forms:")) {
+                past_plural_forms = true;
+            }
+            
+            try {
+                Match match = Regex.Match(line, ".*#(.*)<(.*)>(.*,.*|[ \n]*$)");
+                if(!match.Success) {
+                    match = Regex.Match(line, ".*\\\"Last-Translator:(.*)<(.*)>.*");
+                    if(!match.Success) {
+                        match = Regex.Match(line, ".*\\\"Language-Team:(.*)<.*>.*");
+                        if(!match.Success) {
+                            continue;
+                        }
+
+                        language_name = match.Groups[1].Value.Trim();
+                        int pos = language_name.IndexOf('(');
+                        if(pos > 0) {
+                            language_name = language_name.Substring(0, pos).Trim();
+                        }
+                        
+                        pos = language_name.IndexOf("GNOME");
+                        if(pos > 0) {
+                            language_name = language_name.Substring(0, pos).Trim();
+                        }
+                    }
+                }
+                
+                string name = match.Groups[1].Value.Trim();
+                string email = match.Groups[2].Value.Trim();
+            
+                if(name == String.Empty || email == String.Empty || name == "FIRST AUTHOR") {
+                    continue;
+                } else if(name.StartsWith("Maintainer:")) {
+                    name = name.Substring(11).Trim();
+                }
+
+                if(!names.ContainsKey(email)) {
+                    bool skip = false;
+                    
+                    foreach(string iter_name in names.Values) {
+                        if(String.Compare(iter_name, name, true) == 0) {
+                            skip = true;
+                            break;
+                        }
+                    }
+                    
+                    if(!skip) {
+                        names.Add(email, name);
+                    }
+                }
+            } catch {
+                continue;
+            }
+        }
+
+        // hack for banshee, remove if used elsewhere
+        if(language_code == "sr") {
+            return;
+        } else if(language_code == "sr latin") {
+            language_code = "sr";
+        }
+        // end special
+
+        // override language names from extracted
+        switch(language_code) {
+            case "ca": language_name = "Catalan"; break;
+            case "zh_CN": language_name = "Simplified Chinese"; break;
+            case "es": language_name = "Spanish"; break;
+            case "fr": language_name = "French"; break;
+            default: break;
+        }
+        
+        Console.WriteLine("  <language code=\"{0}\" name=\"{1}\">", language_code, language_name);
+        List<string> sorted_names = new List<string> (names.Values);
+        sorted_names.Sort ();
+        foreach(string name in sorted_names) {
+            Console.WriteLine("    <person>{0}</person>", name.Replace("\"", "&quot;"));
+        }
+        Console.WriteLine("  </language>");
+    }
+}
+
diff --git a/build/build.environment.mk b/build/build.environment.mk
new file mode 100644
index 0000000..4b25080
--- /dev/null
+++ b/build/build.environment.mk
@@ -0,0 +1,13 @@
+# Initializers
+MONO_BASE_PATH = 
+MONO_ADDINS_PATH =
+
+# Install Paths
+DEFAULT_INSTALL_DIR = $(pkglibdir)
+
+DIR_BIN = $(top_builddir)/bin
+
+# Cute hack to replace a space with something
+colon:= :
+empty:=
+space:= $(empty) $(empty)
diff --git a/build/build.mk b/build/build.mk
new file mode 100644
index 0000000..78e0760
--- /dev/null
+++ b/build/build.mk
@@ -0,0 +1,3 @@
+include $(top_srcdir)/build/build.environment.mk
+include $(top_srcdir)/build/build.rules.mk
+
diff --git a/build/build.rules.mk b/build/build.rules.mk
new file mode 100644
index 0000000..648a60d
--- /dev/null
+++ b/build/build.rules.mk
@@ -0,0 +1,91 @@
+UNIQUE_FILTER_PIPE = tr [:space:] \\n | sort | uniq
+BUILD_DATA_DIR = $(top_builddir)/bin/share/$(PACKAGE)
+
+SOURCES_BUILD = $(addprefix $(srcdir)/, $(SOURCES))
+dnl SOURCES_BUILD += $(top_srcdir)/src/AssemblyInfo.cs
+
+RESOURCES_EXPANDED = $(addprefix $(srcdir)/, $(RESOURCES))
+RESOURCES_BUILD = $(foreach resource, $(RESOURCES_EXPANDED), \
+	-resource:$(resource),$(notdir $(resource)))
+
+INSTALL_ICONS = $(top_srcdir)/build/private-icon-theme-installer "$(mkinstalldirs)" "$(INSTALL_DATA)"
+THEME_ICONS_SOURCE = $(wildcard $(srcdir)/ThemeIcons/*/*/*.png) $(wildcard $(srcdir)/ThemeIcons/scalable/*/*.svg)
+THEME_ICONS_RELATIVE = $(subst $(srcdir)/ThemeIcons/, , $(THEME_ICONS_SOURCE))
+
+ASSEMBLY_EXTENSION = $(strip $(patsubst library, dll, $(TARGET)))
+ASSEMBLY_FILE = $(top_builddir)/bin/$(ASSEMBLY).$(ASSEMBLY_EXTENSION)
+
+INSTALL_DIR_RESOLVED = $(firstword $(subst , $(DEFAULT_INSTALL_DIR), $(INSTALL_DIR)))
+
+if ENABLE_TESTS
+    LINK += " $(NUNIT_LIBS)"
+    ENABLE_TESTS_FLAG = "-define:ENABLE_TESTS"
+endif
+
+if ENABLE_ATK
+    ENABLE_ATK_FLAG = "-define:ENABLE_ATK"
+endif
+
+FILTERED_LINK = $(shell echo "$(LINK)" | $(UNIQUE_FILTER_PIPE))
+DEP_LINK = $(shell echo "$(LINK)" | $(UNIQUE_FILTER_PIPE) | sed s,-r:,,g | grep '$(top_builddir)/bin/')
+
+OUTPUT_FILES = \
+	$(ASSEMBLY_FILE) \
+	$(ASSEMBLY_FILE).mdb
+
+moduledir = $(INSTALL_DIR_RESOLVED)
+module_SCRIPTS = $(OUTPUT_FILES)
+
+all: $(ASSEMBLY_FILE) theme-icons
+
+run: 
+	@pushd $(top_builddir); \
+	make run; \
+	popd;
+
+test:
+	@pushd $(top_builddir)/tests; \
+	make $(ASSEMBLY); \
+	popd;
+
+build-debug:
+	@echo $(DEP_LINK)
+
+$(ASSEMBLY_FILE).mdb: $(ASSEMBLY_FILE)
+
+$(ASSEMBLY_FILE): $(SOURCES_BUILD) $(RESOURCES_EXPANDED) $(DEP_LINK)
+	@mkdir -p $(top_builddir)/bin
+	@if [ ! "x$(ENABLE_RELEASE)" = "xyes" ]; then \
+		$(top_srcdir)/build/dll-map-makefile-verifier $(srcdir)/Makefile.am $(srcdir)/$(notdir $  config) && \
+		$(MONO) $(top_builddir)/build/dll-map-verifier.exe $(srcdir)/$(notdir $  config) -iwinmm -ilibbanshee -ilibbnpx11 -ilibc -ilibc.so.6 -iintl -ilibmtp.dll -ilibigemacintegration.dylib -iCFRelease $(SOURCES_BUILD); \
+	fi;
+	$(MCS) \
+		$(GMCS_FLAGS) \
+		$(ASSEMBLY_BUILD_FLAGS) \
+		-nowarn:0278 -nowarn:0078 $$warn \
+		-define:HAVE_GTK_2_10 -define:NET_2_0 \
+		-debug -target:$(TARGET) -out:$@ \
+		$(BUILD_DEFINES) $(ENABLE_TESTS_FLAG) $(ENABLE_ATK_FLAG) \
+		$(FILTERED_LINK) $(RESOURCES_BUILD) $(SOURCES_BUILD)
+	@if [ -e $(srcdir)/$(notdir $  config) ]; then \
+		cp $(srcdir)/$(notdir $  config) $(top_builddir)/bin; \
+	fi;
+	@if [ ! -z "$(EXTRA_BUNDLE)" ]; then \
+		cp $(EXTRA_BUNDLE) $(top_builddir)/bin; \
+	fi;
+
+theme-icons: $(THEME_ICONS_SOURCE)
+	@$(INSTALL_ICONS) -il "$(BUILD_DATA_DIR)" "$(srcdir)" $(THEME_ICONS_RELATIVE)
+
+install-data-local: $(THEME_ICONS_SOURCE)
+	@$(INSTALL_ICONS) -i "$(DESTDIR)$(pkgdatadir)" "$(srcdir)" $(THEME_ICONS_RELATIVE)
+	
+uninstall-local: $(THEME_ICONS_SOURCE)
+	@$(INSTALL_ICONS) -u "$(DESTDIR)$(pkgdatadir)" "$(srcdir)" $(THEME_ICONS_RELATIVE)
+
+EXTRA_DIST = $(SOURCES_BUILD) $(RESOURCES_EXPANDED) $(THEME_ICONS_SOURCE)
+
+CLEANFILES = $(OUTPUT_FILES)
+DISTCLEANFILES = *.pidb
+MAINTAINERCLEANFILES = Makefile.in
+
diff --git a/build/dll-map-makefile-verifier b/build/dll-map-makefile-verifier
new file mode 100755
index 0000000..c75afa5
--- /dev/null
+++ b/build/dll-map-makefile-verifier
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+
+if [ -f $2 ]; then
+	# Lame, but better than nothing
+	grep $(basename $2) $1 | grep module_SCRIPTS &>/dev/null || {
+		echo "Assembly has corresponding .config file, but it was not found in module_SCRIPTS in Makefile.am" 2>&1
+		exit 1
+	}
+fi
+
diff --git a/build/gconf-schema-rules b/build/gconf-schema-rules
new file mode 100644
index 0000000..5fb8c5c
--- /dev/null
+++ b/build/gconf-schema-rules
@@ -0,0 +1,18 @@
+schema_in_files = $(ASSEMBLY_GCONF_SCHEMA)
+schemadir = $(GCONF_SCHEMA_FILE_DIR)
+schema_DATA = $(schema_in_files:.schemas.in=.schemas)
+
+$(srcdir)/$(ASSEMBLY_GCONF_SCHEMA): $(ASSEMBLY)
+	if test -w $@ -o \( ! -e $@ -a -w $(srcdir) \); then \
+		BANSHEE_DISABLE_GCONF=1 MONO_PATH=$(MONO_BASE_PATH) $(MONO) $(top_builddir)/build/gconf-schema-extractor.exe $< $(srcdir)/$@; \
+	fi
+
+ INTLTOOL_SCHEMAS_RULE@
+
+if GCONF_SCHEMAS_INSTALL
+install-data-local:
+	if [ -z "$(DESTDIR)" ]; then \
+		GCONF_CONFIG_SOURCE="" $(GCONFTOOL) --makefile-install-rule $(schema_DATA); \
+	fi
+endif
+
diff --git a/build/icon-theme-installer b/build/icon-theme-installer
new file mode 100755
index 0000000..56c8571
--- /dev/null
+++ b/build/icon-theme-installer
@@ -0,0 +1,177 @@
+#!/usr/bin/env bash
+
+# icon-theme-installer
+# Copyright (C) 2006 Novell, Inc.
+# Written by Aaron Bockover <abock gnome org>
+# Licensed under the MIT/X11 license
+#
+# This script is meant to be invoked from within a Makefile/Makefile.am
+# in the install-data-local and uninstall-data sections. It handles the
+# task of properly installing icons into the icon theme. It requires a
+# few arguments to set up its environment, and a list of files to be
+# installed. The format of the file list is critical:
+#
+# <category>,<local-src-file-name>
+#
+#   apps,music-player-banshee.svg
+#   apps,music-player-banshee-16.png
+#   apps,music-player-banshee-22.png
+#
+# <category> is the icon theme category, for instance, apps, devices,
+# actions, emblems...
+#
+# <local-src-file-name> must have a basename in the form of:
+#
+#   proper-theme-name[-<SIZE>].<EXTENSION>
+#
+# Where <SIZE> should be either nothing, which will default to scalable
+# or \-[0-9]{2}, which will expand to <SIZE>x<SIZE>. For example:
+#
+#   music-player-banshee-16.png
+#
+# The <SIZE> here is -16 and will expand to 16x16 per the icon theme spec
+#
+# What follows is an example Makefile.am for icon theme installation:
+#
+# ---------------
+# theme=hicolor
+# themedir=$(datadir)/icons/$(theme)
+# theme_icons = \
+#	apps,music-player-banshee.svg \
+#	apps,music-player-banshee-16.png \
+#	apps,music-player-banshee-22.png \
+#	apps,music-player-banshee-24.png \
+#	apps,music-player-banshee-32.png
+#
+# install_icon_exec = $(top_srcdir)/build/icon-theme-installer -t $(theme) -s $(srcdir) -d "x$(DESTDIR)" -b $(themedir) -m "$(mkinstalldirs)" -x "$(INSTALL_DATA)"
+# install-data-local:
+#	$(install_icon_exec) -i $(theme_icons)
+#
+#	uninstall-hook:
+#		$(install_icon_exec) -u $(theme_icons)
+#
+#	MAINTAINERCLEANFILES = Makefile.in
+#	EXTRA_DIST = $(wildcard *.svg *.png)
+# ---------------
+#
+# Arguments to this program:
+#
+# -i         : Install
+# -u         : Uninstall
+# -t <theme> : Theme name (hicolor)
+# -b <dir>   : Theme installation dest directory [x$(DESTDIR)] - Always prefix
+#              this argument with x; it will be stripped but will act as a
+#              placeholder for zero $DESTDIRs (only set by packagers)
+# -d <dir>   : Theme installation directory [$(hicolordir)]
+# -s <dir>   : Source directory [$(srcdir)]
+# -m <exec>  : Command to exec for directory creation [$(mkinstalldirs)]
+# -x <exec>  : Command to exec for single file installation [$(INSTALL_DATA)]
+# <remainging> : All remainging should be category,filename pairs
+
+while getopts "iut:b:d:s:m:x:" flag; do
+	case "$flag" in
+		i) INSTALL=yes ;;
+		u) UNINSTALL=yes ;;
+		t) THEME_NAME=$OPTARG ;;
+		d) INSTALL_DEST_DIR=${OPTARG##x} ;;
+		b) INSTALL_BASE_DIR=$OPTARG ;;
+		s) SRC_DIR=$OPTARG ;;
+		m) MKINSTALLDIRS_EXEC=$OPTARG ;;
+		x) INSTALL_DATA_EXEC=$OPTARG ;;
+	esac
+done
+
+shift $(($OPTIND - 1))
+
+if test "x$INSTALL" = "xyes" -a "x$UNINSTALL" = "xyes"; then
+	echo "Cannot pass both -i and -u"
+	exit 1
+elif test "x$INSTALL" = "x" -a "x$UNINSTALL" = "x"; then
+	echo "Must path either -i or -u"
+	exit 1
+fi
+
+if test -z "$THEME_NAME"; then
+	echo "Theme name required (-t hicolor)"
+	exit 1
+fi
+
+if test -z "$INSTALL_BASE_DIR"; then
+	echo "Base theme directory required [-d \$(hicolordir)]"
+	exit 1
+fi
+
+if test ! -x $(echo "$MKINSTALLDIRS_EXEC" | cut -f1 -d' '); then
+	echo "Cannot find '$MKINSTALLDIRS_EXEC'; You probably want to pass -m \$(mkinstalldirs)"
+	exit 1
+fi
+
+if test ! -x $(echo "$INSTALL_DATA_EXEC" | cut -f1 -d' '); then
+	echo "Cannot find '$INSTALL_DATA_EXEC'; You probably want to pass -x \$(INSTALL_DATA)"
+	exit 1
+fi
+
+if test -z "$SRC_DIR"; then
+	SRC_DIR=.
+fi
+
+for icon in $@; do
+	size=$(echo $icon | sed s/[^0-9]*//g)
+	category=$(echo $icon | cut -d, -f1)
+	build_name=$(echo $icon | cut -d, -f2)
+	install_name=$(echo $build_name | sed "s/[0-9]//g; s/-\././")
+	install_name=$(basename $install_name)
+
+	if test -z $size; then 
+		size=scalable;
+	else
+		size=${size}x${size};
+	fi
+	
+	install_dir=${INSTALL_DEST_DIR}${INSTALL_BASE_DIR}/$size/$category
+	install_path=$install_dir/$install_name
+	
+	if test "x$INSTALL" = "xyes"; then
+		echo "Installing $size $install_name into $THEME_NAME icon theme"
+		
+		$($MKINSTALLDIRS_EXEC $install_dir) || {
+			echo "Failed to create directory $install_dir"
+			exit 1
+		}
+		
+		$($INSTALL_DATA_EXEC $SRC_DIR/$build_name $install_path) || {
+			echo "Failed to install $SRC_DIR/$build_name into $install_path"
+			exit 1
+		}
+
+		if test ! -e $install_path; then
+			echo "Failed to install $SRC_DIR/$build_name into $install_path"
+			exit 1
+		fi
+	else
+		if test -e $install_path; then
+			echo "Removing $size $install_name from $THEME_NAME icon theme"
+
+			rm $install_path || { 
+				echo "Failed to remove $install_path"
+				exit 1
+			}
+		fi
+	fi
+done
+
+gtk_update_icon_cache_bin="$((which gtk-update-icon-cache || echo /opt/gnome/bin/gtk-update-icon-cache)2>/dev/null)"
+gtk_update_icon_cache="$gtk_update_icon_cache_bin -f -t $INSTALL_BASE_DIR"
+
+if test -z "$INSTALL_DEST_DIR"; then 
+	if test -x $gtk_update_icon_cache_bin; then 
+		echo "Updating GTK icon cache"
+		$gtk_update_icon_cache
+	else
+		echo "*** Icon cache not updated. Could not execute $gtk_update_icon_cache_bin"
+	fi
+else
+	echo "*** Icon cache not updated. After (un)install, run this:"
+	echo "***   $gtk_update_icon_cache"
+fi
+
diff --git a/build/m4/Makefile.am b/build/m4/Makefile.am
new file mode 100644
index 0000000..bc643a5
--- /dev/null
+++ b/build/m4/Makefile.am
@@ -0,0 +1,4 @@
+EXTRA_DIST = \
+	$(srcdir)/shamrock/*.m4 
+
+MAINTAINERCLEANFILES = Makefile.in
diff --git a/expansions.m4 b/build/m4/shamrock/expansions.m4
similarity index 100%
rename from expansions.m4
rename to build/m4/shamrock/expansions.m4
diff --git a/build/m4/shamrock/i18n.m4 b/build/m4/shamrock/i18n.m4
new file mode 100644
index 0000000..e632647
--- /dev/null
+++ b/build/m4/shamrock/i18n.m4
@@ -0,0 +1,10 @@
+AC_DEFUN([SHAMROCK_CONFIGURE_I18N],
+[
+	ALL_LINGUAS=`grep -v '^#' $srcdir/po/LINGUAS | $SED ':a;N;$!ba;s/\n/ /g; s/[ ]+/ /g' | xargs`
+	GETTEXT_PACKAGE=$1
+	AC_SUBST(GETTEXT_PACKAGE)
+	AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext Package])
+	AM_GLIB_GNU_GETTEXT
+	AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
+])
+
diff --git a/build/m4/shamrock/mono.m4 b/build/m4/shamrock/mono.m4
new file mode 100644
index 0000000..0087197
--- /dev/null
+++ b/build/m4/shamrock/mono.m4
@@ -0,0 +1,65 @@
+AC_DEFUN([SHAMROCK_FIND_MONO_1_0_COMPILER],
+[
+	SHAMROCK_FIND_PROGRAM_OR_BAIL(MCS, mcs)
+])
+
+AC_DEFUN([SHAMROCK_FIND_MONO_2_0_COMPILER],
+[
+	SHAMROCK_FIND_PROGRAM_OR_BAIL(MCS, gmcs)
+])
+
+AC_DEFUN([SHAMROCK_FIND_MONO_4_0_COMPILER],
+[
+	SHAMROCK_FIND_PROGRAM_OR_BAIL(MCS, dmcs)
+])
+
+AC_DEFUN([SHAMROCK_FIND_MONO_RUNTIME],
+[
+	SHAMROCK_FIND_PROGRAM_OR_BAIL(MONO, mono)
+])
+
+AC_DEFUN([SHAMROCK_CHECK_MONO_MODULE],
+[
+	PKG_CHECK_MODULES(MONO_MODULE, mono >= $1)
+])
+
+AC_DEFUN([SHAMROCK_CHECK_MONO_MODULE_NOBAIL],
+[
+	PKG_CHECK_MODULES(MONO_MODULE, mono >= $1, 
+		HAVE_MONO_MODULE=yes, HAVE_MONO_MODULE=no)
+	AC_SUBST(HAVE_MONO_MODULE)
+])
+
+AC_DEFUN([_SHAMROCK_CHECK_MONO_GAC_ASSEMBLIES],
+[
+	for asm in $(echo "$*" | cut -d, -f2- | sed 's/\,/ /g')
+	do
+		AC_MSG_CHECKING([for Mono $1 GAC for $asm.dll])
+		if test \
+			-e "$($PKG_CONFIG --variable=libdir mono)/mono/$1/$asm.dll" -o \
+			-e "$($PKG_CONFIG --variable=prefix mono)/lib/mono/$1/$asm.dll"; \
+			then \
+			AC_MSG_RESULT([found])
+		else
+			AC_MSG_RESULT([not found])
+			AC_MSG_ERROR([missing required Mono $1 assembly: $asm.dll])
+		fi
+	done
+])
+
+AC_DEFUN([SHAMROCK_CHECK_MONO_1_0_GAC_ASSEMBLIES],
+[
+	_SHAMROCK_CHECK_MONO_GAC_ASSEMBLIES(1.0, $*)
+])
+
+AC_DEFUN([SHAMROCK_CHECK_MONO_2_0_GAC_ASSEMBLIES],
+[
+	_SHAMROCK_CHECK_MONO_GAC_ASSEMBLIES(2.0, $*)
+])
+
+AC_DEFUN([SHAMROCK_CHECK_MONO_4_0_GAC_ASSEMBLIES],
+[
+	_SHAMROCK_CHECK_MONO_GAC_ASSEMBLIES(4.0, $*)
+])
+
+
diff --git a/build/m4/shamrock/monodoc.m4 b/build/m4/shamrock/monodoc.m4
new file mode 100644
index 0000000..891ac74
--- /dev/null
+++ b/build/m4/shamrock/monodoc.m4
@@ -0,0 +1,25 @@
+AC_DEFUN([SHAMROCK_CHECK_MONODOC],
+[
+	AC_ARG_ENABLE(docs, AC_HELP_STRING([--disable-docs], 
+		[Do not build documentation]), , enable_docs=yes)
+
+	if test "x$enable_docs" = "xyes"; then
+		AC_PATH_PROG(MONODOCER, monodocer, no)
+		if test "x$MONODOCER" = "xno"; then
+			AC_MSG_ERROR([You need to install monodoc, or pass --disable-docs to configure to skip documentation installation])
+		fi
+
+		AC_PATH_PROG(MDASSEMBLER, mdassembler, no)
+		if test "x$MDASSEMBLER" = "xno"; then
+			AC_MSG_ERROR([You need to install mdassembler, or pass --disable-docs to configure to skip documentation installation])
+		fi
+
+		DOCDIR=`$PKG_CONFIG monodoc --variable=sourcesdir`
+		AC_SUBST(DOCDIR)
+		AM_CONDITIONAL(BUILD_DOCS, true)
+	else
+		AC_MSG_NOTICE([not building ${PACKAGE} API documentation])
+		AM_CONDITIONAL(BUILD_DOCS, false)
+	fi
+])
+
diff --git a/build/m4/shamrock/nunit.m4 b/build/m4/shamrock/nunit.m4
new file mode 100644
index 0000000..4d57d00
--- /dev/null
+++ b/build/m4/shamrock/nunit.m4
@@ -0,0 +1,29 @@
+AC_DEFUN([SHAMROCK_CHECK_NUNIT],
+[
+	NUNIT_REQUIRED=2.4.7
+
+	AC_ARG_ENABLE(tests, AC_HELP_STRING([--enable-tests], [Enable NUnit tests]),
+		enable_tests=$enableval, enable_tests="no")
+
+	if test "x$enable_tests" = "xno"; then
+		do_tests=no
+		AM_CONDITIONAL(ENABLE_TESTS, false)
+	else
+		PKG_CHECK_MODULES(NUNIT, nunit >= $NUNIT_REQUIRED,
+			do_tests="yes", do_tests="no")
+
+		AC_SUBST(NUNIT_LIBS)
+		AM_CONDITIONAL(ENABLE_TESTS, test "x$do_tests" = "xyes")
+
+		if test "x$do_tests" = "xno"; then
+			PKG_CHECK_MODULES(NUNIT, mono-nunit >= 2.4,
+				do_tests="yes", do_tests="no")
+
+			AC_SUBST(NUNIT_LIBS)
+			AM_CONDITIONAL(ENABLE_TESTS, test "x$do_tests" = "xyes")
+
+			if test "x$do_tests" = "xno"; then
+				AC_MSG_WARN([Could not find nunit: tests will not be available])			fi
+		fi
+	fi
+])
diff --git a/build/m4/shamrock/programs.m4 b/build/m4/shamrock/programs.m4
new file mode 100644
index 0000000..2bdacfe
--- /dev/null
+++ b/build/m4/shamrock/programs.m4
@@ -0,0 +1,15 @@
+AC_DEFUN([SHAMROCK_FIND_PROGRAM],
+[
+	AC_PATH_PROG($1, $2, $3)
+	AC_SUBST($1)
+])
+
+AC_DEFUN([SHAMROCK_FIND_PROGRAM_OR_BAIL],
+[
+	SHAMROCK_FIND_PROGRAM($1, $2, no)
+	if test "x$$1" = "xno"; then
+		AC_MSG_ERROR([You need to install '$2'])
+	fi
+])
+
+
diff --git a/build/m4/shamrock/util.m4 b/build/m4/shamrock/util.m4
new file mode 100644
index 0000000..de85ba9
--- /dev/null
+++ b/build/m4/shamrock/util.m4
@@ -0,0 +1,11 @@
+AC_DEFUN([SHAMROCK_CONCAT],
+[
+	$1="$$1 $$2"
+])
+
+AC_DEFUN([SHAMROCK_CONCAT_MODULE],
+[
+	SHAMROCK_CONCAT($1_CFLAGS, $2_CFLAGS)
+	SHAMROCK_CONCAT($1_LIBS, $2_LIBS)
+])
+
diff --git a/build/private-icon-theme-installer b/build/private-icon-theme-installer
new file mode 100755
index 0000000..00f0ffe
--- /dev/null
+++ b/build/private-icon-theme-installer
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+
+mkinstalldirs=$1; shift
+install_data=$1; shift
+action=$1; shift
+dest_dir=$1; shift
+src_dir=$1; shift
+
+for icon in $@; do
+	dest_dir_build="${dest_dir}/icons/hicolor/$(dirname ${icon})"
+	if [[ ${action} == "-i" || ${action} == "-il" ]]; then
+		src_file="${src_dir}/ThemeIcons/${icon}"
+		$mkinstalldirs "${dest_dir_build}" &>/dev/null
+		if [[ ${action} == "-i" ]]; then 
+			echo "Installing private icon theme icon: ${icon}"
+		fi
+		$install_data "${src_file}" "${dest_dir_build}"
+	else
+		echo "Uninstalling private icon theme icon: ${icon}"
+		rm -f "${dest_dir_build}/$(basename ${icon})"
+	fi
+done
+
diff --git a/configure.ac b/configure.ac
index f0aeb1d..7006eba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,6 +4,7 @@ AC_PREREQ([2.54])
 AC_INIT([hyena], [0.3])
 AM_INIT_AUTOMAKE([foreign dist-bzip2 tar-ustar])
 AM_MAINTAINER_MODE
+AC_SUBST([ACLOCAL_AMFLAGS], ["-I build/m4/shamrock \${ACLOCAL_FLAGS}"])
 
 dnl pkg-config
 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
@@ -11,20 +12,12 @@ if test "x$PKG_CONFIG" = "xno"; then
         AC_MSG_ERROR([You need to install pkg-config])
 fi
 
-m4_include([expansions.m4])
-
 SHAMROCK_EXPAND_LIBDIR
 SHAMROCK_EXPAND_BINDIR
 SHAMROCK_EXPAND_DATADIR
 
 AC_PROG_INSTALL
 
-AC_PATH_PROG(MCS, gmcs, no)
-if test "x$MCS" = "xno"; then
-        AC_MSG_ERROR([gmcs Not found])
-fi
-
-
 AC_ARG_ENABLE(debug,
 	AC_HELP_STRING([--enable-debug],
 		[Use 'DEBUG' Configuration [default=YES]]),
@@ -54,15 +47,27 @@ if test -z "$CONFIG_REQUESTED" ; then
 	enable_debug=yes
 fi
 
+dnl Mono and gmcs
+SHAMROCK_CHECK_MONO_MODULE(1.9.1)
+SHAMROCK_FIND_MONO_2_0_COMPILER
+SHAMROCK_FIND_MONO_RUNTIME
+SHAMROCK_CHECK_MONO_2_0_GAC_ASSEMBLIES([	
+	System.Data
+	Mono.Cairo
+	Mono.Posix
+	ICSharpCode.SharpZipLib
+])
 
 dnl package checks, common for all configs
-PKG_CHECK_MODULES([GTK_SHARP_20], [gtk-sharp-2.0])
-PKG_CHECK_MODULES([GLIB_SHARP_20], [glib-sharp-2.0])
+PKG_CHECK_MODULES([GTKSHARP], [gtk-sharp-2.0])
+PKG_CHECK_MODULES([GLIBSHARP], [glib-sharp-2.0])
 
 dnl See if Gtk# is recent enought to enable managed widget a11y
 PKG_CHECK_MODULES(GTKSHARP_A11Y, gtk-sharp-2.0 >= 2.12.10, gtksharp_with_a11y=yes, gtksharp_with_a11y=no)
 AM_CONDITIONAL(ENABLE_ATK, test "x$gtksharp_with_a11y" = "xyes")
 
+AM_CONDITIONAL(GCONF_SCHEMAS_INSTALL, false)
+
 dnl Check for nunit
 NUNIT_REQUIRED=2.4.7
 
@@ -95,6 +100,10 @@ dnl package checks, per config
 
 
 AC_CONFIG_FILES([
+Makefile
+build/Makefile
+build/m4/Makefile
+
 src/Mono.Data.Sqlite/Makefile
 src/Hyena/hyena.pc
 src/Hyena/Makefile
@@ -102,8 +111,6 @@ src/Hyena.Data.Sqlite/hyena.data.sqlite.pc
 src/Hyena.Data.Sqlite/Makefile
 src/Hyena.Gui/hyena.gui.pc
 src/Hyena.Gui/Makefile
-Makefile
-
 ])
 
 cat <<EOF
diff --git a/src/Hyena.Data.Sqlite/Makefile.am b/src/Hyena.Data.Sqlite/Makefile.am
index 6f0b72c..cd4835b 100644
--- a/src/Hyena.Data.Sqlite/Makefile.am
+++ b/src/Hyena.Data.Sqlite/Makefile.am
@@ -1,67 +1,9 @@
-
-EXTRA_DIST =  
-
-# Warning: This is an automatically generated file, do not edit!
-
-ASSEMBLY_COMPILER_FLAGS = ""
-
-if ENABLE_DEBUG
-ASSEMBLY_COMPILER_COMMAND = $(MCS)
-ASSEMBLY_COMPILER_FLAGS +=  -noconfig -codepage:utf8 -warn:4 -optimize+ -debug -define:DEBUG "-define:NET_2_0"
-ASSEMBLY = ../../bin/Hyena.Data.Sqlite.dll
-ASSEMBLY_MDB = $(ASSEMBLY).mdb
-COMPILE_TARGET = library
-PROJECT_REFERENCES =  \
-	../../bin/Mono.Data.Sqlite.dll \
-	../../bin/Hyena.dll
-BUILD_DIR = ../../bin
-
-MONO_DATA_SQLITE_DLL_SOURCE=../../bin/Mono.Data.Sqlite.dll
-MONO_DATA_SQLITE_DLL_MDB_SOURCE=../../bin/Mono.Data.Sqlite.dll.mdb
-HYENA_DLL_SOURCE=../../bin/Hyena.dll
-HYENA_DLL_MDB_SOURCE=../../bin/Hyena.dll.mdb
-HYENA_DATA_SQLITE_DLL_MDB_SOURCE=../../bin/Hyena.Data.Sqlite.dll.mdb
-
-endif
-
-if ENABLE_WINDOWS
-ASSEMBLY_COMPILER_COMMAND = $(MCS)
-ASSEMBLY_COMPILER_FLAGS +=  -noconfig -codepage:utf8 -warn:4 -optimize- -debug -define:DEBUG
-ASSEMBLY = ../../bin/Hyena.Data.Sqlite.dll
-ASSEMBLY_MDB = $(ASSEMBLY).mdb
-COMPILE_TARGET = library
-PROJECT_REFERENCES =  \
-	../../bin/Mono.Data.Sqlite.dll \
-	../../bin/Hyena.dll
-BUILD_DIR = ../../bin
-
-MONO_DATA_SQLITE_DLL_SOURCE=../../bin/Mono.Data.Sqlite.dll
-MONO_DATA_SQLITE_DLL_MDB_SOURCE=../../bin/Mono.Data.Sqlite.dll.mdb
-HYENA_DLL_SOURCE=../../bin/Hyena.dll
-HYENA_DLL_MDB_SOURCE=../../bin/Hyena.dll.mdb
-HYENA_DATA_SQLITE_DLL_MDB_SOURCE=../../bin/Hyena.Data.Sqlite.dll.mdb
-
-endif
-
-if ENABLE_TESTS
-ASSEMBLY_COMPILER_FLAGS += -define:ENABLE_TESTS
-endif
-
-AL=al2
-SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll
-
-PROGRAMFILES = \
-	$(HYENA_DATA_SQLITE_DLL_MDB)  
-
-LINUX_PKGCONFIG = \
-	$(HYENA_DATA_SQLITE_PC)  
-
-
-RESGEN=resgen2
-	
-all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) 
-
-FILES = \
+ASSEMBLY = Hyena.Data.Sqlite
+TARGET = library
+LINK = -r:Mono.Posix -r:System  -r:System.Core  -r:System.Data \
+	   -r:$(DIR_BIN)/Mono.Data.Sqlite.dll \
+	   -r:$(DIR_BIN)/Hyena.dll
+SOURCES =  \
 	Hyena.Data.Sqlite/DatabaseColumn.cs \
 	Hyena.Data.Sqlite/DatabaseColumnAttribute.cs \
 	Hyena.Data.Sqlite/SqliteModelProvider.cs \
@@ -76,46 +18,5 @@ FILES = \
 	Hyena.Data.Sqlite/HyenaSqliteArrayDataReader.cs \
 	Hyena.Data.Sqlite/Tests/SqliteUtilTests.cs
 
-DATA_FILES = 
-
-RESOURCES = 
-
-EXTRAS = \
-	hyena.data.sqlite.pc.in 
-
-REFERENCES =  \
-	Mono.Posix \
-	System \
-	System.Core \
-	System.Data \
-	System.Xml
-
-if ENABLE_TESTS
-REFERENCES += $(NUNIT_LIBS)
-endif
-
-DLL_REFERENCES = 
-
-CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) 
-
-include $(top_srcdir)/Makefile.include
-
-MONO_DATA_SQLITE_DLL = $(BUILD_DIR)/Mono.Data.Sqlite.dll
-MONO_DATA_SQLITE_DLL_MDB = $(BUILD_DIR)/Mono.Data.Sqlite.dll.mdb
-HYENA_DLL = $(BUILD_DIR)/Hyena.dll
-HYENA_DLL_MDB = $(BUILD_DIR)/Hyena.dll.mdb
-HYENA_DATA_SQLITE_DLL_MDB = $(BUILD_DIR)/Hyena.Data.Sqlite.dll.mdb
-HYENA_DATA_SQLITE_PC = $(BUILD_DIR)/hyena.data.sqlite.pc
-
-$(eval $(call emit-deploy-wrapper,HYENA_DATA_SQLITE_PC,hyena.data.sqlite.pc))
-
-
-$(eval $(call emit_resgen_targets))
-$(build_xamlg_list): %.xaml.g.cs: %.xaml
-	xamlg '$<'
-
-$(ASSEMBLY_MDB): $(ASSEMBLY)
-
-$(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list)
-	mkdir -p $(shell dirname $(ASSEMBLY))
-	$(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref)
+include $(top_srcdir)/build/build.mk
+EXTRA_DIST += hyena.data.sqlite.pc.in
diff --git a/src/Hyena.Gui/Makefile.am b/src/Hyena.Gui/Makefile.am
index 77cec37..6d83496 100644
--- a/src/Hyena.Gui/Makefile.am
+++ b/src/Hyena.Gui/Makefile.am
@@ -1,64 +1,10 @@
-
-EXTRA_DIST =  
-
-# Warning: This is an automatically generated file, do not edit!
-
-ASSEMBLY_COMPILER_FLAGS = ""
-
-if ENABLE_DEBUG
-ASSEMBLY_COMPILER_COMMAND = $(MCS)
-ASSEMBLY_COMPILER_FLAGS +=  -noconfig -codepage:utf8 -unsafe -warn:4 -optimize+ -debug -define:DEBUG "-define:NET_2_0"
-ASSEMBLY = ../../bin/Hyena.Gui.dll
-ASSEMBLY_MDB = $(ASSEMBLY).mdb
-COMPILE_TARGET = library
-PROJECT_REFERENCES =  \
-	../../bin/Hyena.dll
-BUILD_DIR = ../../bin
-
-HYENA_DLL_SOURCE=../../bin/Hyena.dll
-HYENA_DLL_MDB_SOURCE=../../bin/Hyena.dll.mdb
-HYENA_GUI_DLL_MDB_SOURCE=../../bin/Hyena.Gui.dll.mdb
-endif
-
-if ENABLE_WINDOWS
-ASSEMBLY_COMPILER_COMMAND = $(MCS)
-ASSEMBLY_COMPILER_FLAGS +=  -noconfig -codepage:utf8 -unsafe -warn:4 -optimize- -debug -define:DEBUG
-ASSEMBLY = ../../bin/Hyena.Gui.dll
-ASSEMBLY_MDB = $(ASSEMBLY).mdb
-COMPILE_TARGET = library
-PROJECT_REFERENCES =  \
-	../../bin/Hyena.dll
-BUILD_DIR = ../../bin
-
-HYENA_DLL_SOURCE=../../bin/Hyena.dll
-HYENA_DLL_MDB_SOURCE=../../bin/Hyena.dll.mdb
-HYENA_GUI_DLL_MDB_SOURCE=../../bin/Hyena.Gui.dll.mdb
-endif
-
-if ENABLE_TESTS
-ASSEMBLY_COMPILER_FLAGS += -define:ENABLE_TESTS
-endif
-
-if ENABLE_ATK
-ASSEMBLY_COMPILER_FLAGS += -define:ENABLE_ATK
-endif
-
-AL=al2
-SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll
-
-PROGRAMFILES = \
-	$(HYENA_GUI_DLL_MDB) \
-	$(HYENA_GUI_DLL_CONFIG)
-
-LINUX_PKGCONFIG = \
-	$(HYENA_GUI_PC)  
-
-
-RESGEN=resgen2
-	
-all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) 
-
-FILES = \
+ASSEMBLY = Hyena.Gui
+ASSEMBLY_BUILD_FLAGS = -unsafe
+TARGET = library
+LINK = -r:ICSharpCode.SharpZipLib -r:Mono.Posix -r:System -r:System.Core -r:Mono.Cairo \
+	   $(GTKSHARP_LIBS) $(GLIBSHARP_LIBS) \
+	   -r:$(DIR_BIN)/Hyena.dll
+SOURCES =  \
 	Hyena.Data.Gui/Column.cs \
 	Hyena.Data.Gui/ColumnCell.cs \
 	Hyena.Data.Gui/ColumnCellText.cs \
@@ -162,52 +108,6 @@ FILES = \
 	Hyena.Widgets/GenericToolItem.cs \
 	Hyena.Widgets/HigMessageDialog.cs 
 
-DATA_FILES = 
-
-RESOURCES = 
-
-EXTRAS = \
-	hyena.gui.pc.in
-
-REFERENCES =  \
-	ICSharpCode.SharpZipLib \
-	Mono.Posix \
-	System \
-	System.Core \
-	$(GTK_SHARP_20_LIBS) \
-	Mono.Cairo \
-	$(GLIB_SHARP_20_LIBS) \
-	System.Xml
-
-if ENABLE_TESTS
-REFERENCES += $(NUNIT_LIBS)
-endif
-
-DLL_REFERENCES = \
-	$(HYENA_DLL)
-
-CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) 
-
-include $(top_srcdir)/Makefile.include
-
-HYENA_DLL = $(BUILD_DIR)/Hyena.dll
-HYENA_DLL_MDB = $(BUILD_DIR)/Hyena.dll.mdb
-HYENA_GUI_DLL_MDB = $(BUILD_DIR)/Hyena.Gui.dll.mdb
-HYENA_GUI_DLL_CONFIG = $(BUILD_DIR)/Hyena.Gui.dll.config
-HYENA_GUI_PC = $(BUILD_DIR)/hyena.gui.pc
-
-$(eval $(call emit-deploy-wrapper,HYENA_GUI_PC,hyena.gui.pc))
-
-
-$(eval $(call emit_resgen_targets))
-$(build_xamlg_list): %.xaml.g.cs: %.xaml
-	xamlg '$<'
-
-$(HYENA_GUI_DLL_CONFIG): $(ASSEMBLY)
-
-$(ASSEMBLY_MDB): $(ASSEMBLY)
-
-$(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list)
-	mkdir -p $(shell dirname $(ASSEMBLY))
-	$(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref)
-	cp $(srcdir)/Hyena.Gui.dll.config $(BUILD_DIR)
+include $(top_srcdir)/build/build.mk
+EXTRA_DIST += hyena.gui.pc.in Hyena.Gui.dll.config
+module_SCRIPTS += Hyena.Gui.dll.config
diff --git a/src/Hyena/Makefile.am b/src/Hyena/Makefile.am
index ed9d64d..f14ab1c 100644
--- a/src/Hyena/Makefile.am
+++ b/src/Hyena/Makefile.am
@@ -1,55 +1,7 @@
-
-EXTRA_DIST =  
-
-# Warning: This is an automatically generated file, do not edit!
-
-ASSEMBLY_COMPILER_FLAGS = ""
-
-if ENABLE_DEBUG
-ASSEMBLY_COMPILER_COMMAND = $(MCS)
-ASSEMBLY_COMPILER_FLAGS +=  -noconfig -codepage:utf8 -warn:4 -optimize+ -debug -define:DEBUG "-define:NET_2_0"
-ASSEMBLY = ../../bin/Hyena.dll
-ASSEMBLY_MDB = $(ASSEMBLY).mdb
-COMPILE_TARGET = library
-PROJECT_REFERENCES =  
-BUILD_DIR = ../../bin
-
-HYENA_DLL_MDB_SOURCE=../../bin/Hyena.dll.mdb
-
-endif
-
-if ENABLE_WINDOWS
-ASSEMBLY_COMPILER_COMMAND = $(MCS)
-ASSEMBLY_COMPILER_FLAGS +=  -noconfig -codepage:utf8 -warn:4 -optimize- -debug -define:DEBUG
-ASSEMBLY = ../../bin/Hyena.dll
-ASSEMBLY_MDB = $(ASSEMBLY).mdb
-COMPILE_TARGET = library
-PROJECT_REFERENCES =  
-BUILD_DIR = ../../bin
-
-HYENA_DLL_MDB_SOURCE=../../bin/Hyena.dll.mdb
-
-endif
-
-if ENABLE_TESTS
-ASSEMBLY_COMPILER_FLAGS += -define:ENABLE_TESTS
-endif
-
-AL=al2
-SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll
-
-PROGRAMFILES = \
-	$(HYENA_DLL_MDB)  
-
-LINUX_PKGCONFIG = \
-	$(HYENA_PC)  
-
-
-RESGEN=resgen2
-	
-all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) 
-
-FILES = \
+ASSEMBLY = Hyena
+TARGET = library
+LINK = -r:Mono.Posix -r:System  -r:System.Core
+SOURCES =  \
 	Hyena.Data/BaseListModel.cs \
 	Hyena.Data/ICareAboutView.cs \
 	Hyena.Data/IFilterable.cs \
@@ -157,42 +109,5 @@ FILES = \
 	Hyena/ThreadAssist.cs \
 	Hyena/XdgBaseDirectorySpec.cs 
 
-DATA_FILES = 
-
-RESOURCES = 
-
-EXTRAS = \
-	hyena.pc.in 
-
-REFERENCES =  \
-	Mono.Posix \
-	System \
-	System.Core \
-	System.Data \
-	System.Xml
-
-if ENABLE_TESTS
-REFERENCES += $(NUNIT_LIBS)
-endif
-
-DLL_REFERENCES = 
-
-CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) 
-
-include $(top_srcdir)/Makefile.include
-
-HYENA_DLL_MDB = $(BUILD_DIR)/Hyena.dll.mdb
-HYENA_PC = $(BUILD_DIR)/hyena.pc
-
-$(eval $(call emit-deploy-wrapper,HYENA_PC,hyena.pc))
-
-
-$(eval $(call emit_resgen_targets))
-$(build_xamlg_list): %.xaml.g.cs: %.xaml
-	xamlg '$<'
-
-$(ASSEMBLY_MDB): $(ASSEMBLY)
-
-$(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list)
-	mkdir -p $(shell dirname $(ASSEMBLY))
-	$(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref)
+include $(top_srcdir)/build/build.mk
+EXTRA_DIST += hyena.pc.in 
diff --git a/src/Mono.Data.Sqlite/Makefile.am b/src/Mono.Data.Sqlite/Makefile.am
index 613ced3..f407f2e 100644
--- a/src/Mono.Data.Sqlite/Makefile.am
+++ b/src/Mono.Data.Sqlite/Makefile.am
@@ -1,48 +1,8 @@
-
-EXTRA_DIST =  
-
-# Warning: This is an automatically generated file, do not edit!
-
-if ENABLE_DEBUG
-ASSEMBLY_COMPILER_COMMAND = $(MCS)
-ASSEMBLY_COMPILER_FLAGS =  -noconfig -codepage:utf8 -unsafe -warn:4 -optimize- -debug -define:DEBUG "-define:NET_2_0;MONO_BACKWARD_COMPAT"
-ASSEMBLY = ../../bin/Mono.Data.Sqlite.dll
-ASSEMBLY_MDB = $(ASSEMBLY).mdb
-COMPILE_TARGET = library
-PROJECT_REFERENCES = 
-BUILD_DIR = ../../bin
-
-MONO_DATA_SQLITE_DLL_MDB_SOURCE=../../bin/Mono.Data.Sqlite.dll.mdb
-
-endif
-
-if ENABLE_WINDOWS
-ASSEMBLY_COMPILER_COMMAND = $(MCS)
-ASSEMBLY_COMPILER_FLAGS =  -noconfig -codepage:utf8 -unsafe -warn:4 -optimize- -debug -define:DEBUG
-ASSEMBLY = ../../bin/Mono.Data.Sqlite.dll
-ASSEMBLY_MDB = $(ASSEMBLY).mdb
-COMPILE_TARGET = library
-PROJECT_REFERENCES = 
-BUILD_DIR = ../../bin
-
-MONO_DATA_SQLITE_DLL_MDB_SOURCE=../../bin/Mono.Data.Sqlite.dll.mdb
-
-endif
-
-AL=al2
-SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll
-
-PROGRAMFILES = \
-	$(MONO_DATA_SQLITE_DLL_MDB)  
-
-LINUX_PKGCONFIG = 
-
-
-RESGEN=resgen2
-	
-all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) 
-
-FILES = \
+ASSEMBLY = Mono.Data.Sqlite
+TARGET = library
+LINK = -r:System -r:System.Data -r:System.Transactions
+ASSEMBLY_BUILD_FLAGS = -unsafe -d:MONO_BACKWARD_COMPAT
+SOURCES =  \
 	Mono.Data.Sqlite/SQLite3.cs \
 	Mono.Data.Sqlite/SQLite3_UTF16.cs \
 	Mono.Data.Sqlite/SQLiteBase.cs \
@@ -67,33 +27,4 @@ FILES = \
 	Mono.Data.Sqlite/SqliteDataSourceEnumerator.cs \
 	Mono.Data.Sqlite/UnsafeNativeMethods.cs 
 
-DATA_FILES = 
-
-RESOURCES = 
-
-EXTRAS =
-
-REFERENCES =  \
-	System \
-	System.Data \
-	System.Transactions \
-	System.Xml
-
-DLL_REFERENCES = 
-
-CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) 
-
-include $(top_srcdir)/Makefile.include
-
-MONO_DATA_SQLITE_DLL_MDB = $(BUILD_DIR)/Mono.Data.Sqlite.dll.mdb
-
-
-$(eval $(call emit_resgen_targets))
-$(build_xamlg_list): %.xaml.g.cs: %.xaml
-	xamlg '$<'
-
-$(ASSEMBLY_MDB): $(ASSEMBLY)
-
-$(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list)
-	mkdir -p $(shell dirname $(ASSEMBLY))
-	$(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref)
+include $(top_srcdir)/build/build.mk



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