[anjuta] am-project: Check for Makefile.am in source directory, not build directory



commit bff0d05cbd329786447caf411862bb1e2bfa5141
Author: SÃbastien Granjoux <seb sfo free fr>
Date:   Fri Jun 17 21:17:49 2011 +0200

    am-project: Check for Makefile.am in source directory, not build directory

 plugins/build-basic-autotools/build.c |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/plugins/build-basic-autotools/build.c b/plugins/build-basic-autotools/build.c
index e3805b3..345c5ad 100644
--- a/plugins/build-basic-autotools/build.c
+++ b/plugins/build-basic-autotools/build.c
@@ -91,7 +91,27 @@ directory_has_makefile_am (BasicAutotoolsPlugin *bb_plugin,  GFile *dir)
 	g_object_unref (file);
 
 	/* Check for Makefile.am or GNUmakefile.am */
-	file = g_file_get_child (dir,  "Makefile.am");
+	if (g_file_has_prefix (dir, bb_plugin->project_build_dir))
+	{
+		/* Check for Makefile.am in source directory not build directory */
+		gchar *relative;
+		GFile *src_dir;
+
+		relative = g_file_get_relative_path (bb_plugin->project_build_dir, dir);
+		src_dir = g_file_get_child (bb_plugin->project_root_dir, relative);
+		file = g_file_get_child (src_dir,  "Makefile.am");
+		g_object_unref (src_dir);
+		g_free (relative);
+	}
+	else if (g_file_equal (dir, bb_plugin->project_build_dir))
+	{
+		file = g_file_get_child (bb_plugin->project_root_dir,  "Makefile.am");
+	}
+	else
+	{
+		file = g_file_get_child (dir,  "Makefile.am");
+	}
+	
 	if (!g_file_query_exists (file, NULL))
 	{
 		g_object_unref (file);



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