Merge lp:~eday/gearmand/fixes into lp:gearmand/1.0

Proposed by Eric Day
Status: Merged
Merged at revision: not available
Proposed branch: lp:~eday/gearmand/fixes
Merge into: lp:gearmand/1.0
Diff against target: 3218 lines (+2092/-355)
60 files modified
ChangeLog (+5/-0)
Makefile.am (+32/-17)
benchmark/include.am (+22/-13)
bin/include.am (+12/-6)
config/autorun.sh (+0/-6)
configure.ac (+4/-61)
examples/include.am (+37/-25)
gearmand/include.am (+17/-12)
libgearman-server/gearmand.c (+5/-2)
libgearman-server/gearmand_con.c (+8/-3)
libgearman-server/gearmand_thread.c (+2/-1)
libgearman-server/include.am (+62/-60)
libgearman-server/libgearman-server.ver (+0/-1)
libgearman/client.c (+7/-2)
libgearman/include.am (+38/-36)
libgearman/libgearman.ver (+0/-1)
m4/pandora_canonical.m4 (+83/-10)
m4/pandora_check_cxx_standard.m4 (+9/-2)
m4/pandora_cinttypes.m4 (+34/-0)
m4/pandora_cstdint.m4 (+33/-0)
m4/pandora_cxx_demangle.m4 (+27/-0)
m4/pandora_drizzle_build.m4 (+98/-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 (+10/-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_shared_ptr.m4 (+3/-0)
m4/pandora_stack_direction.m4 (+39/-0)
m4/pandora_stl_hash.m4 (+110/-0)
m4/pandora_vc_build.m4 (+69/-3)
m4/pandora_version.m4 (+11/-0)
m4/pandora_warnings.m4 (+12/-5)
m4/pandora_with_gettext.m4 (+41/-0)
m4/pandora_with_memcached.m4 (+17/-10)
scripts/Makefile.am (+0/-8)
support/Makefile.am (+0/-11)
tests/client_test.c (+30/-1)
tests/client_test.rec (+1/-0)
tests/include.am (+65/-48)
tests/memcached_test.c (+4/-0)
tests/sqlite_test.c (+5/-1)
tests/test_gearmand.c (+4/-0)
tests/worker_test.c (+4/-0)
To merge this branch: bzr merge lp:~eday/gearmand/fixes
Reviewer Review Type Date Requested Status
Gearman-developers Pending
Review via email: mp+16367@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2009-11-30 22:08:50 +0000
3+++ ChangeLog 2009-12-18 22:04:13 +0000
4@@ -1,3 +1,8 @@
5+0.12 - 2010-01-??
6+ * Fixed job handle comparison bug with WORK_FAIL responses.
7+ * Fixed disable assert configure option.
8+ * Build system updates.
9+
10 0.11 - 2009-11-30
11 * Added max wakeup-worker option to gearmand. Default is still to wakeup all.
12 * API and documentation cleanup.
13
14=== modified file 'Makefile.am'
15--- Makefile.am 2009-09-24 23:43:15 +0000
16+++ Makefile.am 2009-12-18 22:04:13 +0000
17@@ -7,25 +7,42 @@
18
19 ACLOCAL_AMFLAGS= -I m4
20
21-SUBDIRS = \
22- libgearman \
23- libgearman-server \
24- gearmand \
25- bin \
26- examples \
27- scripts \
28- support \
29- benchmark \
30- tests
31-
32-include $(top_srcdir)/docs/man_list
33-
34-EXTRA_DIST= \
35+bin_PROGRAMS =
36+sbin_PROGRAMS =
37+check_PROGRAMS =
38+noinst_PROGRAMS =
39+lib_LTLIBRARIES =
40+noinst_LTLIBRARIES =
41+nobase_pkginclude_HEADERS =
42+noinst_HEADERS =
43+EXTRA_DIST =
44+CLEANFILES =
45+
46+
47+include benchmark/include.am
48+include bin/include.am
49+include examples/include.am
50+include gearmand/include.am
51+include libgearman/include.am
52+include libgearman-server/include.am
53+include tests/include.am
54+
55+include docs/man_list
56+
57+EXTRA_DIST+= \
58 docs/Doxyfile.api \
59 docs/Doxyfile.dev \
60 docs/api_header.html \
61 docs/dev_header.html \
62- docs/doxygen.h
63+ docs/doxygen.h \
64+ scripts/gearmand-init \
65+ scripts/gearmand.xml \
66+ scripts/gearmand \
67+ scripts/README.solaris \
68+ support/gearmand.spec
69+
70+pkgconfigdir = $(libdir)/pkgconfig
71+pkgconfig_DATA = support/gearmand.pc
72
73 docs: all
74 ${DOXYGEN} docs/Doxyfile.api
75@@ -33,8 +50,6 @@
76
77 test: check
78
79-valgrind:
80- (cd tests; ${MAKE} valgrind)
81
82 rpm: all dist
83 cp gearmand-$(VERSION).tar.gz ~/rpmbuild/SOURCES/
84
85=== renamed file 'benchmark/Makefile.am' => 'benchmark/include.am'
86--- benchmark/Makefile.am 2009-04-01 01:49:18 +0000
87+++ benchmark/include.am 2009-12-18 22:04:13 +0000
88@@ -1,19 +1,28 @@
89+# vim:ft=automake
90 # Gearman server and library
91 # Copyright (C) 2008 Brian Aker, Eric Day
92+# Copyright (C) 2009 Brian Aker, Eric Day, Monty Taylor
93 # All rights reserved.
94 #
95 # Use and distribution licensed under the BSD license. See
96 # the COPYING file in the parent directory for full text.
97-
98-LDADD= $(LTLIBUUID) $(LTLIBEVENT) $(top_builddir)/libgearman/libgearman.la
99-
100-noinst_PROGRAMS= \
101- blobslap_client \
102- blobslap_worker
103-
104-noinst_HEADERS= \
105- benchmark.h
106-
107-blobslap_client_SOURCES= blobslap_client.c benchmark.c
108-
109-blobslap_worker_SOURCES= blobslap_worker.c benchmark.c
110+#
111+# Included from Top Level Makefile.am
112+# All paths should be given relative to the root
113+
114+
115+noinst_PROGRAMS+= \
116+ benchmark/blobslap_client \
117+ benchmark/blobslap_worker
118+
119+noinst_HEADERS+= \
120+ benchmark/benchmark.h
121+
122+noinst_LTLIBRARIES+= benchmark/libbenchmark.la
123+benchmark_libbenchmark_la_SOURCES= benchmark/benchmark.c
124+
125+benchmark_blobslap_client_SOURCES= benchmark/blobslap_client.c
126+benchmark_blobslap_client_LDADD= benchmark/libbenchmark.la libgearman/libgearman.la
127+
128+benchmark_blobslap_worker_SOURCES= benchmark/blobslap_worker.c
129+benchmark_blobslap_worker_LDADD= benchmark/libbenchmark.la libgearman/libgearman.la
130
131=== renamed file 'bin/Makefile.am' => 'bin/include.am'
132--- bin/Makefile.am 2009-07-14 21:46:14 +0000
133+++ bin/include.am 2009-12-18 22:04:13 +0000
134@@ -1,12 +1,18 @@
135+# vim:ft=automake
136 # Gearman server and library
137 # Copyright (C) 2008 Brian Aker, Eric Day
138+# Copyright (C) 2009 Brian Aker, Eric Day, Monty Taylor
139 # All rights reserved.
140 #
141 # Use and distribution licensed under the BSD license. See
142 # the COPYING file in the parent directory for full text.
143-
144-bin_PROGRAMS= \
145- gearman
146-
147-gearman_SOURCES= gearman.c
148-gearman_LDADD= $(top_builddir)/libgearman/libgearman.la ${BETTER_MALLOC_LIBS}
149+#
150+# Included from Top Level Makefile.am
151+# All paths should be given relative to the root
152+
153+
154+bin_PROGRAMS+= \
155+ bin/gearman
156+
157+bin_gearman_SOURCES= bin/gearman.c
158+bin_gearman_LDADD= libgearman/libgearman.la ${BETTER_MALLOC_LIBS}
159
160=== modified file 'config/autorun.sh'
161--- config/autorun.sh 2009-09-29 04:30:01 +0000
162+++ config/autorun.sh 2009-12-18 22:04:13 +0000
163@@ -68,12 +68,6 @@
164 . config/pre_hook.sh
165 fi
166
167-# We need to some file here for the m4_sinclude, even if it's just empty
168-if test ! -f config/plugin.ac
169-then
170- touch config/plugin.ac
171-fi
172-
173 # Try to detect the supported binaries if the user didn't
174 # override that by pushing the environment variable
175 if test x$LIBTOOLIZE = x; then
176
177=== modified file 'configure.ac'
178--- configure.ac 2009-12-02 05:22:18 +0000
179+++ configure.ac 2009-12-18 22:04:13 +0000
180@@ -43,65 +43,17 @@
181 # or changed
182 AC_SUBST(GEARMAN_SERVER_LIBRARY_VERSION)
183
184-# lib versioning when linked with GNU ld.
185-AS_IF([test "$lt_cv_prog_gnu_ld" = "yes"],[
186- LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libgearman/libgearman.ver"
187- LD_VERSION_SCRIPT_SERVER="-Wl,--version-script=\$(top_srcdir)/libgearman-server/libgearman-server.ver"
188-])
189-AC_SUBST(LD_VERSION_SCRIPT)
190-AC_SUBST(LD_VERSION_SCRIPT_SERVER)
191
192 PANDORA_REQUIRE_PTHREAD
193-
194-#--------------------------------------------------------------------
195-# Check for libevent
196-#--------------------------------------------------------------------
197-
198-AC_LIB_HAVE_LINKFLAGS(event,,
199-[
200-#include <sys/types.h>
201-#include <sys/time.h>
202-#include <stdlib.h>
203-#include <event.h>
204-],[
205- struct bufferevent bev;
206- bufferevent_settimeout(&bev, 1, 1);
207- event_init();
208- event_loop(EVLOOP_ONCE);
209-])
210-AS_IF([test x$ac_cv_libevent = xno],
211- AC_MSG_ERROR([A recent version of libevent is required to build gearmand. On Debian this can be found in libevent-dev. On RedHat its in libevent-devel. You can also install the latest from source at http://www.monkey.org/~provos/libevent.]))
212-
213-
214-save_LIBS="${LIBS}"
215-LIBS="${LIBS} ${LTLIBEVENT}"
216-AC_CHECK_FUNCS(event_base_new)
217-AC_CHECK_FUNCS(event_base_free)
218-AC_CHECK_FUNCS(event_base_get_method)
219-LIBS="$save_LIBS"
220-
221-#--------------------------------------------------------------------
222-# Check for libuuid
223-#--------------------------------------------------------------------
224-
225-AC_CHECK_HEADERS(uuid/uuid.h)
226-if test "x$ac_cv_header_uuid_uuid_h" = "xno"
227-then
228- 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.])
229-fi
230-AC_LIB_HAVE_LINKFLAGS(uuid,,
231-[
232-#include <uuid/uuid.h>
233-],
234-[
235- uuid_t uout;
236- uuid_generate(uout);
237-])
238+PANDORA_REQUIRE_LIBEVENT
239+PANDORA_REQUIRE_LIBUUID
240+
241
242 PANDORA_HAVE_BETTER_MALLOC
243 PANDORA_HAVE_LIBSQLITE3
244 PANDORA_HAVE_LIBDRIZZLE
245 PANDORA_HAVE_LIBMEMCACHED
246+PANDORA_HAVE_MEMCACHED
247 PANDORA_HAVE_LIBPQ
248
249
250@@ -112,15 +64,6 @@
251
252
253 AC_CONFIG_FILES(Makefile
254- libgearman/Makefile
255- libgearman-server/Makefile
256- gearmand/Makefile
257- bin/Makefile
258- tests/Makefile
259- examples/Makefile
260- scripts/Makefile
261- support/Makefile
262- benchmark/Makefile
263 scripts/gearmand-init
264 scripts/gearmand.xml
265 scripts/gearmand
266
267=== renamed file 'examples/Makefile.am' => 'examples/include.am'
268--- examples/Makefile.am 2009-04-01 01:49:18 +0000
269+++ examples/include.am 2009-12-18 22:04:13 +0000
270@@ -1,31 +1,43 @@
271+# vim:ft=automake
272 # Gearman server and library
273 # Copyright (C) 2008 Brian Aker, Eric Day
274+# Copyright (C) 2009 Brian Aker, Eric Day, Monty Taylor
275 # All rights reserved.
276 #
277 # Use and distribution licensed under the BSD license. See
278 # the COPYING file in the parent directory for full text.
279-
280-LDADD= $(LTLIBUUID) $(LTLIBEVENT) $(top_builddir)/libgearman/libgearman.la
281-
282-noinst_PROGRAMS= \
283- echo_client \
284- echo_worker \
285- reverse_client \
286- reverse_client_bg \
287- reverse_client_cb \
288- reverse_worker \
289- wc_worker
290-
291-echo_client_SOURCES= echo_client.c
292-
293-echo_worker_SOURCES= echo_worker.c
294-
295-reverse_client_SOURCES= reverse_client.c
296-
297-reverse_client_bg_SOURCES= reverse_client_bg.c
298-
299-reverse_client_cb_SOURCES= reverse_client_cb.c
300-
301-reverse_worker_SOURCES= reverse_worker.c
302-
303-wc_worker_SOURCES= wc_worker.c
304+#
305+# Included from Top Level Makefile.am
306+# All paths should be given relative to the root
307+
308+EXAMPLES_LDADD= $(LTLIBUUID) $(LTLIBEVENT) libgearman/libgearman.la
309+
310+noinst_PROGRAMS+= \
311+ examples/echo_client \
312+ examples/echo_worker \
313+ examples/reverse_client \
314+ examples/reverse_client_bg \
315+ examples/reverse_client_cb \
316+ examples/reverse_worker \
317+ examples/wc_worker
318+
319+examples_echo_client_SOURCES= examples/echo_client.c
320+examples_echo_client_LDADD= $(AM_LDADD) $(EXAMPLES_LDADD)
321+
322+examples_echo_worker_SOURCES= examples/echo_worker.c
323+examples_echo_worker_LDADD= $(AM_LDADD) $(EXAMPLES_LDADD)
324+
325+examples_reverse_client_SOURCES= examples/reverse_client.c
326+examples_reverse_client_LDADD= $(AM_LDADD) $(EXAMPLES_LDADD)
327+
328+examples_reverse_client_bg_SOURCES= examples/reverse_client_bg.c
329+examples_reverse_client_bg_LDADD= $(AM_LDADD) $(EXAMPLES_LDADD)
330+
331+examples_reverse_client_cb_SOURCES= examples/reverse_client_cb.c
332+examples_reverse_client_cb_LDADD= $(AM_LDADD) $(EXAMPLES_LDADD)
333+
334+examples_reverse_worker_SOURCES= examples/reverse_worker.c
335+examples_reverse_worker_LDADD= $(AM_LDADD) $(EXAMPLES_LDADD)
336+
337+examples_wc_worker_SOURCES= examples/wc_worker.c
338+examples_wc_worker_LDADD= $(AM_LDADD) $(EXAMPLES_LDADD)
339
340=== renamed file 'gearmand/Makefile.am' => 'gearmand/include.am'
341--- gearmand/Makefile.am 2009-09-24 23:43:15 +0000
342+++ gearmand/include.am 2009-12-18 22:04:13 +0000
343@@ -1,20 +1,25 @@
344+# vim:ft=automake
345 # Gearman server and library
346 # Copyright (C) 2008 Brian Aker, Eric Day
347+# Copyright (C) 2009 Brian Aker, Eric Day, Monty Taylor
348 # All rights reserved.
349 #
350 # Use and distribution licensed under the BSD license. See
351 # the COPYING file in the parent directory for full text.
352-
353-sbin_PROGRAMS= gearmand
354-
355-gearmand_LDADD= \
356- $(top_builddir)/libgearman-server/libgearman-server.la \
357+#
358+# Included from Top Level Makefile.am
359+# All paths should be given relative to the root
360+
361+sbin_PROGRAMS+= gearmand/gearmand
362+
363+gearmand_gearmand_LDADD= \
364+ libgearman-server/libgearman-server.la \
365 ${BETTER_MALLOC_LIBS}
366
367-gearmand_SOURCES= gearmand.c
368-
369-valgrind: gearmand
370- libtool --mode=execute valgrind --leak-check=yes --show-reachable=yes gearmand
371-
372-debug: gearmand
373- libtool --mode=execute gdb gearmand
374+gearmand_gearmand_SOURCES= gearmand/gearmand.c
375+
376+gearmand-valgrind: gearmand/gearmand
377+ $(LIBTOOL) --mode=execute valgrind --leak-check=yes --show-reachable=yes gearmand/gearmand
378+
379+gearmand-debug: gearmand/gearmand
380+ $(LIBTOOL) --mode=execute gdb gearmand/gearmand
381
382=== modified file 'libgearman-server/gearmand.c'
383--- libgearman-server/gearmand.c 2009-10-29 22:01:39 +0000
384+++ libgearman-server/gearmand.c 2009-12-18 22:04:13 +0000
385@@ -484,13 +484,15 @@
386 if (!(gearmand->options & GEARMAND_LISTEN_EVENT))
387 return;
388
389+ int del_ret= 0;
390 for (x= 0; x < gearmand->port_count; x++)
391 {
392 for (y= 0; y < gearmand->port_list[x].listen_count; y++)
393 {
394 GEARMAN_INFO(gearmand, "Clearing event for listening socket (%d)",
395 gearmand->port_list[x].listen_fd[y])
396- assert(event_del(&(gearmand->port_list[x].listen_event[y])) == 0);
397+ del_ret= event_del(&(gearmand->port_list[x].listen_event[y]));
398+ assert(del_ret == 0);
399 }
400 }
401
402@@ -615,7 +617,8 @@
403 if (gearmand->options & GEARMAND_WAKEUP_EVENT)
404 {
405 GEARMAN_INFO(gearmand, "Clearing event for wakeup pipe")
406- assert(event_del(&(gearmand->wakeup_event)) == 0);
407+ int del_ret= event_del(&(gearmand->wakeup_event));
408+ assert(del_ret == 0);
409 gearmand->options&= (gearmand_options_t)~GEARMAND_WAKEUP_EVENT;
410 }
411 }
412
413=== modified file 'libgearman-server/gearmand_con.c'
414--- libgearman-server/gearmand_con.c 2009-10-29 20:18:00 +0000
415+++ libgearman-server/gearmand_con.c 2009-12-18 22:04:13 +0000
416@@ -126,13 +126,15 @@
417
418 void gearmand_con_free(gearmand_con_st *dcon)
419 {
420- assert(event_del(&(dcon->event)) == 0);
421+ int del_ret= event_del(&(dcon->event));
422+ assert(del_ret == 0);
423
424 /* This gets around a libevent bug when both POLLIN and POLLOUT are set. */
425 event_set(&(dcon->event), dcon->fd, EV_READ, _con_ready, dcon);
426 event_base_set(dcon->thread->base, &(dcon->event));
427 event_add(&(dcon->event), NULL);
428- assert(event_del(&(dcon->event)) == 0);
429+ del_ret= event_del(&(dcon->event));
430+ assert(del_ret == 0);
431
432 gearman_server_con_free(dcon->server_con);
433 GEARMAN_LIST_DEL(dcon->thread->dcon, dcon,)
434@@ -195,7 +197,10 @@
435 if (dcon->last_events != set_events)
436 {
437 if (dcon->last_events != 0)
438- assert(event_del(&(dcon->event)) == 0);
439+ {
440+ int del_ret= event_del(&(dcon->event));
441+ assert(del_ret == 0);
442+ }
443 event_set(&(dcon->event), dcon->fd, set_events | EV_PERSIST, _con_ready,
444 dcon);
445 event_base_set(dcon->thread->base, &(dcon->event));
446
447=== modified file 'libgearman-server/gearmand_thread.c'
448--- libgearman-server/gearmand_thread.c 2009-10-29 20:18:00 +0000
449+++ libgearman-server/gearmand_thread.c 2009-12-18 22:04:13 +0000
450@@ -335,7 +335,8 @@
451 GEARMAN_INFO(thread->gearmand,
452 "[%4u] Clearing event for IO thread wakeup pipe",
453 thread->count)
454- assert(event_del(&(thread->wakeup_event)) == 0);
455+ int del_ret= event_del(&(thread->wakeup_event));
456+ assert(del_ret == 0);
457 thread->options&= (gearmand_thread_options_t)~GEARMAND_THREAD_WAKEUP_EVENT;
458 }
459 }
460
461=== renamed file 'libgearman-server/Makefile.am' => 'libgearman-server/include.am'
462--- libgearman-server/Makefile.am 2009-09-29 03:57:09 +0000
463+++ libgearman-server/include.am 2009-12-18 22:04:13 +0000
464@@ -1,94 +1,96 @@
465+# vim:ft=automake
466 # Gearman server and library
467 # Copyright (C) 2008 Brian Aker, Eric Day
468+# Copyright (C) 2009 Brian Aker, Eric Day, Monty Taylor
469 # All rights reserved.
470 #
471 # Use and distribution licensed under the BSD license. See
472 # the COPYING file in the parent directory for full text.
473+#
474+# Included from Top Level Makefile.am
475+# All paths should be given relative to the root
476
477 if HAVE_LIBDRIZZLE
478-QUEUE_LIBDRIZZLE_H= queue_libdrizzle.h
479-QUEUE_LIBDRIZZLE_C= queue_libdrizzle.c
480+QUEUE_LIBDRIZZLE_H= libgearman-server/queue_libdrizzle.h
481+QUEUE_LIBDRIZZLE_C= libgearman-server/queue_libdrizzle.c
482 endif
483
484 if HAVE_LIBMEMCACHED
485-QUEUE_LIBMEMCACHED_H= queue_libmemcached.h
486-QUEUE_LIBMEMCACHED_C= queue_libmemcached.c
487+QUEUE_LIBMEMCACHED_H= libgearman-server/queue_libmemcached.h
488+QUEUE_LIBMEMCACHED_C= libgearman-server/queue_libmemcached.c
489 endif
490
491 if HAVE_LIBSQLITE3
492-QUEUE_LIBSQLITE3_H= queue_libsqlite3.h
493-QUEUE_LIBSQLITE3_C= queue_libsqlite3.c
494+QUEUE_LIBSQLITE3_H= libgearman-server/queue_libsqlite3.h
495+QUEUE_LIBSQLITE3_C= libgearman-server/queue_libsqlite3.c
496 endif
497
498 if HAVE_LIBPQ
499-QUEUE_LIBPQ_H= queue_libpq.h
500-QUEUE_LIBPQ_C= queue_libpq.c
501+QUEUE_LIBPQ_H= libgearman-server/queue_libpq.h
502+QUEUE_LIBPQ_C= libgearman-server/queue_libpq.c
503 endif
504
505-lib_LTLIBRARIES= libgearman-server.la
506-
507-libgearman_serverincludedir= ${includedir}/libgearman-server
508-
509-dist_libgearman_serverinclude_HEADERS= \
510- client.h \
511- conf.h \
512- conf_module.h \
513- conn.h \
514- constants.h \
515- function.h \
516- job.h \
517- packet.h \
518- server.h \
519- structs.h \
520- thread.h \
521- worker.h \
522+lib_LTLIBRARIES+= libgearman-server/libgearman-server.la
523+
524+
525+nobase_pkginclude_HEADERS += \
526 $(QUEUE_LIBDRIZZLE_H) \
527 $(QUEUE_LIBMEMCACHED_H) \
528+ $(QUEUE_LIBPQ_H) \
529 $(QUEUE_LIBSQLITE3_H) \
530- $(QUEUE_LIBPQ_H) \
531- protocol_http.h \
532- gearmand.h \
533- gearmand_thread.h \
534- gearmand_con.h
535-
536-noinst_HEADERS= \
537- common.h
538-
539-libgearman_server_la_SOURCES= \
540- client.c \
541- conf.c \
542- conf_module.c \
543- conn.c \
544- function.c \
545- job.c \
546- packet.c \
547- server.c \
548- thread.c \
549- worker.c \
550+ libgearman-server/client.h \
551+ libgearman-server/conf.h \
552+ libgearman-server/conf_module.h \
553+ libgearman-server/conn.h \
554+ libgearman-server/constants.h \
555+ libgearman-server/function.h \
556+ libgearman-server/gearmand.h \
557+ libgearman-server/gearmand_con.h \
558+ libgearman-server/gearmand_thread.h \
559+ libgearman-server/job.h \
560+ libgearman-server/packet.h \
561+ libgearman-server/protocol_http.h \
562+ libgearman-server/server.h \
563+ libgearman-server/structs.h \
564+ libgearman-server/thread.h \
565+ libgearman-server/worker.h
566+
567+noinst_HEADERS+= \
568+ libgearman-server/common.h
569+
570+libgearman_server_libgearman_server_la_SOURCES= \
571 $(QUEUE_LIBDRIZZLE_C) \
572 $(QUEUE_LIBMEMCACHED_C) \
573+ $(QUEUE_LIBPQ_C) \
574 $(QUEUE_LIBSQLITE3_C) \
575- $(QUEUE_LIBPQ_C) \
576- protocol_http.c \
577- gearmand.c \
578- gearmand_thread.c \
579- gearmand_con.c
580+ libgearman-server/client.c \
581+ libgearman-server/conf.c \
582+ libgearman-server/conf_module.c \
583+ libgearman-server/conn.c \
584+ libgearman-server/function.c \
585+ libgearman-server/gearmand.c \
586+ libgearman-server/gearmand_con.c \
587+ libgearman-server/gearmand_thread.c \
588+ libgearman-server/job.c \
589+ libgearman-server/packet.c \
590+ libgearman-server/protocol_http.c \
591+ libgearman-server/server.c \
592+ libgearman-server/thread.c \
593+ libgearman-server/worker.c
594
595-libgearman_server_la_CFLAGS= \
596+libgearman_server_libgearman_server_la_CFLAGS= \
597 ${AM_CFLAGS} \
598 -DBUILDING_LIBGEARMAN
599
600-libgearman_server_la_LDFLAGS= \
601+libgearman_server_libgearman_server_la_LDFLAGS= \
602+ $(AM_LDFLAGS) \
603 -version-info \
604- $(GEARMAN_SERVER_LIBRARY_VERSION) \
605- $(LD_VERSION_SCRIPT_SERVER)
606+ $(GEARMAN_SERVER_LIBRARY_VERSION)
607
608-libgearman_server_la_LIBADD= \
609- $(top_builddir)/libgearman/libgearman.la \
610+libgearman_server_libgearman_server_la_LIBADD= \
611+ $(LTLIBDRIZZLE) \
612 $(LTLIBEVENT) \
613- $(LTLIBDRIZZLE) \
614 $(LTLIBMEMCACHED) \
615+ $(LTLIBPQ) \
616 $(LTLIBSQLITE3) \
617- $(LTLIBPQ)
618-
619-EXTRA_DIST= libgearman-server.ver
620+ libgearman/libgearman.la
621
622=== removed file 'libgearman-server/libgearman-server.ver'
623--- libgearman-server/libgearman-server.ver 2009-09-29 03:57:09 +0000
624+++ libgearman-server/libgearman-server.ver 1970-01-01 00:00:00 +0000
625@@ -1,1 +0,0 @@
626-libgearman_server_0 { global: *; };
627
628=== modified file 'libgearman/client.c'
629--- libgearman/client.c 2009-11-04 21:44:34 +0000
630+++ libgearman/client.c 2009-12-18 22:04:13 +0000
631@@ -759,8 +759,13 @@
632 (char *)(client->con->packet.arg[1]));
633 return GEARMAN_SERVER_ERROR;
634 }
635- else if (strcmp(client->task->job_handle,
636- (char *)(client->con->packet.arg[0])))
637+ else if (strncmp(client->task->job_handle,
638+ (char *)(client->con->packet.arg[0]),
639+ client->con->packet.arg_size[0]) ||
640+ (client->con->packet.command != GEARMAN_COMMAND_WORK_FAIL &&
641+ strlen(client->task->job_handle) != client->con->packet.arg_size[0] - 1) ||
642+ (client->con->packet.command == GEARMAN_COMMAND_WORK_FAIL &&
643+ strlen(client->task->job_handle) != client->con->packet.arg_size[0]))
644 {
645 continue;
646 }
647
648=== renamed file 'libgearman/Makefile.am' => 'libgearman/include.am'
649--- libgearman/Makefile.am 2009-10-29 00:11:45 +0000
650+++ libgearman/include.am 2009-12-18 22:04:13 +0000
651@@ -1,49 +1,51 @@
652+# vim:ft=automake
653 # Gearman server and library
654 # Copyright (C) 2008 Brian Aker, Eric Day
655+# Copyright (C) 2009 Brian Aker, Eric Day, Monty Taylor
656 # All rights reserved.
657 #
658 # Use and distribution licensed under the BSD license. See
659 # the COPYING file in the parent directory for full text.
660-
661-lib_LTLIBRARIES= libgearman.la
662-
663-libgearmanincludedir= ${includedir}/libgearman
664-
665-dist_libgearmaninclude_HEADERS= \
666- client.h \
667- conn.h \
668- constants.h \
669- gearman.h \
670- job.h \
671- packet.h \
672- structs.h \
673- task.h \
674- visibility.h \
675- worker.h
676-
677-noinst_HEADERS= \
678- common.h \
679- gearman_local.h
680-
681-libgearman_la_SOURCES= \
682- client.c \
683- conn.c \
684- gearman.c \
685- job.c \
686- packet.c \
687- task.c \
688- worker.c
689-
690-libgearman_la_CFLAGS= \
691+#
692+# Included from Top Level Makefile.am
693+# All paths should be given relative to the root
694+
695+lib_LTLIBRARIES+= libgearman/libgearman.la
696+
697+nobase_pkginclude_HEADERS += \
698+ libgearman/client.h \
699+ libgearman/conn.h \
700+ libgearman/constants.h \
701+ libgearman/gearman.h \
702+ libgearman/job.h \
703+ libgearman/packet.h \
704+ libgearman/structs.h \
705+ libgearman/task.h \
706+ libgearman/visibility.h \
707+ libgearman/worker.h
708+
709+noinst_HEADERS+= \
710+ libgearman/common.h \
711+ libgearman/gearman_local.h
712+
713+libgearman_libgearman_la_SOURCES= \
714+ libgearman/client.c \
715+ libgearman/conn.c \
716+ libgearman/gearman.c \
717+ libgearman/job.c \
718+ libgearman/packet.c \
719+ libgearman/task.c \
720+ libgearman/worker.c
721+
722+libgearman_libgearman_la_CFLAGS= \
723 ${AM_CFLAGS} \
724 -DBUILDING_LIBGEARMAN
725
726-libgearman_la_LDFLAGS= \
727+libgearman_libgearman_la_LDFLAGS= \
728+ $(AM_LDFLAGS) \
729 -version-info \
730- $(GEARMAN_LIBRARY_VERSION) \
731- $(LD_VERSION_SCRIPT)
732+ $(GEARMAN_LIBRARY_VERSION)
733
734-libgearman_la_LIBADD= \
735+libgearman_libgearman_la_LIBADD= \
736 $(LTLIBUUID)
737
738-EXTRA_DIST= libgearman.ver
739
740=== removed file 'libgearman/libgearman.ver'
741--- libgearman/libgearman.ver 2009-12-02 05:22:18 +0000
742+++ libgearman/libgearman.ver 1970-01-01 00:00:00 +0000
743@@ -1,1 +0,0 @@
744-libgearman_3 { global: *; };
745
746=== modified file 'm4/pandora_canonical.m4'
747--- m4/pandora_canonical.m4 2009-10-20 18:30:03 +0000
748+++ m4/pandora_canonical.m4 2009-12-18 22:04:13 +0000
749@@ -4,7 +4,7 @@
750 dnl with or without modifications, as long as this notice is preserved.
751
752 dnl Which version of the canonical setup we're using
753-AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.63])
754+AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.86])
755
756 AC_DEFUN([PANDORA_FORCE_DEPEND_TRACKING],[
757 dnl Force dependency tracking on for Sun Studio builds
758@@ -24,6 +24,8 @@
759 m4_define([PCT_IGNORE_SHARED_PTR],[no])
760 m4_define([PCT_FORCE_GCC42],[no])
761 m4_define([PCT_SRC_IN_SRC],[no])
762+ m4_define([PCT_VERSION_FROM_VC],[no])
763+ m4_define([PCT_USE_VISIBILITY],[yes])
764 m4_foreach([pct_arg],[$*],[
765 m4_case(pct_arg,
766 [use-gnulib], [
767@@ -42,9 +44,17 @@
768 m4_undefine([PCT_FORCE_GCC42])
769 m4_define([PCT_FORCE_GCC42],[yes])
770 ],
771+ [skip-visibility], [
772+ m4_undefine([PCT_USE_VISIBILITY])
773+ m4_define([PCT_USE_VISIBILITY],[no])
774+ ],
775 [src-in-src], [
776 m4_undefine([PCT_SRC_IN_SRC])
777 m4_define([PCT_SRC_IN_SRC],[yes])
778+ ],
779+ [version-from-vc], [
780+ m4_undefine([PCT_VERSION_FROM_VC])
781+ m4_define([PCT_VERSION_FROM_VC],[yes])
782 ])
783 ])
784
785@@ -58,7 +68,7 @@
786
787 AC_CANONICAL_TARGET
788
789- AM_INIT_AUTOMAKE(-Wall -Werror nostdinc subdir-objects)
790+ AM_INIT_AUTOMAKE(-Wall -Werror nostdinc subdir-objects foreign)
791 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
792
793 m4_if(PCT_USE_GNULIB,yes,[ gl_EARLY ])
794@@ -67,6 +77,11 @@
795 AC_REQUIRE([PANDORA_MAC_GCC42])
796 AC_REQUIRE([PANDORA_64BIT])
797
798+ m4_if(PCT_VERSION_FROM_VC,yes,[
799+ PANDORA_VC_VERSION
800+ ])
801+ PANDORA_VERSION
802+
803 dnl Once we can use a modern autoconf, we can use this
804 dnl AC_PROG_CC_C99
805 AC_REQUIRE([AC_PROG_CXX])
806@@ -90,6 +105,7 @@
807 AS_IF([test "$ac_cv_cxx_stdcxx_98" = "no"],[
808 AC_MSG_ERROR([No working C++ Compiler has been found. ${PACKAGE} requires a C++ compiler that can handle C++98])
809 ])
810+
811 ])
812
813 PANDORA_SHARED_PTR
814@@ -104,6 +120,9 @@
815 AC_CONFIG_LIBOBJ_DIR([gnulib])
816 ])
817
818+ PANDORA_CHECK_C_VERSION
819+ PANDORA_CHECK_CXX_VERSION
820+
821 AC_C_BIGENDIAN
822 AC_C_CONST
823 AC_C_INLINE
824@@ -114,17 +133,71 @@
825 AC_TYPE_SIZE_T
826 AC_SYS_LARGEFILE
827
828-
829- PANDORA_CHECK_C_VERSION
830- PANDORA_CHECK_CXX_VERSION
831+ # off_t is not a builtin type
832+ AC_CHECK_SIZEOF(off_t, 4)
833+ AS_IF([test "$ac_cv_sizeof_off_t" -eq 0],[
834+ AC_MSG_ERROR("${PACKAGE} needs an off_t type.")
835+ ])
836+
837+ AC_CHECK_SIZEOF(size_t)
838+ AS_IF([test "$ac_cv_sizeof_size_t" -eq 0],[
839+ AC_MSG_ERROR("${PACKAGE} needs an size_t type.")
840+ ])
841+
842+ AC_DEFINE_UNQUOTED([SIZEOF_SIZE_T],[$ac_cv_sizeof_size_t],[Size of size_t as computed by sizeof()])
843+ AC_CHECK_SIZEOF(long long)
844+ AC_DEFINE_UNQUOTED([SIZEOF_LONG_LONG],[$ac_cv_sizeof_long_long],[Size of long long as computed by sizeof()])
845+ AC_CACHE_CHECK([if time_t is unsigned], [ac_cv_time_t_unsigned],[
846+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
847+ [[
848+#include <time.h>
849+ ]],
850+ [[
851+ int array[(((time_t)-1) > 0) ? 1 : -1];
852+ ]])
853+ ],[
854+ ac_cv_time_t_unsigned=yes
855+ ],[
856+ ac_cv_time_t_unsigned=no
857+ ])
858+ ])
859+ AS_IF([test "$ac_cv_time_t_unsigned" = "yes"],[
860+ AC_DEFINE([TIME_T_UNSIGNED], 1, [Define to 1 if time_t is unsigned])
861+ ])
862+
863+ dnl AC_FUNC_ALLOCA would test for stack direction if we didn't have a working
864+ dnl alloca - but we need to know it anyway for check_stack_overrun.
865+ PANDORA_STACK_DIRECTION
866+
867+ AC_CHECK_LIBM
868+
869+ AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
870+ AC_CHECK_FUNC(bind, [], [AC_CHECK_LIB(bind, bind)])
871+
872+
873
874 PANDORA_OPTIMIZE
875
876- dnl We need to inject error into the cflags to test if visibility works or not
877- save_CFLAGS="${CFLAGS}"
878- CFLAGS="${CFLAGS} -Werror"
879- gl_VISIBILITY
880- CFLAGS="${save_CFLAGS}"
881+ AC_LANG_PUSH(C++)
882+ # Test whether madvise() is declared in C++ code -- it is not on some
883+ # systems, such as Solaris
884+ AC_CHECK_DECLS([madvise], [], [], [AC_INCLUDES_DEFAULT[
885+ #if HAVE_SYS_MMAN_H
886+ #include <sys/types.h>
887+ #include <sys/mman.h>
888+ #endif
889+ ]])
890+ AC_LANG_POP()
891+
892+ PANDORA_HAVE_GCC_ATOMICS
893+
894+ m4_if(PCT_USE_VISIBILITY,[yes],[
895+ dnl We need to inject error into the cflags to test if visibility works or not
896+ save_CFLAGS="${CFLAGS}"
897+ CFLAGS="${CFLAGS} -Werror"
898+ gl_VISIBILITY
899+ CFLAGS="${save_CFLAGS}"
900+ ])
901
902 PANDORA_HEADER_ASSERT
903
904
905=== modified file 'm4/pandora_check_cxx_standard.m4'
906--- m4/pandora_check_cxx_standard.m4 2009-07-08 07:19:19 +0000
907+++ m4/pandora_check_cxx_standard.m4 2009-12-18 22:04:13 +0000
908@@ -8,9 +8,16 @@
909 AS_IF([test "$GCC" = "yes"],
910 [AS_IF([test "$ac_cv_cxx_compile_cxx0x_native" = "yes"],[],
911 [AS_IF([test "$ac_cv_cxx_compile_cxx0x_gxx" = "yes"],
912- [CXXFLAGS="-std=gnu++0x ${CXXFLAGS}"],
913- [CXXFLAGS="-std=gnu++98"])
914+ [CXX_STANDARD="-std=gnu++0x"],
915+ [CXX_STANDARD="-std=gnu++98"])
916 ])
917 ])
918+ AM_CXXFLAGS="${CXX_STANDARD} ${AM_CXXFLAGS}"
919+
920+ save_CXXFLAGS="${CXXFLAGS}"
921+ CXXFLAGS="${CXXFLAGS} ${CXX_STANDARD}"
922 AC_CXX_HEADER_STDCXX_98
923+ CXXFLAGS="${save_CXXFLAGS}"
924+
925+ AC_SUBST([CXX_STANDARD])
926 ])
927
928=== added file 'm4/pandora_cinttypes.m4'
929--- m4/pandora_cinttypes.m4 1970-01-01 00:00:00 +0000
930+++ m4/pandora_cinttypes.m4 2009-12-18 22:04:13 +0000
931@@ -0,0 +1,34 @@
932+# We check two things: where the include file is for cinttypes. We
933+# include AC_TRY_COMPILE for all the combinations we've seen in the
934+# wild. We define one of HAVE_CINTTYPES or HAVE_TR1_CINTTYPES or
935+# HAVE_BOOST_CINTTYPES depending
936+# on location.
937+
938+AC_DEFUN([PANDORA_CXX_CINTTYPES],
939+ [AC_REQUIRE([PANDORA_CXX_CSTDINT])
940+ AC_MSG_CHECKING(the location of cinttypes)
941+ AC_LANG_PUSH(C++)
942+ save_CXXFLAGS="${CXXFLAGS}"
943+ CXXFLAGS="${CXX_STANDARD} ${CXXFLAGS}"
944+ ac_cv_cxx_cinttypes=""
945+ for location in tr1/cinttypes boost/cinttypes cinttypes; do
946+ if test -z "$ac_cv_cxx_cinttypes"; then
947+ AC_TRY_COMPILE([#include $ac_cv_cxx_cstdint;
948+ #include <$location>],
949+ [uint32_t foo= UINT32_C(1)],
950+ [ac_cv_cxx_cinttypes="<$location>";])
951+ fi
952+ done
953+ AC_LANG_POP()
954+ CXXFLAGS="${save_CXXFLAGS}"
955+ if test -n "$ac_cv_cxx_cinttypes"; then
956+ AC_MSG_RESULT([$ac_cv_cxx_cinttypes])
957+ else
958+ ac_cv_cxx_cinttypes="<inttypes.h>"
959+ AC_MSG_RESULT()
960+ AC_MSG_WARN([Could not find a cinttypes header.])
961+ fi
962+ AC_DEFINE([__STDC_LIMIT_MACROS],[1],[Use STDC Limit Macros in C++])
963+ AC_DEFINE_UNQUOTED(CINTTYPES_H,$ac_cv_cxx_cinttypes,
964+ [the location of <cinttypes>])
965+])
966
967=== added file 'm4/pandora_cstdint.m4'
968--- m4/pandora_cstdint.m4 1970-01-01 00:00:00 +0000
969+++ m4/pandora_cstdint.m4 2009-12-18 22:04:13 +0000
970@@ -0,0 +1,33 @@
971+# We check two things: where the include file is for cstdint. We
972+# include AC_TRY_COMPILE for all the combinations we've seen in the
973+# wild. We define one of HAVE_CSTDINT or HAVE_TR1_CSTDINT or
974+# HAVE_BOOST_CSTDINT depending
975+# on location.
976+
977+AC_DEFUN([PANDORA_CXX_CSTDINT],
978+ [AC_MSG_CHECKING(the location of cstdint)
979+ AC_LANG_PUSH(C++)
980+ save_CXXFLAGS="${CXXFLAGS}"
981+ CXXFLAGS="${CXX_STANDARD} ${CXXFLAGS}"
982+ ac_cv_cxx_cstdint=""
983+ for location in tr1/cstdint boost/cstdint cstdint; do
984+ if test -z "$ac_cv_cxx_cstdint"; then
985+ AC_TRY_COMPILE([#include <$location>],
986+ [uint32_t t],
987+ [ac_cv_cxx_cstdint="<$location>";])
988+ fi
989+ done
990+ AC_LANG_POP()
991+ CXXFLAGS="${save_CXXFLAGS}"
992+ if test -n "$ac_cv_cxx_cstdint"; then
993+ AC_MSG_RESULT([$ac_cv_cxx_cstdint])
994+ else
995+ AC_DEFINE([__STDC_CONSTANT_MACROS],[1],[Use STDC Constant Macros in C++])
996+ AC_DEFINE([__STDC_FORMAT_MACROS],[1],[Use STDC Format Macros in C++])
997+ ac_cv_cxx_cstdint="<stdint.h>"
998+ AC_MSG_RESULT()
999+ AC_MSG_WARN([Could not find a cstdint header.])
1000+ fi
1001+ AC_DEFINE_UNQUOTED(CSTDINT_H,$ac_cv_cxx_cstdint,
1002+ [the location of <cstdint>])
1003+])
1004
1005=== added file 'm4/pandora_cxx_demangle.m4'
1006--- m4/pandora_cxx_demangle.m4 1970-01-01 00:00:00 +0000
1007+++ m4/pandora_cxx_demangle.m4 2009-12-18 22:04:13 +0000
1008@@ -0,0 +1,27 @@
1009+dnl Copyright (C) 2009 Sun Microsystems
1010+dnl This file is free software; Sun Microsystems
1011+dnl gives unlimited permission to copy and/or distribute it,
1012+dnl with or without modifications, as long as this notice is preserved.
1013+
1014+dnl Check for all of the headers and libs that Drizzle needs. We check all
1015+dnl of these for plugins too, to ensure that all of the appropriate defines
1016+dnl are set.
1017+
1018+AC_DEFUN([PANDORA_CXX_DEMANGLE],[
1019+ AC_LANG_PUSH([C++])
1020+ save_CXXFLAGS="${CXXFLAGS}"
1021+ CXXFLAGS="${CXX_STANDARD} ${CXXFLAGS}"
1022+ AC_CHECK_HEADERS(cxxabi.h)
1023+ AC_CACHE_CHECK([checking for abi::__cxa_demangle], pandora_cv_cxa_demangle,
1024+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cxxabi.h>]], [[
1025+ char *foo= 0; int bar= 0;
1026+ foo= abi::__cxa_demangle(foo, foo, 0, &bar);
1027+ ]])],[pandora_cv_cxa_demangle=yes],[pandora_cv_cxa_demangle=no])])
1028+ CXXFLAGS="${save_CXXFLAGS}"
1029+ AC_LANG_POP()
1030+
1031+ AS_IF([test "x$pandora_cv_cxa_demangle" = xyes],[
1032+ AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
1033+ [Define to 1 if you have the `abi::__cxa_demangle' function.])
1034+ ])
1035+])
1036
1037=== added file 'm4/pandora_drizzle_build.m4'
1038--- m4/pandora_drizzle_build.m4 1970-01-01 00:00:00 +0000
1039+++ m4/pandora_drizzle_build.m4 2009-12-18 22:04:13 +0000
1040@@ -0,0 +1,98 @@
1041+dnl Copyright (C) 2009 Sun Microsystems
1042+dnl This file is free software; Sun Microsystems
1043+dnl gives unlimited permission to copy and/or distribute it,
1044+dnl with or without modifications, as long as this notice is preserved.
1045+
1046+dnl Check for all of the headers and libs that Drizzle needs. We check all
1047+dnl of these for plugins too, to ensure that all of the appropriate defines
1048+dnl are set.
1049+
1050+AC_DEFUN([PANDORA_DRIZZLE_BUILD],[
1051+
1052+ dnl We need to turn on our CXXFLAGS to make sure it shows up correctly
1053+ PANDORA_CXX_STL_HASH
1054+
1055+ PANDORA_CXX_CSTDINT
1056+ PANDORA_CXX_CINTTYPES
1057+
1058+ AC_STRUCT_TM
1059+
1060+ AC_FUNC_ALLOCA
1061+ AC_FUNC_UTIME_NULL
1062+ AC_FUNC_VPRINTF
1063+
1064+ PANDORA_WORKING_FDATASYNC
1065+
1066+ AC_CHECK_FUNCS(\
1067+ gethrtime \
1068+ setupterm \
1069+ backtrace \
1070+ backtrace_symbols \
1071+ backtrace_symbols_fd)
1072+
1073+ AC_HEADER_STAT
1074+ AC_HEADER_DIRENT
1075+ AC_HEADER_STDC
1076+ AC_HEADER_SYS_WAIT
1077+ AC_HEADER_STDBOOL
1078+
1079+ AC_CHECK_HEADERS(sys/types.h sys/fpu.h fpu_control.h ieeefp.h)
1080+ AC_CHECK_HEADERS(select.h sys/select.h)
1081+ AC_CHECK_HEADERS(utime.h sys/utime.h )
1082+ AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h)
1083+ AC_CHECK_HEADERS(sched.h)
1084+ AC_CHECK_HEADERS(sys/prctl.h)
1085+ AC_CHECK_HEADERS(execinfo.h)
1086+ AC_CHECK_HEADERS(locale.h)
1087+ AC_CHECK_HEADERS(termcap.h termio.h termios.h asm/termbits.h)
1088+ AC_CHECK_HEADERS(paths.h)
1089+
1090+
1091+ #--------------------------------------------------------------------
1092+ # Check for system libraries. Adds the library to $LIBS
1093+ # and defines HAVE_LIBM etc
1094+ #--------------------------------------------------------------------
1095+
1096+ # For the sched_yield() function on Solaris
1097+ AC_CHECK_FUNC(sched_yield, [],
1098+ [AC_CHECK_LIB(posix4, [sched_yield],
1099+ [AC_DEFINE(HAVE_SCHED_YIELD, 1, [Have sched_yield function]) LIBS="$LIBS -lposix4"])])
1100+
1101+ AS_IF([test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"],[
1102+ AC_CHECK_FUNC(gtty, [], [AC_CHECK_LIB(compat, gtty)])
1103+ ])
1104+
1105+ AC_CHECK_HEADERS([curses.h term.h],[],[],[[
1106+ #ifdef HAVE_CURSES_H
1107+ # include <curses.h>
1108+ #endif
1109+ ]])
1110+ AC_CHECK_TYPES([uint, ulong])
1111+
1112+ PANDORA_CXX_DEMANGLE
1113+
1114+ AH_TOP([
1115+#ifndef __CONFIG_H__
1116+#define __CONFIG_H__
1117+
1118+#if defined(i386) && !defined(__i386__)
1119+#define __i386__
1120+#endif
1121+
1122+ ])
1123+ AH_BOTTOM([
1124+#if defined(__cplusplus)
1125+# include CSTDINT_H
1126+# include CINTTYPES_H
1127+#else
1128+# include <stdint.h>
1129+# include <inttypes.h>
1130+#endif
1131+
1132+#if !defined(HAVE_ULONG) && !defined(__USE_MISC)
1133+typedef unsigned long int ulong;
1134+#endif
1135+
1136+#endif /* __CONFIG_H__ */
1137+ ])
1138+])
1139
1140=== added file 'm4/pandora_fdatasync.m4'
1141--- m4/pandora_fdatasync.m4 1970-01-01 00:00:00 +0000
1142+++ m4/pandora_fdatasync.m4 2009-12-18 22:04:13 +0000
1143@@ -0,0 +1,25 @@
1144+dnl Copyright (C) 2009 Sun Microsystems
1145+dnl This file is free software; Sun Microsystems
1146+dnl gives unlimited permission to copy and/or distribute it,
1147+dnl with or without modifications, as long as this notice is preserved.
1148+
1149+#--------------------------------------------------------------------
1150+# Check for a working fdatasync call
1151+#--------------------------------------------------------------------
1152+
1153+
1154+AC_DEFUN([PANDORA_WORKING_FDATASYNC],[
1155+ AC_CACHE_CHECK([working fdatasync],[ac_cv_func_fdatasync],[
1156+ AC_LANG_PUSH(C++)
1157+ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
1158+#include <unistd.h>
1159+ ]],[[
1160+fdatasync(4);
1161+ ]])],
1162+ [ac_cv_func_fdatasync=yes],
1163+ [ac_cv_func_fdatasync=no])
1164+ AC_LANG_POP()
1165+ ])
1166+ AS_IF([test "x${ac_cv_func_fdatasync}" = "xyes"],
1167+ [AC_DEFINE([HAVE_FDATASYNC],[1],[If the system has a working fdatasync])])
1168+])
1169\ No newline at end of file
1170
1171=== modified file 'm4/pandora_have_better_malloc.m4'
1172--- m4/pandora_have_better_malloc.m4 2009-08-06 22:01:19 +0000
1173+++ m4/pandora_have_better_malloc.m4 2009-12-18 22:04:13 +0000
1174@@ -60,3 +60,8 @@
1175 AC_SUBST([BETTER_MALLOC_LIBS])
1176
1177 ])
1178+
1179+AC_DEFUN([PANDORA_USE_BETTER_MALLOC],[
1180+ AC_REQUIRE([PANDORA_HAVE_BETTER_MALLOC])
1181+ LIBS="${LIBS} ${BETTER_MALLOC_LIBS}"
1182+])
1183\ No newline at end of file
1184
1185=== added file 'm4/pandora_have_gcc_atomics.m4'
1186--- m4/pandora_have_gcc_atomics.m4 1970-01-01 00:00:00 +0000
1187+++ m4/pandora_have_gcc_atomics.m4 2009-12-18 22:04:13 +0000
1188@@ -0,0 +1,37 @@
1189+dnl Copyright (C) 2009 Sun Microsystems
1190+dnl This file is free software; Sun Microsystems
1191+dnl gives unlimited permission to copy and/or distribute it,
1192+dnl with or without modifications, as long as this notice is preserved.
1193+
1194+#--------------------------------------------------------------------
1195+# Check for GCC Atomic Support
1196+#--------------------------------------------------------------------
1197+
1198+
1199+AC_DEFUN([PANDORA_HAVE_GCC_ATOMICS],[
1200+
1201+ AC_CACHE_CHECK(
1202+ [whether the compiler provides atomic builtins],
1203+ [ac_cv_gcc_atomic_builtins],
1204+ [AC_RUN_IFELSE(
1205+ [AC_LANG_PROGRAM([],[[
1206+ int foo= -10; int bar= 10;
1207+ if (!__sync_fetch_and_add(&foo, bar) || foo)
1208+ return -1;
1209+ bar= __sync_lock_test_and_set(&foo, bar);
1210+ if (bar || foo != 10)
1211+ return -1;
1212+ bar= __sync_val_compare_and_swap(&bar, foo, 15);
1213+ if (bar)
1214+ return -1;
1215+ return 0;
1216+ ]])],
1217+ [ac_cv_gcc_atomic_builtins=yes],
1218+ [ac_cv_gcc_atomic_builtins=no])])
1219+
1220+ AS_IF([test "x$ac_cv_gcc_atomic_builtins" = "xyes"],[
1221+ AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1,
1222+ [Define to 1 if compiler provides atomic builtins.])
1223+ ])
1224+
1225+])
1226\ No newline at end of file
1227
1228=== added file 'm4/pandora_have_libavahi.m4'
1229--- m4/pandora_have_libavahi.m4 1970-01-01 00:00:00 +0000
1230+++ m4/pandora_have_libavahi.m4 2009-12-18 22:04:13 +0000
1231@@ -0,0 +1,41 @@
1232+dnl Copyright (C) 2009 Sun Microsystems
1233+dnl This file is free software; Sun Microsystems
1234+dnl gives unlimited permission to copy and/or distribute it,
1235+dnl with or without modifications, as long as this notice is preserved.
1236+
1237+AC_DEFUN([_PANDORA_SEARCH_LIBAVAHI],[
1238+ AC_REQUIRE([AC_LIB_PREFIX])
1239+
1240+ dnl --------------------------------------------------------------------
1241+ dnl Check for libavahi
1242+ dnl --------------------------------------------------------------------
1243+
1244+ AC_ARG_ENABLE([libavahi],
1245+ [AS_HELP_STRING([--disable-libavahi],
1246+ [Build with libavahi support @<:@default=on@:>@])],
1247+ [ac_enable_libavahi="$enableval"],
1248+ [ac_enable_libavahi="yes"])
1249+
1250+ AS_IF([test "x$ac_enable_libavahi" = "xyes"],[
1251+ AC_LIB_HAVE_LINKFLAGS(avahi-client,avahi-common,[
1252+ #include <avahi-client/client.h>
1253+ #include <avahi-common/simple-watch.h>
1254+ ],[
1255+ AvahiSimplePoll *simple_poll= avahi_simple_poll_new();
1256+ ])
1257+ ],[
1258+ ac_cv_libavahi="no"
1259+ ])
1260+
1261+ AM_CONDITIONAL(HAVE_LIBAVAHI, [test "x${ac_cv_libavahi}" = "xyes"])
1262+])
1263+
1264+AC_DEFUN([PANDORA_HAVE_LIBAVAHI],[
1265+ AC_REQUIRE([_PANDORA_SEARCH_LIBAVAHI])
1266+])
1267+
1268+AC_DEFUN([PANDORA_REQUIRE_LIBAVAHI],[
1269+ AC_REQUIRE([_PANDORA_SEARCH_LIBAVAHI])
1270+ AS_IF([test "x${ac_cv_libavahi}" = "xno"],
1271+ AC_MSG_ERROR([libavahi is required for ${PACKAGE}]))
1272+])
1273
1274=== added file 'm4/pandora_have_libbdb.m4'
1275--- m4/pandora_have_libbdb.m4 1970-01-01 00:00:00 +0000
1276+++ m4/pandora_have_libbdb.m4 2009-12-18 22:04:13 +0000
1277@@ -0,0 +1,40 @@
1278+dnl Copyright (C) 2009 Sun Microsystems
1279+dnl This file is free software; Sun Microsystems
1280+dnl gives unlimited permission to copy and/or distribute it,
1281+dnl with or without modifications, as long as this notice is preserved.
1282+
1283+AC_DEFUN([_PANDORA_SEARCH_LIBBDB],[
1284+ AC_REQUIRE([AC_LIB_PREFIX])
1285+
1286+ dnl --------------------------------------------------------------------
1287+ dnl Check for bekerely db
1288+ dnl --------------------------------------------------------------------
1289+
1290+ AC_ARG_ENABLE([libbdb],
1291+ [AS_HELP_STRING([--disable-libbdb],
1292+ [Build with libbdb support @<:@default=on@:>@])],
1293+ [ac_enable_libbdb="$enableval"],
1294+ [ac_enable_libbdb="yes"])
1295+
1296+ AS_IF([test "x$ac_enable_libbdb" = "xyes"],[
1297+ AC_LIB_HAVE_LINKFLAGS(db,,[
1298+ #include <db.h>
1299+ ],[
1300+ const char *test= DB_VERSION_STRING;
1301+ ])
1302+ ],[
1303+ ac_cv_libbdb="no"
1304+ ])
1305+
1306+ AM_CONDITIONAL(HAVE_LIBBDB, [test "x${ac_cv_libbdb}" = "xyes"])
1307+])
1308+
1309+AC_DEFUN([PANDORA_HAVE_LIBBDB],[
1310+ AC_REQUIRE([_PANDORA_SEARCH_LIBBDB])
1311+])
1312+
1313+AC_DEFUN([PANDORA_REQUIRE_LIBBDB],[
1314+ AC_REQUIRE([_PANDORA_SEARCH_LIBBDB])
1315+ AS_IF([test "x${ac_cv_libbdb}" = "xno"],
1316+ AC_MSG_ERROR([libbdb is required for ${PACKAGE}]))
1317+])
1318
1319=== added file 'm4/pandora_have_libdl.m4'
1320--- m4/pandora_have_libdl.m4 1970-01-01 00:00:00 +0000
1321+++ m4/pandora_have_libdl.m4 2009-12-18 22:04:13 +0000
1322@@ -0,0 +1,51 @@
1323+dnl Copyright (C) 2009 Sun Microsystems
1324+dnl This file is free software; Sun Microsystems
1325+dnl gives unlimited permission to copy and/or distribute it,
1326+dnl with or without modifications, as long as this notice is preserved.
1327+
1328+#--------------------------------------------------------------------
1329+# Check for libdl
1330+#--------------------------------------------------------------------
1331+
1332+
1333+AC_DEFUN([_PANDORA_SEARCH_LIBDL],[
1334+
1335+ save_LIBS="$LIBS"
1336+ LIBS=""
1337+ AC_CHECK_LIB(dl,dlopen)
1338+ AC_CHECK_FUNCS(dlopen)
1339+ LIBDL_LIBS="$LIBS"
1340+ LIBS="$my_save_LIBS"
1341+ AC_SUBST(LIBDL_LIBS)
1342+
1343+ AM_CONDITIONAL(HAVE_LIBDL, [test "x${ac_cv_func_dlopen}" = "xyes"])
1344+])
1345+
1346+AC_DEFUN([_PANDORA_HAVE_LIBDL],[
1347+
1348+ AC_ARG_ENABLE([libdl],
1349+ [AS_HELP_STRING([--disable-libdl],
1350+ [Build with libdl support @<:@default=on@:>@])],
1351+ [ac_enable_libdl="$enableval"],
1352+ [ac_enable_libdl="yes"])
1353+
1354+ _PANDORA_SEARCH_LIBDL
1355+])
1356+
1357+
1358+AC_DEFUN([PANDORA_HAVE_LIBDL],[
1359+ AC_REQUIRE([_PANDORA_HAVE_LIBDL])
1360+])
1361+
1362+AC_DEFUN([_PANDORA_REQUIRE_LIBDL],[
1363+ ac_enable_libdl="yes"
1364+ _PANDORA_SEARCH_LIBDL
1365+
1366+ AS_IF([test "$ac_cv_func_dlopen" != "yes"],[
1367+ 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.])
1368+ ])
1369+])
1370+
1371+AC_DEFUN([PANDORA_REQUIRE_LIBDL],[
1372+ AC_REQUIRE([_PANDORA_REQUIRE_LIBDL])
1373+])
1374
1375=== added file 'm4/pandora_have_libevent.m4'
1376--- m4/pandora_have_libevent.m4 1970-01-01 00:00:00 +0000
1377+++ m4/pandora_have_libevent.m4 2009-12-18 22:04:13 +0000
1378@@ -0,0 +1,66 @@
1379+dnl Copyright (C) 2009 Sun Microsystems
1380+dnl This file is free software; Sun Microsystems
1381+dnl gives unlimited permission to copy and/or distribute it,
1382+dnl with or without modifications, as long as this notice is preserved.
1383+
1384+#--------------------------------------------------------------------
1385+# Check for libevent
1386+#--------------------------------------------------------------------
1387+
1388+
1389+AC_DEFUN([_PANDORA_SEARCH_LIBEVENT],[
1390+ AC_REQUIRE([AC_LIB_PREFIX])
1391+
1392+ AC_LIB_HAVE_LINKFLAGS(event,,
1393+ [
1394+ #include <sys/types.h>
1395+ #include <sys/time.h>
1396+ #include <stdlib.h>
1397+ #include <event.h>
1398+ ],[
1399+ struct bufferevent bev;
1400+ bufferevent_settimeout(&bev, 1, 1);
1401+ event_init();
1402+ event_loop(EVLOOP_ONCE);
1403+ ])
1404+
1405+ AM_CONDITIONAL(HAVE_LIBEVENT, [test "x${ac_cv_libevent}" = "xyes"])
1406+
1407+ AS_IF([test "x${ac_cv_libevent}" = "xyes"],[
1408+ save_LIBS="${LIBS}"
1409+ LIBS="${LIBS} ${LTLIBEVENT}"
1410+ AC_CHECK_FUNCS(event_base_new)
1411+ AC_CHECK_FUNCS(event_base_free)
1412+ AC_CHECK_FUNCS(event_base_get_method)
1413+ LIBS="$save_LIBS"
1414+ ])
1415+])
1416+
1417+AC_DEFUN([_PANDORA_HAVE_LIBEVENT],[
1418+
1419+ AC_ARG_ENABLE([libevent],
1420+ [AS_HELP_STRING([--disable-libevent],
1421+ [Build with libevent support @<:@default=on@:>@])],
1422+ [ac_enable_libevent="$enableval"],
1423+ [ac_enable_libevent="yes"])
1424+
1425+ _PANDORA_SEARCH_LIBEVENT
1426+])
1427+
1428+
1429+AC_DEFUN([PANDORA_HAVE_LIBEVENT],[
1430+ AC_REQUIRE([_PANDORA_HAVE_LIBEVENT])
1431+])
1432+
1433+AC_DEFUN([_PANDORA_REQUIRE_LIBEVENT],[
1434+ ac_enable_libevent="yes"
1435+ _PANDORA_SEARCH_LIBEVENT
1436+
1437+ AS_IF([test x$ac_cv_libevent = xno],[
1438+ 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.])
1439+ ])
1440+])
1441+
1442+AC_DEFUN([PANDORA_REQUIRE_LIBEVENT],[
1443+ AC_REQUIRE([_PANDORA_REQUIRE_LIBEVENT])
1444+])
1445
1446=== modified file 'm4/pandora_have_libgearman.m4'
1447--- m4/pandora_have_libgearman.m4 2009-07-29 18:13:26 +0000
1448+++ m4/pandora_have_libgearman.m4 2009-12-18 22:04:13 +0000
1449@@ -21,7 +21,7 @@
1450 #include <libgearman/gearman.h>
1451 ],[
1452 gearman_client_st gearman_client;
1453- gearman_version();
1454+ gearman_client_context(&gearman_client);
1455 ])
1456 ],[
1457 ac_cv_libgearman="no"
1458@@ -37,5 +37,5 @@
1459 AC_DEFUN([PANDORA_REQUIRE_LIBGEARMAN],[
1460 AC_REQUIRE([PANDORA_HAVE_LIBGEARMAN])
1461 AS_IF([test "x${ac_cv_libgearman}" = "xno"],
1462- AC_MSG_ERROR([libgearman is required for ${PACKAGE}]))
1463+ AC_MSG_ERROR([At least version 0.10 of libgearman is required for ${PACKAGE}]))
1464 ])
1465
1466=== modified file 'm4/pandora_have_libmemcached.m4'
1467--- m4/pandora_have_libmemcached.m4 2009-08-06 22:12:44 +0000
1468+++ m4/pandora_have_libmemcached.m4 2009-12-18 22:04:13 +0000
1469@@ -30,7 +30,6 @@
1470
1471 AM_CONDITIONAL(HAVE_LIBMEMCACHED, [test "x${ac_cv_libmemcached}" = "xyes"])
1472
1473- AS_IF([test "x${ac_cv_libmemcached}" = "xyes"], [ PANDORA_WITH_MEMCACHED ])
1474 ])
1475
1476 AC_DEFUN([PANDORA_HAVE_LIBMEMCACHED],[
1477
1478=== added file 'm4/pandora_have_libpcre.m4'
1479--- m4/pandora_have_libpcre.m4 1970-01-01 00:00:00 +0000
1480+++ m4/pandora_have_libpcre.m4 2009-12-18 22:04:13 +0000
1481@@ -0,0 +1,73 @@
1482+dnl Copyright (C) 2009 Sun Microsystems
1483+dnl This file is free software; Sun Microsystems
1484+dnl gives unlimited permission to copy and/or distribute it,
1485+dnl with or without modifications, as long as this notice is preserved.
1486+
1487+#--------------------------------------------------------------------
1488+# Check for libpcre
1489+#--------------------------------------------------------------------
1490+
1491+
1492+AC_DEFUN([_PANDORA_SEARCH_LIBPCRE],[
1493+ AC_REQUIRE([AC_LIB_PREFIX])
1494+
1495+ AC_LIB_HAVE_LINKFLAGS(pcre,,
1496+ [#include <pcre.h>],
1497+ [
1498+ pcre *re= NULL;
1499+ pcre_version();
1500+ ])
1501+ AS_IF([test "x$ac_cv_libpcre" = "xno"],
1502+ [
1503+ unset ac_cv_libpcre
1504+ unset HAVE_LIBPCRE
1505+ unset LIBPCRE
1506+ unset LIBPCRE_PREFIX
1507+ unset LTLIBPCRE
1508+ AC_LIB_HAVE_LINKFLAGS(pcre,,
1509+ [#include <pcre/pcre.h>],
1510+ [
1511+ pcre *re= NULL;
1512+ pcre_version();
1513+ ])
1514+ AS_IF([test "x$ac_cv_libpcre" = "xyes"], [
1515+ ac_cv_pcre_location="<pcre/pcre.h>"
1516+ ])
1517+ ],[
1518+ ac_cv_pcre_location="<pcre.h>"
1519+ ])
1520+
1521+ AM_CONDITIONAL(HAVE_LIBPCRE, [test "x${ac_cv_libpcre}" = "xyes"])
1522+])
1523+
1524+AC_DEFUN([_PANDORA_HAVE_LIBPCRE],[
1525+
1526+ AC_ARG_ENABLE([libpcre],
1527+ [AS_HELP_STRING([--disable-libpcre],
1528+ [Build with libpcre support @<:@default=on@:>@])],
1529+ [ac_enable_libpcre="$enableval"],
1530+ [ac_enable_libpcre="yes"])
1531+
1532+ _PANDORA_SEARCH_LIBPCRE
1533+])
1534+
1535+
1536+AC_DEFUN([PANDORA_HAVE_LIBPCRE],[
1537+ AC_REQUIRE([_PANDORA_HAVE_LIBPCRE])
1538+])
1539+
1540+AC_DEFUN([_PANDORA_REQUIRE_LIBPCRE],[
1541+ ac_enable_libpcre="yes"
1542+ _PANDORA_SEARCH_LIBPCRE
1543+
1544+ AS_IF([test x$ac_cv_libpcre = xno],[
1545+ 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.])
1546+ ],[
1547+ AC_DEFINE_UNQUOTED(PCRE_HEADER,[${ac_cv_pcre_location}],
1548+ [Location of pcre header])
1549+ ])
1550+])
1551+
1552+AC_DEFUN([PANDORA_REQUIRE_LIBPCRE],[
1553+ AC_REQUIRE([_PANDORA_REQUIRE_LIBPCRE])
1554+])
1555
1556=== added file 'm4/pandora_have_libreadline.m4'
1557--- m4/pandora_have_libreadline.m4 1970-01-01 00:00:00 +0000
1558+++ m4/pandora_have_libreadline.m4 2009-12-18 22:04:13 +0000
1559@@ -0,0 +1,242 @@
1560+#
1561+# SYNOPSIS
1562+#
1563+# PANDORA_HAVE_LIBREADLINE
1564+#
1565+# DESCRIPTION
1566+#
1567+# Searches for a readline compatible library. If found, defines
1568+# `HAVE_LIBREADLINE'. If the found library has the `add_history'
1569+# function, sets also `HAVE_READLINE_HISTORY'. Also checks for the
1570+# locations of the necessary include files and sets `HAVE_READLINE_H'
1571+# or `HAVE_READLINE_READLINE_H' and `HAVE_READLINE_HISTORY_H' or
1572+# 'HAVE_HISTORY_H' if the corresponding include files exists.
1573+#
1574+# The libraries that may be readline compatible are `libedit',
1575+# `libeditline' and `libreadline'. Sometimes we need to link a
1576+# termcap library for readline to work, this macro tests these cases
1577+# too by trying to link with `libtermcap', `libcurses' or
1578+# `libncurses' before giving up.
1579+#
1580+# Here is an example of how to use the information provided by this
1581+# macro to perform the necessary includes or declarations in a C
1582+# file:
1583+#
1584+# #ifdef HAVE_LIBREADLINE
1585+# # if defined(HAVE_READLINE_READLINE_H)
1586+# # include <readline/readline.h>
1587+# # elif defined(HAVE_READLINE_H)
1588+# # include <readline.h>
1589+# # else /* !defined(HAVE_READLINE_H) */
1590+# extern char *readline ();
1591+# # endif /* !defined(HAVE_READLINE_H) */
1592+# char *cmdline = NULL;
1593+# #else /* !defined(HAVE_READLINE_READLINE_H) */
1594+# /* no readline */
1595+# #endif /* HAVE_LIBREADLINE */
1596+#
1597+# #ifdef HAVE_READLINE_HISTORY
1598+# # if defined(HAVE_READLINE_HISTORY_H)
1599+# # include <readline/history.h>
1600+# # elif defined(HAVE_HISTORY_H)
1601+# # include <history.h>
1602+# # else /* !defined(HAVE_HISTORY_H) */
1603+# extern void add_history ();
1604+# extern int write_history ();
1605+# extern int read_history ();
1606+# # endif /* defined(HAVE_READLINE_HISTORY_H) */
1607+# /* no history */
1608+# #endif /* HAVE_READLINE_HISTORY */
1609+#
1610+# LAST MODIFICATION
1611+#
1612+# 2009-11-17
1613+#
1614+# Based on VL_LIB_READLINE from Ville Laurikari
1615+#
1616+# COPYLEFT
1617+#
1618+# Copyright (c) 2009 Monty Taylor
1619+# Copyright (c) 2002 Ville Laurikari <vl@iki.fi>
1620+#
1621+# Copying and distribution of this file, with or without
1622+# modification, are permitted in any medium without royalty provided
1623+# the copyright notice and this notice are preserved.
1624+
1625+AC_DEFUN([PANDORA_CHECK_TIOCGWINSZ],[
1626+ AC_CACHE_CHECK([for TIOCGWINSZ in sys/ioctl.h],
1627+ [pandora_cv_tiocgwinsz_in_ioctl],[
1628+ AC_COMPILE_IFELSE([
1629+ AC_LANG_PROGRAM([[
1630+#include <sys/types.h>
1631+#include <sys/ioctl.h>
1632+ ]],[[
1633+int x= TIOCGWINSZ;
1634+ ]])
1635+ ],[
1636+ pandora_cv_tiocgwinsz_in_ioctl=yes
1637+ ],[
1638+ pandora_cv_tiocgwinsz_in_ioctl=no
1639+ ])
1640+ ])
1641+ AS_IF([test "$pandora_cv_tiocgwinsz_in_ioctl" = "yes"],[
1642+ AC_DEFINE([GWINSZ_IN_SYS_IOCTL], [1],
1643+ [READLINE: your system defines TIOCGWINSZ in sys/ioctl.h.])
1644+ ])
1645+])
1646+
1647+AC_DEFUN([PANDORA_CHECK_RL_COMPENTRY], [
1648+ AC_CACHE_CHECK([defined rl_compentry_func_t], [pandora_cv_rl_compentry],[
1649+ AC_COMPILE_IFELSE([
1650+ AC_LANG_PROGRAM([[
1651+#include "stdio.h"
1652+#include "readline/readline.h"
1653+ ]],[[
1654+rl_compentry_func_t *func2= (rl_compentry_func_t*)0;
1655+ ]])
1656+ ],[
1657+ pandora_cv_rl_compentry=yes
1658+ ],[
1659+ pandora_cv_rl_compentry=no
1660+ ])
1661+ ])
1662+ AS_IF([test "$pandora_cv_rl_compentry" = "yes"],[
1663+ AC_DEFINE([HAVE_RL_COMPENTRY], [1],
1664+ [Does system provide rl_compentry_func_t])
1665+ ])
1666+
1667+ save_CXXFLAGS="${CXXFLAGS}"
1668+ CXXFLAGS="${AM_CXXFLAGS} ${CXXFLAGS}"
1669+ AC_LANG_PUSH(C++)
1670+ AC_CACHE_CHECK([rl_compentry_func_t works], [pandora_cv_rl_compentry_works],[
1671+ AC_COMPILE_IFELSE([
1672+ AC_LANG_PROGRAM([[
1673+#include "stdio.h"
1674+#include "readline/readline.h"
1675+ ]],[[
1676+rl_completion_entry_function= (rl_compentry_func_t*)NULL;
1677+ ]])
1678+ ],[
1679+ pandora_cv_rl_compentry_works=yes
1680+ ],[
1681+ pandora_cv_rl_compentry_works=no
1682+ ])
1683+ ])
1684+ AS_IF([test "$pandora_cv_rl_compentry_works" = "yes"],[
1685+ AC_DEFINE([HAVE_WORKING_RL_COMPENTRY], [1],
1686+ [Does system provide an rl_compentry_func_t that is usable])
1687+ ])
1688+ CXXFLAGS="${save_CXXFLAGS}"
1689+ AC_LANG_POP()
1690+])
1691+
1692+
1693+AC_DEFUN([PANDORA_CHECK_RL_COMPLETION_FUNC], [
1694+ AC_CACHE_CHECK([defined rl_completion_func_t], [pandora_cv_rl_completion],[
1695+ AC_COMPILE_IFELSE([
1696+ AC_LANG_PROGRAM([[
1697+#include "stdio.h"
1698+#include "readline/readline.h"
1699+ ]],[[
1700+rl_completion_func_t *func1= (rl_completion_func_t*)0;
1701+ ]])
1702+ ],[
1703+ pandora_cv_rl_completion=yes
1704+ ],[
1705+ pandora_cv_rl_completion=no
1706+ ])
1707+ ])
1708+ AS_IF([test "$pandora_cv_rl_completion" = "yes"],[
1709+ AC_DEFINE([HAVE_RL_COMPLETION], [1],
1710+ [Does system provide rl_completion_func_t])
1711+ ])
1712+])
1713+
1714+AC_DEFUN([_PANDORA_SEARCH_LIBREADLINE], [
1715+
1716+ save_LIBS="${LIBS}"
1717+ LIBS=""
1718+
1719+ AC_CACHE_CHECK([for a readline compatible library],
1720+ ac_cv_libreadline, [
1721+ ORIG_LIBS="$LIBS"
1722+ for readline_lib in readline edit editline; do
1723+ for termcap_lib in "" termcap curses ncurses; do
1724+ if test -z "$termcap_lib"; then
1725+ TRY_LIB="-l$readline_lib"
1726+ else
1727+ TRY_LIB="-l$readline_lib -l$termcap_lib"
1728+ fi
1729+ LIBS="$ORIG_LIBS $TRY_LIB"
1730+ AC_TRY_LINK_FUNC(readline, ac_cv_libreadline="$TRY_LIB")
1731+ if test -n "$ac_cv_libreadline"; then
1732+ break
1733+ fi
1734+ done
1735+ if test -n "$ac_cv_libreadline"; then
1736+ break
1737+ fi
1738+ done
1739+ if test -z "$ac_cv_libreadline"; then
1740+ ac_cv_libreadline="no"
1741+ LIBS="$ORIG_LIBS"
1742+ fi
1743+ ])
1744+
1745+ if test "$ac_cv_libreadline" != "no"; then
1746+ AC_DEFINE(HAVE_LIBREADLINE, 1,
1747+ [Define if you have a readline compatible library])
1748+ AC_CHECK_HEADERS(readline.h readline/readline.h)
1749+ AC_CACHE_CHECK([whether readline supports history],
1750+ ac_cv_libreadline_history, [
1751+ ac_cv_libreadline_history="no"
1752+ AC_TRY_LINK_FUNC(add_history, ac_cv_libreadline_history="yes")
1753+ ])
1754+ if test "$ac_cv_libreadline_history" = "yes"; then
1755+ AC_DEFINE(HAVE_READLINE_HISTORY, 1,
1756+ [Define if your readline library has \`add_history'])
1757+ AC_CHECK_HEADERS(history.h readline/history.h)
1758+ fi
1759+ fi
1760+ PANDORA_CHECK_RL_COMPENTRY
1761+ PANDORA_CHECK_RL_COMPLETION_FUNC
1762+ PANDORA_CHECK_TIOCGWINSZ
1763+
1764+
1765+ READLINE_LIBS="${LIBS}"
1766+ LIBS="${save_LIBS}"
1767+ AC_SUBST(READLINE_LIBS)
1768+
1769+ AM_CONDITIONAL(HAVE_LIBREADLINE, [test "x${ac_cv_libreadline}" = "xyes"])
1770+])
1771+
1772+AC_DEFUN([_PANDORA_HAVE_LIBREADLINE],[
1773+
1774+ AC_ARG_ENABLE([libreadline],
1775+ [AS_HELP_STRING([--disable-libreadline],
1776+ [Build with libreadline support @<:@default=on@:>@])],
1777+ [ac_enable_libreadline="$enableval"],
1778+ [ac_enable_libreadline="yes"])
1779+
1780+ _PANDORA_SEARCH_LIBREADLINE
1781+])
1782+
1783+
1784+AC_DEFUN([PANDORA_HAVE_LIBREADLINE],[
1785+ AC_REQUIRE([_PANDORA_HAVE_LIBREADLINE])
1786+])
1787+
1788+AC_DEFUN([_PANDORA_REQUIRE_LIBREADLINE],[
1789+ ac_enable_libreadline="yes"
1790+ _PANDORA_SEARCH_LIBREADLINE
1791+
1792+ AS_IF([test "x$ac_cv_libreadline" = "xno"],
1793+ 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.]))
1794+
1795+])
1796+
1797+AC_DEFUN([PANDORA_REQUIRE_LIBREADLINE],[
1798+ AC_REQUIRE([_PANDORA_REQUIRE_LIBREADLINE])
1799+])
1800+
1801+
1802
1803=== added file 'm4/pandora_have_libtokyocabinet.m4'
1804--- m4/pandora_have_libtokyocabinet.m4 1970-01-01 00:00:00 +0000
1805+++ m4/pandora_have_libtokyocabinet.m4 2009-12-18 22:04:13 +0000
1806@@ -0,0 +1,52 @@
1807+dnl Copyright (C) 2009 Sun Microsystems
1808+dnl This file is free software; Sun Microsystems
1809+dnl gives unlimited permission to copy and/or distribute it,
1810+dnl with or without modifications, as long as this notice is preserved.
1811+
1812+dnl Provides support for finding libtokyocabinet.
1813+dnl LIBTOKYOCABINET_CFLAGS will be set, in addition to LIBTOKYOCABINET and LTLIBTOKYOCABINET
1814+
1815+AC_DEFUN([_PANDORA_SEARCH_LIBTOKYOCABINET],[
1816+ AC_REQUIRE([AC_LIB_PREFIX])
1817+
1818+ dnl --------------------------------------------------------------------
1819+ dnl Check for libtokyocabinet
1820+ dnl --------------------------------------------------------------------
1821+
1822+ AC_ARG_ENABLE([libtokyocabinet],
1823+ [AS_HELP_STRING([--disable-libtokyocabinet],
1824+ [Build with libtokyocabinet support @<:@default=on@:>@])],
1825+ [ac_enable_libtokyocabinet="$enableval"],
1826+ [ac_enable_libtokyocabinet="yes"])
1827+
1828+ AS_IF([test "x$ac_enable_libtokyocabinet" = "xyes"],[
1829+ AC_LIB_HAVE_LINKFLAGS(tokyocabinet,,[
1830+#include <tcutil.h>
1831+ ],[
1832+const char *test= tcversion;
1833+ ])
1834+ ],[
1835+ ac_cv_libtokyocabinet="no"
1836+ ])
1837+
1838+ AS_IF([test "${ac_cv_libtokyocabinet}" = "no" -a "${ac_enable_libtokyocabinet}" = "yes"],[
1839+
1840+ PKG_CHECK_MODULES([LIBTOKYOCABINET], [libtokyocabinet], [
1841+ ac_cv_libtokyocabinet=yes
1842+ LTLIBTOKYOCABINET=${LIBTOKYOCABINET_LIBS}
1843+ LIBTOKYOCABINET=${LIBTOKYOCABINET_LIBS}
1844+ ],[])
1845+ ])
1846+
1847+ AM_CONDITIONAL(HAVE_LIBTOKYOCABINET, [test "${ac_cv_libtokyocabinet}" = "yes"])
1848+])
1849+
1850+AC_DEFUN([PANDORA_HAVE_LIBTOKYOCABINET],[
1851+ AC_REQUIRE([_PANDORA_SEARCH_LIBTOKYOCABINET])
1852+])
1853+
1854+AC_DEFUN([PANDORA_REQUIRE_LIBTOKYOCABINET],[
1855+ AC_REQUIRE([_PANDORA_SEARCH_LIBTOKYOCABINET])
1856+ AS_IF([test "x${ac_cv_libtokyocabinet}" = "xno"],
1857+ AC_MSG_ERROR([libtokyocabinet is required for ${PACKAGE}. On Debian systems this is found in libtokyocabinet-dev. On RedHat, in tokyocabinet-devel.]))
1858+])
1859
1860=== added file 'm4/pandora_have_libuuid.m4'
1861--- m4/pandora_have_libuuid.m4 1970-01-01 00:00:00 +0000
1862+++ m4/pandora_have_libuuid.m4 2009-12-18 22:04:13 +0000
1863@@ -0,0 +1,55 @@
1864+dnl Copyright (C) 2009 Sun Microsystems
1865+dnl This file is free software; Sun Microsystems
1866+dnl gives unlimited permission to copy and/or distribute it,
1867+dnl with or without modifications, as long as this notice is preserved.
1868+
1869+#--------------------------------------------------------------------
1870+# Check for libuuid
1871+#--------------------------------------------------------------------
1872+
1873+
1874+AC_DEFUN([_PANDORA_SEARCH_LIBUUID],[
1875+ AC_REQUIRE([AC_LIB_PREFIX])
1876+
1877+ dnl Do this by hand. Need to check for uuid/uuid.h, but uuid may or may
1878+ dnl not be a lib is weird.
1879+ AC_CHECK_HEADERS(uuid/uuid.h)
1880+ AC_LIB_HAVE_LINKFLAGS(uuid,,
1881+ [
1882+ #include <uuid/uuid.h>
1883+ ],
1884+ [
1885+ uuid_t uout;
1886+ uuid_generate(uout);
1887+ ])
1888+
1889+ AM_CONDITIONAL(HAVE_LIBUUID, [test "x${ac_cv_libuuid}" = "xyes"])
1890+])
1891+
1892+AC_DEFUN([_PANDORA_HAVE_LIBUUID],[
1893+
1894+ AC_ARG_ENABLE([libuuid],
1895+ [AS_HELP_STRING([--disable-libuuid],
1896+ [Build with libuuid support @<:@default=on@:>@])],
1897+ [ac_enable_libuuid="$enableval"],
1898+ [ac_enable_libuuid="yes"])
1899+
1900+ _PANDORA_SEARCH_LIBUUID
1901+])
1902+
1903+
1904+AC_DEFUN([PANDORA_HAVE_LIBUUID],[
1905+ AC_REQUIRE([_PANDORA_HAVE_LIBUUID])
1906+])
1907+
1908+AC_DEFUN([_PANDORA_REQUIRE_LIBUUID],[
1909+ ac_enable_libuuid="yes"
1910+ _PANDORA_SEARCH_LIBUUID
1911+ AS_IF([test "x$ac_cv_header_uuid_uuid_h" = "xno"],[
1912+ 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.])
1913+ ])
1914+])
1915+
1916+AC_DEFUN([PANDORA_REQUIRE_LIBUUID],[
1917+ AC_REQUIRE([_PANDORA_REQUIRE_LIBUUID])
1918+])
1919
1920=== added file 'm4/pandora_have_libxml2.m4'
1921--- m4/pandora_have_libxml2.m4 1970-01-01 00:00:00 +0000
1922+++ m4/pandora_have_libxml2.m4 2009-12-18 22:04:13 +0000
1923@@ -0,0 +1,52 @@
1924+dnl Copyright (C) 2009 Sun Microsystems
1925+dnl This file is free software; Sun Microsystems
1926+dnl gives unlimited permission to copy and/or distribute it,
1927+dnl with or without modifications, as long as this notice is preserved.
1928+
1929+dnl Provides support for finding libxml2.
1930+dnl LIBXML2_CFLAGS will be set, in addition to LIBXML2 and LTLIBXML2
1931+
1932+AC_DEFUN([_PANDORA_SEARCH_LIBXML2],[
1933+ AC_REQUIRE([AC_LIB_PREFIX])
1934+
1935+ dnl --------------------------------------------------------------------
1936+ dnl Check for libxml2
1937+ dnl --------------------------------------------------------------------
1938+
1939+ AC_ARG_ENABLE([libxml2],
1940+ [AS_HELP_STRING([--disable-libxml2],
1941+ [Build with libxml2 support @<:@default=on@:>@])],
1942+ [ac_enable_libxml2="$enableval"],
1943+ [ac_enable_libxml2="yes"])
1944+
1945+ AS_IF([test "x$ac_enable_libxml2" = "xyes"],[
1946+ AC_LIB_HAVE_LINKFLAGS(xml2,,[
1947+#include <libxml/xmlversion.h>
1948+ ],[
1949+const char *test= LIBXML_DOTTED_VERSION;
1950+ ])
1951+ ],[
1952+ ac_cv_libxml2="no"
1953+ ])
1954+
1955+ AS_IF([test "${ac_cv_libxml2}" = "no" -a "${ac_enable_libxml2}" = "yes"],[
1956+
1957+ PKG_CHECK_MODULES([LIBXML2], [libxml-2.0], [
1958+ ac_cv_libxml2=yes
1959+ LTLIBXML2=${LIBXML2_LIBS}
1960+ LIBXML2=${LIBXML2_LIBS}
1961+ ],[])
1962+ ])
1963+
1964+ AM_CONDITIONAL(HAVE_LIBXML2, [test "${ac_cv_libxml2}" = "yes"])
1965+])
1966+
1967+AC_DEFUN([PANDORA_HAVE_LIBXML2],[
1968+ AC_REQUIRE([_PANDORA_SEARCH_LIBXML2])
1969+])
1970+
1971+AC_DEFUN([PANDORA_REQUIRE_LIBXML2],[
1972+ AC_REQUIRE([_PANDORA_SEARCH_LIBXML2])
1973+ AS_IF([test "x${ac_cv_libxml2}" = "xno"],
1974+ AC_MSG_ERROR([libxml2 is required for ${PACKAGE}. On Debian systems this is found in libxml2-dev. On RedHat, libxml2-devel.]))
1975+])
1976
1977=== added file 'm4/pandora_have_libz.m4'
1978--- m4/pandora_have_libz.m4 1970-01-01 00:00:00 +0000
1979+++ m4/pandora_have_libz.m4 2009-12-18 22:04:13 +0000
1980@@ -0,0 +1,51 @@
1981+dnl Copyright (C) 2009 Sun Microsystems
1982+dnl This file is free software; Sun Microsystems
1983+dnl gives unlimited permission to copy and/or distribute it,
1984+dnl with or without modifications, as long as this notice is preserved.
1985+
1986+#--------------------------------------------------------------------
1987+# Check for libz
1988+#--------------------------------------------------------------------
1989+
1990+
1991+AC_DEFUN([_PANDORA_SEARCH_LIBZ],[
1992+ AC_REQUIRE([AC_LIB_PREFIX])
1993+
1994+ AC_LIB_HAVE_LINKFLAGS(z,,
1995+ [
1996+ #include <zlib.h>
1997+ ],[
1998+ crc32(0, Z_NULL, 0);
1999+ ])
2000+
2001+ AM_CONDITIONAL(HAVE_LIBZ, [test "x${ac_cv_libz}" = "xyes"])
2002+])
2003+
2004+AC_DEFUN([_PANDORA_HAVE_LIBZ],[
2005+
2006+ AC_ARG_ENABLE([libz],
2007+ [AS_HELP_STRING([--disable-libz],
2008+ [Build with libz support @<:@default=on@:>@])],
2009+ [ac_enable_libz="$enableval"],
2010+ [ac_enable_libz="yes"])
2011+
2012+ _PANDORA_SEARCH_LIBZ
2013+])
2014+
2015+
2016+AC_DEFUN([PANDORA_HAVE_LIBZ],[
2017+ AC_REQUIRE([_PANDORA_HAVE_LIBZ])
2018+])
2019+
2020+AC_DEFUN([_PANDORA_REQUIRE_LIBZ],[
2021+ ac_enable_libz="yes"
2022+ _PANDORA_SEARCH_LIBZ
2023+
2024+ AS_IF([test x$ac_cv_libz = xno],[
2025+ 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.])
2026+ ])
2027+])
2028+
2029+AC_DEFUN([PANDORA_REQUIRE_LIBZ],[
2030+ AC_REQUIRE([_PANDORA_REQUIRE_LIBZ])
2031+])
2032
2033=== modified file 'm4/pandora_header_assert.m4'
2034--- m4/pandora_header_assert.m4 2009-07-08 07:19:19 +0000
2035+++ m4/pandora_header_assert.m4 2009-12-18 22:04:13 +0000
2036@@ -8,6 +8,7 @@
2037 dnl Check whether to enable assertions.
2038 AC_DEFUN([PANDORA_HEADER_ASSERT],
2039 [
2040+ AC_CHECK_HEADERS(assert.h)
2041 AC_MSG_CHECKING([whether to enable assertions])
2042 AC_ARG_ENABLE([assert],
2043 [AS_HELP_STRING([--disable-assert],
2044@@ -16,8 +17,7 @@
2045 [ac_cv_assert="yes"])
2046 AC_MSG_RESULT([$ac_cv_assert])
2047
2048- AS_IF([test "$ac_cv_assert" = "yes"],
2049- [AC_CHECK_HEADERS(assert.h)],
2050+ AS_IF([test "$ac_cv_assert" = "no"],
2051 [AC_DEFINE(NDEBUG, 1, [Define to 1 if assertions should be disabled.])])
2052 ])
2053
2054
2055=== modified file 'm4/pandora_libtool.m4'
2056--- m4/pandora_libtool.m4 2009-07-08 07:19:19 +0000
2057+++ m4/pandora_libtool.m4 2009-12-18 22:04:13 +0000
2058@@ -4,7 +4,17 @@
2059 dnl with or without modifications, as long as this notice is preserved.
2060
2061 AC_DEFUN([PANDORA_LIBTOOL],[
2062+ AC_REQUIRE([AC_DISABLE_STATIC])
2063 AC_REQUIRE([AC_PROG_LIBTOOL])
2064+ m4_ifndef([LT_PREREQ],[
2065+ pandora_have_old_libtool=yes
2066+ ],[
2067+ pandora_have_old_libtool=no
2068+ ])
2069+ AS_IF([test "$SUNCC" = "yes" -a "${pandora_have_old_libtool}" = "yes"],[
2070+ AC_MSG_ERROR([Building ${PACKAGE} with Sun Studio requires at least libtool 2.2])
2071+ ])
2072+
2073 dnl By requiring AC_PROG_LIBTOOL, we should force the macro system to read
2074 dnl libtool.m4, where in 2.2 AC_PROG_LIBTOOL is an alias for LT_INIT
2075 dnl Then, if we're on 2.2, we should have LT_LANG, so we'll call it.
2076
2077=== modified file 'm4/pandora_plugins.m4'
2078--- m4/pandora_plugins.m4 2009-09-29 04:30:01 +0000
2079+++ m4/pandora_plugins.m4 2009-12-18 22:04:13 +0000
2080@@ -9,20 +9,32 @@
2081
2082 AC_DEFUN([PANDORA_PLUGINS],[
2083
2084- m4_sinclude(config/plugin.ac)
2085+ dnl We do this to prime the files from a fresh checkout. Normally we want
2086+ dnl these commands to be executed by make. Perhaps we should split them into
2087+ dnl a few shell script snippets in config and make Make call them... we're
2088+ dnl going to get there...
2089+ dnl ANYWAY - syscmd gets called during aclocal - so before automake. It will
2090+ dnl get called probably during autoconf too, so it's important to protect
2091+ dnl with test -f ... if the files exist, we don't have the chicken/egg
2092+ dnl problem and therefore don't need to do anything here
2093+ m4_syscmd([python config/pandora-plugin > /dev/null])
2094+ m4_syscmd([test -f config/plugin.stamp || touch config/plugin.stamp aclocal.m4])
2095+
2096+ m4_sinclude(config/pandora-plugin.ac)
2097+
2098 dnl Add code here to read set plugin lists and set drizzled_default_plugin_list
2099- AC_DEFINE_UNQUOTED([PANDORA_PLUGIN_LIST],[$pandora_default_plugin_list],
2100- [List of plugins that should be loaded on startup if no
2101- value is given for --plugin-load])
2102-
2103 pandora_builtin_list=`echo $pandora_builtin_list | sed 's/, *$//'`
2104 AS_IF([test "x$pandora_builtin_list" = "x"], pandora_builtin_list="NULL")
2105 AC_SUBST([PANDORA_BUILTIN_LIST],[$pandora_builtin_list])
2106+ AC_SUBST([PANDORA_PLUGIN_LIST],[$pandora_default_plugin_list])
2107 m4_ifval(m4_normalize([$1]),[
2108 AC_CONFIG_FILES($*)
2109 ],[
2110 AC_DEFINE_UNQUOTED([PANDORA_BUILTIN_LIST],[$pandora_builtin_list],
2111 [List of plugins to be built in])
2112+ AC_DEFINE_UNQUOTED([PANDORA_PLUGIN_LIST],["$pandora_default_plugin_list"],
2113+ [List of plugins that should be loaded on startup if no
2114+ value is given for --plugin-load])
2115 ])
2116
2117
2118
2119=== modified file 'm4/pandora_pthread.m4'
2120--- m4/pandora_pthread.m4 2009-09-29 04:30:01 +0000
2121+++ m4/pandora_pthread.m4 2009-12-18 22:04:13 +0000
2122@@ -53,6 +53,186 @@
2123 [pthread_yield function with one argument])
2124 ])
2125
2126+ AC_CHECK_FUNCS(pthread_attr_getstacksize pthread_attr_setprio \
2127+ pthread_attr_setschedparam \
2128+ pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
2129+ pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
2130+ pthread_setprio_np pthread_setschedparam pthread_sigmask \
2131+ pthread_attr_create rwlock_init
2132+)
2133+
2134+
2135+
2136+# Check definition of pthread_getspecific
2137+AC_CACHE_CHECK([args to pthread_getspecific], [pandora_cv_getspecific_args],
2138+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2139+#if !defined(_REENTRANT)
2140+#define _REENTRANT
2141+#endif
2142+#ifndef _POSIX_PTHREAD_SEMANTICS
2143+#define _POSIX_PTHREAD_SEMANTICS
2144+#endif
2145+#include <pthread.h>
2146+ ]], [[
2147+void *pthread_getspecific(pthread_key_t key);
2148+pthread_getspecific((pthread_key_t) NULL);
2149+ ]])],
2150+ [pandora_cv_getspecific_args=POSIX],
2151+ [pandora_cv_getspecific_args=other])])
2152+ if test "$pandora_cv_getspecific_args" = "other"
2153+ then
2154+ AC_DEFINE([HAVE_NONPOSIX_PTHREAD_GETSPECIFIC], [1],
2155+ [For some non posix threads])
2156+ fi
2157+
2158+ # Check definition of pthread_mutex_init
2159+ AC_CACHE_CHECK([args to pthread_mutex_init], [pandora_cv_mutex_init_args],
2160+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2161+#ifndef _REENTRANT
2162+#define _REENTRANT
2163+#endif
2164+#ifndef _POSIX_PTHREAD_SEMANTICS
2165+#define _POSIX_PTHREAD_SEMANTICS
2166+#endif
2167+#include <pthread.h> ]], [[
2168+ pthread_mutexattr_t attr;
2169+ pthread_mutex_t mp;
2170+ pthread_mutex_init(&mp,&attr); ]])],
2171+ [pandora_cv_mutex_init_args=POSIX],
2172+ [pandora_cv_mutex_init_args=other])])
2173+ if test "$pandora_cv_mutex_init_args" = "other"
2174+ then
2175+ AC_DEFINE([HAVE_NONPOSIX_PTHREAD_MUTEX_INIT], [1],
2176+ [For some non posix threads])
2177+ fi
2178+#---END:
2179+
2180+#---START: Used in for client configure
2181+# Check definition of readdir_r
2182+AC_CACHE_CHECK([args to readdir_r], [pandora_cv_readdir_r],
2183+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2184+#ifndef _REENTRANT
2185+#define _REENTRANT
2186+#endif
2187+#ifndef _POSIX_PTHREAD_SEMANTICS
2188+#define _POSIX_PTHREAD_SEMANTICS
2189+#endif
2190+#include <pthread.h>
2191+#include <dirent.h>]], [[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
2192+readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ]])],
2193+ [pandora_cv_readdir_r=POSIX],
2194+ [pandora_cv_readdir_r=other])])
2195+if test "$pandora_cv_readdir_r" = "POSIX"
2196+then
2197+ AC_DEFINE([HAVE_READDIR_R], [1], [POSIX readdir_r])
2198+fi
2199+
2200+# Check definition of posix sigwait()
2201+AC_CACHE_CHECK([style of sigwait], [pandora_cv_sigwait],
2202+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2203+#ifndef _REENTRANT
2204+#define _REENTRANT
2205+#endif
2206+#ifndef _POSIX_PTHREAD_SEMANTICS
2207+#define _POSIX_PTHREAD_SEMANTICS
2208+#endif
2209+#include <pthread.h>
2210+#include <signal.h>
2211+ ]], [[
2212+#ifndef _AIX
2213+sigset_t set;
2214+int sig;
2215+sigwait(&set,&sig);
2216+#endif
2217+ ]])],
2218+ [pandora_cv_sigwait=POSIX],
2219+ [pandora_cv_sigwait=other])])
2220+if test "$pandora_cv_sigwait" = "POSIX"
2221+then
2222+ AC_DEFINE([HAVE_SIGWAIT], [1], [POSIX sigwait])
2223+fi
2224+
2225+if test "$pandora_cv_sigwait" != "POSIX"
2226+then
2227+unset pandora_cv_sigwait
2228+# Check definition of posix sigwait()
2229+AC_CACHE_CHECK([style of sigwait], [pandora_cv_sigwait],
2230+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2231+#ifndef _REENTRANT
2232+#define _REENTRANT
2233+#endif
2234+#ifndef _POSIX_PTHREAD_SEMANTICS
2235+#define _POSIX_PTHREAD_SEMANTICS
2236+#endif
2237+#include <pthread.h>
2238+#include <signal.h>
2239+ ]], [[
2240+sigset_t set;
2241+int sig;
2242+sigwait(&set);
2243+ ]])],
2244+ [pandora_cv_sigwait=NONPOSIX],
2245+ [pandora_cv_sigwait=other])])
2246+if test "$pandora_cv_sigwait" = "NONPOSIX"
2247+then
2248+ AC_DEFINE([HAVE_NONPOSIX_SIGWAIT], [1], [sigwait with one argument])
2249+fi
2250+fi
2251+#---END:
2252+
2253+# Check if pthread_attr_setscope() exists
2254+AC_CACHE_CHECK([for pthread_attr_setscope], [pandora_cv_pthread_attr_setscope],
2255+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2256+#ifndef _REENTRANT
2257+#define _REENTRANT
2258+#endif
2259+#ifndef _POSIX_PTHREAD_SEMANTICS
2260+#define _POSIX_PTHREAD_SEMANTICS
2261+#endif
2262+#include <pthread.h>
2263+ ]], [[
2264+pthread_attr_t thr_attr;
2265+pthread_attr_setscope(&thr_attr,0);
2266+ ]])],
2267+ [pandora_cv_pthread_attr_setscope=yes],
2268+ [pandora_cv_pthread_attr_setscope=no])])
2269+if test "$pandora_cv_pthread_attr_setscope" = "yes"
2270+then
2271+ AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope])
2272+fi
2273+
2274+
2275+AC_CACHE_CHECK([if pthread_yield takes zero arguments], ac_cv_pthread_yield_zero_arg,
2276+[AC_TRY_LINK([#define _GNU_SOURCE
2277+#include <pthread.h>
2278+#ifdef __cplusplus
2279+extern "C"
2280+#endif
2281+],
2282+[
2283+ pthread_yield();
2284+], ac_cv_pthread_yield_zero_arg=yes, ac_cv_pthread_yield_zero_arg=yeso)])
2285+if test "$ac_cv_pthread_yield_zero_arg" = "yes"
2286+then
2287+ AC_DEFINE([HAVE_PTHREAD_YIELD_ZERO_ARG], [1],
2288+ [pthread_yield that doesn't take any arguments])
2289+fi
2290+AC_CACHE_CHECK([if pthread_yield takes 1 argument], ac_cv_pthread_yield_one_arg,
2291+[AC_TRY_LINK([#define _GNU_SOURCE
2292+#include <pthread.h>
2293+#ifdef __cplusplus
2294+extern "C"
2295+#endif
2296+],
2297+[
2298+ pthread_yield(0);
2299+], ac_cv_pthread_yield_one_arg=yes, ac_cv_pthread_yield_one_arg=no)])
2300+if test "$ac_cv_pthread_yield_one_arg" = "yes"
2301+then
2302+ AC_DEFINE([HAVE_PTHREAD_YIELD_ONE_ARG], [1],
2303+ [pthread_yield function with one argument])
2304+fi
2305+
2306 CFLAGS="${save_CFLAGS}"
2307 CXXFLAGS="${save_CXXFLAGS}"
2308 ])
2309
2310=== added file 'm4/pandora_run_cpplint.m4'
2311--- m4/pandora_run_cpplint.m4 1970-01-01 00:00:00 +0000
2312+++ m4/pandora_run_cpplint.m4 2009-12-18 22:04:13 +0000
2313@@ -0,0 +1,8 @@
2314+dnl Copyright (C) 2009 Sun Microsystems
2315+dnl This file is free software; Sun Microsystems
2316+dnl gives unlimited permission to copy and/or distribute it,
2317+dnl with or without modifications, as long as this notice is preserved.
2318+
2319+AC_DEFUN([PANDORA_RUN_CPPLINT],[
2320+ m4_syscmd([python config/make-lint.py])
2321+])
2322
2323=== added file 'm4/pandora_sasl.m4'
2324--- m4/pandora_sasl.m4 1970-01-01 00:00:00 +0000
2325+++ m4/pandora_sasl.m4 2009-12-18 22:04:13 +0000
2326@@ -0,0 +1,133 @@
2327+dnl Copyright (C) 2009 Sun Microsystems
2328+dnl This file is free software; Sun Microsystems
2329+dnl gives unlimited permission to copy and/or distribute it,
2330+dnl with or without modifications, as long as this notice is preserved.
2331+
2332+AC_DEFUN([_PANDORA_SEARCH_SASL],[
2333+ AC_REQUIRE([AC_LIB_PREFIX])
2334+
2335+ dnl --------------------------------------------------------------------
2336+ dnl Check for sasl
2337+ dnl --------------------------------------------------------------------
2338+ AC_ARG_ENABLE([sasl],
2339+ [AS_HELP_STRING([--disable-sasl],
2340+ [Build with sasl support @<:@default=on@:>@])],
2341+ [ac_enable_sasl="$enableval"],
2342+ [ac_enable_sasl="yes"])
2343+
2344+ AS_IF([test "x$ac_enable_sasl" = "xyes"],
2345+ [
2346+ AC_LIB_HAVE_LINKFLAGS(sasl,,[
2347+ #include <stdlib.h>
2348+ #include <sasl/sasl.h>
2349+ ],[
2350+ sasl_server_init(NULL, NULL);
2351+ ])
2352+
2353+ AS_IF([test "x${ac_cv_libsasl}" != "xyes" ],
2354+ [
2355+ AC_LIB_HAVE_LINKFLAGS(sasl2,,[
2356+ #include <stdlib.h>
2357+ #include <sasl/sasl.h>
2358+ ],[
2359+ sasl_server_init(NULL, NULL);
2360+ ])
2361+ HAVE_LIBSASL="$HAVE_LIBSASL2"
2362+ LIBSASL="$LIBSASL2"
2363+ LIBSASL_PREFIX="$LIBSASL2_PREFIX"
2364+ LTLIBSASL="$LT_LIBSASL2"
2365+ ])
2366+ ])
2367+
2368+ AS_IF([test "x${ac_cv_libsasl}" = "xyes" -o "x${ac_cv_libsasl2}" = "xyes"],
2369+ [ac_cv_sasl=yes],
2370+ [ac_cv_sasl=no])
2371+
2372+ AM_CONDITIONAL(HAVE_LIBSASL, [test "x${ac_cv_libsasl}" = "xyes"])
2373+ AM_CONDITIONAL(HAVE_LIBSASL2, [test "x${ac_cv_libsasl2}" = "xyes"])
2374+ AM_CONDITIONAL(HAVE_SASL, [test "x${ac_cv_sasl}" = "xyes"])
2375+])
2376+
2377+AC_DEFUN([PANDORA_HAVE_SASL],[
2378+ AC_REQUIRE([_PANDORA_SEARCH_SASL])
2379+])
2380+
2381+AC_DEFUN([PANDORA_REQUIRE_SASL],[
2382+ AC_REQUIRE([_PANDORA_SEARCH_SASL])
2383+ AS_IF([test "x${ac_cv_sasl}" = "xno"],
2384+ AC_MSG_ERROR([SASL (libsasl or libsasl2) is required for ${PACKAGE}]))
2385+])
2386+
2387+AC_DEFUN([_PANDORA_SEARCH_LIBSASL],[
2388+ AC_REQUIRE([AC_LIB_PREFIX])
2389+
2390+ dnl --------------------------------------------------------------------
2391+ dnl Check for libsasl
2392+ dnl --------------------------------------------------------------------
2393+
2394+ AC_ARG_ENABLE([libsasl],
2395+ [AS_HELP_STRING([--disable-libsasl],
2396+ [Build with libsasl support @<:@default=on@:>@])],
2397+ [ac_enable_libsasl="$enableval"],
2398+ [ac_enable_libsasl="yes"])
2399+
2400+ AS_IF([test "x$ac_enable_libsasl" = "xyes"],[
2401+ AC_LIB_HAVE_LINKFLAGS(sasl,,[
2402+ #include <stdlib.h>
2403+ #include <sasl/sasl.h>
2404+ ],[
2405+ sasl_server_init(NULL, NULL);
2406+ ])
2407+ ],[
2408+ ac_cv_libsasl="no"
2409+ ])
2410+
2411+ AM_CONDITIONAL(HAVE_LIBSASL, [test "x${ac_cv_libsasl}" = "xyes"])
2412+])
2413+
2414+AC_DEFUN([PANDORA_HAVE_LIBSASL],[
2415+ AC_REQUIRE([_PANDORA_SEARCH_LIBSASL])
2416+])
2417+
2418+AC_DEFUN([PANDORA_REQUIRE_LIBSASL],[
2419+ AC_REQUIRE([_PANDORA_SEARCH_LIBSASL])
2420+ AS_IF([test "x${ac_cv_libsasl}" = "xno"],
2421+ AC_MSG_ERROR([libsasl is required for ${PACKAGE}]))
2422+])
2423+
2424+AC_DEFUN([_PANDORA_SEARCH_LIBSASL2],[
2425+ AC_REQUIRE([AC_LIB_PREFIX])
2426+
2427+ dnl --------------------------------------------------------------------
2428+ dnl Check for libsasl2
2429+ dnl --------------------------------------------------------------------
2430+
2431+ AC_ARG_ENABLE([libsasl2],
2432+ [AS_HELP_STRING([--disable-libsasl2],
2433+ [Build with libsasl2 support @<:@default=on@:>@])],
2434+ [ac_enable_libsasl2="$enableval"],
2435+ [ac_enable_libsasl2="yes"])
2436+
2437+ AS_IF([test "x$ac_enable_libsasl2" = "xyes"],[
2438+ AC_LIB_HAVE_LINKFLAGS(sasl2,,[
2439+ #include <stdlib.h>
2440+ #include <sasl2/sasl2.h>
2441+ ],[
2442+ sasl2_server_init(NULL, NULL);
2443+ ])
2444+ ],[
2445+ ac_cv_libsasl2="no"
2446+ ])
2447+
2448+ AM_CONDITIONAL(HAVE_LIBSASL2, [test "x${ac_cv_libsasl2}" = "xyes"])
2449+])
2450+
2451+AC_DEFUN([PANDORA_HAVE_LIBSASL2],[
2452+ AC_REQUIRE([_PANDORA_SEARCH_LIBSASL2])
2453+])
2454+
2455+AC_DEFUN([PANDORA_REQUIRE_LIBSASL2],[
2456+ AC_REQUIRE([_PANDORA_SEARCH_LIBSASL2])
2457+ AS_IF([test "x${ac_cv_libsasl2}" = "xno"],
2458+ AC_MSG_ERROR([libsasl2 is required for ${PACKAGE}]))
2459+])
2460
2461=== modified file 'm4/pandora_shared_ptr.m4'
2462--- m4/pandora_shared_ptr.m4 2009-07-08 07:19:19 +0000
2463+++ m4/pandora_shared_ptr.m4 2009-12-18 22:04:13 +0000
2464@@ -20,6 +20,8 @@
2465 AC_DEFUN([PANDORA_SHARED_PTR],[
2466 AC_REQUIRE([PANDORA_CHECK_CXX_STANDARD])
2467 AC_LANG_PUSH(C++)
2468+ save_CXXFLAGS="${CXXFLAGS}"
2469+ CXXFLAGS="${CXX_STANDARD} ${CXXFLAGS}"
2470 AC_CHECK_HEADERS(memory tr1/memory boost/shared_ptr.hpp)
2471 AC_CACHE_CHECK([the location of shared_ptr header file],
2472 [ac_cv_shared_ptr_h],[
2473@@ -52,5 +54,6 @@
2474 AC_DEFINE_UNQUOTED([SHARED_PTR_NAMESPACE],
2475 ${ac_cv_shared_ptr_namespace},
2476 [The namespace in which SHARED_PTR can be found])
2477+ CXXFLAGS="${save_CXXFLAGS}"
2478 AC_LANG_POP()
2479 ])
2480
2481=== added file 'm4/pandora_stack_direction.m4'
2482--- m4/pandora_stack_direction.m4 1970-01-01 00:00:00 +0000
2483+++ m4/pandora_stack_direction.m4 2009-12-18 22:04:13 +0000
2484@@ -0,0 +1,39 @@
2485+dnl Copyright (C) 2009 Sun Microsystems
2486+dnl This file is free software; Sun Microsystems
2487+dnl gives unlimited permission to copy and/or distribute it,
2488+dnl with or without modifications, as long as this notice is preserved.
2489+
2490+#--------------------------------------------------------------------
2491+# Check what direction the stack runs in
2492+#--------------------------------------------------------------------
2493+
2494+AC_DEFUN([PANDORA_STACK_DIRECTION],[
2495+ AC_REQUIRE([AC_FUNC_ALLOCA])
2496+ AC_CACHE_CHECK([stack direction], [ac_cv_c_stack_direction],[
2497+ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
2498+#include <stdlib.h>
2499+ int find_stack_direction ()
2500+ {
2501+ static char *addr = 0;
2502+ auto char dummy;
2503+ if (addr == 0)
2504+ {
2505+ addr = &dummy;
2506+ return find_stack_direction ();
2507+ }
2508+ else
2509+ return (&dummy > addr) ? 1 : -1;
2510+ }
2511+ ]],[[
2512+ exit (find_stack_direction() < 0);
2513+ ]])],[
2514+ ac_cv_c_stack_direction=1
2515+ ],[
2516+ ac_cv_c_stack_direction=-1
2517+ ])
2518+ ])
2519+ AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
2520+])
2521+
2522+
2523+
2524
2525=== added file 'm4/pandora_stl_hash.m4'
2526--- m4/pandora_stl_hash.m4 1970-01-01 00:00:00 +0000
2527+++ m4/pandora_stl_hash.m4 2009-12-18 22:04:13 +0000
2528@@ -0,0 +1,110 @@
2529+# We check two things: where the include file is for hash_map, and
2530+# what namespace hash_map lives in within that include file. We
2531+# include AC_COMPILE_IFELSE for all the combinations we've seen in the
2532+# wild. We define one of HAVE_HASH_MAP or HAVE_EXT_HASH_MAP depending
2533+# on location, and HASH_NAMESPACE to be the namespace hash_map is
2534+# defined in.
2535+#
2536+# Ideally we'd use AC_CACHE_CHECK, but that only lets us store one value
2537+# at a time, and we need to store two (filename and namespace).
2538+# prints messages itself, so we have to do the message-printing ourselves
2539+# via AC_MSG_CHECKING + AC_MSG_RESULT. (TODO(csilvers): can we cache?)
2540+
2541+AC_DEFUN([PANDORA_CXX_STL_HASH],
2542+ [AC_MSG_CHECKING(the location of hash_map)
2543+ save_CXXFLAGS="${CXXFLAGS}"
2544+ CXXFLAGS="${AM_CXXFLAGS} ${CXXFLAGS}"
2545+ AC_LANG_PUSH(C++)
2546+ ac_cv_cxx_hash_map=""
2547+ for location in "" "ext/" "tr1/" ; do
2548+ for namespace in __gnu_cxx "" std stdext; do
2549+ for classprefix in unordered hash; do
2550+ if test -z "$ac_cv_cxx_hash_map"; then
2551+ AC_COMPILE_IFELSE(
2552+ [AC_LANG_PROGRAM([[#include <${location}${classprefix}_map>]],
2553+ [[${namespace}::${classprefix}_map<int, int> t]])],
2554+ [ac_cv_cxx_hash_map="<${location}${classprefix}_map>";
2555+ ac_cv_cxx_hash_set="<${location}${classprefix}_set>";
2556+ ac_cv_cxx_hash_namespace="$namespace";
2557+ ac_cv_cxx_hash_map_class="${classprefix}_map";
2558+ ac_cv_cxx_hash_set_class="${classprefix}_set"])
2559+
2560+ fi
2561+ done
2562+ done
2563+ done
2564+
2565+ if test -n "$ac_cv_cxx_hash_map"; then
2566+ AC_DEFINE(HAVE_HASH_MAP, 1, [define if the compiler has hash_map])
2567+ AC_DEFINE(HAVE_HASH_SET, 1, [define if the compiler has hash_set])
2568+ AC_DEFINE_UNQUOTED(HASH_MAP_H,$ac_cv_cxx_hash_map,
2569+ [the location of <hash_map>])
2570+ AC_DEFINE_UNQUOTED(HASH_SET_H,$ac_cv_cxx_hash_set,
2571+ [the location of <hash_set>])
2572+ AC_DEFINE_UNQUOTED(HASH_NAMESPACE,$ac_cv_cxx_hash_namespace,
2573+ [the namespace of hash_map/hash_set])
2574+ AC_DEFINE_UNQUOTED(HASH_MAP_CLASS,$ac_cv_cxx_hash_map_class,
2575+ [the classname of hash_map])
2576+ AC_DEFINE_UNQUOTED(HASH_SET_CLASS,$ac_cv_cxx_hash_set_class,
2577+ [the classname of hash_set])
2578+ AC_MSG_RESULT([$ac_cv_cxx_hash_map])
2579+ else
2580+ AC_MSG_RESULT()
2581+ AC_MSG_WARN([could not find an STL hash_map])
2582+ fi
2583+ AC_CACHE_CHECK(
2584+ [whether hash_map has rehash method],
2585+ [ac_cv_hash_map_has_rehash],
2586+ [AC_COMPILE_IFELSE(
2587+ [AC_LANG_PROGRAM([[
2588+#include HASH_MAP_H
2589+using namespace HASH_NAMESPACE;
2590+ ]],[[
2591+HASH_MAP_CLASS<int, int> test_hash;
2592+test_hash.rehash(100);
2593+ ]])],
2594+ [ac_cv_hash_map_has_rehash=yes],
2595+ [ac_cv_hash_map_has_rehash=no])])
2596+ AS_IF([test $ac_cv_hash_map_has_rehash = yes],[
2597+ AC_DEFINE(HASH_MAP_HAS_REHASH, 1, [if hash_map<> hash rehash method])
2598+ ])
2599+ AC_CACHE_CHECK(
2600+ [whether hash_map has resize method],
2601+ [ac_cv_hash_map_has_resize],
2602+ [AC_COMPILE_IFELSE(
2603+ [AC_LANG_PROGRAM([[
2604+#include HASH_MAP_H
2605+using namespace HASH_NAMESPACE;
2606+ ]],[[
2607+HASH_MAP_CLASS<int, int> test_hash;
2608+test_hash.resize(100);
2609+ ]])],
2610+ [ac_cv_hash_map_has_resize=yes],
2611+ [ac_cv_hash_map_has_resize=no])])
2612+ AS_IF([test $ac_cv_hash_map_has_resize = yes],[
2613+ AC_DEFINE(HASH_MAP_HAS_RESIZE, 1, [if hash_map<> hash resize method])
2614+ ])
2615+ AC_CACHE_CHECK(
2616+ [whether to redefine hash<string>],
2617+ [ac_cv_redefine_hash_string],
2618+ [AC_COMPILE_IFELSE(
2619+ [AC_LANG_PROGRAM([[
2620+#include HASH_SET_H
2621+#include <string>
2622+using namespace HASH_NAMESPACE;
2623+using namespace std;
2624+ ]],[[
2625+string teststr("test");
2626+HASH_SET_CLASS<string> test_hash;
2627+HASH_SET_CLASS<string>::iterator iter= test_hash.find(teststr);
2628+if (iter != test_hash.end())
2629+ return 1;
2630+ ]])],
2631+ [ac_cv_redefine_hash_string=no],
2632+ [ac_cv_redefine_hash_string=yes])])
2633+ AS_IF([test $ac_cv_redefine_hash_string = yes],[
2634+ AC_DEFINE(REDEFINE_HASH_STRING, 1, [if hash<string> needs to be defined])
2635+ ])
2636+ CXXFLAGS="${save_CXXFLAGS}"
2637+ AC_LANG_POP()
2638+])
2639
2640=== modified file 'm4/pandora_vc_build.m4'
2641--- m4/pandora_vc_build.m4 2009-09-29 04:30:01 +0000
2642+++ m4/pandora_vc_build.m4 2009-12-18 22:04:13 +0000
2643@@ -52,6 +52,72 @@
2644 AC_DEFINE(PEBI_PREFIX[RELEASE_VERSION], ["RELEASE_VERSION"], [$1 version number formatted for display])
2645 AC_DEFINE(PEBI_PREFIX[RELEASE_COMMENT], ["RELEASE_COMMENT"], [Set to trunk if the branch is the main $1 branch])
2646 AC_DEFINE(PEBI_PREFIX[RELEASE_ID], [RELEASE_ID], [$1 version number formatted for numerical comparison])
2647-
2648-])
2649-
2650+])
2651+
2652+AC_DEFUN([_PANDORA_READ_FROM_FILE],[
2653+ $1=`grep $1 $2 | cut -f2 -d=`
2654+])
2655+
2656+AC_DEFUN([PANDORA_VC_VERSION],[
2657+ AC_REQUIRE([PANDORA_BUILDING_FROM_VC])
2658+
2659+ PANDORA_RELEASE_DATE=`date +%Y.%m`
2660+ PANDORA_RELEASE_NODOTS_DATE=`date +%Y%m`
2661+
2662+ dnl Set some defaults
2663+ PANDORA_VC_REVNO="0"
2664+ PANDORA_VC_REVID="unknown"
2665+ PANDORA_VC_BRANCH="bzr-export"
2666+
2667+ AS_IF([test -f ${srcdir}/config/bzr_revinfo],[
2668+ _PANDORA_READ_FROM_FILE([PANDORA_VC_REVNO],${srcdir}/config/bzr_revinfo)
2669+ _PANDORA_READ_FROM_FILE([PANDORA_VC_REVID],${srcdir}/config/bzr_revinfo)
2670+ _PANDORA_READ_FROM_FILE([PANDORA_VC_BRANCH],
2671+ ${srcdir}/config/bzr_revinfo)
2672+ _PANDORA_READ_FROM_FILE([PANDORA_RELEASE_DATE],
2673+ ${srcdir}/config/bzr_revinfo)
2674+ _PANDORA_READ_FROM_FILE([PANDORA_RELEASE_NODOTS_DATE],
2675+ ${srcdir}/config/bzr_revinfo)
2676+ _PANDORA_READ_FROM_FILE([PANDORA_RELEASE_COMMENT],
2677+ ${srcdir}/config/bzr_revinfo)
2678+ ])
2679+ AS_IF([test "${ac_cv_building_from_bzr}" = "yes"],[
2680+dnl echo "Grabbing changelog and version information from bzr"
2681+dnl bzr log --short > ChangeLog || touch ChangeLog
2682+ PANDORA_BZR_REVNO=`bzr revno`
2683+ AS_IF([test "x$PANDORA_BZR_REVNO" != "${PANDORA_VC_REVNO}"],[
2684+ PANDORA_VC_REVNO="${PANDORA_BZR_REVNO}"
2685+ PANDORA_VC_REVID=`bzr log -r-1 --show-ids | grep revision-id | awk '{print $[]2}' | head -1`
2686+ PANDORA_VC_BRANCH=`bzr nick`
2687+ AS_IF([test "x${PANDORA_VC_BRANCH}" != "${PACKAGE}"],[
2688+ PANDORA_RELEASE_COMMENT="${PANDORA_VC_BRANCH}"
2689+ ],[
2690+ PANDORA_RELEASE_COMMENT="trunk"
2691+ ])
2692+ ])
2693+ ])
2694+ AS_IF([! test -d config],[mkdir -p config])
2695+ cat > "config/bzr_revinfo" <<EOF
2696+PANDORA_VC_REVNO=${PANDORA_VC_REVNO}
2697+PANDORA_VC_REVID=${PANDORA_VC_REVID}
2698+PANDORA_VC_BRANCH=${PANDORA_VC_BRANCH}
2699+PANDORA_RELEASE_DATE=${PANDORA_RELEASE_DATE}
2700+PANDORA_RELEASE_NODOTS_DATE=${PANDORA_RELEASE_NODOTS_DATE}
2701+PANDORA_RELEASE_COMMENT=${PANDORA_RELEASE_COMMENT}
2702+EOF
2703+
2704+ PANDORA_RELEASE_VERSION="${PANDORA_RELEASE_DATE}.${PANDORA_VC_REVNO}"
2705+ PANDORA_RELEASE_ID="${PANDORA_RELEASE_NODOTS_DATE}${PANDORA_VC_REVNO}"
2706+
2707+ VERSION="${PANDORA_RELEASE_VERSION}"
2708+ AC_DEFINE_UNQUOTED([PANDORA_RELEASE_VERSION],["${PANDORA_RELEASE_VERSION}"],
2709+ [The real version of the software])
2710+ AC_SUBST(PANDORA_VC_REVNO)
2711+ AC_SUBST(PANDORA_VC_REVID)
2712+ AC_SUBST(PANDORA_VC_BRANCH)
2713+ AC_SUBST(PANDORA_RELEASE_DATE)
2714+ AC_SUBST(PANDORA_RELEASE_NODOTS_DATE)
2715+ AC_SUBST(PANDORA_RELEASE_COMMENT)
2716+ AC_SUBST(PANDORA_RELEASE_VERSION)
2717+ AC_SUBST(PANDORA_RELEASE_ID)
2718+])
2719
2720=== added file 'm4/pandora_version.m4'
2721--- m4/pandora_version.m4 1970-01-01 00:00:00 +0000
2722+++ m4/pandora_version.m4 2009-12-18 22:04:13 +0000
2723@@ -0,0 +1,11 @@
2724+dnl Copyright (C) 2009 Sun Microsystems
2725+dnl This file is free software; Sun Microsystems
2726+dnl gives unlimited permission to copy and/or distribute it,
2727+dnl with or without modifications, as long as this notice is preserved.
2728+
2729+AC_DEFUN([PANDORA_VERSION],[
2730+
2731+ PANDORA_HEX_VERSION=`echo $VERSION | sed 's|[\-a-z0-9]*$||' | \
2732+ awk -F. '{printf "0x%0.2d%0.3d%0.3d", $[]1, $[]2, $[]3}'`
2733+ AC_SUBST([PANDORA_HEX_VERSION])
2734+])
2735
2736=== modified file 'm4/pandora_warnings.m4'
2737--- m4/pandora_warnings.m4 2009-10-20 18:30:03 +0000
2738+++ m4/pandora_warnings.m4 2009-12-18 22:04:13 +0000
2739@@ -50,6 +50,7 @@
2740
2741 AS_IF([test "$ac_profiling" = "yes"],[
2742 CC_PROFILING="-pg"
2743+ GCOV_LIBS="-pg -lgcov"
2744 save_LIBS="${LIBS}"
2745 LIBS=""
2746 AC_CHECK_LIB(c_p, read)
2747@@ -61,7 +62,12 @@
2748 ])
2749
2750 AS_IF([test "$ac_coverage" = "yes"],
2751- [CC_COVERAGE="-fprofile-arcs -ftest-coverage"])
2752+ [
2753+ CC_COVERAGE="--coverage"
2754+ GCOV_LIBS="-lgcov"
2755+ ])
2756+
2757+
2758
2759 AS_IF([test "$ac_cv_warnings_as_errors" = "yes"],
2760 [W_FAIL="-Werror"])
2761@@ -129,9 +135,9 @@
2762
2763 AS_IF([test "$INTELCC" = "yes"],[
2764 m4_if(PW_LESS_WARNINGS,[no],[
2765- BASE_WARNINGS="-w1 -Wall -Werror -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual"
2766+ BASE_WARNINGS="-w1 -Werror -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual"
2767 ],[
2768- BASE_WARNINGS="-w1 -Wall -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 981"
2769+ BASE_WARNINGS="-w1 -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 981"
2770 ])
2771 CC_WARNINGS="${BASE_WARNINGS}"
2772 CXX_WARNINGS="${BASE_WARNINGS}"
2773@@ -217,8 +223,8 @@
2774 AC_INCLUDES_DEFAULT])],
2775 [ac_cv_safe_to_use_Wredundant_decls_=yes],
2776 [ac_cv_safe_to_use_Wredundant_decls_=no])
2777- CXXFLAGS="${save_CXXFLAGS}"
2778- AC_LANG_POP()])
2779+ CXXFLAGS="${save_CXXFLAGS}"
2780+ AC_LANG_POP()])
2781 AS_IF([test "$ac_cv_safe_to_use_Wredundant_decls_" = "yes"],
2782 [CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"],
2783 [CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"])
2784@@ -339,5 +345,6 @@
2785 AC_SUBST(PROTOSKIP_WARNINGS)
2786 AC_SUBST(INNOBASE_SKIP_WARNINGS)
2787 AC_SUBST(NO_WERROR)
2788+ AC_SUBST([GCOV_LIBS])
2789
2790 ])
2791
2792=== added file 'm4/pandora_with_gettext.m4'
2793--- m4/pandora_with_gettext.m4 1970-01-01 00:00:00 +0000
2794+++ m4/pandora_with_gettext.m4 2009-12-18 22:04:13 +0000
2795@@ -0,0 +1,41 @@
2796+dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2797+dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
2798+dnl
2799+dnl pandora-build: A pedantic build system
2800+dnl Copyright (C) 2009 Sun Microsystems, Inc.
2801+dnl This file is free software; Sun Microsystems
2802+dnl gives unlimited permission to copy and/or distribute it,
2803+dnl with or without modifications, as long as this notice is preserved.
2804+dnl
2805+dnl From Monty Taylor
2806+
2807+AC_DEFUN([PANDORA_WITH_GETTEXT],[
2808+
2809+ m4_syscmd([if test -d po ; then
2810+ echo "# This file is auto-generated from configure. Do not edit directly" > po/POTFILES.in.stamp
2811+ PACKAGE=`grep ^AC_INIT configure.ac | cut -f2-3 -d[ | cut -f1 -d]`
2812+ for f in `find . | grep -v "${PACKAGE}-" | egrep '\.(cc|c|h|yy)$' | cut -c3- | sort`
2813+ do
2814+ if grep gettext.h "$f" | grep include >/dev/null 2>&1
2815+ then
2816+ echo "$f" >> po/POTFILES.in.stamp
2817+ fi
2818+ done
2819+ if diff po/POTFILES.in.stamp po/POTFILES.in >/dev/null 2>&1
2820+ then
2821+ rm po/POTFILES.in.stamp
2822+ else
2823+ mv po/POTFILES.in.stamp po/POTFILES.in
2824+ fi
2825+ fi])
2826+
2827+ AM_GNU_GETTEXT(external, need-formatstring-macros)
2828+ AM_GNU_GETTEXT_VERSION([0.17])
2829+ AS_IF([test "x$MSGMERGE" = "x" -o "x$MSGMERGE" = "x:"],[
2830+ AM_PATH_PROG_WITH_TEST(GMSGMERGE, gmsgmerge,
2831+ [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
2832+ MSGMERGE="${GMSGMERGE}"
2833+ ])
2834+ AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
2835+
2836+])
2837
2838=== modified file 'm4/pandora_with_memcached.m4'
2839--- m4/pandora_with_memcached.m4 2009-07-16 18:04:03 +0000
2840+++ m4/pandora_with_memcached.m4 2009-12-18 22:04:13 +0000
2841@@ -3,7 +3,7 @@
2842 dnl gives unlimited permission to copy and/or distribute it,
2843 dnl with or without modifications, as long as this notice is preserved.
2844
2845-AC_DEFUN([PANDORA_WITH_MEMCACHED],[
2846+AC_DEFUN([_PANDORA_SEARCH_MEMCACHED],[
2847
2848 AC_ARG_WITH([memcached],
2849 [AS_HELP_STRING([--with-memcached],
2850@@ -13,21 +13,28 @@
2851
2852 # just ignore the user if --without-memcached is passed.. it is
2853 # only used by make test
2854- AS_IF([test "x$withval" = "xno"],[
2855+ AS_IF([test "x$ac_cv_with_memcached" = "xno"],[
2856 ac_cv_with_memcached=memcached
2857 MEMCACHED_BINARY=memcached
2858 ],[
2859- AS_IF([test -f "$withval"],[
2860- ac_cv_with_memcached=$withval
2861- MEMCACHED_BINARY=$withval
2862+ AS_IF([test -f "$ac_cv_with_memcached"],[
2863+ MEMCACHED_BINARY=$ac_cv_with_memcached
2864 ],[
2865 AC_PATH_PROG([MEMCACHED_BINARY], [$ac_cv_with_memcached], "no")
2866- AS_IF([test "x$MEMCACHED_BINARY" = "xno"],[
2867- AC_MSG_ERROR(["could not find memcached binary"])
2868- ])
2869 ])
2870 ])
2871 AC_DEFINE_UNQUOTED([MEMCACHED_BINARY], "$MEMCACHED_BINARY",
2872 [Name of the memcached binary used in make test])
2873-
2874-])
2875+])
2876+
2877+AC_DEFUN([PANDORA_HAVE_MEMCACHED],[
2878+ AC_REQUIRE([_PANDORA_SEARCH_MEMCACHED])
2879+])
2880+
2881+AC_DEFUN([PANDORA_REQUIRE_MEMCACHED],[
2882+ AC_REQUIRE([PANDORA_HAVE_MEMCACHED])
2883+ AS_IF([test "x$MEMCACHED_BINARY" = "xno"],[
2884+ AC_MSG_ERROR(["could not find memcached binary"])
2885+ ])
2886+])
2887+
2888
2889=== removed file 'scripts/Makefile.am'
2890--- scripts/Makefile.am 2009-05-14 07:52:23 +0000
2891+++ scripts/Makefile.am 1970-01-01 00:00:00 +0000
2892@@ -1,8 +0,0 @@
2893-# Gearman server and library
2894-# Copyright (C) 2008 Brian Aker, Eric Day
2895-# All rights reserved.
2896-#
2897-# Use and distribution licensed under the BSD license. See
2898-# the COPYING file in this directory for full text.
2899-
2900-EXTRA_DIST= gearmand-init gearmand.xml gearmand README.solaris
2901
2902=== removed file 'support/Makefile.am'
2903--- support/Makefile.am 2009-04-01 01:49:18 +0000
2904+++ support/Makefile.am 1970-01-01 00:00:00 +0000
2905@@ -1,11 +0,0 @@
2906-# Gearman server and library
2907-# Copyright (C) 2008 Brian Aker, Eric Day
2908-# All rights reserved.
2909-#
2910-# Use and distribution licensed under the BSD license. See
2911-# the COPYING file in this directory for full text.
2912-
2913-EXTRA_DIST = gearmand.spec
2914-
2915-pkgconfigdir = $(libdir)/pkgconfig
2916-pkgconfig_DATA = gearmand.pc
2917
2918=== modified file 'tests/client_test.c'
2919--- tests/client_test.c 2009-10-29 20:18:00 +0000
2920+++ tests/client_test.c 2009-12-18 22:04:13 +0000
2921@@ -8,6 +8,10 @@
2922
2923 #include "config.h"
2924
2925+#if defined(NDEBUG)
2926+# undef NDEBUG
2927+#endif
2928+
2929 #include <assert.h>
2930 #include <stdio.h>
2931 #include <stdlib.h>
2932@@ -35,6 +39,7 @@
2933 test_return echo_test(void *object);
2934 test_return submit_job_test(void *object);
2935 test_return submit_null_job_test(void *object);
2936+test_return submit_fail_job_test(void *object);
2937 test_return background_test(void *object);
2938 test_return background_failure_test(void *object);
2939 test_return add_servers_test(void *object);
2940@@ -160,6 +165,24 @@
2941 return TEST_SUCCESS;
2942 }
2943
2944+test_return submit_fail_job_test(void *object)
2945+{
2946+ gearman_return_t rc;
2947+ gearman_client_st *client= (gearman_client_st *)object;
2948+ uint8_t *job_result;
2949+ size_t job_length;
2950+
2951+ job_result= gearman_client_do(client, "client_test", NULL, "fail", 4,
2952+ &job_length, &rc);
2953+ if (rc != GEARMAN_WORK_FAIL)
2954+ {
2955+ printf("submit_fail_job_test:%s\n", gearman_client_error(client));
2956+ return TEST_FAILURE;
2957+ }
2958+
2959+ return TEST_SUCCESS;
2960+}
2961+
2962 test_return background_test(void *object)
2963 {
2964 gearman_return_t rc;
2965@@ -339,13 +362,18 @@
2966 assert(workload == NULL && *result_size == 0);
2967 result= NULL;
2968 }
2969+ else if (*result_size == 4 && !memcmp(workload, "fail", 4))
2970+ {
2971+ *ret_ptr= GEARMAN_WORK_FAIL;
2972+ return NULL;
2973+ }
2974 else
2975 {
2976 assert((result= malloc(*result_size)) != NULL);
2977 memcpy(result, workload, *result_size);
2978 }
2979
2980- ret_ptr= GEARMAN_SUCCESS;
2981+ *ret_ptr= GEARMAN_SUCCESS;
2982 return result;
2983 }
2984
2985@@ -389,6 +417,7 @@
2986 {"echo", 0, echo_test },
2987 {"submit_job", 0, submit_job_test },
2988 {"submit_null_job", 0, submit_null_job_test },
2989+ {"submit_fail_job", 0, submit_fail_job_test },
2990 {"background", 0, background_test },
2991 {"background_failure", 0, background_failure_test },
2992 {"add_servers", 0, add_servers_test },
2993
2994=== modified file 'tests/client_test.rec'
2995--- tests/client_test.rec 2009-09-26 09:21:13 +0000
2996+++ tests/client_test.rec 2009-12-18 22:04:13 +0000
2997@@ -9,6 +9,7 @@
2998 Testing echo [ ok ]
2999 Testing submit_job [ ok ]
3000 Testing submit_null_job [ ok ]
3001+Testing submit_fail_job [ ok ]
3002 Testing background [ ok ]
3003 Testing background_failure [ ok ]
3004 Testing add_servers [ ok ]
3005
3006=== renamed file 'tests/Makefile.am' => 'tests/include.am'
3007--- tests/Makefile.am 2009-12-02 05:22:18 +0000
3008+++ tests/include.am 2009-12-18 22:04:13 +0000
3009@@ -5,66 +5,83 @@
3010 # Use and distribution licensed under the BSD license. See
3011 # the COPYING file in the parent directory for full text.
3012
3013+noinst_LTLIBRARIES+= tests/libtest.la
3014+tests_libtest_la_SOURCES= tests/test.c tests/test_gearmand.c
3015+
3016+TEST_LDADD = \
3017+ libgearman/libgearman.la \
3018+ libgearman-server/libgearman-server.la \
3019+ tests/libtest.la
3020+
3021 if HAVE_LIBMEMCACHED
3022 LIBMEMCACHED_PIDFILE = ${abs_top_builddir}/tests/Xumemc.pid
3023-LIBMEMCACHED_TEST= memcached_test
3024+LIBMEMCACHED_TEST= tests/memcached_test
3025 LIBMEMCACHED_SETUP= $(MEMCACHED_BINARY) -d -P ${LIBMEMCACHED_PIDFILE} -p 12555
3026 LIBMEMCACHED_TEARDOWN= cat ${LIBMEMCACHED_PIDFILE} | xargs kill
3027 LIBMEMCACHED_RM= rm ${LIBMEMCACHED_PIDFILE}
3028-LIBMEMCACHED_RES= memcached_test.res
3029-LIBMEMCACHED_REC= memcached_test.rec
3030-LIBMEMCACHED_RECORD= ./memcached_test > memcached_test.rec
3031-LIBMEMCACHED_RUN= ./memcached_test > memcached_test.res
3032-LIBMEMCACHED_CHECK= diff ${top_srcdir}/tests/memcached_test.rec memcached_test.res
3033-LIBMEMCACHED_VALGRIND= libtool --mode=execute valgrind --leak-check=yes --show-reachable=yes memcached_test
3034-memcached_test_SOURCES= test.c test_gearmand.c memcached_test.c
3035+LIBMEMCACHED_RES= tests/memcached_test.res
3036+LIBMEMCACHED_REC= ${top_srcdir}/tests/memcached_test.rec
3037+LIBMEMCACHED_RECORD= ${LIBMEMCACHED_TEST} > ${LIBMEMCACHED_REC}
3038+LIBMEMCACHED_RUN= ${LIBMEMCACHED_TEST} > ${LIBMEMCACHED_RES}
3039+LIBMEMCACHED_CHECK= diff ${LIBMEMCACHED_REC} ${LIBMEMCACHED_RES}
3040+LIBMEMCACHED_VALGRIND= libtool --mode=execute valgrind --leak-check=yes --show-reachable=yes ${LIBMEMCACHED_TEST}
3041+check_PROGRAMS += tests/memcached_test
3042 endif
3043
3044+tests_memcached_test_SOURCES= tests/memcached_test.c
3045+tests_memcached_test_LDADD= ${TEST_LDADD}
3046+
3047 if HAVE_LIBSQLITE3
3048-SQLITE_TEST= sqlite_test
3049-SQLITE_RES= sqlite_test.res
3050-SQLITE_REC= sqlite_test.rec
3051-SQLITE_RECORD= ./sqlite_test > sqlite_test.rec
3052-SQLITE_RUN= ./sqlite_test > sqlite_test.res
3053-SQLITE_CHECK= diff ${top_srcdir}/tests/sqlite_test.rec sqlite_test.res
3054-SQLITE_RM= rm -f gearman.sql gearman.sql-journal
3055-SQLITE_VALGRIND= libtool --mode=execute valgrind --leak-check=yes --show-reachable=yes sqlite_test
3056-sqlite_test_SOURCES= test.c test_gearmand.c sqlite_test.c
3057+SQLITE_TEST= tests/sqlite_test
3058+SQLITE_RES= tests/sqlite_test.res
3059+SQLITE_REC= ${top_srcdir}/tests/sqlite_test.rec
3060+SQLITE_RECORD= ${SQLITE_TEST} > ${SQLITE_REC}
3061+SQLITE_RUN= ${SQLITE_TEST} > ${SQLITE_RES}
3062+SQLITE_CHECK= diff ${SQLITE_REC} ${SQLITE_RES}
3063+SQLITE_RM= rm -f tests/gearman.sql tests/gearman.sql-journal
3064+SQLITE_VALGRIND= libtool --mode=execute valgrind --leak-check=yes --show-reachable=yes ${SQLITE_TEST}
3065+check_PROGRAMS += tests/sqlite_test
3066 endif
3067
3068-LDADD= \
3069- $(LTLIBUUID) \
3070- $(LTLIBEVENT) \
3071- $(top_builddir)/libgearman/libgearman.la \
3072- $(top_builddir)/libgearman-server/libgearman-server.la
3073-
3074-noinst_PROGRAMS= client_test worker_test cpp_test $(LIBMEMCACHED_TEST) $(SQLITE_TEST)
3075-noinst_HEADERS= test.h test_gearmand.h test_worker.h
3076-
3077-client_test_SOURCES= test.c test_gearmand.c test_worker.c client_test.c
3078-
3079-worker_test_SOURCES= test.c test_gearmand.c worker_test.c
3080+tests_sqlite_test_SOURCES= tests/sqlite_test.c
3081+tests_sqlite_test_LDADD= ${TEST_LDADD}
3082+
3083+
3084+check_PROGRAMS+= \
3085+ tests/client_test \
3086+ tests/worker_test \
3087+ tests/cpp_test
3088+
3089+noinst_HEADERS+= \
3090+ tests/test.h \
3091+ tests/test_gearmand.h \
3092+ tests/test_worker.h
3093+
3094+tests_client_test_SOURCES= tests/test_worker.c tests/client_test.c
3095+tests_client_test_LDADD= ${TEST_LDADD}
3096+
3097+tests_worker_test_SOURCES= tests/worker_test.c
3098+tests_worker_test_LDADD= ${TEST_LDADD}
3099
3100 # Test linking with C++ application
3101-cpp_test_SOURCES= cpp_test.cc
3102-
3103-CLEANFILES= client_test.res worker_test.res $(LIBMEMCACHED_RES) $(SQLITE_RES)
3104-
3105-EXTRA_DIST= client_test.rec worker_test.rec $(LIBMEMCACHED_REC) $(SQLITE_REC)
3106-
3107-record: client_test worker_test $(LIBMEMCACHED_TEST) $(SQLITE_TEST)
3108- ./client_test > client_test.rec
3109- ./worker_test > worker_test.rec
3110+tests_cpp_test_SOURCES= tests/cpp_test.cc
3111+tests_cpp_test_LDADD= ${TEST_LDADD}
3112+
3113+CLEANFILES+= tests/client_test.res tests/worker_test.res $(LIBMEMCACHED_RES) $(SQLITE_RES)
3114+
3115+EXTRA_DIST+= tests/client_test.rec tests/worker_test.rec $(LIBMEMCACHED_REC) $(SQLITE_REC)
3116+
3117+record: tests/client_test tests/worker_test $(LIBMEMCACHED_TEST) $(SQLITE_TEST)
3118+ tests/client_test > tests/client_test.rec
3119+ tests/worker_test > tests/worker_test.rec
3120 $(LIBMEMCACHED_RECORD)
3121 $(SQLITE_RECORD)
3122
3123-test: check
3124-
3125-check: client_test worker_test $(LIBMEMCACHED_TEST) $(SQLITE_TEST)
3126- ./client_test > client_test.res
3127- diff ${top_srcdir}/tests/client_test.rec client_test.res
3128- ./worker_test > worker_test.res
3129- diff ${top_srcdir}/tests/worker_test.rec worker_test.res
3130+check-local:
3131+ tests/client_test > tests/client_test.res
3132+ diff ${top_srcdir}/tests/client_test.rec tests/client_test.res
3133+ tests/worker_test > tests/worker_test.res
3134+ diff ${top_srcdir}/tests/worker_test.rec tests/worker_test.res
3135 $(LIBMEMCACHED_SETUP)
3136 $(LIBMEMCACHED_RUN)
3137 $(LIBMEMCACHED_CHECK)
3138@@ -74,8 +91,8 @@
3139 $(SQLITE_CHECK)
3140 $(SQLITE_RM)
3141
3142-valgrind: client_test worker_test $(LIBMEMCACHED_TEST) $(SQLITE_VALGRIND)
3143- libtool --mode=execute valgrind --leak-check=yes --show-reachable=yes client_test
3144- libtool --mode=execute valgrind --leak-check=yes --show-reachable=yes worker_test
3145+valgrind: ${check_PROGRAMS}
3146+ libtool --mode=execute valgrind --leak-check=yes --show-reachable=yes tests/client_test
3147+ libtool --mode=execute valgrind --leak-check=yes --show-reachable=yes tests/worker_test
3148 $(LIBMEMCACHED_VALGRIND)
3149 $(SQLITE_VALGRIND)
3150
3151=== modified file 'tests/memcached_test.c'
3152--- tests/memcached_test.c 2009-10-29 20:18:00 +0000
3153+++ tests/memcached_test.c 2009-12-18 22:04:13 +0000
3154@@ -8,6 +8,10 @@
3155
3156 #include "config.h"
3157
3158+#if defined(NDEBUG)
3159+# undef NDEBUG
3160+#endif
3161+
3162 #include <assert.h>
3163 #include <stdio.h>
3164 #include <stdlib.h>
3165
3166=== modified file 'tests/sqlite_test.c'
3167--- tests/sqlite_test.c 2009-11-06 00:38:02 +0000
3168+++ tests/sqlite_test.c 2009-12-18 22:04:13 +0000
3169@@ -8,6 +8,10 @@
3170
3171 #include "config.h"
3172
3173+#if defined(NDEBUG)
3174+# undef NDEBUG
3175+#endif
3176+
3177 #include <assert.h>
3178 #include <stdio.h>
3179 #include <stdlib.h>
3180@@ -138,7 +142,7 @@
3181 void *world_create(void)
3182 {
3183 worker_test_st *test;
3184- const char *argv[2]= { "test_gearmand", "--libsqlite3-db=gearman.sql"};
3185+ const char *argv[2]= { "test_gearmand", "--libsqlite3-db=tests/gearman.sql"};
3186
3187 assert((test= malloc(sizeof(worker_test_st))) != NULL);
3188 memset(test, 0, sizeof(worker_test_st));
3189
3190=== modified file 'tests/test_gearmand.c'
3191--- tests/test_gearmand.c 2009-09-24 23:43:15 +0000
3192+++ tests/test_gearmand.c 2009-12-18 22:04:13 +0000
3193@@ -8,6 +8,10 @@
3194
3195 #include "config.h"
3196
3197+#if defined(NDEBUG)
3198+# undef NDEBUG
3199+#endif
3200+
3201 #include <stdio.h>
3202 #include <string.h>
3203 #include <assert.h>
3204
3205=== modified file 'tests/worker_test.c'
3206--- tests/worker_test.c 2009-11-04 22:09:06 +0000
3207+++ tests/worker_test.c 2009-12-18 22:04:13 +0000
3208@@ -8,6 +8,10 @@
3209
3210 #include "config.h"
3211
3212+#if defined(NDEBUG)
3213+# undef NDEBUG
3214+#endif
3215+
3216 #include <assert.h>
3217 #include <stdio.h>
3218 #include <stdlib.h>

Subscribers

People subscribed via source and target branches

to all changes: