From: Todd C. Miller Date: Tue, 12 Nov 2013 22:13:54 +0000 (-0700) Subject: HP-UX may require _XOPEN_SOURCE_EXTENDED to be defined for MSG_WAITALL X-Git-Tag: SUDO_1_8_9^2~103 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=142fff6db353818dcc22bcf2766ec63ef67298d1;p=sudo HP-UX may require _XOPEN_SOURCE_EXTENDED to be defined for MSG_WAITALL to be visible. --- diff --git a/configure b/configure index f99f58f0c..ad4fa4daa 100755 --- a/configure +++ b/configure @@ -15579,6 +15579,9 @@ fi done +# +# Check for large file support. +# # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then : enableval=$enable_largefile; @@ -15777,10 +15780,16 @@ rm -rf conftest* fi fi +# +# HP-UX may need to define _XOPEN_SOURCE_EXTENDED to expose MSG_WAITALL. +# Also, HP-UX 11.23 has a broken sys/types.h when large files support +# is enabled and _XOPEN_SOURCE_EXTENDED is not also defined. +# The following test will define _XOPEN_SOURCE_EXTENDED in either case. +# case "$host_os" in - hpux11.*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/types.h needs _XOPEN_SOURCE_EXTENDED" >&5 -$as_echo_n "checking whether sys/types.h needs _XOPEN_SOURCE_EXTENDED... " >&6; } + hpux*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/socket.h needs _XOPEN_SOURCE_EXTENDED for MSG_WAITALL" >&5 +$as_echo_n "checking whether sys/socket.h needs _XOPEN_SOURCE_EXTENDED for MSG_WAITALL... " >&6; } if ${sudo_cv_xopen_source_extended+:} false; then : $as_echo_n "(cached) " >&6 else @@ -15791,7 +15800,7 @@ $ac_includes_default int main () { - +int a = MSG_WAITALL; return a; ; return 0; } @@ -15808,7 +15817,7 @@ else int main () { - +int a = MSG_WAITALL; return a; ; return 0; } diff --git a/configure.in b/configure.in index 2cc256fe4..dbce2d169 100644 --- a/configure.in +++ b/configure.in @@ -2113,19 +2113,26 @@ AC_CHECK_HEADERS([procfs.h] [sys/procfs.h], [AC_CHECK_MEMBERS(struct psinfo.pr_t #endif ])] break) -dnl -dnl Check for large file support. HP-UX 11.23 has a broken sys/type.h -dnl when large files support is enabled so work around it. -dnl +# +# Check for large file support. +# AC_SYS_LARGEFILE +# +# HP-UX may need to define _XOPEN_SOURCE_EXTENDED to expose MSG_WAITALL. +# Also, HP-UX 11.23 has a broken sys/types.h when large files support +# is enabled and _XOPEN_SOURCE_EXTENDED is not also defined. +# The following test will define _XOPEN_SOURCE_EXTENDED in either case. +# case "$host_os" in - hpux11.*) - AC_CACHE_CHECK([whether sys/types.h needs _XOPEN_SOURCE_EXTENDED], [sudo_cv_xopen_source_extended], + hpux*) + AC_CACHE_CHECK([whether sys/socket.h needs _XOPEN_SOURCE_EXTENDED for MSG_WAITALL], [sudo_cv_xopen_source_extended], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT - #include ], [])], [sudo_cv_xopen_source_extended=no], [ + #include ], [int a = MSG_WAITALL; return a;])], + [sudo_cv_xopen_source_extended=no], [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#define _XOPEN_SOURCE_EXTENDED AC_INCLUDES_DEFAULT - #include ], [])], [sudo_cv_xopen_source_extended=yes], + #include ], [int a = MSG_WAITALL; return a;])], + [sudo_cv_xopen_source_extended=yes], [sudo_cv_xopen_source_extended=error]) ])]) if test "$sudo_cv_xopen_source_extended" = "yes"; then