Home | History | Annotate | Download | only in compat
History log of /src/tools/compat/nbtool_config.h.in
RevisionDateAuthorComments
 1.61  18-Sep-2025  christos regen
 1.60  18-Sep-2025  christos regen
 1.59  18-Sep-2025  christos Add more functions needed by mandoc
 1.58  24-Jul-2025  hans branches: 1.58.2;
tools/compat: add definitions of __[u]intXX_t types on systems that lack them

Fixes another cross-build issue on illumos.
 1.57  31-Oct-2024  kre Regen for added shquote()
 1.56  20-Jul-2023  lukem branches: 1.56.2;
tools/compat: regen
 1.55  30-May-2023  lukem tools/compat: regen
 1.54  23-May-2023  lukem tools/compat: regen for dispatch_semaphore_create
 1.53  25-Feb-2021  christos branches: 1.53.6;
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.
 1.52  22-Jun-2019  hannken branches: 1.52.2;
Update tools/compat/configure for new path of "rpc/types.h".

Remove intermediate patch from rpcgen/Makefile.

Patch from Nick Hudson, errors from me.
 1.51  19-Jun-2019  kamil regen tools/compat
 1.50  19-Jun-2019  kamil Add sys/uio.h & enum uio_seg, enum uio_rw to tools/compat

This is needed for bootstrapping the tools on Ubuntu 16.x.
 1.49  27-Jan-2019  dholland Restore comment accidentally lost in merge.
 1.48  27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.47  30-Aug-2018  christos deal with getsubopt and strncasecmp (needed by mdocml)
 1.46  16-Aug-2018  christos add strncasecmp
 1.45  11-Aug-2018  christos Add strcasecmp
 1.44  13-Jun-2018  maya branches: 1.44.2;
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
 1.43  11-Jun-2018  maya 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.
 1.42  09-Dec-2017  sevan branches: 1.42.2;
regen
 1.41  02-Oct-2017  christos regen
 1.40  07-Jan-2017  christos branches: 1.40.6;
regen
 1.39  19-Oct-2016  christos regen
 1.38  20-Jan-2016  christos branches: 1.38.2;
Regen with autoconf 2.69.
 1.37  26-Jul-2015  kamil Add reallocarr(3) to tools/compat

This should unbreak libutil(3) creation on systems withot reallocarr(3).
 1.36  16-Jan-2015  christos regen
 1.35  06-Jun-2014  christos branches: 1.35.2;
Deal with errc/warnc
 1.34  09-Jan-2014  apb branches: 1.34.2;
regen
 1.33  14-Aug-2013  jmcneill regen
 1.32  09-Aug-2013  jmcneill regen
 1.31  06-Aug-2013  apb regen, to pick up the test for snprintb_m.
 1.30  19-Jul-2013  pooka regen

(XXX: I don't think these files were previously regen'd with the
method documented in configure.ac, and therefore the diffs are now huge)
 1.29  05-Mar-2013  christos branches: 1.29.4;
regen
 1.28  17-Feb-2013  christos regen
 1.27  03-Nov-2011  joerg branches: 1.27.6;
Add getline(3) compat glue.
 1.26  14-Aug-2011  apb branches: 1.26.2;
regen
 1.25  21-Jan-2010  tsutsui Regen this properly per procedure described in src/tools/compat/configure.ac.
 1.24  15-Jan-2010  asau Test for <sys/endian.h> and provide HAVE_SYS_ENDIAN_H.
Fixes FreeBSD hosted builds (PR 42440 and PR 42470).

Approved by <dholland>.
 1.23  16-Jun-2009  christos add fpurge; needed by awk.
 1.22  05-Jan-2009  tnozaki 1. reworking PR lib/40317:
libnbcompat already contains empty fparseln.lo
so previous fix doesn't work correctly.
i've just added broken fparseln check to configure script.

2. reworking cross build breakage under FreeBSD/MacOS X.
FreeBSD/MacOS X still have public /usr/include/runetype.h
derived from 4.4BSD-Lite. so i renamed out private header from
src/lib/libc/locale/runetype.h to src/lib/libc/locale/runetype_local.h
to solve this problems.

