[anjuta] am-project: Partial fix bgo #642784 - New autotools backend has problems with variables in dependenc



commit eff98fdc3def26e884cc860710ebce273ed3b5cc
Author: Sébastien Granjoux <seb sfo free fr>
Date:   Sat Mar 5 21:29:03 2011 +0100

    am-project: Partial fix bgo #642784 - New autotools backend has problems with variables in dependencies

 libanjuta/anjuta-token-stream.c     |   19 +++++++++++++++----
 plugins/am-project/am-parser.y      |    4 ++++
 plugins/am-project/am-project.c     |    3 +++
 plugins/am-project/amp-group.c      |    3 +--
 plugins/am-project/tests/anjuta.lst |   13 ++++++++-----
 5 files changed, 31 insertions(+), 11 deletions(-)
---
diff --git a/libanjuta/anjuta-token-stream.c b/libanjuta/anjuta-token-stream.c
index 577a863..aa58203 100644
--- a/libanjuta/anjuta-token-stream.c
+++ b/libanjuta/anjuta-token-stream.c
@@ -325,10 +325,21 @@ anjuta_token_stream_push (AnjutaTokenStream *parent, AnjutaToken *root, AnjutaTo
 	child->begin = 0;
 	child->parent = parent;
 
-	child->next = anjuta_token_next (content);
-	child->start = child->next;
-	child->last = anjuta_token_last (content);
-	if (child->last == content) child->last = NULL;
+	/* If content is empty, anjuta_token_next returns following token which is
+	 * wrong */
+	if (anjuta_token_is_empty (content))
+	{
+		child->next = NULL;
+		child->start = NULL;
+		child->last = NULL;
+	}
+	else
+	{
+		child->next = anjuta_token_next (content);
+		child->start = child->next;
+		child->last = anjuta_token_last (content);
+		if (child->last == content) child->last = NULL;
+	}
 
 	child->root = root == NULL ? anjuta_token_new_static (ANJUTA_TOKEN_FILE, NULL) : root;
 	if (file == NULL)
diff --git a/plugins/am-project/am-parser.y b/plugins/am-project/am-parser.y
index 6190efd..7aa6477 100644
--- a/plugins/am-project/am-parser.y
+++ b/plugins/am-project/am-parser.y
@@ -224,10 +224,14 @@ definition:
         amp_am_scanner_update_variable (scanner, $$);
 	}
 	| head_list  equal_token {
+		AnjutaToken *list;
+		list = anjuta_token_new_static (ANJUTA_TOKEN_LIST, NULL);
+		anjuta_token_insert_after ($2, list);
 		$$ = anjuta_token_new_static (ANJUTA_TOKEN_DEFINITION, NULL);
         anjuta_token_merge_own_children ($1);
         anjuta_token_merge ($$, $1);
         anjuta_token_merge ($$, $2);
+		anjuta_token_merge ($$, list);
 		amp_am_scanner_update_variable (scanner, $$);
 	}
 	;
diff --git a/plugins/am-project/am-project.c b/plugins/am-project/am-project.c
index 38dc2c6..9c0f2b4 100644
--- a/plugins/am-project/am-project.c
+++ b/plugins/am-project/am-project.c
@@ -1347,6 +1347,9 @@ amp_project_set_am_variable (AmpProject* project, AmpGroupNode* group, AnjutaTok
 	default:
 		break;
 	}
