Module Name: src Committed By: kamil Date: Wed Jun 19 03:40:15 UTC 2019
Modified Files: src/tools/compat: compat_defs.h configure configure.ac nbtool_config.h.in Log Message: Add sys/uio.h & enum uio_seg, enum uio_rw to tools/compat This is needed for bootstrapping the tools on Ubuntu 16.x. To generate a diff of this commit: cvs rdiff -u -r1.114 -r1.115 src/tools/compat/compat_defs.h cvs rdiff -u -r1.93 -r1.94 src/tools/compat/configure cvs rdiff -u -r1.94 -r1.95 src/tools/compat/configure.ac cvs rdiff -u -r1.49 -r1.50 src/tools/compat/nbtool_config.h.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.114 src/tools/compat/compat_defs.h:1.115 --- src/tools/compat/compat_defs.h:1.114 Thu Aug 30 12:05:34 2018 +++ src/tools/compat/compat_defs.h Wed Jun 19 03:40:15 2019 @@ -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 unsigned int id_t; 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 @@ typedef unsigned short u_short; #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 Index: src/tools/compat/configure diff -u src/tools/compat/configure:1.93 src/tools/compat/configure:1.94 --- src/tools/compat/configure:1.93 Thu Aug 30 12:05:34 2018 +++ src/tools/compat/configure Wed Jun 19 03:40:15 2019 @@ -4098,7 +4098,8 @@ fi 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 @@ $as_echo "#define HAVE_SOCKLEN_T 1" >>co 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 @@ if test -n "$ac_unrecognized_opts" && te { $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 - Index: src/tools/compat/configure.ac diff -u src/tools/compat/configure.ac:1.94 src/tools/compat/configure.ac:1.95 --- src/tools/compat/configure.ac:1.94 Thu Aug 30 12:05:34 2018 +++ src/tools/compat/configure.ac Wed Jun 19 03:40:15 2019 @@ -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 @@ AC_CHECK_HEADERS(sys/ioctl.h sys/mman.h # 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 @@ AC_CHECK_TYPE(socklen_t, [AC_DEFINE([HAV #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 Index: src/tools/compat/nbtool_config.h.in diff -u src/tools/compat/nbtool_config.h.in:1.49 src/tools/compat/nbtool_config.h.in:1.50 --- src/tools/compat/nbtool_config.h.in:1.49 Sun Jan 27 05:15:32 2019 +++ src/tools/compat/nbtool_config.h.in Wed Jun 19 03:40:15 2019 @@ -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