summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/libnbcompat/Makefile4
-rw-r--r--pkgtools/libnbcompat/PLIST14
-rw-r--r--pkgtools/libnbcompat/buildlink3.mk4
-rw-r--r--pkgtools/libnbcompat/files/Makefile.in34
-rw-r--r--pkgtools/libnbcompat/files/README15
-rwxr-xr-xpkgtools/libnbcompat/files/configure400
-rw-r--r--pkgtools/libnbcompat/files/configure.ac48
-rw-r--r--pkgtools/libnbcompat/files/nbcompat.h308
-rw-r--r--pkgtools/libnbcompat/files/nbcompat/config.h.in24
-rw-r--r--pkgtools/libnbcompat/files/nbcompat/fnmatch.h8
-rw-r--r--pkgtools/libnbcompat/files/nbcompat/grp.h62
-rw-r--r--pkgtools/libnbcompat/files/nbcompat/limits.h76
-rw-r--r--pkgtools/libnbcompat/files/nbcompat/paths.h65
-rw-r--r--pkgtools/libnbcompat/files/nbcompat/pwd.h62
-rw-r--r--pkgtools/libnbcompat/files/nbcompat/queue.h10
-rw-r--r--pkgtools/libnbcompat/files/nbcompat/stat.h66
-rw-r--r--pkgtools/libnbcompat/files/nbcompat/statvfs.h16
-rw-r--r--pkgtools/libnbcompat/files/nbcompat/stdio.h66
-rw-r--r--pkgtools/libnbcompat/files/nbcompat/stdlib.h71
-rw-r--r--pkgtools/libnbcompat/files/nbcompat/string.h74
-rw-r--r--pkgtools/libnbcompat/files/nbcompat/time.h74
-rw-r--r--pkgtools/libnbcompat/files/nbcompat/tzfile.h82
-rw-r--r--pkgtools/libnbcompat/files/nbcompat/unistd.h78
-rw-r--r--pkgtools/libnbcompat/files/nbcompat/util.h64
-rw-r--r--pkgtools/libnbcompat/files/pwcache.c26
-rw-r--r--pkgtools/libnbcompat/files/setgroupent.c54
-rw-r--r--pkgtools/libnbcompat/files/setpassent.c54
27 files changed, 1249 insertions, 610 deletions
diff --git a/pkgtools/libnbcompat/Makefile b/pkgtools/libnbcompat/Makefile
index cc5c8b8ed8f..8bb0219e2e1 100644
--- a/pkgtools/libnbcompat/Makefile
+++ b/pkgtools/libnbcompat/Makefile
@@ -1,11 +1,11 @@
-# $NetBSD: Makefile,v 1.36 2004/08/06 16:55:09 jlam Exp $
+# $NetBSD: Makefile,v 1.37 2004/08/10 18:47:55 jlam 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.
#
-DISTNAME= libnbcompat-20040805
+DISTNAME= libnbcompat-20040809
CATEGORIES= pkgtools
MASTER_SITES= # empty
DISTFILES= # empty
diff --git a/pkgtools/libnbcompat/PLIST b/pkgtools/libnbcompat/PLIST
index d9c09142606..aba98747f73 100644
--- a/pkgtools/libnbcompat/PLIST
+++ b/pkgtools/libnbcompat/PLIST
@@ -1,18 +1,30 @@
-@comment $NetBSD: PLIST,v 1.11 2004/08/06 16:55:09 jlam Exp $
+@comment $NetBSD: PLIST,v 1.12 2004/08/10 18:47:55 jlam Exp $
include/nbcompat.h
include/nbcompat/err.h
include/nbcompat/fnmatch.h
include/nbcompat/fts.h
include/nbcompat/getopt.h
include/nbcompat/glob.h
+include/nbcompat/grp.h
+include/nbcompat/limits.h
include/nbcompat/md5.h
include/nbcompat/nbconfig.h
include/nbcompat/nbtypes.h
+include/nbcompat/paths.h
include/nbcompat/poll.h
+include/nbcompat/pwd.h
include/nbcompat/queue.h
include/nbcompat/rmd160.h
include/nbcompat/sha1.h
+include/nbcompat/stat.h
include/nbcompat/statvfs.h
+include/nbcompat/stdio.h
+include/nbcompat/stdlib.h
+include/nbcompat/string.h
+include/nbcompat/time.h
+include/nbcompat/tzfile.h
+include/nbcompat/unistd.h
+include/nbcompat/util.h
include/nbcompat/vis.h
lib/libnbcompat.a
@dirrm include/nbcompat
diff --git a/pkgtools/libnbcompat/buildlink3.mk b/pkgtools/libnbcompat/buildlink3.mk
index 1e06a44c5f5..6a708b03ea8 100644
--- a/pkgtools/libnbcompat/buildlink3.mk
+++ b/pkgtools/libnbcompat/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.7 2004/08/06 16:55:09 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.8 2004/08/10 18:47:55 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
LIBNBCOMPAT_BUILDLINK3_MK:= ${LIBNBCOMPAT_BUILDLINK3_MK}+
@@ -11,7 +11,7 @@ BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nlibnbcompat}
BUILDLINK_PACKAGES+= libnbcompat
.if !empty(LIBNBCOMPAT_BUILDLINK3_MK:M+)
-BUILDLINK_DEPENDS.libnbcompat+= libnbcompat>=20040805
+BUILDLINK_DEPENDS.libnbcompat+= libnbcompat>=20040809
BUILDLINK_PKGSRCDIR.libnbcompat?= ../../pkgtools/libnbcompat
BUILDLINK_DEPMETHOD.libnbcompat?= build
BUILDLINK_LDADD.libnbcompat= -lnbcompat
diff --git a/pkgtools/libnbcompat/files/Makefile.in b/pkgtools/libnbcompat/files/Makefile.in
index 588fc042748..614f5feb37b 100644
--- a/pkgtools/libnbcompat/files/Makefile.in
+++ b/pkgtools/libnbcompat/files/Makefile.in
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.in,v 1.23 2004/08/06 16:55:09 jlam Exp $
+# $NetBSD: Makefile.in,v 1.24 2004/08/10 18:47:55 jlam Exp $
#
srcdir= @srcdir@
@@ -19,11 +19,33 @@ RANLIB= @RANLIB@
LIB= libnbcompat.a
-INCS= nbcompat.h nbcompat/err.h nbcompat/fnmatch.h nbcompat/fts.h \
- nbcompat/getopt.h nbcompat/glob.h nbcompat/md5.h \
- nbcompat/nbconfig.h nbcompat/nbtypes.h nbcompat/poll.h \
- nbcompat/queue.h nbcompat/rmd160.h nbcompat/sha1.h \
- nbcompat/statvfs.h nbcompat/vis.h
+INCS= nbcompat.h \
+ nbcompat/err.h \
+ nbcompat/fnmatch.h \
+ nbcompat/fts.h \
+ nbcompat/getopt.h \
+ nbcompat/glob.h \
+ nbcompat/grp.h \
+ nbcompat/limits.h \
+ nbcompat/md5.h \
+ nbcompat/nbconfig.h \
+ nbcompat/nbtypes.h \
+ nbcompat/paths.h \
+ nbcompat/poll.h \
+ nbcompat/pwd.h \
+ nbcompat/queue.h \
+ nbcompat/rmd160.h \
+ nbcompat/sha1.h \
+ nbcompat/stat.h \
+ nbcompat/statvfs.h \
+ nbcompat/stdio.h \
+ nbcompat/stdlib.h \
+ nbcompat/string.h \
+ nbcompat/time.h \
+ nbcompat/tzfile.h \
+ nbcompat/unistd.h \
+ nbcompat/util.h \
+ nbcompat/vis.h
# always use our local glob() implementation.
OBJS= glob.o @LIBOBJS@
diff --git a/pkgtools/libnbcompat/files/README b/pkgtools/libnbcompat/files/README
index 856449b47b9..fd25198cfc1 100644
--- a/pkgtools/libnbcompat/files/README
+++ b/pkgtools/libnbcompat/files/README
@@ -1,4 +1,4 @@
-$NetBSD: README,v 1.1 2004/08/06 16:55:09 jlam Exp $
+$NetBSD: README,v 1.2 2004/08/10 18:47:55 jlam Exp $
0 Introduction
==============
@@ -43,16 +43,19 @@ breakage seep in. Proper methodology for updating this package is:
*NOTE* the most recent libnbcompat.
*NOTE*
-libnbcompat-20040805 has been tested to build and install correctly
+libnbcompat-20040809 has been tested to build and install correctly
on the following operating systems:
FreeBSD-4.8/i386 <jlam@NetBSD.org>
- IRIX 6.5 <jschauma@NetBSD.org>
+ FreeBSD-5.2.1/i386 <seb@NetBSD.org>
+ IRIX 6.5 <schmonz@NetBSD.org>
MacOS X 10.3.4 <schmonz@NetBSD.org>
+ MacOS X 10.3.5 <masahiro@wide.ad.jp>
NetBSD-1.6.2/i386 <jlam@NetBSD.org>
- NetBSD-2.0_BETA/i386 <hubertf@NetBSD.org>
- Red Hat Linux 7.3 <schmonz@NetBSD.org>
- Solaris 9/sparc <salo@NetBSD.org>
+ NetBSD-2.0_BETA/i386 <wiz@NetBSD.org>
+ Red Hat Linux 8.0 <cube@NetBSD.org>
+ Solaris 8 <sketch@NetBSD.org>
+ Solaris 9 <sketch@NetBSD.org>
3 Usage
diff --git a/pkgtools/libnbcompat/files/configure b/pkgtools/libnbcompat/files/configure
index 479d707db94..45998e64d61 100755
--- a/pkgtools/libnbcompat/files/configure
+++ b/pkgtools/libnbcompat/files/configure
@@ -3252,6 +3252,155 @@ done
+for ac_header in inttypes.h sys/types.h sys/bitypes.h bind/bitypes.h \
+ netinet/in6_machtypes.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------- ##
+## Report this to grant@NetBSD.org ##
+## ------------------------------- ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
@@ -3295,16 +3444,15 @@ done
-for ac_header in arpa/nameser.h assert.h bind/bitypes.h dirent.h err.h \
- errno.h fcntl.h fnmatch.h fts.h inttypes.h libutil.h limits.h \
- machine/endian.h memory.h ndir.h netdb.h netinet/in6_machtypes.h \
- paths.h pwd.h stdint.h stdlib.h stringlist.h strings.h \
- string.h sys/bitypes.h sys/byteorder.h sys/cdefs.h sys/dir.h \
- sys/endian.h sys/file.h sys/mkdev.h sys/ndir.h \
- sys/param.h sys/time.h sys/ttycom.h \
- sys/stat.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/types.h \
- sys/vfs.h termcap.h termios.h time.h tzfile.h unistd.h util.h \
- utmp.h
+
+
+for ac_header in assert.h dirent.h err.h errno.h fcntl.h fnmatch.h fts.h \
+ grp.h libutil.h limits.h machine/endian.h memory.h ndir.h paths.h \
+ pwd.h stdint.h stdio.h stdlib.h stringlist.h strings.h string.h \
+ sys/byteorder.h sys/cdefs.h sys/dir.h sys/endian.h sys/file.h \
+ sys/mkdev.h sys/ndir.h sys/param.h sys/time.h sys/ttycom.h \
+ sys/stat.h sys/statfs.h sys/statvfs.h sys/types.h sys/vfs.h \
+ termcap.h termios.h time.h tzfile.h unistd.h util.h utmp.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -4805,6 +4953,7 @@ fi
done
+pkg_use_nbcompat_vis=yes
for ac_header in vis.h
do
@@ -5224,7 +5373,7 @@ done
else
- pkg_use_nbcompat_vis=yes
+
:
fi
@@ -7871,9 +8020,12 @@ done
-for ac_func in err fgetln fnmatch fparseln getenv \
- isblank lchflags lchmod lchown lutimes mkstemp mkdtemp \
- setprogname snprintf strdup strerror strlcat strlcpy \
+
+
+
+for ac_func in err fgetln fnmatch fparseln getenv isblank lchflags \
+ lchmod lchown lutimes mkstemp mkdtemp setgroupent setpassent \
+ setprogname snprintf statvfs strdup strerror strlcat strlcpy \
strmode strsep strtoll usleep utimes
do
@@ -7991,111 +8143,6 @@ done
-for ac_func in setgroupent setgrent setpassent setpwent
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-
-
-
for ac_func in bcopy bzero memset memcpy setlocale
do
@@ -9597,115 +9644,7 @@ fi
fi
-echo "$as_me:$LINENO: checking for statvfs" >&5
-echo $ECHO_N "checking for statvfs... $ECHO_C" >&6
-if test "${ac_cv_func_statvfs+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define statvfs to an innocuous variant, in case <limits.h> declares statvfs.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define statvfs innocuous_statvfs
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char statvfs (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef statvfs
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char statvfs ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_statvfs) || defined (__stub___statvfs)
-choke me
-#else
-char (*f) () = statvfs;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != statvfs;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_statvfs=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_func_statvfs=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_statvfs" >&5
-echo "${ECHO_T}$ac_cv_func_statvfs" >&6
-if test $ac_cv_func_statvfs = yes; then
- :
-else
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_NBCOMPAT_STATVFS 1
-_ACEOF
-
-
-
- case $LIBOBJS in
- "statvfs.$ac_objext" | \
- *" statvfs.$ac_objext" | \
- "statvfs.$ac_objext "* | \
- *" statvfs.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS statvfs.$ac_objext" ;;
-esac
-
- echo "$as_me:$LINENO: checking for struct statfs.f_fsize" >&5
+echo "$as_me:$LINENO: checking for struct statfs.f_fsize" >&5
echo $ECHO_N "checking for struct statfs.f_fsize... $ECHO_C" >&6
if test "${ac_cv_member_struct_statfs_f_fsize+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9819,7 +9758,7 @@ else
:
fi
- echo "$as_me:$LINENO: checking for struct statfs.f_iosize" >&5
+echo "$as_me:$LINENO: checking for struct statfs.f_iosize" >&5
echo $ECHO_N "checking for struct statfs.f_iosize... $ECHO_C" >&6
if test "${ac_cv_member_struct_statfs_f_iosize+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9934,9 +9873,6 @@ else
fi
-fi
-
-
if test $ac_cv_type_long_long = yes; then
diff --git a/pkgtools/libnbcompat/files/configure.ac b/pkgtools/libnbcompat/files/configure.ac
index 3edb5c257bd..ca8492d2433 100644
--- a/pkgtools/libnbcompat/files/configure.ac
+++ b/pkgtools/libnbcompat/files/configure.ac
@@ -1,4 +1,4 @@
-dnl $NetBSD: configure.ac,v 1.44 2004/08/06 16:55:09 jlam Exp $
+dnl $NetBSD: configure.ac,v 1.45 2004/08/10 18:47:55 jlam Exp $
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.52)
@@ -32,16 +32,17 @@ dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_TIME
-AC_CHECK_HEADERS([arpa/nameser.h assert.h bind/bitypes.h dirent.h err.h \
- errno.h fcntl.h fnmatch.h fts.h inttypes.h libutil.h limits.h \
- machine/endian.h memory.h ndir.h netdb.h netinet/in6_machtypes.h \
- paths.h pwd.h stdint.h stdlib.h stringlist.h strings.h \
- string.h sys/bitypes.h sys/byteorder.h sys/cdefs.h sys/dir.h \
- sys/endian.h sys/file.h sys/mkdev.h sys/ndir.h \
- sys/param.h sys/time.h sys/ttycom.h \
- sys/stat.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/types.h \
- sys/vfs.h termcap.h termios.h time.h tzfile.h unistd.h util.h \
- utmp.h
+dnl Used by bits.c to check for sizes of integer types
+AC_CHECK_HEADERS([inttypes.h sys/types.h sys/bitypes.h bind/bitypes.h \
+ netinet/in6_machtypes.h])
+
+AC_CHECK_HEADERS([assert.h dirent.h err.h errno.h fcntl.h fnmatch.h fts.h \
+ grp.h libutil.h limits.h machine/endian.h memory.h ndir.h paths.h \
+ pwd.h stdint.h stdio.h stdlib.h stringlist.h strings.h string.h \
+ sys/byteorder.h sys/cdefs.h sys/dir.h sys/endian.h sys/file.h \
+ sys/mkdev.h sys/ndir.h sys/param.h sys/time.h sys/ttycom.h \
+ sys/stat.h sys/statfs.h sys/statvfs.h sys/types.h sys/vfs.h \
+ termcap.h termios.h time.h tzfile.h unistd.h util.h utmp.h
])
AC_CHECK_HEADERS([sys/mount.h], [:], [:], [
AC_INCLUDES_DEFAULT
@@ -126,6 +127,7 @@ dnl Check that this vis.h has *vis()-related functions because Solaris'
dnl vis.h doesn't. Also, only consider the header found if it defines
dnl all of the functions that we need.
dnl
+pkg_use_nbcompat_vis=yes
AC_CHECK_HEADERS([vis.h], [
AC_MSG_TRY_COMPILE([for VIS_WHITE in vis.h], pkg_cv_have_vis_white, [
#include <sys/types.h>
@@ -135,7 +137,7 @@ AC_CHECK_HEADERS([vis.h], [
AC_CHECK_FUNCS([strunvis strvis strsvis],
[pkg_use_nbcompat_vis=no],
[pkg_use_nbcompat_vis=yes; break])
- ], [pkg_use_nbcompat_vis=yes])
+ ])
])
if test $pkg_use_nbcompat_vis = yes; then
@@ -185,13 +187,12 @@ AC_FUNC_MALLOC
AC_FUNC_STRERROR_R
AC_FUNC_VPRINTF
-AC_REPLACE_FUNCS([err fgetln fnmatch fparseln getenv \
- isblank lchflags lchmod lchown lutimes mkstemp mkdtemp \
- setprogname snprintf strdup strerror strlcat strlcpy \
+AC_REPLACE_FUNCS([err fgetln fnmatch fparseln getenv isblank lchflags \
+ lchmod lchown lutimes mkstemp mkdtemp setgroupent setpassent \
+ setprogname snprintf statvfs strdup strerror strlcat strlcpy \
strmode strsep strtoll usleep utimes
])
-AC_CHECK_FUNCS([setgroupent setgrent setpassent setpwent])
AC_CHECK_FUNCS([bcopy bzero memset memcpy setlocale])
AC_CHECK_FUNCS([getmode setmode])
AC_CHECK_FUNCS([getmode setmode], [:], [
@@ -271,17 +272,10 @@ AC_CHECK_FUNCS([getpassphrase getpgrp memmove select])
AC_CHECK_FUNC(getpgrp, [AC_FUNC_GETPGRP])
-AC_CHECK_FUNC(statvfs, [:], [
- AC_DEFINE(HAVE_NBCOMPAT_STATVFS, 1)
- AH_TEMPLATE([HAVE_NBCOMPAT_STATVFS], [
- Define to 1 if the `statvfs' function is built into the library.
- ])
- AC_LIBOBJ(statvfs)
- AC_CHECK_MEMBERS([struct statfs.f_fsize], [:], [:],
- [ #include <sys/statfs.h> ])
- AC_CHECK_MEMBERS([struct statfs.f_iosize], [:], [:],
- [ #include <sys/statfs.h> ])
-])
+AC_CHECK_MEMBERS([struct statfs.f_fsize], [:], [:],
+ [ #include <sys/statfs.h> ])
+AC_CHECK_MEMBERS([struct statfs.f_iosize], [:], [:],
+ [ #include <sys/statfs.h> ])
if test $ac_cv_type_long_long = yes; then
diff --git a/pkgtools/libnbcompat/files/nbcompat.h b/pkgtools/libnbcompat/files/nbcompat.h
index a766af48afe..8bdad20bc46 100644
--- a/pkgtools/libnbcompat/files/nbcompat.h
+++ b/pkgtools/libnbcompat/files/nbcompat.h
@@ -1,4 +1,4 @@
-/* $NetBSD: nbcompat.h,v 1.35 2004/08/06 16:55:09 jlam Exp $ */
+/* $NetBSD: nbcompat.h,v 1.36 2004/08/10 18:47:55 jlam Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -41,36 +41,33 @@
#include <sys/types.h>
#include <sys/param.h>
-#include <sys/ioctl.h>
#include <sys/socket.h>
-#include <sys/stat.h>
#include <sys/wait.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
-#include <limits.h>
-#include <netdb.h>
-#include <pwd.h>
#include <setjmp.h>
#include <signal.h>
#include <stdarg.h>
#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <termios.h>
-#include <unistd.h>
-/* Augment <sys/queue.h> with any needed macros that are missing. */
-#if HAVE_SYS_QUEUE_H
-# include <sys/queue.h>
-#endif
+#include <nbcompat/fnmatch.h>
+#include <nbcompat/grp.h>
+#include <nbcompat/limits.h>
+#include <nbcompat/paths.h>
+#include <nbcompat/pwd.h>
#include <nbcompat/queue.h>
+#include <nbcompat/stat.h>
+#include <nbcompat/statvfs.h>
+#include <nbcompat/stdlib.h>
+#include <nbcompat/stdio.h>
+#include <nbcompat/string.h>
+#include <nbcompat/time.h>
+#include <nbcompat/tzfile.h>
+#include <nbcompat/unistd.h>
+#include <nbcompat/util.h>
#if !HAVE_POLL
# undef HAVE_POLL_H
@@ -100,17 +97,6 @@
# include <nbcompat/fts.h>
#endif
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
#if HAVE_ASSERT_H
# include <assert.h>
#endif
@@ -135,24 +121,6 @@
# endif
#endif
-#if HAVE_PATHS_H
-# include <paths.h>
-#endif
-#ifndef _PATH_BSHELL
-#define _PATH_BSHELL "/bin/sh"
-#endif
-#ifndef _PATH_TMP
-#define _PATH_TMP "/tmp/"
-#endif
-
-#ifndef _PATH_DEFTAPE
-# ifdef DEFTAPE
-# define _PATH_DEFTAPE DEFTAPE
-# else
-# define _PATH_DEFTAPE "/dev/tape"
-# endif /* DEFTAPE */
-#endif /* _PATH_DEFTAPE */
-
#if HAVE_TERMCAP_H
# include <termcap.h>
#else
@@ -164,51 +132,6 @@ char *tgoto(const char *, int, int);
void tputs(const char *, int, int (*)(int));
#endif
-/* not all systems define all of these in tzfile.h */
-#if HAVE_TZFILE_H
-# include <tzfile.h>
-#endif
-
-#ifndef DAYSPERNYEAR
-# define DAYSPERNYEAR 365
-#endif
-
-#ifndef EPOCH_YEAR
-# define EPOCH_YEAR 1970
-#endif
-
-#ifndef HOURSPERDAY
-# define HOURSPERDAY 24
-#endif
-
-#ifndef MINSPERHOUR
-# define MINSPERHOUR 60
-#endif
-
-#ifndef SECSPERHOUR
-# define SECSPERHOUR 3600
-#endif
-
-#ifndef SECSPERMIN
-# define SECSPERMIN 60
-#endif
-
-#ifndef SECSPERDAY
-# define SECSPERDAY 86400
-#endif
-
-#ifndef TM_YEAR_BASE
-# define TM_YEAR_BASE 1900
-#endif
-
-#if HAVE_UTIL_H
-# include <util.h>
-#endif
-
-#if HAVE_LIBUTIL_H
-# include <libutil.h>
-#endif
-
#if HAVE_NBCOMPAT_MD5INIT
# if HAVE_MD5_H
# undef HAVE_MD5_H
@@ -250,169 +173,14 @@ void tputs(const char *, int, int (*)(int));
# include <nbcompat/getopt.h>
#endif
-#if !HAVE_OPTARG_D
-extern char *optarg;
-#endif
-
-#if !HAVE_OPTIND_D
-extern int optind;
-#endif
-
#if !HAVE_D_NAMLEN
# define DIRENT_MISSING_D_NAMLEN
#endif
-#if !HAVE_H_ERRNO_D
-#ifndef _AIX
-extern int h_errno;
-#endif
-#endif
-#define HAVE_H_ERRNO 1 /* XXX: an assumption for now... */
-
-#if !HAVE_FCLOSE_D
-int fclose(FILE *);
-#endif
-
#if !HAVE_ISBLANK
int isblank(int);
#endif
-#if !HAVE_GETPASS_D
-char *getpass(const char *);
-#endif
-
-#if !HAVE_PCLOSE_D
-int pclose(FILE *);
-#endif
-
-#if !HAVE_FGETLN
-char *fgetln(FILE *, size_t *);
-#endif
-
-#if !HAVE_FPARSELN
-# define FPARSELN_UNESCESC 0x01
-# define FPARSELN_UNESCCONT 0x02
-# define FPARSELN_UNESCCOMM 0x04
-# define FPARSELN_UNESCREST 0x08
-# define FPARSELN_UNESCALL 0x0f
-char *fparseln(FILE *, size_t *, size_t *, const char[3], int);
-#endif
-
-#if !HAVE_MKSTEMP
-int mkstemp(char *);
-#endif
-
-#if !HAVE_MKDTEMP
-char *mkdtemp(char *);
-#endif
-
-#if !HAVE_LCHMOD
-int lchmod(const char *, mode_t);
-#endif
-
-#if !HAVE_LCHOWN
-int lchown(const char *, uid_t, gid_t);
-#endif
-
-#if !HAVE_SETPROGNAME
-const char *getprogname(void);
-void setprogname(const char *);
-#endif
-
-#if !HAVE_SNPRINTF
-int snprintf(char *, size_t, const char *, ...);
-#endif
-
-#if !HAVE_STRDUP
-char *strdup(const char *);
-#endif
-
-#if !HAVE_STRERROR
-char *strerror(int);
-#endif
-
-#if !HAVE_STRMODE
-void strmode(mode_t, char *);
-#endif
-
-#if HAVE_WORKING_LONG_LONG
-# if !defined(HAVE_STRTOLL) && defined(HAVE_LONG_LONG)
-long long strtoll(const char *, char **, int);
-# endif
-# if ! defined(LLONG_MAX)
-# if defined(LONG_LONG_MAX)
-# define LLONG_MAX LONG_LONG_MAX
-# else
-# define LLONG_MAX (0x7fffffffffffffffLL)
-# endif
-# endif
-# if ! defined(LLONG_MIN)
-# if defined(LONG_LONG_MIN)
-# define LLONG_MIN LONG_LONG_MIN
-# else
-# define LLONG_MIN (-0x7fffffffffffffffLL-1)
-# endif
-# endif
-#else /* ! HAVE_WORKING_LONG_LONG */
-# define NO_LONG_LONG 1
-#endif /* ! HAVE_WORKING_LONG_LONG */
-
-#if ! defined(LLONG_MAX)
-# define LLONG_MAX 0x7fffffffffffffffLL /* max long long */
-#endif
-
-#if ! defined(ULLONG_MAX)
-# define ULLONG_MAX 0xffffffffffffffffULL /* max unsigned long long */
-#endif
-
-#if !HAVE_HSTRERROR
-char *strerror(int);
-#endif
-
-#if !HAVE_STRLCAT
-size_t strlcat(char *, const char *, size_t);
-#endif
-
-#if !HAVE_STRLCPY
-size_t strlcpy(char *, const char *, size_t);
-#endif
-
-#if !HAVE_STRSEP
-char *strsep(char **stringp, const char *delim);
-#endif
-
-#if !HAVE_USER_FROM_UID
-const char *user_from_uid(uid_t, int);
-#endif
-
-#if !HAVE_GROUP_FROM_GID
-const char *group_from_gid(gid_t, int);
-#endif
-
-#if !HAVE_UID_FROM_USER
-int uid_from_user(const char *, uid_t *);
-#endif
-
-#if !HAVE_GID_FROM_GROUP
-int gid_from_group(const char *, gid_t *);
-#endif
-
-#if !HAVE_FNMATCH
-# include <nbcompat/fnmatch.h>
-#endif
-
-#if HAVE_NBCOMPAT_STATVFS
-# if HAVE_SYS_STATVFS_H
-# undef HAVE_SYS_STATVFS_H
-# endif
-# include <nbcompat/statvfs.h>
-#endif
-
-#if !HAVE_MEMMOVE
-# define memmove(a,b,c) bcopy((b),(a),(c))
- /* XXX: add others #defines for borken systems? */
-#endif
-
#if HAVE_GETPASSPHRASE
# define getpass getpassphrase
#endif
@@ -424,50 +192,4 @@ int gid_from_group(const char *, gid_t *);
# define MAX(a, b) ((a) < (b) ? (b) : (a))
#endif
-#if !defined(timersub)
-# define timersub(tvp, uvp, vvp) \
- do { \
- (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
- (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
- if ((vvp)->tv_usec < 0) { \
- (vvp)->tv_sec--; \
- (vvp)->tv_usec += 1000000; \
- } \
- } while (0)
-#endif
-
-/* not all systems define all of these in sys/stat.h */
-#if !defined(S_ISLNK)
-# define S_ISLNK(m) ((m & S_IFMT) == S_IFLNK)
-#endif
-
-#if !defined(S_ISTXT)
-# define S_ISTXT S_ISVTX
-#endif
-
-#if !defined(ALLPERMS)
-# define ALLPERMS (S_ISUID|S_ISGID|S_ISTXT|S_IRWXU|S_IRWXG|S_IRWXO)
-#endif
-
-/* not all systems define all of these in limits.h */
-#ifndef GID_MAX
-# define GID_MAX 2147483647U /* max value for a gid_t (2^31-2) */
-#endif
-
-#ifndef UID_MAX
-# define UID_MAX 2147483647U /* max value for a uid_t (2^31-2) */
-#endif
-
-#if !HAVE_SETMODE
-void *setmode(const char *);
-#endif
-
-#if !HAVE_GETMODE
-mode_t getmode(const void *, mode_t);
-#endif
-
-#if !HAVE_UTIMES
-int utimes(const char *, const struct timeval *);
-#endif
-
#endif /* !_NBCOMPAT_H */
diff --git a/pkgtools/libnbcompat/files/nbcompat/config.h.in b/pkgtools/libnbcompat/files/nbcompat/config.h.in
index 01bb248e48e..7836f1d8d76 100644
--- a/pkgtools/libnbcompat/files/nbcompat/config.h.in
+++ b/pkgtools/libnbcompat/files/nbcompat/config.h.in
@@ -3,9 +3,6 @@
/* Define to 1 if the `getpgrp' function requires zero arguments. */
#undef GETPGRP_VOID
-/* Define to 1 if you have the <arpa/nameser.h> header file. */
-#undef HAVE_ARPA_NAMESER_H
-
/* Define to 1 if you have the <assert.h> header file. */
#undef HAVE_ASSERT_H
@@ -82,6 +79,9 @@
/* Define to 1 if you have the `group_from_gid' function. */
#undef HAVE_GROUP_FROM_GID
+/* Define to 1 if you have the <grp.h> header file. */
+#undef HAVE_GRP_H
+
/* Define to 1 if the system has the type `int16_t'. */
#undef HAVE_INT16_T
@@ -179,18 +179,12 @@
/* Define to 1 if the `SHA1*' functions are built into the library. */
#undef HAVE_NBCOMPAT_SHA1
-/* Define to 1 if the `statvfs' function is built into the library. */
-#undef HAVE_NBCOMPAT_STATVFS
-
/* Define to 1 if the `vis' function is built into the library. */
#undef HAVE_NBCOMPAT_VIS
/* Define to 1 if you have the <ndir.h> header file. */
#undef HAVE_NDIR_H
-/* Define to 1 if you have the <netdb.h> header file. */
-#undef HAVE_NETDB_H
-
/* Define to 1 if you have the <netinet/in6_machtypes.h> header file. */
#undef HAVE_NETINET_IN6_MACHTYPES_H
@@ -231,9 +225,6 @@
/* Define to 1 if you have the `setenv' function. */
#undef HAVE_SETENV
-/* Define to 1 if you have the `setgrent' function. */
-#undef HAVE_SETGRENT
-
/* Define to 1 if you have the `setgroupent' function. */
#undef HAVE_SETGROUPENT
@@ -249,18 +240,21 @@
/* Define to 1 if you have the `setprogname' function. */
#undef HAVE_SETPROGNAME
-/* Define to 1 if you have the `setpwent' function. */
-#undef HAVE_SETPWENT
-
/* Define to 1 if you have the <sha1.h> header file. */
#undef HAVE_SHA1_H
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
+/* Define to 1 if you have the `statvfs' function. */
+#undef HAVE_STATVFS
+
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
+/* Define to 1 if you have the <stdio.h> header file. */
+#undef HAVE_STDIO_H
+
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
diff --git a/pkgtools/libnbcompat/files/nbcompat/fnmatch.h b/pkgtools/libnbcompat/files/nbcompat/fnmatch.h
index 30348b5a06c..9a709925f5c 100644
--- a/pkgtools/libnbcompat/files/nbcompat/fnmatch.h
+++ b/pkgtools/libnbcompat/files/nbcompat/fnmatch.h
@@ -1,4 +1,4 @@
-/* $NetBSD: fnmatch.h,v 1.1 2004/08/06 16:55:09 jlam Exp $ */
+/* $NetBSD: fnmatch.h,v 1.2 2004/08/10 18:47:55 jlam Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -34,6 +34,11 @@
#ifndef _NBCOMPAT_FNMATCH_H_
#define _NBCOMPAT_FNMATCH_H_
+#if HAVE_FNMATCH_H
+# include <fnmatch.h>
+#endif
+
+#if !HAVE_FNMATCH
#define FNM_NOMATCH 1 /* Match failed. */
#define FNM_NOSYS 2 /* Function not implemented. */
@@ -44,5 +49,6 @@
#define FNM_LEADING_DIR 0x10 /* Ignore /<tail> after Imatch. */
int fnmatch(const char *, const char *, int);
+#endif
#endif /* !_NBCOMPAT_FNMATCH_H_ */
diff --git a/pkgtools/libnbcompat/files/nbcompat/grp.h b/pkgtools/libnbcompat/files/nbcompat/grp.h
new file mode 100644
index 00000000000..d61be39d7c1
--- /dev/null
+++ b/pkgtools/libnbcompat/files/nbcompat/grp.h
@@ -0,0 +1,62 @@
+/* $NetBSD: grp.h,v 1.1 2004/08/10 18:47:55 jlam Exp $ */
+
+/*-
+ * Copyright (c) 2004 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Johnny C. Lam.
+ *
+ * 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#ifndef _NBCOMPAT_GRP_H_
+#define _NBCOMPAT_GRP_H_
+
+#if HAVE_GRP_H
+# include <grp.h>
+#endif
+
+/*
+ * Declare functions that may be missing in <grp.h>.
+ */
+
+#if !HAVE_SETGROUPENT
+int setgroupent(int);
+#endif
+
+#if !HAVE_GROUP_FROM_GID
+const char *group_from_gid(gid_t, int);
+#endif
+
+#if !HAVE_GID_FROM_GROUP
+int gid_from_group(const char *, gid_t *);
+#endif
+
+#endif /* !_NBCOMPAT_GRP_H_ */
diff --git a/pkgtools/libnbcompat/files/nbcompat/limits.h b/pkgtools/libnbcompat/files/nbcompat/limits.h
new file mode 100644
index 00000000000..51a30f6e1a0
--- /dev/null
+++ b/pkgtools/libnbcompat/files/nbcompat/limits.h
@@ -0,0 +1,76 @@
+/* $NetBSD: limits.h,v 1.1 2004/08/10 18:47:55 jlam Exp $ */
+
+/*-
+ * Copyright (c) 2004 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Johnny C. Lam.
+ *
+ * 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#ifndef _NBCOMPAT_LIMITS_H_
+#define _NBCOMPAT_LIMITS_H_
+
+#if HAVE_LIMITS_H
+# include <limits.h>
+#endif
+
+/*
+ * Declare functions and macros that may be missing in <limits.h>.
+ */
+
+#if !defined(LLONG_MAX)
+# if defined(LONG_LONG_MAX)
+# define LLONG_MAX LONG_LONG_MAX
+# else
+# define LLONG_MAX (0x7fffffffffffffffLL)
+# endif
+#endif
+#if !defined(LLONG_MIN)
+# if defined(LONG_LONG_MIN)
+# define LLONG_MIN LONG_LONG_MIN
+# else
+# define LLONG_MIN (-0x7fffffffffffffffLL-1)
+# endif
+#endif
+#if !defined(ULLONG_MAX)
+# define ULLONG_MAX (0xffffffffffffffffULL) /* max unsigned long long */
+#endif
+
+#ifndef GID_MAX
+# define GID_MAX 2147483647U /* max value for a gid_t (2^31-2) */
+#endif
+
+#ifndef UID_MAX
+# define UID_MAX 2147483647U /* max value for a uid_t (2^31-2) */
+#endif
+
+#endif /* !_NBCOMPAT_LIMITS_H_ */
diff --git a/pkgtools/libnbcompat/files/nbcompat/paths.h b/pkgtools/libnbcompat/files/nbcompat/paths.h
new file mode 100644
index 00000000000..dbadb84f1a8
--- /dev/null
+++ b/pkgtools/libnbcompat/files/nbcompat/paths.h
@@ -0,0 +1,65 @@
+/* $NetBSD: paths.h,v 1.1 2004/08/10 18:47:55 jlam Exp $ */
+
+/*-
+ * Copyright (c) 2004 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Johnny C. Lam.
+ *
+ * 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#ifndef _NBCOMPAT_PATHS_H_
+#define _NBCOMPAT_PATHS_H_
+
+#if HAVE_PATHS_H
+# include <paths.h>
+#endif
+
+/*
+ * Declare functions and macros that may be missing in <paths.h>.
+ */
+
+#ifndef _PATH_BSHELL
+#define _PATH_BSHELL "/bin/sh"
+#endif
+#ifndef _PATH_TMP
+#define _PATH_TMP "/tmp/"
+#endif
+
+#ifndef _PATH_DEFTAPE
+# ifdef DEFTAPE
+# define _PATH_DEFTAPE DEFTAPE
+# else
+# define _PATH_DEFTAPE "/dev/tape"
+# endif /* DEFTAPE */
+#endif /* _PATH_DEFTAPE */
+
+#endif /* !_NBCOMPAT_PATHS_H_ */
diff --git a/pkgtools/libnbcompat/files/nbcompat/pwd.h b/pkgtools/libnbcompat/files/nbcompat/pwd.h
new file mode 100644
index 00000000000..4098a1463c3
--- /dev/null
+++ b/pkgtools/libnbcompat/files/nbcompat/pwd.h
@@ -0,0 +1,62 @@
+/* $NetBSD: pwd.h,v 1.1 2004/08/10 18:47:55 jlam Exp $ */
+
+/*-
+ * Copyright (c) 2004 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Johnny C. Lam.
+ *
+ * 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#ifndef _NBCOMPAT_PWD_H_
+#define _NBCOMPAT_PWD_H_
+
+#if HAVE_PWD_H
+# include <pwd.h>
+#endif
+
+/*
+ * Declare functions that may be missing in <pwd.h>.
+ */
+
+#if !HAVE_SETPASSENT
+int setpassent(int);
+#endif
+
+#if !HAVE_USER_FROM_UID
+const char *user_from_uid(uid_t, int);
+#endif
+
+#if !HAVE_UID_FROM_USER
+int uid_from_user(const char *, uid_t *);
+#endif
+
+#endif /* !_NBCOMPAT_PWD_H_ */
diff --git a/pkgtools/libnbcompat/files/nbcompat/queue.h b/pkgtools/libnbcompat/files/nbcompat/queue.h
index 84873f99236..fbf9411bf4b 100644
--- a/pkgtools/libnbcompat/files/nbcompat/queue.h
+++ b/pkgtools/libnbcompat/files/nbcompat/queue.h
@@ -1,4 +1,4 @@
-/* $NetBSD: queue.h,v 1.1 2004/08/06 16:55:09 jlam Exp $ */
+/* $NetBSD: queue.h,v 1.2 2004/08/10 18:47:55 jlam Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -38,6 +38,14 @@
#ifndef _NBCOMPAT_QUEUE_H
#define _NBCOMPAT_QUEUE_H
+#if HAVE_SYS_QUEUE_H
+# include <sys/queue.h>
+#endif
+
+/*
+ * Provide any macros missing from <sys/queue.h>.
+ */
+
#ifndef LIST_HEAD
#define LIST_HEAD(name, type) \
struct name { \
diff --git a/pkgtools/libnbcompat/files/nbcompat/stat.h b/pkgtools/libnbcompat/files/nbcompat/stat.h
new file mode 100644
index 00000000000..97f2bf07071
--- /dev/null
+++ b/pkgtools/libnbcompat/files/nbcompat/stat.h
@@ -0,0 +1,66 @@
+/* $NetBSD: stat.h,v 1.1 2004/08/10 18:47:55 jlam Exp $ */
+
+/*-
+ * Copyright (c) 2004 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Johnny C. Lam.
+ *
+ * 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#ifndef _NBCOMPAT_STAT_H_
+#define _NBCOMPAT_STAT_H_
+
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+
+/*
+ * Declare functions and macros that may be missing in <sys/stat.h>.
+ */
+
+#if !HAVE_LCHMOD
+int lchmod(const char *, mode_t);
+#endif
+
+#if !defined(S_ISLNK)
+# define S_ISLNK(m) ((m & S_IFMT) == S_IFLNK)
+#endif
+
+#if !defined(S_ISTXT)
+# define S_ISTXT S_ISVTX
+#endif
+
+#if !defined(ALLPERMS)
+# define ALLPERMS (S_ISUID|S_ISGID|S_ISTXT|S_IRWXU|S_IRWXG|S_IRWXO)
+#endif
+
+#endif /* !_NBCOMPAT_STAT_H_ */
diff --git a/pkgtools/libnbcompat/files/nbcompat/statvfs.h b/pkgtools/libnbcompat/files/nbcompat/statvfs.h
index 4fc07412086..0dbc17af20a 100644
--- a/pkgtools/libnbcompat/files/nbcompat/statvfs.h
+++ b/pkgtools/libnbcompat/files/nbcompat/statvfs.h
@@ -1,4 +1,4 @@
-/* $NetBSD: statvfs.h,v 1.1 2004/08/06 16:55:09 jlam Exp $ */
+/* $NetBSD: statvfs.h,v 1.2 2004/08/10 18:47:55 jlam Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -36,8 +36,14 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef _NBCOMPAT_STATVFS_H
-#define _NBCOMPAT_STATVFS_H
+#ifndef _NBCOMPAT_STATVFS_H_
+#define _NBCOMPAT_STATVFS_H_
+
+#if HAVE_SYS_STATVFS_H
+# include <sys/statvfs.h>
+#endif
+
+#if !HAVE_STATVFS
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -124,4 +130,6 @@ struct statvfs {
int statvfs(const char *path, struct statvfs *vfs);
int fstatvfs(int fd, struct statvfs *vfs);
-#endif /* !_NBCOMPAT_STATVFS_H */
+#endif /* !HAVE_STATVFS */
+
+#endif /* !_NBCOMPAT_STATVFS_H_ */
diff --git a/pkgtools/libnbcompat/files/nbcompat/stdio.h b/pkgtools/libnbcompat/files/nbcompat/stdio.h
new file mode 100644
index 00000000000..60d3c0bf7a2
--- /dev/null
+++ b/pkgtools/libnbcompat/files/nbcompat/stdio.h
@@ -0,0 +1,66 @@
+/* $NetBSD: stdio.h,v 1.1 2004/08/10 18:47:55 jlam Exp $ */
+
+/*-
+ * Copyright (c) 2004 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Johnny C. Lam.
+ *
+ * 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#ifndef _NBCOMPAT_STDIO_H_
+#define _NBCOMPAT_STDIO_H_
+
+#if HAVE_STDIO_H
+# include <stdio.h>
+#endif
+
+/*
+ * Declare functions and macros that may be missing in <stdio.h>.
+ */
+
+#if !HAVE_FCLOSE_D
+int fclose(FILE *);
+#endif
+
+#if !HAVE_PCLOSE_D
+int pclose(FILE *);
+#endif
+
+#if !HAVE_FGETLN
+char *fgetln(FILE *, size_t *);
+#endif
+
+#if !HAVE_SNPRINTF
+int snprintf(char *, size_t, const char *, ...);
+#endif
+
+#endif /* !_NBCOMPAT_STDIO_H_ */
diff --git a/pkgtools/libnbcompat/files/nbcompat/stdlib.h b/pkgtools/libnbcompat/files/nbcompat/stdlib.h
new file mode 100644
index 00000000000..d57623bc430
--- /dev/null
+++ b/pkgtools/libnbcompat/files/nbcompat/stdlib.h
@@ -0,0 +1,71 @@
+/* $NetBSD: stdlib.h,v 1.1 2004/08/10 18:47:55 jlam Exp $ */
+
+/*-
+ * Copyright (c) 2004 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Johnny C. Lam.
+ *
+ * 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#ifndef _NBCOMPAT_STDLIB_H_
+#define _NBCOMPAT_STDLIB_H_
+
+#if HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
+/*
+ * Declare functions and macros that may be missing in <stdlib.h>.
+ */
+
+#if !HAVE_MKSTEMP
+int mkstemp(char *);
+#endif
+
+#if !HAVE_MKDTEMP
+char *mkdtemp(char *);
+#endif
+
+#if !HAVE_SETPROGNAME
+const char *getprogname(void);
+void setprogname(const char *);
+#endif
+
+#if HAVE_WORKING_LONG_LONG
+# if !defined(HAVE_STRTOLL) && defined(HAVE_LONG_LONG)
+long long strtoll(const char *, char **, int);
+# endif
+#else
+# define NO_LONG_LONG 1
+#endif /* ! HAVE_WORKING_LONG_LONG */
+
+#endif /* !_NBCOMPAT_STDLIB_H_ */
diff --git a/pkgtools/libnbcompat/files/nbcompat/string.h b/pkgtools/libnbcompat/files/nbcompat/string.h
new file mode 100644
index 00000000000..09741c9aba4
--- /dev/null
+++ b/pkgtools/libnbcompat/files/nbcompat/string.h
@@ -0,0 +1,74 @@
+/* $NetBSD: string.h,v 1.1 2004/08/10 18:47:55 jlam Exp $ */
+
+/*-
+ * Copyright (c) 2004 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Johnny C. Lam.
+ *
+ * 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#ifndef _NBCOMPAT_STRING_H_
+#define _NBCOMPAT_STRING_H_
+
+#if HAVE_STRING_H
+# include <string.h>
+#endif
+
+/*
+ * Declare functions and macros that may be missing in <string.h>.
+ */
+
+#if !HAVE_MEMMOVE
+# define memmove(a,b,c) bcopy((b),(a),(c))
+#endif
+
+#if !HAVE_STRDUP
+char *strdup(const char *);
+#endif
+
+#if !HAVE_STRERROR
+char *strerror(int);
+#endif
+
+#if !HAVE_STRLCAT
+size_t strlcat(char *, const char *, size_t);
+#endif
+
+#if !HAVE_STRLCPY
+size_t strlcpy(char *, const char *, size_t);
+#endif
+
+#if !HAVE_STRSEP
+char *strsep(char **stringp, const char *delim);
+#endif
+
+#endif /* !_NBCOMPAT_STRING_H_ */
diff --git a/pkgtools/libnbcompat/files/nbcompat/time.h b/pkgtools/libnbcompat/files/nbcompat/time.h
new file mode 100644
index 00000000000..ffd7e8d65af
--- /dev/null
+++ b/pkgtools/libnbcompat/files/nbcompat/time.h
@@ -0,0 +1,74 @@
+/* $NetBSD: time.h,v 1.1 2004/08/10 18:47:55 jlam Exp $ */
+
+/*-
+ * Copyright (c) 2004 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Johnny C. Lam.
+ *
+ * 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#ifndef _NBCOMPAT_TIME_H_
+#define _NBCOMPAT_TIME_H_
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+/*
+ * Declare functions and macros that may be missing in <time.h> or
+ * <sys/time.h>.
+ */
+
+#if !defined(timersub)
+# define timersub(tvp, uvp, vvp) \
+ do { \
+ (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
+ (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
+ if ((vvp)->tv_usec < 0) { \
+ (vvp)->tv_sec--; \
+ (vvp)->tv_usec += 1000000; \
+ } \
+ } while (0)
+#endif
+
+#if !HAVE_UTIMES
+int utimes(const char *, const struct timeval *);
+#endif
+
+#endif /* !_NBCOMPAT_TIME_H_ */
diff --git a/pkgtools/libnbcompat/files/nbcompat/tzfile.h b/pkgtools/libnbcompat/files/nbcompat/tzfile.h
new file mode 100644
index 00000000000..324e4786369
--- /dev/null
+++ b/pkgtools/libnbcompat/files/nbcompat/tzfile.h
@@ -0,0 +1,82 @@
+/* $NetBSD: tzfile.h,v 1.1 2004/08/10 18:47:55 jlam Exp $ */
+
+/*-
+ * Copyright (c) 2004 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Johnny C. Lam.
+ *
+ * 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#ifndef _NBCOMPAT_TZFILE_H_
+#define _NBCOMPAT_TZFILE_H_
+
+#if HAVE_TZFILE_H
+# include <tzfile.h>
+#endif
+
+/*
+ * Declare functions and macros that may be missing in <tzfile.h>.
+ */
+
+#ifndef DAYSPERNYEAR
+# define DAYSPERNYEAR 365
+#endif
+
+#ifndef EPOCH_YEAR
+# define EPOCH_YEAR 1970
+#endif
+
+#ifndef HOURSPERDAY
+# define HOURSPERDAY 24
+#endif
+
+#ifndef MINSPERHOUR
+# define MINSPERHOUR 60
+#endif
+
+#ifndef SECSPERHOUR
+# define SECSPERHOUR 3600
+#endif
+
+#ifndef SECSPERMIN
+# define SECSPERMIN 60
+#endif
+
+#ifndef SECSPERDAY
+# define SECSPERDAY 86400
+#endif
+
+#ifndef TM_YEAR_BASE
+# define TM_YEAR_BASE 1900
+#endif
+
+#endif /* !_NBCOMPAT_TZFILE_H_ */
diff --git a/pkgtools/libnbcompat/files/nbcompat/unistd.h b/pkgtools/libnbcompat/files/nbcompat/unistd.h
new file mode 100644
index 00000000000..288120febb7
--- /dev/null
+++ b/pkgtools/libnbcompat/files/nbcompat/unistd.h
@@ -0,0 +1,78 @@
+/* $NetBSD: unistd.h,v 1.1 2004/08/10 18:47:55 jlam Exp $ */
+
+/*-
+ * Copyright (c) 2004 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Johnny C. Lam.
+ *
+ * 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#ifndef _NBCOMPAT_UNISTD_H_
+#define _NBCOMPAT_UNISTD_H_
+
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+/*
+ * Declare functions and macros that may be missing in <unistd.h>.
+ */
+
+#if !HAVE_OPTARG_D
+extern char *optarg;
+#endif
+
+#if !HAVE_OPTIND_D
+extern int optind;
+#endif
+
+#if !HAVE_GETPASS_D
+char *getpass(const char *);
+#endif
+
+#if !HAVE_LCHOWN
+int lchown(const char *, uid_t, gid_t);
+#endif
+
+#if !HAVE_GETMODE
+mode_t getmode(const void *, mode_t);
+#endif
+
+#if !HAVE_SETMODE
+void *setmode(const char *);
+#endif
+
+#if !HAVE_STRMODE
+void strmode(mode_t, char *);
+#endif
+
+#endif /* !_NBCOMPAT_UNISTD_H_ */
diff --git a/pkgtools/libnbcompat/files/nbcompat/util.h b/pkgtools/libnbcompat/files/nbcompat/util.h
new file mode 100644
index 00000000000..88346be6214
--- /dev/null
+++ b/pkgtools/libnbcompat/files/nbcompat/util.h
@@ -0,0 +1,64 @@
+/* $NetBSD: util.h,v 1.1 2004/08/10 18:47:55 jlam Exp $ */
+
+/*-
+ * Copyright (c) 2004 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Johnny C. Lam.
+ *
+ * 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#ifndef _NBCOMPAT_UTIL_H_
+#define _NBCOMPAT_UTIL_H_
+
+#if HAVE_UTIL_H
+# include <util.h>
+#endif
+#if HAVE_LIBUTIL_H
+# include <libutil.h>
+#endif
+
+/*
+ * Declare functions and macros that may be missing in <util.h> or
+ * <libutil.h>.
+ */
+
+#if !HAVE_FPARSELN
+#define FPARSELN_UNESCESC 0x01
+#define FPARSELN_UNESCCONT 0x02
+#define FPARSELN_UNESCCOMM 0x04
+#define FPARSELN_UNESCREST 0x08
+#define FPARSELN_UNESCALL 0x0f
+
+char *fparseln(FILE *, size_t *, size_t *, const char[3], int);
+#endif
+
+#endif /* !_NBCOMPAT_UTIL_H_ */
diff --git a/pkgtools/libnbcompat/files/pwcache.c b/pkgtools/libnbcompat/files/pwcache.c
index 0d2dec162c9..7151dea3a88 100644
--- a/pkgtools/libnbcompat/files/pwcache.c
+++ b/pkgtools/libnbcompat/files/pwcache.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pwcache.c,v 1.5 2004/03/12 15:21:13 grant Exp $ */
+/* $NetBSD: pwcache.c,v 1.6 2004/08/10 18:47:55 jlam Exp $ */
/*-
* Copyright (c) 1992 Keith Muller.
@@ -78,7 +78,7 @@
#if 0
static char sccsid[] = "@(#)cache.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: pwcache.c,v 1.5 2004/03/12 15:21:13 grant Exp $");
+__RCSID("$NetBSD: pwcache.c,v 1.6 2004/08/10 18:47:55 jlam Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -86,8 +86,8 @@ __RCSID("$NetBSD: pwcache.c,v 1.5 2004/03/12 15:21:13 grant Exp $");
#include <sys/param.h>
#include <assert.h>
-#include <grp.h>
-#include <pwd.h>
+#include <nbcompat/grp.h>
+#include <nbcompat/pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -122,25 +122,11 @@ __weak_alias(pwcache_groupdb,_pwcache_groupdb)
* function pointers to various name lookup routines.
* these may be changed as necessary.
*/
-static int (*_pwcache_setgroupent)(int) =
-#if HAVE_SETGROUPENT
- setgroupent;
-#elif HAVE_SETGRENT
- setgrent;
-#else
- NULL
-#endif
+static int (*_pwcache_setgroupent)(int) = setgroupent;
static void (*_pwcache_endgrent)(void) = endgrent;
static struct group * (*_pwcache_getgrnam)(const char *) = getgrnam;
static struct group * (*_pwcache_getgrgid)(gid_t) = getgrgid;
-static int (*_pwcache_setpassent)(int) =
-#if HAVE_SETPASSENT
- setpassent;
-#elif HAVE_SETGRENT
- setpwent;
-#else
- NULL
-#endif
+static int (*_pwcache_setpassent)(int) = setpassent;
static void (*_pwcache_endpwent)(void) = endpwent;
static struct passwd * (*_pwcache_getpwnam)(const char *) = getpwnam;
static struct passwd * (*_pwcache_getpwuid)(uid_t) = getpwuid;
diff --git a/pkgtools/libnbcompat/files/setgroupent.c b/pkgtools/libnbcompat/files/setgroupent.c
new file mode 100644
index 00000000000..7131a3e6c44
--- /dev/null
+++ b/pkgtools/libnbcompat/files/setgroupent.c
@@ -0,0 +1,54 @@
+/* $NetBSD: setgroupent.c,v 1.1 2004/08/10 18:47:55 jlam Exp $ */
+
+/*-
+ * Copyright (c) 2004 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Johnny C. Lam.
+ *
+ * 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#include "nbcompat/nbconfig.h"
+
+#if HAVE_GRP_H
+#include <grp.h>
+#endif
+
+#include "nbcompat/grp.h"
+
+int
+setgroupent(int stayopen)
+{
+#if HAVE_SETGRENT
+ setgrent();
+#endif
+ return 1;
+}
diff --git a/pkgtools/libnbcompat/files/setpassent.c b/pkgtools/libnbcompat/files/setpassent.c
new file mode 100644
index 00000000000..4897e675495
--- /dev/null
+++ b/pkgtools/libnbcompat/files/setpassent.c
@@ -0,0 +1,54 @@
+/* $NetBSD: setpassent.c,v 1.1 2004/08/10 18:47:55 jlam Exp $ */
+
+/*-
+ * Copyright (c) 2004 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Johnny C. Lam.
+ *
+ * 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#include "nbcompat/nbconfig.h"
+
+#if HAVE_PWD_H
+#include <pwd.h>
+#endif
+
+#include "nbcompat/pwd.h"
+
+int
+setpassent(int stayopen)
+{
+#if HAVE_SETPWENT
+ setpwent();
+#endif
+ return 1;
+}