From 6812b9d2cde1479cd32237e3743ed4b4d26d7a2b Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 19 Apr 2023 16:00:29 -0400 Subject: build: Check for all libc functions --- diff --git a/configure.ac b/configure.ac index 620a85c..c2a4411 100644 --- a/configure.ac +++ b/configure.ac @@ -33,9 +33,21 @@ AC_PROG_CC() AM_PROG_CC_C_O() test -d "${srcdir}/.git" || CFLAGS="${save_CFLAGS}" -AC_SEARCH_LIBS([log10], [m], [], AC_MSG_ERROR([missing log10])) -AC_SEARCH_LIBS([ceil], [m], [], AC_MSG_ERROR([missing ceil])) -AC_SEARCH_LIBS([lrint], [m], [], AC_MSG_ERROR([missing lrint])) +funcs_missing=false +AC_CHECK_FUNCS( + [\ + fclose feof ferror fopen fprintf fputs fread free fwrite \ + localtime malloc memcmp memcpy memset printf puts snprintf \ + sprintf strcmp strftime strlen strncpy strtol + ], + [], + [funcs_missing=true]) +for func in log10 ceil lrint; do + AC_SEARCH_LIBS([${func}], [m], [], [funcs_missing=true]) +done +if ${funcs_missing}; then + AC_MSG_ERROR([required functions are missing]) +fi PKG_PROG_PKG_CONFIG() PKG_CHECK_MODULES([ZLIB], [zlib]) -- cgit v0.9.1