3. fix build breakage when CITRUS=no was set.
 1.21  18-Oct-2008  tsutsui branches: 1.21.2;
Regen from configure.ac rev 1.67:
> Prepare dummy <resolv.h> and <arpa/nameser.h> to make asn1_compile and
> compile_et compile on systems which don't have these BIND headers like Cygwin.
 1.20  14-Oct-2008  tsutsui Regen autoconf stuff using tools version of autoconf (in src/tools/autoconf),
as per suggestion from apb@ on tech-toolchain.
Tested 'build.sh -U release iso-image' on NetBSD/i386 4.99.73.
 1.19  19-Oct-2007  christos I am now convinced of the error of my ways, and I am checking for all the
decls mtree is using.
 1.18  28-Sep-2007  lukem regen for raise_default_signal
 1.17  07-Aug-2007  apb branches: 1.17.2;
Regen after recent changes to configure.ac and compat_defs.h.
(Most of the changes seem to result from somebody having used
non-tools versions of autoconf and autoheader in the past.)
 1.16  03-Jul-2007  nakayama Add strndup(3) to libnbcompat, since estrndup(3) added into efun.c calls it.
 1.15  09-Oct-2006  christos branches: 1.15.2; 1.15.4;
regen.
 1.14  07-Oct-2006  apb Add definitions for strmode. This was missing from the
patch in PR 31232.
 1.13  20-Aug-2006  thorpej Also check for DIR.__dd_fd. tools/compat now builds on the WWDC developer
preview version of Mac OS X "Leopard".
 1.12  11-Feb-2006  wiz Redo previous differently: use AH_TOP and AH_BOTTOM macros to insert
header and footer into nbtool_config.h.in directly.
 1.11  11-Feb-2006  wiz Make using autoheader easier:
split off the autogenerated file into nbtool_config_internal.h,
and let nbtool_config.h be a file with the proper wrappers.

This way you can just change configure.ac, run autoconf and autoheader,
verify the result, and commit, but don't have to edit nbtool_config*in
manually every time.
 1.10  11-Feb-2006  wiz rerun autoheader (and re-add header and footer).
 1.9  09-Feb-2006  wiz regen with autoheader; header and footer need to be added manually,
add a comment saying so.
 1.8  09-Feb-2006  dogcow change #include <sys/endian.h> => #include <machine/endian.h> so that
it's (more) consistent in the tree; this, along with changing tools/compat's
autoconf detection from AC_CHECK_FUNCS to AC_CHECK_DECLS makes the vast
majority of htobe16 and friends' redefinition errors bite the dust.
Tested with -current and FreeBSD.
 1.7  12-Oct-2004  jmc Check for fstatvfs and provide/use it only if the host system has it.
Fixes PR#27221
 1.6  24-Jul-2004  dbj check for HAVE_STRUCT_STATVFS_F_IOSIZE
addresses PR toolchain/26415
 1.5  24-Jul-2004  dbj remove HAVE_STRUCT_STATFS_F_IOSIZE
this is not currently being used and should be replaced with
HAVE_STRUCT_STATVFS_F_IOSIZE, but that will be done separately.
This commit should be able to be safely pulled up to
the netbsd-2-0 branch to address PR toolchain/26415
 1.4  20-Jun-2004  jmc Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
 1.3  18-Jun-2004  thorpej Check for group_from_gid().
 1.2  12-Nov-2003  dbj branches: 1.2.2;
