1 Index: tmux-1.5/configure.ac
2 ===================================================================
3 --- tmux-1.5.orig/configure.ac 2011-07-09 18:00:17.000000000 +0200
4 +++ tmux-1.5/configure.ac 2011-07-31 17:00:47.000000000 +0200
6 # autoconf will automatically use CFLAGS="-O2 -g". Prevent that by using an
10 # Set up the compiler in two different ways and say yes we may want to install.
16 AC_HELP_STRING(--enable-static, create a static build),
17 - [found_static=$enable_static]
18 + [LDFLAGS="$LDFLAGS -static"]
20 -AM_CONDITIONAL(IS_STATIC, test "x" = xyes)
23 AM_CONDITIONAL(IS_GCC, test "x$GCC" = xyes)
25 AC_CHECK_LIB(rt, clock_gettime)
28 -AC_SEARCH_LIBS(event_init, [event event-1.4 event2], found_libevent=yes, found_libevent=no)
31 + [event event-1.4 event2],
35 if test "x$found_libevent" = xno; then
36 - AC_MSG_ERROR("libevent not found")
37 + AC_MSG_ERROR("libevent not found")
42 AC_MSG_ERROR("curses not found")
45 +# Check for b64_ntop.
46 +AC_MSG_CHECKING(for b64_ntop)
49 + #include <sys/types.h>
50 + #include <netinet/in.h>
53 + [b64_ntop(NULL, 0, NULL, 0);],
57 +if test "x$found_b64_ntop" = xno; then
60 + AC_MSG_CHECKING(for b64_ntop with -lresolv)
61 + LIBS="$LIBS -lresolv"
64 + #include <sys/types.h>
65 + #include <netinet/in.h>
68 + [b64_ntop(NULL, 0, NULL, 0);],
72 + if test "x$found_b64_ntop" = xno; then
76 +if test "x$found_b64_ntop" = xyes; then
77 + AC_DEFINE(HAVE_B64_NTOP)
80 +AM_CONDITIONAL(NO_B64_NTOP, [test "x$found_b64_ntop" = xno])
82 # Look for networking libraries.
83 -AC_SEARCH_LIBS(b64_ntop, resolv)
84 -AC_SEARCH_LIBS(__b64_ntop, resolv)
85 AC_SEARCH_LIBS(inet_ntoa, nsl)
86 AC_SEARCH_LIBS(socket, socket)
87 AC_CHECK_LIB(xnet, socket)
88 Index: tmux-1.5/compat.h
89 ===================================================================
90 --- tmux-1.5.orig/compat.h 2011-07-09 11:42:38.000000000 +0200
91 +++ tmux-1.5/compat.h 2011-07-31 17:00:24.000000000 +0200
96 +#ifndef HAVE_B64_NTOP
98 +int b64_ntop(const char *, size_t, char *, size_t);
103 #include <sys/ioctl.h>
104 Index: tmux-1.5/Makefile.am
105 ===================================================================
106 --- tmux-1.5.orig/Makefile.am 2011-07-09 15:45:24.000000000 +0200
107 +++ tmux-1.5/Makefile.am 2011-07-31 17:00:47.000000000 +0200
112 -# Set flags for static.
117 # Set flags for Solaris.
119 CPPFLAGS += -D_XPG4_2 -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS
122 nodist_tmux_SOURCES += compat/strtonum.c
125 +nodist_tmux_SOURCES += compat/b64_ntop.c
128 # Update SF web site.
129 upload-index.html: update-index.html
130 Index: tmux-1.5/compat/b64_ntop.c
131 ===================================================================
132 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
133 +++ tmux-1.5/compat/b64_ntop.c 2011-07-31 17:04:03.000000000 +0200
136 + * Copyright (c) 1996, 1998 by Internet Software Consortium.
138 + * Permission to use, copy, modify, and distribute this software for any
139 + * purpose with or without fee is hereby granted, provided that the above
140 + * copyright notice and this permission notice appear in all copies.
142 + * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
143 + * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
144 + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
145 + * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
146 + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
147 + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
148 + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
153 + * Portions Copyright (c) 1995 by International Business Machines, Inc.
155 + * International Business Machines, Inc. (hereinafter called IBM) grants
156 + * permission under its copyrights to use, copy, modify, and distribute this
157 + * Software with or without fee, provided that the above copyright notice and
158 + * all paragraphs of this notice appear in all copies, and that the name of IBM
159 + * not be used in connection with the marketing of any product incorporating
160 + * the Software or modifications thereof, without specific, written prior
163 + * To the extent it has a right to do so, IBM grants an immunity from suit
164 + * under its patents, if any, for the use, sale or manufacture of products to
165 + * the extent that such products are used for performing Domain Name System
166 + * dynamic updates in TCP/IP networks by means of the Software. No immunity is
167 + * granted for any product per se or for any other function of any product.
169 + * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
170 + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
171 + * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
172 + * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
173 + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
174 + * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
177 +#include <sys/types.h>
178 +#include <sys/param.h>
179 +#include <sys/socket.h>
181 +#include <netinet/in.h>
182 +#include <arpa/inet.h>
189 +#define Assert(Cond) if (!(Cond)) abort()
191 +static const char Base64[] =
192 + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
193 +static const char Pad64 = '=';
195 +/* (From RFC1521 and draft-ietf-dnssec-secext-03.txt)
196 + The following encoding technique is taken from RFC 1521 by Borenstein
197 + and Freed. It is reproduced here in a slightly edited form for
200 + A 65-character subset of US-ASCII is used, enabling 6 bits to be
201 + represented per printable character. (The extra 65th character, "=",
202 + is used to signify a special processing function.)
204 + The encoding process represents 24-bit groups of input bits as output
205 + strings of 4 encoded characters. Proceeding from left to right, a
206 + 24-bit input group is formed by concatenating 3 8-bit input groups.
207 + These 24 bits are then treated as 4 concatenated 6-bit groups, each
208 + of which is translated into a single digit in the base64 alphabet.
210 + Each 6-bit group is used as an index into an array of 64 printable
211 + characters. The character referenced by the index is placed in the
214 + Table 1: The Base64 Alphabet
216 + Value Encoding Value Encoding Value Encoding Value Encoding
227 + 10 K 27 b 44 s 61 9
228 + 11 L 28 c 45 t 62 +
229 + 12 M 29 d 46 u 63 /
231 + 14 O 31 f 48 w (pad) =
235 + Special processing is performed if fewer than 24 bits are available
236 + at the end of the data being encoded. A full encoding quantum is
237 + always completed at the end of a quantity. When fewer than 24 input
238 + bits are available in an input group, zero bits are added (on the
239 + right) to form an integral number of 6-bit groups. Padding at the
240 + end of the data is performed using the '=' character.
242 + Since all base64 input is an integral number of octets, only the
243 + -------------------------------------------------
244 + following cases can arise:
246 + (1) the final quantum of encoding input is an integral
247 + multiple of 24 bits; here, the final unit of encoded
248 + output will be an integral multiple of 4 characters
249 + with no "=" padding,
250 + (2) the final quantum of encoding input is exactly 8 bits;
251 + here, the final unit of encoded output will be two
252 + characters followed by two "=" padding characters, or
253 + (3) the final quantum of encoding input is exactly 16 bits;
254 + here, the final unit of encoded output will be three
255 + characters followed by one "=" padding character.
259 +b64_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsize) {
260 + size_t datalength = 0;
265 + while (2 < srclength) {
271 + output[0] = input[0] >> 2;
272 + output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
273 + output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
274 + output[3] = input[2] & 0x3f;
275 + Assert(output[0] < 64);
276 + Assert(output[1] < 64);
277 + Assert(output[2] < 64);
278 + Assert(output[3] < 64);
280 + if (datalength + 4 > targsize)
282 + target[datalength++] = Base64[output[0]];
283 + target[datalength++] = Base64[output[1]];
284 + target[datalength++] = Base64[output[2]];
285 + target[datalength++] = Base64[output[3]];
288 + /* Now we worry about padding. */
289 + if (0 != srclength) {
290 + /* Get what's left. */
291 + input[0] = input[1] = input[2] = '\0';
292 + for (i = 0; i < srclength; i++)
295 + output[0] = input[0] >> 2;
296 + output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
297 + output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
298 + Assert(output[0] < 64);
299 + Assert(output[1] < 64);
300 + Assert(output[2] < 64);
302 + if (datalength + 4 > targsize)
304 + target[datalength++] = Base64[output[0]];
305 + target[datalength++] = Base64[output[1]];
306 + if (srclength == 1)
307 + target[datalength++] = Pad64;
309 + target[datalength++] = Base64[output[2]];
310 + target[datalength++] = Pad64;
312 + if (datalength >= targsize)
314 + target[datalength] = '\0'; /* Returned value doesn't count \0. */
315 + return (datalength);