~ubuntu-branches/ubuntu/trusty/libesmtp/trusty-proposed

« back to all changes in this revision

Viewing changes to configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy T. Bouse
  • Date: 2002-03-06 08:37:48 UTC
  • Revision ID: james.westby@ubuntu.com-20020306083748-ihmt32mddsslvg5i
Tags: upstream-0.8.11
ImportĀ upstreamĀ versionĀ 0.8.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl Process this file with autoconf to produce a configure script.
 
2
 
 
3
dnl #########################################################################
 
4
dnl 
 
5
dnl This file is part of libESMTP, a library for submission of RFC 2822
 
6
dnl formatted electronic mail messages using the SMTP protocol described
 
7
dnl in RFC 2821.
 
8
dnl 
 
9
dnl Copyright (C) 2001  Brian Stafford  <brian@stafford.uklinux.net>
 
10
dnl 
 
11
dnl This library is free software; you can redistribute it and/or
 
12
dnl modify it under the terms of the GNU Lesser General Public
 
13
dnl License as published by the Free Software Foundation; either
 
14
dnl version 2.1 of the License, or (at your option) any later version.
 
15
dnl 
 
16
dnl This library is distributed in the hope that it will be useful,
 
17
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
19
dnl Lesser General Public License for more details.
 
20
dnl 
 
21
dnl You should have received a copy of the GNU Lesser General Public
 
22
dnl License along with this library; if not, write to the Free Software
 
23
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
24
dnl 
 
25
dnl #########################################################################
 
26
 
 
27
AC_INIT(smtp-api.c)
 
28
AM_CONFIG_HEADER(config.h)
 
29
AM_INIT_AUTOMAKE([libesmtp],[0.8.11])
 
30
AC_CANONICAL_HOST
 
31
 
 
32
dnl #########################################################################
 
33
dnl Library versioning
 
34
dnl #########################################################################
 
35
 
 
36
LIB_CURRENT=5
 
37
LIB_REVISION=11
 
38
LIB_AGE=0
 
39
AC_SUBST(LIB_CURRENT)
 
40
AC_SUBST(LIB_REVISION)
 
41
AC_SUBST(LIB_AGE)
 
42
 
 
43
LIBESMTP_VERSION="$LIB_CURRENT:$LIB_REVISION:$LIB_AGE"
 
44
AC_SUBST(LIBESMTP_VERSION)
 
45
subdirs=
 
46
 
 
47
dnl #########################################################################
 
48
dnl Checks for programs.
 
49
dnl #########################################################################
 
50
AC_PROG_CC
 
51
AC_PROG_INSTALL
 
52
AC_PROG_MAKE_SET
 
53
AM_PROG_LIBTOOL
 
54
 
 
55
dnl #########################################################################
 
56
dnl Miscellaneous stuff
 
57
dnl #########################################################################
 
58
 
 
59
EXTRA_CFLAGS=""
 
60
case $host_vendor-$host_os in
 
61
sun*)
 
62
        AC_DEFINE(__EXTENSIONS__,1,[Sun's netdb.h needs this for getaddrinfo])
 
63
        ;;
 
64
osf*)
 
65
        AC_DEFINE(_OSF_SOURCE,1,[OSF needs this for getaddrinfo])
 
66
        ;;
 
67
*gnu*)
 
68
        AC_DEFINE(_GNU_SOURCE,1,[GNU needs this for strcasecmp etc])
 
69
        ;;
 
70
esac
 
71
 
 
72
dnl #########################################################################
 
73
dnl turn warnings into errors to enforce clean code
 
74
dnl #########################################################################
 
75
 
 
76
AC_ARG_ENABLE([more-warnings],
 
77
              ACX_HELP_STRING([--enable-more-warnings=no/yes/picky],[additional compiler warnings (default=yes)]),
 
78
              ,
 
79
              enable_more_warnings=yes)
 
80
 
 
81
if test "$GCC" = "yes" -a "$enable_more_warnings" != "no"; then
 
82
        EXTRA_CFLAGS="$EXTRA_CFLAGS \
 
83
        -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
 
84
        -Wstrict-prototypes -Wnested-externs -Wpointer-arith \
 
85
        -Wbad-function-cast -Wcast-align -Wsign-promo"
 
