[packages] add dante - provides libsocks, sockd and socksify
[openwrt/svn-archive/archive.git] / net / dante / patches / 001-automake-compat.patch
1 --- a/configure.ac
2 +++ b/configure.ac
3 @@ -16,7 +16,7 @@ echo "Configuring Dante ${version}${pren
4
5 AM_INIT_AUTOMAKE(dante, ${version}${prename})
6 AC_CONFIG_SRCDIR(include/common.h)
7 -AM_CONFIG_HEADER(include/autoconf.h)
8 +AM_CONFIG_HEADER(autoconfig-is-soo-stupid.h include/autoconf.h)
9
10 AC_DEFINE(BAREFOOTD, 0, [we are Dante])
11
12 @@ -38,17 +38,6 @@ AC_PROG_CPP
13
14 AM_CONDITIONAL(PRERELEASE, test x$prerelease != x)
15
16 -#known keywords for --enable/disable-foo(=yes/no)?
17 -LTINTERNAL="dlopen|dlopen_self|dlopen_self_static|fast_install|libtool_lock|win32_dll|shared_with_static_runtimes|shared_with_static_runtimes_CXX|shared_with_static_runtimes_F77"
18 -KNOWN_KEYWORDS="$LTINTERNAL|shared|static|debug|warnings|diagnostic|profiling|linting|libwrap|preload|serverdl|clientdl|internal|pidfile|drt_fallback"
19 -for keyword in `set | egrep '^enable_' | sed -e 's/^enable_\(.*\)=.*/\1/'`; do
20 - echo $keyword | egrep "^(${KNOWN_KEYWORDS})$" > /dev/null
21 - if test $? -ne 0; then
22 - AC_MSG_WARN([unknown option '$keyword', ignoring ...])
23 - sleep 10;
24 - fi
25 -done
26 -
27 case $host in
28 *-*-osf*)
29 AC_MSG_WARN([OSF support might be removed in the near future.])
30 @@ -175,31 +164,6 @@ case $host in
31 #XXX make sure compiling with compiler options works
32 esac
33
34 -AC_MSG_CHECKING([for support for -pipe compiler flag])
35 -oCFLAGS=$CFLAGS
36 -CFLAGS="$CFLAGS -pipe"
37 -AC_TRY_RUN([
38 -int main()
39 -{
40 - return 0;
41 -}], [AC_MSG_RESULT([yes])
42 - comp_flags="${comp_flags} -pipe"],
43 - AC_MSG_RESULT([no]))
44 -CFLAGS="$oCFLAGS"
45 -
46 -AC_MSG_CHECKING([for support for -Wbounded compiler flag])
47 -oCFLAGS=$CFLAGS
48 -CFLAGS="$CFLAGS -Wbounded"
49 -AC_TRY_RUN([
50 -int main()
51 -{
52 - return 0;
53 -}], [AC_MSG_RESULT([yes])
54 - comp_flags="${comp_flags} -Wbounded"],
55 - [AC_MSG_RESULT([no])
56 - AC_DEFINE(__bounded__(a,b,c), , [empty __bounded__ macro])])
57 -CFLAGS="$oCFLAGS"
58 -
59 AC_MSG_CHECKING([for compilation with debugging])
60 AC_ARG_ENABLE(debug,
61 [ --enable-debug compile with debugging support],
62 @@ -608,43 +572,6 @@ else
63 fi], [AC_MSG_RESULT(no)
64 AC_MSG_WARN([performance in the server might be degraded without support for the SO_SNDLOWAT socket option])])
65
66 -AC_MSG_CHECKING([whether realloc with a NULL pointer calls malloc])
67 -AC_TRY_RUN([
68 -#include <stdlib.h>
69 -#ifndef NULL
70 -#define NULL (char *)0
71 -#endif
72 -
73 -int main()
74 -{
75 - /* will assume this test doesn\'t fail because of lack of memory */
76 - if (realloc(NULL, 1) == NULL)
77 - return 1;
78 - else
79 - return 0;
80 -}], [AC_MSG_RESULT(yes)],
81 - [AC_DEFINE(HAVE_NOMALLOC_REALLOC, 1, [realloc never calls malloc])
82 - AC_MSG_RESULT(no)])
83 -
84 -AC_MSG_CHECKING([whether free can be called with NULL])
85 -AC_TRY_RUN([
86 -#include <stdlib.h>
87 -#ifndef NULL
88 -#define NULL (char *)0
89 -#endif
90 -
91 -int main()
92 -{
93 - /* will assume core dump/seg fault if it doesn\'t work */
94 - free(NULL);
95 - return 0;
96 -}], [AC_MSG_RESULT(yes)],
97 - [AC_DEFINE(HAVE_NONULL_FREE, 1, [free does not accept NULL parameter])
98 - AC_MSG_RESULT(no)])
99 -
100 -#A good time to save the cache (preload code might fail)
101 -AC_CACHE_SAVE
102 -
103 m4_include(preload.m4)
104
105 #construct SUBDIRS variable
106 @@ -722,31 +649,8 @@ case $host in
107 ;;
108 esac
109
110 -AC_MSG_CHECKING([for CMSG_SPACE in sys/socket.h])
111 -AC_TRY_RUN([
112 -#include <sys/types.h>
113 -#include <sys/socket.h>
114 -int main()
115 -{
116 - int d = CMSG_SPACE(4);
117 - return 0;
118 -}
119 -], [AC_MSG_RESULT(yes)
120 - AC_DEFINE(HAVE_CMSG_SPACE, 1, CMSG_SPACE exists)],
121 - [AC_MSG_RESULT(no)])
122 -
123 -AC_MSG_CHECKING([for CMSG_LEN in sys/socket.h])
124 -AC_TRY_RUN([
125 -#include <sys/types.h>
126 -#include <sys/socket.h>
127 -
128 -int main()
129 -{
130 - int d = CMSG_LEN(4);
131 - return 0;
132 -}], [AC_MSG_RESULT(yes)
133 - AC_DEFINE(HAVE_CMSG_LEN, 1, [CMSG_LEN exists])],
134 - [AC_MSG_RESULT(no)])
135 +AC_DEFINE(HAVE_CMSG_SPACE, 1, [CMSG_SPACE exists])
136 +AC_DEFINE(HAVE_CMSG_LEN, 1, [CMSG_LEN exists])
137
138 AC_MSG_CHECKING([for sa_len in sockaddr])
139 AC_TRY_COMPILE([
140 @@ -913,10 +817,6 @@ else
141 AC_MSG_RESULT([yes])
142 fi
143
144 -dnl determine GSSAPI support
145 -no_gssapi=t
146 -m4_include(gssapi.m4)
147 -
148 dnl compatibility library tests
149 m4_include(libscompat.m4)
150
151 @@ -978,15 +878,6 @@ global:
152 fi
153 AC_SUBST(MAPOPT)
154
155 -#expected select behaviour?
156 -unset nb_select_err
157 -L_UNCON_SELECT([],
158 - [nb_select_err=t])
159 -
160 -if test x"${nb_select_err}" = xt; then
161 - AC_MSG_WARN([operations on nonblocking sockets might fail on this platform])
162 -fi
163 -
164 AC_MSG_CHECKING([direct route fallback in client enabled])
165 with_drtfallback=t
166 AC_ARG_ENABLE(drt-fallback,
167 --- a/acinclude.m4
168 +++ b/acinclude.m4
169 @@ -180,63 +180,7 @@ selectcheck(s)
170 [AC_MSG_RESULT(no)
171 [$2]])])
172
173 -#can it really be this simple?
174 -#nope, doesn't handle coff files which also have no underscore
175 -AC_DEFUN([L_SYMBOL_UNDERSCORE],
176 -[AC_MSG_CHECKING(for object file type)
177 -AH_TEMPLATE([HAVE_NO_SYMBOL_UNDERSCORE], [platform symbol type])
178 -AC_TRY_RUN([
179 -/* look for ELF identification header at the start of argv[0] */
180 -
181 -#include <stdio.h>
182 -#include <fcntl.h>
183 -#include <string.h>
184 -
185 -/*
186 - * ELF header, from ELF standard (Portable Formats Specification,
187 - * Version 1.1).
188 - */
189 -char elfheader[] = { 0x7f, 'E', 'L', 'F' };
190 -
191 -int
192 -main (argc, argv)
193 - int argc;
194 - char *argv[];
195 -{
196 - int fd;
197 - int len = sizeof(elfheader);
198 - char header[len];
199 -
200 - if ((fd = open(argv[0], O_RDONLY, 0)) == -1) {
201 - perror("open");
202 - exit(1);
203 - }
204 - if (read(fd, header, len) != len) {
205 - perror("read");
206 - exit(1);
207 - }
208 - if (memcmp(header, elfheader, len) == 0)
209 - exit(0); /* pointy ears */
210 - else
211 - exit(1);
212 -}
213 -], [AC_MSG_RESULT(elf)
214 - AC_DEFINE(HAVE_NO_SYMBOL_UNDERSCORE)],
215 - [
216 - #XXX exceptions for coff platforms, should be detected automatically
217 - case $host in
218 - alpha*-dec-osf*)
219 - AC_DEFINE(HAVE_NO_SYMBOL_UNDERSCORE)
220 - AC_MSG_RESULT(coff)
221 - ;;
222 - *-*-hpux*) #XXX apparently does not use underscore
223 - AC_DEFINE(HAVE_NO_SYMBOL_UNDERSCORE)
224 - AC_MSG_RESULT(a.out?)
225 - ;;
226 - *)
227 - AC_MSG_RESULT(a.out)
228 - ;;
229 - esac])])
230 +AC_DEFUN([L_SYMBOL_UNDERSCORE], [AC_DEFINE(HAVE_NO_SYMBOL_UNDERSCORE, [1], [Automake sucks])])
231
232
233 dnl addproto - generate AC_DEFINE statements
234 --- a/preload.m4
235 +++ b/preload.m4
236 @@ -517,91 +517,6 @@ AC_DEFINE_UNQUOTED(LIBRARY_LIBC, "${LIBC
237
238 L_SYMBOL_UNDERSCORE()
239
240 -AC_MSG_CHECKING([for working dlsym])
241 -AC_TRY_RUN([
242 -#include <dlfcn.h>
243 -#include <stdio.h>
244 -
245 -#include "include/symbols.h"
246 -
247 -int main()
248 -{
249 - void *lib;
250 - void *sym;
251 -
252 - if ((lib = dlopen(LIBRARY_CONNECT, DL_LAZY)) == NULL) {
253 - fprintf(stderr, "dlopen: %s", dlerror());
254 - return 1;
255 - }
256 - (void)dlerror();
257 - if ((sym = dlsym(lib, SYMBOL_CONNECT)) == NULL) {
258 - fprintf(stderr, "dlsym: %s", dlerror());
259 - return 1;
260 - }
261 - return 0;
262 -}], [AC_MSG_RESULT(yes)],
263 - [AC_MSG_RESULT(no)
264 - no_preload_client=t
265 - no_preload_server=t
266 - no_preload=t])
267 -
268 -AC_MSG_CHECKING([for working RTLD_NEXT])
269 -AC_TRY_RUN([
270 -#define _GNU_SOURCE
271 -#include <dlfcn.h>
272 -#include <stdio.h>
273 -
274 -#include "include/symbols.h"
275 -
276 -int main()
277 -{
278 - void *sym;
279 -
280 - if ((sym = dlsym(RTLD_NEXT, SYMBOL_READ)) == NULL) {
281 - fprintf(stderr, "dlsym: %s", dlerror());
282 - return 1;
283 - }
284 - return 0;
285 -}], [AC_MSG_RESULT(yes)
286 - AC_DEFINE(HAVE_RTLD_NEXT, 1, [have working dlsym RTLD_NEXT])],
287 - [AC_MSG_RESULT(no)
288 - AC_DEFINE(HAVE_RTLD_NEXT, 0, [no working dlsym RTLD_NEXT])])
289 -
290 -#solaris might block preloading
291 -AC_MSG_CHECKING([libc preload blocking])
292 -AC_TRY_RUN([
293 -#include <stdlib.h>
294 -#include <string.h>
295 -#include <unistd.h>
296 -int
297 -main(int argc, char *argv[])
298 -{
299 - char buf[1024];
300 -
301 - strcpy(buf, "lari -V ");
302 - strcat(buf, argv[0]);
303 - strcat(buf, " | grep read | grep protected > /dev/null");
304 -
305 - /*
306 - * return error if 'protected'
307 - * (ignore errors, not indicative of blocking) */
308 - if (system(buf) == 0)
309 - return 1;
310 - else
311 - return 0;
312 -}
313 -
314 -ssize_t
315 -read(d, buf, nbytes)
316 - int d;
317 - void *buf;
318 - size_t nbytes;
319 -{
320 - return 0;
321 -}
322 -], [AC_MSG_RESULT(no)],
323 - [AC_MSG_RESULT(yes)
324 - AC_MSG_WARN([this platform blocks preloading of libraries])
325 - blocked_preload=t])
326 +AC_DEFINE(HAVE_RTLD_NEXT, 1, [have working dlsym RTLD_NEXT])
327
328 AC_CONFIG_FILES(bin/socksify)
329 --- a/libscompat.m4
330 +++ b/libscompat.m4
331 @@ -1,70 +1,6 @@
332 dnl libscompat.m4 - tests related to replacement code in libscompat directory
333
334 -AC_MSG_CHECKING([for __attribute__ support])
335 -AC_TRY_RUN([
336 -#include <stdlib.h>
337 -
338 -void errfunc(void) __attribute((noreturn));
339 -
340 -void errfunc(void)
341 -{
342 - exit(0);
343 -}
344 -
345 -int main()
346 -{
347 - errfunc();
348 -}], [AC_MSG_RESULT([yes])],
349 - [AC_MSG_RESULT([no])
350 - AC_DEFINE(__attribute__(a), , [empty __attribute__ macro])])
351 -
352 -AC_MSG_CHECKING([for __printf__ attribute support])
353 -if test x"$have_suncc" = xt; then
354 - AC_MSG_RESULT([disabled for sun cc])
355 - AC_DEFINE(format(a,b,c), , [empty format attribute macro])
356 -else
357 - AC_TRY_RUN([
358 -#include <stdlib.h>
359 -
360 -void func(const char *fmt, ...)
361 - __attribute__((format(__printf__, 1, 2)));
362 -
363 -void func(const char *fmt, ...) {
364 - (void)fmt;
365 - return;
366 -}
367 -
368 -int main()
369 -{
370 - func("foo");
371 - return 0;
372 -}], [AC_MSG_RESULT([yes])],
373 - [AC_MSG_RESULT([no])
374 - AC_DEFINE(format(a,b,c), , [empty format attribute macro])])
375 -fi
376 -
377 -AC_MSG_CHECKING([for timer macros])
378 -AC_TRY_RUN([
379 -#include <sys/time.h>
380 -
381 -int main()
382 -{
383 - struct timeval tv, tv2, tv3;
384 -
385 - tv.tv_sec = 0;
386 - tv.tv_usec = 0;
387 - tv2.tv_sec = 0;
388 - tv2.tv_usec = 0;
389 - tv3.tv_sec = 0;
390 - tv3.tv_usec = 0;
391 -
392 - timeradd(&tv, &tv2, &tv3);
393 - timersub(&tv3, &tv2, &tv);
394 -
395 - return 0; }],
396 -[AC_MSG_RESULT(yes)
397 - AC_DEFINE(HAVE_TIMER_MACROS, 1, [timeradd(), timersub etc. exist in sys/time.h])],
398 -[AC_MSG_RESULT(no)])
399 +AC_DEFINE(HAVE_TIMER_MACROS, 1, [timeradd(), timersub etc. exist in sys/time.h])
400
401 AC_CHECK_FUNCS(daemon difftime getifaddrs freeifaddrs hstrerror inet_aton)
402 AC_CHECK_FUNCS(inet_pton issetugid memmove seteuid setegid)
403 @@ -72,53 +8,7 @@ AC_CHECK_FUNCS(setproctitle sockatmark s
404 AC_CHECK_FUNCS(bzero)
405 #inet_ntoa - only checked for incorrect behavior
406
407 -#try to detect gcc bug (irix 64 problem, affects among others inet_ntoa)
408 -AC_MSG_CHECKING([for incorrect inet_ntoa behaviour])
409 -AC_TRY_RUN([
410 -#include <sys/types.h>
411 -#include <netinet/in.h>
412 -#include <arpa/inet.h>
413 -#include <sys/socket.h>
414 -int main(void)
415 -{
416 - struct sockaddr_in addr;
417 - char *a, *b = "195.195.195.195";
418 - addr.sin_addr.s_addr = inet_addr(b);
419 - a = inet_ntoa(addr.sin_addr);
420 - if (strcmp(a, b) == 0)
421 - return 1;
422 - else
423 - return 0;
424 -}
425 -], [AC_DEFINE(HAVE_BROKEN_INET_NTOA, 1, [platform bug])
426 - AC_MSG_RESULT(yes)
427 - ac_cv_func_inet_ntoa=no],
428 - AC_MSG_RESULT(no))
429 -
430 -if test x${ac_cv_func_sockatmark} = xyes; then
431 - AC_MSG_CHECKING([for working sockatmark])
432 - AC_TRY_RUN([
433 -#include <sys/types.h>
434 -#include <sys/socket.h>
435 -
436 -int
437 -main()
438 -{
439 - int s;
440 - int r;
441 -
442 - if ((s = socket(PF_UNIX, SOCK_STREAM, 0)) == -1)
443 - return 1;
444 - if ((r = sockatmark(s)) == -1)
445 - return 1;
446 - if (r == 0)
447 - return 0;
448 - else
449 - return 1; /* would likely indicate an error */
450 -}], [AC_MSG_RESULT(yes)],
451 - [AC_MSG_RESULT(no)
452 - ac_cv_func_sockatmark=no])
453 -fi
454 +ac_cv_func_sockatmark=no
455
456 #only compile files that are needed
457 unset LIBSCSRC
458 @@ -139,24 +29,3 @@ AC_SUBST([LIBSCSRC])
459 if test x${ac_cv_func_bzero} = xno; then
460 AC_DEFINE(bzero(b, len), memset((b), 0, (len)), [bzero replacement])
461 fi
462 -
463 -#causes problems with packaging, allow test to be turned off
464 -AC_ARG_WITH(glibc-secure,
465 -[ --without-glibc-secure disable libc_enable_secure check @<:@default=detect@:>@],
466 -[GLIBCSEC=$withval])
467 -
468 -if test "${GLIBCSEC}" != no; then
469 - AC_MSG_CHECKING([for __libc_enable_secure])
470 - AC_TRY_RUN([
471 -extern int __libc_enable_secure;
472 -
473 -int main()
474 -{
475 - if (__libc_enable_secure == 0)
476 - return 0;
477 -
478 - return 1;
479 -}],[AC_MSG_RESULT([yes])
480 - AC_DEFINE(HAVE_LIBC_ENABLE_SECURE, 1, [linux version of issetugid()])],
481 - AC_MSG_RESULT([no]))
482 -fi