+
+	/* Keep the autotools variable as a normal variable too */
+    amp_group_node_update_variable (group, variable);
 }
 
 /* Map function
diff --git a/plugins/am-project/amp-group.c b/plugins/am-project/amp-group.c
index 8867ef6..d7d56f0 100644
--- a/plugins/am-project/amp-group.c
+++ b/plugins/am-project/amp-group.c
@@ -477,8 +477,7 @@ amp_group_node_update_variable (AmpGroupNode *group, AnjutaToken *variable)
 
 	arg = anjuta_token_first_item (variable);
 	name = g_strstrip (anjuta_token_evaluate (arg));
-	arg = anjuta_token_next_item (arg);
-	value = anjuta_token_next_item (arg);
+	value = anjuta_token_last_item (variable);
 
 	var = (AmpVariable *)g_hash_table_lookup (group->variables, name);
 	if (var != NULL)
diff --git a/plugins/am-project/tests/anjuta.lst b/plugins/am-project/tests/anjuta.lst
index 9b2c05d..4b0ddeb 100644
--- a/plugins/am-project/tests/anjuta.lst
+++ b/plugins/am-project/tests/anjuta.lst
@@ -128,7 +128,7 @@ PROPERTY (URL): http://www.anjuta.org/
             PROPERTY (Installation directories): gladeanjutadir = $(libdir)/glade/modules catalogdir = $(datadir)/glade/catalogs libanjutaincludedir = $(includedir)/libanjuta-3.0/libanjuta pkgconfigdir = $(libdir)/pkgconfig girdir = $(datadir)/gir-1.0 typelibdir = $(libdir)/girepository-1.0
             GROUP (): interfaces
                 PROPERTY (C preprocessor flags): -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\"
-                PROPERTY (Installation directories): libanjuta_interfaces_includedir = $(includedir)/libanjuta-3.0/libanjuta/interfaces idldir = $(libanjuta_interfaces_includedir)
+                PROPERTY (Installation directories): libanjuta_interfaces_includedir = $(includedir)/libanjuta-3.0/libanjuta/interfaces idldir = /libanjuta-3.0/libanjuta/interfaces
                 TARGET (): libanjuta-interfaces.la
                     PROPERTY (Do not install): true
                     PROPERTY (Libraries): $(ANJUTA_LIBS) $(XML_LIBS)
@@ -706,7 +706,8 @@ PROPERTY (URL): http://www.anjuta.org/
                     PROPERTY (Installation directory): plugindir
                     PROPERTY (Linker flags): $(ANJUTA_PLUGIN_LDFLAGS)
                     PROPERTY (Libraries): $(GIO_LIBS) $(LIBANJUTA_LIBS)
-                    SOURCE (): plugins/debug-manager/$(BUILT_SOURCES)
+                    SOURCE (): plugins/debug-manager/anjuta-marshal.c
+                    SOURCE (): plugins/debug-manager/anjuta-marshal.h
                     SOURCE (): plugins/debug-manager/plugin.c
                     SOURCE (): plugins/debug-manager/plugin.h
                     SOURCE (): plugins/debug-manager/start.c
@@ -1389,7 +1390,7 @@ PROPERTY (URL): http://www.anjuta.org/
                     SOURCE (): plugins/language-support-js/prefs.h
             GROUP (): language-support-python
                 PROPERTY (Installation directories): python_plugin_uidir = $(anjuta_ui_dir) python_plugin_gladedir = $(anjuta_glade_dir) python_plugin_pixmapsdir = $(anjuta_image_dir) scriptsdir = $(anjuta_plugin_dir) python_plugin_plugindir = $(anjuta_plugin_dir) plugindir = $(anjuta_plugin_dir)
-                PROPERTY (C preprocessor flags): $(XML_CFLAGS) $(LIBANJUTA_CFLAGS) -DSCRIPTS_DIR=\"$(scriptsdir)\" -DG_LOG_DOMAIN=\"language-support-python\"
+                PROPERTY (C preprocessor flags): $(XML_CFLAGS) $(LIBANJUTA_CFLAGS) -DSCRIPTS_DIR=\" \" -DG_LOG_DOMAIN=\"language-support-python\"
                 TARGET (): python_plugin_ui
                     PROPERTY (Installation directory): python_plugin_uidir
                     SOURCE (): plugins/language-support-python/python-plugin.xml
@@ -1575,7 +1576,8 @@ PROPERTY (URL): http://www.anjuta.org/
                     SOURCE (): plugins/project-manager/project.c
                     SOURCE (): plugins/project-manager/dialogs.c
                     SOURCE (): plugins/project-manager/dialogs.h
-                    SOURCE (): plugins/project-manager/$(BUILT_SOURCES)
+                    SOURCE (): plugins/project-manager/project-marshal.c
+                    SOURCE (): plugins/project-manager/project-marshal.h
             GROUP (): project-wizard
                 PROPERTY (Installation directories): wizard_gladedir = $(anjuta_glade_dir) wizard_uidir = $(anjuta_ui_dir) wizard_pixmapsdir = $(anjuta_image_dir) wizard_plugindir = $(anjuta_plugin_dir) plugindir = $(anjuta_plugin_dir)
                 PROPERTY (C preprocessor flags): $(WARN_CFLAGS) $(DEPRECATED_FLAGS) $(LIBANJUTA_CFLAGS) -DANJUTA_BINDIR=\"$(bindir)\" -DANJUTA_LIBDIR=\"$(libdir)\" -DG_LOG_DOMAIN=\"libanjuta-project-wizard\"
@@ -2075,7 +2077,8 @@ PROPERTY (URL): http://www.anjuta.org/
                     PROPERTY (Linker flags): $(ANJUTA_PLUGIN_LDFLAGS)
                     PROPERTY (Libraries): $(GIO_LIBS) $(SOURCEVIEW_LIBS) $(LIBANJUTA_LIBS)
                     MODULE (): SOURCEVIEW
-                    SOURCE (): plugins/sourceview/$(BUILT_SOURCES)
+                    SOURCE (): plugins/sourceview/anjuta-marshal.c
+                    SOURCE (): plugins/sourceview/anjuta-marshal.h
                     SOURCE (): plugins/sourceview/plugin.c
                     SOURCE (): plugins/sourceview/plugin.h
                     SOURCE (): plugins/sourceview/sourceview.c



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