86
fi
 
87
if test "$GCC" = "yes" -a "$enable_more_warnings" = "picky"; then
 
88
        EXTRA_CFLAGS="$EXTRA_CFLAGS -fno-builtin -W -Werror -Wwrite-strings \
 
89
                        -Wcast-qual"
 
90
fi
 
91
 
 
92
AC_ARG_ENABLE([isoc],
 
93
              ACX_HELP_STRING([--disable-isoc],[check ISO C compliance (default=yes)]),
 
94
              ,
 
95
              enable_isoc=yes)
 
96
if test "$enable_isoc" != "no"; then
 
97
        if test "$GCC" = "yes"; then
 
98
                CFLAGS="-ansi -pedantic $CFLAGS"
 
99
        fi
 
100
        AC_DEFINE(_ISOC9X_SOURCE,1,[ISO compliant code])
 
101
        AC_DEFINE(_POSIX_C_SOURCE,199506L,[POSIX compliant code])
 
102
        AC_DEFINE(_XOPEN_SOURCE,500,[Single Unix conformance])
 
103
fi
 
104
 
 
105
dnl #########################################################################
 
106
dnl Checks for libraries and options.
 
107
dnl #########################################################################
 
108
 
 
109
AC_ARG_ENABLE([all],ACX_HELP_STRING([--enable-all], [convenience: enable features which default to off]),
 
110
              ,
 
111
              enable_all=no)
 
112
 
 
113
dnl #########################################################################
 
114
dnl Check whether to use SUS functions or libltdl for loading plugins.
 
115
dnl #########################################################################
 
116
 
 
117
have_dl=no
 
118
AC_SEARCH_LIBS(dlsym, dl svdl, [
 
119
        AC_DEFINE([HAVE_DLSYM],1,[the dlsym() function is available])
 
120
        have_dl=yes
 
121
])
 
122
if test x$have_dl = xno ; then
 
123
dnl # WARNING: I don't know what libraries ltdl depends on.  I just assume
 
124
dnl #          that if the punter asks for it, then it must be properly
 
125
dnl #          installed and the dynamic linker will sort the dependencies
 
126
dnl #          at link time.
 
