Merge lp://staging/~posulliv/libmemcached/sol-build-fixes into lp://staging/~tangent-org/libmemcached/trunk

Proposed by Padraig O'Sullivan
Status: Merged
Merged at revision: not available
Proposed branch: lp://staging/~posulliv/libmemcached/sol-build-fixes
Merge into: lp://staging/~tangent-org/libmemcached/trunk
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~posulliv/libmemcached/sol-build-fixes
Reviewer Review Type Date Requested Status
Libmemcached-developers Pending
Review via email: mp+8842@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Padraig O'Sullivan (posulliv) wrote :

Contains some small fixes for solaris builds.

-Padraig

565. By Padraig O'Sullivan

Updated the ChangeLog and the .pod document indicating the changes I made to
the memcached_get and memcached_get_by_key API calls.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'libmemcached/common.h'
--- libmemcached/common.h 2009-07-08 13:38:34 +0000
+++ libmemcached/common.h 2009-07-15 18:26:30 +0000
@@ -136,7 +136,7 @@
136136
137LIBMEMCACHED_LOCAL137LIBMEMCACHED_LOCAL
138memcached_return memcached_key_test(const char **keys, size_t *key_length,138memcached_return memcached_key_test(const char **keys, size_t *key_length,
139 unsigned int number_of_keys);139 size_t number_of_keys);
140140
141141
142LIBMEMCACHED_LOCAL142LIBMEMCACHED_LOCAL
143143
=== modified file 'libmemcached/memcached.hh'
--- libmemcached/memcached.hh 2009-07-15 09:05:00 +0000
+++ libmemcached/memcached.hh 2009-07-15 18:26:30 +0000
@@ -109,7 +109,7 @@
109 if (!real_keys.empty())109 if (!real_keys.empty())
110 {110 {
111 memcached_return rc= memcached_mget(&memc, &real_keys[0], &key_len[0], 111 memcached_return rc= memcached_mget(&memc, &real_keys[0], &key_len[0],
112 static_cast<unsigned int>(real_keys.size()));112 real_keys.size());
113 return (rc == MEMCACHED_SUCCESS);113 return (rc == MEMCACHED_SUCCESS);
114 }114 }
115115
116116
=== modified file 'libmemcached/memcached_get.c'
--- libmemcached/memcached_get.c 2009-07-08 13:38:34 +0000
+++ libmemcached/memcached_get.c 2009-07-15 18:26:30 +0000
@@ -103,7 +103,7 @@
103103
104memcached_return memcached_mget(memcached_st *ptr, 104memcached_return memcached_mget(memcached_st *ptr,
105 const char **keys, size_t *key_length, 105 const char **keys, size_t *key_length,
106 unsigned int number_of_keys)106 size_t number_of_keys)
107{107{
108 return memcached_mget_by_key(ptr, NULL, 0, keys, key_length, number_of_keys);108 return memcached_mget_by_key(ptr, NULL, 0, keys, key_length, number_of_keys);
109}109}
@@ -112,14 +112,14 @@
112 unsigned int master_server_key,112 unsigned int master_server_key,
113 bool is_master_key_set,113 bool is_master_key_set,
114 const char **keys, size_t *key_length,114 const char **keys, size_t *key_length,
115 unsigned int number_of_keys);115 size_t number_of_keys);
116116
117memcached_return memcached_mget_by_key(memcached_st *ptr, 117memcached_return memcached_mget_by_key(memcached_st *ptr,
118 const char *master_key, 118 const char *master_key,
119 size_t master_key_length,119 size_t master_key_length,
120 const char **keys, 120 const char **keys,
121 size_t *key_length, 121 size_t *key_length,
122 unsigned int number_of_keys)122 size_t number_of_keys)
123{123{
124 unsigned int x;124 unsigned int x;
125 memcached_return rc= MEMCACHED_NOTFOUND;125 memcached_return rc= MEMCACHED_NOTFOUND;
@@ -260,7 +260,7 @@
260 unsigned int master_server_key,260 unsigned int master_server_key,
261 bool is_master_key_set,261 bool is_master_key_set,
262 const char **keys, size_t *key_length, 262 const char **keys, size_t *key_length,
263 unsigned int number_of_keys)263 size_t number_of_keys)
264{264{
265 memcached_return rc= MEMCACHED_NOTFOUND;265 memcached_return rc= MEMCACHED_NOTFOUND;
266 uint32_t x;266 uint32_t x;
@@ -361,7 +361,7 @@
361static memcached_return replication_binary_mget(memcached_st *ptr,361static memcached_return replication_binary_mget(memcached_st *ptr,
362 uint32_t* hash, bool* dead_servers,362 uint32_t* hash, bool* dead_servers,
363 const char **keys, size_t *key_length,363 const char **keys, size_t *key_length,
364 unsigned int number_of_keys)364 size_t number_of_keys)
365{365{
366 memcached_return rc= MEMCACHED_NOTFOUND;366 memcached_return rc= MEMCACHED_NOTFOUND;
367 uint32_t x;367 uint32_t x;
@@ -460,7 +460,7 @@
460 unsigned int master_server_key,460 unsigned int master_server_key,
461 bool is_master_key_set,461 bool is_master_key_set,
462 const char **keys, size_t *key_length,462 const char **keys, size_t *key_length,
463 unsigned int number_of_keys)463 size_t number_of_keys)
464{464{
465 memcached_return rc;465 memcached_return rc;
466466
467467
=== modified file 'libmemcached/memcached_get.h'
--- libmemcached/memcached_get.h 2009-07-08 13:38:34 +0000
+++ libmemcached/memcached_get.h 2009-07-15 18:26:30 +0000
@@ -24,7 +24,7 @@
24LIBMEMCACHED_API24LIBMEMCACHED_API
25memcached_return memcached_mget(memcached_st *ptr, 25memcached_return memcached_mget(memcached_st *ptr,
26 const char **keys, size_t *key_length, 26 const char **keys, size_t *key_length,
27 unsigned int number_of_keys);27 size_t number_of_keys);
2828
29LIBMEMCACHED_API29LIBMEMCACHED_API
30char *memcached_get_by_key(memcached_st *ptr, 30char *memcached_get_by_key(memcached_st *ptr,
@@ -40,7 +40,7 @@
40 master_key_length,40 master_key_length,
41 const char **keys, 41 const char **keys,
42 size_t *key_length, 42 size_t *key_length,
43 unsigned int number_of_keys);43 size_t number_of_keys);
4444
45LIBMEMCACHED_API45LIBMEMCACHED_API
46char *memcached_fetch(memcached_st *ptr, 46char *memcached_fetch(memcached_st *ptr,
4747
=== modified file 'libmemcached/memcached_key.c'
--- libmemcached/memcached_key.c 2009-07-08 13:38:34 +0000
+++ libmemcached/memcached_key.c 2009-07-15 18:26:30 +0000
@@ -1,7 +1,7 @@
1#include "common.h"1#include "common.h"
22
3memcached_return memcached_key_test(const char **keys, size_t *key_length, 3memcached_return memcached_key_test(const char **keys, size_t *key_length,
4 unsigned int number_of_keys)4 size_t number_of_keys)
5{5{
6 uint32_t x;6 uint32_t x;
7 memcached_return rc;7 memcached_return rc;
88
=== added file 'm4/lib-ld.m4'
--- m4/lib-ld.m4 1970-01-01 00:00:00 +0000
+++ m4/lib-ld.m4 2009-07-16 02:58:56 +0000
@@ -0,0 +1,110 @@
1# lib-ld.m4 serial 3 (gettext-0.13)
2dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl Subroutines of libtool.m4,
8dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
9dnl with libtool.m4.
10
11dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
12AC_DEFUN([AC_LIB_PROG_LD_GNU],
13[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
14[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
15case `$LD -v 2>&1 </dev/null` in
16*GNU* | *'with BFD'*)
17 acl_cv_prog_gnu_ld=yes ;;
18*)
19 acl_cv_prog_gnu_ld=no ;;
20esac])
21with_gnu_ld=$acl_cv_prog_gnu_ld
22])
23
24dnl From libtool-1.4. Sets the variable LD.
25AC_DEFUN([AC_LIB_PROG_LD],
26[AC_ARG_WITH(gnu-ld,
27[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
28test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
29AC_REQUIRE([AC_PROG_CC])dnl
30AC_REQUIRE([AC_CANONICAL_HOST])dnl
31# Prepare PATH_SEPARATOR.
32# The user is always right.
33if test "${PATH_SEPARATOR+set}" != set; then
34 echo "#! /bin/sh" >conf$$.sh
35 echo "exit 0" >>conf$$.sh
36 chmod +x conf$$.sh
37 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
38 PATH_SEPARATOR=';'
39 else
40 PATH_SEPARATOR=:
41 fi
42 rm -f conf$$.sh
43fi
44ac_prog=ld
45if test "$GCC" = yes; then
46 # Check if gcc -print-prog-name=ld gives a path.
47 AC_MSG_CHECKING([for ld used by GCC])
48 case $host in
49 *-*-mingw*)
50 # gcc leaves a trailing carriage return which upsets mingw
51 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
52 *)
53 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
54 esac
55 case $ac_prog in
56 # Accept absolute paths.
57 [[\\/]* | [A-Za-z]:[\\/]*)]
58 [re_direlt='/[^/][^/]*/\.\./']
59 # Canonicalize the path of ld
60 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
61 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
62 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
63 done
64 test -z "$LD" && LD="$ac_prog"
65 ;;
66 "")
67 # If it fails, then pretend we aren't using GCC.
68 ac_prog=ld
69 ;;
70 *)
71 # If it is relative, then search for the first ld in PATH.
72 with_gnu_ld=unknown
73 ;;
74 esac
75elif test "$with_gnu_ld" = yes; then
76 AC_MSG_CHECKING([for GNU ld])
77else
78 AC_MSG_CHECKING([for non-GNU ld])
79fi
80AC_CACHE_VAL(acl_cv_path_LD,
81[if test -z "$LD"; then
82 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
83 for ac_dir in $PATH; do
84 test -z "$ac_dir" && ac_dir=.
85 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
86 acl_cv_path_LD="$ac_dir/$ac_prog"
87 # Check to see if the program is GNU ld. I'd rather use --version,
88 # but apparently some GNU ld's only accept -v.
89 # Break only if it was the GNU/non-GNU ld that we prefer.
90 case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
91 *GNU* | *'with BFD'*)
92 test "$with_gnu_ld" != no && break ;;
93 *)
94 test "$with_gnu_ld" != yes && break ;;
95 esac
96 fi
97 done
98 IFS="$ac_save_ifs"
99else
100 acl_cv_path_LD="$LD" # Let the user override the test with a path.
101fi])
102LD="$acl_cv_path_LD"
103if test -n "$LD"; then
104 AC_MSG_RESULT($LD)
105else
106 AC_MSG_RESULT(no)
107fi
108test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
109AC_LIB_PROG_LD_GNU
110])
0111
=== added file 'm4/lib-link.m4'
--- m4/lib-link.m4 1970-01-01 00:00:00 +0000
+++ m4/lib-link.m4 2009-07-16 02:58:56 +0000
@@ -0,0 +1,767 @@
1# lib-link.m4 serial 18 (gettext-0.18)
2dnl Copyright (C) 2001-2009 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Bruno Haible.
8
9AC_PREREQ([2.54])
10
11dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
12dnl the libraries corresponding to explicit and implicit dependencies.
13dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
14dnl augments the CPPFLAGS variable.
15dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
16dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
17AC_DEFUN([AC_LIB_LINKFLAGS],
18[
19 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
20 AC_REQUIRE([AC_LIB_RPATH])
21 pushdef([Name],[translit([$1],[./-], [___])])
22 pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
23 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
24 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
25 AC_LIB_LINKFLAGS_BODY([$1], [$2])
26 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
27 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
28 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
29 ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
30 ])
31 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
32 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
33 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
34 LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
35 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
36 AC_SUBST([LIB]NAME)
37 AC_SUBST([LTLIB]NAME)
38 AC_SUBST([LIB]NAME[_PREFIX])
39 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
40 dnl results of this search when this library appears as a dependency.
41 HAVE_LIB[]NAME=yes
42 popdef([NAME])
43 popdef([Name])
44])
45
46dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [system])
47dnl searches for libname and the libraries corresponding to explicit and
48dnl implicit dependencies, together with the specified include files and
49dnl the ability to compile and link the specified testcode. If found, it
50dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
51dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
52dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
53dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
54dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
55dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
56AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
57[
58 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
59 AC_REQUIRE([AC_LIB_RPATH])
60 pushdef([Name],[translit([$1],[./-], [___])])
61 pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
62 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
63
64 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
65 dnl accordingly.
66 AC_LIB_LINKFLAGS_BODY([$1], [$2], [$5])
67
68 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
69 dnl because if the user has installed lib[]Name and not disabled its use
70 dnl via --without-lib[]Name-prefix, he wants to use it.
71 ac_save_CPPFLAGS="$CPPFLAGS"
72 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
73
74 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
75 ac_save_LIBS="$LIBS"
76 LIBS="$LIBS $LIB[]NAME"
77 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
78 LIBS="$ac_save_LIBS"
79 ])
80 if test "$ac_cv_lib[]Name" = yes; then
81 HAVE_LIB[]NAME=yes
82 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
83 AC_MSG_CHECKING([how to link with lib[]$1])
84 AC_MSG_RESULT([$LIB[]NAME])
85 else
86 HAVE_LIB[]NAME=no
87 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
88 dnl $INC[]NAME either.
89 CPPFLAGS="$ac_save_CPPFLAGS"
90 LIB[]NAME=
91 LTLIB[]NAME=
92 LIB[]NAME[]_PREFIX=
93 fi
94 AC_SUBST([HAVE_LIB]NAME)
95 AC_SUBST([LIB]NAME)
96 AC_SUBST([LTLIB]NAME)
97 AC_SUBST([LIB]NAME[_PREFIX])
98 popdef([NAME])
99 popdef([Name])
100])
101
102dnl Determine the platform dependent parameters needed to use rpath:
103dnl acl_libext,
104dnl acl_shlibext,
105dnl acl_hardcode_libdir_flag_spec,
106dnl acl_hardcode_libdir_separator,
107dnl acl_hardcode_direct,
108dnl acl_hardcode_minus_L.
109AC_DEFUN([AC_LIB_RPATH],
110[
111 dnl Tell automake >= 1.10 to complain if config.rpath is missing.
112 m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
113 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
114 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
115 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
116 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
117 AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
118 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
119 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
120 . ./conftest.sh
121 rm -f ./conftest.sh
122 acl_cv_rpath=done
123 ])
124 wl="$acl_cv_wl"
125 acl_libext="$acl_cv_libext"
126 acl_shlibext="$acl_cv_shlibext"
127 acl_libname_spec="$acl_cv_libname_spec"
128 acl_library_names_spec="$acl_cv_library_names_spec"
129 acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
130 acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
131 acl_hardcode_direct="$acl_cv_hardcode_direct"
132 acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
133 dnl Determine whether the user wants rpath handling at all.
134 AC_ARG_ENABLE([rpath],
135 [ --disable-rpath do not hardcode runtime library paths],
136 :, enable_rpath=yes)
137])
138
139dnl AC_LIB_FROMPACKAGE(name, package)
140dnl declares that libname comes from the given package. The configure file
141dnl will then not have a --with-libname-prefix option but a
142dnl --with-package-prefix option. Several libraries can come from the same
143dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
144dnl macro call that searches for libname.
145AC_DEFUN([AC_LIB_FROMPACKAGE],
146[
147 pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
148 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
149 define([acl_frompackage_]NAME, [$2])
150 popdef([NAME])
151 pushdef([PACK],[$2])
152 pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
153 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
154 define([acl_libsinpackage_]PACKUP,
155 m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1])
156 popdef([PACKUP])
157 popdef([PACK])
158])
159
160dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies, system]) searches for
161dnl libname and the libraries corresponding to explicit and implicit
162dnl dependencies.
163dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
164dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
165dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
166dnl If system==system, -isystem is used instead of -I
167AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
168[
169 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
170 pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
171 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
172 pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
173 pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
174 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
175 pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
176 dnl Autoconf >= 2.61 supports dots in --with options.
177 pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)])
178 dnl By default, look in $includedir and $libdir.
179 use_additional=yes
180 if test "x$GCC" = "xyes" -a "x$3" = "xsystem"
181 then
182 i_system="-isystem "
183 else
184 i_system="-I"
185 fi
186
187 AC_LIB_WITH_FINAL_PREFIX([
188 eval additional_includedir=\"$includedir\"
189 eval additional_libdir=\"$libdir\"
190 ])
191 AC_ARG_WITH(P_A_C_K[-prefix],
192[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
193 --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
194[
195 if test "X$withval" = "Xno"; then
196 use_additional=no
197 else
198 if test "X$withval" = "X"; then
199 AC_LIB_WITH_FINAL_PREFIX([
200 eval additional_includedir=\"$includedir\"
201 eval additional_libdir=\"$libdir\"
202 ])
203 else
204 additional_includedir="$withval/include"
205 additional_libdir="$withval/$acl_libdirstem"
206 if test "$acl_libdirstem2" != "$acl_libdirstem" \
207 && ! test -d "$withval/$acl_libdirstem"; then
208 additional_libdir="$withval/$acl_libdirstem2"
209 fi
210 fi
211 fi
212])
213 dnl Search the library and its dependencies in $additional_libdir and
214 dnl $LDFLAGS. Using breadth-first-seach.
215 LIB[]NAME=
216 LTLIB[]NAME=
217 INC[]NAME=
218 LIB[]NAME[]_PREFIX=
219 rpathdirs=
220 ltrpathdirs=
221 names_already_handled=
222 names_next_round='$1 $2'
223 while test -n "$names_next_round"; do
224 names_this_round="$names_next_round"
225 names_next_round=
226 for name in $names_this_round; do
227 already_handled=
228 for n in $names_already_handled; do
229 if test "$n" = "$name"; then
230 already_handled=yes
231 break
232 fi
233 done
234 if test -z "$already_handled"; then
235 names_already_handled="$names_already_handled $name"
236 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
237 dnl or AC_LIB_HAVE_LINKFLAGS call.
238 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
239 eval value=\"\$HAVE_LIB$uppername\"
240 if test -n "$value"; then
241 if test "$value" = yes; then
242 eval value=\"\$LIB$uppername\"
243 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
244 eval value=\"\$LTLIB$uppername\"
245 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
246 else
247 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
248 dnl that this library doesn't exist. So just drop it.
249 :
250 fi
251 else
252 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
253 dnl and the already constructed $LIBNAME/$LTLIBNAME.
254 found_dir=
255 found_la=
256 found_so=
257 found_a=
258 eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
259 if test -n "$acl_shlibext"; then
260 shrext=".$acl_shlibext" # typically: shrext=.so
261 else
262 shrext=
263 fi
264 if test $use_additional = yes; then
265 dir="$additional_libdir"
266 dnl The same code as in the loop below:
267 dnl First look for a shared library.
268 if test -n "$acl_shlibext"; then
269 if test -f "$dir/$libname$shrext"; then
270 found_dir="$dir"
271 found_so="$dir/$libname$shrext"
272 else
273 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
274 ver=`(cd "$dir" && \
275 for f in "$libname$shrext".*; do echo "$f"; done \
276 | sed -e "s,^$libname$shrext\\\\.,," \
277 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
278 | sed 1q ) 2>/dev/null`
279 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
280 found_dir="$dir"
281 found_so="$dir/$libname$shrext.$ver"
282 fi
283 else
284 eval library_names=\"$acl_library_names_spec\"
285 for f in $library_names; do
286 if test -f "$dir/$f"; then
287 found_dir="$dir"
288 found_so="$dir/$f"
289 break
290 fi
291 done
292 fi
293 fi
294 fi
295 dnl Then look for a static library.
296 if test "X$found_dir" = "X"; then
297 if test -f "$dir/$libname.$acl_libext"; then
298 found_dir="$dir"
299 found_a="$dir/$libname.$acl_libext"
300 fi
301 fi
302 if test "X$found_dir" != "X"; then
303 if test -f "$dir/$libname.la"; then
304 found_la="$dir/$libname.la"
305 fi
306 fi
307 fi
308 if test "X$found_dir" = "X"; then
309 for x in $LDFLAGS $LTLIB[]NAME; do
310 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
311 case "$x" in
312 -L*)
313 dir=`echo "X$x" | sed -e 's/^X-L//'`
314 dnl First look for a shared library.
315 if test -n "$acl_shlibext"; then
316 if test -f "$dir/$libname$shrext"; then
317 found_dir="$dir"
318 found_so="$dir/$libname$shrext"
319 else
320 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
321 ver=`(cd "$dir" && \
322 for f in "$libname$shrext".*; do echo "$f"; done \
323 | sed -e "s,^$libname$shrext\\\\.,," \
324 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
325 | sed 1q ) 2>/dev/null`
326 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
327 found_dir="$dir"
328 found_so="$dir/$libname$shrext.$ver"
329 fi
330 else
331 eval library_names=\"$acl_library_names_spec\"
332 for f in $library_names; do
333 if test -f "$dir/$f"; then
334 found_dir="$dir"
335 found_so="$dir/$f"
336 break
337 fi
338 done
339 fi
340 fi
341 fi
342 dnl Then look for a static library.
343 if test "X$found_dir" = "X"; then
344 if test -f "$dir/$libname.$acl_libext"; then
345 found_dir="$dir"
346 found_a="$dir/$libname.$acl_libext"
347 fi
348 fi
349 if test "X$found_dir" != "X"; then
350 if test -f "$dir/$libname.la"; then
351 found_la="$dir/$libname.la"
352 fi
353 fi
354 ;;
355 esac
356 if test "X$found_dir" != "X"; then
357 break
358 fi
359 done
360 fi
361 if test "X$found_dir" != "X"; then
362 dnl Found the library.
363 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
364 if test "X$found_so" != "X"; then
365 dnl Linking with a shared library. We attempt to hardcode its
366 dnl directory into the executable's runpath, unless it's the
367 dnl standard /usr/lib.
368 if test "$enable_rpath" = no \
369 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
370 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
371 dnl No hardcoding is needed.
372 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
373 else
374 dnl Use an explicit option to hardcode DIR into the resulting
375 dnl binary.
376 dnl Potentially add DIR to ltrpathdirs.
377 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
378 haveit=
379 for x in $ltrpathdirs; do
380 if test "X$x" = "X$found_dir"; then
381 haveit=yes
382 break
383 fi
384 done
385 if test -z "$haveit"; then
386 ltrpathdirs="$ltrpathdirs $found_dir"
387 fi
388 dnl The hardcoding into $LIBNAME is system dependent.
389 if test "$acl_hardcode_direct" = yes; then
390 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
391 dnl resulting binary.
392 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
393 else
394 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
395 dnl Use an explicit option to hardcode DIR into the resulting
396 dnl binary.
397 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
398 dnl Potentially add DIR to rpathdirs.
399 dnl The rpathdirs will be appended to $LIBNAME at the end.
400 haveit=
401 for x in $rpathdirs; do
402 if test "X$x" = "X$found_dir"; then
403 haveit=yes
404 break
405 fi
406 done
407 if test -z "$haveit"; then
408 rpathdirs="$rpathdirs $found_dir"
409 fi
410 else
411 dnl Rely on "-L$found_dir".
412 dnl But don't add it if it's already contained in the LDFLAGS
413 dnl or the already constructed $LIBNAME
414 haveit=
415 for x in $LDFLAGS $LIB[]NAME; do
416 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
417 if test "X$x" = "X-L$found_dir"; then
418 haveit=yes
419 break
420 fi
421 done
422 if test -z "$haveit"; then
423 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
424 fi
425 if test "$acl_hardcode_minus_L" != no; then
426 dnl FIXME: Not sure whether we should use
427 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
428 dnl here.
429 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
430 else
431 dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
432 dnl here, because this doesn't fit in flags passed to the
433 dnl compiler. So give up. No hardcoding. This affects only
434 dnl very old systems.
435 dnl FIXME: Not sure whether we should use
436 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
437 dnl here.
438 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
439 fi
440 fi
441 fi
442 fi
443 else
444 if test "X$found_a" != "X"; then
445 dnl Linking with a static library.
446 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
447 else
448 dnl We shouldn't come here, but anyway it's good to have a
449 dnl fallback.
450 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
451 fi
452 fi
453 dnl Assume the include files are nearby.
454 additional_includedir=
455 case "$found_dir" in
456 */$acl_libdirstem | */$acl_libdirstem/)
457 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
458 if test "$name" = '$1'; then
459 LIB[]NAME[]_PREFIX="$basedir"
460 fi
461 additional_includedir="$basedir/include"
462 ;;
463 */$acl_libdirstem2 | */$acl_libdirstem2/)
464 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
465 if test "$name" = '$1'; then
466 LIB[]NAME[]_PREFIX="$basedir"
467 fi
468 additional_includedir="$basedir/include"
469 ;;
470 esac
471 if test "X$additional_includedir" != "X"; then
472 dnl Potentially add $additional_includedir to $INCNAME.
473 dnl But don't add it
474 dnl 1. if it's the standard /usr/include,
475 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
476 dnl 3. if it's already present in $CPPFLAGS or the already
477 dnl constructed $INCNAME,
478 dnl 4. if it doesn't exist as a directory.
479 if test "X$additional_includedir" != "X/usr/include"; then
480 haveit=
481 if test "X$additional_includedir" = "X/usr/local/include"; then
482 if test -n "$GCC"; then
483 case $host_os in
484 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
485 esac
486 fi
487 fi
488 if test -z "$haveit"; then
489 for x in $CPPFLAGS $INC[]NAME; do
490 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
491 if test "X$x" = "X${i_system}$additional_includedir"; then
492 haveit=yes
493 break
494 fi
495 done
496 if test -z "$haveit"; then
497 if test -d "$additional_includedir"; then
498 dnl Really add $additional_includedir to $INCNAME.
499 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }${i_system}$additional_includedir"
500 fi
501 fi
502 fi
503 fi
504 fi
505 dnl Look for dependencies.
506 if test -n "$found_la"; then
507 dnl Read the .la file. It defines the variables
508 dnl dlname, library_names, old_library, dependency_libs, current,
509 dnl age, revision, installed, dlopen, dlpreopen, libdir.
510 save_libdir="$libdir"
511 case "$found_la" in
512 */* | *\\*) . "$found_la" ;;
513 *) . "./$found_la" ;;
514 esac
515 libdir="$save_libdir"
516 dnl We use only dependency_libs.
517 for dep in $dependency_libs; do
518 case "$dep" in
519 -L*)
520 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
521 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
522 dnl But don't add it
523 dnl 1. if it's the standard /usr/lib,
524 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
525 dnl 3. if it's already present in $LDFLAGS or the already
526 dnl constructed $LIBNAME,
527 dnl 4. if it doesn't exist as a directory.
528 if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
529 && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
530 haveit=
531 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
532 || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
533 if test -n "$GCC"; then
534 case $host_os in
535 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
536 esac
537 fi
538 fi
539 if test -z "$haveit"; then
540 haveit=
541 for x in $LDFLAGS $LIB[]NAME; do
542 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
543 if test "X$x" = "X-L$additional_libdir"; then
544 haveit=yes
545 break
546 fi
547 done
548 if test -z "$haveit"; then
549 if test -d "$additional_libdir"; then
550 dnl Really add $additional_libdir to $LIBNAME.
551 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
552 fi
553 fi
554 haveit=
555 for x in $LDFLAGS $LTLIB[]NAME; do
556 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
557 if test "X$x" = "X-L$additional_libdir"; then
558 haveit=yes
559 break
560 fi
561 done
562 if test -z "$haveit"; then
563 if test -d "$additional_libdir"; then
564 dnl Really add $additional_libdir to $LTLIBNAME.
565 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
566 fi
567 fi
568 fi
569 fi
570 ;;
571 -R*)
572 dir=`echo "X$dep" | sed -e 's/^X-R//'`
573 if test "$enable_rpath" != no; then
574 dnl Potentially add DIR to rpathdirs.
575 dnl The rpathdirs will be appended to $LIBNAME at the end.
576 haveit=
577 for x in $rpathdirs; do
578 if test "X$x" = "X$dir"; then
579 haveit=yes
580 break
581 fi
582 done
583 if test -z "$haveit"; then
584 rpathdirs="$rpathdirs $dir"
585 fi
586 dnl Potentially add DIR to ltrpathdirs.
587 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
588 haveit=
589 for x in $ltrpathdirs; do
590 if test "X$x" = "X$dir"; then
591 haveit=yes
592 break
593 fi
594 done
595 if test -z "$haveit"; then
596 ltrpathdirs="$ltrpathdirs $dir"
597 fi
598 fi
599 ;;
600 -l*)
601 dnl Handle this in the next round.
602 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
603 ;;
604 *.la)
605 dnl Handle this in the next round. Throw away the .la's
606 dnl directory; it is already contained in a preceding -L
607 dnl option.
608 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
609 ;;
610 *)
611 dnl Most likely an immediate library name.
612 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
613 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
614 ;;
615 esac
616 done
617 fi
618 else
619 dnl Didn't find the library; assume it is in the system directories
620 dnl known to the linker and runtime loader. (All the system
621 dnl directories known to the linker should also be known to the
622 dnl runtime loader, otherwise the system is severely misconfigured.)
623 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
624 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
625 fi
626 fi
627 fi
628 done
629 done
630 if test "X$rpathdirs" != "X"; then
631 if test -n "$acl_hardcode_libdir_separator"; then
632 dnl Weird platform: only the last -rpath option counts, the user must
633 dnl pass all path elements in one option. We can arrange that for a
634 dnl single library, but not when more than one $LIBNAMEs are used.
635 alldirs=
636 for found_dir in $rpathdirs; do
637 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
638 done
639 dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
640 acl_save_libdir="$libdir"
641 libdir="$alldirs"
642 eval flag=\"$acl_hardcode_libdir_flag_spec\"
643 libdir="$acl_save_libdir"
644 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
645 else
646 dnl The -rpath options are cumulative.
647 for found_dir in $rpathdirs; do
648 acl_save_libdir="$libdir"
649 libdir="$found_dir"
650 eval flag=\"$acl_hardcode_libdir_flag_spec\"
651 libdir="$acl_save_libdir"
652 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
653 done
654 fi
655 fi
656 if test "X$ltrpathdirs" != "X"; then
657 dnl When using libtool, the option that works for both libraries and
658 dnl executables is -R. The -R options are cumulative.
659 for found_dir in $ltrpathdirs; do
660 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
661 done
662 fi
663 popdef([P_A_C_K])
664 popdef([PACKLIBS])
665 popdef([PACKUP])
666 popdef([PACK])
667 popdef([NAME])
668])
669
670dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
671dnl unless already present in VAR.
672dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
673dnl contains two or three consecutive elements that belong together.
674AC_DEFUN([AC_LIB_APPENDTOVAR],
675[
676 for element in [$2]; do
677 haveit=
678 for x in $[$1]; do
679 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
680 if test "X$x" = "X$element"; then
681 haveit=yes
682 break
683 fi
684 done
685 if test -z "$haveit"; then
686 [$1]="${[$1]}${[$1]:+ }$element"
687 fi
688 done
689])
690
691dnl For those cases where a variable contains several -L and -l options
692dnl referring to unknown libraries and directories, this macro determines the
693dnl necessary additional linker options for the runtime path.
694dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
695dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
696dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
697dnl otherwise linking without libtool is assumed.
698AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
699[
700 AC_REQUIRE([AC_LIB_RPATH])
701 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
702 $1=
703 if test "$enable_rpath" != no; then
704 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
705 dnl Use an explicit option to hardcode directories into the resulting
706 dnl binary.
707 rpathdirs=
708 next=
709 for opt in $2; do
710 if test -n "$next"; then
711 dir="$next"
712 dnl No need to hardcode the standard /usr/lib.
713 if test "X$dir" != "X/usr/$acl_libdirstem" \
714 && test "X$dir" != "X/usr/$acl_libdirstem2"; then
715 rpathdirs="$rpathdirs $dir"
716 fi
717 next=
718 else
719 case $opt in
720 -L) next=yes ;;
721 -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
722 dnl No need to hardcode the standard /usr/lib.
723 if test "X$dir" != "X/usr/$acl_libdirstem" \
724 && test "X$dir" != "X/usr/$acl_libdirstem2"; then
725 rpathdirs="$rpathdirs $dir"
726 fi
727 next= ;;
728 *) next= ;;
729 esac
730 fi
731 done
732 if test "X$rpathdirs" != "X"; then
733 if test -n ""$3""; then
734 dnl libtool is used for linking. Use -R options.
735 for dir in $rpathdirs; do
736 $1="${$1}${$1:+ }-R$dir"
737 done
738 else
739 dnl The linker is used for linking directly.
740 if test -n "$acl_hardcode_libdir_separator"; then
741 dnl Weird platform: only the last -rpath option counts, the user
742 dnl must pass all path elements in one option.
743 alldirs=
744 for dir in $rpathdirs; do
745 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
746 done
747 acl_save_libdir="$libdir"
748 libdir="$alldirs"
749 eval flag=\"$acl_hardcode_libdir_flag_spec\"
750 libdir="$acl_save_libdir"
751 $1="$flag"
752 else
753 dnl The -rpath options are cumulative.
754 for dir in $rpathdirs; do
755 acl_save_libdir="$libdir"
756 libdir="$dir"
757 eval flag=\"$acl_hardcode_libdir_flag_spec\"
758 libdir="$acl_save_libdir"
759 $1="${$1}${$1:+ }$flag"
760 done
761 fi
762 fi
763 fi
764 fi
765 fi
766 AC_SUBST([$1])
767])
0768
=== added file 'm4/lib-prefix.m4'
--- m4/lib-prefix.m4 1970-01-01 00:00:00 +0000
+++ m4/lib-prefix.m4 2009-07-16 02:58:56 +0000
@@ -0,0 +1,226 @@
1# lib-prefix.m4 serial 6 (gettext-0.18)
2dnl Copyright (C) 2001-2005, 2008 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl From Bruno Haible.
8
9dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
10dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
11dnl require excessive bracketing.
12ifdef([AC_HELP_STRING],
13[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
14[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
15
16dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
17dnl to access previously installed libraries. The basic assumption is that
18dnl a user will want packages to use other packages he previously installed
19dnl with the same --prefix option.
20dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
21dnl libraries, but is otherwise very convenient.
22AC_DEFUN([AC_LIB_PREFIX],
23[
24 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
25 AC_REQUIRE([AC_PROG_CC])
26 AC_REQUIRE([AC_CANONICAL_HOST])
27 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
28 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
29 dnl By default, look in $includedir and $libdir.
30 use_additional=yes
31 AC_LIB_WITH_FINAL_PREFIX([
32 eval additional_includedir=\"$includedir\"
33 eval additional_libdir=\"$libdir\"
34 ])
35 AC_LIB_ARG_WITH([lib-prefix],
36[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
37 --without-lib-prefix don't search for libraries in includedir and libdir],
38[
39 if test "X$withval" = "Xno"; then
40 use_additional=no
41 else
42 if test "X$withval" = "X"; then
43 AC_LIB_WITH_FINAL_PREFIX([
44 eval additional_includedir=\"$includedir\"
45 eval additional_libdir=\"$libdir\"
46 ])
47 else
48 additional_includedir="$withval/include"
49 additional_libdir="$withval/$acl_libdirstem"
50 fi
51 fi
52])
53 if test $use_additional = yes; then
54 dnl Potentially add $additional_includedir to $CPPFLAGS.
55 dnl But don't add it
56 dnl 1. if it's the standard /usr/include,
57 dnl 2. if it's already present in $CPPFLAGS,
58 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
59 dnl 4. if it doesn't exist as a directory.
60 if test "X$additional_includedir" != "X/usr/include"; then
61 haveit=
62 for x in $CPPFLAGS; do
63 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
64 if test "X$x" = "X-I$additional_includedir"; then
65 haveit=yes
66 break
67 fi
68 done
69 if test -z "$haveit"; then
70 if test "X$additional_includedir" = "X/usr/local/include"; then
71 if test -n "$GCC"; then
72 case $host_os in
73 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
74 esac
75 fi
76 fi
77 if test -z "$haveit"; then
78 if test -d "$additional_includedir"; then
79 dnl Really add $additional_includedir to $CPPFLAGS.
80 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
81 fi
82 fi
83 fi
84 fi
85 dnl Potentially add $additional_libdir to $LDFLAGS.
86 dnl But don't add it
87 dnl 1. if it's the standard /usr/lib,
88 dnl 2. if it's already present in $LDFLAGS,
89 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
90 dnl 4. if it doesn't exist as a directory.
91 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
92 haveit=
93 for x in $LDFLAGS; do
94 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
95 if test "X$x" = "X-L$additional_libdir"; then
96 haveit=yes
97 break
98 fi
99 done
100 if test -z "$haveit"; then
101 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
102 if test -n "$GCC"; then
103 case $host_os in
104 linux*) haveit=yes;;
105 esac
106 fi
107 fi
108 if test -z "$haveit"; then
109 if test -d "$additional_libdir"; then
110 dnl Really add $additional_libdir to $LDFLAGS.
111 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
112 fi
113 fi
114 fi
115 fi
116 fi
117])
118
119dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
120dnl acl_final_exec_prefix, containing the values to which $prefix and
121dnl $exec_prefix will expand at the end of the configure script.
122AC_DEFUN([AC_LIB_PREPARE_PREFIX],
123[
124 dnl Unfortunately, prefix and exec_prefix get only finally determined
125 dnl at the end of configure.
126 if test "X$prefix" = "XNONE"; then
127 acl_final_prefix="$ac_default_prefix"
128 else
129 acl_final_prefix="$prefix"
130 fi
131 if test "X$exec_prefix" = "XNONE"; then
132 acl_final_exec_prefix='${prefix}'
133 else
134 acl_final_exec_prefix="$exec_prefix"
135 fi
136 acl_save_prefix="$prefix"
137 prefix="$acl_final_prefix"
138 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
139 prefix="$acl_save_prefix"
140])
141
142dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
143dnl variables prefix and exec_prefix bound to the values they will have
144dnl at the end of the configure script.
145AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
146[
147 acl_save_prefix="$prefix"
148 prefix="$acl_final_prefix"
149 acl_save_exec_prefix="$exec_prefix"
150 exec_prefix="$acl_final_exec_prefix"
151 $1
152 exec_prefix="$acl_save_exec_prefix"
153 prefix="$acl_save_prefix"
154])
155
156dnl AC_LIB_PREPARE_MULTILIB creates
157dnl - a variable acl_libdirstem, containing the basename of the libdir, either
158dnl "lib" or "lib64" or "lib/64",
159dnl - a variable acl_libdirstem2, as a secondary possible value for
160dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
161dnl "lib/amd64".
162AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
163[
164 dnl There is no formal standard regarding lib and lib64.
165 dnl On glibc systems, the current practice is that on a system supporting
166 dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
167 dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
168 dnl the compiler's default mode by looking at the compiler's library search
169 dnl path. If at least one of its elements ends in /lib64 or points to a
170 dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
171 dnl Otherwise we use the default, namely "lib".
172 dnl On Solaris systems, the current practice is that on a system supporting
173 dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
174 dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
175 dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
176 AC_REQUIRE([AC_CANONICAL_HOST])
177 acl_libdirstem=lib
178 acl_libdirstem2=
179 case "$host_os" in
180 solaris*)
181 dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
182 dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
183 dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
184 dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
185 dnl symlink is missing, so we set acl_libdirstem2 too.
186 AC_MSG_CHECKING([if buildling 64-bit app])
187 AC_RUN_IFELSE([
188 AC_LANG_PROGRAM([
189 ], [
190 return sizeof(void*) == 8 ? 0 : 1;
191 ])
192 ], [
193 gl_cv_solaris_64bit=yes
194 ], [
195 gl_cv_solaris_64bit=no
196 ])
197 AC_MSG_RESULT([$gl_cv_solaris_64bit])
198 if test $gl_cv_solaris_64bit = yes; then
199 acl_libdirstem=lib/64
200 case "$host_cpu" in
201 sparc*) acl_libdirstem2=lib/sparcv9 ;;
202 i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
203 esac
204 fi
205 ;;
206 *)
207 searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
208 if test -n "$searchpath"; then
209 acl_save_IFS="${IFS= }"; IFS=":"
210 for searchdir in $searchpath; do
211 if test -d "$searchdir"; then
212 case "$searchdir" in
213 */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
214 *) searchdir=`cd "$searchdir" && pwd`
215 case "$searchdir" in
216 */lib64 ) acl_libdirstem=lib64 ;;
217 esac ;;
218 esac
219 fi
220 done
221 IFS="$acl_save_IFS"
222 fi
223 ;;
224 esac
225 test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
226])
0227
=== modified file 'm4/pandora_canonical.m4'
--- m4/pandora_canonical.m4 2009-07-14 19:18:55 +0000
+++ m4/pandora_canonical.m4 2009-07-16 02:28:54 +0000
@@ -4,7 +4,7 @@
4dnl with or without modifications, as long as this notice is preserved.4dnl with or without modifications, as long as this notice is preserved.
55
6dnl Which version of the canonical setup we're using6dnl Which version of the canonical setup we're using
7AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.13])7AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.20])
88
9AC_DEFUN([PANDORA_FORCE_DEPEND_TRACKING],[9AC_DEFUN([PANDORA_FORCE_DEPEND_TRACKING],[
10 dnl Force dependency tracking on for Sun Studio builds10 dnl Force dependency tracking on for Sun Studio builds
@@ -70,7 +70,10 @@
70 m4_if(PCT_FORCE_GCC42, [yes], [70 m4_if(PCT_FORCE_GCC42, [yes], [
71 AS_IF([test "$GCC" = "yes"], PANDORA_ENSURE_GCC_VERSION)71 AS_IF([test "$GCC" = "yes"], PANDORA_ENSURE_GCC_VERSION)
72 ])72 ])
73 73
74 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
75 AC_CHECK_DECL([__ICC], [INTELCC="yes"], [INTELCC="no"])
76 AS_IF([test "x$INTELCC" = "xyes"], [enable_rpath=no])
7477
75 PANDORA_LIBTOOL78 PANDORA_LIBTOOL
7679
@@ -97,15 +100,10 @@
97 AC_C_CONST100 AC_C_CONST
98 AC_C_INLINE101 AC_C_INLINE
99 AC_C_VOLATILE102 AC_C_VOLATILE
103 AC_C_RESTRICT
100104
101 AC_HEADER_TIME105 AC_HEADER_TIME
102 AC_TYPE_SIZE_T106 AC_TYPE_SIZE_T
103 AC_FUNC_MALLOC
104 AC_FUNC_REALLOC
105
106
107 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
108
109 AC_SYS_LARGEFILE107 AC_SYS_LARGEFILE
110108
111109
@@ -127,6 +125,9 @@
127125
128 PANDORA_ENABLE_DTRACE126 PANDORA_ENABLE_DTRACE
129127
128 AC_LIB_PREFIX
129 PANDORA_HAVE_BETTER_MALLOC
130
130 AC_CHECK_PROGS([DOXYGEN], [doxygen])131 AC_CHECK_PROGS([DOXYGEN], [doxygen])
131 AC_CHECK_PROGS([PERL], [perl])132 AC_CHECK_PROGS([PERL], [perl])
132133
133134
=== added file 'm4/pandora_have_better_malloc.m4'
--- m4/pandora_have_better_malloc.m4 1970-01-01 00:00:00 +0000
+++ m4/pandora_have_better_malloc.m4 2009-07-16 02:58:56 +0000
@@ -0,0 +1,54 @@
1dnl Copyright (C) 2009 Sun Microsystems
2dnl This file is free software; Sun Microsystems
3dnl gives unlimited permission to copy and/or distribute it,
4dnl with or without modifications, as long as this notice is preserved.
5
6AC_DEFUN([PANDORA_HAVE_BETTER_MALLOC],[
7 AC_REQUIRE([AC_FUNC_MALLOC])
8 AC_REQUIRE([AC_FUNC_REALLOC])
9 AC_REQUIRE([AC_LIB_PREFIX])
10
11 AC_ARG_ENABLE([umem],
12 [AS_HELP_STRING([--enable-umem],
13 [Enable linking with libumem @<:@default=off@:>@])],
14 [ac_enable_umem="$enableval"],
15 [ac_enable_umem="no"])
16
17 AC_ARG_ENABLE([tcmalloc],
18 [AS_HELP_STRING([--enable-tcmalloc],
19 [Enable linking with tcmalloc @<:@default=off@:>@])],
20 [ac_enable_tcmalloc="$enableval"],
21 [ac_enable_tcmalloc="no"])
22
23 AC_ARG_ENABLE([mtmalloc],
24 [AS_HELP_STRING([--disable-mtmalloc],
25 [Enable linking with mtmalloc @<:@default=on@:>@])],
26 [ac_enable_mtmalloc="$enableval"],
27 [ac_enable_mtmalloc="yes"])
28
29 save_LIBS="${LIBS}"
30 LIBS=
31 AS_IF([test "x$ac_enable_umem" = "xyes"],[
32 AC_CHECK_LIB(umem,malloc,[],[])
33 ],[
34 case "$target_os" in
35 *linux*)
36 AS_IF([test "x$ac_enable_tcmalloc" != "xno"],[
37 AC_CHECK_LIB(tcmalloc-minimal,malloc,[],[])
38 AS_IF([test "x$ac_cv_lib_tcmalloc_minimal_malloc" != "xyes"],[
39 AC_CHECK_LIB(tcmalloc,malloc,[],[])
40 ])
41 ])
42 ;;
43 *solaris*)
44 AS_IF([test "x$ac_enable_mtmalloc" != "xno"],[
45 AC_CHECK_LIB(mtmalloc,malloc,[],[])
46 ])
47 ;;
48 esac
49 ])
50 BETTER_MALLOC_LIBS="${LIBS}"
51 LIBS="${save_LIBS}"
52 AC_SUBST([BETTER_MALLOC_LIBS])
53
54])
055
=== added file 'm4/pandora_have_libdrizzle.m4'
--- m4/pandora_have_libdrizzle.m4 1970-01-01 00:00:00 +0000
+++ m4/pandora_have_libdrizzle.m4 2009-07-16 02:58:56 +0000
@@ -0,0 +1,46 @@
1dnl Copyright (C) 2009 Sun Microsystems
2dnl This file is free software; Sun Microsystems
3dnl gives unlimited permission to copy and/or distribute it,
4dnl with or without modifications, as long as this notice is preserved.
5
6AC_DEFUN([_PANDORA_SEARCH_LIBDRIZZLE],[
7 AC_REQUIRE([AC_LIB_PREFIX])
8
9 dnl --------------------------------------------------------------------
10 dnl Check for libdrizzle
11 dnl --------------------------------------------------------------------
12
13 AC_LIB_HAVE_LINKFLAGS(drizzle,,[
14 #include <libdrizzle/drizzle_client.h>
15 ],[
16 drizzle_st drizzle;
17 drizzle_version();
18 ])
19
20 AM_CONDITIONAL(HAVE_LIBDRIZZLE, [test "x${ac_cv_libdrizzle}" = "xyes"])
21
22])
23
24AC_DEFUN([PANDORA_HAVE_LIBDRIZZLE],[
25 AC_REQUIRE([_PANDORA_SEARCH_LIBDRIZZLE])
26])
27
28AC_DEFUN([PANDORA_REQUIRE_LIBDRIZZLE],[
29 AC_REQUIRE([PANDORA_HAVE_LIBDRIZZLE])
30 AS_IF([test x$ac_cv_libdrizzle = xno],
31 AC_MSG_ERROR([libdrizzle is required for ${PACKAGE}]))
32])
33
34AC_DEFUN([PANDORA_LIBDRIZZLE_NOVCOL],[
35 AC_CACHE_CHECK([if libdrizzle still has virtual columns],
36 [pandora_cv_libdrizzle_vcol],
37 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
38#include <libdrizzle/drizzle.h>
39int foo= DRIZZLE_COLUMN_TYPE_DRIZZLE_VIRTUAL;
40 ]])],
41 [pandora_cv_libdrizzle_vcol=yes],
42 [pandora_cv_libdrizzle_vcol=no])])
43 AS_IF([test "$pandora_cv_libdrizzle_vcol" = "yes"],[
44 AC_MSG_ERROR([Your version of libdrizzle is too old. ${PACKAGE} requires at least version 0.4])
45 ])
46])
047
=== added file 'm4/pandora_have_libgearman.m4'
--- m4/pandora_have_libgearman.m4 1970-01-01 00:00:00 +0000
+++ m4/pandora_have_libgearman.m4 2009-07-16 02:58:56 +0000
@@ -0,0 +1,31 @@
1dnl Copyright (C) 2009 Sun Microsystems
2dnl This file is free software; Sun Microsystems
3dnl gives unlimited permission to copy and/or distribute it,
4dnl with or without modifications, as long as this notice is preserved.
5
6AC_DEFUN([_PANDORA_SEARCH_LIBGEARMAN],[
7 AC_REQUIRE([AC_LIB_PREFIX])
8
9 dnl --------------------------------------------------------------------
10 dnl Check for libgearman
11 dnl --------------------------------------------------------------------
12
13 AC_LIB_HAVE_LINKFLAGS(gearman,,
14 [#include <libgearman/gearman.h>],[
15 gearman_client_st gearman_client;
16 gearman_version();
17 ])
18
19 AM_CONDITIONAL(HAVE_LIBGEARMAN, [test "x${ac_cv_libgearman}" = "xyes"])
20
21])
22
23AC_DEFUN([PANDORA_HAVE_LIBGEARMAN],[
24 AC_REQUIRE([_PANDORA_SEARCH_LIBGEARMAN])
25])
26
27AC_DEFUN([PANDORA_REQUIRE_LIBGEARMAN],[
28 AC_REQUIRE([PANDORA_HAVE_LIBGEARMAN])
29 AS_IF([test x$ac_cv_libgearman = xno],
30 AC_MSG_ERROR([libgearman is required for ${PACKAGE}]))
31])
032
=== added file 'm4/pandora_have_libmemcached.m4'
--- m4/pandora_have_libmemcached.m4 1970-01-01 00:00:00 +0000
+++ m4/pandora_have_libmemcached.m4 2009-07-16 02:58:56 +0000
@@ -0,0 +1,35 @@
1dnl Copyright (C) 2009 Sun Microsystems
2dnl This file is free software; Sun Microsystems
3dnl gives unlimited permission to copy and/or distribute it,
4dnl with or without modifications, as long as this notice is preserved.
5
6AC_DEFUN([_PANDORA_SEARCH_LIBMEMCACHED],[
7 AC_REQUIRE([AC_LIB_PREFIX])
8
9 dnl --------------------------------------------------------------------
10 dnl Check for libmemcached
11 dnl --------------------------------------------------------------------
12
13 AC_LIB_HAVE_LINKFLAGS(memcached,,[
14 #include <libmemcached/memcached.h>
15 ], [
16 memcached_st memc;
17 memcached_dump_func *df;
18 memcached_version();
19 ])
20
21 AM_CONDITIONAL(HAVE_LIBMEMCACHED, [test "x${ac_cv_libmemcached}" = "xyes"])
22
23 AS_IF([test "x${ac_cv_libmemcached}" = "xyes"], [ PANDORA_WITH_MEMCACHED ])
24
25])
26
27AC_DEFUN([PANDORA_HAVE_LIBMEMCACHED],[
28 AC_REQUIRE([_PANDORA_SEARCH_LIBMEMCACHED])
29])
30
31AC_DEFUN([PANDORA_REQUIRE_LIBMEMCACHED],[
32 AC_REQUIRE([PANDORA_HAVE_LIBMEMCACHED])
33 AS_IF([test x$ac_cv_libmemcached = xno],
34 AC_MSG_ERROR([libmemcached is required for ${PACKAGE}]))
35])
036
=== added file 'm4/pandora_have_sqlite.m4'
--- m4/pandora_have_sqlite.m4 1970-01-01 00:00:00 +0000
+++ m4/pandora_have_sqlite.m4 2009-07-16 02:58:56 +0000
@@ -0,0 +1,24 @@
1dnl Copyright (C) 2009 Sun Microsystems
2dnl This file is free software; Sun Microsystems
3dnl gives unlimited permission to copy and/or distribute it,
4dnl with or without modifications, as long as this notice is preserved.
5
6
7AC_DEFUN([_PANDORA_SEARCH_SQLITE],[
8 AC_REQUIRE([AC_LIB_PREFIX])
9
10 AC_LIB_HAVE_LINKFLAGS(sqlite3,,[
11 #include <stdio.h>
12 #include <sqlite3.h>
13 ],[
14 sqlite3 *db;
15 sqlite3_open(NULL, &db);
16 ])
17
18 AM_CONDITIONAL(HAVE_LIBSQLITE3, [test "x${ac_cv_libsqlite3}" = "xyes"])
19
20])
21
22AC_DEFUN([PANDORA_HAVE_SQLITE],[
23 AC_REQUIRE([_PANDORA_SEARCH_SQLITE])
24])
025
=== modified file 'm4/pandora_optimize.m4'
--- m4/pandora_optimize.m4 2009-07-14 19:18:55 +0000
+++ m4/pandora_optimize.m4 2009-07-16 02:28:54 +0000
@@ -6,7 +6,7 @@
6AC_DEFUN([PANDORA_OPTIMIZE],[6AC_DEFUN([PANDORA_OPTIMIZE],[
7 dnl Build optimized or debug version ?7 dnl Build optimized or debug version ?
8 dnl First check for gcc and g++8 dnl First check for gcc and g++
9 AS_IF([test "$GCC" = "yes"],[9 AS_IF([test "$GCC" = "yes" -a "$INTELCC" = "no"],[
1010
11 dnl The following is required for portable results of floating point 11 dnl The following is required for portable results of floating point
12 dnl calculations on PowerPC. The same must also be done for IA-64, but 12 dnl calculations on PowerPC. The same must also be done for IA-64, but
@@ -30,6 +30,20 @@
30 OPTIMIZE_CFLAGS="-O3"30 OPTIMIZE_CFLAGS="-O3"
31 OPTIMIZE_CXXFLAGS="-O3"31 OPTIMIZE_CXXFLAGS="-O3"
32 ])32 ])
33 AS_IF([test "$INTELCC" = "yes"],[
34 dnl Once we can use a modern autoconf, we can replace the std=gnu99 here
35 dnl with using AC_CC_STD_C99 above
36 CC="${CC} -std=c99"
37
38 AM_CPPFLAGS="-g ${AM_CPPFLAGS}"
39
40 DEBUG_CFLAGS="-O0"
41 DEBUG_CXXFLAGS="-O0"
42
43 OPTIMIZE_CFLAGS="-xHOST -O3 -no-prec-div -static"
44 OPTIMIZE_CXXFLAGS="${OPTIMIZE_CFLAGS}"
45
46 ])
33 AS_IF([test "$SUNCC" = "yes"],[47 AS_IF([test "$SUNCC" = "yes"],[
34 dnl Once we can use a modern autoconf, we can replace the -xc99=all here48 dnl Once we can use a modern autoconf, we can replace the -xc99=all here
35 dnl with using AC_CC_STD_C99 above49 dnl with using AC_CC_STD_C99 above
3650
=== modified file 'm4/pandora_warnings.m4'
--- m4/pandora_warnings.m4 2009-07-14 19:18:55 +0000
+++ m4/pandora_warnings.m4 2009-07-16 02:28:54 +0000
@@ -127,78 +127,88 @@
127 NO_STRICT_ALIASING="-fno-strict-aliasing -Wno-strict-aliasing"127 NO_STRICT_ALIASING="-fno-strict-aliasing -Wno-strict-aliasing"
128 NO_SHADOW="-Wno-shadow"128 NO_SHADOW="-Wno-shadow"
129129
130 m4_if(PW_LESS_WARNINGS,[no],[130 AS_IF([test "$INTELCC" = "yes"],[
131 BASE_WARNINGS_FULL="-Wformat=2 ${W_CONVERSION} -Wstrict-aliasing"131 m4_if(PW_LESS_WARNINGS,[no],[
132 CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings"132 BASE_WARNINGS="-w1 -Wall -Werror -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual"
133 CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast"133 ],[
134 BASE_WARNINGS="-w1 -Wall -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 981"
135 ])
136 CC_WARNINGS="${BASE_WARNINGS}"
137 CXX_WARNINGS="${BASE_WARNINGS}"
134 ],[138 ],[
135 BASE_WARNINGS_FULL="-Wformat ${NO_STRICT_ALIASING}"139 m4_if(PW_LESS_WARNINGS,[no],[
136 ])140 BASE_WARNINGS_FULL="-Wformat=2 ${W_CONVERSION} -Wstrict-aliasing"
137141 CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings"
138 AS_IF([test "${ac_cv_assert}" = "no"],142 CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast"
139 [NO_UNUSED="-Wno-unused-variable -Wno-unused-parameter"])143 ],[
140144 BASE_WARNINGS_FULL="-Wformat ${NO_STRICT_ALIASING}"
141 BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wextra -Wundef -Wshadow ${NO_UNUSED} ${F_DIAGNOSTICS_SHOW_OPTION} ${CFLAG_VISIBILITY} ${BASE_WARNINGS_FULL}"145 ])
142 CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}"146
143 CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long ${CXX_WARNINGS_FULL}"147 AS_IF([test "${ac_cv_assert}" = "no"],
144148 [NO_UNUSED="-Wno-unused-variable -Wno-unused-parameter"])
145 AC_CACHE_CHECK([whether it is safe to use -Wmissing-declarations from C++],149
146 [ac_cv_safe_to_use_Wmissing_declarations_],150 BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wextra -Wundef -Wshadow ${NO_UNUSED} ${F_DIAGNOSTICS_SHOW_OPTION} ${CFLAG_VISIBILITY} ${BASE_WARNINGS_FULL}"
147 [AC_LANG_PUSH(C++)151 CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}"
148 save_CXXFLAGS="$CXXFLAGS"152 CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long ${CXX_WARNINGS_FULL}"
149 CXXFLAGS="-Werror -pedantic -Wmissing-declarations ${AM_CXXFLAGS}"153
150 AC_COMPILE_IFELSE([154 AC_CACHE_CHECK([whether it is safe to use -Wmissing-declarations from C++],
151 AC_LANG_PROGRAM(155 [ac_cv_safe_to_use_Wmissing_declarations_],
152 [[156 [AC_LANG_PUSH(C++)
153#include <stdio.h>157 save_CXXFLAGS="$CXXFLAGS"
154 ]], [[]])158 CXXFLAGS="-Werror -pedantic -Wmissing-declarations ${AM_CXXFLAGS}"
155 ],159 AC_COMPILE_IFELSE([
156 [ac_cv_safe_to_use_Wmissing_declarations_=yes],160 AC_LANG_PROGRAM(
157 [ac_cv_safe_to_use_Wmissing_declarations_=no])161 [[
158 CXXFLAGS="$save_CXXFLAGS"162#include <stdio.h>
159 AC_LANG_POP()163 ]], [[]])
160 ])164 ],
161 AS_IF([test "$ac_cv_safe_to_use_Wmissing_declarations_" = "yes"],165 [ac_cv_safe_to_use_Wmissing_declarations_=yes],
162 [CXX_WARNINGS="${CXX_WARNINGS} -Wmissing-declarations"])166 [ac_cv_safe_to_use_Wmissing_declarations_=no])
163167 CXXFLAGS="$save_CXXFLAGS"
164 AC_CACHE_CHECK([whether it is safe to use -Wlogical-op],168 AC_LANG_POP()
165 [ac_cv_safe_to_use_Wlogical_op_],169 ])
166 [save_CFLAGS="$CFLAGS"170 AS_IF([test "$ac_cv_safe_to_use_Wmissing_declarations_" = "yes"],
167 CFLAGS="${W_FAIL} -pedantic -Wlogical-op ${AM_CFLAGS} ${CFLAGS}"171 [CXX_WARNINGS="${CXX_WARNINGS} -Wmissing-declarations"])
168 AC_COMPILE_IFELSE([172
169 AC_LANG_PROGRAM(173 AC_CACHE_CHECK([whether it is safe to use -Wlogical-op],
170 [[174 [ac_cv_safe_to_use_Wlogical_op_],
171#include <stdio.h>175 [save_CFLAGS="$CFLAGS"
172 ]], [[]])176 CFLAGS="${W_FAIL} -pedantic -Wlogical-op ${AM_CFLAGS} ${CFLAGS}"
173 ],177 AC_COMPILE_IFELSE([
174 [ac_cv_safe_to_use_Wlogical_op_=yes],178 AC_LANG_PROGRAM(
175 [ac_cv_safe_to_use_Wlogical_op_=no])179 [[
176 CFLAGS="$save_CFLAGS"])180#include <stdio.h>
177 AS_IF([test "$ac_cv_safe_to_use_Wlogical_op_" = "yes"],181 ]], [[]])
178 [CC_WARNINGS="${CC_WARNINGS} -Wlogical-op"])182 ],
179183 [ac_cv_safe_to_use_Wlogical_op_=yes],
180 AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls from C++],184 [ac_cv_safe_to_use_Wlogical_op_=no])
181 [ac_cv_safe_to_use_Wredundant_decls_],185 CFLAGS="$save_CFLAGS"])
182 [AC_LANG_PUSH(C++)186 AS_IF([test "$ac_cv_safe_to_use_Wlogical_op_" = "yes"],
183 save_CXXFLAGS="${CXXFLAGS}"187 [CC_WARNINGS="${CC_WARNINGS} -Wlogical-op"])
184 CXXFLAGS="${W_FAIL} -pedantic -Wredundant-decls ${AM_CXXFLAGS}"188
185 AC_COMPILE_IFELSE(189 AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls from C++],
186 [AC_LANG_PROGRAM([190 [ac_cv_safe_to_use_Wredundant_decls_],
191 [AC_LANG_PUSH(C++)
192 save_CXXFLAGS="${CXXFLAGS}"
193 CXXFLAGS="${W_FAIL} -pedantic -Wredundant-decls ${AM_CXXFLAGS}"
194 AC_COMPILE_IFELSE(
195 [AC_LANG_PROGRAM([
187template <typename E> struct C { void foo(); };196template <typename E> struct C { void foo(); };
188template <typename E> void C<E>::foo() { }197template <typename E> void C<E>::foo() { }
189template <> void C<int>::foo();198template <> void C<int>::foo();
190 AC_INCLUDES_DEFAULT])],199 AC_INCLUDES_DEFAULT])],
191 [ac_cv_safe_to_use_Wredundant_decls_=yes],200 [ac_cv_safe_to_use_Wredundant_decls_=yes],
192 [ac_cv_safe_to_use_Wredundant_decls_=no])201 [ac_cv_safe_to_use_Wredundant_decls_=no])
193 CXXFLAGS="${save_CXXFLAGS}"202 CXXFLAGS="${save_CXXFLAGS}"
194 AC_LANG_POP()])203 AC_LANG_POP()])
195 AS_IF([test "$ac_cv_safe_to_use_Wredundant_decls_" = "yes"],204 AS_IF([test "$ac_cv_safe_to_use_Wredundant_decls_" = "yes"],
196 [CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"],205 [CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"],
197 [CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"])206 [CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"])
198207
199 NO_REDUNDANT_DECLS="-Wno-redundant-decls"208 NO_REDUNDANT_DECLS="-Wno-redundant-decls"
200 PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow"209 PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow"
201 210
211 ])
202 ])212 ])
203213
204 AS_IF([test "$SUNCC" = "yes"],[214 AS_IF([test "$SUNCC" = "yes"],[
@@ -229,6 +239,7 @@
229239
230 m4_if(PW_LESS_WARNINGS, [no],[240 m4_if(PW_LESS_WARNINGS, [no],[
231 CC_WARNINGS_FULL="-erroff=E_INTEGER_OVERFLOW_DETECTED${W_PASTE_RESULT}"241 CC_WARNINGS_FULL="-erroff=E_INTEGER_OVERFLOW_DETECTED${W_PASTE_RESULT}"
242 CXX_WARNINGS_FULL="-erroff=inllargeuse"
232 ],[243 ],[
233 CC_WARNINGS_FULL="-erroff=E_ATTRIBUTE_NOT_VAR"244 CC_WARNINGS_FULL="-erroff=E_ATTRIBUTE_NOT_VAR"
234 CXX_WARNINGS_FULL="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint"245 CXX_WARNINGS_FULL="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint"
235246
=== added file 'm4/pandora_with_memcached.m4'
--- m4/pandora_with_memcached.m4 1970-01-01 00:00:00 +0000
+++ m4/pandora_with_memcached.m4 2009-07-16 02:58:56 +0000
@@ -0,0 +1,33 @@
1dnl Copyright (C) 2009 Sun Microsystems
2dnl This file is free software; Sun Microsystems
3dnl gives unlimited permission to copy and/or distribute it,
4dnl with or without modifications, as long as this notice is preserved.
5
6AC_DEFUN([PANDORA_WITH_MEMCACHED],[
7
8 AC_ARG_WITH([memcached],
9 [AS_HELP_STRING([--with-memcached],
10 [Memcached binary to use for make test])],
11 [ac_cv_with_memcached="$withval"],
12 [ac_cv_with_memcached=memcached])
13
14 # just ignore the user if --without-memcached is passed.. it is
15 # only used by make test
16 AS_IF([test "x$withval" = "xno"],[
17 ac_cv_with_memcached=memcached
18 MEMCACHED_BINARY=memcached
19 ],[
20 AS_IF([test -f "$withval"],[
21 ac_cv_with_memcached=$withval
22 MEMCACHED_BINARY=$withval
23 ],[
24 AC_PATH_PROG([MEMCACHED_BINARY], [$ac_cv_with_memcached], "no")
25 AS_IF([test "x$MEMCACHED_BINARY" = "xno"],[
26 AC_MSG_ERROR(["could not find memcached binary"])
27 ])
28 ])
29 ])
30 AC_DEFINE_UNQUOTED([MEMCACHED_BINARY], "$MEMCACHED_BINARY",
31 [Name of the memcached binary used in make test])
32
33])
034
=== modified file 'tests/plus.cpp'
--- tests/plus.cpp 2009-07-11 19:10:39 +0000
+++ tests/plus.cpp 2009-07-15 18:45:15 +0000
@@ -21,11 +21,19 @@
21using namespace std;21using namespace std;
2222
23extern "C" {23extern "C" {
24 test_return basic_test(memcached_st *memc);
25 test_return increment_test(memcached_st *memc);
26 test_return basic_master_key_test(memcached_st *memc);
27 test_return mget_result_function(memcached_st *memc);
28 test_return mget_test(memcached_st *memc);
29 memcached_return callback_counter(memcached_st *,
30 memcached_result_st *,
31 void *context);
24 void *world_create(void);32 void *world_create(void);
25 void world_destroy(void *p);33 void world_destroy(void *p);
26}34}
2735
28static test_return basic_test(memcached_st *memc)36test_return basic_test(memcached_st *memc)
29{37{
30 Memcached foo(memc);38 Memcached foo(memc);
31 const string value_set("This is some data");39 const string value_set("This is some data");
@@ -40,7 +48,7 @@
40 return TEST_SUCCESS;48 return TEST_SUCCESS;
41}49}
4250
43static test_return increment_test(memcached_st *memc)51test_return increment_test(memcached_st *memc)
44{52{
45 Memcached mcach(memc);53 Memcached mcach(memc);
46 bool rc;54 bool rc;
@@ -73,7 +81,7 @@
73 return TEST_SUCCESS;81 return TEST_SUCCESS;
74}82}
7583
76static test_return basic_master_key_test(memcached_st *memc)84test_return basic_master_key_test(memcached_st *memc)
77{85{
78 Memcached foo(memc);86 Memcached foo(memc);
79 const string value_set("Data for server A");87 const string value_set("Data for server A");
@@ -95,9 +103,9 @@
95}103}
96104
97/* Count the results */105/* Count the results */
98static memcached_return callback_counter(memcached_st *ptr __attribute__((unused)), 106memcached_return callback_counter(memcached_st *,
99 memcached_result_st *result __attribute__((unused)), 107 memcached_result_st *,
100 void *context)108 void *context)
101{109{
102 unsigned int *counter= static_cast<unsigned int *>(context);110 unsigned int *counter= static_cast<unsigned int *>(context);
103111
@@ -106,7 +114,7 @@
106 return MEMCACHED_SUCCESS;114 return MEMCACHED_SUCCESS;
107}115}
108116
109static test_return mget_result_function(memcached_st *memc)117test_return mget_result_function(memcached_st *memc)
110{118{
111 Memcached mc(memc);119 Memcached mc(memc);
112 bool rc;120 bool rc;
@@ -138,7 +146,7 @@
138 return TEST_SUCCESS;146 return TEST_SUCCESS;
139}147}
140148
141static test_return mget_test(memcached_st *memc)149test_return mget_test(memcached_st *memc)
142{150{
143 Memcached mc(memc);151 Memcached mc(memc);
144 bool rc;152 bool rc;

Subscribers

People subscribed via source and target branches