aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-multipart.c
blob: 84e4ecd5c5da2cec44676746f6f5bfbd5bfd82e6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* camel-multipart.c : Abstract class for a multipart */


/*
 *
 * Author :
 *  Bertrand Guiheneuf <bertrand@helixcode.com>
 *
 * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of version 2 of the GNU General Public
 * License as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 * USA
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <string.h> /* strlen() */
#include <unistd.h> /* for getpid */
#include <time.h>   /* for time */
#include <errno.h>

#include "camel-stream-mem.h"
#include "camel-multipart.h"
#include "camel-mime-part.h"
#include "camel-exception.h"
#include "md5-utils.h"

#define d(x)

static gboolean              is_offline        (CamelDataWrapper *data_wrapper);
static void                  add_part          (CamelMultipart *multipart,
                        CamelMimePart *part);
static void                  add_part_at       (CamelMultipart *multipart,
                        CamelMimePart *part,
                        guint index);
static void                  remove_part       (CamelMultipart *multipart,
                        CamelMimePart *part);
static CamelMimePart *       remove_part_at    (CamelMultipart *multipart,
                        guint index);
static CamelMimePart *       get_part          (CamelMultipart *multipart,
                        guint index);
static guint                 get_number        (CamelMultipart *multipart);
static void                  set_boundary      (CamelMultipart *multipart,
                        const char *boundary);
static const gchar *         get_boundary      (CamelMultipart *multipart);
static int                   write_to_stream   (CamelDataWrapper *data_wrapper,
                        CamelStream *stream);
static void                  unref_part        (gpointer data, gpointer user_data);

static int construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *mp);

static CamelDataWrapperClass *parent_class = NULL;



/* Returns the class for a CamelMultipart */
#define CMP_CLASS(so) CAMEL_MULTIPART_CLASS (CAMEL_OBJECT_GET_CLASS(so))

/* Returns the class for a CamelDataWrapper */
#define CDW_CLASS(so) CAMEL_DATA_WRAPPER_CLASS (CAMEL_OBJECT_GET_CLASS(so))


static void
camel_multipart_class_init (CamelMultipartClass *camel_multipart_class)
{
    CamelDataWrapperClass *camel_data_wrapper_class =
        CAMEL_DATA_WRAPPER_CLASS (camel_multipart_class);

    parent_class = (CamelDataWrapperClass *) camel_data_wrapper_get_type ();

    /* virtual method definition */
    camel_multipart_class->add_part = add_part;
    camel_multipart_class->add_part_at = add_part_at;
    camel_multipart_class->remove_part = remove_part;
    camel_multipart_class->remove_part_at = remove_part_at;
    camel_multipart_class->get_part = get_part;
    camel_multipart_class->get_number = get_number;
    camel_multipart_class->set_boundary = set_boundary;
    camel_multipart_class->get_boundary = get_boundary;
    camel_multipart_class->construct_from_parser = construct_from_parser;

    /* virtual method overload */
    camel_data_wrapper_class->write_to_stream = write_to_stream;
    camel_data_wrapper_class->is_offline = is_offline;
}

static void
camel_multipart_init (gpointer object, gpointer klass)
{
    CamelMultipart *multipart = CAMEL_MULTIPART (object);

    camel_data_wrapper_set_mime_type (CAMEL_DATA_WRAPPER (multipart),
                      "multipart/mixed");
    multipart->preface = NULL;
    multipart->postface = NULL;
}

static void
camel_multipart_finalize (CamelObject *object)
{
    CamelMultipart *multipart = CAMEL_MULTIPART (object);

    g_list_foreach (multipart->parts, unref_part, NULL);

    /*if (multipart->boundary)
      g_free (multipart->boundary);*/
    if (multipart->preface)
        g_free (multipart->preface);
    if (multipart->postface)
        g_free (multipart->postface);
}


CamelType
camel_multipart_get_type (void)
{
    static CamelType camel_multipart_type = CAMEL_INVALID_TYPE;

    if (camel_multipart_type == CAMEL_INVALID_TYPE) {
        camel_multipart_type = camel_type_register (camel_data_wrapper_get_type (), "CamelMultipart",
                                sizeof (CamelMultipart),
                                sizeof (CamelMultipartClass),
                                (CamelObjectClassInitFunc) camel_multipart_class_init,
                                NULL,
                                (CamelObjectInitFunc) camel_multipart_init,
                                (CamelObjectFinalizeFunc) camel_multipart_finalize);
    }

    return camel_multipart_type;
}

static void
unref_part (gpointer data, gpointer user_data)
{
    CamelObject *part = CAMEL_OBJECT (data);

    camel_object_unref (part);
}

/**
 * camel_multipart_new:
 *
 * Create a new CamelMultipart object.
 *
 * Return value: a new CamelMultipart
 **/
CamelMultipart *
camel_multipart_new (void)
{
    CamelMultipart *multipart;

    multipart = (CamelMultipart *)camel_object_new (CAMEL_MULTIPART_TYPE);
    multipart->preface = NULL;
    multipart->postface = NULL;

    return multipart;
}


static void
add_part (CamelMultipart *multipart, CamelMimePart *part)
{
    multipart->parts = g_list_append (multipart->parts, part);
    camel_object_ref (CAMEL_OBJECT (part));
}

/**
 * camel_multipart_add_part:
 * @multipart: a CamelMultipart
 * @part: the part to add
 *
 * Appends the part to the multipart object.
 **/
void
camel_multipart_add_part (CamelMultipart *multipart, CamelMimePart *part)
{
    g_return_if_fail (CAMEL_IS_MULTIPART (multipart));
    g_return_if_fail (CAMEL_IS_MIME_PART (part));

    CMP_CLASS (multipart)->add_part (multipart, part);
}


static void
add_part_at (CamelMultipart *multipart, CamelMimePart *part, guint index)
{
    multipart->parts = g_list_insert (multipart->parts, part, index);
    camel_object_ref (CAMEL_OBJECT (part));
}

/**
 * camel_multipart_add_part_at:
 * @multipart: a CamelMultipart
 * @part: the part to add
 * @index: index to add the multipart at
 *
 * Adds the part to the multipart object after the @index'th
 * element. If @index is greater than the number of parts, it is
 * equivalent to camel_multipart_add_part().
 **/
void
camel_multipart_add_part_at (CamelMultipart *multipart,
                 CamelMimePart *part, guint index)
{
    g_return_if_fail (CAMEL_IS_MULTIPART (multipart));
    g_return_if_fail (CAMEL_IS_MIME_PART (part));

    CMP_CLASS (multipart)->add_part_at (multipart, part, index);
}


static void
remove_part (CamelMultipart *multipart, CamelMimePart *part)
{
    if (!multipart->parts)
        return;
    multipart->parts = g_list_remove (multipart->parts, part);
    camel_object_unref (CAMEL_OBJECT (part));
}

/**
 * camel_multipart_remove_part:
 * @multipart: a CamelMultipart
 * @part: the part to remove
 *
 * Removes @part from @multipart.
 **/
void
camel_multipart_remove_part (CamelMultipart *multipart,
                 CamelMimePart *part)
{
    g_return_if_fail (CAMEL_IS_MULTIPART (multipart));
    g_return_if_fail (CAMEL_IS_MIME_PART (part));

    CMP_CLASS (multipart)->remove_part (multipart, part);
}


static CamelMimePart *
remove_part_at (CamelMultipart *multipart, guint index)
{
    GList *parts_list;
    GList *part_to_remove;
    CamelMimePart *removed_part;

    if (!(multipart->parts))
        return NULL;

    parts_list = multipart->parts;
    part_to_remove = g_list_nth (parts_list, index);
    if (!part_to_remove) {
        g_warning ("CamelMultipart::remove_part_at: "
               "part to remove is NULL\n");
        return NULL;
    }
    removed_part = CAMEL_MIME_PART (part_to_remove->data);

    multipart->parts = g_list_remove_link (parts_list, part_to_remove);
    if (part_to_remove->data)
        camel_object_unref (CAMEL_OBJECT (part_to_remove->data));
    g_list_free_1 (part_to_remove);

    return removed_part;
}

/**
 * camel_multipart_remove_part_at:
 * @multipart: a CamelMultipart
 * @index: a zero-based index indicating the part to remove
 *
 * Remove the indicated part from the multipart object.
 *
 * Return value: the removed part. Note that it is camel_object_unref()ed
 * before being returned, which may cause it to be destroyed.
 **/
CamelMimePart *
camel_multipart_remove_part_at (CamelMultipart *multipart, guint index)
{
    g_return_val_if_fail (CAMEL_IS_MULTIPART (multipart), NULL);

    return CMP_CLASS (multipart)->remove_part_at (multipart, index);
}


static CamelMimePart *
get_part (CamelMultipart *multipart, guint index)
{
    GList *part;

    if (!(multipart->parts))
        return NULL;

    part = g_list_nth (multipart->parts, index);
    if (part)
        return CAMEL_MIME_PART (part->data);
    else
        return NULL;
}

/**
 * camel_multipart_get_part:
 * @multipart: a CamelMultipart
 * @index: a zero-based index indicating the part to get
 *
 * Return value: the indicated subpart, or %NULL
 **/
CamelMimePart *
camel_multipart_get_part (CamelMultipart *multipart, guint index)
{
    g_return_val_if_fail (CAMEL_IS_MULTIPART (multipart), NULL);

    return CMP_CLASS (multipart)->get_part (multipart, index);
}


static guint
get_number (CamelMultipart *multipart)
{
    return g_list_length (multipart->parts);
}

/**
 * camel_multipart_get_number:
 * @multipart: a CamelMultipart
 *
 * Return value: the number of subparts in @multipart
 **/
guint
camel_multipart_get_number (CamelMultipart *multipart)
{
    g_return_val_if_fail (CAMEL_IS_MULTIPART (multipart), 0);

    return CMP_CLASS (multipart)->get_number (multipart);
}