127
 
 
128
        AC_SEARCH_LIBS(lt_dlsym, ltdl,
 
129
                have_dl=yes,
 
130
                AC_MSG_ERROR([libltdl not found (available from http://www.gnu.org/software/libtool/)])
 
131
        )
 
132
fi
 
133
 
 
134
dnl #########################################################################
 
135
dnl Check if using Posix Threads
 
136
dnl #########################################################################
 
137
 
 
138
AC_ARG_ENABLE([pthreads],
 
139
              ACX_HELP_STRING([--enable-pthreads], [build with support for Posix threads  (default=auto)]),
 
140
              ,
 
141
              enable_pthreads=auto)
 
142
 
 
143
if test x"$enable_pthreads" != xno ; then
 
144
        ACX_PTHREAD(enable_pthreads=yes,
 
145
                       if test x"$enable_pthreads" = xyes ; then
 
146
                                AC_MSG_ERROR([Cannot find the pthread library.])
 
147
                       else
 
148
                                enable_pthreads=no
 
149
                       fi
 
150
        )
 
151
fi
 
152
 
 
153
AC_MSG_CHECKING(whether to use Posix Threads)
 
154
if test x"$enable_pthreads" != xno ; then
 
155
        CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
 
156
        LDFLAGS="$PTHREAD_LDFLAGS $LDFLAGS"
 
157
        LIBS="$PTHREAD_LIBS $LIBS"
 
158
        CC="$PTHREAD_CC"
 
159
        AC_DEFINE([USE_PTHREADS],1,[Build with support for Posix threading])
 
160
        AC_MSG_RESULT([yes])
 
161
else
 
162
        AC_MSG_RESULT([no])
 
163
fi
 
164
 
 
165
dnl #########################################################################
 
166
dnl Check if Posix getaddrinfo() is available.  It is also possible to use
 
167
dnl the version from the lwres library distributed with BIND.
 
168
dnl #########################################################################
 
169
AC_ARG_ENABLE([emulate-getaddrinfo],
 
170
              ACX_HELP_STRING([--enable-emulate-getaddrinfo],
 
171
                             [enable getaddrinfo emulation (default=no)]),
 
172
              ,
 
173
              enable_emulate_getaddrinfo=no)
 
174
AC_ARG_WITH(lwres,
 
175
            ACX_HELP_STRING([--with-lwres=DIR],
 
176
                           [use lwres library for getaddrinfo (default=no)]),
 
177
            ,
 
178
            with_lwres=no)
 
179
 
 
180
dnl ## enable force to test getaddrinfo.c
 
181
if test x$enable_emulate_getaddrinfo = xforce ; then
 
182
        enable_emulate_getaddrinfo=yes
 
183
        have_getaddrinfo=no
 
184
else
 
185
 
 
186
have_getaddrinfo=no
 
187
if test x$with_lwres != xno ; then
 
188
        if test "$with_lwres" != yes ; then
 
189
                   CPPFLAGS="-I${with_lwres}/include $CPPFLAGS"
 
190
                   LDFLAGS="-L${with_lwres}/lib $LDFLAGS"
 
191
        fi
 
192
        AC_CHECK_HEADERS(lwres/netdb.h, ,
 
193
                        [AC_MSG_ERROR([cannot find <lwres/netdb.h>])])
 
194
        AC_CHECK_LIB(lwres, lwres_getaddrinfo, ,
 
195
                     [AC_MSG_ERROR([cannot find the lwres library])],
 
196
                     -lnsl -lpthread)
 
197
        have_getaddrinfo=yes
 
198
fi
 
199
 
 
200
if test x$have_getaddrinfo != xyes ; then
 
201
        AC_SEARCH_LIBS(getaddrinfo, socket resolv bind nsl c_r cr, have_getaddrinfo=yes)
 
202
fi
 
203
 
 
204
dnl # Special nonsense for systems that actually have getaddrinfo but
 
205
dnl # redefine the name to something else, e.g. OSF
 
206
if test x$have_getaddrinfo != xyes ; then
 
207
        AC_MSG_CHECKING(if getaddrinfo is redefined in netdb.h)
 
208
        AC_TRY_LINK([
 
209
#               include <netdb.h>
 
210
        ], [
 
211
                struct addrinfo hints, *res;
 
212
                int err;
 
213
 
 
214
                err = getaddrinfo ("host", "service", &hints, &res);
 
215
        ], [
 
216
                have_getaddrinfo=yes
 
217
                AC_MSG_RESULT(yes)
 
218
        ], [AC_MSG_RESULT(no)])
 
219
fi
 
220
 
 
221
fi
 
222
 
 
223
if test x$have_getaddrinfo != xno ; then
 
224
        if test x$enable_emulate_getaddrinfo != xno ; then
 
225
                AC_MSG_ERROR([getaddrinfo found but emulate-getaddrinfo was enabled])
 
226
        fi
 
227
        AC_DEFINE(HAVE_GETADDRINFO, 1,
 
228
                  [Does system provide RFC 2553/Posix getaddrinfo?])
 
229
else
 
230
        if test x$enable_emulate_getaddrinfo != xyes ; then
 
231
                AC_MSG_ERROR([getaddrinfo not found: try --with-lwres or --enable-emulate-getaddrinfo])
 
232
        fi
 
233
        LIBOBJS="$LIBOBJS getaddrinfo.o"
 
234
fi
 
235
 
 
236
if test x"$enable_emulate_getaddrinfo" != xno ; then
 
237
    have_resolver=no
 
238
 
 
239
  dnl  Try for getipnodebyname
 
240
    AC_SEARCH_LIBS(getipnodebyname, resolv bind nsl c_r cr, have_resolver=yes)
 
241
    if test x"$have_resolver" != xno ; then
 
242
         AC_DEFINE(HAVE_GETIPNODEBYNAME, 1,
 
243
                   [Set when getipnodebyname is available])
 
244
    fi
 
245
 
 
246
  dnl  Try for gethostbyname_r
 
247
    if test x"$have_resolver" = xno ; then
 
248
        AC_SEARCH_LIBS(gethostbyname_r, resolv bind nsl c_r cr,
 
249
                       [have_resolver=yes
 
250
                        ACX_WHICH_GETHOSTBYNAME_R])
 
251
    fi
 
252
 
 
253
  dnl  Try for gethostbyname
 
254
    if test x"$have_resolver" = xno ; then
 
255
        if test x"$enable_pthreads" != xno ; then
 
256
            AC_MSG_WARN([using threads but cannot find gethostbyname_r or getipnodebyname])
 
257
        fi
 
258
        AC_SEARCH_LIBS(gethostbyname, resolv bind nsl, ,
 
259
                       [AC_MSG_ERROR([cannot find gethostbyname])])
 
260
    fi
 
261
    LIBOBJS="$LIBOBJS gethostbyname.o"
 
262
 
 
263
    AC_CACHE_CHECK([for IPv6 support], acx_cv_sys_use_ipv6, [
 
264
            AC_TRY_COMPILE([
 
265
#               include <netinet/in.h>
 
266
            ], [
 
267
                struct sockaddr_in6 sin6;
 
268
                void *p;
 
269
 
 
270
                sin6.sin6_family = AF_INET6;
 
271
                sin6.sin6_port = 587;
 
272
                p = &sin6.sin6_addr;
 
273
            ], [acx_cv_sys_use_ipv6=yes], [acx_cv_sys_use_ipv6=no])
 
274
    ])
 
275
    if test x"$acx_cv_sys_use_ipv6" != xno ; then
 
276
            AC_DEFINE(USE_IPV6,1,[Enable IPv6 support])
 
277
    fi
 
278
fi
 
279
 
 
280
dnl #########################################################################
 
281
dnl Check if using OpenSSL
 
282
dnl #########################################################################
 
283
AC_ARG_WITH(openssl,
 
284
            ACX_HELP_STRING([--with-openssl=DIR],
 
285
                           [build features depending on OpenSSL (default=auto)]),
 
286
            ,
 
287
            with_openssl=auto)
 
288
if test x$with_openssl != xno ; then
 
289
        if test "$with_openssl" != yes -a "$with_openssl" != auto ; then
 
290
                   CPPFLAGS="-I${with_openssl}/include $CPPFLAGS"
 
291
                   LDFLAGS="-L${with_openssl}/lib $LDFLAGS"
 
292
                   with_openssl=yes
 
293
        fi
 
294
        dnl *** with_openssl is either "yes" or "auto"
 
295
        AC_CHECK_HEADER(openssl/ssl.h,,
 
296
                        if test x"$with_openssl" = xyes ; then
 
297
                                AC_MSG_ERROR([cannot find the ssl headers])
 
298
                        else
 
299
                                with_openssl=no
 
300
                        fi
 
301
        )
 
302
fi
 
303
if test x$with_openssl != xno ; then
 
304
        AC_CHECK_LIB(ssl, SSL_library_init, [
 
305
                                with_openssl=yes
 
306
                                LIBS="-lssl -lcrypto $LIBS"
 
307
                     ], [
 
308
                     if test x"$with_openssl" = xyes ; then
 
309
                                AC_MSG_ERROR([cannot find the ssl library])
 
310
                     else
 
311
                                with_openssl=no
 
312
                     fi],
 
313
                     -lcrypto
 
314
        )
 
315
fi
 
316
 
 
317
dnl #########################################################################
 
318
dnl Set OpenSSL dependencies for RPM - this sucks, there must be a better way.
 
319
dnl #########################################################################
 
320
 
 
321
RPM_REQUIRES=""
 
322
RPM_BUILDREQUIRES=""
 
323
RPM_OPENSSL=""
 
324
RPM_OPENSSLDEVEL=""
 
325
if test x$with_openssl != xno ; then
 
326
        RPM_REQUIRES="Requires:"
 
327
        RPM_BUILDREQUIRES="BuildRequires:"
 
328
        RPM_OPENSSL="openssl >= %{openssl}"
 
329
        RPM_OPENSSLDEVEL="openssl-devel >= %{openssl}"
 
330
fi
 
331
AC_SUBST(RPM_REQUIRES)
 
332
AC_SUBST(RPM_BUILDREQUIRES)
 
333
AC_SUBST(RPM_OPENSSL)
 
334
AC_SUBST(RPM_OPENSSLDEVEL)
 
335
 
 
336
dnl #########################################################################
 
337
dnl Check if using SMTP AUTH using SASL
 
338
dnl #########################################################################
 
339
 
 
340
dnl Force use of SMTP AUTH for now.  Eventually it is hoped that
 
341
dnl the SASL API will move into a library of its own.  The USE_SASL
 
342
dnl option will then be needed to select whether SMTP AUTH is to be
 
343
dnl built since libESMTP will depend on the SASL library.
 
344
 
 
345
AC_DEFINE(USE_SASL,1,[Build with support for SMTP AUTH using SASL])
 
346
SASL_PLUGINS="login plain crammd5"
 
347
 
 
348
dnl Set up the authentication plugin directory
 
349
 
 
350
AC_ARG_WITH(auth-plugin-dir,
 
351
            ACX_HELP_STRING([--with-auth-plugin-dir=DIR],
 
352
                           [directory for SASL plugins (default=LIBDIR/esmtp-plugins)]),
 
353
            plugindir=$withval)
 
354
if test x$plugindir = x ; then
 
355
        plugindir=$libdir/esmtp-plugins
 
356
fi
 
357
AC_SUBST(plugindir)
 
358
ACX_DEFINE_DIR([AUTHPLUGINDIR], $plugindir, [location of authentication plugins.])
 
359
 
 
360
have_libcrypto=no
 
361
 
 
362
dnl Check for md5 functions in OpenSSL.  If these are present, use them
 
363
dnl in preference to the supplied md5.[ch] when building the CRAM-MD5
 
364
dnl SASL plugin.  The assumption is that the OpenSSL functions are optimised
 
365
dnl and actively maintained.
 
366
 
 
367
use_local_md5_c=yes
 
368
CRAMMD5_LIBOBJS=""
 
369
if test x$with_openssl != xno ; then
 
370
        AC_CHECK_HEADER(openssl/md5.h, [
 
371
                AC_CHECK_LIB(crypto, MD5_Init, [
 
372
                             have_libcrypto=yes
 
373
                             use_local_md5_c=no
 
374
                             CRAMMD5_LIBS="-lcrypto"
 
375
                             AC_SUBST(CRAMMD5_LIBS)
 
376
                ])
 
377
        ])
 
378
fi
 
379
if test x$use_local_md5_c != xno ; then
 
380
        CRAMMD5_LIBOBJS="$CRAMMD5_LIBOBJS md5.o"
 
381
fi
 
382
CRAMMD5_LTLIBOBJS=`echo "$CRAMMD5_LIBOBJS" | sed ['s/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/']`
 
383
AC_SUBST(CRAMMD5_LTLIBOBJS)
 
384
 
 
385
dnl Check if enabling NTLM authentication.  For now this requires that
 
386
dnl OpenSSL is available.
 
387
if test x$with_openssl != xno ; then
 
388
        AC_CHECK_HEADER(openssl/md4.h, [
 
389
                AC_CHECK_LIB(crypto, MD4_Init, [
 
390
                             have_libcrypto=yes
 
391
                             SASL_PLUGINS="$SASL_PLUGINS ntlm"
 
392
                             NTLM_LIBS="-lcrypto"
 
393
                             AC_SUBST(NTLM_LIBS)
 
394
                ])
 
395
        ])
 
396
fi
 
397
 
 
398
if test x$have_libcrypto != xno ; then
 
399
   AC_DEFINE(HAVE_LIBCRYPTO,1,[Set when -lcrypto from OpenSSL is available])
 
400
fi
 
401
 
 
402
dnl #########################################################################
 
403
dnl Check if enabling STARTTLS
 
404
dnl #########################################################################
 
405
 
 
406
AC_MSG_CHECKING(whether to enable STARTTLS)
 
407
if test x"$with_openssl" != xno ; then
 
408
        AC_MSG_RESULT([yes])
 
409
        AC_DEFINE(USE_TLS,1,[Build with support for SMTP STARTTLS extension])
 
410
else
 
411
        AC_MSG_RESULT([no])
 
412
fi
 
413
 
 
414
dnl #########################################################################
 
415
dnl Enable ETRN (experimental)
 
416
dnl #########################################################################
 
417
 
 
418
AC_ARG_ENABLE([etrn],
 
419
              ACX_HELP_STRING([--enable-etrn],[experimental support for ETRN  (default=no)]),
 
420
              ,
 
421
              enable_etrn=$enable_all)
 
422
 
 
423
AC_MSG_CHECKING(whether to enable ETRN)
 
424
if test x"$enable_etrn" = xyes ; then
 
425
        AC_MSG_RESULT([yes])
 
426
        AC_DEFINE(USE_ETRN,1,[Enable experimental support for SMTP STARTTLS extension])
 
427
else
 
428
        AC_MSG_RESULT([no])
 
429
fi
 
430
 
 
431
dnl #########################################################################
 
432
dnl Enable XUSR
 
433
dnl #########################################################################
 
434
 
 
435
AC_ARG_ENABLE([xusr],
 
436
              ACX_HELP_STRING([--disable-xusr],
 
437
                             [support for sendmail XUSR extension (default=yes)]),
 
438
              ,
 
439
              enable_xusr=yes)
 
440
 
 
441
AC_MSG_CHECKING(whether to enable sendmail XUSR)
 
442
if test x"$enable_xusr" = xyes ; then
 
443
        AC_MSG_RESULT([yes])
 
444
        AC_DEFINE(USE_XUSR,1,[Enable support for sendmail XUSR extension])
 
445
else
 
446
        AC_MSG_RESULT([no])
 
447
fi
 
448
 
 
449
dnl #########################################################################
 
450
dnl Enable non-standard AUTH= syntax in EHLO response
 
451
dnl #########################################################################
 
452
 
 
453
AC_ARG_ENABLE([nsauth],
 
454
              ACX_HELP_STRING([--enable-nsauth],
 
455
                              [support non-standard EHLO AUTH= response (default=no)]),
 
456
              ,
 
457
              enable_nsauth=$enable_all)
 
458
 
 
459
AC_MSG_CHECKING([whether to enable non-standard EHLO AUTH= response])
 
460
if test x"$enable_nsauth" = xyes ; then
 
461
        AC_MSG_RESULT([yes])
 
462
        AC_DEFINE(AUTH_ID_HACK,1,[support non-standard EHLO AUTH= response])
 
463
else
 
464
        AC_MSG_RESULT([no])
 
465
fi
 
466
 
 
467
dnl #########################################################################
 
468
dnl Require all recipients hack (not recommended)
 
469
dnl #########################################################################
 
470
 
 
471
AC_ARG_ENABLE([require-all-recipients],
 
472
              ACX_HELP_STRING([--enable-require-all-recipients],
 
473
                              [[add extra API call, needed for Balsa (default=no)]]),
 
474
              ,
 
475
              enable_require_all_recipients=$enable_all)
 
476
 
 
477
if test x"$enable_require_all_recipients" != xno ; then
 
478
  AC_DEFINE(USE_REQUIRE_ALL_RECIPIENTS,1,
 
479
            [Build smtp_option_require_all_recipients() API])
 
480
fi
 
481
 
 
482
dnl #########################################################################
 
483
dnl Enable debugging code, e.g. assert()
 
484
dnl #########################################################################
 
485
 
 
486
AC_ARG_ENABLE([debug],
 
487
              ACX_HELP_STRING([--enable-debug],
 
488
                             [enable use of debugging code (default=no)]),
 
489
              ,
 
490
              enable_debug=no)
 
491
 
 
492
if test x"$enable_debug" != xno ; then
 
493
  AC_DEFINE(DEBUG,1, [Enable additional debugging code])
 
494
else
 
495
  AC_DEFINE(NDEBUG,1, [Disable assertions])
 
496
fi
 
497
 
 
498
dnl #########################################################################
 
499
dnl Checks for header files.
 
500
dnl #########################################################################
 
501
 
 
502
AC_HEADER_STDC
 
503
AC_CHECK_HEADERS(sys/ioctl.h unistd.h)
 
504
 
 
505
dnl #########################################################################
 
506
dnl Checks for typedefs, structures, and compiler characteristics.
 
507
dnl #########################################################################
 
508
 
 
509
AC_C_CONST
 
510
AC_C_INLINE
 
511
AC_C_BIGENDIAN
 
512
AC_STRUCT_TM
 
513
AC_HEADER_TIME
 
514
AC_STRUCT_TIMEZONE
 
515
 
 
516
dnl #########################################################################
 
517
dnl Check for types
 
518
dnl #########################################################################
 
519
AC_CHECK_SIZEOF(unsigned short)
 
520
AC_CHECK_SIZEOF(unsigned int)
 
521
AC_CHECK_SIZEOF(unsigned long)
 
522
 
 
523
dnl #########################################################################
 
524
dnl Checks for library functions.
 
525
dnl #########################################################################
 
526
 
 
527
AC_REPLACE_FUNCS(strdup strcasecmp strncasecmp)
 
528
AC_CHECK_FUNCS(strtol uname gethostname)
 
529
AC_SEARCH_LIBS(socket, socket)
 
530
 
 
531
dnl Conditional check for functions needed in threaded code
 
532
 
 
533
if test x"$enable_pthreads" != xno ; then
 
534
        AC_SEARCH_LIBS(localtime_r, c_r cr,
 
535
                       AC_DEFINE(HAVE_LOCALTIME_R,1,[Set when localtime_r is available]),
 
536
                       AC_MSG_ERROR([Cannot find localtime_r.]))
 
537
        AC_CHECK_FUNCS(strerror_r,[
 
538
            AC_CACHE_CHECK([for working strerror_r],
 
539
                           acx_cv_sys_working_strerror_r, [
 
540
                AC_TRY_COMPILE([
 
541
#                       define _SVID_SOURCE     1
 
542
#                       include <string.h>
 
543
                ], [
 
544
                        char *s;
 
545
 
 
546
                        s = strerror_r (0, (char *) 0, 0);
 
547
                ],
 
548
                [acx_cv_sys_working_strerror_r=yes],
 
549
                [acx_cv_working_strerror_r=no])
 
550
            ])
 
551
            if test x$acx_cv_sys_working_strerror_r = xyes ; then
 
552
                AC_DEFINE(HAVE_WORKING_STRERROR_R,1,[strerror_r works!])
 
553
            fi
 
554
        ])
 
555
else
 
556
        AC_CHECK_FUNCS(localtime strerror)
 
557
fi
 
558
 
 
559
dnl #########################################################################
 
560
dnl Check that snprintf works correctly.
 
561
dnl #########################################################################
 
562
ACX_SNPRINTF(,[LIBOBJS="$LIBOBJS snprintf.o"])
 
563
 
 
564
dnl #########################################################################
 
565
dnl Make substitutions
 
566
dnl #########################################################################
 
567
 
 
568
AC_SUBST(SASL_PLUGINS)
 
569
AC_SUBST(LIBTOOL_DEPS)
 
570
AC_SUBST(LIBS)
 
571
AC_SUBST(CFLAGS)
 
572
AC_SUBST(EXTRA_CFLAGS)
 
573
AC_SUBST(CC)
 
574
AC_SUBST(RANLIB)
 
575
AC_SUBST(subdirs)
 
576
 
 
577
LTLIBOBJS=`echo "$LIBOBJS" | sed ['s/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/']`
 
578
AC_SUBST(LTLIBOBJS)
 
579
LTALLOCA=`echo "$ALLOCA" | sed ['s/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/']`
 
580
AC_SUBST(LTALLOCA)
 
581
 
 
582
AC_OUTPUT([libesmtp-config libesmtp.spec
 
583
           Makefile login/Makefile plain/Makefile crammd5/Makefile ntlm/Makefile])
 
584
 
 
585
dnl #########################################################################
 
586
dnl Feature synopsis
 
587
dnl #########################################################################
 
588
 
 
589
echo
 
590
echo '*************************'
 
591
echo '*** libESMTP features ***'
 
592
echo '*************************'
 
593
d=`eval echo $plugindir`
 
594
ACX_FEATURE([with],[auth-plugin-dir],[`eval echo $d`])
 
595
ACX_FEATURE([with],[lwres])
 
596
ACX_FEATURE([with],[openssl])
 
597
ACX_FEATURE([enable],[pthreads])
 
598
ACX_FEATURE([enable],[etrn])
 
599
ACX_FEATURE([enable],[xusr])
 
600
ACX_FEATURE([enable],[nsauth])
 
601
ACX_FEATURE([enable],[require-all-recipients])
 
602
ACX_FEATURE([enable],[debug])
 
603