-rw-r--r-- | acinclude.m4 | 17 | ||||
-rw-r--r-- | configure.ac | 32 | ||||
-rw-r--r-- | include/Makefile.am | 3 | ||||
-rw-r--r-- | include/opkele/consumer.h | 6 | ||||
-rw-r--r-- | include/opkele/server.h | 4 | ||||
-rw-r--r-- | include/opkele/types.h | 7 |
6 files changed, 59 insertions, 10 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 80defc7..fbb4cdc 100644 --- a/acinclude.m4 +++ b/acinclude.m4 | |||
@@ -165,2 +165,19 @@ AC_DEFUN([AC_WITH_PCREPP],[ | |||
165 | 165 | ||
166 | dnl AC_CHECK_SHAREDPTR(NS,HEADER[,ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]]) | ||
167 | AC_DEFUN([AC_CHECK_SHAREDPTR],[ | ||
168 | AC_LANG_PUSH([C++]) | ||
169 | AC_MSG_CHECKING([for $1::shared_ptr<> in $2]) | ||
170 | AC_COMPILE_IFELSE([ | ||
171 | #include <$2> | ||
172 | int main(int c,char**v) { $1::shared_ptr<int> spi(new int(0)); return *spi; } | ||
173 | ],[ | ||
174 | AC_MSG_RESULT([found]) | ||
175 | $3 | ||
176 | ],[ | ||
177 | AC_MSG_RESULT([not found]) | ||
178 | $4 | ||
179 | ]) | ||
180 | AC_LANG_POP([C++]) | ||
181 | ]) | ||
182 | |||
166 | m4_include([acinclude.d/libcurl.m4]) | 183 | m4_include([acinclude.d/libcurl.m4]) |
diff --git a/configure.ac b/configure.ac index 1bd1873..c4e9a74 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -28,2 +28,33 @@ AC_DEFINE_UNQUOTED([PACKAGE_SRC_VERSION],["$PACKAGE_SRC_VERSION"],[more or less | |||
28 | 28 | ||
29 | tr1_mem_std="false" | ||
30 | tr1_mem_boost="false" | ||
31 | AC_CHECK_SHAREDPTR(std::tr1,tr1/memory,[ tr1_mem_std=true ]) | ||
32 | AC_CHECK_SHAREDPTR(boost,boost/shared_ptr.hpp,[ tr1_mem_boost=true ]) | ||
33 | tr1_mem="" | ||
34 | AC_ARG_WITH([tr1-memory], | ||
35 | AC_HELP_STRING([--with-tr1-memory=<boost|std>],[select tr1/memory (shared_ptr<>) implementation to use]), | ||
36 | [ tr1_mem="$withval" ] | ||
37 | ) | ||
38 | AC_MSG_CHECKING([for tr1/memory implementation to use]) | ||
39 | test -z "$tr1_mem" && $tr1_mem_std && tr1_mem=std | ||
40 | test -z "$tr1_mem" && $tr1_mem_boost && tr1_mem=boost | ||
41 | test -z "$tr1_mem" && AC_MSG_RESULT([none found]) || AC_MSG_RESULT([$tr1_mem]) | ||
42 | case "$tr1_mem" in | ||
43 | std) | ||
44 | $tr1_mem_std || AC_MSG_ERROR([std implementation requested, but not found]) | ||
45 | OPKELE_TR1_MEM_NS=std::tr1 | ||
46 | OPKELE_TR1_MEM_HEADER=tr1/memory | ||
47 | ;; | ||
48 | boost) | ||
49 | $tr1_mem_boost || AC_MSG_ERROR([boost implementation requested, but not found]) | ||
50 | OPKELE_TR1_MEM_NS=boost | ||
51 | OPKELE_TR1_MEM_HEADER=boost/shared_ptr.hpp | ||
52 | ;; | ||
53 | *) | ||
54 | AC_MSG_ERROR([no shared_ptr<> implementation found]) | ||
55 | ;; | ||
56 | esac | ||
57 | AC_SUBST([OPKELE_TR1_MEM_NS]) | ||
58 | AC_SUBST([OPKELE_TR1_MEM_HEADER]) | ||
59 | |||
29 | PKG_CHECK_MODULES([OPENSSL],[openssl],,[ | 60 | PKG_CHECK_MODULES([OPENSSL],[openssl],,[ |
@@ -146,2 +177,3 @@ AC_CONFIG_FILES([ | |||
146 | include/Makefile | 177 | include/Makefile |
178 | include/opkele/tr1-mem.h | ||
147 | lib/Makefile | 179 | lib/Makefile |
diff --git a/include/Makefile.am b/include/Makefile.am index 078c6dc..26cb614 100644 --- a/include/Makefile.am +++ b/include/Makefile.am | |||
@@ -14,3 +14,4 @@ nobase_include_HEADERS = \ | |||
14 | opkele/discovery.h \ | 14 | opkele/discovery.h \ |
15 | opkele/uris.h | 15 | opkele/uris.h \ |
16 | opkele/tr1-mem.h | ||
16 | EXTRA_DIST = \ | 17 | EXTRA_DIST = \ |
diff --git a/include/opkele/consumer.h b/include/opkele/consumer.h index c463787..3c1d318 100644 --- a/include/opkele/consumer.h +++ b/include/opkele/consumer.h | |||
@@ -33,3 +33,3 @@ namespace opkele { | |||
33 | * @param expires_in the number of seconds until the handle is expired | 33 | * @param expires_in the number of seconds until the handle is expired |
34 | * @return the auto_ptr<> for the newly allocated association_t object | 34 | * @return the assoc_t for the newly allocated association_t object |
35 | */ | 35 | */ |
@@ -75,3 +75,3 @@ namespace opkele { | |||
75 | * @param server the OpenID server | 75 | * @param server the OpenID server |
76 | * @return the auto_ptr<> for the newly allocated association_t object | 76 | * @return the assoc_t for the newly allocated association_t object |
77 | * @throw failed_lookup in case of absence of the handle | 77 | * @throw failed_lookup in case of absence of the handle |
@@ -95,3 +95,3 @@ namespace opkele { | |||
95 | * @param server the OpenID server | 95 | * @param server the OpenID server |
96 | * @return the auto_ptr<> for the newly allocated association_t | 96 | * @return the assoc_t for the newly allocated association_t |
97 | * object, representing established association | 97 | * object, representing established association |
diff --git a/include/opkele/server.h b/include/opkele/server.h index dd7fc41..3c25646 100644 --- a/include/opkele/server.h +++ b/include/opkele/server.h | |||
@@ -27,3 +27,3 @@ namespace opkele { | |||
27 | * statelessness of the association upon | 27 | * statelessness of the association upon |
28 | * @return the auto_ptr<> for the newly allocated association_t object | 28 | * @return the assoc_t for the newly allocated association_t object |
29 | */ | 29 | */ |
@@ -35,3 +35,3 @@ namespace opkele { | |||
35 | * @param h association handle | 35 | * @param h association handle |
36 | * @return the auto_ptr<> for the newly allocated association_t object | 36 | * @return the assoc_t for the newly allocated association_t object |
37 | * @throw failed_lookup in case of failure | 37 | * @throw failed_lookup in case of failure |
diff --git a/include/opkele/types.h b/include/opkele/types.h index ca07df5..d959021 100644 --- a/include/opkele/types.h +++ b/include/opkele/types.h | |||
@@ -12,4 +12,4 @@ | |||
12 | #include <map> | 12 | #include <map> |
13 | #include <memory> | ||
14 | #include <set> | 13 | #include <set> |
14 | #include <opkele/tr1-mem.h> | ||
15 | 15 | ||
@@ -20,3 +20,2 @@ namespace opkele { | |||
20 | using std::ostream; | 20 | using std::ostream; |
21 | using std::auto_ptr; | ||
22 | using std::multimap; | 21 | using std::multimap; |
@@ -110,5 +109,5 @@ namespace opkele { | |||
110 | /** | 109 | /** |
111 | * the auto_ptr<> for association_t object type | 110 | * the shared_ptr<> for association_t object type |
112 | */ | 111 | */ |
113 | typedef auto_ptr<association_t> assoc_t; | 112 | typedef tr1mem::shared_ptr<association_t> assoc_t; |
114 | 113 | ||