Merge lp:~mordred/libdrizzle/update-build into lp:~drizzle-trunk/libdrizzle/classic

Proposed by Monty Taylor
Status: Merged
Merged at revision: not available
Proposed branch: lp:~mordred/libdrizzle/update-build
Merge into: lp:~drizzle-trunk/libdrizzle/classic
Diff against target: 2155 lines (+1720/-53)
38 files modified
.bzrignore (+0/-1)
Makefile.am (+2/-2)
config/autorun.sh (+0/-6)
configure.ac (+0/-3)
libdrizzle/libdrizzle.ver (+0/-1)
m4/pandora_canonical.m4 (+88/-10)
m4/pandora_cinttypes.m4 (+31/-0)
m4/pandora_cstdint.m4 (+30/-0)
m4/pandora_cxx_demangle.m4 (+24/-0)
m4/pandora_drizzle_build.m4 (+77/-0)
m4/pandora_fdatasync.m4 (+25/-0)
m4/pandora_have_better_malloc.m4 (+5/-0)
m4/pandora_have_gcc_atomics.m4 (+37/-0)
m4/pandora_have_libavahi.m4 (+41/-0)
m4/pandora_have_libbdb.m4 (+40/-0)
m4/pandora_have_libdl.m4 (+51/-0)
m4/pandora_have_libevent.m4 (+66/-0)
m4/pandora_have_libgearman.m4 (+2/-2)
m4/pandora_have_libmemcached.m4 (+0/-1)
m4/pandora_have_libpcre.m4 (+73/-0)
m4/pandora_have_libreadline.m4 (+242/-0)
m4/pandora_have_libtokyocabinet.m4 (+52/-0)
m4/pandora_have_libuuid.m4 (+55/-0)
m4/pandora_have_libxml2.m4 (+52/-0)
m4/pandora_have_libz.m4 (+51/-0)
m4/pandora_header_assert.m4 (+2/-2)
m4/pandora_libtool.m4 (+9/-0)
m4/pandora_plugins.m4 (+17/-5)
m4/pandora_pthread.m4 (+180/-0)
m4/pandora_run_cpplint.m4 (+8/-0)
m4/pandora_sasl.m4 (+133/-0)
m4/pandora_stack_direction.m4 (+39/-0)
m4/pandora_stl_hash.m4 (+107/-0)
m4/pandora_vc_build.m4 (+69/-3)
m4/pandora_version.m4 (+11/-0)
m4/pandora_warnings.m4 (+43/-7)
m4/pandora_with_gettext.m4 (+41/-0)
m4/pandora_with_memcached.m4 (+17/-10)
To merge this branch: bzr merge lp:~mordred/libdrizzle/update-build
Reviewer Review Type Date Requested Status
Drizzle Developers Pending
Review via email: mp+15700@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Monty Taylor (mordred) wrote :

