CVS commit: src/tools/compat
Module Name:src Committed By: cjep Date: Sun Jul 11 06:15:42 UTC 2021 Modified Files: src/tools/compat: README Log Message: Final note on OpenBSD cross-buildling. Remaining issues were due to default limits on the build host. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/tools/compat/README Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/README diff -u src/tools/compat/README:1.20 src/tools/compat/README:1.21 --- src/tools/compat/README:1.20 Sun Jul 4 12:57:48 2021 +++ src/tools/compat/README Sun Jul 11 06:15:42 2021 @@ -1,4 +1,4 @@ -$NetBSD: README,v 1.20 2021/07/04 12:57:48 cjep Exp $ +$NetBSD: README,v 1.21 2021/07/11 06:15:42 cjep Exp $ Special notes for cross-hosting a NetBSD build on certain platforms. Only those platforms which have been tested to complete a "build.sh" run @@ -65,14 +65,17 @@ OpenBSD --- As of -current 20210629, ./build.sh will build src on OpenBSD 6.9 -for all targets except MIPS-based ones. +for all platforms. -For builds requiring the LLVM RT library (including X on amd64, -i386 and evbarm64-el), the build user's limits needs to be setup -for higher memory usage, otherwise the build will fail. This can -be achieved by either building as root (not recommended) or -by changing the datasize attribute to infinity for the relevant -groups and users in /etc/login.conf. +Due to the default limits placed on user accounts, the host may experience +memory exhaustion on builds requiring the LLVM RT library (including +X on amd64, i386 and evbarm64-el) and for MIPS targets. + +This can be avoided by building as root (not ideal) or by asking your +administrator to increase your limits in login.conf. These two variables +seem to be sufficient: +:datasize=infinity:\ +:stacksize-cur=8M:\ NetBSD (earlier releases) -
CVS commit: src/tools/compat
Module Name:src Committed By: cjep Date: Sun Jul 4 12:57:48 UTC 2021 Modified Files: src/tools/compat: README Log Message: LLVM RT library will actually cross-build from OpenBSD provided sufficient limits are in place for the build user. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/tools/compat/README Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/README diff -u src/tools/compat/README:1.19 src/tools/compat/README:1.20 --- src/tools/compat/README:1.19 Tue Jun 29 10:02:34 2021 +++ src/tools/compat/README Sun Jul 4 12:57:48 2021 @@ -1,4 +1,4 @@ -$NetBSD: README,v 1.19 2021/06/29 10:02:34 cjep Exp $ +$NetBSD: README,v 1.20 2021/07/04 12:57:48 cjep Exp $ Special notes for cross-hosting a NetBSD build on certain platforms. Only those platforms which have been tested to complete a "build.sh" run @@ -65,10 +65,14 @@ OpenBSD --- As of -current 20210629, ./build.sh will build src on OpenBSD 6.9 -for some platforms. Known problems: -* MIPS targets do not currently build. -* The LLVM RT library will not build and consequently nor will X on - amd64 and i386. +for all targets except MIPS-based ones. + +For builds requiring the LLVM RT library (including X on amd64, +i386 and evbarm64-el), the build user's limits needs to be setup +for higher memory usage, otherwise the build will fail. This can +be achieved by either building as root (not recommended) or +by changing the datasize attribute to infinity for the relevant +groups and users in /etc/login.conf. NetBSD (earlier releases) -
CVS commit: src/tools/compat
Module Name:src Committed By: cjep Date: Tue Jun 29 10:02:34 UTC 2021 Modified Files: src/tools/compat: README Log Message: Note OpenBSD cross-build progress To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/tools/compat/README Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/README diff -u src/tools/compat/README:1.18 src/tools/compat/README:1.19 --- src/tools/compat/README:1.18 Mon Jun 28 07:18:01 2021 +++ src/tools/compat/README Tue Jun 29 10:02:34 2021 @@ -1,4 +1,4 @@ -$NetBSD: README,v 1.18 2021/06/28 07:18:01 cjep Exp $ +$NetBSD: README,v 1.19 2021/06/29 10:02:34 cjep Exp $ Special notes for cross-hosting a NetBSD build on certain platforms. Only those platforms which have been tested to complete a "build.sh" run @@ -61,6 +61,15 @@ HP-UX * zlib must be available. +OpenBSD +--- + +As of -current 20210629, ./build.sh will build src on OpenBSD 6.9 +for some platforms. Known problems: +* MIPS targets do not currently build. +* The LLVM RT library will not build and consequently nor will X on + amd64 and i386. + NetBSD (earlier releases) -
CVS commit: src/tools/compat
Module Name:src Committed By: cjep Date: Mon Jun 28 07:18:01 UTC 2021 Modified Files: src/tools/compat: README Log Message: avoid triggering conflict indicator warnings To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/tools/compat/README Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/README diff -u src/tools/compat/README:1.17 src/tools/compat/README:1.18 --- src/tools/compat/README:1.17 Mon Jun 28 07:16:46 2021 +++ src/tools/compat/README Mon Jun 28 07:18:01 2021 @@ -1,4 +1,4 @@ -$NetBSD: README,v 1.17 2021/06/28 07:16:46 cjep Exp $ +$NetBSD: README,v 1.18 2021/06/28 07:18:01 cjep Exp $ Special notes for cross-hosting a NetBSD build on certain platforms. Only those platforms which have been tested to complete a "build.sh" run @@ -14,7 +14,7 @@ In addition all hosts must provide the f zlib and headers (this requirement may be dropped in future) FreeBSD -=== +--- build.sh was recently tested on: * FreeBSD 13 (amd64, aarch64) @@ -23,7 +23,7 @@ build.sh was recently tested on: * FreeBSD 10.4 (amd64) Linux -= +- build.sh has been tested on: * Amazon Linux 2 (x86) @@ -45,7 +45,7 @@ build.sh has been tested on: * There is a known build problem on Linux/aarch64 with glibc <2.28 macOS/Darwin - + build.sh was recently tested on: * macOS Big Sur (x86) @@ -57,12 +57,12 @@ Previously, there have been issues build HFS filesystems. build.sh is not working yet on M1-based Macs. HP-UX -= +- * zlib must be available. NetBSD (earlier releases) -= +- * Tested on NetBSD 1.5.2 (machine-independently). * Should need no special setup. @@ -70,7 +70,7 @@ NetBSD (earlier releases) compat_defs.h will error out if it finds it defined. Solaris -=== +--- (updated instruction for Solaris 11 further below)
CVS commit: src/tools/compat
Module Name:src Committed By: cjep Date: Mon Jun 28 07:16:46 UTC 2021 Modified Files: src/tools/compat: README Log Message: note on Darwin/Mac To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/tools/compat/README Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/README diff -u src/tools/compat/README:1.16 src/tools/compat/README:1.17 --- src/tools/compat/README:1.16 Wed May 12 06:39:28 2021 +++ src/tools/compat/README Mon Jun 28 07:16:46 2021 @@ -1,4 +1,4 @@ -$NetBSD: README,v 1.16 2021/05/12 06:39:28 cjep Exp $ +$NetBSD: README,v 1.17 2021/06/28 07:16:46 cjep Exp $ Special notes for cross-hosting a NetBSD build on certain platforms. Only those platforms which have been tested to complete a "build.sh" run @@ -48,13 +48,13 @@ macOS/Darwin build.sh was recently tested on: -* macOS Big Sur +* macOS Big Sur (x86) * macOS Catalina * macOS High Sierra -with up to date Xcode command line tools and APFS filesystems. -(Previously, there have been issues building on case-insensitive -HFS filesystems.) +with up to date Xcode command line tools and APFS filesystems. +Previously, there have been issues building on case-insensitive +HFS filesystems. build.sh is not working yet on M1-based Macs. HP-UX =
CVS commit: src/tools/compat
Module Name:src Committed By: cjep Date: Sun May 30 10:39:41 UTC 2021 Modified Files: src/tools/compat: compat_defs.h Log Message: PR port-amiga/56188 Include a prototype for __nbcompat_heapsort. The tools for amiga now build on Darwin where one Amiga specific tool uses heapsort. Despite being a one-liner, ./build.sh -m amiga tools was tested on NetBSD, Darwin, FreeBSD & Linux with the change. Discussed various options with jdc & thorpej. Perhaps in the future we could look at using qsort instead of heapsort as qsort is standardised and more likely to be available. We could then remove heapsort from the compatibility library. To generate a diff of this commit: cvs rdiff -u -r1.119 -r1.120 src/tools/compat/compat_defs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.119 src/tools/compat/compat_defs.h:1.120 --- src/tools/compat/compat_defs.h:1.119 Mon May 24 23:07:40 2021 +++ src/tools/compat/compat_defs.h Sun May 30 10:39:41 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.119 2021/05/24 23:07:40 uwe Exp $ */ +/* $NetBSD: compat_defs.h,v 1.120 2021/05/30 10:39:41 cjep Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -462,7 +462,9 @@ int __nbcompat_gettemp(char *, int *, in ssize_t pread(int, void *, size_t, off_t); #endif +int __nbcompat_heapsort (void *, size_t, size_t, int (*)(const void *, const void *)); #define heapsort __nbcompat_heapsort + #if !HAVE_DECL_HEAPSORT int heapsort (void *, size_t, size_t, int (*)(const void *, const void *)); #endif
CVS commit: src/tools/compat
Module Name:src Committed By: uwe Date: Mon May 24 23:07:41 UTC 2021 Modified Files: src/tools/compat: compat_defs.h Log Message: Fix typo in pathname in a comment. To generate a diff of this commit: cvs rdiff -u -r1.118 -r1.119 src/tools/compat/compat_defs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.118 src/tools/compat/compat_defs.h:1.119 --- src/tools/compat/compat_defs.h:1.118 Thu Feb 25 13:41:58 2021 +++ src/tools/compat/compat_defs.h Mon May 24 23:07:40 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.118 2021/02/25 13:41:58 christos Exp $ */ +/* $NetBSD: compat_defs.h,v 1.119 2021/05/24 23:07:40 uwe Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -454,7 +454,7 @@ char *mkdtemp(char *); #if !HAVE_MKSTEMP || !HAVE_MKDTEMP /* This is a prototype for the internal function defined in - * src/lib/lib/stdio/gettemp.c */ + * src/lib/libc/stdio/gettemp.c */ int __nbcompat_gettemp(char *, int *, int); #endif
CVS commit: src/tools/compat
Module Name:src Committed By: cjep Date: Wed May 12 06:39:28 UTC 2021 Modified Files: src/tools/compat: README Log Message: Add macOS High Sierra to the list of verified build platforms To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/tools/compat/README Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/README diff -u src/tools/compat/README:1.15 src/tools/compat/README:1.16 --- src/tools/compat/README:1.15 Fri May 7 14:52:59 2021 +++ src/tools/compat/README Wed May 12 06:39:28 2021 @@ -1,4 +1,4 @@ -$NetBSD: README,v 1.15 2021/05/07 14:52:59 cjep Exp $ +$NetBSD: README,v 1.16 2021/05/12 06:39:28 cjep Exp $ Special notes for cross-hosting a NetBSD build on certain platforms. Only those platforms which have been tested to complete a "build.sh" run @@ -50,6 +50,7 @@ macOS/Darwin build.sh was recently tested on: * macOS Big Sur * macOS Catalina +* macOS High Sierra with up to date Xcode command line tools and APFS filesystems. (Previously, there have been issues building on case-insensitive
CVS commit: src/tools/compat
Module Name:src Committed By: cjep Date: Fri May 7 14:52:59 UTC 2021 Modified Files: src/tools/compat: README Log Message: More test notes from using build.sh against non NetBSD platforms. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/tools/compat/README Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/README diff -u src/tools/compat/README:1.14 src/tools/compat/README:1.15 --- src/tools/compat/README:1.14 Thu May 6 07:32:15 2021 +++ src/tools/compat/README Fri May 7 14:52:59 2021 @@ -1,4 +1,4 @@ -$NetBSD: README,v 1.14 2021/05/06 07:32:15 cjep Exp $ +$NetBSD: README,v 1.15 2021/05/07 14:52:59 cjep Exp $ Special notes for cross-hosting a NetBSD build on certain platforms. Only those platforms which have been tested to complete a "build.sh" run @@ -16,17 +16,22 @@ In addition all hosts must provide the f FreeBSD === -build.sh was recently tested on FreeBSD 13 with the compiler tools installed. +build.sh was recently tested on: +* FreeBSD 13 (amd64, aarch64) +* FreeBSD 12.2 (amd64, aarch64) +* FreeBSD 11.4 (amd64) +* FreeBSD 10.4 (amd64) Linux = build.sh has been tested on: * Amazon Linux 2 (x86) -* Debian 10 (x86) -* Red Hat Enterprise Linux 8 (x86) +* Debian 10 (x86, aarch64) +* Red Hat Enterprise Linux 8 (x86, aarch64) * SUSE Enterprise Server 15 (x86) -* Ubuntu Server 20.04 (x86) +* Ubuntu Server 20.04 (x86, aarch64) +* Ubuntu Server 18.04 (x86) * The gcc and g++ package must be installed, along with the typical system development packages (glibc-devel, etc.). The g++ package is sometimes @@ -37,12 +42,18 @@ build.sh has been tested on: * The zlib and zlib-devel packages must be installed (these are called zlib1g and zlib1g-dev on Debian and Ubuntu Linux) +* There is a known build problem on Linux/aarch64 with glibc <2.28 + macOS/Darwin -build.sh was recently tested on macOS Big Sur with an APFS filesystem -and the Xcode command line tools. (Previously, there have been issues -building on case-insensitive HFS filesystems.) +build.sh was recently tested on: +* macOS Big Sur +* macOS Catalina + +with up to date Xcode command line tools and APFS filesystems. +(Previously, there have been issues building on case-insensitive +HFS filesystems.) HP-UX =
CVS commit: src/tools/compat
Module Name:src Committed By: cjep Date: Thu May 6 07:32:16 UTC 2021 Modified Files: src/tools/compat: README Log Message: Update with information from recent testing of different Linux variants on AWS. Also FreeBSD 13. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/tools/compat/README Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/README diff -u src/tools/compat/README:1.13 src/tools/compat/README:1.14 --- src/tools/compat/README:1.13 Sun Sep 9 19:17:21 2018 +++ src/tools/compat/README Thu May 6 07:32:15 2021 @@ -1,4 +1,4 @@ -$NetBSD: README,v 1.13 2018/09/09 19:17:21 palle Exp $ +$NetBSD: README,v 1.14 2021/05/06 07:32:15 cjep Exp $ Special notes for cross-hosting a NetBSD build on certain platforms. Only those platforms which have been tested to complete a "build.sh" run @@ -8,62 +8,57 @@ All hosts must have a POSIX compatible s otherwise set. This can be overridden by setting HOST_SH in the environment. In addition all hosts must provide the following local tools: + gzip + gcc + g++ + zlib and headers (this requirement may be dropped in future) -gzip +FreeBSD +=== -= - -NetBSD: - -* _NETBSD_SOURCE is *not* to be defined/pulled in during compat/tools builds. - compat_defs.h will error out if it finds it defined. - -HP-UX: - -* zlib must be available. - This will be fixed in the future to include zlib in libnbcompat. +build.sh was recently tested on FreeBSD 13 with the compiler tools installed. +Linux = -LINUX: - -* Tested on RedHat Linux 7.1 (i386). - Tested on RedHat Linux 7.3 (i686) on 16 Sep 2002. Requires "LANG=C" - in the environment. - -* Tested on Redhat Linux 8.0 (i686) in Fall 2003. Requires no special settings. - -* Tested on Redhat ES3 and AS3 in spring of 2004. Requires no special settings. - -* The gcc (and libstdc++, if needed) package must be installed, along - with the typical system development packages (glibc-devel, etc.). +build.sh has been tested on: +* Amazon Linux 2 (x86) +* Debian 10 (x86) +* Red Hat Enterprise Linux 8 (x86) +* SUSE Enterprise Server 15 (x86) +* Ubuntu Server 20.04 (x86) + +* The gcc and g++ package must be installed, along with the typical system + development packages (glibc-devel, etc.). The g++ package is sometimes + called gcc-c++. * The ncurses-devel package must be installed (for nbinfo). -* The zlib and zlib-devel packages must be installed. This will be - fixed in the future to include zlib in libnbcompat. - -= +* The zlib and zlib-devel packages must be installed (these are + called zlib1g and zlib1g-dev on Debian and Ubuntu Linux) -MACOS - Requires a case sensitive filesystem such as UFS +macOS/Darwin + -* Tested on 10.2.8 with Dec 2002 Developer Tools -- may require a fix to /usr/bin/join, netbsd's join should work fine -* Tested on 10.3 with xcode 1.5 -- compiles fine out of the box +build.sh was recently tested on macOS Big Sur with an APFS filesystem +and the Xcode command line tools. (Previously, there have been issues +building on case-insensitive HFS filesystems.) +HP-UX = -NETBSD (earlier releases): +* zlib must be available. -* Tested on NetBSD 1.5.2 (machine-independently). +NetBSD (earlier releases) += +* Tested on NetBSD 1.5.2 (machine-independently). * Should need no special setup. +* _NETBSD_SOURCE is *not* to be defined/pulled in during compat/tools builds. + compat_defs.h will error out if it finds it defined. -= - -SOLARIS: +Solaris +=== (updated instruction for Solaris 11 further below)
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Thu Feb 25 13:41:58 UTC 2021 Modified Files: src/tools/compat: Makefile compat_defs.h configure configure.ac nbtool_config.h.in Log Message: Add reallocarray; this is used by the new regex code and we don't want to convert it to reallocarr so the code is kept similar with the original from FreeBSD. To generate a diff of this commit: cvs rdiff -u -r1.88 -r1.89 src/tools/compat/Makefile cvs rdiff -u -r1.117 -r1.118 src/tools/compat/compat_defs.h cvs rdiff -u -r1.98 -r1.99 src/tools/compat/configure \ src/tools/compat/configure.ac cvs rdiff -u -r1.52 -r1.53 src/tools/compat/nbtool_config.h.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.88 src/tools/compat/Makefile:1.89 --- src/tools/compat/Makefile:1.88 Sat Jun 13 06:49:17 2020 +++ src/tools/compat/Makefile Thu Feb 25 08:41:58 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.88 2020/06/13 10:49:17 lukem Exp $ +# $NetBSD: Makefile,v 1.89 2021/02/25 13:41:58 christos Exp $ HOSTLIB= nbcompat @@ -13,7 +13,8 @@ SRCS= atoll.c basename.c cdbr.c cdbw.c mi_vector_hash.c mkdtemp.c \ mkstemp.c pread.c putc_unlocked.c pwcache.c pwrite.c \ pw_scan.c \ - raise_default_signal.c rb.c reallocarr.c rmd160.c rmd160hl.c \ + raise_default_signal.c rb.c reallocarr.c reallocarray.c \ + rmd160.c rmd160hl.c \ regcomp.c regerror.c regexec.c regfree.c \ setenv.c setgroupent.c \ setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \ Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.117 src/tools/compat/compat_defs.h:1.118 --- src/tools/compat/compat_defs.h:1.117 Tue Feb 23 11:03:00 2021 +++ src/tools/compat/compat_defs.h Thu Feb 25 08:41:58 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.117 2021/02/23 16:03:00 rin Exp $ */ +/* $NetBSD: compat_defs.h,v 1.118 2021/02/25 13:41:58 christos Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -556,6 +556,10 @@ int raise_default_signal(int); int reallocarr(void *, size_t, size_t); #endif +#if !HAVE_DECL_REALLOCARRAY +void *reallocarray(void *, size_t, size_t); +#endif + #if !HAVE_DECL_SETENV int setenv(const char *, const char *, int); #endif Index: src/tools/compat/configure diff -u src/tools/compat/configure:1.98 src/tools/compat/configure:1.99 --- src/tools/compat/configure:1.98 Wed Jun 24 10:44:44 2020 +++ src/tools/compat/configure Thu Feb 25 08:41:58 2021 @@ -4832,6 +4832,19 @@ fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_REALLOCARR $ac_have_decl _ACEOF +ac_fn_c_check_decl "$LINENO" "reallocarray" "ac_cv_have_decl_reallocarray" " +#include + +" +if test "x$ac_cv_have_decl_reallocarray" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_REALLOCARRAY $ac_have_decl +_ACEOF ac_fn_c_check_decl "$LINENO" "getsubopt" "ac_cv_have_decl_getsubopt" " #include @@ -5285,7 +5298,7 @@ for ac_func in atoll asprintf asnprintf getopt getopt_long group_from_gid gid_from_group \ heapsort isblank issetugid lchflags lchmod lchown lutimes mkstemp \ mkdtemp poll pread putc_unlocked pwcache_userdb pwcache_groupdb \ - pwrite raise_default_signal random reallocarr setenv \ + pwrite raise_default_signal random reallocarr reallocarray setenv \ setgroupent setprogname setpassent \ snprintb_m snprintf strlcat strlcpy strmode \ strcasecmp strncasecmp strndup strnlen strsep strsuftoll strtoi \ Index: src/tools/compat/configure.ac diff -u src/tools/compat/configure.ac:1.98 src/tools/compat/configure.ac:1.99 --- src/tools/compat/configure.ac:1.98 Wed Jun 24 10:39:01 2020 +++ src/tools/compat/configure.ac Thu Feb 25 08:41:58 2021 @@ -1,4 +1,4 @@ -# $NetBSD: configure.ac,v 1.98 2020/06/24 14:39:01 uwe Exp $ +# $NetBSD: configure.ac,v 1.99 2021/02/25 13:41:58 christos Exp $ # # Autoconf definition file for libnbcompat. # @@ -179,8 +179,9 @@ AC_CHECK_DECLS([asprintf, asnprintf, vas #include ]) -AC_CHECK_DECLS([atoll, heapsort, mkdtemp, mkstemp, reallocarr, getsubopt, - setenv, strtoi, strtoll, strtou, setprogname, getprogname],,, [ +AC_CHECK_DECLS([atoll, heapsort, mkdtemp, mkstemp, reallocarr, reallocarray, + getsubopt, setenv, strtoi, strtoll, strtou, setprogname, + getprogname],,, [ #include ]) @@ -223,7 +224,7 @@ AC_CHECK_FUNCS(atoll asprintf asnprintf getopt getopt_long group_from_gid gid_from_group \ heapsort isblank issetugid lchflags lchmod lchown lutimes mkstemp \ mkdtemp poll pread putc_unlocked pwcache_userdb pwcache_groupdb \ - pwrite raise_default_signal random reallocarr setenv \ + pwrite raise_default_signal random reallocarr reallocarray setenv \ setgroupent setprogname setpassent \ snprintb_m snprintf strlcat strlcpy strmode \ strcasecmp strncasecmp strndup strnlen strsep strsuftoll strtoi \ Index:
CVS commit: src/tools/compat
Module Name:src Committed By: rin Date: Tue Feb 23 16:03:01 UTC 2021 Modified Files: src/tools/compat: compat_defs.h Log Message: Fix copy-paste error for heapsort(3), so that it is declared appropriately. To generate a diff of this commit: cvs rdiff -u -r1.116 -r1.117 src/tools/compat/compat_defs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.116 src/tools/compat/compat_defs.h:1.117 --- src/tools/compat/compat_defs.h:1.116 Wed Jun 19 23:33:07 2019 +++ src/tools/compat/compat_defs.h Tue Feb 23 16:03:00 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.116 2019/06/19 23:33:07 kamil Exp $ */ +/* $NetBSD: compat_defs.h,v 1.117 2021/02/23 16:03:00 rin Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -462,11 +462,10 @@ int __nbcompat_gettemp(char *, int *, in ssize_t pread(int, void *, size_t, off_t); #endif +#define heapsort __nbcompat_heapsort #if !HAVE_DECL_HEAPSORT int heapsort (void *, size_t, size_t, int (*)(const void *, const void *)); #endif -/* Make them use our version */ -# define heapsort __nbcompat_heapsort char *flags_to_string(unsigned long, const char *); int string_to_flags(char **, unsigned long *, unsigned long *);
CVS commit: src/tools/compat
Module Name:src Committed By: uwe Date: Wed Jun 24 14:44:44 UTC 2020 Modified Files: src/tools/compat: configure Log Message: Regen: Add AC_MSG_RESULT yes/no to the uio checks. To generate a diff of this commit: cvs rdiff -u -r1.97 -r1.98 src/tools/compat/configure Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/configure diff -u src/tools/compat/configure:1.97 src/tools/compat/configure:1.98 --- src/tools/compat/configure:1.97 Sat Jun 22 14:40:33 2019 +++ src/tools/compat/configure Wed Jun 24 14:44:44 2020 @@ -4315,9 +4315,14 @@ enum uio_rw rw; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } $as_echo "#define HAVE_ENUM_UIO_RW 1" >>confdefs.h +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext @@ -4339,9 +4344,14 @@ enum uio_seg seg; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } $as_echo "#define HAVE_ENUM_UIO_SEG 1" >>confdefs.h +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CVS commit: src/tools/compat
Module Name:src Committed By: uwe Date: Wed Jun 24 14:39:01 UTC 2020 Modified Files: src/tools/compat: configure.ac Log Message: Add AC_MSG_RESULT yes/no to the uio checks. To generate a diff of this commit: cvs rdiff -u -r1.97 -r1.98 src/tools/compat/configure.ac Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/configure.ac diff -u src/tools/compat/configure.ac:1.97 src/tools/compat/configure.ac:1.98 --- src/tools/compat/configure.ac:1.97 Sat Jun 22 13:42:53 2019 +++ src/tools/compat/configure.ac Wed Jun 24 14:39:01 2020 @@ -1,4 +1,4 @@ -# $NetBSD: configure.ac,v 1.97 2019/06/22 13:42:53 hannken Exp $ +# $NetBSD: configure.ac,v 1.98 2020/06/24 14:39:01 uwe Exp $ # # Autoconf definition file for libnbcompat. # @@ -121,8 +121,11 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #ifdef HAVE_SYS_UIO_H #include #endif]], -[[enum uio_rw rw;]])],[AC_DEFINE([HAVE_ENUM_UIO_RW], 1, - [Define if you have the enum uio_rw type.])],) +[[enum uio_rw rw;]])], +[AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_ENUM_UIO_RW], 1, +[Define if you have the enum uio_rw type.])], +[AC_MSG_RESULT(no)]) AC_MSG_CHECKING([for enum uio_seg]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ @@ -130,8 +133,11 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #ifdef HAVE_SYS_UIO_H #include #endif]], -[[enum uio_seg seg;]])],[AC_DEFINE([HAVE_ENUM_UIO_SEG], 1, - [Define if you have the enum uio_seg type.])],) +[[enum uio_seg seg;]])], +[AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_ENUM_UIO_SEG], 1, +[Define if you have the enum uio_seg type.])], +[AC_MSG_RESULT(no)]) dnl XXX - This is UGLY. Need a better way to homogenize the bitsized types, dnl including use of compiler primitive types via AC_CHECK_SIZEOF.
CVS commit: src/tools/compat
Module Name:src Committed By: dholland Date: Sun Jan 27 05:15:32 UTC 2019 Modified Files: src/tools/compat: nbtool_config.h.in Log Message: Restore comment accidentally lost in merge. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/tools/compat/nbtool_config.h.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/nbtool_config.h.in diff -u src/tools/compat/nbtool_config.h.in:1.48 src/tools/compat/nbtool_config.h.in:1.49 --- src/tools/compat/nbtool_config.h.in:1.48 Sun Jan 27 02:08:50 2019 +++ src/tools/compat/nbtool_config.h.in Sun Jan 27 05:15:32 2019 @@ -1,5 +1,6 @@ +/* nbtool_config.h.in. Generated from configure.ac by autoheader. */ -/* $NetBSD: nbtool_config.h.in,v 1.48 2019/01/27 02:08:50 pgoyette Exp $*/ +/* $NetBSD: nbtool_config.h.in,v 1.49 2019/01/27 05:15:32 dholland Exp $*/ #ifndef __NETBSD_NBTOOL_CONFIG_H__ #define __NETBSD_NBTOOL_CONFIG_H__
CVS commit: src/tools/compat
Module Name:src Committed By: palle Date: Sun Sep 9 19:17:21 UTC 2018 Modified Files: src/tools/compat: README Log Message: Add instructions for building NetBSD on modern Solaris 11 hosts To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/tools/compat/README Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/README diff -u src/tools/compat/README:1.12 src/tools/compat/README:1.13 --- src/tools/compat/README:1.12 Tue Apr 5 00:21:22 2005 +++ src/tools/compat/README Sun Sep 9 19:17:21 2018 @@ -1,4 +1,4 @@ -$NetBSD: README,v 1.12 2005/04/05 00:21:22 jmc Exp $ +$NetBSD: README,v 1.13 2018/09/09 19:17:21 palle Exp $ Special notes for cross-hosting a NetBSD build on certain platforms. Only those platforms which have been tested to complete a "build.sh" run @@ -65,6 +65,8 @@ NETBSD (earlier releases): SOLARIS: +(updated instruction for Solaris 11 further below) + * Tested on Solaris/x86 8 (5.8) with gcc 2.95.2 and Solaris/sparc 8 (5.8) with gcc 3.2 (not yet tested with SUNWspro). @@ -85,3 +87,16 @@ SOLARIS: /usr/ucb may optionally be placed before /usr/bin, per your preference, but /usr/ucb *MUST NOT* be before /usr/ccs/bin or before the path to the host C and C++ compilers. + +Solaris 11: + +* Solaris 11.3 + * Set PATH to /usr/xpg6/bin:/usr/xpg4/bin:/usr/bin + * Set HOST_CC to /usr/bin/gcc + +* Solaris 11.4 + * Install gcc-5 since the default installed gcc-7 has issues when compiling + toolchain version of groff (hypot()) + * Set PATH to /usr/xpg7/bin:/usr/xpg6/bin:/usr/xpg4/bin:/usr/bin + * set HOST_CC to /usr/gcc/5/bin/gcc + * set HOST_CXX to /usr/gcc/5/bin/g++
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Thu Aug 30 12:05:35 UTC 2018 Modified Files: src/tools/compat: Makefile compat_defs.h configure configure.ac nbtool_config.h.in Log Message: deal with getsubopt and strncasecmp (needed by mdocml) To generate a diff of this commit: cvs rdiff -u -r1.85 -r1.86 src/tools/compat/Makefile cvs rdiff -u -r1.113 -r1.114 src/tools/compat/compat_defs.h cvs rdiff -u -r1.92 -r1.93 src/tools/compat/configure cvs rdiff -u -r1.93 -r1.94 src/tools/compat/configure.ac cvs rdiff -u -r1.46 -r1.47 src/tools/compat/nbtool_config.h.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.85 src/tools/compat/Makefile:1.86 --- src/tools/compat/Makefile:1.85 Thu Aug 16 08:03:36 2018 +++ src/tools/compat/Makefile Thu Aug 30 08:05:34 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.85 2018/08/16 12:03:36 christos Exp $ +# $NetBSD: Makefile,v 1.86 2018/08/30 12:05:34 christos Exp $ HOSTLIB= nbcompat @@ -7,7 +7,7 @@ HOSTLIB= nbcompat SRCS= atoll.c basename.c cdbr.c cdbw.c dirname.c \ dprintf.c fgetln.c flock.c fparseln.c fpurge.c \ getcap.c getline.c getmode.c getopt_long.c gettemp.c \ - heapsort.c \ + heapsort.c getsubopt.c \ issetugid.c lchflags.c lchmod.c lchown.c libyywrap.c \ md2.c md2hl.c md4c.c md4hl.c md5c.c md5hl.c \ mi_vector_hash.c mkdtemp.c \ Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.113 src/tools/compat/compat_defs.h:1.114 --- src/tools/compat/compat_defs.h:1.113 Sat Aug 11 12:24:59 2018 +++ src/tools/compat/compat_defs.h Thu Aug 30 08:05:34 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.113 2018/08/11 16:24:59 christos Exp $ */ +/* $NetBSD: compat_defs.h,v 1.114 2018/08/30 12:05:34 christos Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -255,6 +255,10 @@ extern char *optarg; extern int optind, opterr, optopt; #endif +#if !HAVE_DECL_GETSUBOPT +int getsubopt(char **, char * const *, char **); +#endif + #if !HAVE_DECL_DIRNAME char *dirname(char *); #endif @@ -497,6 +501,9 @@ size_t strnlen(const char *, size_t); #if !HAVE_DECL_STRCASECMP int strcasecmp(const char *, const char *); #endif +#if !HAVE_DECL_STRNCASECMP +int strncasecmp(const char *, const char *, size_t); +#endif #if !HAVE_DECL_LCHFLAGS int lchflags(const char *, unsigned long); #endif Index: src/tools/compat/configure diff -u src/tools/compat/configure:1.92 src/tools/compat/configure:1.93 --- src/tools/compat/configure:1.92 Thu Aug 16 08:03:36 2018 +++ src/tools/compat/configure Thu Aug 30 08:05:34 2018 @@ -4717,6 +4717,19 @@ fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_REALLOCARR $ac_have_decl _ACEOF +ac_fn_c_check_decl "$LINENO" "getsubopt" "ac_cv_have_decl_getsubopt" " +#include + +" +if test "x$ac_cv_have_decl_getsubopt" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETSUBOPT $ac_have_decl +_ACEOF ac_fn_c_check_decl "$LINENO" "setenv" "ac_cv_have_decl_setenv" " #include Index: src/tools/compat/configure.ac diff -u src/tools/compat/configure.ac:1.93 src/tools/compat/configure.ac:1.94 --- src/tools/compat/configure.ac:1.93 Thu Aug 16 08:03:36 2018 +++ src/tools/compat/configure.ac Thu Aug 30 08:05:34 2018 @@ -1,4 +1,4 @@ -# $NetBSD: configure.ac,v 1.93 2018/08/16 12:03:36 christos Exp $ +# $NetBSD: configure.ac,v 1.94 2018/08/30 12:05:34 christos Exp $ # # Autoconf definition file for libnbcompat. # @@ -145,7 +145,7 @@ AC_CHECK_DECLS([asprintf, asnprintf, vas #include ]) -AC_CHECK_DECLS([atoll, heapsort, mkdtemp, mkstemp, reallocarr, +AC_CHECK_DECLS([atoll, heapsort, mkdtemp, mkstemp, reallocarr, getsubopt, setenv, strtoi, strtoll, strtou, setprogname, getprogname],,, [ #include ]) Index: src/tools/compat/nbtool_config.h.in diff -u src/tools/compat/nbtool_config.h.in:1.46 src/tools/compat/nbtool_config.h.in:1.47 --- src/tools/compat/nbtool_config.h.in:1.46 Thu Aug 16 08:03:36 2018 +++ src/tools/compat/nbtool_config.h.in Thu Aug 30 08:05:34 2018 @@ -1,6 +1,6 @@ /* nbtool_config.h.in. Generated from configure.ac by autoheader. */ -/* $NetBSD: nbtool_config.h.in,v 1.46 2018/08/16 12:03:36 christos Exp $*/ +/* $NetBSD: nbtool_config.h.in,v 1.47 2018/08/30 12:05:34 christos Exp $*/ #ifndef __NETBSD_NBTOOL_CONFIG_H__ #define __NETBSD_NBTOOL_CONFIG_H__ @@ -154,6 +154,10 @@ don't. */ #undef HAVE_DECL_GETPROGNAME +/* Define to 1 if you have the declaration of `getsubopt', and to 0 if you + don't. */ +#undef HAVE_DECL_GETSUBOPT + /* Define to 1 if you have the declaration of `gid_from_group', and to 0 if you don't. */ #undef HAVE_DECL_GID_FROM_GROUP
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Thu Aug 16 12:03:36 UTC 2018 Modified Files: src/tools/compat: Makefile configure configure.ac nbtool_config.h.in Log Message: add strncasecmp To generate a diff of this commit: cvs rdiff -u -r1.84 -r1.85 src/tools/compat/Makefile cvs rdiff -u -r1.91 -r1.92 src/tools/compat/configure cvs rdiff -u -r1.92 -r1.93 src/tools/compat/configure.ac cvs rdiff -u -r1.45 -r1.46 src/tools/compat/nbtool_config.h.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.84 src/tools/compat/Makefile:1.85 --- src/tools/compat/Makefile:1.84 Sat Aug 11 12:24:59 2018 +++ src/tools/compat/Makefile Thu Aug 16 08:03:36 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.84 2018/08/11 16:24:59 christos Exp $ +# $NetBSD: Makefile,v 1.85 2018/08/16 12:03:36 christos Exp $ HOSTLIB= nbcompat @@ -19,7 +19,7 @@ SRCS= atoll.c basename.c cdbr.c cdbw.c setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \ sha256hl.c sha384hl.c sha512hl.c snprintb.c snprintf.c \ stat_flags.c strlcat.c strlcpy.c strmode.c \ - strcasecmp.c strndup.c strnlen.c \ + strcasecmp.c strncasecmp.c strndup.c strnlen.c \ strsep.c strsuftoll.c strtoll.c \ strtoi.c strtou.c \ unvis.c vis.c err.c errx.c errc.c verr.c verrx.c verrc.c \ Index: src/tools/compat/configure diff -u src/tools/compat/configure:1.91 src/tools/compat/configure:1.92 --- src/tools/compat/configure:1.91 Sat Aug 11 12:24:59 2018 +++ src/tools/compat/configure Thu Aug 16 08:03:36 2018 @@ -5160,7 +5160,8 @@ for ac_func in atoll asprintf asnprintf pwrite raise_default_signal random reallocarr setenv \ setgroupent setprogname setpassent \ snprintb_m snprintf strlcat strlcpy strmode \ - strcasecmp strndup strnlen strsep strsuftoll strtoi strtoll strtou \ + strcasecmp strncasecmp strndup strnlen strsep strsuftoll strtoi \ + strtoll strtou \ user_from_uid uid_from_user vasprintf vasnprintf vsnprintf do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` @@ -5267,6 +5268,19 @@ fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRCASECMP $ac_have_decl _ACEOF +ac_fn_c_check_decl "$LINENO" "strncasecmp" "ac_cv_have_decl_strncasecmp" " +#include + +" +if test "x$ac_cv_have_decl_strncasecmp" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRNCASECMP $ac_have_decl +_ACEOF ac_fn_c_check_decl "$LINENO" "strlcpy" "ac_cv_have_decl_strlcpy" " #include Index: src/tools/compat/configure.ac diff -u src/tools/compat/configure.ac:1.92 src/tools/compat/configure.ac:1.93 --- src/tools/compat/configure.ac:1.92 Sat Aug 11 12:24:59 2018 +++ src/tools/compat/configure.ac Thu Aug 16 08:03:36 2018 @@ -1,4 +1,4 @@ -# $NetBSD: configure.ac,v 1.92 2018/08/11 16:24:59 christos Exp $ +# $NetBSD: configure.ac,v 1.93 2018/08/16 12:03:36 christos Exp $ # # Autoconf definition file for libnbcompat. # @@ -192,7 +192,8 @@ AC_CHECK_FUNCS(atoll asprintf asnprintf pwrite raise_default_signal random reallocarr setenv \ setgroupent setprogname setpassent \ snprintb_m snprintf strlcat strlcpy strmode \ - strcasecmp strndup strnlen strsep strsuftoll strtoi strtoll strtou \ + strcasecmp strncasecmp strndup strnlen strsep strsuftoll strtoi \ + strtoll strtou \ user_from_uid uid_from_user vasprintf vasnprintf vsnprintf) AC_CHECK_DECLS([user_from_uid, uid_from_user, pwcache_userdb],,,[ @@ -201,7 +202,8 @@ AC_CHECK_DECLS([user_from_uid, uid_from_ AC_CHECK_DECLS([group_from_gid, gid_from_group, pwcache_groupdb],,,[ #include ]) -AC_CHECK_DECLS([strcasecmp, strlcpy, strlcat, strndup, strnlen, strsep],,,[ +AC_CHECK_DECLS([strcasecmp, strncasecmp, strlcpy, strlcat, strndup, + strnlen, strsep],,,[ #include ]) AC_CHECK_DECLS([strsuftoll, mi_vector_hash],,,[#include ]) @@ -210,7 +212,8 @@ AC_CHECK_DECLS([lchflags, lchmod, lchown #include ]) -AC_CHECK_DECLS([err, errc, errx, verrc, verrx, warn, warnc, warnx, vwarnc, vwarnx],,, [ +AC_CHECK_DECLS([err, errc, errx, verrc, verrx, warn, warnc, warnx, vwarnc, + vwarnx],,,[ #ifdef HAVE_ERR_H #include #endif Index: src/tools/compat/nbtool_config.h.in diff -u src/tools/compat/nbtool_config.h.in:1.45 src/tools/compat/nbtool_config.h.in:1.46 --- src/tools/compat/nbtool_config.h.in:1.45 Sat Aug 11 12:24:59 2018 +++ src/tools/compat/nbtool_config.h.in Thu Aug 16 08:03:36 2018 @@ -1,6 +1,6 @@ /* nbtool_config.h.in. Generated from configure.ac by autoheader. */ -/* $NetBSD: nbtool_config.h.in,v 1.45 2018/08/11 16:24:59 christos Exp $*/ +/* $NetBSD: nbtool_config.h.in,v 1.46 2018/08/16 12:03:36 christos Exp $*/ #ifndef __NETBSD_NBTOOL_CONFIG_H__ #define __NETBSD_NBTOOL_CONFIG_H__ @@ -326,6 +326,10 @@ don't. */ #undef HAVE_DECL_STRMODE +/* Define to 1 if you have the declaration of `strncasecmp', and to 0 if you + don't. */ +#undef
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Sat Aug 11 16:24:59 UTC 2018 Modified Files: src/tools/compat: Makefile compat_defs.h configure configure.ac nbtool_config.h.in Log Message: Add strcasecmp To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/tools/compat/Makefile cvs rdiff -u -r1.112 -r1.113 src/tools/compat/compat_defs.h cvs rdiff -u -r1.90 -r1.91 src/tools/compat/configure cvs rdiff -u -r1.91 -r1.92 src/tools/compat/configure.ac cvs rdiff -u -r1.44 -r1.45 src/tools/compat/nbtool_config.h.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.83 src/tools/compat/Makefile:1.84 --- src/tools/compat/Makefile:1.83 Tue May 1 15:59:46 2018 +++ src/tools/compat/Makefile Sat Aug 11 12:24:59 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.83 2018/05/01 19:59:46 christos Exp $ +# $NetBSD: Makefile,v 1.84 2018/08/11 16:24:59 christos Exp $ HOSTLIB= nbcompat @@ -19,7 +19,7 @@ SRCS= atoll.c basename.c cdbr.c cdbw.c setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \ sha256hl.c sha384hl.c sha512hl.c snprintb.c snprintf.c \ stat_flags.c strlcat.c strlcpy.c strmode.c \ - strndup.c strnlen.c \ + strcasecmp.c strndup.c strnlen.c \ strsep.c strsuftoll.c strtoll.c \ strtoi.c strtou.c \ unvis.c vis.c err.c errx.c errc.c verr.c verrx.c verrc.c \ Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.112 src/tools/compat/compat_defs.h:1.113 --- src/tools/compat/compat_defs.h:1.112 Wed Jun 13 00:17:43 2018 +++ src/tools/compat/compat_defs.h Sat Aug 11 12:24:59 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.112 2018/06/13 04:17:43 maya Exp $ */ +/* $NetBSD: compat_defs.h,v 1.113 2018/08/11 16:24:59 christos Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -494,6 +494,9 @@ char *strndup(const char *, size_t); #if !HAVE_DECL_STRNLEN size_t strnlen(const char *, size_t); #endif +#if !HAVE_DECL_STRCASECMP +int strcasecmp(const char *, const char *); +#endif #if !HAVE_DECL_LCHFLAGS int lchflags(const char *, unsigned long); #endif Index: src/tools/compat/configure diff -u src/tools/compat/configure:1.90 src/tools/compat/configure:1.91 --- src/tools/compat/configure:1.90 Wed Jun 13 00:17:43 2018 +++ src/tools/compat/configure Sat Aug 11 12:24:59 2018 @@ -5160,7 +5160,7 @@ for ac_func in atoll asprintf asnprintf pwrite raise_default_signal random reallocarr setenv \ setgroupent setprogname setpassent \ snprintb_m snprintf strlcat strlcpy strmode \ - strndup strnlen strsep strsuftoll strtoi strtoll strtou \ + strcasecmp strndup strnlen strsep strsuftoll strtoi strtoll strtou \ user_from_uid uid_from_user vasprintf vasnprintf vsnprintf do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` @@ -5254,6 +5254,19 @@ cat >>confdefs.h <<_ACEOF #define HAVE_DECL_PWCACHE_GROUPDB $ac_have_decl _ACEOF +ac_fn_c_check_decl "$LINENO" "strcasecmp" "ac_cv_have_decl_strcasecmp" " +#include + +" +if test "x$ac_cv_have_decl_strcasecmp" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRCASECMP $ac_have_decl +_ACEOF ac_fn_c_check_decl "$LINENO" "strlcpy" "ac_cv_have_decl_strlcpy" " #include Index: src/tools/compat/configure.ac diff -u src/tools/compat/configure.ac:1.91 src/tools/compat/configure.ac:1.92 --- src/tools/compat/configure.ac:1.91 Wed Jun 13 00:17:43 2018 +++ src/tools/compat/configure.ac Sat Aug 11 12:24:59 2018 @@ -1,4 +1,4 @@ -# $NetBSD: configure.ac,v 1.91 2018/06/13 04:17:43 maya Exp $ +# $NetBSD: configure.ac,v 1.92 2018/08/11 16:24:59 christos Exp $ # # Autoconf definition file for libnbcompat. # @@ -192,7 +192,7 @@ AC_CHECK_FUNCS(atoll asprintf asnprintf pwrite raise_default_signal random reallocarr setenv \ setgroupent setprogname setpassent \ snprintb_m snprintf strlcat strlcpy strmode \ - strndup strnlen strsep strsuftoll strtoi strtoll strtou \ + strcasecmp strndup strnlen strsep strsuftoll strtoi strtoll strtou \ user_from_uid uid_from_user vasprintf vasnprintf vsnprintf) AC_CHECK_DECLS([user_from_uid, uid_from_user, pwcache_userdb],,,[ @@ -201,7 +201,7 @@ AC_CHECK_DECLS([user_from_uid, uid_from_ AC_CHECK_DECLS([group_from_gid, gid_from_group, pwcache_groupdb],,,[ #include ]) -AC_CHECK_DECLS([strlcpy, strlcat, strndup, strnlen, strsep],,,[ +AC_CHECK_DECLS([strcasecmp, strlcpy, strlcat, strndup, strnlen, strsep],,,[ #include ]) AC_CHECK_DECLS([strsuftoll, mi_vector_hash],,,[#include ]) Index: src/tools/compat/nbtool_config.h.in diff -u src/tools/compat/nbtool_config.h.in:1.44 src/tools/compat/nbtool_config.h.in:1.45 --- src/tools/compat/nbtool_config.h.in:1.44 Wed Jun 13 00:17:43 2018 +++ src/tools/compat/nbtool_config.h.in Sat Aug 11 12:24:59 2018 @@ -1,6 +1,6 @@ /* nbtool_config.h.in. Generated from configure.ac
CVS commit: src/tools/compat
Module Name:src Committed By: maya Date: Wed Jun 13 04:17:43 UTC 2018 Modified Files: src/tools/compat: compat_defs.h configure configure.ac nbtool_config.h.in Log Message: Revert my previous config test inclusion for u_longlong_t. Fixing this differently by avoiding the need for the definition. It also caused a problem in OS X, as I neglected to include a correct header To generate a diff of this commit: cvs rdiff -u -r1.111 -r1.112 src/tools/compat/compat_defs.h cvs rdiff -u -r1.89 -r1.90 src/tools/compat/configure cvs rdiff -u -r1.90 -r1.91 src/tools/compat/configure.ac cvs rdiff -u -r1.43 -r1.44 src/tools/compat/nbtool_config.h.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.111 src/tools/compat/compat_defs.h:1.112 --- src/tools/compat/compat_defs.h:1.111 Tue Jun 12 23:52:56 2018 +++ src/tools/compat/compat_defs.h Wed Jun 13 04:17:43 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.111 2018/06/12 23:52:56 christos Exp $ */ +/* $NetBSD: compat_defs.h,v 1.112 2018/06/13 04:17:43 maya Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -68,10 +68,6 @@ typedef unsigned int u_int; typedef unsigned short u_short; #endif -#if !HAVE_U_LONGLONG_T -typedef uint64_t u_longlong_t; -#endif - /* System headers needed for (re)definitions below. */ #include Index: src/tools/compat/configure diff -u src/tools/compat/configure:1.89 src/tools/compat/configure:1.90 --- src/tools/compat/configure:1.89 Mon Jun 11 18:48:25 2018 +++ src/tools/compat/configure Wed Jun 13 04:17:43 2018 @@ -4227,17 +4227,6 @@ _ACEOF fi -ac_fn_c_check_type "$LINENO" "u_longlong_t" "ac_cv_type_u_longlong_t" "#include -" -if test "x$ac_cv_type_u_longlong_t" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_U_LONGLONG_T 1 -_ACEOF - - -fi - ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include #ifdef HAVE_RPC_TYPES_H #include Index: src/tools/compat/configure.ac diff -u src/tools/compat/configure.ac:1.90 src/tools/compat/configure.ac:1.91 --- src/tools/compat/configure.ac:1.90 Mon Jun 11 18:48:25 2018 +++ src/tools/compat/configure.ac Wed Jun 13 04:17:43 2018 @@ -1,4 +1,4 @@ -# $NetBSD: configure.ac,v 1.90 2018/06/11 18:48:25 maya Exp $ +# $NetBSD: configure.ac,v 1.91 2018/06/13 04:17:43 maya Exp $ # # Autoconf definition file for libnbcompat. # @@ -97,7 +97,6 @@ AC_CHECK_HEADERS(rpc/types.h netconfig.h # Typedefs. AC_TYPE_SIZE_T AC_CHECK_TYPES([id_t, long long, u_long, u_char, u_short, u_int, u_quad_t]) -AC_CHECK_TYPES([u_longlong_t],,, [#include ]) AC_CHECK_TYPE(socklen_t, [AC_DEFINE([HAVE_SOCKLEN_T], 1, [Define if you have the socklen_t type.])],, [#include Index: src/tools/compat/nbtool_config.h.in diff -u src/tools/compat/nbtool_config.h.in:1.43 src/tools/compat/nbtool_config.h.in:1.44 --- src/tools/compat/nbtool_config.h.in:1.43 Mon Jun 11 18:48:25 2018 +++ src/tools/compat/nbtool_config.h.in Wed Jun 13 04:17:43 2018 @@ -1,6 +1,6 @@ /* nbtool_config.h.in. Generated from configure.ac by autoheader. */ -/* $NetBSD: nbtool_config.h.in,v 1.43 2018/06/11 18:48:25 maya Exp $*/ +/* $NetBSD: nbtool_config.h.in,v 1.44 2018/06/13 04:17:43 maya Exp $*/ #ifndef __NETBSD_NBTOOL_CONFIG_H__ #define __NETBSD_NBTOOL_CONFIG_H__ @@ -780,9 +780,6 @@ /* Define to 1 if the system has the type `u_long'. */ #undef HAVE_U_LONG -/* Define to 1 if the system has the type `u_longlong_t'. */ -#undef HAVE_U_LONGLONG_T - /* Define to 1 if the system has the type `u_quad_t'. */ #undef HAVE_U_QUAD_T
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Tue Jun 12 23:52:56 UTC 2018 Modified Files: src/tools/compat: compat_defs.h Log Message: Move the typedefs before the header inclusions (except ) and explain why. To generate a diff of this commit: cvs rdiff -u -r1.110 -r1.111 src/tools/compat/compat_defs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.110 src/tools/compat/compat_defs.h:1.111 --- src/tools/compat/compat_defs.h:1.110 Mon Jun 11 14:48:24 2018 +++ src/tools/compat/compat_defs.h Tue Jun 12 19:52:56 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.110 2018/06/11 18:48:24 maya Exp $ */ +/* $NetBSD: compat_defs.h,v 1.111 2018/06/12 23:52:56 christos Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -30,6 +30,48 @@ #define __USE_ISOC99 1 #endif /* __linux__ && HAVE_FEATURES_H */ +/* + * Type substitutes. + * These are controlled via HAVE_TYPE protections and some of them are needed + * in other header files (in the build tree not in the host). This is because + * we are mixing the header files (which don't need them) with extensions + * such as the Solaris headers which depend on types defined by the native + * system headers, and might be missing in the build host. + */ + +#if !HAVE_ID_T +typedef unsigned int id_t; +#endif + +#if !HAVE_SOCKLEN_T +/* + * This is defined as int for compatibility with legacy systems (and not + * unsigned int), since universally it was int in most systems that did not + * define it. + */ +typedef int socklen_t; +#endif + +#if !HAVE_U_LONG +typedef unsigned long u_long; +#endif + +#if !HAVE_U_CHAR +typedef unsigned char u_char; +#endif + +#if !HAVE_U_INT +typedef unsigned int u_int; +#endif + +#if !HAVE_U_SHORT +typedef unsigned short u_short; +#endif + +#if !HAVE_U_LONGLONG_T +typedef uint64_t u_longlong_t; +#endif + /* System headers needed for (re)definitions below. */ #include @@ -193,37 +235,6 @@ struct group; # endif #endif -/* Type substitutes. */ - -#if !HAVE_ID_T -typedef unsigned int id_t; -#endif - -#if !HAVE_SOCKLEN_T -/* - * This is defined as int for compatibility with legacy systems (and not - * unsigned int), since universally it was int in most systems that did not - * define it. - */ -typedef int socklen_t; -#endif - -#if !HAVE_U_LONG -typedef unsigned long u_long; -#endif - -#if !HAVE_U_CHAR -typedef unsigned char u_char; -#endif - -#if !HAVE_U_INT -typedef unsigned int u_int; -#endif - -#if !HAVE_U_SHORT -typedef unsigned short u_short; -#endif - /* Prototypes for replacement functions. */ #if !HAVE_DECL_ATOLL @@ -1298,10 +1309,6 @@ __GEN_ENDIAN_DEC(64, le) #define NBBY 8 #endif -#if !HAVE_U_LONGLONG_T -typedef uint64_t u_longlong_t; -#endif - #if !HAVE_U_QUAD_T /* #define, not typedef, as quad_t exists as a struct on some systems */ #define quad_t long long
CVS commit: src/tools/compat
Module Name:src Committed By: maya Date: Mon Jun 11 18:48:25 UTC 2018 Modified Files: src/tools/compat: compat_defs.h configure configure.ac nbtool_config.h.in Log Message: Add configure check and fallback definition for u_longlong_t Should help linux tools compilation of dtrace tools, and not affect NetBSD. >From Chuck Zmudzinski in current-users, with light modification by myself. To generate a diff of this commit: cvs rdiff -u -r1.109 -r1.110 src/tools/compat/compat_defs.h cvs rdiff -u -r1.88 -r1.89 src/tools/compat/configure cvs rdiff -u -r1.89 -r1.90 src/tools/compat/configure.ac cvs rdiff -u -r1.42 -r1.43 src/tools/compat/nbtool_config.h.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.109 src/tools/compat/compat_defs.h:1.110 --- src/tools/compat/compat_defs.h:1.109 Tue Oct 3 01:43:03 2017 +++ src/tools/compat/compat_defs.h Mon Jun 11 18:48:24 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.109 2017/10/03 01:43:03 christos Exp $ */ +/* $NetBSD: compat_defs.h,v 1.110 2018/06/11 18:48:24 maya Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -1298,6 +1298,10 @@ __GEN_ENDIAN_DEC(64, le) #define NBBY 8 #endif +#if !HAVE_U_LONGLONG_T +typedef uint64_t u_longlong_t; +#endif + #if !HAVE_U_QUAD_T /* #define, not typedef, as quad_t exists as a struct on some systems */ #define quad_t long long Index: src/tools/compat/configure diff -u src/tools/compat/configure:1.88 src/tools/compat/configure:1.89 --- src/tools/compat/configure:1.88 Sat Dec 9 04:23:22 2017 +++ src/tools/compat/configure Mon Jun 11 18:48:25 2018 @@ -4227,6 +4227,17 @@ _ACEOF fi +ac_fn_c_check_type "$LINENO" "u_longlong_t" "ac_cv_type_u_longlong_t" "#include +" +if test "x$ac_cv_type_u_longlong_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_U_LONGLONG_T 1 +_ACEOF + + +fi + ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include #ifdef HAVE_RPC_TYPES_H #include Index: src/tools/compat/configure.ac diff -u src/tools/compat/configure.ac:1.89 src/tools/compat/configure.ac:1.90 --- src/tools/compat/configure.ac:1.89 Sat Dec 9 04:22:53 2017 +++ src/tools/compat/configure.ac Mon Jun 11 18:48:25 2018 @@ -1,4 +1,4 @@ -# $NetBSD: configure.ac,v 1.89 2017/12/09 04:22:53 sevan Exp $ +# $NetBSD: configure.ac,v 1.90 2018/06/11 18:48:25 maya Exp $ # # Autoconf definition file for libnbcompat. # @@ -97,6 +97,7 @@ AC_CHECK_HEADERS(rpc/types.h netconfig.h # Typedefs. AC_TYPE_SIZE_T AC_CHECK_TYPES([id_t, long long, u_long, u_char, u_short, u_int, u_quad_t]) +AC_CHECK_TYPES([u_longlong_t],,, [#include ]) AC_CHECK_TYPE(socklen_t, [AC_DEFINE([HAVE_SOCKLEN_T], 1, [Define if you have the socklen_t type.])],, [#include Index: src/tools/compat/nbtool_config.h.in diff -u src/tools/compat/nbtool_config.h.in:1.42 src/tools/compat/nbtool_config.h.in:1.43 --- src/tools/compat/nbtool_config.h.in:1.42 Sat Dec 9 04:23:22 2017 +++ src/tools/compat/nbtool_config.h.in Mon Jun 11 18:48:25 2018 @@ -1,6 +1,6 @@ /* nbtool_config.h.in. Generated from configure.ac by autoheader. */ -/* $NetBSD: nbtool_config.h.in,v 1.42 2017/12/09 04:23:22 sevan Exp $*/ +/* $NetBSD: nbtool_config.h.in,v 1.43 2018/06/11 18:48:25 maya Exp $*/ #ifndef __NETBSD_NBTOOL_CONFIG_H__ #define __NETBSD_NBTOOL_CONFIG_H__ @@ -780,6 +780,9 @@ /* Define to 1 if the system has the type `u_long'. */ #undef HAVE_U_LONG +/* Define to 1 if the system has the type `u_longlong_t'. */ +#undef HAVE_U_LONGLONG_T + /* Define to 1 if the system has the type `u_quad_t'. */ #undef HAVE_U_QUAD_T
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Sun Mar 11 18:32:44 UTC 2018 Modified Files: src/tools/compat: regex.h Log Message: undo previous; breaks the build. handle inside flex. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/tools/compat/regex.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/regex.h diff -u src/tools/compat/regex.h:1.4 src/tools/compat/regex.h:1.5 --- src/tools/compat/regex.h:1.4 Sun Mar 11 06:14:04 2018 +++ src/tools/compat/regex.h Sun Mar 11 14:32:43 2018 @@ -1,4 +1,3 @@ -/* $NetBSD: regex.h,v 1.4 2018/03/11 10:14:04 hans Exp $ */ +/* $NetBSD: regex.h,v 1.5 2018/03/11 18:32:43 christos Exp $ */ -#include "nbtool_config.h" #include "../../include/regex.h"
CVS commit: src/tools/compat
Module Name:src Committed By: hans Date: Sun Mar 11 10:14:04 UTC 2018 Modified Files: src/tools/compat: regex.h Log Message: Fix build of tools/lex on platforms lacking sys/cdefs.h by including nbtool_config.h in tools/compat/regex.h. Tested on illumos. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/tools/compat/regex.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/regex.h diff -u src/tools/compat/regex.h:1.3 src/tools/compat/regex.h:1.4 --- src/tools/compat/regex.h:1.3 Sun Mar 6 10:22:59 2016 +++ src/tools/compat/regex.h Sun Mar 11 10:14:04 2018 @@ -1,3 +1,4 @@ -/* $NetBSD: regex.h,v 1.3 2016/03/06 10:22:59 aymeric Exp $ */ +/* $NetBSD: regex.h,v 1.4 2018/03/11 10:14:04 hans Exp $ */ +#include "nbtool_config.h" #include "../../include/regex.h"
CVS commit: src/tools/compat
Module Name:src Committed By: sevan Date: Sat Dec 9 04:23:22 UTC 2017 Modified Files: src/tools/compat: configure nbtool_config.h.in Log Message: regen To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/tools/compat/configure cvs rdiff -u -r1.41 -r1.42 src/tools/compat/nbtool_config.h.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/configure diff -u src/tools/compat/configure:1.87 src/tools/compat/configure:1.88 --- src/tools/compat/configure:1.87 Mon Oct 2 22:21:31 2017 +++ src/tools/compat/configure Sat Dec 9 04:23:22 2017 @@ -4520,6 +4520,19 @@ fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_ASPRINTF $ac_have_decl _ACEOF +ac_fn_c_check_decl "$LINENO" "asnprintf" "ac_cv_have_decl_asnprintf" " +#include + +" +if test "x$ac_cv_have_decl_asnprintf" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ASNPRINTF $ac_have_decl +_ACEOF ac_fn_c_check_decl "$LINENO" "vasprintf" "ac_cv_have_decl_vasprintf" " #include @@ -4999,6 +5012,8 @@ else # ifdef _MSC_VER # include # define alloca _alloca +# elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) +# include # else # ifdef HAVE_ALLOCA_H # include Index: src/tools/compat/nbtool_config.h.in diff -u src/tools/compat/nbtool_config.h.in:1.41 src/tools/compat/nbtool_config.h.in:1.42 --- src/tools/compat/nbtool_config.h.in:1.41 Mon Oct 2 22:21:31 2017 +++ src/tools/compat/nbtool_config.h.in Sat Dec 9 04:23:22 2017 @@ -1,6 +1,6 @@ /* nbtool_config.h.in. Generated from configure.ac by autoheader. */ -/* $NetBSD: nbtool_config.h.in,v 1.41 2017/10/02 22:21:31 christos Exp $*/ +/* $NetBSD: nbtool_config.h.in,v 1.42 2017/12/09 04:23:22 sevan Exp $*/ #ifndef __NETBSD_NBTOOL_CONFIG_H__ #define __NETBSD_NBTOOL_CONFIG_H__ @@ -47,6 +47,10 @@ /* Define to 1 if you have the header file. */ #undef HAVE_CTYPE_H +/* Define to 1 if you have the declaration of `asnprintf', and to 0 if you + don't. */ +#undef HAVE_DECL_ASNPRINTF + /* Define to 1 if you have the declaration of `asprintf', and to 0 if you don't. */ #undef HAVE_DECL_ASPRINTF
CVS commit: src/tools/compat
Module Name:src Committed By: sevan Date: Sat Dec 9 04:22:53 UTC 2017 Modified Files: src/tools/compat: configure.ac Log Message: Add asnprintf() to the AC_CHECK_DECLS list. Resolves conflict when cross compiling on Cygwin the provided implementation does not get picked up. Closes PR toolchain/52797 To generate a diff of this commit: cvs rdiff -u -r1.88 -r1.89 src/tools/compat/configure.ac Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/configure.ac diff -u src/tools/compat/configure.ac:1.88 src/tools/compat/configure.ac:1.89 --- src/tools/compat/configure.ac:1.88 Mon Oct 2 22:19:45 2017 +++ src/tools/compat/configure.ac Sat Dec 9 04:22:53 2017 @@ -1,4 +1,4 @@ -# $NetBSD: configure.ac,v 1.88 2017/10/02 22:19:45 christos Exp $ +# $NetBSD: configure.ac,v 1.89 2017/12/09 04:22:53 sevan Exp $ # # Autoconf definition file for libnbcompat. # @@ -140,7 +140,7 @@ AC_CHECK_MEMBERS(struct statvfs.f_iosize AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include ]) # Global variable decls. -AC_CHECK_DECLS([asprintf, vasprintf, vasnprintf, vsnprintf, fgetln, fparseln, +AC_CHECK_DECLS([asprintf, asnprintf, vasprintf, vasnprintf, vsnprintf, fgetln, fparseln, fpurge, getdelim, getline, snprintf],,, [ #include ])
CVS commit: src/tools/compat
Module Name:src Committed By: joerg Date: Tue Oct 3 10:28:30 UTC 2017 Modified Files: src/tools/compat: fpurge.c Log Message: Be consistent with our header. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tools/compat/fpurge.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/fpurge.c diff -u src/tools/compat/fpurge.c:1.2 src/tools/compat/fpurge.c:1.3 --- src/tools/compat/fpurge.c:1.2 Mon Oct 2 22:19:45 2017 +++ src/tools/compat/fpurge.c Tue Oct 3 10:28:30 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: fpurge.c,v 1.2 2017/10/02 22:19:45 christos Exp $ */ +/* $NetBSD: fpurge.c,v 1.3 2017/10/03 10:28:30 joerg Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -42,11 +42,12 @@ #include #include -void +int fpurge(FILE *fp) { #if HAVE___FPURGE __fpurge(fp); #endif + return 0; } #endif
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Tue Oct 3 01:43:03 UTC 2017 Modified Files: src/tools/compat: compat_defs.h Log Message: fix fpurge declaration To generate a diff of this commit: cvs rdiff -u -r1.108 -r1.109 src/tools/compat/compat_defs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.108 src/tools/compat/compat_defs.h:1.109 --- src/tools/compat/compat_defs.h:1.108 Mon Oct 2 18:19:45 2017 +++ src/tools/compat/compat_defs.h Mon Oct 2 21:43:03 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.108 2017/10/02 22:19:45 christos Exp $ */ +/* $NetBSD: compat_defs.h,v 1.109 2017/10/03 01:43:03 christos Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -253,7 +253,7 @@ char *dirname(char *); #endif #if !HAVE_DECL_FPURGE -void fpurge(FILE *); +int fpurge(FILE *); #endif #if !HAVE_DIRFD
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Mon Oct 2 22:21:31 UTC 2017 Modified Files: src/tools/compat: configure nbtool_config.h.in Log Message: regen To generate a diff of this commit: cvs rdiff -u -r1.86 -r1.87 src/tools/compat/configure cvs rdiff -u -r1.40 -r1.41 src/tools/compat/nbtool_config.h.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/configure diff -u src/tools/compat/configure:1.86 src/tools/compat/configure:1.87 --- src/tools/compat/configure:1.86 Sat Jan 7 16:31:07 2017 +++ src/tools/compat/configure Mon Oct 2 18:21:31 2017 @@ -4097,7 +4097,7 @@ fi fi -for ac_header in sys/mtio.h sys/sysmacros.h sys/syslimits.h \ +for ac_header in sys/mtio.h sys/sysmacros.h sys/syslimits.h stdio_ext.h \ getopt.h features.h malloc.h sys/poll.h pthread.h stddef.h rpc/types.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` @@ -4572,19 +4572,44 @@ fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FGETLN $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "fparseln - getdelim" "ac_cv_have_decl_fparseln__getdelim" " +ac_fn_c_check_decl "$LINENO" "fparseln" "ac_cv_have_decl_fparseln" " #include " -if test "x$ac_cv_have_decl_fparseln__getdelim" = xyes; then : +if test "x$ac_cv_have_decl_fparseln" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPARSELN__GETDELIM $ac_have_decl +#define HAVE_DECL_FPARSELN $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "fpurge" "ac_cv_have_decl_fpurge" " +#include + +" +if test "x$ac_cv_have_decl_fpurge" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPURGE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "getdelim" "ac_cv_have_decl_getdelim" " +#include + +" +if test "x$ac_cv_have_decl_getdelim" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETDELIM $ac_have_decl _ACEOF ac_fn_c_check_decl "$LINENO" "getline" "ac_cv_have_decl_getline" " #include @@ -4974,8 +4999,6 @@ else # ifdef _MSC_VER # include # define alloca _alloca -# elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) -# include # else # ifdef HAVE_ALLOCA_H # include Index: src/tools/compat/nbtool_config.h.in diff -u src/tools/compat/nbtool_config.h.in:1.40 src/tools/compat/nbtool_config.h.in:1.41 --- src/tools/compat/nbtool_config.h.in:1.40 Sat Jan 7 16:31:07 2017 +++ src/tools/compat/nbtool_config.h.in Mon Oct 2 18:21:31 2017 @@ -1,6 +1,6 @@ /* nbtool_config.h.in. Generated from configure.ac by autoheader. */ -/* $NetBSD: nbtool_config.h.in,v 1.40 2017/01/07 21:31:07 christos Exp $*/ +/* $NetBSD: nbtool_config.h.in,v 1.41 2017/10/02 22:21:31 christos Exp $*/ #ifndef __NETBSD_NBTOOL_CONFIG_H__ #define __NETBSD_NBTOOL_CONFIG_H__ @@ -126,14 +126,22 @@ */ #undef HAVE_DECL_FGETLN -/* Define to 1 if you have the declaration of `fparseln getdelim', and to 0 if - you don't. */ -#undef HAVE_DECL_FPARSELN__GETDELIM +/* Define to 1 if you have the declaration of `fparseln', and to 0 if you + don't. */ +#undef HAVE_DECL_FPARSELN + +/* Define to 1 if you have the declaration of `fpurge', and to 0 if you don't. + */ +#undef HAVE_DECL_FPURGE /* Define to 1 if you have the declaration of `fstatvfs', and to 0 if you don't. */ #undef HAVE_DECL_FSTATVFS +/* Define to 1 if you have the declaration of `getdelim', and to 0 if you + don't. */ +#undef HAVE_DECL_GETDELIM + /* Define to 1 if you have the declaration of `getline', and to 0 if you don't. */ #undef HAVE_DECL_GETLINE @@ -613,6 +621,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_EXT_H + /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Mon Oct 2 22:19:45 UTC 2017 Modified Files: src/tools/compat: compat_defs.h configure.ac fpurge.c Log Message: handle __fpurge being declared in To generate a diff of this commit: cvs rdiff -u -r1.107 -r1.108 src/tools/compat/compat_defs.h cvs rdiff -u -r1.87 -r1.88 src/tools/compat/configure.ac cvs rdiff -u -r1.1 -r1.2 src/tools/compat/fpurge.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.107 src/tools/compat/compat_defs.h:1.108 --- src/tools/compat/compat_defs.h:1.107 Sat Jan 7 16:29:30 2017 +++ src/tools/compat/compat_defs.h Mon Oct 2 18:19:45 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.107 2017/01/07 21:29:30 christos Exp $ */ +/* $NetBSD: compat_defs.h,v 1.108 2017/10/02 22:19:45 christos Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -252,6 +252,10 @@ extern int optind, opterr, optopt; char *dirname(char *); #endif +#if !HAVE_DECL_FPURGE +void fpurge(FILE *); +#endif + #if !HAVE_DIRFD #if HAVE_DIR_DD_FD #define dirfd(dirp) ((dirp)->dd_fd) Index: src/tools/compat/configure.ac diff -u src/tools/compat/configure.ac:1.87 src/tools/compat/configure.ac:1.88 --- src/tools/compat/configure.ac:1.87 Sat Jan 7 16:30:42 2017 +++ src/tools/compat/configure.ac Mon Oct 2 18:19:45 2017 @@ -1,4 +1,4 @@ -# $NetBSD: configure.ac,v 1.87 2017/01/07 21:30:42 christos Exp $ +# $NetBSD: configure.ac,v 1.88 2017/10/02 22:19:45 christos Exp $ # # Autoconf definition file for libnbcompat. # @@ -78,7 +78,7 @@ AC_CHECK_HEADERS(sys/ioctl.h sys/mman.h # Find headers that may not be available. AC_HEADER_DIRENT -AC_CHECK_HEADERS(sys/mtio.h sys/sysmacros.h sys/syslimits.h \ +AC_CHECK_HEADERS(sys/mtio.h sys/sysmacros.h sys/syslimits.h stdio_ext.h \ getopt.h features.h malloc.h sys/poll.h pthread.h stddef.h rpc/types.h) AC_CHECK_HEADERS(sys/bswap.h machine/bswap.h sys/cdefs.h machine/endian.h \ sys/endian.h sys/featuretest.h err.h inttypes.h libgen.h paths.h \ @@ -140,8 +140,8 @@ AC_CHECK_MEMBERS(struct statvfs.f_iosize AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include ]) # Global variable decls. -AC_CHECK_DECLS([asprintf, vasprintf, vasnprintf, vsnprintf, fgetln, fparseln - getdelim, getline, snprintf],,, [ +AC_CHECK_DECLS([asprintf, vasprintf, vasnprintf, vsnprintf, fgetln, fparseln, + fpurge, getdelim, getline, snprintf],,, [ #include ]) Index: src/tools/compat/fpurge.c diff -u src/tools/compat/fpurge.c:1.1 src/tools/compat/fpurge.c:1.2 --- src/tools/compat/fpurge.c:1.1 Tue Jun 16 18:35:34 2009 +++ src/tools/compat/fpurge.c Mon Oct 2 18:19:45 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: fpurge.c,v 1.1 2009/06/16 22:35:34 christos Exp $ */ +/* $NetBSD: fpurge.c,v 1.2 2017/10/02 22:19:45 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -36,6 +36,9 @@ #include "nbtool_config.h" #if !HAVE_FPURGE +#if HAVE_STDIO_EXT_H +#include +#endif #include #include
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Sat Jan 7 21:31:07 UTC 2017 Modified Files: src/tools/compat: configure nbtool_config.h.in Log Message: regen To generate a diff of this commit: cvs rdiff -u -r1.85 -r1.86 src/tools/compat/configure cvs rdiff -u -r1.39 -r1.40 src/tools/compat/nbtool_config.h.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/configure diff -u src/tools/compat/configure:1.85 src/tools/compat/configure:1.86 --- src/tools/compat/configure:1.85 Wed Oct 19 17:55:26 2016 +++ src/tools/compat/configure Sat Jan 7 16:31:07 2017 @@ -4113,7 +4113,7 @@ done for ac_header in sys/bswap.h machine/bswap.h sys/cdefs.h machine/endian.h \ sys/endian.h sys/featuretest.h err.h inttypes.h libgen.h paths.h \ - stdint.h util.h resolv.h arpa/nameser.h + libgen.h stdint.h util.h resolv.h arpa/nameser.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -4507,6 +4507,374 @@ fi # Global variable decls. +ac_fn_c_check_decl "$LINENO" "asprintf" "ac_cv_have_decl_asprintf" " +#include + +" +if test "x$ac_cv_have_decl_asprintf" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ASPRINTF $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "vasprintf" "ac_cv_have_decl_vasprintf" " +#include + +" +if test "x$ac_cv_have_decl_vasprintf" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VASPRINTF $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "vasnprintf" "ac_cv_have_decl_vasnprintf" " +#include + +" +if test "x$ac_cv_have_decl_vasnprintf" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VASNPRINTF $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "vsnprintf" "ac_cv_have_decl_vsnprintf" " +#include + +" +if test "x$ac_cv_have_decl_vsnprintf" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VSNPRINTF $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "fgetln" "ac_cv_have_decl_fgetln" " +#include + +" +if test "x$ac_cv_have_decl_fgetln" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FGETLN $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "fparseln + getdelim" "ac_cv_have_decl_fparseln__getdelim" " +#include + +" +if test "x$ac_cv_have_decl_fparseln__getdelim" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPARSELN__GETDELIM $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "getline" "ac_cv_have_decl_getline" " +#include + +" +if test "x$ac_cv_have_decl_getline" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETLINE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" " +#include + +" +if test "x$ac_cv_have_decl_snprintf" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SNPRINTF $ac_have_decl +_ACEOF + + +ac_fn_c_check_decl "$LINENO" "atoll" "ac_cv_have_decl_atoll" " +#include + +" +if test "x$ac_cv_have_decl_atoll" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ATOLL $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "heapsort" "ac_cv_have_decl_heapsort" " +#include + +" +if test "x$ac_cv_have_decl_heapsort" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_HEAPSORT $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "mkdtemp" "ac_cv_have_decl_mkdtemp" " +#include + +" +if test "x$ac_cv_have_decl_mkdtemp" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_MKDTEMP $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "mkstemp" "ac_cv_have_decl_mkstemp" " +#include + +" +if test "x$ac_cv_have_decl_mkstemp" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_MKSTEMP $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "reallocarr" "ac_cv_have_decl_reallocarr" " +#include + +" +if test "x$ac_cv_have_decl_reallocarr" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_REALLOCARR $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "setenv" "ac_cv_have_decl_setenv" " +#include + +" +if test "x$ac_cv_have_decl_setenv" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SETENV $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "strtoi" "ac_cv_have_decl_strtoi" " +#include + +" +if test
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Sat Jan 7 21:30:42 UTC 2017 Modified Files: src/tools/compat: configure.ac Log Message: strmode on MacOS/X is in string.h To generate a diff of this commit: cvs rdiff -u -r1.86 -r1.87 src/tools/compat/configure.ac Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/configure.ac diff -u src/tools/compat/configure.ac:1.86 src/tools/compat/configure.ac:1.87 --- src/tools/compat/configure.ac:1.86 Fri Jan 6 21:52:04 2017 +++ src/tools/compat/configure.ac Sat Jan 7 16:30:42 2017 @@ -1,4 +1,4 @@ -# $NetBSD: configure.ac,v 1.86 2017/01/07 02:52:04 christos Exp $ +# $NetBSD: configure.ac,v 1.87 2017/01/07 21:30:42 christos Exp $ # # Autoconf definition file for libnbcompat. # @@ -158,10 +158,15 @@ AC_CHECK_DECLS([raise_default_signal],,, #include ]) -AC_CHECK_DECLS([issetugid, pread, pwrite, strmode],,, [ +AC_CHECK_DECLS([issetugid, pread, pwrite],,, [ #include ]) +AC_CHECK_DECLS([strmode],,, [ +#include +#include +]) + AC_CHECK_DECLS([isblank],,, [ #include ])
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Sat Jan 7 21:29:30 UTC 2017 Modified Files: src/tools/compat: compat_defs.h Log Message: adjust for SSP (MacOS/X) To generate a diff of this commit: cvs rdiff -u -r1.106 -r1.107 src/tools/compat/compat_defs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.106 src/tools/compat/compat_defs.h:1.107 --- src/tools/compat/compat_defs.h:1.106 Fri Jan 6 21:55:19 2017 +++ src/tools/compat/compat_defs.h Sat Jan 7 16:29:30 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.106 2017/01/07 02:55:19 christos Exp $ */ +/* $NetBSD: compat_defs.h,v 1.107 2017/01/07 21:29:30 christos Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -529,7 +529,7 @@ int snprintb(char *, size_t, const char int snprintb_m(char *, size_t, const char *, uint64_t, size_t); #endif -#if !HAVE_DECL_SNPRINTF +#if !HAVE_DECL_SNPRINTF && !defined(snprintf) int snprintf(char *, size_t, const char *, ...); #endif @@ -581,7 +581,7 @@ int vasprintf(char **, const char *, va_ int vasnprintf(char **, size_t, const char *, va_list); #endif -#if !HAVE_DECL_VSNPRINTF +#if !HAVE_DECL_VSNPRINTF && !defined(vsnprintf) int vsnprintf(char *, size_t, const char *, va_list); #endif
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Sat Jan 7 02:55:19 UTC 2017 Modified Files: src/tools/compat: compat_defs.h Log Message: need ctype.h To generate a diff of this commit: cvs rdiff -u -r1.105 -r1.106 src/tools/compat/compat_defs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.105 src/tools/compat/compat_defs.h:1.106 --- src/tools/compat/compat_defs.h:1.105 Fri Jan 6 21:52:04 2017 +++ src/tools/compat/compat_defs.h Fri Jan 6 21:55:19 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.105 2017/01/07 02:52:04 christos Exp $ */ +/* $NetBSD: compat_defs.h,v 1.106 2017/01/07 02:55:19 christos Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Sat Jan 7 02:52:04 UTC 2017 Modified Files: src/tools/compat: compat_defs.h configure.ac Log Message: Check for declarations, not the existance of functions since some are visible only when _NETBSD_SOURCE is defined. This avoids || defined(__NetBSD__) hacks. To generate a diff of this commit: cvs rdiff -u -r1.104 -r1.105 src/tools/compat/compat_defs.h cvs rdiff -u -r1.85 -r1.86 src/tools/compat/configure.ac Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.104 src/tools/compat/compat_defs.h:1.105 --- src/tools/compat/compat_defs.h:1.104 Wed Oct 19 17:54:20 2016 +++ src/tools/compat/compat_defs.h Fri Jan 6 21:52:04 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.104 2016/10/19 21:54:20 christos Exp $ */ +/* $NetBSD: compat_defs.h,v 1.105 2017/01/07 02:52:04 christos Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -46,6 +46,9 @@ #include #include #include +#if HAVE_ERR_H +#include +#endif #if HAVE_SYS_CDEFS_H #include @@ -63,6 +66,9 @@ #if HAVE_STDDEF_H #include #endif +#if HAVE_LIBGEN_H +#include +#endif #if HAVE_RPC_TYPES_H #include @@ -219,19 +225,19 @@ typedef unsigned short u_short; /* Prototypes for replacement functions. */ -#if !HAVE_ATOLL +#if !HAVE_DECL_ATOLL long long int atoll(const char *); #endif -#if !HAVE_ASPRINTF +#if !HAVE_DECL_ASPRINTF int asprintf(char **, const char *, ...); #endif -#if !HAVE_ASNPRINTF +#if !HAVE_DECL_ASNPRINTF int asnprintf(char **, size_t, const char *, ...); #endif -#if !HAVE_BASENAME +#if !HAVE_DECL_BASENAME char *basename(char *); #endif @@ -241,7 +247,7 @@ extern char *optarg; extern int optind, opterr, optopt; #endif -#if !HAVE_DIRNAME +#if !HAVE_DECL_DIRNAME char *dirname(char *); #endif @@ -323,10 +329,10 @@ int easprintf(char **, const char *, ... int evasprintf(char **, const char *, va_list); #endif -#if !HAVE_FGETLN || defined(__NetBSD__) +#if !HAVE_DECL_FGETLN char *fgetln(FILE *, size_t *); #endif -#if !HAVE_DPRINTF +#if !HAVE_DECL_DPRINTF int dprintf(int, const char *, ...); #endif @@ -338,7 +344,7 @@ int dprintf(int, const char *, ...); int flock(int, int); #endif -#if !HAVE_FPARSELN || BROKEN_FPARSELN || defined(__NetBSD__) +#if !HAVE_DECL_FPARSELN || BROKEN_FPARSELN # define FPARSELN_UNESCESC 0x01 # define FPARSELN_UNESCCONT 0x02 # define FPARSELN_UNESCCOMM 0x04 @@ -347,16 +353,18 @@ int flock(int, int); char *fparseln(FILE *, size_t *, size_t *, const char [3], int); #endif -#if !HAVE_GETLINE +#if !HAVE_DECL_GETDELIM ssize_t getdelim(char **, size_t *, int, FILE *); +#endif +#if !HAVE_DECL_GETLINE ssize_t getline(char **, size_t *, FILE *); #endif -#if !HAVE_ISSETUGID +#if !HAVE_DECL_ISSETUGID int issetugid(void); #endif -#if !HAVE_ISBLANK && !defined(isblank) +#if !HAVE_DECL_ISBLANK && !defined(isblank) #define isblank(x) ((x) == ' ' || (x) == '\t') #endif @@ -389,11 +397,11 @@ int issetugid(void); #define bswap64(x) __nbcompat_bswap64(x) #endif -#if !HAVE_MKSTEMP +#if !HAVE_DECL_MKSTEMP int mkstemp(char *); #endif -#if !HAVE_MKDTEMP +#if !HAVE_DECL_MKDTEMP char *mkdtemp(char *); #endif @@ -403,11 +411,11 @@ char *mkdtemp(char *); int __nbcompat_gettemp(char *, int *, int); #endif -#if !HAVE_PREAD +#if !HAVE_DECL_PREAD ssize_t pread(int, void *, size_t, off_t); #endif -#if !HAVE_HEAPSORT +#if !HAVE_DECL_HEAPSORT int heapsort (void *, size_t, size_t, int (*)(const void *, const void *)); #endif /* Make them use our version */ @@ -484,7 +492,7 @@ int lchmod(const char *, mode_t); int lchown(const char *, uid_t, gid_t); #endif -#if !HAVE_PWRITE +#if !HAVE_DECL_PWRITE ssize_t pwrite(int, const void *, size_t, off_t); #endif @@ -492,11 +500,11 @@ ssize_t pwrite(int, const void *, size_t int raise_default_signal(int); #endif -#if !HAVE_REALLOCARR +#if !HAVE_DECL_REALLOCARR int reallocarr(void *, size_t, size_t); #endif -#if !HAVE_SETENV +#if !HAVE_DECL_SETENV int setenv(const char *, const char *, int); #endif @@ -508,8 +516,10 @@ int setgroupent(int); int setpassent(int); #endif -#if !HAVE_SETPROGNAME || defined(__NetBSD__) +#if !HAVE_DECL_GETPROGNAME const char *getprogname(void); +#endif +#if !HAVE_DECL_SETPROGNAME void setprogname(const char *); #endif @@ -518,27 +528,19 @@ int snprintb(char *, size_t, const char int snprintb_m(char *, size_t, const char *, uint64_t, size_t); #endif -#if !HAVE_SNPRINTF +#if !HAVE_DECL_SNPRINTF int snprintf(char *, size_t, const char *, ...); #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_STRMODE +#if !HAVE_DECL_STRMODE void strmode(mode_t, char *); #endif -#if !HAVE_STRNDUP +#if
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Wed Oct 19 21:55:26 UTC 2016 Modified Files: src/tools/compat: configure nbtool_config.h.in Log Message: regen To generate a diff of this commit: cvs rdiff -u -r1.84 -r1.85 src/tools/compat/configure cvs rdiff -u -r1.38 -r1.39 src/tools/compat/nbtool_config.h.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/configure diff -u src/tools/compat/configure:1.84 src/tools/compat/configure:1.85 --- src/tools/compat/configure:1.84 Wed Jan 20 14:35:32 2016 +++ src/tools/compat/configure Wed Oct 19 17:55:26 2016 @@ -4846,7 +4846,35 @@ cat >>confdefs.h <<_ACEOF #define HAVE_DECL_PWCACHE_GROUPDB $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "strndup" "ac_cv_have_decl_strndup" "#include +ac_fn_c_check_decl "$LINENO" "strlcpy" "ac_cv_have_decl_strlcpy" " +#include + +" +if test "x$ac_cv_have_decl_strlcpy" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRLCPY $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "strlcat" "ac_cv_have_decl_strlcat" " +#include + +" +if test "x$ac_cv_have_decl_strlcat" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRLCAT $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "strndup" "ac_cv_have_decl_strndup" " +#include + " if test "x$ac_cv_have_decl_strndup" = xyes; then : ac_have_decl=1 @@ -4857,7 +4885,9 @@ fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRNDUP $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "#include +ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" " +#include + " if test "x$ac_cv_have_decl_strnlen" = xyes; then : ac_have_decl=1 @@ -4880,6 +4910,17 @@ fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRSUFTOLL $ac_have_decl _ACEOF +ac_fn_c_check_decl "$LINENO" "mi_vector_hash" "ac_cv_have_decl_mi_vector_hash" "#include +" +if test "x$ac_cv_have_decl_mi_vector_hash" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_MI_VECTOR_HASH $ac_have_decl +_ACEOF ac_fn_c_check_decl "$LINENO" "lchflags" "ac_cv_have_decl_lchflags" " #include @@ -4925,6 +4966,21 @@ cat >>confdefs.h <<_ACEOF _ACEOF +ac_fn_c_check_decl "$LINENO" "err" "ac_cv_have_decl_err" " +#ifdef HAVE_ERR_H +#include +#endif + +" +if test "x$ac_cv_have_decl_err" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ERR $ac_have_decl +_ACEOF ac_fn_c_check_decl "$LINENO" "errc" "ac_cv_have_decl_errc" " #ifdef HAVE_ERR_H #include @@ -4940,6 +4996,21 @@ fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_ERRC $ac_have_decl _ACEOF +ac_fn_c_check_decl "$LINENO" "errx" "ac_cv_have_decl_errx" " +#ifdef HAVE_ERR_H +#include +#endif + +" +if test "x$ac_cv_have_decl_errx" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ERRX $ac_have_decl +_ACEOF ac_fn_c_check_decl "$LINENO" "verrc" "ac_cv_have_decl_verrc" " #ifdef HAVE_ERR_H #include @@ -4955,6 +5026,36 @@ fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_VERRC $ac_have_decl _ACEOF +ac_fn_c_check_decl "$LINENO" "verrx" "ac_cv_have_decl_verrx" " +#ifdef HAVE_ERR_H +#include +#endif + +" +if test "x$ac_cv_have_decl_verrx" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VERRX $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "warn" "ac_cv_have_decl_warn" " +#ifdef HAVE_ERR_H +#include +#endif + +" +if test "x$ac_cv_have_decl_warn" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_WARN $ac_have_decl +_ACEOF ac_fn_c_check_decl "$LINENO" "warnc" "ac_cv_have_decl_warnc" " #ifdef HAVE_ERR_H #include @@ -4970,6 +5071,21 @@ fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_WARNC $ac_have_decl _ACEOF +ac_fn_c_check_decl "$LINENO" "warnx" "ac_cv_have_decl_warnx" " +#ifdef HAVE_ERR_H +#include +#endif + +" +if test "x$ac_cv_have_decl_warnx" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_WARNX $ac_have_decl +_ACEOF ac_fn_c_check_decl "$LINENO" "vwarnc" "ac_cv_have_decl_vwarnc" " #ifdef HAVE_ERR_H #include @@ -4985,6 +5101,21 @@ fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_VWARNC $ac_have_decl _ACEOF +ac_fn_c_check_decl "$LINENO" "vwarnx" "ac_cv_have_decl_vwarnx" " +#ifdef HAVE_ERR_H +#include +#endif + +" +if test "x$ac_cv_have_decl_vwarnx" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VWARNX $ac_have_decl +_ACEOF ac_fn_c_check_decl "$LINENO" "htobe16" "ac_cv_have_decl_htobe16" "#include Index: src/tools/compat/nbtool_config.h.in diff -u
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Wed Oct 19 21:54:20 UTC 2016 Modified Files: src/tools/compat: compat_defs.h configure.ac Log Message: try to fix missing decls To generate a diff of this commit: cvs rdiff -u -r1.103 -r1.104 src/tools/compat/compat_defs.h cvs rdiff -u -r1.84 -r1.85 src/tools/compat/configure.ac Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.103 src/tools/compat/compat_defs.h:1.104 --- src/tools/compat/compat_defs.h:1.103 Mon Sep 21 17:50:16 2015 +++ src/tools/compat/compat_defs.h Wed Oct 19 17:54:20 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.103 2015/09/21 21:50:16 pooka Exp $ */ +/* $NetBSD: compat_defs.h,v 1.104 2016/10/19 21:54:20 christos Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -272,26 +272,43 @@ struct _dirdesc { #endif #endif -#if !HAVE_ERR_H +#if !HAVE_DECL_ERR void err(int, const char *, ...); +#endif +#if !HAVE_DECL_ERRC +void errc(int, int, const char *, ...); +#endif +#if !HAVE_DECL_ERRX void errx(int, const char *, ...); +#endif +#if !HAVE_DECL_VERRC +void verrc(int, int, const char *, va_list); +#endif +#if !HAVE_DECL_VERRX +void verrx(int, const char *, va_list); +#endif +#if !HAVE_DECL_WARN void warn(const char *, ...); -void warnx(const char *, ...); -void vwarnx(const char *, va_list); #endif #if !HAVE_DECL_WARNC void warnc(int, const char *, ...); #endif +#if !HAVE_DECL_WARNX +void warnx(const char *, ...); +#endif #if !HAVE_DECL_VWARNC void vwarnc(int, const char *, va_list); #endif -#if !HAVE_DECL_ERRC -void errc(int, int, const char *, ...); +#if !HAVE_DECL_VWARNX +void vwarnx(const char *, va_list); #endif -#if !HAVE_DECL_VERRC -void verrc(int, int, const char *, va_list); + +#if !HAVE_DECL_MI_VECTOR_HASH +void mi_vector_hash(const void * __restrict, size_t, uint32_t, +uint32_t[3]); #endif + #if !HAVE_ESETFUNC void (*esetfunc(void (*)(int, const char *, ...)))(int, const char *, ...); size_t estrlcpy(char *, const char *, size_t); @@ -445,6 +462,12 @@ int pwcache_groupdb(int (*)(int), void ( struct group * (*)(const char *), struct group * (*)(gid_t)); #endif +#if !HAVE_DECL_STRLCAT +size_t strlcat(char *, const char *, size_t); +#endif +#if !HAVE_DECL_STRLCPY +size_t strlcpy(char *, const char *, size_t); +#endif #if !HAVE_DECL_STRNDUP char *strndup(const char *, size_t); #endif Index: src/tools/compat/configure.ac diff -u src/tools/compat/configure.ac:1.84 src/tools/compat/configure.ac:1.85 --- src/tools/compat/configure.ac:1.84 Sun Jul 26 10:01:53 2015 +++ src/tools/compat/configure.ac Wed Oct 19 17:54:20 2016 @@ -1,4 +1,4 @@ -# $NetBSD: configure.ac,v 1.84 2015/07/26 14:01:53 kamil Exp $ +# $NetBSD: configure.ac,v 1.85 2016/10/19 21:54:20 christos Exp $ # # Autoconf definition file for libnbcompat. # @@ -169,14 +169,16 @@ AC_CHECK_DECLS([user_from_uid, uid_from_ AC_CHECK_DECLS([group_from_gid, gid_from_group, pwcache_groupdb],,,[ #include ]) -AC_CHECK_DECLS([strndup, strnlen],,,[#include ]) -AC_CHECK_DECLS([strsuftoll],,,[#include ]) +AC_CHECK_DECLS([strlcpy, strlcat, strndup, strnlen],,,[ +#include +]) +AC_CHECK_DECLS([strsuftoll, mi_vector_hash],,,[#include ]) AC_CHECK_DECLS([lchflags, lchmod, lchown],,,[ #include #include ]) -AC_CHECK_DECLS([errc, verrc, warnc, vwarnc],,, [ +AC_CHECK_DECLS([err, errc, errx, verrc, verrx, warn, warnc, warnx, vwarnc, vwarnx],,, [ #ifdef HAVE_ERR_H #include #endif
CVS commit: src/tools/compat
Module Name:src Committed By: aymeric Date: Sun Mar 6 10:22:59 UTC 2016 Added Files: src/tools/compat: regex.h Log Message: add our libc's regex implementation to libnbcompat. This way, nbsed picks it up and it unbreaks the build of xf86-video-intel-old's man page under Linux and probably other future changes which rightfully expect the (net)bsd behaviour. Full release tested on ArchLinux and NetBSD 7.0_STABLE To generate a diff of this commit: cvs rdiff -u -r0 -r1.3 src/tools/compat/regex.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/tools/compat/regex.h diff -u /dev/null src/tools/compat/regex.h:1.3 --- /dev/null Sun Mar 6 10:22:59 2016 +++ src/tools/compat/regex.h Sun Mar 6 10:22:59 2016 @@ -0,0 +1,3 @@ +/* $NetBSD: regex.h,v 1.3 2016/03/06 10:22:59 aymeric Exp $ */ + +#include "../../include/regex.h"
CVS commit: src/tools/compat
Module Name:src Committed By: martin Date: Tue Mar 1 10:11:07 UTC 2016 Removed Files: src/tools/compat: regex.h Log Message: Remove regexp.h here temporarily To generate a diff of this commit: cvs rdiff -u -r1.1 -r0 src/tools/compat/regex.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tools/compat
Module Name:src Committed By: martin Date: Tue Mar 1 10:09:00 UTC 2016 Modified Files: src/tools/compat: Makefile Log Message: Revert to rev 1.77 for now on Aymeric's request To generate a diff of this commit: cvs rdiff -u -r1.79 -r1.80 src/tools/compat/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.79 src/tools/compat/Makefile:1.80 --- src/tools/compat/Makefile:1.79 Tue Mar 1 06:48:55 2016 +++ src/tools/compat/Makefile Tue Mar 1 10:09:00 2016 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.79 2016/03/01 06:48:55 aymeric Exp $ +# $NetBSD: Makefile,v 1.80 2016/03/01 10:09:00 martin Exp $ HOSTLIB= nbcompat @@ -14,7 +14,6 @@ SRCS= atoll.c basename.c cdbr.c cdbw.c mkstemp.c pread.c putc_unlocked.c pwcache.c pwrite.c \ pw_scan.c \ raise_default_signal.c reallocarr.c rmd160.c rmd160hl.c \ - regcomp.c regerror.c regexec.c regfree.c \ setenv.c setgroupent.c \ setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \ sha256hl.c sha384hl.c sha512hl.c snprintb.c snprintf.c \ @@ -48,7 +47,6 @@ CPPFLAGS+= -I. -I./include -I${.CURDIR} ${.CURDIR}/../../lib/libc/hash/sha1 \ ${.CURDIR}/../../lib/libc/hash/sha2 \ ${.CURDIR}/../../lib/libc/md \ - ${.CURDIR}/../../lib/libc/regex \ ${.CURDIR}/../../lib/libc/stdio \ ${.CURDIR}/../../lib/libc/stdlib \ ${.CURDIR}/../../lib/libc/string \
CVS commit: src/tools/compat
Module Name:src Committed By: aymeric Date: Tue Mar 1 06:48:55 UTC 2016 Modified Files: src/tools/compat: Makefile Log Message: remove regsub.c from the list of files to build because it unbreaks the build and this API is not yet endorsed. OK christos@ To generate a diff of this commit: cvs rdiff -u -r1.78 -r1.79 src/tools/compat/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.78 src/tools/compat/Makefile:1.79 --- src/tools/compat/Makefile:1.78 Mon Feb 29 22:19:29 2016 +++ src/tools/compat/Makefile Tue Mar 1 06:48:55 2016 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.78 2016/02/29 22:19:29 aymeric Exp $ +# $NetBSD: Makefile,v 1.79 2016/03/01 06:48:55 aymeric Exp $ HOSTLIB= nbcompat @@ -14,7 +14,7 @@ SRCS= atoll.c basename.c cdbr.c cdbw.c mkstemp.c pread.c putc_unlocked.c pwcache.c pwrite.c \ pw_scan.c \ raise_default_signal.c reallocarr.c rmd160.c rmd160hl.c \ - regcomp.c regerror.c regexec.c regfree.c regsub.c \ + regcomp.c regerror.c regexec.c regfree.c \ setenv.c setgroupent.c \ setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \ sha256hl.c sha384hl.c sha512hl.c snprintb.c snprintf.c \
CVS commit: src/tools/compat
Module Name:src Committed By: aymeric Date: Mon Feb 29 22:19:29 UTC 2016 Modified Files: src/tools/compat: Makefile Added Files: src/tools/compat: regex.h Log Message: add our libc's regex implementation to libnbcompat. This way, nbsed picks it up and it unbreaks the build of xf86-video-intel-old's man page under Linux and probably other future changes which rightfully expect the (net)bsd behaviour. To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/tools/compat/Makefile cvs rdiff -u -r0 -r1.1 src/tools/compat/regex.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.77 src/tools/compat/Makefile:1.78 --- src/tools/compat/Makefile:1.77 Sat Jan 9 17:40:37 2016 +++ src/tools/compat/Makefile Mon Feb 29 22:19:29 2016 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.77 2016/01/09 17:40:37 christos Exp $ +# $NetBSD: Makefile,v 1.78 2016/02/29 22:19:29 aymeric Exp $ HOSTLIB= nbcompat @@ -14,6 +14,7 @@ SRCS= atoll.c basename.c cdbr.c cdbw.c mkstemp.c pread.c putc_unlocked.c pwcache.c pwrite.c \ pw_scan.c \ raise_default_signal.c reallocarr.c rmd160.c rmd160hl.c \ + regcomp.c regerror.c regexec.c regfree.c regsub.c \ setenv.c setgroupent.c \ setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \ sha256hl.c sha384hl.c sha512hl.c snprintb.c snprintf.c \ @@ -47,6 +48,7 @@ CPPFLAGS+= -I. -I./include -I${.CURDIR} ${.CURDIR}/../../lib/libc/hash/sha1 \ ${.CURDIR}/../../lib/libc/hash/sha2 \ ${.CURDIR}/../../lib/libc/md \ + ${.CURDIR}/../../lib/libc/regex \ ${.CURDIR}/../../lib/libc/stdio \ ${.CURDIR}/../../lib/libc/stdlib \ ${.CURDIR}/../../lib/libc/string \ Added files: Index: src/tools/compat/regex.h diff -u /dev/null src/tools/compat/regex.h:1.1 --- /dev/null Mon Feb 29 22:19:29 2016 +++ src/tools/compat/regex.h Mon Feb 29 22:19:29 2016 @@ -0,0 +1,4 @@ +/* $NetBSD: regex.h,v 1.1 2016/02/29 22:19:29 aymeric Exp $ */ + +#include "nbtool_config.h" +#include "../../include/regex.h"
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Sat Jan 9 17:40:37 UTC 2016 Modified Files: src/tools/compat: Makefile Log Message: lex source moved. To generate a diff of this commit: cvs rdiff -u -r1.76 -r1.77 src/tools/compat/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.76 src/tools/compat/Makefile:1.77 --- src/tools/compat/Makefile:1.76 Thu Sep 17 10:25:43 2015 +++ src/tools/compat/Makefile Sat Jan 9 12:40:37 2016 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.76 2015/09/17 14:25:43 christos Exp $ +# $NetBSD: Makefile,v 1.77 2016/01/09 17:40:37 christos Exp $ HOSTLIB= nbcompat @@ -59,7 +59,7 @@ CPPFLAGS+= -I. -I./include -I${.CURDIR} ${.CURDIR}/../../common/lib/libc/md \ ${.CURDIR}/../../common/lib/libc/stdlib \ ${.CURDIR}/../../common/lib/libutil \ - ${.CURDIR}/../../external/bsd/flex/dist + ${.CURDIR}/../../external/bsd/flex/dist/src DPSRCS+= defs.mk CLEANFILES+= config.log config.status configure.lineno *.stamp
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Fri Oct 9 14:42:40 UTC 2015 Modified Files: src/tools/compat: fgetln.c Log Message: use c comments To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/tools/compat/fgetln.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/fgetln.c diff -u src/tools/compat/fgetln.c:1.11 src/tools/compat/fgetln.c:1.12 --- src/tools/compat/fgetln.c:1.11 Thu Oct 8 16:33:58 2015 +++ src/tools/compat/fgetln.c Fri Oct 9 10:42:40 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: fgetln.c,v 1.11 2015/10/08 20:33:58 christos Exp $ */ +/* $NetBSD: fgetln.c,v 1.12 2015/10/09 14:42:40 christos Exp $ */ /* * Copyright (c) 2015 Joerg Jung@@ -54,8 +54,10 @@ fgetln(FILE *fp, size_t *len) while ((c = getc(fp)) != EOF) { buf[r++] = c; if (r == bufsz) { - // Original uses reallocarray() but we don't have it - // in tools. + /* + * Original uses reallocarray() but we don't have it + * in tools. + */ if (!(p = realloc(buf, 2 * bufsz))) { e = errno; free(buf);
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Thu Oct 8 20:20:45 UTC 2015 Modified Files: src/tools/compat: fgetln.c Log Message: Switch to a version that does not suffer from reporting the wrong length if the file contains NULs. From OpenBSD. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/tools/compat/fgetln.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/fgetln.c diff -u src/tools/compat/fgetln.c:1.9 src/tools/compat/fgetln.c:1.10 --- src/tools/compat/fgetln.c:1.9 Tue Apr 29 02:53:03 2008 +++ src/tools/compat/fgetln.c Thu Oct 8 16:20:45 2015 @@ -1,32 +1,23 @@ -/* $NetBSD: fgetln.c,v 1.9 2008/04/29 06:53:03 martin Exp $ */ +/* $NetBSD: fgetln.c,v 1.10 2015/10/08 20:20:45 christos Exp $ */ -/*- - * Copyright (c) 1998 The NetBSD Foundation, Inc. - * All rights reserved. +/* + * Copyright (c) 2015 Joerg Jung* - * This code is derived from software contributed to The NetBSD Foundation - * by Christos Zoulas. + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - *notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - *notice, this list of conditions and the following disclaimer in the - *documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE 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. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * portable fgetln() version, reentrant */ #ifdef HAVE_NBTOOL_CONFIG_H @@ -38,58 +29,50 @@ #ifndef HAVE_NBTOOL_CONFIG_H /* These headers are required, but included from nbtool_config.h */ #include -#include +#include #include -#include #endif char * fgetln(FILE *fp, size_t *len) { static char *buf = NULL; - static size_t bufsiz = 0; - char *ptr; - - - if (buf == NULL) { - bufsiz = BUFSIZ; - if ((buf = malloc(bufsiz)) == NULL) - return NULL; - } + static size_t bufsz = 0; + size_t r = 0; + char *p; + int c, e; - if (fgets(buf, bufsiz, fp) == NULL) + if (!fp || !len) { + errno = EINVAL; return NULL; - - *len = 0; - while ((ptr = strchr([*len], '\n')) == NULL) { - size_t nbufsiz = bufsiz + BUFSIZ; - char *nbuf = realloc(buf, nbufsiz); - - if (nbuf == NULL) { - int oerrno = errno; - free(buf); - errno = oerrno; - buf = NULL; + } + if (!buf) { + if (!(buf = calloc(1, BUFSIZ))) return NULL; - } else - buf = nbuf; - - if (fgets([bufsiz], BUFSIZ, fp) == NULL) { - buf[bufsiz] = '\0'; - *len = strlen(buf); - return buf; + bufsz = BUFSIZ; + } + while ((c = getc(fp)) != EOF) { + buf[r++] = c; + if (r == bufsz) { + // Original uses reallocarray() but we don't have it + // in tools. + if (!(p = realloc(buf, 2 * bufsz))) { +e = errno; +free(buf); +errno = e; +buf = NULL, bufsz = 0; +return NULL; + } + buf = p, bufsz = 2 * bufsz; } - - *len = bufsiz; - bufsiz = nbufsiz; + if (c == '\n') + break; } - - *len = (ptr - buf) + 1; - return buf; + return (*len = r) ? buf : NULL; } - #endif + #ifdef TEST int main(int argc, char *argv[])
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Thu Oct 8 20:33:58 UTC 2015 Modified Files: src/tools/compat: fgetln.c Log Message: don't lie in the comment; this is not the re-entrant version To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/tools/compat/fgetln.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/fgetln.c diff -u src/tools/compat/fgetln.c:1.10 src/tools/compat/fgetln.c:1.11 --- src/tools/compat/fgetln.c:1.10 Thu Oct 8 16:20:45 2015 +++ src/tools/compat/fgetln.c Thu Oct 8 16:33:58 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: fgetln.c,v 1.10 2015/10/08 20:20:45 christos Exp $ */ +/* $NetBSD: fgetln.c,v 1.11 2015/10/08 20:33:58 christos Exp $ */ /* * Copyright (c) 2015 Joerg Jung@@ -17,7 +17,7 @@ */ /* - * portable fgetln() version, reentrant + * portable fgetln() version */ #ifdef HAVE_NBTOOL_CONFIG_H
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Thu Sep 17 14:25:43 UTC 2015 Modified Files: src/tools/compat: Makefile Log Message: undo previous; include is in ${.OBJDIR} To generate a diff of this commit: cvs rdiff -u -r1.75 -r1.76 src/tools/compat/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.75 src/tools/compat/Makefile:1.76 --- src/tools/compat/Makefile:1.75 Wed Sep 16 22:22:47 2015 +++ src/tools/compat/Makefile Thu Sep 17 10:25:43 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.75 2015/09/17 02:22:47 christos Exp $ +# $NetBSD: Makefile,v 1.76 2015/09/17 14:25:43 christos Exp $ HOSTLIB= nbcompat @@ -125,7 +125,7 @@ ${HOST_INCSDIR}/compat/${_d}: # Install include files in ${TOOLDIR}/include/compat includes: .PHONY ${HOST_INCINSTDIRS} .WAIT ${HOST_INCINSTFILES} - @(cd ${.CURDIR}/include && find . -name '*.h' -print | while read f ; do \ + @(cd include && find . -name '*.h' -print | while read f ; do \ ${HOST_INSTALL_FILE} $$f ${HOST_INCSDIR}/compat/$$f ; \ done)
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Thu Sep 17 02:22:47 UTC 2015 Modified Files: src/tools/compat: Makefile Log Message: make this more robust by using .CURDIR to cd. To generate a diff of this commit: cvs rdiff -u -r1.74 -r1.75 src/tools/compat/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.74 src/tools/compat/Makefile:1.75 --- src/tools/compat/Makefile:1.74 Sun Jul 26 10:01:53 2015 +++ src/tools/compat/Makefile Wed Sep 16 22:22:47 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.74 2015/07/26 14:01:53 kamil Exp $ +# $NetBSD: Makefile,v 1.75 2015/09/17 02:22:47 christos Exp $ HOSTLIB= nbcompat @@ -125,7 +125,7 @@ ${HOST_INCSDIR}/compat/${_d}: # Install include files in ${TOOLDIR}/include/compat includes: .PHONY ${HOST_INCINSTDIRS} .WAIT ${HOST_INCINSTFILES} - @(cd include && find . -name '*.h' -print | while read f ; do \ + @(cd ${.CURDIR}/include && find . -name '*.h' -print | while read f ; do \ ${HOST_INSTALL_FILE} $$f ${HOST_INCSDIR}/compat/$$f ; \ done)
CVS commit: src/tools/compat
Module Name:src Committed By: kamil Date: Sun Jul 26 14:01:53 UTC 2015 Modified Files: src/tools/compat: Makefile compat_defs.h configure configure.ac nbtool_config.h.in Log Message: Add reallocarr(3) to tools/compat This should unbreak libutil(3) creation on systems withot reallocarr(3). To generate a diff of this commit: cvs rdiff -u -r1.73 -r1.74 src/tools/compat/Makefile cvs rdiff -u -r1.101 -r1.102 src/tools/compat/compat_defs.h cvs rdiff -u -r1.82 -r1.83 src/tools/compat/configure cvs rdiff -u -r1.83 -r1.84 src/tools/compat/configure.ac cvs rdiff -u -r1.36 -r1.37 src/tools/compat/nbtool_config.h.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.73 src/tools/compat/Makefile:1.74 --- src/tools/compat/Makefile:1.73 Sun Jan 18 18:09:10 2015 +++ src/tools/compat/Makefile Sun Jul 26 14:01:53 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.73 2015/01/18 18:09:10 christos Exp $ +# $NetBSD: Makefile,v 1.74 2015/07/26 14:01:53 kamil Exp $ HOSTLIB= nbcompat @@ -13,7 +13,7 @@ SRCS= atoll.c basename.c cdbr.c cdbw.c mi_vector_hash.c mkdtemp.c \ mkstemp.c pread.c putc_unlocked.c pwcache.c pwrite.c \ pw_scan.c \ - raise_default_signal.c rmd160.c rmd160hl.c \ + raise_default_signal.c reallocarr.c rmd160.c rmd160hl.c \ setenv.c setgroupent.c \ setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \ sha256hl.c sha384hl.c sha512hl.c snprintb.c snprintf.c \ Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.101 src/tools/compat/compat_defs.h:1.102 --- src/tools/compat/compat_defs.h:1.101 Fri Jan 16 18:44:06 2015 +++ src/tools/compat/compat_defs.h Sun Jul 26 14:01:53 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.101 2015/01/16 18:44:06 christos Exp $ */ +/* $NetBSD: compat_defs.h,v 1.102 2015/07/26 14:01:53 kamil Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -469,6 +469,10 @@ ssize_t pwrite(int, const void *, size_t int raise_default_signal(int); #endif +#if !HAVE_REALLOCARR +int reallocarr(void *, size_t, size_t); +#endif + #if !HAVE_SETENV int setenv(const char *, const char *, int); #endif Index: src/tools/compat/configure diff -u src/tools/compat/configure:1.82 src/tools/compat/configure:1.83 --- src/tools/compat/configure:1.82 Fri Jan 16 18:44:31 2015 +++ src/tools/compat/configure Sun Jul 26 14:01:53 2015 @@ -5044,7 +5044,7 @@ for ac_func in atoll asprintf asnprintf getopt getopt_long group_from_gid gid_from_group \ heapsort isblank issetugid lchflags lchmod lchown lutimes mkstemp \ mkdtemp poll pread putc_unlocked pwcache_userdb pwcache_groupdb \ - pwrite raise_default_signal random setenv \ + pwrite raise_default_signal random reallocarr setenv \ setgroupent setprogname setpassent \ snprintb_m snprintf strlcat strlcpy strmode \ strndup strnlen strsep strsuftoll strtoi strtoll strtou \ Index: src/tools/compat/configure.ac diff -u src/tools/compat/configure.ac:1.83 src/tools/compat/configure.ac:1.84 --- src/tools/compat/configure.ac:1.83 Fri Jan 16 18:44:06 2015 +++ src/tools/compat/configure.ac Sun Jul 26 14:01:53 2015 @@ -1,4 +1,4 @@ -# $NetBSD: configure.ac,v 1.83 2015/01/16 18:44:06 christos Exp $ +# $NetBSD: configure.ac,v 1.84 2015/07/26 14:01:53 kamil Exp $ # # Autoconf definition file for libnbcompat. # @@ -157,7 +157,7 @@ AC_CHECK_FUNCS(atoll asprintf asnprintf getopt getopt_long group_from_gid gid_from_group \ heapsort isblank issetugid lchflags lchmod lchown lutimes mkstemp \ mkdtemp poll pread putc_unlocked pwcache_userdb pwcache_groupdb \ - pwrite raise_default_signal random setenv \ + pwrite raise_default_signal random reallocarr setenv \ setgroupent setprogname setpassent \ snprintb_m snprintf strlcat strlcpy strmode \ strndup strnlen strsep strsuftoll strtoi strtoll strtou \ Index: src/tools/compat/nbtool_config.h.in diff -u src/tools/compat/nbtool_config.h.in:1.36 src/tools/compat/nbtool_config.h.in:1.37 --- src/tools/compat/nbtool_config.h.in:1.36 Fri Jan 16 18:44:31 2015 +++ src/tools/compat/nbtool_config.h.in Sun Jul 26 14:01:53 2015 @@ -1,6 +1,6 @@ /* nbtool_config.h.in. Generated automatically from configure.ac by autoheader. */ -/* $NetBSD: nbtool_config.h.in,v 1.36 2015/01/16 18:44:31 christos Exp $*/ +/* $NetBSD: nbtool_config.h.in,v 1.37 2015/07/26 14:01:53 kamil Exp $*/ #ifndef __NETBSD_NBTOOL_CONFIG_H__ #define __NETBSD_NBTOOL_CONFIG_H__ @@ -419,6 +419,9 @@ /* Define if you have the `random' function. */ #undef HAVE_RANDOM +/* Define if you have the `reallocarr' function. */ +#undef HAVE_REALLOCARR + /* Define if you have the resolv.h header file. */ #undef HAVE_RESOLV_H
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Sun Jan 18 18:09:10 UTC 2015 Modified Files: src/tools/compat: Makefile Log Message: add strtoi strtou (Kamil Rytarowski) To generate a diff of this commit: cvs rdiff -u -r1.72 -r1.73 src/tools/compat/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.72 src/tools/compat/Makefile:1.73 --- src/tools/compat/Makefile:1.72 Thu Jan 16 12:24:56 2014 +++ src/tools/compat/Makefile Sun Jan 18 13:09:10 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.72 2014/01/16 17:24:56 christos Exp $ +# $NetBSD: Makefile,v 1.73 2015/01/18 18:09:10 christos Exp $ HOSTLIB= nbcompat @@ -20,6 +20,7 @@ SRCS= atoll.c basename.c cdbr.c cdbw.c stat_flags.c strlcat.c strlcpy.c strmode.c \ strndup.c strnlen.c \ strsep.c strsuftoll.c strtoll.c \ + strtoi.c strtou.c \ unvis.c vis.c err.c errx.c errc.c verr.c verrx.c verrc.c \ vwarn.c vwarnx.c vwarnc.c warn.c warnx.c warnc.c \ fts.c glob.c efun.c
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Fri Jan 16 18:44:07 UTC 2015 Modified Files: src/tools/compat: compat_defs.h configure.ac Log Message: strto{i,u} To generate a diff of this commit: cvs rdiff -u -r1.100 -r1.101 src/tools/compat/compat_defs.h cvs rdiff -u -r1.82 -r1.83 src/tools/compat/configure.ac Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.100 src/tools/compat/compat_defs.h:1.101 --- src/tools/compat/compat_defs.h:1.100 Wed Dec 24 11:18:46 2014 +++ src/tools/compat/compat_defs.h Fri Jan 16 13:44:06 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.100 2014/12/24 16:18:46 christos Exp $ */ +/* $NetBSD: compat_defs.h,v 1.101 2015/01/16 18:44:06 christos Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -525,6 +525,16 @@ long long strsuftollx(const char *, cons long long strtoll(const char *, char **, int); #endif +#if !HAVE_STRTOI +intmax_t strtoi(const char * __restrict, char ** __restrict, int, +intmax_t, intmax_t, int *); +#endif + +#if !HAVE_STRTOU +uintmax_t strtou(const char * __restrict, char ** __restrict, int, +uintmax_t, uintmax_t, int *); +#endif + #if !HAVE_USER_FROM_UID const char *user_from_uid(uid_t, int); #endif Index: src/tools/compat/configure.ac diff -u src/tools/compat/configure.ac:1.82 src/tools/compat/configure.ac:1.83 --- src/tools/compat/configure.ac:1.82 Thu Jun 5 21:40:40 2014 +++ src/tools/compat/configure.ac Fri Jan 16 13:44:06 2015 @@ -1,4 +1,4 @@ -# $NetBSD: configure.ac,v 1.82 2014/06/06 01:40:40 christos Exp $ +# $NetBSD: configure.ac,v 1.83 2015/01/16 18:44:06 christos Exp $ # # Autoconf definition file for libnbcompat. # @@ -160,7 +160,7 @@ AC_CHECK_FUNCS(atoll asprintf asnprintf pwrite raise_default_signal random setenv \ setgroupent setprogname setpassent \ snprintb_m snprintf strlcat strlcpy strmode \ - strndup strnlen strsep strsuftoll strtoll \ + strndup strnlen strsep strsuftoll strtoi strtoll strtou \ user_from_uid uid_from_user vasprintf vasnprintf vsnprintf) AC_CHECK_DECLS([user_from_uid, uid_from_user, pwcache_userdb],,,[
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Fri Jan 16 18:44:31 UTC 2015 Modified Files: src/tools/compat: configure nbtool_config.h.in Log Message: regen To generate a diff of this commit: cvs rdiff -u -r1.81 -r1.82 src/tools/compat/configure cvs rdiff -u -r1.35 -r1.36 src/tools/compat/nbtool_config.h.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/configure diff -u src/tools/compat/configure:1.81 src/tools/compat/configure:1.82 --- src/tools/compat/configure:1.81 Thu Jun 5 21:40:40 2014 +++ src/tools/compat/configure Fri Jan 16 13:44:31 2015 @@ -5047,7 +5047,7 @@ for ac_func in atoll asprintf asnprintf pwrite raise_default_signal random setenv \ setgroupent setprogname setpassent \ snprintb_m snprintf strlcat strlcpy strmode \ - strndup strnlen strsep strsuftoll strtoll \ + strndup strnlen strsep strsuftoll strtoi strtoll strtou \ user_from_uid uid_from_user vasprintf vasnprintf vsnprintf do as_ac_var=`echo ac_cv_func_$ac_func | $as_tr_sh` Index: src/tools/compat/nbtool_config.h.in diff -u src/tools/compat/nbtool_config.h.in:1.35 src/tools/compat/nbtool_config.h.in:1.36 --- src/tools/compat/nbtool_config.h.in:1.35 Thu Jun 5 21:40:40 2014 +++ src/tools/compat/nbtool_config.h.in Fri Jan 16 13:44:31 2015 @@ -1,6 +1,6 @@ /* nbtool_config.h.in. Generated automatically from configure.ac by autoheader. */ -/* $NetBSD: nbtool_config.h.in,v 1.35 2014/06/06 01:40:40 christos Exp $*/ +/* $NetBSD: nbtool_config.h.in,v 1.36 2015/01/16 18:44:31 christos Exp $*/ #ifndef __NETBSD_NBTOOL_CONFIG_H__ #define __NETBSD_NBTOOL_CONFIG_H__ @@ -491,9 +491,15 @@ /* Define if you have the `strsuftoll' function. */ #undef HAVE_STRSUFTOLL +/* Define if you have the `strtoi' function. */ +#undef HAVE_STRTOI + /* Define if you have the `strtoll' function. */ #undef HAVE_STRTOLL +/* Define if you have the `strtou' function. */ +#undef HAVE_STRTOU + /* Define if `d_namlen' is member of `struct dirent'. */ #undef HAVE_STRUCT_DIRENT_D_NAMLEN
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Wed Dec 24 16:18:46 UTC 2014 Modified Files: src/tools/compat: compat_defs.h Log Message: add __UNVOLATILE To generate a diff of this commit: cvs rdiff -u -r1.99 -r1.100 src/tools/compat/compat_defs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.99 src/tools/compat/compat_defs.h:1.100 --- src/tools/compat/compat_defs.h:1.99 Wed Sep 24 09:17:35 2014 +++ src/tools/compat/compat_defs.h Wed Dec 24 11:18:46 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.99 2014/09/24 13:17:35 christos Exp $ */ +/* $NetBSD: compat_defs.h,v 1.100 2014/12/24 16:18:46 christos Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -77,6 +77,11 @@ #undef __UNCONST #endif #define __UNCONST(a) ((void *)(unsigned long)(const void *)(a)) +#ifdef __UNVOLATILE +#undef __UNVOLATILE +#endif +#define __UNVOLATILE(a)((void *)(unsigned long)(volatile void *)(a)) + #undef __predict_false #define __predict_false(x) (x)
CVS commit: src/tools/compat/dev
Module Name:src Committed By: christos Date: Mon Dec 22 18:08:39 UTC 2014 Modified Files: src/tools/compat/dev: clock_subr.h Log Message: remove unused constants (Kamil Rytarowski) To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tools/compat/dev/clock_subr.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/dev/clock_subr.h diff -u src/tools/compat/dev/clock_subr.h:1.2 src/tools/compat/dev/clock_subr.h:1.3 --- src/tools/compat/dev/clock_subr.h:1.2 Sun Sep 7 07:50:23 2014 +++ src/tools/compat/dev/clock_subr.h Mon Dec 22 13:08:39 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: clock_subr.h,v 1.2 2014/09/07 11:50:23 martin Exp $ */ +/* $NetBSD: clock_subr.h,v 1.3 2014/12/22 18:08:39 christos Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -52,11 +52,4 @@ struct clock_ymdhms { time_t clock_ymdhms_to_secs(struct clock_ymdhms *); int clock_secs_to_ymdhms(time_t, struct clock_ymdhms *); -/* Some handy constants. */ -#define SECDAY (24 * 60 * 60) -#define SECYR (SECDAY * 365) - -/* Traditional POSIX base year */ -#define POSIX_BASE_YEAR 1970 - #endif /* _DEV_CLOCK_SUBR_H_ */
CVS commit: src/tools/compat
Module Name:src Committed By: joerg Date: Wed Nov 12 15:08:52 UTC 2014 Modified Files: src/tools/compat: nl_types.h Log Message: If the internals are not explicitly requested, use #include_next to pick up the system version. locale from libc++ requires this and is used by src/tools/elftosb2. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tools/compat/nl_types.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/nl_types.h diff -u src/tools/compat/nl_types.h:1.2 src/tools/compat/nl_types.h:1.3 --- src/tools/compat/nl_types.h:1.2 Thu Feb 27 01:07:52 2014 +++ src/tools/compat/nl_types.h Wed Nov 12 15:08:52 2014 @@ -1,5 +1,7 @@ -/* $NetBSD: nl_types.h,v 1.2 2014/02/27 01:07:52 matt Exp $ */ +/* $NetBSD: nl_types.h,v 1.3 2014/11/12 15:08:52 joerg Exp $ */ -#if defined(_NLS_PRIVATE) || defined(__NetBSD__) +#if defined(_NLS_PRIVATE) #include ../../include/nl_types.h +#elif defined(__GNUC__) +#include_next nl_types.h #endif
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Wed Sep 24 13:17:35 UTC 2014 Modified Files: src/tools/compat: compat_defs.h Log Message: put O_CLOEXEC definition here. To generate a diff of this commit: cvs rdiff -u -r1.98 -r1.99 src/tools/compat/compat_defs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.98 src/tools/compat/compat_defs.h:1.99 --- src/tools/compat/compat_defs.h:1.98 Mon Sep 1 07:20:06 2014 +++ src/tools/compat/compat_defs.h Wed Sep 24 09:17:35 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.98 2014/09/01 11:20:06 apb Exp $ */ +/* $NetBSD: compat_defs.h,v 1.99 2014/09/24 13:17:35 christos Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -593,6 +593,9 @@ void *setmode(const char *); #ifndef O_SHLOCK #define O_SHLOCK 0 #endif +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif /* inttypes.h */
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Tue Sep 16 17:23:50 UTC 2014 Modified Files: src/tools/compat: getline.c Log Message: Fix problem reading the last line when it did not contain a delimiter (Hubert Garavel) To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tools/compat/getline.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/getline.c diff -u src/tools/compat/getline.c:1.1 src/tools/compat/getline.c:1.2 --- src/tools/compat/getline.c:1.1 Sun Mar 20 16:48:57 2011 +++ src/tools/compat/getline.c Tue Sep 16 13:23:50 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: getline.c,v 1.1 2011/03/20 20:48:57 christos Exp $ */ +/* $NetBSD: getline.c,v 1.2 2014/09/16 17:23:50 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -59,10 +59,14 @@ getdelim(char **buf, size_t *bufsiz, int for (ptr = *buf, eptr = *buf + *bufsiz;;) { int c = fgetc(fp); if (c == -1) { - if (feof(fp)) -return ptr == *buf ? -1 : ptr - *buf; - else -return -1; + if (feof(fp)) { +ssize_t diff = (ssize_t)(ptr - *buf); +if (diff != 0) { + *ptr = '\0'; + return diff; +} + } + return -1; } *ptr++ = c; if (c == delimiter) {
CVS commit: src/tools/compat/dev
Module Name:src Committed By: martin Date: Mon Sep 1 07:48:16 UTC 2014 Added Files: src/tools/compat/dev: clock_subr.h Log Message: Add a slightly stripped down version of sys/dev/clock/clock_subr.h to make this code available for tools. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/tools/compat/dev/clock_subr.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/tools/compat/dev/clock_subr.h diff -u /dev/null src/tools/compat/dev/clock_subr.h:1.1 --- /dev/null Mon Sep 1 07:48:16 2014 +++ src/tools/compat/dev/clock_subr.h Mon Sep 1 07:48:16 2014 @@ -0,0 +1,62 @@ +/* $NetBSD: clock_subr.h,v 1.1 2014/09/01 07:48:16 martin Exp $ */ + +/*- + * Copyright (c) 1996 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Gordon W. Ross + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE 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 _DEV_CLOCK_SUBR_H_ +#define _DEV_CLOCK_SUBR_H_ + +/* + * This is a slightly stripped down version of src/sys/dev/clock_subr.h + */ + +/* + * POSIX time to/from YY/MM/DD/hh/mm/ss + */ +struct clock_ymdhms { + u_short dt_year; + u_char dt_mon; + u_char dt_day; + u_char dt_wday; /* Day of week */ + u_char dt_hour; + u_char dt_min; + u_char dt_sec; +}; + +time_t clock_ymdhms_to_secs(struct clock_ymdhms *); +void clock_secs_to_ymdhms(time_t, struct clock_ymdhms *); + +/* Some handy constants. */ +#define SECDAY (24 * 60 * 60) +#define SECYR (SECDAY * 365) + +/* Traditional POSIX base year */ +#define POSIX_BASE_YEAR 1970 + +#endif /* _DEV_CLOCK_SUBR_H_ */
CVS commit: src/tools/compat
Module Name:src Committed By: apb Date: Mon Sep 1 11:20:06 UTC 2014 Modified Files: src/tools/compat: compat_defs.h Log Message: Copy definitions of __type_min(t), __type_max(t), and some related macros, from sys/cdefs.h, for use when building tools. To generate a diff of this commit: cvs rdiff -u -r1.97 -r1.98 src/tools/compat/compat_defs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.97 src/tools/compat/compat_defs.h:1.98 --- src/tools/compat/compat_defs.h:1.97 Fri Jun 6 01:40:40 2014 +++ src/tools/compat/compat_defs.h Mon Sep 1 11:20:06 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.97 2014/06/06 01:40:40 christos Exp $ */ +/* $NetBSD: compat_defs.h,v 1.98 2014/09/01 11:20:06 apb Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -101,7 +101,7 @@ struct group; #define __END_DECLS #endif -/* Some things usually in BSD sys/cdefs.h. */ +/* Some things in NetBSD sys/cdefs.h. */ #ifndef __CONCAT #define __CONCAT(x,y) x ## y @@ -137,6 +137,20 @@ struct group; #define __arraycount(__x) (sizeof(__x) / sizeof(__x[0])) #undef __USE #define __USE(a) ((void)(a)) +#undef __type_min_s +#define __type_min_s(t) ((t)((1ULL (sizeof(t) * NBBY - 1 +#undef __type_max_s +#define __type_max_s(t) ((t)~((1ULL (sizeof(t) * NBBY - 1 +#undef __type_min_u +#define __type_min_u(t) ((t)0ULL) +#undef __type_max_u +#define __type_max_u(t) ((t)~0ULL) +#undef __type_is_signed +#define __type_is_signed(t) (/*LINTED*/__type_min_s(t) + (t)1 (t)1) +#undef __type_min +#define __type_min(t) (__type_is_signed(t) ? __type_min_s(t) : __type_min_u(t)) +#undef __type_max +#define __type_max(t) (__type_is_signed(t) ? __type_max_s(t) : __type_max_u(t)) /* Dirent support. */
CVS commit: src/tools/compat
Module Name:src Committed By: matt Date: Thu Feb 27 01:07:52 UTC 2014 Modified Files: src/tools/compat: nl_types.h Log Message: To build elftosb with clang++, it needs more than nl_types.h provides. XXX to workaround with, if compiling on __NetBSD__ just include the real nl_types.h To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tools/compat/nl_types.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/nl_types.h diff -u src/tools/compat/nl_types.h:1.1 src/tools/compat/nl_types.h:1.2 --- src/tools/compat/nl_types.h:1.1 Tue Jan 29 10:20:32 2002 +++ src/tools/compat/nl_types.h Thu Feb 27 01:07:52 2014 @@ -1,5 +1,5 @@ -/* $NetBSD: nl_types.h,v 1.1 2002/01/29 10:20:32 tv Exp $ */ +/* $NetBSD: nl_types.h,v 1.2 2014/02/27 01:07:52 matt Exp $ */ -#ifdef _NLS_PRIVATE +#if defined(_NLS_PRIVATE) || defined(__NetBSD__) #include ../../include/nl_types.h #endif
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Thu Jan 16 17:24:56 UTC 2014 Modified Files: src/tools/compat: Makefile Log Message: Add the {v,}{err,warn}c functions To generate a diff of this commit: cvs rdiff -u -r1.71 -r1.72 src/tools/compat/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.71 src/tools/compat/Makefile:1.72 --- src/tools/compat/Makefile:1.71 Thu Jan 9 06:31:12 2014 +++ src/tools/compat/Makefile Thu Jan 16 12:24:56 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.71 2014/01/09 11:31:12 apb Exp $ +# $NetBSD: Makefile,v 1.72 2014/01/16 17:24:56 christos Exp $ HOSTLIB= nbcompat @@ -20,8 +20,9 @@ SRCS= atoll.c basename.c cdbr.c cdbw.c stat_flags.c strlcat.c strlcpy.c strmode.c \ strndup.c strnlen.c \ strsep.c strsuftoll.c strtoll.c \ - unvis.c vis.c err.c errx.c verr.c verrx.c \ - vwarn.c vwarnx.c warn.c warnx.c fts.c glob.c efun.c + unvis.c vis.c err.c errx.c errc.c verr.c verrx.c verrc.c \ + vwarn.c vwarnx.c vwarnc.c warn.c warnx.c warnc.c \ + fts.c glob.c efun.c BUILD_OSTYPE!= uname -s
CVS commit: src/tools/compat
Module Name:src Committed By: apb Date: Thu Jan 9 11:26:58 UTC 2014 Modified Files: src/tools/compat: configure.ac Log Message: Add strnlen to configure tests in tools/compat To generate a diff of this commit: cvs rdiff -u -r1.80 -r1.81 src/tools/compat/configure.ac Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/configure.ac diff -u src/tools/compat/configure.ac:1.80 src/tools/compat/configure.ac:1.81 --- src/tools/compat/configure.ac:1.80 Wed Aug 14 10:14:45 2013 +++ src/tools/compat/configure.ac Thu Jan 9 11:26:58 2014 @@ -1,4 +1,4 @@ -# $NetBSD: configure.ac,v 1.80 2013/08/14 10:14:45 jmcneill Exp $ +# $NetBSD: configure.ac,v 1.81 2014/01/09 11:26:58 apb Exp $ # # Autoconf definition file for libnbcompat. # @@ -160,7 +160,7 @@ AC_CHECK_FUNCS(atoll asprintf asnprintf pwrite raise_default_signal random setenv \ setgroupent setprogname setpassent \ snprintb_m snprintf strlcat strlcpy strmode \ - strndup strsep strsuftoll strtoll \ + strndup strnlen strsep strsuftoll strtoll \ user_from_uid uid_from_user vasprintf vasnprintf vsnprintf) AC_CHECK_DECLS([user_from_uid, uid_from_user, pwcache_userdb],,,[ @@ -169,7 +169,7 @@ AC_CHECK_DECLS([user_from_uid, uid_from_ AC_CHECK_DECLS([group_from_gid, gid_from_group, pwcache_groupdb],,,[ #include grp.h ]) -AC_CHECK_DECLS([strndup],,,[#include string.h]) +AC_CHECK_DECLS([strndup, strnlen],,,[#include string.h]) AC_CHECK_DECLS([strsuftoll],,,[#include stdlib.h]) AC_CHECK_DECLS([lchflags, lchmod, lchown],,,[ #include sys/stat.h
CVS commit: src/tools/compat
Module Name:src Committed By: apb Date: Thu Jan 9 11:30:01 UTC 2014 Modified Files: src/tools/compat: nbtool_config.h.in Log Message: regen To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/tools/compat/nbtool_config.h.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/nbtool_config.h.in diff -u src/tools/compat/nbtool_config.h.in:1.33 src/tools/compat/nbtool_config.h.in:1.34 --- src/tools/compat/nbtool_config.h.in:1.33 Wed Aug 14 10:15:14 2013 +++ src/tools/compat/nbtool_config.h.in Thu Jan 9 11:30:01 2014 @@ -1,6 +1,6 @@ /* nbtool_config.h.in. Generated automatically from configure.ac by autoheader. */ -/* $NetBSD: nbtool_config.h.in,v 1.33 2013/08/14 10:15:14 jmcneill Exp $*/ +/* $NetBSD: nbtool_config.h.in,v 1.34 2014/01/09 11:30:01 apb Exp $*/ #ifndef __NETBSD_NBTOOL_CONFIG_H__ #define __NETBSD_NBTOOL_CONFIG_H__ @@ -203,6 +203,10 @@ don't. */ #undef HAVE_DECL_STRNDUP +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#undef HAVE_DECL_STRNLEN + /* Define to 1 if you have the declaration of `strsuftoll', and to 0 if you don't. */ #undef HAVE_DECL_STRSUFTOLL @@ -462,6 +466,9 @@ /* Define if you have the `strndup' function. */ #undef HAVE_STRNDUP +/* Define if you have the `strnlen' function. */ +#undef HAVE_STRNLEN + /* Define if you have the `strsep' function. */ #undef HAVE_STRSEP
CVS commit: src/tools/compat
Module Name:src Committed By: apb Date: Thu Jan 9 11:31:12 UTC 2014 Modified Files: src/tools/compat: Makefile compat_defs.h Log Message: Declare and define strnlen if necessary. To generate a diff of this commit: cvs rdiff -u -r1.70 -r1.71 src/tools/compat/Makefile cvs rdiff -u -r1.93 -r1.94 src/tools/compat/compat_defs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.70 src/tools/compat/Makefile:1.71 --- src/tools/compat/Makefile:1.70 Wed Dec 11 01:24:08 2013 +++ src/tools/compat/Makefile Thu Jan 9 11:31:12 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.70 2013/12/11 01:24:08 joerg Exp $ +# $NetBSD: Makefile,v 1.71 2014/01/09 11:31:12 apb Exp $ HOSTLIB= nbcompat @@ -17,7 +17,8 @@ SRCS= atoll.c basename.c cdbr.c cdbw.c setenv.c setgroupent.c \ setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \ sha256hl.c sha384hl.c sha512hl.c snprintb.c snprintf.c \ - stat_flags.c strlcat.c strlcpy.c strmode.c strndup.c \ + stat_flags.c strlcat.c strlcpy.c strmode.c \ + strndup.c strnlen.c \ strsep.c strsuftoll.c strtoll.c \ unvis.c vis.c err.c errx.c verr.c verrx.c \ vwarn.c vwarnx.c warn.c warnx.c fts.c glob.c efun.c Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.93 src/tools/compat/compat_defs.h:1.94 --- src/tools/compat/compat_defs.h:1.93 Thu Oct 24 13:59:47 2013 +++ src/tools/compat/compat_defs.h Thu Jan 9 11:31:12 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.93 2013/10/24 13:59:47 apb Exp $ */ +/* $NetBSD: compat_defs.h,v 1.94 2014/01/09 11:31:12 apb Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -415,6 +415,9 @@ int pwcache_groupdb(int (*)(int), void ( #if !HAVE_DECL_STRNDUP char *strndup(const char *, size_t); #endif +#if !HAVE_DECL_STRNLEN +char *strnlen(const char *, size_t); +#endif #if !HAVE_DECL_LCHFLAGS int lchflags(const char *, unsigned long); #endif
CVS commit: src/tools/compat
Module Name:src Committed By: apb Date: Thu Jan 9 16:08:46 UTC 2014 Modified Files: src/tools/compat: compat_defs.h Log Message: fix prototype for strnlen. To generate a diff of this commit: cvs rdiff -u -r1.94 -r1.95 src/tools/compat/compat_defs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.94 src/tools/compat/compat_defs.h:1.95 --- src/tools/compat/compat_defs.h:1.94 Thu Jan 9 11:31:12 2014 +++ src/tools/compat/compat_defs.h Thu Jan 9 16:08:46 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.94 2014/01/09 11:31:12 apb Exp $ */ +/* $NetBSD: compat_defs.h,v 1.95 2014/01/09 16:08:46 apb Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -416,7 +416,7 @@ int pwcache_groupdb(int (*)(int), void ( char *strndup(const char *, size_t); #endif #if !HAVE_DECL_STRNLEN -char *strnlen(const char *, size_t); +size_t strnlen(const char *, size_t); #endif #if !HAVE_DECL_LCHFLAGS int lchflags(const char *, unsigned long);
CVS commit: src/tools/compat
Module Name:src Committed By: apb Date: Thu Oct 24 13:59:47 UTC 2013 Modified Files: src/tools/compat: compat_defs.h Log Message: Define __USE for use during a tools build. To generate a diff of this commit: cvs rdiff -u -r1.92 -r1.93 src/tools/compat/compat_defs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.92 src/tools/compat/compat_defs.h:1.93 --- src/tools/compat/compat_defs.h:1.92 Sun Aug 18 20:48:17 2013 +++ src/tools/compat/compat_defs.h Thu Oct 24 13:59:47 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.92 2013/08/18 20:48:17 joerg Exp $ */ +/* $NetBSD: compat_defs.h,v 1.93 2013/10/24 13:59:47 apb Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -133,6 +133,8 @@ struct group; #define __unused #undef __arraycount #define __arraycount(__x) (sizeof(__x) / sizeof(__x[0])) +#undef __USE +#define __USE(a) ((void)(a)) /* Dirent support. */
CVS commit: src/tools/compat
Module Name:src Committed By: joerg Date: Sun Aug 18 20:48:17 UTC 2013 Modified Files: src/tools/compat: compat_defs.h Log Message: Support __format_arg. To generate a diff of this commit: cvs rdiff -u -r1.91 -r1.92 src/tools/compat/compat_defs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.91 src/tools/compat/compat_defs.h:1.92 --- src/tools/compat/compat_defs.h:1.91 Tue Aug 6 21:58:46 2013 +++ src/tools/compat/compat_defs.h Sun Aug 18 20:48:17 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.91 2013/08/06 21:58:46 apb Exp $ */ +/* $NetBSD: compat_defs.h,v 1.92 2013/08/18 20:48:17 joerg Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -125,6 +125,8 @@ struct group; #define __dead #undef __printflike #define __printflike(x,y) +#undef __format_arg +#define __format_arg(x) #undef __restrict #define __restrict #undef __unused
CVS commit: src/tools/compat
Module Name:src Committed By: jmcneill Date: Wed Aug 14 10:14:45 UTC 2013 Modified Files: src/tools/compat: configure.ac Log Message: add test for struct tm tm_gmtoff member To generate a diff of this commit: cvs rdiff -u -r1.79 -r1.80 src/tools/compat/configure.ac Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/configure.ac diff -u src/tools/compat/configure.ac:1.79 src/tools/compat/configure.ac:1.80 --- src/tools/compat/configure.ac:1.79 Fri Aug 9 20:12:38 2013 +++ src/tools/compat/configure.ac Wed Aug 14 10:14:45 2013 @@ -1,4 +1,4 @@ -# $NetBSD: configure.ac,v 1.79 2013/08/09 20:12:38 jmcneill Exp $ +# $NetBSD: configure.ac,v 1.80 2013/08/14 10:14:45 jmcneill Exp $ # # Autoconf definition file for libnbcompat. # @@ -137,6 +137,7 @@ AC_CHECK_MEMBERS([struct stat.st_flags, struct stat.st_atim, struct stat.st_mtimensec],,, [#include sys/stat.h]) AC_CHECK_MEMBERS(struct statvfs.f_iosize,,, [#include sys/statvfs.h]) +AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include time.h]) # Global variable decls. AC_CHECK_DECLS([optind, optreset],,, [
CVS commit: src/tools/compat
Module Name:src Committed By: jmcneill Date: Fri Aug 9 20:12:38 UTC 2013 Modified Files: src/tools/compat: configure.ac Log Message: makefs_udf uses clock_gettime, and on some versions of linux that lives in librt To generate a diff of this commit: cvs rdiff -u -r1.78 -r1.79 src/tools/compat/configure.ac Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/configure.ac diff -u src/tools/compat/configure.ac:1.78 src/tools/compat/configure.ac:1.79 --- src/tools/compat/configure.ac:1.78 Tue Aug 6 21:50:19 2013 +++ src/tools/compat/configure.ac Fri Aug 9 20:12:38 2013 @@ -1,4 +1,4 @@ -# $NetBSD: configure.ac,v 1.78 2013/08/06 21:50:19 apb Exp $ +# $NetBSD: configure.ac,v 1.79 2013/08/09 20:12:38 jmcneill Exp $ # # Autoconf definition file for libnbcompat. # @@ -201,6 +201,8 @@ dnl # Thus AC_CHECK_LIB(regex...) comes AC_CHECK_LIB(regex, regfree) AC_SEARCH_LIBS(regfree, rx posix) +AC_CHECK_LIB(rt, clock_gettime) + AC_CHECK_FUNCS(fparseln, [ AC_MSG_CHECKING(if fparseln seems to work) AC_RUN_IFELSE(
CVS commit: src/tools/compat
Module Name:src Committed By: jmcneill Date: Fri Aug 9 20:13:21 UTC 2013 Modified Files: src/tools/compat: configure nbtool_config.h.in Log Message: regen To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/tools/compat/configure cvs rdiff -u -r1.31 -r1.32 src/tools/compat/nbtool_config.h.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/configure diff -u src/tools/compat/configure:1.77 src/tools/compat/configure:1.78 --- src/tools/compat/configure:1.77 Tue Aug 6 21:56:36 2013 +++ src/tools/compat/configure Fri Aug 9 20:13:21 2013 @@ -7507,16 +7507,74 @@ if test $ac_cv_search_regfree != no; t fi +echo $as_me:7510: checking for clock_gettime in -lrt 5 +echo $ECHO_N checking for clock_gettime in -lrt... $ECHO_C 6 +if test ${ac_cv_lib_rt_clock_gettime+set} = set; then + echo $ECHO_N (cached) $ECHO_C 6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS=-lrt $LIBS +cat conftest.$ac_ext _ACEOF +#line 7518 configure +#include confdefs.h + +/* 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 clock_gettime (); +int +main () +{ +clock_gettime (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo $as_me:7537: \$ac_link\) 5 + (eval $ac_link) 25 + ac_status=$? + echo $as_me:7540: \$? = $ac_status 5 + (exit $ac_status); } + { ac_try='test -s conftest$ac_exeext' + { (eval echo $as_me:7543: \$ac_try\) 5 + (eval $ac_try) 25 + ac_status=$? + echo $as_me:7546: \$? = $ac_status 5 + (exit $ac_status); }; }; then + ac_cv_lib_rt_clock_gettime=yes +else + echo $as_me: failed program was: 5 +cat conftest.$ac_ext 5 +ac_cv_lib_rt_clock_gettime=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo $as_me:7557: result: $ac_cv_lib_rt_clock_gettime 5 +echo ${ECHO_T}$ac_cv_lib_rt_clock_gettime 6 +if test $ac_cv_lib_rt_clock_gettime = yes; then + cat confdefs.h EOF +#define HAVE_LIBRT 1 +EOF + + LIBS=-lrt $LIBS + +fi + for ac_func in fparseln do as_ac_var=`echo ac_cv_func_$ac_func | $as_tr_sh` -echo $as_me:7513: checking for $ac_func 5 +echo $as_me:7571: 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 -#line 7519 configure +#line 7577 configure #include confdefs.h /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ @@ -7547,16 +7605,16 @@ f = $ac_func; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo $as_me:7550: \$ac_link\) 5 +if { (eval echo $as_me:7608: \$ac_link\) 5 (eval $ac_link) 25 ac_status=$? - echo $as_me:7553: \$? = $ac_status 5 + echo $as_me:7611: \$? = $ac_status 5 (exit $ac_status); } { ac_try='test -s conftest$ac_exeext' - { (eval echo $as_me:7556: \$ac_try\) 5 + { (eval echo $as_me:7614: \$ac_try\) 5 (eval $ac_try) 25 ac_status=$? - echo $as_me:7559: \$? = $ac_status 5 + echo $as_me:7617: \$? = $ac_status 5 (exit $ac_status); }; }; then eval $as_ac_var=yes else @@ -7566,22 +7624,22 @@ eval $as_ac_var=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo $as_me:7569: result: `eval echo '${'$as_ac_var'}'` 5 +echo $as_me:7627: 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 EOF #define `echo HAVE_$ac_func | $as_tr_cpp` 1 EOF -echo $as_me:7576: checking if fparseln seems to work 5 +echo $as_me:7634: checking if fparseln seems to work 5 echo $ECHO_N checking if fparseln seems to work... $ECHO_C 6 if test $cross_compiling = yes; then - { echo $as_me:7579: WARNING: cross compiling: not checking farseln 5 + { echo $as_me:7637: WARNING: cross compiling: not checking farseln 5 echo $as_me: WARNING: cross compiling: not checking farseln 2;} else cat conftest.$ac_ext _ACEOF -#line 7584 configure +#line 7642 configure #include confdefs.h #define _NETBSD_SOURCE @@ -7610,23 +7668,23 @@ main(void) _ACEOF rm -f conftest$ac_exeext -if { (eval echo $as_me:7613: \$ac_link\) 5 +if { (eval echo $as_me:7671: \$ac_link\) 5 (eval $ac_link) 25 ac_status=$? - echo $as_me:7616: \$? = $ac_status 5 + echo $as_me:7674: \$? = $ac_status 5 (exit $ac_status); } { ac_try='./conftest$ac_exeext' - { (eval echo $as_me:7618: \$ac_try\) 5 + { (eval echo $as_me:7676: \$ac_try\) 5 (eval $ac_try) 25 ac_status=$? - echo $as_me:7621: \$? = $ac_status 5 + echo $as_me:7679: \$? = $ac_status 5 (exit $ac_status); }; }; then - echo $as_me:7623:
CVS commit: src/tools/compat
Module Name:src Committed By: apb Date: Tue Aug 6 21:50:19 UTC 2013 Modified Files: src/tools/compat: configure.ac Log Message: Add a configure test for snprintb_m. We will assume that the rpesence of snprintb_m implies the presence of snprintb. To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/tools/compat/configure.ac Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/configure.ac diff -u src/tools/compat/configure.ac:1.77 src/tools/compat/configure.ac:1.78 --- src/tools/compat/configure.ac:1.77 Fri Jul 19 10:53:20 2013 +++ src/tools/compat/configure.ac Tue Aug 6 21:50:19 2013 @@ -1,4 +1,4 @@ -# $NetBSD: configure.ac,v 1.77 2013/07/19 10:53:20 pooka Exp $ +# $NetBSD: configure.ac,v 1.78 2013/08/06 21:50:19 apb Exp $ # # Autoconf definition file for libnbcompat. # @@ -157,7 +157,8 @@ AC_CHECK_FUNCS(atoll asprintf asnprintf heapsort isblank issetugid lchflags lchmod lchown lutimes mkstemp \ mkdtemp poll pread putc_unlocked pwcache_userdb pwcache_groupdb \ pwrite raise_default_signal random setenv \ - setgroupent setprogname setpassent snprintf strlcat strlcpy strmode \ + setgroupent setprogname setpassent \ + snprintb_m snprintf strlcat strlcpy strmode \ strndup strsep strsuftoll strtoll \ user_from_uid uid_from_user vasprintf vasnprintf vsnprintf)
CVS commit: src/tools/compat
Module Name:src Committed By: apb Date: Tue Aug 6 21:58:46 UTC 2013 Modified Files: src/tools/compat: compat_defs.h Log Message: declare snptintb_m() and snprintb() if HAVE_SNPRINTB is not defined. To generate a diff of this commit: cvs rdiff -u -r1.90 -r1.91 src/tools/compat/compat_defs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.90 src/tools/compat/compat_defs.h:1.91 --- src/tools/compat/compat_defs.h:1.90 Sat Jul 20 10:31:19 2013 +++ src/tools/compat/compat_defs.h Tue Aug 6 21:58:46 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.90 2013/07/20 10:31:19 christos Exp $ */ +/* $NetBSD: compat_defs.h,v 1.91 2013/08/06 21:58:46 apb Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -446,6 +446,11 @@ const char *getprogname(void); void setprogname(const char *); #endif +#if !HAVE_SNPRINTB_M +int snprintb(char *, size_t, const char *, uint64_t); +int snprintb_m(char *, size_t, const char *, uint64_t, size_t); +#endif + #if !HAVE_SNPRINTF int snprintf(char *, size_t, const char *, ...); #endif
CVS commit: src/tools/compat
Module Name:src Committed By: apb Date: Tue Aug 6 22:04:25 UTC 2013 Modified Files: src/tools/compat: Makefile Log Message: Compile snprintb.c into libnbcompat. The source file is found in the common/lib/libutil directory. To generate a diff of this commit: cvs rdiff -u -r1.68 -r1.69 src/tools/compat/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.68 src/tools/compat/Makefile:1.69 --- src/tools/compat/Makefile:1.68 Tue Mar 5 16:27:29 2013 +++ src/tools/compat/Makefile Tue Aug 6 22:04:25 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.68 2013/03/05 16:27:29 christos Exp $ +# $NetBSD: Makefile,v 1.69 2013/08/06 22:04:25 apb Exp $ HOSTLIB= nbcompat @@ -16,9 +16,10 @@ SRCS= atoll.c basename.c cdbr.c cdbw.c raise_default_signal.c rmd160.c rmd160hl.c \ setenv.c setgroupent.c \ setpassent.c setprogname.c sha1.c sha1hl.c sha2.c \ - sha256hl.c sha384hl.c sha512hl.c snprintf.c stat_flags.c \ - strlcat.c strlcpy.c strmode.c strndup.c strsep.c strsuftoll.c \ - strtoll.c unvis.c vis.c err.c errx.c verr.c verrx.c \ + sha256hl.c sha384hl.c sha512hl.c snprintb.c snprintf.c \ + stat_flags.c strlcat.c strlcpy.c strmode.c strndup.c \ + strsep.c strsuftoll.c strtoll.c \ + unvis.c vis.c err.c errx.c verr.c verrx.c \ vwarn.c vwarnx.c warn.c warnx.c fts.c glob.c efun.c BUILD_OSTYPE!= uname -s @@ -53,6 +54,7 @@ CPPFLAGS+= -I. -I./include -I${.CURDIR} ${.CURDIR}/../../common/lib/libc/hash/sha2 \ ${.CURDIR}/../../common/lib/libc/md \ ${.CURDIR}/../../common/lib/libc/stdlib \ + ${.CURDIR}/../../common/lib/libutil \ ${.CURDIR}/../../external/bsd/flex/dist DPSRCS+= defs.mk
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Sat Jul 20 10:31:19 UTC 2013 Modified Files: src/tools/compat: compat_defs.h Log Message: revert socklen_t to int (from dh) To generate a diff of this commit: cvs rdiff -u -r1.89 -r1.90 src/tools/compat/compat_defs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.89 src/tools/compat/compat_defs.h:1.90 --- src/tools/compat/compat_defs.h:1.89 Fri Jul 19 08:00:30 2013 +++ src/tools/compat/compat_defs.h Sat Jul 20 06:31:19 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.89 2013/07/19 12:00:30 christos Exp $ */ +/* $NetBSD: compat_defs.h,v 1.90 2013/07/20 10:31:19 christos Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -168,7 +168,12 @@ typedef unsigned int id_t; #endif #if !HAVE_SOCKLEN_T -typedef unsigned int socklen_t; +/* + * This is defined as int for compatibility with legacy systems (and not + * unsigned int), since universally it was int in most systems that did not + * define it. + */ +typedef int socklen_t; #endif #if !HAVE_U_LONG
CVS commit: src/tools/compat
Module Name:src Committed By: pooka Date: Fri Jul 19 10:53:20 UTC 2013 Modified Files: src/tools/compat: configure.ac Log Message: Fix some tests for musl libc -based systems. from Justin Cormack and Jens Staal To generate a diff of this commit: cvs rdiff -u -r1.76 -r1.77 src/tools/compat/configure.ac Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/configure.ac diff -u src/tools/compat/configure.ac:1.76 src/tools/compat/configure.ac:1.77 --- src/tools/compat/configure.ac:1.76 Tue Mar 5 16:26:41 2013 +++ src/tools/compat/configure.ac Fri Jul 19 10:53:20 2013 @@ -1,4 +1,4 @@ -# $NetBSD: configure.ac,v 1.76 2013/03/05 16:26:41 christos Exp $ +# $NetBSD: configure.ac,v 1.77 2013/07/19 10:53:20 pooka Exp $ # # Autoconf definition file for libnbcompat. # @@ -100,7 +100,9 @@ AC_CHECK_TYPES([id_t, long long, u_long, AC_CHECK_TYPE(socklen_t, [AC_DEFINE([HAVE_SOCKLEN_T], 1, [Define if you have the socklen_t type.])],, [#include sys/types.h +#ifdef HAVE_RPC_TYPES_H #include rpc/types.h +#endif #include sys/socket.h]) dnl XXX - This is UGLY. Need a better way to homogenize the bitsized types, @@ -141,6 +143,9 @@ AC_CHECK_DECLS([optind, optreset],,, [ #include stdio.h #include stdlib.h #include unistd.h +#ifdef HAVE_GETOPT_H +#include getopt.h +#endif ]) AC_CHECK_DECLS(sys_signame,,, [#include signal.h])
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Fri Jul 19 12:00:30 UTC 2013 Modified Files: src/tools/compat: compat_defs.h Log Message: PR/48063: Justin Cormack: incorrect definition of socklen_t To generate a diff of this commit: cvs rdiff -u -r1.88 -r1.89 src/tools/compat/compat_defs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.88 src/tools/compat/compat_defs.h:1.89 --- src/tools/compat/compat_defs.h:1.88 Tue Mar 5 11:26:41 2013 +++ src/tools/compat/compat_defs.h Fri Jul 19 08:00:30 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.88 2013/03/05 16:26:41 christos Exp $ */ +/* $NetBSD: compat_defs.h,v 1.89 2013/07/19 12:00:30 christos Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -168,7 +168,7 @@ typedef unsigned int id_t; #endif #if !HAVE_SOCKLEN_T -typedef int socklen_t; +typedef unsigned int socklen_t; #endif #if !HAVE_U_LONG
CVS commit: src/tools/compat/sys
Module Name:src Committed By: christos Date: Tue Mar 12 01:52:56 UTC 2013 Modified Files: src/tools/compat/sys: sha1.h Log Message: not a good place to include nbtool_config.h To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tools/compat/sys/sha1.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/sys/sha1.h diff -u src/tools/compat/sys/sha1.h:1.1 src/tools/compat/sys/sha1.h:1.2 --- src/tools/compat/sys/sha1.h:1.1 Sun Oct 29 01:17:08 2006 +++ src/tools/compat/sys/sha1.h Mon Mar 11 21:52:55 2013 @@ -1,5 +1,4 @@ -/* $NetBSD: sha1.h,v 1.1 2006/10/29 06:17:08 dogcow Exp $ */ +/* $NetBSD: sha1.h,v 1.2 2013/03/12 01:52:55 christos Exp $ */ /* We unconditionally use the NetBSD SHA1 in libnbcompat. */ -#include nbtool_config.h #include ../../sys/sys/sha1.h
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Tue Mar 5 16:26:42 UTC 2013 Modified Files: src/tools/compat: compat_defs.h configure.ac Added Files: src/tools/compat: dprintf.c Log Message: add dprintf To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/tools/compat/compat_defs.h cvs rdiff -u -r1.75 -r1.76 src/tools/compat/configure.ac cvs rdiff -u -r0 -r1.1 src/tools/compat/dprintf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.87 src/tools/compat/compat_defs.h:1.88 --- src/tools/compat/compat_defs.h:1.87 Sat Feb 16 19:34:11 2013 +++ src/tools/compat/compat_defs.h Tue Mar 5 11:26:41 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.87 2013/02/17 00:34:11 christos Exp $ */ +/* $NetBSD: compat_defs.h,v 1.88 2013/03/05 16:26:41 christos Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -267,6 +267,9 @@ int evasprintf(char **, const char *, va #if !HAVE_FGETLN || defined(__NetBSD__) char *fgetln(FILE *, size_t *); #endif +#if !HAVE_DPRINTF +int dprintf(int, const char *, ...); +#endif #if !HAVE_FLOCK # define LOCK_SH 0x01 Index: src/tools/compat/configure.ac diff -u src/tools/compat/configure.ac:1.75 src/tools/compat/configure.ac:1.76 --- src/tools/compat/configure.ac:1.75 Sat Feb 16 19:34:11 2013 +++ src/tools/compat/configure.ac Tue Mar 5 11:26:41 2013 @@ -1,4 +1,4 @@ -# $NetBSD: configure.ac,v 1.75 2013/02/17 00:34:11 christos Exp $ +# $NetBSD: configure.ac,v 1.76 2013/03/05 16:26:41 christos Exp $ # # Autoconf definition file for libnbcompat. # @@ -147,7 +147,7 @@ AC_CHECK_DECLS(sys_signame,,, [#include # Library functions (where a .h check isn't enough). AC_FUNC_ALLOCA AC_CHECK_FUNCS(atoll asprintf asnprintf basename devname dirfd dirname \ - esetfunc fgetln flock fpurge __fpurge futimes getline \ + dprintf esetfunc fgetln flock fpurge __fpurge futimes getline \ getopt getopt_long group_from_gid gid_from_group \ heapsort isblank issetugid lchflags lchmod lchown lutimes mkstemp \ mkdtemp poll pread putc_unlocked pwcache_userdb pwcache_groupdb \ Added files: Index: src/tools/compat/dprintf.c diff -u /dev/null src/tools/compat/dprintf.c:1.1 --- /dev/null Tue Mar 5 11:26:42 2013 +++ src/tools/compat/dprintf.c Tue Mar 5 11:26:41 2013 @@ -0,0 +1,75 @@ +/* $NetBSD: dprintf.c,v 1.1 2013/03/05 16:26:41 christos Exp $ */ + +/*- + * Copyright (c) 2013 NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE 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. + */ + +#ifdef HAVE_NBTOOL_CONFIG_H +#include nbtool_config.h +#endif + +#if !HAVE_DPRINTF +#include stdlib.h +#ifndef HAVE_NBTOOL_CONFIG_H +/* These headers are required, but included from nbtool_config.h */ +#include stdio.h +#include stdarg.h +#include unistd.h +#endif + +int +dprintf(int fd, const char *fmt, ...) +{ + FILE *fp; + int e; + va_list ap; + + if ((e = dup(fd)) == -1) + return -1; + + if ((fp = fdopen(e, r+)) == NULL) + return -1; + + va_start(ap, fmt); + e = vfprintf(fp, fmt, ap); + va_end(ap); + + (void)fclose(fp); + return e; +} + +#endif /* HAVE_DPRINTF */ + +#ifdef TEST +int +main(int argc, char *argv[]) +{ + dprintf(1, Hello %s\n, world); + return 0; +} +#endif
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Tue Mar 5 16:27:29 UTC 2013 Modified Files: src/tools/compat: Makefile Log Message: add dprintf To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 src/tools/compat/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.67 src/tools/compat/Makefile:1.68 --- src/tools/compat/Makefile:1.67 Sun Dec 9 19:34:56 2012 +++ src/tools/compat/Makefile Tue Mar 5 11:27:29 2013 @@ -1,11 +1,11 @@ -# $NetBSD: Makefile,v 1.67 2012/12/10 00:34:56 christos Exp $ +# $NetBSD: Makefile,v 1.68 2013/03/05 16:27:29 christos Exp $ HOSTLIB= nbcompat .include bsd.own.mk SRCS= atoll.c basename.c cdbr.c cdbw.c dirname.c \ - fgetln.c flock.c fparseln.c fpurge.c \ + dprintf.c fgetln.c flock.c fparseln.c fpurge.c \ getcap.c getline.c getmode.c getopt_long.c gettemp.c \ heapsort.c \ issetugid.c lchflags.c lchmod.c lchown.c libyywrap.c \
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Sun Feb 17 00:34:11 UTC 2013 Modified Files: src/tools/compat: compat_defs.h configure.ac Log Message: cygwin defines u_quad_t in rpc/types.h, so include this to the headers we include and test by default. To generate a diff of this commit: cvs rdiff -u -r1.86 -r1.87 src/tools/compat/compat_defs.h cvs rdiff -u -r1.74 -r1.75 src/tools/compat/configure.ac Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.86 src/tools/compat/compat_defs.h:1.87 --- src/tools/compat/compat_defs.h:1.86 Mon Jun 4 06:18:01 2012 +++ src/tools/compat/compat_defs.h Sat Feb 16 19:34:11 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.86 2012/06/04 10:18:01 joerg Exp $ */ +/* $NetBSD: compat_defs.h,v 1.87 2013/02/17 00:34:11 christos Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -62,6 +62,10 @@ #include stddef.h #endif +#if HAVE_RPC_TYPES_H +#include rpc/types.h +#endif + #ifdef _NETBSD_SOURCE #error _NETBSD_SOURCE is *not* to be defined. #endif Index: src/tools/compat/configure.ac diff -u src/tools/compat/configure.ac:1.74 src/tools/compat/configure.ac:1.75 --- src/tools/compat/configure.ac:1.74 Thu Nov 3 10:13:53 2011 +++ src/tools/compat/configure.ac Sat Feb 16 19:34:11 2013 @@ -1,4 +1,4 @@ -# $NetBSD: configure.ac,v 1.74 2011/11/03 14:13:53 joerg Exp $ +# $NetBSD: configure.ac,v 1.75 2013/02/17 00:34:11 christos Exp $ # # Autoconf definition file for libnbcompat. # @@ -79,7 +79,7 @@ AC_CHECK_HEADERS(sys/ioctl.h sys/mman.h # Find headers that may not be available. AC_HEADER_DIRENT AC_CHECK_HEADERS(sys/mtio.h sys/sysmacros.h sys/syslimits.h \ - getopt.h features.h malloc.h sys/poll.h pthread.h stddef.h) + getopt.h features.h malloc.h sys/poll.h pthread.h stddef.h rpc/types.h) AC_CHECK_HEADERS(sys/bswap.h machine/bswap.h sys/cdefs.h machine/endian.h \ sys/endian.h sys/featuretest.h err.h inttypes.h libgen.h paths.h \ stdint.h util.h resolv.h arpa/nameser.h,, @@ -100,6 +100,7 @@ AC_CHECK_TYPES([id_t, long long, u_long, AC_CHECK_TYPE(socklen_t, [AC_DEFINE([HAVE_SOCKLEN_T], 1, [Define if you have the socklen_t type.])],, [#include sys/types.h +#include rpc/types.h #include sys/socket.h]) dnl XXX - This is UGLY. Need a better way to homogenize the bitsized types,
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Thu Feb 7 20:30:29 UTC 2013 Added Files: src/tools/compat: rmd160.h sha1.h sha2.h Log Message: add shaX and rmd160 headers, same as mdX To generate a diff of this commit: cvs rdiff -u -r0 -r1.4 src/tools/compat/rmd160.h cvs rdiff -u -r0 -r1.5 src/tools/compat/sha1.h cvs rdiff -u -r0 -r1.1 src/tools/compat/sha2.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/tools/compat/rmd160.h diff -u /dev/null src/tools/compat/rmd160.h:1.4 --- /dev/null Thu Feb 7 15:30:29 2013 +++ src/tools/compat/rmd160.h Thu Feb 7 15:30:29 2013 @@ -0,0 +1,5 @@ +/* $NetBSD: rmd160.h,v 1.4 2013/02/07 20:30:29 christos Exp $ */ + +/* We unconditionally use the NetBSD rmd160 in libnbcompat. */ +#include nbtool_config.h +#include ../../sys/sys/rmd160.h Index: src/tools/compat/sha1.h diff -u /dev/null src/tools/compat/sha1.h:1.5 --- /dev/null Thu Feb 7 15:30:29 2013 +++ src/tools/compat/sha1.h Thu Feb 7 15:30:29 2013 @@ -0,0 +1,5 @@ +/* $NetBSD: sha1.h,v 1.5 2013/02/07 20:30:29 christos Exp $ */ + +/* We unconditionally use the NetBSD sha1 in libnbcompat. */ +#include nbtool_config.h +#include ../../sys/sys/sha1.h Index: src/tools/compat/sha2.h diff -u /dev/null src/tools/compat/sha2.h:1.1 --- /dev/null Thu Feb 7 15:30:29 2013 +++ src/tools/compat/sha2.h Thu Feb 7 15:30:29 2013 @@ -0,0 +1,5 @@ +/* $NetBSD: sha2.h,v 1.1 2013/02/07 20:30:29 christos Exp $ */ + +/* We unconditionally use the NetBSD sha2 in libnbcompat. */ +#include nbtool_config.h +#include ../../sys/sys/md5.h
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Thu Feb 7 20:31:52 UTC 2013 Modified Files: src/tools/compat: sha2.h Log Message: yes, but include the right file To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tools/compat/sha2.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/sha2.h diff -u src/tools/compat/sha2.h:1.1 src/tools/compat/sha2.h:1.2 --- src/tools/compat/sha2.h:1.1 Thu Feb 7 15:30:29 2013 +++ src/tools/compat/sha2.h Thu Feb 7 15:31:52 2013 @@ -1,5 +1,5 @@ -/* $NetBSD: sha2.h,v 1.1 2013/02/07 20:30:29 christos Exp $ */ +/* $NetBSD: sha2.h,v 1.2 2013/02/07 20:31:52 christos Exp $ */ /* We unconditionally use the NetBSD sha2 in libnbcompat. */ #include nbtool_config.h -#include ../../sys/sys/md5.h +#include ../../sys/sys/sha2.h
CVS commit: src/tools/compat/fs/msdosfs
Module Name:src Committed By: christos Date: Sat Jan 26 16:52:43 UTC 2013 Added Files: src/tools/compat/fs/msdosfs: bootsect.h bpb.h denode.h direntry.h fat.h msdosfsmount.h Log Message: links for makefs To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/tools/compat/fs/msdosfs/bootsect.h \ src/tools/compat/fs/msdosfs/bpb.h src/tools/compat/fs/msdosfs/denode.h \ src/tools/compat/fs/msdosfs/direntry.h src/tools/compat/fs/msdosfs/fat.h \ src/tools/compat/fs/msdosfs/msdosfsmount.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/tools/compat/fs/msdosfs/bootsect.h diff -u /dev/null src/tools/compat/fs/msdosfs/bootsect.h:1.1 --- /dev/null Sat Jan 26 11:52:43 2013 +++ src/tools/compat/fs/msdosfs/bootsect.h Sat Jan 26 11:52:43 2013 @@ -0,0 +1 @@ +#include ../../../../sys/fs/msdosfs/bootsect.h Index: src/tools/compat/fs/msdosfs/bpb.h diff -u /dev/null src/tools/compat/fs/msdosfs/bpb.h:1.1 --- /dev/null Sat Jan 26 11:52:43 2013 +++ src/tools/compat/fs/msdosfs/bpb.h Sat Jan 26 11:52:43 2013 @@ -0,0 +1 @@ +#include ../../../../sys/fs/msdosfs/bpb.h Index: src/tools/compat/fs/msdosfs/denode.h diff -u /dev/null src/tools/compat/fs/msdosfs/denode.h:1.1 --- /dev/null Sat Jan 26 11:52:43 2013 +++ src/tools/compat/fs/msdosfs/denode.h Sat Jan 26 11:52:43 2013 @@ -0,0 +1 @@ +#include ../../../../sys/fs/msdosfs/denode.h Index: src/tools/compat/fs/msdosfs/direntry.h diff -u /dev/null src/tools/compat/fs/msdosfs/direntry.h:1.1 --- /dev/null Sat Jan 26 11:52:43 2013 +++ src/tools/compat/fs/msdosfs/direntry.h Sat Jan 26 11:52:43 2013 @@ -0,0 +1 @@ +#include ../../../../sys/fs/msdosfs/direntry.h Index: src/tools/compat/fs/msdosfs/fat.h diff -u /dev/null src/tools/compat/fs/msdosfs/fat.h:1.1 --- /dev/null Sat Jan 26 11:52:43 2013 +++ src/tools/compat/fs/msdosfs/fat.h Sat Jan 26 11:52:43 2013 @@ -0,0 +1 @@ +#include ../../../../sys/fs/msdosfs/fat.h Index: src/tools/compat/fs/msdosfs/msdosfsmount.h diff -u /dev/null src/tools/compat/fs/msdosfs/msdosfsmount.h:1.1 --- /dev/null Sat Jan 26 11:52:43 2013 +++ src/tools/compat/fs/msdosfs/msdosfsmount.h Sat Jan 26 11:52:43 2013 @@ -0,0 +1 @@ +#include ../../../../sys/fs/msdosfs/msdosfsmount.h
CVS commit: src/tools/compat
Module Name:src Committed By: apb Date: Sun Dec 9 15:22:54 UTC 2012 Modified Files: src/tools/compat: Makefile Log Message: Use a find | while read loop to install all *.h files anywhere under ${.OBJDIR}/include, and remove the previous hack of touching a dummy file in each subdirectory. This should fix a problem on some platforms where include files directly under ${.OBJDIR}/include (not in a subdirectory) were not installed. To generate a diff of this commit: cvs rdiff -u -r1.61 -r1.62 src/tools/compat/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.61 src/tools/compat/Makefile:1.62 --- src/tools/compat/Makefile:1.61 Sun Dec 2 12:34:51 2012 +++ src/tools/compat/Makefile Sun Dec 9 15:22:54 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.61 2012/12/02 12:34:51 apb Exp $ +# $NetBSD: Makefile,v 1.62 2012/12/09 15:22:54 apb Exp $ HOSTLIB= nbcompat @@ -106,12 +106,12 @@ install.includes: .PHONY ${_MKMSG_INSTALL} ${HOST_INCSDIR}/* ${HOST_INSTALL_DIR} ${HOST_INCSDIR} ${HOST_INSTALL_DIR} ${HOST_INCSDIR}/compat - ${HOST_INSTALL_FILE} ${INCFILES} ${HOST_INCSDIR}/compat/ .for _d in ${INCSUBDIRS} ${HOST_INSTALL_DIR} ${HOST_INCSDIR}/compat/${_d} - touch include/${_d}/dummy # ensure dir is not empty - ${HOST_INSTALL_FILE} include/${_d}/* ${HOST_INCSDIR}/compat/${_d}/ .endfor + (cd include find . -name '*.h' -print | while read f ; do \ + ${HOST_INSTALL_FILE} $$f ${HOST_INCSDIR}/compat/$$f ; \ + done) # Install defs.mk in ${TOOLDIR}/share/compat install.defs.mk: .PHONY ${HOST_SHAREDIR}/compat/defs.mk
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Sun Dec 9 18:08:08 UTC 2012 Modified Files: src/tools/compat: Makefile Log Message: Include bsd.own.mk to give a chance to ${TOOLDIR} to be defined before using it in rules. Before there was another .mk file included before ${TOOLDIR} was used. To generate a diff of this commit: cvs rdiff -u -r1.62 -r1.63 src/tools/compat/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.62 src/tools/compat/Makefile:1.63 --- src/tools/compat/Makefile:1.62 Sun Dec 9 10:22:54 2012 +++ src/tools/compat/Makefile Sun Dec 9 13:08:08 2012 @@ -1,4 +1,6 @@ -# $NetBSD: Makefile,v 1.62 2012/12/09 15:22:54 apb Exp $ +# $NetBSD: Makefile,v 1.63 2012/12/09 18:08:08 christos Exp $ + +.include bsd.own.mk HOSTLIB= nbcompat
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Sun Dec 9 19:15:49 UTC 2012 Modified Files: src/tools/compat: Makefile Log Message: make this work To generate a diff of this commit: cvs rdiff -u -r1.63 -r1.64 src/tools/compat/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.63 src/tools/compat/Makefile:1.64 --- src/tools/compat/Makefile:1.63 Sun Dec 9 13:08:08 2012 +++ src/tools/compat/Makefile Sun Dec 9 14:15:48 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.63 2012/12/09 18:08:08 christos Exp $ +# $NetBSD: Makefile,v 1.64 2012/12/09 19:15:48 christos Exp $ .include bsd.own.mk @@ -94,7 +94,7 @@ HOST_LIBDIR= ${TOOLDIR}/lib HOST_INCSDIR= ${TOOLDIR}/include HOST_SHAREDIR= ${TOOLDIR}/share -install: .PHONY install.lib install.includes install.defs.mk +install: .PHONY install.lib includes install.defs.mk # Install lib${HOSTLIB}.a in ${TOOLDIR}/lib install.lib: .PHONY ${HOST_LIBDIR}/lib${HOSTLIB}.a @@ -103,17 +103,22 @@ ${HOST_LIBDIR}/lib${HOSTLIB}.a: lib${HOS ${HOST_INSTALL_DIR} ${HOST_LIBDIR} ${HOST_INSTALL_FILE} -m ${LIBMODE} ${.ALLSRC} ${.TARGET} -# Install include files in ${TOOLDIR}/include/compat -install.includes: .PHONY - ${_MKMSG_INSTALL} ${HOST_INCSDIR}/* - ${HOST_INSTALL_DIR} ${HOST_INCSDIR} - ${HOST_INSTALL_DIR} ${HOST_INCSDIR}/compat +.for _f in ${INCFILES} +HOST_INCINSTFILES+= ${HOST_INCSDIR}/compat/${_f} +${HOST_INCSDIR}/compat/${_f}: ${_f} + ${_MKTARGET_INSTALL} + ${HOST_INSTALL_FILE} ${.ALLSRC} ${.TARGET} +.endfor + .for _d in ${INCSUBDIRS} - ${HOST_INSTALL_DIR} ${HOST_INCSDIR}/compat/${_d} +HOST_INCINSTDIRS+= ${HOST_INCSDIR}/compat/${_d} +${HOST_INCSDIR}/compat/${_d}: + ${_MKTARGET_INSTALL} + ${HOST_INSTALL_DIR} ${.TARGET} .endfor - (cd include find . -name '*.h' -print | while read f ; do \ - ${HOST_INSTALL_FILE} $$f ${HOST_INCSDIR}/compat/$$f ; \ - done) + +# Install include files in ${TOOLDIR}/include/compat +includes: .PHONY ${HOST_INCINSTDIRS} .WAIT ${HOST_INCINSTFILES} # Install defs.mk in ${TOOLDIR}/share/compat install.defs.mk: .PHONY ${HOST_SHAREDIR}/compat/defs.mk
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Sun Dec 9 21:48:04 UTC 2012 Modified Files: src/tools/compat: Makefile Log Message: handle the list of files and directories generated dynamically by configure To generate a diff of this commit: cvs rdiff -u -r1.64 -r1.65 src/tools/compat/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.64 src/tools/compat/Makefile:1.65 --- src/tools/compat/Makefile:1.64 Sun Dec 9 14:15:48 2012 +++ src/tools/compat/Makefile Sun Dec 9 16:48:04 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.64 2012/12/09 19:15:48 christos Exp $ +# $NetBSD: Makefile,v 1.65 2012/12/09 21:48:04 christos Exp $ .include bsd.own.mk @@ -76,7 +76,11 @@ defs.mk: config.cache @touch ${.TARGET} INCFILES= nbtool_config.h -INCSUBDIRS= sys machine rpc arpa +# Generate the list of include files generated by configure the ./ is so that +# the list is not empty. +_INCCONFFILES!= cd include find . -name '*.h' echo ./ +INCCONFFILES= ${_INCCONFFILES:S@./@@} +INCSUBDIRS= ${INCCONFFILES:H:O:u:N.} CLEANDIRFILES+= ${INCFILES} # CLEANDIRFILES may not contain directory names @@ -92,7 +96,7 @@ include/.stamp: HOST_LIBDIR= ${TOOLDIR}/lib HOST_INCSDIR= ${TOOLDIR}/include -HOST_SHAREDIR= ${TOOLDIR}/share +HOST_SHAREDIR= ${TOOLDIR}/share install: .PHONY install.lib includes install.defs.mk @@ -110,6 +114,13 @@ ${HOST_INCSDIR}/compat/${_f}: ${_f} ${HOST_INSTALL_FILE} ${.ALLSRC} ${.TARGET} .endfor +.for _f in ${INCCONFFILES} +HOST_INCINSTFILES+= ${HOST_INCSDIR}/compat/${_f} +${HOST_INCSDIR}/compat/${_f}: include/${_f} + ${_MKTARGET_INSTALL} + ${HOST_INSTALL_FILE} ${.ALLSRC} ${.TARGET} +.endfor + .for _d in ${INCSUBDIRS} HOST_INCINSTDIRS+= ${HOST_INCSDIR}/compat/${_d} ${HOST_INCSDIR}/compat/${_d}:
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Sun Dec 9 23:18:30 UTC 2012 Modified Files: src/tools/compat: Makefile Log Message: restore the find loop to include files generated by configure To generate a diff of this commit: cvs rdiff -u -r1.65 -r1.66 src/tools/compat/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.65 src/tools/compat/Makefile:1.66 --- src/tools/compat/Makefile:1.65 Sun Dec 9 16:48:04 2012 +++ src/tools/compat/Makefile Sun Dec 9 18:18:30 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.65 2012/12/09 21:48:04 christos Exp $ +# $NetBSD: Makefile,v 1.66 2012/12/09 23:18:30 christos Exp $ .include bsd.own.mk @@ -76,11 +76,7 @@ defs.mk: config.cache @touch ${.TARGET} INCFILES= nbtool_config.h -# Generate the list of include files generated by configure the ./ is so that -# the list is not empty. -_INCCONFFILES!= cd include find . -name '*.h' echo ./ -INCCONFFILES= ${_INCCONFFILES:S@./@@} -INCSUBDIRS= ${INCCONFFILES:H:O:u:N.} +INCSUBDIRS= sys machine rpc arpa CLEANDIRFILES+= ${INCFILES} # CLEANDIRFILES may not contain directory names @@ -96,7 +92,7 @@ include/.stamp: HOST_LIBDIR= ${TOOLDIR}/lib HOST_INCSDIR= ${TOOLDIR}/include -HOST_SHAREDIR= ${TOOLDIR}/share +HOST_SHAREDIR= ${TOOLDIR}/share install: .PHONY install.lib includes install.defs.mk @@ -114,13 +110,6 @@ ${HOST_INCSDIR}/compat/${_f}: ${_f} ${HOST_INSTALL_FILE} ${.ALLSRC} ${.TARGET} .endfor -.for _f in ${INCCONFFILES} -HOST_INCINSTFILES+= ${HOST_INCSDIR}/compat/${_f} -${HOST_INCSDIR}/compat/${_f}: include/${_f} - ${_MKTARGET_INSTALL} - ${HOST_INSTALL_FILE} ${.ALLSRC} ${.TARGET} -.endfor - .for _d in ${INCSUBDIRS} HOST_INCINSTDIRS+= ${HOST_INCSDIR}/compat/${_d} ${HOST_INCSDIR}/compat/${_d}: @@ -130,6 +119,10 @@ ${HOST_INCSDIR}/compat/${_d}: # Install include files in ${TOOLDIR}/include/compat includes: .PHONY ${HOST_INCINSTDIRS} .WAIT ${HOST_INCINSTFILES} + @(cd include find . -name '*.h' -print | while read f ; do \ + ${HOST_INSTALL_FILE} $$f ${HOST_INCSDIR}/compat/$$f ; \ + done) + # Install defs.mk in ${TOOLDIR}/share/compat install.defs.mk: .PHONY ${HOST_SHAREDIR}/compat/defs.mk
CVS commit: src/tools/compat
Module Name:src Committed By: christos Date: Mon Dec 10 00:34:56 UTC 2012 Modified Files: src/tools/compat: Makefile Log Message: first define HOSTLIB and then include bsd.own.mk! To generate a diff of this commit: cvs rdiff -u -r1.66 -r1.67 src/tools/compat/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.66 src/tools/compat/Makefile:1.67 --- src/tools/compat/Makefile:1.66 Sun Dec 9 18:18:30 2012 +++ src/tools/compat/Makefile Sun Dec 9 19:34:56 2012 @@ -1,9 +1,9 @@ -# $NetBSD: Makefile,v 1.66 2012/12/09 23:18:30 christos Exp $ - -.include bsd.own.mk +# $NetBSD: Makefile,v 1.67 2012/12/10 00:34:56 christos Exp $ HOSTLIB= nbcompat +.include bsd.own.mk + SRCS= atoll.c basename.c cdbr.c cdbw.c dirname.c \ fgetln.c flock.c fparseln.c fpurge.c \ getcap.c getline.c getmode.c getopt_long.c gettemp.c \
CVS commit: src/tools/compat
Module Name:src Committed By: apb Date: Sun Dec 2 12:19:34 UTC 2012 Modified Files: src/tools/compat: Makefile Log Message: Teach tools/compat/Makefile to use an uninstalled copy of host-mkdep from the.OBJDIR of tools/host-mkdep. This is in preparation for building all three of tools/host-mkdep, tools/compat, and tools/binstall, before installing any of them. While here, also move the regen target to the end. To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 src/tools/compat/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.59 src/tools/compat/Makefile:1.60 --- src/tools/compat/Makefile:1.59 Mon Jun 4 19:06:45 2012 +++ src/tools/compat/Makefile Sun Dec 2 12:19:34 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.59 2012/06/04 19:06:45 joerg Exp $ +# $NetBSD: Makefile,v 1.60 2012/12/02 12:19:34 apb Exp $ HOSTLIB= nbcompat @@ -72,12 +72,6 @@ config.cache: include/.stamp configure n defs.mk: config.cache @touch ${.TARGET} -# Run ${TOOLDIR}/bin/nbmake-${MACHINE} regen by hand after editing -# configure.ac. See more detailed instructions in configure.ac. -regen: - cd ${.CURDIR} ${TOOLDIR}/bin/${_TOOL_PREFIX}autoconf - cd ${.CURDIR} ${TOOLDIR}/bin/${_TOOL_PREFIX}autoheader - include/.stamp: mkdir -p include/sys include/machine include/rpc include/arpa @touch ${.TARGET} @@ -91,3 +85,14 @@ HOST_CPPFLAGS:= ${CPPFLAGS} CPPFLAGS:= # empty .include bsd.hostlib.mk + +# Use uninstalled copy of host-mkdep +HOST_MKDEP_OBJ!= cd ${.CURDIR}/../host-mkdep ${PRINTOBJDIR} +HOST_MKDEP= ${HOST_MKDEP_OBJ}/host-mkdep +MKDEP= ${HOST_MKDEP} + +# Run ${TOOLDIR}/bin/nbmake-${MACHINE} regen by hand after editing +# configure.ac. See more detailed instructions in configure.ac. +regen: + cd ${.CURDIR} ${TOOLDIR}/bin/${_TOOL_PREFIX}autoconf + cd ${.CURDIR} ${TOOLDIR}/bin/${_TOOL_PREFIX}autoheader
CVS commit: src/tools/compat
Module Name:src Committed By: apb Date: Sun Dec 2 12:34:51 UTC 2012 Modified Files: src/tools/compat: Makefile Log Message: Make tools/compat/Makefile install the library in ${TOOLDIR}/lib/libnbcompat.a, install the include files in ${TOOLDIR}/include/compat/**, and install defs.mk in ${TOOLDIR}/share/compat/defs.mk. Previously, nothing from tools/compat was installed under TOOLDIR. Adjust tools/compat/Makefile to use an uninstalled copy of host-mkdep from the .OBJDIR of tools/host-mkdep, and an uninstalled copy of the install program from the .OBJDIR of tools/binstall. This allows it to be built after tools/host-mkdep is built but before tools/host-mkdep is installed; and to be installed after tools/binstall is built but before tools/binstall is installed. To generate a diff of this commit: cvs rdiff -u -r1.60 -r1.61 src/tools/compat/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.60 src/tools/compat/Makefile:1.61 --- src/tools/compat/Makefile:1.60 Sun Dec 2 12:19:34 2012 +++ src/tools/compat/Makefile Sun Dec 2 12:34:51 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.60 2012/12/02 12:19:34 apb Exp $ +# $NetBSD: Makefile,v 1.61 2012/12/02 12:34:51 apb Exp $ HOSTLIB= nbcompat @@ -55,6 +55,7 @@ CPPFLAGS+= -I. -I./include -I${.CURDIR} DPSRCS+= defs.mk CLEANFILES+= config.log config.status configure.lineno *.stamp +CLEANDIRFILES+= defs.mk config.cache confdefs.h # Get components of Berkeley DB. _CURDIR:= ${.CURDIR} @@ -72,14 +73,55 @@ config.cache: include/.stamp configure n defs.mk: config.cache @touch ${.TARGET} +INCFILES= nbtool_config.h +INCSUBDIRS= sys machine rpc arpa +CLEANDIRFILES+= ${INCFILES} + +# CLEANDIRFILES may not contain directory names +cleandir: cleandir.include +cleandir.include: .PHONY + rm -rf include + include/.stamp: - mkdir -p include/sys include/machine include/rpc include/arpa + mkdir -p ${INCSUBDIRS:@d@ include/$d @} @touch ${.TARGET} -cleandir: - -rm -f nbtool_config.h confdefs.h defs.mk - -rm -r -f include - -rm -f config.cache +# Install rules + +HOST_LIBDIR= ${TOOLDIR}/lib +HOST_INCSDIR= ${TOOLDIR}/include +HOST_SHAREDIR= ${TOOLDIR}/share + +install: .PHONY install.lib install.includes install.defs.mk + +# Install lib${HOSTLIB}.a in ${TOOLDIR}/lib +install.lib: .PHONY ${HOST_LIBDIR}/lib${HOSTLIB}.a +${HOST_LIBDIR}/lib${HOSTLIB}.a: lib${HOSTLIB}.a + ${_MKTARGET_INSTALL} + ${HOST_INSTALL_DIR} ${HOST_LIBDIR} + ${HOST_INSTALL_FILE} -m ${LIBMODE} ${.ALLSRC} ${.TARGET} + +# Install include files in ${TOOLDIR}/include/compat +install.includes: .PHONY + ${_MKMSG_INSTALL} ${HOST_INCSDIR}/* + ${HOST_INSTALL_DIR} ${HOST_INCSDIR} + ${HOST_INSTALL_DIR} ${HOST_INCSDIR}/compat + ${HOST_INSTALL_FILE} ${INCFILES} ${HOST_INCSDIR}/compat/ +.for _d in ${INCSUBDIRS} + ${HOST_INSTALL_DIR} ${HOST_INCSDIR}/compat/${_d} + touch include/${_d}/dummy # ensure dir is not empty + ${HOST_INSTALL_FILE} include/${_d}/* ${HOST_INCSDIR}/compat/${_d}/ +.endfor + +# Install defs.mk in ${TOOLDIR}/share/compat +install.defs.mk: .PHONY ${HOST_SHAREDIR}/compat/defs.mk +${HOST_SHAREDIR}/compat/defs.mk: defs.mk + ${_MKTARGET_INSTALL} + ${HOST_INSTALL_DIR} ${HOST_SHAREDIR} + ${HOST_INSTALL_DIR} ${HOST_SHAREDIR}/compat + ${HOST_INSTALL_FILE} ${.ALLSRC} ${.TARGET} + +# bsd.hostlib.mk wants HOST_CPPFLAGS, not CPPFLAGS HOST_CPPFLAGS:= ${CPPFLAGS} CPPFLAGS:= # empty @@ -91,6 +133,10 @@ HOST_MKDEP_OBJ!= cd ${.CURDIR}/../host-m HOST_MKDEP= ${HOST_MKDEP_OBJ}/host-mkdep MKDEP= ${HOST_MKDEP} +# Use uninstalled copy of the install program +INSTALL_OBJ!= cd ${NETBSDSRCDIR}/tools/binstall ${PRINTOBJDIR} +INSTALL= ${INSTALL_OBJ}/xinstall + # Run ${TOOLDIR}/bin/nbmake-${MACHINE} regen by hand after editing # configure.ac. See more detailed instructions in configure.ac. regen:
CVS commit: src/tools/compat
Module Name:src Committed By: apb Date: Sun Dec 2 12:37:08 UTC 2012 Modified Files: src/tools/compat: defs.mk.in Log Message: Add two variables to tools/compat/defs.mk.in: COMPATLIB_UNINSTALLED: If yes, then use the files from the .OBJDIR of NETBSDSRCDIR/tools/compat. Otherwise, use the files from TOOLDIR. COMPATLIB_NO_LIB: If yes then do not use the library (but still use the include files). COMPATLIB_UNINSTALLED defaults to yes for now, but this will soon be changed to no. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/tools/compat/defs.mk.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/defs.mk.in diff -u src/tools/compat/defs.mk.in:1.10 src/tools/compat/defs.mk.in:1.11 --- src/tools/compat/defs.mk.in:1.10 Sun Aug 14 20:22:42 2011 +++ src/tools/compat/defs.mk.in Sun Dec 2 12:37:08 2012 @@ -1,8 +1,73 @@ -# $NetBSD: defs.mk.in,v 1.10 2011/08/14 20:22:42 apb Exp $ - +# $NetBSD: defs.mk.in,v 1.11 2012/12/02 12:37:08 apb Exp $ +# +# Makefile fragment for building with libnbcompat and associated +# include files. It can also be used for building just with +# the include files, without the library. +# +# This can be used when the library and include files have been installed +# into TOOLDIR (by make install in the src/tools/compat directory), +# or when they have not been installed into TOOLDIR but reside +# in the .OBJDIR associated with src/tools/compat. +# +# Variables: +# +# COMPATLIB_UNINSTALLED: +# If yes, then use the files from the .OBJDIR of +# NETBSDSRCDIR/tools/compat. Otherwise, use the files +# from TOOLDIR. +# +# COMPATLIB_NO_LIB: +# If yes then do not use the library (but still use +# the include files). +# +# Examples: +# +# * Use uninstalled copy of libnbcompat and associated *.h files: +# +# COMPATLIB_UNINSTALLED= yes +# COMPATOBJ!= cd ${NETBSDSRCDIR}/tools/compat ${PRINTOBJDIR} +# .-include ${COMPATOBJ}/defs.mk +# +# * Use TOOLDIR copy of libnbcompat and associated *.h files: +# +# .-include ${TOOLDIR}/share/compat/defs.mk +# +# * Use TOOLDIR copy of compat *.h files, but do not use libnbcompat.a: +# +# COMPATLIB_NO_LIB= yes +# .-include ${TOOLDIR}/share/compat/defs.mk +# +# The use of .-include instead of .include above is because it's +# expected that the file might not exist during make obj or make clean. +# + +.include bsd.own.mk + +# Use the installed (TOOLDIR) version of the library and headers by default +COMPATLIB_UNINSTALLED ?= yes # will be changed to no as soon as callers +# have been adjusted. +# Use library and includes by default. +COMPATLIB_NO_LIB ?= no + +.if ${COMPATLIB_UNINSTALLED} == yes +# The library lives in the .OBJDIR. +# +# Some include files live directly in the .OBJDIR, while others +# live in subdirectories of .OBJDIR/include. +# COMPATOBJ:= ${.PARSEDIR} -HOSTEXEEXT= @EXEEXT@ +COMPATLIBDIR= ${COMPATOBJ} +COMPATINCFLAGS= -I${COMPATOBJ} -I${COMPATOBJ}/include +.else +# The library lives in TOOLDIR/lib. +# +# All include files live in TOOLDIR/include/comnpat, and its subdirectories. +# +COMPATLIBDIR= ${TOOLDIR}/lib +COMPATINCFLAGS= -I${TOOLDIR}/include/compat +.endif +HOSTEXEEXT= @EXEEXT@ HOST_BSHELL= @BSHELL@ BUILD_OSTYPE!= uname -s @@ -12,11 +77,12 @@ BUILD_OSTYPE!= uname -s HOST_CPPFLAGS+= -no-cpp-precomp .endif -HOST_CPPFLAGS+= -I${COMPATOBJ} -I${COMPATOBJ}/include \ - -I${.CURDIR}/../compat -DHAVE_NBTOOL_CONFIG_H=1 \ - -D_FILE_OFFSET_BITS=64 +HOST_CPPFLAGS+= ${COMPATINCFLAGS} -I${NETBSDSRCDIR}/tools/compat \ + -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -DPADD+= ${COMPATOBJ}/libnbcompat.a -LDADD+= -L${COMPATOBJ} -lnbcompat @LIBS@ +.if ${COMPATLIB_NO_LIB} != yes +DPADD+= ${COMPATLIBDIR}/libnbcompat.a +LDADD+= -L${COMPATLIBDIR} -lnbcompat @LIBS@ +.endif # ! COMPATLIB_NO_LIB HAVE_PTHREAD_H= @HAVE_PTHREAD_H@
CVS commit: src/tools/compat
Module Name:src Committed By: apb Date: Sun Dec 2 13:05:14 UTC 2012 Modified Files: src/tools/compat: defs.mk.in Log Message: Change the default value of COMPATLIB_UNINSTALLED to no, now that all users of comapt/defs.mk have been adjusted. This is the last commit related to fixing PR 47188. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/tools/compat/defs.mk.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/defs.mk.in diff -u src/tools/compat/defs.mk.in:1.11 src/tools/compat/defs.mk.in:1.12 --- src/tools/compat/defs.mk.in:1.11 Sun Dec 2 12:37:08 2012 +++ src/tools/compat/defs.mk.in Sun Dec 2 13:05:14 2012 @@ -1,4 +1,4 @@ -# $NetBSD: defs.mk.in,v 1.11 2012/12/02 12:37:08 apb Exp $ +# $NetBSD: defs.mk.in,v 1.12 2012/12/02 13:05:14 apb Exp $ # # Makefile fragment for building with libnbcompat and associated # include files. It can also be used for building just with @@ -44,8 +44,7 @@ .include bsd.own.mk # Use the installed (TOOLDIR) version of the library and headers by default -COMPATLIB_UNINSTALLED ?= yes # will be changed to no as soon as callers -# have been adjusted. +COMPATLIB_UNINSTALLED ?= no # Use library and includes by default. COMPATLIB_NO_LIB ?= no
CVS commit: src/tools/compat
Module Name:src Committed By: joerg Date: Mon Jun 4 10:18:01 UTC 2012 Modified Files: src/tools/compat: compat_defs.h Log Message: Make Alan Barrett happy and add (). To generate a diff of this commit: cvs rdiff -u -r1.85 -r1.86 src/tools/compat/compat_defs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.85 src/tools/compat/compat_defs.h:1.86 --- src/tools/compat/compat_defs.h:1.85 Sun Jun 3 21:01:43 2012 +++ src/tools/compat/compat_defs.h Mon Jun 4 10:18:01 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.85 2012/06/03 21:01:43 joerg Exp $ */ +/* $NetBSD: compat_defs.h,v 1.86 2012/06/04 10:18:01 joerg Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -73,9 +73,9 @@ #define __UNCONST(a) ((void *)(unsigned long)(const void *)(a)) #undef __predict_false -#define __predict_false(x) x +#define __predict_false(x) (x) #undef __predict_true -#define __predict_true(x) x +#define __predict_true(x) (x) /* We don't include pwd.h here, so that compat_pwd.h works. */ struct passwd;
CVS commit: src/tools/compat
Module Name:src Committed By: joerg Date: Sun Jun 3 21:01:43 UTC 2012 Modified Files: src/tools/compat: compat_defs.h Log Message: Add __predict_true / __predict_false definitions. To generate a diff of this commit: cvs rdiff -u -r1.84 -r1.85 src/tools/compat/compat_defs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.84 src/tools/compat/compat_defs.h:1.85 --- src/tools/compat/compat_defs.h:1.84 Sat Jun 2 22:54:52 2012 +++ src/tools/compat/compat_defs.h Sun Jun 3 21:01:43 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.84 2012/06/02 22:54:52 joerg Exp $ */ +/* $NetBSD: compat_defs.h,v 1.85 2012/06/03 21:01:43 joerg Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -72,6 +72,11 @@ #endif #define __UNCONST(a) ((void *)(unsigned long)(const void *)(a)) +#undef __predict_false +#define __predict_false(x) x +#undef __predict_true +#define __predict_true(x) x + /* We don't include pwd.h here, so that compat_pwd.h works. */ struct passwd;
CVS commit: src/tools/compat
Module Name:src Committed By: joerg Date: Sat Jun 2 22:54:52 UTC 2012 Modified Files: src/tools/compat: compat_defs.h Log Message: Don't depend on __P. To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/tools/compat/compat_defs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.83 src/tools/compat/compat_defs.h:1.84 --- src/tools/compat/compat_defs.h:1.83 Sat Jan 21 20:05:27 2012 +++ src/tools/compat/compat_defs.h Sat Jun 2 22:54:52 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.83 2012/01/21 20:05:27 tsutsui Exp $ */ +/* $NetBSD: compat_defs.h,v 1.84 2012/06/02 22:54:52 joerg Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -1189,8 +1189,8 @@ __GEN_ENDIAN_DEC(64, le) /* Has quad_t but these prototypes don't get pulled into scope. w/o we lose */ #ifdef __NetBSD__ -quad_t strtoq __P((const char *, char **, int)); -u_quad_t strtouq __P((const char *, char **, int)); +quad_t strtoq(const char *, char **, int); +u_quad_t strtouq(const char *, char **, int); #endif #endif /* !__NETBSD_COMPAT_DEFS_H__ */
CVS commit: src/tools/compat
Module Name:src Committed By: njoly Date: Sat Feb 18 17:51:21 UTC 2012 Modified Files: src/tools/compat: Makefile Log Message: Adjust libyywrap.c location. To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.56 src/tools/compat/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.55 src/tools/compat/Makefile:1.56 --- src/tools/compat/Makefile:1.55 Thu Nov 3 19:30:05 2011 +++ src/tools/compat/Makefile Sat Feb 18 17:51:21 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.55 2011/11/03 19:30:05 joerg Exp $ +# $NetBSD: Makefile,v 1.56 2012/02/18 17:51:21 njoly Exp $ HOSTLIB= nbcompat @@ -49,7 +49,7 @@ CPPFLAGS+= -I. -I./include -I${.CURDIR} ${.CURDIR}/../../common/lib/libc/hash/sha2 \ ${.CURDIR}/../../common/lib/libc/md \ ${.CURDIR}/../../common/lib/libc/stdlib \ - ${.CURDIR}/../../usr.bin/lex + ${.CURDIR}/../../external/bsd/flex/dist DPSRCS+= defs.mk CLEANFILES+= config.log config.status configure.lineno *.stamp
CVS commit: src/tools/compat
Module Name:src Committed By: tsutsui Date: Sat Jan 21 20:05:27 UTC 2012 Modified Files: src/tools/compat: compat_defs.h Log Message: Always redefine DEV_BSIZE=512. All references of DEV_BSIZE in tools are to manipulate target (i.e. NetBSD's) file images (in installboot(8) and makefs(8) etc.) and no host's DEV_BSIZE is required for the moment. Closes PR toolchain/42574. To generate a diff of this commit: cvs rdiff -u -r1.82 -r1.83 src/tools/compat/compat_defs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.82 src/tools/compat/compat_defs.h:1.83 --- src/tools/compat/compat_defs.h:1.82 Thu Nov 3 14:13:53 2011 +++ src/tools/compat/compat_defs.h Sat Jan 21 20:05:27 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.82 2011/11/03 14:13:53 joerg Exp $ */ +/* $NetBSD: compat_defs.h,v 1.83 2012/01/21 20:05:27 tsutsui Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -1052,9 +1052,9 @@ __GEN_ENDIAN_DEC(64, le) #define BYTE_ORDER LITTLE_ENDIAN #endif -#ifndef DEV_BSIZE +/* all references of DEV_BSIZE in tools are for NetBSD's file images */ +#undef DEV_BSIZE #define DEV_BSIZE (1 9) -#endif #undef MIN #undef MAX
CVS commit: src/tools/compat
Module Name:src Committed By: joerg Date: Thu Nov 3 14:13:54 UTC 2011 Modified Files: src/tools/compat: compat_defs.h configure configure.ac nbtool_config.h.in Log Message: Add getline(3) compat glue. To generate a diff of this commit: cvs rdiff -u -r1.81 -r1.82 src/tools/compat/compat_defs.h cvs rdiff -u -r1.72 -r1.73 src/tools/compat/configure cvs rdiff -u -r1.73 -r1.74 src/tools/compat/configure.ac cvs rdiff -u -r1.26 -r1.27 src/tools/compat/nbtool_config.h.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/compat_defs.h diff -u src/tools/compat/compat_defs.h:1.81 src/tools/compat/compat_defs.h:1.82 --- src/tools/compat/compat_defs.h:1.81 Mon Sep 5 07:38:52 2011 +++ src/tools/compat/compat_defs.h Thu Nov 3 14:13:53 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: compat_defs.h,v 1.81 2011/09/05 07:38:52 jdc Exp $ */ +/* $NetBSD: compat_defs.h,v 1.82 2011/11/03 14:13:53 joerg Exp $ */ #ifndef __NETBSD_COMPAT_DEFS_H__ #define __NETBSD_COMPAT_DEFS_H__ @@ -276,6 +276,11 @@ int flock(int, int); char *fparseln(FILE *, size_t *, size_t *, const char [3], int); #endif +#if !HAVE_GETLINE +ssize_t getdelim(char **, size_t *, int, FILE *); +ssize_t getline(char **, size_t *, FILE *); +#endif + #if !HAVE_ISSETUGID int issetugid(void); #endif Index: src/tools/compat/configure diff -u src/tools/compat/configure:1.72 src/tools/compat/configure:1.73 --- src/tools/compat/configure:1.72 Sun Aug 14 20:25:01 2011 +++ src/tools/compat/configure Thu Nov 3 14:13:53 2011 @@ -4981,8 +4981,8 @@ EOF fi for ac_func in atoll asprintf asnprintf basename devname dirfd dirname \ - esetfunc fgetln flock fpurge __fpurge futimes getopt getopt_long \ - group_from_gid gid_from_group \ + esetfunc fgetln flock fpurge __fpurge futimes getline \ + getopt getopt_long group_from_gid gid_from_group \ heapsort isblank issetugid lchflags lchmod lchown lutimes mkstemp \ mkdtemp poll pread putc_unlocked pwcache_userdb pwcache_groupdb \ pwrite raise_default_signal random setenv \ Index: src/tools/compat/configure.ac diff -u src/tools/compat/configure.ac:1.73 src/tools/compat/configure.ac:1.74 --- src/tools/compat/configure.ac:1.73 Sun Aug 14 20:22:42 2011 +++ src/tools/compat/configure.ac Thu Nov 3 14:13:53 2011 @@ -1,4 +1,4 @@ -# $NetBSD: configure.ac,v 1.73 2011/08/14 20:22:42 apb Exp $ +# $NetBSD: configure.ac,v 1.74 2011/11/03 14:13:53 joerg Exp $ # # Autoconf definition file for libnbcompat. # @@ -146,8 +146,8 @@ AC_CHECK_DECLS(sys_signame,,, [#include # Library functions (where a .h check isn't enough). AC_FUNC_ALLOCA AC_CHECK_FUNCS(atoll asprintf asnprintf basename devname dirfd dirname \ - esetfunc fgetln flock fpurge __fpurge futimes getopt getopt_long \ - group_from_gid gid_from_group \ + esetfunc fgetln flock fpurge __fpurge futimes getline \ + getopt getopt_long group_from_gid gid_from_group \ heapsort isblank issetugid lchflags lchmod lchown lutimes mkstemp \ mkdtemp poll pread putc_unlocked pwcache_userdb pwcache_groupdb \ pwrite raise_default_signal random setenv \ Index: src/tools/compat/nbtool_config.h.in diff -u src/tools/compat/nbtool_config.h.in:1.26 src/tools/compat/nbtool_config.h.in:1.27 --- src/tools/compat/nbtool_config.h.in:1.26 Sun Aug 14 20:25:01 2011 +++ src/tools/compat/nbtool_config.h.in Thu Nov 3 14:13:53 2011 @@ -1,6 +1,6 @@ /* nbtool_config.h.in. Generated automatically from configure.ac by autoheader. */ -/* $NetBSD: nbtool_config.h.in,v 1.26 2011/08/14 20:25:01 apb Exp $*/ +/* $NetBSD: nbtool_config.h.in,v 1.27 2011/11/03 14:13:53 joerg Exp $*/ #ifndef __NETBSD_NBTOOL_CONFIG_H__ #define __NETBSD_NBTOOL_CONFIG_H__ @@ -267,6 +267,9 @@ /* Define if you have the `futimes' function. */ #undef HAVE_FUTIMES +/* Define if you have the `getline' function. */ +#undef HAVE_GETLINE + /* Define if you have the `getopt' function. */ #undef HAVE_GETOPT
CVS commit: src/tools/compat
Module Name:src Committed By: joerg Date: Thu Nov 3 19:30:05 UTC 2011 Modified Files: src/tools/compat: Makefile Log Message: Add getline.c here too. To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/tools/compat/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/compat/Makefile diff -u src/tools/compat/Makefile:1.54 src/tools/compat/Makefile:1.55 --- src/tools/compat/Makefile:1.54 Wed Feb 3 15:34:44 2010 +++ src/tools/compat/Makefile Thu Nov 3 19:30:05 2011 @@ -1,9 +1,10 @@ -# $NetBSD: Makefile,v 1.54 2010/02/03 15:34:44 roy Exp $ +# $NetBSD: Makefile,v 1.55 2011/11/03 19:30:05 joerg Exp $ HOSTLIB= nbcompat SRCS= atoll.c basename.c dirname.c fgetln.c flock.c fparseln.c \ - fpurge.c getmode.c getopt_long.c gettemp.c heapsort.c \ + fpurge.c getline.c getmode.c getopt_long.c gettemp.c \ + heapsort.c \ issetugid.c lchflags.c lchmod.c lchown.c libyywrap.c \ md2.c md2hl.c md4c.c md4hl.c md5c.c md5hl.c \ mi_vector_hash.c mkdtemp.c \