deal with getsubopt and strncasecmp (needed by mdocml)

This commit is contained in:
christos 2018-08-30 12:05:34 +00:00
parent f34d81553f
commit 14cc014e8a
5 changed files with 30 additions and 6 deletions

View File

@ -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 \

View File

@ -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

View File

@ -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 <stdlib.h>
"
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 <stdlib.h>

View File

@ -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 <stdio.h>
])
AC_CHECK_DECLS([atoll, heapsort, mkdtemp, mkstemp, reallocarr,
AC_CHECK_DECLS([atoll, heapsort, mkdtemp, mkstemp, reallocarr, getsubopt,
setenv, strtoi, strtoll, strtou, setprogname, getprogname],,, [
#include <stdlib.h>
])

View File

@ -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