Home | History | Annotate | Download | only in compat
History log of /src/tools/compat/configure.ac
RevisionDateAuthorComments
 1.111  18-Sep-2025  christos add vsyslog decl check
 1.110  18-Sep-2025  christos Add more functions needed by mandoc
 1.109  24-Jul-2025  hans tools/compat: add definitions of __[u]intXX_t types on systems that lack them

Fixes another cross-build issue on illumos.
 1.108  31-Oct-2024  kre Include shquote() in configure tests
 1.107  20-Jul-2023  lukem branches: 1.107.2;
tools: binstall can use posix_spawn() instead of vfork()
 1.106  20-Jul-2023  lukem tools/compat: provide nb_check_cc_flag.m4

Implement m4 macro NB_CHECK_CC_FLAG(FLAG, [VAR=FLAG_DERIVED])
Determine if the C compiler supports FLAG,
and sets output variable VAR to FLAG if FLAG is supported.

If VAR is not provided, default to FLAG_DERIVED, which is
FLAG converted to upper-case and all special characters
replaced with "_", and the result prepended with "CC_".
FLAG_DERIVED is appended to the m4 macro NB_CHECK_CC_FLAG_VARS.
E.g., if FLAG is "-Wexample=yes", FLAG_DERIVED is "CC_WEXAMPLE_YES".

This is implemented in separate buildaux/nb_check_cc_flag.m4,
based on configure's NB_CC_FLAG(), but supports VAR override.

Adapt configure from internal NB_CC_FLAG() to NB_CHECK_CC_FLAG().

(Note: AX_CHECK_COMPILE_FLAG() from autoconf-archive could be enhanced
to support the clang and gcc workarounds I've implemented here.)
 1.105  03-Jun-2023  lukem tools/compat: support all bsd.own.mk disabled warnings

Check the host CC support for all the warnings now in <bsd.own.mk>
and override appropriately in defs.mk.

In general there's a 1:1 mapping, with the special case
CC_WNO_ADDRESS_OF_PACKED_MEMBER which is set from both
@CC_WNO_ADDRESS_OF_PACKED_MEMBER@ (gcc) and
@CC_WNO_ERROR_ADDRESS_OF_PACKED_MEMBER@ (clang).
 1.104  30-May-2023  lukem tools/compat: disable host CC warnings

Determine if the host CC supports flags to disable various
warnings similar to <bsd.own.mk> GCC_*, CLANG_*, and CC_*,
and override the <bsd.own.mk> equivalents in defs.mk.

Silences "warning: unknown warning option '...'" from our source.
External source (e.g., binutils and gcc) need their own fixes
to enhance their detection of supported clang compiler flags.
 1.103  30-May-2023  lukem tools/compat: detect supported host compiler flags

Define NB_CC_FLAG(FLAG) to use AX_CHECK_COMPILE_FLAG
to determine if the host compiler supports FLAG
and define and AC_SUBST CC_FLAG if so.

Use workarounds to force clang to hard-fail on unknown -Wwarning,
and gcc to use -WWARN to check unknown -Wno-WARN because the
latter doesn't cause an error in gcc.

In the future we could use NB_CC_FLAG([-fcommon]) for
older NetBSD release branches compiled with host gcc 10+.

Rework Darwin -no-cpp-precomp check to use NB_CC_FLAG().
Note: this flag probably hasn't been required on macOS (Darwin)
for a long time, but serves as a good example on how to use this.

Display varaibles at the end of configure to show what was detected.
 1.102  30-May-2023  lukem tools/compat: don't expose HAVE_PTHREAD_H to make

Non of the tools Makefiles needs HAVE_PTHREAD_H, so don't
AC_SUBST it or provide in defs.mk.
 1.101  29-May-2023  lukem tools/compat/configure.ac: style tweaks

Use "NB_" prefix not "AC_" for our macros ("AC_" is for autoconf).
Fail is NB_ macro isn't defined.
Use AC_DEFUN() instead of define().
Consistently use () in zero argument macro calls.
 1.100  23-May-2023  lukem 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.
 1.99  25-Feb-2021  christos branches: 1.99.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.98  24-Jun-2020  uwe Add AC_MSG_RESULT yes/no to the uio checks.
 1.97  22-Jun-2019  hannken 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.96  19-Jun-2019  kamil Add more SunOS types to tools/compat

Add fallback defintions of: uchar_t, ushort_t, uint_t, ulong_t.

Needed by the libctf code on Ubuntu 16.x.
 1.95  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.94  30-Aug-2018  christos deal with getsubopt and strncasecmp (needed by mdocml)
 1.93  16-Aug-2018  christos add strncasecmp
 1.92  11-Aug-2018  christos Add strcasecmp
 1.91  13-Jun-2018  maya branches: 1.91.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.90  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.89  09-Dec-2017  sevan branches: 1.89.2;
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
 1.88  02-Oct-2017  christos handle __fpurge being declared in <stdio_ext.h>
 1.87  07-Jan-2017  christos branches: 1.87.6;
strmode on MacOS/X is in string.h
 1.86  07-Jan-2017  christos Check for declarations, not the existance of functions since some are
visible only when _NETBSD_SOURCE is defined. This avoids || defined(__NetBSD__)
hacks.
 1.85  19-Oct-2016  christos try to fix missing decls
 1.84  26-Jul-2015  kamil branches: 1.84.2;
Add reallocarr(3) to tools/compat

This should unbreak libutil(3) creation on systems withot reallocarr(3).
 1.83  16-Jan-2015  christos strto{i,u}
 1.82  06-Jun-2014  christos branches: 1.82.2;
Deal with errc/warnc
 1.81  09-Jan-2014  apb branches: 1.81.2;
Add strnlen to configure tests in tools/compat
 1.80  14-Aug-2013  jmcneill add test for struct tm tm_gmtoff member
 1.79  09-Aug-2013  jmcneill makefs_udf uses clock_gettime, and on some versions of linux that lives in librt
 1.78  06-Aug-2013  apb Add a configure test for snprintb_m. We will assume that
the rpesence of snprintb_m implies the presence of snprintb.
 1.77  19-Jul-2013  pooka Fix some tests for musl libc -based systems.

from Justin Cormack and Jens Staal
 1.76  05-Mar-2013  christos branches: 1.76.4;
add dprintf
 1.75  17-Feb-2013  christos cygwin defines u_quad_t in <rpc/types.h>, so include this to the headers
we include and test by default.
 1.74  03-Nov-2011  joerg branches: 1.74.6;
Add getline(3) compat glue.
 1.73  14-Aug-2011  apb branches: 1.73.2;
Detect the presence of <pthread.h>, and add a HAVE_PTHREAD_H
variable in defs.mk.
 1.72  14-Aug-2011  apb Prevent expansion of <dollar>NetBSD<dollar> in a string that's
indended to be copied to nbtool_config.h.

Fix most lines longer than 80 columns. I don't know how to fix the
long lines in the definition of NB_CHECK_INTTYPE.
 1.71  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.70  16-Jun-2009  christos add fpurge; needed by awk.
 1.69  03-Feb-2009  dbj do not require sys/mtio.h for a tools build of pax
 1.68  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.67  18-Oct-2008  tsutsui branches: 1.67.2;
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.

Tested by "build.sh -m i386 -U release" on CYGWIN_NT-5.1-1.5.25,
and should close PR toolchain/29032.
 1.66  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.65  28-Sep-2007  lukem Add raise_default_signal().
 1.64  07-Aug-2007  apb branches: 1.64.2;
Update the instructions to say that regen should be done again
to pick up changed RCS IDs.
 1.63  07-Aug-2007  apb Provide definitions for {be,le}{16,32,64}{enc,dec} if necessary.
This is adapted from the very detailed fix provided by
Giles Lean in PR bin/36678.

Only one simplified implementation is provided, instead of the
two implementations conditional on __GNUC_PREREQ__(2,95) that are
provided in NetBSD's <sys/endian.h>. The use of memcpy instead of
__builtin__memcpy, and the absence of __inline or __unused, should make
it independent of GCC.
 1.62  07-Aug-2007  apb More detailed instructions for what to do when editing configure.ac.
In particular, discourage the use of non-tools versions of
autoconf and autoheader.
 1.61  03-Jul-2007  nakayama Add strndup(3) to libnbcompat, since estrndup(3) added into efun.c calls it.
 1.60  09-Oct-2006  christos branches: 1.60.2; 1.60.4;
sideways check for error functions.
 1.59  07-Oct-2006  elad PR/31232: Wim Lewis: tools/compat doesn't check for pre-existence of
strmode()

Commited slightly different diff, input and okay from apb@
 1.58  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.57  22-Feb-2006  dogcow Twiddle configure/configure.ac to check/define/create machine/endian.h; this
should fix PR/32878. Tested on NetBSD-current, FreeBSD4, Solaris8.
 1.56  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.55  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.54  11-Feb-2006  wiz Add AC_CHECK_DECLS test for strsuftoll. hannken reports it is needed
for building nbmakefs on 3.0/i386.
 1.53  09-Feb-2006  wiz Use the AC_DEFINE version with three arguments consistently, since
then autoheader works too.
Replace the remaining abusers of AC_CHECK_FUNCS with AC_CHECK_DECLS
too.
 1.52  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.51  02-Feb-2006  dbj touch an empty sys/bswap.h if detected as missing by configure
this fixes cross compile problems from recent changes to
convert machine/bswap.h to sys/bswap.h
 1.50  02-Mar-2005  wiz Remove commas in AC_CHECK_FUNCS that shouldn't be there.
Closes PR 29577 by Valeriy E. Ushakov.
 1.49  13-Jan-2005  jmc Turns out some platforms (freebsd5) expose st_birthtime but not
st_birthtimensec. Make sure and check for both so programs can deal w. it
 1.48  28-Nov-2004  jmc Add heapsort to libnbcompat
 1.47  12-Oct-2004  jmc Check for fstatvfs and provide/use it only if the host system has it.
Fixes PR#27221
 1.46  24-Jul-2004  dbj check for HAVE_STRUCT_STATVFS_F_IOSIZE
addresses PR toolchain/26415
 1.45  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.44  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.43  18-Jun-2004  thorpej Check for group_from_gid().
 1.42  12-Nov-2003  dbj branches: 1.42.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.41  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.40  26-Jul-2003  salo netbsd.org->NetBSD.org
 1.39  25-Jul-2003  atatat More properly host-tool-ify stat
 1.38  18-Jul-2003  fredb As discussed briefly on tech-toolchain, AIX doesn't have "u_long",
so add a check for that. Partial fix for PR toolchain/22177.
 1.37  03-Jun-2003  uwe Add atoll(3) to libnbcompat. We need it when building target's gcc
for a 64-bit target on a 32-bit host.

NB: There seems to be a bug in either gcc itself or the way we import
it, b/c the incorrect #define HAVE_ATOLL is picked from (e.g. for
sparc64) gnu/usr.bin/gcc/arch/sparc64/auto-host.h - so when gen*
auxilary (host) programs are built in gnu/usr.bin/gcc/backend, they
incorrectly pick-up target's HAVE_ATOLL.

For now providing atoll(3) in libnbcompat is a simple and sufficient
workaround.
 1.36  14-Mar-2003  thorpej Add a putc_unlocked().
 1.35  13-Mar-2003  thorpej Fix the socklen_t test; we need to explcitly list the headers we want
included for that test.
 1.34  13-Mar-2003  thorpej Check for sys/socket.h and socklen_t.
 1.33  16-Dec-2002  thorpej Include <sys/types.h> before <grp.h>; Mac OS 10.2.2 needs this.
 1.32  16-Dec-2002  thorpej Include <sys/types.h> before including <dirent.h>; Mac OS 10.2.2
needs this.
 1.31  30-Nov-2002  lukem add check back for util.h; needed on some foreign systems
 1.30  30-Nov-2002  lukem - Migrate fparseln(3) from libutil to libc, where it should have been in
the first place...
- Bump libutil major (to 7.0) and libc minor (to 12.91).
 1.29  29-Nov-2002  lukem replace missing strsuftoll(3)
 1.28  07-Oct-2002  briggs Just check for poll.h, don't fail if it's not present.
 1.27  06-Oct-2002  lukem Provide strtoll() in libnbcompat.
Should fix relevant build issue on HP-UX and MacOS X hosts.
 1.26  05-Oct-2002  lukem check for lchflags
 1.25  04-Oct-2002  thorpej Check for <poll.h> and poll(2).
 1.24  16-Sep-2002  briggs Always use NetBSD's fts(3) in compat builds. Some systems (notably
