Fails to build on FreeBSD
README doesn't mention if libbsd is supposed to build and work on traditional BSDs. For example, libbsd can be packaged or bundled as subproject to avoid extra conditionals.
$ cc --version
FreeBSD clang version 16.0.4 (https://github.com/llvm/llvm-project.git llvmorg-16.0.4-0-gae42196bc493)
Target: x86_64-unknown-freebsd14.0
Thread model: posix
InstalledDir: /usr/bin
$ ./autogen
$ ./configure
[...]
checking for library containing MD5Update... -lmd
checking for library containing SHA512Update... no
configure: error: cannot find required SHA-2 functions in libc or libmd
$ gmake
[...]
progname.c:141:2: error: "Function getprogname() needs to be ported."
#error "Function getprogname() needs to be ported."
^
In file included from md5.c:27:
In file included from ../include/bsd/md5.h:28:
In file included from /usr/include/md5.h:46:
/usr/include/sys/md5.h:39:3: error: unknown type name 'u_int32_t'; did you mean '__int128_t'?
u_int32_t state[4]; /* state (ABCD) */
^
note: '__int128_t' declared here
/usr/include/sys/md5.h:40:3: error: unknown type name 'u_int32_t'; did you mean '__int128_t'?
u_int32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */
^
note: '__int128_t' declared here
/usr/include/sys/md5.h:53:39: error: redefinition of parameter 'off_t'
char * MD5FdChunk(int, char *, off_t, off_t);
^
/usr/include/sys/md5.h:53:32: note: previous declaration is here
char * MD5FdChunk(int, char *, off_t, off_t);
^
/usr/include/sys/md5.h:55:50: error: redefinition of parameter 'off_t'
char * MD5FileChunk(const char *, char *, off_t, off_t);
^
/usr/include/sys/md5.h:55:43: note: previous declaration is here
char * MD5FileChunk(const char *, char *, off_t, off_t);
^
md5.c:43:42: error: unknown type name 'uint8_t'
libbsd_MD5Update(MD5_CTX *context, const uint8_t *data, size_t len)
^
md5.c:43:57: error: unknown type name 'size_t'
libbsd_MD5Update(MD5_CTX *context, const uint8_t *data, size_t len)
^
md5.c:55:2: warning: call to undeclared function '_libmd_MD5Pad'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
MD5Pad(context);
^
/usr/include/md5.h:17:17: note: expanded from macro 'MD5Pad'
#define MD5Pad _libmd_MD5Pad
^
md5.c:60:20: error: conflicting types for '_libmd_MD5Pad'
libbsd_symver_weak(MD5Pad, libbsd_MD5Pad, LIBBSD_0.0);
^
/usr/include/md5.h:17:17: note: expanded from macro 'MD5Pad'
#define MD5Pad _libmd_MD5Pad
^
md5.c:55:2: note: previous implicit declaration is here
MD5Pad(context);
^
/usr/include/md5.h:17:17: note: expanded from macro 'MD5Pad'
#define MD5Pad _libmd_MD5Pad
^
md5.c:63:17: error: unknown type name 'uint8_t'
libbsd_MD5Final(uint8_t digest[MD5_DIGEST_LENGTH], MD5_CTX *context)
^
md5.c:73:21: error: unknown type name 'uint32_t'
libbsd_MD5Transform(uint32_t state[4], const uint8_t block[MD5_BLOCK_LENGTH])
^
md5.c:73:46: error: unknown type name 'uint8_t'
libbsd_MD5Transform(uint32_t state[4], const uint8_t block[MD5_BLOCK_LENGTH])
^
md5.c:75:2: warning: call to undeclared function '_libmd_MD5Transform'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
MD5Transform(state, block);
^
/usr/include/md5.h:23:22: note: expanded from macro 'MD5Transform'
#define MD5Transform _libmd_MD5Transform
^
md5.c:103:54: error: unknown type name 'off_t'
libbsd_MD5FileChunk(const char *filename, char *buf, off_t offset, off_t length)
^
md5.c:103:68: error: unknown type name 'off_t'
libbsd_MD5FileChunk(const char *filename, char *buf, off_t offset, off_t length)
^
md5.c:113:22: error: unknown type name 'uint8_t'
libbsd_MD5Data(const uint8_t *data, size_t len, char *buf)
^
md5.c:113:37: error: unknown type name 'size_t'
libbsd_MD5Data(const uint8_t *data, size_t len, char *buf)
^
2 warnings and 14 errors generated.