Merge lp:~trond-norbye/pandora-build/sasl into lp:pandora-build

Proposed by Trond Norbye
Status: Merged
Merged at revision: not available
Proposed branch: lp:~trond-norbye/pandora-build/sasl
Merge into: lp:pandora-build
Diff against target: 137 lines
1 file modified
m4/pandora_sasl.m4 (+133/-0)
To merge this branch: bzr merge lp:~trond-norbye/pandora-build/sasl
Reviewer Review Type Date Requested Status
Monty Taylor Pending
Review via email: mp+14115@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Trond Norbye (trond-norbye) wrote :

New macros to detect sasl:

PANDORA_HAVE_SASL - detect libsasl or libsasl2. If you use this macro it will first search for libsasl, if it cannot find that it will search for libsasl2. If it finds libsasl2 it will populate the LIBSASL variables with the content of the LIBSASL2 variables so that the developer doesn't need to add double up of the logic in his code..

If you really want one of the two you can use one of the other macros:

PANDORA_HAVE_LIBSASL - detect libsasl
PANDORA_HAVE_LIBSASL2 - detect libsasl2

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'm4/pandora_sasl.m4'
2--- m4/pandora_sasl.m4 1970-01-01 00:00:00 +0000
3+++ m4/pandora_sasl.m4 2009-10-28 21:35:19 +0000
4@@ -0,0 +1,133 @@
5+dnl Copyright (C) 2009 Sun Microsystems
6+dnl This file is free software; Sun Microsystems
7+dnl gives unlimited permission to copy and/or distribute it,
8+dnl with or without modifications, as long as this notice is preserved.
9+
10+AC_DEFUN([_PANDORA_SEARCH_SASL],[
11+ AC_REQUIRE([AC_LIB_PREFIX])
12+
13+ dnl --------------------------------------------------------------------
14+ dnl Check for sasl
15+ dnl --------------------------------------------------------------------
16+ AC_ARG_ENABLE([sasl],
17+ [AS_HELP_STRING([--disable-sasl],
18+ [Build with sasl support @<:@default=on@:>@])],
19+ [ac_enable_sasl="$enableval"],
20+ [ac_enable_sasl="yes"])
21+
22+ AS_IF([test "x$ac_enable_sasl" = "xyes"],
23+ [
24+ AC_LIB_HAVE_LINKFLAGS(sasl,,[
25+ #include <stdlib.h>
26+ #include <sasl/sasl.h>
27+ ],[
28+ sasl_server_init(NULL, NULL);
29+ ])
30+
31+ AS_IF([test "x${ac_cv_libsasl}" != "xyes" ],
32+ [
33+ AC_LIB_HAVE_LINKFLAGS(sasl2,,[
34+ #include <stdlib.h>
35+ #include <sasl/sasl.h>
36+ ],[
37+ sasl_server_init(NULL, NULL);
38+ ])
39+ HAVE_LIBSASL="$HAVE_LIBSASL2"
40+ LIBSASL="$LIBSASL2"
41+ LIBSASL_PREFIX="$LIBSASL2_PREFIX"
42+ LTLIBSASL="$LT_LIBSASL2"
43+ ])
44+ ])
45+
46+ AS_IF([test "x${ac_cv_libsasl}" = "xyes" -o "x${ac_cv_libsasl2}" = "xyes"],
47+ [ac_cv_sasl=yes],
48+ [ac_cv_sasl=no])
49+
50+ AM_CONDITIONAL(HAVE_LIBSASL, [test "x${ac_cv_libsasl}" = "xyes"])
51+ AM_CONDITIONAL(HAVE_LIBSASL2, [test "x${ac_cv_libsasl2}" = "xyes"])
52+ AM_CONDITIONAL(HAVE_SASL, [test "x${ac_cv_sasl}" = "xyes"])
53+])
54+
55+AC_DEFUN([PANDORA_HAVE_SASL],[
56+ AC_REQUIRE([_PANDORA_SEARCH_SASL])
57+])
58+
59+AC_DEFUN([PANDORA_REQUIRE_SASL],[
60+ AC_REQUIRE([_PANDORA_SEARCH_SASL])
61+ AS_IF([test "x${ac_cv_sasl}" = "xno"],
62+ AC_MSG_ERROR([SASL (libsasl or libsasl2) is required for ${PACKAGE}]))
63+])
64+
65+AC_DEFUN([_PANDORA_SEARCH_LIBSASL],[
66+ AC_REQUIRE([AC_LIB_PREFIX])
67+
68+ dnl --------------------------------------------------------------------
69+ dnl Check for libsasl
70+ dnl --------------------------------------------------------------------
71+
72+ AC_ARG_ENABLE([libsasl],
73+ [AS_HELP_STRING([--disable-libsasl],
74+ [Build with libsasl support @<:@default=on@:>@])],
75+ [ac_enable_libsasl="$enableval"],
76+ [ac_enable_libsasl="yes"])
77+
78+ AS_IF([test "x$ac_enable_libsasl" = "xyes"],[
79+ AC_LIB_HAVE_LINKFLAGS(sasl,,[
80+ #include <stdlib.h>
81+ #include <sasl/sasl.h>
82+ ],[
83+ sasl_server_init(NULL, NULL);
84+ ])
85+ ],[
86+ ac_cv_libsasl="no"
87+ ])
88+
89+ AM_CONDITIONAL(HAVE_LIBSASL, [test "x${ac_cv_libsasl}" = "xyes"])
90+])
91+
92+AC_DEFUN([PANDORA_HAVE_LIBSASL],[
93+ AC_REQUIRE([_PANDORA_SEARCH_LIBSASL])
94+])
95+
96+AC_DEFUN([PANDORA_REQUIRE_LIBSASL],[
97+ AC_REQUIRE([_PANDORA_SEARCH_LIBSASL])
98+ AS_IF([test "x${ac_cv_libsasl}" = "xno"],
99+ AC_MSG_ERROR([libsasl is required for ${PACKAGE}]))
100+])
101+
102+AC_DEFUN([_PANDORA_SEARCH_LIBSASL2],[
103+ AC_REQUIRE([AC_LIB_PREFIX])
104+
105+ dnl --------------------------------------------------------------------
106+ dnl Check for libsasl2
107+ dnl --------------------------------------------------------------------
108+
109+ AC_ARG_ENABLE([libsasl2],
110+ [AS_HELP_STRING([--disable-libsasl2],
111+ [Build with libsasl2 support @<:@default=on@:>@])],
112+ [ac_enable_libsasl2="$enableval"],
113+ [ac_enable_libsasl2="yes"])
114+
115+ AS_IF([test "x$ac_enable_libsasl2" = "xyes"],[
116+ AC_LIB_HAVE_LINKFLAGS(sasl2,,[
117+ #include <stdlib.h>
118+ #include <sasl2/sasl2.h>
119+ ],[
120+ sasl2_server_init(NULL, NULL);
121+ ])
122+ ],[
123+ ac_cv_libsasl2="no"
124+ ])
125+
126+ AM_CONDITIONAL(HAVE_LIBSASL2, [test "x${ac_cv_libsasl2}" = "xyes"])
127+])
128+
129+AC_DEFUN([PANDORA_HAVE_LIBSASL2],[
130+ AC_REQUIRE([_PANDORA_SEARCH_LIBSASL2])
131+])
132+
133+AC_DEFUN([PANDORA_REQUIRE_LIBSASL2],[
134+ AC_REQUIRE([_PANDORA_SEARCH_LIBSASL2])
135+ AS_IF([test "x${ac_cv_libsasl2}" = "xno"],
136+ AC_MSG_ERROR([libsasl2 is required for ${PACKAGE}]))
137+])

Subscribers

People subscribed via source and target branches

to all changes: