Adjustments in line with "autoscan" recommendations.

This commit is contained in:
Andrew Wood
2023-09-12 21:26:24 +01:00
parent e11c58cf3b
commit 052c182278
7 changed files with 105 additions and 11 deletions
+22 -3
View File
@@ -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],
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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
+2 -2
View File
@@ -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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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
+73
View File
@@ -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 <fcntl.h> 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 <getopt.h> 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 <minix/config.h> 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 <stdlib.h> 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 <strings.h> 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 <sys/file.h> header file. */
#undef HAVE_SYS_FILE_H
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H
@@ -118,6 +163,9 @@
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> 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 <sys/types.h> 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 <sys/types.h> does not define. */
#undef mode_t
/* Define to `long int' if <sys/types.h> 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 <sys/types.h> does not define. */
#undef size_t
/* Define to `int' if <sys/types.h> does not define. */
#undef ssize_t
/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t
#include "config-aux.h"
+2
View File
@@ -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;