Subject: CVS commit: pkgsrc/pkgtools/libnbcompat/files
From: Taylor R Campbell
Date: 2023-06-27 11:30:27
Message id: 20230627093028.0D3F6FA89@cvs.NetBSD.org

Log Message:
libnbcompat: Use AC_CACHE_CHECK so we can handle cross-compiling.

The printf %lld test, the printf %qd test, and the vsnprintf return
value test are necessarily runtime tests, which don't work during
cross-compilation.

On NetBSD, the tests all pass, so there's no need to substitute the
NetBSD snprintf for is own snprintf in libnbcompat, which falls apart
if we try it because of the ssp macros:

mips64--netbsd-gcc -DHAVE_NBCOMPAT_H=1 \ 
-I/home/riastradh/pkgsrc/current/cross/work/net/libfetch/work.mips64eb/libnbcompat \ 
-I/usr/include -I. -I.  -O2 -fPIC -D_FORTIFY_SOURCE=2 -I/usr/include \ 
-DHAVE_CONFIG_H -c snprintf.c
In file included from \ 
/home/riastradh/netbsd/current/obj.evbmips64-eb/destdir.evbmips/usr/include/stdi \ 
o.h:595,
                 from \ 
/home/riastradh/pkgsrc/current/cross/work/net/libfetch/work.mips64eb/libnbcompat \ 
/nbcompat/stdio.h:40,
                 from \ 
/home/riastradh/pkgsrc/current/cross/work/net/libfetch/work.mips64eb/libnbcompat \ 
/nbcompat.h:61,
                 from snprintf.c:28:
snprintf.c:43:1: error: expected declaration specifiers or '...' before numeric \ 
constant
   43 | snprintf(char *str, size_t size, const char *format, ...)
      | ^~~~~~~~

With this change, we have the opportunity to predetermine known test
outcomes without a runtime test by setting nb_cv_* variables in the
configure environment (to be done in a subsequent commit).

Files:
RevisionActionfile
1.89modifypkgsrc/pkgtools/libnbcompat/files/configure.ac