static void
set_boundary (CamelMultipart *multipart, const char *boundary)
{
    CamelDataWrapper *cdw = CAMEL_DATA_WRAPPER (multipart);
    char *bgen, digest[16], bbuf[27], *p;
    int state, save;

    g_return_if_fail (cdw->mime_type != NULL);

    if (!boundary) {
        /* Generate a fairly random boundary string. */
        bgen = g_strdup_printf ("%p:%lu:%lu", multipart,
                    (unsigned long) getpid(),
                    (unsigned long) time(0));
        md5_get_digest (bgen, strlen (bgen), digest);
        g_free (bgen);
        strcpy (bbuf, "=-");
        p = bbuf + 2;
        state = save = 0;
        p += base64_encode_step (digest, 16, FALSE, p, &state, &save);
        *p = '\0';

        boundary = bbuf;
    }

    header_content_type_set_param (cdw->mime_type, "boundary", boundary);
}

/**
 * camel_multipart_set_boundary:
 * @multipart: a CamelMultipart
 * @boundary: the message boundary, or %NULL
 *
 * Sets the message boundary for @multipart to @boundary. This should
 * be a string which does not occur anywhere in any of @multipart's
 * subparts. If @boundary is %NULL, a randomly-generated boundary will
 * be used.
 **/
void
camel_multipart_set_boundary (CamelMultipart *multipart, const char *boundary)
{
    g_return_if_fail (CAMEL_IS_MULTIPART (multipart));

    CMP_CLASS (multipart)->set_boundary (multipart, boundary);
}


static const gchar *
get_boundary (CamelMultipart *multipart)
{
    CamelDataWrapper *cdw = CAMEL_DATA_WRAPPER (multipart);

    g_return_val_if_fail (cdw->mime_type != NULL, NULL);
    return header_content_type_param (cdw->mime_type, "boundary");
}

/**
 * camel_multipart_get_boundary:
 * @multipart: a CamelMultipart
 *
 * Return value: @multipart's message boundary
 **/
const gchar *
camel_multipart_get_boundary (CamelMultipart *multipart)
{
    return CMP_CLASS (multipart)->get_boundary (multipart);
}

static gboolean
is_offline (CamelDataWrapper *data_wrapper)
{
    CamelMultipart *multipart = CAMEL_MULTIPART (data_wrapper);
    GList *node;
    CamelDataWrapper *part;

    if (parent_class->is_offline (data_wrapper))
        return TRUE;
    for (node = multipart->parts; node; node = node->next) {
        part = node->data;
        if (camel_data_wrapper_is_offline (part))
            return TRUE;
    }

    return FALSE;
}

/* this is MIME specific, doesn't belong here really */
static int
write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
{
    CamelMultipart *multipart = CAMEL_MULTIPART (data_wrapper);
    const gchar *boundary;
    int total = 0;
    int count;
    GList *node;

    /* get the bundary text */
    boundary = camel_multipart_get_boundary (multipart);
    
    /* we cannot write a multipart without a boundary string */
    g_return_val_if_fail (boundary, -1);
    
    /*
     * write the preface text (usually something like
     *   "This is a mime message, if you see this, then
     *    your mail client probably doesn't support ...."
     */
    if (multipart->preface) {
        count = camel_stream_write_string (stream, multipart->preface);
        if (count == -1)
            return -1;
        total += count;
    }

    /*
     * Now, write all the parts, separated by the boundary
     * delimiter
     */
    node = multipart->parts;
    while (node) {
        count = camel_stream_printf (stream, "\n--%s\n", boundary);
        if (count == -1)
            return -1;
        total += count;

        count = camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (node->data), stream);
        if (count == -1)
            return -1;
        total += count;
        node = node->next;
    }

    /* write the terminating boudary delimiter */
    count = camel_stream_printf (stream, "\n--%s--\n", boundary);
    if (count == -1)
        return -1;
    total += count;

    /* and finally the postface */
    if (multipart->postface) {
        count = camel_stream_write_string (stream, multipart->postface);
        if (count == -1)
            return -1;
        total += count;
    }

    return total;
}

/**
 * camel_multipart_set_preface:
 * @multipart: 
 * @preface: 
 * 
 * Set the preface text for this multipart.  Will be written out infront
 * of the multipart.  This text should only include US-ASCII strings, and
 * be relatively short, and will be ignored by any MIME mail client.
 **/
void
camel_multipart_set_preface(CamelMultipart *multipart, const char *preface)
{
    if (multipart->preface != preface) {
        g_free(multipart->preface);
        if (preface)
            multipart->preface = g_strdup(preface);
        else
            multipart->preface = NULL;
    }
}

/**
 * camel_multipart_set_postface:
 * @multipart: 
 * @postface: 
 * 
 * Set the postfix text for this multipart.  Will be written out after
 * the last boundary of the multipart, and ignored by any MIME mail
 * client.
 *
 * Generally postface texts should not be sent with multipart messages.
 **/
void
camel_multipart_set_postface(CamelMultipart *multipart, const char *postface)
{
    if (multipart->postface != postface) {
        g_free(multipart->postface);
        if (postface)
            multipart->postface = g_strdup(postface);
        else
            multipart->postface = NULL;
    }
}

static int
construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *mp)
{
    int err;
    struct _header_content_type *content_type;
    CamelMimePart *bodypart;
    char *buf;
    unsigned int len;

    g_assert(camel_mime_parser_state(mp) == HSCAN_MULTIPART);
        
    /* FIXME: we should use a came-mime-mutlipart, not jsut a camel-multipart, but who cares */
    d(printf("Creating multi-part\n"));
        
    content_type = camel_mime_parser_content_type(mp);
    camel_multipart_set_boundary(multipart,
                     header_content_type_param(content_type, "boundary"));
    
    while (camel_mime_parser_step(mp, &buf, &len) != HSCAN_MULTIPART_END) {
        camel_mime_parser_unstep(mp);
        bodypart = camel_mime_part_new();
        camel_mime_part_construct_from_parser(bodypart, mp);
        camel_multipart_add_part(multipart, bodypart);
        camel_object_unref((CamelObject *)bodypart);
    }
    
    /* these are only return valid data in the MULTIPART_END state */
    camel_multipart_set_preface(multipart, camel_mime_parser_preface (mp));
    camel_multipart_set_postface(multipart, camel_mime_parser_postface (mp));
    
    err = camel_mime_parser_errno(mp);
    if (err != 0) {
        errno = err;
        return -1;
    } else
        return 0;
}

