summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2023-04-19 16:00:29 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2023-04-19 16:00:29 (EDT)
commit6812b9d2cde1479cd32237e3743ed4b4d26d7a2b (patch)
tree334fcfa13c2a79c6fe3be1a07681f66ac15b595b
parentde2f99f8c485eacd4d39c526dc4f729c5df9b96f (diff)
build: Check for all libc functions
-rw-r--r--configure.ac18
1 files changed, 15 insertions, 3 deletions
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])