Source-Changes-HG archive

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

[src/trunk]: src/tools/compat deal with getsubopt and strncasecmp (needed by ...



details:   https://anonhg.NetBSD.org/src/rev/7e63bbf3553c
branches:  trunk
changeset: 366506:7e63bbf3553c
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Aug 30 12:05:34 2018 +0000

description:
deal with getsubopt and strncasecmp (needed by mdocml)

diffstat:

 tools/compat/Makefile           |   4 ++--
 tools/compat/compat_defs.h      |   9 ++++++++-
 tools/compat/configure          |  13 +++++++++++++
 tools/compat/configure.ac       |   4 ++--
 tools/compat/nbtool_config.h.in |   6 +++++-
 5 files changed, 30 insertions(+), 6 deletions(-)

diffs (111 lines):

diff -r 00f26a7280b8 -r 7e63bbf3553c tools/compat/Makefile
--- a/tools/compat/Makefile     Thu Aug 30 10:38:01 2018 +0000
+++ b/tools/compat/Makefile     Thu Aug 30 12:05:34 2018 +0000
@@ -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 @@
 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 -r 00f26a7280b8 -r 7e63bbf3553c tools/compat/compat_defs.h
--- a/tools/compat/compat_defs.h        Thu Aug 30 10:38:01 2018 +0000
+++ b/tools/compat/compat_defs.h        Thu Aug 30 12:05:34 2018 +0000
@@ -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 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 @@
 #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 -r 00f26a7280b8 -r 7e63bbf3553c tools/compat/configure
--- a/tools/compat/configure    Thu Aug 30 10:38:01 2018 +0000
+++ b/tools/compat/configure    Thu Aug 30 12:05:34 2018 +0000
@@ -4717,6 +4717,19 @@
 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>
 
diff -r 00f26a7280b8 -r 7e63bbf3553c tools/compat/configure.ac
--- a/tools/compat/configure.ac Thu Aug 30 10:38:01 2018 +0000
+++ b/tools/compat/configure.ac Thu Aug 30 12:05:34 2018 +0000
@@ -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 @@
 #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>
 ])
diff -r 00f26a7280b8 -r 7e63bbf3553c tools/compat/nbtool_config.h.in
--- a/tools/compat/nbtool_config.h.in   Thu Aug 30 10:38:01 2018 +0000
+++ b/tools/compat/nbtool_config.h.in   Thu Aug 30 12:05:34 2018 +0000
@@ -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



Home | Main Index | Thread Index | Old Index