001-automake-compat.patch 12 KB

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