pandora build fixes.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2009-08-10 21:57:14 +0000
3+++ .bzrignore 2009-12-05 23:40:29 +0000
4@@ -41,4 +41,3 @@
5 tests/drizzle_query_st
6 tests/drizzle_result_st
7 tests/drizzle_st
8-config/plugin.ac
9
10=== modified file 'Makefile.am'
11--- Makefile.am 2009-10-05 06:58:37 +0000
12+++ Makefile.am 2009-12-05 23:40:29 +0000
13@@ -33,9 +33,9 @@
14 -DBUILDING_LIBDRIZZLE
15
16 libdrizzle_la_LDFLAGS= \
17+ $(AM_LDFLAGS) \
18 -version-info \
19- $(LIBDRIZZLE_LIBRARY_VERSION) \
20- $(LD_VERSION_SCRIPT)
21+ $(LIBDRIZZLE_LIBRARY_VERSION)
22
23 libdrizzle_la_SOURCES= \
24 libdrizzle/drizzle.c \
25
26=== modified file 'config/autorun.sh'
27--- config/autorun.sh 2009-10-07 01:12:30 +0000
28+++ config/autorun.sh 2009-12-05 23:40:29 +0000
29@@ -68,12 +68,6 @@
30 . config/pre_hook.sh
31 fi
32
33-# We need to some file here for the m4_sinclude, even if it's just empty
34-if test ! -f config/plugin.ac
35-then
36- touch config/plugin.ac
37-fi
38-
39 # Try to detect the supported binaries if the user didn't
40 # override that by pushing the environment variable
41 if test x$LIBTOOLIZE = x; then
42
43=== modified file 'configure.ac'
44--- configure.ac 2009-11-05 22:47:42 +0000
45+++ configure.ac 2009-12-05 23:40:29 +0000
46@@ -39,10 +39,7 @@
47
48 PANDORA_HAVE_LIBSQLITE3
49
50-AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
51 AC_CHECK_FUNC(inet_ntoa, [], [AC_CHECK_LIB(nsl, inet_ntoa)])
52-# This may get things to compile even if bind-8 is installed
53-AC_CHECK_FUNC(bind, [], [AC_CHECK_LIB(bind, bind)])
54
55 AC_CHECK_FUNCS(memchr memmove memset socket strcasecmp strtoul)
56
57
58=== removed file 'libdrizzle/libdrizzle.ver'
59--- libdrizzle/libdrizzle.ver 2009-02-02 18:00:27 +0000
60+++ libdrizzle/libdrizzle.ver 1970-01-01 00:00:00 +0000
61@@ -1,1 +0,0 @@
62-libdrizzle_0 { global: *; };
63
64=== modified file 'm4/pandora_canonical.m4'
65--- m4/pandora_canonical.m4 2009-10-07 01:12:30 +0000
66+++ m4/pandora_canonical.m4 2009-12-05 23:40:29 +0000
67@@ -4,7 +4,7 @@
68 dnl with or without modifications, as long as this notice is preserved.
69
70 dnl Which version of the canonical setup we're using
71-AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.62])
72+AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.82])
73
74 AC_DEFUN([PANDORA_FORCE_DEPEND_TRACKING],[
75 dnl Force dependency tracking on for Sun Studio builds
76@@ -24,6 +24,8 @@
77 m4_define([PCT_IGNORE_SHARED_PTR],[no])
78 m4_define([PCT_FORCE_GCC42],[no])
79 m4_define([PCT_SRC_IN_SRC],[no])
80+ m4_define([PCT_VERSION_FROM_VC],[no])
81+ m4_define([PCT_USE_VISIBILITY],[yes])
82 m4_foreach([pct_arg],[$*],[
83 m4_case(pct_arg,
84 [use-gnulib], [
85@@ -42,9 +44,17 @@
86 m4_undefine([PCT_FORCE_GCC42])
87 m4_define([PCT_FORCE_GCC42],[yes])
88 ],
89+ [skip-visibility], [
90+ m4_undefine([PCT_USE_VISIBILITY])
91+ m4_define([PCT_USE_VISIBILITY],[no])
92+ ],
93 [src-in-src], [
94 m4_undefine([PCT_SRC_IN_SRC])
95 m4_define([PCT_SRC_IN_SRC],[yes])
96+ ],
97+ [version-from-vc], [
98+ m4_undefine([PCT_VERSION_FROM_VC])
99+ m4_define([PCT_VERSION_FROM_VC],[yes])
100 ])
101 ])
102
103@@ -58,7 +68,7 @@
104
105 AC_CANONICAL_TARGET
106
107- AM_INIT_AUTOMAKE(-Wall -Werror nostdinc subdir-objects)
108+ AM_INIT_AUTOMAKE(-Wall -Werror nostdinc subdir-objects foreign)
109 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
110
111 m4_if(PCT_USE_GNULIB,yes,[ gl_EARLY ])
112@@ -67,6 +77,11 @@
113 AC_REQUIRE([PANDORA_MAC_GCC42])
114 AC_REQUIRE([PANDORA_64BIT])
115
116+ m4_if(PCT_VERSION_FROM_VC,yes,[
117+ PANDORA_VC_VERSION
118+ ])
119+ PANDORA_VERSION
120+
121 dnl Once we can use a modern autoconf, we can use this
122 dnl AC_PROG_CC_C99
123 AC_REQUIRE([AC_PROG_CXX])
124@@ -90,6 +105,7 @@
125 AS_IF([test "$ac_cv_cxx_stdcxx_98" = "no"],[
126 AC_MSG_ERROR([No working C++ Compiler has been found. ${PACKAGE} requires a C++ compiler that can handle C++98])
127 ])
128+
129 ])
130
131 PANDORA_SHARED_PTR
132@@ -104,6 +120,9 @@
133 AC_CONFIG_LIBOBJ_DIR([gnulib])
134 ])
135
136+ PANDORA_CHECK_C_VERSION
137+ PANDORA_CHECK_CXX_VERSION
138+
139 AC_C_BIGENDIAN
140 AC_C_CONST
141 AC_C_INLINE
142@@ -114,17 +133,76 @@
143 AC_TYPE_SIZE_T
144 AC_SYS_LARGEFILE
145
146-
147- PANDORA_CHECK_C_VERSION
148- PANDORA_CHECK_CXX_VERSION
149+ # off_t is not a builtin type
150+ AC_CHECK_SIZEOF(off_t, 4)
151+ AS_IF([test "$ac_cv_sizeof_off_t" -eq 0],[
152+ AC_MSG_ERROR("${PACKAGE} needs an off_t type.")
153+ ])
154+
155+ AC_CHECK_SIZEOF(size_t)
156+ AS_IF([test "$ac_cv_sizeof_size_t" -eq 0],[
157+ AC_MSG_ERROR("${PACKAGE} needs an size_t type.")
158+ ])
159+
160+ AC_DEFINE_UNQUOTED([SIZEOF_SIZE_T],[$ac_cv_sizeof_size_t],[Size of size_t as computed by sizeof()])
161+ AC_CHECK_SIZEOF(long long)
162+ AC_DEFINE_UNQUOTED([SIZEOF_LONG_LONG],[$ac_cv_sizeof_long_long],[Size of long long as computed by sizeof()])
163+ AC_CACHE_CHECK([if time_t is unsigned], [ac_cv_time_t_unsigned],[
164+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
165+ [[
166+#include <time.h>
167+ ]],
168+ [[
169+ int array[(((time_t)-1) > 0) ? 1 : -1];
170+ ]])
171+ ],[
172+ ac_cv_time_t_unsigned=yes
173+ ],[
174+ ac_cv_time_t_unsigned=no
175+ ])
176+ ])
177+ AS_IF([test "$ac_cv_time_t_unsigned" = "yes"],[
178+ AC_DEFINE([TIME_T_UNSIGNED], 1, [Define to 1 if time_t is unsigned])
179+ ])
180+
181+ dnl AC_FUNC_ALLOCA would test for stack direction if we didn't have a working
182+ dnl alloca - but we need to know it anyway for check_stack_overrun.
183+ PANDORA_STACK_DIRECTION
184+
185+ save_LIBS="${LIBS}"
186+ LIBS=""
187+ AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
188+ LIBM="${LIBS}"
189+ LIBS="${save_LIBS}"
190+ AC_SUBST([LIBM])
191+
192+ AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
193+ AC_CHECK_FUNC(bind, [], [AC_CHECK_LIB(bind, bind)])
194+
195+
196
197 PANDORA_OPTIMIZE
198
199- dnl We need to inject error into the cflags to test if visibility works or not
200- save_CFLAGS="${CFLAGS}"
201- CFLAGS="${CFLAGS} -Werror"
202- gl_VISIBILITY
203- CFLAGS="${save_CFLAGS}"
204+ AC_LANG_PUSH(C++)
205+ # Test whether madvise() is declared in C++ code -- it is not on some
206+ # systems, such as Solaris
207+ AC_CHECK_DECLS([madvise], [], [], [AC_INCLUDES_DEFAULT[
208+ #if HAVE_SYS_MMAN_H
209+ #include <sys/types.h>
210+ #include <sys/mman.h>
211+ #endif
212+ ]])
213+ AC_LANG_POP()
214+
215+ PANDORA_HAVE_GCC_ATOMICS
216+
217+ m4_if(PCT_USE_VISIBILITY,[yes],[
218+ dnl We need to inject error into the cflags to test if visibility works or not
219+ save_CFLAGS="${CFLAGS}"
220+ CFLAGS="${CFLAGS} -Werror"
221+ gl_VISIBILITY
222+ CFLAGS="${save_CFLAGS}"
223+ ])
224
225 PANDORA_HEADER_ASSERT
226
227
228=== added file 'm4/pandora_cinttypes.m4'
229--- m4/pandora_cinttypes.m4 1970-01-01 00:00:00 +0000
230+++ m4/pandora_cinttypes.m4 2009-12-05 23:40:29 +0000
231@@ -0,0 +1,31 @@
232+# We check two things: where the include file is for cinttypes. We
233+# include AC_TRY_COMPILE for all the combinations we've seen in the
234+# wild. We define one of HAVE_CINTTYPES or HAVE_TR1_CINTTYPES or
235+# HAVE_BOOST_CINTTYPES depending
236+# on location.
237+
238+AC_DEFUN([PANDORA_CXX_CINTTYPES],
239+ [AC_REQUIRE([PANDORA_CXX_CSTDINT])
240+ AC_MSG_CHECKING(the location of cinttypes)
241+ AC_LANG_PUSH(C++)
242+ ac_cv_cxx_cinttypes=""
243+ for location in tr1/cinttypes boost/cinttypes cinttypes; do
244+ if test -z "$ac_cv_cxx_cinttypes"; then
245+ AC_TRY_COMPILE([#include $ac_cv_cxx_cstdint;
246+ #include <$location>],
247+ [uint32_t foo= UINT32_C(1)],
248+ [ac_cv_cxx_cinttypes="<$location>";])
249+ fi
250+ done
251+ AC_LANG_POP()
252+ if test -n "$ac_cv_cxx_cinttypes"; then
253+ AC_MSG_RESULT([$ac_cv_cxx_cinttypes])
254+ else
255+ AC_DEFINE([__STDC_LIMIT_MACROS],[1],[Use STDC Limit Macros in C++])
256+ ac_cv_cxx_cinttypes="<inttypes.h>"
257+ AC_MSG_RESULT()
258+ AC_MSG_WARN([Could not find a cinttypes header.])
259+ fi
260+ AC_DEFINE_UNQUOTED(CINTTYPES_H,$ac_cv_cxx_cinttypes,
261+ [the location of <cinttypes>])
262+])
263
264=== added file 'm4/pandora_cstdint.m4'
265--- m4/pandora_cstdint.m4 1970-01-01 00:00:00 +0000
266+++ m4/pandora_cstdint.m4 2009-12-05 23:40:29 +0000
267@@ -0,0 +1,30 @@
268+# We check two things: where the include file is for cstdint. We
269+# include AC_TRY_COMPILE for all the combinations we've seen in the
270+# wild. We define one of HAVE_CSTDINT or HAVE_TR1_CSTDINT or
271+# HAVE_BOOST_CSTDINT depending
272+# on location.
273+
274+AC_DEFUN([PANDORA_CXX_CSTDINT],
275+ [AC_MSG_CHECKING(the location of cstdint)
276+ AC_LANG_PUSH(C++)
277+ ac_cv_cxx_cstdint=""
278+ for location in tr1/cstdint boost/cstdint cstdint; do
279+ if test -z "$ac_cv_cxx_cstdint"; then
280+ AC_TRY_COMPILE([#include <$location>],
281+ [uint32_t t],
282+ [ac_cv_cxx_cstdint="<$location>";])
283+ fi
284+ done
285+ AC_LANG_POP()
286+ if test -n "$ac_cv_cxx_cstdint"; then
287+ AC_MSG_RESULT([$ac_cv_cxx_cstdint])
288+ else
289+ AC_DEFINE([__STDC_CONSTANT_MACROS],[1],[Use STDC Constant Macros in C++])
290+ AC_DEFINE([__STDC_FORMAT_MACROS],[1],[Use STDC Format Macros in C++])
291+ ac_cv_cxx_cstdint="<stdint.h>"
292+ AC_MSG_RESULT()
293+ AC_MSG_WARN([Could not find a cstdint header.])
294+ fi
295+ AC_DEFINE_UNQUOTED(CSTDINT_H,$ac_cv_cxx_cstdint,
296+ [the location of <cstdint>])
297+])
298
299=== added file 'm4/pandora_cxx_demangle.m4'
300--- m4/pandora_cxx_demangle.m4 1970-01-01 00:00:00 +0000
301+++ m4/pandora_cxx_demangle.m4 2009-12-05 23:40:29 +0000
302@@ -0,0 +1,24 @@
303+dnl Copyright (C) 2009 Sun Microsystems
304+dnl This file is free software; Sun Microsystems
305+dnl gives unlimited permission to copy and/or distribute it,
306+dnl with or without modifications, as long as this notice is preserved.
307+
308+dnl Check for all of the headers and libs that Drizzle needs. We check all
309+dnl of these for plugins too, to ensure that all of the appropriate defines
310+dnl are set.
311+
312+AC_DEFUN([PANDORA_CXX_DEMANGLE],[
313+ AC_LANG_PUSH([C++])
314+ AC_CHECK_HEADERS(cxxabi.h)
315+ AC_CACHE_CHECK([checking for abi::__cxa_demangle], pandora_cv_cxa_demangle,
316+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cxxabi.h>]], [[
317+ char *foo= 0; int bar= 0;
318+ foo= abi::__cxa_demangle(foo, foo, 0, &bar);
319+ ]])],[pandora_cv_cxa_demangle=yes],[pandora_cv_cxa_demangle=no])])
320+ AC_LANG_POP()
321+
322+ AS_IF([test "x$pandora_cv_cxa_demangle" = xyes],[
323+ AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
324+ [Define to 1 if you have the `abi::__cxa_demangle' function.])
325+ ])
326+])
327
328=== added file 'm4/pandora_drizzle_build.m4'
329--- m4/pandora_drizzle_build.m4 1970-01-01 00:00:00 +0000
330+++ m4/pandora_drizzle_build.m4 2009-12-05 23:40:29 +0000
331@@ -0,0 +1,77 @@
332+dnl Copyright (C) 2009 Sun Microsystems
333+dnl This file is free software; Sun Microsystems
334+dnl gives unlimited permission to copy and/or distribute it,
335+dnl with or without modifications, as long as this notice is preserved.
336+
337+dnl Check for all of the headers and libs that Drizzle needs. We check all
338+dnl of these for plugins too, to ensure that all of the appropriate defines
339+dnl are set.
340+
341+AC_DEFUN([PANDORA_DRIZZLE_BUILD],[
342+
343+ dnl We need to turn on our CXXFLAGS to make sure it shows up correctly
344+ save_CXXFLAGS="${CXXFLAGS}"
345+ CXXFLAGS="${CXXFLAGS} ${AM_CXXFLAGS}"
346+ PANDORA_CXX_STL_HASH
347+ CXXFLAGS="${save_CXXFLAGS}"
348+
349+ PANDORA_CXX_CSTDINT
350+ PANDORA_CXX_CINTTYPES
351+
352+ AC_STRUCT_TM
353+
354+ AC_FUNC_ALLOCA
355+ AC_FUNC_UTIME_NULL
356+ AC_FUNC_VPRINTF
357+
358+ PANDORA_WORKING_FDATASYNC
359+
360+ AC_CHECK_FUNCS(\
361+ gethrtime \
362+ setupterm \
363+ backtrace \
364+ backtrace_symbols \
365+ backtrace_symbols_fd)
366+
367+ AC_HEADER_STAT
368+ AC_HEADER_DIRENT
369+ AC_HEADER_STDC
370+ AC_HEADER_SYS_WAIT
371+ AC_HEADER_STDBOOL
372+
373+ AC_CHECK_HEADERS(sys/types.h sys/fpu.h fpu_control.h ieeefp.h)
374+ AC_CHECK_HEADERS(select.h sys/select.h)
375+ AC_CHECK_HEADERS(utime.h sys/utime.h )
376+ AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h)
377+ AC_CHECK_HEADERS(sched.h)
378+ AC_CHECK_HEADERS(sys/prctl.h)
379+ AC_CHECK_HEADERS(execinfo.h)
380+ AC_CHECK_HEADERS(locale.h)
381+ AC_CHECK_HEADERS(termcap.h termio.h termios.h asm/termbits.h)
382+ AC_CHECK_HEADERS(paths.h)
383+
384+
385+ #--------------------------------------------------------------------
386+ # Check for system libraries. Adds the library to $LIBS
387+ # and defines HAVE_LIBM etc
388+ #--------------------------------------------------------------------
389+
390+ # For the sched_yield() function on Solaris
391+ AC_CHECK_FUNC(sched_yield, [],
392+ [AC_CHECK_LIB(posix4, [sched_yield],
393+ [AC_DEFINE(HAVE_SCHED_YIELD, 1, [Have sched_yield function]) LIBS="$LIBS -lposix4"])])
394+
395+ AS_IF([test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"],[
396+ AC_CHECK_FUNC(gtty, [], [AC_CHECK_LIB(compat, gtty)])
397+ ])
398+
399+ AC_CHECK_HEADERS([curses.h term.h],[],[],[[
400+ #ifdef HAVE_CURSES_H
401+ # include <curses.h>
402+ #endif
403+ ]])
404+ AC_CHECK_TYPES([uint, ulong])
405+
406+ PANDORA_CXX_DEMANGLE
407+
408+])
409
410=== added file 'm4/pandora_fdatasync.m4'
411--- m4/pandora_fdatasync.m4 1970-01-01 00:00:00 +0000
412+++ m4/pandora_fdatasync.m4 2009-12-05 23:40:29 +0000
413@@ -0,0 +1,25 @@
414+dnl Copyright (C) 2009 Sun Microsystems
415+dnl This file is free software; Sun Microsystems
416+dnl gives unlimited permission to copy and/or distribute it,
417+dnl with or without modifications, as long as this notice is preserved.
418+
419+#--------------------------------------------------------------------
420+# Check for a working fdatasync call
421+#--------------------------------------------------------------------
422+
423+
424+AC_DEFUN([PANDORA_WORKING_FDATASYNC],[
425+ AC_CACHE_CHECK([working fdatasync],[ac_cv_func_fdatasync],[
426+ AC_LANG_PUSH(C++)
427+ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
428+#include <unistd.h>
429+ ]],[[
430+fdatasync(4);
431+ ]])],
432+ [ac_cv_func_fdatasync=yes],
433+ [ac_cv_func_fdatasync=no])
434+ AC_LANG_POP()
435+ ])
436+ AS_IF([test "x${ac_cv_func_fdatasync}" = "xyes"],
437+ [AC_DEFINE([HAVE_FDATASYNC],[1],[If the system has a working fdatasync])])
438+])
439\ No newline at end of file
440
441=== modified file 'm4/pandora_have_better_malloc.m4'
442--- m4/pandora_have_better_malloc.m4 2009-08-07 21:05:59 +0000
443+++ m4/pandora_have_better_malloc.m4 2009-12-05 23:40:29 +0000
444@@ -60,3 +60,8 @@
445 AC_SUBST([BETTER_MALLOC_LIBS])
446
447 ])
448+
449+AC_DEFUN([PANDORA_USE_BETTER_MALLOC],[
450+ AC_REQUIRE([PANDORA_HAVE_BETTER_MALLOC])
451+ LIBS="${LIBS} ${BETTER_MALLOC_LIBS}"
452+])
453\ No newline at end of file
454
455=== added file 'm4/pandora_have_gcc_atomics.m4'
456--- m4/pandora_have_gcc_atomics.m4 1970-01-01 00:00:00 +0000
457+++ m4/pandora_have_gcc_atomics.m4 2009-12-05 23:40:29 +0000
458@@ -0,0 +1,37 @@
459+dnl Copyright (C) 2009 Sun Microsystems
460+dnl This file is free software; Sun Microsystems
461+dnl gives unlimited permission to copy and/or distribute it,
462+dnl with or without modifications, as long as this notice is preserved.
463+
464+#--------------------------------------------------------------------
465+# Check for GCC Atomic Support
466+#--------------------------------------------------------------------
467+
468+
469+AC_DEFUN([PANDORA_HAVE_GCC_ATOMICS],[
470+
471+ AC_CACHE_CHECK(
472+ [whether the compiler provides atomic builtins],
473+ [ac_cv_gcc_atomic_builtins],
474+ [AC_RUN_IFELSE(
475+ [AC_LANG_PROGRAM([],[[
476+ int foo= -10; int bar= 10;
477+ if (!__sync_fetch_and_add(&foo, bar) || foo)
478+ return -1;
479+ bar= __sync_lock_test_and_set(&foo, bar);
480+ if (bar || foo != 10)
481+ return -1;
482+ bar= __sync_val_compare_and_swap(&bar, foo, 15);
483+ if (bar)
484+ return -1;
485+ return 0;
486+ ]])],
487+ [ac_cv_gcc_atomic_builtins=yes],
488+ [ac_cv_gcc_atomic_builtins=no])])
489+
490+ AS_IF([test "x$ac_cv_gcc_atomic_builtins" = "xyes"],[
491+ AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1,
492+ [Define to 1 if compiler provides atomic builtins.])
493+ ])
494+
495+])
496\ No newline at end of file
497
498=== added file 'm4/pandora_have_libavahi.m4'
499--- m4/pandora_have_libavahi.m4 1970-01-01 00:00:00 +0000
500+++ m4/pandora_have_libavahi.m4 2009-12-05 23:40:29 +0000
501@@ -0,0 +1,41 @@
502+dnl Copyright (C) 2009 Sun Microsystems
503+dnl This file is free software; Sun Microsystems
504+dnl gives unlimited permission to copy and/or distribute it,
505+dnl with or without modifications, as long as this notice is preserved.
506+
507+AC_DEFUN([_PANDORA_SEARCH_LIBAVAHI],[
508+ AC_REQUIRE([AC_LIB_PREFIX])
509+
510+ dnl --------------------------------------------------------------------
511+ dnl Check for libavahi
512+ dnl --------------------------------------------------------------------
513+
514+ AC_ARG_ENABLE([libavahi],
515+ [AS_HELP_STRING([--disable-libavahi],
516+ [Build with libavahi support @<:@default=on@:>@])],
517+ [ac_enable_libavahi="$enableval"],
518+ [ac_enable_libavahi="yes"])
519+
520+ AS_IF([test "x$ac_enable_libavahi" = "xyes"],[
521+ AC_LIB_HAVE_LINKFLAGS(avahi-client,avahi-common,[
522+ #include <avahi-client/client.h>
523+ #include <avahi-common/simple-watch.h>
524+ ],[
525+ AvahiSimplePoll *simple_poll= avahi_simple_poll_new();
526+ ])
527+ ],[
528+ ac_cv_libavahi="no"
529+ ])
530+
531+ AM_CONDITIONAL(HAVE_LIBAVAHI, [test "x${ac_cv_libavahi}" = "xyes"])
532+])
533+
534+AC_DEFUN([PANDORA_HAVE_LIBAVAHI],[
535+ AC_REQUIRE([_PANDORA_SEARCH_LIBAVAHI])
536+])
537+
538+AC_DEFUN([PANDORA_REQUIRE_LIBAVAHI],[
539+ AC_REQUIRE([_PANDORA_SEARCH_LIBAVAHI])
540+ AS_IF([test "x${ac_cv_libavahi}" = "xno"],
541+ AC_MSG_ERROR([libavahi is required for ${PACKAGE}]))
542+])
543
544=== added file 'm4/pandora_have_libbdb.m4'
545--- m4/pandora_have_libbdb.m4 1970-01-01 00:00:00 +0000
546+++ m4/pandora_have_libbdb.m4 2009-12-05 23:40:29 +0000
547@@ -0,0 +1,40 @@
548+dnl Copyright (C) 2009 Sun Microsystems
549+dnl This file is free software; Sun Microsystems
550+dnl gives unlimited permission to copy and/or distribute it,
551+dnl with or without modifications, as long as this notice is preserved.
552+
553+AC_DEFUN([_PANDORA_SEARCH_LIBBDB],[
554+ AC_REQUIRE([AC_LIB_PREFIX])
555+
556+ dnl --------------------------------------------------------------------
557+ dnl Check for bekerely db
558+ dnl --------------------------------------------------------------------
559+
560+ AC_ARG_ENABLE([libbdb],
561+ [AS_HELP_STRING([--disable-libbdb],
562+ [Build with libbdb support @<:@default=on@:>@])],
563+ [ac_enable_libbdb="$enableval"],
564+ [ac_enable_libbdb="yes"])
565+
566+ AS_IF([test "x$ac_enable_libbdb" = "xyes"],[
567+ AC_LIB_HAVE_LINKFLAGS(db,,[
568+ #include <db.h>
569+ ],[
570+ const char *test= DB_VERSION_STRING;
571+ ])
572+ ],[
573+ ac_cv_libbdb="no"
574+ ])
575+
576+ AM_CONDITIONAL(HAVE_LIBBDB, [test "x${ac_cv_libbdb}" = "xyes"])
577+])
578+
579+AC_DEFUN([PANDORA_HAVE_LIBBDB],[
580+ AC_REQUIRE([_PANDORA_SEARCH_LIBBDB])
581+])
582+
583+AC_DEFUN([PANDORA_REQUIRE_LIBBDB],[
584+ AC_REQUIRE([_PANDORA_SEARCH_LIBBDB])
585+ AS_IF([test "x${ac_cv_libbdb}" = "xno"],
586+ AC_MSG_ERROR([libbdb is required for ${PACKAGE}]))
587+])
588
589=== added file 'm4/pandora_have_libdl.m4'
590--- m4/pandora_have_libdl.m4 1970-01-01 00:00:00 +0000
591+++ m4/pandora_have_libdl.m4 2009-12-05 23:40:29 +0000
592@@ -0,0 +1,51 @@
593+dnl Copyright (C) 2009 Sun Microsystems
594+dnl This file is free software; Sun Microsystems
595+dnl gives unlimited permission to copy and/or distribute it,
596+dnl with or without modifications, as long as this notice is preserved.
597+
598+#--------------------------------------------------------------------
599+# Check for libdl
600+#--------------------------------------------------------------------
601+
602+
603+AC_DEFUN([_PANDORA_SEARCH_LIBDL],[
604+
605+ save_LIBS="$LIBS"
606+ LIBS=""
607+ AC_CHECK_LIB(dl,dlopen)
608+ AC_CHECK_FUNCS(dlopen)
609+ LIBDL_LIBS="$LIBS"
610+ LIBS="$my_save_LIBS"
611+ AC_SUBST(LIBDL_LIBS)
612+
613+ AM_CONDITIONAL(HAVE_LIBDL, [test "x${ac_cv_func_dlopen}" = "xyes"])
614+])
615+
616+AC_DEFUN([_PANDORA_HAVE_LIBDL],[
617+
618+ AC_ARG_ENABLE([libdl],
619+ [AS_HELP_STRING([--disable-libdl],
620+ [Build with libdl support @<:@default=on@:>@])],
621+ [ac_enable_libdl="$enableval"],
622+ [ac_enable_libdl="yes"])
623+
624+ _PANDORA_SEARCH_LIBDL
625+])
626+
627+
628+AC_DEFUN([PANDORA_HAVE_LIBDL],[
629+ AC_REQUIRE([_PANDORA_HAVE_LIBDL])
630+])
631+
632+AC_DEFUN([_PANDORA_REQUIRE_LIBDL],[
633+ ac_enable_libdl="yes"
634+ _PANDORA_SEARCH_LIBDL
635+
636+ AS_IF([test "$ac_cv_func_dlopen" != "yes"],[
637+ AC_MSG_ERROR([libdl/dlopen() is required for ${PACKAGE}. On Debian this can be found in libc6-dev. On RedHat this can be found in glibc-devel.])
638+ ])
639+])
640+
641+AC_DEFUN([PANDORA_REQUIRE_LIBDL],[
642+ AC_REQUIRE([_PANDORA_REQUIRE_LIBDL])
643+])
644
645=== added file 'm4/pandora_have_libevent.m4'
646--- m4/pandora_have_libevent.m4 1970-01-01 00:00:00 +0000
647+++ m4/pandora_have_libevent.m4 2009-12-05 23:40:29 +0000
648@@ -0,0 +1,66 @@
649+dnl Copyright (C) 2009 Sun Microsystems
650+dnl This file is free software; Sun Microsystems
651+dnl gives unlimited permission to copy and/or distribute it,
652+dnl with or without modifications, as long as this notice is preserved.
653+
654+#--------------------------------------------------------------------
655+# Check for libevent
656+#--------------------------------------------------------------------
657+
658+
659+AC_DEFUN([_PANDORA_SEARCH_LIBEVENT],[
660+ AC_REQUIRE([AC_LIB_PREFIX])
661+
662+ AC_LIB_HAVE_LINKFLAGS(event,,
663+ [
664+ #include <sys/types.h>
665+ #include <sys/time.h>
666+ #include <stdlib.h>
667+ #include <event.h>
668+ ],[
669+ struct bufferevent bev;
670+ bufferevent_settimeout(&bev, 1, 1);
671+ event_init();
672+ event_loop(EVLOOP_ONCE);
673+ ])
674+
675+ AM_CONDITIONAL(HAVE_LIBEVENT, [test "x${ac_cv_libevent}" = "xyes"])
676+
677+ AS_IF([test "x${ac_cv_libevent}" = "xyes"],[
678+ save_LIBS="${LIBS}"
679+ LIBS="${LIBS} ${LTLIBEVENT}"
680+ AC_CHECK_FUNCS(event_base_new)
681+ AC_CHECK_FUNCS(event_base_free)
682+ AC_CHECK_FUNCS(event_base_get_method)
683+ LIBS="$save_LIBS"
684+ ])
685+])
686+
687+AC_DEFUN([_PANDORA_HAVE_LIBEVENT],[
688+
689+ AC_ARG_ENABLE([libevent],
690+ [AS_HELP_STRING([--disable-libevent],
691+ [Build with libevent support @<:@default=on@:>@])],
692+ [ac_enable_libevent="$enableval"],
693+ [ac_enable_libevent="yes"])
694+
695+ _PANDORA_SEARCH_LIBEVENT
696+])
697+
698+
699+AC_DEFUN([PANDORA_HAVE_LIBEVENT],[
700+ AC_REQUIRE([_PANDORA_HAVE_LIBEVENT])
701+])
702+
703+AC_DEFUN([_PANDORA_REQUIRE_LIBEVENT],[
704+ ac_enable_libevent="yes"
705+ _PANDORA_SEARCH_LIBEVENT
706+
707+ AS_IF([test x$ac_cv_libevent = xno],[
708+ AC_MSG_ERROR([libevent is required for ${PACKAGE}. On Debian this can be found in libevent-dev. On RedHat this can be found in libevent-devel.])
709+ ])
710+])
711+
712+AC_DEFUN([PANDORA_REQUIRE_LIBEVENT],[
713+ AC_REQUIRE([_PANDORA_REQUIRE_LIBEVENT])
714+])
715
716=== modified file 'm4/pandora_have_libgearman.m4'
717--- m4/pandora_have_libgearman.m4 2009-07-29 18:43:09 +0000
718+++ m4/pandora_have_libgearman.m4 2009-12-05 23:40:29 +0000
719@@ -21,7 +21,7 @@
720 #include <libgearman/gearman.h>
721 ],[
722 gearman_client_st gearman_client;
723- gearman_version();
724+ gearman_client_context(&gearman_client);
725 ])
726 ],[
727 ac_cv_libgearman="no"
728@@ -37,5 +37,5 @@
729 AC_DEFUN([PANDORA_REQUIRE_LIBGEARMAN],[
730 AC_REQUIRE([PANDORA_HAVE_LIBGEARMAN])
731 AS_IF([test "x${ac_cv_libgearman}" = "xno"],
732- AC_MSG_ERROR([libgearman is required for ${PACKAGE}]))
733+ AC_MSG_ERROR([At least version 0.10 of libgearman is required for ${PACKAGE}]))
734 ])
735
736=== modified file 'm4/pandora_have_libmemcached.m4'
737--- m4/pandora_have_libmemcached.m4 2009-08-07 21:05:59 +0000
738+++ m4/pandora_have_libmemcached.m4 2009-12-05 23:40:29 +0000
739@@ -30,7 +30,6 @@
740
741 AM_CONDITIONAL(HAVE_LIBMEMCACHED, [test "x${ac_cv_libmemcached}" = "xyes"])
742
743- AS_IF([test "x${ac_cv_libmemcached}" = "xyes"], [ PANDORA_WITH_MEMCACHED ])
744 ])
745
746 AC_DEFUN([PANDORA_HAVE_LIBMEMCACHED],[
747
748=== added file 'm4/pandora_have_libpcre.m4'
749--- m4/pandora_have_libpcre.m4 1970-01-01 00:00:00 +0000
750+++ m4/pandora_have_libpcre.m4 2009-12-05 23:40:29 +0000
751@@ -0,0 +1,73 @@
752+dnl Copyright (C) 2009 Sun Microsystems
753+dnl This file is free software; Sun Microsystems
754+dnl gives unlimited permission to copy and/or distribute it,
755+dnl with or without modifications, as long as this notice is preserved.
756+
757+#--------------------------------------------------------------------
758+# Check for libpcre
759+#--------------------------------------------------------------------
760+
761+
762+AC_DEFUN([_PANDORA_SEARCH_LIBPCRE],[
763+ AC_REQUIRE([AC_LIB_PREFIX])
764+
765+ AC_LIB_HAVE_LINKFLAGS(pcre,,
766+ [#include <pcre.h>],
767+ [
768+ pcre *re= NULL;
769+ pcre_version();
770+ ])
771+ AS_IF([test "x$ac_cv_libpcre" = "xno"],
772+ [
773+ unset ac_cv_libpcre
774+ unset HAVE_LIBPCRE
775+ unset LIBPCRE
776+ unset LIBPCRE_PREFIX
777+ unset LTLIBPCRE
778+ AC_LIB_HAVE_LINKFLAGS(pcre,,
779+ [#include <pcre/pcre.h>],
780+ [
781+ pcre *re= NULL;
782+ pcre_version();
783+ ])
784+ AS_IF([test "x$ac_cv_libpcre" = "xyes"], [
785+ ac_cv_pcre_location="<pcre/pcre.h>"
786+ ])
787+ ],[
788+ ac_cv_pcre_location="<pcre.h>"
789+ ])
790+
791+ AM_CONDITIONAL(HAVE_LIBPCRE, [test "x${ac_cv_libpcre}" = "xyes"])
792+])
793+
794+AC_DEFUN([_PANDORA_HAVE_LIBPCRE],[
795+
796+ AC_ARG_ENABLE([libpcre],
797+ [AS_HELP_STRING([--disable-libpcre],
798+ [Build with libpcre support @<:@default=on@:>@])],
799+ [ac_enable_libpcre="$enableval"],
800+ [ac_enable_libpcre="yes"])
801+
802+ _PANDORA_SEARCH_LIBPCRE
803+])
804+
805+
806+AC_DEFUN([PANDORA_HAVE_LIBPCRE],[
807+ AC_REQUIRE([_PANDORA_HAVE_LIBPCRE])
808+])
809+
810+AC_DEFUN([_PANDORA_REQUIRE_LIBPCRE],[
811+ ac_enable_libpcre="yes"
812+ _PANDORA_SEARCH_LIBPCRE
813+
814+ AS_IF([test x$ac_cv_libpcre = xno],[
815+ AC_MSG_ERROR([libpcre is required for ${PACKAGE}. On Debian this can be found in libpcre3-dev. On RedHat this can be found in pcre-devel.])
816+ ],[
817+ AC_DEFINE_UNQUOTED(PCRE_HEADER,[${ac_cv_pcre_location}],
818+ [Location of pcre header])
819+ ])
820+])
821+
822+AC_DEFUN([PANDORA_REQUIRE_LIBPCRE],[
823+ AC_REQUIRE([_PANDORA_REQUIRE_LIBPCRE])
824+])
825
826=== added file 'm4/pandora_have_libreadline.m4'
827--- m4/pandora_have_libreadline.m4 1970-01-01 00:00:00 +0000
828+++ m4/pandora_have_libreadline.m4 2009-12-05 23:40:29 +0000
829@@ -0,0 +1,242 @@
830+#
831+# SYNOPSIS
832+#
833+# PANDORA_HAVE_LIBREADLINE
834+#
835+# DESCRIPTION
836+#
837+# Searches for a readline compatible library. If found, defines
838+# `HAVE_LIBREADLINE'. If the found library has the `add_history'
839+# function, sets also `HAVE_READLINE_HISTORY'. Also checks for the
840+# locations of the necessary include files and sets `HAVE_READLINE_H'
841+# or `HAVE_READLINE_READLINE_H' and `HAVE_READLINE_HISTORY_H' or
842+# 'HAVE_HISTORY_H' if the corresponding include files exists.
843+#
844+# The libraries that may be readline compatible are `libedit',
845+# `libeditline' and `libreadline'. Sometimes we need to link a
846+# termcap library for readline to work, this macro tests these cases
847+# too by trying to link with `libtermcap', `libcurses' or
848+# `libncurses' before giving up.
849+#
850+# Here is an example of how to use the information provided by this
851+# macro to perform the necessary includes or declarations in a C
852+# file:
853+#
854+# #ifdef HAVE_LIBREADLINE
855+# # if defined(HAVE_READLINE_READLINE_H)
856+# # include <readline/readline.h>
857+# # elif defined(HAVE_READLINE_H)
858+# # include <readline.h>
859+# # else /* !defined(HAVE_READLINE_H) */
860+# extern char *readline ();
861+# # endif /* !defined(HAVE_READLINE_H) */
862+# char *cmdline = NULL;
863+# #else /* !defined(HAVE_READLINE_READLINE_H) */
864+# /* no readline */
865+# #endif /* HAVE_LIBREADLINE */
866+#
867+# #ifdef HAVE_READLINE_HISTORY
868+# # if defined(HAVE_READLINE_HISTORY_H)
869+# # include <readline/history.h>
870+# # elif defined(HAVE_HISTORY_H)
871+# # include <history.h>
872+# # else /* !defined(HAVE_HISTORY_H) */
873+# extern void add_history ();
874+# extern int write_history ();
875+# extern int read_history ();
876+# # endif /* defined(HAVE_READLINE_HISTORY_H) */
877+# /* no history */
878+# #endif /* HAVE_READLINE_HISTORY */
879+#
880+# LAST MODIFICATION
881+#
882+# 2009-11-17
883+#
884+# Based on VL_LIB_READLINE from Ville Laurikari
885+#
886+# COPYLEFT
887+#
888+# Copyright (c) 2009 Monty Taylor
889+# Copyright (c) 2002 Ville Laurikari <vl@iki.fi>
890+#
891+# Copying and distribution of this file, with or without
892+# modification, are permitted in any medium without royalty provided
893+# the copyright notice and this notice are preserved.
894+
895+AC_DEFUN([PANDORA_CHECK_TIOCGWINSZ],[
896+ AC_CACHE_CHECK([for TIOCGWINSZ in sys/ioctl.h],
897+ [pandora_cv_tiocgwinsz_in_ioctl],[
898+ AC_COMPILE_IFELSE([
899+ AC_LANG_PROGRAM([[
900+#include <sys/types.h>
901+#include <sys/ioctl.h>
902+ ]],[[
903+int x= TIOCGWINSZ;
904+ ]])
905+ ],[
906+ pandora_cv_tiocgwinsz_in_ioctl=yes
907+ ],[
908+ pandora_cv_tiocgwinsz_in_ioctl=no
909+ ])
910+ ])
911+ AS_IF([test "$pandora_cv_tiocgwinsz_in_ioctl" = "yes"],[
912+ AC_DEFINE([GWINSZ_IN_SYS_IOCTL], [1],
913+ [READLINE: your system defines TIOCGWINSZ in sys/ioctl.h.])
914+ ])
915+])
916+
917+AC_DEFUN([PANDORA_CHECK_RL_COMPENTRY], [
918+ AC_CACHE_CHECK([defined rl_compentry_func_t], [pandora_cv_rl_compentry],[
919+ AC_COMPILE_IFELSE([
920+ AC_LANG_PROGRAM([[
921+#include "stdio.h"
922+#include "readline/readline.h"
923+ ]],[[
924+rl_compentry_func_t *func2= (rl_compentry_func_t*)0;
925+ ]])
926+ ],[
927+ pandora_cv_rl_compentry=yes
928+ ],[
929+ pandora_cv_rl_compentry=no
930+ ])
931+ ])
932+ AS_IF([test "$pandora_cv_rl_compentry" = "yes"],[
933+ AC_DEFINE([HAVE_RL_COMPENTRY], [1],
934+ [Does system provide rl_compentry_func_t])
935+ ])
936+
937+ AC_LANG_PUSH(C++)
938+ save_CXXFLAGS="${CXXFLAGS}"
939+ CXXFLAGS="${AM_CXXFLAGS} ${CXXFLAGS}"
940+ AC_CACHE_CHECK([rl_compentry_func_t works], [pandora_cv_rl_compentry_works],[
941+ AC_COMPILE_IFELSE([
942+ AC_LANG_PROGRAM([[
943+#include "stdio.h"
944+#include "readline/readline.h"
945+ ]],[[
946+rl_completion_entry_function= (rl_compentry_func_t*)NULL;
947+ ]])
948+ ],[
949+ pandora_cv_rl_compentry_works=yes
950+ ],[
951+ pandora_cv_rl_compentry_works=no
952+ ])
953+ ])
954+ AS_IF([test "$pandora_cv_rl_compentry_works" = "yes"],[
955+ AC_DEFINE([HAVE_WORKING_RL_COMPENTRY], [1],
956+ [Does system provide an rl_compentry_func_t that is usable])
957+ ])
958+ CXXFLAGS="${save_CXXFLAGS}"
959+ AC_LANG_POP()
960+])
961+
962+
963+AC_DEFUN([PANDORA_CHECK_RL_COMPLETION_FUNC], [
964+ AC_CACHE_CHECK([defined rl_completion_func_t], [pandora_cv_rl_completion],[
965+ AC_COMPILE_IFELSE([
966+ AC_LANG_PROGRAM([[
967+#include "stdio.h"
968+#include "readline/readline.h"
969+ ]],[[
970+rl_completion_func_t *func1= (rl_completion_func_t*)0;
971+ ]])
972+ ],[
973+ pandora_cv_rl_completion=yes
974+ ],[
975+ pandora_cv_rl_completion=no
976+ ])
977+ ])
978+ AS_IF([test "$pandora_cv_rl_completion" = "yes"],[
979+ AC_DEFINE([HAVE_RL_COMPLETION], [1],
980+ [Does system provide rl_completion_func_t])
981+ ])
982+])
983+
984+AC_DEFUN([_PANDORA_SEARCH_LIBREADLINE], [
985+
986+ save_LIBS="${LIBS}"
987+ LIBS=""
988+
989+ AC_CACHE_CHECK([for a readline compatible library],
990+ ac_cv_libreadline, [
991+ ORIG_LIBS="$LIBS"
992+ for readline_lib in readline edit editline; do
993+ for termcap_lib in "" termcap curses ncurses; do
994+ if test -z "$termcap_lib"; then
995+ TRY_LIB="-l$readline_lib"
996+ else
997+ TRY_LIB="-l$readline_lib -l$termcap_lib"
998+ fi
999+ LIBS="$ORIG_LIBS $TRY_LIB"
1000+ AC_TRY_LINK_FUNC(readline, ac_cv_libreadline="$TRY_LIB")
1001+ if test -n "$ac_cv_libreadline"; then
1002+ break
1003+ fi
1004+ done
1005+ if test -n "$ac_cv_libreadline"; then
1006+ break
1007+ fi
1008+ done
1009+ if test -z "$ac_cv_libreadline"; then
1010+ ac_cv_libreadline="no"
1011+ LIBS="$ORIG_LIBS"
1012+ fi
1013+ ])
1014+
1015+ if test "$ac_cv_libreadline" != "no"; then
1016+ AC_DEFINE(HAVE_LIBREADLINE, 1,
1017+ [Define if you have a readline compatible library])
1018+ AC_CHECK_HEADERS(readline.h readline/readline.h)
1019+ AC_CACHE_CHECK([whether readline supports history],
1020+ ac_cv_libreadline_history, [
1021+ ac_cv_libreadline_history="no"
1022+ AC_TRY_LINK_FUNC(add_history, ac_cv_libreadline_history="yes")
1023+ ])
1024+ if test "$ac_cv_libreadline_history" = "yes"; then
1025+ AC_DEFINE(HAVE_READLINE_HISTORY, 1,
1026+ [Define if your readline library has \`add_history'])
1027+ AC_CHECK_HEADERS(history.h readline/history.h)
1028+ fi
1029+ fi
1030+ PANDORA_CHECK_RL_COMPENTRY
1031+ PANDORA_CHECK_RL_COMPLETION_FUNC
1032+ PANDORA_CHECK_TIOCGWINSZ
1033+
1034+
1035+ READLINE_LIBS="${LIBS}"
1036+ LIBS="${save_LIBS}"
1037+ AC_SUBST(READLINE_LIBS)
1038+
1039+ AM_CONDITIONAL(HAVE_LIBREADLINE, [test "x${ac_cv_libreadline}" = "xyes"])
1040+])
1041+
1042+AC_DEFUN([_PANDORA_HAVE_LIBREADLINE],[
1043+
1044+ AC_ARG_ENABLE([libreadline],
1045+ [AS_HELP_STRING([--disable-libreadline],
1046+ [Build with libreadline support @<:@default=on@:>@])],
1047+ [ac_enable_libreadline="$enableval"],
1048+ [ac_enable_libreadline="yes"])
1049+
1050+ _PANDORA_SEARCH_LIBREADLINE
1051+])
1052+
1053+
1054+AC_DEFUN([PANDORA_HAVE_LIBREADLINE],[
1055+ AC_REQUIRE([_PANDORA_HAVE_LIBREADLINE])
1056+])
1057+
1058+AC_DEFUN([_PANDORA_REQUIRE_LIBREADLINE],[
1059+ ac_enable_libreadline="yes"
1060+ _PANDORA_SEARCH_LIBREADLINE
1061+
1062+ AS_IF([test "x$ac_cv_libreadline" = "xno"],
1063+ AC_MSG_ERROR([libreadline is required for ${PACKAGE}. On Debian this can be found in libreadline5-dev. On RedHat this can be found in readline-devel.]))
1064+
1065+])
1066+
1067+AC_DEFUN([PANDORA_REQUIRE_LIBREADLINE],[
1068+ AC_REQUIRE([_PANDORA_REQUIRE_LIBREADLINE])
1069+])
1070+
1071+
1072
1073=== added file 'm4/pandora_have_libtokyocabinet.m4'
1074--- m4/pandora_have_libtokyocabinet.m4 1970-01-01 00:00:00 +0000
1075+++ m4/pandora_have_libtokyocabinet.m4 2009-12-05 23:40:29 +0000
1076@@ -0,0 +1,52 @@
1077+dnl Copyright (C) 2009 Sun Microsystems
1078+dnl This file is free software; Sun Microsystems
1079+dnl gives unlimited permission to copy and/or distribute it,
1080+dnl with or without modifications, as long as this notice is preserved.
1081+
1082+dnl Provides support for finding libtokyocabinet.
1083+dnl LIBTOKYOCABINET_CFLAGS will be set, in addition to LIBTOKYOCABINET and LTLIBTOKYOCABINET
1084+
1085+AC_DEFUN([_PANDORA_SEARCH_LIBTOKYOCABINET],[
1086+ AC_REQUIRE([AC_LIB_PREFIX])
1087+
1088+ dnl --------------------------------------------------------------------
1089+ dnl Check for libtokyocabinet
1090+ dnl --------------------------------------------------------------------
1091+
1092+ AC_ARG_ENABLE([libtokyocabinet],
1093+ [AS_HELP_STRING([--disable-libtokyocabinet],
1094+ [Build with libtokyocabinet support @<:@default=on@:>@])],
1095+ [ac_enable_libtokyocabinet="$enableval"],
1096+ [ac_enable_libtokyocabinet="yes"])
1097+
1098+ AS_IF([test "x$ac_enable_libtokyocabinet" = "xyes"],[
1099+ AC_LIB_HAVE_LINKFLAGS(tokyocabinet,,[
1100+#include <tcutil.h>
1101+ ],[
1102+const char *test= tcversion;
1103+ ])
1104+ ],[
1105+ ac_cv_libtokyocabinet="no"
1106+ ])
1107+
1108+ AS_IF([test "${ac_cv_libtokyocabinet}" = "no" -a "${ac_enable_libtokyocabinet}" = "yes"],[
1109+
1110+ PKG_CHECK_MODULES([LIBTOKYOCABINET], [libtokyocabinet], [
1111+ ac_cv_libtokyocabinet=yes
1112+ LTLIBTOKYOCABINET=${LIBTOKYOCABINET_LIBS}
1113+ LIBTOKYOCABINET=${LIBTOKYOCABINET_LIBS}
1114+ ],[])
1115+ ])
1116+
1117+ AM_CONDITIONAL(HAVE_LIBTOKYOCABINET, [test "${ac_cv_libtokyocabinet}" = "yes"])
1118+])
1119+
1120+AC_DEFUN([PANDORA_HAVE_LIBTOKYOCABINET],[
1121+ AC_REQUIRE([_PANDORA_SEARCH_LIBTOKYOCABINET])
1122+])
1123+
1124+AC_DEFUN([PANDORA_REQUIRE_LIBTOKYOCABINET],[
1125+ AC_REQUIRE([_PANDORA_SEARCH_LIBTOKYOCABINET])
1126+ AS_IF([test "x${ac_cv_libtokyocabinet}" = "xno"],
1127+ AC_MSG_ERROR([libtokyocabinet is required for ${PACKAGE}. On Debian systems this is found in libtokyocabinet-dev. On RedHat, in tokyocabinet-devel.]))
1128+])
1129
1130=== added file 'm4/pandora_have_libuuid.m4'
1131--- m4/pandora_have_libuuid.m4 1970-01-01 00:00:00 +0000
1132+++ m4/pandora_have_libuuid.m4 2009-12-05 23:40:29 +0000
1133@@ -0,0 +1,55 @@
1134+dnl Copyright (C) 2009 Sun Microsystems
1135+dnl This file is free software; Sun Microsystems
1136+dnl gives unlimited permission to copy and/or distribute it,
1137+dnl with or without modifications, as long as this notice is preserved.
1138+
1139+#--------------------------------------------------------------------
1140+# Check for libuuid
1141+#--------------------------------------------------------------------
1142+
1143+
1144+AC_DEFUN([_PANDORA_SEARCH_LIBUUID],[
1145+ AC_REQUIRE([AC_LIB_PREFIX])
1146+
1147+ dnl Do this by hand. Need to check for uuid/uuid.h, but uuid may or may
1148+ dnl not be a lib is weird.
1149+ AC_CHECK_HEADERS(uuid/uuid.h)
1150+ AC_LIB_HAVE_LINKFLAGS(uuid,,
1151+ [
1152+ #include <uuid/uuid.h>
1153+ ],
1154+ [
1155+ uuid_t uout;
1156+ uuid_generate(uout);
1157+ ])
1158+
1159+ AM_CONDITIONAL(HAVE_LIBUUID, [test "x${ac_cv_libuuid}" = "xyes"])
1160+])
1161+
1162+AC_DEFUN([_PANDORA_HAVE_LIBUUID],[
1163+
1164+ AC_ARG_ENABLE([libuuid],
1165+ [AS_HELP_STRING([--disable-libuuid],
1166+ [Build with libuuid support @<:@default=on@:>@])],
1167+ [ac_enable_libuuid="$enableval"],
1168+ [ac_enable_libuuid="yes"])
1169+
1170+ _PANDORA_SEARCH_LIBUUID
1171+])
1172+
1173+
1174+AC_DEFUN([PANDORA_HAVE_LIBUUID],[
1175+ AC_REQUIRE([_PANDORA_HAVE_LIBUUID])
1176+])
1177+
1178+AC_DEFUN([_PANDORA_REQUIRE_LIBUUID],[
1179+ ac_enable_libuuid="yes"
1180+ _PANDORA_SEARCH_LIBUUID
1181+ AS_IF([test "x$ac_cv_header_uuid_uuid_h" = "xno"],[
1182+ AC_MSG_ERROR([Couldn't find uuid/uuid.h. On Debian this can be found in uuid-dev. On Redhat this can be found in e2fsprogs-devel.])
1183+ ])
1184+])
1185+
1186+AC_DEFUN([PANDORA_REQUIRE_LIBUUID],[
1187+ AC_REQUIRE([_PANDORA_REQUIRE_LIBUUID])
1188+])
1189
1190=== added file 'm4/pandora_have_libxml2.m4'
1191--- m4/pandora_have_libxml2.m4 1970-01-01 00:00:00 +0000
1192+++ m4/pandora_have_libxml2.m4 2009-12-05 23:40:29 +0000
1193@@ -0,0 +1,52 @@
1194+dnl Copyright (C) 2009 Sun Microsystems
1195+dnl This file is free software; Sun Microsystems
1196+dnl gives unlimited permission to copy and/or distribute it,
1197+dnl with or without modifications, as long as this notice is preserved.
1198+
1199+dnl Provides support for finding libxml2.
1200+dnl LIBXML2_CFLAGS will be set, in addition to LIBXML2 and LTLIBXML2
1201+
1202+AC_DEFUN([_PANDORA_SEARCH_LIBXML2],[
1203+ AC_REQUIRE([AC_LIB_PREFIX])
1204+
1205+ dnl --------------------------------------------------------------------
1206+ dnl Check for libxml2
1207+ dnl --------------------------------------------------------------------
1208+
1209+ AC_ARG_ENABLE([libxml2],
1210+ [AS_HELP_STRING([--disable-libxml2],
1211+ [Build with libxml2 support @<:@default=on@:>@])],
1212+ [ac_enable_libxml2="$enableval"],
1213+ [ac_enable_libxml2="yes"])
1214+
1215+ AS_IF([test "x$ac_enable_libxml2" = "xyes"],[
1216+ AC_LIB_HAVE_LINKFLAGS(xml2,,[
1217+#include <libxml/xmlversion.h>
1218+ ],[
1219+const char *test= LIBXML_DOTTED_VERSION;
1220+ ])
1221+ ],[
1222+ ac_cv_libxml2="no"
1223+ ])
1224+
1225+ AS_IF([test "${ac_cv_libxml2}" = "no" -a "${ac_enable_libxml2}" = "yes"],[
1226+
1227+ PKG_CHECK_MODULES([LIBXML2], [libxml-2.0], [
1228+ ac_cv_libxml2=yes
1229+ LTLIBXML2=${LIBXML2_LIBS}
1230+ LIBXML2=${LIBXML2_LIBS}
1231+ ],[])
1232+ ])
1233+
1234+ AM_CONDITIONAL(HAVE_LIBXML2, [test "${ac_cv_libxml2}" = "yes"])
1235+])
1236+
1237+AC_DEFUN([PANDORA_HAVE_LIBXML2],[
1238+ AC_REQUIRE([_PANDORA_SEARCH_LIBXML2])
1239+])
1240+
1241+AC_DEFUN([PANDORA_REQUIRE_LIBXML2],[
1242+ AC_REQUIRE([_PANDORA_SEARCH_LIBXML2])
1243+ AS_IF([test "x${ac_cv_libxml2}" = "xno"],
1244+ AC_MSG_ERROR([libxml2 is required for ${PACKAGE}. On Debian systems this is found in libxml2-dev. On RedHat, libxml2-devel.]))
1245+])
1246
1247=== added file 'm4/pandora_have_libz.m4'
1248--- m4/pandora_have_libz.m4 1970-01-01 00:00:00 +0000
1249+++ m4/pandora_have_libz.m4 2009-12-05 23:40:29 +0000
1250@@ -0,0 +1,51 @@
1251+dnl Copyright (C) 2009 Sun Microsystems
1252+dnl This file is free software; Sun Microsystems
1253+dnl gives unlimited permission to copy and/or distribute it,
1254+dnl with or without modifications, as long as this notice is preserved.
1255+
1256+#--------------------------------------------------------------------
1257+# Check for libz
1258+#--------------------------------------------------------------------
1259+
1260+
1261+AC_DEFUN([_PANDORA_SEARCH_LIBZ],[
1262+ AC_REQUIRE([AC_LIB_PREFIX])
1263+
1264+ AC_LIB_HAVE_LINKFLAGS(z,,
1265+ [
1266+ #include <zlib.h>
1267+ ],[
1268+ crc32(0, Z_NULL, 0);
1269+ ])
1270+
1271+ AM_CONDITIONAL(HAVE_LIBZ, [test "x${ac_cv_libz}" = "xyes"])
1272+])
1273+
1274+AC_DEFUN([_PANDORA_HAVE_LIBZ],[
1275+
1276+ AC_ARG_ENABLE([libz],
1277+ [AS_HELP_STRING([--disable-libz],
1278+ [Build with libz support @<:@default=on@:>@])],
1279+ [ac_enable_libz="$enableval"],
1280+ [ac_enable_libz="yes"])
1281+
1282+ _PANDORA_SEARCH_LIBZ
1283+])
1284+
1285+
1286+AC_DEFUN([PANDORA_HAVE_LIBZ],[
1287+ AC_REQUIRE([_PANDORA_HAVE_LIBZ])
1288+])
1289+
1290+AC_DEFUN([_PANDORA_REQUIRE_LIBZ],[
1291+ ac_enable_libz="yes"
1292+ _PANDORA_SEARCH_LIBZ
1293+
1294+ AS_IF([test x$ac_cv_libz = xno],[
1295+ AC_MSG_ERROR([libz is required for ${PACKAGE}. On Debian this can be found in zlib1g-dev. On RedHat this can be found in zlib-devel.])
1296+ ])
1297+])
1298+
1299+AC_DEFUN([PANDORA_REQUIRE_LIBZ],[
1300+ AC_REQUIRE([_PANDORA_REQUIRE_LIBZ])
1301+])
1302
1303=== modified file 'm4/pandora_header_assert.m4'
1304--- m4/pandora_header_assert.m4 2009-07-08 07:18:46 +0000
1305+++ m4/pandora_header_assert.m4 2009-12-05 23:40:29 +0000
1306@@ -8,6 +8,7 @@
1307 dnl Check whether to enable assertions.
1308 AC_DEFUN([PANDORA_HEADER_ASSERT],
1309 [
1310+ AC_CHECK_HEADERS(assert.h)
1311 AC_MSG_CHECKING([whether to enable assertions])
1312 AC_ARG_ENABLE([assert],
1313 [AS_HELP_STRING([--disable-assert],
1314@@ -16,8 +17,7 @@
1315 [ac_cv_assert="yes"])
1316 AC_MSG_RESULT([$ac_cv_assert])
1317
1318- AS_IF([test "$ac_cv_assert" = "yes"],
1319- [AC_CHECK_HEADERS(assert.h)],
1320+ AS_IF([test "$ac_cv_assert" = "no"],
1321 [AC_DEFINE(NDEBUG, 1, [Define to 1 if assertions should be disabled.])])
1322 ])
1323
1324
1325=== modified file 'm4/pandora_libtool.m4'
1326--- m4/pandora_libtool.m4 2009-07-08 07:18:46 +0000
1327+++ m4/pandora_libtool.m4 2009-12-05 23:40:29 +0000
1328@@ -5,6 +5,15 @@
1329
1330 AC_DEFUN([PANDORA_LIBTOOL],[
1331 AC_REQUIRE([AC_PROG_LIBTOOL])
1332+ m4_ifndef([LT_PREREQ],[
1333+ pandora_have_old_libtool=yes
1334+ ],[
1335+ pandora_have_old_libtool=no
1336+ ])
1337+ AS_IF([test "$SUNCC" = "yes" -a "${pandora_have_old_libtool}" = "yes"],[
1338+ AC_MSG_ERROR([Building ${PACKAGE} with Sun Studio requires at least libtool 2.2])
1339+ ])
1340+
1341 dnl By requiring AC_PROG_LIBTOOL, we should force the macro system to read
1342 dnl libtool.m4, where in 2.2 AC_PROG_LIBTOOL is an alias for LT_INIT
1343 dnl Then, if we're on 2.2, we should have LT_LANG, so we'll call it.
1344
1345=== modified file 'm4/pandora_plugins.m4'
1346--- m4/pandora_plugins.m4 2009-09-16 21:10:51 +0000
1347+++ m4/pandora_plugins.m4 2009-12-05 23:40:29 +0000
1348@@ -9,20 +9,32 @@
1349
1350 AC_DEFUN([PANDORA_PLUGINS],[
1351
1352- m4_sinclude(config/plugin.ac)
1353+ dnl We do this to prime the files from a fresh checkout. Normally we want
1354+ dnl these commands to be executed by make. Perhaps we should split them into
1355+ dnl a few shell script snippets in config and make Make call them... we're
1356+ dnl going to get there...
1357+ dnl ANYWAY - syscmd gets called during aclocal - so before automake. It will
1358+ dnl get called probably during autoconf too, so it's important to protect
1359+ dnl with test -f ... if the files exist, we don't have the chicken/egg
1360+ dnl problem and therefore don't need to do anything here
1361+ m4_syscmd([python config/pandora-plugin > /dev/null])
1362+ m4_syscmd([test -f config/plugin.stamp || touch config/plugin.stamp aclocal.m4])
1363+
1364+ m4_sinclude(config/pandora-plugin.ac)
1365+
1366 dnl Add code here to read set plugin lists and set drizzled_default_plugin_list
1367- AC_DEFINE_UNQUOTED([PANDORA_PLUGIN_LIST],[$pandora_default_plugin_list],
1368- [List of plugins that should be loaded on startup if no
1369- value is given for --plugin-load])
1370-
1371 pandora_builtin_list=`echo $pandora_builtin_list | sed 's/, *$//'`
1372 AS_IF([test "x$pandora_builtin_list" = "x"], pandora_builtin_list="NULL")
1373 AC_SUBST([PANDORA_BUILTIN_LIST],[$pandora_builtin_list])
1374+ AC_SUBST([PANDORA_PLUGIN_LIST],[$pandora_default_plugin_list])
1375 m4_ifval(m4_normalize([$1]),[
1376 AC_CONFIG_FILES($*)
1377 ],[
1378 AC_DEFINE_UNQUOTED([PANDORA_BUILTIN_LIST],[$pandora_builtin_list],
1379 [List of plugins to be built in])
1380+ AC_DEFINE_UNQUOTED([PANDORA_PLUGIN_LIST],["$pandora_default_plugin_list"],
1381+ [List of plugins that should be loaded on startup if no
1382+ value is given for --plugin-load])
1383 ])
1384
1385
1386
1387=== modified file 'm4/pandora_pthread.m4'
1388--- m4/pandora_pthread.m4 2009-10-07 01:12:30 +0000
1389+++ m4/pandora_pthread.m4 2009-12-05 23:40:29 +0000
1390@@ -53,6 +53,186 @@
1391 [pthread_yield function with one argument])
1392 ])
1393
1394+ AC_CHECK_FUNCS(pthread_attr_getstacksize pthread_attr_setprio \
1395+ pthread_attr_setschedparam \
1396+ pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
1397+ pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
1398+ pthread_setprio_np pthread_setschedparam pthread_sigmask \
1399+ pthread_attr_create rwlock_init
1400+)
1401+
1402+
1403+
1404+# Check definition of pthread_getspecific
1405+AC_CACHE_CHECK([args to pthread_getspecific], [pandora_cv_getspecific_args],
1406+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1407+#if !defined(_REENTRANT)
1408+#define _REENTRANT
1409+#endif
1410+#ifndef _POSIX_PTHREAD_SEMANTICS
1411+#define _POSIX_PTHREAD_SEMANTICS
1412+#endif
1413+#include <pthread.h>
1414+ ]], [[
1415+void *pthread_getspecific(pthread_key_t key);
1416+pthread_getspecific((pthread_key_t) NULL);
1417+ ]])],
1418+ [pandora_cv_getspecific_args=POSIX],
1419+ [pandora_cv_getspecific_args=other])])
1420+ if test "$pandora_cv_getspecific_args" = "other"
1421+ then
1422+ AC_DEFINE([HAVE_NONPOSIX_PTHREAD_GETSPECIFIC], [1],
1423+ [For some non posix threads])
1424+ fi
1425+
1426+ # Check definition of pthread_mutex_init
1427+ AC_CACHE_CHECK([args to pthread_mutex_init], [pandora_cv_mutex_init_args],
1428+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1429+#ifndef _REENTRANT
1430+#define _REENTRANT
1431+#endif
1432+#ifndef _POSIX_PTHREAD_SEMANTICS
1433+#define _POSIX_PTHREAD_SEMANTICS
1434+#endif
1435+#include <pthread.h> ]], [[
1436+ pthread_mutexattr_t attr;
1437+ pthread_mutex_t mp;
1438+ pthread_mutex_init(&mp,&attr); ]])],
1439+ [pandora_cv_mutex_init_args=POSIX],
1440+ [pandora_cv_mutex_init_args=other])])
1441+ if test "$pandora_cv_mutex_init_args" = "other"
1442+ then
1443+ AC_DEFINE([HAVE_NONPOSIX_PTHREAD_MUTEX_INIT], [1],
1444+ [For some non posix threads])
1445+ fi
1446+#---END:
1447+
1448+#---START: Used in for client configure
1449+# Check definition of readdir_r
1450+AC_CACHE_CHECK([args to readdir_r], [pandora_cv_readdir_r],
1451+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1452+#ifndef _REENTRANT
1453+#define _REENTRANT
1454+#endif
1455+#ifndef _POSIX_PTHREAD_SEMANTICS
1456+#define _POSIX_PTHREAD_SEMANTICS
1457+#endif
1458+#include <pthread.h>
1459+#include <dirent.h>]], [[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
1460+readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ]])],
1461+ [pandora_cv_readdir_r=POSIX],
1462+ [pandora_cv_readdir_r=other])])
1463+if test "$pandora_cv_readdir_r" = "POSIX"
1464+then
1465+ AC_DEFINE([HAVE_READDIR_R], [1], [POSIX readdir_r])
1466+fi
1467+
1468+# Check definition of posix sigwait()
1469+AC_CACHE_CHECK([style of sigwait], [pandora_cv_sigwait],
1470+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1471+#ifndef _REENTRANT
1472+#define _REENTRANT
1473+#endif
1474+#ifndef _POSIX_PTHREAD_SEMANTICS
1475+#define _POSIX_PTHREAD_SEMANTICS
1476+#endif
1477+#include <pthread.h>
1478+#include <signal.h>
1479+ ]], [[
1480+#ifndef _AIX
1481+sigset_t set;
1482+int sig;
1483+sigwait(&set,&sig);
1484+#endif
1485+ ]])],
1486+ [pandora_cv_sigwait=POSIX],
1487+ [pandora_cv_sigwait=other])])
1488+if test "$pandora_cv_sigwait" = "POSIX"
1489+then
1490+ AC_DEFINE([HAVE_SIGWAIT], [1], [POSIX sigwait])
1491+fi
1492+
1493+if test "$pandora_cv_sigwait" != "POSIX"
1494+then
1495+unset pandora_cv_sigwait
1496+# Check definition of posix sigwait()
1497+AC_CACHE_CHECK([style of sigwait], [pandora_cv_sigwait],
1498+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1499+#ifndef _REENTRANT
1500+#define _REENTRANT
1501+#endif
1502+#ifndef _POSIX_PTHREAD_SEMANTICS
1503+#define _POSIX_PTHREAD_SEMANTICS
1504+#endif
1505+#include <pthread.h>
1506+#include <signal.h>
1507+ ]], [[
1508+sigset_t set;
1509+int sig;
1510+sigwait(&set);
1511+ ]])],
1512+ [pandora_cv_sigwait=NONPOSIX],
1513+ [pandora_cv_sigwait=other])])
1514+if test "$pandora_cv_sigwait" = "NONPOSIX"
1515+then
1516+ AC_DEFINE([HAVE_NONPOSIX_SIGWAIT], [1], [sigwait with one argument])
1517+fi
1518+fi
1519+#---END:
1520+
1521+# Check if pthread_attr_setscope() exists
1522+AC_CACHE_CHECK([for pthread_attr_setscope], [pandora_cv_pthread_attr_setscope],
1523+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1524+#ifndef _REENTRANT
1525+#define _REENTRANT
1526+#endif
1527+#ifndef _POSIX_PTHREAD_SEMANTICS
1528+#define _POSIX_PTHREAD_SEMANTICS
1529+#endif
1530+#include <pthread.h>
1531+ ]], [[
1532+pthread_attr_t thr_attr;
1533+pthread_attr_setscope(&thr_attr,0);
1534+ ]])],
1535+ [pandora_cv_pthread_attr_setscope=yes],
1536+ [pandora_cv_pthread_attr_setscope=no])])
1537+if test "$pandora_cv_pthread_attr_setscope" = "yes"
1538+then
1539+ AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope])
1540+fi
1541+
1542+
1543+AC_CACHE_CHECK([if pthread_yield takes zero arguments], ac_cv_pthread_yield_zero_arg,
1544+[AC_TRY_LINK([#define _GNU_SOURCE
1545+#include <pthread.h>
1546+#ifdef __cplusplus
1547+extern "C"
1548+#endif
1549+],
1550+[
1551+ pthread_yield();
1552+], ac_cv_pthread_yield_zero_arg=yes, ac_cv_pthread_yield_zero_arg=yeso)])
1553+if test "$ac_cv_pthread_yield_zero_arg" = "yes"
1554+then
1555+ AC_DEFINE([HAVE_PTHREAD_YIELD_ZERO_ARG], [1],
1556+ [pthread_yield that doesn't take any arguments])
1557+fi
1558+AC_CACHE_CHECK([if pthread_yield takes 1 argument], ac_cv_pthread_yield_one_arg,
1559+[AC_TRY_LINK([#define _GNU_SOURCE
1560+#include <pthread.h>
1561+#ifdef __cplusplus
1562+extern "C"
1563+#endif
1564+],
1565+[
1566+ pthread_yield(0);
1567+], ac_cv_pthread_yield_one_arg=yes, ac_cv_pthread_yield_one_arg=no)])
1568+if test "$ac_cv_pthread_yield_one_arg" = "yes"
1569+then
1570+ AC_DEFINE([HAVE_PTHREAD_YIELD_ONE_ARG], [1],
1571+ [pthread_yield function with one argument])
1572+fi
1573+
1574 CFLAGS="${save_CFLAGS}"
1575 CXXFLAGS="${save_CXXFLAGS}"
1576 ])
1577
1578=== added file 'm4/pandora_run_cpplint.m4'
1579--- m4/pandora_run_cpplint.m4 1970-01-01 00:00:00 +0000
1580+++ m4/pandora_run_cpplint.m4 2009-12-05 23:40:29 +0000
1581@@ -0,0 +1,8 @@
1582+dnl Copyright (C) 2009 Sun Microsystems
1583+dnl This file is free software; Sun Microsystems
1584+dnl gives unlimited permission to copy and/or distribute it,
1585+dnl with or without modifications, as long as this notice is preserved.
1586+
1587+AC_DEFUN([PANDORA_RUN_CPPLINT],[
1588+ m4_syscmd([python config/make-lint.py])
1589+])
1590
1591=== added file 'm4/pandora_sasl.m4'
1592--- m4/pandora_sasl.m4 1970-01-01 00:00:00 +0000
1593+++ m4/pandora_sasl.m4 2009-12-05 23:40:29 +0000
1594@@ -0,0 +1,133 @@
1595+dnl Copyright (C) 2009 Sun Microsystems
1596+dnl This file is free software; Sun Microsystems
1597+dnl gives unlimited permission to copy and/or distribute it,
1598+dnl with or without modifications, as long as this notice is preserved.
1599+
1600+AC_DEFUN([_PANDORA_SEARCH_SASL],[
1601+ AC_REQUIRE([AC_LIB_PREFIX])
1602+
1603+ dnl --------------------------------------------------------------------
1604+ dnl Check for sasl
1605+ dnl --------------------------------------------------------------------
1606+ AC_ARG_ENABLE([sasl],
1607+ [AS_HELP_STRING([--disable-sasl],
1608+ [Build with sasl support @<:@default=on@:>@])],
1609+ [ac_enable_sasl="$enableval"],
1610+ [ac_enable_sasl="yes"])
1611+
1612+ AS_IF([test "x$ac_enable_sasl" = "xyes"],
1613+ [
1614+ AC_LIB_HAVE_LINKFLAGS(sasl,,[
1615+ #include <stdlib.h>
1616+ #include <sasl/sasl.h>
1617+ ],[
1618+ sasl_server_init(NULL, NULL);
1619+ ])
1620+
1621+ AS_IF([test "x${ac_cv_libsasl}" != "xyes" ],
1622+ [
1623+ AC_LIB_HAVE_LINKFLAGS(sasl2,,[
1624+ #include <stdlib.h>
1625+ #include <sasl/sasl.h>
1626+ ],[
1627+ sasl_server_init(NULL, NULL);
1628+ ])
1629+ HAVE_LIBSASL="$HAVE_LIBSASL2"
1630+ LIBSASL="$LIBSASL2"
1631+ LIBSASL_PREFIX="$LIBSASL2_PREFIX"
1632+ LTLIBSASL="$LT_LIBSASL2"
1633+ ])
1634+ ])
1635+
1636+ AS_IF([test "x${ac_cv_libsasl}" = "xyes" -o "x${ac_cv_libsasl2}" = "xyes"],
1637+ [ac_cv_sasl=yes],
1638+ [ac_cv_sasl=no])
1639+
1640+ AM_CONDITIONAL(HAVE_LIBSASL, [test "x${ac_cv_libsasl}" = "xyes"])
1641+ AM_CONDITIONAL(HAVE_LIBSASL2, [test "x${ac_cv_libsasl2}" = "xyes"])
1642+ AM_CONDITIONAL(HAVE_SASL, [test "x${ac_cv_sasl}" = "xyes"])
1643+])
1644+
1645+AC_DEFUN([PANDORA_HAVE_SASL],[
1646+ AC_REQUIRE([_PANDORA_SEARCH_SASL])
1647+])
1648+
1649+AC_DEFUN([PANDORA_REQUIRE_SASL],[
1650+ AC_REQUIRE([_PANDORA_SEARCH_SASL])
1651+ AS_IF([test "x${ac_cv_sasl}" = "xno"],
1652+ AC_MSG_ERROR([SASL (libsasl or libsasl2) is required for ${PACKAGE}]))
1653+])
1654+
1655+AC_DEFUN([_PANDORA_SEARCH_LIBSASL],[
1656+ AC_REQUIRE([AC_LIB_PREFIX])
1657+
1658+ dnl --------------------------------------------------------------------
1659+ dnl Check for libsasl
1660+ dnl --------------------------------------------------------------------
1661+
1662+ AC_ARG_ENABLE([libsasl],
1663+ [AS_HELP_STRING([--disable-libsasl],
1664+ [Build with libsasl support @<:@default=on@:>@])],
1665+ [ac_enable_libsasl="$enableval"],
1666+ [ac_enable_libsasl="yes"])
1667+
1668+ AS_IF([test "x$ac_enable_libsasl" = "xyes"],[
1669+ AC_LIB_HAVE_LINKFLAGS(sasl,,[
1670+ #include <stdlib.h>
1671+ #include <sasl/sasl.h>
1672+ ],[
1673+ sasl_server_init(NULL, NULL);
1674+ ])
1675+ ],[
1676+ ac_cv_libsasl="no"
1677+ ])
1678+
1679+ AM_CONDITIONAL(HAVE_LIBSASL, [test "x${ac_cv_libsasl}" = "xyes"])
1680+])
1681+
1682+AC_DEFUN([PANDORA_HAVE_LIBSASL],[
1683+ AC_REQUIRE([_PANDORA_SEARCH_LIBSASL])
1684+])
1685+
1686+AC_DEFUN([PANDORA_REQUIRE_LIBSASL],[
1687+ AC_REQUIRE([_PANDORA_SEARCH_LIBSASL])
1688+ AS_IF([test "x${ac_cv_libsasl}" = "xno"],
1689+ AC_MSG_ERROR([libsasl is required for ${PACKAGE}]))
1690+])
1691+
1692+AC_DEFUN([_PANDORA_SEARCH_LIBSASL2],[
1693+ AC_REQUIRE([AC_LIB_PREFIX])
1694+
1695+ dnl --------------------------------------------------------------------
1696+ dnl Check for libsasl2
1697+ dnl --------------------------------------------------------------------
1698+
1699+ AC_ARG_ENABLE([libsasl2],
1700+ [AS_HELP_STRING([--disable-libsasl2],
1701+ [Build with libsasl2 support @<:@default=on@:>@])],
1702+ [ac_enable_libsasl2="$enableval"],
1703+ [ac_enable_libsasl2="yes"])
1704+
1705+ AS_IF([test "x$ac_enable_libsasl2" = "xyes"],[
1706+ AC_LIB_HAVE_LINKFLAGS(sasl2,,[
1707+ #include <stdlib.h>
1708+ #include <sasl2/sasl2.h>
1709+ ],[
1710+ sasl2_server_init(NULL, NULL);
1711+ ])
1712+ ],[
1713+ ac_cv_libsasl2="no"
1714+ ])
1715+
1716+ AM_CONDITIONAL(HAVE_LIBSASL2, [test "x${ac_cv_libsasl2}" = "xyes"])
1717+])
1718+
1719+AC_DEFUN([PANDORA_HAVE_LIBSASL2],[
1720+ AC_REQUIRE([_PANDORA_SEARCH_LIBSASL2])
1721+])
1722+
1723+AC_DEFUN([PANDORA_REQUIRE_LIBSASL2],[
1724+ AC_REQUIRE([_PANDORA_SEARCH_LIBSASL2])
1725+ AS_IF([test "x${ac_cv_libsasl2}" = "xno"],
1726+ AC_MSG_ERROR([libsasl2 is required for ${PACKAGE}]))
1727+])
1728
1729=== added file 'm4/pandora_stack_direction.m4'
1730--- m4/pandora_stack_direction.m4 1970-01-01 00:00:00 +0000
1731+++ m4/pandora_stack_direction.m4 2009-12-05 23:40:29 +0000
1732@@ -0,0 +1,39 @@
1733+dnl Copyright (C) 2009 Sun Microsystems
1734+dnl This file is free software; Sun Microsystems
1735+dnl gives unlimited permission to copy and/or distribute it,
1736+dnl with or without modifications, as long as this notice is preserved.
1737+
1738+#--------------------------------------------------------------------
1739+# Check what direction the stack runs in
1740+#--------------------------------------------------------------------
1741+
1742+AC_DEFUN([PANDORA_STACK_DIRECTION],[
1743+ AC_REQUIRE([AC_FUNC_ALLOCA])
1744+ AC_CACHE_CHECK([stack direction], [ac_cv_c_stack_direction],[
1745+ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
1746+#include <stdlib.h>
1747+ int find_stack_direction ()
1748+ {
1749+ static char *addr = 0;
1750+ auto char dummy;
1751+ if (addr == 0)
1752+ {
1753+ addr = &dummy;
1754+ return find_stack_direction ();
1755+ }
1756+ else
1757+ return (&dummy > addr) ? 1 : -1;
1758+ }
1759+ ]],[[
1760+ exit (find_stack_direction() < 0);
1761+ ]])],[
1762+ ac_cv_c_stack_direction=1
1763+ ],[
1764+ ac_cv_c_stack_direction=-1
1765+ ])
1766+ ])
1767+ AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
1768+])
1769+
1770+
1771+
1772
1773=== added file 'm4/pandora_stl_hash.m4'
1774--- m4/pandora_stl_hash.m4 1970-01-01 00:00:00 +0000
1775+++ m4/pandora_stl_hash.m4 2009-12-05 23:40:29 +0000
1776@@ -0,0 +1,107 @@
1777+# We check two things: where the include file is for hash_map, and
1778+# what namespace hash_map lives in within that include file. We
1779+# include AC_COMPILE_IFELSE for all the combinations we've seen in the
1780+# wild. We define one of HAVE_HASH_MAP or HAVE_EXT_HASH_MAP depending
1781+# on location, and HASH_NAMESPACE to be the namespace hash_map is
1782+# defined in.
1783+#
1784+# Ideally we'd use AC_CACHE_CHECK, but that only lets us store one value
1785+# at a time, and we need to store two (filename and namespace).
1786+# prints messages itself, so we have to do the message-printing ourselves
1787+# via AC_MSG_CHECKING + AC_MSG_RESULT. (TODO(csilvers): can we cache?)
1788+
1789+AC_DEFUN([PANDORA_CXX_STL_HASH],
1790+ [AC_MSG_CHECKING(the location of hash_map)
1791+ AC_LANG_PUSH(C++)
1792+ ac_cv_cxx_hash_map=""
1793+ for location in "" "ext/" "tr1/" ; do
1794+ for namespace in __gnu_cxx "" std stdext; do
1795+ for classprefix in unordered hash; do
1796+ if test -z "$ac_cv_cxx_hash_map"; then
1797+ AC_COMPILE_IFELSE(
1798+ [AC_LANG_PROGRAM([[#include <${location}${classprefix}_map>]],
1799+ [[${namespace}::${classprefix}_map<int, int> t]])],
1800+ [ac_cv_cxx_hash_map="<${location}${classprefix}_map>";
1801+ ac_cv_cxx_hash_set="<${location}${classprefix}_set>";
1802+ ac_cv_cxx_hash_namespace="$namespace";
1803+ ac_cv_cxx_hash_map_class="${classprefix}_map";
1804+ ac_cv_cxx_hash_set_class="${classprefix}_set"])
1805+
1806+ fi
1807+ done
1808+ done
1809+ done
1810+
1811+ if test -n "$ac_cv_cxx_hash_map"; then
1812+ AC_DEFINE(HAVE_HASH_MAP, 1, [define if the compiler has hash_map])
1813+ AC_DEFINE(HAVE_HASH_SET, 1, [define if the compiler has hash_set])
1814+ AC_DEFINE_UNQUOTED(HASH_MAP_H,$ac_cv_cxx_hash_map,
1815+ [the location of <hash_map>])
1816+ AC_DEFINE_UNQUOTED(HASH_SET_H,$ac_cv_cxx_hash_set,
1817+ [the location of <hash_set>])
1818+ AC_DEFINE_UNQUOTED(HASH_NAMESPACE,$ac_cv_cxx_hash_namespace,
1819+ [the namespace of hash_map/hash_set])
1820+ AC_DEFINE_UNQUOTED(HASH_MAP_CLASS,$ac_cv_cxx_hash_map_class,
1821+ [the classname of hash_map])
1822+ AC_DEFINE_UNQUOTED(HASH_SET_CLASS,$ac_cv_cxx_hash_set_class,
1823+ [the classname of hash_set])
1824+ AC_MSG_RESULT([$ac_cv_cxx_hash_map])
1825+ else
1826+ AC_MSG_RESULT()
1827+ AC_MSG_WARN([could not find an STL hash_map])
1828+ fi
1829+ AC_CACHE_CHECK(
1830+ [whether hash_map has rehash method],
1831+ [ac_cv_hash_map_has_rehash],
1832+ [AC_COMPILE_IFELSE(
1833+ [AC_LANG_PROGRAM([[
1834+#include HASH_MAP_H
1835+using namespace HASH_NAMESPACE;
1836+ ]],[[
1837+HASH_MAP_CLASS<int, int> test_hash;
1838+test_hash.rehash(100);
1839+ ]])],
1840+ [ac_cv_hash_map_has_rehash=yes],
1841+ [ac_cv_hash_map_has_rehash=no])])
1842+ AS_IF([test $ac_cv_hash_map_has_rehash = yes],[
1843+ AC_DEFINE(HASH_MAP_HAS_REHASH, 1, [if hash_map<> hash rehash method])
1844+ ])
1845+ AC_CACHE_CHECK(
1846+ [whether hash_map has resize method],
1847+ [ac_cv_hash_map_has_resize],
1848+ [AC_COMPILE_IFELSE(
1849+ [AC_LANG_PROGRAM([[
1850+#include HASH_MAP_H
1851+using namespace HASH_NAMESPACE;
1852+ ]],[[
1853+HASH_MAP_CLASS<int, int> test_hash;
1854+test_hash.resize(100);
1855+ ]])],
1856+ [ac_cv_hash_map_has_resize=yes],
1857+ [ac_cv_hash_map_has_resize=no])])
1858+ AS_IF([test $ac_cv_hash_map_has_resize = yes],[
1859+ AC_DEFINE(HASH_MAP_HAS_RESIZE, 1, [if hash_map<> hash resize method])
1860+ ])
1861+ AC_CACHE_CHECK(
1862+ [whether to redefine hash<string>],
1863+ [ac_cv_redefine_hash_string],
1864+ [AC_COMPILE_IFELSE(
1865+ [AC_LANG_PROGRAM([[
1866+#include HASH_SET_H
1867+#include <string>
1868+using namespace HASH_NAMESPACE;
1869+using namespace std;
1870+ ]],[[
1871+string teststr("test");
1872+HASH_SET_CLASS<string> test_hash;
1873+HASH_SET_CLASS<string>::iterator iter= test_hash.find(teststr);
1874+if (iter != test_hash.end())
1875+ return 1;
1876+ ]])],
1877+ [ac_cv_redefine_hash_string=no],
1878+ [ac_cv_redefine_hash_string=yes])])
1879+ AS_IF([test $ac_cv_redefine_hash_string = yes],[
1880+ AC_DEFINE(REDEFINE_HASH_STRING, 1, [if hash<string> needs to be defined])
1881+ ])
1882+ AC_LANG_POP()
1883+])
1884
1885=== modified file 'm4/pandora_vc_build.m4'
1886--- m4/pandora_vc_build.m4 2009-09-16 21:10:51 +0000
1887+++ m4/pandora_vc_build.m4 2009-12-05 23:40:29 +0000
1888@@ -52,6 +52,72 @@
1889 AC_DEFINE(PEBI_PREFIX[RELEASE_VERSION], ["RELEASE_VERSION"], [$1 version number formatted for display])
1890 AC_DEFINE(PEBI_PREFIX[RELEASE_COMMENT], ["RELEASE_COMMENT"], [Set to trunk if the branch is the main $1 branch])
1891 AC_DEFINE(PEBI_PREFIX[RELEASE_ID], [RELEASE_ID], [$1 version number formatted for numerical comparison])
1892-
1893-])
1894-
1895+])
1896+
1897+AC_DEFUN([_PANDORA_READ_FROM_FILE],[
1898+ $1=`grep $1 $2 | cut -f2 -d=`
1899+])
1900+
1901+AC_DEFUN([PANDORA_VC_VERSION],[
1902+ AC_REQUIRE([PANDORA_BUILDING_FROM_VC])
1903+
1904+ PANDORA_RELEASE_DATE=`date +%Y.%m`
1905+ PANDORA_RELEASE_NODOTS_DATE=`date +%Y%m`
1906+
1907+ dnl Set some defaults
1908+ PANDORA_VC_REVNO="0"
1909+ PANDORA_VC_REVID="unknown"
1910+ PANDORA_VC_BRANCH="bzr-export"
1911+
1912+ AS_IF([test -f ${srcdir}/config/bzr_revinfo],[
1913+ _PANDORA_READ_FROM_FILE([PANDORA_VC_REVNO],${srcdir}/config/bzr_revinfo)
1914+ _PANDORA_READ_FROM_FILE([PANDORA_VC_REVID],${srcdir}/config/bzr_revinfo)
1915+ _PANDORA_READ_FROM_FILE([PANDORA_VC_BRANCH],
1916+ ${srcdir}/config/bzr_revinfo)
1917+ _PANDORA_READ_FROM_FILE([PANDORA_RELEASE_DATE],
1918+ ${srcdir}/config/bzr_revinfo)
1919+ _PANDORA_READ_FROM_FILE([PANDORA_RELEASE_NODOTS_DATE],
1920+ ${srcdir}/config/bzr_revinfo)
1921+ _PANDORA_READ_FROM_FILE([PANDORA_RELEASE_COMMENT],
1922+ ${srcdir}/config/bzr_revinfo)
1923+ ])
1924+ AS_IF([test "${ac_cv_building_from_bzr}" = "yes"],[
1925+dnl echo "Grabbing changelog and version information from bzr"
1926+dnl bzr log --short > ChangeLog || touch ChangeLog
1927+ PANDORA_BZR_REVNO=`bzr revno`
1928+ AS_IF([test "x$PANDORA_BZR_REVNO" != "${PANDORA_VC_REVNO}"],[
1929+ PANDORA_VC_REVNO="${PANDORA_BZR_REVNO}"
1930+ PANDORA_VC_REVID=`bzr log -r-1 --show-ids | grep revision-id | awk '{print $[]2}' | head -1`
1931+ PANDORA_VC_BRANCH=`bzr nick`
1932+ AS_IF([test "x${PANDORA_VC_BRANCH}" != "${PACKAGE}"],[
1933+ PANDORA_RELEASE_COMMENT="${PANDORA_VC_BRANCH}"
1934+ ],[
1935+ PANDORA_RELEASE_COMMENT="trunk"
1936+ ])
1937+ ])
1938+ ])
1939+ AS_IF([! test -d config],[mkdir -p config])
1940+ cat > "config/bzr_revinfo" <<EOF
1941+PANDORA_VC_REVNO=${PANDORA_VC_REVNO}
1942+PANDORA_VC_REVID=${PANDORA_VC_REVID}
1943+PANDORA_VC_BRANCH=${PANDORA_VC_BRANCH}
1944+PANDORA_RELEASE_DATE=${PANDORA_RELEASE_DATE}
1945+PANDORA_RELEASE_NODOTS_DATE=${PANDORA_RELEASE_NODOTS_DATE}
1946+PANDORA_RELEASE_COMMENT=${PANDORA_RELEASE_COMMENT}
1947+EOF
1948+
1949+ PANDORA_RELEASE_VERSION="${PANDORA_RELEASE_DATE}.${PANDORA_VC_REVNO}"
1950+ PANDORA_RELEASE_ID="${PANDORA_RELEASE_NODOTS_DATE}${PANDORA_VC_REVNO}"
1951+
1952+ VERSION="${PANDORA_RELEASE_VERSION}"
1953+ AC_DEFINE_UNQUOTED([PANDORA_RELEASE_VERSION],["${PANDORA_RELEASE_VERSION}"],
1954+ [The real version of the software])
1955+ AC_SUBST(PANDORA_VC_REVNO)
1956+ AC_SUBST(PANDORA_VC_REVID)
1957+ AC_SUBST(PANDORA_VC_BRANCH)
1958+ AC_SUBST(PANDORA_RELEASE_DATE)
1959+ AC_SUBST(PANDORA_RELEASE_NODOTS_DATE)
1960+ AC_SUBST(PANDORA_RELEASE_COMMENT)
1961+ AC_SUBST(PANDORA_RELEASE_VERSION)
1962+ AC_SUBST(PANDORA_RELEASE_ID)
1963+])
1964
1965=== added file 'm4/pandora_version.m4'
1966--- m4/pandora_version.m4 1970-01-01 00:00:00 +0000
1967+++ m4/pandora_version.m4 2009-12-05 23:40:29 +0000
1968@@ -0,0 +1,11 @@
1969+dnl Copyright (C) 2009 Sun Microsystems
1970+dnl This file is free software; Sun Microsystems
1971+dnl gives unlimited permission to copy and/or distribute it,
1972+dnl with or without modifications, as long as this notice is preserved.
1973+
1974+AC_DEFUN([PANDORA_VERSION],[
1975+
1976+ PANDORA_HEX_VERSION=`echo $VERSION | sed 's|[\-a-z0-9]*$||' | \
1977+ awk -F. '{printf "0x%0.2d%0.3d%0.3d", $[]1, $[]2, $[]3}'`
1978+ AC_SUBST([PANDORA_HEX_VERSION])
1979+])
1980
1981=== modified file 'm4/pandora_warnings.m4'
1982--- m4/pandora_warnings.m4 2009-09-16 21:10:51 +0000
1983+++ m4/pandora_warnings.m4 2009-12-05 23:40:29 +0000
1984@@ -129,9 +129,9 @@
1985
1986 AS_IF([test "$INTELCC" = "yes"],[
1987 m4_if(PW_LESS_WARNINGS,[no],[
1988- BASE_WARNINGS="-w1 -Wall -Werror -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual"
1989+ BASE_WARNINGS="-w1 -Werror -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual"
1990 ],[
1991- BASE_WARNINGS="-w1 -Wall -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 981"
1992+ BASE_WARNINGS="-w1 -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 981"
1993 ])
1994 CC_WARNINGS="${BASE_WARNINGS}"
1995 CXX_WARNINGS="${BASE_WARNINGS}"
1996@@ -147,7 +147,25 @@
1997 AS_IF([test "${ac_cv_assert}" = "no"],
1998 [NO_UNUSED="-Wno-unused-variable -Wno-unused-parameter"])
1999
2000- BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wextra -Wundef -Wshadow ${NO_UNUSED} ${F_DIAGNOSTICS_SHOW_OPTION} ${CFLAG_VISIBILITY} ${BASE_WARNINGS_FULL}"
2001+ AC_CACHE_CHECK([whether it is safe to use -Wextra],
2002+ [ac_cv_safe_to_use_Wextra_],
2003+ [save_CFLAGS="$CFLAGS"
2004+ CFLAGS="${W_FAIL} -pedantic -Wextra ${AM_CFLAGS} ${CFLAGS}"
2005+ AC_COMPILE_IFELSE([
2006+ AC_LANG_PROGRAM(
2007+ [[
2008+#include <stdio.h>
2009+ ]], [[]])
2010+ ],
2011+ [ac_cv_safe_to_use_Wextra_=yes],
2012+ [ac_cv_safe_to_use_Wextra_=no])
2013+ CFLAGS="$save_CFLAGS"])
2014+
2015+ BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wundef -Wshadow ${NO_UNUSED} ${F_DIAGNOSTICS_SHOW_OPTION} ${CFLAG_VISIBILITY} ${BASE_WARNINGS_FULL}"
2016+ AS_IF([test "$ac_cv_safe_to_use_Wextra_" = "yes"],
2017+ [BASE_WARNINGS="${BASE_WARNINGS} -Wextra"],
2018+ [BASE_WARNINGS="${BASE_WARNINGS} -W"])
2019+
2020 CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}"
2021 CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long ${CXX_WARNINGS_FULL}"
2022
2023@@ -240,13 +258,31 @@
2024 [ac_cv_safe_to_use_Wattributes_=no])
2025 CXXFLAGS="${save_CXXFLAGS}"
2026 AC_LANG_POP()])
2027- AS_IF([test "$ac_cv_safe_to_use_Wattributes_" = "yes"],
2028- [],
2029- [CXX_WARNINGS="${CXX_WARNINGS} -Wno-attributes"])
2030+ AC_CACHE_CHECK([whether it is safe to use -Wno-attributes],
2031+ [ac_cv_safe_to_use_Wno_attributes_],
2032+ [save_CFLAGS="$CFLAGS"
2033+ CFLAGS="${W_FAIL} -pedantic -Wno_attributes_ ${AM_CFLAGS} ${CFLAGS}"
2034+ AC_COMPILE_IFELSE([
2035+ AC_LANG_PROGRAM(
2036+ [[
2037+#include <stdio.h>
2038+ ]], [[]])
2039+ ],
2040+ [ac_cv_safe_to_use_Wno_attributes_=yes],
2041+ [ac_cv_safe_to_use_Wno_attributes_=no])
2042+ CFLAGS="$save_CFLAGS"])
2043+
2044+ dnl GCC 3.4 doesn't have -Wno-attributes, so we can't turn them off
2045+ dnl by using that.
2046+ AS_IF([test "$ac_cv_safe_to_use_Wattributes_" != "yes"],[
2047+ AS_IF([test "$ac_cv_safe_to_use_Wno_attributes_" = "yes"],[
2048+ CC_WARNINGS="${CC_WARNINGS} -Wno-attributes"
2049+ NO_ATTRIBUTES="-Wno-attributes"])])
2050+
2051
2052 NO_REDUNDANT_DECLS="-Wno-redundant-decls"
2053 dnl TODO: Figure out a better way to deal with this:
2054- PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow -Wno-missing-braces -Wno-attributes"
2055+ PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow -Wno-missing-braces ${NO_ATTRIBUTES}"
2056 NO_WERROR="-Wno-error"
2057 INNOBASE_SKIP_WARNINGS="-Wno-shadow -Wno-cast-align"
2058
2059
2060=== added file 'm4/pandora_with_gettext.m4'
2061--- m4/pandora_with_gettext.m4 1970-01-01 00:00:00 +0000
2062+++ m4/pandora_with_gettext.m4 2009-12-05 23:40:29 +0000
2063@@ -0,0 +1,41 @@
2064+dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2065+dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
2066+dnl
2067+dnl pandora-build: A pedantic build system
2068+dnl Copyright (C) 2009 Sun Microsystems, Inc.
2069+dnl This file is free software; Sun Microsystems
2070+dnl gives unlimited permission to copy and/or distribute it,
2071+dnl with or without modifications, as long as this notice is preserved.
2072+dnl
2073+dnl From Monty Taylor
2074+
2075+AC_DEFUN([PANDORA_WITH_GETTEXT],[
2076+
2077+ m4_syscmd([if test -d po ; then
2078+ echo "# This file is auto-generated from configure. Do not edit directly" > po/POTFILES.in.stamp
2079+ PACKAGE=`grep ^AC_INIT configure.ac | cut -f2-3 -d[ | cut -f1 -d]`
2080+ for f in `find . | grep -v "${PACKAGE}-" | egrep '\.(cc|c|h|yy)$' | cut -c3- | sort`
2081+ do
2082+ if grep gettext.h "$f" | grep include >/dev/null 2>&1
2083+ then
2084+ echo "$f" >> po/POTFILES.in.stamp
2085+ fi
2086+ done
2087+ if diff po/POTFILES.in.stamp po/POTFILES.in >/dev/null 2>&1
2088+ then
2089+ rm po/POTFILES.in.stamp
2090+ else
2091+ mv po/POTFILES.in.stamp po/POTFILES.in
2092+ fi
2093+ fi])
2094+
2095+ AM_GNU_GETTEXT(external, need-formatstring-macros)
2096+ AM_GNU_GETTEXT_VERSION([0.17])
2097+ AS_IF([test "x$MSGMERGE" = "x" -o "x$MSGMERGE" = "x:"],[
2098+ AM_PATH_PROG_WITH_TEST(GMSGMERGE, gmsgmerge,
2099+ [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
2100+ MSGMERGE="${GMSGMERGE}"
2101+ ])
2102+ AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
2103+
2104+])
2105
2106=== modified file 'm4/pandora_with_memcached.m4'
2107--- m4/pandora_with_memcached.m4 2009-07-18 22:25:59 +0000
2108+++ m4/pandora_with_memcached.m4 2009-12-05 23:40:29 +0000
2109@@ -3,7 +3,7 @@
2110 dnl gives unlimited permission to copy and/or distribute it,
2111 dnl with or without modifications, as long as this notice is preserved.
2112
2113-AC_DEFUN([PANDORA_WITH_MEMCACHED],[
2114+AC_DEFUN([_PANDORA_SEARCH_MEMCACHED],[
2115
2116 AC_ARG_WITH([memcached],
2117 [AS_HELP_STRING([--with-memcached],
2118@@ -13,21 +13,28 @@
2119
2120 # just ignore the user if --without-memcached is passed.. it is
2121 # only used by make test
2122- AS_IF([test "x$withval" = "xno"],[
2123+ AS_IF([test "x$ac_cv_with_memcached" = "xno"],[
2124 ac_cv_with_memcached=memcached
2125 MEMCACHED_BINARY=memcached
2126 ],[
2127- AS_IF([test -f "$withval"],[
2128- ac_cv_with_memcached=$withval
2129- MEMCACHED_BINARY=$withval
2130+ AS_IF([test -f "$ac_cv_with_memcached"],[
2131+ MEMCACHED_BINARY=$ac_cv_with_memcached
2132 ],[
2133 AC_PATH_PROG([MEMCACHED_BINARY], [$ac_cv_with_memcached], "no")
2134- AS_IF([test "x$MEMCACHED_BINARY" = "xno"],[
2135- AC_MSG_ERROR(["could not find memcached binary"])
2136- ])
2137 ])
2138 ])
2139 AC_DEFINE_UNQUOTED([MEMCACHED_BINARY], "$MEMCACHED_BINARY",
2140 [Name of the memcached binary used in make test])
2141-
2142-])
2143+])
2144+
2145+AC_DEFUN([PANDORA_HAVE_MEMCACHED],[
2146+ AC_REQUIRE([_PANDORA_SEARCH_MEMCACHED])
2147+])
2148+
2149+AC_DEFUN([PANDORA_REQUIRE_MEMCACHED],[
2150+ AC_REQUIRE([PANDORA_HAVE_MEMCACHED])
2151+ AS_IF([test "x$MEMCACHED_BINARY" = "xno"],[
2152+ AC_MSG_ERROR(["could not find memcached binary"])
2153+ ])
2154+])
2155+

Subscribers

People subscribed via source and target branches