]> granicus.if.org Git - sudo/commitdiff
Add workaround for an error in sys/types.h on HP-UX 11.23 when
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 20 Nov 2010 21:26:53 +0000 (16:26 -0500)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 20 Nov 2010 21:26:53 +0000 (16:26 -0500)
large file support is enabled.  Defining _XOPEN_SOURCE_EXTENDED
avoids the broken bits of the header file.

configure
configure.in

index 7d7abcfc036861e3c2b4d8d948d791a5fd85f479..ec5166f6cba676021313fa3e55a8dd3f565a8cc4 100755 (executable)
--- a/configure
+++ b/configure
@@ -14219,6 +14219,63 @@ rm -rf conftest*
   fi
 fi
 
+case "$host" 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; }
+if test "${sudo_cv_xopen_source_extended+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+       #include <sys/socket.h>
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  sudo_cv_xopen_source_extended=no
+else
+
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#define _XOPEN_SOURCE_EXTENDED
+           $ac_includes_default
+           #include <sys/socket.h>
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  sudo_cv_xopen_source_extended=yes
+else
+  sudo_cv_xopen_source_extended=error
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sudo_cv_xopen_source_extended" >&5
+$as_echo "$sudo_cv_xopen_source_extended" >&6; }
+       if test "$sudo_cv_xopen_source_extended" = "yes"; then
+           OSDEFS="${OSDEFS} -D_XOPEN_SOURCE_EXTENDED"
+           cat >>confdefs.h <<\EOF
+#define _XOPEN_SOURCE_EXTENDED 1
+EOF
+
+       fi
+       ;;
+esac
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking POSIX termios" >&5
 $as_echo_n "checking POSIX termios... " >&6; }
 if test "${ac_cv_sys_posix_termios+set}" = set; then :
@@ -14260,11 +14317,10 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $ac_includes_default
 #include <paths.h>
-int main() {char *p = _PATH_MAILDIR;}
 int
 main ()
 {
-
+char *p = _PATH_MAILDIR;
   ;
   return 0;
 }
index 4a1b52766b5ce8f108af41d9ba066692fbe6db74..82db26ea5eea012f1c5d3335ea226edfd8e4b6b1 100644 (file)
@@ -1876,7 +1876,27 @@ AC_HEADER_STDC
 AC_HEADER_DIRENT
 AC_HEADER_TIME
 AC_CHECK_HEADERS(malloc.h paths.h utime.h netgroup.h sys/sockio.h sys/bsdtypes.h sys/select.h sys/stropts.h)
+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
 AC_SYS_LARGEFILE
+case "$host" in
+    *-*-hpux11.*)
+       AC_CACHE_CHECK([whether sys/types.h needs _XOPEN_SOURCE_EXTENDED], [sudo_cv_xopen_source_extended],
+       [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
+       #include <sys/socket.h>], [])], [sudo_cv_xopen_source_extended=no], [
+           AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#define _XOPEN_SOURCE_EXTENDED
+           AC_INCLUDES_DEFAULT
+           #include <sys/socket.h>], [])], [sudo_cv_xopen_source_extended=yes],
+           [sudo_cv_xopen_source_extended=error])
+       ])])
+       if test "$sudo_cv_xopen_source_extended" = "yes"; then
+           OSDEFS="${OSDEFS} -D_XOPEN_SOURCE_EXTENDED"
+           SUDO_DEFINE(_XOPEN_SOURCE_EXTENDED)
+       fi
+       ;;
+esac
 AC_SYS_POSIX_TERMIOS
 if test "$ac_cv_sys_posix_termios" != "yes"; then
     AC_MSG_ERROR([Must have POSIX termios to build sudo])