Am 23.07.2013 07:32 schrieb Andreas Schulze:
> sles9: (autoconf-2.59)
> ----------------------
> autoreconf: /usr/bin/autoconf failed with exit status: 1
> 
> sles10: (autoconf-2.59)
> -----------------------
> autoreconf: /usr/bin/autoconf failed with exit status: 1
> 
> sles11: (autoconf-2.63)
> -----------------------
> autoreconf: automake failed with exit status: 1
> 
> openSUSE_Factory: (autoconf-2.69)
> ---------------------------------
> autoreconf: automake failed with exit status: 1

Hello,

Now I finaly had success compiling the metadata plugin on archaic systems.
First I had to include dovecot.m4 in my dovecot-devel package.
This is unnessesary when building the pigeonhole plugin and so I did not notice 
my packaging fault.

After that I had to apply two patches to the metadata source.
1. Fix configure.ac
 - lower needed autoconf version
 - lower needed automake version
 - add libtool
 - don't use C99 extension

2. As my system have no C99 capable compiler I had to adjust the source
to move the declaration of loop variables outside the loops.

patch && compile && install && work

Thanks to all pointing me in the right direction...
Andreas


-- 
Andreas Schulze
Internetdienste | P252

DATEV eG
90329 Nürnberg | Telefon +49 911 319-0 | Telefax +49 911 319-3196
E-Mail info @datev.de | Internet www.datev.de
Sitz: 90429 Nürnberg, Paumgartnerstr. 6-14 | Registergericht Nürnberg, GenReg 
Nr.70
Vorstand
Prof. Dieter Kempf (Vorsitzender)
Dipl.-Kfm. Wolfgang Stegmann (stellvertretender Vorsitzender)
Dipl.-Kfm. Michael Leistenschneider
Dipl.-Kfm. Dr. Robert Mayr
Jörg Rabe v. Pappenheim
Dipl.-Vw. Eckhard Schwarzer
Vorsitzender des Aufsichtsrates: Reinhard Verholen
Index: dovecot-2.2-metadata/configure.ac
===================================================================
--- dovecot-2.2-metadata.orig/configure.ac	2013-09-03 08:38:54.000000000 +0200
+++ dovecot-2.2-metadata/configure.ac	2013-09-03 11:31:34.000000000 +0200
@@ -1,16 +1,17 @@
-AC_PREREQ(2.65)
+AC_PREREQ(2.59)
 AC_INIT([dovecot-metadata],[14],[devuran...@gmx.net])
 
-AM_INIT_AUTOMAKE([1.10 foreign])
+AM_INIT_AUTOMAKE([1.8 foreign])
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
 
+AC_PROG_LIBTOOL
+
 LT_INIT
 
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_SRCDIR([src])
 
 
-AC_PROG_CC_C99
 AS_IF([test "x$ac_cv_prog_cc_c99" = "xno"],
 	[AC_MSG_ERROR([C99 support required])]
 )
