[anjuta] am-project: Allow to read and write LT_INIT



commit b0d652b176cf42982418c783cee8c6548c1d82a2
Author: SÃbastien Granjoux <seb sfo free fr>
Date:   Sat Nov 5 21:24:52 2011 +0100

    am-project: Allow to read and write LT_INIT

 plugins/am-project/ac-parser.y        |   19 +++---
 plugins/am-project/ac-scanner.h       |    3 +-
 plugins/am-project/ac-scanner.l       |    4 +
 plugins/am-project/ac-writer.c        |   98 ++++++++++++++++-----------
 plugins/am-project/am-project.c       |   64 ++++++++++++++----
 plugins/am-project/am-properties.c    |   19 ++++--
 plugins/am-project/projectparser.c    |    2 +-
 plugins/am-project/tests/Makefile.am  |    3 +-
 plugins/am-project/tests/anjuta.lst   |    1 +
 plugins/am-project/tests/ltinit.at    |  118 +++++++++++++++++++++++++++++++++
 plugins/am-project/tests/testsuite.at |    1 +
 11 files changed, 263 insertions(+), 69 deletions(-)
---
diff --git a/plugins/am-project/ac-parser.y b/plugins/am-project/ac-parser.y
index 49cd9a5..84d7e85 100644
--- a/plugins/am-project/ac-parser.y
+++ b/plugins/am-project/ac-parser.y
@@ -105,7 +105,9 @@
 %token	AM_GLIB_GNU_GETTEXT
 %token	AM_MAINTAINER_MODE
 %token	AM_PROG_LIBTOOL
+%token	AC_PROG_LIBTOOL
 %token	LT_INIT
+%token	DEFAULT_LT_INIT
 %token	LT_PREREQ
 %token	PKG_CHECK_MODULES
 %token	PKG_PROG_PKG_CONFIG
@@ -167,8 +169,10 @@ amp_ac_autoconf_macro (AnjutaToken *token)
 	case AM_INIT_AUTOMAKE:		return AC_TOKEN_AM_INIT_AUTOMAKE;
 	case AM_GLIB_GNU_GETTEXT:	return AC_TOKEN_AM_GLIB_GNU_GETTEXT;
 	case AM_MAINTAINER_MODE:	return AC_TOKEN_AM_MAINTAINER_MODE;
+	case AC_PROG_LIBTOOL:		return AC_TOKEN_AC_PROG_LIBTOOL;
 	case AM_PROG_LIBTOOL:		return AC_TOKEN_AM_PROG_LIBTOOL;
 	case LT_INIT:				return AC_TOKEN_LT_INIT;
+	case DEFAULT_LT_INIT:		return AC_TOKEN_LT_INIT;
 	case LT_PREREQ:				return AC_TOKEN_LT_PREREQ;
 	case PKG_CHECK_MODULES:		return AC_TOKEN_PKG_CHECK_MODULES;
 	case PKG_PROG_PKG_CONFIG:	return AC_TOKEN_PKG_PROG_PKG_CONFIG;
@@ -282,7 +286,6 @@ macro:
     include
 	| ac_macro_with_arg
 	| ac_macro_without_arg
-    | ac_init
 	| ac_subst
 	| pkg_check_modules
 	| obsolete_ac_output
@@ -379,23 +382,16 @@ ac_macro_with_arg:
 		$$ = anjuta_token_new_static (amp_ac_autoconf_macro ($1), NULL);
 		anjuta_token_merge ($$, $1);
 		anjuta_token_merge ($$, $2);
+        amp_ac_scanner_load_properties (scanner, $$, $2);
 	}
 	;
 
 ac_macro_without_arg:
 	ac_macro_without_arg_token {
 		anjuta_token_set_type ($1, amp_ac_autoconf_macro ($1));
+        amp_ac_scanner_load_properties (scanner, $$, NULL);
 	}
 