Red Hat 7.3, at least) do not have fts(3) implementations that work
correctly with -D_FILE_OFFSET_BITS=64.
 1.23  14-Sep-2002  thorpej * Check for mkstemp() and mkdtemp(), and build them into libnbcompat
if necessary.
* mktemp is now a host-tool, so nuke the lame script (which isn't even
properly installed during the tools bootstrap).
 1.22  13-Sep-2002  thorpej * Always include the NetBSD glob(3) in libnbcompat, as the host
tools use some features of glob(3) that are not available on
all systems.
* Always include the NetBSD vis(3) in libnbcompat, since vis(3)
is not really standardized, and the vis(3) present on some systems
is different from ours.
* Always include the NetBSD MD2, MD4, MD5, RMD160, and SHA1 implementations
in libnbcompat. The host tools use features of the NetBSD versions
which aren't present on all systems that include those functions.
* Add a check for random(3) -- the Heimdal host tools want it.
* Add a check for termios.h -- the Heimdal host tools want it.
* Update the README to indicate the current state of building the
host tools on Solaris 8 (for SPARC).
 1.21  03-Jul-2002  pooka Fine-grain checking somewhat:
* check for user_from_uid() in addition to pwcache_userdb()
* check for svis() in addition to vis()
 1.20  24-Apr-2002  bjh21 branches: 1.20.2;
Rather than hardcoding two possible locations of the POSIX shell (for
Solaris and everything else), set _PATH_BSHELL to the first occurrence of
"sh" on the path. This should be rather more portable.
 1.19  23-Apr-2002  bjh21 Add test for alloca() and <alloca.h>, since Sun Workshop C 5.0 needs this.
 1.18  22-Apr-2002  bjh21 Create sys/endian.h if it doesn't exist, since rmd160.c includes it directly.
 1.17  19-Apr-2002  tv Emit an empty <stdint.h> if the host doesn't have one. Should fix PR 16416.
 1.16  18-Apr-2002  tv Re-add test for <sys/endian.h>; it disappeared somewhere along the way.
 1.15  18-Apr-2002  bjh21 Add a stub issetugid() for platforms that don't have it. For now, we assume
that no host program will be installed set-id, so the stub function always
returns 0.
 1.14  01-Apr-2002  bjh21 Revert addition of mkdtemp() to libnbcompat. I don't think we need mktemp(1)
after all.
 1.13  31-Mar-2002  bjh21 Add mkdtemp to libnbcompat, since glibc doesn't have it an mktemp(1) will
need it.
 1.12  31-Mar-2002  bjh21 Add the md[245], sha1 and rmd160 functions to libnbcompat, conditional on their
not being in the host libc.
This will be necessary to make cksum into a host tool.
 1.11  07-Mar-2002  tv Don't gratuitously touch the replacement headers in ${.OBJDIR}/include;
