From 2622c8a1e2c1cabfd0f0c6f504325b9ae21672fa Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Mon, 26 Jun 2023 09:44:14 -0400 Subject: build: Check for mknod funcs, prog calloc(), execve(), fdopen(), mkfifo(), open(), rename(), sleep(), and mknod --- (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index fea89da..77d9c6a 100644 --- a/configure.ac +++ b/configure.ac @@ -43,10 +43,11 @@ test -d "${srcdir}/.git" || CFLAGS="${save_CFLAGS}" funcs_missing=false AC_CHECK_FUNCS( [\ - fclose feof ferror fopen fprintf fputs fread free fscanf fseek \ - fwrite getgrgid getpwuid localtime lstat malloc memcmp memcpy \ - memset mkdir printf puts readlink scandir snprintf sprintf \ - stat strchr strcmp strcpy strftime strlen strncpy strtol unlink + calloc execve fclose fdopen feof ferror fopen fprintf fputs \ + fread free fscanf fseek fwrite getgrgid getpwuid localtime \ + lstat malloc memcmp memcpy memset mkdir mkfifo open printf \ + puts readlink rename scandir sleep snprintf sprintf stat \ + strchr strcmp strcpy strftime strlen strncpy strtol unlink ], [], [funcs_missing=true]) @@ -65,6 +66,33 @@ AC_CHECK_DECLS([[major(dev_t)], [minor(dev_t)]], [], PKG_PROG_PKG_CONFIG() PKG_CHECK_MODULES([ZLIB], [zlib]) +AC_ARG_WITH( + [mknod], + [AS_HELP_STRING([--with-mknod=PATH], [mknod utility])], + [ + case "${withval}" in + 'yes'|'') + AC_MSG_ERROR( + [--with-mknod requires an argument]) + ;; + 'no') + AC_MSG_ERROR([mknod is required]) + ;; + *) + MKNOD="${withval}" + ;; + esac + ], + [ + AC_PATH_PROG([MKNOD], [mknod]) + if test -z "${MKNOD}"; then + AC_MSG_ERROR([mknod not found]) + fi + ] +) +AC_DEFINE_UNQUOTED([MKNOD], ["${MKNOD}"], + [Define to the path to the mknod utility.]) + AX_CFLAGS_WARN_ALL() dnl Adds -Wall or equivalent AX_CHECK_COMPILE_FLAG([-Wpedantic], [AX_APPEND_FLAG([-Wpedantic])]) AX_CHECK_COMPILE_FLAG([-Wextra], [AX_APPEND_FLAG([-Wextra])]) -- cgit v0.9.1