diff options
author | sevan <sevan@pkgsrc.org> | 2019-07-08 20:34:54 +0000 |
---|---|---|
committer | sevan <sevan@pkgsrc.org> | 2019-07-08 20:34:54 +0000 |
commit | 2f9090e046684544425cd6cd2e8163f1b21db6dd (patch) | |
tree | 183420b7157e1f43b15a304553560d30ed335090 /pkgtools/libnbcompat | |
parent | fd2ac87bc2a192c187db50cc6040f971d4a33ac6 (diff) | |
download | pkgsrc-2f9090e046684544425cd6cd2e8163f1b21db6dd.tar.gz |
Include strnlen(3) - Needed on Tiger and more recent Intel only Darwin releases.
Diffstat (limited to 'pkgtools/libnbcompat')
-rw-r--r-- | pkgtools/libnbcompat/Makefile | 4 | ||||
-rw-r--r-- | pkgtools/libnbcompat/files/README | 9 | ||||
-rwxr-xr-x | pkgtools/libnbcompat/files/configure | 42 | ||||
-rw-r--r-- | pkgtools/libnbcompat/files/configure.ac | 11 | ||||
-rw-r--r-- | pkgtools/libnbcompat/files/nbcompat/config.h.in | 3 | ||||
-rw-r--r-- | pkgtools/libnbcompat/files/nbcompat/string.h | 6 | ||||
-rw-r--r-- | pkgtools/libnbcompat/files/strnlen.c | 58 |
7 files changed, 118 insertions, 15 deletions
diff --git a/pkgtools/libnbcompat/Makefile b/pkgtools/libnbcompat/Makefile index 7e9108025f6..3d9d08b54d8 100644 --- a/pkgtools/libnbcompat/Makefile +++ b/pkgtools/libnbcompat/Makefile @@ -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 diff --git a/pkgtools/libnbcompat/files/README b/pkgtools/libnbcompat/files/README index 0f743c244fd..01c98845a9c 100644 --- a/pkgtools/libnbcompat/files/README +++ b/pkgtools/libnbcompat/files/README @@ -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 @@ on the following operating systems: NetBSD/i386 5.2.3 <tnn@NetBSD.org> HP-UX/hppa 11.11 <tnn@NetBSD.org> +libnbcompat-20190608 has been tested to build and install correctly +on the following operating systems: + + NetBSD/amd64 8.99.49 <sevan@NetBSD.org> + Darwin/powerpc 8.11.0 <sevan@NetBSD.org> + FreeBSD/amd64 13-CURRENT <sevan@NetBSD.org> + 3 Usage ======= diff --git a/pkgtools/libnbcompat/files/configure b/pkgtools/libnbcompat/files/configure index a311d09e404..c6d9a2fe0d3 100755 --- a/pkgtools/libnbcompat/files/configure +++ b/pkgtools/libnbcompat/files/configure @@ -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>. # @@ -580,8 +580,8 @@ MAKEFLAGS= # 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' PACKAGE_URL='' @@ -1247,7 +1247,7 @@ if test "$ac_init_help" = "long"; then # 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 @@ fi 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 @@ fi 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 @@ cat >config.log <<_ACEOF 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 @@ esac 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 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # 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 @@ _ACEOF 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 --git a/pkgtools/libnbcompat/files/configure.ac b/pkgtools/libnbcompat/files/configure.ac index 27678364967..bd5f983e8cd 100644 --- a/pkgtools/libnbcompat/files/configure.ac +++ b/pkgtools/libnbcompat/files/configure.ac @@ -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]) +AC_INIT([libnbcompat], [20190708], [joerg@NetBSD.org]) AC_CONFIG_HEADER(nbcompat/config.h) AC_ARG_PROGRAM @@ -366,6 +366,13 @@ if test $need_setmode = yes; then 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 --git a/pkgtools/libnbcompat/files/nbcompat/config.h.in b/pkgtools/libnbcompat/files/nbcompat/config.h.in index 4c304d5b98e..0367030ae87 100644 --- a/pkgtools/libnbcompat/files/nbcompat/config.h.in +++ b/pkgtools/libnbcompat/files/nbcompat/config.h.in @@ -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 --git a/pkgtools/libnbcompat/files/nbcompat/string.h b/pkgtools/libnbcompat/files/nbcompat/string.h index 778642535c9..42d53c03a17 100644 --- a/pkgtools/libnbcompat/files/nbcompat/string.h +++ b/pkgtools/libnbcompat/files/nbcompat/string.h @@ -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 strlcat(char *, const char *, size_t); 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 --git a/pkgtools/libnbcompat/files/strnlen.c b/pkgtools/libnbcompat/files/strnlen.c new file mode 100644 index 00000000000..6fca2fa179d --- /dev/null +++ b/pkgtools/libnbcompat/files/strnlen.c @@ -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> + * 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 */ |