-ac_init:
-    AC_INIT arg_list {
-		$$ = anjuta_token_new_static (AC_TOKEN_AC_INIT, NULL);
-		anjuta_token_merge ($$, $1);
-		anjuta_token_merge ($$, $2);
-        amp_ac_scanner_load_properties (scanner, $1, $2);
-    }
-	;
-
 ac_subst:
 	AC_SUBST arg_list {
 		$$ = anjuta_token_new_static (AC_TOKEN_AC_SUBST, NULL);
@@ -952,6 +948,8 @@ ac_macro_without_arg_token:
 	| AC_TYPE_OFF_T
 	| AM_MAINTAINER_MODE
 	| AM_PROG_LIBTOOL
+	| AC_PROG_LIBTOOL
+	| DEFAULT_LT_INIT
 	;
 
 ac_macro_with_arg_token:
@@ -966,6 +964,7 @@ ac_macro_with_arg_token:
 	| AC_CONFIG_SRCDIR
 	| AC_EGREP_HEADER
 	| AC_PREREQ
+	| AC_INIT
 	| IT_PROG_INTLTOOL
 	| AM_INIT_AUTOMAKE
 	| AM_GLIB_GNU_GETTEXT
diff --git a/plugins/am-project/ac-scanner.h b/plugins/am-project/ac-scanner.h
index 18b3851..379c6ac 100644
--- a/plugins/am-project/ac-scanner.h
+++ b/plugins/am-project/ac-scanner.h
@@ -74,8 +74,9 @@ enum
 	AC_TOKEN_AC_PROG_RANLIB,
 	AC_TOKEN_IT_PROG_INTLTOOL,
 	AC_TOKEN_LT_PREREQ,
-	AC_TOKEN_AM_PROG_LIBTOOL,
 	AC_TOKEN_LT_INIT,
+	AC_TOKEN_AM_PROG_LIBTOOL,
+	AC_TOKEN_AC_PROG_LIBTOOL,
 	AC_TOKEN_PKG_PROG_PKG_CONFIG,
 	AC_TOKEN_AC_CHECK_PROG,
 	AC_TOKEN_AM_GLIB_GNU_GETTEXT,
diff --git a/plugins/am-project/ac-scanner.l b/plugins/am-project/ac-scanner.l
index efb0bb0..9347f25 100644
--- a/plugins/am-project/ac-scanner.l
+++ b/plugins/am-project/ac-scanner.l
@@ -178,6 +178,8 @@ IT_PROG_INTLTOOL\(		{ RETURN (IT_PROG_INTLTOOL);}
 
 AC_PROG_LEX				{ RETURN (AC_PROG_LEX);}
 
+AC_PROG_LIBTOOL			{ RETURN (AC_PROG_LIBTOOL);}
+
 AC_PROG_RANLIB			{ RETURN (AC_PROG_RANLIB);}
 
 AC_PROG_YACC			{ RETURN (AC_PROG_YACC);}
@@ -198,6 +200,8 @@ AM_PROG_LIBTOOL			{ RETURN (AM_PROG_LIBTOOL);}
 
 LT_INIT\(				{ RETURN (LT_INIT);}
 
+LT_INIT					{ RETURN (DEFAULT_LT_INIT);}
+
 LT_PREREQ\(				{ RETURN (LT_PREREQ);}
 
 PKG_CHECK_MODULES\(     { RETURN (PKG_CHECK_MODULES); }
diff --git a/plugins/am-project/ac-writer.c b/plugins/am-project/ac-writer.c
index db51589..1da7333 100644
--- a/plugins/am-project/ac-writer.c
+++ b/plugins/am-project/ac-writer.c
@@ -24,6 +24,8 @@
 #include <config.h>
 #endif
 
+#include <string.h>
+
 #include "ac-writer.h"
 #include "ac-scanner.h"
 #include "ac-parser.h"
@@ -208,57 +210,75 @@ amp_project_update_ac_property (AmpProject *project, AnjutaProjectProperty *prop
 	AnjutaToken *arg;
 	AnjutaToken *args;
 	AmpProperty *prop;
-	guint pos;
-	const gchar *value;
 
-	pos = ((AmpProperty *)property)->position;
-	value = ((AmpProperty *)property)->base.value;
+	if (((property->native->value == NULL) && (property->value == NULL)) ||
+	    (g_strcmp0 (property->native->value, property->value) == 0))
+	{
+		/* Remove property */
+		prop = (AmpProperty *)property;
 
-	prop = find_similar_property (ANJUTA_PROJECT_NODE (project), (AmpProperty *)property);
-	args = prop != NULL ? prop->token : NULL;
+		if (prop->position == -1)
+		{
+			token = prop->token;
 
-	if (args == NULL)
+			anjuta_token_remove_list (anjuta_token_list (token));
+		}
+
+		anjuta_project_node_remove_property (ANJUTA_PROJECT_NODE (project), property);
+	}
+	else
 	{
-		gint types[] = {AC_TOKEN_AC_PREREQ, 0};
-		AnjutaToken *group;
-		AnjutaToken *configure;
+		prop = find_similar_property (ANJUTA_PROJECT_NODE (project), (AmpProperty *)property);
+		args = prop != NULL ? prop->token : NULL;
 
-		configure = amp_project_get_configure_token (project);
-		token = find_tokens (configure, types);
-		if (token == NULL)
+		prop = (AmpProperty *)property;
+
+		if (args == NULL)
 		{
-			token = skip_comment (configure);
+			AnjutaToken *group;
+			AnjutaToken *configure;
+			const char *suffix;
+
+			configure = amp_project_get_configure_token (project);
+			token = anjuta_token_find_position (configure, TRUE, prop->token_type, NULL);
 			if (token == NULL)
 			{
-				token = anjuta_token_append_child (configure, anjuta_token_new_string (COMMENT | ANJUTA_TOKEN_ADDED, "#"));
-				token = anjuta_token_insert_after (token, anjuta_token_new_string (SPACE | ANJUTA_TOKEN_ADDED, " Created by Anjuta project manager"));
-				token = anjuta_token_insert_after (token, anjuta_token_new_string (END_OF_LINE | ANJUTA_TOKEN_ADDED, "\n"));
-				token = anjuta_token_insert_after (token, anjuta_token_new_string (END_OF_LINE | ANJUTA_TOKEN_ADDED, "\n"));
+				token = skip_comment (configure);
+				if (token == NULL)
+				{
+					token = anjuta_token_append_child (configure, anjuta_token_new_string (COMMENT | ANJUTA_TOKEN_ADDED, "#"));
+					token = anjuta_token_insert_after (token, anjuta_token_new_string (SPACE | ANJUTA_TOKEN_ADDED, " Created by Anjuta project manager"));
+					token = anjuta_token_insert_after (token, anjuta_token_new_string (END_OF_LINE | ANJUTA_TOKEN_ADDED, "\n"));
+					token = anjuta_token_insert_after (token, anjuta_token_new_string (END_OF_LINE | ANJUTA_TOKEN_ADDED, "\n"));
+				}
+			}
+
+			suffix = ((AmpProperty *)prop->base.native)->suffix;
+			token = anjuta_token_insert_after (token, anjuta_token_new_string (AC_TOKEN_AC_INIT | ANJUTA_TOKEN_ADDED, suffix));
+			if (suffix[strlen(suffix) - 1] == '(')
+			{
+				group = anjuta_token_insert_after (token, anjuta_token_new_static (ANJUTA_TOKEN_LIST | ANJUTA_TOKEN_ADDED, NULL));
+				args = group;
+				token = anjuta_token_insert_after (group, anjuta_token_new_static (ANJUTA_TOKEN_LAST | ANJUTA_TOKEN_ADDED, NULL));
+				anjuta_token_merge (group, token);
 			}
+			anjuta_token_insert_after (token, anjuta_token_new_string (END_OF_LINE | ANJUTA_TOKEN_ADDED, "\n"));
 		}
+		if (args != NULL)
+		{
+			guint pos;
+
+			token = anjuta_token_new_string (ANJUTA_TOKEN_NAME | ANJUTA_TOKEN_ADDED, prop->base.value);
+			arg = anjuta_token_insert_before (token, anjuta_token_new_static (ANJUTA_TOKEN_ITEM | ANJUTA_TOKEN_ADDED, NULL));
+			anjuta_token_merge (arg, token);
 
-		token = anjuta_token_insert_before (token, anjuta_token_new_string (AC_TOKEN_AC_INIT | ANJUTA_TOKEN_ADDED, "AC_INIT("));
-		group = anjuta_token_insert_after (token, anjuta_token_new_static (ANJUTA_TOKEN_LIST | ANJUTA_TOKEN_ADDED, NULL));
-		args = group;
-		token = anjuta_token_insert_after (group, anjuta_token_new_static (ANJUTA_TOKEN_LAST | ANJUTA_TOKEN_ADDED, NULL));
-		anjuta_token_merge (group, token);
-		anjuta_token_insert_after (token, anjuta_token_new_string (END_OF_LINE | ANJUTA_TOKEN_ADDED, "\n"));
-		//fprintf(stdout, "whole file\n");
-		//anjuta_token_dump (project->configure_token);
+			pos = prop->position;
+			if (pos == -1) pos = 0;
+			anjuta_token_replace_nth_word (args, pos, arg);
+			anjuta_token_style_format (project->arg_list, args);
+		}
 	}
-	//fprintf(stdout, "ac_init before replace\n");
-	//anjuta_token_dump (project->args);
-	token = anjuta_token_new_string (ANJUTA_TOKEN_NAME | ANJUTA_TOKEN_ADDED, value);
-	arg = anjuta_token_insert_before (token, anjuta_token_new_static (ANJUTA_TOKEN_ITEM | ANJUTA_TOKEN_ADDED, NULL));
-	anjuta_token_merge (arg, token);
-	anjuta_token_replace_nth_word (args, pos, arg);
-	//fprintf(stdout, "ac_init after replace\n");
-	//anjuta_token_dump (project->args);
-	//fprintf(stdout, "ac_init after replace link\n");
-	//anjuta_token_dump_link (project->args);
-	anjuta_token_style_format (project->arg_list, args);
-	//fprintf(stdout, "ac_init after update link\n");
-	//anjuta_token_dump (project->args);
+
 	amp_project_update_configure (project, token);
 
 	return TRUE;
diff --git a/plugins/am-project/am-project.c b/plugins/am-project/am-project.c
index e74aa3c..4c822cc 100644
--- a/plugins/am-project/am-project.c
+++ b/plugins/am-project/am-project.c
@@ -672,15 +672,15 @@ void
 amp_project_load_properties (AmpProject *project, AnjutaToken *macro, AnjutaToken *args)
 {
 	GList *item;
+	gint type = anjuta_token_get_type (macro);
 
 	for (item = anjuta_project_node_get_native_properties (ANJUTA_PROJECT_NODE (project)); item != NULL; item = g_list_next (item))
 	{
 		AmpProperty *prop = (AmpProperty *)item->data;
 
-		if ((prop->position >= 0) && (prop->token_type == AC_TOKEN_AC_INIT))
+		if ((prop->token_type == type) && (prop->flags & AM_PROPERTY_IN_CONFIGURE))
 		{
 			AnjutaProjectProperty *new_prop;
-			AnjutaToken *arg;
 
 			new_prop = anjuta_project_node_remove_property (ANJUTA_PROJECT_NODE (project), (AnjutaProjectProperty *)prop);
 			if (new_prop != NULL)
@@ -688,12 +688,35 @@ amp_project_load_properties (AmpProject *project, AnjutaToken *macro, AnjutaToke
 				amp_property_free (new_prop);
 			}
 			new_prop = amp_property_new (NULL, prop->token_type, prop->position, NULL, args);
-			arg = anjuta_token_nth_word (args, prop->position);
-			if ((new_prop->value != NULL) && (new_prop->value != prop->base.value))
+
+			if (prop->position >= 0)
 			{
-				g_free (new_prop->value);
+				/* Each parameter correspond to a different property */
+				AnjutaToken *arg;
+
+				arg = anjuta_token_nth_word (args, prop->position);
+				if ((new_prop->value != NULL) && (new_prop->value != prop->base.value))
+				{
+					g_free (new_prop->value);
+				}
+				new_prop->value = anjuta_token_evaluate (arg);
+			}
+			else
+			{
+				/* Property value is whole argument */
+				if (args == NULL)
+				{
+					new_prop->value = g_strdup(" ");
+				}
+				else
+				{
+					AnjutaToken *arg;
+
+					arg = anjuta_token_nth_word (args, 0);
+					new_prop->value = anjuta_token_evaluate (arg);
+					if (new_prop->value == NULL) new_prop->value = g_strdup(" ");
+				}
 			}
-			new_prop->value = anjuta_token_evaluate (arg);
 			anjuta_project_node_insert_property (ANJUTA_PROJECT_NODE (project), (AnjutaProjectProperty *)prop, new_prop);
 		}
 	}
@@ -1603,7 +1626,6 @@ amp_project_load_root (AmpProject *project, GError **error)
 {
 	AmpAcScanner *scanner;
 	AnjutaToken *arg;
-	AmpGroupNode *group;
 	GFile *root_file;
 	GFile *configure_file;
 	AnjutaTokenFile *configure_token_file;
@@ -2247,15 +2269,29 @@ static PmCommandWork amp_set_property_job = {amp_set_property_setup, amp_set_pro
 static gboolean
 amp_remove_property_setup (PmJob *job)
 {
-	anjuta_project_node_set_state (job->node, ANJUTA_PROJECT_REMOVED);
-
 	return TRUE;
 }
 
 static gboolean
 amp_remove_property_work (PmJob *job)
 {
-	return FALSE;
+	gint flags;
+
+	flags = ((AmpProperty *)job->property->native)->flags;
+
+	if (flags & AM_PROPERTY_IN_CONFIGURE)
+	{
+		amp_project_update_ac_property (AMP_PROJECT (job->user_data), job->property);
+	}
+	else if (flags & AM_PROPERTY_IN_MAKEFILE)
+	{
+		if (((AnjutaProjectProperty *)job->property->native)->flags & ANJUTA_PROJECT_PROPERTY_READ_WRITE)
+		{
+			amp_project_update_am_property (AMP_PROJECT (job->user_data), job->node, job->property);
+		}
+	}
+
+	return TRUE;
 }
 
 static gboolean
@@ -2369,12 +2405,16 @@ iproject_set_property (IAnjutaProject *obj, AnjutaProjectNode *node, AnjutaProje
 static gboolean
 iproject_remove_property (IAnjutaProject *obj, AnjutaProjectNode *node, AnjutaProjectProperty *property, GError **error)
 {
+	AnjutaProjectProperty *new_prop;
 	PmJob *remove_property_job;
 
 	if (AMP_PROJECT (obj)->queue == NULL) AMP_PROJECT (obj)->queue = pm_command_queue_new ();
 
-	remove_property_job = pm_job_new (&amp_remove_property_job, node, NULL, NULL, ANJUTA_PROJECT_UNKNOWN, NULL, NULL, obj);
-	remove_property_job->property = property;
+
+	new_prop = amp_node_property_set (node, property, NULL);
+	new_prop->value = new_prop->native->value;
+	remove_property_job = pm_job_new (&amp_set_property_job, node, NULL, NULL, ANJUTA_PROJECT_UNKNOWN, NULL, NULL, obj);
+	remove_property_job->property = new_prop;
 	pm_command_queue_push (AMP_PROJECT (obj)->queue, remove_property_job);
 
 	return TRUE;
diff --git a/plugins/am-project/am-properties.c b/plugins/am-project/am-properties.c
index f49302e..9036f51 100644
--- a/plugins/am-project/am-properties.c
+++ b/plugins/am-project/am-properties.c
@@ -50,7 +50,7 @@ static AmpProperty AmpProjectProperties[] =
 			ANJUTA_PROJECT_PROPERTY_STRING,
 			ANJUTA_PROJECT_PROPERTY_READ_WRITE,
 		N_("Project name, it can contain spaces by example 'GNU Autoconf'")},
-		AC_TOKEN_AC_INIT, 0, NULL,
+		AC_TOKEN_AC_INIT, 0, "AC_INIT(",
 		AM_PROPERTY_IN_CONFIGURE
 	},
 	{
@@ -59,7 +59,7 @@ static AmpProperty AmpProjectProperties[] =
 			ANJUTA_PROJECT_PROPERTY_STRING,
 			ANJUTA_PROJECT_PROPERTY_READ_WRITE,
 		N_("Project version, typically a few numbers separated by dot by example '1.0.0'")},
-		AC_TOKEN_AC_INIT, 1, NULL,
+		AC_TOKEN_AC_INIT, 1, "AC_INIT(",
 		AM_PROPERTY_IN_CONFIGURE
 	},
 	{
@@ -68,7 +68,7 @@ static AmpProperty AmpProjectProperties[] =
 			ANJUTA_PROJECT_PROPERTY_STRING,
 			ANJUTA_PROJECT_PROPERTY_READ_WRITE,
 		N_("An email address or a link to a web page where the user can report bug. It is optional.")},
-		AC_TOKEN_AC_INIT, 2, NULL,
+		AC_TOKEN_AC_INIT, 2, "AC_INIT(",
 		AM_PROPERTY_IN_CONFIGURE
 	},
 	{
@@ -78,7 +78,7 @@ static AmpProperty AmpProjectProperties[] =
 			ANJUTA_PROJECT_PROPERTY_READ_WRITE,
 		N_("Package name, it can contains only alphanumerics and underscore characters."
 		   "It is generated from the project name if not provided.")},
-		AC_TOKEN_AC_INIT, 3, NULL,
+		AC_TOKEN_AC_INIT, 3, "AC_INIT(",
 		AM_PROPERTY_IN_CONFIGURE
 	},
 	{
@@ -87,7 +87,16 @@ static AmpProperty AmpProjectProperties[] =
 			ANJUTA_PROJECT_PROPERTY_STRING,
 			ANJUTA_PROJECT_PROPERTY_READ_WRITE,
 		N_("An link to the project web page if provided.")},
-		AC_TOKEN_AC_INIT, 4, NULL,
+		AC_TOKEN_AC_INIT, 4, "AC_INIT(",
+		AM_PROPERTY_IN_CONFIGURE
+	},
+	{
+		{"LT_INIT",
+		N_("Libtool support:"),
+			ANJUTA_PROJECT_PROPERTY_LIST,
+			ANJUTA_PROJECT_PROPERTY_READ_WRITE,
+			N_("Add support to compile shared and static libraries with libtool.")},
+		AC_TOKEN_LT_INIT, -1, "LT_INIT(",
 		AM_PROPERTY_IN_CONFIGURE
 	},
 	{
diff --git a/plugins/am-project/projectparser.c b/plugins/am-project/projectparser.c
index c50358d..e968c1e 100644
--- a/plugins/am-project/projectparser.c
+++ b/plugins/am-project/projectparser.c
@@ -727,7 +727,7 @@ main(int argc, char *argv[])
 				item = get_project_property (project, node, command[2]);
 				if (item != NULL)
 				{
-					ianjuta_project_set_property (project, node, item, NULL, NULL);
+					ianjuta_project_remove_property (project, node, item, NULL);
 				}
 			}
 			command += 2;
diff --git a/plugins/am-project/tests/Makefile.am b/plugins/am-project/tests/Makefile.am
index 822e168..9210af9 100644
--- a/plugins/am-project/tests/Makefile.am
+++ b/plugins/am-project/tests/Makefile.am
@@ -33,7 +33,8 @@ TESTSUITE_AT = \
 	$(srcdir)/target_module.at \
 	$(srcdir)/data_target.at \
 	$(srcdir)/bugs.at \
-	$(srcdir)/nemiver.at
+	$(srcdir)/nemiver.at \
+	$(srcdir)/ltinit.at
 
 TESTSUITE = $(srcdir)/testsuite
 
diff --git a/plugins/am-project/tests/anjuta.lst b/plugins/am-project/tests/anjuta.lst
index dd2a9da..ccc4562 100644
--- a/plugins/am-project/tests/anjuta.lst
+++ b/plugins/am-project/tests/anjuta.lst
@@ -4,6 +4,7 @@ ROOT (): anjuta
     PROPERTY (Bug report URL): http://bugzilla.gnome.org/enter_bug.cgi?product=anjuta
     PROPERTY (Package name): anjuta
     PROPERTY (URL): http://www.anjuta.org/
+    PROPERTY (Libtool support): disable-static
     PROPERTY (Installation directories): anjutadocdir = $(docdir) anjuta_datadir = $(datadir)/anjuta gnomemenudir = $(datadir)/applications
     MODULE (): ANJUTA
         PACKAGE (): gthread-2.0
diff --git a/plugins/am-project/tests/ltinit.at b/plugins/am-project/tests/ltinit.at
new file mode 100644
index 0000000..3c945d0
--- /dev/null
+++ b/plugins/am-project/tests/ltinit.at
@@ -0,0 +1,118 @@
+AT_SETUP([Read and Write LT_INIT macro])
+AS_MKDIR_P([empty])
+AT_DATA([empty/configure.ac],
+[[AC_INIT(empty)
+AC_CONFIG_FILES(Makefile)
+]])
+AT_DATA([empty/Makefile.am],
+[[
+]])
+AT_DATA([expect],
+[[ROOT (): empty1
+    PROPERTY (Name): empty
+    PROPERTY (Libtool support):
+]])
+AT_DATA([reference],
+[[AC_INIT(empty)
+LT_INIT()
+AC_CONFIG_FILES(Makefile)
+]])
+AT_PARSER_CHECK([load empty \
+		 move empty1 \
+		 set 0 LT_INIT ""\
+		 list \
+		 save])
+AT_CHECK([diff -b empty1/configure.ac reference])
+AT_PARSER_CHECK([load empty1 \
+		list])
+AT_CHECK([diff -b output expect])
+
+
+
+AT_DATA([expect],
+[[ROOT (): empty2
+     PROPERTY (Name): empty
+     PROPERTY (Libtool support): disable-shared
+]])
+AT_DATA([reference],
+[[AC_INIT(empty)
+LT_INIT(disable-shared)
+AC_CONFIG_FILES(Makefile)
+]])
+AT_PARSER_CHECK([load empty1 \
+		 move empty2 \
+		 set 0 LT_INIT "disable-shared" \
+		 list \
+		 save])
+AT_CHECK([diff -b empty2/configure.ac reference])
+AT_PARSER_CHECK([load empty2 \
+		list])
+AT_CHECK([diff -b output expect])
+
+
+
+AT_DATA([expect],
+[[ROOT (): empty3
+    PROPERTY (Name): empty
+    PROPERTY (Libtool support): disable-shared pic-only
+]])
+AT_DATA([reference],
+[[AC_INIT(empty)
+LT_INIT(disable-shared pic-only)
+AC_CONFIG_FILES(Makefile)
+]])
+AT_PARSER_CHECK([load empty2 \
+		 move empty3 \
+		 set 0 LT_INIT "disable-shared pic-only" \
+		 list \
+		 save])
+AT_CHECK([diff -b empty3/configure.ac reference])
+AT_PARSER_CHECK([load empty3 \
+		list])
+AT_CHECK([diff -b output expect])
+
+
+
+AT_DATA([expect],
+[[ROOT (): empty4
+    PROPERTY (Name): empty
+    PROPERTY (Libtool support): pic-only
+]])
+AT_DATA([reference],
+[[AC_INIT(empty)
+LT_INIT(pic-only)
+AC_CONFIG_FILES(Makefile)
+]])
+AT_PARSER_CHECK([load empty3 \
+		 move empty4 \
+		 set 0 LT_INIT "pic-only" \
+		 list \
+		 save])
+AT_CHECK([diff -b empty4/configure.ac reference])
+AT_PARSER_CHECK([load empty4 \
+		list])
+AT_CHECK([diff -b output expect])
+
+
+
+AT_DATA([expect],
+[[ROOT (): empty5
+    PROPERTY (Name): empty
+]])
+AT_DATA([reference],
+[[AC_INIT(empty)
+AC_CONFIG_FILES(Makefile)
+]])
+AT_PARSER_CHECK([load empty4 \
+		 move empty5 \
+		 clear 0 LT_INIT \
+		 list \
+		 save])
+AT_CHECK([diff -b empty5/configure.ac reference])
+AT_PARSER_CHECK([load empty5 \
+		list])
+AT_CHECK([diff -b output expect])
+
+
+
+AT_CLEANUP
diff --git a/plugins/am-project/tests/testsuite.at b/plugins/am-project/tests/testsuite.at
index acceb5e..0ae2274 100644
--- a/plugins/am-project/tests/testsuite.at
+++ b/plugins/am-project/tests/testsuite.at
@@ -14,3 +14,4 @@ m4_include([target_module.at])
 m4_include([data_target.at])
 m4_include([bugs.at])
 m4_include([nemiver.at])
+m4_include([ltinit.at])



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