int
camel_multipart_construct_from_parser(CamelMultipart *multipart, struct _CamelMimeParser *mp)
{
    g_return_val_if_fail(CAMEL_IS_MULTIPART(multipart), -1);

    return CMP_CLASS(multipart)->construct_from_parser(multipart, mp);
}
le="color:#3a3935">(socklen_t,int)])]) dnl dnl Purify support dnl EVO_PURIFY_SUPPORT dnl ************** dnl Test Component dnl ************** AC_ARG_ENABLE(test-component, [ --enable-test-component=[no/yes] Enable test component.],enable_test_comp="$enableval",enable_test_comp=no) AM_CONDITIONAL(ENABLE_TEST_COMPONENT, test "x$enable_test_comp" = "xyes") dnl *************** dnl Timezone checks dnl *************** AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff, AC_TRY_COMPILE([ #include <time.h> ], [ struct tm tm; tm.tm_gmtoff = 1; ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)) if test $ac_cv_struct_tm_gmtoff = yes; then AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has a tm_gmtoff member]) else AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone, AC_TRY_COMPILE([ #include <time.h> ], [ timezone = 1; ], ac_cv_var_timezone=yes, ac_cv_var_timezone=no)) if test $ac_cv_var_timezone = yes; then AC_DEFINE(HAVE_TIMEZONE, 1, [Define if libc defines a timezone variable]) AC_CACHE_CHECK(for altzone variable, ac_cv_var_altzone, AC_TRY_COMPILE([ #include <time.h> ], [ altzone = 1; ], ac_cv_var_altzone=yes, ac_cv_var_altzone=no)) if test $ac_cv_var_altzone = yes; then AC_DEFINE(HAVE_ALTZONE, 1, [Define if libc defines an altzone variable]) fi else AC_ERROR(unable to find a way to determine timezone) fi fi AC_CHECK_FUNCS(mkstemp mkdtemp isblank) dnl ************************************************** dnl ctime_r prototype dnl ************************************************** AC_CACHE_CHECK([if ctime_r wants three arguments], ac_cv_ctime_r_three_args, [ AC_TRY_COMPILE([ #include <time.h> ],[ char *buf; time_t date; ctime_r (&date, buf, 100); ],[ ac_cv_ctime_r_three_args=yes ],[ ac_cv_ctime_r_three_args=no ]) ]) if test x"$ac_cv_ctime_r_three_args" = xyes ; then AC_DEFINE(CTIME_R_THREE_ARGS, 1, [Solaris-style ctime_r]) fi dnl ************************************************** dnl gethostbyname_r prototype dnl ************************************************** AC_CHECK_FUNCS(gethostbyname_r,[ AC_CACHE_CHECK([if gethostbyname_r wants five arguments], ac_cv_gethostbyname_r_five_args, [ AC_TRY_COMPILE([ #include "confdefs.h" #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #define BUFSIZE (sizeof(struct hostent)+10) ],[ struct hostent hent; char buffer[BUFSIZE]; int bufsize=BUFSIZE; int h_errno; (void)gethostbyname_r ("www.ximian.com", &hent, buffer, bufsize, &h_errno); ],[ ac_cv_gethostbyname_r_five_args=yes ],[ ac_cv_gethostbyname_r_five_args=no ]) ])]) if test "x$ac_cv_gethostbyname_r_five_args" = "xyes" ; then AC_DEFINE(GETHOSTBYNAME_R_FIVE_ARGS, 1, [Solaris-style gethostbyname_r]) fi dnl ************************************************** dnl gethostbyaddr_r prototype dnl ************************************************** AC_CHECK_FUNCS(gethostbyaddr_r,[ AC_CACHE_CHECK([if gethostbyaddr_r wants seven arguments], ac_cv_gethostbyaddr_r_seven_args, [ AC_TRY_COMPILE([ #include "confdefs.h" #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #define BUFSIZE (sizeof(struct hostent)+10) ],[ struct hostent hent; char buffer[BUFSIZE]; int bufsize=BUFSIZE; int h_errno; (void)gethostbyaddr_r ("www.ximian.com", 14, AF_INET, &hent, buffer, bufsize, &h_errno); ],[ ac_cv_gethostbyaddr_r_seven_args=yes ],[ ac_cv_gethostbyaddr_r_seven_args=no ]) ])]) if test "x$ac_cv_gethostbyaddr_r_seven_args" = "xyes" ; then AC_DEFINE(GETHOSTBYADDR_R_SEVEN_ARGS, 1, [Solaris-style gethostbyaddr_r]) fi dnl ************************************************** dnl stat(v)fs location/type dnl ************************************************** AC_CHECK_HEADERS(sys/statvfs.h) AC_CHECK_FUNCS(statvfs) AC_CHECK_HEADERS(sys/param.h) AC_CHECK_HEADERS(sys/mount.h) AC_CHECK_FUNCS(statfs) dnl ************************************************** dnl * Gnome Icon Theme dnl ************************************************** PKG_CHECK_MODULES(GIT, gnome-icon-theme >= 1.2.0) dnl ************************************************** dnl * Accessibility support dnl ************************************************** PKG_CHECK_MODULES(A11Y, atk) AC_SUBST(A11Y_CFLAGS) AC_SUBST(A11Y_LIBS) dnl ************************************************** dnl LDAP support. dnl ************************************************** if test "$os_win32" != yes; then EVO_LDAP_CHECK(no) case $with_openldap in no) msg_ldap=no ;; *) case $with_static_ldap in yes) msg_ldap="yes (static)" ;; *) msg_ldap="yes (dynamic)" ;; esac esac SAVE_CFLAGS="$CFLAGS" SAVE_LIBS="$LIBS" LDAP_CFLAGS="-DLDAP_DEPRECATED" CFLAGS="$CFLAGS $LDAP_CFLAGS" LIBS="$LIBS $LDAP_LIBS" AC_CHECK_FUNCS(ldap_ntlm_bind) CFLAGS="$SAVE_CFLAGS" LIBS="$SAVE_LIBS" else # Win32 LDAP_CFLAGS="-DLDAP_DEPRECATED" LDAP_LIBS="-lwldap32" AC_SUBST(LDAP_CFLAGS) AC_SUBST(LDAP_LIBS) AC_DEFINE(HAVE_LDAP,1,[Define if you have LDAP support]) AM_CONDITIONAL(ENABLE_LDAP, true) msg_ldap="yes" fi # Win32 dnl ************************************************** dnl NNTP support. dnl ************************************************** AC_ARG_ENABLE(nntp, [ --enable-nntp=[no/yes] Build Usenet news (NNTP) backend],,enable_nntp=yes) if test "x$enable_nntp" = "xyes"; then AC_DEFINE(ENABLE_NNTP,1,[Build NNTP backend]) msg_nntp=yes else msg_nntp=no fi AM_CONDITIONAL(ENABLE_NNTP, test x$enable_nntp = xyes) dnl ************************************************** dnl New IMAP code support. dnl ************************************************** AC_ARG_ENABLE(imapp, [ --enable-imapp=[no/yes] Attempt to compile alternative, incomplete, very unsupported IMAPv4r1 code],,enable_imapp=no) if test "x$enable_imapp" = "xyes"; then AC_DEFINE(ENABLE_IMAPP,1,[Really don't try this at home]) msg_imapp=yes else msg_imapp=no fi AM_CONDITIONAL(ENABLE_IMAPP, test x$enable_imapp = xyes) dnl ************************************************** dnl New IMAP code support. dnl ************************************************** AC_ARG_ENABLE(imap4, [ --enable-imap4=[no/yes] Attempt to compile yet another, incomplete, very unsupported IMAPv4r1 implementation],,enable_imap4="yes") if test "x$enable_imap4" = "xyes"; then AC_DEFINE(ENABLE_IMAP4,1,[Really don't try this at home]) msg_imap4=yes else msg_imap4=no fi AM_CONDITIONAL(ENABLE_IMAP4, test x$enable_imap4 = xyes) dnl ************************************************** dnl * Posix thread support dnl ************************************************** dnl GLIB_CONFIG=${GLIB_CONFIG-glib-config} dnl GNOME_PTHREAD_CHECK dnl if test "x$PTHREAD_LIB" = "x" ; then dnl AC_MSG_ERROR([POSIX threads are currently required for Evolution]) dnl fi dnl dnl Notice that this is a hack, and we wont be able to use this forever, but dnl at least for some time dnl EVO_PTHREAD_CHECK THREADS_LIBS="$PTHREAD_LIB" THREADS_CFLAGS="$PTHREAD_CFLAGS" AC_SUBST(THREADS_LIBS) AC_SUBST(THREADS_CFLAGS) AC_DEFINE(ENABLE_THREADS,1,[Required]) dnl ********* dnl Libraries dnl ********* AC_CHECK_FUNCS(regexec,,[AC_CHECK_LIB(regex,regexec, [REGEX_LIBS=-lregex AC_DEFINE(HAVE_REGEXEC,1,[Define to 1 if you have the regexec function.])], [AC_MSG_ERROR([No regex library found])])]) AC_SUBST(REGEX_LIBS) PKG_CHECK_MODULES(GTKHTML, libgtkhtml-3.8) AC_SUBST(GTKHTML_CFLAGS) AC_SUBST(GTKHTML_LIBS) GTKHTML_DATADIR=`$PKG_CONFIG --variable gtkhtml_datadir libgtkhtml-3.8` AC_SUBST(GTKHTML_DATADIR) GTKHTML_API_VERSION=`$PKG_CONFIG --variable gtkhtml_apiversion libgtkhtml-3.8` AC_DEFINE_UNQUOTED(GTKHTML_API_VERSION, "$GTKHTML_API_VERSION", [The gtkhtml api version]) dnl ****************************** dnl Pilot checking dnl ****************************** AC_ARG_ENABLE(pilot-conduits, [ --enable-pilot-conduits=[no/yes] Enable support for building pilot conduits.],,enable_pilot_conduits=no) if test "x$enable_pilot_conduits" = "xyes"; then PKG_CHECK_MODULES(GNOME_PILOT, gnome-pilot-2.0) CFLAGS_save="$CFLAGS" CFLAGS="$CFLAGS $GNOME_PILOT_CFLAGS" LDFLAGS_save="$LDFLAGS" LDFLAGS="$LDFLAGS $GNOME_PILOT_LIBS" AC_CACHE_CHECK([if pilot-link handles UTF-8 conversions], ac_cv_pilot_link_utf8, AC_TRY_RUN([ #include <stdlib.h> #include <string.h> #include <pi-util.h> int main (int argc, char **argv) { const char *utf8 = "\x66\x66\x66\x66\x66\x66\x66\xC2\xA9"; size_t utf8_real_len = strlen (utf8); char *pstring; if (convert_ToPilotChar ("UTF-8", utf8, utf8_real_len, &pstring) == -1) exit (1); exit (0); } ], ac_cv_pilot_link_utf8=yes, ac_cv_pilot_link_utf8=no, ac_cv_pilot_link_utf8=no)) CFLAGS="$CFLAGS_save" LDFLAGS="$LDFLAGS_save" if test "$ac_cv_pilot_link_utf8" = no; then AC_MSG_ERROR(evolution requires pilot-link to have working UTF-8 conversion routines) fi fi AM_CONDITIONAL(ENABLE_PILOT_CONDUITS, test "x$enable_pilot_conduits" = "xyes") if test x$enable_pilot_conduits = xyes; then msg_pilot=yes else msg_pilot=no fi AC_SUBST(GNOME_PILOT_CFLAGS) AC_SUBST(GNOME_PILOT_LIBS) dnl ******** dnl Kerberos dnl ******** AC_ARG_WITH(krb5, [ --with-krb5=DIR Location of Kerberos 5 install dir], with_krb5="$withval", with_krb5="no") AC_ARG_WITH(krb5-libs, [ --with-krb5-libs=DIR Location of Kerberos 5 libraries], with_krb5_libs="$withval", with_krb5_libs="$with_krb5/lib") AC_ARG_WITH(krb5-includes, [ --with-krb5-includes=DIR Location of Kerberos 5 headers], with_krb5_includes="$withval", with_krb5_includes="") AC_ARG_WITH(krb4, [ --with-krb4=DIR Location of Kerberos 4 install dir], with_krb4="$withval", with_krb4="no") AC_ARG_WITH(krb4-libs, [ --with-krb4-libs=DIR Location of Kerberos 4 libraries], with_krb4_libs="$withval", with_krb4_libs="$with_krb4/lib") AC_ARG_WITH(krb4-includes, [ --with-krb4-includes=DIR Location of Kerberos 4 headers], with_krb4_includes="$withval", with_krb4_includes="") msg_krb5="no" if test "x${with_krb5}" != "xno"; then LDFLAGS_save="$LDFLAGS" mitlibs="-lkrb5 -lk5crypto -lcom_err -lgssapi_krb5" heimlibs="-lkrb5 -lcrypto -lasn1 -lcom_err -lroken -lgssapi" AC_CACHE_CHECK([for Kerberos 5], ac_cv_lib_kerberos5, [ LDFLAGS="$LDFLAGS -L$with_krb5_libs $mitlibs" AC_TRY_LINK_FUNC(krb5_init_context, ac_cv_lib_kerberos5="$mitlibs", [ LDFLAGS="$LDFLAGS_save -L$with_krb5_libs $heimlibs" AC_TRY_LINK_FUNC(krb5_init_context, ac_cv_lib_kerberos5="$heimlibs", ac_cv_lib_kerberos5="no") ]) LDFLAGS="$LDFLAGS_save" ]) if test "$ac_cv_lib_kerberos5" != "no"; then AC_DEFINE(HAVE_KRB5,1,[Define if you have Krb5]) if test "$ac_cv_lib_kerberos5" = "$mitlibs"; then AC_DEFINE(HAVE_MIT_KRB5,1,[Define if you have MIT Krb5]) if test -z "$with_krb5_includes"; then KRB5_CFLAGS="-I$with_krb5/include" else KRB5_CFLAGS="-I$with_krb5_includes" fi msg_krb5="yes (MIT)" else AC_DEFINE(HAVE_HEIMDAL_KRB5,1,[Define if you have Heimdal]) if test -z "$with_krb5_includes"; then KRB5_CFLAGS="-I$with_krb5/include/heimdal" else KRB5_CFLAGS="-I$with_krb5_includes" fi msg_krb5="yes (Heimdal)" fi KRB5_LDFLAGS="-L$with_krb5_libs $ac_cv_lib_kerberos5" fi else AC_MSG_CHECKING(for Kerberos 5) AC_MSG_RESULT($with_krb5) fi AC_CHECK_HEADER([et/com_err.h],[AC_DEFINE([HAVE_ET_COM_ERR_H], 1, [Have et/comm_err.h])]) AC_CHECK_HEADER([com_err.h],[AC_DEFINE([HAVE_COM_ERR_H], 1, [Have comm_err.h])]) msg_krb4="no" if test "x${with_krb4}" != "xno"; then LDFLAGS_save="$LDFLAGS" AC_CACHE_CHECK(for Kerberos 4, ac_cv_lib_kerberos4, [ ac_cv_lib_kerberos4="no" mitcompatlibs="-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err" # Look for MIT krb5 compat krb4 LDFLAGS="$LDFLAGS -L$with_krb4_libs $mitcompatlibs" AC_TRY_LINK_FUNC(krb_mk_req, ac_cv_lib_kerberos4="$mitcompatlibs") if test "$ac_cv_lib_kerberos4" = "no"; then # Look for KTH krb4 LDFLAGS="$LDFLAGS_save -L$with_krb4_libs -lkrb -lcrypto -lcom_err -lroken" AC_TRY_LINK_FUNC(krb_mk_req, ac_cv_lib_kerberos4="-lkrb -lcrypto -lcom_err -lroken") fi if test "$ac_cv_lib_kerberos4" = "no"; then # Look for old MIT krb4 LDFLAGS="$LDFLAGS_save -L$with_krb4_libs -lkrb" AC_TRY_LINK_FUNC(krb_mk_req, ac_cv_lib_kerberos4="-lkrb", [ LDFLAGS="$LDFLAGS -ldes" AC_TRY_LINK_FUNC(krb_mk_req, ac_cv_lib_kerberos4="-lkrb -ldes") ]) fi ]) LDFLAGS="$LDFLAGS_save" if test "$ac_cv_lib_kerberos4" != "no"; then AC_DEFINE(HAVE_KRB4,1,[Define if you have Krb4]) msg_krb4="yes" if test -z "$with_krb4_includes"; then if test -f "$with_krb4/include/krb.h" -o -f "$with_krb4/include/port-sockets.h"; then KRB4_CFLAGS="-I$with_krb4/include" fi if test -d "$with_krb4/include/kerberosIV"; then KRB4_CFLAGS="$KRB4_CFLAGS -I$with_krb4/include/kerberosIV" fi else KRB4_CFLAGS="-I$with_krb4_includes" fi KRB4_LDFLAGS="-L$with_krb4_libs $ac_cv_lib_kerberos4" CFLAGS_save="$CFLAGS" CFLAGS="$CFLAGS $KRB4_CFLAGS" AC_TRY_COMPILE([#include "krb.h" int krb_sendauth; ],[return 0],[AC_DEFINE(NEED_KRB_SENDAUTH_PROTO,1,[Need krb_sendauth proto])],) CFLAGS="$CFLAGS_save" fi else AC_MSG_CHECKING(for Kerberos 4) AC_MSG_RESULT(${with_krb4}) fi AC_SUBST(KRB5_CFLAGS) AC_SUBST(KRB5_LDFLAGS) AC_SUBST(KRB4_CFLAGS) AC_SUBST(KRB4_LDFLAGS) dnl Mono hooks dnl This should just define mono CFLAGS etc here, it is used later to dnl turn on the mono plugin or not. AC_ARG_ENABLE(mono, [ --enable-mono=[yes,no] Add Mono embedded hooks.], enable_mono="$enableval", enable_mono="no") if test "x${enable_mono}" = "xyes"; then AC_DEFINE(ENABLE_MONO,1,[Define if Mono embedding should be enabled]) mono_package="mono" MONO_PLUGIN="mono" fi dnl ******************************************************************************** dnl security extension support (SSL and S/MIME) dnl dnl The following voodoo does detection of mozilla libraries (nspr and nss) dnl needed by Camel (SSL and S/MIME). dnl dnl The Evolution security extensions are only built if these libraries are found dnl ******************************************************************************** msg_ssl="no" msg_smime="no" dnl these 2 enable's are inverses of each other AC_ARG_ENABLE(nss, [ --enable-nss=[yes,no,static] Attempt to use Mozilla libnss for SSL support.], enable_nss="$enableval", enable_nss="yes") AC_ARG_ENABLE(smime, [ --enable-smime=[yes,no] Attempt to use Mozilla libnss for SMIME support (this requires --enable-nss)], enable_smime="$enableval", enable_smime="yes") AC_ARG_WITH(nspr-includes, [ --with-nspr-includes=PREFIX Location of Mozilla nspr4 includes.], with_nspr_includes="$withval") AC_ARG_WITH(nspr-libs, [ --with-nspr-libs=PREFIX Location of Mozilla nspr4 libs.], with_nspr_libs="$withval") AC_ARG_WITH(nss-includes, [ --with-nss-includes=PREFIX Location of Mozilla nss3 includes.], with_nss_includes="$withval") AC_ARG_WITH(nss-libs, [ --with-nss-libs=PREFIX Location of Mozilla nss3 libs.], with_nss_libs="$withval") if test "x${enable_nss}" = "xyes" || test "x${enable_nss}" = "xstatic"; then if test -n "${with_nspr_includes}" || test -n "${with_nspr_libs}" || test -n "${with_nss_includes}" || test -n "${with_nss_libs}" || test "x${enable_nss}" = "xstatic"; then check_manually="yes" else check_manually="no" fi if test "x${check_manually}" = "xno"; then AC_MSG_CHECKING(Mozilla NSPR pkg-config module name) mozilla_nspr_pcs="nspr mozilla-nspr firefox-nspr" for pc in $mozilla_nspr_pcs; do if $PKG_CONFIG --exists $pc; then AC_MSG_RESULT($pc) mozilla_nspr=$pc break; fi done AC_MSG_CHECKING(Mozilla NSS pkg-config module name) mozilla_nss_pcs="nss mozilla-nss firefox-nss" for pc in $mozilla_nss_pcs; do if $PKG_CONFIG --exists $pc; then AC_MSG_RESULT($pc) mozilla_nss=$pc break; fi done if test -n "$mozilla_nspr" -a -n "$mozilla_nss"; then msg_ssl="yes (Mozilla NSS)" if test "x$enable_smime" = "xyes"; then AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled]) msg_smime="yes (Mozilla NSS)" fi AC_DEFINE(HAVE_NSS,1,[Define if you have NSS]) AC_DEFINE(HAVE_SSL,1,[Define if you have a supported SSL library]) AC_DEFINE_UNQUOTED(MOZILLA_NSS_LIB_DIR,"`$PKG_CONFIG --variable=libdir $mozilla_nss`",[Define to the full path of mozilla nss library]) MANUAL_NSPR_CFLAGS="" MANUAL_NSPR_LIBS="" MANUAL_NSS_CFLAGS="" MANUAL_NSS_LIBS="" else check_manually="yes" mozilla_nspr="" mozilla_nss="" fi fi if test "x${check_manually}" = "xyes"; then mozilla_nss="" have_nspr_includes="no" if test "x${with_nspr_includes}" != "xno"; then CPPFLAGS_save="$CPPFLAGS" AC_MSG_CHECKING(for Mozilla nspr4 includes in $with_nspr_includes) AC_MSG_RESULT("") CPPFLAGS="$CPPFLAGS -I$with_nspr_includes" AC_CHECK_HEADERS(nspr.h prio.h, [ moz_nspr_includes="yes" ]) CPPFLAGS="$CPPFLAGS_save" if test "x{$moz_nspr_includes}" != "xno" -a "x{$moz_nspr_includes}" != "x" ; then have_nspr_includes="yes" MANUAL_NSPR_CFLAGS="-I$with_nspr_includes" fi else AC_MSG_CHECKING(for Mozilla nspr4 includes) AC_MSG_RESULT(no) fi have_nspr_libs="no" if test "x${with_nspr_libs}" != "xno" -a "x${have_nspr_includes}" != "xno"; then CFLAGS_save="$CFLAGS" LDFLAGS_save="$LDFLAGS" if test "$enable_nss" = "static"; then if test -z "${with_nspr_libs}"; then AC_MSG_ERROR([Static linkage requested, but path to nspr libraries not set.] [Please specify the path to libnspr4.a] [Example: --with-nspr-libs=/usr/lib]) else nsprlibs="$DL_LIB $with_nspr_libs/libplc4.a $with_nspr_libs/libplds4.a $with_nspr_libs/libnspr4.a $PTHREAD_LIB" fi else nsprlibs="$DL_LIB -lplc4 -lplds4 -lnspr4 $PTHREAD_LIB" fi AC_CACHE_CHECK([for Mozilla nspr libraries], moz_nspr_libs, [ LIBS_save="$LIBS" CFLAGS="$CFLAGS $MANUAL_NSPR_CFLAGS" if test "x${with_nspr_libs}" != "x"; then LIBS="$nsprlibs" LDFLAGS="$LDFLAGS -L$with_nspr_libs" else LIBS="$nsprlibs" LDFLAGS="$LDFLAGS" fi AC_TRY_LINK_FUNC(PR_Init, moz_nspr_libs="yes", moz_nspr_libs="no") CFLAGS="$CFLAGS_save" LDFLAGS="$LDFLAGS_save" LIBS="$LIBS_save" ]) if test "x$moz_nspr_libs" != "xno"; then have_nspr_libs="yes" MANUAL_NSPR_LIBS="-L$with_nspr_libs $nsprlibs" else MANUAL_NSPR_CLFAGS="" fi else AC_MSG_CHECKING(for Mozilla nspr4 libraries) AC_MSG_RESULT(no) fi if test "x${with_nss_includes}" != "xno" -a "x${have_nspr_libs}" != "xno"; then CPPFLAGS_save="$CPPFLAGS" AC_MSG_CHECKING(for Mozilla nss3 includes in $with_nss_includes) AC_MSG_RESULT("") if test "x${with_nspr_includes}" != "x"; then CPPFLAGS="$CPPFLAGS -I$with_nspr_includes -I$with_nss_includes" else CPPFLAGS="$CPPFLAGS -I$with_nss_includes" fi AC_CHECK_HEADERS(nss.h ssl.h smime.h, [ have_nss_includes="yes" ], [ have_nss_includes="no" ]) CPPFLAGS="$CPPFLAGS_save" if test "x${have_nss_includes}" = "xyes"; then have_nss_includes="yes" MANUAL_NSS_CFLAGS="-I$with_nss_includes" else MANUAL_NSPR_CFLAGS="" MANUAL_NSPR_LIBS="" fi else AC_MSG_CHECKING(for Mozilla nss3 includes) AC_MSG_RESULT(no) fi if test "x${with_nss_libs}" != "xno" -a "x${have_nss_includes}" != "xno"; then LDFLAGS_save="$LDFLAGS" if test "$enable_nss" = "static"; then if test -z "${with_nss_libs}"; then AC_MSG_ERROR([Static linkage requested, but path to nss libraries not set.] [Please specify the path to libnss3.a] [Example: --with-nspr-libs=/usr/lib/mozilla]) else nsslibs="-ldb1 $with_nss_libs/libnssckfw.a $with_nss_libs/libasn1.a $with_nss_libs/libcrmf.a $with_nss_libs/libswfci.a $with_nss_libs/libjar.a $with_nss_libs/libpkcs12.a $with_nss_libs/libpkcs7.a $with_nss_libs/libpki1.a $with_nss_libs/libsmime.a $with_nss_libs/libssl.a $with_nss_libs/libnss.a $with_nss_libs/libpk11wrap.a $with_nss_libs/libsoftokn.a $with_nss_libs/libfreebl.a $with_nss_libs/libnsspki.a $with_nss_libs/libnssdev.a $with_nss_libs/libcryptohi.a $with_nss_libs/libcerthi.a $with_nss_libs/libcertdb.a $with_nss_libs/libsecutil.a $with_nss_libs/libnssb.a" case "$host" in *solaris*) nsslibs="$nsslibs $with_nss_libs/libfreebl.a" ;; esac fi else nsslibs="-lssl3 -lsmime3 -lnss3 $SOFTOKN3_LIB" fi AC_CACHE_CHECK([for Mozilla nss libraries], moz_nss_libs, [ LIBS_save="$LIBS" LDFLAGS="$LDFLAGS -L$with_nspr_libs $nsprlibs -L$with_nss_libs $nsslibs" LIBS="$nsslibs $nsprlibs" AC_TRY_LINK_FUNC(NSS_Init, moz_nss_libs="yes", moz_nss_libs="no") if test "$moz_nss_libs" = no; then nsslibs="-lssl3 -lsmime3 -lnss3 $SOFTOKN3_LIB" LDFLAGS="$LDFLAGS -L$with_nspr_libs $nsprlibs -L$with_nss_libs $nsslibs" AC_TRY_LINK_FUNC(NSS_Init, moz_nss_libs="yes", moz_nss_libs="no") fi LDFLAGS="$LDFLAGS_save" LIBS="$LIBS_save" ]) if test "$moz_nss_libs" != no; then AC_DEFINE(HAVE_NSS) AC_DEFINE(HAVE_SSL) AC_DEFINE_UNQUOTED(MOZILLA_NSS_LIB_DIR,"$with_nss_libs", [Define to the full path of mozilla nss library]) if test "$enable_nss" = "static"; then msg_ssl="yes (Mozilla NSS:static)" else msg_ssl="yes (Mozilla NSS)" fi # static_nss if test "$enable_smime" = "yes"; then AC_DEFINE(ENABLE_SMIME,1,[Define if SMIME should be enabled]) msg_smime="yes (Mozilla NSS)" fi MANUAL_NSS_LIBS="-L$with_nss_libs $nsslibs" else MANUAL_NSS_CFLAGS="" MANUAL_NSPR_CFLAGS="" MANUAL_NSPR_LIBS="" fi else AC_MSG_CHECKING(for Mozilla nss libraries) AC_MSG_RESULT(no) fi MANUAL_NSS_CFLAGS="$MANUAL_NSPR_CFLAGS $MANUAL_NSS_CFLAGS" MANUAL_NSS_LIBS="$MANUAL_NSPR_LIBS $MANUAL_NSS_LIBS" fi fi AM_CONDITIONAL(ENABLE_SMIME, test "x$msg_smime" != "xno") AC_SUBST(MANUAL_NSPR_CFLAGS) AC_SUBST(MANUAL_NSPR_LIBS) AC_SUBST(MANUAL_NSS_CFLAGS) AC_SUBST(MANUAL_NSS_LIBS) dnl ************************************************** dnl Exchange support. dnl ************************************************** AC_ARG_ENABLE(exchange, [ --enable-exchange=[no/yes] Build Exchange plugins],enable_exchange="$enableval",enable_exchange=yes) if test "x$enable_exchange" = "xyes"; then msg_exchange=yes EXCHANGE_PLUGIN="exchange-operations" else msg_exchange=no fi AM_CONDITIONAL(ENABLE_EXCHANGE, test x$enable_exchange = xyes) dnl ****************** dnl CDE dtappintegrate dnl ****************** AC_ARG_WITH(cde-path, [ --with-cde-path=PATH Location of CDE installation], [with_cde_path="$withval"]) if test -z "$with_cde_path"; then with_cde_path="/usr/dt" fi AC_MSG_CHECKING(for dtappintegrate) if test -x "$with_cde_path/bin/dtappintegrate" ; then DTAPPINTEGRATE="$with_cde_path/bin/dtappintegrate" else DTAPPINTEGRATE="no" fi AC_MSG_RESULT([$DTAPPINTEGRATE]) AC_SUBST(DTAPPINTEGRATE) AM_CONDITIONAL(HAVE_DTAPPINTEGRATE, test "x$DTAPPINTEGRATE" != "xno") dnl ***************** dnl killall or pkill? dnl ***************** AC_MSG_CHECKING(for command to kill processes) if test `uname -s` = "SunOS" ; then KILL_PROCESS_CMD="pkill"; else KILL_PROCESS_CMD="killall"; fi KILL_PROCESS_CMD=`which $KILL_PROCESS_CMD` if test -z "$KILL_PROCESS_CMD" ; then AC_MSG_RESULT(none) else AC_MSG_RESULT($KILL_PROCESS_CMD) AC_DEFINE_UNQUOTED([KILL_PROCESS_CMD], "$KILL_PROCESS_CMD", [Command to kill processes by name]) fi dnl ****************************** dnl OpenSSL dnl ****************************** dnl only continue detecting OpenSSL if we haven't already found all of the dnl Mozilla libnss includes/libraries and if user actually wants ssl support dnl if test "$msg_ssl" = "no" -a "x${enable_openssl}" != "xno"; then dnl AC_ARG_WITH(openssl-includes, [ --with-openssl-includes=PREFIX Location of OpenSSL includes.], dnl with_openssl_includes="$withval", with_openssl_includes="/usr/include") dnl have_openssl_includes="no" dnl if test "x${with_openssl_includes}" != "xno"; then dnl CPPFLAGS_save="$CPPFLAGS" dnl dnl AC_MSG_CHECKING(for OpenSSL includes) dnl AC_MSG_RESULT("") dnl dnl CPPFLAGS="$CPPFLAGS -I$with_openssl_includes" dnl AC_CHECK_HEADERS(openssl/ssl.h openssl/x509.h, [ openssl_includes="yes" ]) dnl CPPFLAGS="$CPPFLAGS_save" dnl dnl if test "x{$openssl_includes}" != "xno" -a "x{$openssl_includes}" != "x"; then dnl have_openssl_includes="yes" dnl OPENSSL_CFLAGS="-I$with_openssl_includes" dnl else dnl OPENSSL_CFLAGS="" dnl fi dnl else dnl AC_MSG_CHECKING(for OpenSSL includes) dnl AC_MSG_RESULT(no) dnl fi dnl dnl AC_ARG_WITH(openssl-libs, [ --with-openssl-libs=PREFIX Location of OpenSSL libs.], dnl with_openssl_libs="$withval") dnl if test "x${with_openssl_libs}" != "xno" -a "x${have_openssl_includes}" != "xno"; then dnl LDFLAGS_save="$LDFLAGS" dnl dnl case $with_openssl_libs in dnl ""|-L*) ;; dnl *) with_openssl_libs="-L$with_openssl_libs" ;; dnl esac dnl dnl AC_CHECK_LIB(dl, dlopen, DL_LDFLAGS="-ldl", DL_LDFLAGS="") dnl AC_CACHE_CHECK([for OpenSSL libraries], openssl_libs, dnl [ dnl LDFLAGS="$LDFLAGS $with_openssl_libs -lssl -lcrypto $DL_LDFLAGS" dnl AC_TRY_LINK_FUNC(SSL_read, openssl_libs="yes", openssl_libs="no") dnl LDFLAGS="$LDFLAGS_save" dnl ]) dnl if test "x${openssl_libs}" != "xno"; then dnl AC_DEFINE(HAVE_OPENSSL,1,[Define if you have OpenSSL]) dnl AC_DEFINE(HAVE_SSL) dnl msg_ssl="yes (OpenSSL)" dnl OPENSSL_LDFLAGS="$with_openssl_libs -lssl -lcrypto $DL_LDFLAGS" dnl else dnl OPENSSL_CFLAGS="" dnl OPENSSL_LDFLAGS="" dnl fi dnl else dnl AC_MSG_CHECKING(for OpenSSL libraries) dnl AC_MSG_RESULT(no) dnl fi dnl else dnl OPENSSL_CFLAGS="" dnl OPENSSL_LDFLAGS="" dnl dnl dnl AC_SUBST(OPENSSL_CFLAGS) dnl AC_SUBST(OPENSSL_LDFLAGS) dnl ******************* dnl GObject marshalling dnl ******************* AM_PATH_GLIB_2_0 dnl We use AC_SUBST_FILE because AC_SUBST won't deal with newlines EVO_MARSHAL_RULE=$srcdir/marshal.mk AC_SUBST_FILE(EVO_MARSHAL_RULE) dnl ************************* dnl CFLAGS and LIBS and stuff dnl ************************* GNOME_COMPILE_WARNINGS(yes) CFLAGS="$CFLAGS $WARN_CFLAGS" case $CFLAGS in *-Wall*) # Turn off the annoying "comparison between signed and unsigned" # warning in gcc 3.3 CFLAGS="$CFLAGS -Wno-sign-compare" ;; esac AM_PATH_ORBIT2(2.9.8) AC_MSG_CHECKING(for CORBA include paths) IDL_INCLUDES="-I "`pkg-config --variable=idldir libbonobo-2.0`" -I "`pkg-config --variable=idldir bonobo-activation-2.0`" -I "`pkg-config --variable=idldir evolution-data-server-1.2` AC_MSG_RESULT($IDL_INCLUDES) AC_SUBST(IDL_INCLUDES) dnl Utility macro to set compiler flags for a specific lib. dnl EVO_SET_COMPILE_FLAGS(VAR-PREFIX, DEPS, EXTRA-CFLAGS, EXTRA-LIBS) AC_DEFUN([EVO_SET_COMPILE_FLAGS], [ PKG_CHECK_MODULES([$1], [$2]) $1_CFLAGS="[$]$1_CFLAGS \$(WERROR) $3" $1_LIBS="[$]$1_LIBS $4" ]) dnl enable USE_GTKFILECHOOSER if gtk version is > 2.4.0 AC_ARG_ENABLE(file-chooser, [ --enable-file-chooser Enable the usage of the GtkFileChooser in place of the GtkFileSelection dialog], enable_file_chooser="$enableval", enable_file_chooser="yes") if test "x$enable_file_chooser" = "xyes"; then if pkg-config --atleast-version=2.4.0 gtk+-2.0; then AC_DEFINE(USE_GTKFILECHOOSER,1,[Use new GtkFileChooser]) fi fi dnl --- Required version numbers GTKHTML_REQUIRED=3.7.0 GTKHTML_PACKAGE=3.8 EDS_REQUIRED=1.3.1 EDS_PACKAGE=1.2 BONOBOUI_REQUIRED=2.4.2 GNOME_VFS_REQUIRED=2.4 AC_SUBST(GTKHTML_REQUIRED) AC_SUBST(GTKHTML_PACKAGE) AC_SUBST(EDS_REQUIRED) AC_SUBST(EDS_PACKAGE) AC_SUBST(BONOBOUI_REQUIRED) AC_SUBST(GNOME_VFS_REQUIRED) dnl --- Flags to get all the GNOME stuff FULL_GNOME_DEPS="glib-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED libgnomeui-2.0 libglade-2.0 libgnomecanvas-2.0 libxml-2.0 gconf-2.0" EVO_SET_COMPILE_FLAGS(GNOME_FULL, $FULL_GNOME_DEPS) AC_SUBST(GNOME_FULL_CFLAGS) AC_SUBST(GNOME_FULL_LIBS) CPPFLAGS_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags-only-I libgnomeui-2.0`" AC_CHECK_HEADERS(libgnomeui/gnome-icon-lookup.h) AC_CHECK_HEADERS(libgnomeui/gnome-thumbnail.h) CPPFLAGS="$CPPFLAGS_save" PKG_CHECK_MODULES(EXTRA_GNOME, libgnomeprint-2.2 >= 2.2.0 libgnomeprintui-2.2 >= 2.2.1 $FULL_GNOME_DEPS) AC_SUBST(EXTRA_GNOME_LIBS) AC_SUBST(EXTRA_GNOME_CFLAGS) PKG_CHECK_MODULES(HAL, hal >= 0.5.4, HAVE_HAL="yes", HAVE_HAL="no") if test "x$HAVE_HAL" = "xyes"; then AC_DEFINE(HAVE_HAL, 1, [hal available]) HAL_REQUIREMENT="hal" IPOD_SYNC="ipod-sync" else HAL_REQUIREMENT="" IPOD_SYNC="" fi dnl --- Flags for the various libraries we build EVO_SET_COMPILE_FLAGS(CAMEL, camel-provider-$EDS_PACKAGE) AC_SUBST(CAMEL_CFLAGS) AC_SUBST(CAMEL_LIBS) EVO_SET_COMPILE_FLAGS(CAMEL_GROUPWISE, camel-provider-$EDS_PACKAGE libedataserver-$EDS_PACKAGE >= $EDS_REQUIRED libegroupwise-$EDS_PACKAGE >= $EDS_REQUIRED) AC_SUBST(CAMEL_GROUPWISE_CFLAGS) AC_SUBST(CAMEL_GROUPWISE_LIBS) if test "x$mozilla_nss" != "x"; then EVO_SET_COMPILE_FLAGS(MOZILLA_NSS, $mozilla_nss) MOZILLA_L_DIR=`pkg-config --libs-only-L $mozilla_nss` else if test "x$MOZILLA_MANUAL_LIBS" != "x"; then MOZILLA_L_DIR="-L$with_nss_lib" fi fi EVO_SET_COMPILE_FLAGS(CERT_UI, libedataserverui-$EDS_PACKAGE >= $EDS_REQUIRED libglade-2.0 gtk+-2.0 glib-2.0 gobject-2.0 gthread-2.0, $MANUAL_NSS_CFLAGS $MOZILLA_NSS_CFLAGS, $MOZILLA_L_DIR $MANUAL_NSS_LIBS $MOZILLA_NSS_LIBS) AC_SUBST(CERT_UI_CFLAGS) AC_SUBST(CERT_UI_LIBS) EVO_SET_COMPILE_FLAGS(E_NAME, libgnomeui-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED) AC_SUBST(E_NAME_CFLAGS) AC_SUBST(E_NAME_LIBS) EVO_SET_COMPILE_FLAGS(E_UTIL, gthread-2.0 gconf-2.0 libxml-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED libglade-2.0 libgnomeui-2.0 libgnome-2.0 libgnomecanvas-2.0 libgnomeprintui-2.2 libedataserver-$EDS_PACKAGE >= $EDS_REQUIRED libedataserverui-$EDS_PACKAGE >= $EDS_REQUIRED $mozilla_nspr $mono_package, $THREADS_CFLAGS $MANUAL_NSPR_CFLAGS, $THREADS_LIBS $MANUAL_NSPR_LIBS) AC_SUBST(E_UTIL_CFLAGS) AC_SUBST(E_UTIL_LIBS) EVO_SET_COMPILE_FLAGS(TZDIALOG, libecal-$EDS_PACKAGE >= $EDS_REQUIRED, $GNOME_FULL_CFLAGS, $GNOME_FULL_LIBS) AC_SUBST(TZDIALOG_CFLAGS) AC_SUBST(TZDIALOG_LIBS) EVO_SET_COMPILE_FLAGS(E_WIDGETS, glib-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED gnome-vfs-2.0 gnome-vfs-module-2.0 libgnomeui-2.0 libglade-2.0 libgnomecanvas-2.0 libxml-2.0 gconf-2.0 libedataserverui-$EDS_PACKAGE libedataserver-$EDS_PACKAGE >= $EDS_REQUIRED) AC_SUBST(E_WIDGETS_CFLAGS) AC_SUBST(E_WIDGETS_LIBS) EVO_SET_COMPILE_FLAGS(IMPORTERS, libedataserverui-$EDS_PACKAGE >= $EDS_REQUIRED camel-provider-$EDS_PACKAGE camel-$EDS_PACKAGE gconf-2.0 libglade-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED libgnomeui-2.0 libebook-$EDS_PACKAGE >= $EDS_REQUIRED) AC_SUBST(IMPORTERS_CFLAGS) AC_SUBST(IMPORTERS_LIBS) EVO_SET_COMPILE_FLAGS(LIBFILTER, libgnome-2.0 libgnomeui-2.0 libglade-2.0 libxml-2.0 gconf-2.0 libedataserver-$EDS_PACKAGE >= $EDS_REQUIRED) AC_SUBST(LIBFILTER_CFLAGS) AC_SUBST(LIBFILTER_LIBS) dnl --- evolution (shell) flags NM_SUPPORT_PACKAGES="" PKG_CHECK_MODULES(NM, dbus-glib-1 libnm_glib, NM_SUPPORT_GLIB="yes", NM_SUPPORT_GLIB="no") if test "x$NM_SUPPORT_GLIB" = "xyes"; then AC_DEFINE(NM_SUPPORT_GLIB, 1, [network manager available]) NM_SUPPORT_PACKAGES="dbus-1 dbus-glib-1 libnm_glib" else PKG_CHECK_MODULES(NM, dbus-glib-1, NM_SUPPORT="yes", NM_SUPPORT="no") AC_CHECK_HEADER(NetworkManager/NetworkManager.h, [ nm_header="yes" ] ) if test "x$NM_SUPPORT" = "xyes" -a "x$nm_header" = "xyes"; then AC_DEFINE(NM_SUPPORT, 1, [network manager available]) NM_SUPPORT_PACKAGES="dbus-1 dbus-glib-1" else NM_SUPPORT=no fi fi AM_CONDITIONAL(NM_SUPPORT_GLIB, test x$NM_SUPPORT_GLIB = xyes) AM_CONDITIONAL(NM_SUPPORT, test x$NM_SUPPORT = xyes) EVO_SET_COMPILE_FLAGS(SHELL, libgnome-2.0 libgnomeui-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED libglade-2.0 gnome-vfs-2.0 libgtkhtml-$GTKHTML_PACKAGE >= $GTKHTML_REQUIRED $NM_SUPPORT_PACKAGES) AC_SUBST(SHELL_CFLAGS) AC_SUBST(SHELL_LIBS) dnl --- evolution-addressbook flags EVOLUTION_ADDRESSBOOK_DEPS="gconf-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED libglade-2.0 libgnomeui-2.0 libgnome-2.0 libgnomecanvas-2.0 gnome-vfs-2.0 libgnomeprintui-2.2 libgtkhtml-$GTKHTML_PACKAGE >= $GTKHTML_REQUIRED libebook-$EDS_PACKAGE >= $EDS_REQUIRED libedataserverui-$EDS_PACKAGE >= $EDS_REQUIRED camel-$EDS_PACKAGE" EVO_SET_COMPILE_FLAGS(EVOLUTION_ADDRESSBOOK, $EVOLUTION_ADDRESSBOOK_DEPS) AC_SUBST(EVOLUTION_ADDRESSBOOK_CFLAGS) AC_SUBST(EVOLUTION_ADDRESSBOOK_LIBS) if test x$enable_pilot_conduits = xyes; then EVO_SET_COMPILE_FLAGS(EVOLUTION_ADDRESSBOOK_CONDUIT, gnome-pilot-2.0 $EVOLUTION_ADDRESSBOOK_DEPS) AC_SUBST(EVOLUTION_ADDRESSBOOK_CONDUIT_CFLAGS) AC_SUBST(EVOLUTION_ADDRESSBOOK_CONDUIT_LIBS) fi LIBNOTIFY_CFLAGS= LIBNOTIFY_LIBS= PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= 0.3.0, HAVE_LIBNOTIFY="yes", HAVE_LIBNOTIFY="no") if test "x$HAVE_LIBNOTIFY" = "xyes"; then AC_DEFINE(HAVE_LIBNOTIFY, 1, [libnotify available]) libnotify="libnotify" else libnotify="" fi AC_SUBST(LIBNOTIFY_CFLAGS) AC_SUBST(LIBNOTIFY_LIBS) dnl --- evolution-calendar flags PKG_CHECK_MODULES(SOUPTEMP, libsoup-2.4, have_libsoup_24="yes", have_libsoup_24="no") if test $have_libsoup_24 = yes; then LIBSOUP_REQUIRED=2.3.0 LIBSOUP=libsoup-2.4 else LIBSOUP_REQUIRED=2.2.2 LIBSOUP=libsoup-2.2 fi EVO_SET_COMPILE_FLAGS(LIBSOUP, $LIBSOUP >= $LIBSOUP_REQUIRED) AC_SUBST(LIBSOUP_CFLAGS) AC_SUBST(LIBSOUP_LIBS) EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR, libgnome-2.0 libgnomeui-2.0 libbonoboui-2.0 libglade-2.0 gnome-vfs-2.0 libgnomeprint-2.2 libgnomeprintui-2.2 gnome-vfs-module-2.0 libgtkhtml-$GTKHTML_PACKAGE >= $GTKHTML_REQUIRED libebook-$EDS_PACKAGE >= $EDS_REQUIRED libecal-$EDS_PACKAGE >= $EDS_REQUIRED libedataserverui-$EDS_PACKAGE >= $EDS_REQUIRED $HAL_REQUIREMENT $libnotify) AC_SUBST(EVOLUTION_CALENDAR_CFLAGS) AC_SUBST(EVOLUTION_CALENDAR_LIBS) if test x$enable_pilot_conduits = xyes; then EVO_SET_COMPILE_FLAGS(EVOLUTION_CALENDAR_CONDUIT, gnome-pilot-2.0, $EVOLUTION_CALENDAR_CFLAGS, $EVOLUTION_CALENDAR_LIBS) AC_SUBST(EVOLUTION_CALENDAR_CONDUIT_CFLAGS) AC_SUBST(EVOLUTION_CALENDAR_CONDUIT_LIBS) fi dnl --- evolution-mail flags EVO_SET_COMPILE_FLAGS(EVOLUTION_MAIL, camel-provider-$EDS_PACKAGE libgnome-2.0 libgnomeui-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED libglade-2.0 gnome-vfs-module-2.0 libgnomeprint-2.2 libgnomeprintui-2.2 libgtkhtml-$GTKHTML_PACKAGE >= $GTKHTML_REQUIRED libxml-2.0 bonobo-activation-2.0 gthread-2.0 gconf-2.0 $mozilla_nss libebook-$EDS_PACKAGE >= $EDS_REQUIRED libedataserverui-$EDS_PACKAGE >= $EDS_REQUIRED) AC_SUBST(EVOLUTION_MAIL_CFLAGS) AC_SUBST(EVOLUTION_MAIL_LIBS) dnl -- evolution-data-server IDL and version AC_DEFINE(DATASERVER_API_VERSION, "1.2", evolution-data-server API version) AC_DEFINE_UNQUOTED(DATASERVER_VERSION, "`pkg-config --modversion evolution-data-server-1.2`", evolution-data-server version) DATASERVER_EXEC_VERSION=`pkg-config --variable=execversion evolution-data-server-1.2` AC_SUBST(DATASERVER_EXEC_VERSION) AC_MSG_CHECKING(for evolution-data-server IDL) DATASERVER_IDL=`pkg-config --variable=idldir evolution-data-server-1.2`/Evolution-DataServer.idl if test -f "$DATASERVER_IDL"; then AC_MSG_RESULT($DATASERVER_IDL) AC_SUBST(DATASERVER_IDL) else AC_MSG_ERROR(no) fi dnl --- evolution-test flags EVO_SET_COMPILE_FLAGS(EVOLUTION_TEST, libgnome-2.0 libgnomeui-2.0 libbonobo-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED) AC_SUBST(EVOLUTION_TEST_CFLAGS) AC_SUBST(EVOLUTION_TEST_LIBS) dnl ******************* dnl Special directories dnl ******************* dnl --- If you add something here, consider whether or not you also dnl --- need to add it to one or more .pc.in files (for Connector, dnl --- etc) privlibdir='${libdir}'/evolution/$BASE_VERSION AC_SUBST(privlibdir) privlibexecdir='${libexecdir}'/evolution/$BASE_VERSION AC_SUBST(privlibexecdir) privdatadir='${datadir}'/evolution/$BASE_VERSION AC_SUBST(privdatadir) privincludedir='${includedir}'/evolution-$BASE_VERSION AC_SUBST(privincludedir) componentdir="$privlibdir/components" AC_SUBST(componentdir) idldir="$datadir/idl/evolution-$BASE_VERSION" AC_SUBST(idldir) serverdir="$libdir/bonobo/servers" AC_SUBST(serverdir) evolutionuidir="$privdatadir/ui" AC_SUBST(evolutionuidir) evolutionhelpdir="$privdatadir/help" AC_SUBST(evolutionhelpdir) imagesdir="$privdatadir/images" AC_SUBST(imagesdir) images16dir="$privdatadir/images/16x16" AC_SUBST(images16dir) if test "$os_win32" = yes; then # On Win32 there is no "rpath" mechanism. We install the private # shared libraries in $libdir, meaning the DLLs will actually be in # $bindir. This means just having $bindir in PATH will be enough. This # also means gnome_win32_get_prefixes() will be able to deduce the # installation folder correctly. privsolibdir=$libdir # On Win32, use a relative path to the executables in .server # files. The path is relative to the folder where the .server file # is, i.e. $prefix/lib/bonobo/servers. bindir_in_server_file=../../../bin privlibexecdir_in_server_file=../../../libexec/evolution/$BASE_VERSION componentdir_in_server_file=../../../lib/evolution/$BASE_VERSION/components else privsolibdir=$privlibdir bindir_in_server_file="$bindir" privlibexecdir_in_server_file='${libexecdir}'/evolution/$BASE_VERSION componentdir_in_server_file="$componentdir" fi AC_SUBST(privsolibdir) AC_SUBST(bindir_in_server_file) AC_SUBST(privlibexecdir_in_server_file) AC_SUBST(componentdir_in_server_file) dnl images18dir="$privdatadir/images/18x18" dnl AC_SUBST(images18dir) dnl images20dir="$privdatadir/images/20x20" dnl AC_SUBST(images20dir) dnl images24dir="$privdatadir/images/24x24" dnl AC_SUBST(images24dir) dnl images32dir="$privdatadir/images/32x32" dnl AC_SUBST(images32dir) images48dir="$privdatadir/images/48x48" AC_SUBST(images48dir) soundsdir="$privdatadir/sounds" AC_SUBST(soundsdir) gladedir="$privdatadir/glade" AC_SUBST(gladedir) etspecdir="$privdatadir/etspec" AC_SUBST(etspecdir) viewsdir="$privdatadir/views" AC_SUBST(viewsdir) privconduitdir='${libdir}'/evolution/$BASE_VERSION/conduits AC_SUBST(privconduitdir) dnl ************************ dnl IDL/Component Versioning dnl ************************ INTERFACE_VERSION="$BASE_VERSION" AC_SUBST(INTERFACE_VERSION) AC_DEFINE_UNQUOTED(INTERFACE_VERSION, "$INTERFACE_VERSION", [IDL interface version (Major.Minor)]) EVO_SERVER_RULE=$srcdir/server.mk AC_SUBST_FILE(EVO_SERVER_RULE) dnl ************************ dnl Plugins dnl ************************ plugindir="$privlibdir/plugins" AC_SUBST(plugindir) EVO_PLUGIN_RULE=$srcdir/plugin.mk AC_SUBST_FILE(EVO_PLUGIN_RULE) AC_ARG_ENABLE(plugins, [ --enable-plugins=[no/base/all/experimental/list] Enable plugins.],enable_plugins="$enableval",enable_plugins=all) dnl Add any new plugins here plugins_base_always="calendar-file calendar-http calendar-weather itip-formatter plugin-manager default-source addressbook-file startup-wizard print-message mark-all-read groupwise-features groupwise-account-setup hula-account-setup mail-account-disable publish-calendar caldav" plugins_base="$plugins_base_always $SA_JUNK_PLUGIN $EXCHANGE_PLUGIN $MONO_PLUGIN" all_plugins_base="$plugins_base_always sa-junk-plugin exchange-operations mono" plugins_standard_always="bbdb subject-thread save-calendar select-one-source copy-tool mail-to-task mark-calendar-offline audio-inline mailing-list-actions new-mail-notify default-mailer import-ics-attachments" plugins_standard="$plugins_standard_always" all_plugins_standard="$plugins_standard" plugins_experimental_always="backup-restore folder-unsubscribe mail-to-meeting mail-remote prefer-plain save-attachments" plugins_experimental="$plugins_experimental_always $IPOD_SYNC" all_plugins_experimental="$plugins_experimental_always ipod-sync" case x"$enable_plugins" in xno) plugins_enabled="" msg_plugins="no (some core functionality will not be available)" ;; xall | x | xyes) plugins_enabled="$plugins_base $plugins_standard" msg_plugins="yes (all)" ;; xbase) plugins_enabled="$plugins_base" msg_plugins="yes ($plugins_base)" ;; xexperimental) plugins_enabled="$plugins_base $plugins_standard $plugins_experimental" msg_plugins="yes ($plugins_base $plugins_standard $plugins_experimental)" ;; *) plugins_enabled="$enable_plugins" msg_plugins="yes ($enable_plugins)" ;; esac AC_ARG_ENABLE(profiling, [ --enable-profiling=[no/yes] Enable profiling plugin.],enable_profiling="$enableval",enable_profiling=no) case x"$enable_profiling" in x | xyes) plugins_enabled="$plugins_enabled profiler" msg_plugins="$msg_plugins (and profiling)" AC_DEFINE(ENABLE_PROFILING,1,[Profiling Hooks Enabled]) ;; esac if test "x${enable_mono}" = "xyes"; then plugins_enabled="$plugins_enabled mono" msg_plugins="$msg_plugins (and mono)" fi AC_SUBST(plugins_enabled) AC_SUBST(all_plugins_base) AC_SUBST(all_plugins_standard) AC_SUBST(all_plugins_experimental) if echo ${plugins_enabled} | grep "audio-inline" > /dev/null then if ${PKG_CONFIG} --exists gstreamer-0.8 then dnl ********************* dnl gstreamer dnl ********************* PKG_CHECK_MODULES(GSTREAMER, gstreamer-0.8) AC_SUBST(GSTREAMER_CFLAGS) AC_SUBST(GSTREAMER_LIBS) else plugins_enabled=`echo $plugins_enabled | sed -e "s/audio-inline//g"` echo "warning: gstreamer was not found, audio-inline plugin will not be built." echo "you are probably missing gstreamer-devel package." fi fi if echo ${plugins_enabled} | grep "new-mail-notify" > /dev/null ; then if ${PKG_CONFIG} --exists dbus-glib-1 ; then dnl ************************************************** dnl * New Mail Notify plugin dnl ************************************************** PKG_CHECK_MODULES(NMN, dbus-glib-1) AC_SUBST(NMN_CFLAGS) AC_SUBST(NMN_LIBS) # Get the version of the DBus API, so we can hack around API changes until the API stabilises: # multiply by 1000 to convert decimal to integer; so e.g. 0.31 become 310 # since preprocessor values must be integral DBUS_VERSION="`$PKG_CONFIG --modversion dbus-1 | awk '{print 1000 * $1}'`" AC_SUBST(DBUS_VERSION) else plugins_enabled=`echo $plugins_enabled | sed -e "s/new-mail-notify//g"` echo "warning: dbus-glib-1 was not found, new-mail-notify plugin will not be built." fi fi if echo ${plugins_enabled} | grep "exchange-operations" > /dev/null ; then if ${PKG_CONFIG} --exists libexchange-storage-$EDS_PACKAGE ; then dnl ************************************************** dnl * Exchange Operations plugin dnl ************************************************** EVO_SET_COMPILE_FLAGS(CAMEL_EXCHANGE, libbonoboui-2.0 >= $BONOBOUI_REQUIRED libglade-2.0 libgnomeprint-2.2 libgnomeprintui-2.2 gthread-2.0 gconf-2.0 camel-provider-$EDS_PACKAGE libebook-$EDS_PACKAGE >= $EDS_REQUIRED libedataserverui-$EDS_PACKAGE libexchange-storage-$EDS_PACKAGE >= $EDS_REQUIRED libecal-$EDS_PACKAGE) AC_SUBST(CAMEL_EXCHANGE_CFLAGS) AC_SUBST(CAMEL_EXCHANGE_LIBS) else plugins_enabled=`echo $plugins_enabled | sed -e "s/exchange-operations//g"` echo "warning: libevolution-exchange-$EDS_PACKAGE was not found, Exchange Operations plugin will not be built." fi fi ################################################## # Check for gtk-doc. ################################################## AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ]) if test "x$with_html_dir" = "x" ; then HTML_DIR='${datadir}/gnome/html' else HTML_DIR=$with_html_dir fi AC_SUBST(HTML_DIR) AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false) gtk_doc_min_version=0.6 if $GTKDOC ; then gtk_doc_version=`gtkdoc-mkdb --version` AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version]) if perl <<EOF ; then exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) && ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1); EOF AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) GTKDOC=false fi fi dnl Let people disable the gtk-doc stuff. AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto) if test x$enable_gtk_doc = xauto ; then if test x$GTKDOC = xtrue ; then enable_gtk_doc=yes else enable_gtk_doc=no fi fi AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes) dnl *********** dnl GConf stuff dnl *********** AC_PATH_PROG(GCONFTOOL, gconftool-2, no) AM_GCONF_SOURCE_2 dnl ****************** dnl Sub-version number dnl ****************** AC_ARG_WITH(sub-version, [ --with-sub-version=VERSION Specify a sub-version string]) AC_DEFINE_UNQUOTED(SUB_VERSION, "$with_sub_version", [Version substring, for packagers]) AC_ARG_ENABLE(default-binary, [ --disable-default-binary Do not install as the default "evolution" binary ], , enable_default_binary=no) AM_CONDITIONAL(DEFAULT_BINARY, test x$enable_default_binary = xyes) dnl ******************** dnl KDE applnk directory dnl ******************** AC_ARG_WITH(kde-applnk-path, [ --with-kde-applnk-path=PATH Location of KDE applnk files], [with_kde_applnk_path="$withval"], [with_kde_applnk_path="no"]) if test x"$with_kde_applnk_path" != x"no"; then if test -z "$with_kde_applnk_path"; then with_kde_applnk_path="$datadir/applnk" fi KDE_APPLNK_DIR="$with_kde_applnk_path" else KDE_APPLNK_DIR="" fi AM_CONDITIONAL(HAVE_KDE_APPLNK, test x"$KDE_APPLNK_DIR" != x) AC_SUBST(KDE_APPLNK_DIR) dnl ****************************** dnl Makefiles dnl ****************************** export privlibdir export privincludedir export privdatadir export plugindir EVOLUTION_DIR=`(cd $srcdir; pwd)` AC_SUBST(EVOLUTION_DIR) AC_OUTPUT([ po/Makefile.in Makefile win32/Makefile a11y/Makefile a11y/addressbook/Makefile a11y/calendar/Makefile a11y/widgets/Makefile a11y/e-table/Makefile a11y/e-text/Makefile addressbook/Makefile addressbook/conduit/Makefile addressbook/gui/Makefile addressbook/gui/component/Makefile addressbook/gui/contact-editor/Makefile addressbook/gui/contact-list-editor/Makefile addressbook/gui/merging/Makefile addressbook/gui/widgets/Makefile addressbook/importers/Makefile addressbook/printing/Makefile addressbook/tools/Makefile addressbook/util/Makefile art/Makefile data/Makefile data/cde_app_root/Makefile data/cde_app_root/dt/Makefile data/cde_app_root/dt/appconfig/Makefile data/cde_app_root/dt/appconfig/appmanager/Makefile data/cde_app_root/dt/appconfig/appmanager/C/Makefile data/cde_app_root/dt/appconfig/appmanager/C/Ximian/Makefile data/cde_app_root/dt/appconfig/icons/Makefile data/cde_app_root/dt/appconfig/icons/C/Makefile data/cde_app_root/dt/appconfig/types/Makefile data/cde_app_root/dt/appconfig/types/C/Makefile data/cde_app_root/dt/appconfig/types/C/Ximian.dt e-util/Makefile filter/Makefile help/Makefile help/C/Makefile help/quickref/Makefile help/quickref/C/Makefile shell/Makefile shell/evolution-nognome ui/Makefile views/Makefile views/addressbook/Makefile views/calendar/Makefile views/mail/Makefile views/tasks/Makefile views/memos/Makefile widgets/Makefile widgets/e-timezone-dialog/Makefile widgets/menus/Makefile widgets/misc/Makefile widgets/text/Makefile widgets/table/Makefile calendar/Makefile calendar/importers/Makefile calendar/common/Makefile calendar/idl/Makefile calendar/conduits/Makefile calendar/conduits/todo/Makefile calendar/conduits/calendar/Makefile calendar/conduits/memo/Makefile calendar/gui/Makefile calendar/gui/alarm-notify/Makefile calendar/gui/dialogs/Makefile composer/Makefile mail/Makefile mail/default/Makefile mail/default/C/Makefile mail/default/de/Makefile mail/default/fi/Makefile mail/default/fr/Makefile mail/default/lt/Makefile mail/default/mk/Makefile mail/default/zh_CN/Makefile mail/default/ja/Makefile mail/default/nl/Makefile mail/default/pt/Makefile mail/importers/Makefile plugins/Makefile plugins/mark-all-read/Makefile plugins/caldav/Makefile plugins/calendar-file/Makefile plugins/calendar-http/Makefile plugins/calendar-weather/Makefile plugins/plugin-manager/Makefile plugins/bbdb/Makefile plugins/audio-inline/Makefile plugins/mail-to-meeting/Makefile plugins/mail-to-task/Makefile plugins/mail-remote/Makefile plugins/mono/Makefile plugins/new-mail-notify/Makefile plugins/subject-thread/Makefile plugins/save-attachments/Makefile plugins/save-calendar/Makefile plugins/select-one-source/Makefile plugins/mark-calendar-offline/Makefile plugins/prefer-plain/Makefile plugins/profiler/Makefile plugins/copy-tool/Makefile plugins/folder-unsubscribe/Makefile plugins/mailing-list-actions/Makefile plugins/itip-formatter/Makefile plugins/backup-restore/Makefile plugins/exchange-operations/Makefile plugins/default-source/Makefile plugins/default-mailer/Makefile plugins/addressbook-file/Makefile plugins/startup-wizard/Makefile plugins/print-message/Makefile plugins/groupwise-account-setup/Makefile plugins/hula-account-setup/Makefile plugins/groupwise-features/Makefile plugins/mail-account-disable/Makefile plugins/sa-junk-plugin/Makefile plugins/ipod-sync/Makefile plugins/publish-calendar/Makefile plugins/import-ics-attachments/Makefile smime/Makefile smime/lib/Makefile smime/gui/Makefile tools/Makefile evolution-zip evolution-shell.pc evolution-plugin.pc ]) if test "x$with_sub_version" != "x"; then echo " Evolution ($with_sub_version) has been configured as follows: " else echo " Evolution has been configured as follows: " fi echo " LDAP support: $msg_ldap HAL: $HAVE_HAL" if test "$msg_nntp" = "yes"; then echo "\ NNTP support: $msg_nntp" fi echo "\ Pilot conduits: $msg_pilot Libnotify: $HAVE_LIBNOTIFY Kerberos 4/5: $msg_krb4/$msg_krb5 SSL support: $msg_ssl SMIME support: $msg_smime Plugins: $msg_plugins Gtk-doc: $enable_gtk_doc DBus API version $DBUS_VERSION" if test x$enable_gtk_doc = xyes; then echo " Programming documentation files will be built automatically. " else echo " Programming documentation files will not be built. You may want to install the gtk-doc package so that you will get the Evolution Developer's Guide. " fi