Commit cc72de56 cc72de5624595044fe97caebcd15648ef26b7797 by Sergey Poznyakoff

New command line argument "sieve"

1 parent e0a6ed03
...@@ -32,8 +32,8 @@ static struct argp_option options[] = { ...@@ -32,8 +32,8 @@ static struct argp_option options[] = {
32 {"compile", 'c', NULL, 0, 32 {"compile", 'c', NULL, 0,
33 N_("Print C compiler flags to compile with"), 0}, 33 N_("Print C compiler flags to compile with"), 0},
34 {"link", 'l', NULL, 0, 34 {"link", 'l', NULL, 0,
35 N_("Print libraries to link with. Possible arguments are: auth, guile, all, " 35 N_("Print libraries to link with. Possible arguments are: auth, guile, "
36 "mbox, mh, maildir, imap, pop"), 0}, 36 "mbox, mh, maildir, imap, pop, sieve and all"), 0},
37 {"info", 'i', NULL, 0, 37 {"info", 'i', NULL, 0,
38 N_("Print a list of configuration options used to build mailutils. If arguments " 38 N_("Print a list of configuration options used to build mailutils. If arguments "
39 "are given, they are interpreted as a list of configuration options to check " 39 "are given, they are interpreted as a list of configuration options to check "
...@@ -91,29 +91,31 @@ static const char *argp_capa[] = { ...@@ -91,29 +91,31 @@ static const char *argp_capa[] = {
91 }; 91 };
92 92
93 #ifdef WITH_TLS 93 #ifdef WITH_TLS
94 # define TLSAUTH 1 94 # define NEEDAUTH 1
95 #else 95 #else
96 # define TLSAUTH 0 96 # define NEEDAUTH 0
97 #endif 97 #endif
98 #define NOTALL 2
98 99
99 struct lib_descr { 100 struct lib_descr {
100 char *name; 101 char *name;
101 char *libname; 102 char *libname;
102 int needauth; 103 int flags;
103 } lib_descr[] = { 104 } lib_descr[] = {
104 { "mbox", "mu_mbox", 0 }, 105 { "mbox", "mu_mbox", 0 },
105 { "mh", "mu_mh", 0 }, 106 { "mh", "mu_mh", 0 },
106 { "maildir","mu_maildir", 0 }, 107 { "maildir","mu_maildir", 0 },
107 { "imap", "mu_imap", TLSAUTH }, 108 { "imap", "mu_imap", NEEDAUTH },
108 { "pop", "mu_pop", TLSAUTH }, 109 { "pop", "mu_pop", NEEDAUTH },
109 { "nntp", "mu_nntp", 0 }, 110 { "nntp", "mu_nntp", 0 },
111 { "sieve", "sieve", NOTALL },
110 { NULL } 112 { NULL }
111 }; 113 };
112 114
113 struct lib_entry { 115 struct lib_entry {
114 int level; 116 int level;
115 char *ptr; 117 char *ptr;
116 } lib_entry[10]; 118 } lib_entry[16];
117 119
118 int nentry; 120 int nentry;
119 121
...@@ -208,9 +210,11 @@ main (int argc, char **argv) ...@@ -208,9 +210,11 @@ main (int argc, char **argv)
208 210
209 for (p = lib_descr; p->name; p++) 211 for (p = lib_descr; p->name; p++)
210 { 212 {
213 if (p->flags & NOTALL)
214 continue;
211 asprintf (&ptr, "-l%s", p->libname); 215 asprintf (&ptr, "-l%s", p->libname);
212 add_entry (0, ptr); 216 add_entry (0, ptr);
213 if (p->needauth) 217 if (p->flags & NEEDAUTH)
214 add_entry (2, "-lmuauth " AUTHLIBS); 218 add_entry (2, "-lmuauth " AUTHLIBS);
215 } 219 }
216 } 220 }
...@@ -226,7 +230,7 @@ main (int argc, char **argv) ...@@ -226,7 +230,7 @@ main (int argc, char **argv)
226 { 230 {
227 asprintf (&ptr, "-l%s", p->libname); 231 asprintf (&ptr, "-l%s", p->libname);
228 add_entry (0, ptr); 232 add_entry (0, ptr);
229 if (p->needauth) 233 if (p->flags & NEEDAUTH)
230 add_entry (2, "-lmuauth " AUTHLIBS); 234 add_entry (2, "-lmuauth " AUTHLIBS);
231 } 235 }
232 else 236 else
......