instead, touch them only if they're changed.
 1.10  07-Mar-2002  tv Move inttypes.h to list of auto-generated-empty headers.
 1.9  07-Mar-2002  tv Add compat defns for uint*_t (the non-underscored ones).
[The logic in all of this is ugly, and should instead be fixed up to use
AC_CHECK_SIZEOF to use primitives if the counterpart type is unavailable.]
 1.8  26-Feb-2002  tv Add some more bits of host compatibility.
 1.7  31-Jan-2002  tv Roll in fixes to permit cross-compiling from non-NetBSD hosts. This
round has been tested on Solaris/x86 and Linux hosts.

* Add host tools cap_mkdb, ctags, m4, uudecode.
* Protect __RCSID() and __COPYRIGHT() better.
* Reduce the number of places that need to include "config.h", to keep
sources closer to their "vanilla" versions.
* Add more compat #defines and autoconf-checked functions.
 1.6  29-Jan-2002  tv Make almost all tools compile and run properly on non-NetBSD hosts. (In
particular, most tools now run correctly on Solaris 7.)
 1.5  24-Jan-2002  lukem - Replace pwcache(3) if necessary (pwcache_userdb(3) is checked for).
Tested on -current and 1.5.3.
- Wrap some long lines.
 1.4  21-Jan-2002  tv Make many host tools compile on non-NetBSD hosts. Not complete, but
very nearly there.
 1.3  10-Jan-2002  lukem look for <inttypes.h> and #include if found (for uint*_t)
 1.2  04-Jan-2002  lukem Add replacement fgetln(3) (from lukemftp/libukem), as fparseln(3) uses it
 1.1  11-Dec-2001  tv Add the framework for autoconf-based src/tools/compat structure. This will
(after it is more fleshed out) allow the host tools to work more cleanly
on non-NetBSD hosts.
 1.20.2.4  23-Jul-2004  tron Apply patch (request by dbj in ticket 1723):
