From 052c182278674b5d2a397562e8d936f295580e16 Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Tue, 12 Sep 2023 21:26:24 +0100 Subject: [PATCH] Adjustments in line with "autoscan" recommendations. --- configure.ac | 25 ++++++++++++-- po/de.po | 4 +-- po/fr.po | 4 +-- po/pl.po | 4 +-- po/pt.po | 4 +-- src/include/config.h.in | 73 +++++++++++++++++++++++++++++++++++++++++ src/pv/loop.c | 2 ++ 7 files changed, 105 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index 9a84f0b..7c5590f 100644 --- a/configure.ac +++ b/configure.ac @@ -22,18 +22,37 @@ if test "$USE_NLS" = "yes"; then CPPFLAGS="$CPPFLAGS -DLOCALEDIR=\\\"\$(localedir)\\\"" LIBS="$LIBS $LIBINTL" fi + +dnl Items we can use if present, but can do without if not present. AC_CHECK_FUNCS([getopt_long]) -AC_CHECK_HEADERS([getopt.h]) -AC_CHECK_FUNCS([memcpy basename vsnprintf strlcat strtoul]) +AC_CHECK_FUNCS([vsnprintf strlcat strtoul]) AC_CHECK_FUNCS([fdatasync]) AC_CHECK_FUNCS([fpathconf sysconf posix_memalign posix_fadvise]) -AC_SEARCH_LIBS([clock_gettime],[rt]) +AC_CHECK_HEADERS([getopt.h]) AC_CHECK_HEADERS([limits.h]) AC_CHECK_HEADERS([wctype.h]) AC_CHECK_HEADERS([termios.h]) AC_CHECK_HEADERS([libgen.h]) AC_CHECK_HEADERS([sys/ioctl.h]) AC_CHECK_HEADERS([libintl.h locale.h]) +AC_CHECK_MEMBERS([struct stat.st_blksize]) + +dnl Items we can't do without. +AC_CHECK_FUNCS([alarm basename clock_gettime dup2 getcwd memcpy memmove memset select setlocale strchr strerror strrchr strstr], [], [AC_MSG_ERROR([required function is missing])]) +AC_CHECK_HEADERS([fcntl.h sys/file.h sys/time.h unistd.h], [], [AC_MSG_ERROR([required header file is missing])]) + +dnl Libraries that may contain key functions. +AC_SEARCH_LIBS([clock_gettime],[rt]) + +dnl Make sure all the types we use are defined. +AC_TYPE_INT32_T +AC_TYPE_MODE_T +AC_TYPE_OFF_T +AC_TYPE_PID_T +AC_TYPE_SIZE_T +AC_TYPE_SSIZE_T +AC_TYPE_UID_T + AH_BOTTOM([#include "config-aux.h"]) AC_ARG_ENABLE([debugging], diff --git a/po/de.po b/po/de.po index b216234..f5836d5 100644 --- a/po/de.po +++ b/po/de.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: pv@ivarch.com\n" -"POT-Creation-Date: 2023-09-12 13:36+0100\n" +"POT-Creation-Date: 2023-09-12 21:25+0100\n" "Language: de\n" "Content-Type: text/plain; charset=UTF-8\n" "Date: 1999-06-01 15:18:29+0100\n" @@ -420,7 +420,7 @@ msgstr "" msgid "(stdin)" msgstr "" -#: src/pv/loop.c:522 src/pv/loop.c:572 src/pv/loop.c:617 src/pv/watchpid.c:73 +#: src/pv/loop.c:524 src/pv/loop.c:574 src/pv/loop.c:619 src/pv/watchpid.c:73 #: src/pv/watchpid.c:83 src/pv/watchpid.c:94 src/pv/watchpid.c:102 #: src/pv/watchpid.c:139 src/pv/watchpid.c:150 src/pv/watchpid.c:158 #: src/pv/watchpid.c:169 src/pv/watchpid.c:253 src/pv/watchpid.c:261 diff --git a/po/fr.po b/po/fr.po index f5f83fe..e967d65 100644 --- a/po/fr.po +++ b/po/fr.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: pv@ivarch.com\n" -"POT-Creation-Date: 2023-09-12 13:36+0100\n" +"POT-Creation-Date: 2023-09-12 21:25+0100\n" "Language: fr\n" "Content-Type: text/plain; charset=UTF-8\n" "Date: 1999-06-01 15:18:29+0100\n" @@ -421,7 +421,7 @@ msgstr "" msgid "(stdin)" msgstr "" -#: src/pv/loop.c:522 src/pv/loop.c:572 src/pv/loop.c:617 src/pv/watchpid.c:73 +#: src/pv/loop.c:524 src/pv/loop.c:574 src/pv/loop.c:619 src/pv/watchpid.c:73 #: src/pv/watchpid.c:83 src/pv/watchpid.c:94 src/pv/watchpid.c:102 #: src/pv/watchpid.c:139 src/pv/watchpid.c:150 src/pv/watchpid.c:158 #: src/pv/watchpid.c:169 src/pv/watchpid.c:253 src/pv/watchpid.c:261 diff --git a/po/pl.po b/po/pl.po index f028e58..80b9e2d 100644 --- a/po/pl.po +++ b/po/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: pv@ivarch.com\n" -"POT-Creation-Date: 2023-09-12 13:36+0100\n" +"POT-Creation-Date: 2023-09-12 21:25+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -410,7 +410,7 @@ msgstr "" msgid "(stdin)" msgstr "" -#: src/pv/loop.c:522 src/pv/loop.c:572 src/pv/loop.c:617 src/pv/watchpid.c:73 +#: src/pv/loop.c:524 src/pv/loop.c:574 src/pv/loop.c:619 src/pv/watchpid.c:73 #: src/pv/watchpid.c:83 src/pv/watchpid.c:94 src/pv/watchpid.c:102 #: src/pv/watchpid.c:139 src/pv/watchpid.c:150 src/pv/watchpid.c:158 #: src/pv/watchpid.c:169 src/pv/watchpid.c:253 src/pv/watchpid.c:261 diff --git a/po/pt.po b/po/pt.po index 615dae8..4f6e4ed 100644 --- a/po/pt.po +++ b/po/pt.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: pv@ivarch.com\n" -"POT-Creation-Date: 2023-09-12 13:36+0100\n" +"POT-Creation-Date: 2023-09-12 21:25+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -412,7 +412,7 @@ msgstr "" msgid "(stdin)" msgstr "" -#: src/pv/loop.c:522 src/pv/loop.c:572 src/pv/loop.c:617 src/pv/watchpid.c:73 +#: src/pv/loop.c:524 src/pv/loop.c:574 src/pv/loop.c:619 src/pv/watchpid.c:73 #: src/pv/watchpid.c:83 src/pv/watchpid.c:94 src/pv/watchpid.c:102 #: src/pv/watchpid.c:139 src/pv/watchpid.c:150 src/pv/watchpid.c:158 #: src/pv/watchpid.c:169 src/pv/watchpid.c:253 src/pv/watchpid.c:261 diff --git a/src/include/config.h.in b/src/include/config.h.in index 5a91fc5..26fd83a 100644 --- a/src/include/config.h.in +++ b/src/include/config.h.in @@ -7,6 +7,9 @@ language is requested. */ #undef ENABLE_NLS +/* Define to 1 if you have the `alarm' function. */ +#undef HAVE_ALARM + /* Define to 1 if you have the `basename' function. */ #undef HAVE_BASENAME @@ -18,16 +21,28 @@ the CoreFoundation framework. */ #undef HAVE_CFPREFERENCESCOPYAPPVALUE +/* Define to 1 if you have the `clock_gettime' function. */ +#undef HAVE_CLOCK_GETTIME + /* Define if the GNU dcgettext() function is already present or preinstalled. */ #undef HAVE_DCGETTEXT +/* Define to 1 if you have the `dup2' function. */ +#undef HAVE_DUP2 + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + /* Define to 1 if you have the `fdatasync' function. */ #undef HAVE_FDATASYNC /* Define to 1 if you have the `fpathconf' function. */ #undef HAVE_FPATHCONF +/* Define to 1 if you have the `getcwd' function. */ +#undef HAVE_GETCWD + /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H @@ -61,6 +76,12 @@ /* Define to 1 if you have the `memcpy' function. */ #undef HAVE_MEMCPY +/* Define to 1 if you have the `memmove' function. */ +#undef HAVE_MEMMOVE + +/* Define to 1 if you have the `memset' function. */ +#undef HAVE_MEMSET + /* Define to 1 if you have the header file. */ #undef HAVE_MINIX_CONFIG_H @@ -73,6 +94,12 @@ /* Define to 1 if you have the `posix_memalign' function. */ #undef HAVE_POSIX_MEMALIGN +/* Define to 1 if you have the `select' function. */ +#undef HAVE_SELECT + +/* Define to 1 if you have the `setlocale' function. */ +#undef HAVE_SETLOCALE + /* Define to 1 if you have the `splice' function. */ #undef HAVE_SPLICE @@ -88,6 +115,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H +/* Define to 1 if you have the `strchr' function. */ +#undef HAVE_STRCHR + +/* Define to 1 if you have the `strerror' function. */ +#undef HAVE_STRERROR + /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H @@ -97,12 +130,24 @@ /* Define to 1 if you have the `strlcat' function. */ #undef HAVE_STRLCAT +/* Define to 1 if you have the `strrchr' function. */ +#undef HAVE_STRRCHR + +/* Define to 1 if you have the `strstr' function. */ +#undef HAVE_STRSTR + /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL +/* Define to 1 if `st_blksize' is a member of `struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_BLKSIZE + /* Define to 1 if you have the `sysconf' function. */ #undef HAVE_SYSCONF +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_FILE_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H @@ -118,6 +163,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H @@ -265,4 +313,29 @@ /* Define to empty if `const' does not conform to ANSI C. */ #undef const +/* Define to `int' if doesn't define. */ +#undef gid_t + +/* Define to the type of a signed integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef int32_t + +/* Define to `int' if does not define. */ +#undef mode_t + +/* Define to `long int' if does not define. */ +#undef off_t + +/* Define as a signed integer type capable of holding a process identifier. */ +#undef pid_t + +/* Define to `unsigned int' if does not define. */ +#undef size_t + +/* Define to `int' if does not define. */ +#undef ssize_t + +/* Define to `int' if doesn't define. */ +#undef uid_t + #include "config-aux.h" diff --git a/src/pv/loop.c b/src/pv/loop.c index 302e5cf..c9f7a1c 100644 --- a/src/pv/loop.c +++ b/src/pv/loop.c @@ -118,6 +118,7 @@ int pv_main_loop(pvstate_t state) state->direct_io_changed = false; #endif /* O_DIRECT */ +#if HAVE_STRUCT_STAT_ST_BLKSIZE /* * Set target buffer size if the initial file's block size can be * read and we weren't given a target buffer size. @@ -129,6 +130,7 @@ int pv_main_loop(pvstate_t state) sz = BUFFER_SIZE_MAX; state->target_buffer_size = sz; } +#endif if (0 == state->target_buffer_size) state->target_buffer_size = BUFFER_SIZE;