is_windows=no
+abi_accmode=unknown
abi_arc4random=unknown
+abi_arc4random_stir=unknown
abi_bsd_getopt=unknown
+abi_closefrom=unknown
abi_err=unknown
abi_errc=unknown
+abi_expand_number=unknown
+abi_explicit_bzero=unknown
+abi_fgetln=unknown
+abi_flopen=unknown
+abi_fmtcheck=unknown
abi_fpurge=unknown
+abi_freezero=unknown
abi_funopen=unknown
+abi_getbsize=unknown
+abi_getpeereid=unknown
+abi_humanize_number=unknown
+abi_id_from_name=unknown
+abi_inet_net_pton=unknown
abi_md5=unknown
abi_name_from_id=unknown
abi_nlist=unknown
+abi_pidfile=unknown
+abi_proctitle=unknown
abi_progname=unknown
+abi_readpassphrase=unknown
+abi_reallocarray=unknown
+abi_reallocf=unknown
+abi_recallocarray=unknown
+abi_stringlist=unknown
+abi_sort=unknown
abi_strl=unknown
abi_strmode=unknown
+abi_strnstr=unknown
+abi_strtonum=unknown
+abi_strtox=unknown
+abi_timeconv=unknown
+abi_vis=unknown
abi_wcsl=unknown
AS_CASE([$host_os],
[*-gnu*], [
- # DROP: On glibc >= 2.36, parts the arc4random() API got added.
+ abi_accmode=yes
+ # DROP: On glibc >= 2.36.
#abi_arc4random=no
abi_arc4random=yes
+ abi_arc4random_stir=yes
abi_bsd_getopt=yes
+ # DROP: On glibc >= 2.34.
+ #abi_closefrom=no
+ abi_closefrom=yes
abi_err=no
abi_errc=yes
+ abi_expand_number=yes
+ # DROP: On glibc >= 2.25.
+ #abi_explicit_bzero=no
+ abi_explicit_bzero=yes
+ abi_fgetln=yes
+ abi_flopen=yes
+ abi_fmtcheck=yes
abi_fpurge=yes
+ abi_freezero=yes
abi_funopen=yes
+ abi_getbsize=yes
+ abi_getpeereid=yes
+ abi_humanize_number=yes
+ abi_id_from_name=yes
+ # DROP: On glibc.
+ #abi_inet_net_pton=no
+ abi_inet_net_pton=yes
# DROP: On libmd.
#abi_md5=no
abi_md5=yes
abi_name_from_id=yes
abi_nlist=yes
+ abi_pidfile=yes
+ abi_proctitle=yes
abi_progname=yes
+ abi_readpassphrase=yes
+ # DROP: On glibc >= 2.26.
+ #abi_reallocarray=no
+ abi_reallocarray=yes
+ abi_reallocf=yes
+ abi_recallocarray=yes
+ abi_stringlist=yes
+ abi_sort=yes
# DROP: On glibc >= 2.38.
#abi_strl=no
abi_strl=yes
abi_strmode=yes
+ abi_strnstr=yes
+ abi_strtonum=yes
+ abi_strtox=yes
+ abi_timeconv=yes
+ # DROP: On libmd.
+ abi_transparent_libmd=yes
+ abi_vis=yes
abi_wcsl=yes
],
[*-musl*], [
+ abi_accmode=yes
abi_arc4random=yes
+ abi_arc4random_stir=yes
# DROP: On musl >= 0.9.7, optreset got implemented.
#abi_bsd_getopt=no
abi_bsd_getopt=yes
+ abi_closefrom=yes
abi_err=no
abi_errc=yes
+ abi_expand_number=yes
+ # DROP: On musl >= 1.1.20.
+ #abi_explicit_bzero=no
+ abi_explicit_bzero=yes
+ # DROP: On musl >= 0.9.4.
+ #abi_fgetln=no
+ abi_fgetln=yes
+ abi_flopen=yes
+ abi_fmtcheck=yes
abi_fpurge=yes
+ abi_freezero=yes
# On musl >= 1.1.19, fopencookie() got implemented, and because we were
# checking for its presence to decide whether to build funopen(), it got
# included in builds even when previously it had not been included, which
# is partially an ABI issue, but given that disabling it now would be
# worse, we'll ignore this as this is only a problem with downgrades. And
# enable it explicitly
+ #abi_funopen=no
abi_funopen=yes
+ abi_getbsize=yes
+ abi_getpeereid=yes
+ abi_humanize_number=yes
+ abi_id_from_name=yes
+ abi_inet_net_pton=yes
# DROP: On libmd.
#abi_md5=no
abi_md5=yes
abi_name_from_id=yes
abi_nlist=yes
+ abi_pidfile=yes
+ abi_proctitle=yes
abi_progname=yes
+ abi_readpassphrase=yes
+ # DROP: On musl >= 1.2.2.
+ #abi_reallocarray=no
+ abi_reallocarray=yes
+ abi_reallocf=ues
+ abi_recallocarray=yes
+ abi_stringlist=yes
+ abi_sort=yes
# DROP: On musl >= 0.5.0, strlcpy() and strlcat() were already implemented.
#abi_strl=no
abi_strl=yes
abi_strmode=yes
+ abi_strnstr=yes
+ abi_strtonum=yes
+ abi_strtox=yes
+ abi_timeconv=yes
+ # DROP: On libmd.
+ abi_transparent_libmd=yes
+ abi_vis=yes
abi_wcsl=yes
],
[darwin*], [
- # On macOS these are provided by the system, and libbsd has never built
- # there, so we can avoid providing these with no ABI breakage.
+ abi_accmode=no
abi_arc4random=no
+ abi_arc4random_stir=no
abi_bsd_getopt=no
+ abi_closefrom=yes
abi_err=no
abi_errc=no
+ abi_expand_number=yes
+ abi_explicit_bzero=yes
+ abi_fgetln=no
+ abi_flopen=yes
+ abi_fmtcheck=no
abi_fpurge=no
+ abi_freezero=yes
abi_funopen=no
+ abi_getbsize=yes
+ abi_getpeereid=no
+ abi_humanize_number=yes
+ abi_id_from_name=yes
+ abi_inet_net_pton=no
+ # On libmd.
abi_md5=no
abi_name_from_id=no
abi_nlist=no
+ abi_pidfile=yes
+ abi_proctitle=yes
abi_progname=no
+ abi_readpassphrase=no
+ abi_reallocarray=yes
+ abi_reallocf=no
+ abi_recallocarray=yes
+ abi_stringlist=no
+ abi_sort=no
abi_strl=no
abi_strmode=no
+ abi_strnstr=no
+ abi_strtonum=no
+ abi_strtox=yes
+ abi_timeconv=no
+ # On libmd.
abi_transparent_libmd=no
+ abi_vis=no
abi_wcsl=no
],
[mingw*], [
],
)
+# Handle artificial ABI selections that are combinations of others.
+AS_IF([test "$abi_name_from_id" = "yes" || test "$abi_id_from_name" = "yes"], [
+ abi_pwcache=yes
+], [
+ abi_pwcache=no
+])
+
AM_CONDITIONAL([OS_WINDOWS], [test "x$is_windows" = "xyes"])
# Checks for programs.
AM_CONDITIONAL([HAVE_GETENTROPY], [test "x$ac_cv_func_getentropy" = "xyes"])
# ABI selection
+LIBBSD_SELECT_ABI([accmode], [setmode()/getmode()])
LIBBSD_SELECT_ABI([arc4random], [arc4random() API])
+LIBBSD_SELECT_ABI([arc4random_stir], [arc4random_stir()/arc4random_addrandom()])
LIBBSD_SELECT_ABI([bsd_getopt], [BSD getopt()])
+LIBBSD_SELECT_ABI([closefrom], [closefrom()])
LIBBSD_SELECT_ABI([err], [err API])
LIBBSD_SELECT_ABI([errc], [errc API])
+LIBBSD_SELECT_ABI([expand_number], [expand_number()])
+LIBBSD_SELECT_ABI([explicit_bzero], [explicit_bzero()])
+LIBBSD_SELECT_ABI([fgetln], [fgetln/fgetwln()])
+LIBBSD_SELECT_ABI([flopen], [flopen()/flopenat()])
+LIBBSD_SELECT_ABI([fmtcheck], [fmtcheck()])
LIBBSD_SELECT_ABI([fpurge], [fpurge()])
+LIBBSD_SELECT_ABI([freezero], [freezero()])
LIBBSD_SELECT_ABI([funopen], [funopen()])
+LIBBSD_SELECT_ABI([getbsize], [getbsize()])
+LIBBSD_SELECT_ABI([getpeereid], [getpeereid()])
+LIBBSD_SELECT_ABI([humanize_number], [humanize_number()/dehumanize_number()])
+LIBBSD_SELECT_ABI([id_from_name], [uid_from_user()/gid_from_user()])
+LIBBSD_SELECT_ABI([inet_net_pton], [inet_net_pton()])
LIBBSD_SELECT_ABI([md5], [MD5 digest functions])
LIBBSD_SELECT_ABI([name_from_id], [user_from_uid()/group_from_gid()])
LIBBSD_SELECT_ABI([nlist], [nlist()])
+LIBBSD_SELECT_ABI([pidfile], [pidfile API])
+LIBBSD_SELECT_ABI([proctitle], [setproctitle() API])
LIBBSD_SELECT_ABI([progname], [setprogname()/getprogname()])
+LIBBSD_SELECT_ABI([pwcache], [password cache API])
+LIBBSD_SELECT_ABI([readpassphrase], [readpassphrase()])
+LIBBSD_SELECT_ABI([reallocarray], [reallocarray()])
+LIBBSD_SELECT_ABI([reallocf], [reallocf()])
+LIBBSD_SELECT_ABI([recallocarray], [recallocarray()])
+LIBBSD_SELECT_ABI([stringlist], [stringlist sl_*() API])
+LIBBSD_SELECT_ABI([sort], [BSD sort functions])
LIBBSD_SELECT_ABI([strl], [strlcpy()/strlcat()])
LIBBSD_SELECT_ABI([strmode], [strmode()])
+LIBBSD_SELECT_ABI([strnstr], [strnstr()])
+LIBBSD_SELECT_ABI([strtonum], [strtonum()])
+LIBBSD_SELECT_ABI([strtox], [strtoi()/strtou()])
+LIBBSD_SELECT_ABI([timeconv], [timeconf.h API])
LIBBSD_SELECT_ABI([transparent_libmd], [transparent libmd support])
+LIBBSD_SELECT_ABI([vis], [vis API])
LIBBSD_SELECT_ABI([wcsl], [wcslcpy()/wcslcat()])
AS_IF([test "x$abi_funopen" = "xno" && \
LIBBSD_0.0 {
global:
+#if LIBBSD_ABI_ARC4RANDOM
arc4random;
+#endif
+#if LIBBSD_ABI_ARC4RANDOM_STIR
arc4random_stir;
arc4random_addrandom;
+#endif
+#if LIBBSD_ABI_BSD_GETOPT
bsd_getopt;
optreset;
+#endif
+#if LIBBSD_ABI_ERRC
errc;
warnc;
verrc;
vwarnc;
+#endif
+#if LIBBSD_ABI_FGETLN
fgetln;
+#endif
+
+#if LIBBSD_ABI_FMTCHECK
fmtcheck;
+#endif
+
+#if LIBBSD_ABI_SORT
heapsort;
+#endif
+
+#if LIBBSD_ABI_HUMANIZE_NUMBER
humanize_number;
+#endif
- /* XXX: Already provided by glibc, remove. */
+#if LIBBSD_ABI_INET_NET_PTON
inet_net_pton;
+#endif
+#if LIBBSD_ABI_PROGNAME
getprogname;
setprogname;
+#endif
+#if LIBBSD_ABI_STRL
strlcpy;
strlcat;
+#endif
+#if LIBBSD_ABI_ACCMODE
setmode;
getmode;
+#endif
+#if LIBBSD_ABI_VIS
vis;
strvis;
strvisx;
unvis;
strunvis;
strunvisx;
+#endif
- /* The following functions are provided via the system libc or libmd
- * implementations. */
+#if LIBBSD_ABI_MD5
MD5Init;
MD5Update;
MD5Pad;
MD5File;
MD5FileChunk;
MD5Data;
+#endif
local:
*;
};
LIBBSD_0.1 {
+#if LIBBSD_ABI_STRMODE
strmode;
+#endif
+#if LIBBSD_ABI_NLIST
/* Private symbol, but libkvm uses it. */
__fdnlist;
nlist;
+#endif
} LIBBSD_0.0;
LIBBSD_0.2 {
+#if LIBBSD_ABI_STRTONUM
strtonum;
+#endif
+#if LIBBSD_ABI_VIS
strnvis;
strnunvis;
+#endif
+#if LIBBSD_ABI_HUMANIZE_NUMBER
dehumanize_number;
+#endif
+#if LIBBSD_ABI_READPASSPHRASE
readpassphrase;
+#endif
+#if LIBBSD_ABI_FLOPEN
flopen;
+#endif
+#if LIBBSD_ABI_PIDFILE
pidfile_open;
pidfile_write;
pidfile_close;
pidfile_remove;
+#endif
+#if LIBBSD_ABI_ARC4RANDOM
arc4random_buf;
arc4random_uniform;
+#endif
} LIBBSD_0.1;
LIBBSD_0.3 {
+#if LIBBSD_ABI_REALLOCF
reallocf;
+#endif
+
+#if LIBBSD_ABI_GETPEEREID
getpeereid;
+#endif
+#if LIBBSD_ABI_SORT
mergesort;
radixsort;
sradixsort;
+#endif
+#if LIBBSD_ABI_FPURGE
fpurge;
+#endif
} LIBBSD_0.2;
LIBBSD_0.4 {
+#if LIBBSD_ABI_CLOSEFROM
closefrom;
+#endif
+
+#if LIBBSD_ABI_EXPAND_NUMBER
expand_number;
+#endif
} LIBBSD_0.3;
LIBBSD_0.5 {
+#if LIBBSD_ABI_FGETLN
fgetwln;
fparseln;
+#endif
+#if LIBBSD_ABI_PROCTITLE
/* Introduced in 0.2 as a stub, implemented in 0.5. */
setproctitle;
+#endif
+#if LIBBSD_ABI_STRNSTR
strnstr;
+#endif
+#if LIBBSD_ABI_WCSL
wcslcat;
wcslcpy;
+#endif
} LIBBSD_0.4;
LIBBSD_0.6 {
+#if LIBBSD_ABI_PROCTITLE
/* Exported to cope with the constructor+dlopen+threads mess. */
setproctitle_init;
+#endif
} LIBBSD_0.5;
LIBBSD_0.7 {
+#if LIBBSD_ABI_GETBSIZE
getbsize;
+#endif
- /* This symbol might not be present on some specific systems, such
- * as musl based ones. It might need to be removed on SOVERSION bump,
- * as it cannot be portabily implemented everywhere. */
+#if LIBBSD_ABI_FUNOPEN
funopen;
+#endif
+#if LIBBSD_ABI_REALLOCARRAY
reallocarray;
+#endif
+#if LIBBSD_ABI_STRINGLIST
sl_init;
sl_add;
sl_free;
sl_find;
+#endif
+#if LIBBSD_ABI_TIMECONV
_time32_to_time;
_time_to_time32;
_time64_to_time;
_long_to_time;
_time_to_int;
_int_to_time;
+#endif
} LIBBSD_0.6;
LIBBSD_0.8 {
+#if LIBBSD_ABI_EXPLICIT_BZERO
explicit_bzero;
+#endif
} LIBBSD_0.7;
LIBBSD_0.9 {
+#if LIBBSD_ABI_FLOPEN
flopenat;
+#endif
+#if LIBBSD_ABI_PIDFILE
pidfile_fileno;
+#endif
+#if LIBBSD_ABI_STRTOX
strtoi;
strtou;
+#endif
+#if LIBBSD_ABI_VIS
nvis;
snvis;
stravis;
strsvis;
strsvisx;
svis;
+#endif
} LIBBSD_0.8;
LIBBSD_0.9.1 {
+#if LIBBSD_ABI_VIS
/* The strnvis() and strnunvis() symbols changed prototype to match
* the NetBSD implementation. Provided as versioned nodes in 0.9.1, and
* exposed here explicitly so that we can redirect at compile-time. */
strnvis_netbsd;
strnunvis_netbsd;
+#endif
} LIBBSD_0.9;
LIBBSD_0.10.0 {
- /* These BSD extensions are available on GNU systems, but not on other
- * systems such as Windows or musl libc based ones. */
+#if LIBBSD_ABI_ERR
vwarn;
vwarnx;
warn;
verrx;
err;
errx;
+#endif
} LIBBSD_0.9.1;
LIBBSD_0.11.0 {
+#if LIBBSD_ABI_VIS
strnvisx;
+#endif
+#if LIBBSD_ABI_RECALLOCARRAY
recallocarray;
+#endif
+
+#if LIBBSD_ABI_FREEZERO
freezero;
+#endif
+#if LIBBSD_ABI_ID_FROM_NAME
gid_from_group;
- group_from_gid;
uid_from_user;
+#endif
+#if LIBBSD_ABI_NAME_FROM_ID
user_from_uid;
+ group_from_gid;
+#endif
} LIBBSD_0.10.0;