aboutsummaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4')
-rw-r--r--m4/check-libc.m46
-rw-r--r--m4/check-os-options.m46
2 files changed, 11 insertions, 1 deletions
diff --git a/m4/check-libc.m4 b/m4/check-libc.m4
index f1ba611..c189ac9 100644
--- a/m4/check-libc.m4
+++ b/m4/check-libc.m4
@@ -1,11 +1,15 @@
1AC_DEFUN([CHECK_LIBC_COMPAT], [ 1AC_DEFUN([CHECK_LIBC_COMPAT], [
2# Check for libc headers
3AC_CHECK_HEADERS([err.h readpassphrase.h])
2# Check for general libc functions 4# Check for general libc functions
3AC_CHECK_FUNCS([asprintf inet_pton memmem poll reallocarray]) 5AC_CHECK_FUNCS([accept4 asprintf inet_pton memmem poll readpassphrase reallocarray])
4AC_CHECK_FUNCS([strlcat strlcpy strndup strnlen strsep strtonum]) 6AC_CHECK_FUNCS([strlcat strlcpy strndup strnlen strsep strtonum])
7AM_CONDITIONAL([HAVE_ACCEPT4], [test "x$ac_cv_func_accept4" = xyes])
5AM_CONDITIONAL([HAVE_ASPRINTF], [test "x$ac_cv_func_asprintf" = xyes]) 8AM_CONDITIONAL([HAVE_ASPRINTF], [test "x$ac_cv_func_asprintf" = xyes])
6AM_CONDITIONAL([HAVE_INET_PTON], [test "x$ac_cv_func_inet_pton" = xyes]) 9AM_CONDITIONAL([HAVE_INET_PTON], [test "x$ac_cv_func_inet_pton" = xyes])
7AM_CONDITIONAL([HAVE_MEMMEM], [test "x$ac_cv_func_memmem" = xyes]) 10AM_CONDITIONAL([HAVE_MEMMEM], [test "x$ac_cv_func_memmem" = xyes])
8AM_CONDITIONAL([HAVE_POLL], [test "x$ac_cv_func_poll" = xyes]) 11AM_CONDITIONAL([HAVE_POLL], [test "x$ac_cv_func_poll" = xyes])
12AM_CONDITIONAL([HAVE_READPASSPHRASE], [test "x$ac_cv_func_readpassphrase" = xyes])
9AM_CONDITIONAL([HAVE_REALLOCARRAY], [test "x$ac_cv_func_reallocarray" = xyes]) 13AM_CONDITIONAL([HAVE_REALLOCARRAY], [test "x$ac_cv_func_reallocarray" = xyes])
10AM_CONDITIONAL([HAVE_STRLCAT], [test "x$ac_cv_func_strlcat" = xyes]) 14AM_CONDITIONAL([HAVE_STRLCAT], [test "x$ac_cv_func_strlcat" = xyes])
11AM_CONDITIONAL([HAVE_STRLCPY], [test "x$ac_cv_func_strlcpy" = xyes]) 15AM_CONDITIONAL([HAVE_STRLCPY], [test "x$ac_cv_func_strlcpy" = xyes])
diff --git a/m4/check-os-options.m4 b/m4/check-os-options.m4
index 895d22b..9835cd8 100644
--- a/m4/check-os-options.m4
+++ b/m4/check-os-options.m4
@@ -15,8 +15,10 @@ case $host_os in
15 HOST_OS=cygwin 15 HOST_OS=cygwin
16 ;; 16 ;;
17 *darwin*) 17 *darwin*)
18 BUILD_NC=yes
18 HOST_OS=darwin 19 HOST_OS=darwin
19 HOST_ABI=macosx 20 HOST_ABI=macosx
21 AC_SUBST([PROG_LDADD], ['-lresolv'])
20 ;; 22 ;;
21 *freebsd*) 23 *freebsd*)
22 HOST_OS=freebsd 24 HOST_OS=freebsd
@@ -34,15 +36,18 @@ case $host_os in
34 AC_SUBST([PLATFORM_LDADD], ['-lpthread']) 36 AC_SUBST([PLATFORM_LDADD], ['-lpthread'])
35 ;; 37 ;;
36 *linux*) 38 *linux*)
39 BUILD_NC=yes
37 HOST_OS=linux 40 HOST_OS=linux
38 HOST_ABI=elf 41 HOST_ABI=elf
39 CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE -D_GNU_SOURCE" 42 CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE -D_GNU_SOURCE"
43 AC_SUBST([PROG_LDADD], ['-lresolv'])
40 ;; 44 ;;
41 *netbsd*) 45 *netbsd*)
42 HOST_OS=netbsd 46 HOST_OS=netbsd
43 CPPFLAGS="$CPPFLAGS -D_OPENBSD_SOURCE" 47 CPPFLAGS="$CPPFLAGS -D_OPENBSD_SOURCE"
44 ;; 48 ;;
45 *openbsd* | *bitrig*) 49 *openbsd* | *bitrig*)
50 BUILD_NC=yes
46 HOST_OS=openbsd 51 HOST_OS=openbsd
47 HOST_ABI=elf 52 HOST_ABI=elf
48 AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD gcc has bounded]) 53 AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD gcc has bounded])
@@ -66,6 +71,7 @@ case $host_os in
66 *) ;; 71 *) ;;
67esac 72esac
68 73
74AM_CONDITIONAL([BUILD_NC], [test x$BUILD_NC = xyes])
69AM_CONDITIONAL([HOST_AIX], [test x$HOST_OS = xaix]) 75AM_CONDITIONAL([HOST_AIX], [test x$HOST_OS = xaix])
70AM_CONDITIONAL([HOST_CYGWIN], [test x$HOST_OS = xcygwin]) 76AM_CONDITIONAL([HOST_CYGWIN], [test x$HOST_OS = xcygwin])
71AM_CONDITIONAL([HOST_DARWIN], [test x$HOST_OS = xdarwin]) 77AM_CONDITIONAL([HOST_DARWIN], [test x$HOST_OS = xdarwin])