pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/libnbcompat Include strnlen(3) - Needed on Ti...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0b8ecdb9d600
branches:  trunk
changeset: 336186:0b8ecdb9d600
user:      sevan <sevan%pkgsrc.org@localhost>
date:      Mon Jul 08 20:34:54 2019 +0000

description:
Include strnlen(3) - Needed on Tiger and more recent Intel only Darwin releases.

diffstat:

 pkgtools/libnbcompat/Makefile                   |   4 +-
 pkgtools/libnbcompat/files/README               |   9 +++-
 pkgtools/libnbcompat/files/configure            |  42 ++++++++++++++---
 pkgtools/libnbcompat/files/configure.ac         |  11 +++-
 pkgtools/libnbcompat/files/nbcompat/config.h.in |   3 +
 pkgtools/libnbcompat/files/nbcompat/string.h    |   6 ++-
 pkgtools/libnbcompat/files/strnlen.c            |  58 +++++++++++++++++++++++++
 7 files changed, 118 insertions(+), 15 deletions(-)

diffs (270 lines):

diff -r 174c84542397 -r 0b8ecdb9d600 pkgtools/libnbcompat/Makefile
--- a/pkgtools/libnbcompat/Makefile     Mon Jul 08 19:45:54 2019 +0000
+++ b/pkgtools/libnbcompat/Makefile     Mon Jul 08 20:34:54 2019 +0000
@@ -1,11 +1,11 @@
-# $NetBSD: Makefile,v 1.84 2015/06/08 00:44:46 joerg Exp $
+# $NetBSD: Makefile,v 1.85 2019/07/08 20:34:54 sevan Exp $
 #
 # NOTE: If you update this package, it is *mandatory* that you update
 #      pkgsrc/pkgtools/libnbcompat/files/README to reflect the actual
 #      list of tested and supported platforms.
 #
 
-PKGNAME=               libnbcompat-20150615
+PKGNAME=               libnbcompat-20190708
 CATEGORIES=            pkgtools devel
 
 MAINTAINER=            joerg%NetBSD.org@localhost
diff -r 174c84542397 -r 0b8ecdb9d600 pkgtools/libnbcompat/files/README
--- a/pkgtools/libnbcompat/files/README Mon Jul 08 19:45:54 2019 +0000
+++ b/pkgtools/libnbcompat/files/README Mon Jul 08 20:34:54 2019 +0000
@@ -1,4 +1,4 @@
-$NetBSD: README,v 1.23 2018/04/30 10:41:35 wiz Exp $
+$NetBSD: README,v 1.24 2019/07/08 20:34:54 sevan Exp $
 
  0 Introduction
  ==============
@@ -111,6 +111,13 @@
        NetBSD/i386 5.2.3               <tnn%NetBSD.org@localhost>
        HP-UX/hppa 11.11                <tnn%NetBSD.org@localhost>
        
+libnbcompat-20190608 has been tested to build and install correctly
+on the following operating systems:
+
+       NetBSD/amd64 8.99.49            <sevan%NetBSD.org@localhost>
+       Darwin/powerpc 8.11.0           <sevan%NetBSD.org@localhost>
+       FreeBSD/amd64 13-CURRENT        <sevan%NetBSD.org@localhost>
+
  3 Usage
  =======
 
diff -r 174c84542397 -r 0b8ecdb9d600 pkgtools/libnbcompat/files/configure
--- a/pkgtools/libnbcompat/files/configure      Mon Jul 08 19:45:54 2019 +0000
+++ b/pkgtools/libnbcompat/files/configure      Mon Jul 08 20:34:54 2019 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libnbcompat 20150419.
+# Generated by GNU Autoconf 2.69 for libnbcompat 20190708.
 #
 # Report bugs to <joerg%NetBSD.org@localhost>.
 #
@@ -580,8 +580,8 @@
 # Identity of this package.
 PACKAGE_NAME='libnbcompat'
 PACKAGE_TARNAME='libnbcompat'
-PACKAGE_VERSION='20150419'
-PACKAGE_STRING='libnbcompat 20150419'
+PACKAGE_VERSION='20190708'
+PACKAGE_STRING='libnbcompat 20190708'
 PACKAGE_BUGREPORT='joerg%NetBSD.org@localhost'
 PACKAGE_URL=''
 
