Codebase list unbound / 079de39
- Fix #157: undefined reference to `htobe64'. W.C.A. Wijngaards 4 years ago
5 changed file(s) with 132 addition(s) and 37 deletion(s). Raw diff Collapse all Expand all
6363 #ifdef HAVE_SYS_ENDIAN_H
6464 # include <sys/endian.h>
6565 #endif
66 #ifdef HAVE_LIBKERN_OSBYTEORDER_H
67 /* In practice this is specific to MacOS X. We assume it doesn't have
68 * htobe64/be64toh but has alternatives with a different name. */
69 # include <libkern/OSByteOrder.h>
70 # define htobe64(x) OSSwapHostToBigInt64(x)
71 # define be64toh(x) OSSwapBigToHostInt64(x)
72 #endif
73
74 /* Some compilers do not define __BYTE_ORDER__, like IBM XLC on AIX */
75 #ifndef be64toh
76 #if defined(__sun) || defined(_AIX)
77 # if __BIG_ENDIAN__
78 # define be64toh(n) (n)
79 # define htobe64(n) (n)
66
67 #ifndef HAVE_HTOBE64
68 # ifdef HAVE_LIBKERN_OSBYTEORDER_H
69 /* In practice this is specific to MacOS X. We assume it doesn't have
70 * htobe64/be64toh but has alternatives with a different name. */
71 # include <libkern/OSByteOrder.h>
72 # define htobe64(x) OSSwapHostToBigInt64(x)
73 # define be64toh(x) OSSwapBigToHostInt64(x)
8074 # else
81 # define be64toh(n) (((uint64_t)htonl((n) & 0xFFFFFFFF) << 32) | htonl((n) >> 32))
82 # define htobe64(n) (((uint64_t)htonl((n) & 0xFFFFFFFF) << 32) | htonl((n) >> 32))
83 # endif
84 #endif
85 #endif /* be64toh */
75 /* not OSX */
76 /* Some compilers do not define __BYTE_ORDER__, like IBM XLC on AIX */
77 # if __BIG_ENDIAN__
78 # define be64toh(n) (n)
79 # define htobe64(n) (n)
80 # else
81 # define be64toh(n) (((uint64_t)htonl((n) & 0xFFFFFFFF) << 32) | htonl((n) >> 32))
82 # define htobe64(n) (((uint64_t)htonl((n) & 0xFFFFFFFF) << 32) | htonl((n) >> 32))
83 # endif /* _ENDIAN */
84 # endif /* HAVE_LIBKERN_OSBYTEORDER_H */
85 #endif /* HAVE_BE64TOH */
8686
8787 /** the unit test testframe for cachedb, its module state contains
8888 * a cache for a couple queries (in memory). */
6262 /* Whether the C compiler accepts the "weak" attribute */
6363 #undef HAVE_ATTR_WEAK
6464
65 /* If we have be64toh */
66 #undef HAVE_BE64TOH
67
6568 /* Define to 1 if you have the <bsd/stdlib.h> header file. */
6669 #undef HAVE_BSD_STDLIB_H
6770
288291
289292 /* If you have HMAC_Update */
290293 #undef HAVE_HMAC_UPDATE
294
295 /* If we have htobe64 */
296 #undef HAVE_HTOBE64
291297
292298 /* Define to 1 if you have the `inet_aton' function. */
293299 #undef HAVE_INET_ATON
802802 docdir
803803 oldincludedir
804804 includedir
805 runstatedir
806805 localstatedir
807806 sharedstatedir
808807 sysconfdir
950949 sysconfdir='${prefix}/etc'
951950 sharedstatedir='${prefix}/com'
952951 localstatedir='${prefix}/var'
953 runstatedir='${localstatedir}/run'
954952 includedir='${prefix}/include'
955953 oldincludedir='/usr/include'
956954 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
12031201 | -silent | --silent | --silen | --sile | --sil)
12041202 silent=yes ;;
12051203
1206 -runstatedir | --runstatedir | --runstatedi | --runstated \
1207 | --runstate | --runstat | --runsta | --runst | --runs \
1208 | --run | --ru | --r)
1209 ac_prev=runstatedir ;;
1210 -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
1211 | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
1212 | --run=* | --ru=* | --r=*)
1213 runstatedir=$ac_optarg ;;
1214
12151204 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
12161205 ac_prev=sbindir ;;
12171206 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
13491338 for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
13501339 datadir sysconfdir sharedstatedir localstatedir includedir \
13511340 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1352 libdir localedir mandir runstatedir
1341 libdir localedir mandir
13531342 do
13541343 eval ac_val=\$$ac_var
13551344 # Remove trailing slashes.
15021491 --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
15031492 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
15041493 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
1505 --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
15061494 --libdir=DIR object code libraries [EPREFIX/lib]
15071495 --includedir=DIR C header files [PREFIX/include]
15081496 --oldincludedir=DIR C header files for non-gcc [/usr/include]
1565915647 We can't simply define LARGE_OFF_T to be 9223372036854775807,
1566015648 since some C++ compilers masquerading as C compilers
1566115649 incorrectly reject 9223372036854775807. */
15662 #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
15650 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
1566315651 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
1566415652 && LARGE_OFF_T % 2147483647 == 1)
1566515653 ? 1 : -1];
1570515693 We can't simply define LARGE_OFF_T to be 9223372036854775807,
1570615694 since some C++ compilers masquerading as C compilers
1570715695 incorrectly reject 9223372036854775807. */
15708 #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
15696 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
1570915697 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
1571015698 && LARGE_OFF_T % 2147483647 == 1)
1571115699 ? 1 : -1];
1572915717 We can't simply define LARGE_OFF_T to be 9223372036854775807,
1573015718 since some C++ compilers masquerading as C compilers
1573115719 incorrectly reject 9223372036854775807. */
15732 #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
15720 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
1573315721 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
1573415722 && LARGE_OFF_T % 2147483647 == 1)
1573515723 ? 1 : -1];
1577415762 We can't simply define LARGE_OFF_T to be 9223372036854775807,
1577515763 since some C++ compilers masquerading as C compilers
1577615764 incorrectly reject 9223372036854775807. */
15777 #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
15765 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
1577815766 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
1577915767 && LARGE_OFF_T % 2147483647 == 1)
1578015768 ? 1 : -1];
1579815786 We can't simply define LARGE_OFF_T to be 9223372036854775807,
1579915787 since some C++ compilers masquerading as C compilers
1580015788 incorrectly reject 9223372036854775807. */
15801 #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
15789 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
1580215790 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
1580315791 && LARGE_OFF_T % 2147483647 == 1)
1580415792 ? 1 : -1];
2003720025
2003820026
2003920027 fi
20028
20029
20030 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for htobe64" >&5
20031 $as_echo_n "checking for htobe64... " >&6; }
20032 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20033 /* end confdefs.h. */
20034
20035 #include <stdio.h>
20036 #ifdef HAVE_ENDIAN_H
20037 # include <endian.h>
20038 #endif
20039 #ifdef HAVE_SYS_ENDIAN_H
20040 # include <sys/endian.h>
20041 #endif
20042
20043 int
20044 main ()
20045 {
20046 unsigned long long x = htobe64(0); printf("%u", (unsigned)x);
20047 ;
20048 return 0;
20049 }
20050 _ACEOF
20051 if ac_fn_c_try_link "$LINENO"; then :
20052 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
20053 $as_echo "yes" >&6; }
20054
20055 $as_echo "#define HAVE_HTOBE64 1" >>confdefs.h
20056
20057 else
20058 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20059 $as_echo "no" >&6; }
20060 fi
20061 rm -f core conftest.err conftest.$ac_objext \
20062 conftest$ac_exeext conftest.$ac_ext
20063
20064 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for be64toh" >&5
20065 $as_echo_n "checking for be64toh... " >&6; }
20066 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20067 /* end confdefs.h. */
20068
20069 #include <stdio.h>
20070 #ifdef HAVE_ENDIAN_H
20071 # include <endian.h>
20072 #endif
20073 #ifdef HAVE_SYS_ENDIAN_H
20074 # include <sys/endian.h>
20075 #endif
20076
20077 int
20078 main ()
20079 {
20080 unsigned long long x = be64toh(0); printf("%u", (unsigned)x);
20081 ;
20082 return 0;
20083 }
20084 _ACEOF
20085 if ac_fn_c_try_link "$LINENO"; then :
20086 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
20087 $as_echo "yes" >&6; }
20088
20089 $as_echo "#define HAVE_BE64TOH 1" >>confdefs.h
20090
20091 else
20092 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20093 $as_echo "no" >&6; }
20094 fi
20095 rm -f core conftest.err conftest.$ac_objext \
20096 conftest$ac_exeext conftest.$ac_ext
2004020097
2004120098 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setusercontext" >&5
2004220099 $as_echo_n "checking for library containing setusercontext... " >&6; }
14891489 #include <ws2tcpip.h>
14901490 #endif
14911491 ])
1492
1493 AC_MSG_CHECKING([for htobe64])
1494 AC_LINK_IFELSE([AC_LANG_PROGRAM([
1495 #include <stdio.h>
1496 #ifdef HAVE_ENDIAN_H
1497 # include <endian.h>
1498 #endif
1499 #ifdef HAVE_SYS_ENDIAN_H
1500 # include <sys/endian.h>
1501 #endif
1502 ], [unsigned long long x = htobe64(0); printf("%u", (unsigned)x);])],
1503 AC_MSG_RESULT(yes)
1504 AC_DEFINE(HAVE_HTOBE64, 1, [If we have htobe64]),
1505 AC_MSG_RESULT(no))
1506
1507 AC_MSG_CHECKING([for be64toh])
1508 AC_LINK_IFELSE([AC_LANG_PROGRAM([
1509 #include <stdio.h>
1510 #ifdef HAVE_ENDIAN_H
1511 # include <endian.h>
1512 #endif
1513 #ifdef HAVE_SYS_ENDIAN_H
1514 # include <sys/endian.h>
1515 #endif
1516 ], [unsigned long long x = be64toh(0); printf("%u", (unsigned)x);])],
1517 AC_MSG_RESULT(yes)
1518 AC_DEFINE(HAVE_BE64TOH, 1, [If we have be64toh]),
1519 AC_MSG_RESULT(no))
1520
14921521 AC_SEARCH_LIBS([setusercontext], [util])
14931522 AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam endpwent getrlimit setrlimit setsid chroot kill chown sleep usleep random srandom recvmsg sendmsg writev socketpair glob initgroups strftime localtime_r setusercontext _beginthreadex endservent endprotoent fsync shmget accept4])
14941523 AC_CHECK_FUNCS([setresuid],,[AC_CHECK_FUNCS([setreuid])])
0 29 January 2020: Wouter
1 - Fix #157: undefined reference to `htobe64'.
2
03 28 January 2020: Ralph
14 - Merge PR#147; change rfc reference for reserved top level dns names.
25