diff options
| author | Brent Cook <bcook@openbsd.org> | 2015-10-01 07:40:26 -0500 |
|---|---|---|
| committer | Brent Cook <bcook@openbsd.org> | 2015-10-01 07:40:26 -0500 |
| commit | a7f031ba55ac4a69263000357eb7f6d7fb88101a (patch) | |
| tree | 22683754da45f65561d4ae8465311b8eb0a43ec5 /m4 | |
| parent | 497a47c5fcf137b73816ee8e9165ddd12f90fcef (diff) | |
| download | portable-a7f031ba55ac4a69263000357eb7f6d7fb88101a.tar.gz portable-a7f031ba55ac4a69263000357eb7f6d7fb88101a.tar.bz2 portable-a7f031ba55ac4a69263000357eb7f6d7fb88101a.zip | |
add b64_ntop checking and fallback for nc(1)
Diffstat (limited to 'm4')
| -rw-r--r-- | m4/check-libc.m4 | 22 | ||||
| -rw-r--r-- | m4/check-os-options.m4 | 2 |
2 files changed, 21 insertions, 3 deletions
diff --git a/m4/check-libc.m4 b/m4/check-libc.m4 index c189ac9..63fd893 100644 --- a/m4/check-libc.m4 +++ b/m4/check-libc.m4 | |||
| @@ -2,7 +2,8 @@ AC_DEFUN([CHECK_LIBC_COMPAT], [ | |||
| 2 | # Check for libc headers | 2 | # Check for libc headers |
| 3 | AC_CHECK_HEADERS([err.h readpassphrase.h]) | 3 | AC_CHECK_HEADERS([err.h readpassphrase.h]) |
| 4 | # Check for general libc functions | 4 | # Check for general libc functions |
| 5 | AC_CHECK_FUNCS([accept4 asprintf inet_pton memmem poll readpassphrase reallocarray]) | 5 | AC_CHECK_FUNCS([accept4 asprintf inet_pton memmem poll]) |
| 6 | AC_CHECK_FUNCS([readpassphrase reallocarray]) | ||
| 6 | AC_CHECK_FUNCS([strlcat strlcpy strndup strnlen strsep strtonum]) | 7 | AC_CHECK_FUNCS([strlcat strlcpy strndup strnlen strsep strtonum]) |
| 7 | AM_CONDITIONAL([HAVE_ACCEPT4], [test "x$ac_cv_func_accept4" = xyes]) | 8 | AM_CONDITIONAL([HAVE_ACCEPT4], [test "x$ac_cv_func_accept4" = xyes]) |
| 8 | AM_CONDITIONAL([HAVE_ASPRINTF], [test "x$ac_cv_func_asprintf" = xyes]) | 9 | AM_CONDITIONAL([HAVE_ASPRINTF], [test "x$ac_cv_func_asprintf" = xyes]) |
| @@ -19,6 +20,25 @@ AM_CONDITIONAL([HAVE_STRSEP], [test "x$ac_cv_func_strsep" = xyes]) | |||
| 19 | AM_CONDITIONAL([HAVE_STRTONUM], [test "x$ac_cv_func_strtonum" = xyes]) | 20 | AM_CONDITIONAL([HAVE_STRTONUM], [test "x$ac_cv_func_strtonum" = xyes]) |
| 20 | ]) | 21 | ]) |
| 21 | 22 | ||
| 23 | AC_DEFUN([CHECK_B64_NTOP], [ | ||
| 24 | AC_SEARCH_LIBS([b64_ntop],[resolv]) | ||
| 25 | AC_SEARCH_LIBS([__b64_ntop],[resolv]) | ||
| 26 | AC_CACHE_CHECK([for b64_ntop], ac_cv_have_b64_ntop_arg, [ | ||
| 27 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | ||
| 28 | #include <sys/types.h> | ||
| 29 | #include <sys/socket.h> | ||
| 30 | #include <netinet/in.h> | ||
| 31 | #include <arpa/inet.h> | ||
| 32 | #include <resolv.h> | ||
| 33 | ]], [[ b64_ntop(NULL, 0, NULL, 0); ]])], | ||
| 34 | [ ac_cv_have_b64_ntop_arg="yes" ], | ||
| 35 | [ ac_cv_have_b64_ntop_arg="no" | ||
| 36 | ]) | ||
| 37 | ]) | ||
| 38 | AM_CONDITIONAL([HAVE_B64_NTOP], [test "x$ac_cv_func_b64_ntop" = xyes]) | ||
| 39 | ]) | ||
| 40 | |||
| 41 | |||
| 22 | AC_DEFUN([CHECK_LIBC_CRYPTO_COMPAT], [ | 42 | AC_DEFUN([CHECK_LIBC_CRYPTO_COMPAT], [ |
| 23 | # Check crypto-related libc functions | 43 | # Check crypto-related libc functions |
| 24 | AC_CHECK_FUNCS([arc4random_buf explicit_bzero getauxval getentropy]) | 44 | AC_CHECK_FUNCS([arc4random_buf explicit_bzero getauxval getentropy]) |
diff --git a/m4/check-os-options.m4 b/m4/check-os-options.m4 index a71e529..6c28ab8 100644 --- a/m4/check-os-options.m4 +++ b/m4/check-os-options.m4 | |||
| @@ -17,7 +17,6 @@ case $host_os in | |||
| 17 | BUILD_NC=yes | 17 | BUILD_NC=yes |
| 18 | HOST_OS=darwin | 18 | HOST_OS=darwin |
| 19 | HOST_ABI=macosx | 19 | HOST_ABI=macosx |
| 20 | AC_SUBST([PROG_LDADD], ['-lresolv']) | ||
| 21 | ;; | 20 | ;; |
| 22 | *freebsd*) | 21 | *freebsd*) |
| 23 | HOST_OS=freebsd | 22 | HOST_OS=freebsd |
| @@ -39,7 +38,6 @@ case $host_os in | |||
| 39 | HOST_OS=linux | 38 | HOST_OS=linux |
| 40 | HOST_ABI=elf | 39 | HOST_ABI=elf |
| 41 | CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE -D_GNU_SOURCE" | 40 | CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE -D_GNU_SOURCE" |
| 42 | AC_SUBST([PROG_LDADD], ['-lresolv']) | ||
| 43 | ;; | 41 | ;; |
| 44 | *netbsd*) | 42 | *netbsd*) |
| 45 | HOST_OS=netbsd | 43 | HOST_OS=netbsd |