@@ -1247,7 +1247,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures libnbcompat 20150419 to adapt to many kinds of systems.
+\`configure' configures libnbcompat 20190708 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1317,7 +1317,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of libnbcompat 20150419:";;
+     short | recursive ) echo "Configuration of libnbcompat 20190708:";;
    esac
   cat <<\_ACEOF
 
@@ -1404,7 +1404,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-libnbcompat configure 20150419
+libnbcompat configure 20190708
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2243,7 +2243,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by libnbcompat $as_me 20150419, which was
+It was created by libnbcompat $as_me 20190708, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -7327,6 +7327,30 @@
 
 fi
 
+need_strnlen=no
+for ac_func in strnlen
+do :
+  ac_fn_c_check_func "$LINENO" "strnlen" "ac_cv_func_strnlen"
+if test "x$ac_cv_func_strnlen" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_STRNLEN 1
+_ACEOF
+ :
+else
+  need_strnlen=yes
+fi
+done
+
+
+if test $need_strnlen = yes; then
+        case " $LIBOBJS " in
+  *" strnlen.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS strnlen.$ac_objext"
+ ;;
+esac
+
+fi
+
 ac_fn_c_check_decl "$LINENO" "endgrent" "ac_cv_have_decl_endgrent" "$ac_includes_default"
 if test "x$ac_cv_have_decl_endgrent" = xyes; then :
   ac_have_decl=1
@@ -8368,7 +8392,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libnbcompat $as_me 20150419, which was
+This file was extended by libnbcompat $as_me 20190708, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -8430,7 +8454,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-libnbcompat config.status 20150419
+libnbcompat config.status 20190708
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff -r 174c84542397 -r 0b8ecdb9d600 pkgtools/libnbcompat/files/configure.ac
--- a/pkgtools/libnbcompat/files/configure.ac   Mon Jul 08 19:45:54 2019 +0000
+++ b/pkgtools/libnbcompat/files/configure.ac   Mon Jul 08 20:34:54 2019 +0000
@@ -1,8 +1,8 @@
-dnl $NetBSD: configure.ac,v 1.86 2015/09/01 23:17:51 kamil Exp $
+dnl $NetBSD: configure.ac,v 1.87 2019/07/08 20:34:54 sevan Exp $
 
 dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.52)
-AC_INIT([libnbcompat], [20150419], [joerg%NetBSD.org@localhost])
+AC_INIT([libnbcompat], [20190708], [joerg%NetBSD.org@localhost])
 AC_CONFIG_HEADER(nbcompat/config.h)
 AC_ARG_PROGRAM
 
@@ -366,6 +366,13 @@
        AC_LIBOBJ(setmode)
 fi
 
+need_strnlen=no
+AC_CHECK_FUNCS([strnlen], [:], [need_strnlen=yes])
+
+if test $need_strnlen = yes; then
+        AC_LIBOBJ(strnlen)
+fi
+
 AC_CHECK_DECLS([endgrent, endpwent, setpassent])
 
 need_pwcache=no
diff -r 174c84542397 -r 0b8ecdb9d600 pkgtools/libnbcompat/files/nbcompat/config.h.in
--- a/pkgtools/libnbcompat/files/nbcompat/config.h.in   Mon Jul 08 19:45:54 2019 +0000
+++ b/pkgtools/libnbcompat/files/nbcompat/config.h.in   Mon Jul 08 20:34:54 2019 +0000
@@ -348,6 +348,9 @@
 /* Define to 1 if you have the `strmode' function. */
 #undef HAVE_STRMODE
 
+/* Define to 1 if you have the `strnlen' function. */
+#undef HAVE_STRNLEN
+
 /* Define to 1 if you have the `strsep' function. */
 #undef HAVE_STRSEP
 
diff -r 174c84542397 -r 0b8ecdb9d600 pkgtools/libnbcompat/files/nbcompat/string.h
--- a/pkgtools/libnbcompat/files/nbcompat/string.h      Mon Jul 08 19:45:54 2019 +0000
+++ b/pkgtools/libnbcompat/files/nbcompat/string.h      Mon Jul 08 20:34:54 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: string.h,v 1.3 2015/06/08 00:44:46 joerg Exp $ */
+/*     $NetBSD: string.h,v 1.4 2019/07/08 20:34:54 sevan Exp $ */
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -56,6 +56,10 @@
 size_t strlcpy(char *, const char *, size_t);
 #endif
 
+#if !HAVE_STRNLEN
+size_t strlen(const char *str);
+#endif
+
 #if !HAVE_STRSEP
 char   *strsep(char **stringp, const char *delim);
 #endif
diff -r 174c84542397 -r 0b8ecdb9d600 pkgtools/libnbcompat/files/strnlen.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/libnbcompat/files/strnlen.c      Mon Jul 08 20:34:54 2019 +0000
@@ -0,0 +1,58 @@
+/*     $NetBSD: strnlen.c,v 1.1 2019/07/08 20:34:54 sevan Exp $        */
+
+/*-
+ * Copyright (c) 2009 David Schultz <das%FreeBSD.org@localhost>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
+#include <nbcompat.h>
+#include <nbcompat/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: strnlen.c,v 1.1 2019/07/08 20:34:54 sevan Exp $");
+#endif /* LIBC_SCCS and not lint */
+/* FreeBSD: src/lib/libc/string/strnlen.c,v 1.1 2009/02/28 06:00:58 das Exp */
+
+#if !defined(_KERNEL) && !defined(_STANDALONE)
+#include <string.h>
+#else
+#include <lib/libkern/libkern.h>
+#endif
+
+#if !HAVE_STRNLEN
+size_t
+strnlen(const char *s, size_t maxlen)
+{
+       size_t len;
+
+       for (len = 0; len < maxlen; len++, s++) {
+               if (!*s)
+                       break;
+       }
+       return (len);
+}
+#endif /* !HAVE_STRNLEN */



Home | Main Index | Thread Index | Old Index