Fix building the netbsd-1-6 branch under Darwin/MacOS.
 1.20.2.3  01-Dec-2002  he Pull up revision 1.24 (requested by thorpej in ticket #834):
Always NetBSD's own fts(3) in compat builds. Some systems
(among them RedHat 7.3) do not have fts(3) implementations
which work correctly with -D_FILE_OFFSET_BITS=64.
 1.20.2.2  30-Nov-2002  he Pull up revision 1.23 (via patch, requested by thorpej in ticket #807):
o Check for mkstemp() and mkdtemp(), and build them into
libcompat if necessary.
o mktemp is now a host-tool, so remove the now obsoleted
script.
 1.20.2.1  03-Nov-2002  he Pull up revision 1.22 (via patch, requested by thorpej in ticket #797):
Include various more functions in libnbcompat, mostly
becuase our tools use features not universally present in
other versions. This applies to glob(3), vis(3), and the
MD2, MD4, RMD160 and SHA1 implementations.
Also add checks for random(3) and termios.h for the Heimdal
host tools.
Update README to indicate the current state of building the
host tools on Solaris 8 (for SPARC).
 1.42.2.2  25-Jul-2004  tron branches: 1.42.2.2.2;
Pull up revision 1.45 (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.42.2.1  22-Jun-2004  tron Pull up revision 1.44 (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.42.2.2.2.1  06-Apr-2005  he Pull up revision 1.48 (via patch, requested by jmc in ticket #1026):
Convert remaining host tools for amiga to correct cross tools.
Now allows complete amiga builds on non-NetBSD and non-BSD hosts.
 1.60.4.1  03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.60.2.3  14-Feb-2009  snj Apply patch (requested by adrianp in ticket #1278):
Fix build on netbsd-5 amd64 hosts.
 1.60.2.2  18-Nov-2008  snj Pull up following revision(s) (requested by tsutsui in ticket #1224):
tools/compat/Makefile: revision 1.52
tools/compat/configure.ac: revision 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.
Tested by "build.sh -m i386 -U release" on CYGWIN_NT-5.1-1.5.25,
and should close PR toolchain/29032.
 1.60.2.1  30-Aug-2007  pavel branches: 1.60.2.1.2;
Pull up following revision(s) (requested by apb in ticket #827):
tools/compat/Makefile: revision 1.50
tools/compat/compat_defs.h: revision 1.60
tools/compat/configure.ac: revision 1.62-1.64
More detailed instructions for what to do when editing configure.ac.
In particular, discourage the use of non-tools versions of
autoconf and autoheader.
Provide definitions for {be,le}{16,32,64}{enc,dec} if necessary.
This is adapted from the very detailed fix provided by
Giles Lean in PR bin/36678.
Only one simplified implementation is provided, instead of the
two implementations conditional on __GNUC_PREREQ__(2,95) that are
provided in NetBSD's <sys/endian.h>. The use of memcpy instead of
__builtin__memcpy, and the absence of __inline or __unused, should make
it independent of GCC.
Update the instructions to say that regen should be done again
to pick up changed RCS IDs.
 1.60.2.1.2.1  14-Feb-2009  snj Apply patch (requested by adrianp in ticket #1278):
Fix build on netbsd-5 amd64 hosts.
 1.64.2.1  06-Nov-2007  matt sync with HEAD
 1.67.2.3  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.67.2.2  03-Oct-2009  snj Pull up following revision(s) (requested by apb in ticket #1020):
bin/pax/Makefile: revision 1.38
bin/pax/ar_io.c: revision 1.49
tools/compat/configure: revision 1.69
tools/compat/configure.ac: revision 1.69
do not require sys/mtio.h for a tools build of pax
 1.67.2.1  15-Jan-2009  snj branches: 1.67.2.1.2; 1.67.2.1.4;
Pull up following revision(s) (requested by jmcneill in ticket #270):
lib/libc/locale/fix_grouping.c: revision 1.3
lib/libc/locale/iswctype_sb.c: revision 1.7
lib/libc/locale/rune.h: revision 1.14
lib/libc/locale/runetype.h: file removal
lib/libc/locale/runetype_local.h: revision 1.1
lib/libc/stdio/fparseln.c: revision 1.8
lib/libc/string/wcscmp.c: revision 1.7
lib/libc/string/wcsncmp.c: revision 1.7
lib/libc/string/wmemcmp.c: revision 1.5
tools/compat/configure: regen
tools/compat/configure.ac: revision 1.68
tools/compat/nbtool_config.h.in: regen
usr.bin/mklocale/Makefile: revision 1.15
usr.bin/mklocale/lex.l: revision 1.16
usr.bin/mklocale/yacc.y: revision 1.27
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.67.2.1.4.1  15-Dec-2009  matt Allow tools to build on OSX 10.6 (Snow Leopard).
 1.67.2.1.2.1  03-Oct-2009  snj Pull up following revision(s) (requested by apb in ticket #1020):
bin/pax/Makefile: revision 1.38
bin/pax/ar_io.c: revision 1.49
tools/compat/configure: revision 1.69
tools/compat/configure.ac: revision 1.69
do not require sys/mtio.h for a tools build of pax
 1.73.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.73.2.1  10-Nov-2011  yamt sync with head
 1.74.6.3  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.74.6.2  23-Jun-2013  tls resync from head
 1.74.6.1  25-Feb-2013  tls resync with head
 1.76.4.1  23-Jul-2013  riastradh sync with HEAD
 1.81.2.1  10-Aug-2014  tls Rebase.
 1.82.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.84.2.3  20-Mar-2017  pgoyette Sync with HEAD
 1.84.2.2  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.84.2.1  04-Nov-2016  pgoyette Sync with HEAD
 1.87.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.87.6.2  21-Dec-2017  snj revert ticket 435
 1.87.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.89.2.2  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.89.2.1  25-Jun-2018  pgoyette Sync with HEAD
 1.91.2.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.91.2.1  10-Jun-2019  christos Sync with HEAD
 1.99.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.99.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.107.2.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed