Sun Jul 26 14:01:53 2015 UTC ()
Add reallocarr(3) to tools/compat

This should unbreak libutil(3) creation on systems withot reallocarr(3).


(kamil)
diff -r1.73 -r1.74 src/tools/compat/Makefile
diff -r1.101 -r1.102 src/tools/compat/compat_defs.h
diff -r1.82 -r1.83 src/tools/compat/configure
diff -r1.83 -r1.84 src/tools/compat/configure.ac
diff -r1.36 -r1.37 src/tools/compat/nbtool_config.h.in

cvs diff -r1.73 -r1.74 src/tools/compat/Makefile (expand / switch to unified diff)

--- src/tools/compat/Makefile 2015/01/18 18:09:10 1.73
+++ src/tools/compat/Makefile 2015/07/26 14:01:53 1.74
@@ -1,29 +1,29 @@ @@ -1,29 +1,29 @@
1# $NetBSD: Makefile,v 1.73 2015/01/18 18:09:10 christos Exp $ 1# $NetBSD: Makefile,v 1.74 2015/07/26 14:01:53 kamil Exp $
2 2
3HOSTLIB= nbcompat 3HOSTLIB= nbcompat
4 4
5.include <bsd.own.mk> 5.include <bsd.own.mk>
6 6
7SRCS= atoll.c basename.c cdbr.c cdbw.c dirname.c \ 7SRCS= atoll.c basename.c cdbr.c cdbw.c dirname.c \
8 dprintf.c fgetln.c flock.c fparseln.c fpurge.c \ 8 dprintf.c fgetln.c flock.c fparseln.c fpurge.c \
9 getcap.c getline.c getmode.c getopt_long.c gettemp.c \ 9 getcap.c getline.c getmode.c getopt_long.c gettemp.c \
10 heapsort.c \ 10 heapsort.c \
11 issetugid.c lchflags.c lchmod.c lchown.c libyywrap.c \ 11 issetugid.c lchflags.c lchmod.c lchown.c libyywrap.c \
12 md2.c md2hl.c md4c.c md4hl.c md5c.c md5hl.c \ 12 md2.c md2hl.c md4c.c md4hl.c md5c.c md5hl.c \
13 mi_vector_hash.c mkdtemp.c \ 13 mi_vector_hash.c mkdtemp.c \
14 mkstemp.c pread.c putc_unlocked.c pwcache.c pwrite.c \ 14 mkstemp.c pread.c putc_unlocked.c pwcache.c pwrite.c \
15 pw_scan.c \ 15 pw_scan.c \
16 raise_default_signal.c rmd160.c rmd160hl.c \ 16 raise_default_signal.c reallocarr.c rmd160.c rmd160hl.c \
17 setenv.c setgroupent.c \ 17 setenv.c setgroupent.c \
18 setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \ 18 setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \
19 sha256hl.c sha384hl.c sha512hl.c snprintb.c snprintf.c \ 19 sha256hl.c sha384hl.c sha512hl.c snprintb.c snprintf.c \
20 stat_flags.c strlcat.c strlcpy.c strmode.c \ 20 stat_flags.c strlcat.c strlcpy.c strmode.c \
21 strndup.c strnlen.c \ 21 strndup.c strnlen.c \
22 strsep.c strsuftoll.c strtoll.c \ 22 strsep.c strsuftoll.c strtoll.c \
23 strtoi.c strtou.c \ 23 strtoi.c strtou.c \
24 unvis.c vis.c err.c errx.c errc.c verr.c verrx.c verrc.c \ 24 unvis.c vis.c err.c errx.c errc.c verr.c verrx.c verrc.c \
25 vwarn.c vwarnx.c vwarnc.c warn.c warnx.c warnc.c \ 25 vwarn.c vwarnx.c vwarnc.c warn.c warnx.c warnc.c \
26 fts.c glob.c efun.c 26 fts.c glob.c efun.c
27 27
28BUILD_OSTYPE!= uname -s 28BUILD_OSTYPE!= uname -s
29 29

cvs diff -r1.101 -r1.102 src/tools/compat/compat_defs.h (expand / switch to unified diff)

--- src/tools/compat/compat_defs.h 2015/01/16 18:44:06 1.101
+++ src/tools/compat/compat_defs.h 2015/07/26 14:01:53 1.102
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: compat_defs.h,v 1.101 2015/01/16 18:44:06 christos Exp $ */ 1/* $NetBSD: compat_defs.h,v 1.102 2015/07/26 14:01:53 kamil Exp $ */
2 2
3#ifndef __NETBSD_COMPAT_DEFS_H__ 3#ifndef __NETBSD_COMPAT_DEFS_H__
4#define __NETBSD_COMPAT_DEFS_H__ 4#define __NETBSD_COMPAT_DEFS_H__
5 5
6/* 6/*
7 * On NetBSD, ensure that _NETBSD_SOURCE does not get defined, so that 7 * On NetBSD, ensure that _NETBSD_SOURCE does not get defined, so that
8 * accidental attempts to use NetBSD-specific features instead of more 8 * accidental attempts to use NetBSD-specific features instead of more
9 * portable features is likely to be noticed when the tools are built 9 * portable features is likely to be noticed when the tools are built
10 * on NetBSD. Define enough other feature test macros to expose the 10 * on NetBSD. Define enough other feature test macros to expose the
11 * features we need. 11 * features we need.
12 */ 12 */
13#ifdef __NetBSD__ 13#ifdef __NetBSD__
14#define _ISOC99_SOURCE 14#define _ISOC99_SOURCE
@@ -459,26 +459,30 @@ int lchmod(const char *, mode_t); @@ -459,26 +459,30 @@ int lchmod(const char *, mode_t);
459#endif 459#endif
460#if !HAVE_DECL_LCHOWN 460#if !HAVE_DECL_LCHOWN
461int lchown(const char *, uid_t, gid_t); 461int lchown(const char *, uid_t, gid_t);
462#endif 462#endif
463 463
464#if !HAVE_PWRITE 464#if !HAVE_PWRITE
465ssize_t pwrite(int, const void *, size_t, off_t); 465ssize_t pwrite(int, const void *, size_t, off_t);
466#endif 466#endif
467 467
468#if !HAVE_RAISE_DEFAULT_SIGNAL 468#if !HAVE_RAISE_DEFAULT_SIGNAL
469int raise_default_signal(int); 469int raise_default_signal(int);
470#endif 470#endif
471 471
 472#if !HAVE_REALLOCARR
 473int reallocarr(void *, size_t, size_t);
 474#endif
 475
472#if !HAVE_SETENV 476#if !HAVE_SETENV
473int setenv(const char *, const char *, int); 477int setenv(const char *, const char *, int);
474#endif 478#endif
475 479
476#if !HAVE_DECL_SETGROUPENT 480#if !HAVE_DECL_SETGROUPENT
477int setgroupent(int); 481int setgroupent(int);
478#endif 482#endif
479 483
480#if !HAVE_DECL_SETPASSENT 484#if !HAVE_DECL_SETPASSENT
481int setpassent(int); 485int setpassent(int);
482#endif 486#endif
483 487
484#if !HAVE_SETPROGNAME || defined(__NetBSD__) 488#if !HAVE_SETPROGNAME || defined(__NetBSD__)

cvs diff -r1.82 -r1.83 src/tools/compat/configure (expand / switch to unified diff)

--- src/tools/compat/configure 2015/01/16 18:44:31 1.82
+++ src/tools/compat/configure 2015/07/26 14:01:53 1.83
@@ -5034,27 +5034,27 @@ echo "$as_me:5033: result: $ac_cv_c_stac @@ -5034,27 +5034,27 @@ echo "$as_me:5033: result: $ac_cv_c_stac
5034echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 5034echo "${ECHO_T}$ac_cv_c_stack_direction" >&6
5035 5035
5036cat >>confdefs.h <<EOF 5036cat >>confdefs.h <<EOF
5037#define STACK_DIRECTION $ac_cv_c_stack_direction 5037#define STACK_DIRECTION $ac_cv_c_stack_direction
5038EOF 5038EOF
5039 5039
5040fi 5040fi
5041 5041
5042for ac_func in atoll asprintf asnprintf basename devname dirfd dirname \ 5042for ac_func in atoll asprintf asnprintf basename devname dirfd dirname \
5043 dprintf esetfunc fgetln flock fpurge __fpurge futimes getline \ 5043 dprintf esetfunc fgetln flock fpurge __fpurge futimes getline \
5044 getopt getopt_long group_from_gid gid_from_group \ 5044 getopt getopt_long group_from_gid gid_from_group \
5045 heapsort isblank issetugid lchflags lchmod lchown lutimes mkstemp \ 5045 heapsort isblank issetugid lchflags lchmod lchown lutimes mkstemp \
5046 mkdtemp poll pread putc_unlocked pwcache_userdb pwcache_groupdb \ 5046 mkdtemp poll pread putc_unlocked pwcache_userdb pwcache_groupdb \
5047 pwrite raise_default_signal random setenv \ 5047 pwrite raise_default_signal random reallocarr setenv \
5048 setgroupent setprogname setpassent \ 5048 setgroupent setprogname setpassent \
5049 snprintb_m snprintf strlcat strlcpy strmode \ 5049 snprintb_m snprintf strlcat strlcpy strmode \
5050 strndup strnlen strsep strsuftoll strtoi strtoll strtou \ 5050 strndup strnlen strsep strsuftoll strtoi strtoll strtou \
5051 user_from_uid uid_from_user vasprintf vasnprintf vsnprintf 5051 user_from_uid uid_from_user vasprintf vasnprintf vsnprintf
5052do 5052do
5053as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` 5053as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
5054echo "$as_me:5054: checking for $ac_func" >&5 5054echo "$as_me:5054: checking for $ac_func" >&5
5055echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 5055echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
5056if eval "test \"\${$as_ac_var+set}\" = set"; then 5056if eval "test \"\${$as_ac_var+set}\" = set"; then
5057 echo $ECHO_N "(cached) $ECHO_C" >&6 5057 echo $ECHO_N "(cached) $ECHO_C" >&6
5058else 5058else
5059 cat >conftest.$ac_ext <<_ACEOF 5059 cat >conftest.$ac_ext <<_ACEOF
5060#line 5060 "configure" 5060#line 5060 "configure"

cvs diff -r1.83 -r1.84 src/tools/compat/configure.ac (expand / switch to unified diff)

--- src/tools/compat/configure.ac 2015/01/16 18:44:06 1.83
+++ src/tools/compat/configure.ac 2015/07/26 14:01:53 1.84
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: configure.ac,v 1.83 2015/01/16 18:44:06 christos Exp $ 1# $NetBSD: configure.ac,v 1.84 2015/07/26 14:01:53 kamil Exp $
2# 2#
3# Autoconf definition file for libnbcompat. 3# Autoconf definition file for libnbcompat.
4# 4#
5# When you edit configure.ac: 5# When you edit configure.ac:
6# 0. Create the tools versions of autoconf and autoheader: 6# 0. Create the tools versions of autoconf and autoheader:
7# cd ${SRCDIR} && build.sh -V MKMAINTAINERTOOLS=yes tools 7# cd ${SRCDIR} && build.sh -V MKMAINTAINERTOOLS=yes tools
8# (This might not work if you try it after editing configure.ac.) 8# (This might not work if you try it after editing configure.ac.)
9# 1. edit configure.ac 9# 1. edit configure.ac
10# 2. Regenerate "configure" and "nbtool_config.h.in" from "configure.ac": 10# 2. Regenerate "configure" and "nbtool_config.h.in" from "configure.ac":
11# cd ${SRCDIR}/tools/compat && ${TOOLDIR}/bin/nbmake-${MACHINE} regen 11# cd ${SRCDIR}/tools/compat && ${TOOLDIR}/bin/nbmake-${MACHINE} regen
12# (Please don't use a non-tools version of autoconf or autoheader.) 12# (Please don't use a non-tools version of autoconf or autoheader.)
13# 3. Test that the tools still build: 13# 3. Test that the tools still build:
14# mv ${TOOLDIR} ${TOOLDIR}.bak 14# mv ${TOOLDIR} ${TOOLDIR}.bak
@@ -147,27 +147,27 @@ AC_CHECK_DECLS([optind, optreset],,, [ @@ -147,27 +147,27 @@ AC_CHECK_DECLS([optind, optreset],,, [
147#ifdef HAVE_GETOPT_H 147#ifdef HAVE_GETOPT_H
148#include <getopt.h> 148#include <getopt.h>
149#endif 149#endif
150]) 150])
151AC_CHECK_DECLS(sys_signame,,, [#include <signal.h>]) 151AC_CHECK_DECLS(sys_signame,,, [#include <signal.h>])
152 152
153# Library functions (where a .h check isn't enough). 153# Library functions (where a .h check isn't enough).
154AC_FUNC_ALLOCA 154AC_FUNC_ALLOCA
155AC_CHECK_FUNCS(atoll asprintf asnprintf basename devname dirfd dirname \ 155AC_CHECK_FUNCS(atoll asprintf asnprintf basename devname dirfd dirname \
156 dprintf esetfunc fgetln flock fpurge __fpurge futimes getline \ 156 dprintf esetfunc fgetln flock fpurge __fpurge futimes getline \
157 getopt getopt_long group_from_gid gid_from_group \ 157 getopt getopt_long group_from_gid gid_from_group \
158 heapsort isblank issetugid lchflags lchmod lchown lutimes mkstemp \ 158 heapsort isblank issetugid lchflags lchmod lchown lutimes mkstemp \
159 mkdtemp poll pread putc_unlocked pwcache_userdb pwcache_groupdb \ 159 mkdtemp poll pread putc_unlocked pwcache_userdb pwcache_groupdb \
160 pwrite raise_default_signal random setenv \ 160 pwrite raise_default_signal random reallocarr setenv \
161 setgroupent setprogname setpassent \ 161 setgroupent setprogname setpassent \
162 snprintb_m snprintf strlcat strlcpy strmode \ 162 snprintb_m snprintf strlcat strlcpy strmode \
163 strndup strnlen strsep strsuftoll strtoi strtoll strtou \ 163 strndup strnlen strsep strsuftoll strtoi strtoll strtou \
164 user_from_uid uid_from_user vasprintf vasnprintf vsnprintf) 164 user_from_uid uid_from_user vasprintf vasnprintf vsnprintf)
165 165
166AC_CHECK_DECLS([user_from_uid, uid_from_user, pwcache_userdb],,,[ 166AC_CHECK_DECLS([user_from_uid, uid_from_user, pwcache_userdb],,,[
167#include <pwd.h> 167#include <pwd.h>
168]) 168])
169AC_CHECK_DECLS([group_from_gid, gid_from_group, pwcache_groupdb],,,[ 169AC_CHECK_DECLS([group_from_gid, gid_from_group, pwcache_groupdb],,,[
170#include <grp.h> 170#include <grp.h>
171]) 171])
172AC_CHECK_DECLS([strndup, strnlen],,,[#include <string.h>]) 172AC_CHECK_DECLS([strndup, strnlen],,,[#include <string.h>])
173AC_CHECK_DECLS([strsuftoll],,,[#include <stdlib.h>]) 173AC_CHECK_DECLS([strsuftoll],,,[#include <stdlib.h>])

cvs diff -r1.36 -r1.37 src/tools/compat/nbtool_config.h.in (expand / switch to unified diff)

--- src/tools/compat/nbtool_config.h.in 2015/01/16 18:44:31 1.36
+++ src/tools/compat/nbtool_config.h.in 2015/07/26 14:01:53 1.37
@@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
1/* nbtool_config.h.in. Generated automatically from configure.ac by autoheader. */ 1/* nbtool_config.h.in. Generated automatically from configure.ac by autoheader. */
2 2
3/* $NetBSD: nbtool_config.h.in,v 1.36 2015/01/16 18:44:31 christos Exp $ */ 3/* $NetBSD: nbtool_config.h.in,v 1.37 2015/07/26 14:01:53 kamil Exp $ */
4  4
5#ifndef __NETBSD_NBTOOL_CONFIG_H__ 5#ifndef __NETBSD_NBTOOL_CONFIG_H__
6#define __NETBSD_NBTOOL_CONFIG_H__ 6#define __NETBSD_NBTOOL_CONFIG_H__
7 7
8/* Define to 1 if your `fparseln' function is broken. */ 8/* Define to 1 if your `fparseln' function is broken. */
9#undef BROKEN_FPARSELN 9#undef BROKEN_FPARSELN
10 10
11/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP 11/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
12 systems. This function is required for `alloca.c' support on those systems. 12 systems. This function is required for `alloca.c' support on those systems.
13 */ 13 */
14#undef CRAY_STACKSEG_END 14#undef CRAY_STACKSEG_END
15 15
16/* Define if using `alloca.c'. */ 16/* Define if using `alloca.c'. */
@@ -409,26 +409,29 @@ @@ -409,26 +409,29 @@
409 409
410/* Define if you have the <pwd.h> header file. */ 410/* Define if you have the <pwd.h> header file. */
411#undef HAVE_PWD_H 411#undef HAVE_PWD_H
412 412
413/* Define if you have the `pwrite' function. */ 413/* Define if you have the `pwrite' function. */
414#undef HAVE_PWRITE 414#undef HAVE_PWRITE
415 415
416/* Define if you have the `raise_default_signal' function. */ 416/* Define if you have the `raise_default_signal' function. */
417#undef HAVE_RAISE_DEFAULT_SIGNAL 417#undef HAVE_RAISE_DEFAULT_SIGNAL
418 418
419/* Define if you have the `random' function. */ 419/* Define if you have the `random' function. */
420#undef HAVE_RANDOM 420#undef HAVE_RANDOM
421 421
 422/* Define if you have the `reallocarr' function. */
 423#undef HAVE_REALLOCARR
 424
422/* Define if you have the <resolv.h> header file. */ 425/* Define if you have the <resolv.h> header file. */
423#undef HAVE_RESOLV_H 426#undef HAVE_RESOLV_H
424 427
425/* Define if you have the <rpc/types.h> header file. */ 428/* Define if you have the <rpc/types.h> header file. */
426#undef HAVE_RPC_TYPES_H 429#undef HAVE_RPC_TYPES_H
427 430
428/* Define if you have the `setenv' function. */ 431/* Define if you have the `setenv' function. */
429#undef HAVE_SETENV 432#undef HAVE_SETENV
430 433
431/* Define if you have the `setgroupent' function. */ 434/* Define if you have the `setgroupent' function. */
432#undef HAVE_SETGROUPENT 435#undef HAVE_SETGROUPENT
433 436
434/* Define if you have the `setpassent' function. */ 437/* Define if you have the `setpassent' function. */