1 diff -urN --exclude *.m4 memcached-1.4.4/Makefile.am repcached-2.2-1.4.4/Makefile.am
2 --- memcached-1.4.4/Makefile.am Fri Oct 30 04:24:52 2009
3 +++ repcached-2.2-1.4.4/Makefile.am Tue Feb 9 23:02:45 2010
5 memcached_SOURCES += sasl_defs.c
9 +memcached_SOURCES += replication.h replication.c
12 memcached_debug_SOURCES = $(memcached_SOURCES)
13 memcached_CPPFLAGS = -DNDEBUG
14 memcached_debug_LDADD = @PROFILER_LDFLAGS@
15 diff -urN --exclude *.m4 memcached-1.4.4/Makefile.in repcached-2.2-1.4.4/Makefile.in
16 --- memcached-1.4.4/Makefile.in Fri Nov 27 09:34:57 2009
17 +++ repcached-2.2-1.4.4/Makefile.in Wed Feb 10 19:12:15 2010
19 @BUILD_CACHE_TRUE@am__append_2 = cache.c
20 @BUILD_SOLARIS_PRIVS_TRUE@am__append_3 = solaris_priv.c
21 @ENABLE_SASL_TRUE@am__append_4 = sasl_defs.c
22 -@BUILD_DTRACE_TRUE@am__append_5 = memcached_dtrace.h
23 +@ENABLE_REPLICATION_TRUE@am__append_5 = replication.h replication.c
24 @BUILD_DTRACE_TRUE@am__append_6 = memcached_dtrace.h
25 -@DTRACE_INSTRUMENT_OBJ_TRUE@am__append_7 = memcached_dtrace.o
26 +@BUILD_DTRACE_TRUE@am__append_7 = memcached_dtrace.h
27 @DTRACE_INSTRUMENT_OBJ_TRUE@am__append_8 = memcached_dtrace.o
28 -@DTRACE_INSTRUMENT_OBJ_TRUE@am__append_9 = memcached_debug_dtrace.o
29 +@DTRACE_INSTRUMENT_OBJ_TRUE@am__append_9 = memcached_dtrace.o
30 @DTRACE_INSTRUMENT_OBJ_TRUE@am__append_10 = memcached_debug_dtrace.o
31 -@DTRACE_INSTRUMENT_OBJ_TRUE@am__append_11 = memcached_dtrace.o memcached_debug_dtrace.o
32 +@DTRACE_INSTRUMENT_OBJ_TRUE@am__append_11 = memcached_debug_dtrace.o
33 +@DTRACE_INSTRUMENT_OBJ_TRUE@am__append_12 = memcached_dtrace.o memcached_debug_dtrace.o
35 DIST_COMMON = README $(am__configure_deps) $(pkginclude_HEADERS) \
36 $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
38 am__memcached_SOURCES_DIST = memcached.c memcached.h hash.c hash.h \
39 slabs.c slabs.h items.c items.h assoc.c assoc.h thread.c \
40 daemon.c stats.c stats.h util.c util.h trace.h cache.h \
41 - sasl_defs.h cache.c solaris_priv.c sasl_defs.c
42 + sasl_defs.h cache.c solaris_priv.c sasl_defs.c replication.h \
44 @BUILD_CACHE_TRUE@am__objects_1 = memcached-cache.$(OBJEXT)
45 @BUILD_SOLARIS_PRIVS_TRUE@am__objects_2 = \
46 @BUILD_SOLARIS_PRIVS_TRUE@ memcached-solaris_priv.$(OBJEXT)
47 @ENABLE_SASL_TRUE@am__objects_3 = memcached-sasl_defs.$(OBJEXT)
48 +@ENABLE_REPLICATION_TRUE@am__objects_4 = \
49 +@ENABLE_REPLICATION_TRUE@ memcached-replication.$(OBJEXT)
50 am_memcached_OBJECTS = memcached-memcached.$(OBJEXT) \
51 memcached-hash.$(OBJEXT) memcached-slabs.$(OBJEXT) \
52 memcached-items.$(OBJEXT) memcached-assoc.$(OBJEXT) \
53 memcached-thread.$(OBJEXT) memcached-daemon.$(OBJEXT) \
54 memcached-stats.$(OBJEXT) memcached-util.$(OBJEXT) \
55 - $(am__objects_1) $(am__objects_2) $(am__objects_3)
56 + $(am__objects_1) $(am__objects_2) $(am__objects_3) \
58 memcached_OBJECTS = $(am_memcached_OBJECTS)
59 am__memcached_debug_SOURCES_DIST = memcached.c memcached.h hash.c \
60 hash.h slabs.c slabs.h items.c items.h assoc.c assoc.h \
61 thread.c daemon.c stats.c stats.h util.c util.h trace.h \
62 - cache.h sasl_defs.h cache.c solaris_priv.c sasl_defs.c
63 -@BUILD_CACHE_TRUE@am__objects_4 = memcached_debug-cache.$(OBJEXT)
64 -@BUILD_SOLARIS_PRIVS_TRUE@am__objects_5 = memcached_debug-solaris_priv.$(OBJEXT)
65 -@ENABLE_SASL_TRUE@am__objects_6 = memcached_debug-sasl_defs.$(OBJEXT)
66 -am__objects_7 = memcached_debug-memcached.$(OBJEXT) \
67 + cache.h sasl_defs.h cache.c solaris_priv.c sasl_defs.c \
68 + replication.h replication.c
69 +@BUILD_CACHE_TRUE@am__objects_5 = memcached_debug-cache.$(OBJEXT)
70 +@BUILD_SOLARIS_PRIVS_TRUE@am__objects_6 = memcached_debug-solaris_priv.$(OBJEXT)
71 +@ENABLE_SASL_TRUE@am__objects_7 = memcached_debug-sasl_defs.$(OBJEXT)
72 +@ENABLE_REPLICATION_TRUE@am__objects_8 = memcached_debug-replication.$(OBJEXT)
73 +am__objects_9 = memcached_debug-memcached.$(OBJEXT) \
74 memcached_debug-hash.$(OBJEXT) memcached_debug-slabs.$(OBJEXT) \
75 memcached_debug-items.$(OBJEXT) \
76 memcached_debug-assoc.$(OBJEXT) \
77 memcached_debug-thread.$(OBJEXT) \
78 memcached_debug-daemon.$(OBJEXT) \
79 memcached_debug-stats.$(OBJEXT) memcached_debug-util.$(OBJEXT) \
80 - $(am__objects_4) $(am__objects_5) $(am__objects_6)
81 -am_memcached_debug_OBJECTS = $(am__objects_7)
82 + $(am__objects_5) $(am__objects_6) $(am__objects_7) \
84 +am_memcached_debug_OBJECTS = $(am__objects_9)
85 memcached_debug_OBJECTS = $(am_memcached_debug_OBJECTS)
86 memcached_debug_LINK = $(CCLD) $(memcached_debug_CFLAGS) $(CFLAGS) \
87 $(AM_LDFLAGS) $(LDFLAGS) -o $@
89 sizes_OBJECTS = sizes.$(OBJEXT)
90 sizes_LDADD = $(LDADD)
91 am__testapp_SOURCES_DIST = testapp.c util.c util.h cache.c
92 -@BUILD_CACHE_TRUE@am__objects_8 = cache.$(OBJEXT)
93 -am_testapp_OBJECTS = testapp.$(OBJEXT) util.$(OBJEXT) $(am__objects_8)
94 +@BUILD_CACHE_TRUE@am__objects_10 = cache.$(OBJEXT)
95 +am_testapp_OBJECTS = testapp.$(OBJEXT) util.$(OBJEXT) \
97 testapp_OBJECTS = $(am_testapp_OBJECTS)
98 testapp_LDADD = $(LDADD)
99 am_timedrun_OBJECTS = timedrun.$(OBJEXT)
100 @@ -261,21 +270,22 @@
101 top_builddir = @top_builddir@
102 top_srcdir = @top_srcdir@
103 pkginclude_HEADERS = protocol_binary.h
104 -BUILT_SOURCES = $(am__append_5)
105 +BUILT_SOURCES = $(am__append_6)
106 testapp_SOURCES = testapp.c util.c util.h $(am__append_2)
107 timedrun_SOURCES = timedrun.c
108 memcached_SOURCES = memcached.c memcached.h hash.c hash.h slabs.c \
109 slabs.h items.c items.h assoc.c assoc.h thread.c daemon.c \
110 stats.c stats.h util.c util.h trace.h cache.h sasl_defs.h \
111 - $(am__append_1) $(am__append_3) $(am__append_4)
112 + $(am__append_1) $(am__append_3) $(am__append_4) \
114 memcached_debug_SOURCES = $(memcached_SOURCES)
115 memcached_CPPFLAGS = -DNDEBUG
116 -memcached_debug_LDADD = @PROFILER_LDFLAGS@ $(am__append_9)
117 +memcached_debug_LDADD = @PROFILER_LDFLAGS@ $(am__append_10)
118 memcached_debug_CFLAGS = @PROFILER_FLAGS@
119 -memcached_LDADD = $(am__append_7)
120 -memcached_DEPENDENCIES = $(am__append_8)
121 -memcached_debug_DEPENDENCIES = $(am__append_10)
122 -CLEANFILES = $(am__append_6) $(am__append_11)
123 +memcached_LDADD = $(am__append_8)
124 +memcached_DEPENDENCIES = $(am__append_9)
125 +memcached_debug_DEPENDENCIES = $(am__append_11)
126 +CLEANFILES = $(am__append_7) $(am__append_12)
129 EXTRA_DIST = doc scripts t memcached.spec memcached_dtrace.d version.m4
131 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcached-hash.Po@am__quote@
132 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcached-items.Po@am__quote@
133 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcached-memcached.Po@am__quote@
134 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcached-replication.Po@am__quote@
135 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcached-sasl_defs.Po@am__quote@
136 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcached-slabs.Po@am__quote@
137 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcached-solaris_priv.Po@am__quote@
139 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcached_debug-hash.Po@am__quote@
140 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcached_debug-items.Po@am__quote@
141 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcached_debug-memcached.Po@am__quote@
142 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcached_debug-replication.Po@am__quote@
143 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcached_debug-sasl_defs.Po@am__quote@
144 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcached_debug-slabs.Po@am__quote@
145 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcached_debug-solaris_priv.Po@am__quote@
147 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
148 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(memcached_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memcached-sasl_defs.obj `if test -f 'sasl_defs.c'; then $(CYGPATH_W) 'sasl_defs.c'; else $(CYGPATH_W) '$(srcdir)/sasl_defs.c'; fi`
150 +memcached-replication.o: replication.c
151 +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(memcached_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT memcached-replication.o -MD -MP -MF $(DEPDIR)/memcached-replication.Tpo -c -o memcached-replication.o `test -f 'replication.c' || echo '$(srcdir)/'`replication.c
152 +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/memcached-replication.Tpo $(DEPDIR)/memcached-replication.Po
153 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='replication.c' object='memcached-replication.o' libtool=no @AMDEPBACKSLASH@
154 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
155 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(memcached_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memcached-replication.o `test -f 'replication.c' || echo '$(srcdir)/'`replication.c
157 +memcached-replication.obj: replication.c
158 +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(memcached_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT memcached-replication.obj -MD -MP -MF $(DEPDIR)/memcached-replication.Tpo -c -o memcached-replication.obj `if test -f 'replication.c'; then $(CYGPATH_W) 'replication.c'; else $(CYGPATH_W) '$(srcdir)/replication.c'; fi`
159 +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/memcached-replication.Tpo $(DEPDIR)/memcached-replication.Po
160 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='replication.c' object='memcached-replication.obj' libtool=no @AMDEPBACKSLASH@
161 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
162 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(memcached_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memcached-replication.obj `if test -f 'replication.c'; then $(CYGPATH_W) 'replication.c'; else $(CYGPATH_W) '$(srcdir)/replication.c'; fi`
164 memcached_debug-memcached.o: memcached.c
165 @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(memcached_debug_CFLAGS) $(CFLAGS) -MT memcached_debug-memcached.o -MD -MP -MF $(DEPDIR)/memcached_debug-memcached.Tpo -c -o memcached_debug-memcached.o `test -f 'memcached.c' || echo '$(srcdir)/'`memcached.c
166 @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/memcached_debug-memcached.Tpo $(DEPDIR)/memcached_debug-memcached.Po
168 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sasl_defs.c' object='memcached_debug-sasl_defs.obj' libtool=no @AMDEPBACKSLASH@
169 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
170 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(memcached_debug_CFLAGS) $(CFLAGS) -c -o memcached_debug-sasl_defs.obj `if test -f 'sasl_defs.c'; then $(CYGPATH_W) 'sasl_defs.c'; else $(CYGPATH_W) '$(srcdir)/sasl_defs.c'; fi`
172 +memcached_debug-replication.o: replication.c
173 +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(memcached_debug_CFLAGS) $(CFLAGS) -MT memcached_debug-replication.o -MD -MP -MF $(DEPDIR)/memcached_debug-replication.Tpo -c -o memcached_debug-replication.o `test -f 'replication.c' || echo '$(srcdir)/'`replication.c
174 +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/memcached_debug-replication.Tpo $(DEPDIR)/memcached_debug-replication.Po
175 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='replication.c' object='memcached_debug-replication.o' libtool=no @AMDEPBACKSLASH@
176 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
177 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(memcached_debug_CFLAGS) $(CFLAGS) -c -o memcached_debug-replication.o `test -f 'replication.c' || echo '$(srcdir)/'`replication.c
179 +memcached_debug-replication.obj: replication.c
180 +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(memcached_debug_CFLAGS) $(CFLAGS) -MT memcached_debug-replication.obj -MD -MP -MF $(DEPDIR)/memcached_debug-replication.Tpo -c -o memcached_debug-replication.obj `if test -f 'replication.c'; then $(CYGPATH_W) 'replication.c'; else $(CYGPATH_W) '$(srcdir)/replication.c'; fi`
181 +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/memcached_debug-replication.Tpo $(DEPDIR)/memcached_debug-replication.Po
182 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='replication.c' object='memcached_debug-replication.obj' libtool=no @AMDEPBACKSLASH@
183 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
184 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(memcached_debug_CFLAGS) $(CFLAGS) -c -o memcached_debug-replication.obj `if test -f 'replication.c'; then $(CYGPATH_W) 'replication.c'; else $(CYGPATH_W) '$(srcdir)/replication.c'; fi`
185 install-pkgincludeHEADERS: $(pkginclude_HEADERS)
187 test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)"
188 diff -urN --exclude *.m4 memcached-1.4.4/assoc.c repcached-2.2-1.4.4/assoc.c
189 --- memcached-1.4.4/assoc.c Sat Oct 24 00:38:01 2009
190 +++ repcached-2.2-1.4.4/assoc.c Tue Feb 9 23:02:45 2010
195 +#ifdef USE_REPLICATION
196 +char *assoc_key_snap(int *n)
204 + int hm = hashsize(hashpower);
208 + if(expanding && hs < hashsize(hashpower - 1) && hs >= expand_bucket){
209 + i = old_hashtable[hs];
211 + i = primary_hashtable[hs];
221 + if((p = b = malloc(sz))){
224 + if(expanding && hs < hashsize(hashpower - 1) && hs >= expand_bucket){
225 + i = old_hashtable[hs];
227 + i = primary_hashtable[hs];
230 + memcpy(p, ITEM_key(i), i->nkey);
242 +#endif /* USE_REPLICATION */
243 diff -urN --exclude *.m4 memcached-1.4.4/assoc.h repcached-2.2-1.4.4/assoc.h
244 --- memcached-1.4.4/assoc.h Sun Aug 30 03:00:58 2009
245 +++ repcached-2.2-1.4.4/assoc.h Tue Feb 9 23:02:45 2010
247 int start_assoc_maintenance_thread(void);
248 void stop_assoc_maintenance_thread(void);
250 +#ifdef USE_REPLICATION
251 +char *assoc_key_snap(int *n);
252 +#endif /*USE_REPLICATION*/
253 diff -urN --exclude *.m4 memcached-1.4.4/config.guess repcached-2.2-1.4.4/config.guess
254 --- memcached-1.4.4/config.guess Sat Aug 22 04:38:32 2009
255 +++ repcached-2.2-1.4.4/config.guess Tue Jan 19 12:34:08 2010
258 # Attempt to guess a canonical system name.
259 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
260 -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
261 -# Free Software Foundation, Inc.
262 +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
264 -timestamp='2008-09-28'
265 +timestamp='2003-07-02'
267 # This file is free software; you can redistribute it and/or modify it
268 # under the terms of the GNU General Public License as published by
271 # You should have received a copy of the GNU General Public License
272 # along with this program; if not, write to the Free Software
273 -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
275 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
277 # As a special exception to the GNU General Public License, if you
278 # distribute this file as part of a program that contains a
279 # configuration script generated by Autoconf, you may include it under
280 # the same distribution terms that you use for the rest of that program.
283 # Originally written by Per Bothner <per@bothner.com>.
284 # Please send patches to <config-patches@gnu.org>. Submit a context
285 # diff and a properly formatted ChangeLog entry.
287 GNU config.guess ($timestamp)
289 Originally written by Per Bothner.
290 -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
291 -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
292 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
293 +Free Software Foundation, Inc.
295 This is free software; see the source for copying conditions. There is NO
296 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
298 while test $# -gt 0 ; do
300 --time-stamp | --time* | -t )
301 - echo "$timestamp" ; exit ;;
302 + echo "$timestamp" ; exit 0 ;;
304 - echo "$version" ; exit ;;
305 + echo "$version" ; exit 0 ;;
307 - echo "$usage"; exit ;;
308 + echo "$usage"; exit 0 ;;
309 -- ) # Stop option processing
311 - ) # Use stdin as input.
313 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
314 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
316 - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
317 + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
318 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
319 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
320 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
323 ,,*) CC_FOR_BUILD=$CC ;;
324 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
325 -esac ; set_cc_for_build= ;'
328 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
329 # (ghazi@noc.rutgers.edu 1994-08-24)
331 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
332 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
334 -if [ "${UNAME_SYSTEM}" = "Linux" ] ; then
335 - eval $set_cc_for_build
336 - cat << EOF > $dummy.c
337 - #include <features.h>
339 - # ifdef __UCLIBC_CONFIG_VERSION__
340 - LIBC=uclibc __UCLIBC_CONFIG_VERSION__
348 - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'`
351 # Note: order is significant - the case branches are not exclusive.
353 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
355 arm*) machine=arm-unknown ;;
356 sh3el) machine=shl-unknown ;;
357 sh3eb) machine=sh-unknown ;;
358 - sh5el) machine=sh5le-unknown ;;
359 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
361 # The Operating System including object format, if it has switched
362 @@ -217,32 +196,50 @@
363 # contains redundant information, the shorter form:
364 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
365 echo "${machine}-${os}${release}"
369 + echo m68k-unknown-openbsd${UNAME_RELEASE}
372 + echo mipsel-unknown-openbsd${UNAME_RELEASE}
375 + echo m68k-unknown-openbsd${UNAME_RELEASE}
377 + mac68k:OpenBSD:*:*)
378 + echo m68k-unknown-openbsd${UNAME_RELEASE}
380 + macppc:OpenBSD:*:*)
381 + echo powerpc-unknown-openbsd${UNAME_RELEASE}
383 + mvme68k:OpenBSD:*:*)
384 + echo m68k-unknown-openbsd${UNAME_RELEASE}
386 + mvme88k:OpenBSD:*:*)
387 + echo m88k-unknown-openbsd${UNAME_RELEASE}
389 + mvmeppc:OpenBSD:*:*)
390 + echo powerpc-unknown-openbsd${UNAME_RELEASE}
393 + echo mipsel-unknown-openbsd${UNAME_RELEASE}
396 + echo mipseb-unknown-openbsd${UNAME_RELEASE}
399 + echo m68k-unknown-openbsd${UNAME_RELEASE}
401 + wgrisc:OpenBSD:*:*)
402 + echo mipsel-unknown-openbsd${UNAME_RELEASE}
405 - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
406 - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
409 - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
412 - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
415 - echo powerpc-unknown-mirbsd${UNAME_RELEASE}
418 - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
420 + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
423 - case $UNAME_RELEASE in
425 + if test $UNAME_RELEASE = "V4.0"; then
426 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
429 - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
433 # According to Compaq, /usr/sbin/psrinfo has been available on
434 # OSF/1 and Tru64 systems produced since 1995. I hope that
435 # covers most systems running today. This code pipes the CPU
436 @@ -280,49 +277,42 @@
438 UNAME_MACHINE="alphaev79" ;;
440 - # A Pn.n version is a patched version.
441 # A Vn.n version is a released version.
442 # A Tn.n version is a released field test version.
443 # A Xn.n version is an unreleased experimental baselevel.
444 # 1.2 uses "1.2" for uname -r.
445 - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
447 + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
449 + Alpha*:OpenVMS:*:*)
452 Alpha\ *:Windows_NT*:*)
453 # How do we know it's Interix rather than the generic POSIX subsystem?
454 # Should we change UNAME_MACHINE based on the output of uname instead
455 # of the specific Alpha model?
456 echo alpha-pc-interix
459 21064:Windows_NT:50:3)
460 echo alpha-dec-winnt3.5
463 Amiga*:UNIX_System_V:4.0:*)
464 echo m68k-unknown-sysv4
467 *:[Aa]miga[Oo][Ss]:*:*)
468 echo ${UNAME_MACHINE}-unknown-amigaos
471 *:[Mm]orph[Oo][Ss]:*:*)
472 echo ${UNAME_MACHINE}-unknown-morphos
476 echo i370-ibm-openedition
479 - echo s390-ibm-zvmoe
482 - echo powerpc-ibm-os400
485 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
486 echo arm-acorn-riscix${UNAME_RELEASE}
488 - arm:riscos:*:*|arm:RISCOS:*:*)
489 - echo arm-unknown-riscos
492 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
493 echo hppa1.1-hitachi-hiuxmpp
496 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
497 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
498 if test "`(/bin/universe) 2>/dev/null`" = att ; then
499 @@ -330,32 +320,32 @@
501 echo pyramid-pyramid-bsd
506 echo pyramid-pyramid-svr4
509 DRS?6000:unix:4.0:6*)
512 - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
514 + DRS?6000:UNIX_SV:4.2*:7*)
515 case `/usr/bin/uname -p` in
516 - sparc) echo sparc-icl-nx7; exit ;;
517 + sparc) echo sparc-icl-nx7 && exit 0 ;;
520 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
523 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
524 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
526 - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
529 echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
533 # According to config.sub, this is the proper way to canonicalize
534 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
535 # it's likely to be more like Solaris than SunOS4.
536 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
540 case "`/usr/bin/arch -k`" in
542 @@ -364,10 +354,10 @@
544 # Japanese Language versions have a version number like `4.1.3-JL'.
545 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
549 echo m68k-sun-sunos${UNAME_RELEASE}
553 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
554 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
555 @@ -379,10 +369,10 @@
556 echo sparc-sun-sunos${UNAME_RELEASE}
562 echo sparc-auspex-sunos${UNAME_RELEASE}
565 # The situation for MiNT is a little confusing. The machine name
566 # can be virtually everything (everything which is not
567 # "atarist" or "atariste" at least should have a processor
568 @@ -393,40 +383,37 @@
570 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
571 echo m68k-atari-mint${UNAME_RELEASE}
574 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
575 echo m68k-atari-mint${UNAME_RELEASE}
578 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
579 echo m68k-atari-mint${UNAME_RELEASE}
582 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
583 echo m68k-milan-mint${UNAME_RELEASE}
586 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
587 echo m68k-hades-mint${UNAME_RELEASE}
590 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
591 echo m68k-unknown-mint${UNAME_RELEASE}
594 - echo m68k-apple-machten${UNAME_RELEASE}
598 echo powerpc-apple-machten${UNAME_RELEASE}
602 echo mips-dec-mach_bsd4.3
606 echo mips-dec-ultrix${UNAME_RELEASE}
610 echo vax-dec-ultrix${UNAME_RELEASE}
613 2020:CLIX:*:* | 2430:CLIX:*:*)
614 echo clipper-intergraph-clix${UNAME_RELEASE}
617 mips:*:*:UMIPS | mips:*:*:RISCos)
618 eval $set_cc_for_build
619 sed 's/^ //' << EOF >$dummy.c
620 @@ -450,33 +437,32 @@
624 - $CC_FOR_BUILD -o $dummy $dummy.c &&
625 - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
626 - SYSTEM_NAME=`$dummy $dummyarg` &&
627 - { echo "$SYSTEM_NAME"; exit; }
628 + $CC_FOR_BUILD -o $dummy $dummy.c \
629 + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
631 echo mips-mips-riscos${UNAME_RELEASE}
634 Motorola:PowerMAX_OS:*:*)
635 echo powerpc-motorola-powermax
638 Motorola:*:4.3:PL8-*)
639 echo powerpc-harris-powermax
642 Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
643 echo powerpc-harris-powermax
646 Night_Hawk:Power_UNIX:*:*)
647 echo powerpc-harris-powerunix
651 echo m88k-harris-cxux7
655 echo m88k-motorola-sysv4
659 echo m88k-motorola-sysv3
663 # DG/UX returns AViiON for all architectures
664 UNAME_PROCESSOR=`/usr/bin/uname -p`
665 @@ -492,29 +478,29 @@
667 echo i586-dg-dgux${UNAME_RELEASE}
671 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
672 echo m88k-dolphin-sysv3
676 # Delta 88k system running SVR3
677 echo m88k-motorola-sysv3
680 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
681 echo m88k-tektronix-sysv3
684 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
685 echo m68k-tektronix-bsd
689 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
692 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
693 - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
694 - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
695 + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
696 + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
702 if [ -x /usr/bin/oslevel ] ; then
703 IBM_REV=`/usr/bin/oslevel`
705 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
707 echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
711 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
712 eval $set_cc_for_build
713 @@ -537,19 +523,15 @@
717 - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
719 - echo "$SYSTEM_NAME"
721 - echo rs6000-ibm-aix3.2.5
723 + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
724 + echo rs6000-ibm-aix3.2.5
725 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
726 echo rs6000-ibm-aix3.2.4
728 echo rs6000-ibm-aix3.2
734 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
735 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
737 @@ -562,28 +544,28 @@
738 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
740 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
747 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
751 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
752 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
753 - exit ;; # report: romp-ibm BSD 4.3
754 + exit 0 ;; # report: romp-ibm BSD 4.3
756 echo rs6000-bull-bosx
763 9000/[34]??:4.3bsd:1.*:*)
767 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
771 9000/[34678]??:HP-UX:*:*)
772 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
773 case "${UNAME_MACHINE}" in
776 if [ ${HP_ARCH} = "hppa2.0w" ]
778 - eval $set_cc_for_build
780 - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
781 - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
782 - # generating 64-bit code. GNU and HP use different nomenclature:
784 - # $ CC_FOR_BUILD=cc ./config.guess
785 - # => hppa2.0w-hp-hpux11.23
786 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
787 - # => hppa64-hp-hpux11.23
789 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
790 - grep __LP64__ >/dev/null
791 + # avoid double evaluation of $set_cc_for_build
792 + test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
793 + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
797 @@ -665,11 +637,11 @@
800 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
804 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
805 echo ia64-hp-hpux${HPUX_REV}
809 eval $set_cc_for_build
810 sed 's/^ //' << EOF >$dummy.c
811 @@ -697,192 +669,153 @@
815 - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
816 - { echo "$SYSTEM_NAME"; exit; }
817 + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
818 echo unknown-hitachi-hiuxwe2
821 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
829 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
830 echo hppa1.0-hp-mpeix
833 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
842 if [ -x /usr/sbin/sysversion ] ; then
843 echo ${UNAME_MACHINE}-unknown-osf1mk
845 echo ${UNAME_MACHINE}-unknown-osf1
850 echo hppa1.1-hp-lites
853 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
857 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
858 if getsysinfo -f scalar_acc
859 then echo c32-convex-bsd
860 else echo c2-convex-bsd
864 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
868 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
872 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
877 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
881 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
882 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
883 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
888 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
892 echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
896 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
900 - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
902 + echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
904 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
905 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
906 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
907 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
908 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
910 - 5000:UNIX_System_V:4.*:*)
911 - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
912 - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
913 - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
916 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
917 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
921 echo sparc-unknown-bsdi${UNAME_RELEASE}
925 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
928 - case ${UNAME_MACHINE} in
930 - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
932 - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
934 - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
938 + *:FreeBSD:*:*|*:GNU/FreeBSD:*:*)
939 + # Determine whether the default compiler uses glibc.
940 + eval $set_cc_for_build
941 + sed 's/^ //' << EOF >$dummy.c
942 + #include <features.h>
949 + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
950 + # GNU/FreeBSD systems have a "k" prefix to indicate we are using
951 + # FreeBSD's kernel, but not the complete OS.
952 + case ${LIBC} in gnu) kernel_only='k' ;; esac
953 + echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
956 echo ${UNAME_MACHINE}-pc-cygwin
961 echo ${UNAME_MACHINE}-pc-mingw32
964 - # uname -m includes "-pc" on this system.
965 - echo ${UNAME_MACHINE}-mingw32
969 echo ${UNAME_MACHINE}-pc-pw32
971 - *:Interix*:[3456]*)
972 - case ${UNAME_MACHINE} in
974 - echo i586-pc-interix${UNAME_RELEASE}
976 - EM64T | authenticamd | genuineintel)
977 - echo x86_64-unknown-interix${UNAME_RELEASE}
980 - echo ia64-unknown-interix${UNAME_RELEASE}
984 + x86:Interix*:[34]*)
985 + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
987 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
988 echo i${UNAME_MACHINE}-pc-mks
991 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
992 # How do we know it's Interix rather than the generic POSIX subsystem?
993 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
994 # UNAME_MACHINE based on the output of uname instead of i386?
999 echo ${UNAME_MACHINE}-pc-uwin
1001 - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
1002 - echo x86_64-unknown-cygwin
1006 echo powerpcle-unknown-cygwin
1010 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
1015 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
1018 - # other systems with GNU libc and userland
1019 - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
1023 echo ${UNAME_MACHINE}-pc-minix
1027 - eval $set_cc_for_build
1028 - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
1029 - | grep -q __ARM_EABI__
1031 - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1033 - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
1037 - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1039 + echo ${UNAME_MACHINE}-unknown-linux-gnu
1042 - echo cris-axis-linux-${LIBC}
1044 - crisv32:Linux:*:*)
1045 - echo crisv32-axis-linux-${LIBC}
1048 - echo frv-unknown-linux-${LIBC}
1050 + echo cris-axis-linux-gnu
1053 - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1056 - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1058 + echo ${UNAME_MACHINE}-unknown-linux-gnu
1061 - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1063 + echo ${UNAME_MACHINE}-unknown-linux-gnu
1066 eval $set_cc_for_build
1067 sed 's/^ //' << EOF >$dummy.c
1068 @@ -899,12 +832,8 @@
1072 - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
1077 - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
1078 + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
1079 + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
1082 eval $set_cc_for_build
1083 @@ -922,22 +851,15 @@
1087 - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
1092 - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
1093 + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
1094 + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
1097 - echo or32-unknown-linux-${LIBC}
1100 - echo powerpc-unknown-linux-${LIBC}
1102 + echo powerpc-unknown-linux-gnu
1105 - echo powerpc64-unknown-linux-${LIBC}
1107 + echo powerpc64-unknown-linux-gnu
1110 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
1111 EV5) UNAME_MACHINE=alphaev5 ;;
1112 @@ -949,44 +871,35 @@
1113 EV68*) UNAME_MACHINE=alphaev68 ;;
1115 objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
1116 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
1117 - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1120 - echo sparc-unknown-linux-gnu
1122 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
1123 + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
1125 parisc:Linux:*:* | hppa:Linux:*:*)
1126 # Look for CPU level
1127 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
1128 - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
1129 - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
1130 - *) echo hppa-unknown-linux-${LIBC} ;;
1131 + PA7*) echo hppa1.1-unknown-linux-gnu ;;
1132 + PA8*) echo hppa2.0-unknown-linux-gnu ;;
1133 + *) echo hppa-unknown-linux-gnu ;;
1137 parisc64:Linux:*:* | hppa64:Linux:*:*)
1138 - echo hppa64-unknown-linux-${LIBC}
1140 + echo hppa64-unknown-linux-gnu
1142 s390:Linux:*:* | s390x:Linux:*:*)
1143 echo ${UNAME_MACHINE}-ibm-linux
1147 - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1149 + echo ${UNAME_MACHINE}-unknown-linux-gnu
1152 - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1154 + echo ${UNAME_MACHINE}-unknown-linux-gnu
1156 sparc:Linux:*:* | sparc64:Linux:*:*)
1157 - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1160 - echo ${UNAME_MACHINE}-dec-linux-${LIBC}
1162 + echo ${UNAME_MACHINE}-unknown-linux-gnu
1165 - echo x86_64-unknown-linux-${LIBC}
1167 - xtensa*:Linux:*:*)
1168 - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1170 + echo x86_64-unknown-linux-gnu
1173 # The BFD linker knows what the default object file format is, so
1174 # first see if it will tell us. cd to the root directory to prevent
1175 @@ -1000,19 +913,20 @@
1177 case "$ld_supported_targets" in
1179 - TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}"
1180 + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
1183 - echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout"
1185 + echo "${UNAME_MACHINE}-pc-linux-gnuaout"
1188 + echo "${UNAME_MACHINE}-pc-linux-gnucoff"
1191 # Either a pre-BFD a.out linker (linux-gnuoldld) or
1192 # one that does not give us useful --help.
1193 - echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld"
1195 + echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
1198 - # This should get integrated into the C code below, but now we hack
1199 - if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi
1200 # Determine whether the default compiler is a.out or elf
1201 eval $set_cc_for_build
1202 sed 's/^ //' << EOF >$dummy.c
1203 @@ -1028,33 +942,23 @@
1207 - #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
1208 + #ifdef __INTEL_COMPILER
1214 - #ifdef __dietlibc__
1218 - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
1223 - test x"${LIBC}" != x && {
1224 - echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
1227 - test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
1228 + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
1229 + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
1230 + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
1232 i*86:DYNIX/ptx:4*:*)
1233 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1234 # earlier versions are messed up and put the nodename in both
1235 # sysname and nodename.
1236 echo i386-sequent-sysv4
1239 i*86:UNIX_SV:4.2MP:2.*)
1240 # Unixware is an offshoot of SVR4, but it has its own version
1241 # number series starting with 2...
1242 @@ -1062,27 +966,24 @@
1243 # I just have to hope. -- rms.
1244 # Use sysv4.2uw... so that sysv4* matches it.
1245 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1249 # If we were able to find `uname', then EMX Unix compatibility
1250 # is probably installed.
1251 echo ${UNAME_MACHINE}-pc-os2-emx
1254 i*86:XTS-300:*:STOP)
1255 echo ${UNAME_MACHINE}-unknown-stop
1259 echo ${UNAME_MACHINE}-unknown-atheos
1261 - i*86:syllable:*:*)
1262 - echo ${UNAME_MACHINE}-pc-syllable
1265 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
1266 echo i386-unknown-lynxos${UNAME_RELEASE}
1270 echo ${UNAME_MACHINE}-pc-msdosdjgpp
1273 i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1274 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1275 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1276 @@ -1090,16 +991,15 @@
1278 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1282 - # UnixWare 7.x, OpenUNIX and OpenServer 6.
1285 case `/bin/uname -X | grep "^Machine"` in
1286 *486*) UNAME_MACHINE=i486 ;;
1287 *Pentium) UNAME_MACHINE=i586 ;;
1288 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1290 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1294 if test -f /usr/options/cb.name; then
1295 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1296 @@ -1117,73 +1017,73 @@
1298 echo ${UNAME_MACHINE}-pc-sysv32
1303 # Left here for compatibility:
1304 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1305 # the processor, so we play safe by assuming i386.
1306 echo i386-pc-msdosdjgpp
1314 echo i860-intel-osf1
1317 i860:*:4.*:*) # i860-SVR4
1318 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1319 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1320 else # Add other i860-SVR4 vendors below as they are discovered.
1321 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1327 echo m68010-convergent-sysv
1330 mc68k:UNIX:SYSTEM5:3.51m)
1331 echo m68k-convergent-sysv
1337 - M68*:*:R3V[5678]*:*)
1338 - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1339 - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
1341 + M68*:*:R3V[567]*:*)
1342 + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
1343 + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
1345 test -r /etc/.relid \
1346 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1347 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1348 - && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1349 + && echo i486-ncr-sysv4.3${OS_REL} && exit 0
1350 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1351 - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1352 + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
1353 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1354 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1355 - && { echo i486-ncr-sysv4; exit; } ;;
1356 + && echo i486-ncr-sysv4 && exit 0 ;;
1357 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1358 echo m68k-unknown-lynxos${UNAME_RELEASE}
1361 mc68030:UNIX_System_V:4.*:*)
1362 echo m68k-atari-sysv4
1365 TSUNAMI:LynxOS:2.*:*)
1366 echo sparc-unknown-lynxos${UNAME_RELEASE}
1369 rs6000:LynxOS:2.*:*)
1370 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1373 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
1374 echo powerpc-unknown-lynxos${UNAME_RELEASE}
1377 SM[BE]S:UNIX_SV:*:*)
1378 echo mips-dde-sysv${UNAME_RELEASE}
1381 RM*:ReliantUNIX-*:*:*)
1390 if uname -p 2>/dev/null >/dev/null ; then
1391 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1392 @@ -1191,84 +1091,68 @@
1398 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1399 # says <Richard.M.Bartel@ccMail.Census.GOV>
1400 echo i586-unisys-sysv4
1403 *:UNIX_System_V:4*:FTX*)
1404 # From Gerald Hewes <hewes@openmarket.com>.
1405 # How about differentiating between stratus architectures? -djm
1406 echo hppa1.1-stratus-sysv4
1410 # From seanf@swdc.stratus.com.
1411 echo i860-stratus-sysv4
1414 - # From Paul.Green@stratus.com.
1415 - echo ${UNAME_MACHINE}-stratus-vos
1419 # From Paul.Green@stratus.com.
1420 echo hppa1.1-stratus-vos
1424 echo m68k-apple-aux${UNAME_RELEASE}
1428 echo mips-sony-newsos6
1431 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1432 if [ -d /usr/nec ]; then
1433 echo mips-nec-sysv${UNAME_RELEASE}
1435 echo mips-unknown-sysv${UNAME_RELEASE}
1439 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1440 echo powerpc-be-beos
1443 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1444 echo powerpc-apple-beos
1447 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1450 - BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1451 - echo i586-pc-haiku
1455 echo sx4-nec-superux${UNAME_RELEASE}
1459 echo sx5-nec-superux${UNAME_RELEASE}
1463 echo sx6-nec-superux${UNAME_RELEASE}
1465 - SX-7:SUPER-UX:*:*)
1466 - echo sx7-nec-superux${UNAME_RELEASE}
1468 - SX-8:SUPER-UX:*:*)
1469 - echo sx8-nec-superux${UNAME_RELEASE}
1471 - SX-8R:SUPER-UX:*:*)
1472 - echo sx8r-nec-superux${UNAME_RELEASE}
1475 Power*:Rhapsody:*:*)
1476 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1480 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1484 - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1485 - case $UNAME_PROCESSOR in
1486 - unknown) UNAME_PROCESSOR=powerpc ;;
1487 + case `uname -p` in
1488 + *86) UNAME_PROCESSOR=i686 ;;
1489 + powerpc) UNAME_PROCESSOR=powerpc ;;
1491 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1494 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1495 UNAME_PROCESSOR=`uname -p`
1496 if test "$UNAME_PROCESSOR" = "x86"; then
1497 @@ -1276,25 +1160,22 @@
1500 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1506 - NSE-?:NONSTOP_KERNEL:*:*)
1507 - echo nse-tandem-nsk${UNAME_RELEASE}
1509 - NSR-?:NONSTOP_KERNEL:*:*)
1511 + NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
1512 echo nsr-tandem-nsk${UNAME_RELEASE}
1516 echo mips-compaq-nonstopux
1520 echo bs2000-siemens-sysv
1523 DS/*:UNIX_System_V:*:*)
1524 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1528 # "uname -m" is not consistent, so use $cputype instead. 386
1529 # is converted to i386 for consistency with other x86
1530 @@ -1305,47 +1186,28 @@
1531 UNAME_MACHINE="$cputype"
1533 echo ${UNAME_MACHINE}-unknown-plan9
1537 echo pdp10-unknown-tops10
1541 echo pdp10-unknown-tenex
1544 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1545 echo pdp10-dec-tops20
1548 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1549 echo pdp10-xkl-tops20
1553 echo pdp10-unknown-tops20
1557 echo pdp10-unknown-its
1561 echo mips-sei-seiux${UNAME_RELEASE}
1564 - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1567 - UNAME_MACHINE=`(uname -p) 2>/dev/null`
1568 - case "${UNAME_MACHINE}" in
1569 - A*) echo alpha-dec-vms ; exit ;;
1570 - I*) echo ia64-dec-vms ; exit ;;
1571 - V*) echo vax-dec-vms ; exit ;;
1574 - echo i386-pc-xenix
1577 - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1580 - echo ${UNAME_MACHINE}-pc-rdos
1585 #echo '(No uname command or uname output not recognized.)' 1>&2
1586 @@ -1377,7 +1239,7 @@
1589 #if defined (__arm) && defined (__acorn) && defined (__unix)
1590 - printf ("arm-acorn-riscix\n"); exit (0);
1591 + printf ("arm-acorn-riscix"); exit (0);
1594 #if defined (hp300) && !defined (hpux)
1595 @@ -1466,12 +1328,11 @@
1599 -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1600 - { echo "$SYSTEM_NAME"; exit; }
1601 +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
1603 # Apollos put the system type in the environment.
1605 -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1606 +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
1608 # Convex versions that predate uname can use getsysinfo(1)
1610 @@ -1480,22 +1341,22 @@
1611 case `getsysinfo -f cpu_type` in
1617 if getsysinfo -f scalar_acc
1618 then echo c32-convex-bsd
1619 else echo c2-convex-bsd
1638 @@ -1506,9 +1367,7 @@
1639 the operating system you are using. It is advised that you
1640 download the most up to date version of the config scripts from
1642 - http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1644 - http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1645 + ftp://ftp.gnu.org/pub/gnu/config/
1647 If the version you run ($0) is already up to date, please
1648 send the following data and any information you think might be
1649 diff -urN --exclude *.m4 memcached-1.4.4/config.h.in repcached-2.2-1.4.4/config.h.in
1650 --- memcached-1.4.4/config.h.in Fri Nov 27 09:34:56 2009
1651 +++ repcached-2.2-1.4.4/config.h.in Wed Feb 10 19:12:46 2010
1653 /* Define to 1 if you have the ANSI C header files. */
1656 +/* Define this if you want to use replication */
1657 +#undef USE_REPLICATION
1659 /* Version number of package */
1662 diff -urN --exclude *.m4 memcached-1.4.4/config.sub repcached-2.2-1.4.4/config.sub
1663 --- memcached-1.4.4/config.sub Sat Aug 22 04:38:32 2009
1664 +++ repcached-2.2-1.4.4/config.sub Tue Jan 19 12:34:08 2010
1667 # Configuration validation subroutine script.
1668 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
1669 -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
1670 -# Free Software Foundation, Inc.
1671 +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
1673 -timestamp='2008-09-08'
1674 +timestamp='2003-07-04'
1676 # This file is (in principle) common to ALL GNU software.
1677 # The presence of a machine in this file suggests that SOME GNU software
1680 # You should have received a copy of the GNU General Public License
1681 # along with this program; if not, write to the Free Software
1682 -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
1685 +# Foundation, Inc., 59 Temple Place - Suite 330,
1686 +# Boston, MA 02111-1307, USA.
1688 # As a special exception to the GNU General Public License, if you
1689 # distribute this file as part of a program that contains a
1690 # configuration script generated by Autoconf, you may include it under
1691 # the same distribution terms that you use for the rest of that program.
1694 # Please send patches to <config-patches@gnu.org>. Submit a context
1695 # diff and a properly formatted ChangeLog entry.
1699 GNU config.sub ($timestamp)
1701 -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
1702 -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
1703 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
1704 +Free Software Foundation, Inc.
1706 This is free software; see the source for copying conditions. There is NO
1707 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
1709 while test $# -gt 0 ; do
1711 --time-stamp | --time* | -t )
1712 - echo "$timestamp" ; exit ;;
1713 + echo "$timestamp" ; exit 0 ;;
1715 - echo "$version" ; exit ;;
1716 + echo "$version" ; exit 0 ;;
1717 --help | --h* | -h )
1718 - echo "$usage"; exit ;;
1719 + echo "$usage"; exit 0 ;;
1720 -- ) # Stop option processing
1722 - ) # Use stdin as input.
1725 # First pass through any local machine types.
1733 # Here we must recognize all the valid KERNEL-OS combinations.
1734 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
1736 - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
1737 - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
1738 - storm-chaos* | os2-emx* | rtmk-nova*)
1739 + nto-qnx* | linux-gnu* | kfreebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
1741 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
1744 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
1745 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
1746 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
1747 - -apple | -axis | -knuth | -cray)
1752 @@ -173,10 +169,6 @@
1758 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1762 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1763 @@ -193,10 +185,6 @@
1764 # Don't forget version if it is 3.2v4 or newer.
1765 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1768 - # Don't forget version if it is 3.2v4 or newer.
1769 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1773 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1774 @@ -240,55 +228,44 @@
1776 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
1777 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
1779 - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
1781 + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
1783 - | d10v | d30v | dlx | dsp16xx | dvp \
1784 - | fido | fr30 | frv \
1785 + | d10v | d30v | dlx | dsp16xx \
1787 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
1788 | i370 | i860 | i960 | ia64 \
1790 - | m32c | m32r | m32rle | m68000 | m68k | m88k \
1791 - | maxq | mb | microblaze | mcore | mep | metag \
1793 + | m32r | m68000 | m68k | m88k | mcore \
1794 | mips | mipsbe | mipseb | mipsel | mipsle \
1796 | mips64 | mips64el \
1797 - | mips64octeon | mips64octeonel \
1798 - | mips64orion | mips64orionel \
1799 - | mips64r5900 | mips64r5900el \
1800 | mips64vr | mips64vrel \
1801 + | mips64orion | mips64orionel \
1802 | mips64vr4100 | mips64vr4100el \
1803 | mips64vr4300 | mips64vr4300el \
1804 | mips64vr5000 | mips64vr5000el \
1805 - | mips64vr5900 | mips64vr5900el \
1806 | mipsisa32 | mipsisa32el \
1807 | mipsisa32r2 | mipsisa32r2el \
1808 | mipsisa64 | mipsisa64el \
1809 - | mipsisa64r2 | mipsisa64r2el \
1810 | mipsisa64sb1 | mipsisa64sb1el \
1811 | mipsisa64sr71k | mipsisa64sr71kel \
1812 | mipstx39 | mipstx39el \
1813 | mn10200 | mn10300 \
1819 + | openrisc | or32 \
1820 | pdp10 | pdp11 | pj | pjl \
1821 | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
1824 - | sh | sh[1234] | sh[24]a | sh[24]a*eb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
1825 + | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
1827 - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
1828 - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
1829 - | spu | strongarm \
1830 + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
1832 | tahoe | thumb | tic4x | tic80 | tron \
1835 - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
1837 + | x86 | xscale | xstormy16 | xtensa \
1839 basic_machine=$basic_machine-unknown
1841 m6811 | m68hc11 | m6812 | m68hc12)
1844 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
1847 - basic_machine=mt-unknown
1850 # We use `pc' rather than `unknown'
1851 # because (1) that's what they normally are, and
1852 @@ -318,68 +292,56 @@
1854 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
1855 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
1856 - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
1857 + | alphapca5[67]-* | alpha64pca5[67]-* | amd64-* | arc-* \
1858 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
1859 - | avr-* | avr32-* \
1860 - | bfin-* | bs2000-* \
1863 | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
1864 - | clipper-* | craynv-* | cydra-* \
1865 + | clipper-* | cydra-* \
1866 | d10v-* | d30v-* | dlx-* \
1868 - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
1869 + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
1870 | h8300-* | h8500-* \
1871 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
1872 | i*86-* | i860-* | i960-* | ia64-* \
1873 - | ip2k-* | iq2000-* \
1874 - | m32c-* | m32r-* | m32rle-* \
1877 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
1878 - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
1879 + | m88110-* | m88k-* | mcore-* \
1880 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
1882 | mips64-* | mips64el-* \
1883 - | mips64octeon-* | mips64octeonel-* \
1884 - | mips64orion-* | mips64orionel-* \
1885 - | mips64r5900-* | mips64r5900el-* \
1886 | mips64vr-* | mips64vrel-* \
1887 + | mips64orion-* | mips64orionel-* \
1888 | mips64vr4100-* | mips64vr4100el-* \
1889 | mips64vr4300-* | mips64vr4300el-* \
1890 | mips64vr5000-* | mips64vr5000el-* \
1891 - | mips64vr5900-* | mips64vr5900el-* \
1892 | mipsisa32-* | mipsisa32el-* \
1893 | mipsisa32r2-* | mipsisa32r2el-* \
1894 | mipsisa64-* | mipsisa64el-* \
1895 - | mipsisa64r2-* | mipsisa64r2el-* \
1896 | mipsisa64sb1-* | mipsisa64sb1el-* \
1897 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
1898 | mipstx39-* | mipstx39el-* \
1902 - | nios-* | nios2-* \
1903 - | none-* | np1-* | ns16k-* | ns32k-* \
1904 + | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
1906 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
1907 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
1909 | romp-* | rs6000-* \
1910 - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]a*eb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
1911 + | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
1912 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
1913 - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
1915 - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
1916 + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
1917 + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
1918 | tahoe-* | thumb-* \
1919 - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
1920 + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
1922 | v850-* | v850e-* | vax-* \
1924 - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
1925 - | xstormy16-* | xtensa*-* \
1926 + | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
1931 - # Recognize the basic CPU types without company name, with glob match.
1933 - basic_machine=$basic_machine-unknown
1936 # Recognize the various machine names and aliases which stand
1937 # for a CPU type and a company and sometimes even an OS.
1939 basic_machine=a29k-amd
1943 - basic_machine=abacus-unknown
1946 basic_machine=m68010-adobe
1950 basic_machine=x86_64-pc
1953 - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
1956 basic_machine=580-amdahl
1958 @@ -451,22 +407,10 @@
1959 basic_machine=ns32k-sequent
1963 - basic_machine=bfin-unknown
1967 - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
1971 basic_machine=c90-cray
1975 - basic_machine=arm-unknown
1979 basic_machine=c1-convex
1981 @@ -491,27 +435,12 @@
1982 basic_machine=j90-cray
1986 - basic_machine=craynv-cray
1990 - basic_machine=cr16-unknown
1994 basic_machine=m68k-crds
1996 - crisv32 | crisv32-* | etraxfs*)
1997 - basic_machine=crisv32-axis
1999 cris | cris-* | etrax*)
2000 basic_machine=cris-axis
2003 - basic_machine=crx-unknown
2007 basic_machine=m68k-da30
2009 @@ -534,14 +463,6 @@
2010 basic_machine=m88k-motorola
2014 - basic_machine=i686-pc
2018 - basic_machine=i586-pc
2022 basic_machine=rs6000-bull
2024 @@ -692,14 +613,6 @@
2025 basic_machine=m68k-isi
2029 - basic_machine=m68k-unknown
2033 - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
2037 basic_machine=m88k-omron
2039 @@ -715,10 +628,6 @@
2040 basic_machine=i386-pc
2044 - basic_machine=arm-unknown
2048 basic_machine=m68000-convergent
2050 @@ -726,30 +635,16 @@
2051 basic_machine=m68k-atari
2054 - mipsEE* | ee | ps2)
2055 - basic_machine=mips64r5900el-scei
2065 - basic_machine=mipsel-scei
2069 - basic_machine=dvp-scei
2073 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
2076 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
2079 + basic_machine=mmix-knuth
2083 basic_machine=m68k-rom68k
2086 basic_machine=i386-pc
2090 - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
2093 basic_machine=i370-ibm
2095 @@ -833,6 +725,10 @@
2097 basic_machine=np1-gould
2100 + basic_machine=nv1-cray
2104 basic_machine=nsr-tandem
2106 @@ -840,12 +736,9 @@
2107 basic_machine=hppa1.1-oki
2110 - openrisc | openrisc-*)
2112 basic_machine=or32-unknown
2115 - basic_machine=powerpc-ibm
2119 OSE68000 | ose68000)
2120 basic_machine=m68000-ericsson
2121 @@ -863,14 +756,6 @@
2122 basic_machine=i860-intel
2126 - basic_machine=hppa-unknown
2130 - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
2134 basic_machine=sparc-tti
2136 @@ -880,12 +765,6 @@
2138 basic_machine=ns32k-pc532
2141 - basic_machine=i386-pc
2144 - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
2146 pentium | p5 | k5 | k6 | nexgen | viac3)
2147 basic_machine=i586-pc
2149 @@ -942,10 +821,6 @@
2150 basic_machine=i586-unknown
2154 - basic_machine=i386-pc
2158 basic_machine=m68k-rom68k
2160 @@ -972,10 +847,6 @@
2162 basic_machine=mipsisa64sb1el-unknown
2165 - basic_machine=mipsisa32-sde
2169 basic_machine=mips-sei
2172 basic_machine=sh-hitachi
2176 - basic_machine=sh5le-unknown
2179 basic_machine=sh64-unknown
2181 @@ -1079,10 +947,6 @@
2182 basic_machine=tic6x-unknown
2186 - basic_machine=tile-unknown
2190 basic_machine=mipstx39-unknown
2192 @@ -1096,10 +960,6 @@
2194 basic_machine=m68k-ncr
2197 - basic_machine=s390x-ibm
2201 basic_machine=a29k-amd
2203 @@ -1143,10 +1003,6 @@
2204 basic_machine=hppa1.1-winbond
2208 - basic_machine=i686-pc
2212 basic_machine=xps100-honeywell
2214 @@ -1158,10 +1014,6 @@
2215 basic_machine=z8k-unknown
2219 - basic_machine=z80-unknown
2223 basic_machine=none-none
2225 @@ -1181,9 +1033,6 @@
2227 basic_machine=romp-ibm
2230 - basic_machine=mmix-knuth
2233 basic_machine=rs6000-ibm
2235 @@ -1200,10 +1049,13 @@
2237 basic_machine=we32k-att
2239 - sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
2240 + sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
2241 basic_machine=sh-unknown
2243 - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
2245 + basic_machine=sh64-unknown
2247 + sparc | sparcv9 | sparcv9b)
2248 basic_machine=sparc-sun
2251 @@ -1276,23 +1128,19 @@
2253 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
2254 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
2255 - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
2256 - | -openbsd* | -solidbsd* \
2257 - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
2258 - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
2259 + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
2260 + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
2261 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
2262 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
2263 - | -chorusos* | -chorusrdb* | -cegcc* \
2264 + | -chorusos* | -chorusrdb* \
2265 | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
2266 - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
2267 - | -uxpv* | -beos* | -mpeix* | -udk* \
2268 + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
2269 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
2270 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
2271 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
2272 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
2273 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
2274 - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
2275 - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -irx*)
2276 + | -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
2277 # Remember, each alternative MUST END IN *, to match a version number.
2280 @@ -1310,15 +1158,12 @@
2281 os=`echo $os | sed -e 's|nto|nto-qnx|'`
2283 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
2284 - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
2285 + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
2286 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
2289 os=`echo $os | sed -e 's|mac|macos|'`
2292 - os=-linux-dietlibc
2295 os=`echo $os | sed -e 's|linux|linux-gnu|'`
2297 @@ -1331,9 +1176,6 @@
2307 @@ -1355,9 +1197,6 @@
2317 @@ -1380,9 +1219,6 @@
2327 @@ -1419,12 +1255,6 @@
2340 @@ -1447,12 +1277,6 @@
2341 # system, and we'll never get to this point.
2343 case $basic_machine in
2353 @@ -1462,9 +1286,9 @@
2363 # This must come before the *-dec entry.
2366 @@ -1490,9 +1314,6 @@
2376 @@ -1511,15 +1332,9 @@
2392 @@ -1652,15 +1467,9 @@
2405 -vxsim* | -vxworks* | -windiss*)
2408 @@ -1685,7 +1494,7 @@
2411 echo $basic_machine$os
2416 # eval: (add-hook 'write-file-hooks 'time-stamp)
2417 diff -urN --exclude *.m4 memcached-1.4.4/configure repcached-2.2-1.4.4/configure
2418 --- memcached-1.4.4/configure Fri Nov 27 09:34:57 2009
2419 +++ repcached-2.2-1.4.4/configure Wed Feb 10 19:12:16 2010
2422 # Guess values for system-dependent variables and create Makefiles.
2423 -# Generated by GNU Autoconf 2.63 for memcached 1.4.4.
2424 +# Generated by GNU Autoconf 2.63 for memcached 1.4.4_49_g6b6b7ed.
2426 # Report bugs to <brad@danga.com>.
2429 # Identity of this package.
2430 PACKAGE_NAME='memcached'
2431 PACKAGE_TARNAME='memcached'
2432 -PACKAGE_VERSION='1.4.4'
2433 -PACKAGE_STRING='memcached 1.4.4'
2434 +PACKAGE_VERSION='1.4.4_49_g6b6b7ed'
2435 +PACKAGE_STRING='memcached 1.4.4_49_g6b6b7ed'
2436 PACKAGE_BUGREPORT='brad@danga.com'
2438 ac_unique_file="memcached.c"
2441 BUILD_SOLARIS_PRIVS_FALSE
2442 BUILD_SOLARIS_PRIVS_TRUE
2443 +ENABLE_REPLICATION_FALSE
2444 +ENABLE_REPLICATION_TRUE
2455 ac_precious_vars='build_alias
2456 @@ -1322,7 +1325,7 @@
2457 # Omit some internal or obsolete options to make the list less imposing.
2458 # This message is too long to be a string in the A/UX 3.1 sh.
2460 -\`configure' configures memcached 1.4.4 to adapt to many kinds of systems.
2461 +\`configure' configures memcached 1.4.4_49_g6b6b7ed to adapt to many kinds of systems.
2463 Usage: $0 [OPTION]... [VAR=VALUE]...
2465 @@ -1393,7 +1396,7 @@
2467 if test -n "$ac_init_help"; then
2468 case $ac_init_help in
2469 - short | recursive ) echo "Configuration of memcached 1.4.4:";;
2470 + short | recursive ) echo "Configuration of memcached 1.4.4_49_g6b6b7ed:";;
2474 @@ -1407,6 +1410,7 @@
2475 --enable-dtrace Enable dtrace probes
2476 --disable-coverage Disable code coverage
2477 --enable-64bit build 64bit version
2478 + --enable-replication support replication
2479 --disable-docs Disable documentation generation
2482 @@ -1490,7 +1494,7 @@
2483 test -n "$ac_init_help" && exit $ac_status
2484 if $ac_init_version; then
2486 -memcached configure 1.4.4
2487 +memcached configure 1.4.4_49_g6b6b7ed
2488 generated by GNU Autoconf 2.63
2490 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
2491 @@ -1504,7 +1508,7 @@
2492 This file contains any messages produced by compilers while
2493 running configure, to aid debugging if configure makes a mistake.
2495 -It was created by memcached $as_me 1.4.4, which was
2496 +It was created by memcached $as_me 1.4.4_49_g6b6b7ed, which was
2497 generated by GNU Autoconf 2.63. Invocation command line was
2500 @@ -2347,7 +2351,7 @@
2502 # Define the identity of the package.
2505 + VERSION=1.4.4_49_g6b6b7ed
2508 cat >>confdefs.h <<_ACEOF
2509 @@ -6798,6 +6802,32 @@
2510 { (exit 1); exit 1; }; }
2513 +# Check whether --enable-replication was given.
2514 +if test "${enable_replication+set}" = set; then
2515 + enableval=$enable_replication; if test "x$enable_threads" = "xyes"; then
2516 + { { $as_echo "$as_me:$LINENO: error: Can't enable threads and replication together." >&5
2517 +$as_echo "$as_me: error: Can't enable threads and replication together." >&2;}
2518 + { (exit 1); exit 1; }; }
2521 +cat >>confdefs.h <<\_ACEOF
2522 +#define USE_REPLICATION /**/
2530 + if test "x$enable_replication" = "xyes"; then
2531 + ENABLE_REPLICATION_TRUE=
2532 + ENABLE_REPLICATION_FALSE='#'
2534 + ENABLE_REPLICATION_TRUE='#'
2535 + ENABLE_REPLICATION_FALSE=
2540 for ac_func in mlockall
2542 @@ -7969,6 +7999,13 @@
2543 Usually this means the macro was only invoked conditionally." >&2;}
2544 { (exit 1); exit 1; }; }
2546 +if test -z "${ENABLE_REPLICATION_TRUE}" && test -z "${ENABLE_REPLICATION_FALSE}"; then
2547 + { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_REPLICATION\" was never defined.
2548 +Usually this means the macro was only invoked conditionally." >&5
2549 +$as_echo "$as_me: error: conditional \"ENABLE_REPLICATION\" was never defined.
2550 +Usually this means the macro was only invoked conditionally." >&2;}
2551 + { (exit 1); exit 1; }; }
2553 if test -z "${BUILD_SOLARIS_PRIVS_TRUE}" && test -z "${BUILD_SOLARIS_PRIVS_FALSE}"; then
2554 { { $as_echo "$as_me:$LINENO: error: conditional \"BUILD_SOLARIS_PRIVS\" was never defined.
2555 Usually this means the macro was only invoked conditionally." >&5
2556 @@ -8312,7 +8349,7 @@
2557 # report actual input values of CONFIG_FILES etc. instead of their
2558 # values after options handling.
2560 -This file was extended by memcached $as_me 1.4.4, which was
2561 +This file was extended by memcached $as_me 1.4.4_49_g6b6b7ed, which was
2562 generated by GNU Autoconf 2.63. Invocation command line was
2564 CONFIG_FILES = $CONFIG_FILES
2565 @@ -8375,7 +8412,7 @@
2567 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
2569 -memcached config.status 1.4.4
2570 +memcached config.status 1.4.4_49_g6b6b7ed
2571 configured by $0, generated by GNU Autoconf 2.63,
2572 with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
2574 diff -urN --exclude *.m4 memcached-1.4.4/configure.ac repcached-2.2-1.4.4/configure.ac
2575 --- memcached-1.4.4/configure.ac Wed Nov 25 03:40:29 2009
2576 +++ repcached-2.2-1.4.4/configure.ac Tue Feb 9 23:02:45 2010
2577 @@ -382,6 +382,18 @@
2578 AC_MSG_ERROR([Can't enable threads without the POSIX thread library.])
2581 +dnl Check whether the user wants replication or not
2582 +AC_ARG_ENABLE(replication,
2583 + [AS_HELP_STRING([--enable-replication],[support replication])],
2584 + [if test "x$enable_threads" = "xyes"; then
2585 + AC_MSG_ERROR([Can't enable threads and replication together.])
2587 + AC_DEFINE([USE_REPLICATION],,[Define this if you want to use replication])
2591 +AM_CONDITIONAL(ENABLE_REPLICATION, test "x$enable_replication" = "xyes")
2593 AC_CHECK_FUNCS(mlockall)
2594 AC_CHECK_FUNCS(getpagesizes)
2595 AC_CHECK_FUNCS(memcntl)
2596 diff -urN --exclude *.m4 memcached-1.4.4/doc/Makefile repcached-2.2-1.4.4/doc/Makefile
2597 --- memcached-1.4.4/doc/Makefile Fri Nov 27 09:35:03 2009
2598 +++ repcached-2.2-1.4.4/doc/Makefile Wed Feb 10 19:12:43 2010
2600 NORMAL_UNINSTALL = :
2603 -build_triplet = x86_64-unknown-linux-gnu
2604 -host_triplet = x86_64-unknown-linux-gnu
2605 -target_triplet = x86_64-unknown-linux-gnu
2606 +build_triplet = i386-unknown-freebsd6.2
2607 +host_triplet = i386-unknown-freebsd6.2
2608 +target_triplet = i386-unknown-freebsd6.2
2609 #am__append_1 = protocol-binary.txt protocol-binary-range.txt
2611 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
2615 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
2616 -ACLOCAL = ${SHELL} /home/dormando/p/danga/memcached_github_new/missing --run aclocal-1.10
2617 -AMTAR = ${SHELL} /home/dormando/p/danga/memcached_github_new/missing --run tar
2618 -AUTOCONF = ${SHELL} /home/dormando/p/danga/memcached_github_new/missing --run autoconf
2619 -AUTOHEADER = ${SHELL} /home/dormando/p/danga/memcached_github_new/missing --run autoheader
2620 -AUTOMAKE = ${SHELL} /home/dormando/p/danga/memcached_github_new/missing --run automake-1.10
2622 +ACLOCAL = ${SHELL} /home/mdounin/work/memcached-repcached/memcached/missing --run aclocal-1.10
2623 +AMTAR = ${SHELL} /home/mdounin/work/memcached-repcached/memcached/missing --run tar
2624 +AUTOCONF = ${SHELL} /home/mdounin/work/memcached-repcached/memcached/missing --run autoconf
2625 +AUTOHEADER = ${SHELL} /home/mdounin/work/memcached-repcached/memcached/missing --run autoheader
2626 +AUTOMAKE = ${SHELL} /home/mdounin/work/memcached-repcached/memcached/missing --run automake-1.10
2629 CCDEPMODE = depmode=gcc3
2630 CFLAGS = -g -O2 -pthread -Wall -Werror -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls
2633 +CPPFLAGS = -I/usr/local/include
2635 DEFS = -DHAVE_CONFIG_H
2641 -EGREP = /bin/grep -E
2642 +EGREP = /usr/bin/grep -E
2646 +GREP = /usr/bin/grep
2647 INSTALL = /usr/bin/install -c
2648 INSTALL_DATA = ${INSTALL} -m 644
2649 INSTALL_PROGRAM = ${INSTALL}
2650 INSTALL_SCRIPT = ${INSTALL}
2651 INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
2653 +LDFLAGS = -L/usr/local/lib
2657 -MAKEINFO = ${SHELL} /home/dormando/p/danga/memcached_github_new/missing --run makeinfo
2658 -MKDIR_P = /usr/bin/mkdir -p
2659 +MAKEINFO = ${SHELL} /home/mdounin/work/memcached-repcached/memcached/missing --run makeinfo
2660 +MKDIR_P = .././install-sh -c -d
2663 PACKAGE_BUGREPORT = brad@danga.com
2664 PACKAGE_NAME = memcached
2665 -PACKAGE_STRING = memcached 1.4.4
2666 +PACKAGE_STRING = memcached 1.4.4_49_g6b6b7ed
2667 PACKAGE_TARNAME = memcached
2668 -PACKAGE_VERSION = 1.4.4
2669 +PACKAGE_VERSION = 1.4.4_49_g6b6b7ed
2671 PROFILER = /usr/bin/gcov
2672 PROFILER_FLAGS = -fprofile-arcs -ftest-coverage
2673 PROFILER_LDFLAGS = -lgcov
2676 +SHELL = /usr/local/bin/bash
2679 +VERSION = 1.4.4_49_g6b6b7ed
2681 -XSLTPROC = /usr/bin/xsltproc
2682 -abs_builddir = /home/dormando/p/danga/memcached_github_new/doc
2683 -abs_srcdir = /home/dormando/p/danga/memcached_github_new/doc
2684 -abs_top_builddir = /home/dormando/p/danga/memcached_github_new
2685 -abs_top_srcdir = /home/dormando/p/danga/memcached_github_new
2686 +XSLTPROC = /usr/local/bin/xsltproc
2687 +abs_builddir = /home/mdounin/work/memcached-repcached/memcached/doc
2688 +abs_srcdir = /home/mdounin/work/memcached-repcached/memcached/doc
2689 +abs_top_builddir = /home/mdounin/work/memcached-repcached/memcached
2690 +abs_top_srcdir = /home/mdounin/work/memcached-repcached/memcached
2692 am__include = include
2694 @@ -112,10 +112,10 @@
2695 am__tar = ${AMTAR} chof - "$$tardir"
2696 am__untar = ${AMTAR} xf -
2697 bindir = ${exec_prefix}/bin
2698 -build = x86_64-unknown-linux-gnu
2699 +build = i386-unknown-freebsd6.2
2702 -build_os = linux-gnu
2704 +build_os = freebsd6.2
2705 build_vendor = unknown
2707 datadir = ${datarootdir}
2708 @@ -123,21 +123,21 @@
2709 docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
2711 exec_prefix = ${prefix}
2712 -host = x86_64-unknown-linux-gnu
2713 +host = i386-unknown-freebsd6.2
2716 -host_os = linux-gnu
2718 +host_os = freebsd6.2
2719 host_vendor = unknown
2721 includedir = ${prefix}/include
2722 infodir = ${datarootdir}/info
2723 -install_sh = $(SHELL) /home/dormando/p/danga/memcached_github_new/install-sh
2724 +install_sh = $(SHELL) /home/mdounin/work/memcached-repcached/memcached/install-sh
2725 libdir = ${exec_prefix}/lib
2726 libexecdir = ${exec_prefix}/libexec
2727 localedir = ${datarootdir}/locale
2728 localstatedir = ${prefix}/var
2729 mandir = ${datarootdir}/man
2730 -mkdir_p = /usr/bin/mkdir -p
2731 +mkdir_p = $(top_builddir)/./install-sh -c -d
2732 oldincludedir = /usr/include
2735 @@ -147,10 +147,10 @@
2736 sharedstatedir = ${prefix}/com
2738 sysconfdir = ${prefix}/etc
2739 -target = x86_64-unknown-linux-gnu
2740 +target = i386-unknown-freebsd6.2
2742 -target_cpu = x86_64
2743 -target_os = linux-gnu
2745 +target_os = freebsd6.2
2746 target_vendor = unknown
2747 top_build_prefix = ../
2749 @@ -379,10 +379,10 @@
2752 %.chk: %.xml xml2rfc/rfc2629-refchk.xsl
2753 - /usr/bin/xsltproc xml2rfc/rfc2629-refchk.xsl $< >$@
2754 + /usr/local/bin/xsltproc xml2rfc/rfc2629-refchk.xsl $< >$@
2756 %.full: %.xml xml2rfc/rfc2629-noinc.xsl
2757 - /usr/bin/xsltproc xml2rfc/rfc2629-noinc.xsl $< >$@
2758 + /usr/local/bin/xsltproc xml2rfc/rfc2629-noinc.xsl $< >$@
2759 # Tell versions [3.59,3.63) of GNU make to not export all variables.
2760 # Otherwise a system limit (for SysV at least) may be exceeded.
2762 diff -urN --exclude *.m4 memcached-1.4.4/items.c repcached-2.2-1.4.4/items.c
2763 --- memcached-1.4.4/items.c Sat Oct 24 00:38:01 2009
2764 +++ repcached-2.2-1.4.4/items.c Tue Feb 9 23:02:45 2010
2769 +#ifdef USE_REPLICATION
2770 + replication_call_del(ITEM_key(search), search->nkey);
2771 +#endif /* USE_REPLICATION */
2773 do_item_unlink(search);
2775 @@ -288,8 +291,14 @@
2776 stats.total_items += 1;
2779 +#ifdef USE_REPLICATION
2780 + /* Allocate a new CAS ID on link. */
2781 + if(!(it->it_flags & ITEM_REPDATA))
2782 + ITEM_set_cas(it, (settings.use_cas) ? get_cas_id() : 0);
2784 /* Allocate a new CAS ID on link. */
2785 ITEM_set_cas(it, (settings.use_cas) ? get_cas_id() : 0);
2786 +#endif /* USE_REPLICATION */
2790 diff -urN --exclude *.m4 memcached-1.4.4/memcached.c repcached-2.2-1.4.4/memcached.c
2791 --- memcached-1.4.4/memcached.c Fri Nov 27 08:45:13 2009
2792 +++ repcached-2.2-1.4.4/memcached.c Wed Feb 10 16:08:37 2010
2793 @@ -102,6 +102,30 @@
2795 static void conn_free(conn *c);
2797 +#ifdef USE_REPLICATION
2798 +static int rep_exit = 0;
2799 +static conn *rep_recv = NULL;
2800 +static conn *rep_send = NULL;
2801 +static conn *rep_conn = NULL;
2802 +static conn *rep_serv = NULL;
2803 +static int server_socket_replication(const int);
2804 +static void server_close_replication(void);
2805 +static int replication_init(void);
2806 +static int replication_server_init(void);
2807 +static int replication_client_init(void);
2808 +static int replication_start(void);
2809 +static int replication_connect(void);
2810 +static int replication_close(void);
2811 +static void replication_dispatch_close(void);
2812 +static int replication_marugoto(int);
2813 +static int replication_send(conn *);
2814 +static int replication_pop(void);
2815 +static int replication_push(void);
2816 +static int replication_exit(void);
2817 +static int replication_item(Q_ITEM *);
2818 +static pthread_mutex_t replication_pipe_lock = PTHREAD_MUTEX_INITIALIZER;
2819 +#endif /* USE_REPLICATION */
2821 /** exported globals **/
2823 struct settings settings;
2824 @@ -194,6 +218,11 @@
2825 settings.backlog = 1024;
2826 settings.binding_protocol = negotiating_prot;
2827 settings.item_size_max = 1024 * 1024; /* The famous 1MB upper limit. */
2828 +#ifdef USE_REPLICATION
2829 + settings.rep_addr.s_addr = htonl(INADDR_ANY);
2830 + settings.rep_port = 11212;
2831 + settings.rep_qmax = 8192;
2832 +#endif /* USE_REPLICATION */
2836 @@ -382,6 +411,10 @@
2837 prot_text(c->protocol));
2838 } else if (IS_UDP(transport)) {
2839 fprintf(stderr, "<%d server listening (udp)\n", sfd);
2840 +#ifdef USE_REPLICATION
2841 + } else if (init_state == conn_rep_listen) {
2842 + fprintf(stderr, "<%d server listening (replication)\n", sfd);
2843 +#endif /* USE_REPLICATION */
2844 } else if (c->protocol == negotiating_prot) {
2845 fprintf(stderr, "<%d new auto-negotiating client connection\n",
2847 @@ -593,7 +626,11 @@
2853 + "conn_repconnect",
2854 + "conn_rep_listen",
2856 + "conn_pipe_send" };
2857 return statenames[state];
2860 @@ -752,6 +789,14 @@
2864 +#ifdef USE_REPLICATION
2865 + if (c == rep_conn){
2866 + if (settings.verbose > 1)
2867 + fprintf(stderr, "REP>%d %s\n", c->sfd, str);
2868 + conn_set_state(c, conn_new_cmd);
2871 +#endif /* USE_REPLICATION */
2873 if (settings.verbose > 1)
2874 fprintf(stderr, ">%d NOREPLY %s\n", c->sfd, str);
2875 @@ -791,9 +836,11 @@
2877 enum store_item_type ret;
2879 - pthread_mutex_lock(&c->thread->stats.mutex);
2880 - c->thread->stats.slab_stats[it->slabs_clsid].set_cmds++;
2881 - pthread_mutex_unlock(&c->thread->stats.mutex);
2883 + pthread_mutex_lock(&c->thread->stats.mutex);
2884 + c->thread->stats.slab_stats[it->slabs_clsid].set_cmds++;
2885 + pthread_mutex_unlock(&c->thread->stats.mutex);
2888 if (strncmp(ITEM_data(it) + it->nbytes - 2, "\r\n", 2) != 0) {
2889 out_string(c, "CLIENT_ERROR bad data chunk");
2890 @@ -832,6 +879,11 @@
2894 +#ifdef USE_REPLICATION
2895 + if( c != rep_conn ){
2896 + replication_call_rep(ITEM_key(it), it->nkey);
2898 +#endif /* USE_REPLICATION */
2899 out_string(c, "STORED");
2902 @@ -2410,6 +2462,11 @@
2903 APPEND_STAT("listen_disabled_num", "%llu", (unsigned long long)stats.listen_disabled_num);
2904 APPEND_STAT("threads", "%d", settings.num_threads);
2905 APPEND_STAT("conn_yields", "%llu", (unsigned long long)thread_stats.conn_yields);
2906 +#ifdef USE_REPLICATION
2907 + APPEND_STAT("replication", "MASTER", 0);
2908 + APPEND_STAT("repcached_version", "%s", REPCACHED_VERSION);
2909 + APPEND_STAT("repcached_qi_free", "%u", settings.rep_qmax - get_qi_count());
2910 +#endif /*USE_REPLICATION*/
2914 @@ -2797,6 +2854,11 @@
2915 switch(add_delta(c, it, incr, delta, temp)) {
2917 out_string(c, temp);
2918 +#ifdef USE_REPLICATION
2919 + if( c != rep_conn){
2920 + replication_call_rep(ITEM_key(it), it->nkey);
2922 +#endif /* USE_REPLICATION */
2925 out_string(c, "CLIENT_ERROR cannot increment or decrement non-numeric value");
2926 @@ -2911,17 +2973,25 @@
2928 MEMCACHED_COMMAND_DELETE(c->sfd, ITEM_key(it), it->nkey);
2930 - pthread_mutex_lock(&c->thread->stats.mutex);
2931 - c->thread->stats.slab_stats[it->slabs_clsid].delete_hits++;
2932 - pthread_mutex_unlock(&c->thread->stats.mutex);
2934 + pthread_mutex_lock(&c->thread->stats.mutex);
2935 + c->thread->stats.slab_stats[it->slabs_clsid].delete_hits++;
2936 + pthread_mutex_unlock(&c->thread->stats.mutex);
2940 item_remove(it); /* release our reference */
2941 +#ifdef USE_REPLICATION
2942 + if( c != rep_conn )
2943 + replication_call_del(key, nkey);
2944 +#endif /* USE_REPLICATION */
2945 out_string(c, "DELETED");
2947 - pthread_mutex_lock(&c->thread->stats.mutex);
2948 - c->thread->stats.delete_misses++;
2949 - pthread_mutex_unlock(&c->thread->stats.mutex);
2951 + pthread_mutex_lock(&c->thread->stats.mutex);
2952 + c->thread->stats.delete_misses++;
2953 + pthread_mutex_unlock(&c->thread->stats.mutex);
2956 out_string(c, "NOT_FOUND");
2958 @@ -2986,6 +3056,22 @@
2960 process_update_command(c, tokens, ntokens, comm, true);
2962 +#ifdef USE_REPLICATION
2963 + } else if ((ntokens == 7) && (strcmp(tokens[COMMAND_TOKEN].value, "rep") == 0 && (comm = NREAD_SET)) && (c == rep_conn)) {
2965 + process_update_command(c, tokens, ntokens, comm, true);
2967 + ((item *)(c->item))->it_flags |= ITEM_REPDATA;
2969 + } else if ((ntokens == 2) && (strcmp(tokens[COMMAND_TOKEN].value, "marugoto_end") == 0) && (c == rep_conn)) {
2970 + if(replication_start() == -1)
2971 + exit(EXIT_FAILURE);
2972 + if (settings.verbose > 0)
2973 + fprintf(stderr,"replication: start\n");
2974 + out_string(c, "OK");
2977 +#endif /* USE_REPLICATION */
2978 } else if ((ntokens == 4 || ntokens == 5) && (strcmp(tokens[COMMAND_TOKEN].value, "incr") == 0)) {
2980 process_arithmetic_command(c, tokens, ntokens, 1);
2981 @@ -3012,11 +3098,17 @@
2983 set_noreply_maybe(c, tokens, ntokens);
2985 - pthread_mutex_lock(&c->thread->stats.mutex);
2986 - c->thread->stats.flush_cmds++;
2987 - pthread_mutex_unlock(&c->thread->stats.mutex);
2989 + pthread_mutex_lock(&c->thread->stats.mutex);
2990 + c->thread->stats.flush_cmds++;
2991 + pthread_mutex_unlock(&c->thread->stats.mutex);
2994 if(ntokens == (c->noreply ? 3 : 2)) {
2995 +#ifdef USE_REPLICATION
2996 + if( c != rep_conn )
2997 + replication_call_flush_all();
2999 settings.oldest_live = current_time - 1;
3000 item_flush_expired();
3001 out_string(c, "OK");
3002 @@ -3029,6 +3121,11 @@
3006 +#ifdef USE_REPLICATION
3007 + if( c != rep_conn )
3008 + replication_call_defer_flush_all(realtime(exptime) + process_started);
3010 + settings.oldest_live = realtime(exptime) - 1;
3012 If exptime is zero realtime() would return zero too, and
3013 realtime(exptime) - 1 would overflow to the max unsigned
3014 @@ -3275,9 +3372,11 @@
3015 int avail = c->rsize - c->rbytes;
3016 res = read(c->sfd, c->rbuf + c->rbytes, avail);
3018 - pthread_mutex_lock(&c->thread->stats.mutex);
3019 - c->thread->stats.bytes_read += res;
3020 - pthread_mutex_unlock(&c->thread->stats.mutex);
3022 + pthread_mutex_lock(&c->thread->stats.mutex);
3023 + c->thread->stats.bytes_read += res;
3024 + pthread_mutex_unlock(&c->thread->stats.mutex);
3026 gotdata = READ_DATA_RECEIVED;
3029 @@ -3423,6 +3522,12 @@
3033 +#ifdef USE_REPLICATION
3034 + if(rep_exit && (c->state != conn_pipe_recv)){
3037 +#endif /* USE_REPLICATION */
3042 @@ -3502,9 +3607,11 @@
3044 reset_cmd_handler(c);
3046 - pthread_mutex_lock(&c->thread->stats.mutex);
3047 - c->thread->stats.conn_yields++;
3048 - pthread_mutex_unlock(&c->thread->stats.mutex);
3050 + pthread_mutex_lock(&c->thread->stats.mutex);
3051 + c->thread->stats.conn_yields++;
3052 + pthread_mutex_unlock(&c->thread->stats.mutex);
3054 if (c->rbytes > 0) {
3055 /* We have already read in data into the input buffer,
3056 so libevent will most likely not signal read events
3057 @@ -3545,9 +3652,11 @@
3058 /* now try reading from the socket */
3059 res = read(c->sfd, c->ritem, c->rlbytes);
3061 - pthread_mutex_lock(&c->thread->stats.mutex);
3062 - c->thread->stats.bytes_read += res;
3063 - pthread_mutex_unlock(&c->thread->stats.mutex);
3065 + pthread_mutex_lock(&c->thread->stats.mutex);
3066 + c->thread->stats.bytes_read += res;
3067 + pthread_mutex_unlock(&c->thread->stats.mutex);
3069 if (c->rcurr == c->ritem) {
3072 @@ -3600,9 +3709,11 @@
3073 /* now try reading from the socket */
3074 res = read(c->sfd, c->rbuf, c->rsize > c->sbytes ? c->sbytes : c->rsize);
3076 - pthread_mutex_lock(&c->thread->stats.mutex);
3077 - c->thread->stats.bytes_read += res;
3078 - pthread_mutex_unlock(&c->thread->stats.mutex);
3080 + pthread_mutex_lock(&c->thread->stats.mutex);
3081 + c->thread->stats.bytes_read += res;
3082 + pthread_mutex_unlock(&c->thread->stats.mutex);
3087 @@ -3698,6 +3809,10 @@
3089 if (IS_UDP(c->transport))
3091 +#ifdef USE_REPLICATION
3092 + else if(c == rep_conn)
3093 + replication_close();
3094 +#endif /*USE_REPLICATION*/
3098 @@ -3706,6 +3821,70 @@
3099 case conn_max_state:
3103 +#ifdef USE_REPLICATION
3104 + case conn_pipe_recv:
3105 + if(replication_pop()){
3106 + replication_close();
3108 + replication_send(rep_conn);
3113 + case conn_rep_listen:
3114 + if (settings.verbose > 0)
3115 + fprintf(stderr,"replication: accept\n");
3116 + addrlen = sizeof(addr);
3117 + res = accept(c->sfd, (struct sockaddr *)&addr, &addrlen);
3119 + if(errno == EAGAIN || errno == EWOULDBLOCK) {
3120 + } else if (errno == EMFILE) {
3121 + fprintf(stderr, "replication: Too many opened connections\n");
3123 + fprintf(stderr, "replication: accept error\n");
3128 + fprintf(stderr,"replication: already connected\n");
3130 + if((flags = fcntl(res, F_GETFL, 0)) < 0 || fcntl(res, F_SETFL, flags | O_NONBLOCK) < 0){
3132 + fprintf(stderr, "replication: Can't Setting O_NONBLOCK\n");
3134 + server_close_replication();
3135 + rep_conn = conn_new(res, conn_read, EV_READ | EV_PERSIST, DATA_BUFFER_SIZE, tcp_transport, main_base);
3136 + rep_conn->item = NULL;
3137 + rep_conn->rbytes = 0;
3138 + rep_conn->rcurr = rep_conn->rbuf;
3139 + replication_connect();
3140 + replication_marugoto(1);
3141 + replication_marugoto(0);
3148 + case conn_repconnect:
3150 + replication_connect();
3151 + conn_set_state(c, conn_read);
3152 + if (settings.verbose > 0)
3153 + fprintf(stderr,"replication: marugoto copying\n");
3154 + if(!update_event(c, EV_READ | EV_PERSIST)){
3155 + fprintf(stderr, "replication: Couldn't update event\n");
3156 + conn_set_state(c, conn_closing);
3161 + case conn_pipe_send:
3162 + /* should not happen */
3163 + fprintf(stderr, "replication: unexpected conn_pipe_send state\n");
3165 +#endif /* USE_REPLICATION */
3169 @@ -4002,6 +4181,89 @@
3173 +#ifdef USE_REPLICATION
3174 +static int server_socket_replication(const int port) {
3176 + struct linger ling = {0, 0};
3177 + struct addrinfo *ai;
3178 + struct addrinfo *next;
3179 + struct addrinfo hints;
3180 + char port_buf[NI_MAXSERV];
3186 + memset(&hints, 0, sizeof (hints));
3187 + hints.ai_flags = AI_PASSIVE|AI_ADDRCONFIG;
3188 + hints.ai_family = AF_UNSPEC;
3189 + hints.ai_protocol = IPPROTO_TCP;
3190 + hints.ai_socktype = SOCK_STREAM;
3191 + snprintf(port_buf, NI_MAXSERV, "%d", port);
3192 + error= getaddrinfo(settings.inter, port_buf, &hints, &ai);
3194 + if (error != EAI_SYSTEM)
3195 + fprintf(stderr, "getaddrinfo(): %s\n", gai_strerror(error));
3197 + perror("getaddrinfo()");
3202 + for (next= ai; next; next= next->ai_next) {
3203 + conn *rep_serv_add;
3204 + if ((sfd = new_socket(next)) == -1) {
3208 + setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, (void *)&flags, sizeof(flags));
3209 + setsockopt(sfd, SOL_SOCKET, SO_KEEPALIVE, (void *)&flags, sizeof(flags));
3210 + setsockopt(sfd, SOL_SOCKET, SO_LINGER, (void *)&ling, sizeof(ling));
3211 + setsockopt(sfd, IPPROTO_TCP, TCP_NODELAY, (void *)&flags, sizeof(flags));
3213 + if (bind(sfd, next->ai_addr, next->ai_addrlen) == -1) {
3214 + if (errno != EADDRINUSE) {
3224 + if (listen(sfd, 1024) == -1) {
3225 + perror("listen()");
3232 + if (!(rep_serv_add = conn_new(sfd, conn_rep_listen,
3233 + EV_READ | EV_PERSIST, 1, tcp_transport, main_base))) {
3234 + fprintf(stderr, "failed to create replication server connection\n");
3235 + exit(EXIT_FAILURE);
3238 + rep_serv_add->next = rep_serv;
3239 + rep_serv = rep_serv_add;
3244 + /* Return zero iff we detected no errors in starting up connections */
3245 + return success == 0;
3248 +static void server_close_replication(void) {
3250 + conn_close(rep_serv);
3251 + rep_serv = rep_serv->next;
3254 +#endif /* USE_REPLICATION */
3257 * We keep the current time of day in a global variable that's updated by a
3258 * timer event. This saves us a bunch of time() system calls (we really only
3259 @@ -4041,6 +4303,9 @@
3261 static void usage(void) {
3262 printf(PACKAGE " " VERSION "\n");
3263 +#ifdef USE_REPLICATION
3264 + printf("repcached %s\n",REPCACHED_VERSION);
3265 +#endif /* USE_REPLICATION */
3266 printf("-p <num> TCP port number to listen on (default: 11211)\n"
3267 "-U <num> UDP port number to listen on (default: 11211, 0 is off)\n"
3268 "-s <file> UNIX socket path to listen on (disables network support)\n"
3269 @@ -4088,6 +4353,10 @@
3271 printf("-S Turn on Sasl authentication\n");
3273 +#ifdef USE_REPLICATION
3274 + printf("-x <ip_addr> hostname or IP address of peer repcached\n");
3275 + printf("-X <num> TCP port number for replication (default: 11212)\n");
3276 +#endif /* USE_REPLICATION */
3280 @@ -4194,6 +4463,26 @@
3284 +#ifdef USE_REPLICATION
3285 +static void sig_handler_cb(int fd, short event, void *arg)
3287 + struct event *signal = arg;
3289 + if (settings.verbose)
3290 + fprintf(stderr, "got signal %d\n", EVENT_SIGNAL(signal));
3292 + if (replication_exit()) {
3293 + exit(EXIT_FAILURE);
3296 + pthread_mutex_lock(&replication_pipe_lock);
3298 + exit(EXIT_SUCCESS);
3300 + pthread_mutex_unlock(&replication_pipe_lock);
3302 +#endif /* USE_REPLICATION */
3304 #ifndef HAVE_SIGIGNORE
3305 static int sigignore(int sig) {
3306 struct sigaction sa = { .sa_handler = SIG_IGN, .sa_flags = 0 };
3307 @@ -4249,6 +4538,57 @@
3311 +static void create_listening_sockets(void)
3313 + /* create unix mode sockets after dropping privileges */
3314 + if (settings.socketpath != NULL) {
3316 + if (server_socket_unix(settings.socketpath,settings.access)) {
3317 + vperror("failed to listen on UNIX socket: %s", settings.socketpath);
3322 + /* create the listening socket, bind it, and init */
3323 + if (settings.socketpath == NULL) {
3324 + const char *portnumber_filename = getenv("MEMCACHED_PORT_FILENAME");
3325 + char temp_portnumber_filename[PATH_MAX];
3326 + FILE *portnumber_file = NULL;
3328 + if (portnumber_filename != NULL) {
3329 + snprintf(temp_portnumber_filename,
3330 + sizeof(temp_portnumber_filename),
3331 + "%s.lck", portnumber_filename);
3333 + portnumber_file = fopen(temp_portnumber_filename, "a");
3334 + if (portnumber_file == NULL) {
3335 + fprintf(stderr, "Failed to open \"%s\": %s\n",
3336 + temp_portnumber_filename, strerror(errno));
3341 + if (settings.port && server_socket(settings.port, tcp_transport,
3342 + portnumber_file)) {
3343 + vperror("failed to listen on TCP port %d", settings.port);
3347 + /* create the UDP listening socket and bind it */
3349 + if (settings.udpport && server_socket(settings.udpport, udp_transport,
3350 + portnumber_file)) {
3351 + vperror("failed to listen on UDP port %d", settings.udpport);
3355 + if (portnumber_file) {
3356 + fclose(portnumber_file);
3357 + rename(temp_portnumber_filename, portnumber_filename);
3362 int main (int argc, char **argv) {
3364 bool lock_memory = false;
3365 @@ -4261,6 +4601,11 @@
3369 +#ifdef USE_REPLICATION
3370 + struct in_addr addr;
3371 + struct addrinfo master_hint;
3372 + struct addrinfo *master_addr;
3373 +#endif /* USE_REPLICATION */
3374 /* listening sockets */
3375 static int *l_socket = NULL;
3377 @@ -4307,6 +4652,11 @@
3378 "B:" /* Binding protocol */
3379 "I:" /* Max item size */
3381 +#ifdef USE_REPLICATION
3382 + "X:" /* replication port */
3383 + "x:" /* replication master */
3384 + "q:" /* replication queue length */
3385 +#endif /* USE_REPLICATION */
3389 @@ -4462,6 +4812,31 @@
3393 +#ifdef USE_REPLICATION
3395 + if (inet_pton(AF_INET, optarg, &addr) <= 0) {
3396 + memset(&master_hint, 0, sizeof(master_hint));
3397 + master_hint.ai_flags = 0;
3398 + master_hint.ai_socktype = 0;
3399 + master_hint.ai_protocol = 0;
3400 + if(!getaddrinfo(optarg, NULL, &master_hint, &master_addr)){
3401 + settings.rep_addr = ((struct sockaddr_in *)(master_addr->ai_addr)) -> sin_addr;
3402 + freeaddrinfo(master_addr);
3404 + fprintf(stderr, "Illegal address: %s\n", optarg);
3408 + settings.rep_addr = addr;
3412 + settings.rep_port = atoi(optarg);
3415 + settings.rep_qmax = atoi(optarg);
3417 +#endif /* USE_REPLICATION */
3418 case 'S': /* set Sasl authentication to true. Default is false */
3420 fprintf(stderr, "This server is not built with SASL support.\n");
3421 @@ -4587,6 +4962,17 @@
3422 /* initialize main thread libevent instance */
3423 main_base = event_init();
3425 +#ifdef USE_REPLICATION
3426 + /* register events for SIGINT and SIGTERM to handle them in main thread */
3427 + struct event signal_int, signal_term;
3428 + event_set(&signal_int, SIGINT, EV_SIGNAL|EV_PERSIST, sig_handler_cb,
3430 + event_add(&signal_int, NULL);
3431 + event_set(&signal_term, SIGTERM, EV_SIGNAL|EV_PERSIST, sig_handler_cb,
3433 + event_add(&signal_term, NULL);
3436 /* initialize other stuff */
3439 @@ -4615,63 +5001,21 @@
3440 /* initialise clock event */
3441 clock_handler(0, 0, 0);
3443 - /* create unix mode sockets after dropping privileges */
3444 - if (settings.socketpath != NULL) {
3446 - if (server_socket_unix(settings.socketpath,settings.access)) {
3447 - vperror("failed to listen on UNIX socket: %s", settings.socketpath);
3452 - /* create the listening socket, bind it, and init */
3453 - if (settings.socketpath == NULL) {
3456 - const char *portnumber_filename = getenv("MEMCACHED_PORT_FILENAME");
3457 - char temp_portnumber_filename[PATH_MAX];
3458 - FILE *portnumber_file = NULL;
3460 - if (portnumber_filename != NULL) {
3461 - snprintf(temp_portnumber_filename,
3462 - sizeof(temp_portnumber_filename),
3463 - "%s.lck", portnumber_filename);
3465 - portnumber_file = fopen(temp_portnumber_filename, "a");
3466 - if (portnumber_file == NULL) {
3467 - fprintf(stderr, "Failed to open \"%s\": %s\n",
3468 - temp_portnumber_filename, strerror(errno));
3473 - if (settings.port && server_socket(settings.port, tcp_transport,
3474 - portnumber_file)) {
3475 - vperror("failed to listen on TCP port %d", settings.port);
3480 - * initialization order: first create the listening sockets
3481 - * (may need root on low ports), then drop root if needed,
3482 - * then daemonise if needed, then init libevent (in some cases
3483 - * descriptors created by libevent wouldn't survive forking).
3485 - udp_port = settings.udpport ? settings.udpport : settings.port;
3487 - /* create the UDP listening socket and bind it */
3489 - if (settings.udpport && server_socket(settings.udpport, udp_transport,
3490 - portnumber_file)) {
3491 - vperror("failed to listen on UDP port %d", settings.udpport);
3495 + * initialization order: first create the listening sockets
3496 + * (may need root on low ports), then drop root if needed,
3497 + * then daemonise if needed, then init libevent (in some cases
3498 + * descriptors created by libevent wouldn't survive forking).
3501 - if (portnumber_file) {
3502 - fclose(portnumber_file);
3503 - rename(temp_portnumber_filename, portnumber_filename);
3505 +#ifdef USE_REPLICATION
3506 + if(replication_init() == -1){
3507 + fprintf(stderr, "faild to replication init\n");
3508 + exit(EXIT_FAILURE);
3511 + create_listening_sockets();
3514 /* Drop privileges no longer needed */
3516 @@ -4694,3 +5038,401 @@
3518 return EXIT_SUCCESS;
3521 +#ifdef USE_REPLICATION
3522 +static int replication_start(void)
3524 + static int start = 0;
3528 + create_listening_sockets();
3534 +static int replication_server_init(void)
3539 + if(server_socket_replication(settings.rep_port)){
3540 + fprintf(stderr, "replication: failed to initialize replication server socket\n");
3543 + if (settings.verbose > 0)
3544 + fprintf(stderr, "replication: listen\n");
3545 + return(replication_start());
3548 +static int replication_client_init(void)
3552 + struct addrinfo ai;
3553 + struct sockaddr_in server;
3559 + memset(&ai,0,sizeof(ai));
3560 + ai.ai_family = AF_INET;
3561 + ai.ai_socktype = SOCK_STREAM;
3562 + s = new_socket(&ai);
3565 + fprintf(stderr, "replication: failed to replication client socket\n");
3569 + memset((char *)&server, 0, sizeof(server));
3570 + server.sin_family = AF_INET;
3571 + server.sin_addr = settings.rep_addr;
3572 + server.sin_port = htons(settings.rep_port);
3573 + if (settings.verbose > 0)
3574 + fprintf(stderr,"replication: connect (peer=%s:%d)\n", inet_ntoa(settings.rep_addr), settings.rep_port);
3575 + if(connect(s,(struct sockaddr *)&server, sizeof(server)) == 0){
3576 + c = conn_new(s, conn_repconnect, EV_WRITE | EV_PERSIST, DATA_BUFFER_SIZE, false, main_base);
3578 + fprintf(stderr, "replication: failed to create client conn");
3584 + if(errno == EINPROGRESS){
3585 + c = conn_new(s, conn_repconnect, EV_WRITE | EV_PERSIST, DATA_BUFFER_SIZE, false, main_base);
3587 + fprintf(stderr, "replication: failed to create client conn");
3592 + fprintf(stdout,"replication: can't connect %s:%d\n", inet_ntoa(server.sin_addr), ntohs(server.sin_port));
3601 +static int replication_init(void)
3603 + if(settings.rep_addr.s_addr != htonl(INADDR_ANY)){
3604 + if(replication_client_init() != -1){
3608 + return(replication_server_init());
3611 +static int replication_connect(void)
3616 + if(pipe(p) == -1){
3617 + fprintf(stderr, "replication: can't create pipe\n");
3620 + if((f = fcntl(p[0], F_GETFL, 0)) < 0 || fcntl(p[0], F_SETFL, f | O_NONBLOCK) < 0) {
3621 + fprintf(stderr, "replication: can't setting O_NONBLOCK pipe[0]\n");
3624 + if((f = fcntl(p[1], F_GETFL, 0)) < 0 || fcntl(p[1], F_SETFL, f | O_NONBLOCK) < 0) {
3625 + fprintf(stderr, "replication: can't setting O_NONBLOCK pipe[0]\n");
3628 + pthread_mutex_lock(&replication_pipe_lock);
3629 + rep_recv = conn_new(p[0], conn_pipe_recv, EV_READ | EV_PERSIST, DATA_BUFFER_SIZE, tcp_transport, main_base);
3630 + rep_send = conn_new(p[1], conn_pipe_send, EV_READ | EV_PERSIST, DATA_BUFFER_SIZE, tcp_transport, main_base);
3631 + event_del(&rep_send->event);
3632 + pthread_mutex_unlock(&replication_pipe_lock);
3637 +static int replication_close(void)
3643 + if(settings.verbose > 0)
3644 + fprintf(stderr,"replication: close\n");
3646 + rep_recv->rbytes = sizeof(q);
3647 + rep_recv->rcurr = rep_recv->rbuf;
3650 + r = read(rep_recv->sfd, rep_recv->rcurr, rep_recv->rbytes);
3654 + rep_recv->rbytes -= r;
3655 + rep_recv->rcurr += r;
3656 + if(!rep_recv->rbytes){
3657 + memcpy(&q, rep_recv->rbuf, sizeof(q));
3658 + rep_recv->rbytes = sizeof(q);
3659 + rep_recv->rcurr = rep_recv->rbuf;
3664 + conn_close(rep_recv);
3666 + if (settings.verbose > 1) {
3667 + fprintf(stderr, "replication: qitem free %d items\n", qi_free_list());
3668 + fprintf(stderr, "replication: close recv %d items\n", c);
3671 + pthread_mutex_lock(&replication_pipe_lock);
3673 + conn_close(rep_send);
3675 + if (settings.verbose > 1)
3676 + fprintf(stderr,"replication: close send\n");
3678 + pthread_mutex_unlock(&replication_pipe_lock);
3680 + conn_close(rep_conn);
3682 + if (settings.verbose > 1)
3683 + fprintf(stderr,"replication: close conn\n");
3686 + replication_server_init();
3690 +static void replication_dispatch_close(void)
3692 + if (settings.verbose > 1)
3693 + fprintf(stderr, "replication: dispatch close\n");
3694 + pthread_mutex_lock(&replication_pipe_lock);
3696 + conn_close(rep_send);
3699 + pthread_mutex_unlock(&replication_pipe_lock);
3702 +static int replication_marugoto(int f)
3704 + static int keysend = 0;
3705 + static int keycount = 0;
3706 + static char *keylist = NULL;
3707 + static char *keyptr = NULL;
3717 + pthread_mutex_lock(&cache_lock);
3718 + keylist = (char *)assoc_key_snap((int *)&keycount);
3719 + pthread_mutex_unlock(&cache_lock);
3722 + replication_call_marugoto_end();
3724 + if (settings.verbose > 0)
3725 + fprintf(stderr,"replication: marugoto start\n");
3730 + item *it = item_get(keyptr, strlen(keyptr));
3733 + if(replication_call_rep(keyptr, strlen(keyptr)) == -1){
3737 + keyptr += strlen(keyptr) + 1;
3741 + keyptr += strlen(keyptr) + 1;
3743 + if(settings.verbose > 0)
3744 + fprintf(stderr,"replication: marugoto %d\n", keysend);
3745 + replication_call_marugoto_end();
3746 + if(settings.verbose > 0)
3747 + fprintf(stderr,"replication: marugoto owari\n");
3758 +static int replication_send(conn *c)
3761 + int w = write(c->sfd, c->wcurr, c->wbytes);
3763 + if(errno == EAGAIN || errno == EINTR){
3765 + fprintf(stderr,"replication: send error\n");
3766 + replication_close();
3774 + return(c->wbytes);
3777 +static int replication_pop(void)
3784 + if(settings.verbose > 1)
3785 + fprintf(stderr, "replication: pop\n");
3790 + r = read(rep_recv->sfd, rep_recv->rbuf, rep_recv->rsize);
3792 + if(errno == EAGAIN || errno == EINTR){
3794 + fprintf(stderr,"replication: pop error %d\n", errno);
3798 + /* other end closed, trigger replication_close() */
3801 + c = r / sizeof(Q_ITEM *);
3802 + m = r % sizeof(Q_ITEM *);
3803 + q = (Q_ITEM **)(rep_recv->rbuf);
3806 + if(rep_conn && replication_cmd(rep_conn, q[c])){
3807 + replication_item(q[c]); /* error retry */
3813 + if (settings.verbose)
3814 + fprintf(stderr,"replication: cleanup start\n");
3821 + if(rep_conn->wbytes){
3823 + if(replication_exit()){
3824 + replication_close();
3825 + fprintf(stderr,"replication: cleanup error\n");
3826 + exit(EXIT_FAILURE);
3830 + replication_close();
3831 + if (settings.verbose)
3832 + fprintf(stderr,"replication: cleanup complete\n");
3833 + exit(EXIT_SUCCESS);
3836 + replication_marugoto(0);
3840 +static int replication_push(void)
3844 + while(rep_send->wbytes){
3845 + w = write(rep_send->sfd, rep_send->wcurr, rep_send->wbytes);
3847 + if(errno == EAGAIN || errno == EINTR){
3848 + fprintf(stderr,"replication: push EAGAIN or EINTR\n");
3853 + rep_send->wbytes -= w;
3854 + rep_send->wcurr += w;
3857 + rep_send->wcurr = rep_send->wbuf;
3861 +static int replication_exit(void)
3863 + return(replication_item(NULL));
3866 +static int replication_item(Q_ITEM *q)
3868 + pthread_mutex_lock(&replication_pipe_lock);
3870 + pthread_mutex_unlock(&replication_pipe_lock);
3873 + if(rep_send->wcurr + rep_send->wbytes + sizeof(q) > rep_send->wbuf + rep_send->wsize){
3874 + fprintf(stderr,"replication: buffer over fllow\n");
3878 + pthread_mutex_unlock(&replication_pipe_lock);
3879 + replication_dispatch_close();
3882 + memcpy(rep_send->wcurr + rep_send->wbytes, &q, sizeof(q));
3883 + rep_send->wbytes += sizeof(q);
3884 + if(replication_push()){
3885 + fprintf(stderr, "replication: push error\n");
3889 + pthread_mutex_unlock(&replication_pipe_lock);
3890 + replication_dispatch_close();
3893 + pthread_mutex_unlock(&replication_pipe_lock);
3897 +int replication(enum CMD_TYPE type, R_CMD *cmd)
3901 + pthread_mutex_lock(&replication_pipe_lock);
3903 + pthread_mutex_unlock(&replication_pipe_lock);
3906 + pthread_mutex_unlock(&replication_pipe_lock);
3908 + if((q = qi_new(type, cmd, false))) {
3909 + replication_item(q);
3911 + fprintf(stderr,"replication: can't create Q_ITEM\n");
3912 + replication_dispatch_close();
3917 +#endif /* USE_REPLICATION */
3918 diff -urN --exclude *.m4 memcached-1.4.4/memcached.h repcached-2.2-1.4.4/memcached.h
3919 --- memcached-1.4.4/memcached.h Thu Nov 26 03:37:49 2009
3920 +++ repcached-2.2-1.4.4/memcached.h Tue Feb 9 23:02:45 2010
3921 @@ -144,7 +144,13 @@
3922 conn_swallow, /**< swallowing unnecessary bytes w/o storing */
3923 conn_closing, /**< closing this connection */
3924 conn_mwrite, /**< writing out many items sequentially */
3925 - conn_max_state /**< Max state value (used for assertion) */
3926 +#ifdef USE_REPLICATION
3927 + conn_repconnect, /**< replication connecting to master */
3928 + conn_rep_listen, /**< replication listening socket */
3929 + conn_pipe_recv, /**< replication command pipe recv */
3930 + conn_pipe_send, /**< replication command pipe send */
3931 +#endif /* USE_REPLICATION */
3932 + conn_max_state, /**< Max state value (used for assertion) */
3935 enum bin_substates {
3938 uint64_t get_misses;
3941 time_t started; /* when the process was started */
3943 bool accepting_conns; /* whether we are currently accepting */
3944 uint64_t listen_disabled_num;
3946 @@ -274,6 +282,11 @@
3948 int item_size_max; /* Maximum item size, and upper end for slabs */
3949 bool sasl; /* SASL on/off */
3950 +#ifdef USE_REPLICATION
3951 + struct in_addr rep_addr; /* replication addr */
3952 + int rep_port; /* replication port */
3953 + int rep_qmax; /* replication QITEM max */
3954 +#endif /*USE_REPLICATION*/
3957 extern struct stats stats;
3958 @@ -286,6 +299,10 @@
3960 #define ITEM_SLABBED 4
3962 +#ifdef USE_REPLICATION
3963 +#define ITEM_REPDATA 128
3964 +#endif /*USE_REPLICATION*/
3967 * Structure for storing items within memcached.
3969 @@ -438,6 +455,10 @@
3974 +#ifdef USE_REPLICATION
3975 +#include "replication.h"
3976 +#endif /* USE_REPLICATION */
3979 * Functions such as the libevent-related calls that need to do cross-thread
3980 diff -urN --exclude *.m4 memcached-1.4.4/memcached.spec repcached-2.2-1.4.4/memcached.spec
3981 --- memcached-1.4.4/memcached.spec Fri Nov 27 09:34:55 2009
3982 +++ repcached-2.2-1.4.4/memcached.spec Wed Feb 10 19:12:03 2010
3987 +Release: 1.49_g6b6b7ed%{?dist}
3988 Summary: High Performance, Distributed Memory Object Cache
3990 Group: System Environment/Daemons
3992 URL: http://www.danga.com/memcached/
3993 -Source0: http://memcached.googlecode.com/files/%{name}-1.4.4.tar.gz
3994 +Source0: http://memcached.googlecode.com/files/%{name}-1.4.4_49_g6b6b7ed.tar.gz
3995 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
3997 BuildRequires: libevent-devel
3999 web applications by alleviating database load.
4002 -%setup -q -n %{name}-1.4.4
4003 +%setup -q -n %{name}-1.4.4_49_g6b6b7ed
4007 diff -urN --exclude *.m4 memcached-1.4.4/replication.c repcached-2.2-1.4.4/replication.c
4008 --- memcached-1.4.4/replication.c Thu Jan 1 03:00:00 1970
4009 +++ repcached-2.2-1.4.4/replication.c Wed Feb 10 18:40:48 2010
4011 +/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
4015 +#include "memcached.h"
4016 +#include "replication.h"
4017 +#include <stdlib.h>
4019 +#include <unistd.h>
4020 +#include <string.h>
4023 +static Q_ITEM *q_freelist = NULL;
4024 +static int q_itemcount = 0;
4025 +static pthread_mutex_t replication_queue_lock = PTHREAD_MUTEX_INITIALIZER;
4027 +int get_qi_count(void)
4030 + pthread_mutex_lock(&replication_queue_lock);
4032 + pthread_mutex_unlock(&replication_queue_lock);
4036 +Q_ITEM *qi_new(enum CMD_TYPE type, R_CMD *cmd, bool reuse)
4040 + uint32_t keylen = 0;
4041 + rel_time_t time = 0;
4043 + pthread_mutex_lock(&replication_queue_lock);
4046 + q_freelist = q->next;
4051 + pthread_mutex_unlock(&replication_queue_lock);
4054 + if(q_itemcount >= settings.rep_qmax) {
4055 + pthread_mutex_unlock(&replication_queue_lock);
4058 + q = malloc(sizeof(Q_ITEM));
4060 + fprintf(stderr,"replication: qi_new out of memory\n");
4061 + pthread_mutex_unlock(&replication_queue_lock);
4065 + if (settings.verbose > 2)
4066 + fprintf(stderr,"replication: alloc c=%d\n", q_itemcount);
4069 + pthread_mutex_unlock(&replication_queue_lock);
4072 + case REPLICATION_REP:
4073 + case REPLICATION_DEL:
4075 + keylen = cmd->keylen;
4077 + case REPLICATION_FLUSH_ALL:
4079 + case REPLICATION_DEFER_FLUSH_ALL:
4082 + case REPLICATION_MARUGOTO_END:
4085 + fprintf(stderr,"replication: got unknown command: %d\n", type);
4094 + q->key = malloc(keylen + 1);
4095 + if(NULL == q->key){
4099 + memcpy(q->key, key, keylen);
4100 + *(q->key + keylen) = 0;
4107 +void qi_free(Q_ITEM *q)
4114 + pthread_mutex_lock(&replication_queue_lock);
4115 + q->next = q_freelist;
4117 + pthread_mutex_unlock(&replication_queue_lock);
4126 + pthread_mutex_lock(&replication_queue_lock);
4127 + while((q = q_freelist)){
4130 + q_freelist = q->next;
4133 + pthread_mutex_unlock(&replication_queue_lock);
4137 +static int replication_get_num(char *p, int n)
4142 + l = sprintf(p, "%u", n);
4144 + l = sprintf(b, "%u", n);
4148 +int replication_call_rep(char *key, size_t keylen)
4152 + r.keylen = keylen;
4153 + return(replication(REPLICATION_REP, &r));
4156 +int replication_call_del(char *key, size_t keylen)
4160 + r.keylen = keylen;
4161 + return(replication(REPLICATION_DEL, &r));
4164 +int replication_call_flush_all()
4168 + return(replication(REPLICATION_FLUSH_ALL, &r));
4171 +int replication_call_defer_flush_all(const rel_time_t time)
4176 + return(replication(REPLICATION_DEFER_FLUSH_ALL, &r));
4179 +int replication_call_marugoto_end()
4183 + return(replication(REPLICATION_MARUGOTO_END, &r));
4186 +static int replication_alloc(conn *c, int s)
4191 + while(c->wsize < s)
4193 + if((p = malloc(c->wsize))){
4194 + memcpy(p, c->wbuf, c->wbytes);
4204 +static int replication_del(conn *c, char *k)
4207 + char *s = "delete ";
4214 + if(replication_alloc(c,l) == -1){
4215 + fprintf(stderr, "replication: del malloc error\n");
4218 + p = c->wbuf + c->wbytes;
4219 + memcpy(p, s, strlen(s));
4221 + memcpy(p, k, strlen(k));
4223 + memcpy(p, n, strlen(n));
4225 + c->wbytes = p - c->wbuf;
4226 + c->wcurr = c->wbuf;
4230 +static int replication_rep(conn *c, item *it)
4240 + exp = it->exptime + process_started;
4242 + if((p=ITEM_suffix(it))){
4244 + memcpy(flag, p, it->nsuffix - 2);
4245 + flag[it->nsuffix - 2] = 0;
4246 + for(i=0;i<strlen(flag);i++){
4250 + memmove(flag,&flag[i],strlen(flag)-i);
4251 + for(p=flag;*p>' ';p++);
4257 + len += strlen(flag);
4259 + len += replication_get_num(NULL, exp);
4261 + len += replication_get_num(NULL, it->nbytes - 2);
4263 + len += replication_get_num(NULL, ITEM_get_cas(it));
4265 + len += it->nbytes;
4267 + if(replication_alloc(c,len) == -1){
4268 + fprintf(stderr, "replication: rep malloc error\n");
4271 + p = c->wbuf + c->wbytes;
4272 + memcpy(p, s, strlen(s));
4274 + memcpy(p, ITEM_key(it), it->nkey);
4277 + memcpy(p, flag, strlen(flag));
4278 + p += strlen(flag);
4280 + p += replication_get_num(p, exp);
4282 + p += replication_get_num(p, it->nbytes - 2);
4284 + p += replication_get_num(p, ITEM_get_cas(it));
4285 + memcpy(p, n, strlen(n));
4287 + memcpy(p, ITEM_data(it), it->nbytes);
4289 + c->wbytes = p - c->wbuf;
4290 + c->wcurr = c->wbuf;
4294 +static int replication_flush_all(conn *c, rel_time_t exp)
4296 + char *s = "flush_all ";
4300 + int l = strlen(s) + strlen(n);
4302 + l += replication_get_num(NULL, exp);
4303 + if(replication_alloc(c,l) == -1){
4304 + fprintf(stderr, "replication: flush_all malloc error\n");
4307 + p = c->wbuf + c->wbytes;
4308 + memcpy(p, s, strlen(s));
4311 + p += replication_get_num(p, exp);
4312 + memcpy(p, n, strlen(n));
4314 + c->wbytes = p - c->wbuf;
4315 + c->wcurr = c->wbuf;
4319 +static int replication_marugoto_end(conn *c)
4321 + char *s = "marugoto_end";
4325 + int l = strlen(s) + strlen(n);
4326 + if(replication_alloc(c,l) == -1){
4327 + fprintf(stderr, "replication: marugoto_end malloc error\n");
4330 + p = c->wbuf + c->wbytes;
4331 + memcpy(p, s, strlen(s));
4333 + memcpy(p, n, strlen(n));
4335 + c->wbytes = p - c->wbuf;
4336 + c->wcurr = c->wbuf;
4340 +int replication_cmd(conn *c, Q_ITEM *q)
4345 + switch (q->type) {
4346 + case REPLICATION_REP:
4347 + it = item_get(q->key, strlen(q->key));
4349 + return(replication_del(c, q->key));
4350 + r = replication_rep(c, it);
4353 + case REPLICATION_DEL:
4354 + return(replication_del(c, q->key));
4355 + case REPLICATION_FLUSH_ALL:
4356 + return(replication_flush_all(c, 0));
4357 + case REPLICATION_DEFER_FLUSH_ALL:
4358 + return(replication_flush_all(c, q->time));
4359 + case REPLICATION_MARUGOTO_END:
4360 + return(replication_marugoto_end(c));
4362 + fprintf(stderr,"replication: got unknown command:%d\n", q->type);
4366 diff -urN --exclude *.m4 memcached-1.4.4/replication.h repcached-2.2-1.4.4/replication.h
4367 --- memcached-1.4.4/replication.h Thu Jan 1 03:00:00 1970
4368 +++ repcached-2.2-1.4.4/replication.h Wed Feb 10 18:40:31 2010
4370 +#ifndef MEMCACHED_REPLICATION_H
4371 +#define MEMCACHED_REPLICATION_H
4372 +#define REPCACHED_VERSION "2.2"
4378 + REPLICATION_FLUSH_ALL,
4379 + REPLICATION_DEFER_FLUSH_ALL,
4380 + REPLICATION_MARUGOTO_END,
4383 +typedef struct queue_item_t Q_ITEM;
4384 +struct queue_item_t {
4385 + enum CMD_TYPE type;
4391 +typedef struct replication_cmd_t R_CMD;
4392 +struct replication_cmd_t {
4398 +Q_ITEM *qi_new(enum CMD_TYPE type, R_CMD *cmd, bool);
4399 +void qi_free(Q_ITEM *);
4400 +int qi_free_list(void);
4401 +int replication_cmd(conn *, Q_ITEM *);
4402 +int get_qi_count(void);
4404 +int replication_call_rep(char *key, size_t keylen);
4405 +int replication_call_del(char *key, size_t keylen);
4406 +int replication_call_flush_all(void);
4407 +int replication_call_defer_flush_all(const rel_time_t time);
4408 +int replication_call_marugoto_end(void);
4409 +int replication(enum CMD_TYPE type, R_CMD *cmd);
4412 diff -urN --exclude *.m4 memcached-1.4.4/t/binary.t repcached-2.2-1.4.4/t/binary.t
4413 --- memcached-1.4.4/t/binary.t Fri Nov 27 08:05:16 2009
4414 +++ repcached-2.2-1.4.4/t/binary.t Wed Feb 10 17:04:01 2010
4419 -use Test::More tests => 3349;
4421 use FindBin qw($Bin);
4425 +Test::More::plan(tests => support_replication() ? 3385 : 3349);
4427 my $server = new_memcached();
4428 ok($server, "started the server");
4429 diff -urN --exclude *.m4 memcached-1.4.4/t/issue_67.t repcached-2.2-1.4.4/t/issue_67.t
4430 --- memcached-1.4.4/t/issue_67.t Sun Nov 1 01:44:09 2009
4431 +++ repcached-2.2-1.4.4/t/issue_67.t Wed Feb 10 17:50:12 2010
4433 my $exe = "$builddir/memcached-debug";
4434 croak("memcached binary doesn't exist. Haven't run 'make' ?\n") unless -e $exe;
4436 + if (support_replication()) {
4440 my $childpid = fork();
4442 my $cmd = "$builddir/timedrun 10 $exe $args";
4443 diff -urN --exclude *.m4 memcached-1.4.4/t/lib/MemcachedTest.pm repcached-2.2-1.4.4/t/lib/MemcachedTest.pm
4444 --- memcached-1.4.4/t/lib/MemcachedTest.pm Fri Oct 30 04:24:52 2009
4445 +++ repcached-2.2-1.4.4/t/lib/MemcachedTest.pm Wed Feb 10 17:53:34 2010
4449 @EXPORT = qw(new_memcached sleep mem_get_is mem_gets mem_gets_is mem_stats
4450 - supports_sasl free_port);
4451 + supports_sasl free_port support_replication memcached_version
4456 @@ -148,6 +149,23 @@
4460 +sub support_replication {
4461 + my $output = `$builddir/memcached-debug -h`;
4462 + return 1 if $output =~ /^-x <ip_addr>/m;
4466 +sub memcached_version {
4467 + my $output = `$builddir/memcached-debug -h`;
4468 + return $1 if $output =~ /^memcached (\d[\d\.]+)/;
4473 + my($major,$minor,$pl) = ($_[0] =~ /^(\d+)\.(\d+)\.(\d+)$/);
4474 + return $major*100**2 + $minor*100 + $pl
4478 my ($args, $passed_port) = @_;
4479 my $port = $passed_port || free_port();
4483 $args .= " -u root";
4485 + if (support_replication() && $args !~ m/-X/) {
4489 my $childpid = fork();
4490 diff -urN --exclude *.m4 memcached-1.4.4/t/stats.t repcached-2.2-1.4.4/t/stats.t
4491 --- memcached-1.4.4/t/stats.t Thu Nov 26 03:37:49 2009
4492 +++ repcached-2.2-1.4.4/t/stats.t Tue Feb 9 23:13:26 2010
4494 my $stats = mem_stats($sock);
4496 # Test number of keys
4497 -is(scalar(keys(%$stats)), 37, "37 stats values");
4498 +if (! support_replication()) {
4499 + is(scalar(keys(%$stats)), 37, "37 stats values");
4501 + is(scalar(keys(%$stats)), 40, "40 stats values");
4504 # Test initial state
4505 foreach my $key (qw(curr_items total_items bytes cmd_get cmd_set get_hits evictions get_misses
4506 diff -urN --exclude *.m4 memcached-1.4.4/testapp.c repcached-2.2-1.4.4/testapp.c
4507 --- memcached-1.4.4/testapp.c Wed Nov 25 03:40:29 2009
4508 +++ repcached-2.2-1.4.4/testapp.c Wed Feb 10 17:52:05 2010
4509 @@ -300,6 +300,10 @@
4513 +#ifdef USE_REPLICATION
4514 + argv[arg++] = "-X";
4515 + argv[arg++] = "0";
4517 /* Handle rpmbuild and the like doing this as root */
4518 if (getuid() == 0) {