pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/pkgtools/libnbcompat
Module Name: pkgsrc
Committed By: nia
Date: Thu Nov 9 18:55:19 UTC 2023
Modified Files:
pkgsrc/pkgtools/libnbcompat: Makefile
pkgsrc/pkgtools/libnbcompat/files: README configure configure.ac
pkgsrc/pkgtools/libnbcompat/files/nbcompat: config.h.in string.h
Added Files:
pkgsrc/pkgtools/libnbcompat/files: strndup.c
Log Message:
libnbcompat: Add strndup(3) for Mac OS X 10.4.
To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 pkgsrc/pkgtools/libnbcompat/Makefile
cvs rdiff -u -r1.28 -r1.29 pkgsrc/pkgtools/libnbcompat/files/README
cvs rdiff -u -r1.88 -r1.89 pkgsrc/pkgtools/libnbcompat/files/configure
cvs rdiff -u -r1.89 -r1.90 pkgsrc/pkgtools/libnbcompat/files/configure.ac
cvs rdiff -u -r0 -r1.1 pkgsrc/pkgtools/libnbcompat/files/strndup.c
cvs rdiff -u -r1.37 -r1.38 \
pkgsrc/pkgtools/libnbcompat/files/nbcompat/config.h.in
cvs rdiff -u -r1.5 -r1.6 pkgsrc/pkgtools/libnbcompat/files/nbcompat/string.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/pkgtools/libnbcompat/Makefile
diff -u pkgsrc/pkgtools/libnbcompat/Makefile:1.91 pkgsrc/pkgtools/libnbcompat/Makefile:1.92
--- pkgsrc/pkgtools/libnbcompat/Makefile:1.91 Mon Sep 4 19:51:19 2023
+++ pkgsrc/pkgtools/libnbcompat/Makefile Thu Nov 9 18:55:18 2023
@@ -1,16 +1,17 @@
-# $NetBSD: Makefile,v 1.91 2023/09/04 19:51:19 jperkin Exp $
+# $NetBSD: Makefile,v 1.92 2023/11/09 18:55:18 nia 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-20230904
+PKGNAME= libnbcompat-20231109
CATEGORIES= pkgtools devel
MAINTAINER= pkgsrc-users%NetBSD.org@localhost
HOMEPAGE= https://www.NetBSD.org/
COMMENT= Portable NetBSD compatibility library
+LICENSE= 2-clause-bsd AND modified-bsd
GNU_CONFIGURE= yes
MAKE_ENV+= LIBMODE=${LIBMODE}
Index: pkgsrc/pkgtools/libnbcompat/files/README
diff -u pkgsrc/pkgtools/libnbcompat/files/README:1.28 pkgsrc/pkgtools/libnbcompat/files/README:1.29
--- pkgsrc/pkgtools/libnbcompat/files/README:1.28 Mon Sep 4 19:51:19 2023
+++ pkgsrc/pkgtools/libnbcompat/files/README Thu Nov 9 18:55:18 2023
@@ -1,4 +1,4 @@
-$NetBSD: README,v 1.28 2023/09/04 19:51:19 jperkin Exp $
+$NetBSD: README,v 1.29 2023/11/09 18:55:18 nia Exp $
0 Introduction
==============
@@ -44,6 +44,12 @@ breakage seep in. Proper methodology fo
*NOTE* the most recent libnbcompat.
*NOTE*
+libnbcompat-20231109 has been tested to build and install correctly
+on the following operating systems:
+
+ NetBSD/amd64 10.0 RC1 <nia%NetBSD.org@localhost>
+ Darwin/powerpc 8.11.0 <nia%NetBSD.org@localhost>
+
libnbcompat-20230904 has been tested to build and install correctly
on the following operating systems:
Index: pkgsrc/pkgtools/libnbcompat/files/configure
diff -u pkgsrc/pkgtools/libnbcompat/files/configure:1.88 pkgsrc/pkgtools/libnbcompat/files/configure:1.89
--- pkgsrc/pkgtools/libnbcompat/files/configure:1.88 Tue Jun 27 09:30:43 2023
+++ pkgsrc/pkgtools/libnbcompat/files/configure Thu Nov 9 18:55:18 2023
@@ -7547,6 +7547,30 @@ esac
fi
+need_strndup=no
+
+ for ac_func in strndup
+do :
+ ac_fn_c_check_func "$LINENO" "strndup" "ac_cv_func_strndup"
+if test "x$ac_cv_func_strndup" = xyes
+then :
+ printf "%s\n" "#define HAVE_STRNDUP 1" >>confdefs.h
+ :
+else $as_nop
+ need_strndup=yes
+fi
+
+done
+
+if test $need_strndup = yes; then
+ case " $LIBOBJS " in
+ *" strndup.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS strndup.$ac_objext"
+ ;;
+esac
+
+fi
+
ac_fn_check_decl "$LINENO" "endgrent" "ac_cv_have_decl_endgrent" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
if test "x$ac_cv_have_decl_endgrent" = xyes
then :
Index: pkgsrc/pkgtools/libnbcompat/files/configure.ac
diff -u pkgsrc/pkgtools/libnbcompat/files/configure.ac:1.89 pkgsrc/pkgtools/libnbcompat/files/configure.ac:1.90
--- pkgsrc/pkgtools/libnbcompat/files/configure.ac:1.89 Tue Jun 27 09:30:27 2023
+++ pkgsrc/pkgtools/libnbcompat/files/configure.ac Thu Nov 9 18:55:18 2023
@@ -1,4 +1,4 @@
-dnl $NetBSD: configure.ac,v 1.89 2023/06/27 09:30:27 riastradh Exp $
+dnl $NetBSD: configure.ac,v 1.90 2023/11/09 18:55:18 nia Exp $
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.52)
@@ -373,6 +373,13 @@ if test $need_strnlen = yes; then
AC_LIBOBJ(strnlen)
fi
+need_strndup=no
+AC_CHECK_FUNCS([strndup], [:], [need_strndup=yes])
+
+if test $need_strndup = yes; then
+ AC_LIBOBJ(strndup)
+fi
+
AC_CHECK_DECLS([endgrent, endpwent, setpassent])
need_pwcache=no
Index: pkgsrc/pkgtools/libnbcompat/files/nbcompat/config.h.in
diff -u pkgsrc/pkgtools/libnbcompat/files/nbcompat/config.h.in:1.37 pkgsrc/pkgtools/libnbcompat/files/nbcompat/config.h.in:1.38
--- pkgsrc/pkgtools/libnbcompat/files/nbcompat/config.h.in:1.37 Mon Jul 8 20:34:54 2019
+++ pkgsrc/pkgtools/libnbcompat/files/nbcompat/config.h.in Thu Nov 9 18:55:19 2023
@@ -197,8 +197,8 @@
/* Define to 1 if you have the <md5.h> header file. */
#undef HAVE_MD5_H
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
+/* Define to 1 if you have the <minix/config.h> header file. */
+#undef HAVE_MINIX_CONFIG_H
/* Define to 1 if you have the `mkdtemp' function. */
#undef HAVE_MKDTEMP
@@ -330,7 +330,7 @@
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
-/* Define to 1 if you have the `strerror_r' function. */
+/* Define if you have `strerror_r'. */
#undef HAVE_STRERROR_R
/* Define to 1 if you have the <strings.h> header file. */
@@ -348,6 +348,9 @@
/* Define to 1 if you have the `strmode' function. */
#undef HAVE_STRMODE
+/* Define to 1 if you have the `strndup' function. */
+#undef HAVE_STRNDUP
+
/* Define to 1 if you have the `strnlen' function. */
#undef HAVE_STRNLEN
@@ -519,6 +522,9 @@
/* Define to 1 if you have the `warn' function. */
#undef HAVE_WARN
+/* Define to 1 if you have the <wchar.h> header file. */
+#undef HAVE_WCHAR_H
+
/* Define to 1 if `fork' works. */
#undef HAVE_WORKING_FORK
@@ -558,34 +564,103 @@
/* The size of `off_t', as computed by sizeof. */
#undef SIZEOF_OFF_T
-/* Define to 1 if you have the ANSI C header files. */
+/* Define to 1 if all of the C90 standard headers exist (not just the ones
+ required in a freestanding environment). This macro is provided for
+ backward compatibility; new code need not use it. */
#undef STDC_HEADERS
/* Define to 1 if strerror_r returns char *. */
#undef STRERROR_R_CHAR_P
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. This
+ macro is obsolete. */
#undef TIME_WITH_SYS_TIME
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
+/* Enable general extensions on macOS. */
+#ifndef _DARWIN_C_SOURCE
+# undef _DARWIN_C_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
-/* Enable threading extensions on Solaris. */
+/* Enable X/Open compliant socket functions that do not require linking
+ with -lxnet on HP-UX 11.11. */
+#ifndef _HPUX_ALT_XOPEN_SOCKET_API
+# undef _HPUX_ALT_XOPEN_SOCKET_API
+#endif
+/* Identify the host operating system as Minix.
+ This macro does not affect the system headers' behavior.
+ A future release of Autoconf may stop defining this macro. */
+#ifndef _MINIX
+# undef _MINIX
+#endif
+/* Enable general extensions on NetBSD.
+ Enable NetBSD compatibility extensions on Minix. */
+#ifndef _NETBSD_SOURCE
+# undef _NETBSD_SOURCE
+#endif
+/* Enable OpenBSD compatibility extensions on NetBSD.
+ Oddly enough, this does nothing on OpenBSD. */
+#ifndef _OPENBSD_SOURCE
+# undef _OPENBSD_SOURCE
+#endif
+/* Define to 1 if needed for POSIX-compatible behavior. */
+#ifndef _POSIX_SOURCE
+# undef _POSIX_SOURCE
+#endif
+/* Define to 2 if needed for POSIX-compatible behavior. */
+#ifndef _POSIX_1_SOURCE
+# undef _POSIX_1_SOURCE
+#endif
+/* Enable POSIX-compatible threading on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
+/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */
+#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
+# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */
+#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+# undef __STDC_WANT_IEC_60559_BFP_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */
+#ifndef __STDC_WANT_IEC_60559_DFP_EXT__
+# undef __STDC_WANT_IEC_60559_DFP_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */
+#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
+# undef __STDC_WANT_IEC_60559_FUNCS_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */
+#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
+# undef __STDC_WANT_IEC_60559_TYPES_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */
+#ifndef __STDC_WANT_LIB_EXT2__
+# undef __STDC_WANT_LIB_EXT2__
+#endif
+/* Enable extensions specified by ISO/IEC 24747:2009. */
+#ifndef __STDC_WANT_MATH_SPEC_FUNCS__
+# undef __STDC_WANT_MATH_SPEC_FUNCS__
+#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
-/* Enable general extensions on Solaris. */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
+/* Enable X/Open extensions. Define to 500 only if necessary
+ to make mbstate_t available. */
+#ifndef _XOPEN_SOURCE
+# undef _XOPEN_SOURCE
#endif
@@ -601,16 +676,6 @@
# endif
#endif
-/* Define to 1 if on MINIX. */
-#undef _MINIX
-
-/* Define to 2 if the system does not provide POSIX.1 features except with
- this defined. */
-#undef _POSIX_1_SOURCE
-
-/* Define to 1 if you need to in order for `stat' and other things to work. */
-#undef _POSIX_SOURCE
-
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
@@ -642,7 +707,7 @@
a type exists and the standard includes do not define it. */
#undef int8_t
-/* Define to `int' if <sys/types.h> does not define. */
+/* Define as a signed integer type capable of holding a process identifier. */
#undef pid_t
/* Define to `unsigned int' if <sys/types.h> does not define. */
Index: pkgsrc/pkgtools/libnbcompat/files/nbcompat/string.h
diff -u pkgsrc/pkgtools/libnbcompat/files/nbcompat/string.h:1.5 pkgsrc/pkgtools/libnbcompat/files/nbcompat/string.h:1.6
--- pkgsrc/pkgtools/libnbcompat/files/nbcompat/string.h:1.5 Tue Jul 9 09:43:32 2019
+++ pkgsrc/pkgtools/libnbcompat/files/nbcompat/string.h Thu Nov 9 18:55:19 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: string.h,v 1.5 2019/07/09 09:43:32 sevan Exp $ */
+/* $NetBSD: string.h,v 1.6 2023/11/09 18:55:19 nia Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -60,6 +60,10 @@ size_t strlcpy(char *, const char *, siz
size_t strnlen(const char *s, size_t maxlen);
#endif
+#if !HAVE_STRNDUP
+char *strndup(const char *, size_t);
+#endif
+
#if !HAVE_STRSEP
char *strsep(char **stringp, const char *delim);
#endif
Added files:
Index: pkgsrc/pkgtools/libnbcompat/files/strndup.c
diff -u /dev/null pkgsrc/pkgtools/libnbcompat/files/strndup.c:1.1
--- /dev/null Thu Nov 9 18:55:19 2023
+++ pkgsrc/pkgtools/libnbcompat/files/strndup.c Thu Nov 9 18:55:18 2023
@@ -0,0 +1,83 @@
+/* $NetBSD: strndup.c,v 1.1 2023/11/09 18:55:18 nia Exp $ */
+
+/*
+ * Copyright (c) 1988, 1993
+ * The Regents of the University of California. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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>
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+#if 0
+static char sccsid[] = "@(#)strdup.c 8.1 (Berkeley) 6/4/93";
+#else
+__RCSID("$NetBSD: strndup.c,v 1.1 2023/11/09 18:55:18 nia Exp $");
+#endif
+#endif /* LIBC_SCCS and not lint */
+
+#if 0
+#include "namespace.h"
+#endif
+
+#include <nbcompat/assert.h>
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#include <nbcompat/stdlib.h>
+#include <nbcompat/string.h>
+
+#if 0
+#ifdef __weak_alias
+__weak_alias(strndup,_strndup)
+#endif
+#endif
+
+#if !HAVE_STRNDUP
+char *
+strndup(const char *str, size_t n)
+{
+ size_t len;
+ char *copy;
+
+ _DIAGASSERT(str != NULL);
+
+ for (len = 0; len < n && str[len]; len++)
+ continue;
+
+ if (!(copy = malloc(len + 1)))
+ return (NULL);
+ memcpy(copy, str, len);
+ copy[len] = '\0';
+ return (copy);
+}
+#endif /* !HAVE_STRNDUP */
Home |
Main Index |
Thread Index |
Old Index