Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tools/compat Add sys/uio.h & enum uio_seg, enum uio_rw to to...



details:   https://anonhg.NetBSD.org/src/rev/ad0948e49fa1
branches:  trunk
changeset: 452124:ad0948e49fa1
user:      kamil <kamil%NetBSD.org@localhost>
date:      Wed Jun 19 03:40:15 2019 +0000

description:
Add sys/uio.h & enum uio_seg, enum uio_rw to tools/compat

This is needed for bootstrapping the tools on Ubuntu 16.x.

diffstat:

 tools/compat/compat_defs.h      |  17 ++++++++++++-
 tools/compat/configure          |  52 +++++++++++++++++++++++++++++++++++++++-
 tools/compat/configure.ac       |  23 ++++++++++++++++-
 tools/compat/nbtool_config.h.in |  11 +++++++-
 4 files changed, 97 insertions(+), 6 deletions(-)

diffs (189 lines):

diff -r 8777c522fa2f -r ad0948e49fa1 tools/compat/compat_defs.h
--- a/tools/compat/compat_defs.h        Wed Jun 19 03:27:38 2019 +0000
+++ b/tools/compat/compat_defs.h        Wed Jun 19 03:40:15 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_defs.h,v 1.114 2018/08/30 12:05:34 christos Exp $       */
+/*     $NetBSD: compat_defs.h,v 1.115 2019/06/19 03:40:15 kamil Exp $  */
 
 #ifndef        __NETBSD_COMPAT_DEFS_H__
 #define        __NETBSD_COMPAT_DEFS_H__
@@ -52,6 +52,17 @@
 typedef int socklen_t;
 #endif
 
+#if !HAVE_ENUM_UIO_RW
+enum uio_rw { UIO_READ, UIO_WRITE };
+#endif
+
+#if !HAVE_ENUM_UIO_SEG
+enum uio_seg {
+       UIO_USERSPACE,          /* from user data space */
+       UIO_SYSSPACE            /* from system space */
+};
+#endif
+
 #if !HAVE_U_LONG
 typedef unsigned long u_long;
 #endif
@@ -113,6 +124,10 @@
 #include <rpc/types.h>
 #endif
 
+#if HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif
+
 #ifdef _NETBSD_SOURCE
 #error _NETBSD_SOURCE is *not* to be defined.
 #endif
diff -r 8777c522fa2f -r ad0948e49fa1 tools/compat/configure
--- a/tools/compat/configure    Wed Jun 19 03:27:38 2019 +0000
+++ b/tools/compat/configure    Wed Jun 19 03:40:15 2019 +0000
@@ -4098,7 +4098,8 @@
 fi
 
 for ac_header in sys/mtio.h sys/sysmacros.h sys/syslimits.h stdio_ext.h \
-       getopt.h features.h malloc.h sys/poll.h pthread.h stddef.h rpc/types.h
+       getopt.h features.h malloc.h sys/poll.h pthread.h stddef.h rpc/types.h \
+       sys/uio.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -4240,6 +4241,54 @@
 fi
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enum uio_rw" >&5
+$as_echo_n "checking for enum uio_rw... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <sys/types.h>
+#ifdef HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif
+int
+main ()
+{
+enum uio_rw rw;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+$as_echo "#define HAVE_ENUM_UIO_RW 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enum uio_seg" >&5
+$as_echo_n "checking for enum uio_seg... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <sys/types.h>
+#ifdef HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif
+int
+main ()
+{
+enum uio_seg seg;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+$as_echo "#define HAVE_ENUM_UIO_SEG 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 
 
 
@@ -7416,4 +7465,3 @@
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
-
diff -r 8777c522fa2f -r ad0948e49fa1 tools/compat/configure.ac
--- a/tools/compat/configure.ac Wed Jun 19 03:27:38 2019 +0000
+++ b/tools/compat/configure.ac Wed Jun 19 03:40:15 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: configure.ac,v 1.94 2018/08/30 12:05:34 christos Exp $
+#      $NetBSD: configure.ac,v 1.95 2019/06/19 03:40:15 kamil Exp $
 #
 # Autoconf definition file for libnbcompat.
 #
@@ -79,7 +79,8 @@
 # Find headers that may not be available.
 AC_HEADER_DIRENT
 AC_CHECK_HEADERS(sys/mtio.h sys/sysmacros.h sys/syslimits.h stdio_ext.h \
-       getopt.h features.h malloc.h sys/poll.h pthread.h stddef.h rpc/types.h)
+       getopt.h features.h malloc.h sys/poll.h pthread.h stddef.h rpc/types.h \
+       sys/uio.h)
 AC_CHECK_HEADERS(sys/bswap.h machine/bswap.h sys/cdefs.h machine/endian.h \
        sys/endian.h sys/featuretest.h err.h inttypes.h libgen.h paths.h \
        libgen.h stdint.h util.h resolv.h arpa/nameser.h,,
@@ -105,6 +106,24 @@
 #endif
 #include <sys/socket.h>])
 
+AC_MSG_CHECKING([for enum uio_rw])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/types.h>
+#ifdef HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif]],
+[[enum uio_rw rw;]])],[AC_DEFINE([HAVE_ENUM_UIO_RW], 1,
+                           [Define if you have the enum uio_rw type.])],)
+
+AC_MSG_CHECKING([for enum uio_seg])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/types.h>
+#ifdef HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif]],
+[[enum uio_seg seg;]])],[AC_DEFINE([HAVE_ENUM_UIO_SEG], 1,
+                           [Define if you have the enum uio_seg type.])],)
+
 dnl XXX - This is UGLY.  Need a better way to homogenize the bitsized types,
 dnl including use of compiler primitive types via AC_CHECK_SIZEOF.
 dnl
diff -r 8777c522fa2f -r ad0948e49fa1 tools/compat/nbtool_config.h.in
--- a/tools/compat/nbtool_config.h.in   Wed Jun 19 03:27:38 2019 +0000
+++ b/tools/compat/nbtool_config.h.in   Wed Jun 19 03:40:15 2019 +0000
@@ -1,6 +1,6 @@
 /* nbtool_config.h.in.  Generated from configure.ac by autoheader.  */
 
-/*      $NetBSD: nbtool_config.h.in,v 1.49 2019/01/27 05:15:32 dholland Exp $    */
+/*      $NetBSD: nbtool_config.h.in,v 1.50 2019/06/19 03:40:15 kamil Exp $    */
  
 #ifndef __NETBSD_NBTOOL_CONFIG_H__
 #define __NETBSD_NBTOOL_CONFIG_H__
@@ -436,6 +436,12 @@
 /* Define to 1 if you have the `dprintf' function. */
 #undef HAVE_DPRINTF
 
+/* Define if you have the enum uio_rw type. */
+#undef HAVE_ENUM_UIO_RW
+
+/* Define if you have the enum uio_seg type. */
+#undef HAVE_ENUM_UIO_SEG
+
 /* Define to 1 if you have the <errno.h> header file. */
 #undef HAVE_ERRNO_H
 
@@ -768,6 +774,9 @@
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
+/* Define to 1 if you have the <sys/uio.h> header file. */
+#undef HAVE_SYS_UIO_H
+
 /* Define to 1 if you have the <sys/utsname.h> header file. */
 #undef HAVE_SYS_UTSNAME_H
 



Home | Main Index | Thread Index | Old Index