diff options
| author | kamil <kamil@NetBSD.org> | 2019-06-19 03:40:15 +0000 |
|---|---|---|
| committer | kamil <kamil@NetBSD.org> | 2019-06-19 03:40:15 +0000 |
| commit | 73ffba60b16a5ca4321eef539eedd285cbb00c71 (patch) | |
| tree | f0c07306c88238879582a07b161af71207d70945 /tools | |
| parent | b732755214b69571787d83bbc218c0d96823eb29 (diff) | |
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 (limited to 'tools')
| -rw-r--r-- | tools/compat/compat_defs.h | 17 | ||||
| -rwxr-xr-x | tools/compat/configure | 52 | ||||
| -rw-r--r-- | tools/compat/configure.ac | 23 | ||||
| -rw-r--r-- | tools/compat/nbtool_config.h.in | 11 |
4 files changed, 97 insertions, 6 deletions
diff --git a/tools/compat/compat_defs.h b/tools/compat/compat_defs.h index 87543530a67..04e8de0bd09 100644 --- a/tools/compat/compat_defs.h +++ b/tools/compat/compat_defs.h @@ -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 diff --git a/tools/compat/configure b/tools/compat/configure index 93c3f231373..c4bac1498cc 100755 --- a/tools/compat/configure +++ b/tools/compat/configure @@ -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" >>confdefs.h 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" && test "$enable_option_checking" != no; then { $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 --git a/tools/compat/configure.ac b/tools/compat/configure.ac index 9032f97fae7..350f1eabce5 100644 --- a/tools/compat/configure.ac +++ b/tools/compat/configure.ac @@ -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 sys/param.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([HAVE_SOCKLEN_T], 1, #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 --git a/tools/compat/nbtool_config.h.in b/tools/compat/nbtool_config.h.in index be2800ae50f..d621a73c78d 100644 --- a/tools/compat/nbtool_config.h.in +++ b/tools/compat/nbtool_config.h.in @@ -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 |
