1 |
dnl sasl.m4--sasl libraries and includes |
2 |
dnl Derrick Brashear |
3 |
dnl from KTH sasl and Arla |
4 |
dnl $Id: sasl.m4,v 1.21 2002/12/21 18:44:25 cg2v Exp $ |
5 |
|
6 |
AC_DEFUN(CMU_SASL_INC_WHERE1, [ |
7 |
saved_CPPFLAGS=$CPPFLAGS |
8 |
CPPFLAGS="$saved_CPPFLAGS -I$1" |
9 |
CMU_CHECK_HEADER_NOCACHE(sasl.h, |
10 |
ac_cv_found_sasl_inc=yes, |
11 |
ac_cv_found_sasl_inc=no) |
12 |
CPPFLAGS=$saved_CPPFLAGS |
13 |
]) |
14 |
|
15 |
AC_DEFUN(CMU_SASL_INC_WHERE, [ |
16 |
for i in $1; do |
17 |
CMU_SASL_INC_WHERE1($i) |
18 |
CMU_TEST_INCPATH($i, sasl) |
19 |
if test "$ac_cv_found_sasl_inc" = "yes"; then |
20 |
ac_cv_sasl_where_inc=$i |
21 |
break |
22 |
fi |
23 |
done |
24 |
]) |
25 |
|
26 |
AC_DEFUN(CMU_SASL_LIB_WHERE1, [ |
27 |
saved_LIBS=$LIBS |
28 |
LIBS="$saved_LIBS -L$1 -lsasl" |
29 |
AC_TRY_LINK(, |
30 |
[sasl_getprop();], |
31 |
[ac_cv_found_sasl_lib=yes], |
32 |
ac_cv_found_sasl_lib=no) |
33 |
LIBS=$saved_LIBS |
34 |
]) |
35 |
|
36 |
AC_DEFUN(CMU_SASL_LIB_WHERE, [ |
37 |
for i in $1; do |
38 |
CMU_SASL_LIB_WHERE1($i) |
39 |
dnl deal with false positives from implicit link paths |
40 |
CMU_TEST_LIBPATH($i, sasl) |
41 |
if test "$ac_cv_found_sasl_lib" = "yes" ; then |
42 |
ac_cv_sasl_where_lib=$i |
43 |
break |
44 |
fi |
45 |
done |
46 |
]) |
47 |
|
48 |
AC_DEFUN(CMU_SASL, [ |
49 |
AC_ARG_WITH(sasl, |
50 |
[ --with-sasl=DIR Compile with libsasl in <DIR>], |
51 |
with_sasl="$withval", |
52 |
with_sasl="yes") |
53 |
|
54 |
SASLFLAGS="" |
55 |
LIB_SASL="" |
56 |
|
57 |
cmu_saved_CPPFLAGS=$CPPFLAGS |
58 |
cmu_saved_LDFLAGS=$LDFLAGS |
59 |
cmu_saved_LIBS=$LIBS |
60 |
if test -d ${with_sasl}; then |
61 |
ac_cv_sasl_where_lib=${with_sasl}/lib |
62 |
ac_cv_sasl_where_inc=${with_sasl}/include |
63 |
|
64 |
SASLFLAGS="-I$ac_cv_sasl_where_inc" |
65 |
LIB_SASL="-L$ac_cv_sasl_where_lib" |
66 |
CPPFLAGS="${cmu_saved_CPPFLAGS} -I${ac_cv_sasl_where_inc}" |
67 |
LDFLAGS="${cmu_saved_LDFLAGS} -L${ac_cv_sasl_where_lib}" |
68 |
fi |
69 |
|
70 |
AC_CHECK_HEADER(sasl.h, |
71 |
AC_CHECK_LIB(sasl, sasl_getprop, |
72 |
ac_cv_found_sasl=yes, |
73 |
ac_cv_found_sasl=no), ac_cv_found_sasl=no) |
74 |
|
75 |
LIBS="$cmu_saved_LIBS" |
76 |
LDFLAGS="$cmu_saved_LDFLAGS" |
77 |
CPPFLAGS="$cmu_saved_CPPFLAGS" |
78 |
if test "$ac_cv_found_sasl" = yes; then |
79 |
LIB_SASL="$LIB_SASL -lsasl" |
80 |
else |
81 |
LIB_SASL="" |
82 |
SASLFLAGS="" |
83 |
fi |
84 |
AC_SUBST(LIB_SASL) |
85 |
AC_SUBST(SASLFLAGS) |
86 |
]) |
87 |
|
88 |
AC_DEFUN(CMU_SASL_REQUIRED, |
89 |
[AC_REQUIRE([CMU_SASL]) |
90 |
if test "$ac_cv_found_sasl" != "yes"; then |
91 |
AC_ERROR([Cannot continue without libsasl. |
92 |
Get it from ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/.]) |
93 |
fi]) |