diff --git a/tools/compat/Makefile b/tools/compat/Makefile index 695fa8aaeea8..8291a7528385 100644 --- a/tools/compat/Makefile +++ b/tools/compat/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.85 2018/08/16 12:03:36 christos Exp $ +# $NetBSD: Makefile,v 1.86 2018/08/30 12:05:34 christos Exp $ HOSTLIB= nbcompat @@ -7,7 +7,7 @@ HOSTLIB= nbcompat SRCS= atoll.c basename.c cdbr.c cdbw.c dirname.c \ dprintf.c fgetln.c flock.c fparseln.c fpurge.c \ getcap.c getline.c getmode.c getopt_long.c gettemp.c \ - heapsort.c \ + heapsort.c getsubopt.c \ issetugid.c lchflags.c lchmod.c lchown.c libyywrap.c \ md2.c md2hl.c md4c.c md4hl.c md5c.c md5hl.c \ mi_vector_hash.c mkdtemp.c \ diff --git a/tools/compat/compat_defs.h b/tools/compat/compat_defs.h index 2edb60ea4ebf..87543530a67f 100644 --- a/tools/compat/compat_defs.h +++ b/tools/compat/compat_defs.h @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.113 2018/08/11 16:24:59 christos Exp $ */ +/* $NetBSD: compat_defs.h,v 1.114 2018/08/30 12:05:34 christos Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -255,6 +255,10 @@ extern char *optarg; extern int optind, opterr, optopt; #endif +#if !HAVE_DECL_GETSUBOPT +int getsubopt(char **, char * const *, char **); +#endif + #if !HAVE_DECL_DIRNAME char *dirname(char *); #endif @@ -497,6 +501,9 @@ size_t strnlen(const char *, size_t); #if !HAVE_DECL_STRCASECMP int strcasecmp(const char *, const char *); #endif +#if !HAVE_DECL_STRNCASECMP +int strncasecmp(const char *, const char *, size_t); +#endif #if !HAVE_DECL_LCHFLAGS int lchflags(const char *, unsigned long); #endif diff --git a/tools/compat/configure b/tools/compat/configure index a60870391018..93c3f2313730 100755 --- a/tools/compat/configure +++ b/tools/compat/configure @@ -4717,6 +4717,19 @@ fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_REALLOCARR $ac_have_decl _ACEOF +ac_fn_c_check_decl "$LINENO" "getsubopt" "ac_cv_have_decl_getsubopt" " +#include + +" +if test "x$ac_cv_have_decl_getsubopt" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETSUBOPT $ac_have_decl +_ACEOF ac_fn_c_check_decl "$LINENO" "setenv" "ac_cv_have_decl_setenv" " #include diff --git a/tools/compat/configure.ac b/tools/compat/configure.ac index 40f502d41a56..9032f97fae7a 100644 --- a/tools/compat/configure.ac +++ b/tools/compat/configure.ac @@ -1,4 +1,4 @@ -# $NetBSD: configure.ac,v 1.93 2018/08/16 12:03:36 christos Exp $ +# $NetBSD: configure.ac,v 1.94 2018/08/30 12:05:34 christos Exp $ # # Autoconf definition file for libnbcompat. # @@ -145,7 +145,7 @@ AC_CHECK_DECLS([asprintf, asnprintf, vasprintf, vasnprintf, vsnprintf, fgetln, f #include ]) -AC_CHECK_DECLS([atoll, heapsort, mkdtemp, mkstemp, reallocarr, +AC_CHECK_DECLS([atoll, heapsort, mkdtemp, mkstemp, reallocarr, getsubopt, setenv, strtoi, strtoll, strtou, setprogname, getprogname],,, [ #include ]) diff --git a/tools/compat/nbtool_config.h.in b/tools/compat/nbtool_config.h.in index 4717a205424d..d142242af58d 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.46 2018/08/16 12:03:36 christos Exp $ */ +/* $NetBSD: nbtool_config.h.in,v 1.47 2018/08/30 12:05:34 christos Exp $ */ #ifndef __NETBSD_NBTOOL_CONFIG_H__ #define __NETBSD_NBTOOL_CONFIG_H__ @@ -154,6 +154,10 @@ don't. */ #undef HAVE_DECL_GETPROGNAME +/* Define to 1 if you have the declaration of `getsubopt', and to 0 if you + don't. */ +#undef HAVE_DECL_GETSUBOPT + /* Define to 1 if you have the declaration of `gid_from_group', and to 0 if you don't. */ #undef HAVE_DECL_GID_FROM_GROUP