Detect the presense of libgsasl library.
Showing
1 changed file
with
65 additions
and
0 deletions
m4/gsasl.m4
0 → 100644
1 | dnl This file is part of GNU mailutils. | ||
2 | dnl Copyright (C) 2003 Free Software Foundation, Inc. | ||
3 | dnl | ||
4 | dnl GNU Mailutils is free software; you can redistribute it and/or modify | ||
5 | dnl it under the terms of the GNU General Public License as published by | ||
6 | dnl the Free Software Foundation; either version 2, or (at your option) | ||
7 | dnl any later version. | ||
8 | dnl | ||
9 | dnl GNU Mailutils is distributed in the hope that it will be useful, | ||
10 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | dnl GNU General Public License for more details. | ||
13 | dnl | ||
14 | dnl You should have received a copy of the GNU General Public License | ||
15 | dnl along with GNU Mailutils; if not, write to the Free Software | ||
16 | dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | dnl | ||
18 | AC_DEFUN(MU_CHECK_GSASL, | ||
19 | [AC_CACHE_CHECK([whether to use GNU SASL library], | ||
20 | [mu_cv_lib_gsasl], | ||
21 | [if test "x$mu_cv_lib_gsasl" = x; then | ||
22 | cached="" | ||
23 | mu_cv_lib_gsasl=no | ||
24 | |||
25 | AC_ARG_WITH(gsasl, | ||
26 | AC_HELP_STRING([--with-gsasl], [use libgsasl for SASL authentication]), | ||
27 | [case $withval in | ||
28 | yes|no) wantgsasl=$withval;; | ||
29 | *) AC_MSG_ERROR(bad value for --with-gsasl: $withval);; | ||
30 | esac], | ||
31 | [wantgsasl=no]) | ||
32 | |||
33 | if test $wantgsasl = yes; then | ||
34 | AC_CHECK_HEADER(gsasl.h, | ||
35 | [:], | ||
36 | [wantgsasl=no]) | ||
37 | |||
38 | if test $wantgsasl != no; then | ||
39 | save_LIBS=$LIBS | ||
40 | AC_CHECK_LIB(gsasl, gsasl_init, | ||
41 | [mu_cv_lib_gsasl=-lgsasl], | ||
42 | [mu_cv_lib_gsasl=no]) | ||
43 | if test $mu_cv_lib_gsasl != no; then | ||
44 | LIBS="$LIBS $mu_cv_lib_gsasl" | ||
45 | AC_TRY_RUN([ | ||
46 | #include <gsasl.h> | ||
47 | |||
48 | int | ||
49 | main() | ||
50 | { | ||
51 | return gsasl_check_version ("$1") == (char*) 0; | ||
52 | }], | ||
53 | [:], | ||
54 | [mu_cv_lib_gsasl=no], | ||
55 | [mu_cv_lib_gsasl=no]) | ||
56 | fi | ||
57 | LIBS=$save_LIBS | ||
58 | fi | ||
59 | fi | ||
60 | fi]) | ||
61 | if test $mu_cv_lib_gsasl != no; then | ||
62 | GSASL_LIBS=$mu_cv_lib_gsasl | ||
63 | ifelse([$2],,,[$2]) | ||
64 | fi]) | ||
65 |
-
Please register or sign in to post a comment