3 @@ -16,7 +16,7 @@ echo "Configuring Dante ${version}${pren
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)
10 AC_DEFINE(BAREFOOTD, 0, [we are Dante])
12 @@ -38,17 +38,6 @@ AC_PROG_CPP
14 AM_CONDITIONAL(PRERELEASE, test x$prerelease != x)
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 ...])
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
34 -AC_MSG_CHECKING([for support for -pipe compiler flag])
36 -CFLAGS="$CFLAGS -pipe"
41 -}], [AC_MSG_RESULT([yes])
42 - comp_flags="${comp_flags} -pipe"],
43 - AC_MSG_RESULT([no]))
46 -AC_MSG_CHECKING([for support for -Wbounded compiler flag])
48 -CFLAGS="$CFLAGS -Wbounded"
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])])
59 AC_MSG_CHECKING([for compilation with debugging])
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])])
66 -AC_MSG_CHECKING([whether realloc with a NULL pointer calls malloc])
70 -#define NULL (char *)0
75 - /* will assume this test doesn\'t fail because of lack of memory */
76 - if (realloc(NULL, 1) == NULL)
80 -}], [AC_MSG_RESULT(yes)],
81 - [AC_DEFINE(HAVE_NOMALLOC_REALLOC, 1, [realloc never calls malloc])
84 -AC_MSG_CHECKING([whether free can be called with NULL])
88 -#define NULL (char *)0
93 - /* will assume core dump/seg fault if it doesn\'t work */
96 -}], [AC_MSG_RESULT(yes)],
97 - [AC_DEFINE(HAVE_NONULL_FREE, 1, [free does not accept NULL parameter])
100 -#A good time to save the cache (preload code might fail)
103 m4_include(preload.m4)
105 #construct SUBDIRS variable
106 @@ -722,31 +649,8 @@ case $host in
110 -AC_MSG_CHECKING([for CMSG_SPACE in sys/socket.h])
112 -#include <sys/types.h>
113 -#include <sys/socket.h>
116 - int d = CMSG_SPACE(4);
119 -], [AC_MSG_RESULT(yes)
120 - AC_DEFINE(HAVE_CMSG_SPACE, 1, CMSG_SPACE exists)],
121 - [AC_MSG_RESULT(no)])
123 -AC_MSG_CHECKING([for CMSG_LEN in sys/socket.h])
125 -#include <sys/types.h>
126 -#include <sys/socket.h>
130 - int d = CMSG_LEN(4);
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])
138 AC_MSG_CHECKING([for sa_len in sockaddr])
140 @@ -913,10 +817,6 @@ else
144 -dnl determine GSSAPI support
146 -m4_include(gssapi.m4)
148 dnl compatibility library tests
149 m4_include(libscompat.m4)
151 @@ -978,15 +878,6 @@ global:
155 -#expected select behaviour?
160 -if test x"${nb_select_err}" = xt; then
161 - AC_MSG_WARN([operations on nonblocking sockets might fail on this platform])
164 AC_MSG_CHECKING([direct route fallback in client enabled])
166 AC_ARG_ENABLE(drt-fallback,
169 @@ -180,63 +180,7 @@ selectcheck(s)
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])
179 -/* look for ELF identification header at the start of argv[0] */
186 - * ELF header, from ELF standard (Portable Formats Specification,
189 -char elfheader[] = { 0x7f, 'E', 'L', 'F' };
197 - int len = sizeof(elfheader);
200 - if ((fd = open(argv[0], O_RDONLY, 0)) == -1) {
204 - if (read(fd, header, len) != len) {
208 - if (memcmp(header, elfheader, len) == 0)
209 - exit(0); /* pointy ears */
213 -], [AC_MSG_RESULT(elf)
214 - AC_DEFINE(HAVE_NO_SYMBOL_UNDERSCORE)],
216 - #XXX exceptions for coff platforms, should be detected automatically
219 - AC_DEFINE(HAVE_NO_SYMBOL_UNDERSCORE)
220 - AC_MSG_RESULT(coff)
222 - *-*-hpux*) #XXX apparently does not use underscore
223 - AC_DEFINE(HAVE_NO_SYMBOL_UNDERSCORE)
224 - AC_MSG_RESULT(a.out?)
227 - AC_MSG_RESULT(a.out)
230 +AC_DEFUN([L_SYMBOL_UNDERSCORE], [AC_DEFINE(HAVE_NO_SYMBOL_UNDERSCORE, [1], [Automake sucks])])
233 dnl addproto - generate AC_DEFINE statements
236 @@ -517,91 +517,6 @@ AC_DEFINE_UNQUOTED(LIBRARY_LIBC, "${LIBC
238 L_SYMBOL_UNDERSCORE()
240 -AC_MSG_CHECKING([for working dlsym])
245 -#include "include/symbols.h"
252 - if ((lib = dlopen(LIBRARY_CONNECT, DL_LAZY)) == NULL) {
253 - fprintf(stderr, "dlopen: %s", dlerror());
257 - if ((sym = dlsym(lib, SYMBOL_CONNECT)) == NULL) {
258 - fprintf(stderr, "dlsym: %s", dlerror());
262 -}], [AC_MSG_RESULT(yes)],
264 - no_preload_client=t
265 - no_preload_server=t
268 -AC_MSG_CHECKING([for working RTLD_NEXT])
274 -#include "include/symbols.h"
280 - if ((sym = dlsym(RTLD_NEXT, SYMBOL_READ)) == NULL) {
281 - fprintf(stderr, "dlsym: %s", dlerror());
285 -}], [AC_MSG_RESULT(yes)
286 - AC_DEFINE(HAVE_RTLD_NEXT, 1, [have working dlsym RTLD_NEXT])],
288 - AC_DEFINE(HAVE_RTLD_NEXT, 0, [no working dlsym RTLD_NEXT])])
290 -#solaris might block preloading
291 -AC_MSG_CHECKING([libc preload blocking])
297 -main(int argc, char *argv[])
301 - strcpy(buf, "lari -V ");
302 - strcat(buf, argv[0]);
303 - strcat(buf, " | grep read | grep protected > /dev/null");
306 - * return error if 'protected'
307 - * (ignore errors, not indicative of blocking) */
308 - if (system(buf) == 0)
315 -read(d, buf, nbytes)
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])
328 AC_CONFIG_FILES(bin/socksify)
332 dnl libscompat.m4 - tests related to replacement code in libscompat directory
334 -AC_MSG_CHECKING([for __attribute__ support])
338 -void errfunc(void) __attribute((noreturn));
348 -}], [AC_MSG_RESULT([yes])],
349 - [AC_MSG_RESULT([no])
350 - AC_DEFINE(__attribute__(a), , [empty __attribute__ macro])])
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])
360 -void func(const char *fmt, ...)
361 - __attribute__((format(__printf__, 1, 2)));
363 -void func(const char *fmt, ...) {
372 -}], [AC_MSG_RESULT([yes])],
373 - [AC_MSG_RESULT([no])
374 - AC_DEFINE(format(a,b,c), , [empty format attribute macro])])
377 -AC_MSG_CHECKING([for timer macros])
379 -#include <sys/time.h>
383 - struct timeval tv, tv2, tv3;
392 - timeradd(&tv, &tv2, &tv3);
393 - timersub(&tv3, &tv2, &tv);
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])
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
407 -#try to detect gcc bug (irix 64 problem, affects among others inet_ntoa)
408 -AC_MSG_CHECKING([for incorrect inet_ntoa behaviour])
410 -#include <sys/types.h>
411 -#include <netinet/in.h>
412 -#include <arpa/inet.h>
413 -#include <sys/socket.h>
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)
425 -], [AC_DEFINE(HAVE_BROKEN_INET_NTOA, 1, [platform bug])
427 - ac_cv_func_inet_ntoa=no],
430 -if test x${ac_cv_func_sockatmark} = xyes; then
431 - AC_MSG_CHECKING([for working sockatmark])
433 -#include <sys/types.h>
434 -#include <sys/socket.h>
442 - if ((s = socket(PF_UNIX, SOCK_STREAM, 0)) == -1)
444 - if ((r = sockatmark(s)) == -1)
449 - return 1; /* would likely indicate an error */
450 -}], [AC_MSG_RESULT(yes)],
452 - ac_cv_func_sockatmark=no])
454 +ac_cv_func_sockatmark=no
456 #only compile files that are needed
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])
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])
468 -if test "${GLIBCSEC}" != no; then
469 - AC_MSG_CHECKING([for __libc_enable_secure])
471 -extern int __libc_enable_secure;
475 - if (__libc_enable_secure == 0)
479 -}],[AC_MSG_RESULT([yes])
480 - AC_DEFINE(HAVE_LIBC_ENABLE_SECURE, 1, [linux version of issetugid()])],
481 - AC_MSG_RESULT([no]))