Index: dovecot-2.2-metadata/src/metadata-entry.c
===================================================================
--- dovecot-2.2-metadata.orig/src/metadata-entry.c	2013-09-03 08:38:54.000000000 +0200
+++ dovecot-2.2-metadata/src/metadata-entry.c	2013-09-03 08:41:52.000000000 +0200
@@ -36,6 +36,8 @@
 static
 enum metadata_entry_scope
 parse_scope(const char *name) {
+	int i;
+
 	if (name == NULL)
 		return ENTRY_SCOPE_INVALID;
 
@@ -51,7 +53,7 @@
 	name++;
 
 	/* scope is the first component */
-	for (int i = 0; i < ENTRY_SCOPE_MAX; i++) {
+	for (i = 0; i < ENTRY_SCOPE_MAX; i++) {
 		if (strncasecmp(entry_scopes[i], name, strlen(entry_scopes[i])) == 0)
 			return i;
 	}
@@ -70,6 +72,8 @@
 static
 enum metadata_entry_type
 parse_type(const char *name) {
+	int i;
+
 	/* lazy evaluation of scope existance */
 	if (name == NULL || *name++ != '/')
 		return ENTRY_TYPE_INVALID;
@@ -79,7 +83,7 @@
 	if (name++ == NULL)
 		return ENTRY_TYPE_NONE;
 
-	for (int i = 0; i < ENTRY_TYPE_MAX; i++) {
+	for (i = 0; i < ENTRY_TYPE_MAX; i++) {
 		if (strncasecmp(entry_types[i], name, strlen(entry_types[i])) == 0)
 			return i;
 	}
Index: dovecot-2.2-metadata/src/imap-metadata-plugin.c
===================================================================
--- dovecot-2.2-metadata.orig/src/imap-metadata-plugin.c	2013-09-03 08:42:03.000000000 +0200
+++ dovecot-2.2-metadata/src/imap-metadata-plugin.c	2013-09-03 10:43:06.000000000 +0200
@@ -155,12 +155,13 @@
 bool
 is_valid_rfc5464_entry_name(const char *name) {
 	const char *lastslash = NULL;
+	const char *c;
 
 	if (name == NULL || *name != '/') {
 		return false;
 	}
 
-	for (const char *c = name; *c != '\0'; c++) {
+	for (c = name; *c != '\0'; c++) {
 		// Must not be a command character
 		if (*c >= 0x00 && *c <= 0x19) {
 			return false;
@@ -195,8 +196,9 @@
 bool
 is_valid_rfc5464_vendor_name(const char *name) {
 	int num_components = 3; // "vendor/" already includes the slash of component No3
+	const char *c;
 
-	for (const char *c = name; *c != '\0'; c++) {
+	for (c = name; *c != '\0'; c++) {
 		if (*c == '/') {
 			num_components++;
 		}
@@ -211,10 +213,11 @@
 bool
 is_valid_rfc5464_subtype_name(const char *name, enum metadata_entry_subject subject) {
 	bool found_subtype = false;
+	const char **subtype;
 
 	i_assert(subject > 0 && subject < ENTRY_SUBJECT_MAX);
 
-	for (const char **subtype = entry_subtypes_rfc[subject]; *subtype != NULL; subtype++) {
+	for (*subtype = entry_subtypes_rfc[subject]; *subtype != NULL; subtype++) {
 		size_t subtype_len = strlen(*subtype);
 
 		if (strncasecmp(name, *subtype, subtype_len) == 0
@@ -231,7 +234,9 @@
 static ATTR_NONNULL(1)
 enum metadata_entry_scope
 parse_entry_scope(const char **name) {
-	for (int scope = 0; scope < ENTRY_SCOPE_MAX; scope++) {
+	int scope;
+
+	for (scope = 0; scope < ENTRY_SCOPE_MAX; scope++) {
 		size_t scope_len = strlen(entry_scopes[scope]);
 
 		if (strncasecmp(*name, entry_scopes[scope], scope_len) == 0) {
@@ -248,7 +253,9 @@
 static ATTR_NONNULL(1)
 enum metadata_entry_type
 parse_entry_type(const char **name, enum metadata_entry_subject subject) {
-	for (int type = 0; type < ENTRY_TYPE_MAX; type++) {
+	int type;
+
+	for (type = 0; type < ENTRY_TYPE_MAX; type++) {
 		size_t type_len = strlen(entry_types[type]);
 
 		if (strncasecmp(*name, entry_types[type], type_len) == 0) {
@@ -458,7 +465,8 @@
 			const char *values[optdef->num_values];
 			memset(values, 0, sizeof(*values) * optdef->num_values);
 
-			for (int i = 0; i < optdef->num_values; i++) {
+			int i;
+			for (i = 0; i < optdef->num_values; i++) {
 				if (!imap_arg_get_astring(&arglist[i], &values[i])){
 					const char *estr = t_strdup_printf(
 						"Cannot read value %d/%d of '%s' - string expected. (RFC 5464 Section 4.2)",
@@ -512,7 +520,8 @@
 	int warn_longentries = 0;
 
 	if (str_has_wildcards(mailbox_name)) {
-		for (const struct mail_namespace *ns = cmd->client->user->namespaces; ns != NULL; ns = ns->next) {
+		const struct mail_namespace *ns;
+		for (ns = cmd->client->user->namespaces; ns != NULL; ns = ns->next) {
 			const struct mailbox_info *info = NULL;
 
 			struct mailbox_list_iterate_context *ctx = mailbox_list_iter_init(ns->list, mailbox_name, 0);
Index: dovecot-2.2-metadata/src/imap-annotatemore-plugin.c
===================================================================
--- dovecot-2.2-metadata.orig/src/imap-annotatemore-plugin.c	2013-09-03 11:19:45.000000000 +0200
+++ dovecot-2.2-metadata/src/imap-annotatemore-plugin.c	2013-09-03 11:21:28.000000000 +0200
@@ -134,6 +134,7 @@
 bool
 is_valid_annotatemore_entry_name(const char *name) {
 	const char *lastslash = NULL;
+	const char *c;
 
 	if (name == NULL || *name != '/') {
 		return false;
@@ -144,7 +145,7 @@
 		return false;
 	}
 
-	for (const char *c = name; *c != '\0'; c++) {
+	for (c = name; *c != '\0'; c++) {
 		// Must not be a command character
 		/* NOTE This is stricter than the spec requires, but makes our backend saner */
 		if (*c >= 0x00 && *c <= 0x19) {
@@ -177,8 +178,9 @@
 bool
 is_valid_annotatemore_vendor_name(const char *name) {
 	int num_components = 2; // "vendor/" already includes the slash of component No2
+	const char *c;
 
-	for (const char *c = name; *c != '\0'; c++) {
+	for (c = name; *c != '\0'; c++) {
 		if (*c == '/') {
 			num_components++;
 		}
@@ -192,10 +194,11 @@
 static ATTR_NONNULL(1)
 bool is_valid_annotatemore_subtype_name(const char *name, enum metadata_entry_subject subject) {
 	bool found_subtype = false;
+	const char **subtype;
 
 	i_assert(subject > 0 && subject < ENTRY_SUBJECT_MAX);
 
-	for (const char **subtype = entry_subtypes_rfc[subject]; *subtype != NULL; subtype++) {
+	for (*subtype = entry_subtypes_rfc[subject]; *subtype != NULL; subtype++) {
 		size_t subtype_len = strlen(*subtype);
 
 		if (strncasecmp(name, *subtype, subtype_len) == 0) {
@@ -232,10 +235,12 @@
 static ATTR_NONNULL(1)
 enum metadata_entry_type
 parse_entry_type(const char **name, enum metadata_entry_subject subject) {
+	int type;
+
 	if (**name == '\0')
 		return ENTRY_TYPE_NONE;
 
-	for (int type = 0; type < ENTRY_TYPE_MAX; type++) {
+	for (type = 0; type < ENTRY_TYPE_MAX; type++) {
 		size_t type_len = strlen(entry_types[type]);
 
 		if (strncasecmp(*name, entry_types[type], type_len) == 0) {
@@ -516,7 +521,8 @@
 
 	if (str_has_wildcards(mailbox_name)) {
 		i_debug("metadata: Mailbox '%s' contains wildcards", mailbox_name);
-		for (const struct mail_namespace *ns = cmd->client->user->namespaces; ns != NULL; ns = ns->next) {
+		const struct mail_namespace *ns;
+		for (ns = cmd->client->user->namespaces; ns != NULL; ns = ns->next) {
 			const struct mailbox_info *info = NULL;
 
 			struct mailbox_list_iterate_context *ctx = mailbox_list_iter_init(ns->list, mailbox_name, 0);

Reply via email to