use sys/poll.h and HAVE_SYS_POLL_H instead of just HAVE_POLL_H
HAVE_SYS_POLL_H is used by src/include/roken.h needed by the host tool asn1_compile
 1.1  27-Oct-2003  lukem Overhaul how `build.sh tools' are used:

* Rename "config.h" to "nbtool_config.h" and
HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
This makes in more obvious in the source when we're using
tools/compat/config.h versus "standard autoconf" config.h

* Consistently move the inclusion of nbtool_config.h to before
<sys/cdefs.h> so that the former can provide __RCSID() (et al),
and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif
to the top of the source files (for the general case).
 1.2.2.2  25-Jul-2004  tron Pull up revision 1.5 (requested by dbj in ticket #712):
remove HAVE_STRUCT_STATFS_F_IOSIZE
this is not currently being used and should be replaced with
HAVE_STRUCT_STATVFS_F_IOSIZE, but that will be done separately.
This commit should be able to be safely pulled up to
the netbsd-2-0 branch to address PR toolchain/26415
 1.2.2.1  22-Jun-2004  tron Pull up revision 1.4 (requested by jmc in ticket #527):
Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')
Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).
Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.
Fixes PR's: PR#17762 PR#25944
 1.15.4.1  03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.15.2.3  14-Feb-2009  snj Apply patch (requested by adrianp in ticket #1278):
Fix build on netbsd-5 amd64 hosts.
 1.15.2.2  18-Nov-2008  snj Regen for ticket 1224.
 1.15.2.1  31-Aug-2007  pavel branches: 1.15.2.1.2;
regen for ticket #827. Files provided by apb@.
 1.15.2.1.2.1  14-Feb-2009  snj Apply patch (requested by adrianp in ticket #1278):
Fix build on netbsd-5 amd64 hosts.
 1.17.2.1  06-Nov-2007  matt sync with HEAD
 1.21.2.2  02-Nov-2011  riz Pull up following revision(s) (requested by tsutsui in ticket #1676):
tools/compat/configure.ac: revision 1.71
tools/compat/configure: revision 1.71
tools/compat/nbtool_config.h.in: revision 1.24
Test for <sys/endian.h> and provide HAVE_SYS_ENDIAN_H.
Fixes FreeBSD hosted builds (PR 42440 and PR 42470).
Approved by <dholland>.
Regenerate.
 1.21.2.1  15-Jan-2009  snj Regen for ticket 270.
 1.26.2.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.26.2.1  10-Nov-2011  yamt sync with head
 1.27.6.3  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.27.6.2  23-Jun-2013  tls resync from head
 1.27.6.1  25-Feb-2013  tls resync with head
 1.29.4.1  23-Jul-2013  riastradh sync with HEAD
 1.34.2.1  10-Aug-2014  tls Rebase.
 1.35.2.1  22-Apr-2015  snj Pull up following revision(s) (requested by roy in ticket #648):
common/lib/libc/stdlib/_strtoi.h: revisions 1.1, 1.2
common/lib/libc/stdlib/strtoi.c: revision 1.1
common/lib/libc/stdlib/strtou.c: revision 1.1
distrib/sets/lists/base/ad.aarch64: patch
distrib/sets/lists/base/ad.arm: patch
distrib/sets/lists/base/ad.mips: patch
distrib/sets/lists/base/ad.powerpc: patch
distrib/sets/lists/base/md.amd64: patch
distrib/sets/lists/base/md.sparc64: patch
distrib/sets/lists/base/shl.mi: patch
distrib/sets/lists/comp/mi: revision 1.1939
distrib/sets/lists/debug/ad.aarch64: patch
distrib/sets/lists/debug/ad.arm: patch
distrib/sets/lists/debug/ad.mips: patch
distrib/sets/lists/debug/ad.powerpc: patch
distrib/sets/lists/debug/md.amd64: patch
distrib/sets/lists/debug/md.sparc64: patch
distrib/sets/lists/debug/shl.mi: patch
include/inttypes.h: revision 1.11
lib/libc/shlib_version: patch
lib/libc/stdlib/Makefile.inc: revision 1.84
lib/libc/stdlib/strtol.3: revisions 1.27-1.31
lib/libc/stdlib/strtoul.3: revisions 1.26-1.29
sys/lib/libkern/Makefile.libkern: revision 1.37
sys/lib/libkern/libkern.h: revision 1.117
tools/compat/Makefile: revision 1.73
tools/compat/compat_defs.h: revision 1.101
tools/compat/configure.ac: revision 1.83
tools/compat/configure: revision 1.82
tools/compat/nbtool_config.h.in: revision 1.36
add strto{i,u} from Kamil Rytarowski as discussed in tech-userlevel.
--
strtoi and strtou additions
--
strtoi and strtou for the kernel
--
strtoi and strtou additions
--
strtoi and strtou man pages
--
strto{i,u}
--
regen
--
Remove trailing whitespace.
--
match variable names with man page (Kamil Rytarowski)
--
cleanups from (Kamil Rytarowski)
--
add strtoi strtou (Kamil Rytarowski)
--
PR/49640: Kamil Rytarowski: Improve error printing
--
Use existing month for Dd.
 1.38.2.2  20-Mar-2017  pgoyette Sync with HEAD
 1.38.2.1  04-Nov-2016  pgoyette Sync with HEAD
 1.40.6.3  03-Feb-2018  snj Pull up following revision(s) (requested by sevan in ticket #435):
tools/compat/configure: revision 1.88 via patch
tools/compat/configure.ac: revision 1.89 via patch
tools/compat/nbtool_config.h.in: revision 1.42
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
--
regen
 1.40.6.2  21-Dec-2017  snj revert ticket 435
 1.40.6.1  21-Dec-2017  snj Pull up following revision(s) (requested by sevan in ticket #435):
tools/compat/compat_defs.h: 1.108
tools/compat/configure: 1.87-1.88
tools/compat/configure.ac: 1.88-1.89
tools/compat/fpurge.c: 1.2
tools/compat/nbtool_config.h.in: 1.41-1.42
handle __fpurge being declared in <stdio_ext.h>
--
regen
--
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
--
regen
 1.42.2.2  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.42.2.1  25-Jun-2018  pgoyette Sync with HEAD
 1.44.2.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.44.2.1  10-Jun-2019  christos Sync with HEAD
 1.52.2.1  19-Oct-2025  martin Pull up following revision(s) (requested by mrg in ticket #1973):

tools/compat/configure.ac: revision 1.111
tools/compat/compat_defs.h: revision 1.126
tools/compat/compat_defs.h: revision 1.127
usr.bin/nbperf/nbperf.c: revision 1.7
bin/pax/options.c: revision 1.120
tools/compat/nbtool_config.h.in: revision 1.59 (patch)
tools/compat/Makefile: revision 1.95 (patch)
tools/compat/configure.ac: revision 1.110 (patch)
tools/compat/configure (patch for regen from above)

Don't use arc4random for the tools build on NetBSD either.
compat_defs.h explicitly forces _POSIX_SOURCE and this hides the
prototype in stdlib.h.
pax: need <strings.h> for ffs()

Fixes warning as host tool on NetBSD 9.99

Add more functions needed by mandoc

add vsyslog decl check
 1.53.6.3  19-Oct-2025  martin Pull up following revision(s) (requested by mrg in ticket #1174):

tools/compat/configure.ac: revision 1.111 (patch)
tools/compat/compat_defs.h: revision 1.126 (patch)
tools/compat/compat_defs.h: revision 1.127 (patch)
bin/pax/options.c: revision 1.120
tools/compat/nbtool_config.h.in: revision 1.59 (patch)
tools/compat/Makefile: revision 1.95 (patch)
tools/compat/configure.ac: revision 1.110 (patch)

pax: need <strings.h> for ffs()

Fixes warning as host tool on NetBSD 9.99

Add more functions needed by mandoc

add vsyslog decl check
 1.53.6.2  17-Nov-2024  martin Pull up following revision(s) (requested by kre in ticket #1004):

tools/compat/configure: revision 1.106
lib/libc/string/__strsignal.c: revision 1.26
tools/compat/configure.ac: revision 1.108
tools/compat/nbtool_config.h.in: revision 1.57
usr.bin/elf2aout/elf2aout.c: revision 1.24
tools/compat/Makefile: revision 1.93
sys/arch/macppc/stand/fixcoff/fixcoff.c: revision 1.13
tools/compat/compat_defs.h: revision 1.123

Include <arpa/inet.h> for htonl() (From Jan-Benedict Glaw)
Probably this should be using htobe32() instead of htonl()
(and so <endian.h> rather than <arpa/inet.h>) as there is
no sign of any network anywhere near here. But that's for
another day, and to be done by someone who can test it.

Portability fixes from Jan-Benedict Glaw
The args to help() and usage() need to be const char *
and main() should be declared as returning int.

Add shquote to libnbcompat
Include shquote() in configure tests
Regen for added shquote()

Stop attempting to return a (char*) in place of (const char *)
This removes a cast that was added in 1994, when __strsignal()
returned a char * to convert the const char * element of sys_siglist
into a type that matched.

It should have been removed when __strsignal() was changed to
return const char * in 1998. But wasn't.

This should fix an inane warning (treated as an error) from a
compile stupid enough to allow a natural char * (as in char buf[N])
to be returned as a result (which is, of course, fine), but complains
about returning (char *) applied to a (const char *).
 1.53.6.1  30-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #221):

external/cddl/osnet/dist/tools/ctf/cvt/ctfmerge.c: revision 1.18
external/cddl/osnet/sys/sys/opentypes.h: revision 1.7
tools/compat/configure: revision 1.100
external/cddl/osnet/dist/tools/ctf/cvt/barrier.c: revision 1.6
external/cddl/osnet/dist/tools/ctf/cvt/barrier.h: revision 1.4
external/cddl/osnet/dist/tools/ctf/cvt/barrier.c: revision 1.7
external/cddl/osnet/dist/tools/ctf/cvt/barrier.c: revision 1.8
tools/compat/configure.ac: revision 1.100
external/cddl/osnet/dist/tools/ctf/cvt/tdata.c: revision 1.10
tools/compat/nbtool_config.h.in: revision 1.54

ctfmerge: error check sem_*() and pthread_*() APIs

terminate() if sem_*() returns -1 or pthread_*() returns != 0.
(Set errno from pthread_*() so terminate() prints the strerror message).

Note: Failing on errors instead of ignoring them helps identify
reasons for intermittent failures, such as those on macOS host builds:

ERROR: nbctfmerge: barrier_init: sem_init(bar_sem): Function not implemented

ctfmerge: fix macOS semaphore implementation

Use dispatch_semaphore_create() if present instead of sem_init().
macOS doesn't actually implement sem_init() (et al)
(even though it provides the prototypes as deprecated).

This was detected by the previous commit to ctfmerge
that added error handling.

Implement ctfmerge's barrier operations in terms of
dispatch(3) APIs such as dispatch_semaphore_create() (et al).

Update tools/compat/configure.ac to find dispatch_semaphore_create().
Fixes ctfmerge on macOS hosts.

Inspired by https://stackoverflow.com/a/27847103

tools/compat: regen for dispatch_semaphore_create

ctfmerge: fix macOS semaphore implementation, part 2
dispatch_semaphore_signal() doesn't return an error, just an
indicator of whether a thread was woken or not, so there's
no need to fail on non-zero return.

osnet: on macOS, use <mach/boolean.h> for boolean_t
macOS/x86_64 defines boolean_t as 'unsigned int' not 'int',
which causes a build issue with tools/ctfmerge on that host
after my recent fixes for macOS semaphores.

So use the <mach/boolean.h> instead of a local typedef ifdef __APPLE__.
May fix a macOS/x86_64 build issue reported by cjep@.
Builds fine on NetBSD/amd64 or macOS/arm.

Note: this compat stuff is clunky, and based on the commit log,
annoyingly error prone. A newer sync of osnet from upstream /may/
improve a lot of these compat typedef workarounds for solaris types...
 1.56.2.1  02-Aug-2025  perseant Sync with HEAD
 1.58.2.1  19-Oct-2025  martin Pull up following revision(s) (requested by mrg in ticket #56):

tools/compat/configure.ac: revision 1.111
tools/compat/compat_defs.h: revision 1.126
tools/compat/compat_defs.h: revision 1.127
tools/compat/nbtool_config.h.in: revision 1.60
tools/compat/nbtool_config.h.in: revision 1.61
lib/libc/stdio/mkstemps.c: revision 1.2
tools/compat/configure: revision 1.108
tools/compat/configure: revision 1.109
tools/compat/nbtool_config.h.in: revision 1.59
tools/compat/Makefile: revision 1.95
tools/compat/configure.ac: revision 1.110

Add more functions needed by mandoc

regen

add vsyslog decl check

regen

Do the nbtool dance.

RSS XML Feed