groff-1.24.1/0000755000175000017500000000000015155212142007701 500000000000000groff-1.24.1/BUG-REPORT0000644000175000017500000000543215155205667011214 00000000000000 Copyright (C) 1999-2020, 2022 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. groff Bug Report [Please read the 'PROBLEMS' file before submitting a bug report. Please fill in all fields, even if you think they are not relevant. Please delete the text in square brackets before submitting it. Please report distinguishable problems separately. Place this completed form in a new bug report at . Click on the "Bugs" link, then select "Submit new" from the menu.] +verbatim+ GROFF VERSION: [Put the output of the failing command when run with the '--version' option here. For example, "groff --version" or "indxbib --version".] PLATFORM: [Put the output of the "uname -a" command here. On non-POSIX systems, some alternative should be available; on Windows systems, use "ver".] CONFIGURATION REPORT: [If you compiled groff yourself, include the portion of the 'configure' script's output between rows of dashes. If you didn't compile groff yourself, supply the packaging information from your distributor: in DEB- and RPM-based GNU/Linux distributions, gather it with the commands "dpkg -s groff" or "rpm -qi groff", respectively.] INPUT FILES: [Include all the files necessary to reproduce the problem that are not part of the standard groff distribution. This includes device and font description files and any macro files your document uses that groff does not supply. Attach them to the bug report. It's easier for us if you can provide an example that doesn't depend on any macro package, but obviously if you're reporting a problem with a macro package that won't be possible. Further, a short example is more convenient than a long one, but don't worry if you can't find a short example. A claim like "any file that X" is not helpful: always include a concrete example.] COMMAND LINE: [Retype or paste the command line that we should run in order to observe the bug. For example, "groff -Tps bug.tr".] DESCRIPTION OF INCORRECT BEHAVIOUR: [What goes wrong when that command line is run? For example, "groff gets a segmentation fault.", or "The output looks bad because the bar over the x is too long and is too far over to the left." If you get an error message, include it here without modification: don't edit it to make it more readable.] SUGGESTED FIX [optional]: [If you can suggest a fix for the problem, you might include a unified diff here. But don't delay submitting a bug report in the hope of finding a fix. A guess about a bug's cause is not usually helpful.] -verbatim- ##### Editor settings Local Variables: fill-column: 72 mode: text End: vim: set filetype= textwidth=72: groff-1.24.1/INSTALL0000644000175000017500000004116715153275163010675 00000000000000Installation Instructions ************************* Basic Installation ================== The following shell commands: test -f configure || ./bootstrap ./configure make make install should configure, build, and install this package. The first line, which bootstraps, is intended for developers; when building from distribution tarballs it does nothing and can be skipped. A package might name the bootstrapping script differently; if the name is ‘autogen.sh’, for example, the first line should say ‘./autogen.sh’ instead of ‘./bootstrap’. The following more-detailed instructions are generic; see the ‘README’ file for instructions specific to this package. Some packages provide this ‘INSTALL’ file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in the GNU Coding Standards. Many packages have scripts meant for developers instead of ordinary builders, as they may use developer tools that are less commonly installed, or they may access the network, which has privacy implications. These scripts attempt to bootstrap by building the ‘configure’ script and related files, possibly using developer tools or the network. Because the output of bootstrapping is system-independent, it is normally run by a package developer so that its output can be put into the distribution tarball and ordinary builders and users need not bootstrap. Some packages have commands like ‘./autopull.sh’ and ‘./autogen.sh’ that you can run instead of ‘./bootstrap’, for more fine-grained control over bootstrapping. The ‘configure’ script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a ‘Makefile’ in each directory of the package. It may also create one or more ‘.h’ files containing system-dependent definitions. Finally, it creates a script ‘config.status’ that you can run in the future to recreate the current configuration, and a file ‘config.log’ containing output useful for debugging ‘configure’. It can also use an optional file (typically called ‘config.cache’ and enabled with ‘--cache-file=config.cache’ or simply ‘-C’) that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how ‘configure’ could check whether to do them, and mail diffs or instructions to the address given in the ‘README’ so they can be considered for the next release. If you are using the cache, and at some point ‘config.cache’ contains results you don’t want to keep, you may remove or edit it. The ‘autoconf’ program generates ‘configure’ from the file ‘configure.ac’. Normally you should edit ‘configure.ac’ instead of editing ‘configure’ directly. The simplest way to compile this package is: 1. ‘cd’ to the directory containing the package’s source code. 2. If this is a developer checkout and file ‘configure’ does not yet exist, run the bootstrapping script (typically ‘./bootstrap’ or ‘./autogen.sh’) to bootstrap and create the file. You may need special developer tools and network access to bootstrap, and the network access may have privacy implications. 3. Type ‘./configure’ to configure the package for your system. This might take a while. While running, ‘configure’ prints messages telling which features it is checking for. 4. Type ‘make’ to compile the package. 5. Optionally, type ‘make check’ to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 6. Type ‘make install’ to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the ‘make install’ phase executed with root privileges. 7. Optionally, type ‘make installcheck’ to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior ‘make install’ required root privileges, verifies that the installation completed correctly. 8. You can remove the program binaries and object files from the source code directory by typing ‘make clean’. To also remove the files that ‘configure’ created (so you can compile the package for a different kind of computer), type ‘make distclean’. There is also a ‘make maintainer-clean’ target, but that is intended mainly for the package’s developers. If you use it, you may have to bootstrap again. 9. If the package follows the GNU Coding Standards, you can type ‘make uninstall’ to remove the installed files. Installation Prerequisites ========================== Installation requires a POSIX-like environment with a shell and at least the following standard utilities: awk cat cp diff echo expr false ls mkdir mv printf pwd rm rmdir sed sort test tr This package’s installation may need other standard utilities such as ‘grep’, ‘make’, ‘sleep’ and ‘touch’, along with compilers like ‘gcc’. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the ‘configure’ script does not know about. Run ‘./configure --help’ for details on some of the pertinent environment variables. You can give ‘configure’ initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=gcc CFLAGS=-g LIBS=-lposix See “Defining Variables” for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each system in their own directory. To do this, you can use GNU ‘make’. ‘cd’ to the directory where you want the object files and executables to go and run the ‘configure’ script. ‘configure’ automatically checks for the source code in the directory that ‘configure’ is in and in ‘..’. This is known as a “VPATH” build. With a non-GNU ‘make’, it is safer to compile the package for one system at a time in the source code directory. After you have installed the package for one system, use ‘make distclean’ before reconfiguring for another system. Some platforms, notably macOS, support “fat” or “universal” binaries, where a single binary can execute on different architectures. On these platforms you can configure and compile just once, with options specific to that platform. Installation Names ================== By default, ‘make install’ installs the package’s commands under ‘/usr/local/bin’, include files under ‘/usr/local/include’, etc. You can specify an installation prefix other than ‘/usr/local’ by giving ‘configure’ the option ‘--prefix=PREFIX’, where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option ‘--exec-prefix=PREFIX’ to ‘configure’, the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like ‘--bindir=DIR’ to specify different values for particular kinds of files. Run ‘configure --help’ for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of ‘${prefix}’, so that specifying just ‘--prefix’ will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to ‘configure’; however, many packages provide one or both of the following shortcuts of passing variable assignments to the ‘make install’ command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, ‘make install prefix=/alternate/directory’ will choose an alternate location for all directory configuration variables that were expressed in terms of ‘${prefix}’. Any directories that were specified during ‘configure’, but not in terms of ‘${prefix}’, must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the ‘DESTDIR’ variable. For example, ‘make install DESTDIR=/alternate/directory’ will prepend ‘/alternate/directory’ before all installation names. The approach of ‘DESTDIR’ overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of ‘${prefix}’ at ‘configure’ time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving ‘configure’ the option ‘--program-prefix=PREFIX’ or ‘--program-suffix=SUFFIX’. Some packages pay attention to ‘--enable-FEATURE’ and ‘--disable-FEATURE’ options to ‘configure’, where FEATURE indicates an optional part of the package. They may also pay attention to ‘--with-PACKAGE’ and ‘--without-PACKAGE’ options, where PACKAGE is something like ‘gnu-ld’. ‘./configure --help’ should mention the ‘--enable-...’ and ‘--with-...’ options that the package recognizes. Some packages offer the ability to configure how verbose the execution of ‘make’ will be. For these packages, running ‘./configure --enable-silent-rules’ sets the default to minimal output, which can be overridden with ‘make V=1’; while running ‘./configure --disable-silent-rules’ sets the default to verbose, which can be overridden with ‘make V=0’. Specifying a System Type ======================== By default ‘configure’ builds for the current system. To create binaries that can run on a different system type, specify a ‘--host=TYPE’ option along with compiler variables that specify how to generate object code for TYPE. For example, to create binaries intended to run on a 64-bit ARM processor: ./configure --host=aarch64-linux-gnu \ CC=aarch64-linux-gnu-gcc \ CXX=aarch64-linux-gnu-g++ If done on a machine that can execute these binaries (e.g., via ‘qemu-aarch64’, ‘$QEMU_LD_PREFIX’, and Linux’s ‘binfmt_misc’ capability), the build behaves like a native build. Otherwise it is a cross-build: ‘configure’ will make cross-compilation guesses instead of running test programs, and ‘make check’ will not work. A system type can either be a short name like ‘mingw64’, or a canonical name like ‘x86_64-pc-linux-gnu’. Canonical names have the form CPU-COMPANY-SYSTEM where SYSTEM is either OS or KERNEL-OS. To canonicalize and validate a system type, you can run the command ‘config.sub’, which is often squirreled away in a subdirectory like ‘build-aux’. For example: $ build-aux/config.sub arm64-linux aarch64-unknown-linux-gnu $ build-aux/config.sub riscv-lnx Invalid configuration 'riscv-lnx': OS 'lnx' not recognized You can look at the ‘config.sub’ file to see which types are recognized. If the file is absent, this package does not need the system type. If ‘configure’ fails with the diagnostic “cannot guess build type”. ‘config.sub’ did not recognize your system’s type. In this case, first fetch the newest versions of these files from the GNU config package (https://savannah.gnu.org/projects/config). If that fixes things, please report it to the maintainers of the package containing ‘configure’. Otherwise, you can try the configure option ‘--build=TYPE’ where TYPE comes close to your system type; also, please report the problem to . For more details about configuring system types, see the Autoconf documentation. Sharing Defaults ================ If you want to set default values for ‘configure’ scripts to share, you can create a site shell script called ‘config.site’ that gives default values for variables like ‘CC’, ‘cache_file’, and ‘prefix’. ‘configure’ looks for ‘PREFIX/share/config.site’ if it exists, then ‘PREFIX/etc/config.site’ if it exists. Or, you can set the ‘CONFIG_SITE’ environment variable to the location of the site script. A warning: not all ‘configure’ scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to ‘configure’. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the ‘configure’ command line, using ‘VAR=value’. For example: ./configure CC=/usr/local2/bin/gcc causes the specified ‘gcc’ to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for ‘CONFIG_SHELL’ due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash ‘configure’ Invocation ====================== ‘configure’ recognizes the following options to control how it operates. ‘--help’ ‘-h’ Print a summary of all of the options to ‘configure’, and exit. ‘--help=short’ ‘--help=recursive’ Print a summary of the options unique to this package’s ‘configure’, and exit. The ‘short’ variant lists options used only in the top level, while the ‘recursive’ variant lists options also present in any nested packages. ‘--version’ ‘-V’ Print the version of Autoconf used to generate the ‘configure’ script, and exit. ‘--cache-file=FILE’ Enable the cache: use and save the results of the tests in FILE, traditionally ‘config.cache’. FILE defaults to ‘/dev/null’ to disable caching. ‘--config-cache’ ‘-C’ Alias for ‘--cache-file=config.cache’. ‘--srcdir=DIR’ Look for the package’s source code in directory DIR. Usually ‘configure’ can determine that directory automatically. ‘--prefix=DIR’ Use DIR as the installation prefix. See “Installation Names” for more details, including other options available for fine-tuning the installation locations. ‘--host=TYPE’ Build binaries for system TYPE. See “Specifying a System Type”. ‘--enable-FEATURE’ ‘--disable-FEATURE’ Enable or disable the optional FEATURE. See “Optional Features”. ‘--with-PACKAGE’ ‘--without-PACKAGE’ Use or omit PACKAGE when building. See “Optional Features”. ‘--quiet’ ‘--silent’ ‘-q’ Do not print messages saying which checks are being made. To suppress all normal output, redirect it to ‘/dev/null’ (any error messages will still be shown). ‘--no-create’ ‘-n’ Run the configure checks, but stop before creating any output files. ‘configure’ also recognizes several environment variables, and accepts some other, less widely useful, options. Run ‘configure --help’ for more details. Copyright notice ================ Copyright © 1994–1996, 1999–2002, 2004–2017, 2020–2025 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. groff-1.24.1/gnulib_m4/0000755000175000017500000000000015155212141011560 500000000000000groff-1.24.1/gnulib_m4/locale-zh.m40000644000175000017500000001441515153275164013641 00000000000000# locale-zh.m4 # serial 20 dnl Copyright (C) 2003, 2005-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Bruno Haible. dnl Determine the name of a chinese locale with GB18030 encoding. AC_DEFUN_ONCE([gt_LOCALE_ZH_CN], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AM_LANGINFO_CODESET]) AC_CACHE_CHECK([for a transitional chinese locale], [gt_cv_locale_zh_CN], [ AC_LANG_CONFTEST([AC_LANG_SOURCE([[ #include #include #include #if HAVE_LANGINFO_CODESET # include #endif #include #include #include struct tm t; char buf[16]; int main () { /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl imitates locale dependent behaviour by looking at the environment variables, and all locales use the UTF-8 encoding. */ #if defined __BEOS__ || defined __HAIKU__ return 1; #else /* Check whether the given locale name is recognized by the system. */ # if defined _WIN32 && !defined __CYGWIN__ /* On native Windows, setlocale(category, "") looks at the system settings, not at the environment variables. Also, when an encoding suffix such as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE category of the locale to "C". */ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) return 1; # else if (setlocale (LC_ALL, "") == NULL) return 1; # endif /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) is empty, and the behaviour of Tcl 8.4 in this locale is not useful. On OpenBSD 4.0, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "646". In this situation, some unit tests fail. On MirBSD 10, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "UTF-8". */ # if HAVE_LANGINFO_CODESET { const char *cs = nl_langinfo (CODESET); if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 || strcmp (cs, "UTF-8") == 0) return 1; } # endif # ifdef __CYGWIN__ /* On Cygwin, avoid locale names without encoding suffix, because the locale_charset() function relies on the encoding suffix. Note that LC_ALL is set on the command line. */ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; # endif /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. This excludes the UTF-8 encoding (except on MirBSD). */ { const char *p; t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; for (p = buf; *p != '\0'; p++) if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) return 1; } /* Check whether a typical GB18030 multibyte sequence is recognized as a single wide character. This excludes the GB2312 and GBK encodings. */ if (mblen ("\203\062\332\066", 5) != 4) return 1; /* Check whether mbrtowc accept this character one byte at a time. This excludes NetBSD 10.0. */ if (sizeof (wchar_t) > 2) { wchar_t wc; mbstate_t state; memset (&state, 0, sizeof (state)); if (!(mbrtowc (&wc, "\203", 1, &state) == (size_t)(-2) && mbrtowc (&wc, "\062", 1, &state) == (size_t)(-2) && mbrtowc (&wc, "\332", 1, &state) == (size_t)(-2) && mbrtowc (&wc, "\066", 1, &state) == 1)) return 1; } return 0; #endif } ]])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then case "$host_os" in # Handle native Windows specially, because there setlocale() interprets # "ar" or "ara" as "Arabic" or "Arabic_Saudi Arabia.1256", # "en" or "eng" as "English" or "English_United States.1252", # "fr" or "fra" as "French" or "French_France.1252", # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", # "ja" or "jpn" as "Japanese" or "Japanese_Japan.932", # and similar. mingw* | windows*) # Test for the hypothetical native Windows locale name. if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_zh_CN=Chinese_China.54936 else # None found. gt_cv_locale_zh_CN=none fi ;; solaris2.8) # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. gt_cv_locale_zh_CN=none ;; *) # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the # configure script would override the LC_ALL setting. Likewise for # LC_CTYPE, which is also set at the beginning of the configure script. # Test for the locale name without encoding suffix. if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_zh_CN=zh_CN else # Test for the locale name with explicit encoding suffix. if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_zh_CN=zh_CN.GB18030 else # None found. gt_cv_locale_zh_CN=none fi fi ;; esac else # If there was a link error, due to mblen(), the system is so old that # it certainly doesn't have a chinese locale. gt_cv_locale_zh_CN=none fi rm -fr conftest* ]) LOCALE_ZH_CN=$gt_cv_locale_zh_CN case $LOCALE_ZH_CN in #( '' | *[[[:space:]\"\$\'*@<:@]]*) dnl This locale name might cause trouble with sh or make. AC_MSG_WARN([invalid locale "$LOCALE_ZH_CN"; assuming "none"]) LOCALE_ZH_CN=none;; esac AC_SUBST([LOCALE_ZH_CN]) ]) groff-1.24.1/gnulib_m4/musl.m40000644000175000017500000000132315153275164012735 00000000000000# musl.m4 # serial 4 dnl Copyright (C) 2019-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. # Test for musl libc, despite the musl libc authors don't like it # # . # From Bruno Haible. AC_DEFUN_ONCE([gl_MUSL_LIBC], [ AC_REQUIRE([AC_CANONICAL_HOST]) case "$host_os" in *-musl* | midipix*) AC_DEFINE([MUSL_LIBC], [1], [Define to 1 on musl libc.]) ;; esac ]) groff-1.24.1/gnulib_m4/vasnprintf.m40000644000175000017500000004116615153275164014160 00000000000000# vasnprintf.m4 # serial 56 dnl Copyright (C) 2002-2004, 2006-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_VASNPRINTF], [ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CHECK_FUNCS_ONCE([vasnprintf]) if test $ac_cv_func_vasnprintf = yes; then dnl On Cygwin, in directives with a huge width, the width is ignored, and dnl the function returns a wrong result. AC_CACHE_CHECK([whether vasnprintf works], [gl_cv_func_vasnprintf_works], [AC_RUN_IFELSE( [AC_LANG_SOURCE( [[#include ]], [[size_t len; char *res = vasnprintf (NULL, &len, "x%03000000000dy\n", -17); /* On Cygwin 3.4.6, res is "x-17y\n" and len == 6: wrong. */ return (res != NULL && len < 10); ]]) ], [gl_cv_func_vasnprintf_works=yes], [gl_cv_func_vasnprintf_works=no], [case "$host_os" in # Guess no on Cygwin. cygwin*) gl_cv_func_vasnprintf_works="guessing no";; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_vasnprintf_works="$gl_cross_guess_normal";; esac ]) ]) fi if test $ac_cv_func_vasnprintf != yes \ || case "$gl_cv_func_vasnprintf_works" in *yes) false;; *) true;; esac then gl_REPLACE_VASNPRINTF fi ]) AC_DEFUN([gl_REPLACE_VASNPRINTF], [ AC_CHECK_FUNCS_ONCE([vasnprintf]) AC_LIBOBJ([vasnprintf]) AC_LIBOBJ([printf-args]) AC_LIBOBJ([printf-parse]) AC_LIBOBJ([asnprintf]) if test $ac_cv_func_vasnprintf = yes; then AC_DEFINE([REPLACE_VASNPRINTF], [1], [Define if vasnprintf exists but is overridden by gnulib.]) fi gl_PREREQ_PRINTF_ARGS gl_PREREQ_PRINTF_PARSE gl_PREREQ_VASNPRINTF gl_PREREQ_ASNPRINTF ]) AC_DEFUN([gl_FUNC_VASNWPRINTF], [ AC_LIBOBJ([printf-args]) gl_PREREQ_PRINTF_ARGS gl_PREREQ_PRINTF_PARSE gl_PREREQ_VASNWPRINTF gl_PREREQ_ASNPRINTF ]) # Prerequisites of lib/printf-args.h, lib/printf-args.c. AC_DEFUN([gl_PREREQ_PRINTF_ARGS], [ AC_REQUIRE([gt_TYPE_WINT_T]) ]) # Prerequisites of lib/printf-parse.h, lib/printf-parse.c. # Prerequisites of lib/wprintf-parse.h, lib/wprintf-parse.c. AC_DEFUN([gl_PREREQ_PRINTF_PARSE], [ AC_REQUIRE([gl_FEATURES_H]) AC_REQUIRE([gt_TYPE_WINT_T]) AC_REQUIRE([AC_TYPE_SIZE_T]) AC_CHECK_TYPE([ptrdiff_t], , [AC_DEFINE([ptrdiff_t], [long], [Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) ]) AC_REQUIRE([gt_AC_TYPE_INTMAX_T]) ]) # Prerequisites of lib/vasnprintf.c if !WIDE_CHAR_VERSION. AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF], [ AC_CHECK_FUNCS([snprintf strnlen wcrtomb]) dnl Use the _snprintf function only if it is declared (because on NetBSD it dnl is defined as a weak alias of snprintf; we prefer to use the latter). AC_CHECK_DECLS([_snprintf], , , [[#include ]]) dnl We can avoid a lot of code by assuming that snprintf's return value dnl conforms to ISO C99. So check that. AC_REQUIRE([gl_SNPRINTF_RETVAL_C99]) case "$gl_cv_func_snprintf_retval_c99" in *yes) AC_DEFINE([HAVE_SNPRINTF_RETVAL_C99], [1], [Define if the return value of the snprintf function is the number of of bytes (excluding the terminating NUL) that would have been produced if the buffer had been large enough.]) ;; esac dnl Additionally, the use of %n can be eliminated by assuming that snprintf dnl always produces NUL-terminated strings (no truncation). AC_REQUIRE([gl_SNPRINTF_TRUNCATION_C99]) case "$gl_cv_func_snprintf_truncation_c99" in *yes) AC_DEFINE([HAVE_SNPRINTF_TRUNCATION_C99], [1], [Define if the string produced by the snprintf function is always NUL terminated.]) ;; esac gl_PREREQ_VASNXPRINTF ]) # Prerequisites of lib/vasnwprintf.c. AC_DEFUN_ONCE([gl_PREREQ_VASNWPRINTF], [ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CHECK_FUNCS_ONCE([swprintf wcsnlen mbrtowc]) AC_CHECK_DECLS([_snwprintf], , , [[#include ]]) AC_CHECK_DECLS([wcsnlen], , , [[#include ]]) gl_SWPRINTF_WORKS case "$gl_cv_func_swprintf_works" in *yes) AC_DEFINE([HAVE_WORKING_SWPRINTF], [1], [Define if the swprintf function works correctly when it produces output that contains null wide characters.]) ;; esac gl_MBRTOWC_C_LOCALE case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in *yes) AC_CACHE_CHECK([whether swprintf in the C locale is free of encoding errors], [gl_cv_func_swprintf_C_locale_sans_EILSEQ], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #ifndef __USE_MINGW_ANSI_STDIO # define __USE_MINGW_ANSI_STDIO 1 #endif #include #include int main() { int result = 0; { /* This test fails on glibc 2.35, musl libc 1.2.4, FreeBSD 13.2, NetBSD 9.3, OpenBSD 7.2, Cygwin 2.9.0. Reported at . */ wchar_t buf[12]; int ret = swprintf (buf, 12, L"%c", '\377'); if (ret < 0) result |= 1; } return result; }]])], [gl_cv_func_swprintf_C_locale_sans_EILSEQ=yes], [gl_cv_func_swprintf_C_locale_sans_EILSEQ=no], [case "$host_os" in # Guess no on glibc systems. *-gnu* | gnu*) gl_cv_func_swprintf_C_locale_sans_EILSEQ="guessing yes";; # Guess no on musl systems. *-musl* | midipix*) gl_cv_func_swprintf_C_locale_sans_EILSEQ="guessing no";; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_swprintf_C_locale_sans_EILSEQ="$gl_cross_guess_normal";; esac ]) ]) ;; esac if case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in *yes) false ;; *) true ;; esac \ || case "$gl_cv_func_swprintf_C_locale_sans_EILSEQ" in *yes) false ;; *) true ;; esac; then AC_DEFINE([NEED_WPRINTF_DIRECTIVE_C], [1], [Define if the vasnwprintf implementation needs special code for the 'c' directive.]) fi gl_SWPRINTF_DIRECTIVE_LA case "$gl_cv_func_swprintf_directive_la" in *yes) ;; *) AC_DEFINE([NEED_WPRINTF_DIRECTIVE_LA], [1], [Define if the vasnwprintf implementation needs special code for the 'a' directive with 'long double' arguments.]) ;; esac gl_SWPRINTF_DIRECTIVE_LC case "$gl_cv_func_swprintf_directive_lc" in *yes) ;; *) AC_DEFINE([NEED_WPRINTF_DIRECTIVE_LC], [1], [Define if the vasnwprintf implementation needs special code for the 'lc' directive.]) ;; esac gl_MUSL_LIBC gl_PREREQ_VASNXPRINTF ]) # Common prerequisites of lib/vasnprintf.c and lib/vasnwprintf.c. AC_DEFUN_ONCE([gl_PREREQ_VASNXPRINTF], [ AC_REQUIRE([AC_FUNC_ALLOCA]) AC_REQUIRE([gt_TYPE_WINT_T]) AC_CHECK_FUNCS([wcslen]) dnl Knowing DBL_EXPBIT0_WORD and DBL_EXPBIT0_BIT enables an optimization dnl in the code for NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE. AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION]) ]) # Extra prerequisites of lib/vasnprintf.c for supporting 'long double' # arguments. AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF_LONG_DOUBLE], [ AC_REQUIRE([gl_PRINTF_LONG_DOUBLE]) case "$gl_cv_func_printf_long_double" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'long double' arguments.]) ;; esac ]) # Extra prerequisites of lib/vasnprintf.c for supporting infinite 'double' # arguments. AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE], [ AC_REQUIRE([gl_PRINTF_INFINITE]) case "$gl_cv_func_printf_infinite" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for infinite 'double' arguments.]) ;; esac ]) # Extra prerequisites of lib/vasnprintf.c for supporting infinite 'long double' # arguments. AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE], [ AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE]) dnl There is no need to set NEED_PRINTF_INFINITE_LONG_DOUBLE if dnl NEED_PRINTF_LONG_DOUBLE is already set. AC_REQUIRE([gl_PREREQ_VASNPRINTF_LONG_DOUBLE]) case "$gl_cv_func_printf_long_double" in *yes) case "$gl_cv_func_printf_infinite_long_double" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for infinite 'long double' arguments.]) ;; esac ;; esac ]) # Extra prerequisites of lib/vasnprintf.c for supporting the 'a' directive. AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_A], [ AC_REQUIRE([gl_PRINTF_DIRECTIVE_A]) case "$gl_cv_func_printf_directive_a" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], [1], [Define if the vasnprintf implementation needs special code for the 'a' and 'A' directives.]) gl_CHECK_FUNCS_ANDROID([nl_langinfo], [[#include ]]) ;; esac ]) # Extra prerequisites of lib/vasnprintf.c for supporting the 'b' directive. AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_B], [ AC_REQUIRE([gl_PRINTF_DIRECTIVE_B]) case "$gl_cv_func_printf_directive_b" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_DIRECTIVE_B], [1], [Define if the vasnprintf implementation needs special code for the 'b' directive.]) ;; esac ]) # Extra prerequisites of lib/vasnprintf.c for supporting the 'F' directive. AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_F], [ AC_REQUIRE([gl_PRINTF_DIRECTIVE_F]) case "$gl_cv_func_printf_directive_f" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], [1], [Define if the vasnprintf implementation needs special code for the 'F' directive.]) ;; esac ]) # Extra prerequisites of lib/vasnprintf.c for supporting the 'ls' directive. AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_LS], [ AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS]) case "$gl_cv_func_printf_directive_ls" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_DIRECTIVE_LS], [1], [Define if the vasnprintf implementation needs special code for the 'ls' directive.]) ;; esac ]) # Extra prerequisites of lib/vasnprintf.c for supporting the 'lc' directive. AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_LC], [ AC_REQUIRE([gl_PRINTF_DIRECTIVE_LC]) case "$gl_cv_func_printf_directive_lc" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_DIRECTIVE_LC], [1], [Define if the vasnprintf implementation needs special code for the 'lc' directive.]) ;; esac ]) # Extra prerequisites of lib/vasnprintf.c for supporting the ' flag. AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_PRINTF_FLAG_GROUPING]) AC_REQUIRE([gl_PRINTF_FLAG_GROUPING_INT_PRECISION]) AC_REQUIRE([gl_PRINTF_FLAG_GROUPING_MULTIBYTE]) case "$host_os" in mingw* | windows*) dnl MSVC does not support the ' flag at all. dnl mingw does not support it, unless __USE_MINGW_ANSI_STDIO is defined. dnl mingw also has other bugs regarding the ' flag. AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], [1], [Define if the vasnprintf implementation needs special code for the ' flag.]) ;; *) case "$gl_cv_func_printf_flag_grouping,$gl_cv_func_printf_flag_grouping_multibyte" in *yes,*yes) case "$gl_cv_func_printf_flag_grouping_int_precision" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_FLAG_GROUPING_INT], [1], [Define if the vasnprintf implementation needs special code for the ' flag, for integer directives only.]) ;; esac ;; *) AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], [1], [Define if the vasnprintf implementation needs special code for the ' flag.]) ;; esac ;; esac ]) # Extra prerequisites of lib/vasnprintf.c for supporting the '-' flag. AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST], [ AC_REQUIRE([gl_PRINTF_FLAG_LEFTADJUST]) case "$gl_cv_func_printf_flag_leftadjust" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], [1], [Define if the vasnprintf implementation needs special code for the '-' flag.]) ;; esac ]) # Extra prerequisites of lib/vasnprintf.c for supporting the 0 flag. AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO], [ AC_REQUIRE([gl_PRINTF_FLAG_ZERO]) case "$gl_cv_func_printf_flag_zero" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_FLAG_ZERO], [1], [Define if the vasnprintf implementation needs special code for the 0 flag.]) ;; esac ]) # Extra prerequisites of lib/vasnprintf.c for supporting the # flag with a # zero precision and a zero value in the 'x' and 'X' directives. AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ALT_PRECISION_ZERO], [ AC_REQUIRE([gl_PRINTF_FLAG_ALT_PRECISION_ZERO]) case "$gl_cv_func_printf_flag_alt_precision_zero" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_FLAG_ALT_PRECISION_ZERO], [1], [Define if the vasnprintf implementation needs special code for the # flag with a zero precision and a zero value in the 'x' and 'X' directives.]) ;; esac ]) # Extra prerequisites of lib/vasnprintf.c for supporting large precisions. AC_DEFUN([gl_PREREQ_VASNPRINTF_PRECISION], [ AC_REQUIRE([gl_PRINTF_PRECISION]) case "$gl_cv_func_printf_precision" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], [1], [Define if the vasnprintf implementation needs special code for supporting large precisions without arbitrary bounds.]) AC_DEFINE([NEED_PRINTF_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'double' arguments.]) AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'long double' arguments.]) ;; esac ]) # Extra prerequisites of lib/vasnprintf.c for surviving out-of-memory # conditions. AC_DEFUN([gl_PREREQ_VASNPRINTF_ENOMEM], [ AC_REQUIRE([gl_PRINTF_ENOMEM]) case "$gl_cv_func_printf_enomem" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_ENOMEM], [1], [Define if the vasnprintf implementation needs special code for surviving out-of-memory conditions.]) AC_DEFINE([NEED_PRINTF_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'double' arguments.]) AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'long double' arguments.]) ;; esac ]) # Prerequisites of lib/vasnprintf.c including all extras for POSIX compliance. AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS], [ AC_REQUIRE([gl_PREREQ_VASNPRINTF]) gl_PREREQ_VASNPRINTF_LONG_DOUBLE gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE gl_PREREQ_VASNPRINTF_DIRECTIVE_A gl_PREREQ_VASNPRINTF_DIRECTIVE_B gl_PREREQ_VASNPRINTF_DIRECTIVE_F gl_PREREQ_VASNPRINTF_DIRECTIVE_LS gl_PREREQ_VASNPRINTF_DIRECTIVE_LC gl_PREREQ_VASNPRINTF_FLAG_GROUPING gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST gl_PREREQ_VASNPRINTF_FLAG_ZERO gl_PREREQ_VASNPRINTF_FLAG_ALT_PRECISION_ZERO gl_PREREQ_VASNPRINTF_PRECISION gl_PREREQ_VASNPRINTF_ENOMEM ]) # Extra prerequisites of lib/vasnprintf.c for supporting the 'B' directive. AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_UPPERCASE_B], [ AC_REQUIRE([gl_PRINTF_DIRECTIVE_UPPERCASE_B]) case "$gl_cv_func_printf_directive_uppercase_b" in *yes) ;; *) AC_DEFINE([NEED_PRINTF_DIRECTIVE_UPPERCASE_B], [1], [Define if the vasnprintf implementation needs special code for the 'B' directive.]) ;; esac ]) # Prerequisites of lib/vasnprintf.c including all extras for POSIX compliance # and GNU compatibility. AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS], [ gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS AC_DEFINE([SUPPORT_GNU_PRINTF_DIRECTIVES], [1], [Define if the vasnprintf implementation should support GNU compatible printf directives.]) gl_PREREQ_VASNPRINTF_DIRECTIVE_UPPERCASE_B ]) # Prerequisites of lib/asnprintf.c. # Prerequisites of lib/asnwprintf.c. AC_DEFUN([gl_PREREQ_ASNPRINTF], [ ]) groff-1.24.1/gnulib_m4/wctype_h.m40000644000175000017500000001506115153275164013603 00000000000000# wctype_h.m4 # serial 33 dnl A placeholder for ISO C99 , for platforms that lack it. dnl Copyright (C) 2006-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl Written by Paul Eggert. AC_DEFUN_ONCE([gl_WCTYPE_H], [ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_CHECK_FUNCS_ONCE([iswcntrl]) if test $ac_cv_func_iswcntrl = yes; then HAVE_ISWCNTRL=1 else HAVE_ISWCNTRL=0 fi AC_SUBST([HAVE_ISWCNTRL]) AC_REQUIRE([gt_TYPE_WINT_T]) if test $gt_cv_c_wint_t = yes; then HAVE_WINT_T=1 else HAVE_WINT_T=0 fi AC_SUBST([HAVE_WINT_T]) AC_REQUIRE([gl_TYPE_WINT_T_PREREQ]) gl_CHECK_NEXT_HEADERS([wctype.h]) if test $ac_cv_header_wctype_h = yes; then if test $ac_cv_func_iswcntrl = yes; then dnl Linux libc5 has an iswprint function that returns 0 for all arguments. dnl The other functions are likely broken in the same way. AC_CACHE_CHECK([whether iswcntrl works], [gl_cv_func_iswcntrl_works], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include int main () { return iswprint ('x') == 0; } ]])], [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no], [dnl Guess no on Linux libc5, yes otherwise. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #if __GNU_LIBRARY__ == 1 Linux libc5 i18n is broken. #endif]], [[]])], [gl_cv_func_iswcntrl_works="guessing yes"], [gl_cv_func_iswcntrl_works="guessing no"]) ]) ]) fi HAVE_WCTYPE_H=1 else HAVE_WCTYPE_H=0 fi AC_SUBST([HAVE_WCTYPE_H]) if test $GNULIBHEADERS_OVERRIDE_WINT_T = 1; then REPLACE_ISWCNTRL=1 else case "$gl_cv_func_iswcntrl_works" in *yes) REPLACE_ISWCNTRL=0 ;; *) REPLACE_ISWCNTRL=1 ;; esac fi AC_SUBST([REPLACE_ISWCNTRL]) if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then dnl Redefine all of iswcntrl, ..., iswxdigit in . : fi if test $REPLACE_ISWCNTRL = 1; then REPLACE_TOWLOWER=1 else AC_CHECK_FUNCS([towlower]) if test $ac_cv_func_towlower = yes; then REPLACE_TOWLOWER=0 else AC_CHECK_DECLS([towlower],,, [[#include #if HAVE_WCTYPE_H # include #endif ]]) if test $ac_cv_have_decl_towlower = yes; then dnl On Minix 3.1.8, the system's declares towlower() and dnl towupper() although it does not have the functions. Avoid a dnl collision with gnulib's replacement. REPLACE_TOWLOWER=1 else REPLACE_TOWLOWER=0 fi fi fi AC_SUBST([REPLACE_TOWLOWER]) if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then dnl Redefine towlower, towupper in . : fi dnl We assume that the wctype() and iswctype() functions exist if and only dnl if the type wctype_t is defined in or in if that dnl exists. dnl HP-UX 11.00 declares all these in and lacks . AC_CACHE_CHECK([for wctype_t], [gl_cv_type_wctype_t], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include #if HAVE_WCTYPE_H # include #endif wctype_t a; ]], [[]])], [gl_cv_type_wctype_t=yes], [gl_cv_type_wctype_t=no]) ]) if test $gl_cv_type_wctype_t = no; then HAVE_WCTYPE_T=0 fi dnl We assume that the wctrans() and towctrans() functions exist if and only dnl if the type wctrans_t is defined in . AC_CACHE_CHECK([for wctrans_t], [gl_cv_type_wctrans_t], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include #include wctrans_t a; ]], [[]])], [gl_cv_type_wctrans_t=yes], [gl_cv_type_wctrans_t=no]) ]) if test $gl_cv_type_wctrans_t = no; then HAVE_WCTRANS_T=0 fi dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[ #if !(defined __GLIBC__ && !defined __UCLIBC__) # include #endif #include ]], [wctype iswctype wctrans towctrans ]) ]) # gl_WCTYPE_MODULE_INDICATOR([modulename]) # sets the shell variable that indicates the presence of the given module # to a C preprocessor expression that will evaluate to 1. # This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_WCTYPE_MODULE_INDICATOR], [ dnl Ensure to expand the default settings once only. gl_WCTYPE_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) # Initializes the default values for AC_SUBSTed shell variables. # This macro must not be AC_REQUIREd. It must only be invoked, and only # outside of macros or in macros that are not AC_REQUIREd. AC_DEFUN([gl_WCTYPE_H_REQUIRE_DEFAULTS], [ m4_defun(GL_MODULE_INDICATOR_PREFIX[_WCTYPE_H_MODULE_INDICATOR_DEFAULTS], [ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWBLANK]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWDIGIT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWPUNCT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWXDIGIT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTYPE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWCTYPE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTRANS]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOWCTRANS]) ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_WCTYPE_H_MODULE_INDICATOR_DEFAULTS]) AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) ]) AC_DEFUN([gl_WCTYPE_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. HAVE_ISWBLANK=1; AC_SUBST([HAVE_ISWBLANK]) HAVE_WCTYPE_T=1; AC_SUBST([HAVE_WCTYPE_T]) HAVE_WCTRANS_T=1; AC_SUBST([HAVE_WCTRANS_T]) REPLACE_ISWBLANK=0; AC_SUBST([REPLACE_ISWBLANK]) REPLACE_ISWDIGIT=0; AC_SUBST([REPLACE_ISWDIGIT]) REPLACE_ISWPUNCT=0; AC_SUBST([REPLACE_ISWPUNCT]) REPLACE_ISWXDIGIT=0; AC_SUBST([REPLACE_ISWXDIGIT]) REPLACE_WCTRANS=0; AC_SUBST([REPLACE_WCTRANS]) REPLACE_WCTYPE=0; AC_SUBST([REPLACE_WCTYPE]) ]) groff-1.24.1/gnulib_m4/sys_types_h.m40000644000175000017500000000523715153275164014336 00000000000000# sys_types_h.m4 # serial 15 dnl Copyright (C) 2011-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN_ONCE([gl_SYS_TYPES_H], [ AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS]) dnl Use sane struct stat types in OpenVMS 8.2 and later. AC_DEFINE([_USE_STD_STAT], 1, [For standard stat data types on VMS.]) gl_NEXT_HEADERS([sys/types.h]) dnl Ensure the type pid_t gets defined. AC_REQUIRE([AC_TYPE_PID_T]) dnl Ensure the type mode_t gets defined. AC_REQUIRE([AC_TYPE_MODE_T]) dnl Whether to override the 'off_t' type. AC_REQUIRE([gl_TYPE_OFF_T]) dnl Whether to define the 'off64_t' type. AC_REQUIRE([gl_TYPE_OFF64_T]) dnl Whether to override the 'dev_t' and 'ino_t' types. m4_ifdef([gl_WINDOWS_STAT_INODES], [ AC_REQUIRE([gl_WINDOWS_STAT_INODES]) ], [ WINDOWS_STAT_INODES=0 ]) AC_SUBST([WINDOWS_STAT_INODES]) dnl Test whether the 'blksize_t' type is defined. AC_CHECK_TYPE([blksize_t], [HAVE_BLKSIZE_T=1], [HAVE_BLKSIZE_T=0]) AC_SUBST([HAVE_BLKSIZE_T]) dnl Test whether the 'blkcnt_t' type is defined. AC_CHECK_TYPE([blkcnt_t], [HAVE_BLKCNT_T=1], [HAVE_BLKCNT_T=0]) AC_SUBST([HAVE_BLKCNT_T]) ]) # Initializes the default values for AC_SUBSTed shell variables. # This macro must not be AC_REQUIREd. It must only be invoked, and only # outside of macros or in macros that are not AC_REQUIREd. AC_DEFUN([gl_SYS_TYPES_H_REQUIRE_DEFAULTS], [ m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_TYPE_H_MODULE_INDICATOR_DEFAULTS], [ ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_TYPE_H_MODULE_INDICATOR_DEFAULTS]) AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS]) ]) AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS], [ ]) # This works around a buggy version in autoconf <= 2.69. # See # The 2.70 version isn't quoted properly, so override it too. m4_version_prereq([2.70.1], [], [ m4_undefine([AC_HEADER_MAJOR]) AC_DEFUN([AC_HEADER_MAJOR], [AC_CHECK_HEADERS_ONCE([sys/types.h]) AC_CHECK_HEADER([sys/mkdev.h], [AC_DEFINE([MAJOR_IN_MKDEV], [1], [Define to 1 if `major', `minor', and `makedev' are declared in .])]) if test $ac_cv_header_sys_mkdev_h = no; then AC_CHECK_HEADER([sys/sysmacros.h], [AC_DEFINE([MAJOR_IN_SYSMACROS], [1], [Define to 1 if `major', `minor', and `makedev' are declared in .])]) fi ])# AC_HEADER_MAJOR ]) groff-1.24.1/gnulib_m4/locale-ja.m40000644000175000017500000001375015153275164013613 00000000000000# locale-ja.m4 # serial 21 dnl Copyright (C) 2003, 2005-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Bruno Haible. dnl Determine the name of a japanese locale with EUC-JP encoding. AC_DEFUN_ONCE([gt_LOCALE_JA], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AM_LANGINFO_CODESET]) AC_CACHE_CHECK([for a traditional japanese locale], [gt_cv_locale_ja], [ AC_LANG_CONFTEST([AC_LANG_SOURCE([[ #include #include #if HAVE_LANGINFO_CODESET # include #endif #include #include struct tm t; char buf[16]; int main () { /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl imitates locale dependent behaviour by looking at the environment variables, and all locales use the UTF-8 encoding. */ #if defined __BEOS__ || defined __HAIKU__ return 1; #else /* Check whether the given locale name is recognized by the system. */ # if defined _WIN32 && !defined __CYGWIN__ /* On native Windows, setlocale(category, "") looks at the system settings, not at the environment variables. Also, when an encoding suffix such as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE category of the locale to "C". */ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) return 1; # else if (setlocale (LC_ALL, "") == NULL) return 1; # endif /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) is empty, and the behaviour of Tcl 8.4 in this locale is not useful. On OpenBSD 4.0, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "646". In this situation, some unit tests fail. On MirBSD 10, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "UTF-8". */ # if HAVE_LANGINFO_CODESET { const char *cs = nl_langinfo (CODESET); if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 || strcmp (cs, "UTF-8") == 0) return 1; } # endif # ifdef __CYGWIN__ /* On Cygwin, avoid locale names without encoding suffix, because the locale_charset() function relies on the encoding suffix. Note that LC_ALL is set on the command line. */ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; # endif /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales on Cygwin 1.5.x. */ if (MB_CUR_MAX == 1) return 1; /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. This excludes the UTF-8 encoding (except on MirBSD). */ { const char *p; t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; for (p = buf; *p != '\0'; p++) if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) return 1; } return 0; #endif } ]])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then case "$host_os" in # Handle native Windows specially, because there setlocale() interprets # "ar" or "ara" as "Arabic" or "Arabic_Saudi Arabia.1256", # "en" or "eng" as "English" or "English_United States.1252", # "fr" or "fra" as "French" or "French_France.1252", # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", # "ja" or "jpn" as "Japanese" or "Japanese_Japan.932", # and similar. mingw* | windows*) # Note that on native Windows, the Japanese locale is # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we # cannot use it here. gt_cv_locale_ja=none ;; *) # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the # configure script would override the LC_ALL setting. Likewise for # LC_CTYPE, which is also set at the beginning of the configure script. # Test for the AIX locale name. if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_ja=ja_JP else # Test for the locale name with explicit encoding suffix. if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_ja=ja_JP.EUC-JP else # Test for the HP-UX, NetBSD locale name. if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_ja=ja_JP.eucJP else # Test for the FreeBSD locale name. if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_ja=ja_JP.EUC else # Test for the Solaris 10 locale name. if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_ja=ja else # Special test for NetBSD 1.6. if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then gt_cv_locale_ja=ja_JP.eucJP else # None found. gt_cv_locale_ja=none fi fi fi fi fi fi ;; esac fi rm -fr conftest* ]) LOCALE_JA=$gt_cv_locale_ja case $LOCALE_JA in #( '' | *[[[:space:]\"\$\'*@<:@]]*) dnl This locale name might cause trouble with sh or make. AC_MSG_WARN([invalid locale "$LOCALE_JA"; assuming "none"]) LOCALE_JA=none;; esac AC_SUBST([LOCALE_JA]) ]) groff-1.24.1/gnulib_m4/strcasecmp.m40000644000175000017500000000336215153275164014126 00000000000000# strcasecmp.m4 # serial 3 dnl Copyright (C) 2002-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_STRCASECMP], [ AC_REQUIRE([gl_STRINGS_H_DEFAULTS]) AC_CHECK_FUNCS([strcasecmp]) if test $ac_cv_func_strcasecmp = yes; then gl_STRCASECMP_WORKS case "$gl_cv_func_strcasecmp_works" in *yes) ;; *) REPLACE_STRCASECMP=1 ;; esac else HAVE_STRCASECMP=0 fi ]) AC_DEFUN([gl_STRCASECMP_WORKS], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([whether strcasecmp works], [gl_cv_func_strcasecmp_works], [dnl Prepare a guess, used when cross-compiling or when specific locales dnl are not available. case "$host_os" in solaris* | cygwin*) gl_cv_func_strcasecmp_works="guessing no" ;; *) gl_cv_func_strcasecmp_works="guessing yes" ;; esac AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include #include int main () { if (setlocale (LC_ALL, "fr_FR.ISO-8859-1") != NULL || setlocale (LC_ALL, "fr_FR.ISO8859-1") != NULL) { int c1 = (unsigned char) '\311'; int c2 = (unsigned char) '\351'; if (tolower (c1) == c2 && toupper (c2) == c1) return strcasecmp ("Fej\311r", "Fej\351r") != 0; } return 2; }]])], [gl_cv_func_strcasecmp_works=yes], [if test $? = 1; then gl_cv_func_strcasecmp_works=no fi ], [:]) ]) ]) # Prerequisites of lib/strcasecmp.c. AC_DEFUN([gl_PREREQ_STRCASECMP], [ : ]) groff-1.24.1/gnulib_m4/string_h.m40000644000175000017500000002037415153275164013601 00000000000000# string_h.m4 # serial 46 dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. # Configure a GNU-like replacement for . # Written by Paul Eggert. AC_DEFUN_ONCE([gl_STRING_H], [ dnl Ensure to expand the default settings once only, before all statements dnl that occur in other macros. AC_REQUIRE([gl_STRING_H_DEFAULTS]) gl_NEXT_HEADERS([string.h]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use, and which is not dnl guaranteed by C89. gl_WARN_ON_USE_PREPARE([[#include ]], [explicit_bzero ffsl ffsll memmem mempcpy memrchr memset_explicit rawmemchr stpcpy stpncpy strchrnul strdup strncat strncpy strndup strnlen strpbrk strsep strcasestr strtok_r strerror_l strerror_r strerrorname_np sigabbrev_np sigdescr_np strsignal strverscmp]) AC_REQUIRE([AC_C_RESTRICT]) ]) # gl_STRING_MODULE_INDICATOR([modulename]) # sets the shell variable that indicates the presence of the given module # to a C preprocessor expression that will evaluate to 1. # This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_STRING_MODULE_INDICATOR], [ dnl Ensure to expand the default settings once only. gl_STRING_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) # Initializes the default values for AC_SUBSTed shell variables. # This macro must not be AC_REQUIREd. It must only be invoked, and only # outside of macros or in macros that are not AC_REQUIREd. AC_DEFUN([gl_STRING_H_REQUIRE_DEFAULTS], [ m4_defun(GL_MODULE_INDICATOR_PREFIX[_STRING_H_MODULE_INDICATOR_DEFAULTS], [ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPLICIT_BZERO]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFSL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFSLL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMCHR]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMMEM]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMPCPY]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMRCHR]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMSET_EXPLICIT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RAWMEMCHR]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STPCPY]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STPNCPY]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRCHRNUL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRDUP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRINGEQ]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRNCAT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRNCPY]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRNDUP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRNLEN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRPBRK]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRSEP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRSTR]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRCASESTR]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOK_R]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STR_STARTSWITH]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STR_ENDSWITH]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSLEN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSNLEN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCHR]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSRCHR]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSSTR]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCASECMP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSNCASECMP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSPCASECMP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCASESTR]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCSPN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSPBRK]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSSPN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSSEP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSTOK_R]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBS_STARTSWITH]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBS_ENDSWITH]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERROR]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERROR_R]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERROR_L]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERRORNAME_NP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGABBREV_NP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGDESCR_NP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRSIGNAL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRVERSCMP]) dnl Support Microsoft deprecated alias function names by default. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_MEMCCPY], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_STRDUP], [1]) ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_STRING_H_MODULE_INDICATOR_DEFAULTS]) dnl Make sure the shell variable for GNULIB_FREE_POSIX is initialized. gl_STDLIB_H_REQUIRE_DEFAULTS AC_REQUIRE([gl_STRING_H_DEFAULTS]) ]) AC_DEFUN([gl_STRING_H_DEFAULTS], [ HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_EXPLICIT_BZERO=1; AC_SUBST([HAVE_EXPLICIT_BZERO]) HAVE_FFSL=1; AC_SUBST([HAVE_FFSL]) HAVE_FFSLL=1; AC_SUBST([HAVE_FFSLL]) HAVE_DECL_MEMEQ=0; AC_SUBST([HAVE_DECL_MEMEQ]) HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM]) HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY]) HAVE_MEMSET_EXPLICIT=1; AC_SUBST([HAVE_MEMSET_EXPLICIT]) HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR]) HAVE_RAWMEMCHR=1; AC_SUBST([HAVE_RAWMEMCHR]) HAVE_STPCPY=1; AC_SUBST([HAVE_STPCPY]) HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY]) HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL]) HAVE_DECL_STRDUP=1; AC_SUBST([HAVE_DECL_STRDUP]) HAVE_DECL_STREQ=0; AC_SUBST([HAVE_DECL_STREQ]) HAVE_DECL_STRNDUP=1; AC_SUBST([HAVE_DECL_STRNDUP]) HAVE_DECL_STRNLEN=1; AC_SUBST([HAVE_DECL_STRNLEN]) HAVE_STRPBRK=1; AC_SUBST([HAVE_STRPBRK]) HAVE_STRSEP=1; AC_SUBST([HAVE_STRSEP]) HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR]) HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R]) HAVE_DECL_STRERROR_R=1; AC_SUBST([HAVE_DECL_STRERROR_R]) HAVE_STRERROR_L=1; AC_SUBST([HAVE_STRERROR_L]) HAVE_STRERRORNAME_NP=1; AC_SUBST([HAVE_STRERRORNAME_NP]) HAVE_SIGABBREV_NP=1; AC_SUBST([HAVE_SIGABBREV_NP]) HAVE_SIGDESCR_NP=1; AC_SUBST([HAVE_SIGDESCR_NP]) HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL]) HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP]) REPLACE_FFSLL=0; AC_SUBST([REPLACE_FFSLL]) REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR]) REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM]) REPLACE_MEMPCPY=0; AC_SUBST([REPLACE_MEMPCPY]) REPLACE_MEMSET_EXPLICIT=0; AC_SUBST([REPLACE_MEMSET_EXPLICIT]) REPLACE_STPCPY=0; AC_SUBST([REPLACE_STPCPY]) REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY]) REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL]) REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP]) REPLACE_STRNCAT=0; AC_SUBST([REPLACE_STRNCAT]) REPLACE_STRNCPY=0; AC_SUBST([REPLACE_STRNCPY]) REPLACE_STRNDUP=0; AC_SUBST([REPLACE_STRNDUP]) REPLACE_STRNLEN=0; AC_SUBST([REPLACE_STRNLEN]) REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR]) REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR]) REPLACE_STRTOK_R=0; AC_SUBST([REPLACE_STRTOK_R]) REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR]) REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R]) REPLACE_STRERROR_L=0; AC_SUBST([REPLACE_STRERROR_L]) REPLACE_STRERRORNAME_NP=0; AC_SUBST([REPLACE_STRERRORNAME_NP]) REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL]) REPLACE_STRVERSCMP=0; AC_SUBST([REPLACE_STRVERSCMP]) UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R]) ]) groff-1.24.1/gnulib_m4/extensions-aix.m40000644000175000017500000000236215153275164014737 00000000000000# extensions-aix.m4 # serial 1 dnl Copyright (C) 2024-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. # On AIX, most extensions are already enabled through the _ALL_SOURCE macro, # defined by gl_USE_SYSTEM_EXTENSIONS. gl_USE_AIX_EXTENSIONS additionally # activates more GNU and Linux-like behaviours, affecting # - the time_t type, # - errno values in : ENOTEMPTY # - functions in : malloc calloc realloc valloc # # - functions in : strerror_r (returns 'char *', like glibc) # - functions in : scandir, alphasort, readdir_r # - functions in : gethostbyname_r gethostbyaddr_r # - declarations in : sbrk # and a couple of secondary header files. AC_DEFUN_ONCE([gl_USE_AIX_EXTENSIONS], [ AC_DEFINE([_LINUX_SOURCE_COMPAT], [1], [Define so that AIX headers are more compatible with GNU/Linux.]) ]) groff-1.24.1/gnulib_m4/gnulib-common.m40000644000175000017500000021526515153275164014537 00000000000000# gnulib-common.m4 # serial 115 dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_PREREQ([2.62]) # gl_COMMON # is expanded unconditionally through gnulib-tool magic. AC_DEFUN([gl_COMMON], [ dnl Use AC_REQUIRE here, so that the code is expanded once only. AC_REQUIRE([gl_00GNULIB]) AC_REQUIRE([gl_COMMON_BODY]) AC_REQUIRE([gl_ZZGNULIB]) ]) AC_DEFUN([gl_COMMON_BODY], [ AH_VERBATIM([0witness], [/* Witness that has been included. */ #define _GL_CONFIG_H_INCLUDED 1 ]) dnl Avoid warnings from gcc -Wtrailing-whitespace. dnl This is a temporary workaround until Autoconf fixes it. dnl Test case: dnl empty1=; empty2=; AC_DEFINE_UNQUOTED([FOO], [$empty1$empty2], [...]) dnl should produce "#define FOO /**/", not "#define FOO ". AH_TOP([#if defined __GNUC__ && __GNUC__ >= 15 && !defined __clang__ # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wtrailing-whitespace" #endif ]) AH_BOTTOM([#if defined __GNUC__ && __GNUC__ >= 15 && !defined __clang__ # pragma GCC diagnostic pop #endif ]) AH_VERBATIM([_GL_GNUC_PREREQ], [/* True if the compiler says it groks GNU C version MAJOR.MINOR. Except that - clang groks GNU C 4.2, even on Windows, where it does not define __GNUC__. - The OpenMandriva-modified clang compiler pretends that it groks GNU C version 13.1, but it doesn't: It does not support __attribute__ ((__malloc__ (f, i))), nor does it support __attribute__ ((__warning__ (message))) on a function redeclaration. - Users can make clang lie as well, through the -fgnuc-version option. */ #if defined __GNUC__ && defined __GNUC_MINOR__ && !defined __clang__ # define _GL_GNUC_PREREQ(major, minor) \ ((major) < __GNUC__ + ((minor) <= __GNUC_MINOR__)) #elif defined __clang__ /* clang really only groks GNU C 4.2. */ # define _GL_GNUC_PREREQ(major, minor) \ ((major) < 4 + ((minor) <= 2)) #else # define _GL_GNUC_PREREQ(major, minor) 0 #endif ]) AH_VERBATIM([_Noreturn], [/* The _Noreturn keyword of C11. Do not use [[noreturn]], because with it the syntax extern _Noreturn void func (...); would not be valid; such a declaration would be valid only with 'extern' and '_Noreturn' swapped, or without the 'extern' keyword. However, some AIX system header files and several gnulib header files use precisely this syntax with 'extern'. So even though C23 deprecates _Noreturn, it is currently more portable to prefer it to [[noreturn]]. Also, do not try to work around LLVM bug 59792 (clang 15 or earlier). This rare bug can be worked around by compiling with 'clang -D_Noreturn=', though the workaround may generate many false-alarm warnings. */ #ifndef _Noreturn # if ((!defined __cplusplus || defined __clang__) \ && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0))) /* _Noreturn works as-is. */ # elif _GL_GNUC_PREREQ (2, 8) || defined __clang__ || 0x5110 <= __SUNPRO_C /* Prefer __attribute__ ((__noreturn__)) to plain _Noreturn even if the latter works, as 'gcc -std=gnu99 -Wpedantic' warns about _Noreturn. */ # define _Noreturn __attribute__ ((__noreturn__)) # elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0) # define _Noreturn __declspec (noreturn) # else # define _Noreturn # endif #endif ]) AH_VERBATIM([isoc99_inline], [/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of earlier versions), but does not display it by setting __GNUC_STDC_INLINE__. __APPLE__ && __MACH__ test for Mac OS X. __APPLE_CC__ tests for the Apple compiler and its version. __STDC_VERSION__ tests for the C99 mode. */ #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ # define __GNUC_STDC_INLINE__ 1 #endif]) AH_VERBATIM([attribute], [/* Attributes. */ /* Define _GL_HAS_ATTRIBUTE only once, because on FreeBSD, with gcc < 5, if gets included once again after , __has_attribute(x) expands to 0 always, and redefining _GL_HAS_ATTRIBUTE would turn off all attributes. */ #ifndef _GL_HAS_ATTRIBUTE # if (defined __has_attribute \ && (!defined __clang_minor__ \ || (defined __apple_build_version__ \ ? 7000000 <= __apple_build_version__ \ : 5 <= __clang_major__))) # define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__) # else # define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr /* The following lines list the first GCC version that supports the attribute. Although the lines are not used in GCC 5 and later (as GCC 5 introduced __has_attribute support), list GCC versions 5+ anyway for completeness. */ # define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3) # define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2) # define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3) # define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3) # define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95) # define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1) # define _GL_ATTR_diagnose_if 0 # define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3) # define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1) # define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0) # define _GL_ATTR_format _GL_GNUC_PREREQ (2, 7) # define _GL_ATTR_leaf _GL_GNUC_PREREQ (4, 6) # define _GL_ATTR_malloc _GL_GNUC_PREREQ (3, 0) # ifdef _ICC # define _GL_ATTR_may_alias 0 # else # define _GL_ATTR_may_alias _GL_GNUC_PREREQ (3, 3) # endif # define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1) # define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3) # define _GL_ATTR_nonnull_if_nonzero _GL_GNUC_PREREQ (15, 1) # define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0) # define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3) # define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7) # define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96) # define _GL_ATTR_reproducible _GL_GNUC_PREREQ (15, 1) # define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9) # define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0) # define _GL_ATTR_unsequenced _GL_GNUC_PREREQ (15, 1) # define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7) # define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4) # endif #endif /* Use __has_c_attribute if available. However, do not use with pre-C23 GCC, which can issue false positives if -Wpedantic. */ #if (defined __has_c_attribute \ && ! (_GL_GNUC_PREREQ (4, 6) \ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) <= 201710)) # define _GL_HAVE___HAS_C_ATTRIBUTE 1 #else # define _GL_HAVE___HAS_C_ATTRIBUTE 0 #endif /* Attributes in bracket syntax [[...]] vs. attributes in __attribute__((...)) syntax, in function declarations. There are two problems here. (Last tested with gcc/g++ 14 and clang/clang++ 18.) 1) We want that the _GL_ATTRIBUTE_* can be cumulated on the same declaration in any order. =========================== foo.c = foo.cc =========================== __attribute__ ((__deprecated__)) [[__nodiscard__]] int bar1 (int); [[__nodiscard__]] __attribute__ ((__deprecated__)) int bar2 (int); ====================================================================== This gives a syntax error - in C mode with gcc , and - in C++ mode with clang++ version < 16, and - in C++ mode, inside extern "C" {}, still in newer clang++ versions . */ /* Define if, in a function declaration, the attributes in bracket syntax [[...]] must come before the attributes in __attribute__((...)) syntax. If this is defined, it is best to avoid the bracket syntax, so that the various _GL_ATTRIBUTE_* can be cumulated on the same declaration in any order. */ #ifdef __cplusplus # if defined __clang__ # define _GL_BRACKET_BEFORE_ATTRIBUTE 1 # endif #else # if defined __GNUC__ && !defined __clang__ # define _GL_BRACKET_BEFORE_ATTRIBUTE 1 # endif #endif /* 2) We want that the _GL_ATTRIBUTE_* can be placed in a declaration - without 'extern', in C as well as in C++, - with 'extern', in C, - with 'extern "C"', in C++ in the same position. That is, we don't want to be forced to use a macro which arranges for the attribute to come before 'extern' in one case and after 'extern' in the other case, because such a macro would make the source code of .h files pretty ugly. =========================== foo.c = foo.cc =========================== #ifdef __cplusplus # define CC "C" #else # define CC #endif #define ND [[__nodiscard__]] #define WUR __attribute__((__warn_unused_result__)) #ifdef __cplusplus extern "C" { #endif // gcc clang g++ clang++ ND int foo (int); int ND foo (int); // warn error warn error int foo ND (int); int foo (int) ND; // warn error warn error WUR int foo (int); int WUR foo (int); int fo1 WUR (int); // error error error error int foo (int) WUR; #ifdef __cplusplus } #endif // gcc clang g++ clang++ ND extern CC int foo (int); // error error extern CC ND int foo (int); // error error extern CC int ND foo (int); // warn error warn error extern CC int foo ND (int); extern CC int foo (int) ND; // warn error warn error WUR extern CC int foo (int); // warn extern CC WUR int foo (int); extern CC int WUR foo (int); extern CC int foo WUR (int); // error error error error extern CC int foo (int) WUR; ND EXTERN_C_FUNC int foo (int); // error error EXTERN_C_FUNC ND int foo (int); EXTERN_C_FUNC int ND foo (int); // warn error warn error EXTERN_C_FUNC int foo ND (int); EXTERN_C_FUNC int foo (int) ND; // warn error warn error WUR EXTERN_C_FUNC int foo (int); // warn EXTERN_C_FUNC WUR int foo (int); EXTERN_C_FUNC int WUR foo (int); EXTERN_C_FUNC int fo2 WUR (int); // error error error error EXTERN_C_FUNC int foo (int) WUR; ====================================================================== So, if we insist on using the 'extern' keyword ('extern CC' idiom): * If _GL_ATTRIBUTE_* expands to bracket syntax [[...]] in both C and C++, there is one available position: - between the function name and the parameter list. * If _GL_ATTRIBUTE_* expands to __attribute__((...)) syntax in both C and C++, there are several available positions: - before the return type, - between return type and function name, - at the end of the declaration. * If _GL_ATTRIBUTE_* expands to bracket syntax [[...]] in C and to __attribute__((...)) syntax in C++, there is no available position: it would need to come before 'extern' in C but after 'extern "C"' in C++. * If _GL_ATTRIBUTE_* expands to __attribute__((...)) syntax in C and to bracket syntax [[...]] in C++, there is one available position: - before the return type. Whereas, if we use the 'EXTERN_C_FUNC' idiom, which conditionally omits the 'extern' keyword: * If _GL_ATTRIBUTE_* expands to bracket syntax [[...]] in both C and C++, there are two available positions: - before the return type, - between the function name and the parameter list. * If _GL_ATTRIBUTE_* expands to __attribute__((...)) syntax in both C and C++, there are several available positions: - before the return type, - between return type and function name, - at the end of the declaration. * If _GL_ATTRIBUTE_* expands to bracket syntax [[...]] in C and to __attribute__((...)) syntax in C++, there is one available position: - before the return type. * If _GL_ATTRIBUTE_* expands to __attribute__((...)) syntax in C and to bracket syntax [[...]] in C++, there is one available position: - before the return type. The best choice is therefore to use the 'EXTERN_C_FUNC' idiom and put the attributes before the return type. This works regardless to what the _GL_ATTRIBUTE_* macros expand. */ /* Attributes in bracket syntax [[...]] vs. attributes in __attribute__((...)) syntax, in static/inline function definitions. There are similar constraints as for function declarations. However, here, we cannot omit the storage-class specifier. Therefore, the following rule applies: * The macros _GL_ATTRIBUTE_CONST _GL_ATTRIBUTE_DEPRECATED _GL_ATTRIBUTE_MAYBE_UNUSED _GL_ATTRIBUTE_NODISCARD _GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_REPRODUCIBLE _GL_ATTRIBUTE_UNSEQUENCED which may expand to bracket syntax [[...]], must come first, before the storage-class specifier. * Other _GL_ATTRIBUTE_* macros, that expand to __attribute__((...)) syntax, are better placed between the storage-class specifier and the return type. */ /* Attributes in bracket syntax [[...]] vs. attributes in __attribute__((...)) syntax, in variable declarations. At which position can they be placed? (Last tested with gcc/g++ 14 and clang/clang++ 18.) =========================== foo.c = foo.cc =========================== #ifdef __cplusplus # define CC "C" #else # define CC #endif #define BD [[__deprecated__]] #define AD __attribute__ ((__deprecated__)) // gcc clang g++ clang++ BD extern CC int var; // error error extern CC BD int var; // error error extern CC int BD var; // warn error warn error extern CC int var BD; AD extern CC int var; // warn extern CC AD int var; extern CC int AD var; extern CC int var AD; BD extern CC int z[]; // error error extern CC BD int z[]; // error error extern CC int BD z[]; // warn error warn error extern CC int z1 BD []; extern CC int z[] BD; // warn error error AD extern CC int z[]; // warn extern CC AD int z[]; extern CC int AD z[]; extern CC int z2 AD []; // error error error error extern CC int z[] AD; ====================================================================== * For non-array variables, the only good position is after the variable name, that is, at the end of the declaration. * For array variables, you will need to distinguish C and C++: - In C, before the 'extern' keyword. - In C++, between the 'extern "C"' and the variable's type. */ ]dnl There is no _GL_ATTRIBUTE_ALIGNED; use stdalign's alignas instead. [ /* _GL_ATTRIBUTE_ALLOC_SIZE ((N)) declares that the Nth argument of the function is the size of the returned memory block. _GL_ATTRIBUTE_ALLOC_SIZE ((M, N)) declares that the Mth argument multiplied by the Nth argument of the function is the size of the returned memory block. */ /* Applies to: functions, pointer to functions, function types. */ #ifndef _GL_ATTRIBUTE_ALLOC_SIZE # if _GL_HAS_ATTRIBUTE (alloc_size) # define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args)) # else # define _GL_ATTRIBUTE_ALLOC_SIZE(args) # endif #endif /* _GL_ATTRIBUTE_ALWAYS_INLINE tells that the compiler should always inline the function and report an error if it cannot do so. */ /* Applies to: functions. */ #ifndef _GL_ATTRIBUTE_ALWAYS_INLINE # if _GL_HAS_ATTRIBUTE (always_inline) # define _GL_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((__always_inline__)) # else # define _GL_ATTRIBUTE_ALWAYS_INLINE # endif #endif /* _GL_ATTRIBUTE_ARTIFICIAL declares that the function is not important to show in stack traces when debugging. The compiler should omit the function from stack traces. */ /* Applies to: functions. */ #ifndef _GL_ATTRIBUTE_ARTIFICIAL # if _GL_HAS_ATTRIBUTE (artificial) # define _GL_ATTRIBUTE_ARTIFICIAL __attribute__ ((__artificial__)) # else # define _GL_ATTRIBUTE_ARTIFICIAL # endif #endif /* _GL_ATTRIBUTE_COLD declares that the function is rarely executed. */ /* Applies to: functions. */ /* Avoid __attribute__ ((cold)) on MinGW; see thread starting at . Also, Oracle Studio 12.6 requires 'cold' not '__cold__'. */ #ifndef _GL_ATTRIBUTE_COLD # if _GL_HAS_ATTRIBUTE (cold) && !defined __MINGW32__ # ifndef __SUNPRO_C # define _GL_ATTRIBUTE_COLD __attribute__ ((__cold__)) # else # define _GL_ATTRIBUTE_COLD __attribute__ ((cold)) # endif # else # define _GL_ATTRIBUTE_COLD # endif #endif /* _GL_ATTRIBUTE_CONST declares: It is OK for a compiler to move a call, or omit a duplicate call and reuse a cached return value, even if the state changes between calls. It is also OK to omit a call if the result is not used. This attribute is safe if the function does not change observable state, returns a value determined solely by its arguments' values without examining state, and always returns exactly once - e.g., does not raise an exception, call longjmp, or loop forever. (This attribute is stricter than _GL_ATTRIBUTE_PURE because the function cannot observe state. Unlike _GL_ATTRIBUTE_UNSEQUENCED the function must return exactly once and cannot access state addressed by its pointer arguments or that happens to have the same value for all calls to the function, but the function is allowed to return a pointer to storage that can be modified later. */ /* Applies to: functions. */ #ifndef _GL_ATTRIBUTE_CONST # if _GL_HAS_ATTRIBUTE (const) # define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) # else # define _GL_ATTRIBUTE_CONST # endif #endif /* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers that can be freed by passing them as the Ith argument to the function F. _GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that can be freed via 'free'; it can be used only after declaring 'free'. */ /* Applies to: functions. Cannot be used on inline functions. */ #ifndef _GL_ATTRIBUTE_DEALLOC # if _GL_GNUC_PREREQ (11, 0) # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i))) # else # define _GL_ATTRIBUTE_DEALLOC(f, i) # endif #endif /* If gnulib's or has already defined this macro, continue to use this earlier definition, since may not have been included yet. */ #ifndef _GL_ATTRIBUTE_DEALLOC_FREE # if defined __cplusplus && defined __GNUC__ && !defined __clang__ /* Work around GCC bug */ # define _GL_ATTRIBUTE_DEALLOC_FREE \ _GL_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1) # else # define _GL_ATTRIBUTE_DEALLOC_FREE \ _GL_ATTRIBUTE_DEALLOC (free, 1) # endif #endif /* _GL_ATTRIBUTE_DEPRECATED: Declares that an entity is deprecated. The compiler may warn if the entity is used. */ /* Applies to: - function, variable, - struct, union, struct/union member, - enumeration, enumeration item, - typedef, in C++ also: namespace, class, template specialization. */ #ifndef _GL_ATTRIBUTE_DEPRECATED # ifndef _GL_BRACKET_BEFORE_ATTRIBUTE # if _GL_HAVE___HAS_C_ATTRIBUTE # if __has_c_attribute (__deprecated__) # define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]] # endif # endif # endif # if !defined _GL_ATTRIBUTE_DEPRECATED && _GL_HAS_ATTRIBUTE (deprecated) # define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__)) # endif # ifndef _GL_ATTRIBUTE_DEPRECATED # define _GL_ATTRIBUTE_DEPRECATED # endif #endif /* _GL_ATTRIBUTE_ERROR(msg) requests an error if a function is called and the function call is not optimized away. _GL_ATTRIBUTE_WARNING(msg) requests a warning if a function is called and the function call is not optimized away. */ /* Applies to: functions. */ #if !(defined _GL_ATTRIBUTE_ERROR && defined _GL_ATTRIBUTE_WARNING) # if _GL_HAS_ATTRIBUTE (error) # define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__error__ (msg))) # define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__warning__ (msg))) # elif _GL_HAS_ATTRIBUTE (diagnose_if) # define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__diagnose_if__ (1, msg, "error"))) # define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__diagnose_if__ (1, msg, "warning"))) # else # define _GL_ATTRIBUTE_ERROR(msg) # define _GL_ATTRIBUTE_WARNING(msg) # endif #endif /* _GL_ATTRIBUTE_EXTERNALLY_VISIBLE declares that the entity should remain visible to debuggers etc., even with '-fwhole-program'. */ /* Applies to: functions, variables. */ #ifndef _GL_ATTRIBUTE_EXTERNALLY_VISIBLE # if _GL_HAS_ATTRIBUTE (externally_visible) # define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE __attribute__ ((externally_visible)) # else # define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE # endif #endif /* _GL_ATTRIBUTE_FALLTHROUGH declares that it is not a programming mistake if the control flow falls through to the immediately following 'case' or 'default' label. The compiler should not warn in this case. */ /* Applies to: Empty statement (;), inside a 'switch' statement. */ /* Always expands to something. */ #ifndef _GL_ATTRIBUTE_FALLTHROUGH # if _GL_HAVE___HAS_C_ATTRIBUTE # if __has_c_attribute (__fallthrough__) # define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]] # endif # endif # if !defined _GL_ATTRIBUTE_FALLTHROUGH && _GL_HAS_ATTRIBUTE (fallthrough) # define _GL_ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__)) # endif # ifndef _GL_ATTRIBUTE_FALLTHROUGH # define _GL_ATTRIBUTE_FALLTHROUGH ((void) 0) # endif #endif /* _GL_ATTRIBUTE_FORMAT ((ARCHETYPE, STRING-INDEX, FIRST-TO-CHECK)) declares that the STRING-INDEXth function argument is a format string of style ARCHETYPE, which is one of: printf, gnu_printf scanf, gnu_scanf, strftime, gnu_strftime, strfmon, or the same thing prefixed and suffixed with '__'. If FIRST-TO-CHECK is not 0, arguments starting at FIRST-TO_CHECK are suitable for the format string. */ /* Applies to: functions. */ #ifndef _GL_ATTRIBUTE_FORMAT # if _GL_HAS_ATTRIBUTE (format) # define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) # else # define _GL_ATTRIBUTE_FORMAT(spec) # endif #endif /* _GL_ATTRIBUTE_LEAF declares that if the function is called from some other compilation unit, it executes code from that unit only by return or by exception handling. This declaration lets the compiler optimize that unit more aggressively. */ /* Applies to: functions. */ #ifndef _GL_ATTRIBUTE_LEAF # if _GL_HAS_ATTRIBUTE (leaf) # define _GL_ATTRIBUTE_LEAF __attribute__ ((__leaf__)) # else # define _GL_ATTRIBUTE_LEAF # endif #endif /* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly allocated memory. */ /* Applies to: functions. */ #ifndef _GL_ATTRIBUTE_MALLOC # if _GL_HAS_ATTRIBUTE (malloc) # define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) # else # define _GL_ATTRIBUTE_MALLOC # endif #endif /* _GL_ATTRIBUTE_MAY_ALIAS declares that pointers to the type may point to the same storage as pointers to other types. Thus this declaration disables strict aliasing optimization. */ /* Applies to: types. */ /* Oracle Studio 12.6 mishandles may_alias despite __has_attribute OK. */ #ifndef _GL_ATTRIBUTE_MAY_ALIAS # if _GL_HAS_ATTRIBUTE (may_alias) && !defined __SUNPRO_C # define _GL_ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__)) # else # define _GL_ATTRIBUTE_MAY_ALIAS # endif #endif /* _GL_ATTRIBUTE_MAYBE_UNUSED declares that it is not a programming mistake if the entity is not used. The compiler should not warn if the entity is not used. However, 'int _GL_UNNAMED (i)' is preferable to '_GL_ATTRIBUTE_MAYBE_UNUSED int i' when parameter I is unused regardless of preprocessor macro settings. */ /* Applies to: - function, variable, - struct, union, struct/union member, - enumeration, enumeration item, - typedef, in C++ also: class. */ /* In C++ and C23, this is spelled [[__maybe_unused__]]. GCC's syntax is __attribute__ ((__unused__)). clang supports both syntaxes. Except that with clang ≥ 6, < 10, in C++ mode, __has_c_attribute (__maybe_unused__) yields true but the use of [[__maybe_unused__]] nevertheless produces a warning. */ #ifndef _GL_ATTRIBUTE_MAYBE_UNUSED # ifndef _GL_BRACKET_BEFORE_ATTRIBUTE # if defined __clang__ && defined __cplusplus # if !defined __apple_build_version__ && __clang_major__ >= 10 # define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]] # endif # elif _GL_HAVE___HAS_C_ATTRIBUTE # if __has_c_attribute (__maybe_unused__) # define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]] # endif # endif # endif # ifndef _GL_ATTRIBUTE_MAYBE_UNUSED # define _GL_ATTRIBUTE_MAYBE_UNUSED _GL_ATTRIBUTE_UNUSED # endif #endif /* Alternative spelling of this macro, for convenience and for compatibility with glibc/include/libc-symbols.h. */ #define _GL_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED /* Earlier spellings of this macro. */ #define _UNUSED_PARAMETER_ _GL_ATTRIBUTE_MAYBE_UNUSED /* _GL_ATTRIBUTE_NODISCARD declares that the caller of the function should not discard the return value. The compiler may warn if the caller does not use the return value, unless the caller uses something like ignore_value. */ /* Applies to: function, enumeration, class. */ #ifndef _GL_ATTRIBUTE_NODISCARD # ifndef _GL_BRACKET_BEFORE_ATTRIBUTE # if defined __clang__ && defined __cplusplus /* With clang up to 15.0.6 (at least), in C++ mode, [[__nodiscard__]] produces a warning. The 1000 below means a yet unknown threshold. When clang++ version X starts supporting [[__nodiscard__]] without warning about it, you can replace the 1000 with X. */ # if __clang_major__ >= 1000 # define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]] # endif # elif _GL_HAVE___HAS_C_ATTRIBUTE # if __has_c_attribute (__nodiscard__) # define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]] # endif # endif # endif # if !defined _GL_ATTRIBUTE_NODISCARD && _GL_HAS_ATTRIBUTE (warn_unused_result) # define _GL_ATTRIBUTE_NODISCARD __attribute__ ((__warn_unused_result__)) # endif # ifndef _GL_ATTRIBUTE_NODISCARD # define _GL_ATTRIBUTE_NODISCARD # endif #endif /* _GL_ATTRIBUTE_NOINLINE tells that the compiler should not inline the function. */ /* Applies to: functions. */ #ifndef _GL_ATTRIBUTE_NOINLINE # if _GL_HAS_ATTRIBUTE (noinline) # define _GL_ATTRIBUTE_NOINLINE __attribute__ ((__noinline__)) # else # define _GL_ATTRIBUTE_NOINLINE # endif #endif /* _GL_ATTRIBUTE_NONNULL ((N1, N2,...)) declares that the arguments N1, N2,... must not be NULL. _GL_ATTRIBUTE_NONNULL () declares that all pointer arguments must not be null. */ /* Applies to: functions. */ #ifndef _GL_ATTRIBUTE_NONNULL # if _GL_HAS_ATTRIBUTE (nonnull) # define _GL_ATTRIBUTE_NONNULL(args) __attribute__ ((__nonnull__ args)) # else # define _GL_ATTRIBUTE_NONNULL(args) # endif #endif /* _GL_ATTRIBUTE_NONNULL_IF_NONZERO (NP, NI) declares that the argument NP (a pointer) must not be NULL if the argument NI (an integer) is != 0. */ /* Applies to: functions. */ #ifndef _GL_ATTRIBUTE_NONNULL_IF_NONZERO # if _GL_HAS_ATTRIBUTE (nonnull_if_nonzero) # define _GL_ATTRIBUTE_NONNULL_IF_NONZERO(np, ni) __attribute__ ((__nonnull_if_nonzero__ (np, ni))) # else # define _GL_ATTRIBUTE_NONNULL_IF_NONZERO(np, ni) # endif #endif /* _GL_ATTRIBUTE_NONSTRING declares that the contents of a character array is not meant to be NUL-terminated. */ /* Applies to: struct/union members and variables that are arrays of element type '[[un]signed] char'. */ #ifndef _GL_ATTRIBUTE_NONSTRING # if _GL_HAS_ATTRIBUTE (nonstring) # define _GL_ATTRIBUTE_NONSTRING __attribute__ ((__nonstring__)) # else # define _GL_ATTRIBUTE_NONSTRING # endif #endif /* There is no _GL_ATTRIBUTE_NORETURN; use _Noreturn instead. */ /* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions. */ /* Applies to: functions. */ /* After a function's parameter list, this attribute must come first, before other attributes. */ #ifndef _GL_ATTRIBUTE_NOTHROW # if defined __cplusplus # if _GL_GNUC_PREREQ (2, 8) || __clang_major__ >= 4 # if __cplusplus >= 201103L # define _GL_ATTRIBUTE_NOTHROW noexcept (true) # else # define _GL_ATTRIBUTE_NOTHROW throw () # endif # else # define _GL_ATTRIBUTE_NOTHROW # endif # else # if _GL_HAS_ATTRIBUTE (nothrow) # define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__)) # else # define _GL_ATTRIBUTE_NOTHROW # endif # endif #endif /* _GL_ATTRIBUTE_PACKED declares: For struct members: The member has the smallest possible alignment. For struct, union, class: All members have the smallest possible alignment, minimizing the memory required. */ /* Applies to: struct members, struct, union, in C++ also: class. */ #ifndef _GL_ATTRIBUTE_PACKED /* Oracle Studio 12.6 miscompiles code with __attribute__ ((__packed__)) despite __has_attribute OK. */ # if _GL_HAS_ATTRIBUTE (packed) && !defined __SUNPRO_C # define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__)) # else # define _GL_ATTRIBUTE_PACKED # endif #endif /* _GL_ATTRIBUTE_PURE declares: It is OK for a compiler to move a call, or omit a duplicate call and reuse a cached return value, if observable state is the same. It is also OK to omit a call if the return value is not used. This attribute is safe if the function does not change observable state, returns a value determined solely by its arguments's values together with observable state, and always returns exactly once. (This attribute is looser than _GL_ATTRIBUTE_CONST because the function can depend on observable state. Unlike _GL_ATTRIBUTE_REPRODUCIBLE the function must return exactly once and cannot change state addressed by its arguments, but the function can return a pointer to storage whose contents change later.) */ /* Applies to: functions. */ #ifndef _GL_ATTRIBUTE_PURE # if _GL_HAS_ATTRIBUTE (pure) # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) # else # define _GL_ATTRIBUTE_PURE # endif #endif /* _GL_ATTRIBUTE_REPRODUCIBLE declares: It is OK for a compiler to move a call, or omit a duplicate call and reuse a cached value returned either directly or indirectly via a pointer, if other observable state is the same; however, pointer arguments cannot alias. This attribute is safe for a function that is effectless and idempotent; see ISO C 23 § 6.7.13.8 for a definition of these terms. (This attribute is looser than _GL_ATTRIBUTE_UNSEQUENCED because the function need not be stateless or independent. Unlike _GL_ATTRIBUTE_PURE the function need not return exactly once and can change state addressed by its pointer arguments, but the function cannot return a pointer to storage whose contents change later.) See also and . */ /* Applies to: functions, pointer to functions, function types. */ #ifndef _GL_ATTRIBUTE_REPRODUCIBLE /* This may be revisited when gcc and clang support [[reproducible]] or possibly __attribute__ ((__reproducible__)). */ # ifndef _GL_BRACKET_BEFORE_ATTRIBUTE # if _GL_HAS_ATTRIBUTE (reproducible) # define _GL_ATTRIBUTE_REPRODUCIBLE [[reproducible]] # endif # endif # ifndef _GL_ATTRIBUTE_REPRODUCIBLE # define _GL_ATTRIBUTE_REPRODUCIBLE # endif #endif /* _GL_ATTRIBUTE_RETURNS_NONNULL declares that the function's return value is a non-NULL pointer. */ /* Applies to: functions. */ #ifndef _GL_ATTRIBUTE_RETURNS_NONNULL # if _GL_HAS_ATTRIBUTE (returns_nonnull) # define _GL_ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__)) # else # define _GL_ATTRIBUTE_RETURNS_NONNULL # endif #endif /* _GL_ATTRIBUTE_SENTINEL(pos) declares that the variadic function expects a trailing NULL argument. _GL_ATTRIBUTE_SENTINEL () - The last argument is NULL (requires C99). _GL_ATTRIBUTE_SENTINEL ((N)) - The (N+1)st argument from the end is NULL. */ /* Applies to: functions. */ #ifndef _GL_ATTRIBUTE_SENTINEL # if _GL_HAS_ATTRIBUTE (sentinel) # define _GL_ATTRIBUTE_SENTINEL(pos) __attribute__ ((__sentinel__ pos)) # else # define _GL_ATTRIBUTE_SENTINEL(pos) # endif #endif /* _GL_ATTRIBUTE_UNSEQUENCED declares: It is OK for a compiler to move a call, or omit a duplicate call and reuse a cached value returned either directly or indirectly via a pointer, if the state addressed by its pointer arguments is the same; however, pointer arguments cannot alias. This attribute is safe for a function that is effectless, idempotent, stateless, and independent; see ISO C 23 § 6.7.13.8 for a definition of these terms. (This attribute is stricter than _GL_ATTRIBUTE_REPRODUCIBLE because the function must be stateless and independent. Unlike _GL_ATTRIBUTE_CONST the function need not return exactly once, and can depend on state accessed via its pointer arguments or that happens to have the same value for all calls to the function, but the function cannot return a pointer to storage whose contents change later.) See also and . */ /* Applies to: functions, pointer to functions, function types. */ #ifndef _GL_ATTRIBUTE_UNSEQUENCED /* This may be revisited when gcc and clang support [[unsequenced]] or possibly __attribute__ ((__unsequenced__)). */ # ifndef _GL_BRACKET_BEFORE_ATTRIBUTE # if _GL_HAS_ATTRIBUTE (unsequenced) # define _GL_ATTRIBUTE_UNSEQUENCED [[unsequenced]] # endif # endif # ifndef _GL_ATTRIBUTE_UNSEQUENCED # define _GL_ATTRIBUTE_UNSEQUENCED # endif #endif /* A helper macro. Don't use it directly. */ #ifndef _GL_ATTRIBUTE_UNUSED # if _GL_HAS_ATTRIBUTE (unused) # define _GL_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) # else # define _GL_ATTRIBUTE_UNUSED # endif #endif ]dnl There is no _GL_ATTRIBUTE_VISIBILITY; see m4/visibility.m4 instead. [ /* _GL_UNUSED_LABEL; declares that it is not a programming mistake if the immediately preceding label is not used. The compiler should not warn if the label is not used. */ /* Applies to: label (both in C and C++). */ /* Note that g++ < 4.5 does not support the '__attribute__ ((__unused__)) ;' syntax. But clang does. */ #ifndef _GL_UNUSED_LABEL # if !(defined __cplusplus && !_GL_GNUC_PREREQ (4, 5)) || defined __clang__ # define _GL_UNUSED_LABEL _GL_ATTRIBUTE_UNUSED # else # define _GL_UNUSED_LABEL # endif #endif /* _GL_UNNAMED (ID) is the "name" of an unnamed function parameter. Each of the function's unnamed parameters should have a unique "name". The "name" cannot be used. This ports both to C17 and earlier, which lack unnamed parameters, and to C++ and later C, which have them. */ /* Applies to: - function parameters. */ #ifndef _GL_UNNAMED # if ((defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 202311 \ && !defined __cplusplus) # define _GL_UNNAMED(id) unnamed_##id _GL_ATTRIBUTE_UNUSED # else # define _GL_UNNAMED(id) # endif #endif /* The following attributes enable detection of multithread-safety problems and resource leaks at compile-time, by clang ≥ 15, when the warning option -Wthread-safety is enabled. For usage, see . */ #ifndef _GL_ATTRIBUTE_CAPABILITY_TYPE # if __clang_major__ >= 15 # define _GL_ATTRIBUTE_CAPABILITY_TYPE(concept) \ __attribute__ ((__capability__ (concept))) # else # define _GL_ATTRIBUTE_CAPABILITY_TYPE(concept) # endif #endif #ifndef _GL_ATTRIBUTE_ACQUIRE_CAPABILITY # if __clang_major__ >= 15 # define _GL_ATTRIBUTE_ACQUIRE_CAPABILITY(resource) \ __attribute__ ((__acquire_capability__ (resource))) # else # define _GL_ATTRIBUTE_ACQUIRE_CAPABILITY(resource) # endif #endif #ifndef _GL_ATTRIBUTE_RELEASE_CAPABILITY # if __clang_major__ >= 15 # define _GL_ATTRIBUTE_RELEASE_CAPABILITY(resource) \ __attribute__ ((__release_capability__ (resource))) # else # define _GL_ATTRIBUTE_RELEASE_CAPABILITY(resource) # endif #endif ]) AH_VERBATIM([c_linkage], [/* In C++, there is the concept of "language linkage", that encompasses name mangling and function calling conventions. The following macros start and end a block of "C" linkage. */ #ifdef __cplusplus # define _GL_BEGIN_C_LINKAGE extern "C" { # define _GL_END_C_LINKAGE } #else # define _GL_BEGIN_C_LINKAGE # define _GL_END_C_LINKAGE #endif ]) AH_VERBATIM([async_safe], [/* The _GL_ASYNC_SAFE marker should be attached to functions that are signal handlers (for signals other than SIGABRT, SIGPIPE) or can be invoked from such signal handlers. Such functions have some restrictions: * All functions that it calls should be marked _GL_ASYNC_SAFE as well, or should be listed as async-signal-safe in POSIX section 2.4.3. Note that malloc(), sprintf(), and fwrite(), in particular, are NOT async-signal-safe. * All memory locations (variables and struct fields) that these functions access must be marked 'volatile'. This holds for both read and write accesses. Otherwise the compiler might optimize away stores to and reads from such locations that occur in the program, depending on its data flow analysis. For example, when the program contains a loop that is intended to inspect a variable set from within a signal handler while (!signal_occurred) ; the compiler is allowed to transform this into an endless loop if the variable 'signal_occurred' is not declared 'volatile'. Additionally, recall that: * A signal handler should not modify errno (except if it is a handler for a fatal signal and ends by raising the same signal again, thus provoking the termination of the process). If it invokes a function that may clobber errno, it needs to save and restore the value of errno. */ #define _GL_ASYNC_SAFE ]) AH_VERBATIM([micro_optimizations], [/* _GL_CMP (n1, n2) performs a three-valued comparison on n1 vs. n2, where n1 and n2 are expressions without side effects, that evaluate to real numbers (excluding NaN). It returns 1 if n1 > n2 0 if n1 == n2 -1 if n1 < n2 The naïve code (n1 > n2 ? 1 : n1 < n2 ? -1 : 0) produces a conditional jump with nearly all GCC versions up to GCC 10. This variant (n1 < n2 ? -1 : n1 > n2) produces a conditional jump with many GCC versions up to GCC 9. The better code (n1 > n2) - (n1 < n2) from Hacker's Delight § 2-9 avoids conditional jumps in all GCC versions >= 3.4. */ #define _GL_CMP(n1, n2) (((n1) > (n2)) - ((n1) < (n2))) ]) dnl Hint which direction to take regarding cross-compilation guesses: dnl When a user installs a program on a platform they are not intimately dnl familiar with, --enable-cross-guesses=conservative is the appropriate dnl choice. It implements the "If we don't know, assume the worst" principle. dnl However, when an operating system developer (on a platform which is not dnl yet known to gnulib) builds packages for their platform, they want to dnl expose, not hide, possible platform bugs; in this case, dnl --enable-cross-guesses=risky is the appropriate choice. dnl Sets the variables dnl gl_cross_guess_normal (to be used when 'yes' is good and 'no' is bad), dnl gl_cross_guess_inverted (to be used when 'no' is good and 'yes' is bad). AC_ARG_ENABLE([cross-guesses], [AS_HELP_STRING([[--enable-cross-guesses={conservative|risky}]], [specify policy for cross-compilation guesses])], [if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then AC_MSG_WARN([invalid argument supplied to --enable-cross-guesses]) enableval=conservative fi gl_cross_guesses="$enableval"], [gl_cross_guesses=conservative]) if test $gl_cross_guesses = risky; then gl_cross_guess_normal="guessing yes" gl_cross_guess_inverted="guessing no" else gl_cross_guess_normal="guessing no" gl_cross_guess_inverted="guessing yes" fi dnl Preparation for running test programs: dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not dnl to /dev/tty, so they can be redirected to log files. Such diagnostics dnl arise e.g., in the macros gl_PRINTF_DIRECTIVE_N, gl_SNPRINTF_DIRECTIVE_N. LIBC_FATAL_STDERR_=1 export LIBC_FATAL_STDERR_ ]) # gl_MODULE_INDICATOR_INIT_VARIABLE([variablename]) # gl_MODULE_INDICATOR_INIT_VARIABLE([variablename], [initialvalue]) # initializes the shell variable that indicates the presence of the given module # as a C preprocessor expression. AC_DEFUN([gl_MODULE_INDICATOR_INIT_VARIABLE], [ GL_MODULE_INDICATOR_PREFIX[]_[$1]=m4_if([$2], , [0], [$2]) AC_SUBST(GL_MODULE_INDICATOR_PREFIX[]_[$1]) ]) # gl_MODULE_INDICATOR_CONDITION # expands to a C preprocessor expression that evaluates to 1 or 0, depending # whether a gnulib module that has been requested shall be considered present # or not. m4_define([gl_MODULE_INDICATOR_CONDITION], [1]) # gl_MODULE_INDICATOR_SET_VARIABLE([modulename]) # sets the shell variable that indicates the presence of the given module to # a C preprocessor expression that will evaluate to 1. AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE], [ gl_MODULE_INDICATOR_SET_VARIABLE_AUX( [GL_MODULE_INDICATOR_PREFIX[]_GNULIB_[]m4_translit([[$1]], [abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) ]) # gl_MODULE_INDICATOR_SET_VARIABLE_AUX([variable]) # modifies the shell variable to include the gl_MODULE_INDICATOR_CONDITION. # The shell variable's value is a C preprocessor expression that evaluates # to 0 or 1. AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX], [ m4_if(m4_defn([gl_MODULE_INDICATOR_CONDITION]), [1], [ dnl Simplify the expression VALUE || 1 to 1. $1=1 ], [gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([$1], [gl_MODULE_INDICATOR_CONDITION])]) ]) # gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([variable], [condition]) # modifies the shell variable to include the given condition. The shell # variable's value is a C preprocessor expression that evaluates to 0 or 1. AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR], [ dnl Simplify the expression 1 || CONDITION to 1. if test "$[]$1" != 1; then dnl Simplify the expression 0 || CONDITION to CONDITION. if test "$[]$1" = 0; then $1=$2 else $1="($[]$1 || $2)" fi fi ]) # gl_MODULE_INDICATOR([modulename]) # defines a C macro indicating the presence of the given module # in a location where it can be used. # | Value | Value | # | in lib/ | in tests/ | # --------------------------------------------+---------+-----------+ # Module present among main modules: | 1 | 1 | # --------------------------------------------+---------+-----------+ # Module present among tests-related modules: | 0 | 1 | # --------------------------------------------+---------+-----------+ # Module not present at all: | 0 | 0 | # --------------------------------------------+---------+-----------+ AC_DEFUN([gl_MODULE_INDICATOR], [ AC_DEFINE_UNQUOTED([GNULIB_]m4_translit([[$1]], [abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [gl_MODULE_INDICATOR_CONDITION], [Define to a C preprocessor expression that evaluates to 1 or 0, depending whether the gnulib module $1 shall be considered present.]) ]) # gl_MODULE_INDICATOR_FOR_TESTS([modulename]) # defines a C macro indicating the presence of the given module # in lib or tests. This is useful to determine whether the module # should be tested. # | Value | Value | # | in lib/ | in tests/ | # --------------------------------------------+---------+-----------+ # Module present among main modules: | 1 | 1 | # --------------------------------------------+---------+-----------+ # Module present among tests-related modules: | 1 | 1 | # --------------------------------------------+---------+-----------+ # Module not present at all: | 0 | 0 | # --------------------------------------------+---------+-----------+ AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], [ AC_DEFINE([GNULIB_TEST_]m4_translit([[$1]], [abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1], [Define to 1 when the gnulib module $1 should be tested.]) ]) # gl_ASSERT_NO_GNULIB_POSIXCHECK # asserts that there will never be a need to #define GNULIB_POSIXCHECK. # and thereby enables an optimization of configure and config.h. # Used by Emacs. AC_DEFUN([gl_ASSERT_NO_GNULIB_POSIXCHECK], [ dnl Override gl_WARN_ON_USE_PREPARE. dnl But hide this definition from 'aclocal'. AC_DEFUN([gl_W][ARN_ON_USE_PREPARE], []) ]) # gl_ASSERT_NO_GNULIB_TESTS # asserts that there will be no gnulib tests in the scope of the configure.ac # and thereby enables an optimization of config.h. # Used by Emacs. AC_DEFUN([gl_ASSERT_NO_GNULIB_TESTS], [ dnl Override gl_MODULE_INDICATOR_FOR_TESTS. AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], []) ]) # Test whether exists. # Set HAVE_FEATURES_H. AC_DEFUN([gl_FEATURES_H], [ AC_CHECK_HEADERS_ONCE([features.h]) if test $ac_cv_header_features_h = yes; then HAVE_FEATURES_H=1 else HAVE_FEATURES_H=0 fi AC_SUBST([HAVE_FEATURES_H]) ]) # gl_PROG_CC_C99 # Modifies the value of the shell variable CC in an attempt to make $CC # understand ISO C99 source code. AC_DEFUN([gl_PROG_CC_C99], [ dnl Just use AC_PROG_CC_C99. dnl When AC_PROG_CC_C99 and AC_PROG_CC_STDC are used together, the substituted dnl value of CC will contain the C99 enabling options twice. But this is only dnl a cosmetic problem. dnl With Autoconf >= 2.70, use AC_PROG_CC since it implies AC_PROG_CC_C99; dnl this avoids a "warning: The macro `AC_PROG_CC_C99' is obsolete." m4_version_prereq([2.70], [AC_REQUIRE([AC_PROG_CC])], [AC_REQUIRE([AC_PROG_CC_C99])]) ]) # gl_PROG_AR_RANLIB # Determines the values for AR, ARFLAGS, RANLIB that fit with the compiler. # The user can set the variables AR, ARFLAGS, RANLIB if he wants to override # the values. AC_DEFUN([gl_PROG_AR_RANLIB], [ dnl Minix 3 comes with two toolchains: The Amsterdam Compiler Kit compiler dnl as "cc", and GCC as "gcc". They have different object file formats and dnl library formats. In particular, the GNU binutils programs ar and ranlib dnl produce libraries that work only with gcc, not with cc. AC_REQUIRE([AC_PROG_CC]) dnl The '][' hides this use from 'aclocal'. AC_BEFORE([$0], [A][M_PROG_AR]) AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler], [ AC_EGREP_CPP([Amsterdam], [ #ifdef __ACK__ Amsterdam #endif ], [gl_cv_c_amsterdam_compiler=yes], [gl_cv_c_amsterdam_compiler=no]) ]) dnl Don't compete with AM_PROG_AR's decision about AR/ARFLAGS if we are not dnl building with __ACK__. if test $gl_cv_c_amsterdam_compiler = yes; then if test -z "$AR"; then AR='cc -c.a' fi if test -z "$ARFLAGS"; then ARFLAGS='-o' fi else dnl AM_PROG_AR was added in automake v1.11.2. AM_PROG_AR does not AC_SUBST dnl ARFLAGS variable (it is filed into Makefile.in directly by automake dnl script on-demand, if not specified by ./configure of course). dnl Don't AC_REQUIRE the AM_PROG_AR otherwise the code for __ACK__ above dnl will be ignored. Also, pay attention to call AM_PROG_AR in else block dnl because AM_PROG_AR is written so it could re-set AR variable even for dnl __ACK__. It may seem like its easier to avoid calling the macro here, dnl but we need to AC_SUBST both AR/ARFLAGS (thus those must have some good dnl default value and automake should usually know them). dnl dnl The '][' hides this use from 'aclocal'. m4_ifdef([A][M_PROG_AR], [A][M_PROG_AR], [:]) fi dnl In case the code above has not helped with setting AR/ARFLAGS, use dnl Automake-documented default values for AR and ARFLAGS, but prefer dnl ${host}-ar over ar (useful for cross-compiling). AC_CHECK_TOOL([AR], [ar], [ar]) if test -z "$ARFLAGS"; then ARFLAGS='cr' fi AC_SUBST([AR]) AC_SUBST([ARFLAGS]) if test -z "$RANLIB"; then if test $gl_cv_c_amsterdam_compiler = yes; then RANLIB=':' else dnl Use the ranlib program if it is available. AC_PROG_RANLIB fi fi AC_SUBST([RANLIB]) ]) # AC_C_RESTRICT # This definition is copied from post-2.70 Autoconf and overrides the # AC_C_RESTRICT macro from autoconf 2.60..2.70. m4_version_prereq([2.70.1], [], [ AC_DEFUN([AC_C_RESTRICT], [AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict], [ac_cv_c_restrict=no # Put '__restrict__' first, to avoid problems with glibc and non-GCC; see: # https://lists.gnu.org/archive/html/bug-autoconf/2016-02/msg00006.html # Put 'restrict' last, because C++ lacks it. for ac_kw in __restrict__ __restrict _Restrict restrict; do AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[typedef int *int_ptr; int foo (int_ptr $ac_kw ip) { return ip[0]; } int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ int bar (int ip[$ac_kw]) { return ip[0]; } ]], [[int s[1]; int *$ac_kw t = s; t[0] = 0; return foo (t) + bar (t); ]])], [ac_cv_c_restrict=$ac_kw]) test "$ac_cv_c_restrict" != no && break done ]) AH_VERBATIM([restrict], [/* Define to the equivalent of the C99 'restrict' keyword, or to nothing if this is not supported. Do not define if restrict is supported only directly. */ #undef restrict /* Work around a bug in older versions of Sun C++, which did not #define __restrict__ or support _Restrict or __restrict__ even though the corresponding Sun C compiler ended up with "#define restrict _Restrict" or "#define restrict __restrict__" in the previous line. This workaround can be removed once we assume Oracle Developer Studio 12.5 (2016) or later. */ #if defined __SUNPRO_CC && !defined __RESTRICT && !defined __restrict__ # define _Restrict # define __restrict__ #endif]) case $ac_cv_c_restrict in restrict) ;; no) AC_DEFINE([restrict], []) ;; *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;; esac ])# AC_C_RESTRICT ]) # gl_BIGENDIAN # is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd. # Note that AC_REQUIRE([AC_C_BIGENDIAN]) does not work reliably because some # macros invoke AC_C_BIGENDIAN with arguments. AC_DEFUN([gl_BIGENDIAN], [ AC_C_BIGENDIAN ]) # A temporary file descriptor. # Must be less than 10, because dash 0.5.8 does not support redirections # with multi-digit file descriptors. m4_define([GL_TMP_FD], 9) # gl_SILENT(command) # executes command, but without the normal configure output. # This is useful when you want to invoke AC_CACHE_CHECK (or AC_CHECK_FUNC etc.) # inside another AC_CACHE_CHECK. AC_DEFUN([gl_SILENT], [ exec GL_TMP_FD>&AS_MESSAGE_FD AS_MESSAGE_FD>/dev/null $1 exec AS_MESSAGE_FD>&GL_TMP_FD GL_TMP_FD>&- ]) # gl_CACHE_VAL_SILENT(cache-id, command-to-set-it) # is like AC_CACHE_VAL(cache-id, command-to-set-it), except that it does not # output a spurious "(cached)" mark in the midst of other configure output. # This macro should be used instead of AC_CACHE_VAL when it is not surrounded # by an AC_MSG_CHECKING/AC_MSG_RESULT pair. AC_DEFUN([gl_CACHE_VAL_SILENT], [ gl_SILENT([ AC_CACHE_VAL([$1], [$2]) ]) ]) # gl_CONDITIONAL(conditional, condition) # is like AM_CONDITIONAL(conditional, condition), except that it does not # produce an error # configure: error: conditional "..." was never defined. # Usually this means the macro was only invoked conditionally. # when only invoked conditionally. Instead, in that case, both the _TRUE # and the _FALSE case are disabled. AC_DEFUN([gl_CONDITIONAL], [ pushdef([AC_CONFIG_COMMANDS_PRE], [:])dnl AM_CONDITIONAL([$1], [$2]) popdef([AC_CONFIG_COMMANDS_PRE])dnl if test -z "${[$1]_TRUE}" && test -z "${[$1]_FALSE}"; then [$1]_TRUE='#' [$1]_FALSE='#' fi ]) # gl_CC_ALLOW_WARNINGS # sets and substitutes a variable GL_CFLAG_ALLOW_WARNINGS, to a $(CC) option # that reverts a preceding '-Werror' option, if available. # This is expected to be '-Wno-error' on gcc, clang (except clang/MSVC), xlclang # and empty otherwise. AC_DEFUN([gl_CC_ALLOW_WARNINGS], [ AC_REQUIRE([AC_PROG_CC]) AC_CACHE_CHECK([for C compiler option to allow warnings], [gl_cv_cc_wallow], [rm -fr conftest* echo 'int dummy;' > conftest.c AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c 2>conftest1.err]) >/dev/null AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Wno-error -c conftest.c 2>conftest2.err]) >/dev/null dnl Test the number of error output lines, because AIX xlc accepts the dnl option '-Wno-error', just to produce a warning dnl "Option -Wno-error was incorrectly specified. The option will be ignored." dnl afterwards. if test $? = 0 && test `wc -l < conftest1.err` = `wc -l < conftest2.err`; then gl_cv_cc_wallow='-Wno-error' else gl_cv_cc_wallow=none fi rm -fr conftest* ]) case "$gl_cv_cc_wallow" in none) GL_CFLAG_ALLOW_WARNINGS='' ;; *) GL_CFLAG_ALLOW_WARNINGS="$gl_cv_cc_wallow" ;; esac AC_SUBST([GL_CFLAG_ALLOW_WARNINGS]) ]) # gl_CXX_ALLOW_WARNINGS # sets and substitutes a variable GL_CXXFLAG_ALLOW_WARNINGS, to a $(CC) option # that reverts a preceding '-Werror' option, if available. AC_DEFUN([gl_CXX_ALLOW_WARNINGS], [ dnl Requires AC_PROG_CXX or gl_PROG_ANSI_CXX. if test -n "$CXX" && test "$CXX" != no; then AC_CACHE_CHECK([for C++ compiler option to allow warnings], [gl_cv_cxx_wallow], [rm -fr conftest* echo 'int dummy;' > conftest.cc AC_TRY_COMMAND([${CXX-c++} $CXXFLAGS $CPPFLAGS -c conftest.cc 2>conftest1.err]) >/dev/null AC_TRY_COMMAND([${CXX-c++} $CXXFLAGS $CPPFLAGS -Wno-error -c conftest.cc 2>conftest2.err]) >/dev/null dnl Test the number of error output lines, because AIX xlC accepts the dnl option '-Wno-error', just to produce a warning dnl "Option -Wno-error was incorrectly specified. The option will be ignored." dnl afterwards. if test $? = 0 && test `wc -l < conftest1.err` = `wc -l < conftest2.err`; then gl_cv_cxx_wallow='-Wno-error' else gl_cv_cxx_wallow=none fi rm -fr conftest* ]) case "$gl_cv_cxx_wallow" in none) GL_CXXFLAG_ALLOW_WARNINGS='' ;; *) GL_CXXFLAG_ALLOW_WARNINGS="$gl_cv_cxx_wallow" ;; esac else GL_CXXFLAG_ALLOW_WARNINGS='' fi AC_SUBST([GL_CXXFLAG_ALLOW_WARNINGS]) ]) # gl_CC_GNULIB_WARNINGS # sets and substitutes a variable GL_CFLAG_GNULIB_WARNINGS, to a $(CC) option # set that enables or disables warnings as suitable for the Gnulib coding style. AC_DEFUN([gl_CC_GNULIB_WARNINGS], [ AC_REQUIRE([gl_CC_ALLOW_WARNINGS]) dnl Assume that the compiler supports -Wno-* options only if it also supports dnl -Wno-error. GL_CFLAG_GNULIB_WARNINGS='' if test -n "$GL_CFLAG_ALLOW_WARNINGS"; then dnl Enable these warning options: dnl dnl GCC clang dnl -Wno-cast-qual >= 3 >= 3.9 dnl -Wno-conversion >= 3 >= 3.9 dnl -Wno-float-conversion >= 4.9 >= 3.9 dnl -Wno-float-equal >= 3 >= 3.9 dnl -Wimplicit-fallthrough >= 7 >= 3.9 dnl -Wno-pedantic >= 4.8 >= 3.9 dnl -Wno-sign-compare >= 3 >= 3.9 dnl -Wno-sign-conversion >= 4.3 >= 3.9 dnl -Wno-tautological-out-of-range-compare - >= 3.9 dnl -Wno-type-limits >= 4.3 >= 3.9 dnl -Wno-undef >= 3 >= 3.9 dnl -Wno-unsuffixed-float-constants >= 4.5 dnl -Wno-unused-const-variable >= 6.1 >= 3.9 dnl -Wno-unused-function >= 3 >= 3.9 dnl -Wno-unused-parameter >= 3 >= 3.9 dnl cat > conftest.c <<\EOF #if (__GNUC__ >= 3 && !defined __clang__) || (__clang_major__ + (__clang_minor__ >= 9) > 3) -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter #endif #if (__GNUC__ + (__GNUC_MINOR__ >= 9) > 4 && !defined __clang__) || (__clang_major__ + (__clang_minor__ >= 9) > 3) -Wno-float-conversion #endif #if (__GNUC__ >= 7 && !defined __clang__) || (__clang_major__ + (__clang_minor__ >= 9) > 3) -Wimplicit-fallthrough #endif #if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 4 && !defined __clang__) || (__clang_major__ + (__clang_minor__ >= 9) > 3) -Wno-pedantic #endif #if 3 < __clang_major__ + (9 <= __clang_minor__) -Wno-tautological-constant-out-of-range-compare #endif #if (__GNUC__ + (__GNUC_MINOR__ >= 3) > 4 && !defined __clang__) || (__clang_major__ + (__clang_minor__ >= 9) > 3) -Wno-sign-conversion -Wno-type-limits #endif #if (__GNUC__ + (__GNUC_MINOR__ >= 1) > 6 && !defined __clang__) || (__clang_major__ + (__clang_minor__ >= 9) > 3) -Wno-unused-const-variable #endif #if (__GNUC__ + (__GNUC_MINOR__ >= 5) > 4 && !defined __clang__) -Wno-unsuffixed-float-constants #endif EOF gl_command="$CC $CFLAGS $CPPFLAGS -E conftest.c > conftest.out" if AC_TRY_EVAL([gl_command]); then gl_options=`grep -v '#' conftest.out` for word in $gl_options; do GL_CFLAG_GNULIB_WARNINGS="$GL_CFLAG_GNULIB_WARNINGS $word" done fi rm -f conftest.c conftest.out fi AC_SUBST([GL_CFLAG_GNULIB_WARNINGS]) ]) dnl gl_CONDITIONAL_HEADER([foo.h]) dnl takes a shell variable GL_GENERATE_FOO_H (with value true or false) as input dnl and produces dnl - an AC_SUBSTed variable FOO_H that is either a file name or empty, based dnl on whether GL_GENERATE_FOO_H is true or false, dnl - an Automake conditional GL_GENERATE_FOO_H that evaluates to the value of dnl the shell variable GL_GENERATE_FOO_H. AC_DEFUN([gl_CONDITIONAL_HEADER], [ m4_pushdef([gl_header_name], AS_TR_SH(m4_toupper($1))) m4_pushdef([gl_generate_var], [GL_GENERATE_]AS_TR_SH(m4_toupper($1))) m4_pushdef([gl_generate_cond], [GL_GENERATE_]AS_TR_SH(m4_toupper($1))) case "$gl_generate_var" in false) gl_header_name='' ;; true) dnl It is OK to use a .h file in lib/ from within tests/, but not vice dnl versa. if test -z "$gl_header_name"; then gl_header_name="${gl_source_base_prefix}$1" fi ;; *) echo "*** gl_generate_var is not set correctly" 1>&2; exit 1 ;; esac AC_SUBST(gl_header_name) gl_CONDITIONAL(gl_generate_cond, [$gl_generate_var]) m4_popdef([gl_generate_cond]) m4_popdef([gl_generate_var]) m4_popdef([gl_header_name]) ]) dnl Preparations for gl_CHECK_FUNCS_MACOS. AC_DEFUN([gl_PREPARE_CHECK_FUNCS_MACOS], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_COMPILER_CLANG]) AC_CACHE_CHECK([for compiler option needed when checking for future declarations], [gl_cv_compiler_check_future_option], [case "$host_os" in dnl This is only needed on macOS. darwin*) if test $gl_cv_compiler_clang = yes; then dnl Test whether the compiler supports the option dnl '-Werror=unguarded-availability-new'. saved_ac_compile="$ac_compile" ac_compile="$ac_compile -Werror=unguarded-availability-new" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])], [gl_cv_compiler_check_future_option='-Werror=unguarded-availability-new'], [gl_cv_compiler_check_future_option=none]) ac_compile="$saved_ac_compile" else gl_cv_compiler_check_future_option=none fi ;; *) gl_cv_compiler_check_future_option=none ;; esac ]) ]) dnl Pieces of the expansion of dnl gl_CHECK_FUNCS_ANDROID dnl gl_CHECK_FUNCS_MACOS dnl gl_CHECK_FUNCS_ANDROID_MACOS AC_DEFUN([gl_CHECK_FUNCS_DEFAULT_CASE], [ *) AC_CHECK_FUNC([$1]) [gl_cv_onwards_func_][$1]=$[ac_cv_func_][$1] ;; ]) AC_DEFUN([gl_CHECK_FUNCS_CASE_FOR_ANDROID], [ linux*-android*) AC_CHECK_DECL([$1], , , [$2]) if test $[ac_cv_have_decl_][$1] = yes; then AC_CHECK_FUNC([[$1]]) if test $[ac_cv_func_][$1] = yes; then [gl_cv_onwards_func_][$1]=yes else dnl The function is declared but does not exist. This should not dnl happen normally. But anyway, we know that a future version dnl of Android will have the function. [gl_cv_onwards_func_][$1]='future OS version' fi else [gl_cv_onwards_func_][$1]='future OS version' fi ;; ]) AC_DEFUN([gl_CHECK_FUNCS_CASE_FOR_MACOS], [ darwin*) if test "x$gl_cv_compiler_check_future_option" != "xnone"; then dnl Use a compile test, not a link test. saved_ac_compile="$ac_compile" ac_compile="$ac_compile $gl_cv_compiler_check_future_option" saved_ac_compile_for_check_decl="$ac_compile_for_check_decl" ac_compile_for_check_decl="$ac_compile_for_check_decl $gl_cv_compiler_check_future_option" unset [ac_cv_have_decl_][$1] AC_CHECK_DECL([$1], , , [$2]) ac_compile="$saved_ac_compile" ac_compile_for_check_decl="$saved_ac_compile_for_check_decl" [ac_cv_func_][$1]="$[ac_cv_have_decl_][$1]" if test $[ac_cv_func_][$1] = yes; then [gl_cv_onwards_func_][$1]=yes else dnl This is a bit complicated, because here we need the behaviour dnl of AC_CHECK_DECL before the dnl commit e1bbc9b93cdff61d70719c224b37970e065008bb (2025-05-26). [ac_cv_have_decl_][$1][_saved]="$[ac_cv_have_decl_][$1]" unset [ac_cv_have_decl_][$1] ac_c_future_darwin_options_saved="$ac_c_future_darwin_options" ac_cxx_future_darwin_options_saved="$ac_cxx_future_darwin_options" ac_c_future_darwin_options= ac_cxx_future_darwin_options= AC_CHECK_DECL([$1], , , [$2]) ac_c_future_darwin_options="$ac_c_future_darwin_options_saved" ac_cxx_future_darwin_options="$ac_cxx_future_darwin_options_saved" if test $[ac_cv_have_decl_][$1] = yes; then [gl_cv_onwards_func_][$1]='future OS version' else [gl_cv_onwards_func_][$1]=no fi [ac_cv_have_decl_][$1]="$[ac_cv_have_decl_][$1][_saved]" unset [ac_cv_have_decl_][$1][_saved] fi else AC_CHECK_FUNC([$1]) [gl_cv_onwards_func_][$1]=$[ac_cv_func_][$1] fi ;; ]) AC_DEFUN([gl_CHECK_FUNCS_SET_RESULTS], [ case "$[gl_cv_onwards_func_][$1]" in future*) [ac_cv_func_][$1]=no ;; *) [ac_cv_func_][$1]=$[gl_cv_onwards_func_][$1] ;; esac if test $[ac_cv_func_][$1] = yes; then AC_DEFINE([HAVE_]m4_translit([[$1]], [abcdefghijklmnopqrstuvwxyz], [ABCDEFGHIJKLMNOPQRSTUVWXYZ]), [1], [Define to 1 if you have the `$1' function.]) fi ]) dnl gl_CHECK_FUNCS_ANDROID([func], [[#include ]]) dnl is like AC_CHECK_FUNCS([func]), taking into account a portability problem dnl on Android. dnl dnl When code is compiled on Android, it is in the context of a certain dnl "Android API level", which indicates the minimum version of Android on dnl which the app can be installed. In other words, you don't compile for a dnl specific version of Android. You compile for all versions of Android, dnl onwards from the given API level. dnl Thus, the question "does the OS have the function func" has three possible dnl answers: dnl - yes, in all versions starting from the given API level, dnl - no, in no version, dnl - not in the given API level, but in a later version of Android. dnl dnl In detail, this works as follows: dnl If func was added to Android API level, say, 28, then the libc.so has the dnl symbol func always, whereas the header file declares func dnl conditionally: dnl #if __ANDROID_API__ >= 28 dnl ... func (...) __INTRODUCED_IN(28); dnl #endif dnl Thus, when compiling with "clang -target armv7a-unknown-linux-android28", dnl the function func is declared and exists in libc. dnl Whereas when compiling with "clang -target armv7a-unknown-linux-android27", dnl the function func is not declared but exists in libc. dnl dnl This macro sets two variables: dnl - gl_cv_onwards_func_ to yes / no / "future OS version" dnl - ac_cv_func_ to yes / no / no dnl The first variable allows distinguishing all three cases. dnl The second variable is set, so that an invocation dnl gl_CHECK_FUNCS_ANDROID([func], [[#include ]]) dnl can be used as a drop-in replacement for dnl AC_CHECK_FUNCS([func]). AC_DEFUN([gl_CHECK_FUNCS_ANDROID], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([for [$1]], [[gl_cv_onwards_func_][$1]], [gl_SILENT([ case "$host_os" in gl_CHECK_FUNCS_CASE_FOR_ANDROID([$1], [$2]) gl_CHECK_FUNCS_DEFAULT_CASE([$1]) esac ]) ]) gl_CHECK_FUNCS_SET_RESULTS([$1]) ]) dnl gl_CHECK_FUNCS_MACOS([func], [[#include ]]) dnl is like AC_CHECK_FUNCS([func]), taking into account a portability problem dnl on macOS. dnl dnl When code is compiled on macOS, it is in the context of a certain minimum dnl macOS version, that can be set through the option '-mmacosx-version-min='. dnl In other words, you don't compile for a specific version of macOS. You dnl compile for all versions of macOS, onwards from the given version. dnl Thus, the question "does the OS have the function func" has three possible dnl answers: dnl - yes, in all versions starting from the given version, dnl - no, in no version, dnl - not in the given version, but in a later version of macOS. dnl dnl In detail, this works as follows: dnl If func was added to, say, macOS version 13, then the libc has the dnl symbol func always, whereas the header file declares func dnl conditionally with a special availability attribute: dnl ... func (...) __attribute__((availability(macos,introduced=13.0))); dnl Thus, when compiling with "clang mmacosx-version-min=13", there is no dnl warning about the use of func, and the resulting binary dnl - runs fine on macOS 13, dnl - aborts with a dyld "Symbol not found" message on macOS 12. dnl Whereas, when compiling with "clang mmacosx-version-min=12", there is a dnl warning: 'func' is only available on macOS 13.0 or newer dnl [-Wunguarded-availability-new], dnl and the resulting binary dnl - runs fine on macOS 13, dnl - crashes with a SIGSEGV (signal 11) on macOS 12. dnl dnl This macro sets two variables: dnl - gl_cv_onwards_func_ to yes / no / "future OS version" dnl - ac_cv_func_ to yes / no / no dnl The first variable allows distinguishing all three cases. dnl The second variable is set, so that an invocation dnl gl_CHECK_FUNCS_MACOS([func], [[#include ]]) dnl can be used as a drop-in replacement for dnl AC_CHECK_FUNCS([func]). AC_DEFUN([gl_CHECK_FUNCS_MACOS], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_PREPARE_CHECK_FUNCS_MACOS]) AC_CACHE_CHECK([for [$1]], [[gl_cv_onwards_func_][$1]], [gl_SILENT([ case "$host_os" in gl_CHECK_FUNCS_CASE_FOR_MACOS([$1], [$2]) gl_CHECK_FUNCS_DEFAULT_CASE([$1]) esac ]) ]) gl_CHECK_FUNCS_SET_RESULTS([$1]) ]) dnl gl_CHECK_FUNCS_ANDROID_MACOS([func], [[#include ]]) dnl is like AC_CHECK_FUNCS([func]), taking into account a portability problem dnl on Android and on macOS. dnl It is the combination of gl_CHECK_FUNCS_ANDROID and gl_CHECK_FUNCS_MACOS. AC_DEFUN([gl_CHECK_FUNCS_ANDROID_MACOS], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_PREPARE_CHECK_FUNCS_MACOS]) AC_CACHE_CHECK([for [$1]], [[gl_cv_onwards_func_][$1]], [gl_SILENT([ case "$host_os" in gl_CHECK_FUNCS_CASE_FOR_ANDROID([$1], [$2]) gl_CHECK_FUNCS_CASE_FOR_MACOS([$1], [$2]) gl_CHECK_FUNCS_DEFAULT_CASE([$1]) esac ]) ]) gl_CHECK_FUNCS_SET_RESULTS([$1]) ]) dnl Expands to some code for use in .c programs that, on native Windows, defines dnl the Microsoft deprecated alias function names to the underscore-prefixed dnl actual function names. With this macro, these function names are available dnl without linking with '-loldnames' and without generating warnings. dnl Usage: Use it after all system header files are included. dnl #include <...> dnl #include <...> dnl ]GL_MDA_DEFINES[ dnl ... AC_DEFUN([GL_MDA_DEFINES],[ AC_REQUIRE([_GL_MDA_DEFINES]) [$gl_mda_defines] ]) AC_DEFUN([_GL_MDA_DEFINES], [gl_mda_defines=' #if defined _WIN32 && !defined __CYGWIN__ #define access _access #define chdir _chdir #define chmod _chmod #define close _close #define creat _creat #define dup _dup #define dup2 _dup2 #define ecvt _ecvt #define execl _execl #define execle _execle #define execlp _execlp #define execv _execv #define execve _execve #define execvp _execvp #define execvpe _execvpe #define fcloseall _fcloseall #define fcvt _fcvt #define fdopen _fdopen #define fileno _fileno #define gcvt _gcvt #define getcwd _getcwd #define getpid _getpid #define getw _getw #define isatty _isatty #define j0 _j0 #define j1 _j1 #define jn _jn #define lfind _lfind #define lsearch _lsearch #define lseek _lseek #define memccpy _memccpy #define mkdir _mkdir #define mktemp _mktemp #define open _open #define putenv _putenv #define putw _putw #define read _read #define rmdir _rmdir #define strdup _strdup #define swab _swab #define tempnam _tempnam #define tzset _tzset #define umask _umask #define unlink _unlink #define utime _utime #define wcsdup _wcsdup #define write _write #define y0 _y0 #define y1 _y1 #define yn _yn #endif ' ]) groff-1.24.1/gnulib_m4/unicase_h.m40000644000175000017500000000346615153275164013725 00000000000000# unicase_h.m4 # serial 1 dnl Copyright (C) 2023-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN_ONCE([gl_UNICASE_H], [ dnl Ensure to expand the default settings once only, before all statements dnl that occur in other macros. AC_REQUIRE([gl_UNICASE_H_DEFAULTS]) ]) # gl_UNICASE_MODULE_INDICATOR([modulename]) # sets the shell variable that indicates the presence of the given module # to a C preprocessor expression that will evaluate to 1. # This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_UNICASE_MODULE_INDICATOR], [ dnl Ensure to expand the default settings once only. gl_UNICASE_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) # Initializes the default values for AC_SUBSTed shell variables. # This macro must not be AC_REQUIREd. It must only be invoked, and only # outside of macros or in macros that are not AC_REQUIREd. AC_DEFUN([gl_UNICASE_H_REQUIRE_DEFAULTS], [ m4_defun(GL_MODULE_INDICATOR_PREFIX[_UNICASE_H_MODULE_INDICATOR_DEFAULTS], [ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICASE_EMPTY_PREFIX_CONTEXT_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICASE_EMPTY_SUFFIX_CONTEXT_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_UNICASE_H_MODULE_INDICATOR_DEFAULTS]) AC_REQUIRE([gl_UNICASE_H_DEFAULTS]) ]) AC_DEFUN([gl_UNICASE_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. ]) groff-1.24.1/gnulib_m4/std-gnu11.m40000644000175000017500000006111315153275164013503 00000000000000# std-gnu11.m4 # serial 3 # Prefer GNU C11 and C++11 to earlier versions. -*- coding: utf-8 -*- # The std-gnu23 module, which defines _AC_C_C23_OPTIONS, supersedes us. m4_ifndef([_AC_C_C23_OPTIONS], [ # This implementation is taken from GNU Autoconf lib/autoconf/c.m4 # commit 017d5ddd82854911f0119691d91ea8a1438824d6 # dated Sun Apr 3 13:57:17 2016 -0700 # with minor changes to commentary. # This implementation will be obsolete once we can assume Autoconf 2.70 # or later is installed everywhere a Gnulib program might be developed. m4_version_prereq([2.70], [], [ # Copyright (C) 2001-2026 Free Software Foundation, Inc. # This file is part of Autoconf. This program is free # software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # Under Section 7 of GPL version 3, you are granted additional # permissions described in the Autoconf Configure Script Exception, # version 3.0, as published by the Free Software Foundation. # # You should have received a copy of the GNU General Public License # and a copy of the Autoconf Configure Script Exception along with # this program; see the files COPYINGv3 and COPYING.EXCEPTION # respectively. If not, see and # . # Written by David MacKenzie, with help from # Akim Demaille, Paul Eggert, # François Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, # Roland McGrath, Noah Friedman, david d zuhn, and many others. # AC_PROG_CC([COMPILER ...]) # -------------------------- # COMPILER ... is a space separated list of C compilers to search for. # This just gives the user an opportunity to specify an alternative # search list for the C compiler. AC_DEFUN([AC_PROG_CC], [AC_LANG_PUSH(C)dnl AC_ARG_VAR([CC], [C compiler command])dnl AC_ARG_VAR([CFLAGS], [C compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl _AC_ARG_VAR_LIBS()dnl _AC_ARG_VAR_CPPFLAGS()dnl m4_ifval([$1], [AC_CHECK_TOOLS(CC, [$1])], [AC_CHECK_TOOL(CC, gcc) if test -z "$CC"; then dnl Here we want: dnl AC_CHECK_TOOL(CC, cc) dnl but without the check for a tool without the prefix. dnl Until the check is removed from there, copy the code: if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(CC, [${ac_tool_prefix}cc], [${ac_tool_prefix}cc]) fi fi if test -z "$CC"; then AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) fi if test -z "$CC"; then AC_CHECK_TOOLS(CC, cl.exe) fi if test -z "$CC"; then AC_CHECK_TOOL(CC, clang) fi ]) test -z "$CC" && AC_MSG_FAILURE([no acceptable C compiler found in \$PATH]) # Provide some information about the compiler. _AS_ECHO_LOG([checking for _AC_LANG compiler version]) set X $ac_compile ac_compiler=$[2] for ac_option in --version -v -V -qversion -version; do _AC_DO_LIMIT([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD]) done m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl _AC_LANG_COMPILER_GNU if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi _AC_PROG_CC_G dnl dnl Set ac_prog_cc_stdc to the supported C version. dnl Also set the documented variable ac_cv_prog_cc_stdc; dnl its name was chosen when it was cached, but it is no longer cached. _AC_PROG_CC_C11([ac_prog_cc_stdc=c11 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11], [_AC_PROG_CC_C99([ac_prog_cc_stdc=c99 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99], [_AC_PROG_CC_C89([ac_prog_cc_stdc=c89 ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89], [ac_prog_cc_stdc=no ac_cv_prog_cc_stdc=no])])]) dnl AC_LANG_POP(C)dnl ])# AC_PROG_CC # AC_PROG_CXX([LIST-OF-COMPILERS]) # -------------------------------- # LIST-OF-COMPILERS is a space separated list of C++ compilers to search # for (if not specified, a default list is used). This just gives the # user an opportunity to specify an alternative search list for the C++ # compiler. # aCC HP-UX C++ compiler much better than `CC', so test before. # FCC Fujitsu C++ compiler # KCC KAI C++ compiler # RCC Rational C++ # xlC_r AIX C Set++ (with support for reentrant code) # xlC AIX C Set++ AC_DEFUN([AC_PROG_CXX], [AC_LANG_PUSH(C++)dnl AC_ARG_VAR([CXX], [C++ compiler command])dnl AC_ARG_VAR([CXXFLAGS], [C++ compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl _AC_ARG_VAR_LIBS()dnl _AC_ARG_VAR_CPPFLAGS()dnl _AC_ARG_VAR_PRECIOUS([CCC])dnl if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else AC_CHECK_TOOLS(CXX, [m4_default([$1], [g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++])], g++) fi fi # Provide some information about the compiler. _AS_ECHO_LOG([checking for _AC_LANG compiler version]) set X $ac_compile ac_compiler=$[2] for ac_option in --version -v -V -qversion; do _AC_DO_LIMIT([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD]) done m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl _AC_LANG_COMPILER_GNU if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi _AC_PROG_CXX_G _AC_PROG_CXX_CXX11([ac_prog_cxx_stdcxx=cxx11 ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 ac_cv_prog_cxx_cxx98=$ac_cv_prog_cxx_cxx11], [_AC_PROG_CXX_CXX98([ac_prog_cxx_stdcxx=cxx98 ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98], [ac_prog_cxx_stdcxx=no ac_cv_prog_cxx_stdcxx=no])]) AC_LANG_POP(C++)dnl ])# AC_PROG_CXX # _AC_C_STD_TRY(STANDARD, TEST-PROLOGUE, TEST-BODY, OPTION-LIST, # ACTION-IF-AVAILABLE, ACTION-IF-UNAVAILABLE) # -------------------------------------------------------------- # Check whether the C compiler accepts features of STANDARD (e.g `c89', `c99') # by trying to compile a program of TEST-PROLOGUE and TEST-BODY. If this fails, # try again with each compiler option in the space-separated OPTION-LIST; if one # helps, append it to CC. If eventually successful, run ACTION-IF-AVAILABLE, # else ACTION-IF-UNAVAILABLE. AC_DEFUN([_AC_C_STD_TRY], [AC_MSG_CHECKING([for $CC option to enable ]m4_translit($1, [c], [C])[ features]) AC_CACHE_VAL(ac_cv_prog_cc_$1, [ac_cv_prog_cc_$1=no ac_save_CC=$CC AC_LANG_CONFTEST([AC_LANG_PROGRAM([$2], [$3])]) for ac_arg in '' $4 do CC="$ac_save_CC $ac_arg" _AC_COMPILE_IFELSE([], [ac_cv_prog_cc_$1=$ac_arg]) test "x$ac_cv_prog_cc_$1" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ])# AC_CACHE_VAL ac_prog_cc_stdc_options= case "x$ac_cv_prog_cc_$1" in x) AC_MSG_RESULT([none needed]) ;; xno) AC_MSG_RESULT([unsupported]) ;; *) ac_prog_cc_stdc_options=" $ac_cv_prog_cc_$1" CC=$CC$ac_prog_cc_stdc_options AC_MSG_RESULT([$ac_cv_prog_cc_$1]) ;; esac AS_IF([test "x$ac_cv_prog_cc_$1" != xno], [$5], [$6]) ])# _AC_C_STD_TRY # _AC_C_C99_TEST_HEADER # --------------------- # A C header suitable for testing for C99. AC_DEFUN([_AC_C_C99_TEST_HEADER], [[#include #include #include #include #include #include // Check varargs macros. These examples are taken from C99 6.10.3.5. #define debug(...) fprintf (stderr, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK your preprocessor is broken; #endif #if BIG_OK #else your preprocessor is broken; #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\0'; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case 's': // string str = va_arg (args_copy, const char *); break; case 'd': // int number = va_arg (args_copy, int); break; case 'f': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; }]])# _AC_C_C99_TEST_HEADER # _AC_C_C99_TEST_BODY # ------------------- # A C body suitable for testing for C99, assuming the corresponding header. AC_DEFUN([_AC_C_C99_TEST_BODY], [[ // Check bool. _Bool success = false; // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' || dynamic_array[ni.number - 1] != 543); ]]) # _AC_PROG_CC_C99 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) # ---------------------------------------------------------------- # If the C compiler is not in ISO C99 mode by default, try to add an # option to output variable CC to make it so. This macro tries # various options that select ISO C99 on some system or another. It # considers the compiler to be in ISO C99 mode if it handles _Bool, # // comments, flexible array members, inline, long long int, mixed # code and declarations, named initialization of structs, restrict, # va_copy, varargs macros, variable declarations in for loops and # variable length arrays. AC_DEFUN([_AC_PROG_CC_C99], [_AC_C_STD_TRY([c99], [_AC_C_C99_TEST_HEADER], [_AC_C_C99_TEST_BODY], dnl Try dnl GCC -std=gnu99 (unused restrictive modes: -std=c99 -std=iso9899:1999) dnl IBM XL C -qlanglvl=extc1x (V12.1; does not pass C11 test) dnl IBM XL C -qlanglvl=extc99 dnl (pre-V12.1; unused restrictive mode: -qlanglvl=stdc99) dnl HP cc -AC99 dnl Intel ICC -std=c99, -c99 (deprecated) dnl IRIX -c99 dnl Solaris -D_STDC_C99= dnl cc's -xc99 option uses linker magic to define the external dnl symbol __xpg4 as if by "int __xpg4 = 1;", which enables C99 dnl behavior for C library functions. This is not wanted here, dnl because it means that a single module compiled with -xc99 dnl alters C runtime behavior for the entire program, not for dnl just the module. Instead, define the (private) symbol dnl _STDC_C99, which suppresses a bogus failure in . dnl The resulting compiler passes the test case here, and that's dnl good enough. For more, please see the thread starting at: dnl https://lists.gnu.org/r/autoconf/2010-12/msg00059.html dnl Tru64 -c99 dnl with extended modes being tried first. [[-std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99]], [$1], [$2])[]dnl ])# _AC_PROG_CC_C99 # _AC_PROG_CC_C11 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) # ---------------------------------------------------------------- # If the C compiler is not in ISO C11 mode by default, try to add an # option to output variable CC to make it so. This macro tries # various options that select ISO C11 on some system or another. It # considers the compiler to be in ISO C11 mode if it handles _Alignas, # _Alignof, _Noreturn, _Static_assert, UTF-8 string literals, # duplicate typedefs, and anonymous structures and unions. AC_DEFUN([_AC_PROG_CC_C11], [_AC_C_STD_TRY([c11], [_AC_C_C99_TEST_HEADER[ // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ]], [_AC_C_C99_TEST_BODY[ v1.i = 2; v1.w.k = 5; _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); ]], dnl Try dnl GCC -std=gnu11 (unused restrictive mode: -std=c11) dnl with extended modes being tried first. dnl dnl Do not try -qlanglvl=extc1x, because IBM XL C V12.1 (the latest version as dnl of September 2012) does not pass the C11 test. For now, try extc1x when dnl compiling the C99 test instead, since it enables _Static_assert and dnl _Noreturn, which is a win. If -qlanglvl=extc11 or -qlanglvl=extc1x passes dnl the C11 test in some future version of IBM XL C, we'll add it here, dnl preferably extc11. [[-std=gnu11]], [$1], [$2])[]dnl ])# _AC_PROG_CC_C11 # AC_PROG_CC_C89 # -------------- # Do not use AU_ALIAS here and in AC_PROG_CC_C99 and AC_PROG_CC_STDC, # as that'd be incompatible with how Automake redefines AC_PROG_CC. See # . AU_DEFUN([AC_PROG_CC_C89], [AC_REQUIRE([AC_PROG_CC])], [$0 is obsolete; use AC_PROG_CC] ) # AC_PROG_CC_C99 # -------------- AU_DEFUN([AC_PROG_CC_C99], [AC_REQUIRE([AC_PROG_CC])], [$0 is obsolete; use AC_PROG_CC] ) # AC_PROG_CC_STDC # --------------- AU_DEFUN([AC_PROG_CC_STDC], [AC_REQUIRE([AC_PROG_CC])], [$0 is obsolete; use AC_PROG_CC] ) # AC_C_PROTOTYPES # --------------- # Check if the C compiler supports prototypes, included if it needs # options. AC_DEFUN([AC_C_PROTOTYPES], [AC_REQUIRE([AC_PROG_CC])dnl if test "$ac_prog_cc_stdc" != no; then AC_DEFINE(PROTOTYPES, 1, [Define to 1 if the C compiler supports function prototypes.]) AC_DEFINE(__PROTOTYPES, 1, [Define like PROTOTYPES; this can be used by system headers.]) fi ])# AC_C_PROTOTYPES # _AC_CXX_STD_TRY(STANDARD, TEST-PROLOGUE, TEST-BODY, OPTION-LIST, # ACTION-IF-AVAILABLE, ACTION-IF-UNAVAILABLE) # ---------------------------------------------------------------- # Check whether the C++ compiler accepts features of STANDARD (e.g # `cxx98', `cxx11') by trying to compile a program of TEST-PROLOGUE # and TEST-BODY. If this fails, try again with each compiler option # in the space-separated OPTION-LIST; if one helps, append it to CXX. # If eventually successful, run ACTION-IF-AVAILABLE, else # ACTION-IF-UNAVAILABLE. AC_DEFUN([_AC_CXX_STD_TRY], [AC_MSG_CHECKING([for $CXX option to enable ]m4_translit(m4_translit($1, [x], [+]), [a-z], [A-Z])[ features]) AC_LANG_PUSH(C++)dnl AC_CACHE_VAL(ac_cv_prog_cxx_$1, [ac_cv_prog_cxx_$1=no ac_save_CXX=$CXX AC_LANG_CONFTEST([AC_LANG_PROGRAM([$2], [$3])]) for ac_arg in '' $4 do CXX="$ac_save_CXX $ac_arg" _AC_COMPILE_IFELSE([], [ac_cv_prog_cxx_$1=$ac_arg]) test "x$ac_cv_prog_cxx_$1" != "xno" && break done rm -f conftest.$ac_ext CXX=$ac_save_CXX ])# AC_CACHE_VAL ac_prog_cxx_stdcxx_options= case "x$ac_cv_prog_cxx_$1" in x) AC_MSG_RESULT([none needed]) ;; xno) AC_MSG_RESULT([unsupported]) ;; *) ac_prog_cxx_stdcxx_options=" $ac_cv_prog_cxx_$1" CXX=$CXX$ac_prog_cxx_stdcxx_options AC_MSG_RESULT([$ac_cv_prog_cxx_$1]) ;; esac AC_LANG_POP(C++)dnl AS_IF([test "x$ac_cv_prog_cxx_$1" != xno], [$5], [$6]) ])# _AC_CXX_STD_TRY # _AC_CXX_CXX98_TEST_HEADER # ------------------------- # A C++ header suitable for testing for CXX98. AC_DEFUN([_AC_CXX_CXX98_TEST_HEADER], [[ #include #include #include #include #include #include #include #include #include #include #include #include #include namespace test { typedef std::vector string_vec; typedef std::pair map_value; typedef std::map map_type; typedef std::set set_type; template class printer { public: printer(std::ostringstream& os): os(os) {} void operator() (T elem) { os << elem << std::endl; } private: std::ostringstream& os; }; } ]])# _AC_CXX_CXX98_TEST_HEADER # _AC_CXX_CXX98_TEST_BODY # ----------------------- # A C++ body suitable for testing for CXX98, assuming the corresponding header. AC_DEFUN([_AC_CXX_CXX98_TEST_BODY], [[ try { // Basic string. std::string teststr("ASCII text"); teststr += " string"; // Simple vector. test::string_vec testvec; testvec.push_back(teststr); testvec.push_back("foo"); testvec.push_back("bar"); if (testvec.size() != 3) { throw std::runtime_error("vector size is not 1"); } // Dump vector into stringstream and obtain string. std::ostringstream os; for (test::string_vec::const_iterator i = testvec.begin(); i != testvec.end(); ++i) { if (i + 1 != testvec.end()) { os << teststr << '\n'; } } // Check algorithms work. std::for_each(testvec.begin(), testvec.end(), test::printer(os)); std::string os_out = os.str(); // Test pair and map. test::map_type testmap; testmap.insert(std::make_pair(std::string("key"), std::make_pair(53,false))); // Test set. int values[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; test::set_type testset(values, values + sizeof(values)/sizeof(values[0])); std::list testlist(testset.begin(), testset.end()); std::copy(testset.begin(), testset.end(), std::back_inserter(testlist)); } catch (const std::exception& e) { std::cerr << "Caught exception: " << e.what() << std::endl; // Test fstream std::ofstream of("test.txt"); of << "Test ASCII text\n" << std::flush; of << "N= " << std::hex << std::setw(8) << std::left << 534 << std::endl; of.close(); } std::exit(0); ]]) # _AC_CXX_CXX11_TEST_HEADER # ------------------------- # A C++ header suitable for testing for CXX11. AC_DEFUN([_AC_CXX_CXX11_TEST_HEADER], [[ #include #include #include #include #include #include #include namespace cxx11test { typedef std::shared_ptr sptr; typedef std::weak_ptr wptr; typedef std::tuple tp; typedef std::array int_array; constexpr int get_val() { return 20; } struct testinit { int i; double d; }; class delegate { public: delegate(int n) : n(n) {} delegate(): delegate(2354) {} virtual int getval() { return this->n; }; protected: int n; }; class overridden : public delegate { public: overridden(int n): delegate(n) {} virtual int getval() override final { return this->n * 2; } }; class nocopy { public: nocopy(int i): i(i) {} nocopy() = default; nocopy(const nocopy&) = delete; nocopy & operator=(const nocopy&) = delete; private: int i; }; } ]])# _AC_CXX_CXX11_TEST_HEADER # _AC_CXX_CXX11_TEST_BODY # ----------------------- # A C++ body suitable for testing for CXX11, assuming the corresponding header. AC_DEFUN([_AC_CXX_CXX11_TEST_BODY], [[ { // Test auto and decltype std::deque d; d.push_front(43); d.push_front(484); d.push_front(3); d.push_front(844); int total = 0; for (auto i = d.begin(); i != d.end(); ++i) { total += *i; } auto a1 = 6538; auto a2 = 48573953.4; auto a3 = "String literal"; decltype(a2) a4 = 34895.034; } { // Test constexpr short sa[cxx11test::get_val()] = { 0 }; } { // Test initializer lists cxx11test::testinit il = { 4323, 435234.23544 }; } { // Test range-based for and lambda cxx11test::int_array array = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; for (int &x : array) { x += 23; } std::for_each(array.begin(), array.end(), [](int v1){ std::cout << v1; }); } { using cxx11test::sptr; using cxx11test::wptr; sptr sp(new std::string("ASCII string")); wptr wp(sp); sptr sp2(wp); } { cxx11test::tp tuple("test", 54, 45.53434); double d = std::get<2>(tuple); std::string s; int i; std::tie(s,i,d) = tuple; } { static std::regex filename_regex("^_?([a-z0-9_.]+-)+[a-z0-9]+$"); std::string testmatch("Test if this string matches"); bool match = std::regex_search(testmatch, filename_regex); } { cxx11test::int_array array = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; cxx11test::int_array::size_type size = array.size(); } { // Test constructor delegation cxx11test::delegate d1; cxx11test::delegate d2(); cxx11test::delegate d3(45); } { // Test override and final cxx11test::overridden o1(55464); } { // Test nullptr char *c = nullptr; } { // Test template brackets std::vector> v1; } { // Unicode literals auto const *utf8 = u8"UTF-8 string \u2500"; // This is portable to C++20. char16_t const *utf16 = u"UTF-8 string \u2500"; char32_t const *utf32 = U"UTF-32 string \u2500"; } ]]) # _AC_PROG_CXX_CXX98 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) # ------------------------------------------------------------------- # If the C++ compiler is not in ISO C++98 mode by default, try to add # an option to output variable CXX to make it so. This macro tries # various options that select ISO C++98 on some system or another. It # considers the compiler to be in ISO C++98 mode if it handles basic # features of the std namespace including: string, containers (list, # map, set, vector), streams (fstreams, iostreams, stringstreams, # iomanip), pair, exceptions and algorithms. AC_DEFUN([_AC_PROG_CXX_CXX98], [_AC_CXX_STD_TRY([cxx98], [_AC_CXX_CXX98_TEST_HEADER], [_AC_CXX_CXX98_TEST_BODY], dnl Try dnl GCC -std=gnu++98 (unused restrictive mode: -std=c++98) dnl IBM XL C -qlanglvl=extended dnl HP aC++ -AA dnl Intel ICC -std=gnu++98 dnl Solaris N/A (default) dnl Tru64 N/A (default, but -std gnu could be used) dnl with extended modes being tried first. [[-std=gnu++98 -std=c++98 -qlanglvl=extended -AA]], [$1], [$2])[]dnl ])# _AC_PROG_CXX_CXX98 # _AC_PROG_CXX_CXX11 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE]) # ------------------------------------------------------------------- # If the C++ compiler is not in ISO CXX11 mode by default, try to add # an option to output variable CXX to make it so. This macro tries # various options that select ISO C++11 on some system or another. It # considers the compiler to be in ISO C++11 mode if it handles all the # tests from the C++98 checks, plus the following: Language features # (auto, constexpr, decltype, default/deleted constructors, delegate # constructors, final, initializer lists, lambda functions, nullptr, # override, range-based for loops, template brackets without spaces, # unicode literals) and library features (array, memory (shared_ptr, # weak_ptr), regex and tuple types). AC_DEFUN([_AC_PROG_CXX_CXX11], [_AC_CXX_STD_TRY([cxx11], [_AC_CXX_CXX11_TEST_HEADER _AC_CXX_CXX98_TEST_HEADER], [_AC_CXX_CXX11_TEST_BODY _AC_CXX_CXX98_TEST_BODY], dnl Try dnl GCC -std=gnu++11 (unused restrictive mode: -std=c++11) [and 0x variants] dnl IBM XL C -qlanglvl=extended0x dnl (pre-V12.1; unused restrictive mode: -qlanglvl=stdcxx11) dnl HP aC++ -AA dnl Intel ICC -std=c++11 -std=c++0x dnl Solaris N/A (no support) dnl Tru64 N/A (no support) dnl with extended modes being tried first. [[-std=gnu++11 -std=c++11 -std=gnu++0x -std=c++0x -qlanglvl=extended0x -AA]], [$1], [$2])[]dnl ])# _AC_PROG_CXX_CXX11 ])# m4_version_prereq ])# !_AC_C_C23_OPTIONS groff-1.24.1/gnulib_m4/gnulib-comp.m40000644000175000017500000012510315153275164014174 00000000000000# DO NOT EDIT! GENERATED AUTOMATICALLY! # Copyright (C) 2002-2026 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This file is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this file. If not, see . # # As a special exception to the GNU General Public License, # this file may be distributed as part of a program that # contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. # # This file represents the compiled summary of the specification in # gnulib-cache.m4. It lists the computed macro invocations that need # to be invoked from configure.ac. # In projects that use version control, this file can be treated like # other built files. # This macro should be invoked from ./configure.ac, in the section # "Checks for programs", right after AC_PROG_CC, and certainly before # any checks for libraries, header files, types and library functions. AC_DEFUN([gl_EARLY], [ m4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace m4_pattern_allow([^gl_ES$])dnl a valid locale name m4_pattern_allow([^gl_LIBOBJS$])dnl a variable m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable # Pre-early section. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gl_PROG_AR_RANLIB]) # Code from module absolute-header: # Code from module alloca-opt: # Code from module assert-h: # Code from module attribute: # Code from module bool: # Code from module builtin-expect: # Code from module c32isalnum: # Code from module c32isalpha: # Code from module c32isblank: # Code from module c32iscntrl: # Code from module c32isdigit: # Code from module c32isgraph: # Code from module c32islower: # Code from module c32isprint: # Code from module c32ispunct: # Code from module c32isspace: # Code from module c32isupper: # Code from module c32isxdigit: # Code from module c32tolower: # Code from module c32width: # Code from module c99: # Code from module environ: # Code from module errno-h: # Code from module extensions: # This is actually already done in the pre-early phase. # AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) # Code from module extensions-aix: AC_REQUIRE([gl_USE_AIX_EXTENSIONS]) # Code from module extern-inline: # Code from module fabs: # Code from module fcntl-h: # Code from module filename: # Code from module float-h: # Code from module fmod: # Code from module fpieee: AC_REQUIRE([gl_FP_IEEE]) # Code from module fprintf-posix: # Code from module fpucw: # Code from module free-posix: # Code from module frexp: # Code from module frexp-nolibm: # Code from module frexpl-nolibm: # Code from module fseterr: # Code from module gen-header: # Code from module getopt-gnu: # Code from module getopt-posix: # Code from module gettext-h: # Code from module git-version-gen: # Code from module gnulib-i18n: # Code from module hard-locale: # Code from module havelib: # Code from module hypot: # Code from module idx: # Code from module include_next: # Code from module intprops: # Code from module inttypes-h-incomplete: # Code from module isfinite-no-c++: # Code from module isinf-no-c++: # Code from module isnand: # Code from module isnand-nolibm: # Code from module isnanf-nolibm: # Code from module isnanl-nolibm: # Code from module issymlink: # Code from module iswblank: # Code from module iswdigit: # Code from module iswpunct: # Code from module iswxdigit: # Code from module largefile: AC_REQUIRE([AC_SYS_LARGEFILE]) # Code from module ldexp: # Code from module limits-h: # Code from module localcharset: # Code from module locale-h: # Code from module localeconv: # Code from module lstat: # Code from module malloc-posix: # Code from module malloca: # Code from module math-h: # Code from module mbchar: # Code from module mbiterf: # Code from module mbrtoc32: # Code from module mbrtowc: # Code from module mbsinit: # Code from module mbsnlen: # Code from module mbszero: # Code from module memchr: # Code from module memmem: # Code from module memmem-simple: # Code from module mixin/printf-posix: # Code from module multiarch: # Code from module nocrash: # Code from module once: # Code from module package-version: # Code from module pathmax: # Code from module printf-frexp: # Code from module printf-frexpl: # Code from module printf-safe: # Code from module pthread-h: gl_ANYTHREADLIB_EARLY # Code from module pthread-once: # Code from module putenv: # Code from module putenv-gnu: # Code from module readlink: # Code from module sched-h: # Code from module setlocale-null: # Code from module setlocale-null-unlocked: # Code from module signbit-no-c++: # Code from module size_max: # Code from module snippet/_Noreturn: # Code from module snippet/arg-nonnull: # Code from module snippet/c++defs: # Code from module snippet/warn-on-use: # Code from module snprintf: # Code from module sqrt: # Code from module ssize_t: # Code from module stat: # Code from module stat-time: # Code from module std-gnu11: # Code from module stdbool-h-c99: # Code from module stdckdint-h: # Code from module stdcountof-h: # Code from module stddef-h: # Code from module stdint-h: # Code from module stdio-h: gl_STDIO_H_EARLY # Code from module stdio-windows: # Code from module stdlib-h: # Code from module strcase: # Code from module strcasecmp: # Code from module streq: # Code from module strerror: # Code from module strerror-override: # Code from module string-h: # Code from module stringeq: # Code from module strings-h: # Code from module strncasecmp: # Code from module strsignal: # Code from module sys_stat-h: # Code from module sys_types-h: AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) # Code from module sys_wait-h: # Code from module threadlib: gl_THREADLIB_EARLY # Code from module time-h: # Code from module tls: # Code from module trunc: # Code from module uchar-h: # Code from module unicase/base: # Code from module unicase/tolower: # Code from module unictype/base: # Code from module unictype/ctype-alnum: # Code from module unictype/ctype-alpha: # Code from module unictype/ctype-blank: # Code from module unictype/ctype-cntrl: # Code from module unictype/ctype-digit: # Code from module unictype/ctype-graph: # Code from module unictype/ctype-lower: # Code from module unictype/ctype-print: # Code from module unictype/ctype-punct: # Code from module unictype/ctype-space: # Code from module unictype/ctype-upper: # Code from module unictype/ctype-xdigit: # Code from module uninorm/base: # Code from module unistd-h: # Code from module unitypes-h: # Code from module uniwidth/base: # Code from module uniwidth/width: # Code from module unlink: # Code from module unsetenv: # Code from module vararrays: # Code from module vasnprintf: # Code from module vfzprintf: # Code from module vsnprintf: # Code from module vsnzprintf: # Code from module wchar-h: # Code from module wctype-h: # Code from module wcwidth: # Code from module windows-once: # Code from module windows-tls: # Code from module xalloc-oversized: # Code from module xsize: ]) # This macro should be invoked from ./configure.ac, in the section # "Check for header files, types and library functions". AC_DEFUN([gl_INIT], [ AM_CONDITIONAL([GL_COND_LIBTOOL], [false]) gl_cond_libtool=false gl_libdeps= gl_ltlibdeps= gl_m4_base='gnulib_m4' m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ])) m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS])) m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES])) m4_pushdef([gl_LIBSOURCES_LIST], []) m4_pushdef([gl_LIBSOURCES_DIR], []) m4_pushdef([GL_MACRO_PREFIX], [gl]) m4_pushdef([GL_MODULE_INDICATOR_PREFIX], [GL]) gl_COMMON gl_source_base='lib' gl_source_base_prefix='$(top_build_prefix)lib/' gl_FUNC_ALLOCA gl_CONDITIONAL_HEADER([alloca.h]) AC_PROG_MKDIR_P gl_ASSERT_H gl_CONDITIONAL_HEADER([assert.h]) AC_PROG_MKDIR_P gl_C_BOOL gl___BUILTIN_EXPECT AC_REQUIRE([gl_UCHAR_H]) dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is dnl determined. It describes how mbrtoc32 is implemented. AC_REQUIRE([gl_MBSTATE_T_BROKEN]) AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) AC_REQUIRE([gl_C32RTOMB_SANITYCHECK]) gl_UCHAR_MODULE_INDICATOR([c32isalnum]) AC_REQUIRE([gl_UCHAR_H]) dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is dnl determined. It describes how mbrtoc32 is implemented. AC_REQUIRE([gl_MBSTATE_T_BROKEN]) AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) AC_REQUIRE([gl_C32RTOMB_SANITYCHECK]) gl_UCHAR_MODULE_INDICATOR([c32isalpha]) AC_REQUIRE([gl_UCHAR_H]) dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is dnl determined. It describes how mbrtoc32 is implemented. AC_REQUIRE([gl_MBSTATE_T_BROKEN]) AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) AC_REQUIRE([gl_C32RTOMB_SANITYCHECK]) gl_UCHAR_MODULE_INDICATOR([c32isblank]) AC_REQUIRE([gl_UCHAR_H]) dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is dnl determined. It describes how mbrtoc32 is implemented. AC_REQUIRE([gl_MBSTATE_T_BROKEN]) AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) AC_REQUIRE([gl_C32RTOMB_SANITYCHECK]) gl_UCHAR_MODULE_INDICATOR([c32iscntrl]) AC_REQUIRE([gl_UCHAR_H]) dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is dnl determined. It describes how mbrtoc32 is implemented. AC_REQUIRE([gl_MBSTATE_T_BROKEN]) AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) AC_REQUIRE([gl_C32RTOMB_SANITYCHECK]) gl_UCHAR_MODULE_INDICATOR([c32isdigit]) AC_REQUIRE([gl_UCHAR_H]) dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is dnl determined. It describes how mbrtoc32 is implemented. AC_REQUIRE([gl_MBSTATE_T_BROKEN]) AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) AC_REQUIRE([gl_C32RTOMB_SANITYCHECK]) gl_UCHAR_MODULE_INDICATOR([c32isgraph]) AC_REQUIRE([gl_UCHAR_H]) dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is dnl determined. It describes how mbrtoc32 is implemented. AC_REQUIRE([gl_MBSTATE_T_BROKEN]) AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) AC_REQUIRE([gl_C32RTOMB_SANITYCHECK]) gl_UCHAR_MODULE_INDICATOR([c32islower]) AC_REQUIRE([gl_UCHAR_H]) dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is dnl determined. It describes how mbrtoc32 is implemented. AC_REQUIRE([gl_MBSTATE_T_BROKEN]) AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) AC_REQUIRE([gl_C32RTOMB_SANITYCHECK]) gl_UCHAR_MODULE_INDICATOR([c32isprint]) AC_REQUIRE([gl_UCHAR_H]) dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is dnl determined. It describes how mbrtoc32 is implemented. AC_REQUIRE([gl_MBSTATE_T_BROKEN]) AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) AC_REQUIRE([gl_C32RTOMB_SANITYCHECK]) gl_UCHAR_MODULE_INDICATOR([c32ispunct]) AC_REQUIRE([gl_UCHAR_H]) dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is dnl determined. It describes how mbrtoc32 is implemented. AC_REQUIRE([gl_MBSTATE_T_BROKEN]) AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) AC_REQUIRE([gl_C32RTOMB_SANITYCHECK]) gl_UCHAR_MODULE_INDICATOR([c32isspace]) AC_REQUIRE([gl_UCHAR_H]) dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is dnl determined. It describes how mbrtoc32 is implemented. AC_REQUIRE([gl_MBSTATE_T_BROKEN]) AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) AC_REQUIRE([gl_C32RTOMB_SANITYCHECK]) gl_UCHAR_MODULE_INDICATOR([c32isupper]) AC_REQUIRE([gl_UCHAR_H]) dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is dnl determined. It describes how mbrtoc32 is implemented. AC_REQUIRE([gl_MBSTATE_T_BROKEN]) AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) AC_REQUIRE([gl_C32RTOMB_SANITYCHECK]) gl_UCHAR_MODULE_INDICATOR([c32isxdigit]) AC_REQUIRE([gl_UCHAR_H]) dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is dnl determined. It describes how mbrtoc32 is implemented. AC_REQUIRE([gl_MBSTATE_T_BROKEN]) AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) AC_REQUIRE([gl_C32RTOMB_SANITYCHECK]) gl_UCHAR_MODULE_INDICATOR([c32tolower]) AC_REQUIRE([gl_UCHAR_H]) dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is dnl determined. It describes how mbrtoc32 is implemented. AC_REQUIRE([gl_MBSTATE_T_BROKEN]) AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) AC_REQUIRE([gl_C32RTOMB_SANITYCHECK]) gl_UCHAR_MODULE_INDICATOR([c32width]) gl_ENVIRON gl_UNISTD_MODULE_INDICATOR([environ]) gl_HEADER_ERRNO_H gl_CONDITIONAL_HEADER([errno.h]) AC_PROG_MKDIR_P AC_REQUIRE([gl_EXTERN_INLINE]) gl_FUNC_FABS gl_FCNTL_H gl_FCNTL_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_FLOAT_H gl_CONDITIONAL_HEADER([float.h]) AC_PROG_MKDIR_P gl_CONDITIONAL([GL_COND_OBJ_FLOAT], [test $REPLACE_FLOAT_LDBL = 1 || test $REPLACE_FLOAT_SNAN = 1]) gl_CONDITIONAL([GL_COND_OBJ_ITOLD], [test $REPLACE_ITOLD = 1]) dnl Prerequisites of lib/float.c. AC_REQUIRE([gl_BIGENDIAN]) gl_FUNC_FMOD gl_CONDITIONAL([GL_COND_OBJ_FMOD], [test $REPLACE_FMOD = 1]) gl_MATH_MODULE_INDICATOR([fmod]) gl_FUNC_FPRINTF_POSIX gl_STDIO_MODULE_INDICATOR([fprintf-posix]) gl_FUNC_FREE gl_CONDITIONAL([GL_COND_OBJ_FREE], [test $REPLACE_FREE = 1]) AM_COND_IF([GL_COND_OBJ_FREE], [ gl_PREREQ_FREE ]) gl_STDLIB_MODULE_INDICATOR([free-posix]) AC_REQUIRE([gl_FUNC_FREXP]) if test $gl_func_frexp != yes; then AC_LIBOBJ([frexp]) fi gl_MATH_MODULE_INDICATOR([frexp]) gl_FUNC_FREXP_NO_LIBM if test $gl_func_frexp_no_libm != yes; then AC_LIBOBJ([frexp]) fi gl_MATH_MODULE_INDICATOR([frexp]) gl_FUNC_FREXPL_NO_LIBM if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl_no_libm = no; then AC_LIBOBJ([frexpl]) fi gl_MATH_MODULE_INDICATOR([frexpl]) gl_FUNC_FSETERR gl_CONDITIONAL([GL_COND_OBJ_FSETERR], [test $ac_cv_func___fseterr = no]) gl_FUNC_GETOPT_GNU dnl Because of the way gl_FUNC_GETOPT_GNU is implemented (the gl_getopt_required dnl mechanism), there is no need to do any AC_LIBOBJ or AC_SUBST here; they are dnl done in the getopt-posix module. gl_FUNC_GETOPT_POSIX gl_CONDITIONAL_HEADER([getopt.h]) gl_CONDITIONAL_HEADER([getopt-cdefs.h]) AC_PROG_MKDIR_P gl_CONDITIONAL([GL_COND_OBJ_GETOPT], [test $REPLACE_GETOPT = 1]) AM_COND_IF([GL_COND_OBJ_GETOPT], [ dnl Define the substituted variable GNULIB_UNISTD_H_GETOPT to 1. gl_UNISTD_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_GETOPT], [1]) ]) gl_UNISTD_MODULE_INDICATOR([getopt-posix]) gl_MUSL_LIBC gl_GETTEXT_H GNULIB_I18N AC_REQUIRE([gl_FUNC_SETLOCALE_NULL]) HARD_LOCALE_LIB="$SETLOCALE_NULL_LIB" AC_SUBST([HARD_LOCALE_LIB]) dnl For backward compatibility. LIB_HARD_LOCALE="$HARD_LOCALE_LIB" AC_SUBST([LIB_HARD_LOCALE]) AC_DEFUN([gl_HAVE_MODULE_HAVELIB]) gl_FUNC_HYPOT gl_CONDITIONAL([GL_COND_OBJ_HYPOT], [test $REPLACE_HYPOT = 1]) gl_MATH_MODULE_INDICATOR([hypot]) gl_INTTYPES_INCOMPLETE gl_INTTYPES_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_ISFINITE gl_CONDITIONAL([GL_COND_OBJ_ISFINITE], [test $REPLACE_ISFINITE = 1]) gl_MATH_MODULE_INDICATOR([isfinite-no-cxx]) gl_ISINF gl_CONDITIONAL([GL_COND_OBJ_ISINF], [test $REPLACE_ISINF = 1]) gl_MATH_MODULE_INDICATOR([isinf-no-cxx]) gl_FUNC_ISNAND m4_ifdef([gl_ISNAN], [ AC_REQUIRE([gl_ISNAN]) ]) if test $HAVE_ISNAND = 0 || test $REPLACE_ISNAN = 1; then AC_LIBOBJ([isnand]) gl_PREREQ_ISNAND fi gl_MATH_MODULE_INDICATOR([isnand]) gl_FUNC_ISNAND_NO_LIBM if test $gl_func_isnand_no_libm != yes; then AC_LIBOBJ([isnand]) gl_PREREQ_ISNAND fi gl_FUNC_ISNANF_NO_LIBM if test $gl_func_isnanf_no_libm != yes; then AC_LIBOBJ([isnanf]) gl_PREREQ_ISNANF fi gl_FUNC_ISNANL_NO_LIBM if test $gl_func_isnanl_no_libm != yes; then AC_LIBOBJ([isnanl]) gl_PREREQ_ISNANL fi gl_MODULE_INDICATOR([issymlink]) gl_FUNC_ISWBLANK gl_CONDITIONAL([GL_COND_OBJ_ISWBLANK], [! { test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; } && { test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; }]) gl_WCTYPE_MODULE_INDICATOR([iswblank]) gl_FUNC_ISWDIGIT gl_CONDITIONAL([GL_COND_OBJ_ISWDIGIT], [! { test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; } && test $REPLACE_ISWDIGIT = 1]) gl_WCTYPE_MODULE_INDICATOR([iswdigit]) gl_FUNC_ISWPUNCT gl_CONDITIONAL([GL_COND_OBJ_ISWPUNCT], [! { test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; } && test $REPLACE_ISWPUNCT = 1]) gl_WCTYPE_MODULE_INDICATOR([iswpunct]) gl_FUNC_ISWXDIGIT gl_CONDITIONAL([GL_COND_OBJ_ISWXDIGIT], [! { test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; } && test $REPLACE_ISWXDIGIT = 1]) gl_WCTYPE_MODULE_INDICATOR([iswxdigit]) AC_REQUIRE([gl_LARGEFILE]) gl_FUNC_LDEXP gl_CONDITIONAL([GL_COND_OBJ_LDEXP], [test $REPLACE_LDEXP = 1]) gl_MATH_MODULE_INDICATOR([ldexp]) gl_LIMITS_H gl_CONDITIONAL_HEADER([limits.h]) AC_PROG_MKDIR_P gl_LOCALCHARSET dnl For backward compatibility. Some packages still use this. LOCALCHARSET_TESTS_ENVIRONMENT= AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT]) gl_LOCALE_H gl_LOCALE_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_FUNC_LOCALECONV gl_CONDITIONAL([GL_COND_OBJ_LOCALECONV], [test $REPLACE_LOCALECONV = 1]) AM_COND_IF([GL_COND_OBJ_LOCALECONV], [ gl_PREREQ_LOCALECONV ]) gl_LOCALE_MODULE_INDICATOR([localeconv]) gl_MODULE_INDICATOR([localeconv]) gl_FUNC_LSTAT gl_CONDITIONAL([GL_COND_OBJ_LSTAT], [test $REPLACE_LSTAT = 1]) AM_COND_IF([GL_COND_OBJ_LSTAT], [ gl_PREREQ_LSTAT ]) gl_SYS_STAT_MODULE_INDICATOR([lstat]) gl_MODULE_INDICATOR([lstat]) AC_REQUIRE([gl_FUNC_MALLOC_POSIX]) if test $REPLACE_MALLOC_FOR_MALLOC_POSIX = 1; then AC_LIBOBJ([malloc]) fi gl_STDLIB_MODULE_INDICATOR([malloc-posix]) gl_MALLOCA gl_MATH_H gl_MATH_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_MBCHAR gl_MBITER gl_FUNC_MBRTOC32 gl_CONDITIONAL([GL_COND_OBJ_MBRTOC32], [test $HAVE_MBRTOC32 = 0 || test $REPLACE_MBRTOC32 = 1]) AM_COND_IF([GL_COND_OBJ_MBRTOC32], [ if test $REPLACE_MBSTATE_T = 1; then AC_LIBOBJ([lc-charset-dispatch]) AC_LIBOBJ([mbtowc-lock]) gl_PREREQ_MBTOWC_LOCK fi gl_PREREQ_MBRTOC32 ]) gl_UCHAR_MODULE_INDICATOR([mbrtoc32]) gl_FUNC_MBRTOWC gl_CONDITIONAL([GL_COND_OBJ_MBRTOWC], [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]) AM_COND_IF([GL_COND_OBJ_MBRTOWC], [ if test $REPLACE_MBSTATE_T = 1; then AC_LIBOBJ([lc-charset-dispatch]) AC_LIBOBJ([mbtowc-lock]) gl_PREREQ_MBTOWC_LOCK fi gl_PREREQ_MBRTOWC ]) gl_WCHAR_MODULE_INDICATOR([mbrtowc]) gl_FUNC_MBSINIT gl_CONDITIONAL([GL_COND_OBJ_MBSINIT], [test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1]) AM_COND_IF([GL_COND_OBJ_MBSINIT], [ gl_PREREQ_MBSINIT ]) gl_WCHAR_MODULE_INDICATOR([mbsinit]) gl_STRING_MODULE_INDICATOR([mbsnlen]) AC_REQUIRE([AC_TYPE_MBSTATE_T]) gl_MBSTATE_T_BROKEN gl_MUSL_LIBC gl_WCHAR_MODULE_INDICATOR([mbszero]) gl_FUNC_MEMCHR gl_CONDITIONAL([GL_COND_OBJ_MEMCHR], [test $REPLACE_MEMCHR = 1]) AM_COND_IF([GL_COND_OBJ_MEMCHR], [ gl_PREREQ_MEMCHR ]) gl_STRING_MODULE_INDICATOR([memchr]) gl_FUNC_MEMMEM if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then AC_LIBOBJ([memmem]) fi gl_FUNC_MEMMEM_SIMPLE if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then AC_LIBOBJ([memmem]) fi gl_STRING_MODULE_INDICATOR([memmem]) # Conditionally invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. gl_MULTIARCH gl_ONCE gl_PATHMAX gl_FUNC_PRINTF_FREXP gl_FUNC_PRINTF_FREXPL m4_divert_text([INIT_PREPARE], [gl_printf_safe=yes]) gl_PTHREAD_H gl_PTHREAD_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_PTHREAD_ONCE gl_CONDITIONAL([GL_COND_OBJ_PTHREAD_ONCE], [test $HAVE_PTHREAD_ONCE = 0 || test $REPLACE_PTHREAD_ONCE = 1]) gl_PTHREAD_MODULE_INDICATOR([pthread-once]) gl_FUNC_PUTENV gl_CONDITIONAL([GL_COND_OBJ_PUTENV], [test $REPLACE_PUTENV = 1]) AM_COND_IF([GL_COND_OBJ_PUTENV], [ gl_PREREQ_PUTENV ]) gl_STDLIB_MODULE_INDICATOR([putenv]) gl_FUNC_READLINK gl_CONDITIONAL([GL_COND_OBJ_READLINK], [test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1]) AM_COND_IF([GL_COND_OBJ_READLINK], [ gl_PREREQ_READLINK ]) gl_UNISTD_MODULE_INDICATOR([readlink]) gl_SCHED_H gl_SCHED_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_FUNC_SETLOCALE_NULL gl_CONDITIONAL([GL_COND_OBJ_SETLOCALE_LOCK], [test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0]) AM_COND_IF([GL_COND_OBJ_SETLOCALE_LOCK], [ gl_PREREQ_SETLOCALE_LOCK ]) gl_LOCALE_MODULE_INDICATOR([setlocale_null]) gl_SIGNBIT gl_CONDITIONAL([GL_COND_OBJ_SIGNBIT3], [test $REPLACE_SIGNBIT = 1]) gl_MATH_MODULE_INDICATOR([signbit-no-cxx]) gl_SIZE_MAX gl_FUNC_SNPRINTF gl_STDIO_MODULE_INDICATOR([snprintf]) gl_MODULE_INDICATOR([snprintf]) gl_FUNC_SQRT gt_TYPE_SSIZE_T gl_FUNC_STAT gl_CONDITIONAL([GL_COND_OBJ_STAT], [test $REPLACE_STAT = 1]) AM_COND_IF([GL_COND_OBJ_STAT], [ case "$host_os" in mingw* | windows*) AC_LIBOBJ([stat-w32]) ;; esac gl_PREREQ_STAT ]) gl_SYS_STAT_MODULE_INDICATOR([stat]) gl_MODULE_INDICATOR([stat]) gl_STAT_TIME gl_STAT_BIRTHTIME gl_STDBOOL_H gl_CONDITIONAL_HEADER([stdbool.h]) AC_PROG_MKDIR_P gl_STDCKDINT_H gl_CONDITIONAL_HEADER([stdckdint.h]) AC_PROG_MKDIR_P gl_STDCOUNTOF_H gl_CONDITIONAL_HEADER([stdcountof.h]) AC_PROG_MKDIR_P gl_STDDEF_H gl_STDDEF_H_REQUIRE_DEFAULTS gl_CONDITIONAL_HEADER([stddef.h]) AC_PROG_MKDIR_P gl_STDINT_H gl_CONDITIONAL_HEADER([stdint.h]) dnl Because of gl_REPLACE_LIMITS_H: gl_CONDITIONAL_HEADER([limits.h]) AC_PROG_MKDIR_P gl_STDIO_H gl_STDIO_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_CONDITIONAL([GL_COND_OBJ_STDIO_READ], [test $REPLACE_STDIO_READ_FUNCS = 1]) gl_CONDITIONAL([GL_COND_OBJ_STDIO_WRITE], [test $REPLACE_STDIO_WRITE_FUNCS = 1]) dnl No need to create extra modules for these functions. Everyone who uses dnl likely needs them. gl_STDIO_MODULE_INDICATOR([fscanf]) gl_MODULE_INDICATOR([fscanf]) gl_STDIO_MODULE_INDICATOR([scanf]) gl_MODULE_INDICATOR([scanf]) gl_STDIO_MODULE_INDICATOR([fgetc]) gl_STDIO_MODULE_INDICATOR([getc]) gl_STDIO_MODULE_INDICATOR([getchar]) gl_STDIO_MODULE_INDICATOR([fgets]) gl_STDIO_MODULE_INDICATOR([fread]) dnl No need to create extra modules for these functions. Everyone who uses dnl likely needs them. gl_STDIO_MODULE_INDICATOR([fprintf]) gl_STDIO_MODULE_INDICATOR([printf]) gl_STDIO_MODULE_INDICATOR([vfprintf]) gl_STDIO_MODULE_INDICATOR([vprintf]) gl_STDIO_MODULE_INDICATOR([fputc]) gl_STDIO_MODULE_INDICATOR([putc]) gl_STDIO_MODULE_INDICATOR([putchar]) gl_STDIO_MODULE_INDICATOR([fputs]) gl_STDIO_MODULE_INDICATOR([puts]) gl_STDIO_MODULE_INDICATOR([fwrite]) AC_REQUIRE([AC_CANONICAL_HOST]) USES_MSVCRT=0 case "$host_os" in mingw* | windows*) AC_EGREP_CPP([Special], [ #ifndef _UCRT Special #endif ], [USES_MSVCRT=1]) ;; esac gl_CONDITIONAL([GL_COND_OBJ_STDIO_CONSOLESAFE], [test $USES_MSVCRT = 1]) AC_CHECK_FUNCS([vasprintf]) gl_STDLIB_H gl_STDLIB_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_FUNC_STRCASECMP gl_CONDITIONAL([GL_COND_OBJ_STRCASECMP], [test $HAVE_STRCASECMP = 0 || test $REPLACE_STRCASECMP = 1]) AM_COND_IF([GL_COND_OBJ_STRCASECMP], [ gl_PREREQ_STRCASECMP ]) gl_STRINGS_MODULE_INDICATOR([strcasecmp]) gl_FUNC_STRERROR gl_CONDITIONAL([GL_COND_OBJ_STRERROR], [test $REPLACE_STRERROR = 1]) gl_MODULE_INDICATOR([strerror]) gl_STRING_MODULE_INDICATOR([strerror]) AC_REQUIRE([gl_HEADER_ERRNO_H]) AC_REQUIRE([gl_FUNC_STRERROR_0]) gl_CONDITIONAL([GL_COND_OBJ_STRERROR_OVERRIDE], [test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1]) AM_COND_IF([GL_COND_OBJ_STRERROR_OVERRIDE], [ gl_PREREQ_SYS_H_WINSOCK2 ]) gl_STRING_H gl_STRING_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_FUNC_STREQ gl_FUNC_MEMEQ gl_STRING_MODULE_INDICATOR([stringeq]) gl_STRINGS_H gl_STRINGS_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_FUNC_STRNCASECMP gl_CONDITIONAL([GL_COND_OBJ_STRNCASECMP], [test $HAVE_STRNCASECMP = 0 || test $REPLACE_STRNCASECMP = 1]) AM_COND_IF([GL_COND_OBJ_STRNCASECMP], [ gl_PREREQ_STRNCASECMP ]) gl_STRINGS_MODULE_INDICATOR([strncasecmp]) gl_FUNC_STRSIGNAL gl_CONDITIONAL([GL_COND_OBJ_STRSIGNAL], [test $HAVE_STRSIGNAL = 0 || test $REPLACE_STRSIGNAL = 1]) AM_COND_IF([GL_COND_OBJ_STRSIGNAL], [ gl_PREREQ_STRSIGNAL ]) gl_STRING_MODULE_INDICATOR([strsignal]) gl_SYS_STAT_H gl_SYS_STAT_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_SYS_TYPES_H gl_SYS_TYPES_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_SYS_WAIT_H gl_SYS_WAIT_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P AC_REQUIRE([gl_THREADLIB]) gl_TIME_H gl_TIME_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_TLS gl_FUNC_TRUNC gl_CONDITIONAL([GL_COND_OBJ_TRUNC], [test $HAVE_DECL_TRUNC = 0 || test $REPLACE_TRUNC = 1]) gl_MATH_MODULE_INDICATOR([trunc]) gl_UCHAR_H gl_UCHAR_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_LIBUNISTRING_LIBHEADER([1.2], [unicase.h]) gl_UNICASE_H gl_UNICASE_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_LIBUNISTRING_MODULE([1.4], [unicase/tolower]) gl_LIBUNISTRING_LIBHEADER([1.3], [unictype.h]) gl_UNICTYPE_H gl_UNICTYPE_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P AC_REQUIRE([AC_C_INLINE]) gl_LIBUNISTRING_MODULE([1.4], [unictype/ctype-alnum]) AC_REQUIRE([AC_C_INLINE]) gl_LIBUNISTRING_MODULE([1.4], [unictype/ctype-alpha]) AC_REQUIRE([AC_C_INLINE]) gl_LIBUNISTRING_MODULE([1.4], [unictype/ctype-blank]) AC_REQUIRE([AC_C_INLINE]) gl_LIBUNISTRING_MODULE([1.4], [unictype/ctype-cntrl]) AC_REQUIRE([AC_C_INLINE]) gl_LIBUNISTRING_MODULE([1.4], [unictype/ctype-digit]) AC_REQUIRE([AC_C_INLINE]) gl_LIBUNISTRING_MODULE([1.4], [unictype/ctype-graph]) AC_REQUIRE([AC_C_INLINE]) gl_LIBUNISTRING_MODULE([1.4], [unictype/ctype-lower]) AC_REQUIRE([AC_C_INLINE]) gl_LIBUNISTRING_MODULE([1.4], [unictype/ctype-print]) AC_REQUIRE([AC_C_INLINE]) gl_LIBUNISTRING_MODULE([1.4], [unictype/ctype-punct]) AC_REQUIRE([AC_C_INLINE]) gl_LIBUNISTRING_MODULE([1.4], [unictype/ctype-space]) AC_REQUIRE([AC_C_INLINE]) gl_LIBUNISTRING_MODULE([1.4], [unictype/ctype-upper]) AC_REQUIRE([AC_C_INLINE]) gl_LIBUNISTRING_MODULE([1.4], [unictype/ctype-xdigit]) gl_LIBUNISTRING_LIBHEADER([1.2], [uninorm.h]) gl_UNINORM_H gl_UNINORM_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_UNISTD_H gl_UNISTD_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_LIBUNISTRING_LIBHEADER([0.9.11], [unitypes.h]) AC_PROG_MKDIR_P gl_UNITYPES_H gl_LIBUNISTRING_LIBHEADER([0.9.11], [uniwidth.h]) AC_PROG_MKDIR_P gl_LIBUNISTRING_MODULE([1.4], [uniwidth/width]) gl_FUNC_UNLINK gl_CONDITIONAL([GL_COND_OBJ_UNLINK], [test $REPLACE_UNLINK = 1]) gl_UNISTD_MODULE_INDICATOR([unlink]) gl_FUNC_UNSETENV gl_CONDITIONAL([GL_COND_OBJ_UNSETENV], [test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1]) AM_COND_IF([GL_COND_OBJ_UNSETENV], [ gl_PREREQ_UNSETENV ]) gl_STDLIB_MODULE_INDICATOR([unsetenv]) AC_C_VARARRAYS AC_REQUIRE([AC_C_RESTRICT]) gl_FUNC_VASNPRINTF gl_STDIO_MODULE_INDICATOR([vfzprintf]) gl_FUNC_VSNPRINTF gl_STDIO_MODULE_INDICATOR([vsnprintf]) gl_STDIO_MODULE_INDICATOR([vsnzprintf]) gl_WCHAR_H gl_WCHAR_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_WCTYPE_H gl_WCTYPE_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_FUNC_WCWIDTH gl_CONDITIONAL([GL_COND_OBJ_WCWIDTH], [test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1]) AM_COND_IF([GL_COND_OBJ_WCWIDTH], [ gl_PREREQ_WCWIDTH ]) gl_WCHAR_MODULE_INDICATOR([wcwidth]) AC_REQUIRE([AC_CANONICAL_HOST]) gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_ONCE], [case "$host_os" in mingw* | windows*) true;; *) false;; esac]) AC_REQUIRE([AC_CANONICAL_HOST]) gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_TLS], [case "$host_os" in mingw* | windows*) true;; *) false;; esac]) gl_XSIZE # End of code from modules m4_ifval(gl_LIBSOURCES_LIST, [ m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ || for gl_file in ]gl_LIBSOURCES_LIST[ ; do if test ! -r ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file ; then echo "missing file ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file" >&2 exit 1 fi done])dnl m4_if(m4_sysval, [0], [], [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])]) ]) m4_popdef([GL_MODULE_INDICATOR_PREFIX]) m4_popdef([GL_MACRO_PREFIX]) m4_popdef([gl_LIBSOURCES_DIR]) m4_popdef([gl_LIBSOURCES_LIST]) m4_popdef([AC_LIBSOURCES]) m4_popdef([AC_REPLACE_FUNCS]) m4_popdef([AC_LIBOBJ]) AC_CONFIG_COMMANDS_PRE([ gl_libobjs= gl_ltlibobjs= gl_libobjdeps= gl_libgnu_libobjs= gl_libgnu_ltlibobjs= gl_libgnu_libobjdeps= if test -n "$gl_LIBOBJS"; then # Remove the extension. changequote(,)dnl sed_drop_objext='s/\.o$//;s/\.obj$//' sed_dirname1='s,//*,/,g' sed_dirname2='s,\(.\)/$,\1,' sed_dirname3='s,[^/]*$,,' sed_basename1='s,.*/,,' changequote([, ])dnl for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do gl_libobjs="$gl_libobjs lib/$i.$ac_objext" gl_ltlibobjs="$gl_ltlibobjs lib/$i.lo" i_dir=`echo "$i" | sed -e "$sed_dirname1" -e "$sed_dirname2" -e "$sed_dirname3"` i_base=`echo "$i" | sed -e "$sed_basename1"` gl_libgnu_libobjs="$gl_libgnu_libobjs lib/$i_dir""libgnu_a-$i_base.$ac_objext" gl_libgnu_ltlibobjs="$gl_libgnu_ltlibobjs lib/$i_dir""libgnu_la-$i_base.lo" gl_libobjdeps="$gl_libobjdeps lib/$i_dir\$(DEPDIR)/$i_base.Po" gl_libgnu_libobjdeps="$gl_libgnu_libobjdeps lib/$i_dir\$(DEPDIR)/libgnu_a-$i_base.Po" done fi AC_SUBST([gl_LIBOBJS], [$gl_libobjs]) AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs]) AC_SUBST([gl_LIBOBJDEPS], [$gl_libobjdeps]) AC_SUBST([gl_libgnu_LIBOBJS], [$gl_libgnu_libobjs]) AC_SUBST([gl_libgnu_LTLIBOBJS], [$gl_libgnu_ltlibobjs]) AC_SUBST([gl_libgnu_LIBOBJDEPS], [$gl_libgnu_libobjdeps]) ]) gltests_libdeps= gltests_ltlibdeps= m4_pushdef([AC_LIBOBJ], m4_defn([gltests_LIBOBJ])) m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gltests_REPLACE_FUNCS])) m4_pushdef([AC_LIBSOURCES], m4_defn([gltests_LIBSOURCES])) m4_pushdef([gltests_LIBSOURCES_LIST], []) m4_pushdef([gltests_LIBSOURCES_DIR], []) m4_pushdef([GL_MACRO_PREFIX], [gltests]) m4_pushdef([GL_MODULE_INDICATOR_PREFIX], [GL]) gl_COMMON gl_source_base='tests' gl_source_base_prefix= changequote(,)dnl gltests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS changequote([, ])dnl AC_SUBST([gltests_WITNESS]) gl_module_indicator_condition=$gltests_WITNESS m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition]) m4_popdef([gl_MODULE_INDICATOR_CONDITION]) m4_ifval(gltests_LIBSOURCES_LIST, [ m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ || for gl_file in ]gltests_LIBSOURCES_LIST[ ; do if test ! -r ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file ; then echo "missing file ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file" >&2 exit 1 fi done])dnl m4_if(m4_sysval, [0], [], [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])]) ]) m4_popdef([GL_MODULE_INDICATOR_PREFIX]) m4_popdef([GL_MACRO_PREFIX]) m4_popdef([gltests_LIBSOURCES_DIR]) m4_popdef([gltests_LIBSOURCES_LIST]) m4_popdef([AC_LIBSOURCES]) m4_popdef([AC_REPLACE_FUNCS]) m4_popdef([AC_LIBOBJ]) AC_CONFIG_COMMANDS_PRE([ gltests_libobjs= gltests_ltlibobjs= gltests_libobjdeps= gltests_libgnu_libobjs= gltests_libgnu_ltlibobjs= gltests_libgnu_libobjdeps= if test -n "$gltests_LIBOBJS"; then # Remove the extension. changequote(,)dnl sed_drop_objext='s/\.o$//;s/\.obj$//' sed_dirname1='s,//*,/,g' sed_dirname2='s,\(.\)/$,\1,' sed_dirname3='s,[^/]*$,,' sed_basename1='s,.*/,,' changequote([, ])dnl for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do gltests_libobjs="$gltests_libobjs lib/$i.$ac_objext" gltests_ltlibobjs="$gltests_ltlibobjs lib/$i.lo" i_dir=`echo "$i" | sed -e "$sed_dirname1" -e "$sed_dirname2" -e "$sed_dirname3"` i_base=`echo "$i" | sed -e "$sed_basename1"` gltests_libgnu_libobjs="$gltests_libgnu_libobjs lib/$i_dir""libgnu_a-$i_base.$ac_objext" gltests_libgnu_ltlibobjs="$gltests_libgnu_ltlibobjs lib/$i_dir""libgnu_la-$i_base.lo" gltests_libobjdeps="$gltests_libobjdeps lib/$i_dir\$(DEPDIR)/$i_base.Po" gltests_libgnu_libobjdeps="$gltests_libgnu_libobjdeps lib/$i_dir\$(DEPDIR)/libgnu_a-$i_base.Po" done fi AC_SUBST([gltests_LIBOBJS], [$gltests_libobjs]) AC_SUBST([gltests_LTLIBOBJS], [$gltests_ltlibobjs]) AC_SUBST([gltests_LIBOBJDEPS], [$gltests_libobjdeps]) AC_SUBST([gltests_libgnu_LIBOBJS], [$gltests_libgnu_libobjs]) AC_SUBST([gltests_libgnu_LTLIBOBJS], [$gltests_libgnu_ltlibobjs]) AC_SUBST([gltests_libgnu_LIBOBJDEPS], [$gltests_libgnu_libobjdeps]) ]) AC_REQUIRE([gl_CC_GNULIB_WARNINGS]) LIBGNU_LIBDEPS="$gl_libdeps" AC_SUBST([LIBGNU_LIBDEPS]) LIBGNU_LTLIBDEPS="$gl_ltlibdeps" AC_SUBST([LIBGNU_LTLIBDEPS]) ]) # Like AC_LIBOBJ, except that the module name goes # into gl_LIBOBJS instead of into LIBOBJS. AC_DEFUN([gl_LIBOBJ], [ AS_LITERAL_IF([$1], [gl_LIBSOURCES([$1.c])])dnl gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext" ]) # Like AC_REPLACE_FUNCS, except that the module name goes # into gl_LIBOBJS instead of into LIBOBJS. AC_DEFUN([gl_REPLACE_FUNCS], [ m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl AC_CHECK_FUNCS([$1], , [gl_LIBOBJ($ac_func)]) ]) # Like AC_LIBSOURCES, except the directory where the source file is # expected is derived from the gnulib-tool parameterization, # and alloca is special cased (for the alloca-opt module). # We could also entirely rely on EXTRA_lib..._SOURCES. AC_DEFUN([gl_LIBSOURCES], [ m4_foreach([_gl_NAME], [$1], [ m4_if(_gl_NAME, [alloca.c], [], [ m4_define([gl_LIBSOURCES_DIR], [lib]) m4_append([gl_LIBSOURCES_LIST], _gl_NAME, [ ]) ]) ]) ]) # Like AC_LIBOBJ, except that the module name goes # into gltests_LIBOBJS instead of into LIBOBJS. AC_DEFUN([gltests_LIBOBJ], [ AS_LITERAL_IF([$1], [gltests_LIBSOURCES([$1.c])])dnl gltests_LIBOBJS="$gltests_LIBOBJS $1.$ac_objext" ]) # Like AC_REPLACE_FUNCS, except that the module name goes # into gltests_LIBOBJS instead of into LIBOBJS. AC_DEFUN([gltests_REPLACE_FUNCS], [ m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl AC_CHECK_FUNCS([$1], , [gltests_LIBOBJ($ac_func)]) ]) # Like AC_LIBSOURCES, except the directory where the source file is # expected is derived from the gnulib-tool parameterization, # and alloca is special cased (for the alloca-opt module). # We could also entirely rely on EXTRA_lib..._SOURCES. AC_DEFUN([gltests_LIBSOURCES], [ m4_foreach([_gl_NAME], [$1], [ m4_if(_gl_NAME, [alloca.c], [], [ m4_define([gltests_LIBSOURCES_DIR], [tests]) m4_append([gltests_LIBSOURCES_LIST], _gl_NAME, [ ]) ]) ]) ]) # This macro records the list of files which have been installed by # gnulib-tool and may be removed by future gnulib-tool invocations. AC_DEFUN([gl_FILE_LIST], [ build-aux/config.rpath build-aux/git-version-gen lib/_Noreturn.h lib/alloca.in.h lib/arg-nonnull.h lib/asnprintf.c lib/assert.in.h lib/attribute.h lib/c++defs.h lib/c32is-impl.h lib/c32isalnum.c lib/c32isalpha.c lib/c32isblank.c lib/c32iscntrl.c lib/c32isdigit.c lib/c32isgraph.c lib/c32islower.c lib/c32isprint.c lib/c32ispunct.c lib/c32isspace.c lib/c32isupper.c lib/c32isxdigit.c lib/c32to-impl.h lib/c32tolower.c lib/c32width.c lib/errno.in.h lib/fcntl.in.h lib/filename.h lib/float+.h lib/float.c lib/float.in.h lib/fmod.c lib/fprintf.c lib/fpucw.h lib/free.c lib/frexp.c lib/frexpl.c lib/fseterr.c lib/fseterr.h lib/getopt-cdefs.in.h lib/getopt-core.h lib/getopt-ext.h lib/getopt-pfx-core.h lib/getopt-pfx-ext.h lib/getopt.c lib/getopt.in.h lib/getopt1.c lib/getopt_int.h lib/gettext.h lib/glthread/once.c lib/glthread/once.h lib/glthread/threadlib.c lib/glthread/tls.c lib/glthread/tls.h lib/hard-locale.c lib/hard-locale.h lib/hypot.c lib/idx.h lib/intprops-internal.h lib/intprops.h lib/inttypes.in.h lib/isfinite.c lib/isinf.c lib/isnan.c lib/isnand-nolibm.h lib/isnand.c lib/isnanf-nolibm.h lib/isnanf.c lib/isnanl-nolibm.h lib/isnanl.c lib/issymlink.c lib/issymlink.h lib/iswblank.c lib/iswdigit.c lib/iswpunct.c lib/iswxdigit.c lib/itold.c lib/lc-charset-dispatch.c lib/lc-charset-dispatch.h lib/ldexp.c lib/limits.in.h lib/localcharset.c lib/localcharset.h lib/locale.in.h lib/localeconv.c lib/lstat.c lib/malloc.c lib/malloca.c lib/malloca.h lib/math.c lib/math.in.h lib/mbchar.c lib/mbchar.h lib/mbiterf.c lib/mbiterf.h lib/mbrtoc32.c lib/mbrtowc-impl-utf8.h lib/mbrtowc-impl.h lib/mbrtowc.c lib/mbsinit.c lib/mbsnlen.c lib/mbszero.c lib/mbtowc-lock.c lib/mbtowc-lock.h lib/memchr.c lib/memchr.valgrind lib/memmem.c lib/pathmax.h lib/printf-args.c lib/printf-args.h lib/printf-frexp.c lib/printf-frexp.h lib/printf-frexpl.c lib/printf-frexpl.h lib/printf-parse.c lib/printf-parse.h lib/pthread-once.c lib/pthread.in.h lib/putenv.c lib/readlink.c lib/sched.in.h lib/setlocale-lock.c lib/setlocale_null-unlocked.c lib/setlocale_null.c lib/setlocale_null.h lib/siglist.h lib/signbitd.c lib/signbitf.c lib/signbitl.c lib/size_max.h lib/snprintf.c lib/stat-time.c lib/stat-time.h lib/stat-w32.c lib/stat-w32.h lib/stat.c lib/stdbool.in.h lib/stdckdint.in.h lib/stdcountof.in.h lib/stddef.in.h lib/stdint.in.h lib/stdio-consolesafe.c lib/stdio-impl.h lib/stdio-read.c lib/stdio-write.c lib/stdio.in.h lib/stdlib.c lib/stdlib.in.h lib/str-two-way.h lib/strcasecmp.c lib/streq.h lib/strerror-override.c lib/strerror-override.h lib/strerror.c lib/string.c lib/string.in.h lib/strings.in.h lib/strncasecmp.c lib/strsignal.c lib/sys_stat.in.h lib/sys_types.in.h lib/sys_wait.in.h lib/time.in.h lib/trunc.c lib/uchar.in.h lib/unicase.in.h lib/unicase/simple-mapping.h lib/unicase/tolower.c lib/unicase/tolower.h lib/unictype.in.h lib/unictype/bitmap.h lib/unictype/ctype_alnum.c lib/unictype/ctype_alnum.h lib/unictype/ctype_alpha.c lib/unictype/ctype_alpha.h lib/unictype/ctype_blank.c lib/unictype/ctype_blank.h lib/unictype/ctype_cntrl.c lib/unictype/ctype_cntrl.h lib/unictype/ctype_digit.c lib/unictype/ctype_digit.h lib/unictype/ctype_graph.c lib/unictype/ctype_graph.h lib/unictype/ctype_lower.c lib/unictype/ctype_lower.h lib/unictype/ctype_print.c lib/unictype/ctype_print.h lib/unictype/ctype_punct.c lib/unictype/ctype_punct.h lib/unictype/ctype_space.c lib/unictype/ctype_space.h lib/unictype/ctype_upper.c lib/unictype/ctype_upper.h lib/unictype/ctype_xdigit.c lib/unictype/ctype_xdigit.h lib/uninorm.in.h lib/unistd.c lib/unistd.in.h lib/unitypes.in.h lib/uniwidth.in.h lib/uniwidth/cjk.h lib/uniwidth/width.c lib/uniwidth/width0.h lib/uniwidth/width2.h lib/unlink.c lib/unsetenv.c lib/vasnprintf.c lib/vasnprintf.h lib/verify.h lib/vfzprintf.c lib/vsnprintf.c lib/vsnzprintf.c lib/warn-on-use.h lib/wchar.in.h lib/wctype-h.c lib/wctype.in.h lib/wcwidth.c lib/windows-initguard.h lib/windows-once.c lib/windows-once.h lib/windows-tls.c lib/windows-tls.h lib/xalloc-oversized.h lib/xsize.c lib/xsize.h m4/00gnulib.m4 m4/absolute-header.m4 m4/alloca.m4 m4/assert_h.m4 m4/build-to-host.m4 m4/builtin-expect.m4 m4/c-bool.m4 m4/c32rtomb.m4 m4/check-math-lib.m4 m4/codeset.m4 m4/environ.m4 m4/errno_h.m4 m4/exponentd.m4 m4/exponentf.m4 m4/exponentl.m4 m4/extensions-aix.m4 m4/extensions.m4 m4/extern-inline.m4 m4/fabs.m4 m4/fcntl-o.m4 m4/fcntl_h.m4 m4/float_h.m4 m4/fmod.m4 m4/fpieee.m4 m4/fprintf-posix.m4 m4/free.m4 m4/frexp.m4 m4/frexpl.m4 m4/fseterr.m4 m4/getopt.m4 m4/gettext_h.m4 m4/gnulib-common.m4 m4/gnulib-i18n.m4 m4/host-cpu-c-abi.m4 m4/hypot.m4 m4/include_next.m4 m4/init-package-version.m4 m4/intmax_t.m4 m4/inttypes.m4 m4/inttypes_h.m4 m4/isfinite.m4 m4/isinf.m4 m4/isnand.m4 m4/isnanf.m4 m4/isnanl.m4 m4/iswblank.m4 m4/iswdigit.m4 m4/iswpunct.m4 m4/iswxdigit.m4 m4/largefile.m4 m4/ldexp.m4 m4/ldexpl.m4 m4/lib-ld.m4 m4/lib-link.m4 m4/lib-prefix.m4 m4/libunistring-base.m4 m4/limits-h.m4 m4/localcharset.m4 m4/locale-en.m4 m4/locale-fr.m4 m4/locale-ja.m4 m4/locale-zh.m4 m4/locale_h.m4 m4/localeconv.m4 m4/lstat.m4 m4/malloc.m4 m4/malloca.m4 m4/math_h.m4 m4/mathfunc.m4 m4/mbchar.m4 m4/mbiter.m4 m4/mbrtoc32.m4 m4/mbrtowc.m4 m4/mbsinit.m4 m4/mbstate_t.m4 m4/memchr.m4 m4/memmem.m4 m4/mmap-anon.m4 m4/multiarch.m4 m4/musl.m4 m4/nocrash.m4 m4/off64_t.m4 m4/off_t.m4 m4/once.m4 m4/pathmax.m4 m4/pid_t.m4 m4/printf-frexp.m4 m4/printf-frexpl.m4 m4/printf.m4 m4/pthread-once.m4 m4/pthread-spin.m4 m4/pthread_h.m4 m4/putenv.m4 m4/readlink.m4 m4/sched_h.m4 m4/setenv.m4 m4/setlocale_null.m4 m4/signbit.m4 m4/size_max.m4 m4/snprintf.m4 m4/sqrt.m4 m4/ssize_t.m4 m4/stat-time.m4 m4/stat.m4 m4/std-gnu11.m4 m4/stdbool.m4 m4/stdckdint_h.m4 m4/stdcountof_h.m4 m4/stddef_h.m4 m4/stdint.m4 m4/stdint_h.m4 m4/stdio_h.m4 m4/stdlib_h.m4 m4/strcasecmp.m4 m4/strerror.m4 m4/string_h.m4 m4/stringeq.m4 m4/strings_h.m4 m4/strncasecmp.m4 m4/strsignal.m4 m4/sys_cdefs_h.m4 m4/sys_socket_h.m4 m4/sys_stat_h.m4 m4/sys_types_h.m4 m4/sys_wait_h.m4 m4/threadlib.m4 m4/time_h.m4 m4/tls.m4 m4/trunc.m4 m4/uchar_h.m4 m4/unicase_h.m4 m4/unictype_h.m4 m4/uninorm_h.m4 m4/unistd_h.m4 m4/unitypes_h.m4 m4/unlink.m4 m4/vararrays.m4 m4/vasnprintf.m4 m4/visibility.m4 m4/vsnprintf.m4 m4/warn-on-use.m4 m4/wchar_h.m4 m4/wctype_h.m4 m4/wcwidth.m4 m4/wint_t.m4 m4/xsize.m4 m4/zzgnulib.m4 ]) groff-1.24.1/gnulib_m4/limits-h.m40000644000175000017500000000343315153275164013507 00000000000000# limits-h.m4 # serial 1 dnl Copyright 2016-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl Check whether limits.h has needed features. dnl From Paul Eggert. AC_DEFUN_ONCE([gl_LIMITS_H], [ gl_CHECK_NEXT_HEADERS([limits.h]) AC_CACHE_CHECK([whether limits.h has WORD_BIT, BOOL_WIDTH etc.], [gl_cv_header_limits_width], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 #endif #include long long llm = LLONG_MAX; int wb = WORD_BIT; int ullw = ULLONG_WIDTH; int bw = BOOL_WIDTH; int bm = BOOL_MAX; int mblm = MB_LEN_MAX; ]])], [gl_cv_header_limits_width=yes], [gl_cv_header_limits_width=no])]) GL_GENERATE_LIMITS_H=true AS_IF([test "$gl_cv_header_limits_width" = yes], [AC_CACHE_CHECK([whether limits.h has SSIZE_MAX], [gl_cv_header_limits_ssize_max], [AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#include #ifndef SSIZE_MAX #error "SSIZE_MAX is not defined" #endif ]])], [gl_cv_header_limits_ssize_max=yes], [gl_cv_header_limits_ssize_max=no])]) if test "$gl_cv_header_limits_ssize_max" = yes; then GL_GENERATE_LIMITS_H=false fi]) ]) dnl Unconditionally enables the replacement of . AC_DEFUN([gl_REPLACE_LIMITS_H], [ AC_REQUIRE([gl_LIMITS_H]) GL_GENERATE_LIMITS_H=true ]) groff-1.24.1/gnulib_m4/alloca.m40000644000175000017500000000740215153275164013214 00000000000000# alloca.m4 # serial 21 dnl Copyright (C) 2002-2004, 2006-2007, 2009-2026 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_ALLOCA], [ AC_REQUIRE([AC_FUNC_ALLOCA]) if test $ac_cv_func_alloca_works = no; then gl_PREREQ_ALLOCA fi # Define an additional variable used in the Makefile substitution. if test $ac_cv_working_alloca_h = yes; then AC_CACHE_CHECK([for alloca as a compiler built-in], [gl_cv_rpl_alloca], [ AC_EGREP_CPP([Need own alloca], [ #if defined __GNUC__ || defined _AIX || defined _MSC_VER Need own alloca #endif ], [gl_cv_rpl_alloca=yes], [gl_cv_rpl_alloca=no]) ]) if test $gl_cv_rpl_alloca = yes; then dnl OK, alloca can be implemented through a compiler built-in. AC_DEFINE([HAVE_ALLOCA], [1], [Define to 1 if you have 'alloca' after including , a header that may be supplied by this distribution.]) GL_GENERATE_ALLOCA_H=true else dnl alloca exists as a library function, i.e. it is slow and probably dnl a memory leak. Don't define HAVE_ALLOCA in this case. GL_GENERATE_ALLOCA_H=false fi else GL_GENERATE_ALLOCA_H=true fi if test $ac_cv_working_alloca_h = yes; then HAVE_ALLOCA_H=1 else HAVE_ALLOCA_H=0 fi AC_SUBST([HAVE_ALLOCA_H]) ]) # Prerequisites of lib/alloca.c. # STACK_DIRECTION is already handled by AC_FUNC_ALLOCA. AC_DEFUN([gl_PREREQ_ALLOCA], [:]) m4_version_prereq([2.70], [], [ # This works around a bug in autoconf <= 2.68 and has simplifications # from 2.70. See: # https://lists.gnu.org/r/bug-gnulib/2011-06/msg00277.html # https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497 # https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=15edf7fd8094fd14a89d9891dd72a9624762597a # _AC_LIBOBJ_ALLOCA # ----------------- # Set up the LIBOBJ replacement of 'alloca'. Well, not exactly # AC_LIBOBJ since we actually set the output variable 'ALLOCA'. # Nevertheless, for Automake, AC_LIBSOURCES it. m4_define([_AC_LIBOBJ_ALLOCA], [# The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. AC_LIBSOURCES(alloca.c) AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.$ac_objext])dnl AC_DEFINE(C_ALLOCA, 1, [Define to 1 if using 'alloca.c'.]) AC_CACHE_CHECK([stack direction for C alloca], [ac_cv_c_stack_direction], [AC_RUN_IFELSE([AC_LANG_SOURCE( [AC_INCLUDES_DEFAULT int find_stack_direction (int *addr, int depth) { int dir, dummy = 0; if (! addr) addr = &dummy; *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; dir = depth ? find_stack_direction (addr, depth - 1) : 0; return dir + dummy; } int main (int argc, char **argv) { return find_stack_direction (0, argc + !argv + 20) < 0; }])], [ac_cv_c_stack_direction=1], [ac_cv_c_stack_direction=-1], [ac_cv_c_stack_direction=0])]) AH_VERBATIM([STACK_DIRECTION], [/* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION])dnl AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction) ])# _AC_LIBOBJ_ALLOCA ]) groff-1.24.1/gnulib_m4/off_t.m40000644000175000017500000000107615153275164013057 00000000000000# off_t.m4 # serial 1 dnl Copyright (C) 2012-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl Check whether to override the 'off_t' type. dnl Set WINDOWS_64_BIT_OFF_T. AC_DEFUN([gl_TYPE_OFF_T], [ m4_ifdef([gl_LARGEFILE], [ AC_REQUIRE([gl_LARGEFILE]) ], [ WINDOWS_64_BIT_OFF_T=0 ]) AC_SUBST([WINDOWS_64_BIT_OFF_T]) ]) groff-1.24.1/gnulib_m4/ssize_t.m40000644000175000017500000000270215153275164013437 00000000000000# ssize_t.m4 # serial 6 dnl Copyright (C) 2001-2003, 2006, 2010-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Bruno Haible. dnl Define ssize_t if it does not already exist. AC_DEFUN([gt_TYPE_SSIZE_T], [ AC_CACHE_CHECK([for ssize_t], [gl_cv_ssize_t], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[int x = sizeof (ssize_t *) + sizeof (ssize_t); return !x;]])], [gl_cv_ssize_t=yes], [gl_cv_ssize_t=no])]) if test $gl_cv_ssize_t = no; then dnl On 64-bit native Windows, ssize_t needs to be defined as 'long long', dnl for consistency with the 64-bit size_t. AC_CACHE_CHECK([whether size_t is wider than 'long'], [gl_cv_size_t_large], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include typedef int array [2 * (sizeof (size_t) > sizeof (long)) - 1]; ]])], [gl_cv_size_t_large=yes], [gl_cv_size_t_large=no])]) if test $gl_cv_size_t_large = yes; then gl_def_ssize_t='long long' else gl_def_ssize_t='long' fi AC_DEFINE_UNQUOTED([ssize_t], [$gl_def_ssize_t], [Define as a signed type of the same size as size_t.]) fi ]) groff-1.24.1/gnulib_m4/libunistring-base.m40000644000175000017500000002170215153275164015401 00000000000000# libunistring-base.m4 # serial 10 dnl Copyright (C) 2010-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Paolo Bonzini and Bruno Haible. dnl gl_LIBUNISTRING_MODULE([VERSION], [Module]) dnl Declares that the source files of Module should be compiled, unless we dnl are linking with libunistring and its version is >= the given VERSION. dnl Defines an automake conditional LIBUNISTRING_COMPILE_$MODULE that is dnl true if the source files of Module should be compiled. dnl This macro is to be used for public libunistring API, not for dnl undocumented API. dnl dnl You have to bump the VERSION argument to the next projected version dnl number each time you make a change that affects the behaviour of the dnl functions defined in Module (even if the sources of Module itself do not dnl change). dnl dnl This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_LIBUNISTRING_MODULE], [ AC_REQUIRE([gl_LIBUNISTRING_LIB_PREPARE]) dnl Use the variables HAVE_LIBUNISTRING, LIBUNISTRING_VERSION from dnl gl_LIBUNISTRING_CORE if that macro has been run. gl_CONDITIONAL(AS_TR_CPP([LIBUNISTRING_COMPILE_$2]), [gl_LIBUNISTRING_VERSION_CMP([$1])]) ]) dnl gl_LIBUNISTRING_MODULE_WITH_VARIABLE([VERSION], [Module]) dnl is like gl_LIBUNISTRING_MODULE([VERSION], [Module]), except that it also dnl defines an AC_SUBSTed autoconf variable GNULIB_$MODULE_DLL_VARIABLE. dnl What's the expansion of this autoconf variable? dnl - When building libunistring, it expands to LIBUNISTRING_DLL_VARIABLE. dnl (This is necessary because this token must be present in the .h files dnl when the .h files get installed.) dnl - When building gnulib or application code it expands to dnl - LIBUNISTRING_DLL_VARIABLE by default, dnl - if the automake conditional LIBUNISTRING_COMPILE_$MODULE evaluates dnl to true: the value of dnl ${module_indicator_prefix}_GNULIB_LIBUNISTRING_DLL_VARIABLE_NAME dnl (which usually is empty, unless explicitly set in configure.ac). dnl (This is necessary because when the conditional evaluates to false, dnl the application code expects to use the declared variable from the dnl installed libunistring; it's in this case that the dnl LIBUNISTRING_DLL_VARIABLE macro from the installed dnl must be used.) dnl dnl This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_LIBUNISTRING_MODULE_WITH_VARIABLE], [ gl_LIBUNISTRING_MODULE([$1], [$2]) m4_ifndef([gl_IN_LIBUNISTRING], [if test -z "${AS_TR_CPP([LIBUNISTRING_COMPILE_$2])_TRUE}"; then GL_MODULE_INDICATOR_PREFIX[]_GNULIB_[]AS_TR_CPP([$2_DLL_VARIABLE])=$GL_MODULE_INDICATOR_PREFIX[]_GNULIB_LIBUNISTRING_DLL_VARIABLE_NAME fi ]) ]) dnl gl_LIBUNISTRING_LIBHEADER([VERSION], [HeaderFile]) dnl Declares that HeaderFile should be created, unless we are linking dnl with libunistring and its version is >= the given VERSION. dnl HeaderFile should be relative to the lib directory and end in '.h'. dnl Prepares for substituting LIBUNISTRING_HEADERFILE (to HeaderFile or empty). dnl dnl When we are linking with the already installed libunistring and its version dnl is < VERSION, we create HeaderFile here, because we may compile functions dnl (via gl_LIBUNISTRING_MODULE above) that are not contained in the installed dnl version. dnl When we are linking with the already installed libunistring and its version dnl is > VERSION, we don't create HeaderFile here: it could cause compilation dnl errors in other libunistring header files if some types are missing. dnl dnl You have to bump the VERSION argument to the next projected version dnl number each time you make a non-comment change to the HeaderFile. AC_DEFUN([gl_LIBUNISTRING_LIBHEADER], [ AC_REQUIRE([gl_LIBUNISTRING_LIB_PREPARE]) dnl Use the variables HAVE_LIBUNISTRING, LIBUNISTRING_VERSION from dnl gl_LIBUNISTRING_CORE if that macro has been run. if gl_LIBUNISTRING_VERSION_CMP([$1]); then dnl It is OK to use a .h file in lib/ from within tests/, but not vice dnl versa. if test -z "$LIBUNISTRING_[]AS_TR_CPP([$2])"; then LIBUNISTRING_[]AS_TR_CPP([$2])="${gl_source_base_prefix}$2" fi else LIBUNISTRING_[]AS_TR_CPP([$2])= fi AC_SUBST([LIBUNISTRING_]AS_TR_CPP([$2])) ]) dnl Miscellaneous preparations/initializations. AC_DEFUN([gl_LIBUNISTRING_LIB_PREPARE], [ dnl Ensure that HAVE_LIBUNISTRING is fully determined at this point. m4_ifdef([gl_LIBUNISTRING], [AC_REQUIRE([gl_LIBUNISTRING])]) AC_REQUIRE([AC_PROG_AWK]) dnl Sed expressions to extract the parts of a version number. changequote(,) gl_libunistring_sed_extract_major='/^[0-9]/{s/^\([0-9]*\).*/\1/p;q;} i\ 0 q ' gl_libunistring_sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]\([0-9]*\).*/\1/p;q;} i\ 0 q ' gl_libunistring_sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p;q;} i\ 0 q ' changequote([,]) if test "$HAVE_LIBUNISTRING" = yes; then LIBUNISTRING_VERSION_MAJOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_major"` LIBUNISTRING_VERSION_MINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_minor"` LIBUNISTRING_VERSION_SUBMINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_subminor"` fi dnl Determine whether from an installed libunistring dnl is available. m4_ifdef([gl_IN_LIBUNISTRING], [dnl In libunistring, all .h files that declare variables need to dnl #include . This references the file dnl unistring/woe32dll.h in libunistring. HAVE_UNISTRING_WOE32DLL_H=1 ], [dnl In gnulib or in applications, we need a #include dnl if and only if an installed libunistring is available. if test "$HAVE_LIBUNISTRING" = yes; then AC_CHECK_HEADERS([unistring/woe32dll.h], [HAVE_UNISTRING_WOE32DLL_H=1], [HAVE_UNISTRING_WOE32DLL_H=0]) else HAVE_UNISTRING_WOE32DLL_H=0 fi ]) AC_SUBST([HAVE_UNISTRING_WOE32DLL_H]) ]) dnl gl_LIBUNISTRING_VERSION_CMP([VERSION]) dnl Expands to a shell statement that evaluates to true if LIBUNISTRING_VERSION dnl is less than the VERSION argument. AC_DEFUN([gl_LIBUNISTRING_VERSION_CMP], [dnl VERSION = 999.9 means to evaluates to true always, i.e. to ignore dnl the installed libunistring regardless of its version. m4_if([$1], [999.9], [true], [ { test "$HAVE_LIBUNISTRING" != yes \ || { dnl AS_LITERAL_IF exists and works fine since autoconf-2.59 at least. AS_LITERAL_IF([$1], [dnl This is the optimized variant, that assumes the argument is a literal: m4_pushdef([requested_version_major], [gl_LIBUNISTRING_ARG_OR_ZERO(m4_bpatsubst([$1], [^\([0-9]*\).*], [\1]), [])]) m4_pushdef([requested_version_minor], [gl_LIBUNISTRING_ARG_OR_ZERO(m4_bpatsubst([$1], [^[0-9]*[.]\([0-9]*\).*], [\1]), [$1])]) m4_pushdef([requested_version_subminor], [gl_LIBUNISTRING_ARG_OR_ZERO(m4_bpatsubst([$1], [^[0-9]*[.][0-9]*[.]\([0-9]*\).*], [\1]), [$1])]) test $LIBUNISTRING_VERSION_MAJOR -lt requested_version_major \ || { test $LIBUNISTRING_VERSION_MAJOR -eq requested_version_major \ && { test $LIBUNISTRING_VERSION_MINOR -lt requested_version_minor \ || { test $LIBUNISTRING_VERSION_MINOR -eq requested_version_minor \ && test $LIBUNISTRING_VERSION_SUBMINOR -lt requested_version_subminor } } } m4_popdef([requested_version_subminor]) m4_popdef([requested_version_minor]) m4_popdef([requested_version_major]) ], [dnl This is the unoptimized variant: requested_version_major=`echo '$1' | sed -n -e "$gl_libunistring_sed_extract_major"` requested_version_minor=`echo '$1' | sed -n -e "$gl_libunistring_sed_extract_minor"` requested_version_subminor=`echo '$1' | sed -n -e "$gl_libunistring_sed_extract_subminor"` test $LIBUNISTRING_VERSION_MAJOR -lt $requested_version_major \ || { test $LIBUNISTRING_VERSION_MAJOR -eq $requested_version_major \ && { test $LIBUNISTRING_VERSION_MINOR -lt $requested_version_minor \ || { test $LIBUNISTRING_VERSION_MINOR -eq $requested_version_minor \ && test $LIBUNISTRING_VERSION_SUBMINOR -lt $requested_version_subminor } } } ]) } }])]) dnl gl_LIBUNISTRING_ARG_OR_ZERO([ARG], [ORIG]) expands to ARG if it is not the dnl same as ORIG, otherwise to 0. m4_define([gl_LIBUNISTRING_ARG_OR_ZERO], [m4_if([$1], [$2], [0], [$1])]) groff-1.24.1/gnulib_m4/time_h.m40000644000175000017500000001703115153275164013225 00000000000000# time_h.m4 # serial 27 dnl Copyright (C) 2000-2001, 2003-2007, 2009-2026 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. # Configure a more-standard replacement for . # Written by Paul Eggert and Jim Meyering. AC_DEFUN_ONCE([gl_TIME_H], [ dnl Ensure to expand the default settings once only, before all statements dnl that occur in other macros. AC_REQUIRE([gl_TIME_H_DEFAULTS]) gl_NEXT_HEADERS([time.h]) AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[ #include ]], [ asctime asctime_r ctime ctime_r gmtime_r localtime localtime_r mktime nanosleep strftime strptime time timegm timespec_get timespec_getres tzset ]) AC_REQUIRE([AC_C_RESTRICT]) AC_CACHE_CHECK([for TIME_UTC in ], [gl_cv_time_h_has_TIME_UTC], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[static int x = TIME_UTC; x++;]])], [gl_cv_time_h_has_TIME_UTC=yes], [gl_cv_time_h_has_TIME_UTC=no])]) if test $gl_cv_time_h_has_TIME_UTC = yes; then TIME_H_DEFINES_TIME_UTC=1 else TIME_H_DEFINES_TIME_UTC=0 fi AC_SUBST([TIME_H_DEFINES_TIME_UTC]) ]) dnl Check whether 'struct timespec' is declared dnl in time.h, sys/time.h, pthread.h, or unistd.h. AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC], [ AC_CHECK_HEADERS_ONCE([sys/time.h]) AC_CACHE_CHECK([for struct timespec in ], [gl_cv_sys_struct_timespec_in_time_h], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], [gl_cv_sys_struct_timespec_in_time_h=yes], [gl_cv_sys_struct_timespec_in_time_h=no])]) TIME_H_DEFINES_STRUCT_TIMESPEC=0 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0 PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0 UNISTD_H_DEFINES_STRUCT_TIMESPEC=0 if test $gl_cv_sys_struct_timespec_in_time_h = yes; then TIME_H_DEFINES_STRUCT_TIMESPEC=1 else AC_CACHE_CHECK([for struct timespec in ], [gl_cv_sys_struct_timespec_in_sys_time_h], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], [gl_cv_sys_struct_timespec_in_sys_time_h=yes], [gl_cv_sys_struct_timespec_in_sys_time_h=no])]) if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1 else AC_CACHE_CHECK([for struct timespec in ], [gl_cv_sys_struct_timespec_in_pthread_h], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], [gl_cv_sys_struct_timespec_in_pthread_h=yes], [gl_cv_sys_struct_timespec_in_pthread_h=no])]) if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1 else AC_CACHE_CHECK([for struct timespec in ], [gl_cv_sys_struct_timespec_in_unistd_h], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], [gl_cv_sys_struct_timespec_in_unistd_h=yes], [gl_cv_sys_struct_timespec_in_unistd_h=no])]) if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then UNISTD_H_DEFINES_STRUCT_TIMESPEC=1 fi fi fi fi AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC]) AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC]) AC_SUBST([PTHREAD_H_DEFINES_STRUCT_TIMESPEC]) AC_SUBST([UNISTD_H_DEFINES_STRUCT_TIMESPEC]) ]) # gl_TIME_MODULE_INDICATOR([modulename]) # sets the shell variable that indicates the presence of the given module # to a C preprocessor expression that will evaluate to 1. # This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_TIME_MODULE_INDICATOR], [ dnl Ensure to expand the default settings once only. gl_TIME_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) # Initializes the default values for AC_SUBSTed shell variables. # This macro must not be AC_REQUIREd. It must only be invoked, and only # outside of macros or in macros that are not AC_REQUIREd. AC_DEFUN([gl_TIME_H_REQUIRE_DEFAULTS], [ m4_defun(GL_MODULE_INDICATOR_PREFIX[_TIME_H_MODULE_INDICATOR_DEFAULTS], [ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CTIME]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKTIME]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALTIME]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NANOSLEEP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRFTIME]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRPTIME]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIME]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMEGM]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMESPEC_GET]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMESPEC_GETRES]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIME_R]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIME_RZ]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TZNAME]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TZSET]) dnl Support Microsoft deprecated alias function names by default. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_TZSET], [1]) ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_TIME_H_MODULE_INDICATOR_DEFAULTS]) AC_REQUIRE([gl_TIME_H_DEFAULTS]) ]) AC_DEFUN([gl_TIME_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DECL_LOCALTIME_R=1; AC_SUBST([HAVE_DECL_LOCALTIME_R]) HAVE_NANOSLEEP=1; AC_SUBST([HAVE_NANOSLEEP]) HAVE_STRPTIME=1; AC_SUBST([HAVE_STRPTIME]) HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM]) HAVE_TIMESPEC_GET=1; AC_SUBST([HAVE_TIMESPEC_GET]) HAVE_TIMESPEC_GETRES=1; AC_SUBST([HAVE_TIMESPEC_GETRES]) dnl Even GNU libc does not have timezone_t and tzalloc() yet. HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T]) HAVE_TZALLOC=0; AC_SUBST([HAVE_TZALLOC]) REPLACE_CTIME=0; AC_SUBST([REPLACE_CTIME]) REPLACE_GMTIME=0; AC_SUBST([REPLACE_GMTIME]) REPLACE_LOCALTIME=0; AC_SUBST([REPLACE_LOCALTIME]) REPLACE_LOCALTIME_R=0; AC_SUBST([REPLACE_LOCALTIME_R]) REPLACE_LOCALTIME_RZ=0; AC_SUBST([REPLACE_LOCALTIME_RZ]) REPLACE_MKTIME=0; AC_SUBST([REPLACE_MKTIME]) REPLACE_MKTIME_Z=0; AC_SUBST([REPLACE_MKTIME_Z]) REPLACE_NANOSLEEP=0; AC_SUBST([REPLACE_NANOSLEEP]) REPLACE_STRFTIME=0; AC_SUBST([REPLACE_STRFTIME]) REPLACE_TIME=0; AC_SUBST([REPLACE_TIME]) REPLACE_TIMEGM=0; AC_SUBST([REPLACE_TIMEGM]) REPLACE_TIMESPEC_GET=0; AC_SUBST([REPLACE_TIMESPEC_GET]) REPLACE_TIMESPEC_GETRES=0; AC_SUBST([REPLACE_TIMESPEC_GETRES]) REPLACE_TZSET=0; AC_SUBST([REPLACE_TZSET]) ]) groff-1.24.1/gnulib_m4/mmap-anon.m40000644000175000017500000000353315153275164013645 00000000000000# mmap-anon.m4 # serial 15 dnl Copyright (C) 2005, 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. # Detect how mmap can be used to create anonymous (not file-backed) memory # mappings. # - On Linux, AIX, Solaris, Cygwin, Interix, Haiku, both MAP_ANONYMOUS and # MAP_ANON exist and have the same value. # - On HP-UX, only MAP_ANONYMOUS exists. # - On Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, only MAP_ANON exists. AC_DEFUN_ONCE([gl_FUNC_MMAP_ANON], [ dnl Persuade glibc to define MAP_ANONYMOUS. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is # irrelevant for anonymous mappings. # Instead, assume that mmap() exists if and only if exists. # Code needs to tests HAVE_SYS_MMAN_H, not HAVE_MMAP. AC_CHECK_HEADERS_ONCE([sys/mman.h]) # Try to allow MAP_ANONYMOUS. gl_have_mmap_anonymous=no if test $ac_cv_header_sys_mman_h = yes; then AC_MSG_CHECKING([for MAP_ANONYMOUS]) AC_EGREP_CPP([I cannot identify this map], [ #include #ifdef MAP_ANONYMOUS I cannot identify this map #endif ], [gl_have_mmap_anonymous=yes]) if test $gl_have_mmap_anonymous != yes; then AC_EGREP_CPP([I cannot identify this map], [ #include #ifdef MAP_ANON I cannot identify this map #endif ], [AC_DEFINE([MAP_ANONYMOUS], [MAP_ANON], [Define to a substitute value for mmap()'s MAP_ANONYMOUS flag.]) gl_have_mmap_anonymous=yes]) fi AC_MSG_RESULT([$gl_have_mmap_anonymous]) fi ]) groff-1.24.1/gnulib_m4/environ.m40000644000175000017500000000267615153275164013451 00000000000000# environ.m4 # serial 8 dnl Copyright (C) 2001-2004, 2006-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN_ONCE([gl_ENVIRON], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl Persuade glibc to declare environ. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_CHECK_HEADERS_ONCE([unistd.h]) gt_CHECK_VAR_DECL( [#if HAVE_UNISTD_H #include #endif /* mingw, BeOS, Haiku declare environ in , not in . */ #include ], [environ]) if test $gt_cv_var_environ_declaration != yes; then HAVE_DECL_ENVIRON=0 fi ]) # Check if a variable is properly declared. # gt_CHECK_VAR_DECL(includes,variable) AC_DEFUN([gt_CHECK_VAR_DECL], [ define([gt_cv_var], [gt_cv_var_]$2[_declaration]) AC_CACHE_CHECK([if $2 is properly declared], [gt_cv_var], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[$1 typedef struct { int foo; } foo_t; extern foo_t $2;]], [[$2.foo = 1;]])], [gt_cv_var=no], [gt_cv_var=yes])]) if test $gt_cv_var = yes; then AC_DEFINE([HAVE_]m4_translit($2, [a-z], [A-Z])[_DECL], 1, [Define if you have the declaration of $2.]) fi undefine([gt_cv_var]) ]) groff-1.24.1/gnulib_m4/exponentl.m40000644000175000017500000001617715153275164014006 00000000000000# exponentl.m4 # serial 8 dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN_ONCE([gl_LONG_DOUBLE_EXPONENT_LOCATION], [ AC_REQUIRE([gl_BIGENDIAN]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([where to find the exponent in a 'long double'], [gl_cv_cc_long_double_expbit0], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include #include #define NWORDS \ ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) typedef union { long double value; unsigned int word[NWORDS]; } memory_long_double; static unsigned int ored_words[NWORDS]; static unsigned int anded_words[NWORDS]; static void add_to_ored_words (long double *x) { memory_long_double m; size_t i; /* Clear it first, in case sizeof (long double) < sizeof (memory_long_double). */ memset (&m, 0, sizeof (memory_long_double)); m.value = *x; for (i = 0; i < NWORDS; i++) { ored_words[i] |= m.word[i]; anded_words[i] &= m.word[i]; } } int main () { static long double samples[5] = { 0.25L, 0.5L, 1.0L, 2.0L, 4.0L }; size_t j; FILE *fp = fopen ("conftest.out", "w"); if (fp == NULL) return 1; for (j = 0; j < NWORDS; j++) anded_words[j] = ~ (unsigned int) 0; for (j = 0; j < 5; j++) add_to_ored_words (&samples[j]); /* Remove bits that are common (e.g. if representation of the first mantissa bit is explicit). */ for (j = 0; j < NWORDS; j++) ored_words[j] &= ~anded_words[j]; /* Now find the nonzero word. */ for (j = 0; j < NWORDS; j++) if (ored_words[j] != 0) break; if (j < NWORDS) { size_t i; for (i = j + 1; i < NWORDS; i++) if (ored_words[i] != 0) { fprintf (fp, "unknown"); return (fclose (fp) != 0); } for (i = 0; ; i++) if ((ored_words[j] >> i) & 1) { fprintf (fp, "word %d bit %d", (int) j, (int) i); return (fclose (fp) != 0); } } fprintf (fp, "unknown"); return (fclose (fp) != 0); } ]])], [gl_cv_cc_long_double_expbit0=`cat conftest.out`], [gl_cv_cc_long_double_expbit0="unknown"], [ dnl When cross-compiling, in general we don't know. It depends on the dnl ABI and compiler version. But we know the results for specific dnl CPUs. AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then gl_DOUBLE_EXPONENT_LOCATION gl_cv_cc_long_double_expbit0="$gl_cv_cc_double_expbit0" if test "$gl_cv_cc_double_expbit0" = unknown; then case "$host_cpu" in arm*) # See the comments in exponentd.m4. ;; aarch64 | sh4) # little-endian IEEE 754 double-precision gl_cv_cc_long_double_expbit0='word 1 bit 20' ;; hppa*) # big-endian IEEE 754 double-precision gl_cv_cc_long_double_expbit0='word 0 bit 20' ;; mips*) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[ #if defined _MIPSEB /* equivalent: __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ */ int big; #else #error little #endif ]], [[]]) ], [# big-endian IEEE 754 double-precision gl_cv_cc_long_double_expbit0='word 0 bit 20' ], [# little-endian IEEE 754 double-precision gl_cv_cc_long_double_expbit0='word 1 bit 20' ]) ;; esac fi else case "$host_cpu" in changequote(,)dnl i[34567]86 | x86_64 | ia64*) changequote([,])dnl # 80-bits "extended precision" gl_cv_cc_long_double_expbit0='word 2 bit 0' ;; m68k*) # big-endian, 80-bits padded to 96 bits, non-IEEE exponent gl_cv_cc_long_double_expbit0='word 0 bit 16' ;; alpha* | aarch64 | loongarch64 | riscv32 | riscv64 | sh4) # little-endian IEEE 754 quadruple-precision gl_cv_cc_long_double_expbit0='word 3 bit 16' ;; s390* | sparc | sparc64) # big-endian IEEE 754 quadruple-precision gl_cv_cc_long_double_expbit0='word 0 bit 16' ;; arm*) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[ #if defined _ARMEL int little; #else #error big #endif ]], [[]]) ], [# little-endian IEEE 754 quadruple-precision gl_cv_cc_long_double_expbit0='word 3 bit 16' ], [# big-endian IEEE 754 quadruple-precision gl_cv_cc_long_double_expbit0='word 0 bit 16' ]) ;; mips*) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[ #if defined _MIPSEB /* equivalent: __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ */ int big; #else #error little #endif ]], [[]]) ], [# big-endian IEEE 754 quadruple-precision gl_cv_cc_long_double_expbit0='word 0 bit 16' ], [# little-endian IEEE 754 quadruple-precision gl_cv_cc_long_double_expbit0='word 3 bit 16' ]) ;; powerpc64le) # little-endian double-double gl_cv_cc_long_double_expbit0='word 1 bit 20' ;; powerpc* | rs6000) # big-endian double-double gl_cv_cc_long_double_expbit0='word 0 bit 20' ;; *) gl_cv_cc_long_double_expbit0="unknown" ;; esac fi ]) rm -f conftest.out ]) case "$gl_cv_cc_long_double_expbit0" in word*bit*) word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'` AC_DEFINE_UNQUOTED([LDBL_EXPBIT0_WORD], [$word], [Define as the word index where to find the exponent of 'long double'.]) AC_DEFINE_UNQUOTED([LDBL_EXPBIT0_BIT], [$bit], [Define as the bit index in the word where to find bit 0 of the exponent of 'long double'.]) ;; esac ]) groff-1.24.1/gnulib_m4/snprintf.m40000644000175000017500000000365715153275164013634 00000000000000# snprintf.m4 # serial 7 dnl Copyright (C) 2002-2004, 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl Libintl 0.17 will replace snprintf only if it does not support %1$s, dnl but defers to any gnulib snprintf replacements. Therefore, gnulib dnl must guarantee that the decision for replacing snprintf is a superset dnl of the reasons checked by libintl. AC_DEFUN([gl_FUNC_SNPRINTF], [ AC_REQUIRE([gl_STDIO_H_DEFAULTS]) gl_cv_func_snprintf_usable=no AC_CHECK_FUNCS([snprintf]) if test $ac_cv_func_snprintf = yes; then gl_SNPRINTF_SIZE1 case "$gl_cv_func_snprintf_size1" in *yes) gl_SNPRINTF_RETVAL_C99 case "$gl_cv_func_snprintf_retval_c99" in *yes) gl_PRINTF_POSITIONS case "$gl_cv_func_printf_positions" in *yes) gl_cv_func_snprintf_usable=yes ;; esac ;; esac ;; esac fi if test $gl_cv_func_snprintf_usable = no; then gl_REPLACE_SNPRINTF fi AC_CHECK_DECLS_ONCE([snprintf]) if test $ac_cv_have_decl_snprintf = no; then HAVE_DECL_SNPRINTF=0 fi ]) AC_DEFUN([gl_REPLACE_SNPRINTF], [ AC_REQUIRE([gl_STDIO_H_DEFAULTS]) AC_LIBOBJ([snprintf]) if test $ac_cv_func_snprintf = yes; then REPLACE_SNPRINTF=1 else AC_CHECK_DECLS_ONCE([snprintf]) if test $ac_cv_have_decl_snprintf = yes; then dnl If the function is declared but does not appear to exist, it may be dnl defined as an inline function. In order to avoid a conflict, we have dnl to define rpl_snprintf, not snprintf. REPLACE_SNPRINTF=1 fi fi gl_PREREQ_SNPRINTF ]) # Prerequisites of lib/snprintf.c. AC_DEFUN([gl_PREREQ_SNPRINTF], [:]) groff-1.24.1/gnulib_m4/fmod.m40000644000175000017500000000721015153275164012703 00000000000000# fmod.m4 # serial 14 dnl Copyright (C) 2011-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_FMOD], [ m4_divert_text([DEFAULTS], [gl_fmod_required=plain]) AC_REQUIRE([gl_MATH_H_DEFAULTS]) dnl Determine FMOD_LIBM. gl_COMMON_DOUBLE_MATHFUNC([fmod]) m4_ifdef([gl_FUNC_FMOD_IEEE], [ if test $gl_fmod_required = ieee && test $REPLACE_FMOD = 0; then AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether fmod works according to ISO C 99 with IEC 60559], [gl_cv_func_fmod_ieee], [ saved_LIBS="$LIBS" LIBS="$LIBS $FMOD_LIBM" AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #ifndef __NO_MATH_INLINES # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include ]gl_DOUBLE_MINUS_ZERO_CODE[ ]gl_DOUBLE_SIGNBIT_CODE[ /* Compare two numbers with ==. This is a separate function in order to disable compiler optimizations. */ static int numeric_equal (double x, double y) { return x == y; } static double dummy (double x, double y) { return 0; } int main (int argc, char *argv[]) { double (* volatile my_fmod) (double, double) = argc ? fmod : dummy; int result = 0; double f; /* Test fmod(-0.0,...). This test fails on native Windows. */ f = my_fmod (minus_zerod, 2.0); if (!(f == 0.0) || (signbitd (minus_zerod) && !signbitd (f))) result |= 1; return result; } ]])], [gl_cv_func_fmod_ieee=yes], [gl_cv_func_fmod_ieee=no], [case "$host_os" in # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_fmod_ieee="guessing yes" ;; # Guess yes on musl systems. *-musl* | midipix*) gl_cv_func_fmod_ieee="guessing yes" ;; # Guess yes on native Windows. mingw* | windows*) gl_cv_func_fmod_ieee="guessing yes" ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_fmod_ieee="$gl_cross_guess_normal" ;; esac ]) LIBS="$saved_LIBS" ]) case "$gl_cv_func_fmod_ieee" in *yes) ;; *) REPLACE_FMOD=1 ;; esac fi ]) if test $REPLACE_FMOD = 1; then dnl Find libraries needed to link lib/fmod.c. AC_REQUIRE([gl_FUNC_FABS]) AC_REQUIRE([gl_FUNC_FREXP]) AC_REQUIRE([gl_FUNC_TRUNC]) AC_REQUIRE([gl_FUNC_LDEXP]) AC_REQUIRE([gl_FUNC_ISNAND]) FMOD_LIBM= dnl Append $FABS_LIBM to FMOD_LIBM, avoiding gratuitous duplicates. case " $FMOD_LIBM " in *" $FABS_LIBM "*) ;; *) FMOD_LIBM="$FMOD_LIBM $FABS_LIBM" ;; esac dnl Append $FREXP_LIBM to FMOD_LIBM, avoiding gratuitous duplicates. case " $FMOD_LIBM " in *" $FREXP_LIBM "*) ;; *) FMOD_LIBM="$FMOD_LIBM $FREXP_LIBM" ;; esac dnl Append $TRUNC_LIBM to FMOD_LIBM, avoiding gratuitous duplicates. case " $FMOD_LIBM " in *" $TRUNC_LIBM "*) ;; *) FMOD_LIBM="$FMOD_LIBM $TRUNC_LIBM" ;; esac dnl Append $LDEXP_LIBM to FMOD_LIBM, avoiding gratuitous duplicates. case " $FMOD_LIBM " in *" $LDEXP_LIBM "*) ;; *) FMOD_LIBM="$FMOD_LIBM $LDEXP_LIBM" ;; esac dnl Append $ISNAND_LIBM to FMOD_LIBM, avoiding gratuitous duplicates. case " $FMOD_LIBM " in *" $ISNAND_LIBM "*) ;; *) FMOD_LIBM="$FMOD_LIBM $ISNAND_LIBM" ;; esac fi ]) groff-1.24.1/gnulib_m4/size_max.m40000644000175000017500000000556615153275164013611 00000000000000# size_max.m4 # serial 12 dnl Copyright (C) 2003, 2005-2006, 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Bruno Haible. AC_PREREQ([2.61]) AC_DEFUN([gl_SIZE_MAX], [ AC_CHECK_HEADERS([stdint.h]) dnl First test whether the system already has SIZE_MAX. AC_CACHE_CHECK([for SIZE_MAX], [gl_cv_size_max], [ gl_cv_size_max=no AC_EGREP_CPP([Found it], [ #include #if HAVE_STDINT_H #include #endif #ifdef SIZE_MAX Found it #endif ], [gl_cv_size_max=yes]) if test $gl_cv_size_max != yes; then dnl Define it ourselves. Here we assume that the type 'size_t' is not wider dnl than the type 'unsigned long'. Try hard to find a definition that can dnl be used in a preprocessor #if, i.e. doesn't contain a cast. AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1], [#include #include ], [size_t_bits_minus_1=]) AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)], [#include ], [fits_in_uint=]) if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then if test $fits_in_uint = 1; then dnl Even though SIZE_MAX fits in an unsigned int, it must be of type dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include extern size_t foo; extern unsigned long foo; ]], [[]])], [fits_in_uint=0]) fi dnl We cannot use 'expr' to simplify this expression, because 'expr' dnl works only with 'long' integers in the host environment, while we dnl might be cross-compiling from a 32-bit platform to a 64-bit platform. if test $fits_in_uint = 1; then gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" else gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" fi else dnl Shouldn't happen, but who knows... gl_cv_size_max='((size_t)~(size_t)0)' fi fi ]) if test "$gl_cv_size_max" != yes; then AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max], [Define as the maximum value of type 'size_t', if the system doesn't define it.]) fi dnl Don't redefine SIZE_MAX in config.h if config.h is re-included after dnl . Remember that the #undef in AH_VERBATIM gets replaced with dnl #define by AC_DEFINE_UNQUOTED. AH_VERBATIM([SIZE_MAX], [/* Define as the maximum value of type 'size_t', if the system doesn't define it. */ #ifndef SIZE_MAX # undef SIZE_MAX #endif]) ]) groff-1.24.1/gnulib_m4/stdckdint_h.m40000644000175000017500000001041415153275164014254 00000000000000# stdckdint_h.m4 # serial 1 dnl Copyright 2025-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl Written by Collin Funk. AC_DEFUN_ONCE([gl_STDCKDINT_H], [ gl_CHECK_NEXT_HEADERS([stdckdint.h]) if test $ac_cv_header_stdckdint_h = yes; then HAVE_STDCKDINT_H=1 else HAVE_STDCKDINT_H=0 fi AC_SUBST([HAVE_STDCKDINT_H]) if test $HAVE_STDCKDINT_H = 1; then AC_CACHE_CHECK([whether stdckdint.h can be included in C], [gl_cv_header_c_stdckdint_h], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]])], [gl_cv_header_c_stdckdint_h=yes], [gl_cv_header_c_stdckdint_h=no])]) if test $gl_cv_header_c_stdckdint_h = yes; then HAVE_C_STDCKDINT_H=1 AC_CACHE_CHECK([checking for an ISO C23 compliant stdckdint.h in C], [gl_cv_header_c_stdckdint_h_works], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[int r; int a = 1; int b = 1; return !!(ckd_add (&r, a, b) || ckd_sub (&r, a, b) || ckd_mul (&r, a, b)); ]])], [gl_cv_header_c_stdckdint_h_works=yes], [gl_cv_header_c_stdckdint_h_works=no])]) if test $gl_cv_header_c_stdckdint_h_works = yes; then HAVE_WORKING_C_STDCKDINT_H=1 else HAVE_WORKING_C_STDCKDINT_H=0 fi else HAVE_C_STDCKDINT_H=0 HAVE_WORKING_C_STDCKDINT_H=0 fi if test "$CXX" != no; then AC_CACHE_CHECK([whether stdckdint.h can be included in C++], [gl_cv_header_cxx_stdckdint_h], [dnl We can't use AC_LANG_PUSH([C++]) and AC_LANG_POP([C++]) here, due to dnl an autoconf bug . cat > conftest.cpp <<\EOF #include EOF gl_command="$CXX $CXXFLAGS $CPPFLAGS -c conftest.cpp" if AC_TRY_EVAL([gl_command]); then gl_cv_header_cxx_stdckdint_h=yes else gl_cv_header_cxx_stdckdint_h=no fi rm -fr conftest* ]) if test $gl_cv_header_cxx_stdckdint_h = yes; then HAVE_CXX_STDCKDINT_H=1 AC_CACHE_CHECK([checking for an ISO C++26 compliant stdckdint.h in C++], [gl_cv_header_cxx_stdckdint_h_works], [dnl We can't use AC_LANG_PUSH([C++]) and AC_LANG_POP([C++]) here, due to dnl an autoconf bug . cat > conftest.cpp <<\EOF #include int main (void) { int r; int a = 1; int b = 1; return !!(ckd_add (&r, a, b) || ckd_sub (&r, a, b) || ckd_mul (&r, a, b)); } EOF gl_command="$CXX $CXXFLAGS $CPPFLAGS -c conftest.cpp" if AC_TRY_EVAL([gl_command]); then gl_cv_header_cxx_stdckdint_h_works=yes else gl_cv_header_cxx_stdckdint_h_works=no fi rm -fr conftest* ]) if test $gl_cv_header_cxx_stdckdint_h_works = yes; then HAVE_WORKING_CXX_STDCKDINT_H=1 else HAVE_WORKING_CXX_STDCKDINT_H=0 fi else HAVE_CXX_STDCKDINT_H=0 HAVE_WORKING_CXX_STDCKDINT_H=0 fi fi else HAVE_C_STDCKDINT_H=0 HAVE_WORKING_C_STDCKDINT_H=0 HAVE_CXX_STDCKDINT_H=0 HAVE_WORKING_CXX_STDCKDINT_H=0 fi AC_SUBST([HAVE_C_STDCKDINT_H]) AC_SUBST([HAVE_WORKING_C_STDCKDINT_H]) AC_SUBST([HAVE_CXX_STDCKDINT_H]) AC_SUBST([HAVE_WORKING_CXX_STDCKDINT_H]) if test "$CXX" != no; then dnl We might need the header for C or C++. if test $HAVE_C_STDCKDINT_H = 1 \ && test $HAVE_WORKING_C_STDCKDINT_H = 1 \ && test $HAVE_CXX_STDCKDINT_H = 1 \ && test $HAVE_WORKING_CXX_STDCKDINT_H = 1; then GL_GENERATE_STDCKDINT_H=false else GL_GENERATE_STDCKDINT_H=true fi else dnl We don't care about C++ here. if test $HAVE_C_STDCKDINT_H = 1 \ && test $HAVE_WORKING_C_STDCKDINT_H = 1; then GL_GENERATE_STDCKDINT_H=false else GL_GENERATE_STDCKDINT_H=true fi fi ]) groff-1.24.1/gnulib_m4/ldexp.m40000644000175000017500000000636215153275164013101 00000000000000# ldexp.m4 # serial 3 dnl Copyright (C) 2010-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_LDEXP], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) AC_REQUIRE([gl_FUNC_ISNAND]) dnl for ISNAND_LIBM AC_REQUIRE([gl_CHECK_LDEXP_NO_LIBM]) LDEXP_LIBM= if test $gl_cv_func_ldexp_no_libm = no; then AC_CACHE_CHECK([whether ldexp() can be used with libm], [gl_cv_func_ldexp_in_libm], [ saved_LIBS="$LIBS" LIBS="$LIBS -lm" AC_LINK_IFELSE( [AC_LANG_PROGRAM([[#ifndef __NO_MATH_INLINES # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include double (*funcptr) (double, int) = ldexp; double x;]], [[return ldexp (x, -1) > 0;]])], [gl_cv_func_ldexp_in_libm=yes], [gl_cv_func_ldexp_in_libm=no]) LIBS="$saved_LIBS" ]) if test $gl_cv_func_ldexp_in_libm = yes; then LDEXP_LIBM=-lm fi fi saved_LIBS="$LIBS" LIBS="$LIBS $LDEXP_LIBM" gl_FUNC_LDEXP_WORKS LIBS="$saved_LIBS" case "$gl_cv_func_ldexp_works" in *yes) ;; *) REPLACE_LDEXP=1 ;; esac if test $REPLACE_LDEXP = 1; then dnl Find libraries needed to link lib/ldexp.c. LDEXP_LIBM="$ISNAND_LIBM" fi AC_SUBST([LDEXP_LIBM]) ]) dnl Test whether ldexp() can be used without linking with libm. dnl Set gl_cv_func_ldexp_no_libm to 'yes' or 'no' accordingly. AC_DEFUN([gl_CHECK_LDEXP_NO_LIBM], [ AC_CACHE_CHECK([whether ldexp() can be used without linking with libm], [gl_cv_func_ldexp_no_libm], [ AC_LINK_IFELSE( [AC_LANG_PROGRAM([[#ifndef __NO_MATH_INLINES # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include double (*funcptr) (double, int) = ldexp; double x;]], [[return ldexp (x, -1) > 0;]])], [gl_cv_func_ldexp_no_libm=yes], [gl_cv_func_ldexp_no_libm=no]) ]) ]) dnl Test whether ldexp() works (this fails on OpenBSD 7.3/mips64). AC_DEFUN([gl_FUNC_LDEXP_WORKS], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether ldexp works], [gl_cv_func_ldexp_works], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include int main() { int result = 0; { volatile double x = 1.9269695883136991774e-308; volatile double y = ldexp (x, 0); if (y != x) result |= 1; } return result; }]])], [gl_cv_func_ldexp_works=yes], [gl_cv_func_ldexp_works=no], [case "$host_os" in openbsd*) gl_cv_func_ldexp_works="guessing no" ;; # Guess yes on native Windows. mingw* | windows*) gl_cv_func_ldexp_works="guessing yes" ;; *) gl_cv_func_ldexp_works="guessing yes" ;; esac ]) ]) ]) groff-1.24.1/gnulib_m4/stringeq.m40000644000175000017500000000124415153275164013613 00000000000000# stringeq.m4 # serial 1 dnl Copyright (C) 2025-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_STREQ], [ AC_REQUIRE([gl_STRING_H_DEFAULTS]) AC_CHECK_DECLS_ONCE([streq]) if test $ac_cv_have_decl_streq != no; then HAVE_DECL_STREQ=1 fi ]) AC_DEFUN([gl_FUNC_MEMEQ], [ AC_REQUIRE([gl_STRING_H_DEFAULTS]) AC_CHECK_DECLS_ONCE([memeq]) if test $ac_cv_have_decl_memeq != no; then HAVE_DECL_MEMEQ=1 fi ]) groff-1.24.1/gnulib_m4/uchar_h.m40000644000175000017500000002376515153275164013404 00000000000000# uchar_h.m4 # serial 32 dnl Copyright (C) 2019-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Bruno Haible. dnl Prepare the overridden . AC_DEFUN_ONCE([gl_UCHAR_H], [ AC_REQUIRE([gl_UCHAR_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([uchar.h]) if test $ac_cv_header_uchar_h = yes; then HAVE_UCHAR_H=1 else HAVE_UCHAR_H=0 fi AC_SUBST([HAVE_UCHAR_H]) dnl On macOS 15, in C mode, does not exist. But in C++ mode, dnl it exists, and we need to #include_next it, otherwise we get an error dnl " tried including but didn't find libc++'s dnl header." m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])]) CXX_HAVE_UCHAR_H=0 if test "$CXX" != no; then AC_CACHE_CHECK([whether the C++ compiler has ], [gl_cv_cxx_have_uchar_h], [dnl We can't use AC_LANG_PUSH([C++]) and AC_LANG_POP([C++]) here, due to dnl an autoconf bug . cat > conftest.cpp <<\EOF #include EOF gl_command="$CXX $CXXFLAGS $CPPFLAGS -c conftest.cpp" if AC_TRY_EVAL([gl_command]); then gl_cv_cxx_have_uchar_h=yes else gl_cv_cxx_have_uchar_h=no fi rm -fr conftest* ]) if test $gl_cv_cxx_have_uchar_h = yes; then CXX_HAVE_UCHAR_H=1 fi fi AC_SUBST([CXX_HAVE_UCHAR_H]) gl_TYPE_CHAR8_T gl_TYPE_CHAR16_T gl_TYPE_CHAR32_T dnl In C++ mode, clang defines 'char16_t' and 'char32_t' as built-in types dnl on some platforms (e.g. OpenBSD 6.7), and as types defined by many dnl header files (, , , , dnl and others) on some platforms (e.g. Mac OS X 10.13). dnl The same thing may also happen for 'char8_t'; so, be prepared for it. m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])]) CXX_HAS_UCHAR_TYPES=0 if test $HAVE_UCHAR_H = 0; then if test "$CXX" != no; then AC_CACHE_CHECK([whether the C++ compiler predefines the types], [gl_cv_cxx_has_uchar_types], [dnl We can't use AC_LANG_PUSH([C++]) and AC_LANG_POP([C++]) here, due to dnl an autoconf bug . cat > conftest.cpp <<\EOF #include char16_t a; char32_t b; EOF gl_command="$CXX $CXXFLAGS $CPPFLAGS -c conftest.cpp" if AC_TRY_EVAL([gl_command]); then gl_cv_cxx_has_uchar_types=yes else gl_cv_cxx_has_uchar_types=no fi rm -fr conftest* ]) if test $gl_cv_cxx_has_uchar_types = yes; then CXX_HAS_UCHAR_TYPES=1 fi fi fi AC_SUBST([CXX_HAS_UCHAR_TYPES]) CXX_HAS_CHAR8_TYPE=0 if test $HAVE_UCHAR_H = 0; then if test "$CXX" != no; then AC_CACHE_CHECK([whether the C++ compiler predefines the char8_t type], [gl_cv_cxx_has_char8_type], [dnl We can't use AC_LANG_PUSH([C++]) and AC_LANG_POP([C++]) here, due to dnl an autoconf bug . cat > conftest.cpp <<\EOF #include char8_t a; EOF gl_command="$CXX $CXXFLAGS $CPPFLAGS -c conftest.cpp" if AC_TRY_EVAL([gl_command]); then gl_cv_cxx_has_char8_type=yes else gl_cv_cxx_has_char8_type=no fi rm -fr conftest* ]) if test $gl_cv_cxx_has_char8_type = yes; then CXX_HAS_CHAR8_TYPE=1 fi fi fi AC_SUBST([CXX_HAS_CHAR8_TYPE]) dnl Test whether a 'char32_t' can hold more characters than a 'wchar_t'. gl_STDINT_BITSIZEOF([wchar_t], [gl_STDINT_INCLUDES]) if test $BITSIZEOF_WCHAR_T -lt 32; then SMALL_WCHAR_T=1 else SMALL_WCHAR_T=0 fi dnl SMALL_WCHAR_T is expected to be 1 on 32-bit AIX, Cygwin, native Windows. AC_SUBST([SMALL_WCHAR_T]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use, and which is not dnl guaranteed by C11. gl_WARN_ON_USE_PREPARE([[ #ifdef __HAIKU__ #include #endif #include ]], [c32rtomb mbrtoc16 mbrtoc32]) ]) AC_DEFUN_ONCE([gl_TYPE_CHAR8_T], [ dnl Determine whether gnulib's would, if present, override char8_t. AC_CACHE_CHECK([whether char8_t is correctly defined], [gl_cv_type_char8_t_works], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[ #ifdef __HAIKU__ #include #endif #include int verify[(char8_t)(-1) >= 0 && sizeof (char8_t) == sizeof (unsigned char) ? 1 : -1]; ]]) ], [gl_cv_type_char8_t_works=yes], [gl_cv_type_char8_t_works=no]) ]) if test $gl_cv_type_char8_t_works = no; then GNULIBHEADERS_OVERRIDE_CHAR8_T=1 else GNULIBHEADERS_OVERRIDE_CHAR8_T=0 fi AC_SUBST([GNULIBHEADERS_OVERRIDE_CHAR8_T]) ]) dnl On Haiku 2020, char16_t and char32_t are incorrectly defined. dnl See . AC_DEFUN_ONCE([gl_TYPE_CHAR16_T], [ dnl Determine whether gnulib's would, if present, override char16_t. AC_CACHE_CHECK([whether char16_t is correctly defined], [gl_cv_type_char16_t_works], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[ #ifdef __HAIKU__ #include #endif #include /* For simplicity, assume that uint16_least_t is equivalent to 'unsigned short'. */ int verify[(char16_t)(-1) >= 0 && sizeof (char16_t) == sizeof (unsigned short) ? 1 : -1]; ]]) ], [gl_cv_type_char16_t_works=yes], [gl_cv_type_char16_t_works=no]) ]) if test $gl_cv_type_char16_t_works = no; then GNULIBHEADERS_OVERRIDE_CHAR16_T=1 else GNULIBHEADERS_OVERRIDE_CHAR16_T=0 fi AC_SUBST([GNULIBHEADERS_OVERRIDE_CHAR16_T]) ]) AC_DEFUN_ONCE([gl_TYPE_CHAR32_T], [ dnl Determine whether gnulib's would, if present, override char32_t. AC_CACHE_CHECK([whether char32_t is correctly defined], [gl_cv_type_char32_t_works], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[ #ifdef __HAIKU__ #include #endif #include /* For simplicity, assume that uint32_least_t is equivalent to 'unsigned int'. */ int verify[(char32_t)(-1) >= 0 && sizeof (char32_t) == sizeof (unsigned int) ? 1 : -1]; ]]) ], [gl_cv_type_char32_t_works=yes], [gl_cv_type_char32_t_works=no]) ]) if test $gl_cv_type_char32_t_works = no; then GNULIBHEADERS_OVERRIDE_CHAR32_T=1 else GNULIBHEADERS_OVERRIDE_CHAR32_T=0 fi AC_SUBST([GNULIBHEADERS_OVERRIDE_CHAR32_T]) ]) # gl_UCHAR_MODULE_INDICATOR([modulename]) # sets the shell variable that indicates the presence of the given module # to a C preprocessor expression that will evaluate to 1. # This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_UCHAR_MODULE_INDICATOR], [ dnl Ensure to expand the default settings once only. gl_UCHAR_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) # Initializes the default values for AC_SUBSTed shell variables. # This macro must not be AC_REQUIREd. It must only be invoked, and only # outside of macros or in macros that are not AC_REQUIREd. AC_DEFUN([gl_UCHAR_H_REQUIRE_DEFAULTS], [ m4_defun(GL_MODULE_INDICATOR_PREFIX[_UCHAR_H_MODULE_INDICATOR_DEFAULTS], [ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_BTOC32]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISALNUM]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISALPHA]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISBLANK]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISCNTRL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISDIGIT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISGRAPH]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISLOWER]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISPRINT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISPUNCT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISSPACE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISUPPER]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISXDIGIT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32TOLOWER]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32TOUPPER]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32WIDTH]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32RTOMB]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32SNRTOMBS]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32SRTOMBS]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32STOMBS]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32SWIDTH]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32TOB]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32_APPLY_MAPPING]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32_APPLY_TYPE_TEST]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32_GET_MAPPING]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32_GET_TYPE_TEST]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBRTOC16]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBRTOC32]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSNRTOC32S]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSRTOC32S]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSTOC32S]) ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_UCHAR_H_MODULE_INDICATOR_DEFAULTS]) AC_REQUIRE([gl_UCHAR_H_DEFAULTS]) ]) AC_DEFUN([gl_UCHAR_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. HAVE_C32RTOMB=1; AC_SUBST([HAVE_C32RTOMB]) HAVE_MBRTOC16=1; AC_SUBST([HAVE_MBRTOC16]) HAVE_MBRTOC32=1; AC_SUBST([HAVE_MBRTOC32]) REPLACE_C32RTOMB=0; AC_SUBST([REPLACE_C32RTOMB]) REPLACE_MBRTOC16=0; AC_SUBST([REPLACE_MBRTOC16]) REPLACE_MBRTOC32=0; AC_SUBST([REPLACE_MBRTOC32]) ]) groff-1.24.1/gnulib_m4/strsignal.m40000644000175000017500000000403115153275164013762 00000000000000# strsignal.m4 # serial 10 dnl Copyright (C) 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_STRSIGNAL], [ dnl Persuade glibc to declare strsignal(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gl_STRING_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CHECK_DECLS_ONCE([strsignal]) if test $ac_cv_have_decl_strsignal = no; then HAVE_DECL_STRSIGNAL=0 fi AC_CHECK_FUNCS([strsignal]) if test $ac_cv_func_strsignal = yes; then HAVE_STRSIGNAL=1 dnl Check if strsignal behaves reasonably for out-of-range signal numbers. dnl On Solaris it returns NULL; on AIX 5.1 it returns (char *) -1. AC_CACHE_CHECK([whether strsignal always returns a string], [gl_cv_func_working_strsignal], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include #include /* NetBSD 5.0 declares it in wrong header. */ ]], [[int result = 0; char *s = strsignal (-1); if (s == (char *) 0) result |= 1; if (s == (char *) -1) result |= 2; return result; ]])], [gl_cv_func_working_strsignal=yes], [gl_cv_func_working_strsignal=no], [case "$host_os" in solaris* | aix*) gl_cv_func_working_strsignal=no;; *) gl_cv_func_working_strsignal="guessing yes";; esac])]) if test "$gl_cv_func_working_strsignal" = no; then REPLACE_STRSIGNAL=1 fi else HAVE_STRSIGNAL=0 fi ]) # Prerequisites of lib/strsignal.c. AC_DEFUN([gl_PREREQ_STRSIGNAL], [ AC_CHECK_HEADERS_ONCE([unistd.h]) AC_CHECK_DECLS([sys_siglist], [], [], [[#include ]]) AC_CHECK_DECLS([_sys_siglist], [], [], [[#include ]]) ]) groff-1.24.1/gnulib_m4/00gnulib.m40000644000175000017500000000710515153275164013401 00000000000000# 00gnulib.m4 # serial 9 dnl Copyright (C) 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl This file must be named something that sorts before all other dnl gnulib-provided .m4 files. It is needed until the clang fix has dnl been included in Autoconf. # The following definitions arrange to use a compiler option # -Werror=implicit-function-declaration in AC_CHECK_DECL, when the # compiler is clang. Without it, clang implicitly declares "known" # library functions in C mode, but not in C++ mode, which would cause # Gnulib to omit a declaration and thus later produce an error in C++ # mode. As of clang 9.0, these "known" functions are identified through # LIBBUILTIN invocations in the LLVM source file # llvm/tools/clang/include/clang/Basic/Builtins.def. # It's not possible to AC_REQUIRE the extra tests from AC_CHECK_DECL, # because AC_CHECK_DECL, like other Autoconf built-ins, is not supposed # to AC_REQUIRE anything: some configure.ac files have their first # AC_CHECK_DECL executed conditionally. Therefore append the extra tests # to AC_PROG_CC. AC_DEFUN([gl_COMPILER_CLANG], [ dnl AC_REQUIRE([AC_PROG_CC]) AC_CACHE_CHECK([whether the compiler is clang], [gl_cv_compiler_clang], [dnl Use _AC_COMPILE_IFELSE instead of AC_EGREP_CPP, to avoid error dnl "circular dependency of AC_LANG_COMPILER(C)" if AC_PROG_CC has dnl not yet been invoked. _AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[ #ifdef __clang__ barfbarf #endif ]],[[]]) ], [gl_cv_compiler_clang=no], [gl_cv_compiler_clang=yes]) ]) ]) AC_DEFUN([gl_COMPILER_PREPARE_CHECK_DECL], [ dnl AC_REQUIRE([AC_PROG_CC]) dnl AC_REQUIRE([gl_COMPILER_CLANG]) AC_CACHE_CHECK([for compiler option needed when checking for declarations], [gl_cv_compiler_check_decl_option], [if test $gl_cv_compiler_clang = yes; then dnl Test whether the compiler supports the option dnl '-Werror=implicit-function-declaration'. saved_ac_compile="$ac_compile" ac_compile="$ac_compile -Werror=implicit-function-declaration" dnl Use _AC_COMPILE_IFELSE instead of AC_COMPILE_IFELSE, to avoid a dnl warning "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS". _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])], [gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration'], [gl_cv_compiler_check_decl_option=none]) ac_compile="$saved_ac_compile" else gl_cv_compiler_check_decl_option=none fi ]) if test "x$gl_cv_compiler_check_decl_option" != xnone; then ac_compile_for_check_decl="$ac_compile $gl_cv_compiler_check_decl_option" else ac_compile_for_check_decl="$ac_compile" fi ]) dnl Redefine _AC_CHECK_DECL_BODY so that it references ac_compile_for_check_decl dnl instead of ac_compile. If, for whatever reason, the override of AC_PROG_CC dnl in zzgnulib.m4 is inactive, use the original ac_compile. m4_define([_AC_CHECK_DECL_BODY], [ ac_saved_ac_compile="$ac_compile" if test -n "$ac_compile_for_check_decl"; then ac_compile="$ac_compile_for_check_decl" fi] m4_defn([_AC_CHECK_DECL_BODY])[ ac_compile="$ac_saved_ac_compile" ]) # gl_00GNULIB # ----------- # Witness macro that this file has been included. Needed to force # Automake to include this file prior to all other gnulib .m4 files. AC_DEFUN([gl_00GNULIB]) groff-1.24.1/gnulib_m4/gettext_h.m40000644000175000017500000000132715153275164013754 00000000000000# gettext_h.m4 # serial 1 dnl Copyright (C) 2025-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN_ONCE([gl_GETTEXT_H], [ AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) AH_BOTTOM([ /* The text domainname for Gnulib messages. Ordinarily this is "gnulib", but packages that do their own translations of Gnulib can use something different by defining GNULIB_TEXT_DOMAIN in their config.h file. */ #ifndef GNULIB_TEXT_DOMAIN # define GNULIB_TEXT_DOMAIN/**/"gnulib" #endif ]) ]) groff-1.24.1/gnulib_m4/check-math-lib.m40000644000175000017500000000223715153275164014532 00000000000000# check-math-lib.m4 # serial 6 dnl Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl dnl gl_CHECK_MATH_LIB (VARIABLE, TYPE, EXPRESSION [, EXTRA-CODE]) dnl dnl Sets the shell VARIABLE according to the libraries needed by EXPRESSION dnl (that operates on a variable x of type TYPE) to compile and link: to the dnl empty string if no extra libraries are needed, to "-lm" if -lm is needed, dnl or to "missing" if it does not compile and link either way. dnl dnl Example: gl_CHECK_MATH_LIB([ROUNDF_LIBM], [float], [x = roundf (x);]) AC_DEFUN([gl_CHECK_MATH_LIB], [ saved_LIBS="$LIBS" $1=missing for libm in "" "-lm"; do LIBS="$saved_LIBS $libm" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #ifndef __NO_MATH_INLINES # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include $4 $2 x;]], [$3])], [$1=$libm break]) done LIBS="$saved_LIBS" ]) groff-1.24.1/gnulib_m4/stdlib_h.m40000644000175000017500000003077115153275164013556 00000000000000# stdlib_h.m4 # serial 86 dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN_ONCE([gl_STDLIB_H], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) gl_NEXT_HEADERS([stdlib.h]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use, and which is not dnl guaranteed by C89. gl_WARN_ON_USE_PREPARE([[#include #if HAVE_SYS_LOADAVG_H /* OpenIndiana has a bug: must be included before . */ # include # include #endif #if HAVE_RANDOM_H # include #endif ]], [_Exit aligned_alloc atoll canonicalize_file_name free getloadavg getprogname getsubopt grantpt initstate initstate_r mbstowcs mbtowc mkdtemp mkostemp mkostemps mkstemp mkstemps posix_memalign posix_openpt ptsname ptsname_r qsort_r random random_r reallocarray realpath rpmatch secure_getenv setenv setstate setstate_r srandom srandom_r strtod strtol strtold strtoll strtoul strtoull unlockpt unsetenv]) AC_REQUIRE([AC_C_RESTRICT]) dnl Test whether MB_CUR_MAX needs to be overridden. dnl On Solaris 10, in UTF-8 locales, its value is 3 but needs to be 4. dnl Fortunately, we can do this because on this platform MB_LEN_MAX is 5. AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gt_LOCALE_EN_UTF8]) AC_CACHE_CHECK([whether MB_CUR_MAX is correct], [gl_cv_macro_MB_CUR_MAX_good], [AC_LINK_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[return !!MB_CUR_MAX;]]) ], [dnl Initial guess, used when cross-compiling or when no suitable locale dnl is present. # Guess no on Solaris and Haiku, yes otherwise. AS_CASE([$host_os], [solaris* | haiku*], [gl_cv_macro_MB_CUR_MAX_good="guessing no"], [gl_cv_macro_MB_CUR_MAX_good="guessing yes"]) if test "$LOCALE_EN_UTF8" != none; then AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include int main () { int result = 0; if (setlocale (LC_ALL, "$LOCALE_EN_UTF8") != NULL) { if (MB_CUR_MAX < 4) result |= 1; } return result; }]])], [gl_cv_macro_MB_CUR_MAX_good=yes], [gl_cv_macro_MB_CUR_MAX_good=no], [:]) fi ], [gl_cv_macro_MB_CUR_MAX_good="link failed - so no"]) ]) AS_CASE([$gl_cv_macro_MB_CUR_MAX_good], [*yes], [], ["link failed - so no"], [# 4 suffices as a workaround in Android NDK 16, # the only known platform with the bug. REPLACE_MB_CUR_MAX=4], [REPLACE_MB_CUR_MAX="(-1)"]) AC_CHECK_DECLS_ONCE([ecvt]) if test $ac_cv_have_decl_ecvt = no; then HAVE_DECL_ECVT=0 fi AC_CHECK_DECLS_ONCE([fcvt]) if test $ac_cv_have_decl_fcvt = no; then HAVE_DECL_FCVT=0 fi AC_CHECK_DECLS_ONCE([gcvt]) if test $ac_cv_have_decl_gcvt = no; then HAVE_DECL_GCVT=0 fi ]) # gl_STDLIB_MODULE_INDICATOR([modulename]) # sets the shell variable that indicates the presence of the given module # to a C preprocessor expression that will evaluate to 1. # This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], [ dnl Ensure to expand the default settings once only. gl_STDLIB_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) # Initializes the default values for AC_SUBSTed shell variables. # This macro must not be AC_REQUIREd. It must only be invoked, and only # outside of macros or in macros that are not AC_REQUIREd. AC_DEFUN([gl_STDLIB_H_REQUIRE_DEFAULTS], [ m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDLIB_H_MODULE_INDICATOR_DEFAULTS], [ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB__EXIT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ABORT_DEBUG]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ALIGNED_ALLOC]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATOLL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CALLOC_GNU]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CALLOC_POSIX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CANONICALIZE_FILE_NAME]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREE_POSIX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOADAVG]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPROGNAME]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETSUBOPT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GRANTPT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MALLOC_GNU]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MALLOC_POSIX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSTOWCS]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBTOWC]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKDTEMP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKOSTEMP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKOSTEMPS]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKSTEMP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKSTEMPS]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_MEMALIGN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_OPENPT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTSNAME]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTSNAME_R]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTENV]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_QSORT_R]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RAND]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RANDOM]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RANDOM_R]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REALLOCARRAY]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REALLOC_POSIX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REALPATH]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RPMATCH]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SECURE_GETENV]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETENV]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STACK_TRACE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOD]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOLD]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOLL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOUL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOULL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SYSTEM_POSIX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNLOCKPT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNSETENV]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTOMB]) dnl Support Microsoft deprecated alias function names by default. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_ECVT], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FCVT], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_GCVT], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_MKTEMP], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_PUTENV], [1]) ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_STDLIB_H_MODULE_INDICATOR_DEFAULTS]) AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) ]) AC_DEFUN([gl_STDLIB_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. HAVE__EXIT=1; AC_SUBST([HAVE__EXIT]) HAVE_ALIGNED_ALLOC=1; AC_SUBST([HAVE_ALIGNED_ALLOC]) HAVE_ATOLL=1; AC_SUBST([HAVE_ATOLL]) HAVE_CANONICALIZE_FILE_NAME=1; AC_SUBST([HAVE_CANONICALIZE_FILE_NAME]) HAVE_DECL_ECVT=1; AC_SUBST([HAVE_DECL_ECVT]) HAVE_DECL_FCVT=1; AC_SUBST([HAVE_DECL_FCVT]) HAVE_DECL_GCVT=1; AC_SUBST([HAVE_DECL_GCVT]) HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG]) HAVE_DECL_PROGRAM_INVOCATION_NAME=1; AC_SUBST([HAVE_DECL_PROGRAM_INVOCATION_NAME]) HAVE_GETPROGNAME=1; AC_SUBST([HAVE_GETPROGNAME]) HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT]) HAVE_GRANTPT=1; AC_SUBST([HAVE_GRANTPT]) HAVE_INITSTATE=1; AC_SUBST([HAVE_INITSTATE]) HAVE_DECL_INITSTATE=1; AC_SUBST([HAVE_DECL_INITSTATE]) HAVE_MBTOWC=1; AC_SUBST([HAVE_MBTOWC]) HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP]) HAVE_MKOSTEMP=1; AC_SUBST([HAVE_MKOSTEMP]) HAVE_MKOSTEMPS=1; AC_SUBST([HAVE_MKOSTEMPS]) HAVE_MKSTEMP=1; AC_SUBST([HAVE_MKSTEMP]) HAVE_MKSTEMPS=1; AC_SUBST([HAVE_MKSTEMPS]) HAVE_POSIX_MEMALIGN=1; AC_SUBST([HAVE_POSIX_MEMALIGN]) HAVE_POSIX_OPENPT=1; AC_SUBST([HAVE_POSIX_OPENPT]) HAVE_PTSNAME=1; AC_SUBST([HAVE_PTSNAME]) HAVE_PTSNAME_R=1; AC_SUBST([HAVE_PTSNAME_R]) HAVE_QSORT_R=1; AC_SUBST([HAVE_QSORT_R]) HAVE_RANDOM=1; AC_SUBST([HAVE_RANDOM]) HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R]) HAVE_REALLOCARRAY=1; AC_SUBST([HAVE_REALLOCARRAY]) HAVE_REALPATH=1; AC_SUBST([HAVE_REALPATH]) HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH]) HAVE_SECURE_GETENV=1; AC_SUBST([HAVE_SECURE_GETENV]) HAVE_SETENV=1; AC_SUBST([HAVE_SETENV]) HAVE_DECL_SETENV=1; AC_SUBST([HAVE_DECL_SETENV]) HAVE_SETSTATE=1; AC_SUBST([HAVE_SETSTATE]) HAVE_DECL_SETSTATE=1; AC_SUBST([HAVE_DECL_SETSTATE]) HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD]) HAVE_STRTOF=1; AC_SUBST([HAVE_STRTOF]) HAVE_STRTOL=1; AC_SUBST([HAVE_STRTOL]) HAVE_STRTOLD=1; AC_SUBST([HAVE_STRTOLD]) HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL]) HAVE_STRTOUL=1; AC_SUBST([HAVE_STRTOUL]) HAVE_STRTOULL=1; AC_SUBST([HAVE_STRTOULL]) HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA]) HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H]) HAVE_SYS_PROCESS_H=0; AC_SUBST([HAVE_SYS_PROCESS_H]) HAVE_UNLOCKPT=1; AC_SUBST([HAVE_UNLOCKPT]) HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV]) REPLACE__EXIT=0; AC_SUBST([REPLACE__EXIT]) REPLACE_ABORT=0; AC_SUBST([REPLACE_ABORT]) REPLACE_ALIGNED_ALLOC=0; AC_SUBST([REPLACE_ALIGNED_ALLOC]) REPLACE_CALLOC_FOR_CALLOC_GNU=0; AC_SUBST([REPLACE_CALLOC_FOR_CALLOC_GNU]) REPLACE_CALLOC_FOR_CALLOC_POSIX=0; AC_SUBST([REPLACE_CALLOC_FOR_CALLOC_POSIX]) REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME]) REPLACE_FREE=0; AC_SUBST([REPLACE_FREE]) REPLACE_GETLOADAVG=0; AC_SUBST([REPLACE_GETLOADAVG]) REPLACE_GETPROGNAME=0; AC_SUBST([REPLACE_GETPROGNAME]) REPLACE_GETSUBOPT=0; AC_SUBST([REPLACE_GETSUBOPT]) REPLACE_INITSTATE=0; AC_SUBST([REPLACE_INITSTATE]) REPLACE_MALLOC_FOR_MALLOC_GNU=0; AC_SUBST([REPLACE_MALLOC_FOR_MALLOC_GNU]) REPLACE_MALLOC_FOR_MALLOC_POSIX=0; AC_SUBST([REPLACE_MALLOC_FOR_MALLOC_POSIX]) REPLACE_MB_CUR_MAX=0; AC_SUBST([REPLACE_MB_CUR_MAX]) REPLACE_MBSTOWCS=0; AC_SUBST([REPLACE_MBSTOWCS]) REPLACE_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC]) REPLACE_MKOSTEMP=0; AC_SUBST([REPLACE_MKOSTEMP]) REPLACE_MKOSTEMPS=0; AC_SUBST([REPLACE_MKOSTEMPS]) REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP]) REPLACE_POSIX_MEMALIGN=0; AC_SUBST([REPLACE_POSIX_MEMALIGN]) REPLACE_POSIX_OPENPT=0; AC_SUBST([REPLACE_POSIX_OPENPT]) REPLACE_PTSNAME=0; AC_SUBST([REPLACE_PTSNAME]) REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R]) REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV]) REPLACE_QSORT_R=0; AC_SUBST([REPLACE_QSORT_R]) REPLACE_RAND=0; AC_SUBST([REPLACE_RAND]) REPLACE_RANDOM=0; AC_SUBST([REPLACE_RANDOM]) REPLACE_RANDOM_R=0; AC_SUBST([REPLACE_RANDOM_R]) REPLACE_REALLOC_FOR_REALLOC_POSIX=0; AC_SUBST([REPLACE_REALLOC_FOR_REALLOC_POSIX]) REPLACE_REALLOCARRAY=0; AC_SUBST([REPLACE_REALLOCARRAY]) REPLACE_REALPATH=0; AC_SUBST([REPLACE_REALPATH]) REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV]) REPLACE_SETSTATE=0; AC_SUBST([REPLACE_SETSTATE]) REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD]) REPLACE_STRTOF=0; AC_SUBST([REPLACE_STRTOF]) REPLACE_STRTOL=0; AC_SUBST([REPLACE_STRTOL]) REPLACE_STRTOLD=0; AC_SUBST([REPLACE_STRTOLD]) REPLACE_STRTOLL=0; AC_SUBST([REPLACE_STRTOLL]) REPLACE_STRTOUL=0; AC_SUBST([REPLACE_STRTOUL]) REPLACE_STRTOULL=0; AC_SUBST([REPLACE_STRTOULL]) REPLACE_UNSETENV=0; AC_SUBST([REPLACE_UNSETENV]) REPLACE_WCTOMB=0; AC_SUBST([REPLACE_WCTOMB]) CAN_PRINT_STACK_TRACE=0; AC_SUBST([CAN_PRINT_STACK_TRACE]) ]) groff-1.24.1/gnulib_m4/isnand.m40000644000175000017500000000541215153275164013234 00000000000000# isnand.m4 # serial 15 dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl Check how to get or define isnand(). AC_DEFUN_ONCE([gl_FUNC_ISNAND], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) ISNAND_LIBM= gl_HAVE_ISNAND_NO_LIBM if test $gl_cv_func_isnand_no_libm = no; then gl_HAVE_ISNAND_IN_LIBM if test $gl_cv_func_isnand_in_libm = yes; then ISNAND_LIBM=-lm fi fi dnl The variable gl_func_isnand set here is used by isnan.m4. if test $gl_cv_func_isnand_no_libm = yes || test -n "$ISNAND_LIBM"; then gl_func_isnand=yes else gl_func_isnand=no HAVE_ISNAND=0 fi AC_SUBST([ISNAND_LIBM]) ]) dnl Check how to get or define isnand() without linking with libm. AC_DEFUN([gl_FUNC_ISNAND_NO_LIBM], [ gl_HAVE_ISNAND_NO_LIBM gl_func_isnand_no_libm=$gl_cv_func_isnand_no_libm if test $gl_cv_func_isnand_no_libm = yes; then AC_DEFINE([HAVE_ISNAND_IN_LIBC], [1], [Define if the isnan(double) function is available in libc.]) fi ]) dnl Prerequisites of replacement isnand definition. It does not need -lm. AC_DEFUN([gl_PREREQ_ISNAND], [ AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION]) ]) dnl Test whether isnand() can be used with libm. AC_DEFUN([gl_HAVE_ISNAND_IN_LIBM], [ AC_CACHE_CHECK([whether isnan(double) can be used with libm], [gl_cv_func_isnand_in_libm], [ saved_LIBS="$LIBS" LIBS="$LIBS -lm" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnand # define isnand(x) __builtin_isnan ((double)(x)) #elif defined isnan # undef isnand # define isnand(x) isnan ((double)(x)) #endif double x;]], [[return isnand (x);]])], [gl_cv_func_isnand_in_libm=yes], [gl_cv_func_isnand_in_libm=no]) LIBS="$saved_LIBS" ]) ]) AC_DEFUN([gl_HAVE_ISNAND_NO_LIBM], [ AC_CACHE_CHECK([whether isnan(double) can be used without linking with libm], [gl_cv_func_isnand_no_libm], [ AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnand # define isnand(x) __builtin_isnan ((double)(x)) #else # undef isnand # define isnand(x) isnan ((double)(x)) #endif double x;]], [[return isnand (x);]])], [gl_cv_func_isnand_no_libm=yes], [gl_cv_func_isnand_no_libm=no]) ]) ]) groff-1.24.1/gnulib_m4/sched_h.m40000644000175000017500000000624515153275164013362 00000000000000# sched_h.m4 # serial 16 dnl Copyright (C) 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl Written by Bruno Haible. AC_DEFUN_ONCE([gl_SCHED_H], [ dnl Ensure to expand the default settings once only, before all statements dnl that occur in other macros. AC_REQUIRE([gl_SCHED_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_CHECK_HEADER_SYS_CDEFS_H]) AC_CHECK_HEADERS([sched.h], [], [], [[#if HAVE_SYS_CDEFS_H #include #endif ]]) gl_NEXT_HEADERS([sched.h]) if test "$ac_cv_header_sched_h" = yes; then HAVE_SCHED_H=1 else HAVE_SCHED_H=0 fi AC_SUBST([HAVE_SCHED_H]) if test "$HAVE_SCHED_H" = 1; then AC_CHECK_TYPE([struct sched_param], [HAVE_STRUCT_SCHED_PARAM=1], [HAVE_STRUCT_SCHED_PARAM=0], [[#if HAVE_SYS_CDEFS_H #include #endif #include ]]) else HAVE_STRUCT_SCHED_PARAM=0 case "$host_os" in os2*) dnl On OS/2 kLIBC, struct sched_param is in spawn.h. AC_CHECK_TYPE([struct sched_param], [HAVE_STRUCT_SCHED_PARAM=1], [], [#include ]) ;; vms) dnl On OpenVMS 7.2 or newer, struct sched_param is in pthread.h. AC_CHECK_TYPE([struct sched_param], [HAVE_STRUCT_SCHED_PARAM=1], [], [#include ]) ;; esac fi AC_SUBST([HAVE_STRUCT_SCHED_PARAM]) dnl Ensure the type pid_t gets defined. AC_REQUIRE([AC_TYPE_PID_T]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use, if it is not common dnl enough to be declared everywhere. gl_WARN_ON_USE_PREPARE([[#include ]], [sched_yield]) ]) # gl_SCHED_MODULE_INDICATOR([modulename]) # sets the shell variable that indicates the presence of the given module # to a C preprocessor expression that will evaluate to 1. # This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_SCHED_MODULE_INDICATOR], [ dnl Ensure to expand the default settings once only. gl_SCHED_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) # Initializes the default values for AC_SUBSTed shell variables. # This macro must not be AC_REQUIREd. It must only be invoked, and only # outside of macros or in macros that are not AC_REQUIREd. AC_DEFUN([gl_SCHED_H_REQUIRE_DEFAULTS], [ m4_defun(GL_MODULE_INDICATOR_PREFIX[_SCHED_H_MODULE_INDICATOR_DEFAULTS], [ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SCHED_YIELD]) ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_SCHED_H_MODULE_INDICATOR_DEFAULTS]) AC_REQUIRE([gl_SCHED_H_DEFAULTS]) ]) AC_DEFUN([gl_SCHED_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. HAVE_SCHED_YIELD=1; AC_SUBST([HAVE_SCHED_YIELD]) REPLACE_SCHED_YIELD=0; AC_SUBST([REPLACE_SCHED_YIELD]) ]) groff-1.24.1/gnulib_m4/mbsinit.m40000644000175000017500000000250515153275164013425 00000000000000# mbsinit.m4 # serial 10 dnl Copyright (C) 2008, 2010-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_MBSINIT], [ AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_TYPE_MBSTATE_T]) gl_MBSTATE_T_BROKEN AC_CHECK_FUNCS_ONCE([mbsinit]) if test $ac_cv_func_mbsinit = no; then HAVE_MBSINIT=0 AC_CHECK_DECLS([mbsinit],,, [[ #include ]]) if test $ac_cv_have_decl_mbsinit = yes; then dnl On Minix 3.1.8, the system's declares mbsinit() although dnl it does not have the function. Avoid a collision with gnulib's dnl replacement. REPLACE_MBSINIT=1 fi else if test $REPLACE_MBSTATE_T = 1; then REPLACE_MBSINIT=1 else dnl On mingw, mbsinit() always returns 1, which is inappropriate for dnl states produced by mbrtowc() for an incomplete multibyte character dnl in multibyte locales. case "$host_os" in mingw* | windows*) REPLACE_MBSINIT=1 ;; esac fi fi ]) # Prerequisites of lib/mbsinit.c. AC_DEFUN([gl_PREREQ_MBSINIT], [ : ]) groff-1.24.1/gnulib_m4/memchr.m40000644000175000017500000000615615153275164013241 00000000000000# memchr.m4 # serial 21 dnl Copyright (C) 2002-2004, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN_ONCE([gl_FUNC_MEMCHR], [ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Check for prerequisites for memory fence checks. gl_FUNC_MMAP_ANON AC_CHECK_HEADERS_ONCE([sys/mman.h]) AC_CHECK_FUNCS_ONCE([mprotect]) AC_REQUIRE([gl_STRING_H_DEFAULTS]) # Detect platform-specific bugs in some versions of glibc: # memchr should not dereference anything with length 0 # https://bugzilla.redhat.com/show_bug.cgi?id=499689 # memchr should not dereference overestimated length after a match # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 # https://sourceware.org/PR10162 # memchr should cast the second argument to 'unsigned char'. # This bug exists in Android 4.3. # Assume that memchr works on platforms that lack mprotect. AC_CACHE_CHECK([whether memchr works], [gl_cv_func_memchr_works], [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include #if HAVE_SYS_MMAN_H # include # include # include # include #endif ]], [[ int result = 0; char *fence = NULL; #if HAVE_SYS_MMAN_H && HAVE_MPROTECT { long int pagesize = sysconf (_SC_PAGESIZE); char *two_pages = (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); if (two_pages != (char *)(-1) && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0) fence = two_pages + pagesize; } #endif if (fence) { /* Test against bugs on glibc systems. */ if (memchr (fence, 0, 0)) result |= 1; strcpy (fence - 9, "12345678"); if (memchr (fence - 9, 0, 79) != fence - 1) result |= 2; if (memchr (fence - 1, 0, 3) != fence - 1) result |= 4; /* Test against bug on AIX 7.2. */ if (memchr (fence - 4, '6', 16) != fence - 4) result |= 8; } /* Test against bug on Android 4.3. */ { char input[3]; input[0] = 'a'; input[1] = 'b'; input[2] = 'c'; if (memchr (input, 0x789abc00 | 'b', 3) != input + 1) result |= 16; } return result; ]])], [gl_cv_func_memchr_works=yes], [gl_cv_func_memchr_works=no], [case "$host_os" in # Guess no on Android. linux*-android*) gl_cv_func_memchr_works="guessing no" ;; # Guess yes on native Windows. mingw* | windows*) gl_cv_func_memchr_works="guessing yes" ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;; esac ]) ]) case "$gl_cv_func_memchr_works" in *yes) ;; *) REPLACE_MEMCHR=1 ;; esac ]) # Prerequisites of lib/memchr.c. AC_DEFUN([gl_PREREQ_MEMCHR], [ AC_CHECK_HEADERS([bp-sym.h]) ]) groff-1.24.1/gnulib_m4/fabs.m40000644000175000017500000000065615153275164012700 00000000000000# fabs.m4 # serial 1 dnl Copyright (C) 2011-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_FABS], [ dnl Determine FABS_LIBM. gl_MATHFUNC([fabs], [double], [(double)]) ]) groff-1.24.1/gnulib_m4/malloc.m40000644000175000017500000002012615153275164013226 00000000000000# malloc.m4 # serial 46 dnl Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. m4_version_prereq([2.73], [], [ # Modules that use this macro directly or indirectly should depend # on extensions-aix, so that _LINUX_SOURCE_COMPAT gets defined # before this macro gets invoked. This helps on AIX 7.2 and earlier # if !(__VEC__ || __AIXVEC), and doesn't hurt otherwise. # # This is copied from upstream Autoconf here: # https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/functions.m4?id=1f38316f6af7bf63e5e7dd187ff6456e07ad743e#n971 # _AC_FUNC_MALLOC_IF(IF-WORKS, IF-NOT[, UNKNOWN-ASSUME]) # ------------------------------------------------------ # If 'malloc (0)' returns nonnull, run IF-WORKS, otherwise, IF-NOT. # If it is not known whether it works, assume the shell word UNKNOWN-ASSUME, # which should end in "yes" or in something else (the latter is the default). AC_DEFUN([_AC_FUNC_MALLOC_IF], [ AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles AC_CACHE_CHECK([whether malloc (0) returns nonnull], [ac_cv_func_malloc_0_nonnull], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include /* Use pmalloc to test; 'volatile' prevents the compiler from optimizing the malloc call away. */ void *(*volatile pmalloc) (size_t) = malloc;]], [[void *p = pmalloc (0); int result = !p; free (p); return result;]])], [ac_cv_func_malloc_0_nonnull=yes], [ac_cv_func_malloc_0_nonnull=no], [AS_CASE([$host_os], [# Guess yes on platforms where we know the result. *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ | gnu* | *-musl* | midipix* | midnightbsd* \ | hpux* | solaris* | cygwin* | mingw* | windows* | msys*], [ac_cv_func_malloc_0_nonnull="guessing yes"], [# Guess as follows if we don't know. ac_cv_func_malloc_0_nonnull=m4_default([$3], ["guessing no"])])])]) AS_CASE([$ac_cv_func_malloc_0_nonnull], [*yes], [$1], [$2]) ])# _AC_FUNC_MALLOC_IF ]) # gl_FUNC_MALLOC_0_NONNULL # ------------------------ # If 'malloc (0)' returns nonnull define HAVE_MALLOC_0_NONNULL. # Also, set ac_cv_func_malloc_0_nonnull to a string that ends in # "yes", otherwise set it to something else. If unknown whether # malloc (0) works, guess as normal for cross-builds. AC_DEFUN([gl_FUNC_MALLOC_0_NONNULL], [ _AC_FUNC_MALLOC_IF( [AC_DEFINE([HAVE_MALLOC_0_NONNULL], [1], [Define to 1 if malloc (0) returns nonnull.])], [], ["$gl_cross_guess_normal"]) ]) # gl_FUNC_MALLOC_GNU # ------------------ # Test whether malloc (0) is compatible with GNU libc. # Replace malloc if not. # Define HAVE_MALLOC_0_NONNULL if malloc (0) returns nonnull (except upon # out-of-memory). # Define HAVE_MALLOC_PTRDIFF if malloc (N) reliably fails when N exceeds # PTRDIFF_MAX. AC_DEFUN([gl_FUNC_MALLOC_GNU], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) AC_REQUIRE([gl_FUNC_MALLOC_POSIX]) AC_REQUIRE([gl_FUNC_MALLOC_0_NONNULL]) AS_CASE([$ac_cv_func_malloc_0_nonnull], [*yes], [REPLACE_MALLOC_FOR_MALLOC_GNU=$REPLACE_MALLOC_FOR_MALLOC_POSIX], [REPLACE_MALLOC_FOR_MALLOC_GNU=1]) ]) # gl_FUNC_MALLOC_PTRDIFF # ---------------------- # Test whether malloc (N) reliably fails when N exceeds PTRDIFF_MAX. # Define HAVE_MALLOC_PTRDIFF if yes. # Replace malloc if not. AC_DEFUN([gl_FUNC_MALLOC_PTRDIFF], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) AC_REQUIRE([gl_CHECK_MALLOC_PTRDIFF]) AS_IF([test "$gl_cv_malloc_ptrdiff" = yes], [AC_DEFINE([HAVE_MALLOC_PTRDIFF], 1, [Define to 1 if malloc-like functions do not allocate objects larger than PTRDIFF_MAX bytes.])], [REPLACE_MALLOC_FOR_MALLOC_POSIX=1]) ]) # Test whether malloc, calloc refuse to create objects # larger than what can be expressed in ptrdiff_t. # Set gl_cv_func_malloc_gnu. AC_DEFUN([gl_CHECK_MALLOC_PTRDIFF], [ AC_CACHE_CHECK([whether malloc is ptrdiff_t safe], [gl_cv_malloc_ptrdiff], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[/* 64-bit ptrdiff_t is so wide that no practical platform can exceed it. */ #define WIDE_PTRDIFF (PTRDIFF_MAX >> 31 >> 31 != 0) /* On rare machines where size_t fits in ptrdiff_t there is no problem. */ #define NARROW_SIZE (SIZE_MAX <= PTRDIFF_MAX) /* glibc 2.30 and later malloc refuses to exceed ptrdiff_t bounds even on 32-bit platforms. We don't know which non-glibc systems are safe. */ #define KNOWN_SAFE (2 < __GLIBC__ + (30 <= __GLIBC_MINOR__)) #if WIDE_PTRDIFF || NARROW_SIZE || KNOWN_SAFE return 0; #else #error "malloc might not be ptrdiff_t safe" syntax error #endif ]])], [gl_cv_malloc_ptrdiff=yes], [gl_cv_malloc_ptrdiff=no]) ]) ]) # gl_FUNC_MALLOC_POSIX # -------------------- # Test whether 'malloc' is POSIX compliant (sets errno to ENOMEM when it # fails, and doesn't mess up with ptrdiff_t overflow), and replace # malloc if it is not. AC_DEFUN([gl_FUNC_MALLOC_POSIX], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) AC_REQUIRE([gl_FUNC_MALLOC_PTRDIFF]) AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) case "$gl_cv_func_malloc_posix" in *yes) AC_DEFINE([HAVE_MALLOC_POSIX], [1], [Define if malloc and calloc set errno on allocation failure.]) ;; *) REPLACE_MALLOC_FOR_MALLOC_POSIX=1 ;; esac ]) # Test whether malloc, calloc set errno to ENOMEM on failure. # Set gl_cv_func_malloc_posix to *yes or *no accordingly. AC_DEFUN([gl_CHECK_MALLOC_POSIX], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([whether malloc, calloc set errno on failure], [gl_cv_func_malloc_posix], [ dnl It is too dangerous to try to allocate a large amount of memory: dnl some systems go to their knees when you do that. So assume that dnl all Unix implementations of the function set errno on failure, dnl except on those platforms where we have seen 'test-malloc-gnu', dnl 'test-realloc-posix', 'test-calloc-gnu' fail. For platforms dnl where only 'test-realloc-posix', see realloc.m4. case "$host_os" in mingw* | windows*) dnl Old MSVCRT from 2001 did not set errno=ENOMEM when malloc failed. dnl More recent MSVCRT from 2019 does so. dnl UCRT is the successor of MSVCRT. Assume that UCRT does so as well. AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include #ifndef _UCRT msvcrt yuck #endif ]], [[]]) ], [gl_cv_func_malloc_posix="guessing yes"], [gl_cv_func_malloc_posix="guessing no"]) ;; solaris*) dnl On Solaris 11.3, the three functions might fail with errno set dnl to EAGAIN, not ENOMEM, when the argument is larger than dnl PTRDIFF_MAX. See: dnl https://lists.gnu.org/r/bug-gnulib/2021-05/msg00052.html dnl Here is a test program: m4_divert_push([KILL]) #include #include #include #include #include #define TEST_CALL(call) \ do { \ void *p = call; \ if (p) \ fprintf (stderr, "returned %p (incorrect success)\n", p); \ else if (errno == ENOMEM) \ perror ("correct failure"); \ else \ perror ("incorrect failure (wrong errno)"); \ free (p); \ } while (0) int main () { size_t big = PTRDIFF_MAX; TEST_CALL (malloc (big + 1)); TEST_CALL (calloc (big / 2 + 1, 2)); TEST_CALL (realloc (NULL, big + 1)); void *small = malloc (1); TEST_CALL (realloc (small, big + 1)); free (small); return 0; } m4_divert_pop([KILL]) gl_cv_func_malloc_posix=no ;; *) gl_cv_func_malloc_posix=yes ;; esac ]) ]) groff-1.24.1/gnulib_m4/stdcountof_h.m40000644000175000017500000000332515153275164014460 00000000000000# stdcountof_h.m4 # serial 2 dnl Copyright 2025-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN_ONCE([gl_STDCOUNTOF_H], [ AC_CHECK_HEADERS_ONCE([stdcountof.h]) gl_CHECK_NEXT_HEADERS([stdcountof.h]) if test $ac_cv_header_stdcountof_h = yes; then HAVE_STDCOUNTOF_H=1 else HAVE_STDCOUNTOF_H=0 fi AC_SUBST([HAVE_STDCOUNTOF_H]) dnl In clang 21, exists but does not work in C++ mode, because dnl it uses _Countof, which is not a compiler built-in in C++ mode. m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])]) CXX_HAVE_STDCOUNTOF_H=1 if test "$CXX" != no; then AC_CACHE_CHECK([whether the C++ compiler has ], [gl_cv_cxx_have_stdcountof_h], [dnl We can't use AC_LANG_PUSH([C++]) and AC_LANG_POP([C++]) here, due to dnl an autoconf bug . cat > conftest.cpp <<\EOF #include int a[] = { 86, 47 }; unsigned int a_n = countof (a); EOF gl_command="$CXX $CXXFLAGS $CPPFLAGS -c conftest.cpp" if AC_TRY_EVAL([gl_command]); then gl_cv_cxx_have_stdcountof_h=yes else gl_cv_cxx_have_stdcountof_h=no fi rm -fr conftest* ]) if test $gl_cv_cxx_have_stdcountof_h != yes; then CXX_HAVE_STDCOUNTOF_H=0 fi fi AC_SUBST([CXX_HAVE_STDCOUNTOF_H]) if test $HAVE_STDCOUNTOF_H = 1 && test $CXX_HAVE_STDCOUNTOF_H = 1; then GL_GENERATE_STDCOUNTOF_H=false else GL_GENERATE_STDCOUNTOF_H=true fi ]) groff-1.24.1/gnulib_m4/locale-en.m40000644000175000017500000001320215153275164013613 00000000000000# locale-en.m4 # serial 1 dnl Copyright (C) 2003-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Bruno Haible. dnl Determine the name of an English (or American English) locale with dnl UTF-8 encoding. AC_DEFUN_ONCE([gt_LOCALE_EN_UTF8], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AM_LANGINFO_CODESET]) AC_CACHE_CHECK([for an english Unicode locale], [gt_cv_locale_en_utf8], [ case "$host_os" in *-musl* | midipix*) dnl On musl libc, all kinds of ll_CC.UTF-8 locales exist, even without dnl any locale file on disk. But they are effectively equivalent to the dnl C.UTF-8 locale, except for locale categories (such as LC_MESSAGES) dnl for which localizations (.mo files) have been installed. gt_cv_locale_en_utf8=en_US.UTF-8 ;; *) AC_LANG_CONFTEST([AC_LANG_SOURCE([[ #include #include #if HAVE_LANGINFO_CODESET # include #endif #include #include struct tm t; char buf[16]; int main () { /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl imitates locale dependent behaviour by looking at the environment variables, and all locales use the UTF-8 encoding. */ #if !(defined __BEOS__ || defined __HAIKU__) /* Check whether the given locale name is recognized by the system. */ # if defined _WIN32 && !defined __CYGWIN__ /* On native Windows, setlocale(category, "") looks at the system settings, not at the environment variables. Also, when an encoding suffix such as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE category of the locale to "C". */ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) return 1; # else if (setlocale (LC_ALL, "") == NULL) return 1; # endif /* Check whether nl_langinfo(CODESET) is "UTF-8" or equivalent. */ # if HAVE_LANGINFO_CODESET { const char *cs = nl_langinfo (CODESET); if (!(strcmp (cs, "UTF-8") == 0 || strcmp (cs, "UTF8") == 0 || strcmp (cs, "utf-8") == 0 || strcmp (cs, "utf8") == 0)) return 1; } # endif # ifdef __CYGWIN__ /* On Cygwin, avoid locale names without encoding suffix, because the locale_charset() function relies on the encoding suffix. Note that LC_ALL is set on the command line. */ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; # endif /* Check the third month name. */ t.tm_year = 1975 - 1900; t.tm_mon = 3 - 1; t.tm_mday = 24; if (strftime (buf, sizeof (buf), "%B", &t) < 5 || strcmp (buf, "March") != 0) return 1; #endif #if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ /* Check whether the decimal separator is a dot. */ if (localeconv () ->decimal_point[0] != '.') return 1; #endif return 0; } ]])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then case "$host_os" in # Handle native Windows specially, because there setlocale() interprets # "ar" or "ara" as "Arabic" or "Arabic_Saudi Arabia.1256", # "en" or "eng" as "English" or "English_United States.1252", # "fr" or "fra" as "French" or "French_France.1252", # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", # "ja" or "jpn" as "Japanese" or "Japanese_Japan.932", # and similar. mingw* | windows*) # Test for the hypothetical native Windows locale name. if (LC_ALL='English_United States.65001' LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_en_utf8='English_United States.65001' else # None found. gt_cv_locale_en_utf8=none fi ;; *) # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the # configure script would override the LC_ALL setting. Likewise for # LC_CTYPE, which is also set at the beginning of the configure script. # Test for the locale name with explicit encoding suffix first # (this is necessary on Haiku). if (LC_ALL=en_US.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_en_utf8=en_US.UTF-8 else # Test for the locale name without encoding suffix. if (LC_ALL=en_US LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_en_utf8=en_US else # Test for the Solaris 10 locale name. if (LC_ALL=en.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_en_utf8=en.UTF-8 else # None found. gt_cv_locale_en_utf8=none fi fi fi ;; esac fi rm -fr conftest* ;; esac ]) LOCALE_EN_UTF8="$gt_cv_locale_en_utf8" case "$LOCALE_EN_UTF8" in #( '' | *[[\"\$\'*@<:@]]*) dnl The empty value occurs when the conftest.c program above could not dnl be compiled. The other values might cause trouble with sh or make. AC_MSG_WARN([invalid locale "$LOCALE_EN_UTF8"; assuming "none"]) LOCALE_EN_UTF8=none;; esac AC_SUBST([LOCALE_EN_UTF8]) ]) groff-1.24.1/gnulib_m4/builtin-expect.m40000644000175000017500000000320615153275164014713 00000000000000# builtin-expect.m4 # serial 3 dnl Copyright 2016-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl Provide a GCC-compatible __builtin_expect macro in . dnl Written by Paul Eggert. AC_DEFUN([gl___BUILTIN_EXPECT], [ AC_CACHE_CHECK([for __builtin_expect], [gl_cv___builtin_expect], [AC_LINK_IFELSE( [AC_LANG_SOURCE([[ int main (int argc, char **argv) { argc = __builtin_expect (argc, 100); return argv[argc != 100][0]; }]])], [gl_cv___builtin_expect=yes], [AC_LINK_IFELSE( [AC_LANG_SOURCE([[ #include int main (int argc, char **argv) { argc = __builtin_expect (argc, 100); return argv[argc != 100][0]; }]])], [gl_cv___builtin_expect="in "], [gl_cv___builtin_expect=no])])]) if test "$gl_cv___builtin_expect" = yes; then AC_DEFINE([HAVE___BUILTIN_EXPECT], [1]) elif test "$gl_cv___builtin_expect" = "in "; then AC_DEFINE([HAVE___BUILTIN_EXPECT], [2]) fi AH_VERBATIM([HAVE___BUILTIN_EXPECT], [/* Define to 1 if the compiler supports __builtin_expect, and to 2 if does. */ #undef HAVE___BUILTIN_EXPECT #ifndef HAVE___BUILTIN_EXPECT # define __builtin_expect(e, c) (e) #elif HAVE___BUILTIN_EXPECT == 2 # include #endif ])]) groff-1.24.1/gnulib_m4/frexpl.m40000644000175000017500000001560515153275164013265 00000000000000# frexpl.m4 # serial 25 dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_FREXPL], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) dnl Persuade glibc to declare frexpl(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) dnl Check whether it's declared. dnl Mac OS X 10.3 has frexpl() in libc but doesn't declare it in . AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include ]]) FREXPL_LIBM= if test $HAVE_DECL_FREXPL = 1; then gl_CHECK_FREXPL_NO_LIBM if test $gl_cv_func_frexpl_no_libm = no; then AC_CACHE_CHECK([whether frexpl() can be used with libm], [gl_cv_func_frexpl_in_libm], [ saved_LIBS="$LIBS" LIBS="$LIBS -lm" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include long double x;]], [[int e; return frexpl (x, &e) > 0;]])], [gl_cv_func_frexpl_in_libm=yes], [gl_cv_func_frexpl_in_libm=no]) LIBS="$saved_LIBS" ]) if test $gl_cv_func_frexpl_in_libm = yes; then FREXPL_LIBM=-lm fi fi if test $gl_cv_func_frexpl_no_libm = yes \ || test $gl_cv_func_frexpl_in_libm = yes; then saved_LIBS="$LIBS" LIBS="$LIBS $FREXPL_LIBM" gl_FUNC_FREXPL_WORKS LIBS="$saved_LIBS" case "$gl_cv_func_frexpl_works" in *yes) gl_func_frexpl=yes ;; *) gl_func_frexpl=no; REPLACE_FREXPL=1 ;; esac else gl_func_frexpl=no fi if test $gl_func_frexpl = yes; then AC_DEFINE([HAVE_FREXPL], [1], [Define if the frexpl() function is available.]) fi fi if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then dnl Find libraries needed to link lib/frexpl.c. if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then AC_REQUIRE([gl_FUNC_FREXP]) FREXPL_LIBM="$FREXP_LIBM" else FREXPL_LIBM= fi fi AC_SUBST([FREXPL_LIBM]) ]) AC_DEFUN([gl_FUNC_FREXPL_NO_LIBM], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) dnl Check whether it's declared. dnl Mac OS X 10.3 has frexpl() in libc but doesn't declare it in . AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include ]]) if test $HAVE_DECL_FREXPL = 1; then gl_CHECK_FREXPL_NO_LIBM if test $gl_cv_func_frexpl_no_libm = yes; then gl_FUNC_FREXPL_WORKS case "$gl_cv_func_frexpl_works" in *yes) gl_func_frexpl_no_libm=yes ;; *) gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;; esac else gl_func_frexpl_no_libm=no dnl Set REPLACE_FREXPL here because the system may have frexpl in libm. REPLACE_FREXPL=1 fi if test $gl_func_frexpl_no_libm = yes; then AC_DEFINE([HAVE_FREXPL_IN_LIBC], [1], [Define if the frexpl() function is available in libc.]) fi fi ]) dnl Test whether frexpl() can be used without linking with libm. dnl Set gl_cv_func_frexpl_no_libm to 'yes' or 'no' accordingly. AC_DEFUN([gl_CHECK_FREXPL_NO_LIBM], [ AC_CACHE_CHECK([whether frexpl() can be used without linking with libm], [gl_cv_func_frexpl_no_libm], [ AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include long double x;]], [[int e; return frexpl (x, &e) > 0;]])], [gl_cv_func_frexpl_no_libm=yes], [gl_cv_func_frexpl_no_libm=no]) ]) ]) dnl Test whether frexpl() works on finite numbers (this fails on dnl Mac OS X 10.4/PowerPC, on AIX 5.1, and on BeOS), on denormalized numbers dnl (this fails on Mac OS X 10.5/i386), and also on infinite numbers (this dnl fails e.g. on mingw). AC_DEFUN([gl_FUNC_FREXPL_WORKS], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether frexpl works], [gl_cv_func_frexpl_works], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include /* Override the values of , like done in float.in.h. */ #if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__) # undef LDBL_MIN_EXP # define LDBL_MIN_EXP (-16381) #endif #if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__) # undef LDBL_MIN_EXP # define LDBL_MIN_EXP (-16381) #endif #if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__ # undef LDBL_MIN_EXP # define LDBL_MIN_EXP DBL_MIN_EXP #endif extern #ifdef __cplusplus "C" #endif long double frexpl (long double, int *); long double zero = 0.0L; int main() { int result = 0; volatile long double x; /* Test on finite numbers that fails on AIX 5.1. */ x = 16.0L; { int exp = -9999; frexpl (x, &exp); if (exp != 5) result |= 1; } /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl function returns an invalid (incorrectly normalized) value: it returns y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 } but the correct result is 0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 } */ x = 1.01L; { int exp = -9999; long double y = frexpl (x, &exp); if (!(exp == 1 && y == 0.505L)) result |= 2; } /* Test on large finite numbers. This fails on BeOS at i = 16322, while LDBL_MAX_EXP = 16384. In the loop end test, we test x against Infinity, rather than comparing i with LDBL_MAX_EXP, because BeOS has a wrong LDBL_MAX_EXP. */ { int i; for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L) { int exp = -9999; frexpl (x, &exp); if (exp != i) { result |= 4; break; } } } /* Test on denormalized numbers. */ { int i; for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L) ; if (x > 0.0L) { int exp; long double y = frexpl (x, &exp); /* On machines with IEEE854 arithmetic: x = 1.68105e-4932, exp = -16382, y = 0.5. On Mac OS X 10.5: exp = -16384, y = 0.5. */ if (exp != LDBL_MIN_EXP - 1) result |= 8; } } /* Test on infinite numbers. */ /* The Microsoft MSVC 14 compiler chokes on the expression 1.0 / 0.0. */ x = 1.0L / zero; { int exp; long double y = frexpl (x, &exp); if (y != x) result |= 16; } return result; }]])], [gl_cv_func_frexpl_works=yes], [gl_cv_func_frexpl_works=no], [ changequote(,)dnl case "$host_os" in aix | aix[3-6]* | beos* | darwin* | mingw* | windows* | pw*) gl_cv_func_frexpl_works="guessing no";; *) gl_cv_func_frexpl_works="guessing yes";; esac changequote([,])dnl ]) ]) ]) groff-1.24.1/gnulib_m4/nocrash.m40000644000175000017500000001064515153275164013421 00000000000000# nocrash.m4 # serial 5 dnl Copyright (C) 2005, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl Based on libsigsegv, from Bruno Haible and Paolo Bonzini. AC_PREREQ([2.13]) dnl Expands to some code for use in .c programs that will cause the configure dnl test to exit instead of crashing. This is useful to avoid triggering dnl action from a background debugger and to avoid core dumps. dnl Usage: ... dnl ]GL_NOCRASH[ dnl ... dnl int main() { nocrash_init(); ... } AC_DEFUN([GL_NOCRASH],[[ #include #if defined __MACH__ && defined __APPLE__ /* Avoid a crash on Mac OS X. */ #include #include #include #include #include #include /* The exception port on which our thread listens. */ static mach_port_t our_exception_port; /* The main function of the thread listening for exceptions of type EXC_BAD_ACCESS. */ static void * mach_exception_thread (void *arg) { /* Buffer for a message to be received. */ struct { mach_msg_header_t head; mach_msg_body_t msgh_body; char data[1024]; } msg; mach_msg_return_t retval; /* Wait for a message on the exception port. */ retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg), our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); if (retval != MACH_MSG_SUCCESS) abort (); exit (1); } static void nocrash_init (void) { mach_port_t self = mach_task_self (); /* Allocate a port on which the thread shall listen for exceptions. */ if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port) == KERN_SUCCESS) { /* See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */ if (mach_port_insert_right (self, our_exception_port, our_exception_port, MACH_MSG_TYPE_MAKE_SEND) == KERN_SUCCESS) { /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting for us. */ exception_mask_t mask = EXC_MASK_BAD_ACCESS; /* Create the thread listening on the exception port. */ pthread_attr_t attr; pthread_t thread; if (pthread_attr_init (&attr) == 0 && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0 && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) { pthread_attr_destroy (&attr); /* Replace the exception port info for these exceptions with our own. Note that we replace the exception port for the entire task, not only for a particular thread. This has the effect that when our exception port gets the message, the thread specific exception port has already been asked, and we don't need to bother about it. See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */ task_set_exception_ports (self, mask, our_exception_port, EXCEPTION_DEFAULT, MACHINE_THREAD_STATE); } } } } #elif defined _WIN32 && ! defined __CYGWIN__ /* Avoid a crash on native Windows. */ #define WIN32_LEAN_AND_MEAN #include #include static LONG WINAPI exception_filter (EXCEPTION_POINTERS *ExceptionInfo) { switch (ExceptionInfo->ExceptionRecord->ExceptionCode) { case EXCEPTION_ACCESS_VIOLATION: case EXCEPTION_IN_PAGE_ERROR: case EXCEPTION_STACK_OVERFLOW: case EXCEPTION_GUARD_PAGE: case EXCEPTION_PRIV_INSTRUCTION: case EXCEPTION_ILLEGAL_INSTRUCTION: case EXCEPTION_DATATYPE_MISALIGNMENT: case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: case EXCEPTION_NONCONTINUABLE_EXCEPTION: exit (1); } return EXCEPTION_CONTINUE_SEARCH; } static void nocrash_init (void) { SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter); } #else /* Avoid a crash on POSIX systems. */ #include #include /* A POSIX signal handler. */ static void exception_handler (int sig) { _exit (1); } static void nocrash_init (void) { #ifdef SIGSEGV signal (SIGSEGV, exception_handler); #endif #ifdef SIGBUS signal (SIGBUS, exception_handler); #endif } #endif ]]) groff-1.24.1/gnulib_m4/strerror.m40000644000175000017500000000740115153275164013642 00000000000000# strerror.m4 # serial 25 dnl Copyright (C) 2002, 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_STRERROR], [ AC_REQUIRE([gl_STRING_H_DEFAULTS]) AC_REQUIRE([gl_HEADER_ERRNO_H]) AC_REQUIRE([gl_FUNC_STRERROR_0]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [ AC_REQUIRE([gl_FUNC_STRERROR_R_WORKS]) ]) if test "$GL_GENERATE_ERRNO_H:$REPLACE_STRERROR_0" = false:0; then AC_CACHE_CHECK([for working strerror function], [gl_cv_func_working_strerror], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[if (!*strerror (-2)) return 1;]])], [gl_cv_func_working_strerror=yes], [gl_cv_func_working_strerror=no], [case "$host_os" in # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;; # Guess yes on musl systems. *-musl* | midipix*) gl_cv_func_working_strerror="guessing yes" ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_working_strerror="$gl_cross_guess_normal" ;; esac ]) ]) case "$gl_cv_func_working_strerror" in *yes) ;; *) dnl The system's strerror() fails to return a string for out-of-range dnl integers. Replace it. REPLACE_STRERROR=1 ;; esac m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [ dnl If the system's strerror_r or __xpg_strerror_r clobbers strerror's dnl buffer, we must replace strerror. case "$gl_cv_func_strerror_r_works" in *no) REPLACE_STRERROR=1 ;; esac ]) else dnl The system's strerror() cannot know about the new errno values we add dnl to , or any fix for strerror(0). Replace it. REPLACE_STRERROR=1 fi ]) dnl Detect if strerror(0) passes (that is, does not set errno, and does not dnl return a string that matches strerror(-1)). AC_DEFUN([gl_FUNC_STRERROR_0], [ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles REPLACE_STRERROR_0=0 AC_CACHE_CHECK([whether strerror(0) succeeds], [gl_cv_func_strerror_0_works], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include #include ]], [[int result = 0; char *str; errno = 0; str = strerror (0); if (!*str) result |= 1; if (errno) result |= 2; if (strstr (str, "nknown") || strstr (str, "ndefined")) result |= 4; return result;]])], [gl_cv_func_strerror_0_works=yes], [gl_cv_func_strerror_0_works=no], [case "$host_os" in # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;; # Guess yes on musl systems. *-musl* | midipix*) gl_cv_func_strerror_0_works="guessing yes" ;; # Guess yes on native Windows. mingw* | windows*) gl_cv_func_strerror_0_works="guessing yes" ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_strerror_0_works="$gl_cross_guess_normal" ;; esac ]) ]) case "$gl_cv_func_strerror_0_works" in *yes) ;; *) REPLACE_STRERROR_0=1 AC_DEFINE([REPLACE_STRERROR_0], [1], [Define to 1 if strerror(0) does not return a message implying success.]) ;; esac ]) groff-1.24.1/gnulib_m4/setenv.m40000644000175000017500000001167515153275164013274 00000000000000# setenv.m4 # serial 36 dnl Copyright (C) 2001-2004, 2006-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_SETENV], [ AC_REQUIRE([gl_FUNC_SETENV_SEPARATE]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles if test $ac_cv_func_setenv = no; then HAVE_SETENV=0 else AC_CACHE_CHECK([whether setenv validates arguments], [gl_cv_func_setenv_works], [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include #include #include ]], [[ int result = 0; { if (setenv ("", "", 0) != -1) result |= 1; else if (errno != EINVAL) result |= 2; } { if (setenv ("a", "=", 1) != 0) result |= 4; else if (strcmp (getenv ("a"), "=") != 0) result |= 8; } return result; ]])], [gl_cv_func_setenv_works=yes], [gl_cv_func_setenv_works=no], [case "$host_os" in # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;; # Guess yes on musl systems. *-musl* | midipix*) gl_cv_func_setenv_works="guessing yes" ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_setenv_works="$gl_cross_guess_normal" ;; esac ])]) case "$gl_cv_func_setenv_works" in *yes) ;; *) REPLACE_SETENV=1 ;; esac fi ]) # Like gl_FUNC_SETENV, except prepare for separate compilation # (no REPLACE_SETENV, no AC_LIBOBJ). AC_DEFUN([gl_FUNC_SETENV_SEPARATE], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) AC_CHECK_DECLS_ONCE([setenv]) if test $ac_cv_have_decl_setenv = no; then HAVE_DECL_SETENV=0 fi AC_CHECK_FUNCS_ONCE([setenv]) gl_PREREQ_SETENV ]) AC_DEFUN([gl_FUNC_UNSETENV], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CHECK_DECLS_ONCE([unsetenv]) if test $ac_cv_have_decl_unsetenv = no; then HAVE_DECL_UNSETENV=0 fi AC_CHECK_FUNCS([unsetenv]) if test $ac_cv_func_unsetenv = no; then HAVE_UNSETENV=0 else HAVE_UNSETENV=1 dnl Some BSDs return void, failing to do error checking. AC_CACHE_CHECK([for unsetenv() return type], [gt_cv_func_unsetenv_ret], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include extern #ifdef __cplusplus "C" #endif int unsetenv (const char *name); ]], [[]])], [gt_cv_func_unsetenv_ret='int'], [gt_cv_func_unsetenv_ret='void'])]) if test $gt_cv_func_unsetenv_ret = 'void'; then AC_DEFINE([VOID_UNSETENV], [1], [Define to 1 if unsetenv returns void instead of int.]) REPLACE_UNSETENV=1 fi dnl Solaris 10 unsetenv does not remove all copies of a name. dnl Haiku alpha 2 unsetenv gets confused by assignment to environ. dnl OpenBSD 4.7 unsetenv("") does not fail. AC_CACHE_CHECK([whether unsetenv obeys POSIX], [gl_cv_func_unsetenv_works], [AC_RUN_IFELSE( [AC_LANG_PROGRAM([[ #include #include extern char **environ; ]GL_MDA_DEFINES], [[ char entry1[] = "a=1"; char entry2[] = "b=2"; char *env[] = { entry1, entry2, NULL }; if (putenv ((char *) "a=1")) return 1; if (putenv (entry2)) return 2; entry2[0] = 'a'; unsetenv ("a"); if (getenv ("a")) return 3; if (!unsetenv ("") || errno != EINVAL) return 4; entry2[0] = 'b'; environ = env; if (!getenv ("a")) return 5; entry2[0] = 'a'; unsetenv ("a"); if (getenv ("a")) return 6; ]])], [gl_cv_func_unsetenv_works=yes], [gl_cv_func_unsetenv_works=no], [case "$host_os" in # Guess yes on glibc systems. *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_unsetenv_works="$gl_cross_guess_normal" ;; esac ]) ]) case "$gl_cv_func_unsetenv_works" in *yes) ;; *) REPLACE_UNSETENV=1 ;; esac fi ]) # Prerequisites of lib/setenv.c. AC_DEFUN([gl_PREREQ_SETENV], [ AC_REQUIRE([gl_ENVIRON]) AC_CHECK_HEADERS_ONCE([unistd.h]) AC_CHECK_HEADERS([search.h]) AC_CHECK_DECLS_ONCE([_putenv]) gl_CHECK_FUNCS_ANDROID([tsearch], [[#include ]]) ]) # Prerequisites of lib/unsetenv.c. AC_DEFUN([gl_PREREQ_UNSETENV], [ AC_REQUIRE([gl_ENVIRON]) AC_CHECK_HEADERS_ONCE([unistd.h]) AC_CHECK_DECLS_ONCE([_putenv]) ]) groff-1.24.1/gnulib_m4/intmax_t.m40000644000175000017500000000363415153275164013607 00000000000000# intmax_t.m4 # serial 9 dnl Copyright (C) 1997-2004, 2006-2007, 2009-2026 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Paul Eggert. AC_PREREQ([2.53]) # Define intmax_t to 'long' or 'long long' # if it is not already defined in or . AC_DEFUN([gl_AC_TYPE_INTMAX_T], [ dnl For simplicity, we assume that a header file defines 'intmax_t' if and dnl only if it defines 'uintmax_t'. AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then AC_DEFINE_UNQUOTED([intmax_t], [long long], [Define to long or long long if and don't define.]) else AC_DEFINE([HAVE_INTMAX_T], [1], [Define if you have the 'intmax_t' type in or .]) fi ]) dnl An alternative would be to explicitly test for 'intmax_t'. AC_DEFUN([gt_AC_TYPE_INTMAX_T], [ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include #if HAVE_STDINT_H_WITH_UINTMAX #include #endif #if HAVE_INTTYPES_H_WITH_UINTMAX #include #endif ]], [[intmax_t x = -1; return !x;]])], [gt_cv_c_intmax_t=yes], [gt_cv_c_intmax_t=no])]) if test $gt_cv_c_intmax_t = yes; then AC_DEFINE([HAVE_INTMAX_T], [1], [Define if you have the 'intmax_t' type in or .]) else AC_DEFINE_UNQUOTED([intmax_t], [long long], [Define to long or long long if and don't define.]) fi ]) groff-1.24.1/gnulib_m4/pthread-spin.m40000644000175000017500000000516715153275164014365 00000000000000# pthread-spin.m4 # serial 8 dnl Copyright (C) 2019-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN_ONCE([gl_PTHREAD_SPIN], [ AC_REQUIRE([gl_PTHREAD_H_PART1]) AC_REQUIRE([AC_CANONICAL_HOST]) if { case "$host_os" in mingw* | windows*) true;; *) false;; esac; } \ && test $gl_threads_api = windows; then dnl Choose function names that don't conflict with the mingw-w64 winpthreads dnl library. REPLACE_PTHREAD_SPIN_INIT=1 REPLACE_PTHREAD_SPIN_LOCK=1 REPLACE_PTHREAD_SPIN_TRYLOCK=1 REPLACE_PTHREAD_SPIN_UNLOCK=1 REPLACE_PTHREAD_SPIN_DESTROY=1 else if test $HAVE_PTHREAD_H = 0 || test $HAVE_PTHREAD_SPINLOCK_T = 0; then HAVE_PTHREAD_SPIN_INIT=0 HAVE_PTHREAD_SPIN_LOCK=0 HAVE_PTHREAD_SPIN_TRYLOCK=0 HAVE_PTHREAD_SPIN_UNLOCK=0 HAVE_PTHREAD_SPIN_DESTROY=0 else dnl Test whether the gnulib module 'threadlib' is in use. dnl Some packages like Emacs use --avoid=threadlib. dnl Write the symbol in such a way that it does not cause 'aclocal' to pick dnl the threadlib.m4 file that is installed in $PREFIX/share/aclocal/. m4_ifdef([gl_][THREADLIB], [ AC_REQUIRE([gl_][THREADLIB]) dnl Test whether the functions actually exist. dnl FreeBSD 5.2.1 declares them but does not define them. AC_CACHE_CHECK([for pthread_spin_init], [gl_cv_func_pthread_spin_init_in_LIBMULTITHREAD], [gl_saved_LIBS="$LIBS" LIBS="$LIBS $LIBMULTITHREAD" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[pthread_spinlock_t lock; return pthread_spin_init (&lock, 0); ]]) ], [gl_cv_func_pthread_spin_init_in_LIBMULTITHREAD=yes], [gl_cv_func_pthread_spin_init_in_LIBMULTITHREAD=no]) LIBS="$gl_saved_LIBS" ]) if test $gl_cv_func_pthread_spin_init_in_LIBMULTITHREAD != yes; then HAVE_PTHREAD_SPIN_INIT=0 REPLACE_PTHREAD_SPIN_INIT=1 HAVE_PTHREAD_SPIN_LOCK=0 REPLACE_PTHREAD_SPIN_LOCK=1 HAVE_PTHREAD_SPIN_TRYLOCK=0 REPLACE_PTHREAD_SPIN_TRYLOCK=1 HAVE_PTHREAD_SPIN_UNLOCK=0 REPLACE_PTHREAD_SPIN_UNLOCK=1 HAVE_PTHREAD_SPIN_DESTROY=0 REPLACE_PTHREAD_SPIN_DESTROY=1 fi ], [ : ]) fi fi ]) groff-1.24.1/gnulib_m4/locale-fr.m40000644000175000017500000003067115153275164013631 00000000000000# locale-fr.m4 # serial 25 dnl Copyright (C) 2003, 2005-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Bruno Haible. dnl Determine the name of a french locale with traditional encoding. AC_DEFUN_ONCE([gt_LOCALE_FR], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AM_LANGINFO_CODESET]) AC_CACHE_CHECK([for a traditional french locale], [gt_cv_locale_fr], [ AC_LANG_CONFTEST([AC_LANG_SOURCE([[ #include #include #if HAVE_LANGINFO_CODESET # include #endif #include #include struct tm t; char buf[16]; int main () { /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl imitates locale dependent behaviour by looking at the environment variables, and all locales use the UTF-8 encoding. */ #if defined __BEOS__ || defined __HAIKU__ return 1; #else /* Check whether the given locale name is recognized by the system. */ # if defined _WIN32 && !defined __CYGWIN__ /* On native Windows, setlocale(category, "") looks at the system settings, not at the environment variables. Also, when an encoding suffix such as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE category of the locale to "C". */ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) return 1; # else if (setlocale (LC_ALL, "") == NULL) return 1; # endif /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) is empty, and the behaviour of Tcl 8.4 in this locale is not useful. On OpenBSD 4.0, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "646". In this situation, some unit tests fail. On MirBSD 10, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "UTF-8". */ # if HAVE_LANGINFO_CODESET { const char *cs = nl_langinfo (CODESET); if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 || strcmp (cs, "UTF-8") == 0) return 1; } # endif # ifdef __CYGWIN__ /* On Cygwin, avoid locale names without encoding suffix, because the locale_charset() function relies on the encoding suffix. Note that LC_ALL is set on the command line. */ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; # endif /* Check whether in the abbreviation of the second month, the second character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only one byte long. This excludes the UTF-8 encoding. */ t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; # if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ /* Check whether the decimal separator is a comma. On NetBSD 3.0 in the fr_FR.ISO8859-1 locale and on Haiku in the fr_FR.UTF-8 locale, localeconv()->decimal_point are nl_langinfo(RADIXCHAR) are both ".". */ if (localeconv () ->decimal_point[0] != ',') return 1; # endif return 0; #endif } ]])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then case "$host_os" in # Handle native Windows specially, because there setlocale() interprets # "ar" or "ara" as "Arabic" or "Arabic_Saudi Arabia.1256", # "en" or "eng" as "English" or "English_United States.1252", # "fr" or "fra" as "French" or "French_France.1252", # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", # "ja" or "jpn" as "Japanese" or "Japanese_Japan.932", # and similar. mingw* | windows*) # Test for the native Windows locale name. if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr=French_France.1252 else # None found. gt_cv_locale_fr=none fi ;; *) # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the # configure script would override the LC_ALL setting. Likewise for # LC_CTYPE, which is also set at the beginning of the configure script. # Test for the usual locale name. if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr=fr_FR else # Test for the locale name with explicit encoding suffix. if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr=fr_FR.ISO-8859-1 else # Test for the AIX, FreeBSD, NetBSD, OpenBSD locale name. if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr=fr_FR.ISO8859-1 else # Test for the HP-UX locale name. if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr=fr_FR.iso88591 else # Test for the Solaris 10 locale name. if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr=fr else # None found. gt_cv_locale_fr=none fi fi fi fi fi ;; esac fi rm -fr conftest* ]) LOCALE_FR=$gt_cv_locale_fr case $LOCALE_FR in #( '' | *[[[:space:]\"\$\'*@<:@]]*) dnl This locale name might cause trouble with sh or make. AC_MSG_WARN([invalid locale "$LOCALE_FR"; assuming "none"]) LOCALE_FR=none;; esac AC_SUBST([LOCALE_FR]) ]) dnl Determine the name of a french locale with UTF-8 encoding. AC_DEFUN_ONCE([gt_LOCALE_FR_UTF8], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AM_LANGINFO_CODESET]) AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [ case "$host_os" in *-musl* | midipix*) dnl On musl libc, all kinds of ll_CC.UTF-8 locales exist, even without dnl any locale file on disk. But they are effectively equivalent to the dnl C.UTF-8 locale, except for locale categories (such as LC_MESSAGES) dnl for which localizations (.mo files) have been installed. gt_cv_locale_fr_utf8=fr_FR.UTF-8 ;; *) AC_LANG_CONFTEST([AC_LANG_SOURCE([[ #include #include #if HAVE_LANGINFO_CODESET # include #endif #include #include struct tm t; char buf[16]; int main () { /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl imitates locale dependent behaviour by looking at the environment variables, and all locales use the UTF-8 encoding. */ #if !(defined __BEOS__ || defined __HAIKU__) /* Check whether the given locale name is recognized by the system. */ # if defined _WIN32 && !defined __CYGWIN__ /* On native Windows, setlocale(category, "") looks at the system settings, not at the environment variables. Also, when an encoding suffix such as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE category of the locale to "C". */ if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) return 1; # else if (setlocale (LC_ALL, "") == NULL) return 1; # endif /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) is empty, and the behaviour of Tcl 8.4 in this locale is not useful. On OpenBSD 4.0, when an unsupported locale is specified, setlocale() succeeds but then nl_langinfo(CODESET) is "646". In this situation, some unit tests fail. */ # if HAVE_LANGINFO_CODESET { const char *cs = nl_langinfo (CODESET); if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) return 1; } # endif # ifdef __CYGWIN__ /* On Cygwin, avoid locale names without encoding suffix, because the locale_charset() function relies on the encoding suffix. Note that LC_ALL is set on the command line. */ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; # endif /* Check whether in the abbreviation of the second month, the second character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is two bytes long, with UTF-8 encoding. */ t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; if (strftime (buf, sizeof (buf), "%b", &t) < 4 || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') return 1; #endif #if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ /* Check whether the decimal separator is a comma. On NetBSD 3.0 in the fr_FR.ISO8859-1 locale and on Haiku in the fr_FR.UTF-8 locale, localeconv()->decimal_point are nl_langinfo(RADIXCHAR) are both ".". */ if (localeconv () ->decimal_point[0] != ',') return 1; #endif return 0; } ]])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then case "$host_os" in # Handle native Windows specially, because there setlocale() interprets # "ar" or "ara" as "Arabic" or "Arabic_Saudi Arabia.1256", # "en" or "eng" as "English" or "English_United States.1252", # "fr" or "fra" as "French" or "French_France.1252", # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", # "ja" or "jpn" as "Japanese" or "Japanese_Japan.932", # and similar. mingw* | windows*) # Test for the hypothetical native Windows locale name. if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr_utf8=French_France.65001 else # None found. gt_cv_locale_fr_utf8=none fi ;; *) # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the # configure script would override the LC_ALL setting. Likewise for # LC_CTYPE, which is also set at the beginning of the configure script. # Test for the usual locale name. if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr_utf8=fr_FR else # Test for the locale name with explicit encoding suffix. if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr_utf8=fr_FR.UTF-8 else # Test for the Solaris 10 locale name. if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr_utf8=fr.UTF-8 else # None found. gt_cv_locale_fr_utf8=none fi fi fi ;; esac fi rm -fr conftest* ;; esac ]) LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 case $LOCALE_FR_UTF8 in #( '' | *[[[:space:]\"\$\'*@<:@]]*) dnl This locale name might cause trouble with sh or make. AC_MSG_WARN([invalid locale "$LOCALE_FR_UTF8"; assuming "none"]) LOCALE_FR_UTF8=none;; esac AC_SUBST([LOCALE_FR_UTF8]) dnl Users of $LOCALE_FR_UTF8 need to know which of the locale categories they dnl can rely on. case "$host_os" in *-musl* | midipix*) dnl On musl libc, locale categories other than LC_CTYPE and LC_MESSAGES dnl are effectively unimplemented. LC_COLLATE_IMPLEMENTED=false LC_NUMERIC_IMPLEMENTED=false LC_TIME_IMPLEMENTED=false LC_MONETARY_IMPLEMENTED=false ;; *) LC_COLLATE_IMPLEMENTED=true LC_NUMERIC_IMPLEMENTED=true LC_TIME_IMPLEMENTED=true LC_MONETARY_IMPLEMENTED=true ;; esac AC_SUBST([LC_COLLATE_IMPLEMENTED]) AC_SUBST([LC_NUMERIC_IMPLEMENTED]) AC_SUBST([LC_TIME_IMPLEMENTED]) AC_SUBST([LC_MONETARY_IMPLEMENTED]) ]) groff-1.24.1/gnulib_m4/isfinite.m40000644000175000017500000001506415153275164013576 00000000000000# isfinite.m4 # serial 24 dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_ISFINITE], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl Persuade glibc to declare isfinite. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_CHECK_DECLS([isfinite], , , [[#include ]]) if test "$ac_cv_have_decl_isfinite" = yes; then gl_CHECK_MATH_LIB([ISFINITE_LIBM], [double], [x = isfinite (x) + isfinite ((float) x);]) if test "$ISFINITE_LIBM" != missing; then dnl Test whether isfinite() on 'long double' works. gl_ISFINITEL_WORKS case "$gl_cv_func_isfinitel_works" in *yes) ;; *) ISFINITE_LIBM=missing;; esac dnl Also, isfinite() on 'double' does not work on Linux/ia64 (because of dnl signalling NaNs). But this does not have to be tested, since dnl isfinite(long double) also does not work in this situation. fi fi dnl On Solaris 10, with CC in C++ mode, isfinite is not available although dnl is with cc in C mode. This cannot be worked around by defining dnl _XOPEN_SOURCE=600, because the latter does not work in C++ mode on dnl Solaris 11.0. Therefore use the replacement functions on Solaris. if test "$ac_cv_have_decl_isfinite" != yes \ || test "$ISFINITE_LIBM" = missing \ || { case "$host_os" in solaris*) true;; *) false;; esac; }; then REPLACE_ISFINITE=1 dnl No libraries are needed to link lib/isfinite.c. ISFINITE_LIBM= fi AC_SUBST([ISFINITE_LIBM]) ]) dnl Test whether isfinite() on 'long double' recognizes all canonical values dnl which are neither finite nor infinite. AC_DEFUN([gl_ISFINITEL_WORKS], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gl_BIGENDIAN]) AC_REQUIRE([gl_LONG_DOUBLE_EXPONENT_LOCATION]) AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether isfinite(long double) works], [gl_cv_func_isfinitel_works], [ saved_LIBS="$LIBS" LIBS="$LIBS $ISFINITE_LIBM" AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #include #define NWORDS \ ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) typedef union { unsigned int word[NWORDS]; long double value; } memory_long_double; #define NaNl() (0.0L / 0.0L) int main () { int result = 0; { memory_long_double m; unsigned int i; /* The isfinite macro should be immune against changes in the sign bit and in the mantissa bits. The xor operation twiddles a bit that can only be a sign bit or a mantissa bit (since the exponent never extends to bit 31). */ m.value = NaNl (); m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1); for (i = 0; i < NWORDS; i++) m.word[i] |= 1; if (isfinite (m.value)) result |= 1; #if defined LDBL_EXPBIT0_WORD && defined LDBL_EXPBIT0_BIT /* Another NaN, more precisely crafted. */ m.value = NaNl (); #if defined _ARCH_PPC && LDBL_MANT_DIG == 106 /* This is PowerPC "double double", a pair of two doubles. Inf and NaN are represented as the corresponding 64-bit IEEE values in the first double; the second is ignored. Manipulate only the first double. */ #define HNWORDS \ ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) #else #define HNWORDS NWORDS #endif #if LDBL_EXPBIT0_BIT > 0 m.word[LDBL_EXPBIT0_WORD] ^= (unsigned int) 1 << (LDBL_EXPBIT0_BIT - 1); #else m.word[LDBL_EXPBIT0_WORD + (LDBL_EXPBIT0_WORD < HNWORDS / 2 ? 1 : - 1)] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1); #endif m.word[LDBL_EXPBIT0_WORD + (LDBL_EXPBIT0_WORD < HNWORDS / 2 ? 1 : - 1)] |= (unsigned int) 1 << LDBL_EXPBIT0_BIT; #undef HNWORDS if (isfinite (m.value)) result |= 1; #endif } #if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE /* Representation of an 80-bit 'long double' as an initializer for a sequence of 'unsigned int' words. */ # ifdef WORDS_BIGENDIAN # define LDBL80_WORDS(exponent,manthi,mantlo) \ { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ (unsigned int) (mantlo) << 16 \ } # else # define LDBL80_WORDS(exponent,manthi,mantlo) \ { mantlo, manthi, exponent } # endif { /* Quiet NaN. */ static memory_long_double x = { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; if (isfinite (x.value)) result |= 2; } { /* Signalling NaN. */ static memory_long_double x = { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; if (isfinite (x.value)) result |= 2; } /* isfinite should return something even for noncanonical values. */ { /* Pseudo-NaN. */ static memory_long_double x = { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; if (isfinite (x.value) && !isfinite (x.value)) result |= 4; } { /* Pseudo-Infinity. */ static memory_long_double x = { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; if (isfinite (x.value) && !isfinite (x.value)) result |= 8; } { /* Pseudo-Zero. */ static memory_long_double x = { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; if (isfinite (x.value) && !isfinite (x.value)) result |= 16; } { /* Unnormalized number. */ static memory_long_double x = { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; if (isfinite (x.value) && !isfinite (x.value)) result |= 32; } { /* Pseudo-Denormal. */ static memory_long_double x = { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; if (isfinite (x.value) && !isfinite (x.value)) result |= 64; } #endif return result; }]])], [gl_cv_func_isfinitel_works=yes], [gl_cv_func_isfinitel_works=no], [case "$host_os" in # Guess no on native Windows. mingw* | windows*) gl_cv_func_isfinitel_works="guessing no" ;; *) gl_cv_func_isfinitel_works="guessing yes" ;; esac ]) LIBS="$saved_LIBS" ]) ]) groff-1.24.1/gnulib_m4/sys_socket_h.m40000644000175000017500000001622015153275164014454 00000000000000# sys_socket_h.m4 # serial 32 dnl Copyright (C) 2005-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Simon Josefsson. AC_DEFUN_ONCE([gl_SYS_SOCKET_H], [ AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) GL_GENERATE_SYS_SOCKET_H=false AC_CACHE_CHECK([whether is self-contained], [gl_cv_header_sys_socket_h_selfcontained], [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[]])], [gl_cv_header_sys_socket_h_selfcontained=yes], [gl_cv_header_sys_socket_h_selfcontained=no]) ]) if test $gl_cv_header_sys_socket_h_selfcontained = yes; then dnl If the shutdown function exists, should define dnl SHUT_RD, SHUT_WR, SHUT_RDWR. AC_CHECK_FUNCS([shutdown]) if test $ac_cv_func_shutdown = yes; then AC_CACHE_CHECK([whether defines the SHUT_* macros], [gl_cv_header_sys_socket_h_shut], [ AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };]])], [gl_cv_header_sys_socket_h_shut=yes], [gl_cv_header_sys_socket_h_shut=no]) ]) if test $gl_cv_header_sys_socket_h_shut = no; then GL_GENERATE_SYS_SOCKET_H=true fi fi fi # We need to check for ws2tcpip.h now. gl_PREREQ_SYS_H_SOCKET gl_PREREQ_SYS_SA_FAMILY if test $ac_cv_type_struct_sockaddr_storage = no; then HAVE_STRUCT_SOCKADDR_STORAGE=0 fi if test $ac_cv_type_struct_sockaddr_storage != no; then AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family], [], [HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0], [#include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_WS2TCPIP_H #include #endif ]) fi if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \ || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then GL_GENERATE_SYS_SOCKET_H=true fi gl_PREREQ_SYS_H_WINSOCK2 dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[ /* Some systems require prerequisite headers. */ #include #include ]], [socket connect accept bind getpeername getsockname getsockopt listen recv send recvfrom sendto setsockopt shutdown accept4]) AC_REQUIRE([AC_C_RESTRICT]) ]) AC_DEFUN([gl_PREREQ_SYS_H_SOCKET], [ dnl Check prerequisites of the replacement. AC_REQUIRE([gl_CHECK_SOCKET_HEADERS]) gl_CHECK_NEXT_HEADERS([sys/socket.h]) if test $ac_cv_header_sys_socket_h = yes; then HAVE_SYS_SOCKET_H=1 else HAVE_SYS_SOCKET_H=0 fi AC_SUBST([HAVE_SYS_SOCKET_H]) gl_PREREQ_SYS_H_WS2TCPIP ]) # Common prerequisites of the replacement and of the # replacement. # Sets and substitutes HAVE_WINSOCK2_H. AC_DEFUN([gl_PREREQ_SYS_H_WINSOCK2], [ m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])]) m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])]) AC_CHECK_HEADERS_ONCE([sys/socket.h]) if test $ac_cv_header_sys_socket_h != yes; then dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make dnl the check for those headers unconditional; yet cygwin reports dnl that the headers are present but cannot be compiled (since on dnl cygwin, all socket information should come from sys/socket.h). AC_CHECK_HEADERS([winsock2.h]) fi if test "$ac_cv_header_winsock2_h" = yes; then HAVE_WINSOCK2_H=1 UNISTD_H_HAVE_WINSOCK2_H=1 SYS_IOCTL_H_HAVE_WINSOCK2_H=1 else HAVE_WINSOCK2_H=0 fi AC_SUBST([HAVE_WINSOCK2_H]) ]) # Common prerequisites of the replacement and of the # replacement. # Sets and substitutes HAVE_WS2TCPIP_H. AC_DEFUN([gl_PREREQ_SYS_H_WS2TCPIP], [ AC_REQUIRE([gl_CHECK_SOCKET_HEADERS]) if test $ac_cv_header_sys_socket_h = yes; then HAVE_WS2TCPIP_H=0 else if test $ac_cv_header_ws2tcpip_h = yes; then HAVE_WS2TCPIP_H=1 else HAVE_WS2TCPIP_H=0 fi fi AC_SUBST([HAVE_WS2TCPIP_H]) ]) # Common prerequisites of the replacement and of the # replacement. # Sets and substitutes HAVE_SA_FAMILY_T. AC_DEFUN([gl_PREREQ_SYS_SA_FAMILY], [ AC_REQUIRE([gl_CHECK_SOCKET_HEADERS]) AC_CHECK_TYPES([struct sockaddr_storage, sa_family_t],,,[ /* sys/types.h is not needed according to POSIX, but the sys/socket.h in i386-unknown-freebsd4.10 and powerpc-apple-darwin5.5 required it. */ #include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_WS2TCPIP_H #include #endif ]) if test $ac_cv_type_sa_family_t = yes; then HAVE_SA_FAMILY_T=1 else HAVE_SA_FAMILY_T=0 fi AC_SUBST([HAVE_SA_FAMILY_T]) ]) # gl_SYS_SOCKET_MODULE_INDICATOR([modulename]) # sets the shell variable that indicates the presence of the given module # to a C preprocessor expression that will evaluate to 1. # This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR], [ dnl Ensure to expand the default settings once only. gl_SYS_SOCKET_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) # Initializes the default values for AC_SUBSTed shell variables. # This macro must not be AC_REQUIREd. It must only be invoked, and only # outside of macros or in macros that are not AC_REQUIREd. AC_DEFUN([gl_SYS_SOCKET_H_REQUIRE_DEFAULTS], [ m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_SOCKET_H_MODULE_INDICATOR_DEFAULTS], [ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SOCKET]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CONNECT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACCEPT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_BIND]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPEERNAME]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETSOCKNAME]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETSOCKOPT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LISTEN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RECV]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SEND]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RECVFROM]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SENDTO]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETSOCKOPT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SHUTDOWN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACCEPT4]) ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_SOCKET_H_MODULE_INDICATOR_DEFAULTS]) AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS]) ]) AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS], [ HAVE_STRUCT_SOCKADDR_STORAGE=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE]) HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY]) HAVE_ACCEPT4=1; AC_SUBST([HAVE_ACCEPT4]) ]) groff-1.24.1/gnulib_m4/free.m40000644000175000017500000000373215153275164012704 00000000000000# free.m4 # serial 6 dnl Copyright (C) 2003-2005, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. # Written by Paul Eggert and Bruno Haible. AC_DEFUN([gl_FUNC_FREE], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) dnl In the next release of POSIX, free must preserve errno. dnl https://www.austingroupbugs.net/view.php?id=385 dnl https://sourceware.org/PR17924 dnl So far, we know of three platforms that do this: dnl * glibc >= 2.33, thanks to the fix for this bug: dnl dnl * OpenBSD >= 4.5, thanks to this commit: dnl dnl * Solaris, because its malloc() implementation is based on brk(), dnl not mmap(); hence its free() implementation makes no system calls. dnl For other platforms, you can only be sure if they state it in their dnl documentation, or by code inspection of the free() implementation in libc. AC_CACHE_CHECK([whether free is known to preserve errno], [gl_cv_func_free_preserves_errno], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[#if 2 < __GLIBC__ + (33 <= __GLIBC_MINOR__) #elif defined __OpenBSD__ #elif defined __sun #else #error "'free' is not known to preserve errno" #endif ]])], [gl_cv_func_free_preserves_errno=yes], [gl_cv_func_free_preserves_errno=no]) ]) case $gl_cv_func_free_preserves_errno in *yes) AC_DEFINE([HAVE_FREE_POSIX], [1], [Define if the 'free' function is guaranteed to preserve errno.]) ;; *) REPLACE_FREE=1 ;; esac ]) # Prerequisites of lib/free.c. AC_DEFUN([gl_PREREQ_FREE], [:]) groff-1.24.1/gnulib_m4/localeconv.m40000644000175000017500000000421615153275164014106 00000000000000# localeconv.m4 # serial 3 dnl Copyright (C) 2012-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_LOCALECONV], [ AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) AC_REQUIRE([gl_LOCALE_H]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles if test $REPLACE_STRUCT_LCONV = 1; then REPLACE_LOCALECONV=1 fi if test $REPLACE_LOCALECONV = 0; then dnl Test whether fields of type 'char' are filled correctly. dnl This test fails on mingw 5.0.3. AC_CACHE_CHECK([whether localeconv works], [gl_cv_func_localeconv_works], [AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include int main () { struct lconv *l = localeconv (); return l->frac_digits != CHAR_MAX && l->frac_digits < 0; } ]])], [gl_cv_func_localeconv_works=yes], [gl_cv_func_localeconv_works=no], [case "$host_os" in # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_localeconv_works="guessing yes" ;; # Guess yes on musl systems. *-musl* | midipix*) gl_cv_func_localeconv_works="guessing yes" ;; # Guess no on native Windows. mingw* | windows*) gl_cv_func_localeconv_works="guessing no" ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_localeconv_works="$gl_cross_guess_normal" ;; esac ]) ]) case "$gl_cv_func_localeconv_works" in *yes) ;; *) REPLACE_LOCALECONV=1 ;; esac fi ]) # Prerequisites of lib/localeconv.c. AC_DEFUN([gl_PREREQ_LOCALECONV], [ AC_CHECK_MEMBERS([struct lconv.decimal_point], [], [], [[#include ]]) AC_CHECK_MEMBERS([struct lconv.int_p_cs_precedes], [], [], [[#include ]]) ]) groff-1.24.1/gnulib_m4/vararrays.m40000644000175000017500000000453715153275164014001 00000000000000# vararrays.m4 # serial 6 dnl Copyright (C) 2001, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. # Check for variable-length arrays. # From Paul Eggert m4_version_prereq([2.70], [], [ # AC_C_VARARRAYS # -------------- # Check whether the C compiler supports variable-length arrays. AC_DEFUN([AC_C_VARARRAYS], [ AC_CACHE_CHECK([for variable-length arrays], ac_cv_c_vararrays, [AC_EGREP_CPP([defined], [#ifdef __STDC_NO_VLA__ defined #endif ], [ac_cv_c_vararrays='no: __STDC_NO_VLA__ is defined'], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[/* Test for VLA support. This test is partly inspired from examples in the C standard. Use at least two VLA functions to detect the GCC 3.4.3 bug described in: https://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html */ #ifdef __STDC_NO_VLA__ syntax error; #else extern int n; int B[100]; int fvla (int m, int C[m][m]); int simple (int count, int all[static count]) { return all[count - 1]; } int fvla (int m, int C[m][m]) { typedef int VLA[m][m]; VLA x; int D[m]; static int (*q)[m] = &B; int (*s)[n] = q; return C && &x[0][0] == &D[0] && &D[0] == s[0]; } #endif ]])], [ac_cv_c_vararrays=yes], [ac_cv_c_vararrays=no])])]) if test "$ac_cv_c_vararrays" = yes; then dnl This is for compatibility with Autoconf 2.61-2.69. AC_DEFINE([HAVE_C_VARARRAYS], 1, [Define to 1 if C supports variable-length arrays.]) elif test "$ac_cv_c_vararrays" = no; then AC_DEFINE([__STDC_NO_VLA__], 1, [Define to 1 if C does not support variable-length arrays, and if the compiler does not already define this.]) fi ]) ]) groff-1.24.1/gnulib_m4/isnanf.m40000644000175000017500000001065615153275164013244 00000000000000# isnanf.m4 # serial 22 dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl Check how to get or define isnanf(). AC_DEFUN([gl_FUNC_ISNANF], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) ISNANF_LIBM= gl_HAVE_ISNANF_NO_LIBM if test $gl_cv_func_isnanf_no_libm = no; then gl_HAVE_ISNANF_IN_LIBM if test $gl_cv_func_isnanf_in_libm = yes; then ISNANF_LIBM=-lm fi fi dnl The variable gl_func_isnanf set here is used by isnan.m4. if test $gl_cv_func_isnanf_no_libm = yes || test -n "$ISNANF_LIBM"; then saved_LIBS="$LIBS" LIBS="$LIBS $ISNANF_LIBM" gl_ISNANF_WORKS LIBS="$saved_LIBS" case "$gl_cv_func_isnanf_works" in *yes) gl_func_isnanf=yes ;; *) gl_func_isnanf=no; ISNANF_LIBM= ;; esac else gl_func_isnanf=no fi if test $gl_func_isnanf != yes; then HAVE_ISNANF=0 fi AC_SUBST([ISNANF_LIBM]) ]) dnl Check how to get or define isnanf() without linking with libm. AC_DEFUN([gl_FUNC_ISNANF_NO_LIBM], [ gl_HAVE_ISNANF_NO_LIBM if test $gl_cv_func_isnanf_no_libm = yes; then gl_ISNANF_WORKS fi if test $gl_cv_func_isnanf_no_libm = yes \ && { case "$gl_cv_func_isnanf_works" in *yes) true;; *) false;; esac }; then gl_func_isnanf_no_libm=yes AC_DEFINE([HAVE_ISNANF_IN_LIBC], [1], [Define if the isnan(float) function is available in libc.]) else gl_func_isnanf_no_libm=no fi ]) dnl Prerequisites of replacement isnanf definition. It does not need -lm. AC_DEFUN([gl_PREREQ_ISNANF], [ gl_FLOAT_EXPONENT_LOCATION ]) dnl Test whether isnanf() can be used without libm. AC_DEFUN([gl_HAVE_ISNANF_NO_LIBM], [ AC_CACHE_CHECK([whether isnan(float) can be used without linking with libm], [gl_cv_func_isnanf_no_libm], [ AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanf # define isnanf(x) __builtin_isnan ((float)(x)) #elif defined isnan # undef isnanf # define isnanf(x) isnan ((float)(x)) #endif float x;]], [[return isnanf (x);]])], [gl_cv_func_isnanf_no_libm=yes], [gl_cv_func_isnanf_no_libm=no]) ]) ]) dnl Test whether isnanf() can be used with libm. AC_DEFUN([gl_HAVE_ISNANF_IN_LIBM], [ AC_CACHE_CHECK([whether isnan(float) can be used with libm], [gl_cv_func_isnanf_in_libm], [ saved_LIBS="$LIBS" LIBS="$LIBS -lm" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanf # define isnanf(x) __builtin_isnan ((float)(x)) #elif defined isnan # undef isnanf # define isnanf(x) isnan ((float)(x)) #endif float x;]], [[return isnanf (x);]])], [gl_cv_func_isnanf_in_libm=yes], [gl_cv_func_isnanf_in_libm=no]) LIBS="$saved_LIBS" ]) ]) dnl Test whether isnanf() rejects Infinity (this fails on Solaris 2.5.1). AC_DEFUN([gl_ISNANF_WORKS], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_REQUIRE([gl_FLOAT_EXPONENT_LOCATION]) AC_CACHE_CHECK([whether isnan(float) works], [gl_cv_func_isnanf_works], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanf # define isnanf(x) __builtin_isnan ((float)(x)) #elif defined isnan # undef isnanf # define isnanf(x) isnan ((float)(x)) #endif int main() { int result = 0; if (isnanf (1.0f / 0.0f)) result |= 1; return result; }]])], [gl_cv_func_isnanf_works=yes], [gl_cv_func_isnanf_works=no], [case "$host_os" in solaris*) gl_cv_func_isnanf_works="guessing no" ;; mingw* | windows*) # Guess yes on mingw, no on MSVC. AC_EGREP_CPP([Known], [ #ifdef __MINGW32__ Known #endif ], [gl_cv_func_isnanf_works="guessing yes"], [gl_cv_func_isnanf_works="guessing no"]) ;; *) gl_cv_func_isnanf_works="guessing yes" ;; esac ]) ]) ]) groff-1.24.1/gnulib_m4/stddef_h.m40000644000175000017500000001312215153275164013535 00000000000000# stddef_h.m4 # serial 23 dnl Copyright (C) 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl A placeholder for , for platforms that have issues. AC_DEFUN_ONCE([gl_STDDEF_H], [ AC_REQUIRE([gl_STDDEF_H_DEFAULTS]) dnl Persuade OpenBSD to declare max_align_t. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) GL_GENERATE_STDDEF_H=false dnl Test whether the type max_align_t exists and whether its alignment dnl "is as great as is supported by the implementation in all contexts". AC_CACHE_CHECK([for good max_align_t], [gl_cv_type_max_align_t], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[/* On FreeBSD 12.0/x86, max_align_t defined by has the correct alignment with the default (wrong) definition of _Alignof, but a wrong alignment as soon as we activate an ISO C compliant _Alignof definition. */ #if ((defined __GNUC__ && 4 <= __GNUC__) || defined __clang__) && !defined __cplusplus #define _Alignof(type) __builtin_offsetof (struct { char __a; type __b; }, __b) #endif #include unsigned int s = sizeof (max_align_t); #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__ int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1]; int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1]; #endif typedef struct { char a; max_align_t b; } max_helper; typedef struct { char a; long b; } long_helper; typedef struct { char a; double b; } double_helper; typedef struct { char a; long double b; } long_double_helper; int check3[2 * (offsetof (long_helper, b) <= offsetof (max_helper, b)) - 1]; int check4[2 * (offsetof (double_helper, b) <= offsetof (max_helper, b)) - 1]; int check5[2 * (offsetof (long_double_helper, b) <= offsetof (max_helper, b)) - 1]; ]])], [gl_cv_type_max_align_t=yes], [gl_cv_type_max_align_t=no]) ]) if test $gl_cv_type_max_align_t = no; then HAVE_MAX_ALIGN_T=0 GL_GENERATE_STDDEF_H=true fi AC_CACHE_CHECK([whether NULL can be used in arbitrary expressions], [gl_cv_decl_null_works], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include int test[2 * (sizeof NULL == sizeof (void *)) -1]; ]])], [gl_cv_decl_null_works=yes], [gl_cv_decl_null_works=no])]) if test $gl_cv_decl_null_works = no; then REPLACE_NULL=1 GL_GENERATE_STDDEF_H=true fi AC_CACHE_CHECK([for unreachable in C], [gl_cv_c_func_unreachable], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[unreachable (); ]])], [gl_cv_c_func_unreachable=yes], [gl_cv_c_func_unreachable=no]) ]) if test $gl_cv_c_func_unreachable = no; then GL_GENERATE_STDDEF_H=true HAVE_C_UNREACHABLE=0 else HAVE_C_UNREACHABLE=1 fi AC_SUBST([HAVE_C_UNREACHABLE]) dnl Provide gl_unreachable() unconditionally. GL_GENERATE_STDDEF_H=true dnl https://gcc.gnu.org/PR114869 AC_CACHE_CHECK([whether nullptr_t needs ], [gl_cv_nullptr_t_needs_stddef], [AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[nullptr_t x;]], [gl_cv_nullptr_t_needs_stddef=no], [gl_cv_nullptr_t_needs_stddef=yes])]) if test "$gl_cv_nullptr_t_needs_stddef" = no; then NULLPTR_T_NEEDS_STDDEF=0 GL_GENERATE_STDDEF_H=true fi dnl https://gcc.gnu.org/PR114870 dnl affects GCC 13.3 and 14.2. AC_CACHE_CHECK([whether is idempotent], [gl_cv_stddef_idempotent], [AC_COMPILE_IFELSE([AC_LANG_SOURCE( [[ #if \ ((__GNUC__ == 13 && __GNUC_MINOR__ <= 3) \ || (__GNUC__ == 14 && __GNUC_MINOR__ <= 2)) #error "bug 114870 is present" #endif ]])], [gl_cv_stddef_idempotent="guessing yes"], [gl_cv_stddef_idempotent="guessing no"]) ]) case "$gl_cv_stddef_idempotent" in *yes) ;; *) STDDEF_NOT_IDEMPOTENT=1 GL_GENERATE_STDDEF_H=true ;; esac if $GL_GENERATE_STDDEF_H; then gl_NEXT_HEADERS([stddef.h]) fi ]) # gl_STDDEF_MODULE_INDICATOR([modulename]) # sets the shell variable that indicates the presence of the given module # to a C preprocessor expression that will evaluate to 1. # This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_STDDEF_MODULE_INDICATOR], [ dnl Ensure to expand the default settings once only. gl_STDDEF_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$1]) ]) # Initializes the default values for AC_SUBSTed shell variables. # This macro must not be AC_REQUIREd. It must only be invoked, and only # outside of macros or in macros that are not AC_REQUIREd. AC_DEFUN([gl_STDDEF_H_REQUIRE_DEFAULTS], [ m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDDEF_H_MODULE_INDICATOR_DEFAULTS], [ ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_STDDEF_H_MODULE_INDICATOR_DEFAULTS]) AC_REQUIRE([gl_STDDEF_H_DEFAULTS]) ]) AC_DEFUN([gl_STDDEF_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. NULLPTR_T_NEEDS_STDDEF=1; AC_SUBST([NULLPTR_T_NEEDS_STDDEF]) STDDEF_NOT_IDEMPOTENT=0; AC_SUBST([STDDEF_NOT_IDEMPOTENT]) REPLACE_NULL=0; AC_SUBST([REPLACE_NULL]) HAVE_MAX_ALIGN_T=1; AC_SUBST([HAVE_MAX_ALIGN_T]) ]) groff-1.24.1/gnulib_m4/stat-time.m40000644000175000017500000000621015153275164013664 00000000000000# stat-time.m4 # serial 1 dnl Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2026 Free Software dnl Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. # Checks for stat-related time functions. dnl From Paul Eggert. # st_atim.tv_nsec - Linux, Solaris, Cygwin # st_atimespec.tv_nsec - FreeBSD, NetBSD, if ! defined _POSIX_SOURCE # st_atimensec - FreeBSD, NetBSD, if defined _POSIX_SOURCE # st_atim.st__tim.tv_nsec - UnixWare (at least 2.1.2 through 7.1) # st_birthtimespec - FreeBSD, NetBSD (hidden on OpenBSD 3.9, anyway) # st_birthtim - Cygwin 1.7.0+ AC_DEFUN([gl_STAT_TIME], [ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_CHECK_HEADERS_ONCE([sys/time.h]) AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec], [AC_CACHE_CHECK([whether struct stat.st_atim is of type struct timespec], [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [[ #include #include #if HAVE_SYS_TIME_H # include #endif #include struct timespec ts; struct stat st; ]], [[ st.st_atim = ts; ]])], [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes], [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no])]) if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then AC_DEFINE([TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC], [1], [Define to 1 if the type of the st_atim member of a struct stat is struct timespec.]) fi], [AC_CHECK_MEMBERS([struct stat.st_atimespec.tv_nsec], [], [AC_CHECK_MEMBERS([struct stat.st_atimensec], [], [AC_CHECK_MEMBERS([struct stat.st_atim.st__tim.tv_nsec], [], [], [#include #include ])], [#include #include ])], [#include #include ])], [#include #include ]) ]) # Check for st_birthtime, a feature from UFS2 (FreeBSD, NetBSD, OpenBSD, etc.) # and NTFS (Cygwin). # There was a time when this field was named st_createtime (21 June # 2002 to 16 July 2002) But that window is very small and applied only # to development code, so systems still using that configuration are # not supported. See revisions 1.10 and 1.11 of FreeBSD's # src/sys/ufs/ufs/dinode.h. # AC_DEFUN([gl_STAT_BIRTHTIME], [ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_CHECK_HEADERS_ONCE([sys/time.h]) AC_CHECK_MEMBERS([struct stat.st_birthtimespec.tv_nsec], [], [AC_CHECK_MEMBERS([struct stat.st_birthtimensec], [], [AC_CHECK_MEMBERS([struct stat.st_birthtim.tv_nsec], [], [], [#include #include ])], [#include #include ])], [#include #include ]) ]) groff-1.24.1/gnulib_m4/readlink.m40000644000175000017500000001121315153275164013545 00000000000000# readlink.m4 # serial 18 dnl Copyright (C) 2003, 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_READLINK], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_CHECK_FUNCS_ONCE([readlink]) if test $ac_cv_func_readlink = no; then HAVE_READLINK=0 else AC_CACHE_CHECK([whether readlink signature is correct], [gl_cv_decl_readlink_works], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include /* Cause compilation failure if original declaration has wrong type. */ ssize_t readlink (const char *, char *, size_t); ]]) ], [gl_cv_decl_readlink_works=yes], [gl_cv_decl_readlink_works=no])]) dnl Solaris 9 ignores trailing slash. dnl FreeBSD 7.2 dereferences only one level of links with trailing slash. AC_CACHE_CHECK([whether readlink handles trailing slash correctly], [gl_cv_func_readlink_trailing_slash], [# We have readlink, so assume ln -s works. ln -s conftest.no-such conftest.link ln -s conftest.link conftest.lnk2 AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[char buf[20]; return readlink ("conftest.lnk2/", buf, sizeof buf) != -1; ]]) ], [gl_cv_func_readlink_trailing_slash=yes], [gl_cv_func_readlink_trailing_slash=no], [case "$host_os" in # Guess yes on Linux or glibc systems. linux-* | linux | *-gnu* | gnu*) gl_cv_func_readlink_trailing_slash="guessing yes" ;; # Guess yes on systems that emulate the Linux system calls. midipix*) gl_cv_func_readlink_trailing_slash="guessing yes" ;; # Guess no on AIX or HP-UX. aix* | hpux*) gl_cv_func_readlink_trailing_slash="guessing no" ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_readlink_trailing_slash="$gl_cross_guess_normal" ;; esac ]) rm -f conftest.link conftest.lnk2]) case "$gl_cv_func_readlink_trailing_slash" in *yes) if test "$gl_cv_decl_readlink_works" != yes; then REPLACE_READLINK=1 fi ;; *) AC_DEFINE([READLINK_TRAILING_SLASH_BUG], [1], [Define to 1 if readlink fails to recognize a trailing slash.]) REPLACE_READLINK=1 ;; esac AC_CACHE_CHECK([whether readlink truncates results correctly], [gl_cv_func_readlink_truncate], [# We have readlink, so assume ln -s works. ln -s ab conftest.link AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[char c; return readlink ("conftest.link", &c, 1) != 1; ]]) ], [gl_cv_func_readlink_truncate=yes], [gl_cv_func_readlink_truncate=no], [case "$host_os" in # Guess yes on Linux or glibc systems. linux-* | linux | *-gnu* | gnu*) gl_cv_func_readlink_truncate="guessing yes" ;; # Guess yes on systems that emulate the Linux system calls. midipix*) gl_cv_func_readlink_truncate="guessing yes" ;; # Guess no on AIX or HP-UX. aix* | hpux*) gl_cv_func_readlink_truncate="guessing no" ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_readlink_truncate="$gl_cross_guess_normal" ;; esac ]) rm -f conftest.link conftest.lnk2]) case $gl_cv_func_readlink_truncate in *yes) if test "$gl_cv_decl_readlink_works" != yes; then REPLACE_READLINK=1 fi ;; *) AC_DEFINE([READLINK_TRUNCATE_BUG], [1], [Define to 1 if readlink sets errno instead of truncating a too-long link.]) REPLACE_READLINK=1 ;; esac dnl On Cygwin 3.3.6, readlink("/dev/null") returns "\\Device\\Null", which dnl is unusable. case "$host_os" in cygwin*) REPLACE_READLINK=1 ;; esac fi ]) # Like gl_FUNC_READLINK, except prepare for separate compilation # (no REPLACE_READLINK, no AC_LIBOBJ). AC_DEFUN([gl_FUNC_READLINK_SEPARATE], [ AC_CHECK_FUNCS_ONCE([readlink]) gl_PREREQ_READLINK ]) # Prerequisites of lib/readlink.c. AC_DEFUN([gl_PREREQ_READLINK], [ : ]) groff-1.24.1/gnulib_m4/setlocale_null.m40000644000175000017500000001036515153275164014770 00000000000000# setlocale_null.m4 # serial 11 dnl Copyright (C) 2019-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN_ONCE([gl_FUNC_SETLOCALE_NULL], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_PTHREADLIB]) AC_CHECK_HEADERS_ONCE([threads.h]) AC_CACHE_CHECK([whether setlocale (LC_ALL, NULL) is multithread-safe], [gl_cv_func_setlocale_null_all_mtsafe], [case "$host_os" in # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku. *-musl* | midipix* | darwin* | freebsd* | midnightbsd* | netbsd* | openbsd* | aix* | haiku*) gl_cv_func_setlocale_null_all_mtsafe=no ;; # Guess no on Cygwin < 3.4.6. cygwin*) AC_EGREP_CPP([Lucky user], [ #if defined __CYGWIN__ #include #if CYGWIN_VERSION_DLL_COMBINED >= CYGWIN_VERSION_DLL_MAKE_COMBINED (3004, 6) Lucky user #endif #endif ], [gl_cv_func_setlocale_null_all_mtsafe=yes], [gl_cv_func_setlocale_null_all_mtsafe=no]) ;; # Guess yes on glibc, HP-UX, Solaris, native Windows. *-gnu* | gnu* | hpux* | solaris* | mingw* | windows*) gl_cv_func_setlocale_null_all_mtsafe=yes ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;; esac ]) dnl On platforms without multithreading, there is no issue. case "$host_os" in mingw* | windows*) ;; *) if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then gl_cv_func_setlocale_null_all_mtsafe="trivially yes" fi ;; esac case "$gl_cv_func_setlocale_null_all_mtsafe" in *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;; *) SETLOCALE_NULL_ALL_MTSAFE=0 ;; esac AC_DEFINE_UNQUOTED([SETLOCALE_NULL_ALL_MTSAFE], [$SETLOCALE_NULL_ALL_MTSAFE], [Define to 1 if setlocale (LC_ALL, NULL) is multithread-safe.]) dnl This is about a single category (not LC_ALL). AC_CACHE_CHECK([whether setlocale (category, NULL) is multithread-safe], [gl_cv_func_setlocale_null_one_mtsafe], [case "$host_os" in # Guess no on OpenBSD, AIX. openbsd* | aix*) gl_cv_func_setlocale_null_one_mtsafe=no ;; # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, Solaris, Haiku, Cygwin, native Windows. *-gnu* | gnu* | *-musl* | midipix* | darwin* | freebsd* | midnightbsd* | netbsd* | hpux* | solaris* | haiku* | cygwin* | mingw* | windows*) gl_cv_func_setlocale_null_one_mtsafe=yes ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;; esac ]) dnl On platforms without multithreading, there is no issue. case "$host_os" in mingw* | windows*) ;; *) if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then gl_cv_func_setlocale_null_one_mtsafe="trivially yes" fi ;; esac case "$gl_cv_func_setlocale_null_one_mtsafe" in *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;; *) SETLOCALE_NULL_ONE_MTSAFE=0 ;; esac AC_DEFINE_UNQUOTED([SETLOCALE_NULL_ONE_MTSAFE], [$SETLOCALE_NULL_ONE_MTSAFE], [Define to 1 if setlocale (category, NULL) is multithread-safe.]) dnl Determine link dependencies of lib/setlocale_null.c and lib/setlocale-lock.c. if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then case "$host_os" in mingw* | windows*) SETLOCALE_NULL_LIB= ;; *) gl_WEAK_SYMBOLS case "$gl_cv_have_weak" in *yes) SETLOCALE_NULL_LIB= ;; *) SETLOCALE_NULL_LIB="$LIBPTHREAD" ;; esac ;; esac else SETLOCALE_NULL_LIB= fi dnl SETLOCALE_NULL_LIB is expected to be '-pthread' or '-lpthread' on AIX dnl with gcc or xlc, and empty otherwise. AC_SUBST([SETLOCALE_NULL_LIB]) dnl For backward compatibility. LIB_SETLOCALE_NULL="$SETLOCALE_NULL_LIB" AC_SUBST([LIB_SETLOCALE_NULL]) ]) # Prerequisites of lib/setlocale-lock.c. AC_DEFUN([gl_PREREQ_SETLOCALE_LOCK], [ gl_VISIBILITY ]) groff-1.24.1/gnulib_m4/printf-frexp.m40000644000175000017500000000235615153275164014410 00000000000000# printf-frexp.m4 # serial 5 dnl Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl Check how to define printf_frexp() without linking with libm. AC_DEFUN([gl_FUNC_PRINTF_FREXP], [ AC_REQUIRE([gl_CHECK_FREXP_NO_LIBM]) if test $gl_cv_func_frexp_no_libm = yes; then gl_FUNC_FREXP_WORKS case "$gl_cv_func_frexp_works" in *yes) AC_DEFINE([HAVE_FREXP_IN_LIBC], [1], [Define if the frexp function is available in libc.]) ;; esac fi AC_CACHE_CHECK([whether ldexp can be used without linking with libm], [gl_cv_func_ldexp_no_libm], [ AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include double x; int y;]], [[return ldexp (x, y) < 1;]])], [gl_cv_func_ldexp_no_libm=yes], [gl_cv_func_ldexp_no_libm=no]) ]) if test $gl_cv_func_ldexp_no_libm = yes; then AC_DEFINE([HAVE_LDEXP_IN_LIBC], [1], [Define if the ldexp function is available in libc.]) fi ]) groff-1.24.1/gnulib_m4/assert_h.m40000644000175000017500000000644215153275164013574 00000000000000# assert_h.m4 # serial 6 dnl Copyright (C) 2011-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Paul Eggert. AC_DEFUN([gl_ASSERT_H], [ AC_CACHE_CHECK([for static_assert], [gl_cv_static_assert], [gl_saved_CFLAGS=$CFLAGS for gl_working in "yes, a keyword" "yes, an macro"; do AS_CASE([$gl_working], [*assert.h*], [CFLAGS="$gl_saved_CFLAGS -DINCLUDE_ASSERT_H"]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#if defined __clang__ && __STDC_VERSION__ < 202311 #pragma clang diagnostic error "-Wc2x-extensions" #pragma clang diagnostic error "-Wc++1z-extensions" #endif #ifdef INCLUDE_ASSERT_H #include #endif static_assert (2 + 2 == 4, "arithmetic does not work"); static_assert (2 + 2 == 4); ]], [[ static_assert (sizeof (char) == 1, "sizeof does not work"); static_assert (sizeof (char) == 1); ]]) ], [gl_cv_static_assert=$gl_working], [gl_cv_static_assert=no]) CFLAGS=$gl_saved_CFLAGS test "$gl_cv_static_assert" != no && break done ]) GL_GENERATE_ASSERT_H=false AS_CASE([$gl_cv_static_assert], [yes*keyword*], [AC_DEFINE([HAVE_C_STATIC_ASSERT], [1], [Define to 1 if the static_assert keyword works.])], [no], [GL_GENERATE_ASSERT_H=true gl_NEXT_HEADERS([assert.h])]) dnl The "zz" puts this toward config.h's end, to avoid potential dnl collisions with other definitions. dnl Hardcode the known configuration results for GCC and clang, so that dnl a configuration made with the C compiler works also with the C++ compiler dnl and vice versa. dnl The seemingly redundant parentheses are necessary for MSVC 14. dnl #undef assert so that programs are not tempted to use it without dnl specifically including assert.h. dnl Break the #undef_s apart with a comment so that 'configure' does dnl not comment them out. AH_VERBATIM([zzstatic_assert], [#if (!(defined __clang__ \ ? (defined __cplusplus \ ? __cplusplus >= 201703L \ : __STDC_VERSION__ >= 202000L && __clang_major__ >= 16 \ && !defined __sun) \ : (defined __GNUC__ \ ? (defined __cplusplus \ ? __cplusplus >= 201103L && __GNUG__ >= 6 \ : __STDC_VERSION__ >= 202000L && __GNUC__ >= 13 \ && !defined __sun) \ : defined HAVE_C_STATIC_ASSERT)) \ && !defined assert \ && (!defined __cplusplus \ || (__cpp_static_assert < 201411 \ && __GNUG__ < 6 && __clang_major__ < 6))) #include #undef/**/assert /* Solaris 11.4 defines static_assert as a macro with 2 arguments. We need it also to be invocable with a single argument. Haiku 2022 does not define static_assert at all. */ #if (__STDC_VERSION__ - 0 >= 201112L) && !defined __cplusplus #undef/**/static_assert #define static_assert _Static_assert #endif #endif]) ]) groff-1.24.1/gnulib_m4/sqrt.m40000644000175000017500000000061315153275164012747 00000000000000# sqrt.m4 # serial 3 dnl Copyright (C) 2010-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_SQRT], [ gl_COMMON_DOUBLE_MATHFUNC([sqrt]) ]) groff-1.24.1/gnulib_m4/sys_stat_h.m40000644000175000017500000001232215153275164014136 00000000000000# sys_stat_h.m4 # serial 44 -*- Autoconf -*- dnl Copyright (C) 2006-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Eric Blake. dnl Provide a GNU-like . AC_DEFUN_ONCE([gl_SYS_STAT_H], [ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) dnl Check for broken stat macros. AC_REQUIRE([AC_HEADER_STAT]) gl_CHECK_NEXT_HEADERS([sys/stat.h]) dnl Ensure the type mode_t gets defined. AC_REQUIRE([AC_TYPE_MODE_T]) dnl Whether to enable precise timestamps in 'struct stat'. m4_ifdef([gl_WINDOWS_STAT_TIMESPEC], [ AC_REQUIRE([gl_WINDOWS_STAT_TIMESPEC]) ], [ WINDOWS_STAT_TIMESPEC=0 ]) AC_SUBST([WINDOWS_STAT_TIMESPEC]) dnl Whether to ensure that struct stat.st_size is 64-bit wide. m4_ifdef([gl_LARGEFILE], [ AC_REQUIRE([gl_LARGEFILE]) ], [ WINDOWS_64_BIT_ST_SIZE=0 ]) AC_SUBST([WINDOWS_64_BIT_ST_SIZE]) dnl Define types that are supposed to be defined in or dnl . AC_CHECK_TYPE([nlink_t], [], [AC_DEFINE([nlink_t], [int], [Define to the type of st_nlink in struct stat, or a supertype.])], [#include #include ]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[#include ]], [chmod fchmodat fstat fstatat futimens getumask lchmod lstat mkdirat mkfifo mkfifoat mknod mknodat stat utimensat]) AC_REQUIRE([AC_C_RESTRICT]) ]) # gl_SYS_STAT_MODULE_INDICATOR([modulename]) # sets the shell variable that indicates the presence of the given module # to a C preprocessor expression that will evaluate to 1. # This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR], [ dnl Ensure to expand the default settings once only. gl_SYS_STAT_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) # Initializes the default values for AC_SUBSTed shell variables. # This macro must not be AC_REQUIREd. It must only be invoked, and only # outside of macros or in macros that are not AC_REQUIREd. AC_DEFUN([gl_SYS_STAT_H_REQUIRE_DEFAULTS], [ m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_STAT_H_MODULE_INDICATOR_DEFAULTS], [ gl_UNISTD_H_REQUIRE_DEFAULTS dnl for REPLACE_FCHDIR gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CHMOD]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCHMODAT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSTAT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSTATAT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FUTIMENS]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETUMASK]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LCHMOD]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LSTAT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKDIR]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKDIRAT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKFIFO]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKFIFOAT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKNOD]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKNODAT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STAT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UTIMENSAT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OVERRIDES_STRUCT_STAT]) dnl Support Microsoft deprecated alias function names by default. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_CHMOD], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_MKDIR], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_UMASK], [1]) ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_STAT_H_MODULE_INDICATOR_DEFAULTS]) AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) ]) AC_DEFUN([gl_SYS_STAT_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. HAVE_FCHMODAT=1; AC_SUBST([HAVE_FCHMODAT]) HAVE_FSTATAT=1; AC_SUBST([HAVE_FSTATAT]) HAVE_FUTIMENS=1; AC_SUBST([HAVE_FUTIMENS]) HAVE_GETUMASK=1; AC_SUBST([HAVE_GETUMASK]) HAVE_LCHMOD=1; AC_SUBST([HAVE_LCHMOD]) HAVE_LSTAT=1; AC_SUBST([HAVE_LSTAT]) HAVE_MKDIRAT=1; AC_SUBST([HAVE_MKDIRAT]) HAVE_MKFIFO=1; AC_SUBST([HAVE_MKFIFO]) HAVE_MKFIFOAT=1; AC_SUBST([HAVE_MKFIFOAT]) HAVE_MKNOD=1; AC_SUBST([HAVE_MKNOD]) HAVE_MKNODAT=1; AC_SUBST([HAVE_MKNODAT]) HAVE_UTIMENSAT=1; AC_SUBST([HAVE_UTIMENSAT]) REPLACE_CHMOD=0; AC_SUBST([REPLACE_CHMOD]) REPLACE_FCHMODAT=0; AC_SUBST([REPLACE_FCHMODAT]) REPLACE_FSTAT=0; AC_SUBST([REPLACE_FSTAT]) REPLACE_FSTATAT=0; AC_SUBST([REPLACE_FSTATAT]) REPLACE_FUTIMENS=0; AC_SUBST([REPLACE_FUTIMENS]) REPLACE_LSTAT=0; AC_SUBST([REPLACE_LSTAT]) REPLACE_MKDIR=0; AC_SUBST([REPLACE_MKDIR]) REPLACE_MKFIFO=0; AC_SUBST([REPLACE_MKFIFO]) REPLACE_MKFIFOAT=0; AC_SUBST([REPLACE_MKFIFOAT]) REPLACE_MKNOD=0; AC_SUBST([REPLACE_MKNOD]) REPLACE_MKNODAT=0; AC_SUBST([REPLACE_MKNODAT]) REPLACE_STAT=0; AC_SUBST([REPLACE_STAT]) REPLACE_UTIMENSAT=0; AC_SUBST([REPLACE_UTIMENSAT]) ]) groff-1.24.1/gnulib_m4/hypot.m40000644000175000017500000000674615153275164013136 00000000000000# hypot.m4 # serial 14 dnl Copyright (C) 2012-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_HYPOT], [ m4_divert_text([DEFAULTS], [gl_hypot_required=plain]) AC_REQUIRE([gl_MATH_H_DEFAULTS]) dnl Persuade glibc to declare hypot(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) dnl Determine HYPOT_LIBM. gl_COMMON_DOUBLE_MATHFUNC([hypot]) m4_ifdef([gl_FUNC_HYPOT_IEEE], [ if test $gl_hypot_required = ieee && test $REPLACE_HYPOT = 0; then AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether hypot works according to ISO C 99 with IEC 60559], [gl_cv_func_hypot_ieee], [ saved_LIBS="$LIBS" LIBS="$LIBS $HYPOT_LIBM" AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #ifndef __NO_MATH_INLINES # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include /* Compare two numbers with ==. This is a separate function in order to disable compiler optimizations. */ static int numeric_equal (double x, double y) { return x == y; } static double dummy (double x, double y) { return 0; } double zero; double one = 1.0; int main (int argc, char *argv[]) { double (* volatile my_hypot) (double, double) = argc ? hypot : dummy; double f; /* Test hypot(NaN,Infinity). This test fails on native Windows. */ f = my_hypot (zero / zero, one / zero); if (!numeric_equal (f, f)) return 1; return 0; } ]])], [gl_cv_func_hypot_ieee=yes], [gl_cv_func_hypot_ieee=no], [case "$host_os" in # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_hypot_ieee="guessing yes" ;; # Guess yes on musl systems. *-musl* | midipix*) gl_cv_func_hypot_ieee="guessing yes" ;; # Guess yes on native Windows. mingw* | windows*) gl_cv_func_hypot_ieee="guessing yes" ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_hypot_ieee="$gl_cross_guess_normal" ;; esac ]) LIBS="$saved_LIBS" ]) case "$gl_cv_func_hypot_ieee" in *yes) ;; *) REPLACE_HYPOT=1 ;; esac fi ]) if test $REPLACE_HYPOT = 1; then dnl Find libraries needed to link lib/hypot.c. AC_REQUIRE([gl_FUNC_FABS]) AC_REQUIRE([gl_FUNC_FREXP]) AC_REQUIRE([gl_FUNC_LDEXP]) AC_REQUIRE([gl_FUNC_SQRT]) HYPOT_LIBM= dnl Append $FABS_LIBM to HYPOT_LIBM, avoiding gratuitous duplicates. case " $HYPOT_LIBM " in *" $FABS_LIBM "*) ;; *) HYPOT_LIBM="$HYPOT_LIBM $FABS_LIBM" ;; esac dnl Append $FREXP_LIBM to HYPOT_LIBM, avoiding gratuitous duplicates. case " $HYPOT_LIBM " in *" $FREXP_LIBM "*) ;; *) HYPOT_LIBM="$HYPOT_LIBM $FREXP_LIBM" ;; esac dnl Append $LDEXP_LIBM to HYPOT_LIBM, avoiding gratuitous duplicates. case " $HYPOT_LIBM " in *" $LDEXP_LIBM "*) ;; *) HYPOT_LIBM="$HYPOT_LIBM $LDEXP_LIBM" ;; esac dnl Append $SQRT_LIBM to HYPOT_LIBM, avoiding gratuitous duplicates. case " $HYPOT_LIBM " in *" $SQRT_LIBM "*) ;; *) HYPOT_LIBM="$HYPOT_LIBM $SQRT_LIBM" ;; esac fi ]) groff-1.24.1/gnulib_m4/float_h.m40000644000175000017500000000725215153275164013400 00000000000000# float_h.m4 # serial 16 dnl Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FLOAT_H], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) GL_GENERATE_FLOAT_H=false REPLACE_FLOAT_LDBL=0 case "$host_os" in aix* | beos* | openbsd* | mirbsd*) GL_GENERATE_FLOAT_H=true ;; freebsd* | dragonfly*) case "$host_cpu" in changequote(,)dnl i[34567]86 ) changequote([,])dnl GL_GENERATE_FLOAT_H=true ;; x86_64 ) # On x86_64 systems, the C compiler may still be generating # 32-bit code. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __LP64__ || defined __x86_64__ || defined __amd64__ int ok; #else error fail #endif ]])], [], [GL_GENERATE_FLOAT_H=true]) ;; esac ;; linux*) case "$host_cpu" in powerpc*) GL_GENERATE_FLOAT_H=true ;; esac ;; esac case "$host_os" in aix* | freebsd* | dragonfly* | linux*) if $GL_GENERATE_FLOAT_H; then REPLACE_FLOAT_LDBL=1 fi ;; esac dnl Test for completeness w.r.t. ISO C 23. REPLACE_FLOAT_SNAN=0 AC_CACHE_CHECK([whether float.h conforms to ISO C23], [gl_cv_header_float_h_isoc23], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include int x[] = { FLT_DECIMAL_DIG, DBL_DECIMAL_DIG, LDBL_DECIMAL_DIG }; float maxf = FLT_NORM_MAX; double maxd = DBL_NORM_MAX; long double maxl = LDBL_NORM_MAX; ]], [[float sf = FLT_SNAN; double sd = DBL_SNAN; long double sl = LDBL_SNAN; return (sf != 0) + (sd != 0) + (sl != 0); ]])], [gl_cv_header_float_h_isoc23=yes], [gl_cv_header_float_h_isoc23=no]) ]) if test $gl_cv_header_float_h_isoc23 != yes; then GL_GENERATE_FLOAT_H=true REPLACE_FLOAT_SNAN=1 fi dnl Test against glibc-2.7 Linux/SPARC64 bug. REPLACE_ITOLD=0 AC_CACHE_CHECK([whether conversion from 'int' to 'long double' works], [gl_cv_func_itold_works], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ int i = -1; volatile long double ld; int main () { ld += i * 1.0L; if (ld > 0) return 1; return 0; }]])], [gl_cv_func_itold_works=yes], [gl_cv_func_itold_works=no], [case "$host" in sparc*-*-linux*) AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __LP64__ || defined __arch64__ int ok; #else error fail #endif ]])], [gl_cv_func_itold_works="guessing no"], [gl_cv_func_itold_works="guessing yes"]) ;; # Guess yes on native Windows. mingw* | windows*) gl_cv_func_itold_works="guessing yes" ;; *) gl_cv_func_itold_works="guessing yes" ;; esac ]) ]) case "$gl_cv_func_itold_works" in *no) REPLACE_ITOLD=1 dnl We add the workaround to but also to , dnl to increase the chances that the fix function gets pulled in. GL_GENERATE_FLOAT_H=true ;; esac if $GL_GENERATE_FLOAT_H; then gl_NEXT_HEADERS([float.h]) fi AC_SUBST([REPLACE_ITOLD]) ]) groff-1.24.1/gnulib_m4/unlink.m40000644000175000017500000001226515153275164013264 00000000000000# unlink.m4 # serial 17 dnl Copyright (C) 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_UNLINK], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_CHECK_HEADERS_ONCE([unistd.h]) dnl Detect FreeBSD 7.2, AIX 7.1, Solaris 9 bug. AC_CACHE_CHECK([whether unlink honors trailing slashes], [gl_cv_func_unlink_honors_slashes], [touch conftest.file # Assume that if we have lstat, we can also check symlinks. if test $ac_cv_func_lstat = yes; then ln -s conftest.file conftest.lnk fi AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#if HAVE_UNISTD_H # include #else /* on Windows with MSVC */ # include #endif #include ]GL_MDA_DEFINES], [[int result = 0; if (!unlink ("conftest.file/")) result |= 1; else if (errno != ENOTDIR) result |= 2; #if HAVE_LSTAT if (!unlink ("conftest.lnk/")) result |= 4; else if (errno != ENOTDIR) result |= 8; #endif return result; ]])], [gl_cv_func_unlink_honors_slashes=yes], [gl_cv_func_unlink_honors_slashes=no], [case "$host_os" in # Guess yes on Linux systems. linux-* | linux) gl_cv_func_unlink_honors_slashes="guessing yes" ;; # Guess yes on systems that emulate the Linux system calls. midipix*) gl_cv_func_unlink_honors_slashes="guessing yes" ;; # Guess yes on glibc systems. *-gnu*) gl_cv_func_unlink_honors_slashes="guessing yes" ;; # Guess no on native Windows. mingw* | windows*) gl_cv_func_unlink_honors_slashes="guessing no" ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_unlink_honors_slashes="$gl_cross_guess_normal" ;; esac ]) rm -f conftest.file conftest.lnk]) case "$gl_cv_func_unlink_honors_slashes" in *no) REPLACE_UNLINK=1 ;; esac dnl Detect Mac OS X 10.5.6 bug: On read-write HFS mounts, unlink("..") or dnl unlink("../..") succeeds without doing anything. AC_CACHE_CHECK([whether unlink of a parent directory fails as it should], [gl_cv_func_unlink_parent_fails], [case "$host_os" in darwin*) dnl Try to unlink a subdirectory of /tmp, because /tmp is usually on a dnl HFS mount on Mac OS X. Use a subdirectory, owned by the current dnl user, because otherwise unlink() may fail due to permissions dnl reasons, and because when running as root we don't want to risk dnl destroying the entire /tmp. if { # Use the mktemp program if available. If not available, hide the error # message. tmp=`(umask 077 && mktemp -d /tmp/gtXXXXXX) 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { # Use a simple mkdir command. It is guaranteed to fail if the directory # already exists. $RANDOM is bash specific and expands to empty in shells # other than bash, ksh and zsh. Its use does not increase security; # rather, it minimizes the probability of failure in a very cluttered /tmp # directory. tmp=/tmp/gt$$-$RANDOM (umask 077 && mkdir "$tmp") }; then mkdir "$tmp/subdir" GL_SUBDIR_FOR_UNLINK="$tmp/subdir" export GL_SUBDIR_FOR_UNLINK AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #if HAVE_UNISTD_H # include #else /* on Windows with MSVC */ # include # include #endif ]GL_MDA_DEFINES[ int main () { int result = 0; if (chdir (getenv ("GL_SUBDIR_FOR_UNLINK")) != 0) result |= 1; else if (unlink ("..") == 0) result |= 2; return result; } ]])], [gl_cv_func_unlink_parent_fails=yes], [gl_cv_func_unlink_parent_fails=no], [# If we don't know, obey --enable-cross-guesses. gl_cv_func_unlink_parent_fails="$gl_cross_guess_normal" ]) unset GL_SUBDIR_FOR_UNLINK rm -rf "$tmp" else gl_cv_func_unlink_parent_fails="guessing no" fi ;; *) gl_cv_func_unlink_parent_fails="guessing yes" ;; esac ]) case "$gl_cv_func_unlink_parent_fails" in *no) REPLACE_UNLINK=1 AC_DEFINE([UNLINK_PARENT_BUG], [1], [Define to 1 if unlink() on a parent directory may succeed]) ;; esac ]) groff-1.24.1/gnulib_m4/off64_t.m40000644000175000017500000000172515153275164013232 00000000000000# off64_t.m4 # serial 1 dnl Copyright (C) 2024-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl Check whether defines the 'off64_t' type. dnl Set HAVE_OFF64_T. AC_DEFUN([gl_TYPE_OFF64_T], [ dnl Persuade glibc , , , , dnl to define off64_t. AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) AC_CACHE_CHECK([for off64_t], [gl_cv_off64_t], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[int x = sizeof (off64_t *) + sizeof (off64_t); return !x;]])], [gl_cv_off64_t=yes], [gl_cv_off64_t=no])]) if test $gl_cv_off64_t != no; then HAVE_OFF64_T=1 else HAVE_OFF64_T=0 fi AC_SUBST([HAVE_OFF64_T]) ]) groff-1.24.1/gnulib_m4/math_h.m40000644000175000017500000005730315153275164013226 00000000000000# math_h.m4 # serial 146 dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN_ONCE([gl_MATH_H], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([math.h]) AC_CACHE_CHECK([whether NAN macro works], [gl_cv_header_math_nan_works], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[/* Solaris 10 has a broken definition of NAN. Other platforms fail to provide NAN, or provide it only in C99 mode; this test only needs to fail when NAN is provided but wrong. */ float f = 1.0f; #ifdef NAN f = NAN; #endif return f == 0;]])], [gl_cv_header_math_nan_works=yes], [gl_cv_header_math_nan_works=no])]) if test $gl_cv_header_math_nan_works = no; then REPLACE_NAN=1 fi AC_CACHE_CHECK([whether HUGE_VAL works], [gl_cv_header_math_huge_val_works], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[/* Solaris 10 has a broken definition of HUGE_VAL. */ double d = HUGE_VAL; return d == 0;]])], [gl_cv_header_math_huge_val_works=yes], [gl_cv_header_math_huge_val_works=no])]) if test $gl_cv_header_math_huge_val_works = no; then REPLACE_HUGE_VAL=1 fi dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[#include ]], [acosf acosl asinf asinl atanf atanl cbrt cbrtf cbrtl ceilf ceill copysign copysignf copysignl cosf cosl coshf expf expl exp2 exp2f exp2l expm1 expm1f expm1l fabsf fabsl floorf floorl fma fmaf fmal fmod fmodf fmodl frexpf frexpl getpayload getpayloadf getpayloadl hypotf hypotl ilogb ilogbf ilogbl ldexpf ldexpl log logf logl log10 log10f log10l log1p log1pf log1pl log2 log2f log2l logb logbf logbl logp1 log1pf logp1l modf modff modfl powf remainder remainderf remainderl rint rintf rintl round roundf roundl setpayload setpayloadf setpayloadl setpayloadsig setpayloadsigf setpayloadsigl sinf sinl sinhf sqrtf sqrtl tanf tanl tanhf totalorder totalorderf totalorderl totalordermag totalordermagf totalordermagl trunc truncf truncl]) ]) # gl_MATH_MODULE_INDICATOR([modulename]) # sets the shell variable that indicates the presence of the given module # to a C preprocessor expression that will evaluate to 1. # This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_MATH_MODULE_INDICATOR], [ dnl Ensure to expand the default settings once only. gl_MATH_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) # Initializes the default values for AC_SUBSTed shell variables. # This macro must not be AC_REQUIREd. It must only be invoked, and only # outside of macros or in macros that are not AC_REQUIREd. AC_DEFUN([gl_MATH_H_REQUIRE_DEFAULTS], [ m4_defun(GL_MODULE_INDICATOR_PREFIX[_MATH_H_MODULE_INDICATOR_DEFAULTS], [ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACOSF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACOSL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ASINF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ASINL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATANF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATANL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATAN2F]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CBRT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CBRTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CBRTL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CEIL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CEILF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CEILL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPYSIGN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPYSIGNF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPYSIGNL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COSF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COSL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COSHF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXP2]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXP2F]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXP2L]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPM1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPM1F]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPM1L]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FABSF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FABSL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOOR]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOORF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOORL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMA]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMAF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMAL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMOD]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMODF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMODL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXPF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXPL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPAYLOAD]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPAYLOADF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPAYLOADL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOTL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGB]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGBF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGBL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISFINITE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISFINITE_NO_CXX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISINF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISINF_NO_CXX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAN_NO_CXX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAND]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LDEXP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LDEXPF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LDEXPL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG10]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG10F]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG10L]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG1P]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG1PF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG1PL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG2]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG2F]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG2L]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGB]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGBF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGBL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGP1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGP1F]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGP1L]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODFF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODFL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POWF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMAINDER]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMAINDERF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMAINDERL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RINT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RINTL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUND]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUNDF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUNDL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOAD]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOADF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOADL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOADSIG]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOADSIGF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOADSIGL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGNBIT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGNBIT_NO_CXX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINHF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SQRTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SQRTL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANHF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOTALORDER]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOTALORDERF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOTALORDERL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOTALORDERMAG]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOTALORDERMAGF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOTALORDERMAGL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNC]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCL]) dnl Support Microsoft deprecated alias function names by default. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_J0], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_J1], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_JN], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_Y0], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_Y1], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_YN], [1]) ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_MATH_H_MODULE_INDICATOR_DEFAULTS]) AC_REQUIRE([gl_MATH_H_DEFAULTS]) ]) AC_DEFUN([gl_MATH_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. HAVE_ACOSF=1; AC_SUBST([HAVE_ACOSF]) HAVE_ACOSL=1; AC_SUBST([HAVE_ACOSL]) HAVE_ASINF=1; AC_SUBST([HAVE_ASINF]) HAVE_ASINL=1; AC_SUBST([HAVE_ASINL]) HAVE_ATANF=1; AC_SUBST([HAVE_ATANF]) HAVE_ATANL=1; AC_SUBST([HAVE_ATANL]) HAVE_ATAN2F=1; AC_SUBST([HAVE_ATAN2F]) HAVE_CBRT=1; AC_SUBST([HAVE_CBRT]) HAVE_CBRTF=1; AC_SUBST([HAVE_CBRTF]) HAVE_CBRTL=1; AC_SUBST([HAVE_CBRTL]) HAVE_COPYSIGN=1; AC_SUBST([HAVE_COPYSIGN]) HAVE_COPYSIGNF=1; AC_SUBST([HAVE_COPYSIGNF]) HAVE_COPYSIGNL=1; AC_SUBST([HAVE_COPYSIGNL]) HAVE_COSF=1; AC_SUBST([HAVE_COSF]) HAVE_COSL=1; AC_SUBST([HAVE_COSL]) HAVE_COSHF=1; AC_SUBST([HAVE_COSHF]) HAVE_EXPF=1; AC_SUBST([HAVE_EXPF]) HAVE_EXPL=1; AC_SUBST([HAVE_EXPL]) HAVE_EXP2=1; AC_SUBST([HAVE_EXP2]) HAVE_EXP2F=1; AC_SUBST([HAVE_EXP2F]) HAVE_EXP2L=1; AC_SUBST([HAVE_EXP2L]) HAVE_EXPM1=1; AC_SUBST([HAVE_EXPM1]) HAVE_EXPM1F=1; AC_SUBST([HAVE_EXPM1F]) HAVE_EXPM1L=1; AC_SUBST([HAVE_EXPM1L]) HAVE_FABSF=1; AC_SUBST([HAVE_FABSF]) HAVE_FABSL=1; AC_SUBST([HAVE_FABSL]) HAVE_FMA=1; AC_SUBST([HAVE_FMA]) HAVE_FMAF=1; AC_SUBST([HAVE_FMAF]) HAVE_FMAL=1; AC_SUBST([HAVE_FMAL]) HAVE_FMODF=1; AC_SUBST([HAVE_FMODF]) HAVE_FMODL=1; AC_SUBST([HAVE_FMODL]) HAVE_FREXPF=1; AC_SUBST([HAVE_FREXPF]) HAVE_GETPAYLOAD=1; AC_SUBST([HAVE_GETPAYLOAD]) HAVE_GETPAYLOADF=1; AC_SUBST([HAVE_GETPAYLOADF]) HAVE_GETPAYLOADL=1; AC_SUBST([HAVE_GETPAYLOADL]) HAVE_HYPOTF=1; AC_SUBST([HAVE_HYPOTF]) HAVE_HYPOTL=1; AC_SUBST([HAVE_HYPOTL]) HAVE_ILOGB=1; AC_SUBST([HAVE_ILOGB]) HAVE_ILOGBF=1; AC_SUBST([HAVE_ILOGBF]) HAVE_ILOGBL=1; AC_SUBST([HAVE_ILOGBL]) HAVE_ISNANF=1; AC_SUBST([HAVE_ISNANF]) HAVE_ISNAND=1; AC_SUBST([HAVE_ISNAND]) HAVE_ISNANL=1; AC_SUBST([HAVE_ISNANL]) HAVE_LDEXPF=1; AC_SUBST([HAVE_LDEXPF]) HAVE_LOGF=1; AC_SUBST([HAVE_LOGF]) HAVE_LOGL=1; AC_SUBST([HAVE_LOGL]) HAVE_LOG10F=1; AC_SUBST([HAVE_LOG10F]) HAVE_LOG10L=1; AC_SUBST([HAVE_LOG10L]) HAVE_LOG1P=1; AC_SUBST([HAVE_LOG1P]) HAVE_LOG1PF=1; AC_SUBST([HAVE_LOG1PF]) HAVE_LOG1PL=1; AC_SUBST([HAVE_LOG1PL]) HAVE_LOG2=1; AC_SUBST([HAVE_LOG2]) HAVE_LOG2F=1; AC_SUBST([HAVE_LOG2F]) HAVE_LOG2L=1; AC_SUBST([HAVE_LOG2L]) HAVE_LOGBF=1; AC_SUBST([HAVE_LOGBF]) HAVE_LOGBL=1; AC_SUBST([HAVE_LOGBL]) HAVE_LOGP1=1; AC_SUBST([HAVE_LOGP1]) HAVE_LOGP1F=1; AC_SUBST([HAVE_LOGP1F]) HAVE_LOGP1L=1; AC_SUBST([HAVE_LOGP1L]) HAVE_MODFF=1; AC_SUBST([HAVE_MODFF]) HAVE_MODFL=1; AC_SUBST([HAVE_MODFL]) HAVE_POWF=1; AC_SUBST([HAVE_POWF]) HAVE_REMAINDER=1; AC_SUBST([HAVE_REMAINDER]) HAVE_REMAINDERF=1; AC_SUBST([HAVE_REMAINDERF]) HAVE_REMAINDERL=1; AC_SUBST([HAVE_REMAINDERL]) HAVE_RINT=1; AC_SUBST([HAVE_RINT]) HAVE_RINTF=1; AC_SUBST([HAVE_RINTF]) HAVE_RINTL=1; AC_SUBST([HAVE_RINTL]) HAVE_ROUND=1; AC_SUBST([HAVE_ROUND]) HAVE_ROUNDF=1; AC_SUBST([HAVE_ROUNDF]) HAVE_ROUNDL=1; AC_SUBST([HAVE_ROUNDL]) HAVE_SETPAYLOAD=1; AC_SUBST([HAVE_SETPAYLOAD]) HAVE_SETPAYLOADF=1; AC_SUBST([HAVE_SETPAYLOADF]) HAVE_SETPAYLOADL=1; AC_SUBST([HAVE_SETPAYLOADL]) HAVE_SETPAYLOADSIG=1; AC_SUBST([HAVE_SETPAYLOADSIG]) HAVE_SETPAYLOADSIGF=1; AC_SUBST([HAVE_SETPAYLOADSIGF]) HAVE_SETPAYLOADSIGL=1; AC_SUBST([HAVE_SETPAYLOADSIGL]) HAVE_SINF=1; AC_SUBST([HAVE_SINF]) HAVE_SINL=1; AC_SUBST([HAVE_SINL]) HAVE_SINHF=1; AC_SUBST([HAVE_SINHF]) HAVE_SQRTF=1; AC_SUBST([HAVE_SQRTF]) HAVE_SQRTL=1; AC_SUBST([HAVE_SQRTL]) HAVE_TANF=1; AC_SUBST([HAVE_TANF]) HAVE_TANL=1; AC_SUBST([HAVE_TANL]) HAVE_TANHF=1; AC_SUBST([HAVE_TANHF]) HAVE_TOTALORDER=1; AC_SUBST([HAVE_TOTALORDER]) HAVE_TOTALORDERF=1; AC_SUBST([HAVE_TOTALORDERF]) HAVE_TOTALORDERL=1; AC_SUBST([HAVE_TOTALORDERL]) HAVE_TOTALORDERMAG=1; AC_SUBST([HAVE_TOTALORDERMAG]) HAVE_TOTALORDERMAGF=1; AC_SUBST([HAVE_TOTALORDERMAGF]) HAVE_TOTALORDERMAGL=1; AC_SUBST([HAVE_TOTALORDERMAGL]) HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL]) HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL]) HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL]) HAVE_DECL_CEILF=1; AC_SUBST([HAVE_DECL_CEILF]) HAVE_DECL_CEILL=1; AC_SUBST([HAVE_DECL_CEILL]) HAVE_DECL_COSL=1; AC_SUBST([HAVE_DECL_COSL]) HAVE_DECL_EXPL=1; AC_SUBST([HAVE_DECL_EXPL]) HAVE_DECL_FLOORF=1; AC_SUBST([HAVE_DECL_FLOORF]) HAVE_DECL_FLOORL=1; AC_SUBST([HAVE_DECL_FLOORL]) HAVE_DECL_FREXPL=1; AC_SUBST([HAVE_DECL_FREXPL]) HAVE_DECL_LDEXPL=1; AC_SUBST([HAVE_DECL_LDEXPL]) HAVE_DECL_LOGL=1; AC_SUBST([HAVE_DECL_LOGL]) HAVE_DECL_LOG10L=1; AC_SUBST([HAVE_DECL_LOG10L]) HAVE_DECL_LOGB=1; AC_SUBST([HAVE_DECL_LOGB]) HAVE_DECL_SINL=1; AC_SUBST([HAVE_DECL_SINL]) HAVE_DECL_SQRTL=1; AC_SUBST([HAVE_DECL_SQRTL]) HAVE_DECL_TANL=1; AC_SUBST([HAVE_DECL_TANL]) HAVE_DECL_TRUNC=1; AC_SUBST([HAVE_DECL_TRUNC]) HAVE_DECL_TRUNCF=1; AC_SUBST([HAVE_DECL_TRUNCF]) HAVE_DECL_TRUNCL=1; AC_SUBST([HAVE_DECL_TRUNCL]) REPLACE_ACOSF=0; AC_SUBST([REPLACE_ACOSF]) REPLACE_ASINF=0; AC_SUBST([REPLACE_ASINF]) REPLACE_ATANF=0; AC_SUBST([REPLACE_ATANF]) REPLACE_ATAN2F=0; AC_SUBST([REPLACE_ATAN2F]) REPLACE_CBRTF=0; AC_SUBST([REPLACE_CBRTF]) REPLACE_CBRTL=0; AC_SUBST([REPLACE_CBRTL]) REPLACE_CEIL=0; AC_SUBST([REPLACE_CEIL]) REPLACE_CEILF=0; AC_SUBST([REPLACE_CEILF]) REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL]) REPLACE_COSF=0; AC_SUBST([REPLACE_COSF]) REPLACE_COSHF=0; AC_SUBST([REPLACE_COSHF]) REPLACE_EXPF=0; AC_SUBST([REPLACE_EXPF]) REPLACE_EXPL=0; AC_SUBST([REPLACE_EXPL]) REPLACE_EXPM1=0; AC_SUBST([REPLACE_EXPM1]) REPLACE_EXPM1F=0; AC_SUBST([REPLACE_EXPM1F]) REPLACE_EXPM1L=0; AC_SUBST([REPLACE_EXPM1L]) REPLACE_EXP2=0; AC_SUBST([REPLACE_EXP2]) REPLACE_EXP2L=0; AC_SUBST([REPLACE_EXP2L]) REPLACE_FABSL=0; AC_SUBST([REPLACE_FABSL]) REPLACE_FLOOR=0; AC_SUBST([REPLACE_FLOOR]) REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF]) REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL]) REPLACE_FMA=0; AC_SUBST([REPLACE_FMA]) REPLACE_FMAF=0; AC_SUBST([REPLACE_FMAF]) REPLACE_FMAL=0; AC_SUBST([REPLACE_FMAL]) REPLACE_FMOD=0; AC_SUBST([REPLACE_FMOD]) REPLACE_FMODF=0; AC_SUBST([REPLACE_FMODF]) REPLACE_FMODL=0; AC_SUBST([REPLACE_FMODL]) REPLACE_FREXPF=0; AC_SUBST([REPLACE_FREXPF]) REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP]) REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL]) REPLACE_GETPAYLOAD=0; AC_SUBST([REPLACE_GETPAYLOAD]) REPLACE_GETPAYLOADF=0; AC_SUBST([REPLACE_GETPAYLOADF]) REPLACE_GETPAYLOADL=0; AC_SUBST([REPLACE_GETPAYLOADL]) REPLACE_HUGE_VAL=0; AC_SUBST([REPLACE_HUGE_VAL]) REPLACE_HYPOT=0; AC_SUBST([REPLACE_HYPOT]) REPLACE_HYPOTF=0; AC_SUBST([REPLACE_HYPOTF]) REPLACE_HYPOTL=0; AC_SUBST([REPLACE_HYPOTL]) REPLACE_ILOGB=0; AC_SUBST([REPLACE_ILOGB]) REPLACE_ILOGBF=0; AC_SUBST([REPLACE_ILOGBF]) REPLACE_ILOGBL=0; AC_SUBST([REPLACE_ILOGBL]) REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE]) REPLACE_ISINF=0; AC_SUBST([REPLACE_ISINF]) REPLACE_ISNAN=0; AC_SUBST([REPLACE_ISNAN]) REPLACE_LDEXP=0; AC_SUBST([REPLACE_LDEXP]) REPLACE_LDEXPL=0; AC_SUBST([REPLACE_LDEXPL]) REPLACE_LOG=0; AC_SUBST([REPLACE_LOG]) REPLACE_LOGF=0; AC_SUBST([REPLACE_LOGF]) REPLACE_LOGL=0; AC_SUBST([REPLACE_LOGL]) REPLACE_LOG10=0; AC_SUBST([REPLACE_LOG10]) REPLACE_LOG10F=0; AC_SUBST([REPLACE_LOG10F]) REPLACE_LOG10L=0; AC_SUBST([REPLACE_LOG10L]) REPLACE_LOG1P=0; AC_SUBST([REPLACE_LOG1P]) REPLACE_LOG1PF=0; AC_SUBST([REPLACE_LOG1PF]) REPLACE_LOG1PL=0; AC_SUBST([REPLACE_LOG1PL]) REPLACE_LOG2=0; AC_SUBST([REPLACE_LOG2]) REPLACE_LOG2F=0; AC_SUBST([REPLACE_LOG2F]) REPLACE_LOG2L=0; AC_SUBST([REPLACE_LOG2L]) REPLACE_LOGB=0; AC_SUBST([REPLACE_LOGB]) REPLACE_LOGBF=0; AC_SUBST([REPLACE_LOGBF]) REPLACE_LOGBL=0; AC_SUBST([REPLACE_LOGBL]) REPLACE_MODF=0; AC_SUBST([REPLACE_MODF]) REPLACE_MODFF=0; AC_SUBST([REPLACE_MODFF]) REPLACE_MODFL=0; AC_SUBST([REPLACE_MODFL]) REPLACE_NAN=0; AC_SUBST([REPLACE_NAN]) REPLACE_REMAINDER=0; AC_SUBST([REPLACE_REMAINDER]) REPLACE_REMAINDERF=0; AC_SUBST([REPLACE_REMAINDERF]) REPLACE_REMAINDERL=0; AC_SUBST([REPLACE_REMAINDERL]) REPLACE_RINTL=0; AC_SUBST([REPLACE_RINTL]) REPLACE_ROUND=0; AC_SUBST([REPLACE_ROUND]) REPLACE_ROUNDF=0; AC_SUBST([REPLACE_ROUNDF]) REPLACE_ROUNDL=0; AC_SUBST([REPLACE_ROUNDL]) REPLACE_SIGNBIT=0; AC_SUBST([REPLACE_SIGNBIT]) REPLACE_SIGNBIT_USING_BUILTINS=0; AC_SUBST([REPLACE_SIGNBIT_USING_BUILTINS]) REPLACE_SINF=0; AC_SUBST([REPLACE_SINF]) REPLACE_SINHF=0; AC_SUBST([REPLACE_SINHF]) REPLACE_SINL=0; AC_SUBST([REPLACE_SINL]) REPLACE_SQRTF=0; AC_SUBST([REPLACE_SQRTF]) REPLACE_SQRTL=0; AC_SUBST([REPLACE_SQRTL]) REPLACE_TANF=0; AC_SUBST([REPLACE_TANF]) REPLACE_TANHF=0; AC_SUBST([REPLACE_TANHF]) REPLACE_TOTALORDER=0; AC_SUBST([REPLACE_TOTALORDER]) REPLACE_TOTALORDERF=0; AC_SUBST([REPLACE_TOTALORDERF]) REPLACE_TOTALORDERL=0; AC_SUBST([REPLACE_TOTALORDERL]) REPLACE_TOTALORDERMAG=0; AC_SUBST([REPLACE_TOTALORDERMAG]) REPLACE_TOTALORDERMAGF=0; AC_SUBST([REPLACE_TOTALORDERMAGF]) REPLACE_TOTALORDERMAGL=0; AC_SUBST([REPLACE_TOTALORDERMAGL]) REPLACE_TRUNC=0; AC_SUBST([REPLACE_TRUNC]) REPLACE_TRUNCF=0; AC_SUBST([REPLACE_TRUNCF]) REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL]) ]) # gl_LONG_DOUBLE_VS_DOUBLE # determines whether 'long double' and 'double' have the same representation. # Sets variable HAVE_SAME_LONG_DOUBLE_AS_DOUBLE to 0 or 1, and defines # HAVE_SAME_LONG_DOUBLE_AS_DOUBLE accordingly. # The currently known platforms where this is the case are: # Linux/HPPA, NetBSD/sparc32, Minix 3.1.8, AIX 5, AIX 6 and 7 with xlc, MSVC 9. AC_DEFUN([gl_LONG_DOUBLE_VS_DOUBLE], [ AC_CACHE_CHECK([whether long double and double are the same], [gl_cv_long_double_equals_double], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[typedef int check[sizeof (long double) == sizeof (double) && LDBL_MANT_DIG == DBL_MANT_DIG && LDBL_MAX_EXP == DBL_MAX_EXP && LDBL_MIN_EXP == DBL_MIN_EXP ? 1 : -1]; ]])], [gl_cv_long_double_equals_double=yes], [gl_cv_long_double_equals_double=no]) ]) if test $gl_cv_long_double_equals_double = yes; then AC_DEFINE([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE], [1], [Define to 1 if 'long double' and 'double' have the same representation.]) HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1 else HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0 fi AC_SUBST([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE]) ]) groff-1.24.1/gnulib_m4/mbiter.m40000644000175000017500000000073215153275164013242 00000000000000# mbiter.m4 # serial 7 dnl Copyright (C) 2005, 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl autoconf tests required for use of mbiter.h dnl From Bruno Haible. AC_DEFUN([gl_MBITER], [ AC_REQUIRE([AC_TYPE_MBSTATE_T]) : ]) groff-1.24.1/gnulib_m4/stdbool.m40000644000175000017500000000747315153275164013437 00000000000000# stdbool.m4 # serial 10 dnl Copyright (C) 2002-2006, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. # Check for stdbool.h that conforms to C99. # Prepare for substituting if it is not supported. AC_DEFUN([gl_STDBOOL_H], [ AC_REQUIRE([AC_CHECK_HEADER_STDBOOL]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl On some platforms, does not exist or does not conform to C99. dnl On Solaris 10 with CC=cc CXX=CC, exists but is not usable dnl in C++ mode (and no exists). In this case, we use our dnl replacement, also in C mode (for binary compatibility between C and C++). if test "$ac_cv_header_stdbool_h" = yes; then case "$host_os" in solaris*) if test -z "$GCC"; then GL_GENERATE_STDBOOL_H=true else GL_GENERATE_STDBOOL_H=false fi ;; *) GL_GENERATE_STDBOOL_H=false ;; esac else GL_GENERATE_STDBOOL_H=true fi if test "$ac_cv_type__Bool" = yes; then HAVE__BOOL=1 else HAVE__BOOL=0 fi AC_SUBST([HAVE__BOOL]) ]) m4_version_prereq([2.72], [], [ AC_DEFUN([AC_CHECK_HEADER_STDBOOL], [AC_CHECK_TYPES([_Bool]) AC_CACHE_CHECK([for stdbool.h that conforms to C99 or later], [ac_cv_header_stdbool_h], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include /* "true" and "false" should be usable in #if expressions and integer constant expressions, and "bool" should be a valid type name. Although C99 requires bool, true, and false to be macros, C23 and C++11 overrule that, so do not test for that. Although C99 requires __bool_true_false_are_defined and _Bool, C23 says they are obsolescent, so do not require them. */ #if !true #error "'true' is not true" #endif #if true != 1 #error "'true' is not equal to 1" #endif char b[true == 1 ? 1 : -1]; char c[true]; #if false #error "'false' is not false" #endif #if false != 0 #error "'false' is not equal to 0" #endif char d[false == 0 ? 1 : -1]; enum { e = false, f = true, g = false * true, h = true * 256 }; char i[(bool) 0.5 == true ? 1 : -1]; char j[(bool) 0.0 == false ? 1 : -1]; char k[sizeof (bool) > 0 ? 1 : -1]; struct sb { bool s: 1; bool t; } s; char l[sizeof s.t > 0 ? 1 : -1]; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ bool m[h]; char n[sizeof m == h * sizeof m[0] ? 1 : -1]; char o[-1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html */ bool p = true; bool *pp = &p; ]], [[ bool ps = &s; *pp |= p; *pp |= ! p; /* Refer to every declared value, so they cannot be discarded as unused. */ return (!b + !c + !d + !e + !f + !g + !h + !i + !j + !k + !l + !m + !n + !o + !p + !pp + !ps); ]])], [ac_cv_header_stdbool_h=yes], [ac_cv_header_stdbool_h=no])]) ])# AC_CHECK_HEADER_STDBOOL ]) # m4_version_prereq 2.72 groff-1.24.1/gnulib_m4/inttypes_h.m40000644000175000017500000000206415153275164014146 00000000000000# inttypes_h.m4 # serial 10 dnl Copyright (C) 1997-2004, 2006, 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Paul Eggert. # Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, # doesn't clash with , and declares uintmax_t. AC_DEFUN([gl_AC_HEADER_INTTYPES_H], [ AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[uintmax_t i = (uintmax_t) -1; return !i;]])], [gl_cv_header_inttypes_h=yes], [gl_cv_header_inttypes_h=no])]) if test $gl_cv_header_inttypes_h = yes; then AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1], [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi ]) groff-1.24.1/gnulib_m4/threadlib.m40000644000175000017500000005771115153275164013727 00000000000000# threadlib.m4 # serial 49 dnl Copyright (C) 2005-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Bruno Haible. AC_PREREQ([2.60]) dnl The general structure of the multithreading modules in gnulib is that we dnl have three set of modules: dnl dnl * POSIX API: dnl pthread, which combines dnl pthread-h dnl pthread-thread dnl pthread-once dnl pthread-mutex dnl pthread-rwlock dnl pthread-cond dnl pthread-tss dnl pthread-spin dnl sched_yield dnl dnl * ISO C API: dnl threads, which combines dnl threads-h dnl thrd dnl mtx dnl cnd dnl tss dnl dnl * Gnulib API, with an implementation that can be chosen at configure dnl time through the option --enable-threads=... dnl thread dnl lock dnl cond dnl tls dnl yield dnl dnl They are independent, except for the fact that dnl - the implementation of the ISO C API may use the POSIX (or some other dnl platform dependent) API, dnl - the implementation of the Gnulib API may use the POSIX or ISO C or dnl some other platform dependent API, depending on the --enable-threads dnl option. dnl dnl This file contains macros for all of these APIs! dnl ============================================================================ dnl Macros for all thread APIs AC_DEFUN([gl_ANYTHREADLIB_EARLY], [ AC_REQUIRE([AC_CANONICAL_HOST]) if test -z "$gl_anythreadlib_early_done"; then # Some systems optimize for single-threaded programs by default, and # need special flags to disable these optimizations. For example, the # definition of errno in . AS_CASE([$host_os], [aix* | freebsd*], [CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"], [hpux* | solaris*], [CPPFLAGS="$CPPFLAGS -D_REENTRANT"]) gl_anythreadlib_early_done=done fi ]) dnl Checks whether the compiler and linker support weak declarations of symbols. AC_DEFUN([gl_WEAK_SYMBOLS], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([whether imported symbols can be declared weak], [gl_cv_have_weak], [AS_CASE([$host_os], [cygwin* | mingw* | windows*], [ dnl On Cygwin 3.2.0 with gcc 10.2, and likewise on mingw 10.0.0 with dnl gcc 11.3, the test below would succeed, but programs that use dnl pthread_in_use() with weak symbol references crash miserably at dnl runtime. gl_cv_have_weak="guessing no" ], [ gl_cv_have_weak=no dnl First, test whether the compiler accepts it syntactically. AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[extern void xyzzy (); #pragma weak xyzzy ]], [[xyzzy();]])], [gl_cv_have_weak=maybe]) AS_IF([test $gl_cv_have_weak = maybe], [ dnl Second, test whether it actually works. On Cygwin 1.7.2, with dnl gcc 4.3, symbols declared weak always evaluate to the address 0. AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #pragma weak fputs int main () { return (fputs == NULL); }]])], [gl_cv_have_weak=yes], [gl_cv_have_weak=no], [dnl When cross-compiling, assume that only ELF platforms support dnl weak symbols. AC_EGREP_CPP([Extensible Linking Format], [#ifdef __ELF__ Extensible Linking Format #endif ], [gl_cv_have_weak="guessing yes"], [gl_cv_have_weak="guessing no"]) ]) ]) ]) dnl But when linking statically, weak symbols do not work. AS_CASE([" $LDFLAGS "], [*" -static "*], [gl_cv_have_weak=no]) dnl Test for a bug in FreeBSD 11: A link error occurs when using a weak dnl symbol and linking against a shared library that has a dependency on dnl the shared library that defines the symbol. AS_CASE([$gl_cv_have_weak], [*yes], [AS_CASE([$host_os], [freebsd* | dragonfly* | midnightbsd*], [ : > conftest1.c $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&AS_MESSAGE_LOG_FD 2>&1 cat < conftest2.c #include #pragma weak pthread_mutexattr_gettype int main () { return (pthread_mutexattr_gettype != NULL); } EOF $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&AS_MESSAGE_LOG_FD 2>&1 \ || gl_cv_have_weak=no rm -f conftest1.c libempty.so conftest2.c conftest ]) ]) ]) AS_CASE([$gl_cv_have_weak], [*yes], [ AC_DEFINE([HAVE_WEAK_SYMBOLS], [1], [Define to 1 if the compiler and linker support weak declarations of symbols.]) ]) ]) dnl ============================================================================ dnl Macros for the POSIX API dnl gl_PTHREADLIB dnl ------------- dnl Tests for the libraries needs for using the POSIX threads API. dnl Sets the variable LIBPTHREAD to the linker options for use in a Makefile. dnl Sets the variable LIBPMULTITHREAD, for programs that really need dnl multithread functionality. The difference between LIBPTHREAD and dnl LIBPMULTITHREAD is that on platforms supporting weak symbols, typically dnl LIBPTHREAD is empty whereas LIBPMULTITHREAD is not. dnl Sets the variable SCHED_YIELD_LIB to the linker options needed to use the dnl sched_yield() function. dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for dnl multithread-safe programs. dnl Defines the C macro HAVE_PTHREAD_API if (at least parts of) the POSIX dnl threads API is available. dnl The guts of gl_PTHREADLIB. Needs to be expanded only once. AC_DEFUN([gl_PTHREADLIB_BODY], [ AC_REQUIRE([gl_ANYTHREADLIB_EARLY]) AS_IF([test -z "$gl_pthreadlib_body_done"], [ gl_pthread_api=no LIBPTHREAD= LIBPMULTITHREAD= AC_CHECK_HEADER([pthread.h], [gl_have_pthread_h=yes], [gl_have_pthread_h=no]) AS_IF([test "$gl_have_pthread_h" = yes], [ # Other possible tests: # -lpthreads (FSU threads, PCthreads) # -lgthreads # Test whether both pthread_mutex_lock exists in libc. # # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04 # needs -pthread for some reason. See: # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html saved_LIBS="$LIBS" for gl_pthread in "" "-pthread"; do LIBS="$LIBS $gl_pthread" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include pthread_mutex_t m; ]], [[pthread_mutex_lock (&m);]])], [gl_pthread_api=yes LIBPTHREAD=$gl_pthread LIBPMULTITHREAD=$gl_pthread]) LIBS="$saved_LIBS" test $gl_pthread_api = yes && break done echo "$as_me:__oline__: gl_pthread_api=$gl_pthread_api" >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: LIBPTHREAD=$LIBPTHREAD" >&AS_MESSAGE_LOG_FD gl_pthread_in_glibc=no # On Linux with glibc >= 2.34, libc contains the fully functional # pthread functions. AS_CASE([$host_os], [linux*], [ AC_EGREP_CPP([Lucky user], [#include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 34) || (__GLIBC__ > 2) Lucky user #endif #endif ], [gl_pthread_in_glibc=yes], []) ]) echo "$as_me:__oline__: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&AS_MESSAGE_LOG_FD # Test for libpthread by looking for pthread_kill. AS_IF([test $gl_pthread_api = yes && test -z "$LIBPTHREAD"], [ # The program links fine without libpthread. But it may actually # need to link with libpthread in order to create multiple threads. AC_CHECK_LIB([pthread], [pthread_kill], [AS_IF([test $gl_pthread_in_glibc = yes], [ LIBPMULTITHREAD= ], [ LIBPMULTITHREAD=-lpthread # On Solaris and HP-UX, most pthread functions exist also in libc. # Therefore pthread_in_use() needs to actually try to create a # thread: pthread_create from libc will fail, whereas # pthread_create will actually create a thread. # On Solaris 10 or newer, this test is no longer needed, because # libc contains the fully functional pthread functions. AS_CASE([$host_os], [[solaris | solaris2.[1-9] | solaris2.[1-9].* | hpux*]], [ AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1], [Define if the pthread_in_use() detection is hard.]) ]) ]) ], [dnl This is needed on FreeBSD 5.2.1. AC_CHECK_LIB([thr], [pthread_kill], [if test $gl_pthread_in_glibc = yes; then LIBPMULTITHREAD= else LIBPMULTITHREAD=-lthr fi ]) ]) ], [test $gl_pthread_api != yes], [ # Some library is needed. Try libpthread and libc_r. AC_CHECK_LIB([pthread], [pthread_kill], [gl_pthread_api=yes LIBPTHREAD=-lpthread LIBPMULTITHREAD=-lpthread]) AS_IF([test $gl_pthread_api != yes], [ # For FreeBSD 4. AC_CHECK_LIB([c_r], [pthread_kill], [gl_pthread_api=yes LIBPTHREAD=-lc_r LIBPMULTITHREAD=-lc_r]) ]) ]) echo "$as_me:__oline__: LIBPMULTITHREAD=$LIBPMULTITHREAD" >&AS_MESSAGE_LOG_FD ]) AC_MSG_CHECKING([whether POSIX threads API is available]) AC_MSG_RESULT([$gl_pthread_api]) AC_SUBST([LIBPTHREAD]) AC_SUBST([LIBPMULTITHREAD]) AS_IF([test $gl_pthread_api = yes], [ AC_DEFINE([HAVE_PTHREAD_API], [1], [Define if you have the header and the POSIX threads API.]) ]) dnl On some systems, sched_yield is in librt, rather than in libpthread. AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[sched_yield ();]])], [SCHED_YIELD_LIB= ], [dnl Solaris 7...10 has sched_yield in librt, not in libpthread or libc. AC_CHECK_LIB([rt], [sched_yield], [SCHED_YIELD_LIB=-lrt], [dnl Solaris 2.5.1, 2.6 has sched_yield in libposix4, not librt. AC_CHECK_LIB([posix4], [sched_yield], [SCHED_YIELD_LIB=-lposix4])]) ]) AC_SUBST([SCHED_YIELD_LIB]) dnl For backward compatibility. LIB_SCHED_YIELD="$SCHED_YIELD_LIB" AC_SUBST([LIB_SCHED_YIELD]) gl_pthreadlib_body_done=done ]) ]) AC_DEFUN([gl_PTHREADLIB], [ AC_REQUIRE([gl_ANYTHREADLIB_EARLY]) gl_PTHREADLIB_BODY ]) dnl ============================================================================ dnl Macros for the ISO C API dnl gl_STDTHREADLIB dnl --------------- dnl Tests for the libraries needs for using the ISO C threads API. dnl Sets the variable LIBSTDTHREAD to the linker options for use in a Makefile. dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for dnl multithread-safe programs. dnl Defines the C macro HAVE_THREADS_H if (at least parts of) the ISO C threads dnl API is available. dnl The guts of gl_STDTHREADLIB. Needs to be expanded only once. AC_DEFUN([gl_STDTHREADLIB_BODY], [ AC_REQUIRE([gl_ANYTHREADLIB_EARLY]) AC_REQUIRE([AC_CANONICAL_HOST]) AS_IF([test -z "$gl_stdthreadlib_body_done"], [ AC_CHECK_HEADERS_ONCE([threads.h]) AS_CASE([$host_os], [mingw* | windows*], [ LIBSTDTHREAD= ], [ gl_PTHREADLIB_BODY AS_IF([test $ac_cv_header_threads_h = yes], [ dnl glibc >= 2.29 has thrd_create in libpthread. dnl FreeBSD >= 10 has thrd_create in libstdthreads; this library depends dnl on libpthread (for the symbol pthread_mutexattr_gettype). dnl glibc >= 2.34, AIX >= 7.1, and Solaris >= 11.4 have thrd_create in dnl libc. gl_CHECK_FUNCS_ANDROID([thrd_create], [[#include ]]) AS_IF([test $ac_cv_func_thrd_create = yes], [ LIBSTDTHREAD= ], [ AC_CHECK_LIB([stdthreads], [thrd_create], [ LIBSTDTHREAD="-lstdthreads -lpthread" ], [ dnl Guess that thrd_create is in libpthread. LIBSTDTHREAD="$LIBPMULTITHREAD" ]) ]) ], [ dnl Libraries needed by thrd.c, mtx.c, cnd.c, tss.c. LIBSTDTHREAD="$LIBPMULTITHREAD $SCHED_YIELD_LIB" ]) ]) AC_SUBST([LIBSTDTHREAD]) AC_MSG_CHECKING([whether ISO C threads API is available]) AC_MSG_RESULT([$ac_cv_header_threads_h]) gl_stdthreadlib_body_done=done ]) ]) AC_DEFUN([gl_STDTHREADLIB], [ AC_REQUIRE([gl_ANYTHREADLIB_EARLY]) gl_STDTHREADLIB_BODY ]) dnl ============================================================================ dnl Macros for the Gnulib API dnl gl_THREADLIB dnl ------------ dnl Tests for a multithreading library to be used. dnl If the configure.ac contains a definition of the gl_THREADLIB_DEFAULT_NO dnl (it must be placed before the invocation of gl_THREADLIB_EARLY!), then the dnl default is "no", otherwise it is system dependent. In both cases, the user dnl can change the choice through the options --enable-threads=choice or dnl --disable-threads. dnl Defines at most one of the macros USE_ISOC_THREADS, USE_POSIX_THREADS, dnl USE_ISOC_AND_POSIX_THREADS, USE_WINDOWS_THREADS. dnl The choice --enable-threads=isoc+posix is available only on platforms that dnl have both the ISO C and the POSIX threads APIs. It has the effect of using dnl the ISO C API for most things and the POSIX API only for creating and dnl controlling threads (because there is no equivalent to pthread_atfork in dnl the ISO C API). dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with dnl libtool). dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for dnl programs that really need multithread functionality. The difference dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak dnl symbols, typically LIBTHREAD is empty whereas LIBMULTITHREAD is not. dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for dnl multithread-safe programs. dnl Since support for GNU pth was removed, $LTLIBTHREAD and $LIBTHREAD have the dnl same value, and similarly $LTLIBMULTITHREAD and $LIBMULTITHREAD have the dnl same value. Only system libraries are needed. AC_DEFUN([gl_THREADLIB_EARLY], [ AC_REQUIRE([gl_THREADLIB_EARLY_BODY]) ]) dnl The guts of gl_THREADLIB_EARLY. Needs to be expanded only once. AC_DEFUN([gl_THREADLIB_EARLY_BODY], [ dnl Ordering constraints: This macro modifies CPPFLAGS in a way that dnl influences the result of the autoconf tests that test for *_unlocked dnl declarations, on AIX 5 at least. Therefore it must come early. AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl AC_BEFORE([$0], [gl_ARGP])dnl AC_REQUIRE([AC_CANONICAL_HOST]) dnl _GNU_SOURCE is needed for pthread_rwlock_t on glibc systems. AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) dnl Check for multithreading. m4_ifdef([gl_THREADLIB_DEFAULT_NO], [m4_divert_text([DEFAULTS], [gl_use_threads_default=no])], [m4_divert_text([DEFAULTS], [gl_use_threads_default=])]) dnl gl_use_winpthreads_default defaults to "no", because in mingw 10, like dnl in mingw 5, the use of libwinpthread still makes test-pthread-tss crash. m4_divert_text([DEFAULTS], [gl_use_winpthreads_default=no]) dnl Don't display the --disable-threads option dnl - if the package builds one or more libraries, because libraries must dnl always be multithread-safe (as far as possible), dnl - if the package defines gl_THREADLIB_DEFAULT_NO, because the option dnl would then be a no-op. AC_ARG_ENABLE([threads], AS_HELP_STRING([[--enable-threads={isoc|posix|isoc+posix|windows}]], [specify multithreading API])m4_ifdef([LT_INIT], [], [m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [ AS_HELP_STRING([[--disable-threads]], [build without multithread safety])])]), [gl_use_threads=$enableval], [if test -n "$gl_use_threads_default"; then gl_use_threads="$gl_use_threads_default" else AS_CASE([$host_os], dnl Disable multithreading by default on Cygwin 1.5.x, because it has dnl bugs that lead to endless loops or crashes. See dnl . [cygwin*], [AS_CASE([$(uname -r)], [[1.[0-5].*]], [gl_use_threads=no], [gl_use_threads=yes]) ], dnl Obey gl_AVOID_WINPTHREAD on mingw. [mingw* | windows*], [AS_CASE([$gl_use_winpthreads_default], [yes], [gl_use_threads=posix], [no], [gl_use_threads=windows], [gl_use_threads=yes]) ], [gl_use_threads=yes]) fi ]) AS_CASE([$gl_use_threads], [yes | isoc | posix | isoc+posix], [ # For using or : gl_ANYTHREADLIB_EARLY ]) ]) dnl The guts of gl_THREADLIB. Needs to be expanded only once. AC_DEFUN([gl_THREADLIB_BODY], [ AC_REQUIRE([gl_THREADLIB_EARLY_BODY]) gl_threads_api=none LIBTHREAD= LTLIBTHREAD= LIBMULTITHREAD= LTLIBMULTITHREAD= AS_IF([test "$gl_use_threads" = no], [AC_DEFINE([AVOID_ANY_THREADS], [1], [Define if no multithread safety and no multithreading is desired.])], [ dnl Check whether the compiler and linker support weak declarations. gl_WEAK_SYMBOLS AS_CASE([$gl_cv_have_weak], [*yes], [ dnl If we use weak symbols to implement pthread_in_use / pth_in_use / dnl thread_in_use, we also need to test whether the ISO C 11 thrd_create dnl facility is in use. AC_CHECK_HEADERS_ONCE([threads.h]) : ]) AS_CASE([$gl_use_threads], [isoc | isoc+posix], [ AC_CHECK_HEADERS_ONCE([threads.h]) gl_have_isoc_threads="$ac_cv_header_threads_h" ]) AS_CASE([$gl_use_threads], [yes | posix | isoc+posix], [ gl_PTHREADLIB_BODY LIBTHREAD=$LIBPTHREAD LTLIBTHREAD=$LIBPTHREAD LIBMULTITHREAD=$LIBPMULTITHREAD LTLIBMULTITHREAD=$LIBPMULTITHREAD AS_IF([test $gl_pthread_api = yes], [ AS_IF([test "$gl_use_threads" = isoc+posix && test "$gl_have_isoc_threads" = yes], [ gl_threads_api="isoc+posix" AC_DEFINE([USE_ISOC_AND_POSIX_THREADS], [1], [Define if the combination of the ISO C and POSIX multithreading APIs can be used.]) LIBTHREAD= LTLIBTHREAD= ], [ gl_threads_api=posix AC_DEFINE([USE_POSIX_THREADS], [1], [Define if the POSIX multithreading library can be used.]) AS_IF([test -z "$LIBMULTITHREAD" && test -z "$LTLIBMULTITHREAD"], [ AC_DEFINE([USE_POSIX_THREADS_FROM_LIBC], [1], [Define if references to the POSIX multithreading library are satisfied by libc.]) ], [ AS_CASE([$gl_cv_have_weak], [*yes], [ AC_DEFINE([USE_POSIX_THREADS_WEAK], [1], [Define if references to the POSIX multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= ], [AS_CASE([$host_os], [freebsd* | dragonfly* | midnightbsd*], [ AS_IF([test "x$LIBTHREAD" != "x$LIBMULTITHREAD"], [ dnl If weak symbols cannot tell whether dnl pthread_create(), dnl pthread_key_create() dnl etc. will succeed, we need a runtime test. AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1], [Define if the pthread_in_use() detection is hard.]) ]) ]) ]) ]) ]) ]) ]) AS_IF([test $gl_threads_api = none], [ AS_IF([test "$gl_use_threads" = isoc && test "$gl_have_isoc_threads" = yes], [ gl_STDTHREADLIB_BODY LIBTHREAD=$LIBSTDTHREAD LTLIBTHREAD=$LIBSTDTHREAD LIBMULTITHREAD=$LIBSTDTHREAD LTLIBMULTITHREAD=$LIBSTDTHREAD gl_threads_api=isoc AC_DEFINE([USE_ISOC_THREADS], [1], [Define if the ISO C multithreading library can be used.]) ]) ]) AS_IF([test $gl_threads_api = none], [ # The "win32" is for backward compatibility. AS_CASE([$gl_use_threads], [yes | windows | win32], [AS_CASE([$host_os], [mingw* | windows*], [ gl_threads_api=windows AC_DEFINE([USE_WINDOWS_THREADS], [1], [Define if the native Windows multithreading API can be used.]) ]) ]) ]) ]) AC_MSG_CHECKING([for multithread API to use]) AC_MSG_RESULT([$gl_threads_api]) AC_SUBST([LIBTHREAD]) AC_SUBST([LTLIBTHREAD]) AC_SUBST([LIBMULTITHREAD]) AC_SUBST([LTLIBMULTITHREAD]) ]) AC_DEFUN([gl_THREADLIB], [ AC_REQUIRE([gl_THREADLIB_EARLY]) AC_REQUIRE([gl_THREADLIB_BODY]) ]) dnl gl_DISABLE_THREADS dnl ------------------ dnl Sets the gl_THREADLIB default so that threads are not used by default. dnl The user can still override it at installation time, by using the dnl configure option "--enable-threads". AC_DEFUN([gl_DISABLE_THREADS], [ m4_divert_text([INIT_PREPARE], [gl_use_threads_default=no]) ]) dnl gl_AVOID_WINPTHREAD dnl ------------------- dnl Sets the gl_THREADLIB default so that on mingw, a dependency to the dnl libwinpthread DLL (mingw-w64 winpthreads library) is avoided. dnl The user can still override it at installation time, by using the dnl configure option "--enable-threads=posix". dnl As of 2023, this is now the default. AC_DEFUN([gl_AVOID_WINPTHREAD], [ m4_divert_text([INIT_PREPARE], [gl_use_winpthreads_default=no]) ]) dnl ============================================================================ dnl Survey of platforms: dnl dnl Platform Available Compiler Supports test-lock dnl flavours option weak result dnl --------------- --------- --------- -------- --------- dnl Linux 2.4/glibc posix -lpthread Y OK dnl dnl Linux/glibc 2.34 posix Y OK dnl dnl GNU Hurd/glibc posix -lpthread Y OK dnl dnl Ubuntu 14.04 posix -pthread Y OK dnl dnl FreeBSD 5.3 posix -lc_r Y dnl posix -lkse ? Y dnl posix -lpthread ? Y dnl posix -lthr Y dnl dnl FreeBSD 5.2 posix -lc_r Y dnl posix -lkse Y dnl posix -lthr Y dnl dnl FreeBSD 4.0,4.10 posix -lc_r Y OK dnl dnl NetBSD 1.6 -- dnl dnl OpenBSD 3.4 posix -lpthread Y OK dnl dnl Mac OS X 10.[123] posix -lpthread Y OK dnl dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK dnl dnl HP-UX 11 posix -lpthread N (cc) OK dnl Y (gcc) dnl dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK dnl dnl Cygwin posix -lpthread Y OK dnl dnl Mingw windows N OK dnl dnl BeOS 5 -- dnl dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is dnl turned off: dnl OK if all three tests terminate OK, dnl 0.5 if the first test terminates OK but the second one loops endlessly, dnl 0.0 if the first test already loops endlessly. groff-1.24.1/gnulib_m4/fpieee.m40000644000175000017500000000440115153275164013212 00000000000000# fpieee.m4 # serial 2 dnl Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl IEEE 754 standardized three items: dnl - The formats of single-float and double-float - nowadays commonly dnl available as 'float' and 'double' in C and C++. dnl No autoconf test needed. dnl - The overflow and division by zero behaviour: The result are values dnl '±Inf' and 'NaN', rather than exceptions as it was before. dnl This file provides an autoconf macro for ensuring this behaviour of dnl floating-point operations. dnl - A set of conditions (overflow, underflow, inexact, etc.) which can dnl be configured to trigger an exception. dnl This cannot be done in a portable way: it depends on the compiler, dnl libc, kernel, and CPU. No autoconf macro is provided for this. dnl Ensure non-trapping behaviour of floating-point overflow and dnl floating-point division by zero. dnl (For integer overflow, see gcc's -ftrapv option; for integer division by dnl zero, see the autoconf macro in intdiv0.m4.) AC_DEFUN([gl_FP_IEEE], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) # IEEE behaviour is the default on all CPUs except Alpha and SH # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4 # and the GCC 4.1.2 manual). case "$host_cpu" in alpha*) # On Alpha systems, a compiler option provides the behaviour. # See the ieee(3) manual page, also available at # if test -n "$GCC"; then # GCC has the option -mieee. # For full IEEE compliance (rarely needed), use option -mieee-with-inexact. CPPFLAGS="$CPPFLAGS -mieee" else # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact. # For full IEEE compliance (rarely needed), use option -ieee_with_inexact. CPPFLAGS="$CPPFLAGS -ieee" fi ;; sh*) if test -n "$GCC"; then # GCC has the option -mieee. CPPFLAGS="$CPPFLAGS -mieee" fi ;; esac ]) groff-1.24.1/gnulib_m4/isnanl.m40000644000175000017500000001631115153275164013244 00000000000000# isnanl.m4 # serial 27 dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN_ONCE([gl_FUNC_ISNANL], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) ISNANL_LIBM= gl_HAVE_ISNANL_NO_LIBM if test $gl_cv_func_isnanl_no_libm = no; then gl_HAVE_ISNANL_IN_LIBM if test $gl_cv_func_isnanl_in_libm = yes; then ISNANL_LIBM=-lm fi fi dnl The variable gl_func_isnanl set here is used by isnan.m4. if test $gl_cv_func_isnanl_no_libm = yes || test -n "$ISNANL_LIBM"; then saved_LIBS="$LIBS" LIBS="$LIBS $ISNANL_LIBM" gl_FUNC_ISNANL_WORKS LIBS="$saved_LIBS" case "$gl_cv_func_isnanl_works" in *yes) gl_func_isnanl=yes ;; *) gl_func_isnanl=no; ISNANL_LIBM= ;; esac else gl_func_isnanl=no fi if test $gl_func_isnanl != yes; then HAVE_ISNANL=0 fi AC_SUBST([ISNANL_LIBM]) ]) AC_DEFUN([gl_FUNC_ISNANL_NO_LIBM], [ gl_HAVE_ISNANL_NO_LIBM gl_func_isnanl_no_libm=$gl_cv_func_isnanl_no_libm if test $gl_func_isnanl_no_libm = yes; then gl_FUNC_ISNANL_WORKS case "$gl_cv_func_isnanl_works" in *yes) ;; *) gl_func_isnanl_no_libm=no ;; esac fi if test $gl_func_isnanl_no_libm = yes; then AC_DEFINE([HAVE_ISNANL_IN_LIBC], [1], [Define if the isnan(long double) function is available in libc.]) fi ]) dnl Prerequisites of replacement isnanl definition. It does not need -lm. AC_DEFUN([gl_PREREQ_ISNANL], [ gl_LONG_DOUBLE_EXPONENT_LOCATION AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) ]) dnl Test whether isnanl() can be used without libm. AC_DEFUN([gl_HAVE_ISNANL_NO_LIBM], [ AC_CACHE_CHECK([whether isnan(long double) can be used without linking with libm], [gl_cv_func_isnanl_no_libm], [ AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanl # define isnanl(x) __builtin_isnan ((long double)(x)) #elif defined isnan # undef isnanl # define isnanl(x) isnan ((long double)(x)) #endif long double x;]], [[return isnanl (x);]])], [gl_cv_func_isnanl_no_libm=yes], [gl_cv_func_isnanl_no_libm=no]) ]) ]) dnl Test whether isnanl() can be used with libm. AC_DEFUN([gl_HAVE_ISNANL_IN_LIBM], [ AC_CACHE_CHECK([whether isnan(long double) can be used with libm], [gl_cv_func_isnanl_in_libm], [ saved_LIBS="$LIBS" LIBS="$LIBS -lm" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanl # define isnanl(x) __builtin_isnan ((long double)(x)) #elif defined isnan # undef isnanl # define isnanl(x) isnan ((long double)(x)) #endif long double x;]], [[return isnanl (x);]])], [gl_cv_func_isnanl_in_libm=yes], [gl_cv_func_isnanl_in_libm=no]) LIBS="$saved_LIBS" ]) ]) dnl Test whether isnanl() recognizes all canonical numbers which are neither dnl finite nor infinite. AC_DEFUN([gl_FUNC_ISNANL_WORKS], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gl_BIGENDIAN]) AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether isnanl works], [gl_cv_func_isnanl_works], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanl # define isnanl(x) __builtin_isnan ((long double)(x)) #elif defined isnan # undef isnanl # define isnanl(x) isnan ((long double)(x)) #endif #define NWORDS \ ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) typedef union { unsigned int word[NWORDS]; long double value; } memory_long_double; #define NaNl() (0.0L / 0.0L) int main () { int result = 0; if (!isnanl (NaNl ())) result |= 1; { memory_long_double m; unsigned int i; /* The isnanl function should be immune against changes in the sign bit and in the mantissa bits. The xor operation twiddles a bit that can only be a sign bit or a mantissa bit (since the exponent never extends to bit 31). */ m.value = NaNl (); m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1); for (i = 0; i < NWORDS; i++) m.word[i] |= 1; if (!isnanl (m.value)) result |= 1; } #if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE /* Representation of an 80-bit 'long double' as an initializer for a sequence of 'unsigned int' words. */ # ifdef WORDS_BIGENDIAN # define LDBL80_WORDS(exponent,manthi,mantlo) \ { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ (unsigned int) (mantlo) << 16 \ } # else # define LDBL80_WORDS(exponent,manthi,mantlo) \ { mantlo, manthi, exponent } # endif { /* Quiet NaN. */ static memory_long_double x = { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; if (!isnanl (x.value)) result |= 2; } { /* Signalling NaN. */ static memory_long_double x = { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; if (!isnanl (x.value)) result |= 2; } /* isnanl should return something even for noncanonical values. */ { /* Pseudo-NaN. */ static memory_long_double x = { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; if (isnanl (x.value) && !isnanl (x.value)) result |= 4; } { /* Pseudo-Infinity. */ static memory_long_double x = { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; if (isnanl (x.value) && !isnanl (x.value)) result |= 8; } { /* Pseudo-Zero. */ static memory_long_double x = { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; if (isnanl (x.value) && !isnanl (x.value)) result |= 16; } { /* Unnormalized number. */ static memory_long_double x = { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; if (isnanl (x.value) && !isnanl (x.value)) result |= 32; } { /* Pseudo-Denormal. */ static memory_long_double x = { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; if (isnanl (x.value) && !isnanl (x.value)) result |= 64; } #endif return result; }]])], [gl_cv_func_isnanl_works=yes], [gl_cv_func_isnanl_works=no], [case "$host_os" in mingw* | windows*) # Guess yes on mingw, no on MSVC. AC_EGREP_CPP([Known], [ #ifdef __MINGW32__ Known #endif ], [gl_cv_func_isnanl_works="guessing yes"], [gl_cv_func_isnanl_works="guessing no"]) ;; *) gl_cv_func_isnanl_works="guessing yes" ;; esac ]) ]) ]) groff-1.24.1/gnulib_m4/getopt.m40000644000175000017500000003123215153275164013261 00000000000000# getopt.m4 # serial 52 dnl Copyright (C) 2002-2006, 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. # Request a POSIX compliant getopt function. AC_DEFUN([gl_FUNC_GETOPT_POSIX], [ m4_divert_text([DEFAULTS], [gl_getopt_required=POSIX]) AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) AC_REQUIRE([gl_GETOPT_CHECK_HEADERS]) dnl Other modules can request the gnulib implementation of the getopt dnl functions unconditionally, by defining gl_REPLACE_GETOPT_ALWAYS. dnl argp.m4 does this. m4_ifdef([gl_REPLACE_GETOPT_ALWAYS], [ REPLACE_GETOPT=1 ], [ REPLACE_GETOPT=0 if test -n "$gl_replace_getopt"; then REPLACE_GETOPT=1 fi ]) GL_GENERATE_GETOPT_H=false GL_GENERATE_GETOPT_CDEFS_H=false if test $REPLACE_GETOPT = 1; then dnl Arrange for getopt.h to be created. gl_GETOPT_SUBSTITUTE_HEADER fi ]) # Request a POSIX compliant getopt function with GNU extensions (such as # options with optional arguments) and the functions getopt_long, # getopt_long_only. AC_DEFUN([gl_FUNC_GETOPT_GNU], [ dnl Set the variable gl_getopt_required, so that all invocations of dnl gl_GETOPT_CHECK_HEADERS in the scope of the current configure file dnl will check for getopt with GNU extensions. dnl This means that if one gnulib-tool invocation requests getopt-posix dnl and another gnulib-tool invocation requests getopt-gnu, it is as if dnl both had requested getopt-gnu. m4_divert_text([INIT_PREPARE], [gl_getopt_required=GNU]) dnl No need to invoke gl_FUNC_GETOPT_POSIX here; this is automatically dnl done through the module dependency getopt-gnu -> getopt-posix. ]) # Determine whether to replace the entire getopt facility. AC_DEFUN([gl_GETOPT_CHECK_HEADERS], [ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_REQUIRE([AC_PROG_AWK]) dnl for awk that supports ENVIRON dnl Persuade Solaris to declare optarg, optind, opterr, optopt. AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) gl_CHECK_NEXT_HEADERS([getopt.h]) if test $ac_cv_header_getopt_h = yes; then HAVE_GETOPT_H=1 else HAVE_GETOPT_H=0 fi AC_SUBST([HAVE_GETOPT_H]) gl_replace_getopt= dnl Test whether is available. if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then AC_CHECK_HEADERS([getopt.h], [], [gl_replace_getopt=yes]) fi dnl Test whether the function getopt_long is available. if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then AC_CHECK_FUNCS([getopt_long_only], [], [gl_replace_getopt=yes]) fi dnl POSIX 2008 does not specify leading '+' behavior, but see dnl https://austingroupbugs.net/view.php?id=191 for a recommendation on dnl the next version of POSIX. For now, we only guarantee leading '+' dnl behavior with getopt-gnu. if test -z "$gl_replace_getopt"; then AC_CACHE_CHECK([whether getopt is POSIX compatible], [gl_cv_func_getopt_posix], [ dnl Merging these three different test programs into a single one dnl would require a reset mechanism. On BSD systems, it can be done dnl through 'optreset'; on some others (glibc), it can be done by dnl setting 'optind' to 0; on others again (HP-UX, Solaris 9, dnl musl libc), there is no such mechanism. if test $cross_compiling = no; then dnl Sanity check. Succeeds everywhere (except on MSVC, dnl which lacks and getopt() entirely). AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include int main () { static char program[] = "program"; static char a[] = "-a"; static char foo[] = "foo"; static char bar[] = "bar"; char *argv[] = { program, a, foo, bar, NULL }; int c; c = getopt (4, argv, "ab"); if (!(c == 'a')) return 1; c = getopt (4, argv, "ab"); if (!(c == -1)) return 2; if (!(optind == 2)) return 3; return 0; } ]])], [gl_cv_func_getopt_posix=maybe], [gl_cv_func_getopt_posix=no]) if test $gl_cv_func_getopt_posix = maybe; then dnl Sanity check with '+'. Succeeds everywhere (except on MSVC, dnl which lacks and getopt() entirely). AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include int main () { static char program[] = "program"; static char donald[] = "donald"; static char p[] = "-p"; static char billy[] = "billy"; static char duck[] = "duck"; static char a[] = "-a"; static char bar[] = "bar"; char *argv[] = { program, donald, p, billy, duck, a, bar, NULL }; int c; c = getopt (7, argv, "+abp:q:"); if (!(c == -1)) return 4; if (!(strcmp (argv[0], "program") == 0)) return 5; if (!(strcmp (argv[1], "donald") == 0)) return 6; if (!(strcmp (argv[2], "-p") == 0)) return 7; if (!(strcmp (argv[3], "billy") == 0)) return 8; if (!(strcmp (argv[4], "duck") == 0)) return 9; if (!(strcmp (argv[5], "-a") == 0)) return 10; if (!(strcmp (argv[6], "bar") == 0)) return 11; if (!(optind == 1)) return 12; return 0; } ]])], [gl_cv_func_getopt_posix=maybe], [gl_cv_func_getopt_posix=no]) fi if test $gl_cv_func_getopt_posix = maybe; then dnl Detect Mac OS X 10.5, AIX 7.1, mingw bug. AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include int main () { static char program[] = "program"; static char ab[] = "-ab"; char *argv[3] = { program, ab, NULL }; if (getopt (2, argv, "ab:") != 'a') return 13; if (getopt (2, argv, "ab:") != '?') return 14; if (optopt != 'b') return 15; if (optind != 2) return 16; return 0; } ]])], [gl_cv_func_getopt_posix=yes], [gl_cv_func_getopt_posix=no]) fi else case "$host_os" in darwin* | aix* | mingw* | windows*) gl_cv_func_getopt_posix="guessing no";; *) gl_cv_func_getopt_posix="guessing yes";; esac fi ]) case "$gl_cv_func_getopt_posix" in *no) gl_replace_getopt=yes ;; esac fi if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_getopt_gnu], [# Even with POSIXLY_CORRECT, the GNU extension of leading '-' in the # optstring is necessary for programs like m4 that have POSIX-mandated # semantics for supporting options interspersed with files. # Also, since getopt_long is a GNU extension, we require optind=0. # Bash ties 'set -o posix' to a non-exported POSIXLY_CORRECT; # so take care to revert to the correct (non-)export state. dnl GNU Coding Standards currently allow awk but not env; besides, env dnl is ambiguous with environment values that contain newlines. gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }' case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" #include #include ]GL_NOCRASH[ ]], [[ int result = 0; nocrash_init(); /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw, and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, Solaris 10. */ { static char conftest[] = "conftest"; static char plus[] = "-+"; char *argv[3] = { conftest, plus, NULL }; opterr = 0; if (getopt (2, argv, "+a") != '?') result |= 1; } /* This code succeeds on glibc 2.8, mingw, and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11, Solaris 10, Cygwin 1.5.x. */ { static char program[] = "program"; static char p[] = "-p"; static char foo[] = "foo"; static char bar[] = "bar"; char *argv[] = { program, p, foo, bar, NULL }; optind = 1; if (getopt (4, argv, "p::") != 'p') result |= 2; else if (optarg != NULL) result |= 4; else if (getopt (4, argv, "p::") != -1) result |= 6; else if (optind != 2) result |= 8; } /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0. */ { static char program[] = "program"; static char foo[] = "foo"; static char p[] = "-p"; char *argv[] = { program, foo, p, NULL }; optind = 0; if (getopt (3, argv, "-p") != 1) result |= 16; else if (getopt (3, argv, "-p") != 'p') result |= 16; } /* This code fails on glibc 2.11. */ { static char program[] = "program"; static char b[] = "-b"; static char a[] = "-a"; char *argv[] = { program, b, a, NULL }; optind = opterr = 0; if (getopt (3, argv, "+:a:b") != 'b') result |= 32; else if (getopt (3, argv, "+:a:b") != ':') result |= 32; } /* This code dumps core on glibc 2.14. */ { static char program[] = "program"; static char w[] = "-W"; static char dummy[] = "dummy"; char *argv[] = { program, w, dummy, NULL }; optind = opterr = 1; if (getopt (3, argv, "W;") != 'W') result |= 64; } return result; ]])], [gl_cv_func_getopt_gnu=yes], [gl_cv_func_getopt_gnu=no], [dnl Cross compiling. dnl Assume the worst, even on glibc platforms. dnl But obey --enable-cross-guesses. gl_cv_func_getopt_gnu="$gl_cross_guess_normal" ]) case $gl_had_POSIXLY_CORRECT in exported) ;; yes) AS_UNSET([POSIXLY_CORRECT]); POSIXLY_CORRECT=1 ;; *) AS_UNSET([POSIXLY_CORRECT]) ;; esac ]) if test "$gl_cv_func_getopt_gnu" != yes; then gl_replace_getopt=yes else AC_CACHE_CHECK([for working GNU getopt_long function], [gl_cv_func_getopt_long_gnu], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include #include #include ]], [[static const struct option long_options[] = { { "xtremely-",no_argument, NULL, 1003 }, { "xtra", no_argument, NULL, 1001 }, { "xtreme", no_argument, NULL, 1002 }, { "xtremely", no_argument, NULL, 1003 }, { NULL, 0, NULL, 0 } }; /* This code fails on OpenBSD 5.0. */ { static char program[] = "program"; static char xtremel[] = "--xtremel"; char *argv[] = { program, xtremel, NULL }; int option_index; optind = 1; opterr = 0; if (getopt_long (2, argv, "", long_options, &option_index) != 1003) return 1; } return 0; ]])], [gl_cv_func_getopt_long_gnu=yes], [gl_cv_func_getopt_long_gnu=no], [dnl Cross compiling. Guess no on OpenBSD, yes otherwise. case "$host_os" in openbsd*) gl_cv_func_getopt_long_gnu="guessing no";; *) gl_cv_func_getopt_long_gnu="guessing yes";; esac ]) ]) case "$gl_cv_func_getopt_long_gnu" in *yes) ;; *) gl_replace_getopt=yes ;; esac fi fi ]) AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER], [ gl_CHECK_HEADER_SYS_CDEFS_H AC_DEFINE([__GETOPT_PREFIX], [[rpl_]], [Define to rpl_ if the getopt replacement functions and variables should be used.]) GL_GENERATE_GETOPT_H=true GL_GENERATE_GETOPT_CDEFS_H=true ]) groff-1.24.1/gnulib_m4/frexp.m40000644000175000017500000001233015153275164013101 00000000000000# frexp.m4 # serial 21 dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_FREXP], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) AC_REQUIRE([gl_CHECK_FREXP_NO_LIBM]) FREXP_LIBM= if test $gl_cv_func_frexp_no_libm = no; then AC_CACHE_CHECK([whether frexp() can be used with libm], [gl_cv_func_frexp_in_libm], [ saved_LIBS="$LIBS" LIBS="$LIBS -lm" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include double x;]], [[int e; return frexp (x, &e) > 0;]])], [gl_cv_func_frexp_in_libm=yes], [gl_cv_func_frexp_in_libm=no]) LIBS="$saved_LIBS" ]) if test $gl_cv_func_frexp_in_libm = yes; then FREXP_LIBM=-lm fi fi if test $gl_cv_func_frexp_no_libm = yes \ || test $gl_cv_func_frexp_in_libm = yes; then saved_LIBS="$LIBS" LIBS="$LIBS $FREXP_LIBM" gl_FUNC_FREXP_WORKS LIBS="$saved_LIBS" case "$gl_cv_func_frexp_works" in *yes) gl_func_frexp=yes ;; *) gl_func_frexp=no; REPLACE_FREXP=1; FREXP_LIBM= ;; esac else gl_func_frexp=no fi if test $gl_func_frexp = yes; then AC_DEFINE([HAVE_FREXP], [1], [Define if the frexp() function is available and works.]) fi AC_SUBST([FREXP_LIBM]) ]) AC_DEFUN([gl_FUNC_FREXP_NO_LIBM], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) AC_REQUIRE([gl_CHECK_FREXP_NO_LIBM]) if test $gl_cv_func_frexp_no_libm = yes; then gl_FUNC_FREXP_WORKS case "$gl_cv_func_frexp_works" in *yes) gl_func_frexp_no_libm=yes ;; *) gl_func_frexp_no_libm=no; REPLACE_FREXP=1 ;; esac else gl_func_frexp_no_libm=no dnl Set REPLACE_FREXP here because the system may have frexp in libm. REPLACE_FREXP=1 fi if test $gl_func_frexp_no_libm = yes; then AC_DEFINE([HAVE_FREXP_IN_LIBC], [1], [Define if the frexp() function is available in libc.]) fi ]) dnl Test whether frexp() can be used without linking with libm. dnl Set gl_cv_func_frexp_no_libm to 'yes' or 'no' accordingly. AC_DEFUN([gl_CHECK_FREXP_NO_LIBM], [ AC_CACHE_CHECK([whether frexp() can be used without linking with libm], [gl_cv_func_frexp_no_libm], [ AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include double x;]], [[int e; return frexp (x, &e) > 0;]])], [gl_cv_func_frexp_no_libm=yes], [gl_cv_func_frexp_no_libm=no]) ]) ]) dnl Test whether frexp() works also on denormalized numbers (this fails e.g. on dnl NetBSD 3.0), on infinite numbers (this fails e.g. on mingw), and on negative dnl zero (this fails e.g. on NetBSD 4.99 and mingw). AC_DEFUN([gl_FUNC_FREXP_WORKS], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CHECK_DECLS_ONCE([alarm]) AC_CACHE_CHECK([whether frexp works], [gl_cv_func_frexp_works], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include #if HAVE_DECL_ALARM # include # include #endif /* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. ICC 10.0 has a bug when optimizing the expression -zero. The expression -DBL_MIN * DBL_MIN does not work when cross-compiling to PowerPC on Mac OS X 10.5. */ #if defined __hpux || defined __ICC static double compute_minus_zero (void) { return -DBL_MIN * DBL_MIN; } # define minus_zero compute_minus_zero () #else double minus_zero = -0.0; #endif int main() { int result = 0; int i; volatile double x; double zero = 0.0; #if HAVE_DECL_ALARM /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite number. Let the test fail in this case. */ signal (SIGALRM, SIG_DFL); alarm (5); #endif /* Test on denormalized numbers. */ for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5) ; if (x > 0.0) { int exp; double y = frexp (x, &exp); /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022. On NetBSD: y = 0.75. Correct: y = 0.5. */ if (y != 0.5) result |= 1; } /* Test on infinite numbers. */ x = 1.0 / zero; { int exp; double y = frexp (x, &exp); if (y != x) result |= 2; } /* Test on negative zero. */ x = minus_zero; { int exp; double y = frexp (x, &exp); double x1 = x; if (memcmp (&y, &x1, sizeof x1)) result |= 4; } return result; }]])], [gl_cv_func_frexp_works=yes], [gl_cv_func_frexp_works=no], [case "$host_os" in netbsd*) gl_cv_func_frexp_works="guessing no" ;; # Guess yes with MSVC, no with mingw. windows*-msvc*) gl_cv_func_frexp_works="guessing yes" ;; mingw* | windows*) AC_EGREP_CPP([Good], [ #ifdef _MSC_VER Good #endif ], [gl_cv_func_frexp_works="guessing yes"], [gl_cv_func_frexp_works="guessing no"]) ;; *) gl_cv_func_frexp_works="guessing yes" ;; esac ]) ]) ]) groff-1.24.1/gnulib_m4/mbchar.m40000644000175000017500000000074315153275164013216 00000000000000# mbchar.m4 # serial 9 dnl Copyright (C) 2005-2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl autoconf tests required for use of mbchar.m4 dnl From Bruno Haible. AC_DEFUN([gl_MBCHAR], [ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) ]) groff-1.24.1/gnulib_m4/visibility.m40000644000175000017500000000671615153275164014157 00000000000000# visibility.m4 # serial 9 dnl Copyright (C) 2005, 2008, 2010-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Bruno Haible. dnl Tests whether the compiler supports the command-line option dnl -fvisibility=hidden and the function and variable attributes dnl __attribute__((__visibility__("hidden"))) and dnl __attribute__((__visibility__("default"))). dnl Does *not* test for __visibility__("protected") - which has tricky dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on dnl Mac OS X. dnl Does *not* test for __visibility__("internal") - which has processor dnl dependent semantics. dnl Does *not* test for #pragma GCC visibility push(hidden) - which is dnl "really only recommended for legacy code". dnl Set the variable CFLAG_VISIBILITY. dnl Defines and sets the variable HAVE_VISIBILITY. AC_DEFUN([gl_VISIBILITY], [ AC_REQUIRE([AC_PROG_CC]) CFLAG_VISIBILITY= HAVE_VISIBILITY=0 if test -n "$GCC"; then dnl First, check whether -Werror can be added to the command line, or dnl whether it leads to an error because of some other option that the dnl user has put into $CC $CFLAGS $CPPFLAGS. AC_CACHE_CHECK([whether the -Werror option is usable], [gl_cv_cc_vis_werror], [gl_saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Werror" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[]], [[]])], [gl_cv_cc_vis_werror=yes], [gl_cv_cc_vis_werror=no]) CFLAGS="$gl_saved_CFLAGS" ]) dnl Now check whether visibility declarations are supported. AC_CACHE_CHECK([for simple visibility declarations], [gl_cv_cc_visibility], [gl_saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden" dnl We use the option -Werror and a function dummyfunc, because on some dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning dnl "visibility attribute not supported in this configuration; ignored" dnl at the first function definition in every compilation unit, and we dnl don't want to use the option in this case. if test $gl_cv_cc_vis_werror = yes; then CFLAGS="$CFLAGS -Werror" fi AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[extern __attribute__((__visibility__("hidden"))) int hiddenvar; extern __attribute__((__visibility__("default"))) int exportedvar; extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); extern __attribute__((__visibility__("default"))) int exportedfunc (void); void dummyfunc (void); int hiddenvar; int exportedvar; int hiddenfunc (void) { return 51; } int exportedfunc (void) { return 1225736919; } void dummyfunc (void) {} ]], [[]])], [gl_cv_cc_visibility=yes], [gl_cv_cc_visibility=no]) CFLAGS="$gl_saved_CFLAGS" ]) if test $gl_cv_cc_visibility = yes; then CFLAG_VISIBILITY="-fvisibility=hidden" HAVE_VISIBILITY=1 fi fi AC_SUBST([CFLAG_VISIBILITY]) AC_SUBST([HAVE_VISIBILITY]) AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY], [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.]) ]) groff-1.24.1/gnulib_m4/warn-on-use.m40000644000175000017500000000561515153275164014140 00000000000000# warn-on-use.m4 # serial 11 dnl Copyright (C) 2010-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. # gl_WARN_ON_USE_PREPARE(INCLUDES, NAMES) # --------------------------------------- # If the module 'posixcheck' is in use: # # For each whitespace-separated element in the list of NAMES, define # HAVE_RAW_DECL_name if the function has a declaration among INCLUDES # even after being undefined as a macro. # # See warn-on-use.h for some hints on how to poison function names, as # well as ideas on poisoning global variables and macros. NAMES may # include global variables, but remember that only functions work with # _GL_WARN_ON_USE. Typically, INCLUDES only needs to list a single # header, but if the replacement header pulls in other headers because # some systems declare functions in the wrong header, then INCLUDES # should do likewise. # # It is generally safe to assume declarations for functions declared # in the intersection of C89 and C11 (such as printf) without # needing gl_WARN_ON_USE_PREPARE. AC_DEFUN([gl_WARN_ON_USE_PREPARE], [ m4_ifdef([gl_POSIXCHECK], [m4_foreach_w([gl_decl], [$2], [AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])), [Define to 1 if ]m4_defn([gl_decl])[ is declared even after undefining macros.])])dnl for gl_func in m4_flatten([$2]); do AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl dnl As a workaround to implicit built-in function declarations in dnl clang (e.g. strndup), reference ac_compile_for_check_decl instead dnl of ac_compile. If, for whatever reason, the override of AC_PROG_CC dnl in zzgnulib.m4 is inactive, use the original ac_compile. ac_saved_ac_compile="$ac_compile" if test -n "$ac_compile_for_check_decl"; then ac_compile="$ac_compile_for_check_decl" fi AC_CACHE_CHECK([whether $gl_func is declared without a macro], [gl_Symbol], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1], [[#undef $gl_func (void) $gl_func;]])], [AS_VAR_SET([gl_Symbol], [yes])], [AS_VAR_SET([gl_Symbol], [no])])]) ac_compile="$ac_saved_ac_compile" AS_VAR_IF([gl_Symbol], [yes], [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1]) dnl Shortcut for an AC_CHECK_DECL invocation that may come later: dnl If the raw declaration exists with the given includes, then dnl AC_CHECK_DECL with its many includes would see it as well. dnl So, set a cache variable to allow skipping any later dnl AC_CHECK_DECL invocation for $gl_func. eval "ac_cv_have_decl_$gl_func=yes" ]) AS_VAR_POPDEF([gl_Symbol])dnl done ]) ]) groff-1.24.1/gnulib_m4/errno_h.m40000644000175000017500000000323115153275164013411 00000000000000# errno_h.m4 # serial 19 dnl Copyright (C) 2004, 2006, 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_PREREQ([2.61]) AC_DEFUN_ONCE([gl_HEADER_ERRNO_H], [ AC_REQUIRE([AC_PROG_CC]) dnl Through the dependency on module extensions-aix, _LINUX_SOURCE_COMPAT dnl gets defined already before this macro gets invoked. This persuades dnl AIX 7.3 errno.h to assign ENOTEMPTY a value different than EEXIST. AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [ AC_EGREP_CPP([booboo],[ #include #if !defined ETXTBSY booboo #endif #if !defined ENOMSG booboo #endif #if !defined EIDRM booboo #endif #if !defined ENOLINK booboo #endif #if !defined EPROTO booboo #endif #if !defined EMULTIHOP booboo #endif #if !defined EBADMSG booboo #endif #if !defined EOVERFLOW booboo #endif #if !defined ENOTSUP booboo #endif #if !defined ENETRESET booboo #endif #if !defined ECONNABORTED booboo #endif #if !defined ESTALE booboo #endif #if !defined EDQUOT booboo #endif #if !defined ECANCELED booboo #endif #if !defined EOWNERDEAD booboo #endif #if !defined ENOTRECOVERABLE booboo #endif #if !defined EILSEQ booboo #endif #if !defined ESOCKTNOSUPPORT booboo #endif ], [gl_cv_header_errno_h_complete=no], [gl_cv_header_errno_h_complete=yes]) ]) if test $gl_cv_header_errno_h_complete = yes; then GL_GENERATE_ERRNO_H=false else gl_NEXT_HEADERS([errno.h]) GL_GENERATE_ERRNO_H=true fi ]) groff-1.24.1/gnulib_m4/locale_h.m40000644000175000017500000001632315153275164013531 00000000000000# locale_h.m4 # serial 39 dnl Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN_ONCE([gl_LOCALE_H], [ dnl Ensure to expand the default settings once only, before all statements dnl that occur in other macros. AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) dnl Persuade glibc to define locale_t and the int_p_*, int_n_* dnl members of 'struct lconv'. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) dnl If is replaced, then must also be replaced. AC_REQUIRE([gl_STDDEF_H]) AC_REQUIRE([gl_LOCALE_T]) dnl On native Windows, there is a type '_locale_t' that can be used to dnl define locale_t. AC_CACHE_CHECK([whether locale.h defines _locale_t], [gl_cv_header_locale_has_windows_locale_t], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include _locale_t x;]], [[]])], [gl_cv_header_locale_has_windows_locale_t=yes], [gl_cv_header_locale_has_windows_locale_t=no]) ]) if test $gl_cv_header_locale_has_windows_locale_t = yes; then HAVE_WINDOWS_LOCALE_T=1 AC_DEFINE([HAVE_WINDOWS_LOCALE_T], [1], [Define to 1 if defines the _locale_t type.]) else HAVE_WINDOWS_LOCALE_T=0 fi AC_SUBST([HAVE_WINDOWS_LOCALE_T]) dnl Solaris 11.0 defines the int_p_*, int_n_* members of 'struct lconv' dnl only if _LCONV_C99 is defined. AC_REQUIRE([AC_CANONICAL_HOST]) case "$host_os" in solaris*) AC_DEFINE([_LCONV_C99], [1], [Define to 1 on Solaris.]) ;; esac AC_CACHE_CHECK([whether locale.h conforms to POSIX:2001], [gl_cv_header_locale_h_posix2001], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include int x = LC_MESSAGES; int y = sizeof (((struct lconv *) 0)->decimal_point);]], [[]])], [gl_cv_header_locale_h_posix2001=yes], [gl_cv_header_locale_h_posix2001=no])]) dnl Check whether 'struct lconv' is complete. dnl Bionic libc's 'struct lconv' is just a dummy. dnl On OpenBSD 4.9, HP-UX 11, Solaris 9, Cygwin 1.5.x, mingw, MSVC 9, dnl it lacks the int_p_* and int_n_* members. AC_CACHE_CHECK([whether struct lconv is properly defined], [gl_cv_sys_struct_lconv_ok], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include struct lconv l; int x = sizeof (l.decimal_point); int y = sizeof (l.int_p_cs_precedes);]], [[]])], [gl_cv_sys_struct_lconv_ok=yes], [gl_cv_sys_struct_lconv_ok=no]) ]) if test $gl_cv_sys_struct_lconv_ok = no; then dnl On native Windows with MSVC, merely define these member names as macros. dnl This avoids trouble in C++ mode. case "$host_os" in windows*-msvc*) ;; mingw* | windows*) AC_EGREP_CPP([Special], [ #ifdef _MSC_VER Special #endif ], [], [REPLACE_STRUCT_LCONV=1]) ;; *) REPLACE_STRUCT_LCONV=1 ;; esac fi dnl is always overridden, because of GNULIB_POSIXCHECK. gl_NEXT_HEADERS([locale.h]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[#include /* Some systems provide declarations in a non-standard header. */ #if HAVE_XLOCALE_H # include #endif ]], [setlocale newlocale duplocale freelocale getlocalename_l]) ]) dnl Checks to determine whether the system has the locale_t type, dnl and how to obtain it. AC_DEFUN([gl_LOCALE_T], [ dnl Persuade glibc and Solaris to define locale_t. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) dnl Check whether use of locale_t requires inclusion of , dnl e.g. on Mac OS X 10.5. If does not define locale_t by dnl itself, we assume that will do so. AC_CACHE_CHECK([whether locale.h defines locale_t], [gl_cv_header_locale_has_locale_t], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include locale_t x;]], [[]])], [gl_cv_header_locale_has_locale_t=yes], [gl_cv_header_locale_has_locale_t=no]) ]) dnl Check for . AC_CHECK_HEADERS_ONCE([xlocale.h]) if test $ac_cv_header_xlocale_h = yes; then HAVE_XLOCALE_H=1 if test $gl_cv_header_locale_has_locale_t = yes; then gl_cv_header_locale_h_needs_xlocale_h=no else gl_cv_header_locale_h_needs_xlocale_h=yes fi HAVE_LOCALE_T=1 else HAVE_XLOCALE_H=0 gl_cv_header_locale_h_needs_xlocale_h=no if test $gl_cv_header_locale_has_locale_t = yes; then HAVE_LOCALE_T=1 else HAVE_LOCALE_T=0 fi fi AC_SUBST([HAVE_XLOCALE_H]) AC_SUBST([HAVE_LOCALE_T]) ]) # gl_LOCALE_MODULE_INDICATOR([modulename]) # sets the shell variable that indicates the presence of the given module # to a C preprocessor expression that will evaluate to 1. # This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_LOCALE_MODULE_INDICATOR], [ dnl Ensure to expand the default settings once only. gl_LOCALE_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) # Initializes the default values for AC_SUBSTed shell variables. # This macro must not be AC_REQUIREd. It must only be invoked, and only # outside of macros or in macros that are not AC_REQUIREd. AC_DEFUN([gl_LOCALE_H_REQUIRE_DEFAULTS], [ m4_defun(GL_MODULE_INDICATOR_PREFIX[_LOCALE_H_MODULE_INDICATOR_DEFAULTS], [ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALECONV]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETLOCALE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETLOCALE_NULL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NEWLOCALE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUPLOCALE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREELOCALE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOCALENAME_L]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOCALENAME_L_UNSAFE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALENAME_UNSAFE]) ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_LOCALE_H_MODULE_INDICATOR_DEFAULTS]) AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) ]) AC_DEFUN([gl_LOCALE_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. HAVE_NEWLOCALE=1; AC_SUBST([HAVE_NEWLOCALE]) HAVE_DUPLOCALE=1; AC_SUBST([HAVE_DUPLOCALE]) HAVE_FREELOCALE=1; AC_SUBST([HAVE_FREELOCALE]) HAVE_GETLOCALENAME_L=1; AC_SUBST([HAVE_GETLOCALENAME_L]) REPLACE_LOCALECONV=0; AC_SUBST([REPLACE_LOCALECONV]) REPLACE_SETLOCALE=0; AC_SUBST([REPLACE_SETLOCALE]) REPLACE_NEWLOCALE=0; AC_SUBST([REPLACE_NEWLOCALE]) REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE]) REPLACE_FREELOCALE=0; AC_SUBST([REPLACE_FREELOCALE]) REPLACE_GETLOCALENAME_L=0; AC_SUBST([REPLACE_GETLOCALENAME_L]) REPLACE_STRUCT_LCONV=0; AC_SUBST([REPLACE_STRUCT_LCONV]) LOCALENAME_ENHANCE_LOCALE_FUNCS=0; AC_SUBST([LOCALENAME_ENHANCE_LOCALE_FUNCS]) ]) groff-1.24.1/gnulib_m4/unistd_h.m40000644000175000017500000003473515153275164013607 00000000000000# unistd_h.m4 # serial 97 dnl Copyright (C) 2006-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl Written by Simon Josefsson, Bruno Haible. AC_DEFUN_ONCE([gl_UNISTD_H], [ dnl Ensure to expand the default settings once only, before all statements dnl that occur in other macros. AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([unistd.h]) if test $ac_cv_header_unistd_h = yes; then HAVE_UNISTD_H=1 else HAVE_UNISTD_H=0 fi AC_SUBST([HAVE_UNISTD_H]) dnl Ensure the type pid_t gets defined. AC_REQUIRE([AC_TYPE_PID_T]) dnl Determine WINDOWS_64_BIT_OFF_T. AC_REQUIRE([gl_TYPE_OFF_T]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[ #if HAVE_UNISTD_H # include #endif /* Some systems declare various items in the wrong headers. */ #if !(defined __GLIBC__ && !defined __UCLIBC__) # include # include # include # if defined _WIN32 && ! defined __CYGWIN__ # include # endif #endif ]], [access chdir chown copy_file_range dup dup2 dup3 environ euidaccess execl execle execlp execv execve execvp execvpe faccessat fchdir fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize getentropy getgroups gethostname getlogin getlogin_r getpagesize getpass getusershell setusershell endusershell group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite readlink readlinkat rmdir sethostname sleep symlink symlinkat truncate ttyname_r unlink unlinkat usleep]) AC_REQUIRE([AC_C_RESTRICT]) AC_CHECK_DECLS_ONCE([execvpe]) if test $ac_cv_have_decl_execvpe = no; then HAVE_DECL_EXECVPE=0 fi ]) # gl_UNISTD_MODULE_INDICATOR([modulename]) # sets the shell variable that indicates the presence of the given module # to a C preprocessor expression that will evaluate to 1. # This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_UNISTD_MODULE_INDICATOR], [ dnl Ensure to expand the default settings once only. gl_UNISTD_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) # Initializes the default values for AC_SUBSTed shell variables. # This macro must not be AC_REQUIREd. It must only be invoked, and only # outside of macros or in macros that are not AC_REQUIREd. AC_DEFUN([gl_UNISTD_H_REQUIRE_DEFAULTS], [ m4_defun(GL_MODULE_INDICATOR_PREFIX[_UNISTD_H_MODULE_INDICATOR_DEFAULTS], [ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACCESS]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CHDIR]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CHOWN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CLOSE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPY_FILE_RANGE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUP2]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUP3]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ENVIRON]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EUIDACCESS]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECLE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECLP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECV]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECVE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECVP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECVPE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FACCESSAT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCHDIR]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCHOWNAT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FDATASYNC]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSYNC]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTRUNCATE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETCWD]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETDOMAINNAME]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETDTABLESIZE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETENTROPY]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETGROUPS]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETHOSTNAME]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOGIN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOGIN_R]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETOPT_POSIX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPAGESIZE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPASS]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPASS_GNU]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETUSERSHELL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GROUP_MEMBER]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISATTY]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LCHOWN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LINK]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LINKAT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LSEEK]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PIPE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PIPE2]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PREAD]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PWRITE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_READ]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_READLINK]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_READLINKAT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RMDIR]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETHOSTNAME]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SLEEP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SYMLINK]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SYMLINKAT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCATE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TTYNAME_R]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_GETOPT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_NONBLOCKING]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_SIGPIPE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNLINK]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNLINKAT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_USLEEP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WRITE]) dnl Support Microsoft deprecated alias function names by default. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_ACCESS], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_CHDIR], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_CLOSE], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_DUP], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_DUP2], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECL], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECLE], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECLP], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECV], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECVE], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECVP], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECVPE], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_GETCWD], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_GETPID], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_ISATTY], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_LSEEK], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_READ], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_RMDIR], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_SWAB], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_UNLINK], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_WRITE], [1]) ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_UNISTD_H_MODULE_INDICATOR_DEFAULTS]) AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) ]) AC_DEFUN([gl_UNISTD_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. HAVE_CHOWN=1; AC_SUBST([HAVE_CHOWN]) HAVE_COPY_FILE_RANGE=1; AC_SUBST([HAVE_COPY_FILE_RANGE]) HAVE_DUP3=1; AC_SUBST([HAVE_DUP3]) HAVE_EUIDACCESS=1; AC_SUBST([HAVE_EUIDACCESS]) HAVE_EXECVPE=1; AC_SUBST([HAVE_EXECVPE]) HAVE_FACCESSAT=1; AC_SUBST([HAVE_FACCESSAT]) HAVE_FCHDIR=1; AC_SUBST([HAVE_FCHDIR]) HAVE_FCHOWNAT=1; AC_SUBST([HAVE_FCHOWNAT]) HAVE_FDATASYNC=1; AC_SUBST([HAVE_FDATASYNC]) HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC]) HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE]) HAVE_GETENTROPY=1; AC_SUBST([HAVE_GETENTROPY]) HAVE_GETGROUPS=1; AC_SUBST([HAVE_GETGROUPS]) HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME]) HAVE_GETLOGIN=1; AC_SUBST([HAVE_GETLOGIN]) HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) HAVE_GETPASS=1; AC_SUBST([HAVE_GETPASS]) HAVE_GROUP_MEMBER=1; AC_SUBST([HAVE_GROUP_MEMBER]) HAVE_LCHOWN=1; AC_SUBST([HAVE_LCHOWN]) HAVE_LINK=1; AC_SUBST([HAVE_LINK]) HAVE_LINKAT=1; AC_SUBST([HAVE_LINKAT]) HAVE_PIPE=1; AC_SUBST([HAVE_PIPE]) HAVE_PIPE2=1; AC_SUBST([HAVE_PIPE2]) HAVE_PREAD=1; AC_SUBST([HAVE_PREAD]) HAVE_PWRITE=1; AC_SUBST([HAVE_PWRITE]) HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) HAVE_READLINKAT=1; AC_SUBST([HAVE_READLINKAT]) HAVE_SETHOSTNAME=1; AC_SUBST([HAVE_SETHOSTNAME]) HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) HAVE_SYMLINK=1; AC_SUBST([HAVE_SYMLINK]) HAVE_SYMLINKAT=1; AC_SUBST([HAVE_SYMLINKAT]) HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT]) HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP]) HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) HAVE_DECL_EXECVPE=1; AC_SUBST([HAVE_DECL_EXECVPE]) HAVE_DECL_FCHDIR=1; AC_SUBST([HAVE_DECL_FCHDIR]) HAVE_DECL_FDATASYNC=1; AC_SUBST([HAVE_DECL_FDATASYNC]) HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME]) HAVE_DECL_GETLOGIN=1; AC_SUBST([HAVE_DECL_GETLOGIN]) HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE]) HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL]) HAVE_DECL_SETHOSTNAME=1; AC_SUBST([HAVE_DECL_SETHOSTNAME]) HAVE_DECL_TRUNCATE=1; AC_SUBST([HAVE_DECL_TRUNCATE]) HAVE_DECL_TTYNAME_R=1; AC_SUBST([HAVE_DECL_TTYNAME_R]) HAVE_OS_H=0; AC_SUBST([HAVE_OS_H]) HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H]) REPLACE_ACCESS=0; AC_SUBST([REPLACE_ACCESS]) REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN]) REPLACE_CLOSE=0; AC_SUBST([REPLACE_CLOSE]) REPLACE_COPY_FILE_RANGE=0; AC_SUBST([REPLACE_COPY_FILE_RANGE]) REPLACE_DUP=0; AC_SUBST([REPLACE_DUP]) REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2]) REPLACE_DUP3=0; AC_SUBST([REPLACE_DUP3]) REPLACE_EXECL=0; AC_SUBST([REPLACE_EXECL]) REPLACE_EXECLE=0; AC_SUBST([REPLACE_EXECLE]) REPLACE_EXECLP=0; AC_SUBST([REPLACE_EXECLP]) REPLACE_EXECV=0; AC_SUBST([REPLACE_EXECV]) REPLACE_EXECVE=0; AC_SUBST([REPLACE_EXECVE]) REPLACE_EXECVP=0; AC_SUBST([REPLACE_EXECVP]) REPLACE_EXECVPE=0; AC_SUBST([REPLACE_EXECVPE]) REPLACE_FACCESSAT=0; AC_SUBST([REPLACE_FACCESSAT]) REPLACE_FCHDIR=0; AC_SUBST([REPLACE_FCHDIR]) REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT]) REPLACE_FDATASYNC=0; AC_SUBST([REPLACE_FDATASYNC]) REPLACE_FTRUNCATE=0; AC_SUBST([REPLACE_FTRUNCATE]) REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD]) REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME]) REPLACE_GETDTABLESIZE=0; AC_SUBST([REPLACE_GETDTABLESIZE]) REPLACE_GETENTROPY=0; AC_SUBST([REPLACE_GETENTROPY]) REPLACE_GETLOGIN=0; AC_SUBST([REPLACE_GETLOGIN]) REPLACE_GETLOGIN_R=0; AC_SUBST([REPLACE_GETLOGIN_R]) REPLACE_GETGROUPS=0; AC_SUBST([REPLACE_GETGROUPS]) REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE]) REPLACE_GETPASS=0; AC_SUBST([REPLACE_GETPASS]) REPLACE_GETPASS_FOR_GETPASS_GNU=0; AC_SUBST([REPLACE_GETPASS_FOR_GETPASS_GNU]) REPLACE_GETUSERSHELL=0; AC_SUBST([REPLACE_GETUSERSHELL]) REPLACE_ISATTY=0; AC_SUBST([REPLACE_ISATTY]) REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN]) REPLACE_LINK=0; AC_SUBST([REPLACE_LINK]) REPLACE_LINKAT=0; AC_SUBST([REPLACE_LINKAT]) REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK]) REPLACE_PIPE2=0; AC_SUBST([REPLACE_PIPE2]) REPLACE_PREAD=0; AC_SUBST([REPLACE_PREAD]) REPLACE_PWRITE=0; AC_SUBST([REPLACE_PWRITE]) REPLACE_READ=0; AC_SUBST([REPLACE_READ]) REPLACE_READLINK=0; AC_SUBST([REPLACE_READLINK]) REPLACE_READLINKAT=0; AC_SUBST([REPLACE_READLINKAT]) REPLACE_RMDIR=0; AC_SUBST([REPLACE_RMDIR]) REPLACE_SETHOSTNAME=0; AC_SUBST([REPLACE_SETHOSTNAME]) REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP]) REPLACE_SYMLINK=0; AC_SUBST([REPLACE_SYMLINK]) REPLACE_SYMLINKAT=0; AC_SUBST([REPLACE_SYMLINKAT]) REPLACE_TRUNCATE=0; AC_SUBST([REPLACE_TRUNCATE]) REPLACE_TTYNAME_R=0; AC_SUBST([REPLACE_TTYNAME_R]) REPLACE_UNLINK=0; AC_SUBST([REPLACE_UNLINK]) REPLACE_UNLINKAT=0; AC_SUBST([REPLACE_UNLINKAT]) REPLACE_USLEEP=0; AC_SUBST([REPLACE_USLEEP]) REPLACE_WRITE=0; AC_SUBST([REPLACE_WRITE]) UNISTD_H_HAVE_SYS_RANDOM_H=0; AC_SUBST([UNISTD_H_HAVE_SYS_RANDOM_H]) UNISTD_H_HAVE_WINSOCK2_H=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H]) UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS]) ]) groff-1.24.1/gnulib_m4/mbrtowc.m40000644000175000017500000005322615153275164013443 00000000000000# mbrtowc.m4 # serial 47 dnl Copyright (C) 2001-2002, 2004-2005, 2008-2026 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_MBRTOWC], [ AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) AC_REQUIRE([gl_PTHREADLIB]) AC_CHECK_HEADERS_ONCE([threads.h]) AC_REQUIRE([AC_TYPE_MBSTATE_T]) gl_MBSTATE_T_BROKEN AC_CHECK_FUNCS_ONCE([mbrtowc]) if test $ac_cv_func_mbrtowc = no; then HAVE_MBRTOWC=0 AC_CHECK_DECLS([mbrtowc],,, [[ #include ]]) if test $ac_cv_have_decl_mbrtowc = yes; then dnl On Minix 3.1.8, the system's declares mbrtowc() although dnl it does not have the function. Avoid a collision with gnulib's dnl replacement. REPLACE_MBRTOWC=1 fi else if test $REPLACE_MBSTATE_T = 1; then REPLACE_MBRTOWC=1 else gl_MBRTOWC_NULL_ARG1 gl_MBRTOWC_RETVAL gl_MBRTOWC_NUL_RETVAL gl_MBRTOWC_STORES_INCOMPLETE gl_MBRTOWC_EMPTY_INPUT gl_MBRTOWC_C_LOCALE case "$gl_cv_func_mbrtowc_null_arg1" in *yes) ;; *) AC_DEFINE([MBRTOWC_NULL_ARG1_BUG], [1], [Define if the mbrtowc function has the NULL pwc argument bug.]) REPLACE_MBRTOWC=1 ;; esac case "$gl_cv_func_mbrtowc_retval" in *yes) ;; *) AC_DEFINE([MBRTOWC_RETVAL_BUG], [1], [Define if the mbrtowc function returns a wrong return value.]) REPLACE_MBRTOWC=1 ;; esac case "$gl_cv_func_mbrtowc_nul_retval" in *yes) ;; *) AC_DEFINE([MBRTOWC_NUL_RETVAL_BUG], [1], [Define if the mbrtowc function does not return 0 for a NUL character.]) REPLACE_MBRTOWC=1 ;; esac case "$gl_cv_func_mbrtowc_stores_incomplete" in *no) ;; *) AC_DEFINE([MBRTOWC_STORES_INCOMPLETE_BUG], [1], [Define if the mbrtowc function stores a wide character when reporting incomplete input.]) REPLACE_MBRTOWC=1 ;; esac case "$gl_cv_func_mbrtowc_empty_input" in *yes) ;; *) AC_DEFINE([MBRTOWC_EMPTY_INPUT_BUG], [1], [Define if the mbrtowc function does not return (size_t) -2 for empty input.]) REPLACE_MBRTOWC=1 ;; esac case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in *yes) ;; *) AC_DEFINE([MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ], [1], [Define if the mbrtowc function may signal encoding errors in the C locale.]) REPLACE_MBRTOWC=1 ;; esac fi fi if test $REPLACE_MBSTATE_T = 1; then case "$host_os" in mingw* | windows*) MBRTOWC_LIB= ;; *) gl_WEAK_SYMBOLS case "$gl_cv_have_weak" in *yes) MBRTOWC_LIB= ;; *) MBRTOWC_LIB="$LIBPTHREAD" ;; esac ;; esac else MBRTOWC_LIB= fi dnl MBRTOWC_LIB is expected to be '-pthread' or '-lpthread' on AIX dnl with gcc or xlc, and empty otherwise. AC_SUBST([MBRTOWC_LIB]) dnl For backward compatibility. LIB_MBRTOWC="$MBRTOWC_LIB" AC_SUBST([LIB_MBRTOWC]) ]) dnl Test whether mbsinit() and mbrtowc() need to be overridden in a way that dnl redefines the semantics of the given mbstate_t type. dnl Result is REPLACE_MBSTATE_T. dnl When this is set to 1, we replace both mbsinit() and mbrtowc(), in order to dnl avoid inconsistencies. AC_DEFUN_ONCE([gl_MBSTATE_T_BROKEN], [ AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_TYPE_MBSTATE_T]) AC_CHECK_FUNCS_ONCE([mbsinit]) AC_CHECK_FUNCS_ONCE([mbrtowc]) dnl On native Windows, we know exactly how mbsinit() behaves and don't need dnl to override it, even if - like on MSVC - mbsinit() is only defined as dnl an inline function, not as a global function. if case "$host_os" in mingw* | windows*) true ;; *) test $ac_cv_func_mbsinit = yes ;; esac \ && test $ac_cv_func_mbrtowc = yes; then gl_MBRTOWC_INCOMPLETE_STATE gl_MBRTOWC_SANITYCHECK REPLACE_MBSTATE_T=0 case "$gl_cv_func_mbrtowc_incomplete_state" in *yes) ;; *) REPLACE_MBSTATE_T=1 ;; esac case "$gl_cv_func_mbrtowc_sanitycheck" in *yes) ;; *) REPLACE_MBSTATE_T=1 ;; esac else REPLACE_MBSTATE_T=1 fi ]) dnl Test whether mbrtowc puts the state into non-initial state when parsing an dnl incomplete multibyte character. dnl Result is gl_cv_func_mbrtowc_incomplete_state. AC_DEFUN([gl_MBRTOWC_INCOMPLETE_STATE], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gt_LOCALE_JA]) AC_REQUIRE([gt_LOCALE_EN_UTF8]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether mbrtowc handles incomplete characters], [gl_cv_func_mbrtowc_incomplete_state], [ dnl Initial guess, used when cross-compiling or when no suitable locale dnl is present. changequote(,)dnl case "$host_os" in # Guess no on AIX. aix*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_JA != none; then AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include int main () { if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) { const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ mbstate_t state; wchar_t wc; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) if (mbsinit (&state)) return 2; } return 0; }]])], [gl_cv_func_mbrtowc_incomplete_state=yes], [gl_cv_func_mbrtowc_incomplete_state=no], [:]) else if test "$LOCALE_EN_UTF8" != none; then AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include int main () { if (setlocale (LC_ALL, "$LOCALE_EN_UTF8") != NULL) { const char input[] = "B\303\274\303\237er"; /* "Büßer" */ mbstate_t state; wchar_t wc; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) if (mbsinit (&state)) return 2; } return 0; }]])], [gl_cv_func_mbrtowc_incomplete_state=yes], [gl_cv_func_mbrtowc_incomplete_state=no], [:]) fi fi ]) ]) dnl Test whether mbrtowc works not worse than mbtowc. dnl Result is gl_cv_func_mbrtowc_sanitycheck. AC_DEFUN([gl_MBRTOWC_SANITYCHECK], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gt_LOCALE_ZH_CN]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether mbrtowc works as well as mbtowc], [gl_cv_func_mbrtowc_sanitycheck], [ dnl Initial guess, used when cross-compiling or when no suitable locale dnl is present. changequote(,)dnl case "$host_os" in # Guess no on Solaris 8. solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_ZH_CN != none; then AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include #include int main () { /* This fails on Solaris 8: mbrtowc returns 2, and sets wc to 0x00F0. mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) { char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ mbstate_t state; wchar_t wc; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 3, 6, &state) != 4 && mbtowc (&wc, input + 3, 6) == 4) return 2; } return 0; }]])], [gl_cv_func_mbrtowc_sanitycheck=yes], [gl_cv_func_mbrtowc_sanitycheck=no], [:]) fi ]) ]) dnl Test whether mbrtowc supports a NULL pwc argument correctly. dnl Result is gl_cv_func_mbrtowc_null_arg1. AC_DEFUN([gl_MBRTOWC_NULL_ARG1], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gt_LOCALE_EN_UTF8]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether mbrtowc handles a NULL pwc argument], [gl_cv_func_mbrtowc_null_arg1], [ dnl Initial guess, used when cross-compiling or when no suitable locale dnl is present. changequote(,)dnl case "$host_os" in # Guess no on Solaris. solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_mbrtowc_null_arg1="guessing yes" ;; esac changequote([,])dnl if test "$LOCALE_EN_UTF8" != none; then AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include #include int main () { int result = 0; if (setlocale (LC_ALL, "$LOCALE_EN_UTF8") != NULL) { char input[] = "\303\237er"; mbstate_t state; wchar_t wc; size_t ret; memset (&state, '\0', sizeof (mbstate_t)); wc = (wchar_t) 0xBADFACE; ret = mbrtowc (&wc, input, 5, &state); if (ret != 2) result |= 1; if (!mbsinit (&state)) result |= 2; memset (&state, '\0', sizeof (mbstate_t)); ret = mbrtowc (NULL, input, 5, &state); if (ret != 2) /* Solaris 7 fails here: ret is -1. */ result |= 4; if (!mbsinit (&state)) result |= 8; } return result; }]])], [gl_cv_func_mbrtowc_null_arg1=yes], [gl_cv_func_mbrtowc_null_arg1=no], [:]) fi ]) ]) dnl Test whether mbrtowc, when parsing the end of a multibyte character, dnl correctly returns the number of bytes that were needed to complete the dnl character (not the total number of bytes of the multibyte character). dnl Result is gl_cv_func_mbrtowc_retval. AC_DEFUN([gl_MBRTOWC_RETVAL], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gt_LOCALE_EN_UTF8]) AC_REQUIRE([gt_LOCALE_JA]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([whether mbrtowc has a correct return value], [gl_cv_func_mbrtowc_retval], [ dnl Initial guess, used when cross-compiling or when no suitable locale dnl is present. changequote(,)dnl case "$host_os" in # Guess no on HP-UX, Solaris, native Windows. hpux* | solaris* | mingw* | windows*) gl_cv_func_mbrtowc_retval="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_mbrtowc_retval="guessing yes" ;; esac changequote([,])dnl if test "$LOCALE_EN_UTF8" != none || test $LOCALE_JA != none \ || { case "$host_os" in mingw* | windows*) true;; *) false;; esac; }; then AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include int main () { int result = 0; int found_some_locale = 0; /* This fails on Solaris. */ if (strcmp ("$LOCALE_EN_UTF8", "none") != 0 && setlocale (LC_ALL, "$LOCALE_EN_UTF8") != NULL) { char input[] = "B\303\274\303\237er"; /* "Büßer" */ mbstate_t state; wchar_t wc; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) { input[1] = '\0'; if (mbrtowc (&wc, input + 2, 5, &state) != 1) result |= 1; } found_some_locale = 1; } /* This fails on HP-UX 11.11. */ if (strcmp ("$LOCALE_JA", "none") != 0 && setlocale (LC_ALL, "$LOCALE_JA") != NULL) { char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ mbstate_t state; wchar_t wc; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) { input[1] = '\0'; if (mbrtowc (&wc, input + 2, 5, &state) != 2) result |= 2; } found_some_locale = 1; } /* This fails on native Windows. */ if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL) { char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */ mbstate_t state; wchar_t wc; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) { input[3] = '\0'; if (mbrtowc (&wc, input + 4, 4, &state) != 1) result |= 4; } found_some_locale = 1; } if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL) { char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */ mbstate_t state; wchar_t wc; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) { input[3] = '\0'; if (mbrtowc (&wc, input + 4, 4, &state) != 1) result |= 8; } found_some_locale = 1; } if (setlocale (LC_ALL, "Chinese_China.936") != NULL) { char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */ mbstate_t state; wchar_t wc; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2)) { input[3] = '\0'; if (mbrtowc (&wc, input + 4, 4, &state) != 1) result |= 16; } found_some_locale = 1; } return (found_some_locale ? result : 77); }]])], [gl_cv_func_mbrtowc_retval=yes], [if test $? != 77; then gl_cv_func_mbrtowc_retval=no fi ], [:]) fi ]) ]) dnl Test whether mbrtowc, when parsing a NUL character, correctly returns 0. dnl Result is gl_cv_func_mbrtowc_nul_retval. AC_DEFUN([gl_MBRTOWC_NUL_RETVAL], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gt_LOCALE_ZH_CN]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether mbrtowc returns 0 when parsing a NUL character], [gl_cv_func_mbrtowc_nul_retval], [ dnl Initial guess, used when cross-compiling or when no suitable locale dnl is present. changequote(,)dnl case "$host_os" in # Guess no on Solaris 8 and 9. solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_mbrtowc_nul_retval="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_ZH_CN != none; then AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include int main () { /* This fails on Solaris 8 and 9. */ if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) { mbstate_t state; wchar_t wc; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, "", 1, &state) != 0) return 2; } return 0; }]])], [gl_cv_func_mbrtowc_nul_retval=yes], [gl_cv_func_mbrtowc_nul_retval=no], [:]) fi ]) ]) dnl Test whether mbrtowc stores a wide character when reporting incomplete dnl input. AC_DEFUN([gl_MBRTOWC_STORES_INCOMPLETE], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether mbrtowc stores incomplete characters], [gl_cv_func_mbrtowc_stores_incomplete], [ dnl Initial guess, used when cross-compiling or when no suitable locale dnl is present. changequote(,)dnl case "$host_os" in # Guess yes on native Windows. mingw* | windows*) gl_cv_func_mbrtowc_stores_incomplete="guessing yes" ;; *) gl_cv_func_mbrtowc_stores_incomplete="guessing no" ;; esac changequote([,])dnl case "$host_os" in mingw* | windows*) AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include int main () { int result = 0; if (setlocale (LC_ALL, "French_France.65001") != NULL) { wchar_t wc = (wchar_t) 0xBADFACE; mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2) && wc != (wchar_t) 0xBADFACE) result |= 1; } if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL) { wchar_t wc = (wchar_t) 0xBADFACE; mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, "\226", 1, &state) == (size_t)(-2) && wc != (wchar_t) 0xBADFACE) result |= 2; } if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL) { wchar_t wc = (wchar_t) 0xBADFACE; mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, "\245", 1, &state) == (size_t)(-2) && wc != (wchar_t) 0xBADFACE) result |= 4; } if (setlocale (LC_ALL, "Chinese_China.936") != NULL) { wchar_t wc = (wchar_t) 0xBADFACE; mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, "\261", 1, &state) == (size_t)(-2) && wc != (wchar_t) 0xBADFACE) result |= 8; } return result; }]])], [gl_cv_func_mbrtowc_stores_incomplete=no], [gl_cv_func_mbrtowc_stores_incomplete=yes], [:]) ;; *) AC_REQUIRE([gt_LOCALE_EN_UTF8]) if test "$LOCALE_EN_UTF8" != none; then AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include int main () { if (setlocale (LC_ALL, "$LOCALE_EN_UTF8") != NULL) { wchar_t wc = (wchar_t) 0xBADFACE; mbstate_t state; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2) && wc != (wchar_t) 0xBADFACE) return 1; } return 0; }]])], [gl_cv_func_mbrtowc_stores_incomplete=no], [gl_cv_func_mbrtowc_stores_incomplete=yes], [:]) fi ;; esac ]) ]) dnl Test whether mbrtowc returns the correct value on empty input. AC_DEFUN([gl_MBRTOWC_EMPTY_INPUT], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether mbrtowc works on empty input], [gl_cv_func_mbrtowc_empty_input], [AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include static wchar_t wc; static mbstate_t mbs; int main (void) { return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2; }]])], [gl_cv_func_mbrtowc_empty_input=yes], [gl_cv_func_mbrtowc_empty_input=no], [case "$host_os" in # Guess no on AIX and glibc systems. aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;; # Guess no on Android. linux*-android*) gl_cv_func_mbrtowc_empty_input="guessing no" ;; # Guess no on native Windows. mingw* | windows*) gl_cv_func_mbrtowc_empty_input="guessing no" ;; *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; esac ]) ]) ]) dnl Test whether mbrtowc reports encoding errors in the C locale. dnl Although POSIX was never intended to allow this, the GNU C Library dnl and other implementations do it. See: dnl https://sourceware.org/PR19932 dnl POSIX has now clarified it: dnl dnl says: "In the POSIX locale an [EILSEQ] error cannot occur since all byte dnl values are valid characters." AC_DEFUN([gl_MBRTOWC_C_LOCALE], [ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether the C locale is free of encoding errors], [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include #include #include ]], [[ int i; char *locale = setlocale (LC_ALL, "C"); if (! locale) return 2; for (i = CHAR_MIN; i <= CHAR_MAX; i++) { char c = i; wchar_t wc; mbstate_t mbs = { 0, }; size_t ss = mbrtowc (&wc, &c, 1, &mbs); if (1 < ss) return 3; } return 0; ]])], [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=yes], [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=no], [case "$host_os" in # Guess yes on native Windows. mingw* | windows*) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="guessing yes" ;; *) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="$gl_cross_guess_normal" ;; esac ]) ]) ]) # Prerequisites of lib/mbrtowc.c and lib/lc-charset-dispatch.c. AC_DEFUN([gl_PREREQ_MBRTOWC], [ AC_REQUIRE([AC_C_INLINE]) : ]) # Prerequisites of lib/mbtowc-lock.c. AC_DEFUN([gl_PREREQ_MBTOWC_LOCK], [ gl_VISIBILITY ]) dnl From Paul Eggert dnl This is an override of an autoconf macro. AC_DEFUN([AC_FUNC_MBRTOWC], [ dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60. AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared], [gl_cv_func_mbrtowc], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[wchar_t wc; char const s[] = ""; size_t n = 1; mbstate_t state; return ! (sizeof state && (mbrtowc) (&wc, s, n, &state));]])], [gl_cv_func_mbrtowc=yes], [gl_cv_func_mbrtowc=no])]) if test $gl_cv_func_mbrtowc = yes; then AC_DEFINE([HAVE_MBRTOWC], [1], [Define to 1 if mbrtowc and mbstate_t are properly declared.]) fi ]) groff-1.24.1/gnulib_m4/stdint.m40000644000175000017500000004335015153275164013270 00000000000000# stdint.m4 # serial 65 dnl Copyright (C) 2001-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Paul Eggert and Bruno Haible. dnl Test whether is supported or must be substituted. AC_PREREQ([2.61]) AC_DEFUN_ONCE([gl_STDINT_H], [ AC_PREREQ([2.59])dnl AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_REQUIRE([gl_LIMITS_H]) AC_REQUIRE([gt_TYPE_WINT_T]) dnl For backward compatibility. Some packages may still be testing these dnl macros. AC_DEFINE([HAVE_LONG_LONG_INT], [1], [Define to 1 if the system has the type 'long long int'.]) AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1], [Define to 1 if the system has the type 'unsigned long long int'.]) dnl Check for , in the same way as gl_WCHAR_H does. AC_CHECK_HEADERS_ONCE([wchar.h]) if test $ac_cv_header_wchar_h = yes; then HAVE_WCHAR_H=1 else HAVE_WCHAR_H=0 fi AC_SUBST([HAVE_WCHAR_H]) dnl Check for . AC_CHECK_HEADERS_ONCE([inttypes.h]) if test $ac_cv_header_inttypes_h = yes; then HAVE_INTTYPES_H=1 else HAVE_INTTYPES_H=0 fi AC_SUBST([HAVE_INTTYPES_H]) dnl Check for . AC_CHECK_HEADERS_ONCE([sys/types.h]) if test $ac_cv_header_sys_types_h = yes; then HAVE_SYS_TYPES_H=1 else HAVE_SYS_TYPES_H=0 fi AC_SUBST([HAVE_SYS_TYPES_H]) gl_CHECK_NEXT_HEADERS([stdint.h]) if test $ac_cv_header_stdint_h = yes; then HAVE_STDINT_H=1 else HAVE_STDINT_H=0 fi AC_SUBST([HAVE_STDINT_H]) dnl Now see whether we need a substitute . if test $ac_cv_header_stdint_h = yes; then AC_CACHE_CHECK([whether stdint.h conforms to C99], [gl_cv_header_working_stdint_h], [gl_cv_header_working_stdint_h=no AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ #define __STDC_CONSTANT_MACROS 1 #define __STDC_LIMIT_MACROS 1 #include /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in . */ #if !(defined WCHAR_MIN && defined WCHAR_MAX) #error "WCHAR_MIN, WCHAR_MAX not defined in " #endif ] gl_STDINT_INCLUDES [ #ifdef INT8_MAX int8_t a1 = INT8_MAX; int8_t a1min = INT8_MIN; #endif #ifdef INT16_MAX int16_t a2 = INT16_MAX; int16_t a2min = INT16_MIN; #endif #ifdef INT32_MAX int32_t a3 = INT32_MAX; int32_t a3min = INT32_MIN; #endif #ifdef INT64_MAX int64_t a4 = INT64_MAX; int64_t a4min = INT64_MIN; #endif #ifdef UINT8_MAX uint8_t b1 = UINT8_MAX; #else typedef int b1[(unsigned char) -1 != 255 ? 1 : -1]; #endif #ifdef UINT16_MAX uint16_t b2 = UINT16_MAX; #endif #ifdef UINT32_MAX uint32_t b3 = UINT32_MAX; #endif #ifdef UINT64_MAX uint64_t b4 = UINT64_MAX; #endif int_least8_t c1 = INT8_C (0x7f); int_least8_t c1max = INT_LEAST8_MAX; int_least8_t c1min = INT_LEAST8_MIN; int_least16_t c2 = INT16_C (0x7fff); int_least16_t c2max = INT_LEAST16_MAX; int_least16_t c2min = INT_LEAST16_MIN; int_least32_t c3 = INT32_C (0x7fffffff); int_least32_t c3max = INT_LEAST32_MAX; int_least32_t c3min = INT_LEAST32_MIN; int_least64_t c4 = INT64_C (0x7fffffffffffffff); int_least64_t c4max = INT_LEAST64_MAX; int_least64_t c4min = INT_LEAST64_MIN; uint_least8_t d1 = UINT8_C (0xff); uint_least8_t d1max = UINT_LEAST8_MAX; uint_least16_t d2 = UINT16_C (0xffff); uint_least16_t d2max = UINT_LEAST16_MAX; uint_least32_t d3 = UINT32_C (0xffffffff); uint_least32_t d3max = UINT_LEAST32_MAX; uint_least64_t d4 = UINT64_C (0xffffffffffffffff); uint_least64_t d4max = UINT_LEAST64_MAX; int_fast8_t e1 = INT_FAST8_MAX; int_fast8_t e1min = INT_FAST8_MIN; int_fast16_t e2 = INT_FAST16_MAX; int_fast16_t e2min = INT_FAST16_MIN; int_fast32_t e3 = INT_FAST32_MAX; int_fast32_t e3min = INT_FAST32_MIN; int_fast64_t e4 = INT_FAST64_MAX; int_fast64_t e4min = INT_FAST64_MIN; uint_fast8_t f1 = UINT_FAST8_MAX; uint_fast16_t f2 = UINT_FAST16_MAX; uint_fast32_t f3 = UINT_FAST32_MAX; uint_fast64_t f4 = UINT_FAST64_MAX; #ifdef INTPTR_MAX intptr_t g = INTPTR_MAX; intptr_t gmin = INTPTR_MIN; #endif #ifdef UINTPTR_MAX uintptr_t h = UINTPTR_MAX; #endif intmax_t i = INTMAX_MAX; uintmax_t j = UINTMAX_MAX; /* Check that SIZE_MAX has the correct type, if possible. */ /* ISO C 11 mandates _Generic, but GCC versions < 4.9 lack it. */ #if 201112 <= __STDC_VERSION__ \ && (!defined __GNUC__ || 4 < __GNUC__ + (9 <= __GNUC_MINOR__) \ || defined __clang__) int k = _Generic (SIZE_MAX, size_t: 0); #elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \ || (0x5110 <= __SUNPRO_C && !__STDC__) || 1939 <= _MSC_VER) extern size_t k; extern __typeof__ (SIZE_MAX) k; #endif #include /* for CHAR_BIT */ #define TYPE_MINIMUM(t) \ ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) #define TYPE_MAXIMUM(t) \ ((t) ((t) 0 < (t) -1 \ ? (t) -1 \ : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) struct s { int check_PTRDIFF: PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) ? 1 : -1; /* Detect bug in FreeBSD 6.0/ia64 and FreeBSD 13.0/arm64. */ int check_SIG_ATOMIC: SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) ? 1 : -1; int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1; int check_WCHAR: WCHAR_MIN == TYPE_MINIMUM (wchar_t) && WCHAR_MAX == TYPE_MAXIMUM (wchar_t) ? 1 : -1; /* Detect bug in mingw. */ int check_WINT: WINT_MIN == TYPE_MINIMUM (wint_t) && WINT_MAX == TYPE_MAXIMUM (wint_t) ? 1 : -1; /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */ int check_UINT8_C: (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1; int check_UINT16_C: (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1; /* Detect bugs in OpenBSD 3.9 stdint.h. */ #ifdef UINT8_MAX int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1; #endif #ifdef UINT16_MAX int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1; #endif #ifdef UINT32_MAX int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1; #endif #ifdef UINT64_MAX int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1; #endif int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1; int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1; int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1; int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1; int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1; int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1; int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1; int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1; int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1; int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1; int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1; }; ]])], [dnl Determine whether the various *_MIN, *_MAX macros are usable dnl in preprocessor expression. We could do it by compiling a test dnl program for each of these macros. It is faster to run a program dnl that inspects the macro expansion. dnl This detects a bug on HP-UX 11.23/ia64. AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ #define __STDC_CONSTANT_MACROS 1 #define __STDC_LIMIT_MACROS 1 #include ] gl_STDINT_INCLUDES [ #include #include #define MVAL(macro) MVAL1(macro) #define MVAL1(expression) #expression static const char *macro_values[] = { #ifdef INT8_MAX MVAL (INT8_MAX), #endif #ifdef INT16_MAX MVAL (INT16_MAX), #endif #ifdef INT32_MAX MVAL (INT32_MAX), #endif #ifdef INT64_MAX MVAL (INT64_MAX), #endif #ifdef UINT8_MAX MVAL (UINT8_MAX), #endif #ifdef UINT16_MAX MVAL (UINT16_MAX), #endif #ifdef UINT32_MAX MVAL (UINT32_MAX), #endif #ifdef UINT64_MAX MVAL (UINT64_MAX), #endif NULL }; ]], [[ const char **mv; for (mv = macro_values; *mv != NULL; mv++) { const char *value = *mv; /* Test whether it looks like a cast expression. */ if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0 || strncmp (value, "((unsigned short)"/*)*/, 17) == 0 || strncmp (value, "((unsigned char)"/*)*/, 16) == 0 || strncmp (value, "((int)"/*)*/, 6) == 0 || strncmp (value, "((signed short)"/*)*/, 15) == 0 || strncmp (value, "((signed char)"/*)*/, 14) == 0) return mv - macro_values + 1; } return 0; ]])], [gl_cv_header_working_stdint_h=yes], [], [case "$host_os" in # Guess yes on native Windows. mingw* | windows*) gl_cv_header_working_stdint_h="guessing yes" ;; # In general, assume it works. *) gl_cv_header_working_stdint_h="guessing yes" ;; esac ]) ]) ]) fi HAVE_C99_STDINT_H=0 HAVE_SYS_BITYPES_H=0 HAVE_SYS_INTTYPES_H=0 GL_GENERATE_STDINT_H=true case "$gl_cv_header_working_stdint_h" in *yes) HAVE_C99_STDINT_H=1 dnl Now see whether the system works without dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined. dnl If not, there would be problems when stdint.h is included from C++. AC_CACHE_CHECK([whether stdint.h works without ISO C predefines], [gl_cv_header_stdint_without_STDC_macros], [gl_cv_header_stdint_without_STDC_macros=no AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ #include ] gl_STDINT_INCLUDES [ intmax_t im = INTMAX_MAX; int32_t i32 = INT32_C (0x7fffffff); ]])], [gl_cv_header_stdint_without_STDC_macros=yes]) ]) if test $gl_cv_header_stdint_without_STDC_macros = no; then AC_DEFINE([__STDC_CONSTANT_MACROS], [1], [Define to 1 if the system predates C++11.]) AC_DEFINE([__STDC_LIMIT_MACROS], [1], [Define to 1 if the system predates C++11.]) fi AC_CACHE_CHECK([whether stdint.h has UINTMAX_WIDTH etc.], [gl_cv_header_stdint_width], [gl_cv_header_stdint_width=no AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[ /* Work if build is not clean. */ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 #endif #include ]gl_STDINT_INCLUDES[ int iw = UINTMAX_WIDTH; ]])], [gl_cv_header_stdint_width=yes])]) if test "$gl_cv_header_stdint_width" = yes; then GL_GENERATE_STDINT_H=false fi ;; *) dnl Check for , and for dnl (used in Linux libc4 >= 4.6.7 and libc5). AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h]) if test $ac_cv_header_sys_inttypes_h = yes; then HAVE_SYS_INTTYPES_H=1 fi if test $ac_cv_header_sys_bitypes_h = yes; then HAVE_SYS_BITYPES_H=1 fi gl_STDINT_TYPE_PROPERTIES ;; esac dnl The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH. gl_REPLACE_LIMITS_H AC_SUBST([HAVE_C99_STDINT_H]) AC_SUBST([HAVE_SYS_BITYPES_H]) AC_SUBST([HAVE_SYS_INTTYPES_H]) ]) dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES) dnl Determine the size of each of the given types in bits. AC_DEFUN([gl_STDINT_BITSIZEOF], [ dnl Use a shell loop, to avoid bloating configure, and dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into dnl config.h.in, dnl - extra AC_SUBST calls, so that the right substitutions are made. m4_foreach_w([gltype], [$1], [AH_TEMPLATE([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), [Define to the number of bits in type ']gltype['.])]) for gltype in $1 ; do AC_CACHE_CHECK([for bit size of $gltype], [gl_cv_bitsizeof_${gltype}], [AC_COMPUTE_INT([result], [sizeof ($gltype) * CHAR_BIT], [$2 #include ], [result=unknown]) eval gl_cv_bitsizeof_${gltype}=\$result ]) eval result=\$gl_cv_bitsizeof_${gltype} if test $result = unknown; then dnl Use a nonempty default, because some old compilers do a syntax check dnl even on unused #if conditions and give an error on valid C code like dnl this: dnl #if 0 dnl # if > 32 dnl # endif dnl #endif result=0 fi GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result]) eval BITSIZEOF_${GLTYPE}=\$result done m4_foreach_w([gltype], [$1], [AC_SUBST([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) ]) dnl gl_CHECK_TYPES_SIGNED(TYPES, INCLUDES) dnl Determine the signedness of each of the given types. dnl Define HAVE_SIGNED_TYPE if type is signed. AC_DEFUN([gl_CHECK_TYPES_SIGNED], [ dnl Use a shell loop, to avoid bloating configure, and dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into dnl config.h.in, dnl - extra AC_SUBST calls, so that the right substitutions are made. m4_foreach_w([gltype], [$1], [AH_TEMPLATE([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), [Define to 1 if ']gltype[' is a signed integer type.])]) for gltype in $1 ; do AC_CACHE_CHECK([whether $gltype is signed], [gl_cv_type_${gltype}_signed], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([$2[ int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];]])], result=yes, result=no) eval gl_cv_type_${gltype}_signed=\$result ]) eval result=\$gl_cv_type_${gltype}_signed GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` if test "$result" = yes; then AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], [1]) eval HAVE_SIGNED_${GLTYPE}=1 else eval HAVE_SIGNED_${GLTYPE}=0 fi done m4_foreach_w([gltype], [$1], [AC_SUBST([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) ]) dnl gl_INTEGER_TYPE_SUFFIX(TYPES, INCLUDES) dnl Determine the suffix to use for integer constants of the given types. dnl Define t_SUFFIX for each such type. AC_DEFUN([gl_INTEGER_TYPE_SUFFIX], [ dnl Use a shell loop, to avoid bloating configure, and dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into dnl config.h.in, dnl - extra AC_SUBST calls, so that the right substitutions are made. m4_foreach_w([gltype], [$1], [AH_TEMPLATE(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX], [Define to l, ll, u, ul, ull, etc., as suitable for constants of type ']gltype['.])]) for gltype in $1 ; do AC_CACHE_CHECK([for $gltype integer literal suffix], [gl_cv_type_${gltype}_suffix], [eval gl_cv_type_${gltype}_suffix=no eval result=\$gl_cv_type_${gltype}_signed if test "$result" = yes; then glsufu= else glsufu=u fi for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do case $glsuf in '') gltype1='int';; l) gltype1='long int';; ll) gltype1='long long int';; i64) gltype1='__int64';; u) gltype1='unsigned int';; ul) gltype1='unsigned long int';; ull) gltype1='unsigned long long int';; ui64)gltype1='unsigned __int64';; esac AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([$2[ extern $gltype foo; extern $gltype1 foo;]])], [eval gl_cv_type_${gltype}_suffix=\$glsuf]) eval result=\$gl_cv_type_${gltype}_suffix test "$result" != no && break done]) GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` eval result=\$gl_cv_type_${gltype}_suffix test "$result" = no && result= eval ${GLTYPE}_SUFFIX=\$result AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], [$result]) done m4_foreach_w([gltype], [$1], [AC_SUBST(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])]) ]) dnl gl_STDINT_INCLUDES AC_DEFUN([gl_STDINT_INCLUDES], [[ #include #include #if HAVE_WCHAR_H # include #endif ]]) dnl gl_STDINT_TYPE_PROPERTIES dnl Compute HAVE_SIGNED_t, BITSIZEOF_t and t_SUFFIX, for all the types t dnl of interest to stdint.in.h. AC_DEFUN([gl_STDINT_TYPE_PROPERTIES], [ AC_REQUIRE([gl_MULTIARCH]) if test $APPLE_UNIVERSAL_BUILD = 0; then gl_STDINT_BITSIZEOF([ptrdiff_t size_t], [gl_STDINT_INCLUDES]) fi gl_STDINT_BITSIZEOF([sig_atomic_t wchar_t wint_t], [gl_STDINT_INCLUDES]) gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t], [gl_STDINT_INCLUDES]) gl_cv_type_ptrdiff_t_signed=yes gl_cv_type_size_t_signed=no if test $APPLE_UNIVERSAL_BUILD = 0; then gl_INTEGER_TYPE_SUFFIX([ptrdiff_t size_t], [gl_STDINT_INCLUDES]) fi gl_INTEGER_TYPE_SUFFIX([sig_atomic_t wchar_t wint_t], [gl_STDINT_INCLUDES]) dnl If wint_t is smaller than 'int', it cannot satisfy the ISO C 99 dnl requirement that wint_t is "unchanged by default argument promotions". dnl In this case gnulib's and override wint_t. dnl Set the variable BITSIZEOF_WINT_T accordingly. if test $GNULIBHEADERS_OVERRIDE_WINT_T = 1; then BITSIZEOF_WINT_T=32 fi ]) groff-1.24.1/gnulib_m4/absolute-header.m40000644000175000017500000001025415153275164015024 00000000000000# absolute-header.m4 # serial 18 dnl Copyright (C) 2006-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Derek Price. # gl_ABSOLUTE_HEADER(HEADER1 HEADER2 ...) # --------------------------------------- # Find the absolute name of a header file, testing first if the header exists. # If the header were sys/inttypes.h, this macro would define # ABSOLUTE_SYS_INTTYPES_H to the '""' quoted absolute name of sys/inttypes.h # in config.h # (e.g. '#define ABSOLUTE_SYS_INTTYPES_H "///usr/include/sys/inttypes.h"'). # The three "///" are to pacify Sun C 5.8, which otherwise would say # "warning: #include of /usr/include/... may be non-portable". # Use '""', not '<>', so that the /// cannot be confused with a C99 comment. # Note: This macro assumes that the header file is not empty after # preprocessing, i.e. it does not only define preprocessor macros but also # provides some type/enum definitions or function/variable declarations. AC_DEFUN([gl_ABSOLUTE_HEADER], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_LANG_PREPROC_REQUIRE()dnl m4_foreach_w([gl_HEADER_NAME], [$1], [AS_VAR_PUSHDEF([gl_absolute_header], [gl_cv_absolute_]m4_defn([gl_HEADER_NAME]))dnl AC_CACHE_CHECK([absolute name of <]m4_defn([gl_HEADER_NAME])[>], [gl_absolute_header], [AS_VAR_PUSHDEF([ac_header_exists], [ac_cv_header_]m4_defn([gl_HEADER_NAME]))dnl AC_CHECK_HEADERS_ONCE(m4_defn([gl_HEADER_NAME]))dnl if test AS_VAR_GET([ac_header_exists]) = yes; then gl_ABSOLUTE_HEADER_ONE(m4_defn([gl_HEADER_NAME])) fi AS_VAR_POPDEF([ac_header_exists])dnl ])dnl AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_defn([gl_HEADER_NAME])), ["AS_VAR_GET([gl_absolute_header])"], [Define this to an absolute name of <]m4_defn([gl_HEADER_NAME])[>.]) AS_VAR_POPDEF([gl_absolute_header])dnl ])dnl ])# gl_ABSOLUTE_HEADER # gl_ABSOLUTE_HEADER_ONE(HEADER) # ------------------------------ # Like gl_ABSOLUTE_HEADER, except that: # - it assumes that the header exists, # - it uses the current CPPFLAGS, # - it does not cache the result, # - it is silent. AC_DEFUN([gl_ABSOLUTE_HEADER_ONE], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <]]m4_dquote([$1])[[>]])]) dnl AIX "xlc -E" and "cc -E" omit #line directives for header files dnl that contain only a #include of other header files and no dnl non-comment tokens of their own. This leads to a failure to dnl detect the absolute name of , , dnl and others. The workaround is to force preservation of comments dnl through option -C. This ensures all necessary #line directives dnl are present. GCC supports option -C as well. case "$host_os" in aix*) gl_absname_cpp="$ac_cpp -C" ;; *) gl_absname_cpp="$ac_cpp" ;; esac changequote(,) case "$host_os" in mingw* | windows*) dnl For the sake of native Windows compilers (excluding gcc), dnl treat backslash as a directory separator, like /. dnl Actually, these compilers use a double-backslash as dnl directory separator, inside the dnl # line "filename" dnl directives. gl_dirsep_regex='[/\\]' ;; *) gl_dirsep_regex='\/' ;; esac dnl A sed expression that turns a string into a basic regular dnl expression, for use within "/.../". gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' gl_header_literal_regex=`echo '$1' \ | sed -e "$gl_make_literal_regex_sed"` gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ s|^/[^/]|//&| p q }' changequote([,]) dnl eval is necessary to expand gl_absname_cpp. dnl Ultrix and Pyramid sh refuse to redirect output of eval, dnl so use subshell. AS_VAR_SET([gl_cv_absolute_]AS_TR_SH([[$1]]), [`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | sed -n "$gl_absolute_header_sed"`]) ]) groff-1.24.1/gnulib_m4/exponentf.m40000644000175000017500000000555315153275164013774 00000000000000# exponentf.m4 # serial 3 dnl Copyright (C) 2007-2008, 2010-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN_ONCE([gl_FLOAT_EXPONENT_LOCATION], [ AC_CACHE_CHECK([where to find the exponent in a 'float'], [gl_cv_cc_float_expbit0], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include #include #define NWORDS \ ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) typedef union { float value; unsigned int word[NWORDS]; } memory_float; static unsigned int ored_words[NWORDS]; static unsigned int anded_words[NWORDS]; static void add_to_ored_words (float x) { memory_float m; size_t i; /* Clear it first, in case sizeof (float) < sizeof (memory_float). */ memset (&m, 0, sizeof (memory_float)); m.value = x; for (i = 0; i < NWORDS; i++) { ored_words[i] |= m.word[i]; anded_words[i] &= m.word[i]; } } int main () { size_t j; FILE *fp = fopen ("conftest.out", "w"); if (fp == NULL) return 1; for (j = 0; j < NWORDS; j++) anded_words[j] = ~ (unsigned int) 0; add_to_ored_words (0.25f); add_to_ored_words (0.5f); add_to_ored_words (1.0f); add_to_ored_words (2.0f); add_to_ored_words (4.0f); /* Remove bits that are common (e.g. if representation of the first mantissa bit is explicit). */ for (j = 0; j < NWORDS; j++) ored_words[j] &= ~anded_words[j]; /* Now find the nonzero word. */ for (j = 0; j < NWORDS; j++) if (ored_words[j] != 0) break; if (j < NWORDS) { size_t i; for (i = j + 1; i < NWORDS; i++) if (ored_words[i] != 0) { fprintf (fp, "unknown"); return (fclose (fp) != 0); } for (i = 0; ; i++) if ((ored_words[j] >> i) & 1) { fprintf (fp, "word %d bit %d", (int) j, (int) i); return (fclose (fp) != 0); } } fprintf (fp, "unknown"); return (fclose (fp) != 0); } ]])], [gl_cv_cc_float_expbit0=`cat conftest.out`], [gl_cv_cc_float_expbit0="unknown"], [gl_cv_cc_float_expbit0="word 0 bit 23"]) rm -f conftest.out ]) case "$gl_cv_cc_float_expbit0" in word*bit*) word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'` AC_DEFINE_UNQUOTED([FLT_EXPBIT0_WORD], [$word], [Define as the word index where to find the exponent of 'float'.]) AC_DEFINE_UNQUOTED([FLT_EXPBIT0_BIT], [$bit], [Define as the bit index in the word where to find bit 0 of the exponent of 'float'.]) ;; esac ]) groff-1.24.1/gnulib_m4/ldexpl.m40000644000175000017500000000773415153275164013261 00000000000000# ldexpl.m4 # serial 19 dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_LDEXPL], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) AC_REQUIRE([gl_FUNC_ISNANL]) dnl for ISNANL_LIBM dnl Persuade glibc to declare ldexpl(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) dnl Check whether it's declared. dnl Mac OS X 10.3 has ldexpl() in libc but doesn't declare it in . AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [[#include ]]) LDEXPL_LIBM= if test $HAVE_DECL_LDEXPL = 1; then gl_CHECK_LDEXPL_NO_LIBM if test $gl_cv_func_ldexpl_no_libm = no; then AC_CACHE_CHECK([whether ldexpl() can be used with libm], [gl_cv_func_ldexpl_in_libm], [ saved_LIBS="$LIBS" LIBS="$LIBS -lm" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include long double x;]], [[return ldexpl (x, -1) > 0;]])], [gl_cv_func_ldexpl_in_libm=yes], [gl_cv_func_ldexpl_in_libm=no]) LIBS="$saved_LIBS" ]) if test $gl_cv_func_ldexpl_in_libm = yes; then LDEXPL_LIBM=-lm fi fi if test $gl_cv_func_ldexpl_no_libm = yes \ || test $gl_cv_func_ldexpl_in_libm = yes; then saved_LIBS="$LIBS" LIBS="$LIBS $LDEXPL_LIBM" gl_FUNC_LDEXPL_WORKS LIBS="$saved_LIBS" case "$gl_cv_func_ldexpl_works" in *yes) gl_func_ldexpl=yes ;; *) gl_func_ldexpl=no; REPLACE_LDEXPL=1 ;; esac else gl_func_ldexpl=no fi if test $gl_func_ldexpl = yes; then AC_DEFINE([HAVE_LDEXPL], [1], [Define if the ldexpl() function is available.]) fi fi if test $HAVE_DECL_LDEXPL = 0 || test $gl_func_ldexpl = no; then dnl Find libraries needed to link lib/ldexpl.c. if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then AC_REQUIRE([gl_FUNC_LDEXP]) LDEXPL_LIBM="$LDEXP_LIBM" else LDEXPL_LIBM="$ISNANL_LIBM" fi fi AC_SUBST([LDEXPL_LIBM]) ]) dnl Test whether ldexpl() can be used without linking with libm. dnl Set gl_cv_func_ldexpl_no_libm to 'yes' or 'no' accordingly. AC_DEFUN([gl_CHECK_LDEXPL_NO_LIBM], [ AC_CACHE_CHECK([whether ldexpl() can be used without linking with libm], [gl_cv_func_ldexpl_no_libm], [ AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include long double x;]], [[return ldexpl (x, -1) > 0;]])], [gl_cv_func_ldexpl_no_libm=yes], [gl_cv_func_ldexpl_no_libm=no]) ]) ]) dnl Test whether ldexpl() works on finite numbers (this fails on AIX 5.1 dnl and Mac OS X 10.4/PowerPC). AC_DEFUN([gl_FUNC_LDEXPL_WORKS], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether ldexpl works], [gl_cv_func_ldexpl_works], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include extern #ifdef __cplusplus "C" #endif long double ldexpl (long double, int); int main() { int result = 0; { volatile long double x = 1.0; volatile long double y = ldexpl (x, -1); if (y != 0.5L) result |= 1; } { volatile long double x = 1.73205L; volatile long double y = ldexpl (x, 0); if (y != x) result |= 2; } return result; }]])], [gl_cv_func_ldexpl_works=yes], [gl_cv_func_ldexpl_works=no], [ changequote(,)dnl case "$host_os" in aix | aix[3-6]*) gl_cv_func_ldexpl_works="guessing no" ;; # Guess yes on native Windows. mingw* | windows*) gl_cv_func_ldexpl_works="guessing yes" ;; *) gl_cv_func_ldexpl_works="guessing yes" ;; esac changequote([,])dnl ]) ]) ]) groff-1.24.1/gnulib_m4/trunc.m40000644000175000017500000000703615153275164013117 00000000000000# trunc.m4 # serial 18 dnl Copyright (C) 2007, 2010-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_TRUNC], [ m4_divert_text([DEFAULTS], [gl_trunc_required=plain]) AC_REQUIRE([gl_MATH_H_DEFAULTS]) dnl Persuade glibc to declare trunc(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) dnl Test whether trunc() is declared. AC_CHECK_DECLS([trunc], , , [[#include ]]) if test "$ac_cv_have_decl_trunc" = yes; then dnl Test whether trunc() can be used without libm. TRUNC_LIBM=? AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#ifndef __NO_MATH_INLINES # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include double (*funcptr) (double) = trunc; double x;]], [[x = funcptr(x) + trunc(x);]])], [TRUNC_LIBM=]) if test "$TRUNC_LIBM" = "?"; then saved_LIBS="$LIBS" LIBS="$LIBS -lm" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#ifndef __NO_MATH_INLINES # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include double (*funcptr) (double) = trunc; double x;]], [[x = funcptr(x) + trunc(x);]])], [TRUNC_LIBM="-lm"]) LIBS="$saved_LIBS" fi if test "$TRUNC_LIBM" = "?"; then TRUNC_LIBM= fi m4_ifdef([gl_FUNC_TRUNC_IEEE], [ if test $gl_trunc_required = ieee && test $REPLACE_TRUNC = 0; then AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether trunc works according to ISO C 99 with IEC 60559], [gl_cv_func_trunc_ieee], [ saved_LIBS="$LIBS" LIBS="$LIBS $TRUNC_LIBM" AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #ifndef __NO_MATH_INLINES # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include ]gl_DOUBLE_MINUS_ZERO_CODE[ ]gl_DOUBLE_SIGNBIT_CODE[ static double dummy (double f) { return 0; } int main (int argc, char *argv[]) { double (* volatile my_trunc) (double) = argc ? trunc : dummy; /* Test whether trunc (-0.0) is -0.0. */ if (signbitd (minus_zerod) && !signbitd (my_trunc (minus_zerod))) return 1; return 0; } ]])], [gl_cv_func_trunc_ieee=yes], [gl_cv_func_trunc_ieee=no], [case "$host_os" in # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_trunc_ieee="guessing yes" ;; # Guess yes on musl systems. *-musl* | midipix*) gl_cv_func_trunc_ieee="guessing yes" ;; # Guess yes on native Windows. mingw* | windows*) gl_cv_func_trunc_ieee="guessing yes" ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_trunc_ieee="$gl_cross_guess_normal" ;; esac ]) LIBS="$saved_LIBS" ]) case "$gl_cv_func_trunc_ieee" in *yes) ;; *) REPLACE_TRUNC=1 ;; esac fi ]) else HAVE_DECL_TRUNC=0 fi if test $HAVE_DECL_TRUNC = 0 || test $REPLACE_TRUNC = 1; then dnl No libraries are needed to link lib/trunc.c. TRUNC_LIBM= fi AC_SUBST([TRUNC_LIBM]) ]) groff-1.24.1/gnulib_m4/fprintf-posix.m40000644000175000017500000001505215153275164014571 00000000000000# fprintf-posix.m4 # serial 22 dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_FPRINTF_POSIX], [ AC_REQUIRE([gl_FUNC_FPRINTF_IS_POSIX]) if test $gl_cv_func_fprintf_posix = no; then gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS gl_REPLACE_VASNPRINTF gl_REPLACE_FPRINTF fi ]) dnl Test whether fprintf is POSIX compliant. dnl Result is gl_cv_func_fprintf_posix. AC_DEFUN([gl_FUNC_FPRINTF_IS_POSIX], [ AC_REQUIRE([gl_PRINTF_SIZES_C99]) AC_REQUIRE([gl_PRINTF_SIZES_C23]) AC_REQUIRE([gl_PRINTF_LONG_DOUBLE]) AC_REQUIRE([gl_PRINTF_INFINITE]) AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_A]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_B]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_F]) m4_ifdef([gl_PRINTF_SUPPORT_N_DIRECTIVE],[AC_REQUIRE([gl_PRINTF_DIRECTIVE_N])]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_LC]) AC_REQUIRE([gl_PRINTF_POSITIONS]) AC_REQUIRE([gl_PRINTF_FLAG_GROUPING]) AC_REQUIRE([gl_PRINTF_FLAG_GROUPING_INT_PRECISION]) AC_REQUIRE([gl_PRINTF_FLAG_GROUPING_MULTIBYTE]) AC_REQUIRE([gl_PRINTF_FLAG_LEFTADJUST]) AC_REQUIRE([gl_PRINTF_FLAG_ZERO]) AC_REQUIRE([gl_PRINTF_FLAG_ALT_PRECISION_ZERO]) AC_REQUIRE([gl_PRINTF_PRECISION]) AC_REQUIRE([gl_PRINTF_ENOMEM]) gl_cv_func_fprintf_posix=no case "$gl_cv_func_printf_sizes_c99" in *yes) case "$gl_cv_func_printf_sizes_c23" in *yes) case "$gl_cv_func_printf_long_double" in *yes) case "$gl_cv_func_printf_infinite" in *yes) case "$gl_cv_func_printf_infinite_long_double" in *yes) case "$gl_cv_func_printf_directive_a" in *yes) case "$gl_cv_func_printf_directive_b" in *yes) case "$gl_cv_func_printf_directive_f" in *yes) case m4_ifdef([gl_PRINTF_SUPPORT_N_DIRECTIVE],["$gl_cv_func_printf_directive_n"],["yes"]) in *yes) case "$gl_cv_func_printf_directive_ls" in *yes) case "$gl_cv_func_printf_directive_lc" in *yes) case "$gl_cv_func_printf_positions" in *yes) case "$gl_cv_func_printf_flag_grouping" in *yes) case "$gl_cv_func_printf_flag_grouping_int_precision" in *yes) case "$gl_cv_func_printf_flag_grouping_multibyte" in *yes) case "$gl_cv_func_printf_flag_leftadjust" in *yes) case "$gl_cv_func_printf_flag_zero" in *yes) case "$gl_cv_func_printf_flag_alt_precision_zero" in *yes) case "$gl_cv_func_printf_precision" in *yes) case "$gl_cv_func_printf_enomem" in *yes) # fprintf exists and is # already POSIX compliant. gl_cv_func_fprintf_posix=yes ;; esac ;; esac ;; esac ;; esac ;; esac ;; esac ;; esac ;; esac ;; esac ;; esac ;; esac ;; esac ;; esac ;; esac ;; esac ;; esac ;; esac ;; esac ;; esac ;; esac ]) AC_DEFUN([gl_REPLACE_FPRINTF], [ AC_REQUIRE([gl_STDIO_H_DEFAULTS]) AC_LIBOBJ([fprintf]) REPLACE_FPRINTF=1 AC_DEFINE([REPLACE_FPRINTF_POSIX], [1], [Define if fprintf is overridden by a POSIX compliant gnulib implementation.]) gl_PREREQ_FPRINTF ]) AC_DEFUN([gl_PREREQ_FPRINTF], [:]) groff-1.24.1/gnulib_m4/malloca.m40000644000175000017500000000113215153275164013363 00000000000000# malloca.m4 # serial 3 dnl Copyright (C) 2003-2004, 2006-2007, 2009-2026 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_MALLOCA], [ dnl Use the autoconf tests for alloca(), but not the AC_SUBSTed variables dnl @ALLOCA@ and @LTALLOCA@. dnl gl_FUNC_ALLOCA dnl Already brought in by the module dependencies. AC_REQUIRE([gl_FUNC_MALLOC_GNU]) ]) groff-1.24.1/gnulib_m4/vsnprintf.m40000644000175000017500000000371115153275164014011 00000000000000# vsnprintf.m4 # serial 7 dnl Copyright (C) 2002-2004, 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl Libintl 0.17 will replace vsnprintf only if it does not support %1$s, dnl but defers to any gnulib vsnprintf replacements. Therefore, gnulib dnl must guarantee that the decision for replacing vsnprintf is a superset dnl of the reasons checked by libintl. AC_DEFUN([gl_FUNC_VSNPRINTF], [ AC_REQUIRE([gl_STDIO_H_DEFAULTS]) gl_cv_func_vsnprintf_usable=no AC_CHECK_FUNCS([vsnprintf]) if test $ac_cv_func_vsnprintf = yes; then gl_SNPRINTF_SIZE1 case "$gl_cv_func_snprintf_size1" in *yes) gl_SNPRINTF_RETVAL_C99 case "$gl_cv_func_snprintf_retval_c99" in *yes) gl_PRINTF_POSITIONS case "$gl_cv_func_printf_positions" in *yes) gl_cv_func_vsnprintf_usable=yes ;; esac ;; esac ;; esac fi if test $gl_cv_func_vsnprintf_usable = no; then gl_REPLACE_VSNPRINTF fi AC_CHECK_DECLS_ONCE([vsnprintf]) if test $ac_cv_have_decl_vsnprintf = no; then HAVE_DECL_VSNPRINTF=0 fi ]) AC_DEFUN([gl_REPLACE_VSNPRINTF], [ AC_REQUIRE([gl_STDIO_H_DEFAULTS]) AC_LIBOBJ([vsnprintf]) if test $ac_cv_func_vsnprintf = yes; then REPLACE_VSNPRINTF=1 else AC_CHECK_DECLS_ONCE([vsnprintf]) if test $ac_cv_have_decl_vsnprintf = yes; then dnl If the function is declared but does not appear to exist, it may be dnl defined as an inline function. In order to avoid a conflict, we have dnl to define rpl_vsnprintf, not vsnprintf. REPLACE_VSNPRINTF=1 fi fi gl_PREREQ_VSNPRINTF ]) # Prerequisites of lib/vsnprintf.c. AC_DEFUN([gl_PREREQ_VSNPRINTF], [:]) groff-1.24.1/gnulib_m4/largefile.m40000644000175000017500000003533215153275164013716 00000000000000# largefile.m4 # serial 4 dnl Copyright 1992-1996, 1998-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. # Enable large files on systems where this is not the default. # Enable support for files on Linux file systems with 64-bit inode numbers. # The following macro works around a problem in Autoconf's AC_FUNC_FSEEKO: # It does not set _LARGEFILE_SOURCE=1 on HP-UX/ia64 32-bit, although this # setting of _LARGEFILE_SOURCE is needed so that declares fseeko # and ftello in C++ mode as well. # This problem occurs in Autoconf 2.71 and earlier, which lack AC_SYS_YEAR2038. AC_DEFUN([gl_SET_LARGEFILE_SOURCE], m4_ifndef([AC_SYS_YEAR2038], [[ AC_REQUIRE([AC_CANONICAL_HOST]) AC_FUNC_FSEEKO case "$host_os" in hpux*) AC_DEFINE([_LARGEFILE_SOURCE], [1], [Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2).]) ;; esac ]]) ) dnl Remove AC_SYS_YEAR2038_RECOMMENDED if unpatched Autoconf 2.72 or earlier. dnl Autoconf 2.72 still uses -n32, which is not a C preprocessor option, dnl and which was useful only on IRIX which is no longer supported. dnl This should be fixed in Autoconf 2.73. m4_ifdef([AC_SYS_YEAR2038_RECOMMENDED], [m4_bmatch(m4_ifdef([_AC_SYS_LARGEFILE_OPTIONS], [m4_defn([_AC_SYS_LARGEFILE_OPTIONS])], ["-n32"]), ["-n32"], [m4_undefine([AC_SYS_YEAR2038_RECOMMENDED])])]) m4_ifndef([AC_SYS_YEAR2038_RECOMMENDED], [ # Fix up AC_SYS_YEAR2038_RECOMMENDED and related macros, even if # unpatched Autoconf 2.72 or earlier. This code is taken from Autoconf master. # _AC_SYS_YEAR2038_TEST_CODE # -------------------------- # C code used to probe for time_t that can represent time points more # than 2**31 - 1 seconds after the epoch. With the usual Unix epoch, # these correspond to dates after 2038-01-18 22:14:07 +0000 (Gregorian), # hence the name. AC_DEFUN([_AC_SYS_YEAR2038_TEST_CODE], [[ #include /* Check that time_t can represent 2**32 - 1 correctly. */ #define LARGE_TIME_T \\ ((time_t) (((time_t) 1 << 30) - 1 + 3 * ((time_t) 1 << 30))) int verify_time_t_range[(LARGE_TIME_T / 65537 == 65535 && LARGE_TIME_T % 65537 == 0) ? 1 : -1]; ]]) # _AC_SYS_YEAR2038_OPTIONS # ------------------------ # List of known ways to enable support for large time_t. If you change # this list you probably also need to change the AS_CASE at the end of # _AC_SYS_YEAR2038_PROBE. m4_define([_AC_SYS_YEAR2038_OPTIONS], m4_normalize( ["none needed"] dnl 64-bit and newer 32-bit Unix ["-D_TIME_BITS=64"] dnl glibc 2.34 with some 32-bit ABIs ["-D__MINGW_USE_VC2005_COMPAT"] dnl 32-bit MinGW ["-U_USE_32_BIT_TIME_T -D__MINGW_USE_VC2005_COMPAT"] dnl 32-bit MinGW (misconfiguration) )) # _AC_SYS_YEAR2038_PROBE # ---------------------- # Subroutine of AC_SYS_YEAR2038. Probe for time_t that can represent # time points more than 2**31 - 1 seconds after the epoch (dates after # 2038-01-18, see above) and set the cache variable ac_cv_sys_year2038_opts # to one of the values in the _AC_SYS_YEAR2038_OPTIONS list, or to # "support not detected" if none of them worked. Then, set compilation # options and #defines as necessary to enable large time_t support. # # Note that we do not test whether mktime, localtime, etc. handle # large values of time_t correctly, as that would require use of # AC_TRY_RUN. Note also that some systems only support large time_t # together with large off_t. # # If you change this macro you may also need to change # _AC_SYS_YEAR2038_OPTIONS. AC_DEFUN([_AC_SYS_YEAR2038_PROBE], [AC_CACHE_CHECK([for $CC option to support timestamps after 2038], [ac_cv_sys_year2038_opts], [ac_save_CPPFLAGS="$CPPFLAGS" ac_opt_found=no for ac_opt in _AC_SYS_YEAR2038_OPTIONS; do AS_IF([test x"$ac_opt" != x"none needed"], [CPPFLAGS="$ac_save_CPPFLAGS $ac_opt"]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([_AC_SYS_YEAR2038_TEST_CODE])], [ac_cv_sys_year2038_opts="$ac_opt" ac_opt_found=yes]) test $ac_opt_found = no || break done CPPFLAGS="$ac_save_CPPFLAGS" test $ac_opt_found = yes || ac_cv_sys_year2038_opts="support not detected"]) ac_have_year2038=yes AS_CASE([$ac_cv_sys_year2038_opts], ["none needed"], [], ["support not detected"], [ac_have_year2038=no], ["-D_TIME_BITS=64"], [AC_DEFINE([_TIME_BITS], [64], [Number of bits in time_t, on hosts where this is settable.])], ["-D__MINGW_USE_VC2005_COMPAT"], [AC_DEFINE([__MINGW_USE_VC2005_COMPAT], [1], [Define to 1 on platforms where this makes time_t a 64-bit type.])], ["-U_USE_32_BIT_TIME_T"*], [AC_MSG_FAILURE(m4_text_wrap( [the 'time_t' type is currently forced to be 32-bit. It will stop working after mid-January 2038. Remove _USE_32BIT_TIME_T from the compiler flags.], [], [], [55]))], [AC_MSG_ERROR( [internal error: bad value for \$ac_cv_sys_year2038_opts])]) ]) # _AC_SYS_YEAR2038_ENABLE # ----------------------- # Depending on which of the YEAR2038 macros was used, add either an # --enable-year2038 or a --disable-year2038 to # the configure script. This is expanded very late and # therefore there cannot be any code in the AC_ARG_ENABLE. The # default value for 'enable_year2038' is emitted unconditionally # because the generated code always looks at this variable. m4_define([_AC_SYS_YEAR2038_ENABLE], [m4_divert_text([DEFAULTS], m4_provide_if([AC_SYS_YEAR2038], [enable_year2038=yes], [enable_year2038=no]))]dnl [AC_ARG_ENABLE([year2038], m4_provide_if([AC_SYS_YEAR2038], [AS_HELP_STRING([--disable-year2038], [don't support timestamps after 2038])], [AS_HELP_STRING([--enable-year2038], [support timestamps after 2038])]))]) # AC_SYS_YEAR2038 # --------------- # Attempt to detect and activate support for large time_t. # On systems where time_t is not always 64 bits, this probe can be # skipped by passing the --disable-year2038 option to configure. AC_DEFUN([AC_SYS_YEAR2038], [AC_REQUIRE([AC_SYS_LARGEFILE])dnl AS_IF([test "$enable_year2038,$ac_have_year2038,$cross_compiling" = yes,no,no], [# If we're not cross compiling and 'touch' works with a large # timestamp, then we can presume the system supports wider time_t # *somehow* and we just weren't able to detect it. One common # case that we deliberately *don't* probe for is a system that # supports both 32- and 64-bit ABIs but only the 64-bit ABI offers # wide time_t. (It would be inappropriate for us to override an # intentional use of -m32.) Error out, demanding use of # --disable-year2038 if this is intentional. AS_IF([TZ=UTC0 touch -t 210602070628.15 conftest.time 2>/dev/null], [AS_CASE([`TZ=UTC0 LC_ALL=C ls -l conftest.time 2>/dev/null`], [*'Feb 7 2106'* | *'Feb 7 17:10'*], [AC_MSG_FAILURE(m4_text_wrap( [this system appears to support timestamps after mid-January 2038, but no mechanism for enabling wide 'time_t' was detected. Did you mean to build a 64-bit binary? (E.g., 'CC="${CC} -m64"'.) To proceed with 32-bit time_t, configure with '--disable-year2038'.], [], [], [55]))])])])]) # AC_SYS_YEAR2038_RECOMMENDED # --------------------------- # Same as AC_SYS_YEAR2038, but recommend support for large time_t. # If we cannot find any way to make time_t capable of representing # values larger than 2**31 - 1, error out unless --disable-year2038 is given. AC_DEFUN([AC_SYS_YEAR2038_RECOMMENDED], [AC_REQUIRE([AC_SYS_YEAR2038])dnl AS_IF([test "$enable_year2038,$ac_have_year2038" = yes,no], [AC_MSG_FAILURE(m4_text_wrap( [could not enable timestamps after mid-January 2038. This package recommends support for these later timestamps. However, to proceed with signed 32-bit time_t even though it will fail then, configure with '--disable-year2038'.], [], [], [55]))])]) # _AC_SYS_LARGEFILE_TEST_CODE # --------------------------- # C code used to probe for large file support. m4_define([_AC_SYS_LARGEFILE_TEST_CODE], [@%:@include @%:@ifndef FTYPE @%:@ define FTYPE off_t @%:@endif /* Check that FTYPE can represent 2**63 - 1 correctly. We can't simply define LARGE_FTYPE to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ @%:@define LARGE_FTYPE (((FTYPE) 1 << 31 << 31) - 1 + ((FTYPE) 1 << 31 << 31)) int FTYPE_is_large[[(LARGE_FTYPE % 2147483629 == 721 && LARGE_FTYPE % 2147483647 == 1) ? 1 : -1]];[]dnl ]) # Defined by Autoconf 2.71 and circa 2022 Gnulib unwisely depended on it. m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES], [_AC_SYS_LARGEFILE_TEST_CODE]) # _AC_SYS_LARGEFILE_OPTIONS # ------------------------- # List of known ways to enable support for large files. If you change # this list you probably also need to change the AS_CASE at the end of # _AC_SYS_LARGEFILE_PROBE. m4_define([_AC_SYS_LARGEFILE_OPTIONS], m4_normalize( ["none needed"] dnl Most current systems ["-D_FILE_OFFSET_BITS=64"] dnl X/Open LFS spec ["-D_LARGE_FILES=1"] dnl 32-bit AIX 4.2.1+, 32-bit z/OS )) # _AC_SYS_LARGEFILE_PROBE # ----------------------- # Subroutine of AC_SYS_LARGEFILE. Probe for large file support and set # the cache variable ac_cv_sys_largefile_opts to one of the values in # the _AC_SYS_LARGEFILE_OPTIONS list, or to "support not detected" if # none of the options in that list worked. Then, set compilation # options and #defines as necessary to enable large file support. # # If large file support is not detected, the behavior depends on which of # the top-level AC_SYS_LARGEFILE macros was used (see below). # # If you change this macro you may also need to change # _AC_SYS_LARGEFILE_OPTIONS. AC_DEFUN([_AC_SYS_LARGEFILE_PROBE], [AC_CACHE_CHECK([for $CC option to support large files], [ac_cv_sys_largefile_opts], [ac_save_CPPFLAGS=$CPPFLAGS ac_opt_found=no for ac_opt in _AC_SYS_LARGEFILE_OPTIONS; do AS_IF([test x"$ac_opt" != x"none needed"], [CPPFLAGS="$ac_save_CPPFLAGS $ac_opt"]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_CODE])], [AS_IF([test x"$ac_opt" = x"none needed"], [# GNU/Linux s390x and alpha need _FILE_OFFSET_BITS=64 for wide ino_t. CPPFLAGS="$CPPFLAGS -DFTYPE=ino_t" AC_COMPILE_IFELSE([], [], [CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" AC_COMPILE_IFELSE([], [ac_opt='-D_FILE_OFFSET_BITS=64'])])]) ac_cv_sys_largefile_opts=$ac_opt ac_opt_found=yes]) test $ac_opt_found = no || break done CPPFLAGS=$ac_save_CPPFLAGS dnl Gnulib implements large file support for native Windows, based on the dnl variables WINDOWS_64_BIT_OFF_T, WINDOWS_64_BIT_ST_SIZE. m4_ifdef([gl_LARGEFILE], [ AC_REQUIRE([AC_CANONICAL_HOST]) if test $ac_opt_found != yes; then AS_CASE([$host_os], [mingw* | windows*], [ac_cv_sys_largefile_opts="supported through gnulib" ac_opt_found=yes] ) fi ]) test $ac_opt_found = yes || ac_cv_sys_largefile_opts="support not detected"]) ac_have_largefile=yes AS_CASE([$ac_cv_sys_largefile_opts], ["none needed"], [], ["supported through gnulib"], [], ["support not detected"], [ac_have_largefile=no], ["-D_FILE_OFFSET_BITS=64"], [AC_DEFINE([_FILE_OFFSET_BITS], [64], [Number of bits in a file offset, on hosts where this is settable.])], ["-D_LARGE_FILES=1"], [AC_DEFINE([_LARGE_FILES], [1], [Define to 1 on platforms where this makes off_t a 64-bit type.])], [AC_MSG_ERROR( [internal error: bad value for \$ac_cv_sys_largefile_opts])]) AS_IF([test "$enable_year2038" != no], [_AC_SYS_YEAR2038_PROBE]) AC_CONFIG_COMMANDS_PRE([_AC_SYS_YEAR2038_ENABLE])]) # AC_SYS_LARGEFILE # ---------------- # By default, many hosts won't let programs access large files; # one must use special compiler options to get large-file access to work. # For more details about this brain damage please see: # https://www.unix.org/version2/whatsnew/lfs20mar.html # Additionally, on Linux file systems with 64-bit inodes a file that happens # to have a 64-bit inode number cannot be accessed by 32-bit applications on # Linux x86/x86_64. This can occur with file systems such as XFS and NFS. AC_DEFUN([AC_SYS_LARGEFILE], [AC_ARG_ENABLE([largefile], [AS_HELP_STRING([--disable-largefile], [omit support for large files])])dnl AS_IF([test "$enable_largefile,$enable_year2038" != no,no], [_AC_SYS_LARGEFILE_PROBE])]) ])# m4_ifndef AC_SYS_YEAR2038_RECOMMENDED # Enable large files on systems where this is implemented by Gnulib, not by the # system headers. # Set the variables WINDOWS_64_BIT_OFF_T, WINDOWS_64_BIT_ST_SIZE if Gnulib # overrides ensure that off_t or 'struct size.st_size' are 64-bit, respectively. AC_DEFUN([gl_LARGEFILE], [ AC_REQUIRE([AC_CANONICAL_HOST]) case "$host_os" in mingw* | windows*) dnl Native Windows. dnl mingw64 defines off_t to a 64-bit type already, if dnl _FILE_OFFSET_BITS=64, which is ensured by AC_SYS_LARGEFILE. AC_CACHE_CHECK([for 64-bit off_t], [gl_cv_type_off_t_64], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1]; ]], [[]])], [gl_cv_type_off_t_64=yes], [gl_cv_type_off_t_64=no]) ]) if test $gl_cv_type_off_t_64 = no; then WINDOWS_64_BIT_OFF_T=1 else WINDOWS_64_BIT_OFF_T=0 fi dnl Some mingw versions define, if _FILE_OFFSET_BITS=64, 'struct stat' dnl to 'struct _stat32i64' or 'struct _stat64' (depending on dnl _USE_32BIT_TIME_T), which has a 32-bit st_size member. AC_CACHE_CHECK([for 64-bit st_size], [gl_cv_member_st_size_64], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include struct stat buf; int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1]; ]], [[]])], [gl_cv_member_st_size_64=yes], [gl_cv_member_st_size_64=no]) ]) if test $gl_cv_member_st_size_64 = no; then WINDOWS_64_BIT_ST_SIZE=1 else WINDOWS_64_BIT_ST_SIZE=0 fi ;; *) dnl Nothing to do on gnulib's side. dnl A 64-bit off_t is dnl - already the default on Mac OS X, FreeBSD, NetBSD, OpenBSD, Cygwin, dnl - enabled by _FILE_OFFSET_BITS=64 (ensured by AC_SYS_LARGEFILE) on dnl glibc, HP-UX, Solaris, dnl - enabled by _LARGE_FILES=1 (ensured by AC_SYS_LARGEFILE) on AIX, dnl - impossible to achieve on Minix 3.1.8. WINDOWS_64_BIT_OFF_T=0 WINDOWS_64_BIT_ST_SIZE=0 ;; esac ]) groff-1.24.1/gnulib_m4/iswxdigit.m40000644000175000017500000000643315153275164013777 00000000000000# iswxdigit.m4 # serial 9 dnl Copyright (C) 2020-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_ISWXDIGIT], [ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) AC_REQUIRE([gl_WCTYPE_H]) AC_REQUIRE([gt_LOCALE_JA]) AC_REQUIRE([gt_LOCALE_EN_UTF8]) AC_REQUIRE([gt_LOCALE_ZH_CN]) AC_REQUIRE([AC_CANONICAL_HOST]) if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then dnl redefines iswxdigit already. REPLACE_ISWXDIGIT="$REPLACE_ISWCNTRL" else AC_CACHE_CHECK([whether iswxdigit is ISO C compliant], [gl_cv_func_iswxdigit_works], [ dnl Initial guess, used when cross-compiling or when no suitable locale dnl is present. changequote(,)dnl case "$host_os" in # Guess no on FreeBSD, NetBSD, OpenBSD, Solaris, native Windows, Haiku, Android. freebsd* | dragonfly* | netbsd* | openbsd* | solaris* | mingw* | windows* | haiku* | *-android*) gl_cv_func_iswxdigit_works="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_iswxdigit_works="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_JA != none || test "$LOCALE_EN_UTF8" != none || test $LOCALE_ZH_CN != none; then AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include #include #include /* Returns the value of iswxdigit for the multibyte character s[0..n-1]. */ static int for_character (const char *s, size_t n) { mbstate_t state; wchar_t wc; size_t ret; memset (&state, '\0', sizeof (mbstate_t)); wc = (wchar_t) 0xBADFACE; ret = mbrtowc (&wc, s, n, &state); if (ret != n) abort (); return iswxdigit (wc); } int main (int argc, char *argv[]) { int is; int result = 0; if (strcmp ("$LOCALE_JA", "none") != 0 && setlocale (LC_ALL, "$LOCALE_JA") != NULL) { /* This fails on NetBSD 10.0. */ /* U+FF21 FULLWIDTH LATIN CAPITAL LETTER A */ is = for_character ("\243\301", 2); if (!(is == 0)) result |= 1; } if (strcmp ("$LOCALE_EN_UTF8", "none") != 0 && setlocale (LC_ALL, "$LOCALE_EN_UTF8") != NULL) { /* This fails on FreeBSD 13.0, Haiku, Android. */ /* U+0663 ARABIC-INDIC DIGIT THREE */ is = for_character ("\331\243", 2); if (!(is == 0)) result |= 2; /* This fails on NetBSD 10.0, OpenBSD 7.5, MSVC 14, Haiku, Android. */ /* U+FF21 FULLWIDTH LATIN CAPITAL LETTER A */ is = for_character ("\357\274\241", 3); if (!(is == 0)) result |= 4; } if (strcmp ("$LOCALE_ZH_CN", "none") != 0 && setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) { /* This fails on Solaris 10, Solaris 11.4. */ /* U+FF11 FULLWIDTH DIGIT ONE */ is = for_character ("\243\261", 2); if (!(is == 0)) result |= 8; } return result; }]])], [gl_cv_func_iswxdigit_works=yes], [gl_cv_func_iswxdigit_works=no], [:]) fi ]) case "$gl_cv_func_iswxdigit_works" in *yes) ;; *) REPLACE_ISWXDIGIT=1 ;; esac fi ]) groff-1.24.1/gnulib_m4/sys_wait_h.m40000644000175000017500000000360615153275164014134 00000000000000# sys_wait_h.m4 # serial 9 dnl Copyright (C) 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN_ONCE([gl_SYS_WAIT_H], [ AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS]) dnl is always overridden, because of GNULIB_POSIXCHECK. gl_CHECK_NEXT_HEADERS([sys/wait.h]) dnl Ensure the type pid_t gets defined. AC_REQUIRE([AC_TYPE_PID_T]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[#include ]], [waitpid]) ]) # gl_SYS_WAIT_MODULE_INDICATOR([modulename]) # sets the shell variable that indicates the presence of the given module # to a C preprocessor expression that will evaluate to 1. # This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_SYS_WAIT_MODULE_INDICATOR], [ dnl Ensure to expand the default settings once only. gl_SYS_WAIT_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) # Initializes the default values for AC_SUBSTed shell variables. # This macro must not be AC_REQUIREd. It must only be invoked, and only # outside of macros or in macros that are not AC_REQUIREd. AC_DEFUN([gl_SYS_WAIT_H_REQUIRE_DEFAULTS], [ m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_WAIT_H_MODULE_INDICATOR_DEFAULTS], [ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WAITPID]) ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_WAIT_H_MODULE_INDICATOR_DEFAULTS]) AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS]) ]) AC_DEFUN([gl_SYS_WAIT_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. ]) groff-1.24.1/gnulib_m4/multiarch.m40000644000175000017500000000431015153275164013744 00000000000000# multiarch.m4 # serial 9 dnl Copyright (C) 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. # Determine whether the compiler is or may be producing universal binaries. # # On Mac OS X 10.5 and later systems, the user can create libraries and # executables that work on multiple system types--known as "fat" or # "universal" binaries--by specifying multiple '-arch' options to the # compiler but only a single '-arch' option to the preprocessor. Like # this: # # ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ # CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ # CPP="gcc -E" CXXCPP="g++ -E" # # Detect this situation and set APPLE_UNIVERSAL_BUILD accordingly. AC_DEFUN_ONCE([gl_MULTIARCH], [ dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN. AC_CACHE_CHECK([whether the compiler produces multi-arch binaries], [gl_cv_c_multiarch], [gl_cv_c_multiarch=no AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; ]])], [ dnl Check for potential -arch flags. It is not universal unless dnl there are at least two -arch flags with different values. arch= prev= for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do if test -n "$prev"; then case $word in i?86 | x86_64 | ppc | ppc64 | arm | arm64) if test -z "$arch" || test "$arch" = "$word"; then arch="$word" else gl_cv_c_multiarch=yes fi ;; esac prev= else if test "x$word" = "x-arch"; then prev=arch fi fi done ]) ]) if test $gl_cv_c_multiarch = yes; then APPLE_UNIVERSAL_BUILD=1 else APPLE_UNIVERSAL_BUILD=0 fi AC_SUBST([APPLE_UNIVERSAL_BUILD]) ]) groff-1.24.1/gnulib_m4/unitypes_h.m40000644000175000017500000000161415153275164014147 00000000000000# unitypes_h.m4 # serial 1 dnl Copyright (C) 2021-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN_ONCE([gl_UNITYPES_H], [ AH_VERBATIM([unitypes_restrict], [ /* This definition is a duplicate of the one in unitypes.h. It is here so that we can cope with an older version of unitypes.h that does not contain this definition and that is pre-installed among the public header files. */ # if defined __restrict \ || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \ || __clang_major__ >= 3 # define _UC_RESTRICT __restrict # elif 199901L <= __STDC_VERSION__ || defined restrict # define _UC_RESTRICT restrict # else # define _UC_RESTRICT # endif ]) ]) groff-1.24.1/gnulib_m4/inttypes.m40000644000175000017500000001440215153275164013636 00000000000000# inttypes.m4 # serial 37 dnl Copyright (C) 2006-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Derek Price, Bruno Haible. dnl Test whether is supported or must be substituted. AC_DEFUN_ONCE([gl_INTTYPES_H], [ AC_REQUIRE([gl_INTTYPES_INCOMPLETE]) gl_INTTYPES_PRI_SCN ]) AC_DEFUN_ONCE([gl_INTTYPES_INCOMPLETE], [ AC_REQUIRE([gl_STDINT_H]) AC_CHECK_HEADERS_ONCE([inttypes.h]) dnl Override always, so that the portability warnings work. AC_REQUIRE([gl_INTTYPES_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([inttypes.h]) AC_REQUIRE([gl_MULTIARCH]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[#include ]], [imaxabs imaxdiv strtoimax strtoumax]) AC_REQUIRE([AC_C_RESTRICT]) ]) # Ensure that the PRI* and SCN* macros are defined appropriately. AC_DEFUN([gl_INTTYPES_PRI_SCN], [ PRIPTR_PREFIX= if $GL_GENERATE_STDINT_H; then dnl Using the gnulib . It defines intptr_t to 'long' or dnl 'long long', depending on _WIN64. AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[ #ifdef _WIN64 LLP64 #endif ]]) ], [PRIPTR_PREFIX='"l"'], [PRIPTR_PREFIX='"ll"']) else dnl Using the system's . for glpfx in '' l ll I64; do case $glpfx in '') gltype1='int';; l) gltype1='long int';; ll) gltype1='long long int';; I64) gltype1='__int64';; esac AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include extern intptr_t foo; extern $gltype1 foo;]])], [PRIPTR_PREFIX='"'$glpfx'"']) test -n "$PRIPTR_PREFIX" && break done fi AC_SUBST([PRIPTR_PREFIX]) gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION( [INT32_MAX_LT_INTMAX_MAX], [defined INT32_MAX && defined INTMAX_MAX], [INT32_MAX < INTMAX_MAX], [sizeof (int) < sizeof (long long int)]) if test $APPLE_UNIVERSAL_BUILD = 0; then gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION( [INT64_MAX_EQ_LONG_MAX], [defined INT64_MAX], [INT64_MAX == LONG_MAX], [sizeof (long long int) == sizeof (long int)]) else INT64_MAX_EQ_LONG_MAX=-1 fi gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION( [UINT32_MAX_LT_UINTMAX_MAX], [defined UINT32_MAX && defined UINTMAX_MAX], [UINT32_MAX < UINTMAX_MAX], [sizeof (unsigned int) < sizeof (unsigned long long int)]) if test $APPLE_UNIVERSAL_BUILD = 0; then gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION( [UINT64_MAX_EQ_ULONG_MAX], [defined UINT64_MAX], [UINT64_MAX == ULONG_MAX], [sizeof (unsigned long long int) == sizeof (unsigned long int)]) else UINT64_MAX_EQ_ULONG_MAX=-1 fi ]) # Define the symbol $1 to be 1 if the condition is true, 0 otherwise. # If $2 is true, the condition is $3; otherwise if long long int is supported # approximate the condition with $4; otherwise, assume the condition is false. # The condition should work on all C99 platforms; the approximations should be # good enough to work on all practical pre-C99 platforms. # $2 is evaluated by the C preprocessor, $3 and $4 as compile-time constants. AC_DEFUN([gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION], [ AC_CACHE_CHECK([whether $3], [gl_cv_test_$1], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[/* Work also in C++ mode. */ #define __STDC_LIMIT_MACROS 1 /* Work if build is not clean. */ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H #include #if HAVE_STDINT_H #include #endif #if $2 #define CONDITION ($3) #else #define CONDITION ($4) #endif int test[CONDITION ? 1 : -1];]])], [gl_cv_test_$1=yes], [gl_cv_test_$1=no])]) if test $gl_cv_test_$1 = yes; then $1=1; else $1=0; fi AC_SUBST([$1]) ]) # gl_INTTYPES_MODULE_INDICATOR([modulename]) # sets the shell variable that indicates the presence of the given module # to a C preprocessor expression that will evaluate to 1. # This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_INTTYPES_MODULE_INDICATOR], [ dnl Ensure to expand the default settings once only. gl_INTTYPES_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$1]) ]) # Initializes the default values for AC_SUBSTed shell variables. # This macro must not be AC_REQUIREd. It must only be invoked, and only # outside of macros or in macros that are not AC_REQUIREd. AC_DEFUN([gl_INTTYPES_H_REQUIRE_DEFAULTS], [ m4_defun(GL_MODULE_INDICATOR_PREFIX[_INTTYPES_H_MODULE_INDICATOR_DEFAULTS], [ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_IMAXABS]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_IMAXDIV]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOIMAX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOUMAX]) ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_INTTYPES_H_MODULE_INDICATOR_DEFAULTS]) AC_REQUIRE([gl_INTTYPES_H_DEFAULTS]) ]) AC_DEFUN([gl_INTTYPES_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DECL_IMAXABS=1; AC_SUBST([HAVE_DECL_IMAXABS]) HAVE_DECL_IMAXDIV=1; AC_SUBST([HAVE_DECL_IMAXDIV]) HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX]) HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX]) HAVE_IMAXDIV_T=1; AC_SUBST([HAVE_IMAXDIV_T]) HAVE_IMAXABS=1; AC_SUBST([HAVE_IMAXABS]) HAVE_IMAXDIV=1; AC_SUBST([HAVE_IMAXDIV]) REPLACE_IMAXABS=0; AC_SUBST([REPLACE_IMAXABS]) REPLACE_IMAXDIV=0; AC_SUBST([REPLACE_IMAXDIV]) REPLACE_STRTOIMAX=0; AC_SUBST([REPLACE_STRTOIMAX]) REPLACE_STRTOUMAX=0; AC_SUBST([REPLACE_STRTOUMAX]) INT32_MAX_LT_INTMAX_MAX=1; AC_SUBST([INT32_MAX_LT_INTMAX_MAX]) INT64_MAX_EQ_LONG_MAX='defined _LP64'; AC_SUBST([INT64_MAX_EQ_LONG_MAX]) PRIPTR_PREFIX=__PRIPTR_PREFIX; AC_SUBST([PRIPTR_PREFIX]) UINT32_MAX_LT_UINTMAX_MAX=1; AC_SUBST([UINT32_MAX_LT_UINTMAX_MAX]) UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; AC_SUBST([UINT64_MAX_EQ_ULONG_MAX]) ]) groff-1.24.1/gnulib_m4/build-to-host.m40000644000175000017500000002203215153275164014447 00000000000000# build-to-host.m4 # serial 5 dnl Copyright (C) 2023-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl Written by Bruno Haible. dnl When the build environment ($build_os) is different from the target runtime dnl environment ($host_os), file names may need to be converted from the build dnl environment syntax to the target runtime environment syntax. This is dnl because the Makefiles are executed (mostly) by build environment tools and dnl therefore expect file names in build environment syntax, whereas the runtime dnl expects file names in target runtime environment syntax. dnl dnl For example, if $build_os = cygwin and $host_os = mingw32, filenames need dnl be converted from Cygwin syntax to native Windows syntax: dnl /cygdrive/c/foo/bar -> C:\foo\bar dnl /usr/local/share -> C:\cygwin64\usr\local\share dnl dnl gl_BUILD_TO_HOST([somedir]) dnl This macro takes as input an AC_SUBSTed variable 'somedir', which must dnl already have its final value assigned, and produces two additional dnl AC_SUBSTed variables 'somedir_c' and 'somedir_c_make', that designate the dnl same file name value, just in different syntax: dnl - somedir_c is the file name in target runtime environment syntax, dnl as a C string (starting and ending with a double-quote, dnl and with escaped backslashes and double-quotes in dnl between). dnl - somedir_c_make is the same thing, escaped for use in a Makefile. AC_DEFUN([gl_BUILD_TO_HOST], [ AC_REQUIRE([AC_CANONICAL_BUILD]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_BUILD_TO_HOST_INIT]) dnl Define somedir_c. gl_final_[$1]="$[$1]" dnl Translate it from build syntax to host syntax. case "$build_os" in cygwin*) case "$host_os" in mingw* | windows*) gl_final_[$1]=`cygpath -w "$gl_final_[$1]"` ;; esac ;; esac dnl Convert it to C string syntax. [$1]_c=`printf '%s\n' "$gl_final_[$1]" | sed -e "$gl_sed_double_backslashes" -e "$gl_sed_escape_doublequotes" | tr -d "$gl_tr_cr"` [$1]_c='"'"$[$1]_c"'"' AC_SUBST([$1_c]) dnl Define somedir_c_make. [$1]_c_make=`printf '%s\n' "$[$1]_c" | sed -e "$gl_sed_escape_for_make_1" -e "$gl_sed_escape_for_make_2" | tr -d "$gl_tr_cr"` dnl Use the substituted somedir variable, when possible, so that the user dnl may adjust somedir a posteriori when there are no special characters. if test "$[$1]_c_make" = '\"'"${gl_final_[$1]}"'\"'; then [$1]_c_make='\"$([$1])\"' fi AC_SUBST([$1_c_make]) ]) dnl Some initializations for gl_BUILD_TO_HOST. AC_DEFUN([gl_BUILD_TO_HOST_INIT], [ gl_sed_double_backslashes='s/\\/\\\\/g' gl_sed_escape_doublequotes='s/"/\\"/g' changequote(,)dnl gl_sed_escape_for_make_1="s,\\([ \"&'();<>\\\\\`|]\\),\\\\\\1,g" changequote([,])dnl gl_sed_escape_for_make_2='s,\$,\\$$,g' dnl Find out how to remove carriage returns from output. Solaris /usr/ucb/tr dnl does not understand '\r'. case `echo r | tr -d '\r'` in '') gl_tr_cr='\015' ;; *) gl_tr_cr='\r' ;; esac ]) dnl The following macros are convenience invocations of gl_BUILD_TO_HOST dnl for some of the variables that are defined by Autoconf. dnl To do so for _all_ the possible variables, use the module 'configmake'. dnl Defines bindir_c and bindir_c_make. AC_DEFUN_ONCE([gl_BUILD_TO_HOST_BINDIR], [ dnl Find the final value of bindir. gl_saved_prefix="${prefix}" gl_saved_exec_prefix="${exec_prefix}" gl_saved_bindir="${bindir}" dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then prefix="$ac_default_prefix" fi if test "X$exec_prefix" = "XNONE"; then exec_prefix='${prefix}' fi eval exec_prefix="$exec_prefix" eval bindir="$bindir" gl_BUILD_TO_HOST([bindir]) bindir="${gl_saved_bindir}" exec_prefix="${gl_saved_exec_prefix}" prefix="${gl_saved_prefix}" ]) dnl Defines datadir_c and datadir_c_make, dnl where datadir = $(datarootdir) AC_DEFUN_ONCE([gl_BUILD_TO_HOST_DATADIR], [ dnl Find the final value of datadir. gl_saved_prefix="${prefix}" gl_saved_datarootdir="${datarootdir}" gl_saved_datadir="${datadir}" dnl Unfortunately, prefix gets only finally determined at the end of dnl configure. if test "X$prefix" = "XNONE"; then prefix="$ac_default_prefix" fi eval datarootdir="$datarootdir" eval datadir="$datadir" gl_BUILD_TO_HOST([datadir]) datadir="${gl_saved_datadir}" datarootdir="${gl_saved_datarootdir}" prefix="${gl_saved_prefix}" ]) dnl Defines libdir_c and libdir_c_make. AC_DEFUN_ONCE([gl_BUILD_TO_HOST_LIBDIR], [ dnl Find the final value of libdir. gl_saved_prefix="${prefix}" gl_saved_exec_prefix="${exec_prefix}" gl_saved_libdir="${libdir}" dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then prefix="$ac_default_prefix" fi if test "X$exec_prefix" = "XNONE"; then exec_prefix='${prefix}' fi eval exec_prefix="$exec_prefix" eval libdir="$libdir" gl_BUILD_TO_HOST([libdir]) libdir="${gl_saved_libdir}" exec_prefix="${gl_saved_exec_prefix}" prefix="${gl_saved_prefix}" ]) dnl Defines libexecdir_c and libexecdir_c_make. AC_DEFUN_ONCE([gl_BUILD_TO_HOST_LIBEXECDIR], [ dnl Find the final value of libexecdir. gl_saved_prefix="${prefix}" gl_saved_exec_prefix="${exec_prefix}" gl_saved_libexecdir="${libexecdir}" dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then prefix="$ac_default_prefix" fi if test "X$exec_prefix" = "XNONE"; then exec_prefix='${prefix}' fi eval exec_prefix="$exec_prefix" eval libexecdir="$libexecdir" gl_BUILD_TO_HOST([libexecdir]) libexecdir="${gl_saved_libexecdir}" exec_prefix="${gl_saved_exec_prefix}" prefix="${gl_saved_prefix}" ]) dnl Defines localedir_c and localedir_c_make. AC_DEFUN_ONCE([gl_BUILD_TO_HOST_LOCALEDIR], [ dnl Find the final value of localedir. gl_saved_prefix="${prefix}" gl_saved_datarootdir="${datarootdir}" gl_saved_localedir="${localedir}" dnl Unfortunately, prefix gets only finally determined at the end of dnl configure. if test "X$prefix" = "XNONE"; then prefix="$ac_default_prefix" fi eval datarootdir="$datarootdir" eval localedir="$localedir" gl_BUILD_TO_HOST([localedir]) localedir="${gl_saved_localedir}" datarootdir="${gl_saved_datarootdir}" prefix="${gl_saved_prefix}" ]) dnl Defines pkgdatadir_c and pkgdatadir_c_make, dnl where pkgdatadir = $(datadir)/$(PACKAGE) AC_DEFUN_ONCE([gl_BUILD_TO_HOST_PKGDATADIR], [ dnl Find the final value of pkgdatadir. gl_saved_prefix="${prefix}" gl_saved_datarootdir="${datarootdir}" gl_saved_datadir="${datadir}" gl_saved_pkgdatadir="${pkgdatadir}" dnl Unfortunately, prefix gets only finally determined at the end of dnl configure. if test "X$prefix" = "XNONE"; then prefix="$ac_default_prefix" fi eval datarootdir="$datarootdir" eval datadir="$datadir" eval pkgdatadir="$pkgdatadir" gl_BUILD_TO_HOST([pkgdatadir]) pkgdatadir="${gl_saved_pkgdatadir}" datadir="${gl_saved_datadir}" datarootdir="${gl_saved_datarootdir}" prefix="${gl_saved_prefix}" ]) dnl Defines pkglibdir_c and pkglibdir_c_make, dnl where pkglibdir = $(libdir)/$(PACKAGE) AC_DEFUN_ONCE([gl_BUILD_TO_HOST_PKGLIBDIR], [ dnl Find the final value of pkglibdir. gl_saved_prefix="${prefix}" gl_saved_exec_prefix="${exec_prefix}" gl_saved_libdir="${libdir}" gl_saved_pkglibdir="${pkglibdir}" dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then prefix="$ac_default_prefix" fi if test "X$exec_prefix" = "XNONE"; then exec_prefix='${prefix}' fi eval exec_prefix="$exec_prefix" eval libdir="$libdir" eval pkglibdir="$pkglibdir" gl_BUILD_TO_HOST([pkglibdir]) pkglibdir="${gl_saved_pkglibdir}" libdir="${gl_saved_libdir}" exec_prefix="${gl_saved_exec_prefix}" prefix="${gl_saved_prefix}" ]) dnl Defines pkglibexecdir_c and pkglibexecdir_c_make, dnl where pkglibexecdir = $(libexecdir)/$(PACKAGE) AC_DEFUN_ONCE([gl_BUILD_TO_HOST_PKGLIBEXECDIR], [ dnl Find the final value of pkglibexecdir. gl_saved_prefix="${prefix}" gl_saved_exec_prefix="${exec_prefix}" gl_saved_libexecdir="${libexecdir}" gl_saved_pkglibexecdir="${pkglibexecdir}" dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then prefix="$ac_default_prefix" fi if test "X$exec_prefix" = "XNONE"; then exec_prefix='${prefix}' fi eval exec_prefix="$exec_prefix" eval libexecdir="$libexecdir" eval pkglibexecdir="$pkglibexecdir" gl_BUILD_TO_HOST([pkglibexecdir]) pkglibexecdir="${gl_saved_pkglibexecdir}" libexecdir="${gl_saved_libexecdir}" exec_prefix="${gl_saved_exec_prefix}" prefix="${gl_saved_prefix}" ]) groff-1.24.1/gnulib_m4/gnulib-i18n.m40000644000175000017500000000463115153275164014017 00000000000000# gnulib-i18n.m4 # serial 1 dnl Copyright (C) 2005-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Bruno Haible. dnl Support for internationalization of Gnulib code. dnl GNULIB_I18N dnl Sets GNULIB_LOCALEDIR to indicate where to find the gnulib.mo files. dnl Also it defines GNULIB_LOCALEDIR as macro in config.h, that expands to dnl the corresponding C string. AC_DEFUN([GNULIB_I18N], [ dnl It is best to not test "$USE_NLS" here, because: It would be empty dnl in case the package is internationalized but this macro is used before dnl AM_GNU_GETTEXT. We would need to warn about this situation. But since dnl this module is used as a dependency of many packages, such a warning is dnl not welcome. dnl Determine gnulib's localedir. dnl Generally, accept an option --with-gnulib-prefix=PREFIX to indicate dnl where to find gnulib's runtime data. dnl Usually ${prefix}/share/locale, but can be influenced by the configure dnl options --datarootdir and --localedir. GNULIB_LOCALEDIR="${localedir}" AC_ARG_WITH([gnulib-prefix], [[ --with-gnulib-prefix=DIR search for gnulib's runtime data in DIR/share]], [if test "X$withval" != "X" && test "X$withval" != "Xno"; then GNULIB_LOCALEDIR="$withval/share/locale" fi ]) AC_SUBST([GNULIB_LOCALEDIR]) dnl Define GNULIB_LOCALEDIR_c and GNULIB_LOCALEDIR_c_make. dnl Find the final value of GNULIB_LOCALEDIR. gl_saved_prefix="${prefix}" gl_saved_datarootdir="${datarootdir}" gl_saved_localedir="${localedir}" gl_saved_gnuliblocaledir="${GNULIB_LOCALEDIR}" dnl Unfortunately, prefix gets only finally determined at the end of dnl configure. if test "X$prefix" = "XNONE"; then prefix="$ac_default_prefix" fi eval datarootdir="$datarootdir" eval localedir="$localedir" eval GNULIB_LOCALEDIR="$GNULIB_LOCALEDIR" gl_BUILD_TO_HOST([GNULIB_LOCALEDIR]) GNULIB_LOCALEDIR="${gl_saved_gnuliblocaledir}" localedir="${gl_saved_localedir}" datarootdir="${gl_saved_datarootdir}" prefix="${gl_saved_prefix}" AC_DEFINE_UNQUOTED([GNULIB_LOCALEDIR], [${GNULIB_LOCALEDIR_c}], [Define to the directory where to find the localizations of the translation domain 'gnulib', as a C string.]) ]) groff-1.24.1/gnulib_m4/pthread_h.m40000644000175000017500000003574015153275164013725 00000000000000# pthread_h.m4 # serial 11 dnl Copyright (C) 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN_ONCE([gl_PTHREAD_H_PART1], [ dnl Ensure to expand the default settings once only, before all statements dnl that occur in other macros. AC_REQUIRE([gl_PTHREAD_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_PTHREADLIB]) gl_CHECK_NEXT_HEADERS([pthread.h]) if test $ac_cv_header_pthread_h = yes; then HAVE_PTHREAD_H=1 dnl On mingw, if --enable-threads=windows or gl_AVOID_WINPTHREAD is used, dnl ignore the from the mingw-w64 winpthreads library. m4_ifdef([gl_][THREADLIB], [ AC_REQUIRE([gl_][THREADLIB]) if { case "$host_os" in mingw* | windows*) true;; *) false;; esac; } \ && test $gl_threads_api = windows; then HAVE_PTHREAD_H=0 fi ]) else HAVE_PTHREAD_H=0 fi AC_SUBST([HAVE_PTHREAD_H]) AC_CHECK_TYPES([pthread_t, pthread_spinlock_t], [], [], [AC_INCLUDES_DEFAULT[ #if HAVE_PTHREAD_H #include #endif]]) if test $ac_cv_type_pthread_t != yes; then HAVE_PTHREAD_T=0 fi if test $ac_cv_type_pthread_spinlock_t != yes; then HAVE_PTHREAD_SPINLOCK_T=0 fi ]) AC_DEFUN([gl_PTHREAD_H], [ AC_REQUIRE([gl_PTHREAD_H_PART1]) dnl Set HAVE_PTHREAD_SPIN_INIT, REPLACE_PTHREAD_SPIN_INIT. gl_PTHREAD_SPIN dnl Constants may be defined as C preprocessor macros or as enum items. AC_CACHE_CHECK([for PTHREAD_CREATE_DETACHED], [gl_cv_const_PTHREAD_CREATE_DETACHED], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include int x = PTHREAD_CREATE_DETACHED; ]], [[]])], [gl_cv_const_PTHREAD_CREATE_DETACHED=yes], [gl_cv_const_PTHREAD_CREATE_DETACHED=no]) ]) if test $gl_cv_const_PTHREAD_CREATE_DETACHED != yes; then HAVE_PTHREAD_CREATE_DETACHED=0 fi AC_CACHE_CHECK([for PTHREAD_MUTEX_RECURSIVE], [gl_cv_const_PTHREAD_MUTEX_RECURSIVE], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include int x = PTHREAD_MUTEX_RECURSIVE; ]], [[]])], [gl_cv_const_PTHREAD_MUTEX_RECURSIVE=yes], [gl_cv_const_PTHREAD_MUTEX_RECURSIVE=no]) ]) if test $gl_cv_const_PTHREAD_MUTEX_RECURSIVE != yes; then HAVE_PTHREAD_MUTEX_RECURSIVE=0 fi AC_CACHE_CHECK([for PTHREAD_MUTEX_ROBUST], [gl_cv_const_PTHREAD_MUTEX_ROBUST], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include int x = PTHREAD_MUTEX_ROBUST; ]], [[]])], [gl_cv_const_PTHREAD_MUTEX_ROBUST=yes], [gl_cv_const_PTHREAD_MUTEX_ROBUST=no]) ]) if test $gl_cv_const_PTHREAD_MUTEX_ROBUST != yes; then HAVE_PTHREAD_MUTEX_ROBUST=0 fi AC_CACHE_CHECK([for PTHREAD_PROCESS_SHARED], [gl_cv_const_PTHREAD_PROCESS_SHARED], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include int x = PTHREAD_PROCESS_SHARED; ]], [[]])], [gl_cv_const_PTHREAD_PROCESS_SHARED=yes], [gl_cv_const_PTHREAD_PROCESS_SHARED=no]) ]) if test $gl_cv_const_PTHREAD_PROCESS_SHARED != yes; then HAVE_PTHREAD_PROCESS_SHARED=0 fi dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use, if it is not common dnl enough to be declared everywhere. gl_WARN_ON_USE_PREPARE([[#include ]], [ pthread_create pthread_attr_init pthread_attr_getdetachstate pthread_attr_setdetachstate pthread_attr_destroy pthread_self pthread_equal pthread_detach pthread_join pthread_exit pthread_once pthread_mutex_init pthread_mutexattr_init pthread_mutexattr_gettype pthread_mutexattr_settype pthread_mutexattr_getrobust pthread_mutexattr_setrobust pthread_mutexattr_destroy pthread_mutex_lock pthread_mutex_trylock pthread_mutex_timedlock pthread_mutex_unlock pthread_mutex_destroy pthread_rwlock_init pthread_rwlockattr_init pthread_rwlockattr_destroy pthread_rwlock_rdlock pthread_rwlock_wrlock pthread_rwlock_tryrdlock pthread_rwlock_trywrlock pthread_rwlock_timedrdlock pthread_rwlock_timedwrlock pthread_rwlock_unlock pthread_rwlock_destroy pthread_cond_init pthread_condattr_init pthread_condattr_destroy pthread_cond_wait pthread_cond_timedwait pthread_cond_signal pthread_cond_broadcast pthread_cond_destroy pthread_key_create pthread_setspecific pthread_getspecific pthread_key_delete pthread_spin_init pthread_spin_lock pthread_spin_trylock pthread_spin_unlock pthread_spin_destroy]) AC_REQUIRE([AC_C_RESTRICT]) dnl For backward compatibility with gnulib versions <= 2019-07. LIB_PTHREAD="$LIBPMULTITHREAD" AC_SUBST([LIB_PTHREAD]) ]) # gl_PTHREAD_MODULE_INDICATOR([modulename]) # sets the shell variable that indicates the presence of the given module # to a C preprocessor expression that will evaluate to 1. # This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_PTHREAD_MODULE_INDICATOR], [ dnl Ensure to expand the default settings once only. gl_PTHREAD_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) # Initializes the default values for AC_SUBSTed shell variables. # This macro must not be AC_REQUIREd. It must only be invoked, and only # outside of macros or in macros that are not AC_REQUIREd. AC_DEFUN([gl_PTHREAD_H_REQUIRE_DEFAULTS], [ m4_defun(GL_MODULE_INDICATOR_PREFIX[_PTHREAD_H_MODULE_INDICATOR_DEFAULTS], [ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_THREAD]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_ONCE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_MUTEX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_RWLOCK]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_COND]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_TSS]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_SPIN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_MUTEX_TIMEDLOCK]) ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_PTHREAD_H_MODULE_INDICATOR_DEFAULTS]) AC_REQUIRE([gl_PTHREAD_H_DEFAULTS]) ]) AC_DEFUN([gl_PTHREAD_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. HAVE_PTHREAD_T=1; AC_SUBST([HAVE_PTHREAD_T]) HAVE_PTHREAD_SPINLOCK_T=1; AC_SUBST([HAVE_PTHREAD_SPINLOCK_T]) HAVE_PTHREAD_CREATE_DETACHED=1; AC_SUBST([HAVE_PTHREAD_CREATE_DETACHED]) HAVE_PTHREAD_MUTEX_RECURSIVE=1; AC_SUBST([HAVE_PTHREAD_MUTEX_RECURSIVE]) HAVE_PTHREAD_MUTEX_ROBUST=1; AC_SUBST([HAVE_PTHREAD_MUTEX_ROBUST]) HAVE_PTHREAD_PROCESS_SHARED=1; AC_SUBST([HAVE_PTHREAD_PROCESS_SHARED]) HAVE_PTHREAD_CREATE=1; AC_SUBST([HAVE_PTHREAD_CREATE]) HAVE_PTHREAD_ATTR_INIT=1; AC_SUBST([HAVE_PTHREAD_ATTR_INIT]) HAVE_PTHREAD_ATTR_GETDETACHSTATE=1; AC_SUBST([HAVE_PTHREAD_ATTR_GETDETACHSTATE]) HAVE_PTHREAD_ATTR_SETDETACHSTATE=1; AC_SUBST([HAVE_PTHREAD_ATTR_SETDETACHSTATE]) HAVE_PTHREAD_ATTR_DESTROY=1; AC_SUBST([HAVE_PTHREAD_ATTR_DESTROY]) HAVE_PTHREAD_SELF=1; AC_SUBST([HAVE_PTHREAD_SELF]) HAVE_PTHREAD_EQUAL=1; AC_SUBST([HAVE_PTHREAD_EQUAL]) HAVE_PTHREAD_DETACH=1; AC_SUBST([HAVE_PTHREAD_DETACH]) HAVE_PTHREAD_JOIN=1; AC_SUBST([HAVE_PTHREAD_JOIN]) HAVE_PTHREAD_EXIT=1; AC_SUBST([HAVE_PTHREAD_EXIT]) HAVE_PTHREAD_ONCE=1; AC_SUBST([HAVE_PTHREAD_ONCE]) HAVE_PTHREAD_MUTEX_INIT=1; AC_SUBST([HAVE_PTHREAD_MUTEX_INIT]) HAVE_PTHREAD_MUTEXATTR_INIT=1; AC_SUBST([HAVE_PTHREAD_MUTEXATTR_INIT]) HAVE_PTHREAD_MUTEXATTR_GETTYPE=1; AC_SUBST([HAVE_PTHREAD_MUTEXATTR_GETTYPE]) HAVE_PTHREAD_MUTEXATTR_SETTYPE=1; AC_SUBST([HAVE_PTHREAD_MUTEXATTR_SETTYPE]) HAVE_PTHREAD_MUTEXATTR_GETROBUST=1; AC_SUBST([HAVE_PTHREAD_MUTEXATTR_GETROBUST]) HAVE_PTHREAD_MUTEXATTR_SETROBUST=1; AC_SUBST([HAVE_PTHREAD_MUTEXATTR_SETROBUST]) HAVE_PTHREAD_MUTEXATTR_DESTROY=1; AC_SUBST([HAVE_PTHREAD_MUTEXATTR_DESTROY]) HAVE_PTHREAD_MUTEX_LOCK=1; AC_SUBST([HAVE_PTHREAD_MUTEX_LOCK]) HAVE_PTHREAD_MUTEX_TRYLOCK=1; AC_SUBST([HAVE_PTHREAD_MUTEX_TRYLOCK]) HAVE_PTHREAD_MUTEX_TIMEDLOCK=1; AC_SUBST([HAVE_PTHREAD_MUTEX_TIMEDLOCK]) HAVE_PTHREAD_MUTEX_UNLOCK=1; AC_SUBST([HAVE_PTHREAD_MUTEX_UNLOCK]) HAVE_PTHREAD_MUTEX_DESTROY=1; AC_SUBST([HAVE_PTHREAD_MUTEX_DESTROY]) HAVE_PTHREAD_RWLOCK_INIT=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_INIT]) HAVE_PTHREAD_RWLOCKATTR_INIT=1; AC_SUBST([HAVE_PTHREAD_RWLOCKATTR_INIT]) HAVE_PTHREAD_RWLOCKATTR_DESTROY=1; AC_SUBST([HAVE_PTHREAD_RWLOCKATTR_DESTROY]) HAVE_PTHREAD_RWLOCK_RDLOCK=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_RDLOCK]) HAVE_PTHREAD_RWLOCK_WRLOCK=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_WRLOCK]) HAVE_PTHREAD_RWLOCK_TRYRDLOCK=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_TRYRDLOCK]) HAVE_PTHREAD_RWLOCK_TRYWRLOCK=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_TRYWRLOCK]) HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK]) HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK]) HAVE_PTHREAD_RWLOCK_UNLOCK=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_UNLOCK]) HAVE_PTHREAD_RWLOCK_DESTROY=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_DESTROY]) HAVE_PTHREAD_COND_INIT=1; AC_SUBST([HAVE_PTHREAD_COND_INIT]) HAVE_PTHREAD_CONDATTR_INIT=1; AC_SUBST([HAVE_PTHREAD_CONDATTR_INIT]) HAVE_PTHREAD_CONDATTR_DESTROY=1; AC_SUBST([HAVE_PTHREAD_CONDATTR_DESTROY]) HAVE_PTHREAD_COND_WAIT=1; AC_SUBST([HAVE_PTHREAD_COND_WAIT]) HAVE_PTHREAD_COND_TIMEDWAIT=1; AC_SUBST([HAVE_PTHREAD_COND_TIMEDWAIT]) HAVE_PTHREAD_COND_SIGNAL=1; AC_SUBST([HAVE_PTHREAD_COND_SIGNAL]) HAVE_PTHREAD_COND_BROADCAST=1; AC_SUBST([HAVE_PTHREAD_COND_BROADCAST]) HAVE_PTHREAD_COND_DESTROY=1; AC_SUBST([HAVE_PTHREAD_COND_DESTROY]) HAVE_PTHREAD_KEY_CREATE=1; AC_SUBST([HAVE_PTHREAD_KEY_CREATE]) HAVE_PTHREAD_SETSPECIFIC=1; AC_SUBST([HAVE_PTHREAD_SETSPECIFIC]) HAVE_PTHREAD_GETSPECIFIC=1; AC_SUBST([HAVE_PTHREAD_GETSPECIFIC]) HAVE_PTHREAD_KEY_DELETE=1; AC_SUBST([HAVE_PTHREAD_KEY_DELETE]) HAVE_PTHREAD_SPIN_INIT=1; AC_SUBST([HAVE_PTHREAD_SPIN_INIT]) HAVE_PTHREAD_SPIN_LOCK=1; AC_SUBST([HAVE_PTHREAD_SPIN_LOCK]) HAVE_PTHREAD_SPIN_TRYLOCK=1; AC_SUBST([HAVE_PTHREAD_SPIN_TRYLOCK]) HAVE_PTHREAD_SPIN_UNLOCK=1; AC_SUBST([HAVE_PTHREAD_SPIN_UNLOCK]) HAVE_PTHREAD_SPIN_DESTROY=1; AC_SUBST([HAVE_PTHREAD_SPIN_DESTROY]) REPLACE_PTHREAD_CREATE=0; AC_SUBST([REPLACE_PTHREAD_CREATE]) REPLACE_PTHREAD_ATTR_INIT=0; AC_SUBST([REPLACE_PTHREAD_ATTR_INIT]) REPLACE_PTHREAD_ATTR_GETDETACHSTATE=0; AC_SUBST([REPLACE_PTHREAD_ATTR_GETDETACHSTATE]) REPLACE_PTHREAD_ATTR_SETDETACHSTATE=0; AC_SUBST([REPLACE_PTHREAD_ATTR_SETDETACHSTATE]) REPLACE_PTHREAD_ATTR_DESTROY=0; AC_SUBST([REPLACE_PTHREAD_ATTR_DESTROY]) REPLACE_PTHREAD_SELF=0; AC_SUBST([REPLACE_PTHREAD_SELF]) REPLACE_PTHREAD_EQUAL=0; AC_SUBST([REPLACE_PTHREAD_EQUAL]) REPLACE_PTHREAD_DETACH=0; AC_SUBST([REPLACE_PTHREAD_DETACH]) REPLACE_PTHREAD_JOIN=0; AC_SUBST([REPLACE_PTHREAD_JOIN]) REPLACE_PTHREAD_EXIT=0; AC_SUBST([REPLACE_PTHREAD_EXIT]) REPLACE_PTHREAD_ONCE=0; AC_SUBST([REPLACE_PTHREAD_ONCE]) REPLACE_PTHREAD_MUTEX_INIT=0; AC_SUBST([REPLACE_PTHREAD_MUTEX_INIT]) REPLACE_PTHREAD_MUTEXATTR_INIT=0; AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_INIT]) REPLACE_PTHREAD_MUTEXATTR_GETTYPE=0; AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_GETTYPE]) REPLACE_PTHREAD_MUTEXATTR_SETTYPE=0; AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_SETTYPE]) REPLACE_PTHREAD_MUTEXATTR_GETROBUST=0; AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_GETROBUST]) REPLACE_PTHREAD_MUTEXATTR_SETROBUST=0; AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_SETROBUST]) REPLACE_PTHREAD_MUTEXATTR_DESTROY=0; AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_DESTROY]) REPLACE_PTHREAD_MUTEX_LOCK=0; AC_SUBST([REPLACE_PTHREAD_MUTEX_LOCK]) REPLACE_PTHREAD_MUTEX_TRYLOCK=0; AC_SUBST([REPLACE_PTHREAD_MUTEX_TRYLOCK]) REPLACE_PTHREAD_MUTEX_TIMEDLOCK=0; AC_SUBST([REPLACE_PTHREAD_MUTEX_TIMEDLOCK]) REPLACE_PTHREAD_MUTEX_UNLOCK=0; AC_SUBST([REPLACE_PTHREAD_MUTEX_UNLOCK]) REPLACE_PTHREAD_MUTEX_DESTROY=0; AC_SUBST([REPLACE_PTHREAD_MUTEX_DESTROY]) REPLACE_PTHREAD_RWLOCK_INIT=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_INIT]) REPLACE_PTHREAD_RWLOCKATTR_INIT=0; AC_SUBST([REPLACE_PTHREAD_RWLOCKATTR_INIT]) REPLACE_PTHREAD_RWLOCKATTR_DESTROY=0; AC_SUBST([REPLACE_PTHREAD_RWLOCKATTR_DESTROY]) REPLACE_PTHREAD_RWLOCK_RDLOCK=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_RDLOCK]) REPLACE_PTHREAD_RWLOCK_WRLOCK=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_WRLOCK]) REPLACE_PTHREAD_RWLOCK_TRYRDLOCK=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_TRYRDLOCK]) REPLACE_PTHREAD_RWLOCK_TRYWRLOCK=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_TRYWRLOCK]) REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK]) REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK]) REPLACE_PTHREAD_RWLOCK_UNLOCK=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_UNLOCK]) REPLACE_PTHREAD_RWLOCK_DESTROY=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_DESTROY]) REPLACE_PTHREAD_COND_INIT=0; AC_SUBST([REPLACE_PTHREAD_COND_INIT]) REPLACE_PTHREAD_CONDATTR_INIT=0; AC_SUBST([REPLACE_PTHREAD_CONDATTR_INIT]) REPLACE_PTHREAD_CONDATTR_DESTROY=0; AC_SUBST([REPLACE_PTHREAD_CONDATTR_DESTROY]) REPLACE_PTHREAD_COND_WAIT=0; AC_SUBST([REPLACE_PTHREAD_COND_WAIT]) REPLACE_PTHREAD_COND_TIMEDWAIT=0; AC_SUBST([REPLACE_PTHREAD_COND_TIMEDWAIT]) REPLACE_PTHREAD_COND_SIGNAL=0; AC_SUBST([REPLACE_PTHREAD_COND_SIGNAL]) REPLACE_PTHREAD_COND_BROADCAST=0; AC_SUBST([REPLACE_PTHREAD_COND_BROADCAST]) REPLACE_PTHREAD_COND_DESTROY=0; AC_SUBST([REPLACE_PTHREAD_COND_DESTROY]) REPLACE_PTHREAD_KEY_CREATE=0; AC_SUBST([REPLACE_PTHREAD_KEY_CREATE]) REPLACE_PTHREAD_SETSPECIFIC=0; AC_SUBST([REPLACE_PTHREAD_SETSPECIFIC]) REPLACE_PTHREAD_GETSPECIFIC=0; AC_SUBST([REPLACE_PTHREAD_GETSPECIFIC]) REPLACE_PTHREAD_KEY_DELETE=0; AC_SUBST([REPLACE_PTHREAD_KEY_DELETE]) REPLACE_PTHREAD_SPIN_INIT=0; AC_SUBST([REPLACE_PTHREAD_SPIN_INIT]) REPLACE_PTHREAD_SPIN_LOCK=0; AC_SUBST([REPLACE_PTHREAD_SPIN_LOCK]) REPLACE_PTHREAD_SPIN_TRYLOCK=0; AC_SUBST([REPLACE_PTHREAD_SPIN_TRYLOCK]) REPLACE_PTHREAD_SPIN_UNLOCK=0; AC_SUBST([REPLACE_PTHREAD_SPIN_UNLOCK]) REPLACE_PTHREAD_SPIN_DESTROY=0; AC_SUBST([REPLACE_PTHREAD_SPIN_DESTROY]) ]) groff-1.24.1/gnulib_m4/strncasecmp.m40000644000175000017500000000162215153275164014301 00000000000000# strncasecmp.m4 # serial 2 dnl Copyright (C) 2002-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_STRNCASECMP], [ AC_REQUIRE([gl_STRINGS_H_DEFAULTS]) AC_CHECK_FUNCS([strncasecmp]) if test $ac_cv_func_strncasecmp = yes; then dnl Assume that strncasecmp and strcasecmp share the same bugs. gl_STRCASECMP_WORKS case "$gl_cv_func_strcasecmp_works" in *yes) ;; *) REPLACE_STRNCASECMP=1 ;; esac else HAVE_STRNCASECMP=0 fi AC_CHECK_DECLS([strncasecmp]) if test $ac_cv_have_decl_strncasecmp = no; then HAVE_DECL_STRNCASECMP=0 fi ]) # Prerequisites of lib/strncasecmp.c. AC_DEFUN([gl_PREREQ_STRNCASECMP], [ : ]) groff-1.24.1/gnulib_m4/uninorm_h.m40000644000175000017500000000374615153275164013766 00000000000000# uninorm_h.m4 # serial 1 dnl Copyright (C) 2023-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN_ONCE([gl_UNINORM_H], [ dnl Ensure to expand the default settings once only, before all statements dnl that occur in other macros. AC_REQUIRE([gl_UNINORM_H_DEFAULTS]) ]) # gl_UNINORM_MODULE_INDICATOR([modulename]) # sets the shell variable that indicates the presence of the given module # to a C preprocessor expression that will evaluate to 1. # This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_UNINORM_MODULE_INDICATOR], [ dnl Ensure to expand the default settings once only. gl_UNINORM_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) # Initializes the default values for AC_SUBSTed shell variables. # This macro must not be AC_REQUIREd. It must only be invoked, and only # outside of macros or in macros that are not AC_REQUIREd. AC_DEFUN([gl_UNINORM_H_REQUIRE_DEFAULTS], [ m4_defun(GL_MODULE_INDICATOR_PREFIX[_UNINORM_H_MODULE_INDICATOR_DEFAULTS], [ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNINORM_NFD_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNINORM_NFC_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNINORM_NFKD_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNINORM_NFKC_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_UNINORM_H_MODULE_INDICATOR_DEFAULTS]) AC_REQUIRE([gl_UNINORM_H_DEFAULTS]) ]) AC_DEFUN([gl_UNINORM_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. ]) groff-1.24.1/gnulib_m4/exponentd.m40000644000175000017500000000760715153275164013774 00000000000000# exponentd.m4 # serial 5 dnl Copyright (C) 2007-2008, 2010-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN_ONCE([gl_DOUBLE_EXPONENT_LOCATION], [ AC_CACHE_CHECK([where to find the exponent in a 'double'], [gl_cv_cc_double_expbit0], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include #include #define NWORDS \ ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) typedef union { double value; unsigned int word[NWORDS]; } memory_double; static unsigned int ored_words[NWORDS]; static unsigned int anded_words[NWORDS]; static void add_to_ored_words (double x) { memory_double m; size_t i; /* Clear it first, in case sizeof (double) < sizeof (memory_double). */ memset (&m, 0, sizeof (memory_double)); m.value = x; for (i = 0; i < NWORDS; i++) { ored_words[i] |= m.word[i]; anded_words[i] &= m.word[i]; } } int main () { size_t j; FILE *fp = fopen ("conftest.out", "w"); if (fp == NULL) return 1; for (j = 0; j < NWORDS; j++) anded_words[j] = ~ (unsigned int) 0; add_to_ored_words (0.25); add_to_ored_words (0.5); add_to_ored_words (1.0); add_to_ored_words (2.0); add_to_ored_words (4.0); /* Remove bits that are common (e.g. if representation of the first mantissa bit is explicit). */ for (j = 0; j < NWORDS; j++) ored_words[j] &= ~anded_words[j]; /* Now find the nonzero word. */ for (j = 0; j < NWORDS; j++) if (ored_words[j] != 0) break; if (j < NWORDS) { size_t i; for (i = j + 1; i < NWORDS; i++) if (ored_words[i] != 0) { fprintf (fp, "unknown"); return (fclose (fp) != 0); } for (i = 0; ; i++) if ((ored_words[j] >> i) & 1) { fprintf (fp, "word %d bit %d", (int) j, (int) i); return (fclose (fp) != 0); } } fprintf (fp, "unknown"); return (fclose (fp) != 0); } ]])], [gl_cv_cc_double_expbit0=`cat conftest.out`], [gl_cv_cc_double_expbit0="unknown"], [ dnl On ARM, there are two 'double' floating-point formats, used by dnl different sets of instructions: The older FPA instructions assume dnl that they are stored in big-endian word order, while the words dnl (like integer types) are stored in little-endian byte order. dnl The newer VFP instructions assume little-endian order dnl consistently. AC_EGREP_CPP([mixed_endianness], [ #if defined __arm__ mixed_endianness #endif ], [gl_cv_cc_double_expbit0="unknown"], [ pushdef([AC_MSG_CHECKING],[:])dnl pushdef([AC_MSG_RESULT],[:])dnl pushdef([AC_MSG_RESULT_UNQUOTED],[:])dnl AC_C_BIGENDIAN( [gl_cv_cc_double_expbit0="word 0 bit 20"], [gl_cv_cc_double_expbit0="word 1 bit 20"], [gl_cv_cc_double_expbit0="unknown"]) popdef([AC_MSG_RESULT_UNQUOTED])dnl popdef([AC_MSG_RESULT])dnl popdef([AC_MSG_CHECKING])dnl ]) ]) rm -f conftest.out ]) case "$gl_cv_cc_double_expbit0" in word*bit*) word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'` AC_DEFINE_UNQUOTED([DBL_EXPBIT0_WORD], [$word], [Define as the word index where to find the exponent of 'double'.]) AC_DEFINE_UNQUOTED([DBL_EXPBIT0_BIT], [$bit], [Define as the bit index in the word where to find bit 0 of the exponent of 'double'.]) ;; esac ]) groff-1.24.1/gnulib_m4/wint_t.m40000644000175000017500000000352315153275164013265 00000000000000# wint_t.m4 # serial 11 dnl Copyright (C) 2003, 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Bruno Haible. dnl Test whether has the 'wint_t' type and whether gnulib's dnl or would, if present, override 'wint_t'. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WINT_T], [ AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include wint_t foo = (wchar_t)'\0';]], [[]])], [gt_cv_c_wint_t=yes], [gt_cv_c_wint_t=no])]) if test $gt_cv_c_wint_t = yes; then AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.]) dnl Determine whether gnulib's or would, if present, dnl override 'wint_t'. AC_CACHE_CHECK([whether wint_t is large enough], [gl_cv_type_wint_t_large_enough], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1]; ]])], [gl_cv_type_wint_t_large_enough=yes], [gl_cv_type_wint_t_large_enough=no])]) if test $gl_cv_type_wint_t_large_enough = no; then GNULIBHEADERS_OVERRIDE_WINT_T=1 else GNULIBHEADERS_OVERRIDE_WINT_T=0 fi else GNULIBHEADERS_OVERRIDE_WINT_T=0 fi AC_SUBST([GNULIBHEADERS_OVERRIDE_WINT_T]) ]) dnl Prerequisites of the 'wint_t' override. AC_DEFUN([gl_TYPE_WINT_T_PREREQ], [ AC_CHECK_HEADERS_ONCE([crtdefs.h]) if test $ac_cv_header_crtdefs_h = yes; then HAVE_CRTDEFS_H=1 else HAVE_CRTDEFS_H=0 fi AC_SUBST([HAVE_CRTDEFS_H]) ]) groff-1.24.1/gnulib_m4/once.m40000644000175000017500000000062715153275164012707 00000000000000# once.m4 # serial 1 dnl Copyright (C) 2024-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Bruno Haible. AC_DEFUN([gl_ONCE], [ AC_REQUIRE([gl_THREADLIB]) ]) groff-1.24.1/gnulib_m4/iswblank.m40000644000175000017500000000230015153275164013563 00000000000000# iswblank.m4 # serial 7 dnl Copyright (C) 2011-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_ISWBLANK], [ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) AC_REQUIRE([gl_WCTYPE_H]) dnl Persuade glibc to declare iswblank(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) gl_CHECK_FUNCS_ANDROID([iswblank], [[#include ]]) AC_CHECK_DECLS([iswblank], , , [[ #include #include ]]) if test $ac_cv_func_iswblank = no; then HAVE_ISWBLANK=0 if test $ac_cv_have_decl_iswblank = yes \ || case "$gl_cv_onwards_func_iswblank" in \ future*) true ;; \ *) false ;; \ esac; then REPLACE_ISWBLANK=1 fi fi if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then dnl Redefine all of iswcntrl, ..., towupper in . : else if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then dnl Redefine only iswblank. : fi fi ]) groff-1.24.1/gnulib_m4/unictype_h.m40000644000175000017500000004356715153275164014144 00000000000000# unictype_h.m4 # serial 4 dnl Copyright (C) 2023-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN_ONCE([gl_UNICTYPE_H], [ dnl Ensure to expand the default settings once only, before all statements dnl that occur in other macros. AC_REQUIRE([gl_UNICTYPE_H_DEFAULTS]) ]) # gl_UNICTYPE_MODULE_INDICATOR([modulename]) # sets the shell variable that indicates the presence of the given module # to a C preprocessor expression that will evaluate to 1. # This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_UNICTYPE_MODULE_INDICATOR], [ dnl Ensure to expand the default settings once only. gl_UNICTYPE_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) # Initializes the default values for AC_SUBSTed shell variables. # This macro must not be AC_REQUIREd. It must only be invoked, and only # outside of macros or in macros that are not AC_REQUIREd. AC_DEFUN([gl_UNICTYPE_H_REQUIRE_DEFAULTS], [ m4_defun(GL_MODULE_INDICATOR_PREFIX[_UNICTYPE_H_MODULE_INDICATOR_DEFAULTS], [ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_L_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_LC_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_LU_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_LL_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_LT_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_LM_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_LO_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_M_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_MN_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_MC_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_ME_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_N_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_ND_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_NL_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_NO_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_P_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_PC_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_PD_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_PS_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_PE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_PI_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_PF_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_PO_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_S_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_SM_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_SC_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_SK_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_SO_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_Z_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_ZS_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_ZL_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_ZP_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_C_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_CC_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_CF_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_CS_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_CO_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_CATEGORY_CN_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_WHITE_SPACE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_ALPHABETIC_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_OTHER_ALPHABETIC_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_NOT_A_CHARACTER_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_DEFAULT_IGNORABLE_CODE_POINT_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_OTHER_DEFAULT_IGNORABLE_CODE_POINT_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_DEPRECATED_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_LOGICAL_ORDER_EXCEPTION_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_VARIATION_SELECTOR_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_PRIVATE_USE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_UNASSIGNED_CODE_VALUE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_UPPERCASE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_OTHER_UPPERCASE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_LOWERCASE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_OTHER_LOWERCASE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_TITLECASE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_CASED_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_CASE_IGNORABLE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_CHANGES_WHEN_LOWERCASED_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_CHANGES_WHEN_UPPERCASED_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_CHANGES_WHEN_TITLECASED_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_CHANGES_WHEN_CASEFOLDED_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_CHANGES_WHEN_CASEMAPPED_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_SOFT_DOTTED_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_ID_START_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_OTHER_ID_START_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_ID_CONTINUE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_OTHER_ID_CONTINUE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_XID_START_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_XID_CONTINUE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_ID_COMPAT_MATH_START_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_ID_COMPAT_MATH_CONTINUE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_PATTERN_WHITE_SPACE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_PATTERN_SYNTAX_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_JOIN_CONTROL_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_GRAPHEME_BASE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_GRAPHEME_EXTEND_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_OTHER_GRAPHEME_EXTEND_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_GRAPHEME_LINK_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_MODIFIER_COMBINING_MARK_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_BIDI_CONTROL_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_BIDI_LEFT_TO_RIGHT_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_BIDI_HEBREW_RIGHT_TO_LEFT_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_BIDI_ARABIC_RIGHT_TO_LEFT_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_BIDI_EUROPEAN_DIGIT_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_BIDI_EUR_NUM_SEPARATOR_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_BIDI_EUR_NUM_TERMINATOR_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_BIDI_ARABIC_DIGIT_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_BIDI_COMMON_SEPARATOR_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_BIDI_BLOCK_SEPARATOR_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_BIDI_SEGMENT_SEPARATOR_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_BIDI_WHITESPACE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_BIDI_NON_SPACING_MARK_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_BIDI_BOUNDARY_NEUTRAL_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_BIDI_PDF_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_BIDI_EMBEDDING_OR_OVERRIDE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_BIDI_OTHER_NEUTRAL_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_HEX_DIGIT_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_ASCII_HEX_DIGIT_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_IDEOGRAPHIC_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_UNIFIED_IDEOGRAPH_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_RADICAL_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_IDS_UNARY_OPERATOR_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_IDS_BINARY_OPERATOR_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_IDS_TRINARY_OPERATOR_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_EMOJI_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_EMOJI_PRESENTATION_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_EMOJI_MODIFIER_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_EMOJI_MODIFIER_BASE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_EMOJI_COMPONENT_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_EXTENDED_PICTOGRAPHIC_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_ZERO_WIDTH_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_SPACE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_NON_BREAK_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_ISO_CONTROL_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_FORMAT_CONTROL_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_PREPENDED_CONCATENATION_MARK_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_DASH_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_HYPHEN_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_PUNCTUATION_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_LINE_SEPARATOR_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_PARAGRAPH_SEPARATOR_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_QUOTATION_MARK_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_SENTENCE_TERMINAL_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_TERMINAL_PUNCTUATION_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_CURRENCY_SYMBOL_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_MATH_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_OTHER_MATH_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_PAIRED_PUNCTUATION_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_LEFT_OF_PAIR_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_COMBINING_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_COMPOSITE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_DECIMAL_DIGIT_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_NUMERIC_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_DIACRITIC_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_EXTENDER_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_IGNORABLE_CONTROL_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_REGIONAL_INDICATOR_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_UNICTYPE_H_MODULE_INDICATOR_DEFAULTS]) AC_REQUIRE([gl_UNICTYPE_H_DEFAULTS]) ]) AC_DEFUN([gl_UNICTYPE_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. ]) groff-1.24.1/gnulib_m4/putenv.m40000644000175000017500000000412415153275164013300 00000000000000# putenv.m4 # serial 28 dnl Copyright (C) 2002-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Jim Meyering. dnl dnl Check whether putenv ("FOO") removes FOO from the environment. dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that. AC_DEFUN([gl_FUNC_PUTENV], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([for putenv compatible with GNU and SVID], [gl_cv_func_svid_putenv], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [AC_INCLUDES_DEFAULT GL_MDA_DEFINES], [[ /* Put it in env. */ if (putenv ("CONFTEST_putenv=val")) return 1; /* Try to remove it. */ if (putenv ("CONFTEST_putenv")) return 2; /* Make sure it was deleted. */ if (getenv ("CONFTEST_putenv") != 0) return 3; return 0; ]])], [gl_cv_func_svid_putenv=yes], [gl_cv_func_svid_putenv=no], [dnl When crosscompiling, assume putenv is broken. case "$host_os" in # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_svid_putenv="guessing yes" ;; # Guess yes on musl systems. *-musl* | midipix*) gl_cv_func_svid_putenv="guessing yes" ;; # Guess no on native Windows. mingw* | windows*) gl_cv_func_svid_putenv="guessing no" ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_svid_putenv="$gl_cross_guess_normal" ;; esac ]) ]) case "$gl_cv_func_svid_putenv" in *yes) ;; *) REPLACE_PUTENV=1 ;; esac ]) # Prerequisites of lib/putenv.c. AC_DEFUN([gl_PREREQ_PUTENV], [ AC_CHECK_DECLS_ONCE([_putenv]) ]) groff-1.24.1/gnulib_m4/extensions.m40000644000175000017500000002163215153275164014161 00000000000000# extensions.m4 # serial 25 -*- Autoconf -*- dnl Copyright (C) 2003, 2006-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. # Enable extensions on systems that normally disable them. dnl Define to empty for the benefit of Autoconf 2.69 and earlier, so that dnl AC_USE_SYSTEM_EXTENSIONS (below) can be used unchanged from Autoconf 2.70+. m4_ifndef([AC_CHECK_INCLUDES_DEFAULT], [AC_DEFUN([AC_CHECK_INCLUDES_DEFAULT], [])]) # This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git # Autoconf. Perhaps we can remove this once we can assume Autoconf # is recent-enough everywhere, but since Autoconf mutates rapidly # enough in this area it's likely we'll need to redefine # AC_USE_SYSTEM_EXTENSIONS for quite some time. # If autoconf reports a warning # warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS # or warning: AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS # the fix is # 1) to ensure that AC_USE_SYSTEM_EXTENSIONS is never directly invoked # but always AC_REQUIREd, # 2) to ensure that for each occurrence of # AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) # or # AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) # the corresponding gnulib module description has 'extensions' among # its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS # invocation occurs in gl_EARLY, not in gl_INIT. m4_version_prereq([2.72], [], [ # AC_USE_SYSTEM_EXTENSIONS # ------------------------ # Enable extensions on systems that normally disable them, # typically due to standards-conformance issues. # We unconditionally define as many of the known feature-enabling # as possible, reserving conditional behavior for macros that are # known to cause problems on some platforms (such as __EXTENSIONS__). AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS], [AC_BEFORE([$0], [AC_PREPROC_IFELSE])dnl AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl AC_BEFORE([$0], [AC_LINK_IFELSE])dnl AC_BEFORE([$0], [AC_RUN_IFELSE])dnl AC_BEFORE([$0], [AC_CHECK_INCLUDES_DEFAULT])dnl dnl #undef in AH_VERBATIM gets replaced with #define by AC_DEFINE. dnl Use a different key than __EXTENSIONS__, as that name broke existing dnl configure.ac when using autoheader 2.62. dnl The macros below are in alphabetical order ignoring leading _ or __ dnl prefixes. AH_VERBATIM([USE_SYSTEM_EXTENSIONS], [/* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable general extensions on macOS. */ #ifndef _DARWIN_C_SOURCE # undef _DARWIN_C_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable X/Open compliant socket functions that do not require linking with -lxnet on HP-UX 11.11. */ #ifndef _HPUX_ALT_XOPEN_SOCKET_API # undef _HPUX_ALT_XOPEN_SOCKET_API #endif /* Identify the host operating system as Minix. This macro does not affect the system headers' behavior. A future release of Autoconf may stop defining this macro. */ #ifndef _MINIX # undef _MINIX #endif /* Enable general extensions on NetBSD. Enable NetBSD compatibility extensions on Minix. */ #ifndef _NETBSD_SOURCE # undef _NETBSD_SOURCE #endif /* Enable OpenBSD compatibility extensions on NetBSD. Oddly enough, this does nothing on OpenBSD. */ #ifndef _OPENBSD_SOURCE # undef _OPENBSD_SOURCE #endif /* Define to 1 if needed for POSIX-compatible behavior. */ #ifndef _POSIX_SOURCE # undef _POSIX_SOURCE #endif /* Define to 2 if needed for POSIX-compatible behavior. */ #ifndef _POSIX_1_SOURCE # undef _POSIX_1_SOURCE #endif /* Enable POSIX-compatible threading on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ #ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ # undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ # undef __STDC_WANT_IEC_60559_BFP_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ #ifndef __STDC_WANT_IEC_60559_DFP_EXT__ # undef __STDC_WANT_IEC_60559_DFP_EXT__ #endif /* Enable extensions specified by C23 Annex F. */ #ifndef __STDC_WANT_IEC_60559_EXT__ # undef __STDC_WANT_IEC_60559_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ #ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ # undef __STDC_WANT_IEC_60559_FUNCS_EXT__ #endif /* Enable extensions specified by C23 Annex H and ISO/IEC TS 18661-3:2015. */ #ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ # undef __STDC_WANT_IEC_60559_TYPES_EXT__ #endif /* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ #ifndef __STDC_WANT_LIB_EXT2__ # undef __STDC_WANT_LIB_EXT2__ #endif /* Enable extensions specified by ISO/IEC 24747:2009. */ #ifndef __STDC_WANT_MATH_SPEC_FUNCS__ # undef __STDC_WANT_MATH_SPEC_FUNCS__ #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable X/Open extensions. Define to 500 only if necessary to make mbstate_t available. */ #ifndef _XOPEN_SOURCE # undef _XOPEN_SOURCE #endif ])dnl AC_REQUIRE([AC_CHECK_INCLUDES_DEFAULT])dnl _AC_CHECK_HEADER_ONCE([wchar.h]) _AC_CHECK_HEADER_ONCE([minix/config.h]) dnl Defining __EXTENSIONS__ may break the system headers on some systems. dnl (FIXME: Which ones?) AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], [ac_cv_safe_to_define___extensions__], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[ # define __EXTENSIONS__ 1 ]AC_INCLUDES_DEFAULT])], [ac_cv_safe_to_define___extensions__=yes], [ac_cv_safe_to_define___extensions__=no])]) dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to dnl 500, regardless of whether compiling with -Ae or -D_HPUX_SOURCE=1. dnl But defining _XOPEN_SOURCE may turn *off* extensions on platforms dnl not covered by turn-on-extensions macros (notably Dragonfly, Free, dnl and OpenBSD, which don't have any equivalent of _NETBSD_SOURCE) so dnl it should only be defined when necessary. AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined], [ac_cv_should_define__xopen_source], [ac_cv_should_define__xopen_source=no AS_IF([test $ac_cv_header_wchar_h = yes], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[ #include mbstate_t x;]])], [], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[ #define _XOPEN_SOURCE 500 #include mbstate_t x;]])], [ac_cv_should_define__xopen_source=yes])])])]) AC_DEFINE([_ALL_SOURCE]) AC_DEFINE([_DARWIN_C_SOURCE]) AC_DEFINE([_GNU_SOURCE]) AC_DEFINE([_HPUX_ALT_XOPEN_SOCKET_API]) AC_DEFINE([_NETBSD_SOURCE]) AC_DEFINE([_OPENBSD_SOURCE]) AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) AC_DEFINE([__STDC_WANT_IEC_60559_ATTRIBS_EXT__]) AC_DEFINE([__STDC_WANT_IEC_60559_BFP_EXT__]) AC_DEFINE([__STDC_WANT_IEC_60559_DFP_EXT__]) AC_DEFINE([__STDC_WANT_IEC_60559_EXT__]) AC_DEFINE([__STDC_WANT_IEC_60559_FUNCS_EXT__]) AC_DEFINE([__STDC_WANT_IEC_60559_TYPES_EXT__]) AC_DEFINE([__STDC_WANT_LIB_EXT2__]) AC_DEFINE([__STDC_WANT_MATH_SPEC_FUNCS__]) AC_DEFINE([_TANDEM_SOURCE]) AS_IF([test $ac_cv_header_minix_config_h = yes], [MINIX=yes AC_DEFINE([_MINIX]) AC_DEFINE([_POSIX_SOURCE]) AC_DEFINE([_POSIX_1_SOURCE], [2])], [MINIX=]) AS_IF([test $ac_cv_safe_to_define___extensions__ = yes], [AC_DEFINE([__EXTENSIONS__])]) AS_IF([test $ac_cv_should_define__xopen_source = yes], [AC_DEFINE([_XOPEN_SOURCE], [500])]) ])# AC_USE_SYSTEM_EXTENSIONS ]) # gl_USE_SYSTEM_EXTENSIONS # ------------------------ # Enable extensions on systems that normally disable them, # typically due to standards-conformance issues. AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS], [ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) dnl On OpenBSD 6.8 with GCC, the include files contain a couple of dnl definitions that are only activated with an explicit -D_ISOC11_SOURCE. dnl That's because this version of GCC (4.2.1) supports the option dnl '-std=gnu99' but not the option '-std=gnu11'. AC_REQUIRE([AC_CANONICAL_HOST]) case "$host_os" in openbsd*) AC_DEFINE([_ISOC11_SOURCE], [1], [Define to enable the declarations of ISO C 11 types and functions.]) ;; esac dnl On OpenSolaris derivatives, the include files contains a couple of dnl declarations that are only activated with an explicit dnl -D__STDC_WANT_LIB_EXT1__. AH_VERBATIM([USE_ISO_C_23_ANNEX_K_EXTENSIONS], [/* Define to enable the declarations of ISO C 23 Annex K types and functions. */ #if !(defined __STDC_WANT_LIB_EXT1__ && __STDC_WANT_LIB_EXT1__) #undef/**/__STDC_WANT_LIB_EXT1__ #define __STDC_WANT_LIB_EXT1__ 1 #endif ]) ]) groff-1.24.1/gnulib_m4/stdint_h.m40000644000175000017500000000203315153275164013570 00000000000000# stdint_h.m4 # serial 9 dnl Copyright (C) 1997-2004, 2006, 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Paul Eggert. # Define HAVE_STDINT_H_WITH_UINTMAX if exists, # doesn't clash with , and declares uintmax_t. AC_DEFUN([gl_AC_HEADER_STDINT_H], [ AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include #include ]], [[uintmax_t i = (uintmax_t) -1; return !i;]])], [gl_cv_header_stdint_h=yes], [gl_cv_header_stdint_h=no])]) if test $gl_cv_header_stdint_h = yes; then AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1], [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi ]) groff-1.24.1/gnulib_m4/mbstate_t.m40000644000175000017500000000230015153275164013733 00000000000000# mbstate_t.m4 # serial 14 dnl Copyright (C) 2000-2002, 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. # From Paul Eggert. # BeOS 5 has but does not define mbstate_t, # so you can't declare an object of that type. # Check for this incompatibility with Standard C. # AC_TYPE_MBSTATE_T # ----------------- AC_DEFUN([AC_TYPE_MBSTATE_T], [ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) dnl for HP-UX 11.11 AC_CACHE_CHECK([for mbstate_t], [ac_cv_type_mbstate_t], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [AC_INCLUDES_DEFAULT[ #include ]], [[mbstate_t x; return sizeof x;]])], [ac_cv_type_mbstate_t=yes], [ac_cv_type_mbstate_t=no])]) if test $ac_cv_type_mbstate_t = yes; then AC_DEFINE([HAVE_MBSTATE_T], [1], [Define to 1 if declares mbstate_t.]) else AC_DEFINE([mbstate_t], [int], [Define to a type if does not define.]) fi ]) groff-1.24.1/gnulib_m4/printf-frexpl.m40000644000175000017500000000341315153275164014557 00000000000000# printf-frexpl.m4 # serial 10 dnl Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl Check how to define printf_frexpl() without linking with libm. AC_DEFUN([gl_FUNC_PRINTF_FREXPL], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) dnl Subset of gl_FUNC_FREXPL_NO_LIBM. gl_CHECK_FREXPL_NO_LIBM if test $gl_cv_func_frexpl_no_libm = yes; then gl_FUNC_FREXPL_WORKS case "$gl_cv_func_frexpl_works" in *yes) gl_func_frexpl_no_libm=yes ;; *) gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;; esac else gl_func_frexpl_no_libm=no dnl Set REPLACE_FREXPL here because the system may have frexpl in libm. REPLACE_FREXPL=1 fi if test $gl_func_frexpl_no_libm = yes; then AC_DEFINE([HAVE_FREXPL_IN_LIBC], [1], [Define if the frexpl function is available in libc.]) dnl Also check whether it's declared. dnl Mac OS X 10.3 has frexpl() in libc but doesn't declare it in . AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include ]]) fi gl_CHECK_LDEXPL_NO_LIBM if test $gl_cv_func_ldexpl_no_libm = yes; then gl_FUNC_LDEXPL_WORKS case "$gl_cv_func_ldexpl_works" in *yes) AC_DEFINE([HAVE_LDEXPL_IN_LIBC], [1], [Define if the ldexpl function is available in libc.]) dnl Also check whether it's declared. dnl Mac OS X 10.3 has ldexpl() in libc but doesn't declare it in . AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [[#include ]]) ;; esac fi ]) groff-1.24.1/gnulib_m4/include_next.m40000644000175000017500000002113015153275164014434 00000000000000# include_next.m4 # serial 27 dnl Copyright (C) 2006-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Paul Eggert and Derek Price. dnl Sets INCLUDE_NEXT, INCLUDE_NEXT_AS_FIRST_DIRECTIVE, PRAGMA_SYSTEM_HEADER, dnl and PRAGMA_COLUMNS. dnl dnl INCLUDE_NEXT expands to 'include_next' if the compiler supports it, or to dnl 'include' otherwise. dnl dnl INCLUDE_NEXT_AS_FIRST_DIRECTIVE expands to 'include_next' if the compiler dnl supports it in the special case that it is the first include directive in dnl the given file, or to 'include' otherwise. dnl dnl PRAGMA_SYSTEM_HEADER can be used in files that contain #include_next, dnl so as to avoid GCC warnings when the gcc option -pedantic is used. dnl '#pragma GCC system_header' has the same effect as if the file was found dnl through the include search path specified with '-isystem' options (as dnl opposed to the search path specified with '-I' options). Namely, gcc dnl does not warn about some things, and on some systems (Solaris and Interix) dnl __STDC__ evaluates to 0 instead of to 1. The latter is an undesired side dnl effect; we are therefore careful to use 'defined __STDC__' or '1' instead dnl of plain '__STDC__'. dnl dnl PRAGMA_COLUMNS can be used in files that override system header files, so dnl as to avoid compilation errors on HP NonStop systems when the gnulib file dnl is included by a system header file that does a "#pragma COLUMNS 80" (which dnl has the effect of truncating the lines of that file and all files that it dnl includes to 80 columns) and the gnulib file has lines longer than 80 dnl columns. AC_DEFUN([gl_INCLUDE_NEXT], [ AC_LANG_PREPROC_REQUIRE() AC_CACHE_CHECK([whether the preprocessor supports include_next], [gl_cv_have_include_next], [rm -rf conftestd1a conftestd1b conftestd2 mkdir conftestd1a conftestd1b conftestd2 dnl IBM C 9.0, 10.1 (original versions, prior to the 2009-01 updates) on dnl AIX 6.1 support include_next when used as first preprocessor directive dnl in a file, but not when preceded by another include directive. Check dnl for this bug by including . dnl Additionally, with this same compiler, include_next is a no-op when dnl used in a header file that was included by specifying its absolute dnl file name. Despite these two bugs, include_next is used in the dnl compiler's . By virtue of the second bug, we need to use dnl include_next as well in this case. cat < conftestd1a/conftest.h #define DEFINED_IN_CONFTESTD1 #include_next #ifdef DEFINED_IN_CONFTESTD2 int foo; #else #error "include_next doesn't work" #endif EOF cat < conftestd1b/conftest.h #define DEFINED_IN_CONFTESTD1 #include #include_next #ifdef DEFINED_IN_CONFTESTD2 int foo; #else #error "include_next doesn't work" #endif EOF cat < conftestd2/conftest.h #ifndef DEFINED_IN_CONFTESTD1 #error "include_next test doesn't work" #endif #define DEFINED_IN_CONFTESTD2 EOF gl_saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$gl_saved_CPPFLAGS -Iconftestd1b -Iconftestd2" dnl We intentionally avoid using AC_LANG_SOURCE here. AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include ]], [gl_cv_have_include_next=yes], [CPPFLAGS="$gl_saved_CPPFLAGS -Iconftestd1a -Iconftestd2" AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include ]], [gl_cv_have_include_next=buggy], [gl_cv_have_include_next=no]) ]) CPPFLAGS="$gl_saved_CPPFLAGS" rm -rf conftestd1a conftestd1b conftestd2 ]) PRAGMA_SYSTEM_HEADER= if test $gl_cv_have_include_next = yes; then INCLUDE_NEXT=include_next INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next if test -n "$GCC"; then PRAGMA_SYSTEM_HEADER='#pragma GCC system_header' fi else if test $gl_cv_have_include_next = buggy; then INCLUDE_NEXT=include INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next else INCLUDE_NEXT=include INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include fi fi AC_SUBST([INCLUDE_NEXT]) AC_SUBST([INCLUDE_NEXT_AS_FIRST_DIRECTIVE]) AC_SUBST([PRAGMA_SYSTEM_HEADER]) dnl HP NonStop systems, which define __TANDEM, limit the line length dnl after including some system header files. AC_CACHE_CHECK([whether source code line length is unlimited], [gl_cv_source_line_length_unlimited], [AC_EGREP_CPP([choke me], [ #ifdef __TANDEM choke me #endif ], [gl_cv_source_line_length_unlimited=no], [gl_cv_source_line_length_unlimited=yes]) ]) if test $gl_cv_source_line_length_unlimited = no; then PRAGMA_COLUMNS="#pragma COLUMNS 10000" else PRAGMA_COLUMNS= fi AC_SUBST([PRAGMA_COLUMNS]) ]) # gl_CHECK_NEXT_HEADERS(HEADER1 HEADER2 ...) # ------------------------------------------ # For each arg foo.h, if #include_next works, define NEXT_FOO_H to be # ''; otherwise define it to be # '"///usr/include/foo.h"', or whatever other absolute file name is suitable. # Also, if #include_next works as first preprocessing directive in a file, # define NEXT_AS_FIRST_DIRECTIVE_FOO_H to be ''; otherwise define it to # be # '"///usr/include/foo.h"', or whatever other absolute file name is suitable. # That way, a header file with the following line: # #@INCLUDE_NEXT@ @NEXT_FOO_H@ # or # #@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_FOO_H@ # behaves (after sed substitution) as if it contained # #include_next # even if the compiler does not support include_next. # The three "///" are to pacify Sun C 5.8, which otherwise would say # "warning: #include of /usr/include/... may be non-portable". # Use '""', not '<>', so that the /// cannot be confused with a C99 comment. # Note: This macro assumes that the header file is not empty after # preprocessing, i.e. it does not only define preprocessor macros but also # provides some type/enum definitions or function/variable declarations. # # This macro also checks whether each header exists, by invoking # AC_CHECK_HEADERS_ONCE or AC_CHECK_HEADERS on each argument. AC_DEFUN([gl_CHECK_NEXT_HEADERS], [ gl_NEXT_HEADERS_INTERNAL([$1], [check]) ]) # gl_NEXT_HEADERS(HEADER1 HEADER2 ...) # ------------------------------------ # Like gl_CHECK_NEXT_HEADERS, except do not check whether the headers exist. # This is suitable for headers like that are standardized by C89 # and therefore can be assumed to exist. AC_DEFUN([gl_NEXT_HEADERS], [ gl_NEXT_HEADERS_INTERNAL([$1], [assume]) ]) # The guts of gl_CHECK_NEXT_HEADERS and gl_NEXT_HEADERS. AC_DEFUN([gl_NEXT_HEADERS_INTERNAL], [ AC_REQUIRE([gl_INCLUDE_NEXT]) AC_REQUIRE([AC_CANONICAL_HOST]) m4_if([$2], [check], [AC_CHECK_HEADERS_ONCE([$1]) ]) m4_foreach_w([gl_HEADER_NAME], [$1], [AS_VAR_PUSHDEF([gl_next_header], [gl_cv_next_]m4_defn([gl_HEADER_NAME])) if test $gl_cv_have_include_next = yes; then AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>']) else AC_CACHE_CHECK( [absolute name of <]m4_defn([gl_HEADER_NAME])[>], [gl_next_header], [m4_if([$2], [check], [AS_VAR_PUSHDEF([gl_header_exists], [ac_cv_header_]m4_defn([gl_HEADER_NAME])) if test AS_VAR_GET([gl_header_exists]) = yes; then AS_VAR_POPDEF([gl_header_exists]) ]) gl_ABSOLUTE_HEADER_ONE(gl_HEADER_NAME) AS_VAR_COPY([gl_header], [gl_cv_absolute_]AS_TR_SH(gl_HEADER_NAME)) AS_VAR_SET([gl_next_header], ['"'$gl_header'"']) m4_if([$2], [check], [else AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>']) fi ]) ]) fi AC_SUBST( AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])), [AS_VAR_GET([gl_next_header])]) if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' gl_next_as_first_directive='<'gl_HEADER_NAME'>' else # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' gl_next_as_first_directive=AS_VAR_GET([gl_next_header]) fi AC_SUBST( AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])), [$gl_next_as_first_directive]) AS_VAR_POPDEF([gl_next_header])]) ]) # Autoconf 2.68 added warnings for our use of AC_COMPILE_IFELSE; # this fallback is safe for all earlier autoconf versions. m4_define_default([AC_LANG_DEFINES_PROVIDED]) groff-1.24.1/gnulib_m4/printf.m40000644000175000017500000027073215153275164013273 00000000000000# printf.m4 # serial 98 dnl Copyright (C) 2003, 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl Test whether the *printf family of functions supports the 'j', 'z', 't', dnl 'L' size specifiers. (ISO C99, POSIX:2001) dnl Result is gl_cv_func_printf_sizes_c99. AC_DEFUN([gl_PRINTF_SIZES_C99], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports size specifiers as in C99], [gl_cv_func_printf_sizes_c99], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include #include #if HAVE_STDINT_H_WITH_UINTMAX # include #endif #if HAVE_INTTYPES_H_WITH_UINTMAX # include #endif static char buf[100]; int main () { int result = 0; #if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX buf[0] = '\0'; if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0 || strcmp (buf, "12345671 33") != 0) result |= 1; #else result |= 1; #endif buf[0] = '\0'; if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0 || strcmp (buf, "12345672 33") != 0) result |= 2; buf[0] = '\0'; if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0 || strcmp (buf, "12345673 33") != 0) result |= 4; buf[0] = '\0'; if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0 || strcmp (buf, "1.5 33") != 0) result |= 8; return result; }]])], [gl_cv_func_printf_sizes_c99=yes], [gl_cv_func_printf_sizes_c99=no], [ case "$host_os" in changequote(,)dnl # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_printf_sizes_c99="guessing yes";; # Guess yes on musl systems. *-musl* | midipix*) gl_cv_func_printf_sizes_c99="guessing yes";; # Guess yes on FreeBSD >= 5. freebsd[1-4].*) gl_cv_func_printf_sizes_c99="guessing no";; freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";; midnightbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; # Guess yes on Mac OS X >= 10.3. darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";; darwin*) gl_cv_func_printf_sizes_c99="guessing yes";; # Guess yes on OpenBSD >= 3.9. openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) gl_cv_func_printf_sizes_c99="guessing no";; openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; # Guess yes on Solaris >= 2.10. solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; solaris*) gl_cv_func_printf_sizes_c99="guessing no";; # Guess yes on NetBSD >= 3. netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) gl_cv_func_printf_sizes_c99="guessing no";; netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; # Guess yes on Android. linux*-android*) gl_cv_func_printf_sizes_c99="guessing yes";; changequote([,])dnl # Guess yes on MSVC, no on mingw. windows*-msvc*) gl_cv_func_printf_sizes_c99="guessing yes" ;; mingw* | windows*) AC_EGREP_CPP([Known], [ #ifdef _MSC_VER Known #endif ], [gl_cv_func_printf_sizes_c99="guessing yes"], [gl_cv_func_printf_sizes_c99="guessing no"]) ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_printf_sizes_c99="$gl_cross_guess_normal";; esac ]) ]) ]) dnl Test whether the *printf family of functions supports the 'w8', 'w16', dnl 'w32', 'w64', 'wf8', 'wf16', 'wf32', 'wf64' size specifiers. (ISO C23) dnl Result is gl_cv_func_printf_sizes_c23. AC_DEFUN([gl_PRINTF_SIZES_C23], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports size specifiers as in C23], [gl_cv_func_printf_sizes_c23], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include #include #if HAVE_STDINT_H_WITH_UINTMAX # include #endif #if HAVE_INTTYPES_H_WITH_UINTMAX # include #endif static char buf[100]; int main () { int result = 0; buf[0] = '\0'; if (sprintf (buf, "%w8u %d", (uint8_t) 123, 33, 44, 55) < 0 || strcmp (buf, "123 33") != 0) result |= 1; buf[0] = '\0'; if (sprintf (buf, "%wf8u %d", (uint_fast8_t) 123, 33, 44, 55) < 0 || strcmp (buf, "123 33") != 0) result |= 1; buf[0] = '\0'; if (sprintf (buf, "%w16u %d", (uint16_t) 12345, 33, 44, 55) < 0 || strcmp (buf, "12345 33") != 0) result |= 2; buf[0] = '\0'; if (sprintf (buf, "%wf16u %d", (uint_fast16_t) 12345, 33, 44, 55) < 0 || strcmp (buf, "12345 33") != 0) result |= 2; buf[0] = '\0'; if (sprintf (buf, "%w32u %d", (uint32_t) 12345671, 33, 44, 55) < 0 || strcmp (buf, "12345671 33") != 0) result |= 4; buf[0] = '\0'; if (sprintf (buf, "%wf32u %d", (uint_fast32_t) 12345671, 33, 44, 55) < 0 || strcmp (buf, "12345671 33") != 0) result |= 4; #if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX buf[0] = '\0'; if (sprintf (buf, "%w64u %d", (uint64_t) 12345671, 33, 44, 55) < 0 || strcmp (buf, "12345671 33") != 0) result |= 8; buf[0] = '\0'; if (sprintf (buf, "%wf64u %d", (uint_fast64_t) 12345671, 33, 44, 55) < 0 || strcmp (buf, "12345671 33") != 0) result |= 8; #else result |= 8; #endif return result; }]])], [gl_cv_func_printf_sizes_c23=yes], [gl_cv_func_printf_sizes_c23=no], [ case "$host_os" in # Guess no on glibc systems. *-gnu* | gnu*) gl_cv_func_printf_sizes_c23="guessing no";; # Guess no on musl systems. *-musl* | midipix*) gl_cv_func_printf_sizes_c23="guessing no";; # Guess no on Android. linux*-android*) gl_cv_func_printf_sizes_c23="guessing no";; # Guess no on native Windows. mingw* | windows*) gl_cv_func_printf_sizes_c23="guessing no";; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_printf_sizes_c23="$gl_cross_guess_normal";; esac ]) ]) ]) dnl Test whether the *printf family of functions supports 'long double' dnl arguments together with the 'L' size specifier. (ISO C99, POSIX:2001) dnl Result is gl_cv_func_printf_long_double. AC_DEFUN([gl_PRINTF_LONG_DOUBLE], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports 'long double' arguments], [gl_cv_func_printf_long_double], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include static char buf[10000]; int main () { int result = 0; buf[0] = '\0'; if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0 || strcmp (buf, "1.750000 33") != 0) result |= 1; buf[0] = '\0'; if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0 || strcmp (buf, "1.750000e+00 33") != 0) result |= 2; buf[0] = '\0'; if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0 || strcmp (buf, "1.75 33") != 0) result |= 4; return result; }]])], [gl_cv_func_printf_long_double=yes], [gl_cv_func_printf_long_double=no], [case "$host_os" in # Guess no on BeOS. beos*) gl_cv_func_printf_long_double="guessing no";; # Guess yes on Android. linux*-android*) gl_cv_func_printf_long_double="guessing yes";; # Guess yes on MSVC, no on mingw. windows*-msvc*) gl_cv_func_printf_long_double="guessing yes" ;; mingw* | windows*) AC_EGREP_CPP([Known], [ #ifdef _MSC_VER Known #endif ], [gl_cv_func_printf_long_double="guessing yes"], [gl_cv_func_printf_long_double="guessing no"]) ;; *) gl_cv_func_printf_long_double="guessing yes";; esac ]) ]) ]) dnl Test whether the *printf family of functions supports infinite and NaN dnl 'double' arguments and negative zero arguments in the %f, %e, %g dnl directives. (ISO C99, POSIX:2001) dnl Result is gl_cv_func_printf_infinite. AC_DEFUN([gl_PRINTF_INFINITE], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports infinite 'double' arguments], [gl_cv_func_printf_infinite], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include static int strisnan (const char *string, size_t start_index, size_t end_index) { if (start_index < end_index) { if (string[start_index] == '-') start_index++; if (start_index + 3 <= end_index && memcmp (string + start_index, "nan", 3) == 0) { start_index += 3; if (start_index == end_index || (string[start_index] == '(' && string[end_index - 1] == ')')) return 1; } } return 0; } static int have_minus_zero () { static double plus_zero = 0.0; double minus_zero = - plus_zero; return memcmp (&plus_zero, &minus_zero, sizeof (double)) != 0; } static char buf[10000]; static double zero = 0.0; int main () { int result = 0; if (sprintf (buf, "%f", 1.0 / zero) < 0 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) result |= 1; if (sprintf (buf, "%f", -1.0 / zero) < 0 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) result |= 1; if (sprintf (buf, "%f", zero / zero) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 2; if (sprintf (buf, "%e", 1.0 / zero) < 0 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) result |= 4; if (sprintf (buf, "%e", -1.0 / zero) < 0 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) result |= 4; if (sprintf (buf, "%e", zero / zero) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 8; if (sprintf (buf, "%g", 1.0 / zero) < 0 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) result |= 16; if (sprintf (buf, "%g", -1.0 / zero) < 0 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) result |= 16; if (sprintf (buf, "%g", zero / zero) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 32; /* This test fails on HP-UX 10.20. */ if (have_minus_zero ()) if (sprintf (buf, "%g", - zero) < 0 || strcmp (buf, "-0") != 0) result |= 64; return result; }]])], [gl_cv_func_printf_infinite=yes], [gl_cv_func_printf_infinite=no], [ case "$host_os" in changequote(,)dnl # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_printf_infinite="guessing yes";; # Guess yes on musl systems. *-musl* | midipix*) gl_cv_func_printf_infinite="guessing yes";; # Guess yes on FreeBSD >= 6. freebsd[1-5].*) gl_cv_func_printf_infinite="guessing no";; freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";; midnightbsd*) gl_cv_func_printf_infinite="guessing yes";; # Guess yes on Mac OS X >= 10.3. darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";; darwin*) gl_cv_func_printf_infinite="guessing yes";; # Guess yes on HP-UX >= 11. hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";; hpux*) gl_cv_func_printf_infinite="guessing yes";; # Guess yes on NetBSD >= 3. netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) gl_cv_func_printf_infinite="guessing no";; netbsd*) gl_cv_func_printf_infinite="guessing yes";; # Guess yes on OpenBSD >= 6.0. openbsd[1-5].*) gl_cv_func_printf_infinite="guessing no";; openbsd*) gl_cv_func_printf_infinite="guessing yes";; # Guess yes on BeOS. beos*) gl_cv_func_printf_infinite="guessing yes";; # Guess no on Android. linux*-android*) gl_cv_func_printf_infinite="guessing no";; changequote([,])dnl # Guess yes on MSVC, no on mingw. windows*-msvc*) gl_cv_func_printf_infinite="guessing yes" ;; mingw* | windows*) AC_EGREP_CPP([Known], [ #ifdef _MSC_VER Known #endif ], [gl_cv_func_printf_infinite="guessing yes"], [gl_cv_func_printf_infinite="guessing no"]) ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_printf_infinite="$gl_cross_guess_normal";; esac ]) ]) ]) dnl Test whether the *printf family of functions supports infinite and NaN dnl 'long double' arguments in the %f, %e, %g directives. (ISO C99, POSIX:2001) dnl Result is gl_cv_func_printf_infinite_long_double. AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE], [ AC_REQUIRE([gl_PRINTF_LONG_DOUBLE]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gl_BIGENDIAN]) AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl The user can set or unset the variable gl_printf_safe to indicate dnl that he wishes a safe handling of non-IEEE-754 'long double' values. if test -n "$gl_printf_safe"; then AC_DEFINE([CHECK_PRINTF_SAFE], [1], [Define if you wish *printf() functions that have a safe handling of non-IEEE-754 'long double' values.]) fi case "$gl_cv_func_printf_long_double" in *yes) AC_CACHE_CHECK([whether printf supports infinite 'long double' arguments], [gl_cv_func_printf_infinite_long_double], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ ]GL_NOCRASH[ #include #include #include static int strisnan (const char *string, size_t start_index, size_t end_index) { if (start_index < end_index) { if (string[start_index] == '-') start_index++; if (start_index + 3 <= end_index && memcmp (string + start_index, "nan", 3) == 0) { start_index += 3; if (start_index == end_index || (string[start_index] == '(' && string[end_index - 1] == ')')) return 1; } } return 0; } static char buf[10000]; static long double zeroL = 0.0L; int main () { int result = 0; nocrash_init(); if (sprintf (buf, "%Lf", 1.0L / zeroL) < 0 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) result |= 1; if (sprintf (buf, "%Lf", -1.0L / zeroL) < 0 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) result |= 1; if (sprintf (buf, "%Lf", zeroL / zeroL) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 1; if (sprintf (buf, "%Le", 1.0L / zeroL) < 0 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) result |= 1; if (sprintf (buf, "%Le", -1.0L / zeroL) < 0 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) result |= 1; if (sprintf (buf, "%Le", zeroL / zeroL) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 1; if (sprintf (buf, "%Lg", 1.0L / zeroL) < 0 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) result |= 1; if (sprintf (buf, "%Lg", -1.0L / zeroL) < 0 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) result |= 1; if (sprintf (buf, "%Lg", zeroL / zeroL) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 1; #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE /* Representation of an 80-bit 'long double' as an initializer for a sequence of 'unsigned int' words. */ # ifdef WORDS_BIGENDIAN # define LDBL80_WORDS(exponent,manthi,mantlo) \ { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ (unsigned int) (mantlo) << 16 \ } # else # define LDBL80_WORDS(exponent,manthi,mantlo) \ { mantlo, manthi, exponent } # endif { /* Quiet NaN. */ static union { unsigned int word[4]; long double value; } x = { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; if (sprintf (buf, "%Lf", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 2; if (sprintf (buf, "%Le", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 2; if (sprintf (buf, "%Lg", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 2; } { /* Signalling NaN. */ static union { unsigned int word[4]; long double value; } x = { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; if (sprintf (buf, "%Lf", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 2; if (sprintf (buf, "%Le", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 2; if (sprintf (buf, "%Lg", x.value) < 0 || !strisnan (buf, 0, strlen (buf))) result |= 2; } { /* Pseudo-NaN. */ static union { unsigned int word[4]; long double value; } x = { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; if (sprintf (buf, "%Lf", x.value) <= 0) result |= 4; if (sprintf (buf, "%Le", x.value) <= 0) result |= 4; if (sprintf (buf, "%Lg", x.value) <= 0) result |= 4; } { /* Pseudo-Infinity. */ static union { unsigned int word[4]; long double value; } x = { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; if (sprintf (buf, "%Lf", x.value) <= 0) result |= 8; if (sprintf (buf, "%Le", x.value) <= 0) result |= 8; if (sprintf (buf, "%Lg", x.value) <= 0) result |= 8; } { /* Pseudo-Zero. */ static union { unsigned int word[4]; long double value; } x = { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; if (sprintf (buf, "%Lf", x.value) <= 0) result |= 16; if (sprintf (buf, "%Le", x.value) <= 0) result |= 16; if (sprintf (buf, "%Lg", x.value) <= 0) result |= 16; } { /* Unnormalized number. */ static union { unsigned int word[4]; long double value; } x = { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; if (sprintf (buf, "%Lf", x.value) <= 0) result |= 32; if (sprintf (buf, "%Le", x.value) <= 0) result |= 32; if (sprintf (buf, "%Lg", x.value) <= 0) result |= 32; } { /* Pseudo-Denormal. */ static union { unsigned int word[4]; long double value; } x = { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; if (sprintf (buf, "%Lf", x.value) <= 0) result |= 64; if (sprintf (buf, "%Le", x.value) <= 0) result |= 64; if (sprintf (buf, "%Lg", x.value) <= 0) result |= 64; } #endif return result; }]])], [gl_cv_func_printf_infinite_long_double=yes], [gl_cv_func_printf_infinite_long_double=no], [case "$host_cpu" in # Guess no on ia64, x86_64, i386. ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";; *) case "$host_os" in changequote(,)dnl # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";; # Guess yes on musl systems. *-musl* | midipix*) gl_cv_func_printf_infinite_long_double="guessing yes";; # Guess yes on FreeBSD >= 6. freebsd[1-5].*) gl_cv_func_printf_infinite_long_double="guessing no";; freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; midnightbsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; # Guess yes on HP-UX >= 11. hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";; hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";; # Guess yes on OpenBSD >= 6.0. openbsd[1-5].*) gl_cv_func_printf_infinite_long_double="guessing no";; openbsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; # Guess no on Android. linux*-android*) gl_cv_func_printf_infinite_long_double="guessing no";; changequote([,])dnl # Guess yes on MSVC, no on mingw. windows*-msvc*) gl_cv_func_printf_infinite_long_double="guessing yes" ;; mingw* | windows*) AC_EGREP_CPP([Known], [ #ifdef _MSC_VER Known #endif ], [gl_cv_func_printf_infinite_long_double="guessing yes"], [gl_cv_func_printf_infinite_long_double="guessing no"]) ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_printf_infinite_long_double="$gl_cross_guess_normal";; esac ;; esac ]) ]) ;; *) gl_cv_func_printf_infinite_long_double="irrelevant" ;; esac ]) dnl Test whether the *printf family of functions supports the 'a' and 'A' dnl conversion specifier for hexadecimal output of floating-point numbers. dnl (ISO C99, POSIX:2001) dnl Result is gl_cv_func_printf_directive_a. AC_DEFUN([gl_PRINTF_DIRECTIVE_A], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports the 'a' and 'A' directives], [gl_cv_func_printf_directive_a], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include static char buf[100]; static double zero = 0.0; int main () { int result = 0; /* This fails on FreeBSD 5.2.1, Solaris 11.4. */ if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0 || (strcmp (buf, "0x1.922p+1 33") != 0 && strcmp (buf, "0x3.244p+0 33") != 0 && strcmp (buf, "0x6.488p-1 33") != 0 && strcmp (buf, "0xc.91p-2 33") != 0)) result |= 1; if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0 || (strcmp (buf, "-0X1.922P+1 33") != 0 && strcmp (buf, "-0X3.244P+0 33") != 0 && strcmp (buf, "-0X6.488P-1 33") != 0 && strcmp (buf, "-0XC.91P-2 33") != 0)) result |= 1; /* This catches a Mac OS X 10.5, FreeBSD 6.4, NetBSD 10.0 bug: it doesn't round. */ if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0 || (strcmp (buf, "0x1.83p+0 33") != 0 && strcmp (buf, "0x3.05p-1 33") != 0 && strcmp (buf, "0x6.0ap-2 33") != 0 && strcmp (buf, "0xc.14p-3 33") != 0)) result |= 2; /* This catches a macOS 14 (Darwin 23), FreeBSD 14.0, OpenBSD 7.5, AIX 7.3, Solaris 11.4 bug: it doesn't round. */ if (sprintf (buf, "%.0a %d", 1.51, 33, 44, 55) < 0 || (strcmp (buf, "0x2p+0 33") != 0 && strcmp (buf, "0x3p-1 33") != 0 && strcmp (buf, "0x6p-2 33") != 0 && strcmp (buf, "0xcp-3 33") != 0)) result |= 4; /* This catches a Mac OS X 10.5, FreeBSD 6.4 bug. See */ if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0 || buf[0] == '0') result |= 8; /* This catches a Mac OS X 10.3.9 (Darwin 7.9), FreeBSD 6.4 bug. */ if (sprintf (buf, "%.1a", 1.999) < 0 || (strcmp (buf, "0x1.0p+1") != 0 && strcmp (buf, "0x2.0p+0") != 0 && strcmp (buf, "0x4.0p-1") != 0 && strcmp (buf, "0x8.0p-2") != 0)) result |= 16; /* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a glibc 2.4 bug and a FreeBSD 6.4, NetBSD 10.0 bug. */ if (sprintf (buf, "%.1La", 1.999L) < 0 || (strcmp (buf, "0x1.0p+1") != 0 && strcmp (buf, "0x2.0p+0") != 0 && strcmp (buf, "0x4.0p-1") != 0 && strcmp (buf, "0x8.0p-2") != 0)) result |= 32; return result; }]])], [gl_cv_func_printf_directive_a=yes], [gl_cv_func_printf_directive_a=no], [ case "$host_os" in # Guess yes on glibc >= 2.5 systems. *-gnu* | gnu*) AC_EGREP_CPP([BZ2908], [ #include #ifdef __GNU_LIBRARY__ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)) && !defined __UCLIBC__ BZ2908 #endif #endif ], [gl_cv_func_printf_directive_a="guessing yes"], [gl_cv_func_printf_directive_a="guessing no"]) ;; # Guess yes on musl systems. *-musl* | midipix*) gl_cv_func_printf_directive_a="guessing yes";; # Guess no on Android. linux*-android*) gl_cv_func_printf_directive_a="guessing no";; # Guess no on native Windows. mingw* | windows*) gl_cv_func_printf_directive_a="guessing no";; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_printf_directive_a="$gl_cross_guess_normal";; esac ]) ]) ]) dnl Test whether the *printf family of functions supports the 'b' conversion dnl specifier for binary output of integers. dnl (ISO C23) dnl Result is gl_cv_func_printf_directive_b. AC_DEFUN([gl_PRINTF_DIRECTIVE_B], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports the 'b' directive], [gl_cv_func_printf_directive_b], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include static char buf[100]; int main () { int result = 0; if (sprintf (buf, "%b %d", 12345, 33, 44, 55) < 0 || strcmp (buf, "11000000111001 33") != 0) result |= 1; return result; }]])], [gl_cv_func_printf_directive_b=yes], [gl_cv_func_printf_directive_b=no], [ case "$host_os" in # Guess yes on glibc >= 2.35 systems. *-gnu* | gnu*) AC_EGREP_CPP([Lucky], [ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 35) || (__GLIBC__ > 2) Lucky user #endif #endif ], [gl_cv_func_printf_directive_uppercase_b="guessing yes"], [gl_cv_func_printf_directive_uppercase_b="guessing no"]) ;; # Guess no on musl systems. *-musl* | midipix*) gl_cv_func_printf_directive_b="guessing no";; # Guess no on Android. linux*-android*) gl_cv_func_printf_directive_b="guessing no";; # Guess no on native Windows. mingw* | windows*) gl_cv_func_printf_directive_b="guessing no";; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_printf_directive_b="$gl_cross_guess_normal";; esac ]) ]) ]) dnl Test whether the *printf family of functions supports the 'B' conversion dnl specifier for binary output of integers. dnl (GNU, encouraged by ISO C23 § 7.23.6.1) dnl Result is gl_cv_func_printf_directive_uppercase_b. AC_DEFUN([gl_PRINTF_DIRECTIVE_UPPERCASE_B], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports the 'B' directive], [gl_cv_func_printf_directive_uppercase_b], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include static char buf[100]; int main () { int result = 0; if (sprintf (buf, "%#B %d", 12345, 33, 44, 55) < 0 || strcmp (buf, "0B11000000111001 33") != 0) result |= 1; return result; }]])], [gl_cv_func_printf_directive_uppercase_b=yes], [gl_cv_func_printf_directive_uppercase_b=no], [ case "$host_os" in # Guess yes on glibc >= 2.35 systems. *-gnu* | gnu*) AC_EGREP_CPP([Lucky], [ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 35) || (__GLIBC__ > 2) Lucky user #endif #endif ], [gl_cv_func_printf_directive_uppercase_b="guessing yes"], [gl_cv_func_printf_directive_uppercase_b="guessing no"]) ;; # Guess no on musl systems. *-musl* | midipix*) gl_cv_func_printf_directive_uppercase_b="guessing no";; # Guess no on Android. linux*-android*) gl_cv_func_printf_directive_uppercase_b="guessing no";; # Guess no on native Windows. mingw* | windows*) gl_cv_func_printf_directive_uppercase_b="guessing no";; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_printf_directive_uppercase_b="$gl_cross_guess_normal";; esac ]) ]) ]) dnl Test whether the *printf family of functions supports the %F format dnl directive. (ISO C99, POSIX:2001) dnl Result is gl_cv_func_printf_directive_f. AC_DEFUN([gl_PRINTF_DIRECTIVE_F], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports the 'F' directive], [gl_cv_func_printf_directive_f], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include static char buf[100]; static double zero = 0.0; int main () { int result = 0; if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0 || strcmp (buf, "1234567.000000 33") != 0) result |= 1; if (sprintf (buf, "%F", 1.0 / zero) < 0 || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0)) result |= 2; /* This catches a Cygwin 1.5.x bug. */ if (sprintf (buf, "%.F", 1234.0) < 0 || strcmp (buf, "1234") != 0) result |= 4; return result; }]])], [gl_cv_func_printf_directive_f=yes], [gl_cv_func_printf_directive_f=no], [ case "$host_os" in changequote(,)dnl # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_printf_directive_f="guessing yes";; # Guess yes on musl systems. *-musl* | midipix*) gl_cv_func_printf_directive_f="guessing yes";; # Guess yes on FreeBSD >= 6. freebsd[1-5].*) gl_cv_func_printf_directive_f="guessing no";; freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";; midnightbsd*) gl_cv_func_printf_directive_f="guessing yes";; # Guess yes on Mac OS X >= 10.3. darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";; darwin*) gl_cv_func_printf_directive_f="guessing yes";; # Guess yes on OpenBSD >= 6.0. openbsd[1-5].*) gl_cv_func_printf_directive_f="guessing no";; openbsd*) gl_cv_func_printf_directive_f="guessing yes";; # Guess yes on Solaris >= 2.10. solaris2.[1-9][0-9]*) gl_cv_func_printf_directive_f="guessing yes";; solaris*) gl_cv_func_printf_directive_f="guessing no";; # Guess no on Android. linux*-android*) gl_cv_func_printf_directive_f="guessing no";; changequote([,])dnl # Guess yes on MSVC, no on mingw. windows*-msvc*) gl_cv_func_printf_directive_f="guessing yes" ;; mingw* | windows*) AC_EGREP_CPP([Known], [ #ifdef _MSC_VER Known #endif ], [gl_cv_func_printf_directive_f="guessing yes"], [gl_cv_func_printf_directive_f="guessing no"]) ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_printf_directive_f="$gl_cross_guess_normal";; esac ]) ]) ]) dnl Test whether the *printf family of functions supports the %n format dnl directive. (ISO C99, POSIX:2001) dnl Result is gl_cv_func_printf_directive_n. AC_DEFUN([gl_PRINTF_DIRECTIVE_N], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports the 'n' directive], [gl_cv_func_printf_directive_n], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include #if defined _WIN32 && !defined __CYGWIN__ # include #else # include #endif #ifdef _MSC_VER #include #include /* See page about "Parameter Validation" on msdn.microsoft.com. */ static void cdecl invalid_parameter_handler (const wchar_t *expression, const wchar_t *function, const wchar_t *file, unsigned int line, uintptr_t dummy) { exit (1); } #endif static void abort_handler (int sig) { (void) sig; _exit (1); } static char fmtstring[10]; static char buf[100]; int main () { int count = -1; #ifdef _MSC_VER _set_invalid_parameter_handler (invalid_parameter_handler); /* Also avoid an Abort/Retry/Ignore dialog in debug builds. */ _CrtSetReportMode (_CRT_ASSERT, 0); #endif signal (SIGABRT, abort_handler); /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE >= 2) support %n in format strings in read-only memory but not in writable memory. */ strcpy (fmtstring, "%d %n"); if (sprintf (buf, fmtstring, 123, &count, 33, 44, 55) < 0 || strcmp (buf, "123 ") != 0 || count != 4) return 1; return 0; }]])], [gl_cv_func_printf_directive_n=yes], [gl_cv_func_printf_directive_n=no], [case "$host_os" in # Guess no on glibc when _FORTIFY_SOURCE >= 2. *-gnu* | gnu*) AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if _FORTIFY_SOURCE >= 2 error fail #endif ]])], [gl_cv_func_printf_directive_n="guessing yes"], [gl_cv_func_printf_directive_n="guessing no"]) ;; # Guess no on Android. linux*-android*) gl_cv_func_printf_directive_n="guessing no";; # Guess no on native Windows. mingw* | windows*) gl_cv_func_printf_directive_n="guessing no";; *) gl_cv_func_printf_directive_n="guessing yes";; esac ]) ]) ]) dnl Test whether the *printf family of functions supports the %ls format dnl directive and in particular, when a precision is specified, whether dnl the functions stop converting the wide string argument when the number dnl of bytes that have been produced by this conversion equals or exceeds dnl the precision. dnl Result is gl_cv_func_printf_directive_ls. AC_DEFUN([gl_PRINTF_DIRECTIVE_LS], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports the 'ls' directive], [gl_cv_func_printf_directive_ls], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include int main () { int result = 0; char buf[100]; /* Test whether %ls works at all. This test fails on OpenBSD 4.0, Solaris 2.6, Haiku, but not on Cygwin 1.5. */ { static const wchar_t wstring[] = { 'a', 'b', 'c', 0 }; buf[0] = '\0'; if (sprintf (buf, "%ls", wstring) < 0 || strcmp (buf, "abc") != 0) result |= 1; } /* This test fails on Solaris 2.6, Cygwin 1.5, Haiku (with an assertion failure inside libc), but not on OpenBSD 4.0. */ { static const wchar_t wstring[] = { 'a', 0 }; buf[0] = '\0'; if (sprintf (buf, "%ls", wstring) < 0 || strcmp (buf, "a") != 0) result |= 2; } /* Test whether precisions in %ls are supported as specified in ISO C 99 section 7.19.6.1: "If a precision is specified, no more than that many bytes are written (including shift sequences, if any), and the array shall contain a null wide character if, to equal the multibyte character sequence length given by the precision, the function would need to access a wide character one past the end of the array." This test fails on Solaris 10. */ { static const wchar_t wstring[] = { 'a', 'b', (wchar_t) 0xfdfdfdfd, 0 }; buf[0] = '\0'; if (sprintf (buf, "%.2ls", wstring) < 0 || strcmp (buf, "ab") != 0) result |= 8; } return result; }]])], [gl_cv_func_printf_directive_ls=yes], [gl_cv_func_printf_directive_ls=no], [ changequote(,)dnl case "$host_os" in # Guess yes on OpenBSD >= 6.0. openbsd[1-5].*) gl_cv_func_printf_directive_ls="guessing no";; openbsd*) gl_cv_func_printf_directive_ls="guessing yes";; solaris*) gl_cv_func_printf_directive_ls="guessing no";; cygwin*) gl_cv_func_printf_directive_ls="guessing no";; beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";; # Guess no on Android. linux*-android*) gl_cv_func_printf_directive_ls="guessing no";; # Guess yes on native Windows. mingw* | windows*) gl_cv_func_printf_directive_ls="guessing yes";; *) gl_cv_func_printf_directive_ls="guessing yes";; esac changequote([,])dnl ]) ]) ]) dnl Test whether the *printf family of functions supports the %lc format dnl directive and in particular, when the argument is a null wide character, dnl whether the functions produce a NUL byte, as specified in ISO C 23 dnl after the issue GB-141 was fixed. dnl Result is gl_cv_func_printf_directive_lc. AC_DEFUN([gl_PRINTF_DIRECTIVE_LC], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports the 'lc' directive correctly], [gl_cv_func_printf_directive_lc], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include int main () { int result = 0; char buf[100]; /* This test fails on musl libc 1.2.4. */ { buf[0] = '\0'; if (sprintf (buf, "%lc%lc%lc", (wint_t) 'a', (wint_t) 0, (wint_t) 'z') < 0 || memcmp (buf, "a\0z", 4) != 0) result |= 1; } return result; }]])], [gl_cv_func_printf_directive_lc=yes], [gl_cv_func_printf_directive_lc=no], [ changequote(,)dnl case "$host_os" in # Guess no on musl libc. *-musl* | midipix*) gl_cv_func_printf_directive_lc="guessing no";; # Guess yes otherwise. *) gl_cv_func_printf_directive_lc="guessing yes";; esac changequote([,])dnl ]) ]) ]) dnl Test whether the *printf family of functions supports POSIX/XSI format dnl strings with positions. (POSIX:2001) dnl Result is gl_cv_func_printf_positions. AC_DEFUN_ONCE([gl_PRINTF_POSITIONS], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports POSIX/XSI format strings with positions], [gl_cv_func_printf_positions], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include /* The string "%2$d %1$d", with dollar characters protected from the shell's dollar expansion (possibly an autoconf bug). */ static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; static char buf[100]; int main () { sprintf (buf, format, 33, 55); return (strcmp (buf, "55 33") != 0); }]])], [gl_cv_func_printf_positions=yes], [gl_cv_func_printf_positions=no], [ changequote(,)dnl case "$host_os" in netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) gl_cv_func_printf_positions="guessing no";; beos*) gl_cv_func_printf_positions="guessing no";; # Guess yes on Android. linux*-android*) gl_cv_func_printf_positions="guessing yes";; # Guess no on native Windows. mingw* | windows* | pw*) gl_cv_func_printf_positions="guessing no";; *) gl_cv_func_printf_positions="guessing yes";; esac changequote([,])dnl ]) ]) ]) dnl Test whether the *printf family of functions supports POSIX/XSI format dnl strings with the ' flag for grouping of decimal digits. (POSIX:2001) dnl Result is gl_cv_func_printf_flag_grouping. AC_DEFUN([gl_PRINTF_FLAG_GROUPING], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports the grouping flag], [gl_cv_func_printf_flag_grouping], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include static char buf[100]; int main () { if (sprintf (buf, "%'d %d", 1234567, 99) < 0 || buf[strlen (buf) - 1] != '9') return 1; return 0; }]])], [gl_cv_func_printf_flag_grouping=yes], [gl_cv_func_printf_flag_grouping=no], [ changequote(,)dnl case "$host_os" in cygwin*) gl_cv_func_printf_flag_grouping="guessing no";; netbsd*) gl_cv_func_printf_flag_grouping="guessing no";; # Guess no on Android. linux*-android*) gl_cv_func_printf_flag_grouping="guessing no";; # Guess no on native Windows. mingw* | windows* | pw*) gl_cv_func_printf_flag_grouping="guessing no";; *) gl_cv_func_printf_flag_grouping="guessing yes";; esac changequote([,])dnl ]) ]) ]) dnl Test whether the *printf family of functions supports POSIX/XSI format dnl strings with the ' flag for grouping of decimal digits on integers, dnl together with a precision. dnl Result is gl_cv_func_printf_flag_grouping_int_precision. AC_DEFUN([gl_PRINTF_FLAG_GROUPING_INT_PRECISION], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([whether printf supports grouping on integers with a precision], [gl_cv_func_printf_flag_grouping_int_precision], [ dnl Prepare a guess, used when cross-compiling or when specific locales dnl are not available. case "$host_os" in # Guess no on FreeBSD, NetBSD, Solaris, Cygwin, Haiku. freebsd* | dragonfly* | netbsd* | solaris* | cygwin* | haiku*) gl_cv_func_printf_flag_grouping_int_precision="guessing no";; *) gl_cv_func_printf_flag_grouping_int_precision="guessing yes";; esac AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include static char buf[100]; int main () { if (setlocale (LC_ALL, "fr_FR.UTF-8") != NULL || setlocale (LC_ALL, "fr_FR") != NULL || setlocale (LC_ALL, "fr_FR.ISO-8859-1") != NULL || setlocale (LC_ALL, "fr_FR.ISO8859-1") != NULL) { if (sprintf (buf, "%'.10d", 1000) < 0) return 1; if (strlen (buf) == 10 && strcmp (buf, "0000001000") != 0) /* The sprintf implementation has produced fewer than 10 digits. */ return 2; else return 0; } return 3; }]])], [gl_cv_func_printf_flag_grouping_int_precision=yes], [if test $? = 2; then gl_cv_func_printf_flag_grouping_int_precision=no fi ], [:]) ]) ]) dnl Test whether the *printf family of functions supports POSIX/XSI format dnl strings with the ' flag for grouping of decimal digits, when the thousands dnl separator is a multibyte character (such as U+00A0 or U+202F in a UTF-8 dnl locale). dnl Result is gl_cv_func_printf_flag_grouping_multibyte. AC_DEFUN([gl_PRINTF_FLAG_GROUPING_MULTIBYTE], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([whether printf supports grouping with a multibyte separator], [gl_cv_func_printf_flag_grouping_multibyte], [ dnl Prepare a guess, used when cross-compiling or when specific locales dnl are not available. case "$host_os" in # Guess no on NetBSD and Solaris 11 OpenIndiana. netbsd* | solaris*) gl_cv_func_printf_flag_grouping_multibyte="guessing no";; *) gl_cv_func_printf_flag_grouping_multibyte="guessing yes";; esac AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include static char buf[100]; int main () { if (setlocale (LC_ALL, "fr_FR.UTF-8") == NULL) return 0; if (sprintf (buf, "%'.0f", 1000.0) < 0) return 1; if (strlen (localeconv ()->thousands_sep) > 1) { if (strlen (buf) <= 4 + 1) return 2; else return 3; } return 0; }]])], [:], [case $? in 2) gl_cv_func_printf_flag_grouping_multibyte=no ;; 3) gl_cv_func_printf_flag_grouping_multibyte=yes ;; esac ], [:]) ]) ]) dnl Test whether the *printf family of functions supports the - flag correctly. dnl (ISO C99.) See dnl dnl Result is gl_cv_func_printf_flag_leftadjust. AC_DEFUN([gl_PRINTF_FLAG_LEFTADJUST], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports the left-adjust flag correctly], [gl_cv_func_printf_flag_leftadjust], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include static char buf[100]; int main () { /* Check that a '-' flag is not annihilated by a negative width. */ if (sprintf (buf, "a%-*sc", -3, "b") < 0 || strcmp (buf, "ab c") != 0) return 1; return 0; }]])], [gl_cv_func_printf_flag_leftadjust=yes], [gl_cv_func_printf_flag_leftadjust=no], [ changequote(,)dnl case "$host_os" in # Guess yes on HP-UX 11. hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";; # Guess no on HP-UX 10 and older. hpux*) gl_cv_func_printf_flag_leftadjust="guessing no";; # Guess yes on Android. linux*-android*) gl_cv_func_printf_flag_leftadjust="guessing yes";; # Guess yes on native Windows. mingw* | windows*) gl_cv_func_printf_flag_leftadjust="guessing yes";; # Guess yes otherwise. *) gl_cv_func_printf_flag_leftadjust="guessing yes";; esac changequote([,])dnl ]) ]) ]) dnl Test whether the *printf family of functions supports padding of non-finite dnl values with the 0 flag correctly. (ISO C99 + TC1 + TC2.) See dnl dnl Result is gl_cv_func_printf_flag_zero. AC_DEFUN([gl_PRINTF_FLAG_ZERO], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports the zero flag correctly], [gl_cv_func_printf_flag_zero], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include static char buf[100]; static double zero = 0.0; int main () { if (sprintf (buf, "%010f", 1.0 / zero, 33, 44, 55) < 0 || (strcmp (buf, " inf") != 0 && strcmp (buf, " infinity") != 0)) return 1; return 0; }]])], [gl_cv_func_printf_flag_zero=yes], [gl_cv_func_printf_flag_zero=no], [ changequote(,)dnl case "$host_os" in # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_printf_flag_zero="guessing yes";; # Guess yes on musl systems. *-musl* | midipix*) gl_cv_func_printf_flag_zero="guessing yes";; # Guess yes on BeOS. beos*) gl_cv_func_printf_flag_zero="guessing yes";; # Guess no on Android. linux*-android*) gl_cv_func_printf_flag_zero="guessing no";; # Guess no on native Windows. mingw* | windows*) gl_cv_func_printf_flag_zero="guessing no";; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_printf_flag_zero="$gl_cross_guess_normal";; esac changequote([,])dnl ]) ]) ]) dnl Test whether the *printf family of functions supports the # flag with a dnl zero precision and a zero value in the 'x' and 'X' directives correctly. dnl ISO C and POSIX specify that for the 'd', 'i', 'b', 'o', 'u', 'x', 'X' dnl directives: "The result of converting a zero value with a precision of dnl zero is no characters." But on Mac OS X 10.5, for the 'x', 'X' directives, dnl when a # flag is present, the output is "0" instead of "". dnl Result is gl_cv_func_printf_flag_alt_precision_zero. AC_DEFUN([gl_PRINTF_FLAG_ALT_PRECISION_ZERO], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports the alternative flag with a zero precision], [gl_cv_func_printf_flag_alt_precision_zero], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include static char buf[10]; int main () { int result = 0; if (sprintf (buf, "%#.0x %d", 0, 33, 44) > 0 + 3) result |= 1; return result; }]])], [gl_cv_func_printf_flag_alt_precision_zero=yes], [gl_cv_func_printf_flag_alt_precision_zero=no], [ changequote(,)dnl case "$host_os" in # Guess no only on macOS 10..12 systems. darwin[0-9] | darwin[0-9].* | \ darwin1[0-9] | darwin1[0-9].* | \ darwin2[0-1] | darwin2[0-1].*) gl_cv_func_printf_flag_alt_precision_zero="guessing no" ;; darwin*) gl_cv_func_printf_flag_alt_precision_zero="guessing yes" ;; *) gl_cv_func_printf_flag_alt_precision_zero="guessing yes" ;; esac changequote([,])dnl ]) ]) ]) dnl Test whether the *printf family of functions supports large precisions. dnl On mingw, precisions larger than 512 are treated like 512, in integer, dnl floating-point or pointer output. On Solaris 10/x86, precisions larger dnl than 510 in floating-point output crash the program. On Solaris 10/SPARC, dnl precisions larger than 510 in floating-point output yield wrong results. dnl On AIX 7.1, precisions larger than 998 in floating-point output yield dnl wrong results. On BeOS, precisions larger than 1044 crash the program. dnl Result is gl_cv_func_printf_precision. AC_DEFUN([gl_PRINTF_PRECISION], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf supports large precisions], [gl_cv_func_printf_precision], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include static char buf[5000]; int main () { int result = 0; #ifdef __BEOS__ /* On BeOS, this would crash and show a dialog box. Avoid the crash. */ return 1; #endif if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3) result |= 1; if (sprintf (buf, "%.4000f %d", 1.0, 33, 44) < 4000 + 5) result |= 2; if (sprintf (buf, "%.511f %d", 1.0, 33, 44) < 511 + 5 || buf[0] != '1') result |= 4; if (sprintf (buf, "%.999f %d", 1.0, 33, 44) < 999 + 5 || buf[0] != '1') result |= 4; return result; }]])], [gl_cv_func_printf_precision=yes], [gl_cv_func_printf_precision=no], [ changequote(,)dnl case "$host_os" in # Guess no only on Solaris, native Windows, and BeOS systems. solaris*) gl_cv_func_printf_precision="guessing no" ;; mingw* | windows* | pw*) gl_cv_func_printf_precision="guessing no" ;; beos*) gl_cv_func_printf_precision="guessing no" ;; # Guess yes on Android. linux*-android*) gl_cv_func_printf_precision="guessing yes" ;; *) gl_cv_func_printf_precision="guessing yes" ;; esac changequote([,])dnl ]) ]) ]) dnl Test whether the *printf family of functions recovers gracefully in case dnl of an out-of-memory condition, or whether it crashes the entire program. dnl Result is gl_cv_func_printf_enomem. AC_DEFUN([gl_PRINTF_ENOMEM], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gl_MULTIARCH]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether printf survives out-of-memory conditions], [gl_cv_func_printf_enomem], [ gl_cv_func_printf_enomem="guessing no" if test "$cross_compiling" = no; then if test $APPLE_UNIVERSAL_BUILD = 0; then AC_LANG_CONFTEST([AC_LANG_SOURCE([[ ]GL_NOCRASH[ #include #include #include #include #include int main() { struct rlimit limit; int ret; nocrash_init (); /* Some printf implementations allocate temporary space with malloc. */ /* On BSD systems, malloc() is limited by RLIMIT_DATA. */ #ifdef RLIMIT_DATA if (getrlimit (RLIMIT_DATA, &limit) < 0) return 77; if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) limit.rlim_max = 5000000; limit.rlim_cur = limit.rlim_max; if (setrlimit (RLIMIT_DATA, &limit) < 0) return 77; #endif /* On Linux systems, malloc() is limited by RLIMIT_AS. */ #ifdef RLIMIT_AS if (getrlimit (RLIMIT_AS, &limit) < 0) return 77; if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) limit.rlim_max = 5000000; limit.rlim_cur = limit.rlim_max; if (setrlimit (RLIMIT_AS, &limit) < 0) return 77; #endif /* Some printf implementations allocate temporary space on the stack. */ #ifdef RLIMIT_STACK if (getrlimit (RLIMIT_STACK, &limit) < 0) return 77; if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) limit.rlim_max = 5000000; limit.rlim_cur = limit.rlim_max; if (setrlimit (RLIMIT_STACK, &limit) < 0) return 77; #endif ret = printf ("%.5000000f", 1.0); return !(ret == 5000002 || (ret < 0 && errno == ENOMEM)); } ]])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then (./conftest 2>&AS_MESSAGE_LOG_FD result=$? _AS_ECHO_LOG([\$? = $result]) if test $result != 0 && test $result != 77; then result=1; fi exit $result ) >/dev/null 2>/dev/null case $? in 0) gl_cv_func_printf_enomem="yes" ;; 77) gl_cv_func_printf_enomem="guessing no" ;; *) gl_cv_func_printf_enomem="no" ;; esac else gl_cv_func_printf_enomem="guessing no" fi rm -fr conftest* else dnl A universal build on Apple Mac OS X platforms. dnl The result would be 'no' in 32-bit mode and 'yes' in 64-bit mode. dnl But we need a configuration result that is valid in both modes. gl_cv_func_printf_enomem="guessing no" fi fi if test "$gl_cv_func_printf_enomem" = "guessing no"; then changequote(,)dnl case "$host_os" in # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_printf_enomem="guessing yes";; # Guess yes on Solaris. solaris*) gl_cv_func_printf_enomem="guessing yes";; # Guess yes on AIX. aix*) gl_cv_func_printf_enomem="guessing yes";; # Guess yes on HP-UX/hppa. hpux*) case "$host_cpu" in hppa*) gl_cv_func_printf_enomem="guessing yes";; *) gl_cv_func_printf_enomem="guessing no";; esac ;; # Guess yes on BeOS. beos*) gl_cv_func_printf_enomem="guessing yes";; # Guess yes on Haiku. haiku*) gl_cv_func_printf_enomem="guessing yes";; # Guess no on Android. linux*-android*) gl_cv_func_printf_enomem="guessing no";; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_printf_enomem="$gl_cross_guess_normal";; esac changequote([,])dnl fi ]) ]) dnl Test whether the snprintf function exists. (ISO C99, POSIX:2001) dnl Result is ac_cv_func_snprintf. AC_DEFUN([gl_SNPRINTF_PRESENCE], [ AC_CHECK_FUNCS_ONCE([snprintf]) ]) dnl Test whether the string produced by the snprintf function is always NUL dnl terminated. (ISO C99, POSIX:2001) dnl Result is gl_cv_func_snprintf_truncation_c99. AC_DEFUN_ONCE([gl_SNPRINTF_TRUNCATION_C99], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_REQUIRE([gl_SNPRINTF_PRESENCE]) AC_CACHE_CHECK([whether snprintf truncates the result as in C99], [gl_cv_func_snprintf_truncation_c99], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #if HAVE_SNPRINTF # define my_snprintf snprintf #else # include static int my_snprintf (char *buf, int size, const char *format, ...) { va_list args; int ret; va_start (args, format); ret = vsnprintf (buf, size, format, args); va_end (args); return ret; } #endif static char buf[100]; int main () { strcpy (buf, "ABCDEF"); my_snprintf (buf, 3, "%d %d", 4567, 89); if (memcmp (buf, "45\0DEF", 6) != 0) return 1; return 0; }]])], [gl_cv_func_snprintf_truncation_c99=yes], [gl_cv_func_snprintf_truncation_c99=no], [ changequote(,)dnl case "$host_os" in # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on musl systems. *-musl* | midipix*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on FreeBSD >= 5. freebsd[1-4].*) gl_cv_func_snprintf_truncation_c99="guessing no";; freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; midnightbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on Mac OS X >= 10.3. darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";; darwin*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on OpenBSD >= 3.9. openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) gl_cv_func_snprintf_truncation_c99="guessing no";; openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on Solaris >= 2.6. solaris2.[0-5] | solaris2.[0-5].*) gl_cv_func_snprintf_truncation_c99="guessing no";; solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on AIX >= 4. aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";; aix*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on HP-UX >= 11. hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";; hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on NetBSD >= 3. netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) gl_cv_func_snprintf_truncation_c99="guessing no";; netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on BeOS. beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess yes on Android. linux*-android*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess no on native Windows. mingw* | windows*) gl_cv_func_snprintf_truncation_c99="guessing no";; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_snprintf_truncation_c99="$gl_cross_guess_normal";; esac changequote([,])dnl ]) ]) ]) dnl Test whether the return value of the snprintf function is the number dnl of bytes (excluding the terminating NUL) that would have been produced dnl if the buffer had been large enough. (ISO C99, POSIX:2001) dnl For example, this test program fails on HP-UX 11.31 and Solaris 9: dnl --------------------------------------------------------------------- dnl #include dnl int main() dnl { dnl static char buf[8]; dnl int retval = snprintf (buf, 3, "%d", 12345); dnl return retval >= 0 && retval < 3; dnl } dnl --------------------------------------------------------------------- dnl Result is gl_cv_func_snprintf_retval_c99. AC_DEFUN_ONCE([gl_SNPRINTF_RETVAL_C99], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_REQUIRE([gl_SNPRINTF_PRESENCE]) AC_CACHE_CHECK([whether snprintf returns a byte count as in C99], [gl_cv_func_snprintf_retval_c99], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #if HAVE_SNPRINTF # define my_snprintf snprintf #else # include static int my_snprintf (char *buf, int size, const char *format, ...) { va_list args; int ret; va_start (args, format); ret = vsnprintf (buf, size, format, args); va_end (args); return ret; } #endif static char buf[100]; int main () { strcpy (buf, "ABCDEF"); if (my_snprintf (buf, 3, "%d %d", 4567, 89) != 7) return 1; if (my_snprintf (buf, 0, "%d %d", 4567, 89) != 7) return 2; if (my_snprintf (NULL, 0, "%d %d", 4567, 89) != 7) return 3; return 0; }]])], [gl_cv_func_snprintf_retval_c99=yes], [gl_cv_func_snprintf_retval_c99=no], [case "$host_os" in changequote(,)dnl # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";; # Guess yes on musl systems. *-musl* | midipix*) gl_cv_func_snprintf_retval_c99="guessing yes";; # Guess yes on FreeBSD >= 5. freebsd[1-4].*) gl_cv_func_snprintf_retval_c99="guessing no";; freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; midnightbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; # Guess yes on Mac OS X >= 10.3. darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";; darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";; # Guess yes on OpenBSD >= 3.9. openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) gl_cv_func_snprintf_retval_c99="guessing no";; openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; # Guess yes on Solaris >= 2.10. solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; solaris*) gl_cv_func_printf_sizes_c99="guessing no";; # Guess yes on AIX >= 4. aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";; aix*) gl_cv_func_snprintf_retval_c99="guessing yes";; # Guess yes on NetBSD >= 3. netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) gl_cv_func_snprintf_retval_c99="guessing no";; netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; # Guess yes on BeOS. beos*) gl_cv_func_snprintf_retval_c99="guessing yes";; # Guess yes on Android. linux*-android*) gl_cv_func_snprintf_retval_c99="guessing yes";; changequote([,])dnl # Guess yes on MSVC, no on mingw. windows*-msvc*) gl_cv_func_snprintf_retval_c99="guessing yes" ;; mingw* | windows*) AC_EGREP_CPP([Known], [ #ifdef _MSC_VER Known #endif ], [gl_cv_func_snprintf_retval_c99="guessing yes"], [gl_cv_func_snprintf_retval_c99="guessing no"]) ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_snprintf_retval_c99="$gl_cross_guess_normal";; esac ]) ]) ]) dnl Test whether the snprintf function supports the %n format directive dnl also in truncated portions of the format string. (ISO C99, POSIX:2001) dnl Result is gl_cv_func_snprintf_directive_n. AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_REQUIRE([gl_SNPRINTF_PRESENCE]) AC_CACHE_CHECK([whether snprintf fully supports the 'n' directive], [gl_cv_func_snprintf_directive_n], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include #if defined _WIN32 && !defined __CYGWIN__ # include #else # include #endif #if HAVE_SNPRINTF # define my_snprintf snprintf #else # include static int my_snprintf (char *buf, int size, const char *format, ...) { va_list args; int ret; va_start (args, format); ret = vsnprintf (buf, size, format, args); va_end (args); return ret; } #endif static void abort_handler (int sig) { (void) sig; _exit (1); } static char fmtstring[10]; static char buf[100]; int main () { int count = -1; signal (SIGABRT, abort_handler); /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE >= 2) support %n in format strings in read-only memory but not in writable memory. */ strcpy (fmtstring, "%d %n"); my_snprintf (buf, 4, fmtstring, 12345, &count, 33, 44, 55); if (count != 6) return 1; return 0; }]])], [gl_cv_func_snprintf_directive_n=yes], [gl_cv_func_snprintf_directive_n=no], [ case "$host_os" in # Guess no on glibc when _FORTIFY_SOURCE >= 2. *-gnu* | gnu*) AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if _FORTIFY_SOURCE >= 2 error fail #endif ]])], [gl_cv_func_snprintf_directive_n="guessing yes"], [gl_cv_func_snprintf_directive_n="guessing no"]) ;; changequote(,)dnl # Guess yes on musl systems. *-musl* | midipix*) gl_cv_func_snprintf_directive_n="guessing yes";; # Guess yes on FreeBSD >= 5. freebsd[1-4].*) gl_cv_func_snprintf_directive_n="guessing no";; freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";; midnightbsd*) gl_cv_func_snprintf_directive_n="guessing yes";; # Guess yes on Mac OS X >= 10.3. darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";; darwin*) gl_cv_func_snprintf_directive_n="guessing yes";; # Guess yes on Solaris >= 2.6. solaris2.[0-5] | solaris2.[0-5].*) gl_cv_func_snprintf_directive_n="guessing no";; solaris*) gl_cv_func_snprintf_directive_n="guessing yes";; # Guess yes on AIX >= 4. aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";; aix*) gl_cv_func_snprintf_directive_n="guessing yes";; # Guess yes on NetBSD >= 3. netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) gl_cv_func_snprintf_directive_n="guessing no";; netbsd*) gl_cv_func_snprintf_directive_n="guessing yes";; # Guess yes on BeOS. beos*) gl_cv_func_snprintf_directive_n="guessing yes";; # Guess no on Android. linux*-android*) gl_cv_func_snprintf_directive_n="guessing no";; # Guess no on native Windows. mingw* | windows*) gl_cv_func_snprintf_directive_n="guessing no";; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_snprintf_directive_n="$gl_cross_guess_normal";; changequote([,])dnl esac ]) ]) ]) dnl Test whether the snprintf function, when passed a size = 1, writes any dnl output without bounds in this case, behaving like sprintf. This is the dnl case on Linux libc5. dnl Result is gl_cv_func_snprintf_size1. AC_DEFUN([gl_SNPRINTF_SIZE1], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_REQUIRE([gl_SNPRINTF_PRESENCE]) AC_CACHE_CHECK([whether snprintf respects a size of 1], [gl_cv_func_snprintf_size1], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #if HAVE_SNPRINTF # define my_snprintf snprintf #else # include static int my_snprintf (char *buf, int size, const char *format, ...) { va_list args; int ret; va_start (args, format); ret = vsnprintf (buf, size, format, args); va_end (args); return ret; } #endif int main() { static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; my_snprintf (buf, 1, "%d", 12345); return buf[1] != 'E'; }]])], [gl_cv_func_snprintf_size1=yes], [gl_cv_func_snprintf_size1=no], [case "$host_os" in # Guess yes on Android. linux*-android*) gl_cv_func_snprintf_size1="guessing yes" ;; # Guess yes on native Windows. mingw* | windows*) gl_cv_func_snprintf_size1="guessing yes" ;; *) gl_cv_func_snprintf_size1="guessing yes" ;; esac ]) ]) ]) dnl Test whether the vsnprintf function, when passed a zero size, produces no dnl output. (ISO C99, POSIX:2001) dnl For example, snprintf nevertheless writes a NUL byte in this case dnl on OSF/1 5.1: dnl --------------------------------------------------------------------- dnl #include dnl int main() dnl { dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; dnl snprintf (buf, 0, "%d", 12345); dnl return buf[0] != 'D'; dnl } dnl --------------------------------------------------------------------- dnl And vsnprintf writes any output without bounds in this case, behaving like dnl vsprintf, on HP-UX 11 and OSF/1 5.1: dnl --------------------------------------------------------------------- dnl #include dnl #include dnl static int my_snprintf (char *buf, int size, const char *format, ...) dnl { dnl va_list args; dnl int ret; dnl va_start (args, format); dnl ret = vsnprintf (buf, size, format, args); dnl va_end (args); dnl return ret; dnl } dnl int main() dnl { dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; dnl my_snprintf (buf, 0, "%d", 12345); dnl return buf[0] != 'D'; dnl } dnl --------------------------------------------------------------------- dnl Result is gl_cv_func_vsnprintf_zerosize_c99. AC_DEFUN([gl_VSNPRINTF_ZEROSIZE_C99], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether vsnprintf respects a zero size as in C99], [gl_cv_func_vsnprintf_zerosize_c99], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include static int my_snprintf (char *buf, int size, const char *format, ...) { va_list args; int ret; va_start (args, format); ret = vsnprintf (buf, size, format, args); va_end (args); return ret; } int main() { static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; my_snprintf (buf, 0, "%d", 12345); return buf[0] != 'D'; }]])], [gl_cv_func_vsnprintf_zerosize_c99=yes], [gl_cv_func_vsnprintf_zerosize_c99=no], [ changequote(,)dnl case "$host_os" in # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on musl systems. *-musl* | midipix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on FreeBSD >= 5. freebsd[1-4].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; midnightbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on Mac OS X >= 10.3. darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on Cygwin. cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on Solaris >= 2.6. solaris2.[0-5] | solaris2.[0-5].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on AIX >= 4. aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on NetBSD >= 3. netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on BeOS. beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on Android. linux*-android*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # Guess yes on native Windows. mingw* | windows* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_vsnprintf_zerosize_c99="$gl_cross_guess_normal";; esac changequote([,])dnl ]) ]) ]) dnl Test whether the swprintf function works correctly when it produces output dnl that contains null wide characters. dnl Result is gl_cv_func_swprintf_works. AC_DEFUN([gl_SWPRINTF_WORKS], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CHECK_FUNCS_ONCE([swprintf]) AC_CACHE_CHECK([whether swprintf works], [gl_cv_func_swprintf_works], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #ifndef __USE_MINGW_ANSI_STDIO # define __USE_MINGW_ANSI_STDIO 1 #endif #include #include int main() { int result = 0; { /* This test fails on musl libc 1.2.3, FreeBSD, NetBSD, OpenBSD, macOS, AIX. */ wchar_t buf[5] = { 0xBEEF, 0xBEEF, 0xBEEF, 0xBEEF, 0xBEEF }; int ret = swprintf (buf, 4, L"%cz", '\0'); /* Expected result: ret = 2, buf[0] = 0x0, buf[1] = 0x7a, buf[2] = 0x0, buf[3] = 0xbeef musl libc 1.2.3: ret = 2, buf[0] = 0x0, buf[1] = 0x0, buf[2] = 0x0, buf[3] = 0x0 Reported at . FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2, macOS 12.5, AIX 7.2: ret = 2, buf[0] = 0x0, buf[1] = 0xbeef, buf[2] = 0xbeef, buf[3] = 0xbeef */ if (ret < 0 || buf[1] != 'z') result |= 1; } { /* This test fails on mingw. */ wchar_t buf[2]; int ret = swprintf (buf, 2, L"%lc", (wint_t)0); /* Expected: ret = 1 mingw: ret = 0 */ if (ret != 1) result |= 2; } return result; }]])], [gl_cv_func_swprintf_works=yes], [gl_cv_func_swprintf_works=no], [case "$host_os" in # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_swprintf_works="guessing yes";; # Guess no on musl systems. *-musl* | midipix*) gl_cv_func_swprintf_works="guessing no";; # Guess no on FreeBSD, NetBSD, OpenBSD, macOS, AIX. freebsd* | midnightbsd* | netbsd* | openbsd* | darwin* | aix*) gl_cv_func_swprintf_works="guessing no";; # Guess no on native Windows. mingw* | windows* | pw*) gl_cv_func_swprintf_works="guessing no";; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_swprintf_works="$gl_cross_guess_normal";; esac ]) ]) ]) dnl Test whether the *wprintf family of functions supports the 'a' and 'A' dnl conversion specifier for hexadecimal output of 'long double' numbers. dnl (ISO C99, POSIX:2001) dnl Result is gl_cv_func_swprintf_directive_la. AC_DEFUN([gl_SWPRINTF_DIRECTIVE_LA], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether swprintf supports the 'La' and 'LA' directives], [gl_cv_func_swprintf_directive_la], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include static wchar_t buf[100]; int main () { int result = 0; /* This catches a glibc 2.15, Haiku 2022, NetBSD 10.0 bug. */ if (swprintf (buf, sizeof (buf) / sizeof (wchar_t), L"%La %d", 3.1416015625L, 33, 44, 55) < 0 || (wcscmp (buf, L"0x1.922p+1 33") != 0 && wcscmp (buf, L"0x3.244p+0 33") != 0 && wcscmp (buf, L"0x6.488p-1 33") != 0 && wcscmp (buf, L"0xc.91p-2 33") != 0)) result |= 1; return result; }]])], [gl_cv_func_swprintf_directive_la=yes], [gl_cv_func_swprintf_directive_la=no], [case "$host_os" in # Guess yes on glibc >= 2.17 systems. *-gnu* | gnu*) AC_EGREP_CPP([Unlucky], [ #include #ifdef __GNU_LIBRARY__ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16) || (__GLIBC__ > 2)) && !defined __UCLIBC__ Unlucky #endif #endif ], [gl_cv_func_swprintf_directive_la="guessing yes"], [gl_cv_func_swprintf_directive_la="guessing no"]) ;; # Guess yes on musl systems. *-musl* | midipix*) gl_cv_func_swprintf_directive_la="guessing yes";; # Guess yes on Android. linux*-android*) gl_cv_func_swprintf_directive_la="guessing yes";; # Guess no on NetBSD. netbsd*) gl_cv_func_swprintf_directive_la="guessing no";; # Guess no on native Windows. mingw* | windows*) gl_cv_func_swprintf_directive_la="guessing no";; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_swprintf_directive_la="$gl_cross_guess_normal";; esac ]) ]) ]) dnl Test whether the *wprintf family of functions supports the 'lc' conversion dnl specifier for all wide characters. dnl (ISO C11, POSIX:2001) dnl Result is gl_cv_func_swprintf_directive_lc. AC_DEFUN([gl_SWPRINTF_DIRECTIVE_LC], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether swprintf supports the 'lc' directive], [gl_cv_func_swprintf_directive_lc], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include static wchar_t buf[100]; static wint_t L_invalid = (wchar_t) 0x76543210; int main () { int result = 0; /* This catches a musl libc 1.2.4, Android bug. Reported at . */ if (swprintf (buf, sizeof (buf) / sizeof (wchar_t), L"%lc %d", L_invalid, 33, 44, 55) < 0) result |= 1; return result; }]])], [gl_cv_func_swprintf_directive_lc=yes], [gl_cv_func_swprintf_directive_lc=no], [case "$host_os" in # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_swprintf_directive_lc="guessing yes";; # Guess no on musl systems. *-musl* | midipix*) gl_cv_func_swprintf_directive_lc="guessing no";; # Guess no on Android. linux*-android*) gl_cv_func_swprintf_directive_lc="guessing no";; # Guess yes on native Windows. mingw* | windows*) gl_cv_func_swprintf_directive_lc="guessing yes";; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_swprintf_directive_lc="$gl_cross_guess_normal";; esac ]) ]) ]) dnl The results of these tests on various platforms are: dnl dnl 1 = gl_PRINTF_SIZES_C99 dnl 2 = gl_PRINTF_SIZES_C23 dnl 3 = gl_PRINTF_LONG_DOUBLE dnl 4 = gl_PRINTF_INFINITE dnl 5 = gl_PRINTF_INFINITE_LONG_DOUBLE dnl 6 = gl_PRINTF_DIRECTIVE_A dnl 7 = gl_PRINTF_DIRECTIVE_B dnl 8 = gl_PRINTF_DIRECTIVE_UPPERCASE_B dnl 9 = gl_PRINTF_DIRECTIVE_F dnl 10 = gl_PRINTF_DIRECTIVE_N dnl 11 = gl_PRINTF_DIRECTIVE_LS dnl 12 = gl_PRINTF_DIRECTIVE_LC dnl 13 = gl_PRINTF_POSITIONS dnl 14 = gl_PRINTF_FLAG_GROUPING dnl 15 = gl_PRINTF_FLAG_GROUPING_INT_PRECISION dnl 16 = gl_PRINTF_FLAG_GROUPING_MULTIBYTE dnl 17 = gl_PRINTF_FLAG_LEFTADJUST dnl 18 = gl_PRINTF_FLAG_ZERO dnl 19 = gl_PRINTF_FLAG_ALT_PRECISION_ZERO dnl 20 = gl_PRINTF_PRECISION dnl 21 = gl_PRINTF_ENOMEM dnl 22 = gl_SNPRINTF_PRESENCE dnl 23 = gl_SNPRINTF_TRUNCATION_C99 dnl 24 = gl_SNPRINTF_RETVAL_C99 dnl 25 = gl_SNPRINTF_DIRECTIVE_N dnl 26 = gl_SNPRINTF_SIZE1 dnl 27 = gl_VSNPRINTF_ZEROSIZE_C99 dnl 28 = gl_SWPRINTF_WORKS dnl 29 = gl_SWPRINTF_DIRECTIVE_LA dnl 30 = gl_SWPRINTF_DIRECTIVE_LC dnl dnl 1 = checking whether printf supports size specifiers as in C99... dnl 2 = checking whether printf supports size specifiers as in C23... dnl 3 = checking whether printf supports 'long double' arguments... dnl 4 = checking whether printf supports infinite 'double' arguments... dnl 5 = checking whether printf supports infinite 'long double' arguments... dnl 6 = checking whether printf supports the 'a' and 'A' directives... dnl 7 = checking whether printf supports the 'b' directive... dnl 8 = checking whether printf supports the 'B' directive... dnl 9 = checking whether printf supports the 'F' directive... dnl 10 = checking whether printf supports the 'n' directive... dnl 11 = checking whether printf supports the 'ls' directive... dnl 12 = checking whether printf supports the 'lc' directive correctly... dnl 13 = checking whether printf supports POSIX/XSI format strings with positions... dnl 14 = checking whether printf supports the grouping flag... dnl 15 = checking whether printf supports grouping on integers with a precision... dnl 16 = checking whether printf supports grouping with a multibyte separator... dnl 17 = checking whether printf supports the left-adjust flag correctly... dnl 18 = checking whether printf supports the zero flag correctly... dnl 19 = checking whether printf supports the alternative flag with a zero precision... dnl 20 = checking whether printf supports large precisions... dnl 21 = checking whether printf survives out-of-memory conditions... dnl 22 = checking for snprintf... dnl 23 = checking whether snprintf truncates the result as in C99... dnl 24 = checking whether snprintf returns a byte count as in C99... dnl 25 = checking whether snprintf fully supports the 'n' directive... dnl 26 = checking whether snprintf respects a size of 1... dnl 27 = checking whether vsnprintf respects a zero size as in C99... dnl 28 = checking whether swprintf works... dnl 29 = checking whether swprintf supports the 'La' and 'LA' directives... dnl 30 = checking whether swprintf supports the 'lc' directive... dnl dnl . = yes, # = no. dnl dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 dnl musl libc 1.2.3 . # . . . . # # . . . # . . . . . . . . . . . . . . . # . # dnl glibc 2.35 . # . . . . . . . . . . . . # . . . . . . . . . . . . . . . dnl glibc 2.5 . # . . . . # # . . . . . . # . . . . . . . . . . . . . # . dnl glibc 2.3.6 . # . . . # # # . . . . . . . . . . . . . . . . . . . . # . dnl FreeBSD 14.0 . . . . . # . . . . . . . . # . . . . . # . . . . . . # . # dnl FreeBSD 13.0 . # . . . # # # . . . . . . # . . . . . # . . . . . . # . # dnl FreeBSD 5.4, 6.1 . # . . . # # # . . . . . . . . . # ? . # . . . . . . # ? ? dnl Mac OS X 10.13.5 . # . . # # # # . # . . . . ? ? . . . . . . . . # . . # ? ? dnl Mac OS X 10.5.8 . # . . # # # # . . . . . . ? ? . # # . . . . . . . . # ? ? dnl Mac OS X 10.3.9 . # . . . # # # . . . . . . ? ? . # # . # . . . . . . # ? ? dnl OpenBSD 6.0, 6.7 . # . . . # # # . . . . . . . . . . . . # . . . . . . # . # dnl OpenBSD 3.9, 4.0 . # . # # # # # # . # . . # ? ? . # ? . # . . . . . . # ? ? dnl Cygwin 1.7.0 (2009) . # . . # . # # . . ? ? . . ? ? . . ? . ? . . . . . . ? ? ? dnl Cygwin 1.5.25 (2008) . # . . # # # # . . # ? . . ? ? . . ? . # . . . . . . ? ? ? dnl Cygwin 1.5.19 (2006) # # . . # # # # # . # ? . # ? ? . # ? # # . . . . . . ? ? ? dnl Solaris 11.4 . # . # # # # # . . # . . . # # . # . . . . . . . . . . # . dnl Solaris 11.3 . # . . . # # # . . # . . . ? ? . . . . . . . . . . . . # . dnl Solaris 11.0 . # . # # # # # . . # . . . ? ? . # . . . . . . . . . ? ? ? dnl Solaris 10 . # . # # # # # . . # . . . # # . # . # . . . . . . . . # . dnl Solaris 2.6 ... 9 # # . # # # # # # . # . . . ? ? . # ? # . . . # . . . ? ? ? dnl Solaris 2.5.1 # # . # # # # # # . # . . . ? ? . # ? . . # # # # # # ? ? ? dnl AIX 7.1 . # . # # # # # . . . . . . . . . # . # . . . . . . . # . . dnl AIX 5.2 . # . # # # # # . . . . . . ? ? . # ? . . . . . . . . # ? ? dnl AIX 4.3.2, 5.1 # # . # # # # # # . . . . . ? ? . # ? . . . . # . . . # ? ? dnl HP-UX 11.31 . # . . . # # # . . . ? . . ? ? . # ? . . . . # # . . ? ? ? dnl HP-UX 11.{00,11,23} # # . . . # # # # . . ? . . ? ? . # ? . . . . # # . # ? ? ? dnl HP-UX 10.20 # # . # . # # # # . ? ? . . ? ? # # ? . . . . # # ? # ? ? ? dnl IRIX 6.5 # # . # # # # # # . # . . . ? ? . # ? . . . . # . . . # ? ? dnl OSF/1 5.1 # # . # # # # # # . . ? . . ? ? . # ? . . . . # . . # ? ? ? dnl OSF/1 4.0d # # . # # # # # # . . ? . . ? ? . # ? . . # # # # # # ? ? ? dnl NetBSD 9.0 . # . . . # # # . . . . . . # # . . . . . . . . . . . # . # dnl NetBSD 5.0 . # . . # # # # . . . . . . ? ? . # ? . # . . . . . . # ? ? dnl NetBSD 4.0 . # ? ? ? ? # # ? . ? . . ? ? ? ? ? ? ? ? . . . ? ? ? # ? ? dnl NetBSD 3.0 . # . . . # # # # . ? . # # ? ? ? # ? . # . . . . . . # ? ? dnl Haiku . # . . # # # # # . # ? . . # . . . ? . ? . . ? . . . . # . dnl BeOS # # # . # # # # # . ? ? # . ? ? ? . ? # ? . . ? . . . ? ? ? dnl Android 4.3 . # . # # # # # # # # ? . # ? ? . # ? . # . . . # . . ? ? ? dnl old mingw / msvcrt # # # # # # # # # . . ? # # ? ? . # ? # ? . # # # . . # ? ? dnl MSVC 9 # # # # # # # # # # . ? # # ? ? . # ? # ? # # # # . . # ? ? dnl mingw 2009-2011 . # # . # . # # . . . ? # # ? ? . . ? . ? . . . . . . # ? ? dnl mingw-w64 2011 # # # # # # # # # . . ? # # ? ? . # ? # ? . # # # . . # ? ? groff-1.24.1/gnulib_m4/pathmax.m40000644000175000017500000000224515153275164013423 00000000000000# pathmax.m4 # serial 11 dnl Copyright (C) 2002-2003, 2005-2006, 2009-2026 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_PATHMAX], [ dnl Prerequisites of lib/pathmax.h. AC_CHECK_HEADERS_ONCE([sys/param.h]) ]) # Expands to a piece of C program that defines PATH_MAX in the same way as # "pathmax.h" will do. AC_DEFUN([gl_PATHMAX_SNIPPET], [[ /* Arrange to define PATH_MAX, like "pathmax.h" does. */ #if HAVE_UNISTD_H # include #endif #include #if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN # include #endif #if !defined PATH_MAX && defined MAXPATHLEN # define PATH_MAX MAXPATHLEN #endif #ifdef __hpux # undef PATH_MAX # define PATH_MAX 1024 #endif #if defined _WIN32 && ! defined __CYGWIN__ # undef PATH_MAX # define PATH_MAX 260 #endif ]]) # Prerequisites of gl_PATHMAX_SNIPPET. AC_DEFUN([gl_PATHMAX_SNIPPET_PREREQ], [ AC_CHECK_HEADERS_ONCE([unistd.h sys/param.h]) ]) groff-1.24.1/gnulib_m4/wcwidth.m40000644000175000017500000000670715153275164013441 00000000000000# wcwidth.m4 # serial 39 dnl Copyright (C) 2006-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_WCWIDTH], [ AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Persuade glibc to declare wcwidth(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gt_TYPE_WINT_T]) AC_CHECK_HEADERS_ONCE([wchar.h]) AC_CHECK_FUNCS_ONCE([wcwidth]) AC_CHECK_DECLS([wcwidth], [], [], [[ #include ]]) if test $ac_cv_have_decl_wcwidth != yes; then HAVE_DECL_WCWIDTH=0 fi if test $ac_cv_func_wcwidth != yes; then AC_CACHE_CHECK([whether wcwidth is a macro], [gl_cv_func_wcwidth_macro], [AC_EGREP_CPP([wchar_header_defines_wcwidth], [ #include #ifdef wcwidth wchar_header_defines_wcwidth #endif], [gl_cv_func_wcwidth_macro=yes], [gl_cv_func_wcwidth_macro=no]) ]) fi if test $ac_cv_func_wcwidth = yes || test $gl_cv_func_wcwidth_macro = yes; then HAVE_WCWIDTH=1 dnl On Mac OS X 10.3, wcwidth(0x0301) (COMBINING ACUTE ACCENT) returns 1. dnl On macOS 12.5, NetBSD 9.3, OpenBSD 5.0, MidnightBSD 1.1, dnl wcwidth(0x05B0) (HEBREW POINT SHEVA) returns 1. dnl On macOS 12.5, NetBSD 9.3, MidnightBSD 1.1, dnl wcwidth(0x200B) (ZERO WIDTH SPACE) returns 1. dnl On OpenBSD 5.8, wcwidth(0xFF1A) (FULLWIDTH COLON) returns 0. dnl This leads to bugs in 'ls' (coreutils). dnl On Solaris 11.4, wcwidth(0x2202) (PARTIAL DIFFERENTIAL) returns 2, dnl even in Western locales. AC_CACHE_CHECK([whether wcwidth works reasonably in UTF-8 locales], [gl_cv_func_wcwidth_works], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #if !HAVE_DECL_WCWIDTH extern # ifdef __cplusplus "C" # endif int wcwidth (int); #endif int main () { int result = 0; if (setlocale (LC_ALL, "en_US.UTF-8") != NULL) { if (wcwidth (0x0301) > 0) result |= 1; if (wcwidth (0x05B0) > 0) result |= 2; if (wcwidth (0x200B) > 0) result |= 4; if (wcwidth (0xFF1A) == 0) result |= 8; if (wcwidth (0x2202) > 1) result |= 16; } return result; }]])], [gl_cv_func_wcwidth_works=yes], [gl_cv_func_wcwidth_works=no], [ changequote(,)dnl case "$host_os" in # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_wcwidth_works="guessing yes";; # Guess yes on musl systems. *-musl* | midipix*) gl_cv_func_wcwidth_works="guessing yes";; # Guess yes on AIX 7 systems. aix[7-9]*) gl_cv_func_wcwidth_works="guessing yes";; *) gl_cv_func_wcwidth_works="$gl_cross_guess_normal";; esac changequote([,])dnl ]) ]) case "$gl_cv_func_wcwidth_works" in *yes) ;; *no) REPLACE_WCWIDTH=1 ;; esac else HAVE_WCWIDTH=0 fi dnl We don't substitute HAVE_WCWIDTH. We assume that if the system does not dnl have the wcwidth function, then it does not declare it. ]) # Prerequisites of lib/wcwidth.c. AC_DEFUN([gl_PREREQ_WCWIDTH], [ AC_REQUIRE([AC_C_INLINE]) : ]) groff-1.24.1/gnulib_m4/extern-inline.m40000644000175000017500000001336715153275164014551 00000000000000# extern-inline.m4 # serial 2 dnl Copyright 2012-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl 'extern inline' a la ISO C99. AC_DEFUN([gl_EXTERN_INLINE], [ AC_CACHE_CHECK([whether ctype.h defines __header_inline], [gl_cv_have___header_inline], [AC_PREPROC_IFELSE( [AC_LANG_SOURCE([[#include #ifndef __header_inline #error " does not define __header_inline" #endif ]])], [gl_cv_have___header_inline=yes], [gl_cv_have___header_inline=no])]) if test "$gl_cv_have___header_inline" = yes; then AC_DEFINE([HAVE___HEADER_INLINE], [1], [Define to 1 if ctype.h defines __header_inline.]) fi AH_VERBATIM([HAVE___HEADER_INLINE_1], [/* Please see the Gnulib manual for how to use these macros. Suppress extern inline with HP-UX cc, as it appears to be broken; see . Suppress extern inline with Sun C in standards-conformance mode, as it mishandles inline functions that call each other. E.g., for 'inline void f (void) { } inline void g (void) { f (); }', c99 incorrectly complains 'reference to static identifier "f" in extern inline function'. This bug was observed with Oracle Developer Studio 12.6 (Sun C 5.15 SunOS_sparc 2017/05/30). Suppress extern inline (with or without __attribute__ ((__gnu_inline__))) on configurations that mistakenly use 'static inline' to implement functions or macros in standard C headers like . For example, if isdigit is mistakenly implemented via a static inline function, a program containing an extern inline function that calls isdigit may not work since C99 through C23 prohibit extern inline functions from calling static functions (ISO C 23 § 6.7.5 ¶ 3)). Although a future C standard will likely relax this restriction , respect it for now. This bug is known to occur on: OS X 10.8 and earlier; see: https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html DragonFly; see http://muscles.dragonflybsd.org/bulk/clang-master-potential/20141111_102002/logs/ah-tty-0.3.12.log FreeBSD; see: https://lists.gnu.org/r/bug-gnulib/2014-07/msg00104.html OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and for clang but remains for g++; see . Assume DragonFly and FreeBSD will be similar. GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 inline semantics, unless -fgnu89-inline is used. It defines a macro __GNUC_STDC_INLINE__ to indicate this situation or a macro __GNUC_GNU_INLINE__ to indicate the opposite situation. GCC 4.2 with -std=c99 or -std=gnu99 implements the GNU C inline semantics but warns, unless -fgnu89-inline is used: warning: C99 inline functions are not supported; using GNU89 warning: to disable this warning use -fgnu89-inline or the gnu_inline function attribute It defines a macro __GNUC_GNU_INLINE__ to indicate this situation. */ #if (((defined __APPLE__ && defined __MACH__) \ || defined __DragonFly__ || defined __FreeBSD__) \ && (defined HAVE___HEADER_INLINE \ ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \ && ! defined __clang__) \ : ((! defined _DONT_USE_CTYPE_INLINE_ \ && (defined __GNUC__ || defined __cplusplus)) \ || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \ && defined __GNUC__ && ! defined __cplusplus)))) # define _GL_EXTERN_INLINE_STDHEADER_BUG #endif #if ((__GNUC__ \ ? (defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ && !defined __PCC__) \ : (199901L <= __STDC_VERSION__ \ && !defined __HP_cc \ && !defined __PGI \ && !(defined __SUNPRO_C && __STDC__))) \ && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) # define _GL_INLINE inline # define _GL_EXTERN_INLINE extern inline # define _GL_EXTERN_INLINE_IN_USE #elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \ && !defined __PCC__ \ && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) # if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__ /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ # define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) # else # define _GL_INLINE extern inline # endif # define _GL_EXTERN_INLINE extern # define _GL_EXTERN_INLINE_IN_USE #else # define _GL_INLINE _GL_UNUSED static # define _GL_EXTERN_INLINE _GL_UNUSED static #endif /* In GCC 4.6 (inclusive) to 5.1 (exclusive), suppress bogus "no previous prototype for 'FOO'" and "no previous declaration for 'FOO'" diagnostics, when FOO is an inline function in the header; see and . */ #if __GNUC__ == 4 && 6 <= __GNUC_MINOR__ # if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ # define _GL_INLINE_HEADER_CONST_PRAGMA # else # define _GL_INLINE_HEADER_CONST_PRAGMA \ _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") # endif # define _GL_INLINE_HEADER_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \ _GL_INLINE_HEADER_CONST_PRAGMA # define _GL_INLINE_HEADER_END \ _Pragma ("GCC diagnostic pop") #else # define _GL_INLINE_HEADER_BEGIN # define _GL_INLINE_HEADER_END #endif]) ]) groff-1.24.1/gnulib_m4/stat.m40000644000175000017500000000610515153275164012733 00000000000000# stat.m4 # serial 21 dnl Copyright (C) 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_STAT], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) AC_CHECK_FUNCS_ONCE([lstat]) case "$host_os" in mingw* | windows*) dnl On this platform, the original stat() returns st_atime, st_mtime, dnl st_ctime values that are affected by the time zone. REPLACE_STAT=1 ;; *) dnl AIX 7.1, Solaris 9, mingw64 mistakenly succeed on stat("file/"). dnl (For mingw, this is due to a broken stat() override in libmingwex.a.) dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/"). AC_CACHE_CHECK([whether stat handles trailing slashes on files], [gl_cv_func_stat_file_slash], [touch conftest.tmp # Assume that if we have lstat, we can also check symlinks. if test $ac_cv_func_lstat = yes; then ln -s conftest.tmp conftest.lnk fi AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[int result = 0; struct stat st; if (!stat ("conftest.tmp/", &st)) result |= 1; #if HAVE_LSTAT if (!stat ("conftest.lnk/", &st)) result |= 2; #endif return result; ]])], [gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no], [case "$host_os" in # Guess yes on Linux systems. linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;; # Guess yes on systems that emulate the Linux system calls. midipix*) gl_cv_func_stat_file_slash="guessing yes" ;; # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_stat_file_slash="$gl_cross_guess_normal" ;; esac ]) rm -f conftest.tmp conftest.lnk]) case $gl_cv_func_stat_file_slash in *no) REPLACE_STAT=1 AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs help when passed a file name with a trailing slash]);; esac case $host_os in dnl macOS and Solaris stat can return a negative tv_nsec. darwin* | solaris*) REPLACE_FSTAT=1 ;; esac ;; esac ]) # Prerequisites of lib/stat.c and lib/stat-w32.c. AC_DEFUN([gl_PREREQ_STAT], [ AC_REQUIRE([gl_SYS_STAT_H]) AC_REQUIRE([gl_PREREQ_STAT_W32]) : ]) # Prerequisites of lib/stat-w32.c. AC_DEFUN([gl_PREREQ_STAT_W32], [ AC_REQUIRE([AC_CANONICAL_HOST]) case "$host_os" in mingw* | windows*) AC_CHECK_HEADERS([sdkddkver.h]) ;; esac ]) groff-1.24.1/gnulib_m4/mathfunc.m40000644000175000017500000001707015153275164013570 00000000000000# mathfunc.m4 # serial 18 dnl Copyright (C) 2010-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. # gl_MATHFUNC(FUNC, RETTYPE, PARAMTYPES [, INCLUDES] [, EXTRA-CODE]) # ------------------------------------------------------------------ # tests whether the function FUNC is available in libc or libm. # RETTYPE is the return type. PARAMTYPES is a parameter list, with parentheses. # It sets FUNC_LIBM to empty or "-lm" accordingly. AC_DEFUN([gl_MATHFUNC], [ dnl We need the RETTYPE and PARAMTYPES in order to force linking with the dnl function. dnl 1) With gcc >= 4.3 on glibc/x86_64, calls to the 'fabs' function dnl are inlined by the compiler, therefore linking of these calls does dnl not require -lm, but taking the function pointer of 'fabs' does. dnl 2) On MSVC 9, many math functions exist only as macros with arguments, dnl whereas the function pointer is undefined. dnl On the other hand, taking just the function pointer is not enough. dnl 1) On AIX 7.1, when 'long double' is 128 bit large ("xlc -qldbl128" or dnl "xlc -qlongdouble" or "gcc -mlong-double-128") many math functions dnl exist as macros with arguments, that may reference libm or even dnl completely undefined functions such as __rint128. dnl 2) In AIX 7.1 with gcc 4.2, when optimization is turned on, calls to dnl rint() with simple arguments are turned into rintf() calls by the dnl compiler. But while rint() is resides in libc, rintf() is in libm. m4_pushdef([func], [$1]) m4_pushdef([FUNC], [m4_translit([$1],[abcdefghijklmnopqrstuvwxyz], [ABCDEFGHIJKLMNOPQRSTUVWXYZ])]) m4_pushdef([ARGS], [m4_bpatsubst( [m4_bpatsubst( [m4_bpatsubst( [m4_bpatsubst( [m4_bpatsubst( [m4_bpatsubst( [m4_bpatsubst( [m4_bpatsubst( [m4_bpatsubst( [m4_bpatsubst( [m4_bpatsubst( [m4_bpatsubst( [m4_bpatsubst( [$3], [fenv_t\( const\)? \*], [&fenv_ret])], [fexcept_t\( const\)? \*], [&fx_ret])], [int\( const\)? \*], [&i_ret])], [float\( const\)? \*], [&f_ret])], [double\( const\)? \*], [&d_ret])], [long double\( const\)? \*], [&l_ret])], [fp_rnd], [1])], [fp_except_t], [1])], [int], [2])], [float], [1.618034f])], [long double], [1.618033988749894848L])], [double], [1.6180339887])], [void], [])]) FUNC[]_LIBM= AC_CACHE_CHECK([whether func() can be used without linking with libm], [gl_cv_func_]func[_no_libm], [ AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#ifndef __NO_MATH_INLINES # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include $4 $2 (* volatile funcptr) $3 = ]func[; int i_ret; float f_ret; double d_ret; long double l_ret;]], [[$2 y = funcptr ]ARGS[ + ]func[ ]ARGS[; $5 return y < 0.3 || y > 1.7; ]])], [gl_cv_func_]func[_no_libm=yes], [gl_cv_func_]func[_no_libm=no]) ]) if test $gl_cv_func_[]func[]_no_libm = no; then AC_CACHE_CHECK([whether func() can be used with libm], [gl_cv_func_]func[_in_libm], [ saved_LIBS="$LIBS" LIBS="$LIBS -lm" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#ifndef __NO_MATH_INLINES # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include $4 $2 (* volatile funcptr) $3 = ]func[; int i_ret; float f_ret; double d_ret; long double l_ret;]], [[$2 y = funcptr ]ARGS[ + ]func[ ]ARGS[; $5 return y < 0.3 || y > 1.7; ]])], [gl_cv_func_]func[_in_libm=yes], [gl_cv_func_]func[_in_libm=no]) LIBS="$saved_LIBS" ]) if test $gl_cv_func_[]func[]_in_libm = yes; then FUNC[]_LIBM=-lm fi fi AC_SUBST(FUNC[_LIBM]) m4_popdef([ARGS]) m4_popdef([FUNC]) m4_popdef([func]) ]) # gl_COMMON_DOUBLE_MATHFUNC(FUNC) # ------------------------------- # tests whether the function FUNC is available in libc or libm. # It sets FUNC_LIBM to empty or "-lm" accordingly. # FUNC must be one of the following functions, that are present on all systems # and provided by libm on all systems except Mac OS X, BeOS, Haiku: # acos asin atan atan2 cbrt cos cosh erf erfc exp fmod hypot j0 j1 jn lgamma # log log10 log1p pow remainder sin sinh sqrt tan tanh y0 y1 yn AC_DEFUN([gl_COMMON_DOUBLE_MATHFUNC], [ AC_REQUIRE([gl_COMMON_DOUBLE_MATHFUNC_TEST]) m4_pushdef([FUNC], [m4_translit([$1],[abcdefghijklmnopqrstuvwxyz], [ABCDEFGHIJKLMNOPQRSTUVWXYZ])]) FUNC[]_LIBM="$POW_LIBM" AC_SUBST(FUNC[_LIBM]) m4_popdef([FUNC]) ]) AC_DEFUN([gl_COMMON_DOUBLE_MATHFUNC_TEST], [ dnl We could use any of the following: dnl gl_MATHFUNC([acos], [double], [(double)]) dnl gl_MATHFUNC([asin], [double], [(double)]) dnl gl_MATHFUNC([atan], [double], [(double)]) dnl gl_MATHFUNC([atan2], [double], [(double, double)]) dnl gl_MATHFUNC([cbrt], [double], [(double)]) dnl gl_MATHFUNC([cos], [double], [(double)]) dnl gl_MATHFUNC([cosh], [double], [(double)]) dnl gl_MATHFUNC([erf], [double], [(double)]) dnl gl_MATHFUNC([erfc], [double], [(double)]) dnl gl_MATHFUNC([exp], [double], [(double)]) dnl gl_MATHFUNC([fmod], [double], [(double, double)]) dnl gl_MATHFUNC([hypot], [double], [(double, double)]) dnl gl_MATHFUNC([j0], [double], [(double)]) dnl gl_MATHFUNC([j1], [double], [(double)]) dnl gl_MATHFUNC([jn], [double], [(int, double)]) dnl gl_MATHFUNC([lgamma], [double], [(double)]) dnl gl_MATHFUNC([log], [double], [(double)]) dnl gl_MATHFUNC([log10], [double], [(double)]) dnl gl_MATHFUNC([log1p], [double], [(double)]) dnl gl_MATHFUNC([pow], [double], [(double, double)]) dnl gl_MATHFUNC([remainder], [double], [(double, double)]) dnl gl_MATHFUNC([sin], [double], [(double)]) dnl gl_MATHFUNC([sinh], [double], [(double)]) dnl gl_MATHFUNC([sqrt], [double], [(double)]) dnl gl_MATHFUNC([tan], [double], [(double)]) dnl gl_MATHFUNC([tanh], [double], [(double)]) dnl gl_MATHFUNC([y0], [double], [(double)]) dnl gl_MATHFUNC([y1], [double], [(double)]) dnl gl_MATHFUNC([yn], [double], [(int, double)]) gl_MATHFUNC([pow], [double], [(double, double)]) ]) groff-1.24.1/gnulib_m4/iswpunct.m40000644000175000017500000000272015153275164013633 00000000000000# iswpunct.m4 # serial 2 dnl Copyright (C) 2023-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_ISWPUNCT], [ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) AC_REQUIRE([gl_WCTYPE_H]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then dnl redefines iswpunct already. REPLACE_ISWPUNCT="$REPLACE_ISWCNTRL" else AC_CACHE_CHECK([whether iswpunct is consistent with ispunct], [gl_cv_func_iswpunct_works], [AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include int main (int argc, char *argv[]) { int result = 0; /* This fails on Android 11. */ if ((! iswpunct ('\`')) != (! ispunct ('\`'))) result |= 1; return result; }]])], [gl_cv_func_iswpunct_works=yes], [gl_cv_func_iswpunct_works=no], [case "$host_os" in # Guess no on Android. android*) gl_cv_func_iswpunct_works="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_iswpunct_works="guessing yes" ;; esac ]) ]) case "$gl_cv_func_iswpunct_works" in *yes) ;; *) REPLACE_ISWPUNCT=1 ;; esac fi ]) groff-1.24.1/gnulib_m4/pid_t.m40000644000175000017500000000270015153275164013054 00000000000000# pid_t.m4 # serial 4 dnl Copyright (C) 2020-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. # The following implementation works around a problem in autoconf <= 2.69. m4_version_prereq([2.70], [], [ dnl Define pid_t if the headers don't define it. AC_DEFUN([AC_TYPE_PID_T], [ AC_CHECK_TYPE([pid_t], [], [dnl On 64-bit native Windows, define it to the equivalent of 'intptr_t' dnl (= 'long long' = '__int64'), because that is the return type dnl of the _spawnv* functions dnl dnl and the argument type of the _cwait function dnl . dnl Otherwise (on 32-bit Windows and on old Unix platforms), define it dnl to 'int'. AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[ #if defined _WIN64 && !defined __CYGWIN__ LLP64 #endif ]]) ], [gl_pid_type='int'], [gl_pid_type='__int64']) AC_DEFINE_UNQUOTED([pid_t], [$gl_pid_type], [Define as a signed integer type capable of holding a process identifier.]) ], [AC_INCLUDES_DEFAULT]) ]) ])# m4_version_prereq 2.70 groff-1.24.1/gnulib_m4/sys_cdefs_h.m40000644000175000017500000000163615153275164014255 00000000000000# sys_cdefs_h.m4 - Is compatible enough with glibc? # serial 2 dnl Copyright 2024-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl Written by Paul Eggert. AC_DEFUN_ONCE([gl_CHECK_HEADER_SYS_CDEFS_H], [AC_CACHE_CHECK([for glibc-compatible sys/cdefs.h], [gl_cv_header_sys_cdefs_h], [AC_COMPILE_IFELSE( [AC_LANG_DEFINES_PROVIDED [#include enum { foo = __GNUC_PREREQ (14, 1) } bar; ]], [gl_cv_header_sys_cdefs_h=yes], [gl_cv_header_sys_cdefs_h=no])]) if test "$gl_cv_header_sys_cdefs_h" = yes; then HAVE_SYS_CDEFS_H=1 else HAVE_SYS_CDEFS_H=0 fi AC_SUBST([HAVE_SYS_CDEFS_H])]) groff-1.24.1/gnulib_m4/pthread-once.m40000644000175000017500000000603215153275164014330 00000000000000# pthread-once.m4 # serial 6 dnl Copyright (C) 2019-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_PTHREAD_ONCE], [ AC_REQUIRE([gl_PTHREAD_H]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_PTHREADLIB]) if { case "$host_os" in mingw* | windows*) true;; *) false;; esac; } \ && test $gl_threads_api = windows; then dnl Choose function names that don't conflict with the mingw-w64 winpthreads dnl library. REPLACE_PTHREAD_ONCE=1 PTHREAD_ONCE_LIB= else if test $HAVE_PTHREAD_H = 0; then HAVE_PTHREAD_ONCE=0 PTHREAD_ONCE_LIB= else dnl Work around Cygwin 3.5.3 bug. AC_CACHE_CHECK([whether pthread_once works], [gl_cv_func_pthread_once_works], [case "$host_os" in cygwin*) gl_cv_func_pthread_once_works="guessing no" ;; *) gl_cv_func_pthread_once_works="yes" ;; esac ]) case "$gl_cv_func_pthread_once_works" in *yes) ;; *) REPLACE_PTHREAD_ONCE=1 ;; esac dnl Determine whether linking requires $(LIBPMULTITHREAD) or only dnl $(LIBPTHREAD). if test -z "$LIBPTHREAD" && test -n "$LIBPMULTITHREAD"; then AC_CACHE_CHECK([whether pthread_once can be used without linking with libpthread], [gl_cv_func_pthread_once_no_lib], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include static pthread_once_t a_once = PTHREAD_ONCE_INIT; static int a; static void a_init (void) { a = 8647; } ]], [[if (pthread_once (&a_once, a_init)) return 1; if (a != 8647) return 2; return 0; ]])], [gl_cv_func_pthread_once_no_lib=yes], [gl_cv_func_pthread_once_no_lib=no], [case "$host_os" in # Guess no on glibc. *-gnu* | gnu*) gl_cv_func_pthread_once_no_lib="guessing no" ;; # Guess no on FreeBSD. freebsd* | dragonfly* | midnightbsd*) gl_cv_func_pthread_once_no_lib="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_pthread_once_no_lib="guessing yes" ;; esac ]) ]) case "$gl_cv_func_pthread_once_no_lib" in *yes) PTHREAD_ONCE_LIB="$LIBPTHREAD" ;; *) PTHREAD_ONCE_LIB="$LIBPMULTITHREAD" ;; esac dnl Expected result: dnl PTHREAD_ONCE_LIB is $(LIBPMULTITHREAD) on glibc < 2.34, FreeBSD. dnl PTHREAD_ONCE_LIB is $(LIBPTHREAD) in particular on dnl musl libc, macOS, NetBSD, Solaris, Cygwin, Haiku, Android. else PTHREAD_ONCE_LIB="$LIBPTHREAD" fi fi fi AC_SUBST([PTHREAD_ONCE_LIB]) ]) groff-1.24.1/gnulib_m4/tls.m40000644000175000017500000000065215153275164012563 00000000000000# tls.m4 # serial 2 (gettext-0.18) dnl Copyright (C) 2005, 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Bruno Haible. AC_DEFUN([gl_TLS], [ AC_REQUIRE([gl_THREADLIB]) ]) groff-1.24.1/gnulib_m4/gnulib-cache.m40000644000175000017500000000473615153275164014311 00000000000000# Copyright (C) 2002-2026 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This file is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this file. If not, see . # # As a special exception to the GNU General Public License, # this file may be distributed as part of a program that # contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. # # This file represents the specification of how gnulib-tool is used. # It acts as a cache: It is written and read by gnulib-tool. # In projects that use version control, this file is meant to be put under # version control, like the configure.ac and various Makefile.am files. # Specification in the form of a command-line invocation: # gnulib-tool --import \ # --local-dir=gl \ # --lib=libgnu \ # --source-base=lib \ # --m4-base=gnulib_m4 \ # --doc-base=doc \ # --tests-base=tests \ # --aux-dir=build-aux \ # --makefile-name=gnulib.mk \ # --automake-subdir \ # --no-conditional-dependencies \ # --no-libtool \ # --macro-prefix=gl \ # attribute \ # fmod \ # fprintf-posix \ # getopt-gnu \ # git-version-gen \ # havelib \ # hypot \ # memmem \ # putenv \ # snprintf \ # stat \ # stdbool-h-c99 \ # stdckdint-h \ # stdcountof-h \ # stdint-h \ # strcase \ # strerror \ # strsignal \ # sys_wait-h \ # unlink \ # vsnprintf \ # wcwidth # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([gl]) gl_MODULES([ attribute fmod fprintf-posix getopt-gnu git-version-gen havelib hypot memmem putenv snprintf stat stdbool-h-c99 stdckdint-h stdcountof-h stdint-h strcase strerror strsignal sys_wait-h unlink vsnprintf wcwidth ]) gl_AVOID([]) gl_SOURCE_BASE([lib]) gl_M4_BASE([gnulib_m4]) gl_PO_BASE([]) gl_DOC_BASE([doc]) gl_TESTS_BASE([tests]) gl_LIB([libgnu]) gl_MAKEFILE_NAME([gnulib.mk]) gl_AUTOMAKE_SUBDIR gl_MACRO_PREFIX([gl]) gl_PO_DOMAIN([]) gl_WITNESS_C_MACRO([]) groff-1.24.1/gnulib_m4/isinf.m40000644000175000017500000001273315153275164013074 00000000000000# isinf.m4 # serial 17 dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_ISINF], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl Persuade glibc to declare isinf. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_CHECK_DECLS([isinf], , , [[#include #ifndef isinf #error "isinf must be a macro, not a function" #endif ]]) if test "$ac_cv_have_decl_isinf" = yes; then gl_CHECK_MATH_LIB([ISINF_LIBM], [double], [x = isinf (x) + isinf ((float) x);]) if test "$ISINF_LIBM" != missing; then dnl Test whether isinf() on 'long double' works. gl_ISINFL_WORKS case "$gl_cv_func_isinfl_works" in *yes) ;; *) ISINF_LIBM=missing;; esac fi fi dnl On Solaris 10, with CC in C++ mode, isinf is not available although dnl is with cc in C mode. This cannot be worked around by defining dnl _XOPEN_SOURCE=600, because the latter does not work in C++ mode on dnl Solaris 11.0. Therefore use the replacement functions on Solaris. if test "$ac_cv_have_decl_isinf" != yes \ || test "$ISINF_LIBM" = missing \ || { case "$host_os" in solaris*) true;; *) false;; esac; }; then REPLACE_ISINF=1 dnl No libraries are needed to link lib/isinf.c. ISINF_LIBM= fi AC_SUBST([ISINF_LIBM]) ]) dnl Test whether isinf() works: dnl 1) Whether it correctly returns false for LDBL_MAX. dnl 2) Whether on 'long double' recognizes all canonical values which are dnl infinite. AC_DEFUN([gl_ISINFL_WORKS], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gl_BIGENDIAN]) AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether isinf(long double) works], [gl_cv_func_isinfl_works], [ saved_LIBS="$LIBS" LIBS="$LIBS $ISINF_LIBM" AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include #define NWORDS \ ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) typedef union { unsigned int word[NWORDS]; long double value; } memory_long_double; int main () { int result = 0; if (isinf (LDBL_MAX)) result |= 1; { memory_long_double m; unsigned int i; /* The isinf macro should be immune against changes in the sign bit and in the mantissa bits. The xor operation twiddles a bit that can only be a sign bit or a mantissa bit (since the exponent never extends to bit 31). */ m.value = 0.0L / 0.0L; m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1); for (i = 0; i < NWORDS; i++) m.word[i] |= 1; if (isinf (m.value)) result |= 2; } #if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE /* Representation of an 80-bit 'long double' as an initializer for a sequence of 'unsigned int' words. */ # ifdef WORDS_BIGENDIAN # define LDBL80_WORDS(exponent,manthi,mantlo) \ { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ (unsigned int) (mantlo) << 16 \ } # else # define LDBL80_WORDS(exponent,manthi,mantlo) \ { mantlo, manthi, exponent } # endif { /* Quiet NaN. */ static memory_long_double x = { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; if (isinf (x.value)) result |= 2; } { /* Signalling NaN. */ static memory_long_double x = { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; if (isinf (x.value)) result |= 2; } /* isinf should return something even for noncanonical values. */ { /* Pseudo-NaN. */ static memory_long_double x = { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; if (isinf (x.value) && !isinf (x.value)) result |= 4; } { /* Pseudo-Infinity. */ static memory_long_double x = { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; if (isinf (x.value) && !isinf (x.value)) result |= 8; } { /* Pseudo-Zero. */ static memory_long_double x = { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; if (isinf (x.value) && !isinf (x.value)) result |= 16; } { /* Unnormalized number. */ static memory_long_double x = { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; if (isinf (x.value) && !isinf (x.value)) result |= 32; } { /* Pseudo-Denormal. */ static memory_long_double x = { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; if (isinf (x.value) && !isinf (x.value)) result |= 64; } #endif return result; }]])], [gl_cv_func_isinfl_works=yes], [gl_cv_func_isinfl_works=no], [case "$host_os" in mingw* | windows*) # Guess yes on mingw, no on MSVC. AC_EGREP_CPP([Known], [ #ifdef __MINGW32__ Known #endif ], [gl_cv_func_isinfl_works="guessing yes"], [gl_cv_func_isinfl_works="guessing no"]) ;; *) gl_cv_func_isinfl_works="guessing yes" ;; esac ]) LIBS="$saved_LIBS" ]) ]) groff-1.24.1/gnulib_m4/mbrtoc32.m40000644000175000017500000002467515153275164013427 00000000000000# mbrtoc32.m4 # serial 21 dnl Copyright (C) 2014-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_MBRTOC32], [ AC_REQUIRE([gl_UCHAR_H_DEFAULTS]) AC_REQUIRE([AC_TYPE_MBSTATE_T]) dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is dnl determined. It describes how our overridden mbrtowc is implemented. dnl We then implement mbrtoc32 accordingly. AC_REQUIRE([gl_MBSTATE_T_BROKEN]) AC_REQUIRE([gl_TYPE_CHAR32_T]) AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) AC_REQUIRE([gl_CHECK_FUNC_MBRTOC32]) if test $gl_cv_func_mbrtoc32 = no; then HAVE_MBRTOC32=0 else if test $GNULIBHEADERS_OVERRIDE_CHAR32_T = 1 || test $REPLACE_MBSTATE_T = 1; then REPLACE_MBRTOC32=1 else gl_MBRTOC32_EMPTY_INPUT gl_MBRTOC32_C_LOCALE gl_MBRTOC32_UTF8_LOCALE case "$gl_cv_func_mbrtoc32_empty_input" in *yes) ;; *) AC_DEFINE([MBRTOC32_EMPTY_INPUT_BUG], [1], [Define if the mbrtoc32 function does not return (size_t) -2 for empty input.]) REPLACE_MBRTOC32=1 ;; esac case "$gl_cv_func_mbrtoc32_C_locale_sans_EILSEQ" in *yes) ;; *) AC_DEFINE([MBRTOC32_IN_C_LOCALE_MAYBE_EILSEQ], [1], [Define if the mbrtoc32 function may signal encoding errors in the C locale.]) REPLACE_MBRTOC32=1 ;; esac case "$gl_cv_func_mbrtoc32_utf8_locale_works" in *yes) ;; *) AC_DEFINE([MBRTOC32_MULTIBYTE_LOCALE_BUG], [1], [Define if the mbrtoc32 function does not accept the input bytes one-by-one.]) REPLACE_MBRTOC32=1 dnl Our replacement mbrtoc32 can handle UTF-8, but not GB18030. LOCALE_ZH_CN=none ;; esac fi if test $HAVE_WORKING_MBRTOC32 = 0; then REPLACE_MBRTOC32=1 fi fi ]) AC_DEFUN([gl_CHECK_FUNC_MBRTOC32], [ dnl Cf. gl_CHECK_FUNCS_ANDROID AC_CHECK_DECL([mbrtoc32], , , [[#ifdef __HAIKU__ #include #endif #include ]]) if test $ac_cv_have_decl_mbrtoc32 = yes; then dnl We can't use AC_CHECK_FUNC here, because mbrtoc32() is defined as a dnl static inline function on Haiku 2020. AC_CACHE_CHECK([for mbrtoc32], [gl_cv_func_mbrtoc32], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include #ifdef __HAIKU__ #include #endif #include ]], [[char32_t c; return mbrtoc32 (&c, "", 1, NULL) == 0; ]]) ], [gl_cv_func_mbrtoc32=yes], [gl_cv_func_mbrtoc32=no]) ]) else gl_cv_func_mbrtoc32=no fi ]) dnl Test whether mbrtoc32 returns the correct value on empty input. AC_DEFUN([gl_MBRTOC32_EMPTY_INPUT], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether mbrtoc32 works on empty input], [gl_cv_func_mbrtoc32_empty_input], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #ifdef __HAIKU__ #include #endif #include static char32_t wc; static mbstate_t mbs; int main (void) { return mbrtoc32 (&wc, "", 0, &mbs) != (size_t) -2; }]])], [gl_cv_func_mbrtoc32_empty_input=yes], [gl_cv_func_mbrtoc32_empty_input=no], [case "$host_os" in # Guess no on glibc systems. *-gnu* | gnu*) gl_cv_func_mbrtoc32_empty_input="guessing no" ;; # Guess no on Android. linux*-android*) gl_cv_func_mbrtoc32_empty_input="guessing no" ;; # Guess no on native Windows. mingw* | windows*) gl_cv_func_mbrtoc32_empty_input="guessing no" ;; *) gl_cv_func_mbrtoc32_empty_input="guessing yes" ;; esac ]) ]) ]) dnl dnl POSIX:2018 says regarding mbrtowc: "In the POSIX locale an [EILSEQ] error dnl cannot occur since all byte values are valid characters." It is reasonable dnl to expect mbrtoc32 to behave in the same way. AC_DEFUN([gl_MBRTOC32_C_LOCALE], [ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether the C locale is free of encoding errors], [gl_cv_func_mbrtoc32_C_locale_sans_EILSEQ], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include #include #ifdef __HAIKU__ #include #endif #include ]], [[ int i; char *locale = setlocale (LC_ALL, "C"); if (! locale) return 2; for (i = CHAR_MIN; i <= CHAR_MAX; i++) { char c = i; char32_t wc; mbstate_t mbs = { 0, }; size_t ss = mbrtoc32 (&wc, &c, 1, &mbs); if (1 < ss) return 3; } return 0; ]])], [gl_cv_func_mbrtoc32_C_locale_sans_EILSEQ=yes], [gl_cv_func_mbrtoc32_C_locale_sans_EILSEQ=no], [case "$host_os" in # Guess yes on native Windows. mingw* | windows*) gl_cv_func_mbrtoc32_C_locale_sans_EILSEQ="guessing yes" ;; *) gl_cv_func_mbrtoc32_C_locale_sans_EILSEQ="$gl_cross_guess_normal" ;; esac ]) ]) ]) dnl Test whether mbrtoc32 works when it's fed the bytes one-by-one in an UTF-8 dnl locale. AC_DEFUN([gl_MBRTOC32_UTF8_LOCALE], [ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether mbrtoc32 works in an UTF-8 locale], [gl_cv_func_mbrtoc32_utf8_locale_works], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include #ifdef __HAIKU__ #include #endif #include ]], [[ char *locale = setlocale (LC_ALL, "en_US.UTF-8"); if (locale) { /* This test fails on Cygwin 3.5.3. */ mbstate_t state = { 0, }; char32_t uc = 0xDEADBEEF; /* \360\237\220\203 = U+0001F403 */ if (mbrtoc32 (&uc, "\360", 1, &state) != (size_t)-2) return 1; if (mbrtoc32 (&uc, "\237", 1, &state) != (size_t)-2) return 2; if (mbrtoc32 (&uc, "\220", 1, &state) != (size_t)-2) return 3; if (mbrtoc32 (&uc, "\203", 1, &state) != 1) return 4; if (uc != 0x0001F403) return 5; } return 0; ]])], [gl_cv_func_mbrtoc32_utf8_locale_works=yes], [gl_cv_func_mbrtoc32_utf8_locale_works=no], [case "$host_os" in # Guess no on Cygwin. cygwin*) gl_cv_func_mbrtoc32_utf8_locale_works="guessing no" ;; *) gl_cv_func_mbrtoc32_utf8_locale_works="$gl_cross_guess_normal" ;; esac ]) ]) ]) dnl Test whether mbrtoc32 works not worse than mbrtowc. dnl Result is HAVE_WORKING_MBRTOC32. AC_DEFUN([gl_MBRTOC32_SANITYCHECK], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gl_TYPE_CHAR32_T]) AC_REQUIRE([gl_CHECK_FUNC_MBRTOC32]) AC_REQUIRE([gt_LOCALE_FR]) AC_REQUIRE([gt_LOCALE_ZH_CN]) AC_REQUIRE([AC_CANONICAL_HOST]) if test $GNULIBHEADERS_OVERRIDE_CHAR32_T = 1 || test $gl_cv_func_mbrtoc32 = no; then HAVE_WORKING_MBRTOC32=0 else AC_CACHE_CHECK([whether mbrtoc32 works as well as mbrtowc], [gl_cv_func_mbrtoc32_sanitycheck], [ dnl Initial guess, used when cross-compiling or when no suitable locale dnl is present. changequote(,)dnl case "$host_os" in # Guess no on FreeBSD, Solaris, native Windows. freebsd* | midnightbsd* | solaris* | mingw* | windows*) gl_cv_func_mbrtoc32_sanitycheck="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_mbrtoc32_sanitycheck="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_FR != none || test $LOCALE_ZH_CN != none; then AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include #include #ifdef __HAIKU__ #include #endif #include int main () { int result = 0; /* This fails on native Windows: mbrtoc32 returns (size_t)-1. mbrtowc returns 1 (correct). */ if (strcmp ("$LOCALE_FR", "none") != 0 && setlocale (LC_ALL, "$LOCALE_FR") != NULL) { mbstate_t state; wchar_t wc = (wchar_t) 0xBADFACE; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, "\374", 1, &state) == 1) { char32_t c32 = (wchar_t) 0xBADFACE; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtoc32 (&c32, "\374", 1, &state) != 1) result |= 1; } } /* This fails on FreeBSD 13.0 and Solaris 11.4: mbrtoc32 returns (size_t)-2 or (size_t)-1. mbrtowc returns 4 (correct). */ if (strcmp ("$LOCALE_ZH_CN", "none") != 0 && setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) { mbstate_t state; wchar_t wc = (wchar_t) 0xBADFACE; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, "\224\071\375\067", 4, &state) == 4) { char32_t c32 = (wchar_t) 0xBADFACE; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtoc32 (&c32, "\224\071\375\067", 4, &state) != 4) result |= 2; } } return result; }]])], [gl_cv_func_mbrtoc32_sanitycheck=yes], [gl_cv_func_mbrtoc32_sanitycheck=no], [:]) fi ]) case "$gl_cv_func_mbrtoc32_sanitycheck" in *yes) HAVE_WORKING_MBRTOC32=1 AC_DEFINE([HAVE_WORKING_MBRTOC32], [1], [Define if the mbrtoc32 function basically works.]) ;; *) HAVE_WORKING_MBRTOC32=0 ;; esac fi AC_SUBST([HAVE_WORKING_MBRTOC32]) ]) # Prerequisites of lib/mbrtoc32.c and lib/lc-charset-dispatch.c. AC_DEFUN([gl_PREREQ_MBRTOC32], [ AC_REQUIRE([gl_C32RTOMB_SANITYCHECK]) : ]) groff-1.24.1/gnulib_m4/c-bool.m40000644000175000017500000000450415153275164013134 00000000000000# c-bool.m4 # serial 3 dnl Copyright 2022-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. # Check for bool that conforms to C2023. AC_DEFUN([gl_C_BOOL], [ AC_CACHE_CHECK([for bool, true, false], [gl_cv_c_bool], [AC_COMPILE_IFELSE( [AC_LANG_SOURCE([[ #if true == false #error "true == false" #endif extern bool b; bool b = true == false;]])], [gl_cv_c_bool=yes], [gl_cv_c_bool=no])]) if test "$gl_cv_c_bool" = yes; then AC_DEFINE([HAVE_C_BOOL], [1], [Define to 1 if bool, true and false work as per C2023.]) fi AC_CHECK_HEADERS_ONCE([stdbool.h]) dnl The "zz" puts this toward config.h's end, to avoid potential dnl collisions with other definitions. dnl If 'bool', 'true' and 'false' do not work, arrange for them to work. dnl Hardcode the known configuration results for GCC and clang, so that dnl a configuration made with the C compiler works also with the C++ compiler dnl and vice versa. dnl The seemingly redundant parentheses are necessary for MSVC 14. dnl "Arrange for them to work", in C, means including if it is dnl not already included. dnl However, if the preprocessor mistakenly treats 'true' as 0, dnl define it to a bool expression equal to 1; this is needed in dnl Sun C++ 5.11 (Oracle Solaris Studio 12.2, 2010) and older. AH_VERBATIM([zzbool], [#if !(defined __cplusplus \ ? 1 \ : (defined __clang__ \ ? __STDC_VERSION__ >= 202000L && __clang_major__ >= 15 \ : (defined __GNUC__ \ ? __STDC_VERSION__ >= 202000L && __GNUC__ >= 13 \ : defined HAVE_C_BOOL))) # if !defined __cplusplus && !defined __bool_true_false_are_defined # if HAVE_STDBOOL_H # include # else # if defined __SUNPRO_C # error " is not usable with this configuration. To make it usable, add -D_STDC_C99= to $CC." # else # error " does not exist on this platform. Use gnulib module 'stdbool-c99' instead of gnulib module 'stdbool'." # endif # endif # endif # if !true # define true (!false) # endif #endif]) ]) groff-1.24.1/gnulib_m4/strings_h.m40000644000175000017500000000556615153275164013772 00000000000000# strings_h.m4 # serial 14 dnl Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. # Configure a replacement for . AC_DEFUN_ONCE([gl_STRINGS_H], [ dnl Ensure to expand the default settings once only, before all statements dnl that occur in other macros. AC_REQUIRE([gl_STRINGS_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([strings.h]) if test $ac_cv_header_strings_h = yes; then HAVE_STRINGS_H=1 else HAVE_STRINGS_H=0 fi AC_SUBST([HAVE_STRINGS_H]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[ /* Minix 3.1.8 has a bug: must be included before . */ #include #include ]], [ffs strcasecmp strcasecmp_l strncasecmp strncasecmp_l]) ]) # gl_STRINGS_MODULE_INDICATOR([modulename]) # sets the shell variable that indicates the presence of the given module # to a C preprocessor expression that will evaluate to 1. # This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_STRINGS_MODULE_INDICATOR], [ dnl Ensure to expand the default settings once only. gl_STRINGS_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$1]) ]) # Initializes the default values for AC_SUBSTed shell variables. # This macro must not be AC_REQUIREd. It must only be invoked, and only # outside of macros or in macros that are not AC_REQUIREd. AC_DEFUN([gl_STRINGS_H_REQUIRE_DEFAULTS], [ m4_defun(GL_MODULE_INDICATOR_PREFIX[_STRINGS_H_MODULE_INDICATOR_DEFAULTS], [ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFS]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRCASECMP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRCASECMP_L]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRNCASECMP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRNCASECMP_L]) ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_STRINGS_H_MODULE_INDICATOR_DEFAULTS]) AC_REQUIRE([gl_STRINGS_H_DEFAULTS]) ]) AC_DEFUN([gl_STRINGS_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. HAVE_FFS=1; AC_SUBST([HAVE_FFS]) HAVE_STRCASECMP=1; AC_SUBST([HAVE_STRCASECMP]) HAVE_STRCASECMP_L=1; AC_SUBST([HAVE_STRCASECMP_L]) HAVE_STRNCASECMP=1; AC_SUBST([HAVE_STRNCASECMP]) HAVE_STRNCASECMP_L=1; AC_SUBST([HAVE_STRNCASECMP_L]) HAVE_DECL_STRNCASECMP=1; AC_SUBST([HAVE_DECL_STRNCASECMP]) REPLACE_STRCASECMP=0; AC_SUBST([REPLACE_STRCASECMP]) REPLACE_STRCASECMP_L=0; AC_SUBST([REPLACE_STRCASECMP_L]) REPLACE_STRNCASECMP=0; AC_SUBST([REPLACE_STRNCASECMP]) REPLACE_STRNCASECMP_L=0; AC_SUBST([REPLACE_STRNCASECMP_L]) ]) groff-1.24.1/gnulib_m4/fseterr.m40000644000175000017500000000072115153275164013430 00000000000000# fseterr.m4 # serial 2 dnl Copyright (C) 2012-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_FSETERR], [ gl_CHECK_FUNCS_ANDROID([__fseterr], [[#include #include ]]) ]) groff-1.24.1/gnulib_m4/stdio_h.m40000644000175000017500000003114015153275164013406 00000000000000# stdio_h.m4 # serial 75 dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_STDIO_H_EARLY], [ dnl Defining __USE_MINGW_ANSI_STDIO to 1 must be done early, because dnl the results of several configure tests depend on it: The tests dnl - checking whether snprintf returns a byte count as in C99... dnl - checking whether snprintf truncates the result as in C99... dnl - checking whether printf supports the 'F' directive... dnl - checking whether printf supports the grouping flag... dnl - checking whether printf supports the zero flag correctly... dnl - checking whether printf supports infinite 'double' arguments... dnl - checking whether printf supports large precisions... dnl report 'yes' if __USE_MINGW_ANSI_STDIO is 1 but 'no' if dnl __USE_MINGW_ANSI_STDIO is not set. AH_VERBATIM([MINGW_ANSI_STDIO], [/* Use GNU style printf and scanf. */ #ifndef __USE_MINGW_ANSI_STDIO # undef __USE_MINGW_ANSI_STDIO #endif ]) AC_DEFINE([__USE_MINGW_ANSI_STDIO]) ]) AC_DEFUN_ONCE([gl_STDIO_H], [ AC_REQUIRE([gl_STDIO_H_DEFAULTS]) gl_NEXT_HEADERS([stdio.h]) dnl Determine whether __USE_MINGW_ANSI_STDIO makes printf and dnl inttypes.h behave like gnu instead of system; we must give our dnl printf wrapper the right attribute to match. AC_CACHE_CHECK([which flavor of printf attribute matches inttypes macros], [gl_cv_func_printf_attribute_flavor], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #define __STDC_FORMAT_MACROS 1 #include #include /* For non-mingw systems, compilation will trivially succeed. For mingw, compilation will succeed for older mingw (system printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */ #if (defined _WIN32 && ! defined __CYGWIN__) && \ (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1]; #endif ]])], [gl_cv_func_printf_attribute_flavor=system], [gl_cv_func_printf_attribute_flavor=gnu])]) if test "$gl_cv_func_printf_attribute_flavor" = gnu; then AC_DEFINE([GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU], [1], [Define to 1 if printf and friends should be labeled with attribute "__gnu_printf__" instead of "__printf__"]) fi dnl For defining _PRINTF_NAN_LEN_MAX. gl_MUSL_LIBC dnl This ifdef is an optimization, to avoid performing a configure check whose dnl result is not used. But it does not make the test of dnl GNULIB_STDIO_H_NONBLOCKING or GNULIB_NONBLOCKING redundant. m4_ifdef([gl_NONBLOCKING_IO], [ gl_NONBLOCKING_IO if test $gl_cv_have_nonblocking != yes; then REPLACE_STDIO_READ_FUNCS=1 fi ]) dnl This ifdef is an optimization, to avoid performing a configure check whose dnl result is not used. But it does not make the test of dnl GNULIB_STDIO_H_SIGPIPE or GNULIB_SIGPIPE redundant. m4_ifdef([gl_SIGNAL_SIGPIPE], [ gl_SIGNAL_SIGPIPE if test $gl_cv_header_signal_h_SIGPIPE != yes; then REPLACE_STDIO_WRITE_FUNCS=1 fi ]) dnl This ifdef is an optimization, to avoid performing a configure check whose dnl result is not used. But it does not make the test of dnl GNULIB_STDIO_H_NONBLOCKING or GNULIB_NONBLOCKING redundant. m4_ifdef([gl_NONBLOCKING_IO], [ gl_NONBLOCKING_IO if test $gl_cv_have_nonblocking != yes; then REPLACE_STDIO_WRITE_FUNCS=1 fi ]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use, and which is not dnl guaranteed by both C89 and C11. gl_WARN_ON_USE_PREPARE([[#include ]], [dprintf fpurge fseeko ftello getdelim getline gets pclose popen renameat snprintf tmpfile vdprintf vsnprintf]) AC_REQUIRE([AC_C_RESTRICT]) AC_CHECK_DECLS_ONCE([fcloseall]) if test $ac_cv_have_decl_fcloseall = no; then HAVE_DECL_FCLOSEALL=0 fi AC_CHECK_DECLS_ONCE([getw]) if test $ac_cv_have_decl_getw = no; then HAVE_DECL_GETW=0 fi AC_CHECK_DECLS_ONCE([putw]) if test $ac_cv_have_decl_putw = no; then HAVE_DECL_PUTW=0 fi ]) # gl_STDIO_MODULE_INDICATOR([modulename]) # sets the shell variable that indicates the presence of the given module # to a C preprocessor expression that will evaluate to 1. # This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_STDIO_MODULE_INDICATOR], [ dnl Ensure to expand the default settings once only. gl_STDIO_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) # Initializes the default values for AC_SUBSTed shell variables. # This macro must not be AC_REQUIREd. It must only be invoked, and only # outside of macros or in macros that are not AC_REQUIREd. AC_DEFUN([gl_STDIO_H_REQUIRE_DEFAULTS], [ m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDIO_H_MODULE_INDICATOR_DEFAULTS], [ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DZPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCLOSE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FDOPEN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFLUSH]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FGETC]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FGETS]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FOPEN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FOPEN_GNU]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPRINTF_POSIX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPURGE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPUTC]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPUTS]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREAD]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREOPEN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSCANF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSEEK]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSEEKO]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTELL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTELLO]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FWRITE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FZPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETC]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETCHAR]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETDELIM]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLINE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OBSTACK_PRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OBSTACK_PRINTF_POSIX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OBSTACK_ZPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PCLOSE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PERROR]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POPEN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PRINTF_POSIX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTC]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTCHAR]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTS]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMOVE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RENAME]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RENAMEAT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SCANF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SNPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SNZPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SPRINTF_POSIX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_NONBLOCKING]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_SIGPIPE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SZPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TMPFILE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VASPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VASZPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFSCANF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSCANF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VDPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VDZPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFPRINTF_POSIX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFZPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VPRINTF_POSIX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSNPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSNZPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSPRINTF_POSIX]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSZPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VZPRINTF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ZPRINTF]) dnl Support Microsoft deprecated alias function names by default. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FCLOSEALL], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FDOPEN], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FILENO], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_GETW], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_PUTW], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_TEMPNAM], [1]) ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_STDIO_H_MODULE_INDICATOR_DEFAULTS]) AC_REQUIRE([gl_STDIO_H_DEFAULTS]) ]) AC_DEFUN([gl_STDIO_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DECL_FCLOSEALL=1; AC_SUBST([HAVE_DECL_FCLOSEALL]) HAVE_DECL_FPURGE=1; AC_SUBST([HAVE_DECL_FPURGE]) HAVE_DECL_FSEEKO=1; AC_SUBST([HAVE_DECL_FSEEKO]) HAVE_DECL_FTELLO=1; AC_SUBST([HAVE_DECL_FTELLO]) HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM]) HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE]) HAVE_DECL_GETW=1; AC_SUBST([HAVE_DECL_GETW]) HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF]) HAVE_DECL_PUTW=1; AC_SUBST([HAVE_DECL_PUTW]) HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF]) HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF]) HAVE_DPRINTF=1; AC_SUBST([HAVE_DPRINTF]) HAVE_FSEEKO=1; AC_SUBST([HAVE_FSEEKO]) HAVE_FTELLO=1; AC_SUBST([HAVE_FTELLO]) HAVE_PCLOSE=1; AC_SUBST([HAVE_PCLOSE]) HAVE_POPEN=1; AC_SUBST([HAVE_POPEN]) HAVE_RENAMEAT=1; AC_SUBST([HAVE_RENAMEAT]) HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF]) HAVE_VDPRINTF=1; AC_SUBST([HAVE_VDPRINTF]) REPLACE_DPRINTF=0; AC_SUBST([REPLACE_DPRINTF]) REPLACE_FCLOSE=0; AC_SUBST([REPLACE_FCLOSE]) REPLACE_FDOPEN=0; AC_SUBST([REPLACE_FDOPEN]) REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH]) REPLACE_FOPEN=0; AC_SUBST([REPLACE_FOPEN]) REPLACE_FOPEN_FOR_FOPEN_GNU=0; AC_SUBST([REPLACE_FOPEN_FOR_FOPEN_GNU]) REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF]) REPLACE_FPURGE=0; AC_SUBST([REPLACE_FPURGE]) REPLACE_FREOPEN=0; AC_SUBST([REPLACE_FREOPEN]) REPLACE_FSEEK=0; AC_SUBST([REPLACE_FSEEK]) REPLACE_FSEEKO=0; AC_SUBST([REPLACE_FSEEKO]) REPLACE_FTELL=0; AC_SUBST([REPLACE_FTELL]) REPLACE_FTELLO=0; AC_SUBST([REPLACE_FTELLO]) REPLACE_GETDELIM=0; AC_SUBST([REPLACE_GETDELIM]) REPLACE_GETLINE=0; AC_SUBST([REPLACE_GETLINE]) REPLACE_OBSTACK_PRINTF=0; AC_SUBST([REPLACE_OBSTACK_PRINTF]) REPLACE_PERROR=0; AC_SUBST([REPLACE_PERROR]) REPLACE_POPEN=0; AC_SUBST([REPLACE_POPEN]) REPLACE_PRINTF=0; AC_SUBST([REPLACE_PRINTF]) REPLACE_REMOVE=0; AC_SUBST([REPLACE_REMOVE]) REPLACE_RENAME=0; AC_SUBST([REPLACE_RENAME]) REPLACE_RENAMEAT=0; AC_SUBST([REPLACE_RENAMEAT]) REPLACE_SNPRINTF=0; AC_SUBST([REPLACE_SNPRINTF]) REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF]) REPLACE_STDIO_READ_FUNCS=0; AC_SUBST([REPLACE_STDIO_READ_FUNCS]) REPLACE_STDIO_WRITE_FUNCS=0; AC_SUBST([REPLACE_STDIO_WRITE_FUNCS]) REPLACE_TMPFILE=0; AC_SUBST([REPLACE_TMPFILE]) REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF]) REPLACE_VDPRINTF=0; AC_SUBST([REPLACE_VDPRINTF]) REPLACE_VFPRINTF=0; AC_SUBST([REPLACE_VFPRINTF]) REPLACE_VPRINTF=0; AC_SUBST([REPLACE_VPRINTF]) REPLACE_VSNPRINTF=0; AC_SUBST([REPLACE_VSNPRINTF]) REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF]) ]) groff-1.24.1/gnulib_m4/signbit.m40000644000175000017500000003127715153275164013427 00000000000000# signbit.m4 # serial 23 dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_SIGNBIT], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([for signbit macro], [gl_cv_func_signbit], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include /* If signbit is defined as a function, don't use it, since calling it for 'float' or 'long double' arguments would involve conversions. If signbit is not declared at all but exists as a library function, don't use it, since the prototype may not match. If signbit is not declared at all but exists as a compiler built-in, don't use it, since it's preferable to use __builtin_signbit* (no warnings, no conversions). */ #ifndef signbit # error "signbit should be a macro" #endif #include ]gl_SIGNBIT_TEST_PROGRAM ])], [gl_cv_func_signbit=yes], [gl_cv_func_signbit=no], [case "$host_os" in # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_signbit="guessing yes" ;; # Guess yes on musl systems. *-musl* | midipix*) gl_cv_func_signbit="guessing yes" ;; # Guess yes on native Windows. mingw* | windows*) gl_cv_func_signbit="guessing yes" ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_signbit="$gl_cross_guess_normal" ;; esac ]) ]) dnl GCC >= 4.0 and clang provide three built-ins for signbit. dnl They can be used without warnings, also in C++, regardless of . dnl But they may expand to calls to functions, which may or may not be in dnl libc. AC_CACHE_CHECK([for signbit compiler built-ins], [gl_cv_func_signbit_builtins], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # define signbit(x) \ (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \ sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \ __builtin_signbitf (x)) #else # error "signbit should be three compiler built-ins" #endif #include ]gl_SIGNBIT_TEST_PROGRAM ])], [gl_cv_func_signbit_builtins=yes], [gl_cv_func_signbit_builtins=no], [case "$host_os" in # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_signbit_builtins="guessing yes" ;; # Guess yes on musl systems. *-musl* | midipix*) gl_cv_func_signbit_builtins="guessing yes" ;; # Guess yes on mingw, no on MSVC. mingw* | windows*) if test -n "$GCC"; then gl_cv_func_signbit_builtins="guessing yes" else gl_cv_func_signbit_builtins="guessing no" fi ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_signbit_builtins="$gl_cross_guess_normal" ;; esac ]) ]) dnl Use the compiler built-ins whenever possible, because they are more dnl efficient than the system library functions (if they exist). case "$gl_cv_func_signbit_builtins" in *yes) REPLACE_SIGNBIT_USING_BUILTINS=1 ;; *) case "$gl_cv_func_signbit" in *yes) ;; *) dnl REPLACE_SIGNBIT=1 makes sure the signbit[fdl] functions get built. REPLACE_SIGNBIT=1 ;; esac ;; esac dnl On Solaris 10, with CC in C++ mode, signbit is not available although dnl is with cc in C mode. This cannot be worked around by defining dnl _XOPEN_SOURCE=600, because the latter does not work in C++ mode on dnl Solaris 11.0. Therefore use the replacement functions on Solaris. case "$host_os" in solaris*) REPLACE_SIGNBIT=1 ;; esac if test $REPLACE_SIGNBIT = 1; then gl_FLOAT_SIGN_LOCATION gl_DOUBLE_SIGN_LOCATION gl_LONG_DOUBLE_SIGN_LOCATION if test "$gl_cv_cc_float_signbit" = unknown; then dnl Test whether copysignf() is declared. AC_CHECK_DECLS([copysignf], , , [[#include ]]) if test "$ac_cv_have_decl_copysignf" = yes; then dnl Test whether copysignf() can be used without libm. AC_CACHE_CHECK([whether copysignf can be used without linking with libm], [gl_cv_func_copysignf_no_libm], [ AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include float x, y;]], [[return copysignf (x, y) < 0;]])], [gl_cv_func_copysignf_no_libm=yes], [gl_cv_func_copysignf_no_libm=no]) ]) if test $gl_cv_func_copysignf_no_libm = yes; then AC_DEFINE([HAVE_COPYSIGNF_IN_LIBC], [1], [Define if the copysignf function is declared in and available in libc.]) fi fi fi if test "$gl_cv_cc_double_signbit" = unknown; then dnl Test whether copysign() is declared. AC_CHECK_DECLS([copysign], , , [[#include ]]) if test "$ac_cv_have_decl_copysign" = yes; then dnl Test whether copysign() can be used without libm. AC_CACHE_CHECK([whether copysign can be used without linking with libm], [gl_cv_func_copysign_no_libm], [ AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include double x, y;]], [[return copysign (x, y) < 0;]])], [gl_cv_func_copysign_no_libm=yes], [gl_cv_func_copysign_no_libm=no]) ]) if test $gl_cv_func_copysign_no_libm = yes; then AC_DEFINE([HAVE_COPYSIGN_IN_LIBC], [1], [Define if the copysign function is declared in and available in libc.]) fi fi fi if test "$gl_cv_cc_long_double_signbit" = unknown; then dnl Test whether copysignl() is declared. AC_CHECK_DECLS([copysignl], , , [[#include ]]) if test "$ac_cv_have_decl_copysignl" = yes; then dnl Test whether copysignl() can be used without libm. AC_CACHE_CHECK([whether copysignl can be used without linking with libm], [gl_cv_func_copysignl_no_libm], [ AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include long double x, y;]], [[return copysignl (x, y) < 0;]])], [gl_cv_func_copysignl_no_libm=yes], [gl_cv_func_copysignl_no_libm=no]) ]) if test $gl_cv_func_copysignl_no_libm = yes; then AC_DEFINE([HAVE_COPYSIGNL_IN_LIBC], [1], [Define if the copysignl function is declared in and available in libc.]) fi fi fi fi ]) AC_DEFUN([gl_SIGNBIT_TEST_PROGRAM], [[ /* Global variables. Needed because GCC 4 constant-folds __builtin_signbitl (literal) but cannot constant-fold __builtin_signbitl (variable). */ float vf; double vd; long double vl; int main () { /* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. So we use -p0f and -p0d instead. */ float p0f = 0.0f; float m0f = -p0f; double p0d = 0.0; double m0d = -p0d; /* On HP-UX 10.20, negating 0.0L does not yield -0.0L. So we use another constant expression instead. But that expression does not work on other platforms, such as when cross-compiling to PowerPC on Mac OS X 10.5. */ long double p0l = 0.0L; #if defined __hpux long double m0l = -LDBL_MIN * LDBL_MIN; #else long double m0l = -p0l; #endif int result = 0; if (signbit (vf)) /* link check */ vf++; { float plus_inf = 1.0f / p0f; float minus_inf = -1.0f / p0f; if (!(!signbit (255.0f) && signbit (-255.0f) && !signbit (p0f) && (memcmp (&m0f, &p0f, sizeof (float)) == 0 || signbit (m0f)) && !signbit (plus_inf) && signbit (minus_inf))) result |= 1; } if (signbit (vd)) /* link check */ vd++; { double plus_inf = 1.0 / p0d; double minus_inf = -1.0 / p0d; if (!(!signbit (255.0) && signbit (-255.0) && !signbit (p0d) && (memcmp (&m0d, &p0d, sizeof (double)) == 0 || signbit (m0d)) && !signbit (plus_inf) && signbit (minus_inf))) result |= 2; } if (signbit (vl)) /* link check */ vl++; { long double plus_inf = 1.0L / p0l; long double minus_inf = -1.0L / p0l; if (signbit (255.0L)) result |= 4; if (!signbit (-255.0L)) result |= 4; if (signbit (p0l)) result |= 8; if (!(memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l))) result |= 16; if (signbit (plus_inf)) result |= 32; if (!signbit (minus_inf)) result |= 64; } return result; } ]]) AC_DEFUN([gl_FLOAT_SIGN_LOCATION], [ gl_FLOATTYPE_SIGN_LOCATION([float], [gl_cv_cc_float_signbit], [f], [FLT]) ]) AC_DEFUN([gl_DOUBLE_SIGN_LOCATION], [ gl_FLOATTYPE_SIGN_LOCATION([double], [gl_cv_cc_double_signbit], [], [DBL]) ]) AC_DEFUN([gl_LONG_DOUBLE_SIGN_LOCATION], [ gl_FLOATTYPE_SIGN_LOCATION([long double], [gl_cv_cc_long_double_signbit], [L], [LDBL]) ]) AC_DEFUN([gl_FLOATTYPE_SIGN_LOCATION], [ AC_CACHE_CHECK([where to find the sign bit in a '$1'], [$2], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #define NWORDS \ ((sizeof ($1) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) typedef union { $1 value; unsigned int word[NWORDS]; } memory_float; static memory_float plus = { 1.0$3 }; static memory_float minus = { -1.0$3 }; int main () { size_t j, k, i; unsigned int m; FILE *fp = fopen ("conftest.out", "w"); if (fp == NULL) return 1; /* Find the different bit. */ k = 0; m = 0; for (j = 0; j < NWORDS; j++) { unsigned int x = plus.word[j] ^ minus.word[j]; if ((x & (x - 1)) || (x && m)) { /* More than one bit difference. */ fprintf (fp, "unknown"); fclose (fp); return 2; } if (x) { k = j; m = x; } } if (m == 0) { /* No difference. */ fprintf (fp, "unknown"); fclose (fp); return 3; } /* Now m = plus.word[k] ^ ~minus.word[k]. */ if (plus.word[k] & ~minus.word[k]) { /* Oh? The sign bit is set in the positive and cleared in the negative numbers? */ fprintf (fp, "unknown"); fclose (fp); return 4; } for (i = 0; ; i++) if ((m >> i) & 1) break; fprintf (fp, "word %d bit %d", (int) k, (int) i); if (fclose (fp) != 0) return 5; return 0; } ]])], [$2=`cat conftest.out`], [$2="unknown"], [ dnl When cross-compiling, we don't know. It depends on the dnl ABI and compiler version. There are too many cases. $2="unknown" ]) rm -f conftest.out ]) case "$]$2[" in word*bit*) word=`echo "$]$2[" | sed -e 's/word //' -e 's/ bit.*//'` bit=`echo "$]$2[" | sed -e 's/word.*bit //'` AC_DEFINE_UNQUOTED([$4][_SIGNBIT_WORD], [$word], [Define as the word index where to find the sign of '$1'.]) AC_DEFINE_UNQUOTED([$4][_SIGNBIT_BIT], [$bit], [Define as the bit index in the word where to find the sign of '$1'.]) ;; esac ]) # Expands to code that defines a function signbitf(float). # It extracts the sign bit of a non-NaN value. AC_DEFUN([gl_FLOAT_SIGNBIT_CODE], [ gl_FLOATTYPE_SIGNBIT_CODE([float], [f], [f]) ]) # Expands to code that defines a function signbitd(double). # It extracts the sign bit of a non-NaN value. AC_DEFUN([gl_DOUBLE_SIGNBIT_CODE], [ gl_FLOATTYPE_SIGNBIT_CODE([double], [d], []) ]) # Expands to code that defines a function signbitl(long double). # It extracts the sign bit of a non-NaN value. AC_DEFUN([gl_LONG_DOUBLE_SIGNBIT_CODE], [ gl_FLOATTYPE_SIGNBIT_CODE([long double], [l], [L]) ]) AC_DEFUN([gl_FLOATTYPE_SIGNBIT_CODE], [[ static int signbit$2 ($1 value) { typedef union { $1 f; unsigned char b[sizeof ($1)]; } float_union; static float_union plus_one = { 1.0$3 }; /* unused bits are zero here */ static float_union minus_one = { -1.0$3 }; /* unused bits are zero here */ /* Compute the sign bit mask as the XOR of plus_one and minus_one. */ float_union u; unsigned int i; u.f = value; for (i = 0; i < sizeof ($1); i++) if (u.b[i] & (plus_one.b[i] ^ minus_one.b[i])) return 1; return 0; } ]]) groff-1.24.1/gnulib_m4/wchar_h.m40000644000175000017500000002657115153275164013404 00000000000000# wchar_h.m4 # serial 66 dnl Copyright (C) 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl A placeholder for ISO C99 , for platforms that have issues. dnl Written by Eric Blake. AC_DEFUN_ONCE([gl_WCHAR_H], [ AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) AC_REQUIRE([gl_WCHAR_H_INLINE_OK]) dnl Prepare for creating substitute . dnl Check for (missing in Linux uClibc when built without wide dnl character support). dnl is always overridden, because of GNULIB_POSIXCHECK. gl_CHECK_NEXT_HEADERS([wchar.h]) if test $ac_cv_header_wchar_h = yes; then HAVE_WCHAR_H=1 else HAVE_WCHAR_H=0 fi AC_SUBST([HAVE_WCHAR_H]) AC_REQUIRE([gl_FEATURES_H]) AC_REQUIRE([gt_TYPE_WINT_T]) if test $gt_cv_c_wint_t = yes; then HAVE_WINT_T=1 else HAVE_WINT_T=0 fi AC_SUBST([HAVE_WINT_T]) AC_REQUIRE([gl_TYPE_WINT_T_PREREQ]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[ #include ]], [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmempcpy wmemset wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth wcsftime ]) AC_REQUIRE([AC_C_RESTRICT]) AC_CHECK_DECLS([wcsdup], [], [], [[ #include ]]) if test $ac_cv_have_decl_wcsdup = no; then HAVE_DECL_WCSDUP=0 fi ]) dnl Check whether is usable at all. AC_DEFUN([gl_WCHAR_H_INLINE_OK], [ dnl Test whether suffers due to the transition from '__inline' to dnl 'gnu_inline'. See dnl and . In summary, dnl glibc version 2.5 or older, together with gcc version 4.3 or newer and dnl the option -std=c99 or -std=gnu99, leads to a broken . AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([whether uses 'inline' correctly], [gl_cv_header_wchar_h_correct_inline], [gl_cv_header_wchar_h_correct_inline=yes case "$host_os" in *-gnu* | gnu*) AC_LANG_CONFTEST([ AC_LANG_SOURCE([[ #define wcstod renamed_wcstod #include extern int zero (void); int main () { return zero(); } ]])]) dnl Do not rename the object file from conftest.$ac_objext to dnl conftest1.$ac_objext, as this will cause the link to fail on dnl z/OS when using the XPLINK object format (due to duplicate dnl CSECT names). Instead, temporarily redefine $ac_compile so dnl that the object file has the latter name from the start. saved_ac_compile="$ac_compile" ac_compile=`echo "$saved_ac_compile" | sed s/conftest/conftest1/` if echo '#include "conftest.c"' >conftest1.c \ && AC_TRY_EVAL([ac_compile]); then AC_LANG_CONFTEST([ AC_LANG_SOURCE([[ #define wcstod renamed_wcstod #include int zero (void) { return 0; } ]])]) dnl See note above about renaming object files. ac_compile=`echo "$saved_ac_compile" | sed s/conftest/conftest2/` if echo '#include "conftest.c"' >conftest2.c \ && AC_TRY_EVAL([ac_compile]); then if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then : else gl_cv_header_wchar_h_correct_inline=no fi fi fi ac_compile="$saved_ac_compile" rm -f conftest[12].c conftest[12].$ac_objext conftest$ac_exeext ;; esac ]) if test $gl_cv_header_wchar_h_correct_inline = no; then AC_MSG_ERROR([ cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS). This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in C99 mode. You have four options: - Add the flag -fgnu89-inline to CC and reconfigure, or - Fix your include files, using parts of , or - Use a gcc version older than 4.3, or - Don't use the flags -std=c99 or -std=gnu99. Configuration aborted.]) fi ]) # gl_WCHAR_MODULE_INDICATOR([modulename]) # sets the shell variable that indicates the presence of the given module # to a C preprocessor expression that will evaluate to 1. # This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_WCHAR_MODULE_INDICATOR], [ dnl Ensure to expand the default settings once only. gl_WCHAR_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) # Initializes the default values for AC_SUBSTed shell variables. # This macro must not be AC_REQUIREd. It must only be invoked, and only # outside of macros or in macros that are not AC_REQUIREd. AC_DEFUN([gl_WCHAR_H_REQUIRE_DEFAULTS], [ m4_defun(GL_MODULE_INDICATOR_PREFIX[_WCHAR_H_MODULE_INDICATOR_DEFAULTS], [ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_BTOWC]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTOB]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSINIT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSZERO]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBRTOWC]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBRLEN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSRTOWCS]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSNRTOWCS]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCRTOMB]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSRTOMBS]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNRTOMBS]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCWIDTH]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMCHR]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMCMP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMCPY]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMMOVE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMPCPY]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMSET]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSLEN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNLEN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCPY]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCPCPY]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNCPY]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCPNCPY]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCAT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNCAT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCMP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNCMP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCASECMP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNCASECMP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCOLL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSXFRM]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSDUP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCHR]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSRCHR]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCSPN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSSPN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSPBRK]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSSTR]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSTOK]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSWIDTH]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSFTIME]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WGETCWD]) dnl Support Microsoft deprecated alias function names by default. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_WCSDUP], [1]) ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_WCHAR_H_MODULE_INDICATOR_DEFAULTS]) dnl Make sure the shell variable for GNULIB_FREE_POSIX is initialized. gl_STDLIB_H_REQUIRE_DEFAULTS AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) ]) AC_DEFUN([gl_WCHAR_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC]) HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT]) HAVE_MBRTOWC=1; AC_SUBST([HAVE_MBRTOWC]) HAVE_MBRLEN=1; AC_SUBST([HAVE_MBRLEN]) HAVE_MBSRTOWCS=1; AC_SUBST([HAVE_MBSRTOWCS]) HAVE_MBSNRTOWCS=1; AC_SUBST([HAVE_MBSNRTOWCS]) HAVE_WCRTOMB=1; AC_SUBST([HAVE_WCRTOMB]) HAVE_WCSRTOMBS=1; AC_SUBST([HAVE_WCSRTOMBS]) HAVE_WCSNRTOMBS=1; AC_SUBST([HAVE_WCSNRTOMBS]) HAVE_WMEMCHR=1; AC_SUBST([HAVE_WMEMCHR]) HAVE_WMEMCMP=1; AC_SUBST([HAVE_WMEMCMP]) HAVE_WMEMCPY=1; AC_SUBST([HAVE_WMEMCPY]) HAVE_WMEMMOVE=1; AC_SUBST([HAVE_WMEMMOVE]) HAVE_WMEMPCPY=1; AC_SUBST([HAVE_WMEMPCPY]) HAVE_WMEMSET=1; AC_SUBST([HAVE_WMEMSET]) HAVE_WCSLEN=1; AC_SUBST([HAVE_WCSLEN]) HAVE_WCSNLEN=1; AC_SUBST([HAVE_WCSNLEN]) HAVE_WCSCPY=1; AC_SUBST([HAVE_WCSCPY]) HAVE_WCPCPY=1; AC_SUBST([HAVE_WCPCPY]) HAVE_WCSNCPY=1; AC_SUBST([HAVE_WCSNCPY]) HAVE_WCPNCPY=1; AC_SUBST([HAVE_WCPNCPY]) HAVE_WCSCAT=1; AC_SUBST([HAVE_WCSCAT]) HAVE_WCSNCAT=1; AC_SUBST([HAVE_WCSNCAT]) HAVE_WCSCMP=1; AC_SUBST([HAVE_WCSCMP]) HAVE_WCSNCMP=1; AC_SUBST([HAVE_WCSNCMP]) HAVE_WCSCASECMP=1; AC_SUBST([HAVE_WCSCASECMP]) HAVE_WCSNCASECMP=1; AC_SUBST([HAVE_WCSNCASECMP]) HAVE_WCSCOLL=1; AC_SUBST([HAVE_WCSCOLL]) HAVE_WCSXFRM=1; AC_SUBST([HAVE_WCSXFRM]) HAVE_WCSDUP=1; AC_SUBST([HAVE_WCSDUP]) HAVE_WCSCHR=1; AC_SUBST([HAVE_WCSCHR]) HAVE_WCSRCHR=1; AC_SUBST([HAVE_WCSRCHR]) HAVE_WCSCSPN=1; AC_SUBST([HAVE_WCSCSPN]) HAVE_WCSSPN=1; AC_SUBST([HAVE_WCSSPN]) HAVE_WCSPBRK=1; AC_SUBST([HAVE_WCSPBRK]) HAVE_WCSSTR=1; AC_SUBST([HAVE_WCSSTR]) HAVE_WCSTOK=1; AC_SUBST([HAVE_WCSTOK]) HAVE_WCSWIDTH=1; AC_SUBST([HAVE_WCSWIDTH]) HAVE_WCSFTIME=1; AC_SUBST([HAVE_WCSFTIME]) HAVE_WCTOB=1; AC_SUBST([HAVE_WCTOB]) HAVE_DECL_WCSDUP=1; AC_SUBST([HAVE_DECL_WCSDUP]) HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH]) REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T]) REPLACE_BTOWC=0; AC_SUBST([REPLACE_BTOWC]) REPLACE_WCTOB=0; AC_SUBST([REPLACE_WCTOB]) REPLACE_MBSINIT=0; AC_SUBST([REPLACE_MBSINIT]) REPLACE_MBRTOWC=0; AC_SUBST([REPLACE_MBRTOWC]) REPLACE_MBRLEN=0; AC_SUBST([REPLACE_MBRLEN]) REPLACE_MBSRTOWCS=0; AC_SUBST([REPLACE_MBSRTOWCS]) REPLACE_MBSNRTOWCS=0; AC_SUBST([REPLACE_MBSNRTOWCS]) REPLACE_WCRTOMB=0; AC_SUBST([REPLACE_WCRTOMB]) REPLACE_WCSRTOMBS=0; AC_SUBST([REPLACE_WCSRTOMBS]) REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS]) REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH]) REPLACE_WCSWIDTH=0; AC_SUBST([REPLACE_WCSWIDTH]) REPLACE_WCSFTIME=0; AC_SUBST([REPLACE_WCSFTIME]) REPLACE_WCSCMP=0; AC_SUBST([REPLACE_WCSCMP]) REPLACE_WCSNCAT=0; AC_SUBST([REPLACE_WCSNCAT]) REPLACE_WCSNCMP=0; AC_SUBST([REPLACE_WCSNCMP]) REPLACE_WCSSTR=0; AC_SUBST([REPLACE_WCSSTR]) REPLACE_WCSTOK=0; AC_SUBST([REPLACE_WCSTOK]) REPLACE_WMEMCMP=0; AC_SUBST([REPLACE_WMEMCMP]) REPLACE_WMEMPCPY=0; AC_SUBST([REPLACE_WMEMPCPY]) ]) groff-1.24.1/gnulib_m4/lstat.m40000644000175000017500000000604415153275164013111 00000000000000# lstat.m4 # serial 36 dnl Copyright (C) 1997-2001, 2003-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl From Jim Meyering. AC_DEFUN([gl_FUNC_LSTAT], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) dnl If lstat does not exist, the replacement does dnl "#define lstat stat", and lstat.c is a no-op. AC_CHECK_FUNCS_ONCE([lstat]) if test $ac_cv_func_lstat = yes; then AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK]) case $host_os,$gl_cv_func_lstat_dereferences_slashed_symlink in darwin* | solaris* | *no) REPLACE_LSTAT=1 ;; esac else HAVE_LSTAT=0 fi ]) # Prerequisites of lib/lstat.c. AC_DEFUN([gl_PREREQ_LSTAT], [:]) AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK], [ dnl We don't use AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK any more, because it dnl is no longer maintained in Autoconf and because it invokes AC_LIBOBJ. AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether lstat correctly handles trailing slash], [gl_cv_func_lstat_dereferences_slashed_symlink], [rm -f conftest.sym conftest.file echo >conftest.file AC_RUN_IFELSE( [AC_LANG_PROGRAM( [AC_INCLUDES_DEFAULT], [[struct stat sbuf; if (symlink ("conftest.file", "conftest.sym") != 0) return 1; /* Linux will dereference the symlink and fail, as required by POSIX. That is better in the sense that it means we will not have to compile and use the lstat wrapper. */ return lstat ("conftest.sym/", &sbuf) == 0; ]])], [gl_cv_func_lstat_dereferences_slashed_symlink=yes], [gl_cv_func_lstat_dereferences_slashed_symlink=no], [case "$host_os" in linux-* | linux) # Guess yes on Linux systems. gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; midipix*) # Guess yes on systems that emulate the Linux system calls. gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; *-gnu* | gnu*) # Guess yes on glibc systems. gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; mingw* | windows*) # Guess no on native Windows. gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;; *) # If we don't know, obey --enable-cross-guesses. gl_cv_func_lstat_dereferences_slashed_symlink="$gl_cross_guess_normal" ;; esac ]) rm -f conftest.sym conftest.file ]) case "$gl_cv_func_lstat_dereferences_slashed_symlink" in *yes) AC_DEFINE_UNQUOTED([LSTAT_FOLLOWS_SLASHED_SYMLINK], [1], [Define to 1 if 'lstat' dereferences a symlink specified with a trailing slash.]) ;; esac ]) groff-1.24.1/gnulib_m4/xsize.m40000644000175000017500000000071615153275164013124 00000000000000# xsize.m4 # serial 5 dnl Copyright (C) 2003-2004, 2008-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_XSIZE], [ dnl Prerequisites of lib/xsize.h. AC_REQUIRE([gl_SIZE_MAX]) AC_CHECK_HEADERS([stdint.h]) ]) groff-1.24.1/gnulib_m4/iswdigit.m40000644000175000017500000000716115153275164013606 00000000000000# iswdigit.m4 # serial 9 dnl Copyright (C) 2020-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_ISWDIGIT], [ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) AC_REQUIRE([gl_WCTYPE_H]) AC_REQUIRE([gt_LOCALE_FR]) AC_REQUIRE([gt_LOCALE_JA]) AC_REQUIRE([gt_LOCALE_EN_UTF8]) AC_REQUIRE([gt_LOCALE_ZH_CN]) AC_REQUIRE([AC_CANONICAL_HOST]) if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then dnl redefines iswdigit already. REPLACE_ISWDIGIT="$REPLACE_ISWCNTRL" else AC_CACHE_CHECK([whether iswdigit is ISO C compliant], [gl_cv_func_iswdigit_works], [ dnl Initial guess, used when cross-compiling or when no suitable locale dnl is present. changequote(,)dnl case "$host_os" in # Guess no on FreeBSD, NetBSD, OpenBSD, Solaris, native Windows, Haiku, Android. freebsd* | dragonfly* | netbsd* | openbsd* | solaris* | mingw* | windows* | haiku* | *-android*) gl_cv_func_iswdigit_works="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_iswdigit_works="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_FR != none || test $LOCALE_JA != none || test "$LOCALE_EN_UTF8" != none || test $LOCALE_ZH_CN != none; then AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include #include #include /* Returns the value of iswdigit for the multibyte character s[0..n-1]. */ static int for_character (const char *s, size_t n) { mbstate_t state; wchar_t wc; size_t ret; memset (&state, '\0', sizeof (mbstate_t)); wc = (wchar_t) 0xBADFACE; ret = mbrtowc (&wc, s, n, &state); if (ret != n) abort (); return iswdigit (wc); } int main (int argc, char *argv[]) { int is; int result = 0; if (strcmp ("$LOCALE_FR", "none") != 0 && setlocale (LC_ALL, "$LOCALE_FR") != NULL) { /* This fails on mingw, MSVC 14. */ /* U+00B2 SUPERSCRIPT TWO */ is = for_character ("\262", 1); if (!(is == 0)) result |= 1; } if (strcmp ("$LOCALE_JA", "none") != 0 && setlocale (LC_ALL, "$LOCALE_JA") != NULL) { /* This fails on NetBSD 10.0. */ /* U+FF11 FULLWIDTH DIGIT ONE */ is = for_character ("\243\261", 2); if (!(is == 0)) result |= 2; } if (strcmp ("$LOCALE_EN_UTF8", "none") != 0 && setlocale (LC_ALL, "$LOCALE_EN_UTF8") != NULL) { /* This fails on FreeBSD 13.0, NetBSD 10.0, OpenBSD 7.5, MSVC 14, Haiku, Android. */ /* U+0663 ARABIC-INDIC DIGIT THREE */ is = for_character ("\331\243", 2); if (!(is == 0)) result |= 4; /* This fails on FreeBSD 13.0, NetBSD 10.0, OpenBSD 7.5, MSVC 14, Haiku, Android. */ /* U+FF11 FULLWIDTH DIGIT ONE */ is = for_character ("\357\274\221", 3); if (!(is == 0)) result |= 8; } if (strcmp ("$LOCALE_ZH_CN", "none") != 0 && setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) { /* This fails on NetBSD 10.0, Solaris 10, Solaris 11.4. */ /* U+FF11 FULLWIDTH DIGIT ONE */ is = for_character ("\243\261", 2); if (!(is == 0)) result |= 16; } return result; }]])], [gl_cv_func_iswdigit_works=yes], [gl_cv_func_iswdigit_works=no], [:]) fi ]) case "$gl_cv_func_iswdigit_works" in *yes) ;; *) REPLACE_ISWDIGIT=1 ;; esac fi ]) groff-1.24.1/gnulib_m4/c32rtomb.m40000644000175000017500000001253715153275164013421 00000000000000# c32rtomb.m4 # serial 8 dnl Copyright (C) 2020-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. AC_DEFUN([gl_FUNC_C32RTOMB], [ AC_REQUIRE([gl_UCHAR_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) AC_REQUIRE([gl_C32RTOMB_SANITYCHECK]) AC_REQUIRE([gl_CHECK_FUNC_C32RTOMB]) if test $gl_cv_func_c32rtomb = no; then HAVE_C32RTOMB=0 else dnl When we override mbrtoc32, redefining the meaning of the char32_t dnl values, we need to override c32rtomb as well, for consistency. if test $HAVE_WORKING_MBRTOC32 = 0; then REPLACE_C32RTOMB=1 fi AC_CACHE_CHECK([whether c32rtomb return value is correct], [gl_cv_func_c32rtomb_retval], [ dnl Initial guess, used when cross-compiling. changequote(,)dnl case "$host_os" in # Guess no on AIX. aix*) gl_cv_func_c32rtomb_retval="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_c32rtomb_retval="guessing yes" ;; esac changequote([,])dnl AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #ifdef __HAIKU__ #include #endif #include int main () { int result = 0; if (c32rtomb (NULL, 0, NULL) != 1) result |= 1; return result; }]])], [gl_cv_func_c32rtomb_retval=yes], [gl_cv_func_c32rtomb_retval=no], [:]) ]) case "$gl_cv_func_c32rtomb_retval" in *yes) ;; *) AC_DEFINE([C32RTOMB_RETVAL_BUG], [1], [Define if the c32rtomb function has an incorrect return value.]) REPLACE_C32RTOMB=1 ;; esac if test $HAVE_WORKING_C32RTOMB = 0; then REPLACE_C32RTOMB=1 fi fi ]) AC_DEFUN([gl_CHECK_FUNC_C32RTOMB], [ dnl Cf. gl_CHECK_FUNCS_ANDROID AC_CHECK_DECL([c32rtomb], , , [[#ifdef __HAIKU__ #include #endif #include ]]) if test $ac_cv_have_decl_c32rtomb = yes; then dnl We can't use AC_CHECK_FUNC here, because c32rtomb() is defined as a dnl static inline function on Haiku 2020. AC_CACHE_CHECK([for c32rtomb], [gl_cv_func_c32rtomb], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include #ifdef __HAIKU__ #include #endif #include ]], [[char buf[8]; return c32rtomb (buf, 0, NULL) == 0; ]]) ], [gl_cv_func_c32rtomb=yes], [gl_cv_func_c32rtomb=no]) ]) else gl_cv_func_c32rtomb=no fi ]) dnl Test whether c32rtomb works not worse than wcrtomb. dnl Result is HAVE_WORKING_C32RTOMB. AC_DEFUN([gl_C32RTOMB_SANITYCHECK], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([gl_TYPE_CHAR32_T]) AC_REQUIRE([gl_CHECK_FUNC_C32RTOMB]) AC_REQUIRE([gt_LOCALE_ZH_CN]) AC_REQUIRE([AC_CANONICAL_HOST]) if test $GNULIBHEADERS_OVERRIDE_CHAR32_T = 1 || test $gl_cv_func_c32rtomb = no; then HAVE_WORKING_C32RTOMB=0 else AC_CACHE_CHECK([whether c32rtomb works as well as wcrtomb], [gl_cv_func_c32rtomb_sanitycheck], [ dnl Initial guess, used when cross-compiling or when no suitable locale dnl is present. changequote(,)dnl case "$host_os" in # Guess no on Solaris derivatives. solaris*) if test -f /etc/release && grep 'Oracle Solaris' /etc/release >/dev/null; then gl_cv_func_c32rtomb_sanitycheck="guessing yes" else gl_cv_func_c32rtomb_sanitycheck="guessing no" fi ;; # Guess yes otherwise. *) gl_cv_func_c32rtomb_sanitycheck="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_ZH_CN != none; then AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include #include #include #ifdef __HAIKU__ #include #endif #include int main () { int result = 0; /* This fails on Solaris 11 OmniOS: c32rtomb returns (size_t)-1. wcrtomb returns 4 (correct). */ if (strcmp ("$LOCALE_ZH_CN", "none") != 0 && setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) { mbstate_t state; wchar_t wc = (wchar_t) 0xBADFACE; char buf[16]; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, "\201\060\211\070", 4, &state) == 4 && wcrtomb (buf, wc, NULL) == 4 && memcmp (buf, "\201\060\211\070", 4) == 0) { char32_t c32 = (wchar_t) 0xBADFACE; memset (&state, '\0', sizeof (mbstate_t)); if (mbrtoc32 (&c32, "\201\060\211\070", 4, &state) == 4 && c32rtomb (buf, c32, NULL) != 4) result |= 1; } } return result; }]])], [gl_cv_func_c32rtomb_sanitycheck=yes], [gl_cv_func_c32rtomb_sanitycheck=no], [:]) fi ]) case "$gl_cv_func_c32rtomb_sanitycheck" in *yes) HAVE_WORKING_C32RTOMB=1 AC_DEFINE([HAVE_WORKING_C32RTOMB], [1], [Define if the c32rtomb function basically works.]) ;; *) HAVE_WORKING_C32RTOMB=0 ;; esac fi AC_SUBST([HAVE_WORKING_C32RTOMB]) ]) groff-1.24.1/gnulib_m4/memmem.m40000644000175000017500000001154615153275164013242 00000000000000# memmem.m4 # serial 30 dnl Copyright (C) 2002-2004, 2007-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl Check that memmem is present and functional. AC_DEFUN([gl_FUNC_MEMMEM_SIMPLE], [ dnl Persuade glibc to declare memmem(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gl_STRING_H_DEFAULTS]) AC_CHECK_FUNCS([memmem]) if test $ac_cv_func_memmem = yes; then HAVE_MEMMEM=1 else HAVE_MEMMEM=0 fi AC_CHECK_DECLS_ONCE([memmem]) if test $ac_cv_have_decl_memmem = no; then HAVE_DECL_MEMMEM=0 else dnl Detect https://sourceware.org/PR12092. dnl Also check that we handle empty needles correctly. AC_CACHE_CHECK([whether memmem works], [gl_cv_func_memmem_works_always], [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include /* for memmem */ #define P "_EF_BF_BD" #define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P #define NEEDLE P P P P P ]], [[ int result = 0; if (memmem (HAYSTACK, strlen (HAYSTACK), NEEDLE, strlen (NEEDLE))) result |= 1; /* Check for empty needle behavior. */ { const char *haystack = "AAA"; if (memmem (haystack, 3, (const char *) 1, 0) != haystack) result |= 2; } return result; ]])], [gl_cv_func_memmem_works_always=yes], [gl_cv_func_memmem_works_always=no], [dnl glibc 2.9..2.12 and cygwin 1.7.7 have issue #12092 above. dnl Also empty needles work on glibc >= 2.1 and cygwin >= 1.7.0. dnl uClibc is not affected, since it uses different source code. dnl Assume that it works on all other platforms (even if not linear). AC_EGREP_CPP([Lucky user], [ #include /* for __GNU_LIBRARY__ */ #ifdef __GNU_LIBRARY__ #include #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \ || __GLIBC_MINOR__ > 12)) \ || (__GLIBC__ > 2)) \ || defined __UCLIBC__ Lucky user #endif #elif defined __CYGWIN__ #include #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7) Lucky user #endif #else Lucky user #endif ], [gl_cv_func_memmem_works_always="guessing yes"], [gl_cv_func_memmem_works_always="$gl_cross_guess_normal"]) ]) ]) case "$gl_cv_func_memmem_works_always" in *yes) ;; *) REPLACE_MEMMEM=1 ;; esac fi gl_PREREQ_MEMMEM ]) # gl_FUNC_MEMMEM_SIMPLE dnl Additionally, check that memmem has linear performance characteristics AC_DEFUN([gl_FUNC_MEMMEM], [ AC_REQUIRE([gl_FUNC_MEMMEM_SIMPLE]) if test $HAVE_DECL_MEMMEM = 1 && test $REPLACE_MEMMEM = 0; then AC_CACHE_CHECK([whether memmem works in linear time], [gl_cv_func_memmem_works_fast], [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include /* for signal */ #include /* for memmem */ #include /* for malloc */ #include /* for alarm */ static void quit (int sig) { _exit (sig + 128); } ]], [[ int result = 0; size_t m = 1000000; char *haystack = (char *) malloc (2 * m + 1); char *needle = (char *) malloc (m + 1); /* Failure to compile this test due to missing alarm is okay, since all such platforms (mingw, MSVC) also lack memmem. */ signal (SIGALRM, quit); alarm (5); /* Check for quadratic performance. */ if (haystack && needle) { memset (haystack, 'A', 2 * m); haystack[2 * m] = 'B'; memset (needle, 'A', m); needle[m] = 'B'; if (!memmem (haystack, 2 * m + 1, needle, m + 1)) result |= 1; } /* Free allocated memory, in case some sanitizer is watching. */ free (haystack); free (needle); return result; ]])], [gl_cv_func_memmem_works_fast=yes], [gl_cv_func_memmem_works_fast=no], [dnl Only glibc >= 2.9 and cygwin > 1.7.0 are known to have a dnl memmem that works in linear time. AC_EGREP_CPP([Lucky user], [ #include #ifdef __GNU_LIBRARY__ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 9) || (__GLIBC__ > 2)) \ && !defined __UCLIBC__ Lucky user #endif #endif #ifdef __CYGWIN__ #include #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 0) Lucky user #endif #endif ], [gl_cv_func_memmem_works_fast="guessing yes"], [gl_cv_func_memmem_works_fast="$gl_cross_guess_normal"]) ]) ]) case "$gl_cv_func_memmem_works_fast" in *yes) ;; *) REPLACE_MEMMEM=1 ;; esac fi ]) # gl_FUNC_MEMMEM # Prerequisites of lib/memmem.c. AC_DEFUN([gl_PREREQ_MEMMEM], [:]) groff-1.24.1/gnulib_m4/fcntl_h.m40000644000175000017500000000547415153275164013405 00000000000000# fcntl_h.m4 # serial 21 dnl Copyright (C) 2006-2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. # Configure fcntl.h. dnl Written by Paul Eggert. AC_DEFUN_ONCE([gl_FCNTL_H], [ AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) AC_REQUIRE([gl_FCNTL_O_FLAGS]) gl_NEXT_HEADERS([fcntl.h]) dnl Ensure the type pid_t gets defined. AC_REQUIRE([AC_TYPE_PID_T]) dnl Ensure the type mode_t gets defined. AC_REQUIRE([AC_TYPE_MODE_T]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use, if it is not common dnl enough to be declared everywhere. gl_WARN_ON_USE_PREPARE([[#include ]], [fcntl openat openat2]) ]) # gl_FCNTL_MODULE_INDICATOR([modulename]) # sets the shell variable that indicates the presence of the given module # to a C preprocessor expression that will evaluate to 1. # This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_FCNTL_MODULE_INDICATOR], [ dnl Ensure to expand the default settings once only. gl_FCNTL_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$1]) dnl Define it also as a C macro, for the benefit of the unit tests. gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) # Initializes the default values for AC_SUBSTed shell variables. # This macro must not be AC_REQUIREd. It must only be invoked, and only # outside of macros or in macros that are not AC_REQUIREd. AC_DEFUN([gl_FCNTL_H_REQUIRE_DEFAULTS], [ m4_defun(GL_MODULE_INDICATOR_PREFIX[_FCNTL_H_MODULE_INDICATOR_DEFAULTS], [ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CREAT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCNTL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NONBLOCKING]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OPEN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OPENAT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OPENAT2]) dnl Support Microsoft deprecated alias function names by default. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_CREAT], [1]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_OPEN], [1]) ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_FCNTL_H_MODULE_INDICATOR_DEFAULTS]) AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) ]) AC_DEFUN([gl_FCNTL_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. HAVE_FCNTL=1; AC_SUBST([HAVE_FCNTL]) HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT]) HAVE_OPENAT2=0; AC_SUBST([HAVE_OPENAT2]) REPLACE_CREAT=0; AC_SUBST([REPLACE_CREAT]) REPLACE_FCNTL=0; AC_SUBST([REPLACE_FCNTL]) REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN]) REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT]) ]) groff-1.24.1/gnulib_m4/zzgnulib.m40000644000175000017500000000161215153275164013622 00000000000000# zzgnulib.m4 # serial 1 dnl Copyright (C) 2020-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This file is offered as-is, without any warranty. dnl This file must be named something that sorts after all other dnl package- or gnulib-provided .m4 files - at least for those packages dnl that redefine AC_PROG_CC. dnl Redefine AC_PROG_CC so that it ends with invocations of gl_COMPILER_CLANG dnl and gl_COMPILER_PREPARE_CHECK_DECL. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[ gl_COMPILER_CLANG gl_COMPILER_PREPARE_CHECK_DECL ]) # gl_ZZGNULIB # ----------- # Witness macro that this file has been included. Needed to force # Automake to include this file after all other gnulib .m4 files. AC_DEFUN([gl_ZZGNULIB]) groff-1.24.1/LGPLv30000644000175000017500000001674415155205667010605 00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. groff-1.24.1/ChangeLog.old0000644000175000017500000060132515155205667012175 00000000000000Sun Nov 26 11:45:13 1995 James Clark * Version 1.10 released. Fri Nov 24 09:56:16 1995 James Clark * afmtodit/afmtodit.pl: Avoid comment on first line. Mon Nov 20 11:13:49 1995 James Clark * aclocal.m4 (GROFF_INSTALL_SH): New macro. * configure.in: Call it. * Makefile.sub (configure): Depends on aclocal.m4 not acgroff.m4. (distfiles): Doesn't depend on config.log or config.cache. Sun Oct 1 08:45:36 1995 James Clark * grog/grog.sh: Use print "" rather than print in END rule. Wed Aug 23 13:30:52 1995 James Clark * tbl/main.cc (process_data): Don't give error for excess data entries that are comments. Fri Jul 28 11:00:27 1995 James Clark * tbl/main.cc (process_data): Fix case where new for-scope rules silently change meaning of code. Tue Jul 4 23:39:51 1995 James Clark * troff/env.cc (hyphenate): Loop over all consecutive sequences of non-zero hyphenation codes. Sat Jul 1 00:42:15 1995 James Clark * aclocal.m4 (GROFF_POSIX): Use conflicting declaration technique. Thu Jun 29 13:58:36 1995 James Clark * tmac/tmac.e (ip): Divert the tag so as to freeze the spaces. Tue Jun 27 12:30:16 1995 James Clark * tmac/tmac.andoc: Make it work in compatibility mode. * refer/token.h (token_info::is_range_sep): New function. * refer/token.cc (init_special_chars): Make \(en a RANGE_SEP. * refer/ref.cc (reference::output): More sophisticated check for multiple pages. * devps/prologue.ps (MANUAL): New procedure. * grops/ps.cc (main): New -m option. (usage): Include -m. (ps_printer::~ps_printer): Implement -m. * aclocal.m4 (GROFF_G): New macro. * configure.in: Call it. * Makefile.in (g): Provided by configure. * hpftodit/hpftodit.cc (basename): Rename to xbasename. * tmac/tmac.tty: Disable warning about bad fonts. Remove font translations. * Makefile.in (tmacpath): Don't include /usr/lib/tmac. (tmac_m, tmac_s): Deleted. (sys_tmac_prefix, tmac_wrap, tmac_prefix, tmac_an_prefix, tmac_s_prefix): New variables. (MDEFINES): Change accordingly. * Makefile.comm (.man.n): Use new TMAC_* variables. * configure.in (GROFF_TMAC): Call. * aclocal.m4 (GROFF_TMAC): Define. * tmac/Makefile.sub (stamp_wrap): New target. (install_data, uninstall_sub): Handle macro wrapping. Mon Jun 26 14:54:39 1995 James Clark * tbl/main.cc (main): Ignore -T option. Thu Jun 22 09:08:06 1995 James Clark * devlj4/generate/special.map: Add definition of \(nb. * tmac/tmac.dvi: Add definition of \(nb. * troff/dictionary.c (dictionary::dictionary): association::v gets initialized by association::association. * tmac/Makefile.sub: Avoid using temporary files when installing. * troff/env.cc (environment::set_font): Make bad font number a warning. * Makefile.in (fontpath): Remove $(prefix)/lib/font from fontpath. * Makefile.in (datadir): Use share rather than lib. * groff/groff.cc (basename): Rename to xbasename. Wed Jun 21 16:59:46 1995 James Clark * Makefile (CCLIBS): Don't use. * Makefile.ccpg: Likewise. * acgroff.m4: Rename to... * aclocal.m4: Modify extensively for autoconf 2. * configure.in: Likewise. * Makefile.in: Likewise. * groff/pipeline.c (const): Declare as empty if __STDC__ not defined. (xstrsignal): Check for definition of NSIG. Conditionalize on SYS_SIGLIST_DECLARED. Make return type const. Sat Jun 10 12:28:16 1995 James Clark * troff/input.cc (interpolate_macro): Rephrase missing space warning. Thu May 11 01:07:16 1995 Jason Merrill * addftinfo/addftinfo.cc, eqn/delim.cc, eqn/lex.cc, eqn/list.cc, grodvi/dvi.cc, groff/groff.cc, grops/ps.cc, grops/psrm.cc, grotty/tty.cc, include/ptable.h indxbib/indxbib.cc, libbib/index.cc, libbib/linear.cc, libbib/search.cc, libdriver/input.cc, libdriver/printer.cc, libgroff/font.cc, libgroff/lf.cc, libgroff/nametoindex.cc, libgroff/ptable.cc, libgroff/string.cc, lkbib/lkbib.cc, lookbib/lookbib.cc, pic/lex.cc, pic/object.cc, pic/pic.y refer/label.y refer/ref.cc, refer/refer.cc, refer/token.cc, tbl/main.cc, tbl/table.cc, tfmtodit/tfmtodit.cc, troff/dictionary.cc, troff/div.cc, troff/env.cc, troff/input.cc, troff/node.cc, troff/symbol.cc: Fix 'for' scoping. Wed Apr 19 21:15:11 1995 James Clark * troff/input.cc (spring_trap): Push a macro_iterator rather than a string_iterator. (spring_trap, postpone_traps, unpostpone_traps): Move to later in file. (macro_iterator::macro_iterator): Add additional argument. Mon Apr 10 12:06:02 1995 James Clark * troff/div.cc (vertical_size::vertical_size): In place of integer specifying line spacing use cunits specifying post vertical space. (macro_diversion::output, top_level_diversion::output): Likewise. * troff/div.h: Change declarations accordingly. * troff/env.cc (pending_output_line): Replace ls field by post_vs field. (pending_output_line::pending_output_line, pending_output_line::output, environment::output, environment::output_line, environment::output_title, environment::hyphenate_line): In place of integer specifying line spacing use cunits specifying post vertical space. (environment::environment): Add post_vertical_spacing and prev_post_vertical_spacing arguments. (environment::get_post_vertical_spacing): New function. (environment::total_post_vertical_spacing): New function. (environment::post_vertical_spacing): New function. (init_env_requests): Initialize pvs request and .pvs register. * troff/env.h: Change declarations. Tue Mar 28 09:52:07 1995 James Clark * tmac/tmac.pspic: Immediately remove the temporary file. Sat Mar 25 10:43:11 1995 James Clark * tmac/tmac.pspic (PSPIC): Scale graphic uniformly even when height is specified. Thu Jan 26 16:20:13 1995 James Clark * tbl/table.c (struct vertical rule, class table_entry): Use int not short for start_row and end_row. Fri Jan 13 13:53:05 1995 James Clark * troff/input.cc (trapping_blank_line, blank_line_macro): New functions. (diverted_space_node::reread, process_input_stack): Call trapping_blank_line() rather than blank_line(). (init_input_requests): Bind "blm" to blank_line_macro(). * tmac/tmac.s (XA): Use .br and par@reset rather than XA. Tue Jan 10 11:40:35 1995 James Clark * troff/env.cc (environment::possibly_break_line): Require that width total excluding width of final space node be greater than the target text length. Tue Jan 3 09:13:37 1995 James Clark * troff/node.cc (kern_pair_node::vertical_extent): New function. Sun Dec 4 13:19:07 1994 James Clark * troff/node.cc (charinfo_node): New class. (glyph_node, composite_node): Derive from charinfo_node. Change member functions accordingly. Wed Nov 30 10:29:29 1994 James Clark * nroff/nroff.sh: Use -Tlatin1 not -TLatin1. Mon Aug 8 10:17:59 1994 James Clark (jjc@jclark.com) * tmac/tmac.tty-char: Add definitions for \(ab and \[arrowvertex]. * devps/generate/textmap (notsubset): Add. * tmac/tmac.a4: New file. Sun Jul 24 20:08:42 1994 James Clark (jjc@jclark.com) * pic/main.cc (had_parse_error): New variable. (do_picture, do_whole_file): Set had_parse_error if yyparse() returns non-zero. (main): Return 1 if had_parse_error is true. Tue Jul 19 13:40:31 1994 James Clark (jjc@jclark.com) * grolj4/lj4.cc (main): Avoid use of strtoul. Mon Jul 18 15:03:02 1994 James Clark (jjc@jclark.com) * nroff/nroff.sh: Default device is -Tlatin1 if $LC_CTYPE is iso_8859_1 or $LESSCHARSET is latin1. Sun Jul 10 13:38:35 1994 James Clark (jjc@jclark.com) * hpftodit: New directory. * Makefile.in (CCPROGDIRS): Add hpftodit. * devlj4/generate: New directory. Thu Jul 7 23:49:48 1994 James Clark (jjc@jclark.com) * configure.in: Don't use AC_VFORK. * groff/pipeline.c (run_pipeline): Use fork() always. Wed Jul 6 11:13:17 1994 James Clark (jjc@jclark.com) * grops/ps.cc (main): Use %1 not %s in error message for -w. * Makefile.in (CCPROGDIRS): Add grolj4. (DEVDIRS): Add devlj4. * grolj4, devlj4: New directories. * tmac/troffrc: Handle lj4. * tmac/tmac.lj4: New file. Fri Jun 17 18:02:53 1994 James Clark (jjc@jclark.com) * tmac/tmac.e (@n): Set indent to 0 before calling |h. Wed Jun 1 07:33:47 1994 James Clark (jjc@jclark.com) * troff/input.cc (do_if_request): At end of second string, switch environments before getting next token. Fri May 20 07:39:18 1994 James Clark (jjc@jclark.com) * devps/psstrip.sed: Split rule that strips whitespace on either side of delimiters. Wed May 18 08:13:47 1994 James Clark (jjc@jclark.com) * troff/node.h (font_family::make_definition): Add return value to declaration. * troff/symbol.h (symbol::operator==, symbol::operator!=): Likewise. Tue May 17 20:46:06 1994 James Clark (jjc@jclark.com) * groff/groff.cc (main, help, synopsis): Handle -S. (possible_command::insert_arg): New function. * tmac/tmac.safer: New file. * tmac/msafer.man: New file. * tmac/Makefile.sub (FILES): Add tmac.safer and msafer.man. Thu Mar 10 01:58:30 1994 Paul Eggert (eggert@twinsun.com) * pic/pic.h, pic/main.cc (safer_flag): New variable. * pic/pic.y (placeless_element): Avoid unsafe operations if `safer_flag' is set. * pic/main.cc (main): Add -S option, which sets `safer_flag'. Tue May 10 13:02:31 1994 James Clark (jjc@jclark.com) * eqn/lex.cc (get_token): Put call to add_context() in block to work around Sun C++ 4.0 bug. * include/stringclass.h (operator +): Use ?: instead of `if' to work around Sun C++ 4.0 bug. Thu May 5 11:18:03 1994 James Clark (jjc@jclark.com) * tbl/main.cc (process_format): Accept - as a synonym for the _ key letter. * libbib/index.cc (minus_one): Don't declare as const. Fri Apr 29 09:32:48 1994 James Clark (jjc@jclark.com) * troff/input.cc (get_char_for_escape_name): Push back a newline. Wed Apr 27 21:14:18 1994 James Clark (jjc@jclark.com) * troff/input.cc (write_macro_request): New function. (init_input_requests): Bind write_macro_request to writem. Sun Apr 17 11:15:38 1994 James Clark (jjc@jclark.com) * tmac/tmac.s (@EN): Turn filling back on even if there was no equation. * eqn/lex.cc (do_space): Supply missing argument to lex_error. * tmac/tmac.s (@TS): Renamed from TS. (TS): Call LP then TS again. (cov*ab-init): Alias @TS to TS. * tmac/tmac.s: Allow QP or RS to initialize. * tmac/tmac.s (par@load-init): New macro. Call at end of file. Move initializations of PS and LL here. (par@init): Don't initialize HY. Avoid changing environment 0. (par*env-init): Don't all par@reset. Thu Apr 14 19:15:45 1994 James Clark (jjc@jclark.com) * include/posix.h: Include only if not using . Sun Apr 10 09:54:44 1994 James Clark (jjc@jclark.com) * Makefile.in (MDEFINES): Add LDFLAGS. (LDFLAGS): Add definition line. Thu Apr 7 22:22:22 1994 James Clark (jjc@jclark.com) * troff/input.cc (get_optional_char): Split off error check into... (check_missing_character): New function. * troff/token.h: Declare it. * troff/env.cc (margin_character): Don't call get_optional_char. Only call tok.next() after making the node. * include/lib.h (getopt): Make 2nd argument char *const *. Fri Mar 11 07:28:03 1994 James Clark (jjc@jclark.com) * nroff/conftest.sh: Deleted. Fri Mar 4 10:51:36 1994 James Clark (jjc@jclark.com) * pic/make-dos-dist: Deleted. Wed Mar 2 20:59:16 1994 James Clark (jjc@jclark.com) * devps/psstrip.sed: Strip comments before stripping trailing white space. Sat Feb 19 13:07:16 1994 James Clark (jjc@jclark.com) * Version 1.09 released. Wed Feb 16 16:53:49 1994 James Clark (jjc@jclark.com) * tmac/doc-ditroff (hK): Don't reset page number if \nC is > 0. Mon Feb 14 08:26:40 1994 James Clark (jjc@jclark.com) * libgroff/font.cc (font::load_desc): Fix typo in error message. Sun Feb 13 09:37:38 1994 James Clark (jjc@jclark.com) * libgroff/new.cc (operator new): Rewrite so as to avoid warning about returning without a value. * troff/charinfo.h (charinfo::get_special_translation): Cast TRANSLATE_NONE to int. * refer/token.cc (lookup_token, store_token): Remove bogus loop test. Fix test so that it works with n unsigned. * pic/pic.y (defaults_table): Fully bracket initializer. * pic/lex.cc (lookup_keyword): Likewise. * eqn/lex.cc (token_table, def_table): Likewise. * eqn/box.cc (param_table): Likewise. * troff/input.cc (warning_table): Likewise. * libgroff/font.cc (table): Likewise. * grops/ps.cc (ps_printer::special): Likewise. * grops/psrm.cc (resource_manager::process_file): Likewise. * tfmtodit/tfmtodit.cc (lig_chars, lig_table): Likewise. * refer/command.cc (command_table): Likewise. * addftinfo/addftinfo.cc (param_table): Likewise. * troff/symbol.cc (symbol::symbol): Prevent compiler warnings about temp's being unused. (unused): New function. * groff/pipeline.cc: Declare c_fatal. * libbib/linear.cc (bmpattern::search): Cast patterrn[--j] to uchar. * libbib/index.cc (index_search_item::load): Prevent compiler warnings about fd_closer's being unused. (unused): New function. Sat Feb 12 10:31:59 1994 James Clark (jjc@jclark.com) * troff/input.cc (copy_mode_error): Make `prefix' static. Fix typo. * include/posix.h: Include is HAVE_CC_OSFCN_H is defined. * acgroff.m4, configure.in, Makefile: Rename HAVE_CC_UNISTD_H to HAVE_CC_OSFCN_H and modify accordingly. * troff/input.cc (init_charset_table): radicalex overlaps horizontally. * groff/acgroff.m4 (GROFF_ISC_SYSV3): New macro (from udodo!hans@relay.NL.net). * groff/configure.in: Call it. * groff/acgroff.m4 (GROFF_PCLOSE): New macro. * groff/configure.in: Call it. * include/lib.h: Conditionalize declaration of pclose. * troff/div.cc (last_page_number): New global variable. (top_level_diversion::begin_page): Exit if we just printed the last page. * troff/div.h (last_page_number): Declare it. * troff/input.cc (parse_output_page_list): Set last_page_number. * eqn/sqrt.cc: Rename \(rn to \[radicalex]. * devps/S, devps/textmap, tmac/tmac.ps, tmac/tmac.dvi, tmac/tmac.X: Likewise. * tmac/tmac.ps, tmac/tmac.X, tmac.dvi: Add definitions of \(rn. * tmac.dvi: Make \(ru and \(ul extend beyond their width by .04m. Fri Feb 11 11:45:40 1994 James Clark (jjc@jclark.com) * tmac/doc-ditroff (hK): Remove groff specific code which prevented page-breaks between separate manual entries. If this is the first page, don't set the page number to 1. * acgroff.m4 (GROFF_POSIX): New macro. * configure.in: Use it. * troff/node.cc (class real_output_file, real_output_file::real_output_file, real_output_file::~real_output_file): Conditionalize use of popen/pclose on POPEN_MISSING. * troff/node.h: Conditionalize pipe_command on POPEN_MISSING. * troff/input.cc (pipe_command): Give an error if POPEN_MISSING. (pipe_source): Similarly. * acgroff.m4 (GROFF_PROG_CCC): Update message about libg++. * acgroff.m4 (GROFF_GETOPT, GROFF_PUTENV, GROFF_POPEN): Detect presence of declarations by trying to compile example with conflicting declarations. (gcc only gives a warning for missing declarations.) Wed Feb 9 09:12:23 1994 James Clark (jjc@jclark.com) * tmac/tmac.pspic (PSPIC): Allow options to specify alignment (from Ulrich Lauther). Tue Feb 8 03:56:40 1994 James Clark (jjc@jclark.com) * libbib/linear.cc (file_buffer::load): Use S_ISREG macro. Thu Feb 3 09:34:35 1994 James Clark (jjc@jclark.com) * indxbib/indxbib.cc (write_hash_table): Add code for case where pointers and ints have different sizes. Sun Jan 9 16:17:51 1994 James Clark (jjc@jclark.com) * tmac/tmac.s (par*env-init): Call par@reset. Fri Jan 7 10:24:27 1994 James Clark (jjc@jclark.com) * tmac/tmac.s (@IP): Switch to a new environment when diverting tag. (par*push-tag-env, par*pop-tag-env): New macros. Wed Jan 5 21:18:34 1994 James Clark (jjc@jclark.com) * grops/ps.cc (ps_printer::ps_printer): Use MAX_LINE_LENGTH for initializing `out'. Reduce MAX_LINE_LENGTH from 79 to 72. * grops/ps.cc (ps_printer::~ps_printer): Output %%CreationDate comment. Include . Wed Dec 15 14:14:00 1993 James Clark (jjc@jclark.com) * grops/ps.cc (is_small_h, is_small_v): Deleted. (ps_printer::flush_sbuf): Use absolute motion only at beginning of lines. Tue Dec 14 10:06:34 1993 James Clark (jjc@jclark.com) * troff/input.cc (read_request): Only print a prompt if reading from the terminal. Also clearerr on EOF if reading from the terminal. Declare isatty. Mon Nov 29 08:38:15 1993 James Clark (jjc@jclark.com) * refer/label.y: Rename map_t to map_func and extractor_t to extractor_func. Sat Oct 30 06:38:12 1993 James Clark (jjc@jclark.com) * include/assert.h: Don't use volatile. * libgroff/assert.cc: Likewise. Fri Oct 29 15:00:23 1993 James Clark (jjc@jclark.com) * troff/input.cc (abort_request): Look at character in tok before calling get_copy(). Thu Oct 28 14:09:48 1993 James Clark (jjc@jclark.com) * troff/troff.h (NO_RETURN): Deleted. * troff/div.cc (cleanup_and_exit): Don't declare aas NO_RETURN. * troff/input.cc (exit_troff): Likewise * Makefile.in: Remove `Making ...' messages since GNU make now gives these. * configure.in: Use AC_HAVE_HEADERS(unistd.h) instead of AC_UNISTD_H. Wed Oct 27 11:12:51 1993 James Clark (jjc@jclark.com) * tmac/tmac.s (@init): Initialize PO to \n(.o here, rather than to constant 1 inch. Sat Oct 23 10:03:52 1993 James Clark (jjc@jclark.com) * tmac/tmac.e (hl): Use \n[.in] rather than \n(.i. Thu Oct 14 12:09:45 1993 James Clark (jjc@jclark.com) * eqn/delim.cc (delim_box::compute_metrics): Don't increase MARK_REG if there was no left delimiter. Sat Oct 2 19:54:47 1993 James Clark (jjc@jclark.com) * pic/troff.cc (troff_output::text): Set line thickness to relative before outputting text. * tmac/tmac.e (@k): Don't zero ?T. ((z): Likewise. Sat Sep 25 11:08:43 1993 James Clark (jjc@jclark.com) * tmac/tmac.e ($p): Handle possibility that $3 is empty. Wed Aug 18 08:51:41 1993 James Clark (jjc@jclark.com) * troff/input.cc (decode_args): Warn about unquoted tabs (from Paul Eggert). Tue Aug 10 08:38:32 1993 James Clark (jjc@jclark.com) * troff/input.cc (ignoring): New variable. (ignore): Set ignoring during call to do_define_macro. (do_define_macro): Clear ignoring before interpolating terminating macro. (copy_mode_error): New function. (get_char_for_escape_name, read_long_escape_name, interpolate_arg): Use copy_mode_error. (warning_table): Add WARN_IG. * troff/troff.h (WARN_IG): Declare. (WARN_TOTAL): Change accordingly. * groff/pipeline.c (strsignal): Rename to xstrsignal. * groff/groff.cc (strsignal): Delete declaration. Fri Jul 16 01:43:12 1993 James Clark (jjc@jclark.com) * troff/div.cc (page_offset): Use 'm' as default scaling. Sat Jul 3 09:11:38 1993 James Clark (jjc@jclark.com) * nroff/nroff.sh: Ignore -u. Wed Jun 9 12:17:27 1993 James Clark (jjc@jclark.com) * Makefile.in (MDEFINES): Pass down MAKEOVERRIDES. Fri Jun 4 17:35:47 1993 James Clark (jjc@jclark.com) * tmac/tmac.s (par*box-draw): Set adjustment mode to l while drawing box. (B2): With -Tascii, leave additional vertical space before and after. Ensure that the left and right indent is restored to what it was even if the point size changes. Don't call par@finish. Change the indent, line length and title length directly. With -Tascii, make the width of the box 1n less. (B1): Remember 1n at the current point size. Don't call par@reset. Change the indent, line length and title length directly. Ensure that the temporary indent is preserved. (par*box-mark-top): Turn off no spacing mode. Thu Jun 3 17:47:14 1993 James Clark (jjc@jclark.com) * Makefile.in (dist): Use .gz suffix. Thu May 27 20:04:59 1993 James Clark (jjc@jclark.com) * troff/input.cc (main): Add return 0. * pic/main.cc (main): Use return instead of exit. * tbl/main.cc (main): Likewise. * eqn/main.cc (main): Likewise. * grops/ps.cc (main): Likewise. * grotty/tty.cc (main): Likewise. * groff/groff.cc (main): Likewise. * grodvi/dvi.cc (main): Likewise. * refer/refer.cc (main): Likewise. * indxbib/indxbib.cc (main): Likewise. * lkbib/lkbib.cc (main): Likewise. * soelim/soelim.cc (main): Likewise. * addftinfo/addftinfo.cc (main): Likewise. * acgroff.m4 (GROFF_PROG_CCC, GROFF_CC_COMPILE_CHECK, GROFF_COOKIE_BUG, GROFF_CC_ANSI_BUG): Likewise. * troff/token.h (process_input_stack): Don't declare as static. * troff/input.cc: Likewise. * troff/node.c (invalidate_fontno): Make it a static member of class font_family. Change callers. * troff/node.c: Change declaration. * tbl/main.cc (struct input_entry_format): Add explicit public specifier. * tbl/table.cc (struct text_stuff, struct single_hline_stuff, struct double_hline_stuff): Likewise. * tbl/table.h (struct entry_format): Likewise. * pic/object.h (struct saved_state): Likewise. * include/stringclass.h: Add forward declarations of friend functions that are later declared as inline. Don't include inline specifier in friend declaration. * libgroff/lib.h: Declare popen and pclose. * acgroff.m4 (GROFF_POPEN): New macro. * configure.in: Call it. * include/lib.h (PI): New constant. Undef first if necessary. * tfmtodit/tfmtodit.cc (main): Use PI rather than M_PI. * grops/ps.cc (degrees, radians): Likewise. * libgroff/font.cc (font::get_skew): Likewise. * grops/ps.cc (is_ascii): New function. (ps_output::put_string): Use is_ascii. Use csprint rather than isprint. (ps_printer::define_encoding): Use csspace. * libgroff/strtol.c (ISASCII): New macro. (strtol): Cast arguments to is*() and tolower() to unsigned char. Use ISASCII rather than isascii. * libgroff/cmap.cc: Use isascii() only if defines it. * libgroff/cset.cc: Likewise. * libdriver/input.cc: Include cset.h. (do_file, get_integer, possibly_get_integer): Use csdigit() rather than isdigit(). * refer/refer.cc (main): Use %ld rather than %d for longs. * libbib/index.cc (index_search_item_iterator::get_tag): Use S_ISREG macro. * addftinfo/addftinfo.cc (param_t): Add explicit `int'. Mon May 24 08:51:37 1993 James Clark (jjc@jclark.com) * troff/input.cc (hyphenation_code): Skip white space between char/code pairs. Sun May 16 08:15:52 1993 James Clark (jjc at jclark.com) * tbl/table.h (table::entry_list_tailp): New member. (table::table): Initialize it. (table::add_entry): Use entry_list_tailp to avoid O(n^2) behaviour. Sat May 15 17:26:00 1993 James Clark (jjc at jclark.com) * grotty/tty.cc (tty_printer::add_char): Don't discard characters with negative horizontal positions. Remove casts of glyph::hpos to int. (USHRT_MAX): Delete definition. (SHRT_MAX, SHRT_MIN): New definitions. (glyph::hpos): Change type to short. (tty_printer::end_page): Output multiple backspaces if necessary. Remove casts of glyph::hpos to int. Fri May 7 12:14:37 1993 James Clark (jjc at jclark.com) * tmac/tmac.s (@RT): New definition. Thu May 6 21:36:54 1993 James Clark (jjc at jclark.com) * refer/refer.cc (do_file): Make sure current_filename is set when filename is "-". * pic/common.cc (common_output::dot_line): Handle zero length lines. Sun May 2 19:54:16 1993 James Clark (jjc at jclark.com) * tmac/tmac.s (par@reset): Get value for .hy for \n[HY]. (par@init): Initialize \n[HY]. Mon Apr 26 11:43:16 1993 James Clark (jjc at jclark.com) * troff/dictionary.cc (dictionary::remove): Continue when r < j < i. Sun Apr 25 11:03:00 1993 James Clark (jjc at jclark.com) * Makefile.com (.y.cc): Avoid ending up with two versions of $(YTABH). Thu Apr 22 21:03:45 1993 James Clark (jjc at jclark.com) * tmac/tmac.dvi (\(,c): Define only if it does not exist. (\(,C): Likewise. Also fix typo. Wed Apr 21 08:47:32 1993 James Clark (jjc at jclark.com) * lib.h: Delete extraneous semi-colon. * Add pso request: `so' from a pipe. * troff/input.c (file_iterator::file_iterator): Add 3rd argument. (file_iterator::close): New function. (file_iterator::~file_iterator, file_iterator::next_file): Use file_iterator::close. (file_iterator::backtrace): Say `process' rather than `file' when the stream is popened. (pipe_source): New function. (init_input_requests): Bind ".pso" to pipe_source. Tue Apr 20 00:02:26 1993 James Clark (jjc at jclark.com) * afmtodit/afmtodit.pl: Avoid single quotes in comments. * pfbtops/pfbtops.c: Output 64 characters per line. Output hex digits in lower case. Mon Apr 19 09:55:57 1993 James Clark (jjc at jclark) * Version 1.08 released. * Makefile.in (dist): Insert || true after ln -s commands that might fail. * mm: Update to mm 1.16. * acgroff.m4 (GROFF_CSH_HACK): New macro. * configure.in: Call GROFF_CSH_HACK. Substitute for SH_SCRIPT_SED_CMD. * Makefile.in (SH_SCRIPT_SED_CMD): New variable. Include in MDEFINES. * nroff/Makefile.sub (nroff): New target. (install_data): Install nroff. * eqn/Makefile.sub (neqn): Sed with SH_SCRIPT_SED_CMD. * grog/Makefile.sub (grog): Sed grog.sh with SH_SCRIPT_SED_CMD. Sat Apr 17 08:24:28 1993 James Clark (jjc at jclark) * eqn/Makefile.sub (neqn): Add chmod +x. * grog/Makefile.sub (grog): Remove spurious semi-colon. Fri Apr 16 22:41:57 1993 James Clark (jjc at jclark) * troff/input.cc (string_iterator::string_iterator()): Initialize lineno and count. Tue Apr 13 10:22:28 1993 James Clark (jjc at jclark) * troff/div.cc (macro_diversion::space, top_level_diversion::space): Don't set high_water_mark. (macro_diversion::output, top_level_diversion::output): Don't include post line space in high water mark. Wed Apr 7 12:48:18 1993 James Clark (jjc at jclark) * eqn/eqn.y: Don't define YYDEBUG. * pic/pic.y: Likewise. Mon Apr 5 10:15:15 1993 James Clark (jjc at jclark) * tmac/tmac.e ([3): Add space after comma following editors. Change double spaces to single spaces. ([4): Change double spaces to single spaces. * grops/ps.h (USE_PS_ADOBE_2_0): New flag for broken_flags. * grops/ps.cc (ps_printer::~ps_printer): If the USE_PS_ADOBE_2_0 bit is set in broken_flags, use 2.0 rather than 3.0 as the version after %!PS-Adobe- (for Newsprint). * troff/div.cc (top_level_diversion::begin_page): When before_first_page is 1, set page_number to 1. Sun Apr 4 14:28:53 1993 James Clark (jjc at jclark) * eqn/box.cc (box::top_level): Protect equation with \&. Sat Apr 3 23:27:25 1993 James Clark (jjc at jclark) * groff/groff.cc (possible_command::set_name): Delete old name. * groff/groff.cc (possible_command::~possible_command): Use a_delete. * troff/node.cc (troff_output_file::begun_page): New member. (troff_output_file::troff_output_file): Initialize it. (troff_output_file::really_begin_page): Only output V command if a page has been begun. * pic/pic.y (placeless_element): Delete argument to PRINT after use. Fri Apr 2 11:31:02 1993 James Clark (jjc at jclark) * Make wrapman work. * troff/div.h (class top_level_diversion): Replace first_page_begun by before_first_page (with opposite sense). * Change first_page_begun to before_first_page inverting sense. * troff/div.cc (class nl_reg): New class. (init_div_requests): Use class nl_reg for \n(nl. (top_level_diversion::begin_page): Don't call output_file::begin_page if before_first_page is 2; reset before_first_page afterwards. If have_next_page_number is false, then always increment page_number. * tmac/tmac.an: Set traps within TH rather than at the top-level. Restore compatibility mode after loading, and then disable compatibility mode in TH. Thu Apr 1 11:09:34 1993 James Clark (jjc at jclark) * grotty/tty.cc (tty_printer::end_page): Don't discard characters past last line. * troff/node.h (output_file::trailer): Declare. * troff/div.cc (cleanup_and_exit): Call output_file::trailer(). * troff/node.cc (output_file::trailer): New function. (troff_output_file::~troff_output_file): Move most code into... (troff_output_file::trailer): New function. (class troff_output_file): Delete page_length member. Declare trailer(). (troff_output_file::really_begin_page): Use current page length for final V command. * tbl/main.cc (struct options): New decimal_point_char member. (options::options): Initialize this. (process_options): Implement decimalpoint option. (process_data): Pass decimal_point_char option to table::table. * tbl/table.h (class table): New decimal_point_char member. (table::table): Add additional argument. * tbl/table.cc (find_dot): Rename to find_decimal_point. Add second argument specifying decimal point character. Use this instead of '.'. (table::table): Initialize decimal_point_char. (table::add_entry): Change call to find_dot. * troff/input.cc (get_copy, token::next): Implement \V. (interpolate_environment_variable): New function. Tue Mar 30 14:41:39 1993 James Clark (jjc at jclark) * pic/lex.cc (lookup_keyword): Rename MIN to K_MIN, MAX to K_MAX. * pic/pic.y: Likewise. * grotty/tty.cc (tty_printer::add_char, tty_printer::end_page): Add casts to int. * refer/ref.cc (reference::insert_field, reference::delete_field): Likewise. * troff/number.cc (parse_term): Likewise. * acgroff.m4 (GROFF_PROG_YACC): New macro. * configure.in: Use GROFF_PROG_YACC. * acgroff.m4 (GROFF_PROG_CCC): Don't add -O automatically for gcc and g++. * Makefile.in (OPTIMIZE): New define. (DEBUG): Empty by default. (CCFLAGS, CFLAGS): Include $(OPTIMIZE). * acgroff.m4 (GROFF_SYS_SIGLIST): Don't quote program. (GROFF_ARRAY_DELETE): Likewise. (GROFF_CC_COMPILE_CHECK): Quote use of $2 and $3. * troff/env.cc (trie::~trie): Make virtual to shut up g++. * devps/psstrip.sed: Use different delimiter on last line (so that it works with BSD 4.4 sed.) Mon Mar 29 17:07:14 1993 James Clark (jjc at jclark) * devps/psstrip.sed: Delete comments. * acgroff.m4 (AC_GETOPT): Don't test whether declares optind, opterr, optarg. * lib.h: When UNISTD_H_DECLARES_GETOPT is defined, declare optind, opterr, optarg. Sun Mar 28 17:44:25 1993 James Clark (jjc at jclark) * Makefile.in (check): Dummy target. Wed Mar 3 04:53:38 1993 James Clark (jjc at jclark) * Version 1.07 released. * Integrate mm 1.11. * tbl/table.cc (alphabetic_block_entry::print): start_row was used where start_col was meant. Thu Feb 25 07:55:36 1993 James Clark (jjc at jclark) * grog/grog.sh, grog/grog.pl: Recognize PH and SA as -mm macros. Wed Feb 24 10:15:34 1993 James Clark (jjc at jclark) * troff/input.cc (token::next): Make \z\o'...' and similar things work. * env.h (MARGIN_CHARACTER_ON, MARGIN_CHARACTER_NEXT): New constants. (environment): Add margin_character_flags member. * env.cc (environment::environment(symbol), environment::environment(const environment *): Initialize margin_character_flags. (margin_character): Rewrite. (environment::output_line): Add a margin character if margin_character_flags is non-zero. Turn off the MARGIN_CHARACTER_NEXT bit. If that makes margin_character_flags zero, use margin_character_node without copying and then set margin_character_node to 0. * devps/DESC.in: Change minimum size to 1000. Tue Feb 23 14:57:49 1993 James Clark (jjc at jclark) * troff/symbol.h (symbol::hash): Change return type to unsigned long. * troff/dictionary.cc (dictionary::lookup, dictionary::remove): Add casts to int. * test-groff: Use -r rather than -x. * grops/psfig.diff: Include in distribution again. Mon Feb 22 09:10:44 1993 James Clark (jjc at jclark) * Makefile.in (dist): Use gzip. Sun Feb 21 11:12:53 1993 James Clark (jjc at jclark) * acgroff.m4 (GROFF_GETOPT): Check for declaration of getopt() in unistd.h as well as in stdlib.h. * include/lib.h: Include is STDLIB_H_DECLARES_GETOPT is defined; otherwise include and if UNISTD_H_DECLARES_GETOPT is defined. * configure.in: use builtin(include, ... rather than include(... * configure: Regenerate with autoconf 1.3. * libdriver/print.cc (printer::adjust_arc_center): Use new algorithm suggested by Andy Fyfe. * libdriver/printer.cc (printer::adjust_arc_center): New function. * include/printer.h: Declare this. * grops/ps.cc (ps_printer::draw): Use it. * grodvi/dvi.cc (dvi_printer::draw): Use it. Fri Feb 19 23:13:51 1993 James Clark (jjc at jclark) * Makefile.comm (.man.n): Replace macrodir by tmacdir. Thu Feb 11 16:46:59 1993 James Clark (jjc at jclark) * eqn/main.cc (main): Handle "eqn -". Mon Jan 4 20:29:56 1993 James Clark (jjc at jclark) * tmac/tmac.e (++): Install fix from comp.bugs.4sd. * mm: Integrate version 1.08. * pic/troff.cc (troff_output::finish_picture): Set EQN_NO_EXTRA_SPACE reg to 0 rather than removing it. * eqn/box.cc (box::extra_space): Set EQN_NO_EXTRA_SPACE_REG to 0 if it's not defined. Check whether the register is non-zero rather than whether it's not defined. * tmac.e ({, <): Make argument to \x zero if \n(0x is non-zero. * indxbib/indxbib.cc: Move all signal handling into... * indxbib/signal.c: New file. * configure.in: Call AC_RETSIGTYPE. * acgroff.m4 (GROFF_STRUCT_EXCEPTION): New macro. * configure.in: Call GROFF_STRUCT_EXCEPTION. * libgroff/matherr.c: Protect with ifdef HAVE_STRUCT_EXCEPTION. * troff/input.cc (token::token, token::operator=): Work round SGI C++ bug. * pic/object.cc (position::position): Likewise. Mon Dec 28 21:50:21 1992 James Clark (jjc at jclark) * pic/pic.h: Move declaration of hypot(). Wed Dec 16 12:28:29 1992 James Clark (jjc at jclark) * pic/pic.h: Declare hypot(). * pic/pic.h: Define M_PI if necessary. Thu Dec 10 12:03:29 1992 James Clark (jjc at jclark) * tmac/tmac.e (re): Add alternative version that doesn't use groff `.ta T' feature. * devps/prologue.ps (RE): Handle the possibility that the old font doesn't have a FontName entry. Wed Dec 2 10:25:29 1992 James Clark (jjc at jclark) * tmac/tmac.e (fam): Redefine to set family in environment 2. (@C): Use @fam not fam. Thu Nov 26 16:01:25 1992 James Clark (jjc at jclark) * lookbib/lookbib.cc (main): Change type of start to const char *. * lkbib/lkbib.cc (main): Likewise. * eqn/lex.cc (definition::definition): Don't use member initializer syntax for members of anonymous unions. * troff/input.cc (input_stack::backtrace): Change type of to const char *. Wed Nov 25 13:43:09 1992 James Clark (jjc at jclark) * include/stringclass.h (class string): Declare inline friend functions as inline in class declaration. * troff/hvunits.h (class hunits, class vunits): Likewise. * include/refid.h (class reference_id): Likewise * troff/troff.h (points_to_units(units), scale(units, double)): Delete declarations. * libdriver/input.cc (get_char): Delete declaration. * include/lib.h: Change 2nd argument of getopt from const char ** to char **. * troff/symbol.cc (symbol::symbol): Cast `new char *[n]' to `const char **' before assigning to a `const char **'. * tbl/table.cc: Delete extra declarations of prints(). Tue Nov 24 14:33:13 1992 James Clark (jjc at jclark) * libgroff/font.cc (font::load_desc): Cast `new char *[n]' to `const char **' before assigning to a `const char **'. * libgroff/errarg.cc (errarg::errarg): Don't use member initializer syntax for members of anonymous unions. Sat Nov 21 05:02:23 1992 James Clark (jjc at jclark) * mm: Integrate version 1.07. Tue Nov 17 16:44:27 1992 James Clark (jjc at jclark) * troff/input.c (translate2): Rename to (translate_no_transparent). (init_input_requests): Rename tr2 to trnt. Mon Nov 16 09:49:32 1992 James Clark (jjc at jclark) * troff/charinfo.h (class charinfo): Add transparent_translate field. (charinfo::set_translation, charinfo::set_special_translation): Add second argument that specifies value for transparent_translate. (charinfo::get_translation, charinfo::get_special_translation): Add optional second argument that specifies whether translation is being used for transparent throughput. * troff/input.cc (charinfo::set_translation, charinfo::set_special_translation): Handle second argument. (charinfo::charinfo): Initialize transparent_translate. (translate): Split main part off into (do_translate): New function. Pass argument saying whether translation applies to transparent throughput. (translate2): New request. (init_input_requests): Bind translate2 to `tr2'. Wed Nov 11 11:43:20 1992 James Clark (jjc at jclark) * tbl/table.h (class table): Add `nokeep' flag. * tbl/main.cc (process_options): Handle `nokeep' option. * tbl/table.cc (table::init_output, table::do_row, table::do_top, table::do_bottom): Don't output keep/release macro definitions or calls when `nokeep' option has been specified. Sat Nov 7 01:28:33 1992 James Clark (jjc at jclark) * tmac/tmac.Xps (Xps-char): Use " as delimiter for \Z. Wed Nov 4 16:29:04 1992 James Clark (jjc at jclark) * tbl/table.cc (table_entry::divert, block_entry::do_divert, block_entry::divert, alphabetic_block_entry::divert): Add extra argument giving column separation. (table::compute_widths): Pass column separation to table_entry::divert(). (block_entry::do_divert): If an entry spans multiple columns and a minimumum width has been specified for each column, then set the line length to the sum of the widths (plus possibly the column separations). * troff/input.cc (set_escape_char): Don't set the escape_char until after calling has_arg(). Tue Nov 3 11:23:27 1992 James Clark (jjc at jclark) * tbl/table.cc (table::do_top): Add missing \s0 for double box case. * tbl/table.cc (table::print_double_hline): Avoid extra new line in case where r > nrows - 1. * tbl/table.cc (BODY_HEIGHT): Deleted. (LINE_SEP): New definition. (table::print_single_hline, table::print_double_hline, table::compute_vrule_top_adjust, table::compute_vrule_bot_adjust, table::do_row, table::do_top): Use LINE_SEP space before a line instead of \n[.v]-BODY_HEIGHT-BODY_DEPTH. * tbl/table.cc (text_entry::print_contents): New function. (text_string_name, right_text_string_name): Deleted. (TEXT_STRING, RIGHT_TEXT_STRING): Deleted. (simple_text_entry::do_width, numeric_text_entry::do_width, alphabetic_text_entry::do_width): Don't store the contents of the entry in a string. (left_text_entry::simple_print, right_text_entry::simple_print, center_text_entry::simple_print, alphabetic_text_entry::simple_print, numeric_text_entry::simple_print): Print the entry directly instead of using the stored string. Fri Oct 30 10:39:32 1992 James Clark (jjc at jclark) * devps/Makefile: Strip PostScript files. * devps/prologue: Rename to... * devps/prologue.ps. * devps/psstrip.sed: New file. * devps/download: Use .pfa rather than .ps for installed versions of fonts. Thu Oct 29 09:14:43 1992 James Clark (jjc at jclark) * troff/env.cc (input_trap): Give a warning if the argument is out of range. * troff/env.cc (adjust): Treat negative argument as missing. Round argument > 5 down to 5. * troff/env.cc (center, right_justify): Make negative argument zero. * troff/div.cc (page_offset, vertical_position_traps): Treat invalid argument as missing. * troff/env.cc (line_spacing, line_length, title_length, indent, underline, hyphen_line_max_request, control_char, no_break_control_char, widow_control_request, adjust, input_trap, point_size): Likewise. * troff/node.cc (ligature, kern_request, bold_font, track_kern, constant_space): Likewise. * troff/input.cc (compatible, shift, warn_request, set_escape_char): Likewise. * tbl/main.cc (format::format): Avoid doing `new int[0]'. * tbl/table.cc (table::table): Likewise. * Makefile.dev (install_dev): depends on $(DEVFILES). Wed Oct 28 08:30:57 1992 James Clark (jjc at jclark) * devX75, devX75-12, devX100, devX100-12: New directories. * Makefile.in: Add these to DEVDIRS. * troff/Makefile.sub, eqn/Makefile.sub, indxbib/Makefile.sub, afmtodit/Makefile.sub, tmac/Makefile.sub, nroff/Makefile.sub, grog/Makefile.sub, mm/Makefile.sub (uninstall_sub): New target. * Makefile.in (uninstall, uninstall_sub, uninstall_dirs): New targets. * Makefile.ccpg, Makefile.cpg, Makefile.dev, Makefile.man (uninstall): New target. * Makefile.comm (uninstall, uninstall_sub, uninstall_man, uninstall_prog, uninstall_dev): New targets. * troff/div.cc (return_request): Treat an invalid argument as missing. Mon Oct 26 11:33:47 1992 James Clark (jjc at jclark) * tmac/tmac.e ((f): Set up the environment even when there's a current diversion. Transparently throughput a call to @N. (@N): New macro. Thu Oct 22 05:05:59 1992 James Clark (jjc at jclark) * tbl/table.cc (table::compute_vrule_top_adjust): Round adjustment up to vertical resolution. * tbl/table.cc (table::do_row): Change row number after printing stuff list. * pic/lex.cc (get_token_after_dot): Make .left and .right work. Wed Oct 21 14:46:45 1992 James Clark (jjc at jclark) * Rename CHANGES to NEWS. Tue Oct 20 23:25:21 1992 James Clark (jjc at jclark) * libgroff/new.cc (operator new): Avoid calling malloc(0). Mon Oct 19 09:10:13 1992 James Clark (jjc at jclark) * man.ultrix: Removed. Sun Oct 18 06:35:15 1992 James Clark (jjc at jclark) * Makefile.comm (extraclean): Delete files whose names begin with `='. * pic/troff.cc (troff_output::text): Fix typo in implementation of aligned text. Sat Oct 10 09:32:29 1992 James Clark (jjc at jclark) * troff/env.cc (hyphenate_request, vertical_spacing, no_number): * troff/div.cc (page_length, need_space, space_request): Treat invalid optional argument as missing. * troff/env.cc (number_lines): If the first argument is present but not a number, turn on line numbering, don't change the next line number and parse the remaining arguments. * tmac/tmac.e (@q): Do the `ne' before changing to environment 2. Thu Oct 8 10:24:40 1992 James Clark (jjc at jclark) * eqn/box.h: Change declaration accordingly. * eqn/box.cc (set_gsize): Change return type to int. Return 0 if the specified size was bad but don't give an error. Check for overflow. * eqn/main.cc (main): Change caller. Leave validation to set_gsize. * eqn/lex (do_size): Likewise. Wed Oct 7 09:48:59 1992 James Clark (jjc at jclark) * acgroff.m4 (GROFF_PROG_CCC): Use fopen when checking for C++ compatible headers. Sun Oct 4 18:24:02 1992 James Clark (jjc at jclark) * tbl/table.cc (table::init_output): Improve error message when table won't fit on one page. Fri Oct 2 10:41:40 1992 James Clark (jjc at jclark) * pic/troff.cc (troff_output::start_picture): Generate line containing a horizontal motion equal to the width of the picture. * groff/groff.cc (main): Allow PROG_PREFIX to be set at runtime using GROFF_COMMAND_PREFIX environment variable. Fri Sep 25 11:40:40 1992 James Clark (jjc at jclark) * mdate.sh: Use $NF rather than $(NF). Tue Sep 22 09:47:24 1992 James Clark (jjc at jclark) * pic/main.cc (main): Use %1 not %c in argument to warning. * eqn/main.cc (main): Output code to check that geqn was given the correct -T option. Mon Sep 21 10:59:16 1992 James Clark (jjc at jclark) * Makefile.in (dist): Instead of doing `make -f ../Makefile', do `ln -s ../Makefile .; make; rm -f Makefile'. * troff/hyphen: Rename to... * troff/hyphen.us: * troff/input.cc (main): Delete -H option. Don't call read_hyphen_file(). * troff/env.cc: Include searchpath.h and macropath.h. (exception_dictionary): Deleted. (ht): Deleted. (read_hyphen_file): Deleted. (hyphenation_language): New struct. (class trie, class hyphen_trie): Move declarations up. (trie_node::~trie_node): Deleted. (trie::delete_trie_node): New function. (trie::do_delete): New pure virtual function. (hyphen_trie::do_delete): New function. (trie::~trie): New function. (hyphen_trie::~hyphen_trie): New function. (trie::clear): No need to check that tp is not 0. (current_language, language_dictionary): New variables. (hyphen_word): Give an error if no current language. Use exceptions dictionary in current language. (hyphen_trie::read_patterns_file): Find file using macro_path. Allow comments (starting with %) in patterns file. Don't make it a fatal error if the file can't be found. (hyphenate): Return if no current language. Get the exceptions dictionary and the hyphenation patterns from the current language. (set_hyphenation_language): New variable. (hyphenation_patterns_file): New function. (hyphenation_language_reg): New class. (hyphenation_language_reg::get_string): New function. (init_hyphen_requests): Bind "hla" to set_hyphenation_language and "hpf" to hyphenation_patterns_file. Initialize `.hla' number register. * groff/groff.cc (main, help, synopsis): Delete -H option. * include/Makefile.sub: Don't define HYPHENFILE. * Makefile.in: Delete hyphenfile variable and remove from MDEFINES. * Makefile.comm (.man.n): Don't substitute for HYPHENFILE. * tmac/troffrc: Set hyphenation language to `us'. Load `hyphen.us' hyphenation patterns. Sun Sep 20 09:33:02 1992 James Clark (jjc at jclark) * eqn/neqn.sh: New file. * eqn/Makefile.sub: Handle neqn.sh. * eqn/eqn.h: Declare `nroff' variable. * eqn/box.cc (param_table): Add `nroff' param. (nroff): Define it. * eqn/lex.cc (yylex): Handle TDEFINE and NDEFINE using `nroff' variable. * tmac/eqnrc: Set `nroff' to 1 for -Tascii or -Tlatin1. * troff/troff.h (WARN_FONT): New warning. (WARN_TOTAL): Change accordingly. * troff/input.cc (DEFAULT_WARNING_MASK): Include WARN_FONT. (warning_table): Add WARN_FONT. * troff/node.cc (mount_font_no_translate): Pass argument to font::load_font. If this is non-zero, give a warning. Don't give an error message when accessing a font that has already been found to be invalid. * include/font.h (font::load, font::load_font): Add additional optional argument which suppresses error message if the font is not found. * libgroff/font.cc (font::load_font): Handle additional argument. (font::load): Add additional argument. If this is non-null, set it to 1 and don't give error message. * include/printer.h (printer::end_page): Add argument giving length of page. * libdriver/input.cc (do_file): Pass this. * grops/ps.cc (ps_printer::end_page): Add argument. * grodvi/dvi.cc (dvi_printer::end_page, draw_dvi_printer::end_page): Add argument. * grotty/tty.cc (class tty_printer): Remove lines_per_page and columns_per_page members. New member nlines. (DEFAULT_LINES_PER_PAGE): Deleted. (tty_printer::tty_printer): Don't compute lines_per_page from font::paperlength. Don't compute columns_per_page from font::paperwidth. (tty_printer::add_char): Don't check horizontal position against columns_per_page. Grow glyphs vector if necessary. (tty_printer::end_page): Add argument giving page_length in units. Discard lines past end of page. Wed Sep 16 06:29:52 1992 James Clark (jjc at jclark) * tmac/tmac.tty-char: Fix definition of \(/l. * tmac/tmac.X: Define \(en. Tue Sep 15 10:37:13 1992 James Clark (jjc at jclark) * acgroff.m4 (GROFF_PRINT): If a system has lpr and lp but not lpq, then use lp rather than lpr. * tmac/tmac.s (par@reset): Don't call `ad'. (par*env-init): Call `ad'. Sun Sep 13 18:48:20 1992 James Clark (jjc at jclark) * mdate.sh: Use $(NF) instead of $6 to extract year from output of date. * troff/symbol.cc: #undef BLOCK_SIZE if it's defined. * indxbib/indxbib.cc: Likewise. Sun Sep 6 09:44:46 1992 James Clark (jjc at jclark) * libgroff/putenv.c: New file. * libgroff/Makefile.sub: Add putenv.c to CSRCS. * Makefile.in: Say that putenv.o can be one of LIBOBJS. * configure.in: Test for putenv with AC_REPLACE_FUNCS. Test for stdlib.h with AC_HAVE_HEADERS. Sat Sep 5 18:11:52 1992 James Clark (jjc at jclark) * indxbib/dirnamemax.c: Include only if does not exist. Fri Sep 4 09:43:26 1992 James Clark (jjc at jclark) * eqn/box.cc (gsize): Make it an int. (set_gsize): Parse argument handling increment or decrement. (box::top_level): Convert gsize to a string. * troff/input.cc (exit_troff): Make buf unsigned char []. Call to make_temp_iterator casts buf to char*. * Makefile.in ($(TARGETS), dot): Pass $(MDEFINES) to recursive makes. * Makefile.ccpg (depend.temp): Depends on $(YTABC). * Makefile.cpg (depend.temp): Likewise. * Makefile.dep: Remove Makefile.dep from $(REALCLEANFILES). * Makefile.comm: Add y.output to MOSTLYCLEANFILES. Thu Sep 3 08:01:55 1992 James Clark (jjc at jclark) * tmac/tmac.s (B, I, BI, CW): Rewrite avoiding aliases. Tue Sep 1 18:24:53 1992 James Clark (jjc at jclark) * Version 1.06 released. * Integrate mm 1.04. Fri Aug 28 11:28:19 1992 James Clark (jjc at jclark) * Makefile.comm, Makefile.ccpg, Makefile.cpg: Fix TAGS target. Thu Aug 27 11:03:33 1992 James Clark (jjc at jclark) * afmtodit/afmtodit.pl: Add -n option that disables generation of ligatures command. * devps/generate/Makefile (CR, CB, CI, CBI): Pass -n flag to afmtodit. Regenerate. * tmac/tmac.e ()z): Adjust _b if necessary so as to avoid moving @f back past the current position. * tmac/tmac.e: Change calls to @R so that comments are not part of arguments. Tue Aug 25 10:42:07 1992 James Clark (jjc at jclark) * configure.in: Check for mkstemp with AC_HAVE_FUNCS. * acgroff.m4 (GROFF_PROG_CCC): Don't check for . Instead check that we can link a call to a function declared in . (GROFF_UNISTD_H): New macro. * configure.in: Call it. * Makefile.in: Document it. * include/posix.h: New file. * troff/troff.h: Don't include * troff/input.cc: Include posix.h. * libgroff/new.cc, libgroff/tmpfile.cc: Include posix.h rather than osfcn.h. * indxbib/indxbib.cc, libbib/{search.cc,linear.cc,index.cc}: Include posix.h rather , , , . * indxbib/indxbib.cc (S_IRUSR, S_IRGRP, S_IROTH): Delete definitions. * libbib/index.cc (S_ISREG, O_RDONLY): Delete definitions. * libbib/search.cc (O_RDONLY): Delete definition. * refer/refer.cc, include/driver.h, pic/pic.h, groff/groff.cc: Don't include . * acgroff.m4 (GROFF_TIME_T): New macro. * configure.in: Call it. * Makefile.in: Document it. * acgroff.m4 (GROFF_TRADITIONAL_CPP): New macro. * configure.in: Call it. * Makefile.in: Document -DTRADITIONAL_CPP. * include/ptable.h: Don't include generic.h. (name2): Define it. * tmac/tmac.s (][): Make [T1 and [T2 aliases for [T. Afterwards remove [T1 and [T2. (ref*spec!0, ref*spec!2): Use T1 rather than T. (ref*spec!1, ref*spec!4, ref*spec!4): Use T2 rather than T. (ref*add-T2): Renamed from ref*add-T. (ref*add-T1): New macro. Mon Aug 24 11:11:11 1992 James Clark (jjc at jclark) * acgroff.m4 (AC_PROG_CCC): Use GROFF_EXIT rather than exit 1. * libbib/index.cc: Include . (O_RDONLY): Define if necessary. (make_index_search_item, index_search_item_iterator::get_tag, index_search_item::check_files): Use O_RDONLY. * libbib/search.cc: Include , , . (O_RDONLY): Define if necessary. (search_list::add_file): Use O_RDONLY. * indxbib/indxbib.cc: Include , , . (S_IRUSR, S_IRGRP, S_IROTH): Define if necessary. (main): Use these. * libbib/index.cc (S_ISREG): Define it if necessary. (index_search_item::load): Use S_ISREG. * include/driver.h: Include . Sun Aug 23 11:32:18 1992 James Clark (jjc at jclark) * eqn/box.cc (body_height): Increase default value to 85. (body_depth): Increase default value to 35. Fri Aug 21 05:34:42 1992 James Clark (jjc at jclark) * eqn/pbox.h (SAVE_FONT_STRING): Define it. * eqn/box.cc (box::top_level): Hide use of \R in a string that is protected from expansion with \E. * acgroff.m4 (GROFF_PAGE): Use `case' to test domain. * Makefile (Makefile): New target. * Makefile.sub (configure, distfiles): New targets. * acgroff.m4 (GROFF_BROKEN_SPOOLER_FLAGS): Avoid using ${var:-val} construct. Thu Aug 20 12:27:26 1992 James Clark (jjc at jclark) * eqn/box.cc (param_table): Add body_height and body_depth. * eqn/lex.cc (def_table): Make circumflex in hat_def roman. Tue Aug 18 16:24:25 1992 James Clark (jjc at jclark) * psbb/Makefile.sub: Don't link with libgroff.a. * acgroff.m4 (GROFF_PUTENV): New macro. * configure.in: Call GROFF_PUTENV. * Makefile.in: Document STDLIB_H_DECLARES_PUTENV. * groff/groff.cc: Don't declare putenv if STDLIB_H_DECLARES_PUTENV is defined. * troff/env.cc (distribute_space): Rename force_forward argument to force_reverse. Reverse the list if force_reverse is true. Mon Aug 17 17:49:05 1992 James Clark (jjc at jclark) * tmac/tmac.an: Don't define a string `T'. Just define Tm. * eqn/pile.cc (matrix_box::compute_metrics): Don't allow computed height or depth to be negative. Guard against SUP_RAISE quantity being negative. Sat Aug 15 08:18:54 1992 James Clark (jjc at jclark) * devps/generate/textmap: Add `an' (arrowhorizex). * tmac/tmac.ps: \(an overlaps horizontally. * tmac/tmac.dvi, tmac/tmac.tty: Add `an'. * devps/symbolchars: Add arrowverttp, arrowvertbt. * devps/textmap: Add arrowvertex. * eqn/delim.cc (delim_table): Add uparrow, downarrow and updownarrow delimiters. * tmac/tmac.ps, tmac/tmac.X: Add definition of \(va. * tbl/table.cc (simple_entry::position_vertically, block_entry::position_vertically): For a centered entry, perform the motion in two stages. * refer/refer.cc (split_punct): Don't call lookup_token if there is no token. Fri Aug 14 11:14:58 1992 James Clark (jjc at jclark) * troff/input.cc (token::next): Delete token_node after copying token. * grodvi/grodvi.cc (dvi_printer::dvi_printer): Initialize cur_point_size. * libdriver/printer.cc (printer::load_font): Delete old_font_table. * grops/ps.cc (ps_printer::define_encoding): Delete elements of vec. Tue Aug 11 13:50:38 1992 James Clark (jjc at jclark) * grops/ps.cc (usage): -b option takes an argument. * devps/prologue (PLG): New procedure. * grops/ps.cc (main, usage): New -g option. (ps_printer::~ps_printer): If guess_flag is set, guess the paper length using PLG. Mon Aug 10 11:17:53 1992 James Clark (jjc at jclark) * include/cset.h: Include if we have it. * libgroff/illegal.cc: New file. * include/lib.h (illegal_input_char): Use table. * troff/input.cc (ESCAPE_RIGHT_PARENTHESIS): Renumber to 0206. * pic/lex.cc (ARG1): Renumber to 14. * eqn/lex.cc (ARG1): Likewise. * troff/Makefile.sub (majorminor.cc): Handle 3 part versions (eg 1.05.90) correctly. Sun Aug 9 13:35:43 1992 James Clark (jjc at jclark) * tmac/tmac.e (sr): Deleted. Set $r and $R directly. Rename $r and $R registers to $v and $V. ($r, $R): Initialize to 0. (@v, @V): New macros. (sz): Call @v. (@M): Call @V. * troff/input.cc (main, usage): Add -R option that says not to load troffrc. * eqn/main.cc (main, usage): Rename -n to -R. Sat Aug 8 00:16:00 1992 James Clark (jjc at jclark) * devps/DESC.in: Leave font positions 5-9 blank. * devdvi/DESC.in: Likewise. * grog/grog.pl: Handle `.PS 0. * macros/tmac.e (@R, @S): New macros. Declare @, po, $0, $i, $p, df, so, fu, bt, *, ?a, ?b, ?C, ?e, ?H, ?I, ?n, ?o, ?R, ?s, ?T, ?W, ?w registers with @R. Declare $H, $[0-9], .. macros with @S. Declare |0, |1, |2, |3 strings with @S. * macros/tmac.e (@S): Rename to @U. * macros/tmac.e (@z): Define @b and bp as empty instead of deleting them, * macros/tmac.e (@m): Deleted. (@h): Don't call @m. (@z): Don't set @m trap. * macros/tmac.e ($h, $f): Define |z as empty string. * macros/tmac.e (@D): Rework to avoid unbalanced .el requests. (@q): Likewise. * macros/tmac.e (@h): Set ?H, ?C , ?s registers to 0 rather than removing them. ()f): Likewise for * register. * macros/tmac.e (sr): Don't ever scale the arguments. If the third argument is missing, don't change $R. Call sr with three arguments when initializing. Thu Jul 16 12:17:12 1992 James Clark (jjc at jclark) * macros/tmac.e (sr): New macro. Initialize $r and $R using sr. * macros/tmac.e (,): Delete \*(#[. * troff/env.c (set_tabs): Read the tab type even if the position is bad. Allow the position of the first tab stop to be negative. Wed Jul 15 13:14:37 1992 James Clark (jjc at jclark) * refer/dirnamemax.c: Use pathconf() if defines _POSIX_VERSION. * refer/Makefile: Compile dirnamemax.c using -DHAVE_UNISTD_H rather than -DPATHCONF_MISSING. * Makefile: Get rid of PATHCONF_MISSING. * refer/map.c: New file. * refer/index.c: Interface to mmap through map.c. Rename map_size to map_len. * refer/Makefile: Handle map.c. * Makefile: Include -DHAVE_MMAP in OLDCFLAGS rather than CFLAGS. Tue Jul 14 14:15:20 1992 James Clark (jjc at jclark) * Makefile: RANLIB should be `true' if there is no ranlib. * lib/Makefile (libgroff.a): Simplify. * driver/Makefile (libdriver.a): Simplify. * Makefile: Change -DWAIT_COREDUMP_0200 to -DWCOREFLAG=0200. * groff.c (WCOREDUMP): Use WCOREFLAG. Define only if not already defined. Sat Jul 11 09:19:17 1992 James Clark (jjc at jclark) * troff/env.c (compare_ranges): Declare as extern "C". * troff/input.c (init_registers): Use `struct tm' instead of `tm'. * macros/tmac.s, macros/tmac.e: Change .nx /dev/null to .nx. Wed Jul 8 11:52:27 1992 James Clark (jjc at jclark) * pic/troff.c (troff_output::text): Merge in grops_output::text, but conditionalize use of \X based on \*(.T. (grops_output::*): Deleted. * pic/output.h: Delete declaration of make_grops_output. * pic/main.c (main): Ignore -p and -x. driver_extension_flag is 1 by default. -n sets it to 0. (usage): Corresponding changes. * groff.c (main): Don't pass -x or -p to pic. * groff.sh: Likewise. * ps/ps.c (ps_printer::do_exec, ps_printer::do_file): Force ndefs to be non-zero. * ps/devps/afmtodit: Change calculation of asc_boundary and desc_boundary. Make these bounds inclusive. * ps/devps: Regenerate font files. Tue Jul 7 13:14:15 1992 James Clark (jjc at jclark) * macros/tmac.latin1: New file. * macros/tmac.tty-char: Use tmac.latin1. (tmac.tty-tr): Deleted. * macros/Makefile: Install tmac.latin1. * macros/tmac.dvi: Use tmac.latin1. * macros/troffrc: Translate \[char160] onto no-break space here. * macros/{tmac.dvi,tmac.ps,tmac.tty,tmac.X75}: Don't do it here. Mon Jul 6 11:06:52 1992 James Clark (jjc at jclark) * macros/tmac.Xps: Use `do' request. * macros/tmac.ps: Use `do' request. * macros/tmac.e (@C): Use `do' request. * macros/tmac.X, macros/tmac.Xps: Moved from xditview. * macros/Makefile: Install tmac.X*. * tty/tmac.tty, tty/tmac.tty-char: Move to macros. * tty/Makefile: Don't install tmac.tty*. * macros/Makefile: Install tmac.tty*. * dvi/tmac.dvi: Move to macros. * dvi/Makefile: Don't install tmac.dvi. * macros/Makefile: Install tmac.dvi. * ps/tmac.ps*: Move to macros. * ps/Makefile: Don't install tmac.ps*. * macros/Makefile: Install tmac.ps*. * eqn/box.c: Provide draw_lines parameter corresponding to -D option. * macros/eqnrc: Set draw_lines parameter based on device. * groff.c: Don't pass -D flag to eqn. * groff.sh: Likewise. * eqn/main.c: Warn about use of -D. * troff/input.c (process_startup_file): New function. (main): Call process_startup_file(). * macros/troffrc: New file. * macros/Makefile: Install troffrc. * groff.c (main): Don't pass extra -m option to troff. For a pseudo device pass the name of the pseudo device to troff using -d. * groff.sh: Likewise. * groff.c (possible_command::prepend_arg): Deleted. * troff/input.c (do_request): New function. (init_input_requests): Bind "do" to do_request. * eqn/main.c (main): Instead of loading eqnchar from device directory, load eqnrc from macro directory. * macros/eqnrc: New file. * macros/Makefile: Install eqnrc. * ps/devps/eqnchar: Deleted. * ps/devps/Makefile: Don't install eqnchar. * dvi/devdvi/eqnchar: Deleted. * dvi/devdvi/Makefile: Don't install eqnchar. * groff.c (main): Pass -M to eqn. Don't pass -F to eqn. New variable optM. * lib/device.[ch]: New files. * lib/font.h (font::set_device_name, font::get_device_name): Deleted. * lib/fontfile.c: Use device.h. * lib/Makefile: Handle device.[ch]. Make paths.h define DEVICE. * troff/input.c: Delete definition of `device'. (main): Don't initialize device. * troff/troff.h: Include device.h rather than declaring device. * troff/Makefile: No need to handle DEVICE. * driver/input.c: Include device.h. Don't use font::{set,get}_device_name. * groff.c, Makefile: Rename device.h to config.h. * groff.c: Use library device variable. * eqn/main.c: Use library device variable. * eqn/Makefile: No need to handle DEVICE. * lib/searchpath.[ch]: New files. * lib/Makefile: Handle searchpath.[ch]. * troff/input.c (open_file, init_dirs): Deleted. (macro_dirs): Deleted. (open_mac_file, macro_source): Use class search_path. (add_string, struct string_list): Move definition. (main): Change -M option to use macro_path. Delete call to init_dirs(). * lib/fontfile.c (font::command_line_font_dir, font::open_file): Rewrite to use class search_path. * lib/font.h, lib/fontfile.c (font::cl_font_dirs): Deleted. * lib/Makefile: fontfile.c depends on searchpath.h. * lib/Makefile: Rename fontpath.h to paths.h. Make paths.h define MACROPATH. * lib/macropath.[ch]: New files. * troff/Makefile: No need to handle MACROPATH. * troff/input.c: Delete DUMP code. * lib/fontfile.c, lib/font.h: Delete font::forget_command_line_font_dirs. * troff/input.c (push_token): New function. (handle_first_page_transition): Use push_token(). (process_input_stack): Change handling of a space at the beginning of the line. Sun Jul 5 17:11:09 1992 James Clark (jjc at jclark) * troff/input.c (font_dirs): Delete unused variable. * eqn/lex.c (do_set): Correct error messages. Sat Jul 4 10:20:55 1992 James Clark (jjc at jclark) * troff/input.c (do_define_string): Allow the string name to be followed immediately by a tab. (define_character): Likewise. Thu Jul 2 10:59:15 1992 James Clark (jjc at jclark) * ps/ps.c (ps_printer::draw): When drawing an arc, don't allow k to be negative. * troff/input.c (input_iterator::is_file): New virtual function. (file_iterator::is_file): New function. (input_stack::end_file): New function. (input_stack::next_file): Handle the situation where there is no file on the input stack correctly. Avoid making two passes over the input stack. (next_file): Make the filename optional; in this case call input_stack::end_file(). Wed Jul 1 10:17:25 1992 James Clark (jjc at jclark) * dvi/tmac.dvi: Change the definitions of \(ul and _ so that they produce a real _ character when the current font is CW and _ otherwise. * lib/errarg.c (errarg::errarg(const char *)): Invert conditional expression to work around gcc 2.2 bug. Wed Jun 24 08:12:24 1992 James Clark (jjc at jclark) * eqn/main.c (main): Don't give an error if we can't find eqnchar. * troff/env.c (environment::add_padding): New function. (environment::add_char): Use add_padding(). (environment::space): Likewise. (environment::wrap_up_field): Add some padding if there is none and there's no current tab. * troff/env.h: Declare environment::add_padding. Mon Jun 22 08:37:45 1992 James Clark (jjc@jclark) * pic/pic.y: undef fmod and rand before declaring them. Sun Jun 14 11:40:18 1992 James Clark (jjc@jclark) * troff/input.c (main): If the DESC file specifies a font name of 0, then leave the corresponding font position empty. * nroff.sh: New file. * Makefile (install.nobin): Install nroff.sh. * tty/devlatin1/R.proto: Add ao as synonym for de. * tty/tmac.tty-char: Define ao as o. * tty/dev{ascii,latin1}/R.proto: Add aq. * tty/tmac.tty-char: Delete definition of aq. Mon Jun 8 11:43:20 1992 James Clark (jjc@jclark) * troff/input.c (init_charset_table): Don't translate 0240. * ps/tmac.ps: Translate char160 to space. * dvi/tmac.dvi: Likewise. * tty/tmac.tty: Likewise. Sun Jun 7 10:52:35 1992 James Clark (jjc@jclark) * dvi/tmac.dvi: Add support for all Latin-1 characters. * macros/tmac.s: Delete definitions of \(rg, \(ah, \(ad, \(a-, \(ao, \(ac, \(ho, \(-D, \(Sd, \(TP, \(Tp, \(ss, \(AE, \(ae, \(OE, \(oe, \(r?, \(r!. * tty/tmac.tty-char: Add \(ah. * dvi/tmac.dvi: Add definitions of Tp, TP, Sd, -D, ho. No need to define \(FM and \(!/. Conditionalize all character definitions. * ps/devps/lgreekmap: Add +h, +f, +p. * ps/tmac.psnew: New file. * ps/Makefile: Install tmac.psnew. * troff/input.c (charinfo_to_node_list): Don't ever interpret character definitions in compatible mode. * troff/input.c (remove_character): New function. (init_input_requests): Bind remove_character to "rchar". * ps/tmac.psold: New file. * ps/Makefile: Install tmac.psold. * ps/tmac.ps: Load tmac.psold. Move definitions of ISO Latin-1 characters into tmac.psold. Make these definitions unconditional. * tty/tmac.tty-char: Define \n(_C only if it is not already defined. * ps/tmac.ps: Don't define \('c and \('C. * ps/devps/textmap: Move Greek characters to... * ps/devps/symbolchars: Sat Jun 6 16:41:17 1992 James Clark (jjc@jclark) * ps/devps/text.enc: Add quotesingle. * ps/devps/textmap: Add +h, +f, +p, Fn, Bq, bq, aq, lz. * tty/tmac.tty-char: Likewise. * dvi/devdvi/texmi.map: Add +h, +f, +p. * dvi/devdvi/texi.map: Add Fn. * dvi/devdvi/msam.map: Add lz. * dvi/tmac.dvi: Handle Bq, bq, aq. * pic/lex.c (get_token): Recognize 'th. * pic/map.y: Allow `expr'th in contexts where ORDINAL was allowed. Fri Jun 5 11:20:46 1992 James Clark (jjc@jclark) * ps/devps/textmap: Move di, mu, +- to... * ps/devps/symbolchars: * macros/tmac.s (@XS): Don't call par@reset or fi. (XA): Call LP. Turn off adjustment. Reduce line length. * macros/tmac.s: Initially alias XS to LP. (XS): Rename to @XS. (cov*ab-init): Alias XS to @XS. Thu Jun 4 09:12:05 1992 James Clark (jjc@jclark) * troff/token.h: Delete TOKEN_CHAR_HEIGHT, TOKEN_CHAR_SLANT, TOKEN_FONT_NAME, TOKEN_FONT_POSITION, TOKEN_SIZE tokens. (token::is_size, token::changes_env): Deleted. * troff/number.c (parse_term): No need to process \s explicitly. Call tok.next() only after scale indicator has been processed. * troff/input.c (do_overstrike, do_bracket): No need to process \s, \f etc explicitly. (token::next): Handle \s, \f, \S, \H immediately rather than returning them as tokens. (token::operator==, token::description, token::add_to_node_list, token::process): Remove handling of deleted tokens. * troff/env.c (environment::add_char): When adding padding indicator character, call start_line() if necessary. Wed Jun 3 09:55:50 1992 James Clark (jjc@jclark) * ps/devps/afmtodit: Don't output 0 kerns. * ps/devps/afmtodit: Remove directory from name of encoding in font description file. * ps/devps/afmtodit: Improve error messages. * ps/devps/afmtodit: Allow DESC file to be specified with -d. * ps/devps/Makefile: Incorporate FontMakefile. Rework. * ps/devps/FontMakefile: Deleted. * ps/devps/afmname: New file. * ps/devps/symbol.sed: New file. * ps/devps/symbol.diff: Deleted. * ps/devps/FontMakefile: Generate symbol.afm using symbol.sed. Generate zapfdr.afm from zapfd.afm. * tty/tmac.tty (tty-char): Prefix definition with ". * macros/tmac.an (TP): Don't start a diversion if one has already been started. * tty/tmac.tty-char: Add Latin-1 characters. * tty/tmac.tty-char: Incorporate suggestions from Paul Eggert. Tue Jun 2 00:54:34 1992 James Clark (jjc@jclark) * tbl/table.c (table::allocate): Delete old_vline, old_entry. Move declaration of struct horizontal_span. * tbl/table.c (table::table): Initialize span_list. (table::~table): Delete span_list. * lib/ptable.h (PTABLE(T)::~PTABLE(T)): Delete v. * ps/devps/Makefile: Avoid dependency on GNU make. * ps/tmac.ps: Check that character does not already exist before defining it. * tty/tmac.tty: Add definitions of \(ff, \(!=, \(==, \(~=, \(sq, \(OE, \(oe, \(AE, \(ae, \(lh, \(rh. Delete definitions of \(en, \(ru, \(ul, \(br, \(bv, \(sl which are in the font description files. * tty/tmac.tty-char: New file. * tty/Makefile: Install tmac.tty-char. * tty/tmac.tty: Move definitions of \(ua, \(da, \(uA, \(dA into tmac.tty-char. * tty/tmac.tty: Fix definition of \(34. * tty/dev{ascii,latin1}/R.proto: Add ha and ti. Map bracket-drawing characters onto |. Add *o. * troff/env.c (environment::wrap_up_tab): Increment field_spaces only if current_field. * troff/dictionary.c (dictionary::lookup): Free old_table after rehashing. Mon Jun 1 10:15:22 1992 James Clark (jjc@jclark) * tty/dev{ascii,latin1}/R.proto: Add uppercase Greek characters whose glyphs are identical to glyphs of some Roman character. * tty/devlatin1/R.proto (bu): Deleted. * tty/devascii/R.proto (bu): Deleted. * tty/tmac.tty: Add definition of \(bu. * eqn/main.c (do_file): Pass FILE as argument. (main): Automatically load eqnchar. New options -F and -n. Pass do_file an opened FILE. * groff.c: Don't pass eqnchar to eqn. Pass -F options onto eqn. No need to include font.h. * groff.sh: Likewise. Don't need to use - for standard input. Prefix files with -- if first file starts with -. * macros/tmac.e: Conditionalize use of \$* on \n(.g. * troff/env.c (environment::possibly_break_line): Don't set line to 0 across call to output_line(). Don't call output_line() until after discarding nodes after break. Sun May 31 10:45:29 1992 James Clark (jjc@jclark) * request.h (macro::empty): Declare it. * input.c (macro::empty): New method. (interpolate_macro): Don't give a WARN_SPACE if the two-character macro is empty. Sat May 30 10:27:15 1992 James Clark (jjc@jclark) * troff/env.c (environment::start_field): Decrement space_total when a space is frozen. Fri May 22 14:34:38 1992 James Clark (jjc@jclark) * macros/tmac.an (R): Delete macro. * troff/input.c (get_copy, token::next): Support \# (like \" but newline is ignored). * troff/input.c (token::next): Fix error message in 'Y' case. Thu May 21 09:26:24 1992 James Clark (jjc@jclark) * eqn/delim.c (define_extensible_string): Recognize any prefix of a delimiter name. Fri May 15 10:20:41 1992 James Clark (jjc at jclark) * c++test.c: Include . * lib/strtol.c, lib/getcwd.c, ps/psbb.c: Declare errno in case doesn't. Fri May 8 09:37:19 1992 James Clark (jjc at jclark) * tbl/table.c (table::divide_span): Don't count column separation if expand was specified. * tbl/main.c (process_format): Don't ignore width specs in continued format. Give warning for changing equal widths or column separation in continued format. (process_data): Set column separation, minimum width, equal columns at end of table. Thu May 7 08:50:40 1992 James Clark (jjc at jclark) * troff/node.c (kern_pair_node::add_discretionary_hyphen, node::add_discretionary_hyphen): Use soft_hyphen_char. (set_soft_hyphen_char): New function. (init_node_requests): Bind to shc. Initialize soft_hyphen_char. * Makefile (c++tested): Give more helpful message if test fails. Tue May 5 10:58:39 1992 James Clark (jjc at jclark) * troff/input.c (init_charset_table): Translate 0240 to an unbreakable space. * troff/token.h (token::hyphen_indicator): New function. * troff/charinfo.h (TRANSLATE_HYPHEN_INDICATOR): New special translation. * troff/input.c (translate): Allow translation to \%. * troff/node.c (node::add_char): Handle TRANSLATE_HYPHEN_INDICATOR. (make_node): Don't allow TRANSLATE_HYPHEN_INDICATOR here. * troff/input.c (init_charset_table): Don't set BREAK_AFTER flag for \(hy. * tty/devlatin1/R.proto: \(hy and - should print as 055. Tue Apr 21 09:24:42 1992 James Clark (jjc at jclark) * groff.c (run_commands): If the last command gets a SIGPIPE send a SIGPIPE to all children than haven't yet terminated. When command terminates, set pid field to -1. Fri Apr 17 11:20:48 1992 James Clark (jjc at jclark) * groff.c (main): Pass an appropriate -filename option to gxditview. Thu Apr 16 15:11:40 1992 James Clark (jjc at jclark) * Makefile.bd (install): Remove existing program before copying. * Makefile, */Makefile, Makefile.bd, groff.sh, groff.c: Allow programs which have Unix counterparts to be installed with user-specified prefix. * troff/input.c (exit_troff): Don't check if exit_started. (exit_request): Don't call exit_troff if exit_started. * Makefile.bd (install.mm): Rename to install.dwbmm. Tue Apr 14 10:05:10 1992 James Clark (jjc at jclark) * driver/input.c (do_file): Add missing break for '#' case. Mon Apr 13 10:11:02 1992 James Clark (jjc at jclark) * troff/input.c (input_stack::clear): Clear past any boundaries and then add the boundaries back. * troff/input.c (exit_troff): Return immediately if already exiting. * macros/tmac.s (pg@end-text): New macro. Use pg@end-text for the end macro. (pg*end-page): If the text has ended and there are no more footnotes or keeps, exit. * macros/doc-ditroff (Lq, Rq): Define as \(lq and \(rq. * troff/input.c (init_charset_table): Make \(rq transparent by default. * macros/tmac.an: Define lq and rq strings. * macros/tmac.s (Q, U): Define as \(lq and \(rq. Sun Apr 12 12:54:37 1992 James Clark (jjc at jclark) * troff/env.c (environment::final_break): New function. (environment::newline): Set prev_line_interrupted to 2 if exit_started. * troff/env.h: Declare environment::final_break. * troff/input.c (exit_troff): Call environment::final_break() instead of environment::do_break(). * macros/Makefile: Install man.local if $(MACRODIR)/man.local doesn't already exist. * macros/man.local: New file. * macros/tmac.an: Load man.local. * macros/man.ultrix: New file. Sat Apr 11 17:32:04 1992 James Clark (jjc at jclark) * troff/input.c (exit_groff): Rename to... (exit_troff): New function. * troff/div.c (exit_started, done_end_macro, seen_last_page_ejector): New global variables. (began_page_in_end_macro): New static variable. (exit_flag): Deleted. (top_level_diversion::top_level_diversion): Initialize last_page_count. (top_level_diversion): More elaborate test for whether cleanup_and_exit() should be called. Set began_page_in_end_macro if the end macro isn't yet finished. * troff/div.h (top_level_diversion::last_page_count): New data member. (top_level_diversion::set_last_page): New function. (exit_started, done_end_macro, seen_last_page_ejector): Declare. * troff/env.c (do_break): Zero prev_line_interrupted. * troff/input.c (exit_flag): Delete declaration. (LAST_PAGE_EJECTOR): New magic cookie. (token::next): Handle LAST_PAGE_EJECTOR. (exit_groff): Set exit_started and done_end_macro instead of exit_flag. Call top_level_diversion::set_last_page. Push a LAST_PAGE_EJECTOR instead of calling push_page_ejector(). Do another ejection after setting seen_last_page_ejector. Thu Apr 9 04:37:11 1992 James Clark (jjc at jclark) * etc/grog.sh, etc/grog.sh: Recognize -me sh macro. * macros/tmac.e (TH): Make sure there's room for the initial header. * macros/tmac.s (par@init): Make PD and DD at least \n(.V. Set FVS in points rather than units. Mon Apr 6 11:21:32 1992 James Clark (jjc at jclark) * troff/div.c (top_level_diversion::add_trap): Don't consider the position of empty slots. Fri Apr 3 10:46:45 1992 James Clark (jjc at jclark) * ps/devps/S: Fix height and depth of parenrightex. * ps/devps/symbol.diff: Regenerate. Sat Mar 28 21:17:52 1992 James Clark (jjc at jclark) * tmac.e (u): Do underlining as in -mgs. Fri Mar 27 09:23:44 1992 James Clark (jjc at jclark) * tty/tty.c (tty_printer::end_page): If overstriking is suppressed, still turn overstruck horizontal and vertical lines into +. * lib/new.c: Back out Feb 24 change; no longer needed with gcc 2.1. * refer/label.y (format_expr::evaluate): Avoid use of %0*d. Wed Mar 18 09:29:10 1992 James Clark (jjc at jclark) * Version 1.05 released. Tue Mar 17 16:50:45 1992 James Clark (jjc at jclark) * tty/tty.c: Instead of keeping an array of glyphs and then sorting it, keep a ordered linked list of glyphs for each line. * driver/driver.h: Include stddef.h. * tty/tty.c (compare_glyph): * refer/refer.c (rcompare): * troff/env.c (compare_ranges): Arguments of qsort comparison function should be const void *. * troff/number.c (parse_term): * dvi/dvi.c (draw_dvi_printer::draw): Avoid initialization in switch statement. * refer/label.y (consider_authors): Don't access variables constructed under a condition outside that condition: put braces round for statement containing declaration; redeclare use of same variable later. * pic/pic.y (text_expr): Delete production that allows parenthesised text_expr. (expr): Allow a conditional_expr to appear in parentheses. (conditional_expr): Rename to any_expr. * mm: Install new version 1.01 from jh. * lib/font.c (font::get_width): Cache scaled widths. (font::font): Initialize widths_cache. (font::~font): Destroy widths_cache. * lib/font.h: Add font::widths_cache. Declare font_widths_cache. Mon Mar 16 10:16:10 1992 James Clark (jjc at jclark) * c++test.c, c++test.ref: New files. * Makefile: Check that the C++ compiler works. * ps/tmac.pspic (PSPIC): Do a break. * ps/tmac.ps: Move definition of PSPIC into... * ps/tmac.pspic: New file. (PSPIC): Draw box around picture, but make it invisible to grops. * ps/tmac.ps: Load tmac.pspic. * ps/Makefile: Install tmac.pspic. Sun Mar 15 14:18:08 1992 James Clark (jjc at jclark) * lib/font.c (scale_round): If n is negative, subtract .5 before truncating floating point result. * lib/fontfile.c: Include . Tue Mar 10 14:17:03 1992 James Clark (jjc at jclark) * driver/input.c (get_char): Inline. Don't update current_lineno. Change callers to up date current_lineno if necessary. Use get_char() instead of getc(current_file). Sun Mar 8 18:05:28 1992 James Clark (jjc at jclark) * ps/tmac.ps: Fix up spacing of \(mo and \(nm. Fri Mar 6 19:38:58 1992 James Clark (jjc at jclark) * tty/tty.c (tmac.tty): Define \(rg as (R). Tue Mar 3 10:11:25 1992 James Clark (jjc at jclark) * lib/lib.h: New define a_delete. * Use a_delete instead of delete when deleting an array of objects without destructors. * lib/lib.h: Rename adelete to ad_delete. * Change uses of adelete. Mon Mar 2 12:41:05 1992 James Clark (jjc at jclark) * eqn/eqn.y: Include lib.h. * troff/node.c (grow_font_table): Delete old_font_table. * mm: Install new version from jh. Fri Feb 28 10:42:23 1992 James Clark (jjc at jclark) * tbl/table.h (format_type): Make global instead of local to class entry_format. Prefix enumerators with FORMAT_. * tbl/table.c, tbl/main.c: Corresponding changes. * refer/token.h (token_type): Make global. Prefix enumerators with TOKEN_. * refer/token.[ch]: Corresponding changes. * Makefile: Get rid of -DNO_NESTED_TYPES configuration option. * troff/div.c (node::set_vertical_size): Don't name argument. Thu Feb 27 10:29:19 1992 James Clark (jjc at jclark) * Makefile: New configuration option ARRAY_DELETE_NEEDS_SIZE. * lib/lib.h: Define adelete accordingly. * pic/object.c (graphic_object::graphic_object): * tbl/main.c (format::~format): * tbl/table.c (table::~table): * refer/ref.c (reference::~reference, reference::merge, reference::insert_field, reference::delete_field): Use adelete. * Makefile: Change NESTED_TYPES to NO_NESTED_TYPES. * refer/token.h: * tbl/table.h: Corresponding changes. * common.c (common_output::dashed_arc, common_output::dotted_arc): Ensure total_angle is positive. Wed Feb 26 08:49:26 1992 James Clark (jjc at jclark) * refer/ref.c (reference::merge, reference::insert_field, reference::delete_field): Avoid delete[0]. * refer/token.c (init_special_chars): Move calls to cmupper outside calls to init_two_char_letter to work around bug in gcc 2.0. Mon Feb 24 14:20:00 1992 James Clark (jjc at jclark) * lib/new.c (operator new): Use __builtin_new for g++. * pic/object.c (graphic_object::~graphic_object): Don't use delete [] on 0. * pic/object.c (output::compute_scale): Initialize max_width and max_height. Sat Feb 15 09:55:20 1992 James Clark (jjc at jclark) * troff/input.c (write_request): Call fflush. * troff/node.h (class composite_node): Move declaration to node.c * troff/input.c (charinfo_to_node): Rename to ... (charinfo_to_node_list): Return node list rather than composite node. * troff/node.c (make_composite_node): New function. (make_node, add_char): Call make_composite_node instead of charinfo_to_node. (class composite_node): Add a tfont * member. Delete font_size member. (composite_node::composite_node, composite_node::copy, composite_node::size): Corresponding changes. (composite_node::tprint): Provide constant spacing, emboldening and track kerning as specified in tfont. (composite_node::width): Change width calculation accordingly. * troff/env.h (environment::composite): New member. (environment::is_composite, environment::set_composite): New functions. * troff/env.c (environment::environment): Initialize composite. * troff/input.c (charinfo_to_node): Call environment::set_composite. * troff/node.c (make_composite_node, make_glyph_node): Use the plain version of the tfont if the environment is composite. * troff/node.c (font_info::get_space_width): Additional argument giving space_size. Handle constant space correctly. Scale by space_size unless constant spaced. (env_sentence_space_width): New function. * troff/node.h: Declare it. * troff/env.h (environment::get_space_size, environment::get_sentence_space_size, environment::get_narrow_space_width, environment::get_half_narrow_space_width): Make inline. (environment::get_space_width): Make inline. Just call env_space_width. * troff/env.c: Delete definitions for functions made inline. (environment::space_newline, environment::space): Use env_sentence_space_width(). Don't scale by space_size. * troff/node.h: Move declarations of env*space_width() functions into env.h. Sat Feb 8 09:30:22 1992 James Clark (jjc at jclark) * macros/tmac.s (PS): Don't try to set negative indent. Thu Feb 6 09:00:35 1992 James Clark (jjc at jclark) * pic/pic.y: Fix min function. Tue Jan 28 07:52:29 1992 James Clark (jjc at jclark) * man/mdate.sh: Clear LANGUAGE. Sun Jan 19 13:02:41 1992 James Clark (jjc at jclark) * pic/pic.y, pic/lex.c: Rename COMMAND token to COMMAND_LINE. * pic/lex.c: New COMMAND keyword. * pic/pic.y (print_args, print_arg): New rules. (placeless_element): Use print_args for PRINT. New COMMAND element. Tue Jan 7 13:14:31 1992 James Clark (jjc at jclark) * troff/input.c (terminal): Handle missing argument correctly. * pic/pic.y (text_expr): New rule. * pic/pic.y: Implement := operator. Sun Jan 5 10:23:02 1992 James Clark (jjc at jclark) * etc/grog.pl, etc/grog.sh: Distinguish old and new versions of mdoc. Sat Jan 4 14:42:26 1992 James Clark (jjc at jclark) * ps/devps/dingbatsrmap: Include this in the distribution. * macros/tmac.doc: Replace with new version from 2nd Networking Release. Fix loading of doc-* files. * macros/{doc-common,doc-ditroff,doc-nroff,doc-syms}: New files. * macros/tmac.doc.old: New file. Apply fixes that had been applied to old tmac.doc. * macros/tmac.andoc: Check that we're running under groff. * macros/Makefile: Rework. Fri Jan 3 13:27:51 1992 James Clark (jjc at jclark) * tbl/table.h (format_type): * refer/token.h (token_type): If NESTED_TYPES is defined, use typedef to make these types visible at file scope. * Makefile: Add NESTED_TYPES configuration option. * troff/div.c (mark): At the top level use the value of nl_reg_contents rather than the current vertical position. Thu Jan 2 10:34:51 1992 James Clark (jjc at jclark) * tty/tty.c: Implement \D for horizontal or vertical lines. (tty_printer::set_char): Use vec_used+2 as serial number. Don't allow size of vector to exceed USHRT_MAX-2. Split off part into... (tty_printer::add_char): New function. (tty_printer::draw): New function. (compare_glyph): Handle equal serial numbers. (tty_printer::end_page): Handle overstruck characters from \D. (main, usage): Implement -d option. Mon Dec 23 10:37:51 1991 James Clark (jjc at jclark) * tbl/main.c (process_format): * eqn/text.c (split_text): * troff/input.c (token::next): Use inner block for declarations with initializers in switch statement. Mon Dec 16 20:52:03 1991 James Clark (jjc at jclark) * pic/common.c (common_output::dash_line): Cope with zero-length lines. Sun Nov 17 12:04:08 1991 James Clark (jjc at jclark) * Version 1.04 released. Wed Nov 13 05:27:21 1991 James Clark (jjc at jclark) * macros/tmac.an (TH): Define a macro an-init to define variables based on command line arguments. (an-header): Call it. Sun Nov 3 12:07:34 1991 James Clark (jjc at jclark) * Makefile (install.mm): Rename to install.dwbmm. * Makefile: Integrate mm. * mm: New directory. Wed Oct 30 10:11:34 1991 James Clark (jjc at jclark) * refer/dirnamemax.c: If PATHCONF_MISSING is defined, include . * pic/troff.c (troff_output::simple_spline, troff_output::simple_polygon): Rename variable `v' to `d' to avoid shadowing parameter. * lib/tmpfile.c (xtmpfile): Declare dir as const char *. * lib/ptable.h: Add explicit casts when converting from unsigned long to unsigned. * dvi/devdvi/{SA,SB,msam.map,msbm.map}: New files. * dvi/devdvi/Makefile: Install SA, SB. * refer/indxbib.c: Add declaration of mktemp. * refer/lookbib.c: Add declaration of isatty. Fri Oct 25 09:00:17 1991 James Clark (jjc at jclark) * pic/lex.c (interpolate_macro_with_args): While collecting arguments, keep track of whether we're in a string. Wed Oct 23 08:42:48 1991 James Clark (jjc at jclark) * ps/tmac.ps (PSPIC): Do the .sp after the \X, and move the \X down with \v, so as to avoid problems with top of page trap setting no space mode. Tue Oct 22 17:38:49 1991 James Clark (jjc at jclark) * eqn/lex.c (get_delimited_text): Allow tab before macro body. Tue Oct 15 17:24:53 1991 James Clark (jjc at jclark) * ps/psrm.c (ps_get_line): Fix bug when lines longer than 255. Improve error message. Fri Oct 11 11:09:38 1991 James Clark (jjc at jclark) * ps/psrm.c (print_ps_string): Don't pass negative numbers to printf("%03o"); Wed Oct 9 17:50:14 1991 James Clark (jjc at jclark) * groff.c (possible_command::execp): Always use _exit() after a failed exec. * Makefile: Add HAVE_UNION_WAIT, HAVE_PID_T, WAIT_COREDUMP_0200, NO_SYS_WAIT_H configuration options. * groff.c: Use these options. Use POSIX-style macros to extract fields from the status returned by wait(). Fri Oct 4 12:12:27 1991 James Clark (jjc at jclark) * tbl/table.c (table::compute_separation_factor): Allow the separation factor to drop to 0. Tue Oct 1 18:12:38 1991 James Clark (jjc at jclark) * refer/search.c: Include . Sun Sep 29 08:40:57 1991 James Clark (jjc at jclark) * pic/pic.y (YYDEBUG): Don't define for Borland C++. * lib/lib.h: #ifdef out declarations of itoa and iftoa for Borland C++. * pic/lex.c (input_stack::bol): Move definition out of class body. * pic/main.c: On MS-DOS munge argv[0]. * lib/ptable.h: Define name2 as _Paste2 for Borland C++. * lib/ptable.c (hash_string): Use unsigned long rather than unsigned. (next_ptable_size): Use unsigned rather than int. Give an error message if we've hit the largest table size. * lib/ptable.c: Corresponding changes. Also use unsigneds for the table size. * pic/object.h (object_spec): Make flags unsigned long. Declare flags as const unisgned long rather than as enums. * pic/output.c: Deleted. * pic/troff.c (troff_output::simple_ellipse): Remove spurious %. * tbl/table.c (simple_entry::note_double_vrule_on_{left,right}): Add additional argument. (line_entry::note_double_vrule_on_{left,right}): Set value of douvle_vrule_on_{right,left} flag according to argument. (simple_line_entry::simple_print, simple_line_entry::double_line_print): If adjacent to double vrule on a corner extend rather than shorten the rule by half the double vrule sep. * troff/number.c (parse_term): In checking for overflow, handle the case where the current horizontal position is negative. Thu Sep 12 08:26:09 1991 James Clark (jjc at jclark) * pic/object.c (draw_arrow): Check for object having zero length. Wed Sep 11 10:32:38 1991 James Clark (jjc at jclark) * eqn/main.c (do_file): Split off inline equation handling into... (inline_equation): New function. Search for starting delimiter using... (delim_search): New function. Don't recognize a delimiter that occurs in the name of an escape sequence, number register, string etc. Tue Sep 10 04:01:11 1991 James Clark (jjc at jclark) * eqn/delim.c (delim_box::compute_metrics): Don't call define_extensible_string if left is 0. (delim_box::output): Don't print the left delimiter if left is 0. (delim_box::debug_print): Check for left == 0 before calling printf. Fri Aug 23 13:02:30 1991 James Clark (jjc at jclark) * troff/Makefile (majorminor.c): Include only digits in minor_version. Thu Aug 22 09:35:37 1991 James Clark (jjc at jclark) * refer/dirnamemax.c: new file. * refer/genlimits.c: Deleted. * refer/indxbib.c (main): Use dir_name_max() instead of NAME_MAX. Don't check path length. * refer/Makefile: Add dir_name_max.o; delete genlimits. * Makefile: Add PATHCONF_MISSING option. * refer/indxbib.c (get_cwd): New function. (main): Use get_cwd(). * lib/getcwd.c: New file. * Makefile: Delete -DHAVE_GETWD. Include GETCWD variable. Pass GETCWD in SUBFLAGS. * lib/Makefile: Compile getcwd.o. * ps/tmac.psatk (psatk-defs): Define showpage after pushing userdict. * refer/indxbib.c (main): Check success of mktemp. * lib/tmpfile.c: New file. * lib/Makefile: Add tmpfile.c. * lib/lib.h: Declare xtmpfile(); include . * ps/ps.h: Delete declaration of mktemp(). * ps/ps.c (ps_printer::ps_printer): Use xtmpfile(). * refer/refer.c (divert_to_temporary_file): Use xtmpfile(). * driver/driver.h: No need now to include errno.h. * everywhere: Set errno to 0 before calling fopen(). * eqn/eqn.h, etc/soelim.c, driver/driver.h, etc/addftinfo.c, dvi/tfmtodit.c, groff.c, refer/index.c, refer/linear.c, refer/lookbib.c, refer/refer.h, ps/psbb.c: Include . Mon Aug 19 10:52:18 1991 James Clark (jjc at jclark) * troff/env.h (translate_space_to_dummy): Declare it. * troff/env.c (environment::space_newline, environment::space): If translate_space_to_dummy is set then make the width of spaces 0. * troff/input.c (translate): If the second character of a translation is a space, translate to unbreakable space. If the first character is a space, set or clear translate_space_to_dummy according to whether the second character is \&. Weird! Tue Jul 30 10:03:56 1991 James Clark (jjc at jclark) * groff.c (run_commands): Don't use non-zero exit code because a command gets SIGPIPE. * groff.c, groff.sh: Use -mXps with -TXps. * ps/ps.c (ps_printer::special): Move call to flush_sbuf() into... (ps_printer::do_exec, ps_printer::do_file, ps_printer::do_def, ps_printer::do_mdef, ps_printer::do_import): Call flush_sbuf(). (ps_printer::special): New specials invis and endinvis. (ps_printer::do_invis, ps_printer::do_endinvis): New functions. (ps_printer::set_char, ps_printer::draw): Return if invis_count>0. (ps_printer::end_page): Check that invis_count == 0. (ps_printer::invis_count): New member. (ps_printer::ps_printer): Initialize invis_count to 0. * troff/env.c (environment::hyphenate_line): Hyphenation indicator at beginning of word inhibits splitting after -, \(em etc. * pic/pic.y (element): Allow another element to follow } without any intervening separator. Mon Jul 22 12:27:37 1991 James Clark (jjc at jclark) * pic/lex.c (get_delimited): Allow tabs before delimiter. Wed Jul 17 10:59:08 1991 James Clark (jjc at jclark) * groff.c: Get rid of HAVE_UNION_WAIT stuff. Instead suppress declaration of wait() in header files. * Makefile: Get rid of -DHAVE_UNION_WAIT. * tbl/table.c (alphabetic_text_entry::add_tab): New function. * lib/lib.h: Declare return type of strerror as char *. * man/Makefile: Add g flag to sed substitutions. * Makefile (shgroff, bindist): Likewise. Sun Jul 14 11:57:02 1991 James Clark (jjc at jclark) * ps/ps.c (ps_printer::do_import): Move push of userdict into... * ps/devps/prologue (PBEGIN): Define showpage after pushing userdict. Sat Jul 13 20:53:04 1991 James Clark (jjc at jclark) * ps/devps/prologue (PBEGIN): Zap any definition of showpage in userdict. Fri Jul 12 07:10:09 1991 James Clark (jjc at jclark) * man/mdate.sh: Handle the fact that BSD ls -l does not print the group. Sun Jul 7 08:00:23 1991 James Clark (jjc at jclark) * troff/input.c (define_number_reg): If currently undefined, don't define it if the argument is an invalid expression. * Makefile: Ignore return value of `if' commands without `else' parts. * Makefile: Split up CPPDEFINES into a series of separate configuration options. * troff/input.c (init_registers): Use time_t instead of long unless LONG_FOR_TIME_T is defined. Use returned result rather than passing pointer. * Makefile: Document LONG_FOR_TIME_T as a CPPDEFINE. * lib/Makefile (fontpath.h): Use gendef. Thu Jul 4 09:48:05 1991 James Clark (jjc at jclark) * troff/input.c (input_iterator::shift): Delete argument name. * troff/node.c (suppress_output_file::really_begin_page, suppress_output_file::really_transparent_char, node::ascii_print, node::tprint): Delete names of unused arguments. Wed Jul 3 17:34:57 1991 James Clark (jjc at jclark) * refer/label.y (string): Pass $4 to command_error. Tue Jul 2 15:06:01 1991 James Clark (jjc at jclark) * Version 1.03 released. Sat Jun 29 08:14:01 1991 James Clark (jjc at jclark) * Makefile: Pass definition of SHELL in SUBFLAGS. * gendef: New file. * Makefile, eqn/Makefile, refer/Makefile, troff/Makefile, ps/Makefile: Use gendef to construct header files that are constructed from the Makefile. * macros/Makefile: make all should build stripped version of tmac.e. * refer/Makefile (clean): Remove y.output. Fri Jun 28 09:44:36 1991 James Clark (jjc at jclark) * ps/pfbtops.c (main): Add -v option which prints out a version number. * ps/Makefile (pfbtops): Link with libgroff.a. Fri Jun 21 07:43:23 1991 James Clark (jjc at jclark) * refer/search.h (linear_searcher::get_nkeys): Delete declaration. * refer/linear.c (linear_searcher::get_nkeys): Delete definition. * refer/lkbib.c (main): Always terminate reference with blank line. * refer/lookbib.c (main): Likewise. * refer/linear.c (file_buffer::load): Check that the file is not a binary file. * refer/Makefile (genlimits): Possibly add -DHAVE_SYS_DIR_H. (genlimits.c): Include if HAVE_SYS_DIR_H is defined. Delete second inclusion of . Tue Jun 18 01:32:26 1991 James Clark (jjc at jclark) * troff/token.h (token::special): Deleted. * tbl/main.c (process_format): Rework so that opt->tab_char is recognized only when appropriate. * ps/Makefile (clean): Remove pfbtops. Sun Jun 16 09:37:19 1991 James Clark (jjc at jclark) * lib/font.c (text_file::next): Don't return if we have got a blank line. Fri Jun 14 09:52:26 1991 James Clark (jjc at jclark) * refer/refer.c (store_reference): Get hash code from old_table[i] when rehashing the table. Thu Jun 13 01:26:43 1991 James Clark (jjc at jclark) * eqn/box.c (box::top_level): Save size and prev size using \R and restore it afterwards. Set the size to the size at the beginning of the line. * eqn/pbox.h: Declare SAVED_INLINE_PREV_SIZE_REG, SAVED_INLINE_SIZE_REG, and SAVED_SIZE_REG. * refer/Makefile (limits.h): Use ./genlimits. Wed Jun 12 16:05:34 1991 James Clark (jjc at jclark) * refer/index.c: Delete declarations of stat() and fstat(). Tue Jun 11 14:52:49 1991 James Clark (jjc at jclark) * tty/tmac.tty: Add character definitions for \(>= and \(<=. Mon Jun 10 22:49:48 1991 James Clark (jjc at jclark) * etc/grog.sh, etc/grog.pl: Change regex for .PS. Fri Jun 7 09:13:06 1991 James Clark (jjc at jclark) * troff/input.c (token::get_char): Handle \e. * refer/linear.c: Delete declarations of fstat() and stat(). Wed Jun 5 09:11:59 1991 James Clark (jjc at jclark) * troff/node.c, troff/env.c, troff/input.c, Makefile: Remove OP_DELETE_BROKEN stuff, since we now have a fix for g++. Mon Jun 3 13:41:32 1991 James Clark (jjc at jclark) * troff/input.c (do_define_macro): Improve error handling for end of file while defining macro. Sun Jun 2 10:20:24 1991 James Clark (jjc at jclark) * eqn/box.h: Fix declaration of set_gsize. * eqn/box.c (set_gsize): Make argument const char *. (gsize): Declare as char *. * eqn/main.c (main): Don't convert gsize to int. * eqn/lex.c (do_gsize): Pass char * to set_gsize. * Version 1.02 released. Sat Jun 1 12:19:46 1991 James Clark (jjc at jclark) * macros/tmac.andoc: New file. * macros/Makefile: Install tmac.andoc. * troff/node.c, troff/env.c, troff/input.c: Conditionalize use of operator new and delete on OP_DELETE_BROKEN not being defined. * Makefile: Mention OP_DELETE_BROKEN. Mon May 27 13:49:07 1991 James Clark (jjc at jclark) * Makefile (bindist): Pass SUBFLAGS. Sun May 26 14:13:22 1991 James Clark (jjc at jclark) * Makefile, groff.c: Pass definitions to groff.c via device.h. * tty/tty.c (tty_font::load_tty_font): Avoid shadowing parameter. * ps/Makefile, ps.c: Pass BROKEN_SPOOLER_FLAGS via broken.h. * ps/ps.h, ps/psrm.c: Make comment_table and header_comment_table local to resource_manager::process_file. * groff.sh: With -TXps pass -printCommand option to gxditview. * groff.c (possible_command::print): Implement using append_arg_to_string. * xditview: Merge in new implementation with own ChangeLog. Sat May 25 18:33:20 1991 James Clark (jjc at jclark) * groff.c (main): Implement PRINT_OPTION. (append_arg_to_string): New command. (device_table): Set PRINT_OPTION flag for Xps. Fri May 24 09:48:58 1991 James Clark (jjc at jclark) * troff/groff.h: Rename to troff.h. * pic/lex.c (lookup_keyword, docmp): New functions. (get_token): Use new lookup_keyword. Don't include key.h. * pic/key.[ch], pic/pic.gperf: Deleted. * pic/Makefile: Remove gperf stuff. * pic/Makefile, pic/output.h: Move definition of TEX_SUPPORT into output.h. * pic/tex.c: Move include of pic.h before test of TEX_SUPPORT. * troff/Makefile, troff/node.c: Move definition of STORE_WIDTH into node.c. * etc/grog.pl, etc/grog.sh: Support -mdoc. Thu May 23 12:30:49 1991 James Clark (jjc at jclark) * dvi/devdvi/texr.map, dvi.devdvi/texi.map, dvi/devdvi/texb.map: Add lq and rq. dvi/devdvi: Regenerate fonts. * ps/devps/textmap: Add lq and rq. * ps/devps: Regenerate fonts. * tty/devascii/R.proto, tty/devlatin1/R.proto: Add lq and rq. * macros/tmac.e: Define \*(lq and \*(rq to be \(lq and \(rq. * pic/object.c (position_rectangle): When checking radius cope with possibility that width or height is negative. (box_object::box_object): Have separate xrad and yrad with signs matching signs of dim components. (box_object::{north,south}_{east,west}): Use xrad and yrad. (box_object::print): With rounded boxes use absolute values for dim and rad arguments. * lib/Makefile, lib/fontfile.o: Pass definition of FONTPATH in fontpath.h. * eqn/Makefile, eqn/main.c: Pass definition of DEVICE in device.h. * various files: Add explicit destructors to keep Saber CC +d happy. Wed May 22 11:37:11 1991 James Clark (jjc at jclark) * eqn/box.c (box::top_level): Restore fonts correctly after font changes in line containing inline equation. Also restore previous font as well as current font. * eqn/pbox.h: Define necessary string and register names. * troff/input.c (token::next): Case 'R' calls do_register. (do_register): New function. Tue May 21 11:28:23 1991 James Clark (jjc at jclark) * groff.c, groff.sh: Support Xps device. Allow each device to have a pseudo_name and a real_name. * groff.c (run_commands): Don't print `Broken pipe' messages. * ps/pfbtops.c: New file. * ps/Makefile: Add pfbtops. * troff/number.c (parse_term): Improved error message. Mon May 20 11:22:14 1991 James Clark (jjc at jclark) * groff.c, groff.sh, etc/grog.sh, etc/grog.pl: Support grefer. * Makefile: Integrate refer. * refer: New directory. * man/grefer.man, man/glookbib.man, man/gindxbib.man, man/lkbib.man: New files. * man/Makefile: Support refer man pages. * lib/lib.h: Declare is_prime. * lib/prime.c: New file. * troff/input.c (macro_source): New function. (init_input_requests): Bind "mso" to macro_source. * troff/env.c (environment::possibly_break_line): Maintain pointer to pointer to node to be split in ndp so as to avoid using address of freed node. * troff/env.c (environment::hyphenate_line): Maintain pointer to pointer to first node to be hyphenated in startp so as to avoid using address of freed node. * troff/env.c (class trie, class hyphen_trie): Make the elements of the trie be of type char not unsigned char. Declare arguments to be const char* instead of unsigned char *. * troff/env.c (hyphenate): Initialize hbuf[0]. * troff/input.c (set_string): Declare p to be char * and cast *p to unsigned char when necessary. * troff/input.c (do_define_macro): Declare s to be const char*. Cast element to unisgned char when necessary, Declare d to be an int. Handle EOF better. * troff/Makefile, troff/input.c: Different scheme for passing definitions of MACROPATH, HYPHENFILE and DEVICE. Tue May 14 13:41:36 1991 James Clark (jjc at jclark) * tty/devascii/R.proto: Delete entry for em. * tty/devlatin1/R.proto: Likewise. Sat May 11 11:13:28 1991 James Clark (jjc at jclark) * troff/input.c (translate): Stop when we get a space. Treat eof like newline. * macros/tmac.an (IP): Only pass quoted argument to TP when \n(.$>1. Wed Apr 24 19:24:33 1991 James Clark (jjc at jclark) * tbl/main.c (process_format): A font name following a `f' modifier that starts with a digit can be only one character long. Also deal with EOF on the second character of the font name. Wed Apr 17 11:23:43 1991 James Clark (jjc at jclark) * troff/input.c (token::next): Turn \~ into an unbreakable_space_node. * troff/node.c (unbreakable_space_node): New class. * troff/node.h: Declare it. Tue Apr 16 10:47:12 1991 James Clark (jjc at jclark) * dvi/dvi.c (dvi_printer::set_char): Make code an int. Check that it's >= 0, before outputting it as a single byte. Mon Apr 15 11:20:23 1991 James Clark (jjc at jclark) * lib/font.c: Make font_char_metric::code an int. (font::get_code): Change return type to int. (font::load): Allow code to be arbitrary integer. * lib/font.h (font::get_code): Change return type to int. (font::number_to_index): Change argument type to int. * troff/input.c (token::next): In case 'N', allow any value. Store value in token::val. (token::operator==): For TOKEN_NUMBERED_CHAR test equality of val. (token::get_char, token::add_to_node_list, token::process): Get number from val. (charinfo::set_number): Change argument to int. (charinfo::get_number): Require that NUMBERED flag be set. (get_charinfo_by_number): Store numbered characters not between 0 and 255 in a dictionary. * troff/charinfo.h (get_charinfo_by_number): Change argument type to int. (charinfo::number): Change type to int. (charinfo::set_number): Change type of set_number to int. * troff/node.c (troff_output_file::put_char_width, troff_output_file::put_char): Test whether character is numbered using charinfo::numbered(). * driver/printer.c (printer::set_numbered_char): Allow arbitrary values of num. * lib/nametoindex.c: New implementation to cope with arbitrary number characters. * troff/input.c (token::operator==): Test val for TOKEN_CHAR_HEIGHT, TOKEN_CHAR_SLANT, TOKEN_FONT_POSITION, and TOKEN_SIZE. * man/Makefile: Add definition of BROKEN_SPOOLER_FLAGS. (.man.n): sed out @BROKEN_SPOOLER_FLAGS@. Sun Apr 14 12:57:00 1991 James Clark (jjc at jclark) * ps/devps/zapfdr.ps: Don't copy UniqueID. Avoid use of newdict variable. * all Makefiles: rm targets of cp and >. * xditview/xtotroff.c (MapFont): Unlink troff_name before opening it. * eqn/lex.c (def_table): Add dollar. Sat Apr 13 13:02:44 1991 James Clark (jjc at jclark) * troff/input.c (do_width): Push back newline before closing delim like do_bracket. Fri Apr 12 15:16:03 1991 James Clark (jjc at jclark) * groff.c (possible_command::prepend_arg): New function. (main): Prepend device -m option. * groff.sh: Put device -m options before command-line options. Tue Apr 9 10:24:43 1991 James Clark (jjc at jclark) * macros/tmac.an (IP): Quote argument to TP. * ps/ps.c (main): New option -b, which sets... (broken_flags): New variable. (ps_printer::~ps_printer): Incorporate the setup section in the prolog if (broken_flags & NO_SETUP_SECTION). (ps_printer::begin_page): Generate {Begin,End}PageSetup comments. (ps_printer::merge_download_fonts, ps_printer::merge_import_fonts, ps_printer::merge_ps_fonts, ps_printer::print_font_comment, ps_printer::print_needed_font_comment, ps_printer::print_supplied_font_comment, ps_printer::print_include_font_comments, ps_printer::lookup_doc_font, ps_printer::download_fonts, ps_printer::read_download_file, read_document_fonts, add_font, skip_line, parse_fonts_arg, document_font::document_font, document_font::~document_font, document_font::download, ps_output::include_file): Deleted. (ps_printer::~ps_printer): Generate %%EOF. Generate %!PS-Adobe-3.0 rather than %!PS-Adobe-2.0. Make calls to resource_manager::need_font for each font that we used. Replace calls to merge_ps_fonts, merge_download_fonts, print_font_comment, print_supplied_font_comment, print_needed_font_comment by call to resource_manager::print_header_comments. Output %%Orientation comment. Output %%Requirements: numcopies comment if ncopies > 1. Don't output the prolog directly. Instead call resource_manager::output_prolog. Only define #copies when ncopies > 1. Delete calls to print_include_font_comments and download_fonts. Add call to resource_manager::document_setup. (ps_printer::do_file): Call resource_manager::import_file instead of including it ourselves. (ps_printer::do_import): Likewise. Also don't call merge_import_fonts. Push userdict on the dictionary stack before and pop it afterwards. Move declaration of ps_output into ps.h. * ps/psrm.c: New file implementing resource_manager class. * ps/ps.h: New file declaring ps_output and resource_manager classes. * ps/devps/zapfdr.ps: * ps/devps/symbolsl.ps: * ps/devps/prologue: Use 3.0 conventions. * ps/Makefile: Pass definition of BROKEN_SPOOLER_FLAGS in DEFINES. Add default definition of BROKEN_SPOOLER_FLAGS. * Makefile: New variable BROKEN_SPOOLER_FLAGS. Add BROKEN_SPOOLER_FLAGS to SUBFLAGS. Mon Apr 8 09:26:54 1991 James Clark (jjc at jclark) * etc/grog.pl: New file. * Makefile (GROG): New variable. Add GROG to SUBFLAGS. * etc/Makefile (GROG): New variable. (install.nobin): Install $(GROG) rather than grog.sh. Thu Apr 4 11:36:45 1991 James Clark (jjc at jclark) * eqn/special.c (special_box::compute_metrics): Make the input and output strings the same. Get the new height and depth from the predefined height and depth registers. Also make subscript kern and skew available. (special_box::compute_subscript_kern, special_box::compute_skew): New functions. * eqn/box.c (pointer_box::compute_skew, simple_box::compute_metrics, box::top_level) * eqn/text.c (prime_box::compute_metrics, prime_box::comput_subscript_kern) * eqn/limit.c (limit_box::compute_metrics): * eqn/delim.c (build_extensible, delim_box::compute_metrics): * eqn/sqrt.c (sqrt_box::compute_metrics): Protect possibly negative numbers in `nr' requests with a leading 0. Wed Apr 3 15:58:23 1991 James Clark (jjc at jclark) * eqn/special.c: New file. * eqn/eqn.y: Declare token SPECIAL. Make it right associative. Add new rule for simple. * eqn/lex.c (token_table): Add SPECIAL. * eqn/box.h: Declare make_special_box. * eqn/Makefile: Add special.[co]. Sat Mar 30 10:57:53 1991 James Clark (jjc at jclark) * ps/devps/prologue: Possibly set packing to true while defining. Create grops dictionary here. Initialize local variables before defining procedures. (PICTURE): Rename to PBEGIN. Also do save, noop showpage, count the dictionary stack. Set strokeadjust and overprint to false if the relevant operators are defined. (PEND): New procedure. * ps/ps.c (ps_printer::~ps_printer): In the prolog just include prologue. Do everything else in the setup section. (ps_printer::do_import): Just call PBEGIN and PEND around the picture. Also push userdict before, and pop it afterwards. Wed Mar 27 07:59:50 1991 James Clark (jjc at jclark) * troff/node.c (bracket_node::tprint): Brackets were being printed 1m too low. * macros/tmac.an (SH, SS): Set fill mode. Tue Mar 26 07:46:31 1991 James Clark (jjc at jclark) * troff/div.c (top_level_diversion::begin_page): Set high_water_mark to 0. Fri Mar 22 09:19:46 1991 James Clark (jjc at jclark) * man/mdate.sh: New file. * man/mdate.c: Deleted. * man/Makefile: Use mdate.sh instead of mdate. (mdate): Deleted. * eqn/lex.c (do_gsize): Supply missing argument to error message. Tue Mar 19 11:06:50 1991 James Clark (jjc at jclark) * man/mdate.c: New file. * man/*.man: Replace modification date by @MDATE@. * man/Makefile (.man.n): Replace @MDATE@ by `mdate $<`. (mdate): New target. * lib/font.c (text_file::next): Deal with arbitrarily long lines. Remove invalid input characters. Mon Mar 18 08:32:25 1991 James Clark (jjc at jclark) * macros/tmac.s (pg*start-col): Do .ns *after* running the hooks. Sat Mar 16 03:52:25 1991 James Clark (jjc at jclark) * troff/div.c (begin_page): Change behaviour when !first_page_begun and !break_flag. * troff/input.c (do_name_test): Return 0 if argument is empty. * troff/input.c (read_long_escape_name): Require closing ] to be at same input level as opening [. * troff/input.c (read_increment_and_escape_name): New function. (get_copy, process_input_stack): Use this for \n. Fri Mar 15 00:31:48 1991 James Clark (jjc at jclark) * troff/div.c (top_level_diversion::begin_page): Ignore the current value of page_number if !first_page_begun. * groff.c (main): Fix declaration of buf. * troff/input.c (do_name_test): New function. (token::next): Implement \A. (token::next): Implement \e by turning it into a TOKEN_ESCAPE. (token::description, token::add_to_node_list, token::process): Handle TOKEN_ESCAPE. * troff/token.h: New token TOKEN_ESCAPE. Thu Mar 14 10:22:26 1991 James Clark (jjc at jclark) * pic/main.c (do_picture): Allow space before and after filename following `<'. Check that the filename is not empty. Wed Mar 13 12:49:40 1991 James Clark (jjc at jclark) * Version 1.01 released. * dvi/devdvi/CompileFonts: Add cm*ss10 fonts. * dvi/tmac.dvi: ftr HR to H. * macros/tmac.e: Round up computation of $r. * xditview/tmac.X: Don't give up completely in compatibility mode. Use \n(.s instead of \n[.s]. * dvi/tmac.dvi: Don't give up completely in compatibility mode. Use \(ci instead of \[ci]. Use \n(.s instead of \n[.s]. Add u to factors inside \s[...]. Rename frac to dvi-frac. Translate \(FM onto \[prime] and \(!/ onto \[slashnot]; use these short names in the char definitions. * ps/tmac.ps: Don't give up completely in compatibility mode. Fix the fraction definitions to use \n(.s and \(f/. Add an extra quote in front of \n(.s. Add u to factors inside \s[...]. Mon Mar 11 12:01:20 1991 James Clark (jjc at jclark) * tty/tmac.tty: Call the nroff request. * macros/tmac.e ((x, )x): Better definitions that work properly in a diversion. (@0, @1): Helper macros for (x. * macros/tmac.e ($s, hl): Use \l rather than \D. * tty/tmac.tty: Make it work better in compatibility mode. (pchar): Rename to tty-char. * macros/tmac.e (@E): New macro. (r, i, b, rb, bi): Use @E. * macros/tmac.e (@F): Don't use (;...) syntax. * macros/tmac.e: Remove mention of \*(||/revisions. Mention that it was modified for groff. * macros/tmac.e: Make sure \n(ps and \n(es are >= \n(.V. * macros/tmac.e (<., .>): Removed. ([., .]): If \n(.V>=1v, use [] instead of superscripting. * macros/tmac.e: Remove check that groff is being used. * macros/tmac.e (@C): Change families only if using groff; turn compatibility mode off while changing families. Save compatibility mode before changing families and restore it afterwards. * macros/tmac.e (@h): Remove test for offset + line length. * macros/tmac.e (sorry): Rename to @S. Use \$1 instead of \$0 (lo, th, ac): Define to call @S instead of using als. * macros/tmac.e: Make $r and $R now contain \n(.v*100/\n(.sp, ie the ratio of the vertical spacing to the point size in units expressed as a percentage. Use these instead of $10r and $10R, Delete $10r and $10R. * lib/font.c (font::load): In default computation of space_width, divide by sizescale. Use scale_round. * macros/tmac.an (TP): Don't call `nf'. (an-do-tag): Don't call `fi'. Sun Mar 10 09:52:35 1991 James Clark (jjc at jclark) * troff/input.c (process_input_stack): Handle the case where spaces at the beginning of an input line are followed by a newline. Thu Mar 7 20:18:07 1991 James Clark (jjc at jclark) * groff.c (device_table): Add PIC_X_OPTION for dvi device. * groff.sh: Use pic -x with the dvi device. * dvi/devdvi/FontMakefile (H): Don't use -s. * dvi/devdvi/HI, dvi/devdvi/HB: New files. * dvi/devdvi/Makefile: Add HI and HB to FONTS. * dvi/devdvi/FontMakefile: Add rules for HI and HB. Include these in FONTS. Mon Mar 4 13:20:14 1991 James Clark (jjc at jclark) * ps/psfig.diff: New file. * ps/tmac.psfig: New file. Sat Mar 2 00:15:09 1991 James Clark (jjc at jclark) * macros/tmac.s (]=, ref*do-tl, ref*bib-print): Deleted. (]-): Don't call ref*do-tl. * macros/tmac.s (ref*end-print): Use XP if [F not defined. * macros/tmac.s (ref*normal-print): Call FS rather than fn@do-FS. (fn@do-FS): Rename to fn*do-FS. * troff/input.c (transparent_translate): New function. (process_input_stack): Apply transparent_translate before calling diversion::transparent_output(unsigned char). Wed Feb 27 00:13:25 1991 James Clark (jjc at jclark) * troff/input.c (do_define_macro): Define the macro before calling skip_line. * xditview/Makefile: Add DEVICES variable. Change install target to use this. Tue Feb 26 10:46:22 1991 James Clark (jjc at jclark) * groff.c (run_commands): Handle the possibility that there are child processes other than those forked by us. Sun Feb 24 21:32:30 1991 James Clark (jjc at jclark) * lib/string.c (string::append): New function. * lib/stringclass.h: Declare it. Thu Feb 21 11:49:26 1991 James Clark (jjc at jclark) * eqn/main.c (main): New option -N which sets no_newline_in_delim_flag. (do_file): If no_newline_in_delim_flag is set don't allow newlines in delimiters. * groff.c (main): Pass -N on to eqn. (help, synopsis): Mention -N. * groff.sh: Implement -N. Wed Feb 20 15:16:10 1991 James Clark (jjc at jclark) * macros/tmac.s (]=, ref*bib-print, ref*do-tl): New macros. (]-): Call ref*do-tl if ref*need-tl is non-zero. (XP): Allow as initializer. Tue Feb 19 14:09:06 1991 James Clark (jjc at jclark) * troff/env.c (environment::wrap_up_field): If field_spaces are non-zero and we have a current_tab, subtract padding from tab_distance. If this makes tab_distance <= 0, use the next tab stop instead. If there isn't any next tab or it's a left tab, wrap up the current tab. (environment::start_field): Initialize tab_precedes_field. (environment::wrap_up_tab): If there's a current field, update pre_field_width, field_distance and tab_precedes_field. * troff/env.h (environment::tab_precedes_field): New member. Fri Feb 15 01:24:00 1991 James Clark (jjc at jclark) * ps/ps.c (ps_printer::do_file): New function. (ps_printer::special): Bind to `file' special. (ps_printer::do_exec): Set ndefined_styles to 0. Sat Feb 9 03:03:04 1991 James Clark (jjc at jclark) * eqn/text.c (split_text): Grok \* and similar escapes sequences. Avoid stripping first character from the start of unrecognized escapes. Use lex_error instead of error to report errors. * eqn/lex.c (get_token): Rework handling of escapes. (lex_error): Move declaration into... * eqn/eqn.h. * xditview/xditview.c (main): Make -page option work. * Makefile: Correct comment about -DBROKEN_SPOOLER and pageview. Wed Feb 6 12:28:43 1991 James Clark (jjc at jclark) * macros/tmac.s (B2): Correct size of box. Tue Feb 5 00:37:35 1991 James Clark (jjc at jclark) * macros/tmac.s (B2): Postpone drawing the box until in the top-level diversion. * tty/tmac.tty: Add font translations for C, CR, CW. * groff.c (synopsis, help): Document -i. * groff.sh: Implement -i. * macros/tmac.s (@NH): Put a `.' after multi-part numbers. Simplify the construction of SN. * troff/number.c (parse_term): Give `|' a higher precedence. * tbl/table.c (numeric_text_entry::simple_print): Parenthesise accordingly. * macros/tmac.s (B2): Use par@finish instead of par@reset. Mon Feb 4 12:36:09 1991 James Clark (jjc at jclark) * lib/string.c (string::move): New function. * lib/stringclass.h: Declare it. Sat Feb 2 16:02:16 1991 James Clark (jjc at jclark) * troff/env.c (distribute_space): Add optional argument `force_forward'. (environment::wrap_up_field): Call distribute_space with `force_forward' argument of 1. Fri Feb 1 19:36:33 1991 James Clark (jjc at jclark) * lib/string.c, lib/stringclass.h (string::operator+=(char)): Inline it. Move reallocation into... (string::grow1): New function. * pic/Makefile, tbl/Makefile, eqn/Makefile, ps/Makefile: Redo dependencies to include library header files. * lib/Makefile: Make string.c and lf.c depend on stringclass.h. Thu Jan 31 15:02:27 1991 James Clark (jjc at jclark) * macros/tmac.s (@NH): Use the same number registers than -ms does for the heading level counters. Use the same string that -ms does for the number for this heading. Wed Jan 30 14:25:40 1991 James Clark (jjc at jclark) * lib/new.c (operator new): Cast result of malloc to char *. * troff/input.c (spring_trap, lookup_request): Add assert that nm is not null. Tue Jan 29 18:08:05 1991 James Clark (jjc at jclark) * groff.c (main): Support -i. Sun Jan 27 13:23:17 1991 James Clark (jjc at jclark) * pic/pic.h: Include . * ps/ps.c: Add declaration of mktemp. * Makefile: Add -DHAVE_UNION_WAIT option for CPPDEFINES. * groff.c: If HAVE_UNION_WAIT is defined, declare wait()'s argument as union wait *. (run_commands): If HAVE_UNION_WAIT is defined cast wait()'s argument to union wait *. Sat Jan 26 12:04:52 1991 James Clark (jjc at jclark) * tty/tmac.tty: Add definition of \(co. * pic/object.c (make_arc): Only increase radius when radius strictly less than d. (arc_object::update_bounding_box): May need to add 4.0 to end_quad more than once. * troff/env.c (environment::environment(symbol), environment::environment(const environment *)): Initialize input_trap_count. Sat Jan 19 08:18:35 1991 James Clark (jjc at jclark) * tbl/main.c (main): Add exit(0). * ps/ps.c (ps_printer::~ps_printer): Use fseek instead of rewind. * pic/main.c (main): * eqn/main.c (main): * tbl/main.c (main): * etc/soelim.c (main): * driver/printer.c (printer::~printer): * troff/node.c (real_output_file::~real_output_file, real_output_file::flush): Check for errors on stdout. * most files: Add 1991 to copyright notice. * macros/tmac.s: Don't test \n(.x and \n(.y. * troff/input.c (token::next): Rename `escape_char' label to `handle_escape_char' and `normal_char' label to `handle_normal_char'. Thu Jan 17 15:46:35 1991 James Clark (jjc at jclark) * groff.c (main, synopsis, help): Support -a option. * groff.sh: Likewise. Also eliminate Zflag variable by adding -z to trflags while parsing options. Tue Jan 15 13:07:27 1991 James Clark (jjc at jclark) * troff/number.c (parse_term): With `m', `M' and `n' scale indicators, convert scale factor to hunits before scaling. Mon Jan 14 12:39:12 1991 James Clark (jjc at jclark) * lib/font.c (scale_round): Better test for overflow when n is negative. Thu Jan 10 11:10:56 1991 James Clark (jjc at jclark) * tbl/main.c (process_format): Add second argument of type options*. Change callers. Allow opt->tab_char as well as '\t' between format items. Mon Jan 7 12:30:18 1991 James Clark (jjc at jclark) * macros/tmac.an (PD): With no arguments, make sure register PD is at least \n[.V]. (TH): Call PD with no argument, instead of setting register PD directly. Sun Jan 6 11:18:39 1991 James Clark (jjc at jclark) * Version 1.00 released. Sat Jan 5 08:44:30 1991 James Clark (jjc at jclark) * ps/tmac.ps, xditview/tmac.X: Add font translation of C to CR. * dvi/devdvi/DESC: Mount CW instead of CR. * dvi/tmac.dvi: Add definition of \(tm. * dvi/devdvi/texsy.map: Add lh, and rh. * dvi/devdvi/texex.map: Add lt, rt, lb, rb, lk, rk. * dvi/devdvi/texmi.map: Add *o. Regenerate fonts. * dvi/devdvi/FontMakefile: Generate H from cmss10. * dvi/devdvi/Makefile: Install H. * dvi/devdvi/H: New file. Fri Jan 4 15:04:57 1991 James Clark (jjc at jclark) * troff/env.c (vertical_spacing): Don't allow vertical spacing to be 0. Thu Jan 3 13:41:19 1991 James Clark (jjc at jclark) * macros/tmac.s (@EN): Add \n(.V to the argument to ds@need. * macros/tmac.pic (PS): Avoid attempting to set negative indent. * macros/tmac.s (@EN): Handle the case where the equation is empty but the label is not. Wed Jan 2 10:31:44 1991 James Clark (jjc at jclark) * troff/groff.h: New warning category WARN_SPACE. * troff/input.c: Add WARN_SPACE to DEFAULT_WARNING_MASK. Add WARN_SPACE to warning_table. (interpolate_macro): Give a warning of type WARN_SPACE if the name is longer than two characters and is not defined, but the first two characters do make a defined name. * PROBLEMS: New file. * CHANGES: New file. * README-0.6, README-1.00: Deleted. * groff.c, groff.sh: Add X75-12 and X100-12 devices. * xditview/devX75/Makefile: Make devX75-12. * xditview/devX100/Makefile: Make devX100-12. * xditview/devX100/eqnchar, xditview/devX75/eqnchar, dvi/devdvi/eqnchar, ps/devps/eqnchar: Remove use of \R. Tue Jan 1 19:24:01 1991 James Clark (jjc at jclark) * README-0.7: Rename to README-1.00. * macros/tmac.pic: New file. * macros/Makefile (install.nobin): Install tmac.pic. Mon Dec 31 10:40:53 1990 James Clark (jjc at jclark) * troff/env.c (hyphen_word): Correct the test for whether the token is a hyphen. Reset npos to 0. * macros/tmac.s (par@sup-start, par@sup-end): New implementations. Sun Dec 30 15:53:13 1990 James Clark (jjc at jclark) * macros/tmac.s (ds*common-end): Call par*reset. (PE): Likewise. (par@reset-indent): Deleted. * macros/tmac.s (@IP): Divert the label. Sat Dec 29 14:33:32 1990 James Clark (jjc at jclark) * xditview/draw.c (setGC): Use a line width of .1m rather than .04m by default; round rather than truncate value. * tbl/table.c (class empty_entry): New class. (empty_entry::empty_entry, empty_entry::line_type): New functions. (table::add_entry): Represent empty entries by objects of type empty_entry. (table_entry::line_type): Return -1. (table::determine_row_type): Ignore entries with line_type 0. Treat type -1 as non-lines. Fri Dec 28 15:04:41 1990 James Clark (jjc at jclark) * ps/devps/textmap, xditview/libXdvi/DviChar.c, tty/devlatin1/R.proto, macros/tmac.s: Rename \(-d to \(Sd. Thu Dec 27 12:35:47 1990 James Clark (jjc at jclark) * ps/devps/textmap: Add `sd', `/_' and `3d' characters. * xditview/libXdvi/DviChar.c: Likewise. * dvi/devdvi/texsy.map: Add `<<', `>>'. Wed Dec 26 13:33:23 1990 James Clark (jjc at jclark) * troff/div.c (top_level_diversion::begin_page): Call init_output() if the_output is 0. Sat Dec 22 12:35:29 1990 James Clark (jjc at jclark) * troff/input.c: Replace ESCAPE_E by ESCAPE_e and ESCAPE_C by ESCAPE_c. (get_copy): Turn \E into ESCAPE_E. (token::process, asciify): Handle ESCAPE_E. * macros/tmac.s (ds*common-end, par@reset): Add `.rj 0'. (RD): New macro. (DS): Implement `.DS R'. Fri Dec 21 11:41:53 1990 James Clark (jjc at jclark) * macros/tmac.s (FS): New macro. * macros/tmac.s (fn@do-FS): Use @LP instead of LP. * macros/tmac.s (cov*tl-init): Remove after first execution instead of aliasing to @nop. Call top of page macro explicitly instead of setting trap; call @init first. Set pg@top as top of page macro. (cov*auto-init): Deleted. Set cov*tl-init instead of cov*auto-init as top of page trap. (TL, LP): Do a break instead of calling cov*tl-init. (cov*print): With RP format but no TL, alias FS and FE to @FS and @FE; in this case also give a warning and always start another page. No need to set pg@top here. (cov*tl-init): Rename to cov*first-page-init. * macros/tmac.s (RP): Do `.pn 0'. (cov*tl-init): With RP format don't do `.pn 0'. * macros/tmac.s (pg@cs-top): Set no space mode. * macros/tmac.s (par@TL, par@AU, par@AI): New macros. (cov*ab-init): Alias TL, AU and AI to these. Thu Dec 20 10:10:50 1990 James Clark (jjc at jclark) * macros/tmac.s (@EQ): Move the space before the equation into @EN (@EN): Do nothing unless \n[dl] is > 0. Tue Dec 18 12:20:47 1990 James Clark (jjc at jclark) * pic/object.c (ellipse_object::radius): New function. * VERSION: Change version to 0.7. * tbl/table.c (block_entry::do_divert): Declare return type as void. (block_entry::divert, alphabetic_block_entry::divert): Return 1. Mon Dec 17 12:30:34 1990 James Clark (jjc at jclark) * troff/column.c: New file. * troff/Makefile: Corresponding changes. * troff/hvunits.c (scale(vunits, vunits, vunits)): New function. Friend of vunits. * troff/div.c (top_level_diversion::space): If the space causes the first-page transition and springs a trap, truncate the space to 0. Fri Dec 14 12:30:02 1990 James Clark (jjc at jclark) * ps/ps.c (ps_printer::do_import): Add a `clear' after including the document. * pic/troff.c (troff_output::line_thickness, troff_output::set_fill): Do a horizontal motion to compensate for the width of the \D escape sequence. Thu Dec 13 10:17:14 1990 James Clark (jjc at jclark) * xditview/tmac.X: Reinstate definition of \(rn, but only for X100 (not X75). * eqn/sqrt.c (sqrt_box::compute_metrics): Supply missing argument to printf. * tbl/table.c (simple_entry::simply_print): Don't declare as pure. Supply empty definition. (text_entry::simple_print, simple_text_entry::simple_print): Delete declarations. (table::add_entry): Represent empty entries by objects of type `simple_entry'. Wed Dec 12 08:50:48 1990 James Clark (jjc at jclark) * troff/Makefile: Remove -DHYPHEN_CONTROL from DEFINES. * tbl/table.c (left_text_entry::add_tab): New function. * macros/tmac.s: Make @RT an alias for par@reset. Make RT initialize like LP. Mon Dec 10 11:19:55 1990 James Clark (jjc at jclark) * troff/env.c (environment::start_field): Give an error message if there is no next tab. Sun Dec 9 11:46:40 1990 James Clark (jjc at jclark) * troff/env.c (hyphenate): Skip initial elements with zero hyphenation code. * macros/tmac.s (par@init): Keep VS in points rather than units. Sat Dec 8 23:00:27 1990 James Clark (jjc at jclark) * pic/main.c (main): Implement `-c' option. * pic/output.h: Declare make_tpic_output(). * pic/tex.c (tex_output::set_pen_size): Make it virtual and protected. (tpic_output): New class. (tpic_output::tpic_output, tpic_output::set_pen_size, tpic_output::command, make_tpic_output): New functions. Fri Dec 7 11:57:41 1990 James Clark (jjc at jclark) * tbl/main.c (main): Call `.ab' if \n(.g is false. Define TS/TE if they're not already defined. * tbl/table.c (init_output): Don't test \n(.g. * troff/input.c (do_if_request): Delete `g' condition. Recognize `d', `r' and `c' conditions even in compatibility mode. Tue Dec 4 09:13:47 1990 James Clark (jjc at jclark) * ps/tmac.ps (ps-bb): Protect against negative numbers in bounding box. Mon Dec 3 07:18:26 1990 James Clark (jjc at jclark) * troff/env.h (environment::prev_line_interrupted): New member. (environment::get_prev_line_interrupted): New function. * troff/env.c (environment::newline): Set prev_line_interrupted. (environment::environment(const environment *), environment::environment(symbol)): Initialize prev_line_interrupted. * troff/input.c (process_input_stack): Don't give special treatment to space and newline at the beginning of the line if the previous line was interrupted. Sat Dec 1 15:48:37 1990 James Clark (jjc at jclark) * eqn/eqn.y: Disallow PRIME by itself. * eqn/lex.c (token_table): Bind `opprime' instead of `prime' to PRIME. (def_table): Remove definition of '. Define prime to be `. * eqn/eqn.y: Split off part of rule `script' into a new rule `nonsup'. Fri Nov 30 10:23:44 1990 James Clark (jjc at jclark) * macros/tmac.s ({, }): New string aliases. Thu Nov 29 11:34:40 1990 James Clark (jjc at jclark) * README-0.7: New file. Wed Nov 28 10:09:57 1990 James Clark (jjc at jclark) * macros/tmac.s: New file. * man/groff_ms.man: New file. * Makefile: Add definition of TMAC_S. Pass TMAC_S in SUBFLAGS. * Makefile.bd: Similarly. * man/Makefile: Add groff_ms.n to MAN7PAGES. Replace @TMAC_S@. Add definition of TMAC_S. * macros/Makefile: Add definition of TMAC_S. Install tmac.s. * macros/TODO: New file. Sat Nov 24 20:04:54 1990 James Clark (jjc at jclark) * troff/env.c (right_justify): New function. (init_env_requests): Bind this to request "rj". (center_lines): Set right_justify_lines to 0. If we get a bad integer, center 1 line. (environment::environment(symbol), environment::environment(const environment *)): Initialize right_justify_lines. (environment::get_right_justify_lines): New function. (init_env_requests): Bind this to number_register ".rj". * troff/env.c (environment::choose_breakpoint): Implement hyphenation_margin and hyphenation_space. (environment::get_hyphenation_space, environment::get_hyphenation_margin): New functions. (init_env_requests): Bind these to .hys and .hym. (hyphenation_space_request, hyphenation_margin_request): New functions (init_env_requests): Bind these to hys and hym. (environment::environment(symbol), environment::environment(const environment *)): Initialize hyphenation_margin and hyphenation_space. * troff/env.h: Corresponding changes to class environment. Fri Nov 23 09:08:16 1990 James Clark (jjc at jclark) * troff/div.c (blank_line): Always do a break. * eqn/box.c (do_text): Turn off escapes while appending text to string. Thu Nov 22 10:58:59 1990 James Clark (jjc at jclark) * troff/input.c (while_break_request, while_continue_request): New functions. (init_input_requests): Bind these to "break" and "continue". (while_depth, while_break_flag): New variables. (while_request): Update while_depth. Break out of loop if while_break_flag is set. Wed Nov 21 10:54:40 1990 James Clark (jjc at jclark) * tbl/table.c (init_span_reg): Initialize span_width_reg to \n(.H rather than 0. Mon Nov 19 00:45:03 1990 James Clark (jjc at jclark) * Makefile: Include -DBROKEN_SPOOLER by default. Expand comment. * stringify: New file. * Makefile (groff.o): Use stringify. * xditview/tmac.X: Remove definition of \(rn. * xditview/libXdvi/DviChar.c: Remove radicalex from Adobe_symbol_map. Sat Nov 17 10:44:58 1990 James Clark (jjc at jclark) * tbl/table.c (table::add_entry): Allow alphabetic text blocks. (alphabetic_block_entry::alphabetic_block_entry, alphabetic_block_entry::divert, alphabetic_block_entry::print): New functions. (block_entry::divert): Split off body into ... (block_entry::do_divert): If the block is alphabetic, subtract 2n from the line length; also update the span width to dl+2n, and the alphabetic span width to dl. * driver/input.c (do_file): While reading argument to D command, when expanding buffer, multiply szp by sizeof(int) rather than 2 in the argument to memcpy. * tbl/table.c (compute_span_width): Add 2n rather than 1n to the width of alphabetic columns. Fri Nov 16 06:34:27 1990 James Clark (jjc at jclark) * troff/node.c (lookup_family): Supply second argument to lookup. * troff/dictionary.c (dictionary::lookup): After an unsuccessful search, return immediately if v is 0. * pic/troff.c: Define EQN_NO_EXTRA_SPACE_REG. (troff_output::start_picture): Set this reg. (troff_output::end_picture): Remove this reg * eqn/box.c (box::extra_space): Don't produce `\x's if EQN_NO_EXTRA_SPACE_REG is defined. * eqn/eqn.y: Allow just a PRIME to be a `simple'. * eqn/text.c (split_text): Map ' to \(fm when it's the first character. Thu Nov 15 10:35:06 1990 James Clark (jjc at jclark) * macros/tmac.e: Use font 3 instead of B in $c. Remove `bd' requests. * troff/div.c (top_level_diversion::top_level_diversion): Initialize page_number to 0. Wed Nov 14 21:41:58 1990 James Clark (jjc at jclark) * groff/troff (environment::environment(const environment *)): Initialize name to e->name, rather than "anonymous". Sat Nov 10 01:59:37 1990 James Clark (jjc at jclark) * xditview/libXdvi/Dvi.c (ShowDvi): If eof is encountered, reset requested_page. Split middle part into ... (FindPage): New function. (SetValues): If we don't yet know the last page, and the requested page is greater than the current page, call FindPage. Update the font_map_string before doing this. * xditview/tmac.X: Add definitions of \(sq, \(ga, \(dg and \(dd. Translate \(lh and \(rh into left and right double arrows. * troff/node.c (class hyphen_inhibitor_node): New class. (hyphen_inhibitor_node::hyphen_inhibitor_node, hyphen_inhibitor_node::copy, hyphen_inhibitor_node::same, hyphen_inhibitor_node::type, hyphen_inhibitor_node::get_hyphenation_type): New functions. (node::add_discretionary_hyphen): Use hyphen_inhibitor_node rather than dbreak_node(0, 0) to represent a `\%' at the beginning of a word. Fri Nov 9 16:05:38 1990 James Clark (jjc at jclark) * troff/node.h (dummy_node::get_hyphenation_type, transparent_dummy_node::get_hyphenation_type): Declare them. * troff/node.c: (dummy_node::get_hyphenation_type, transparent_dummy_node::get_hyphenation_type): New functions. Wed Nov 7 10:09:06 1990 James Clark (jjc at jclark) * xditview/libXdvi/draw.c: If M_PI not defined after including math.h, then define it. * xditview/Makefile: Add definition of AR. Pass it to the submake in libXdvi. * xditview/libXdvi/Makefile: Add definitions of AR and RANLIB. Tue Nov 6 10:14:27 1990 James Clark (jjc at jclark) * troff/dictionary.h (object_dictionary::alias): Declare return value as int. * troff/dictionary.c (object_dictionary::alias): Return non-zero if the old name was defined. * troff/input.c (alias_macro): Give a warning if the old name was not defined. * troff/reg.c (alias_reg): Likewise. Mon Nov 5 00:31:39 1990 James Clark (jjc at jclark) * troff/input.c (token::next): Delete implementation of \R. * macros/Makefile: Strip comments from tmac.e while installing it. * troff/input.c: New variable `nroff_mode'. (troff_request, nroff_request): New functions. (init_input_requests): Bind `troff' and `nroff' to troff_request and nroff_request. (do_if_request): Compute results of t and n conditions from nroff_mode. * text/text.c (split_text): Fix typo in >=. * eqn/lex.c: Add definition of `==' to def_table. Fri Nov 2 02:49:09 1990 James Clark (jjc at jclark) * pic/tex.c (tex_output::start_picture): Change the definitions of \graph and \graphtemp so that they work properly with Plain TeX. * pic/tex.c (tex_output::solid_arc): Ensure that the second angle argument to `ar' is not less than the first. * pic/pic.y: Allow a comma between elements of the variable list in the argument to `reset'. * pic/object.c (arc_object::arc_object): Fix computation of radius. * eqn/main.c (main): Add exit(0). Thu Nov 1 02:03:50 1990 James Clark (jjc at jclark) * troff/div.c (begin_page): Test no_space_mode after doing the break, but still push the page ejector cookie before doing the break. Also set the next page number after doing the break. * xditview/xditview.c (NewFile): Don't set the title and icon name if this is the first file and its name is `-'. * groff/groff.c: Define a new device flag XT_OPTION. Set it for the X75 and X100 devices. (main): If a device has the XT_OPTION flag set and there's exactly one file argument, pass the driver -xrm and -title options to set the icon name and window title to the name of the file. * troff/env.c (environment_switch): If there was an argument but it wasn't a valid number or name, then pop an environment but don't give an error message on underflow. * troff/number.c (start_number): Correct spelling in error message. * troff/input.c (token::delimiter): Don't print an error message if err is false. * xditview/libXdvi/parse.c (ParseInput): In case 'D', only call ParseDrawFunction if dw->display_enable is true. Wed Oct 31 05:49:50 1990 James Clark (jjc at jclark) * pic/pic.y: Parse text positioning like normal attributes, so as to allow `"text" at 0,0 ljust'. Don't allow `center' as a positioning attribute. Mon Oct 29 22:50:38 1990 James Clark (jjc at jclark) * tbl/main.c (process_data): When in state START while reading a text block, don't change to state MIDDLE if c is a newline. Sun Oct 28 21:59:56 1990 James Clark (jjc at jclark) * dvi/dvi.c (dvi_printer::begin_page): Rename `i' variable to `j' so as to avoid shadowing parameter. Wed Oct 24 18:35:39 1990 James Clark (jjc at jclark) * tbl/table.c (trim_space): Deleted. (table::add_entry): Don't call trim_space. Mon Oct 22 03:48:39 1990 James Clark (jjc at jclark) * VERSION: Change version to 0.6. * troff/number.c (parse_expr): Make == work. Sat Oct 20 11:28:17 1990 James Clark (jjc at jclark) * man/grog.man: New file. * man/Makefile: Add grog.n to MAN1PAGES. * etc/grog.sh: New file. * etc/Makefile: Install grog.sh as grog. Fri Oct 19 11:17:15 1990 James Clark (jjc at jclark) * troff/input.c (token::next): Implement \E. Thu Oct 18 11:56:24 1990 James Clark (jjc at jclark) * xditview/tmac.X: Change font translations to match tmac.ps. * troff/input.c (non_empty_name_warning): Don't give a warning if `\{' terminates the name. Tue Oct 16 10:04:23 1990 James Clark (jjc at jclark) * ps/devps/symbol.diff: New file. * ps/devps/FontMakefile: Mention symbol.diff. Sun Oct 14 11:46:46 1990 James Clark (jjc at jclark) * troff/node.c (font_position): Use get_long_name to read the external_name. * troff/env.c (environment_switch): If we get a number that's < 0 or >= NENVIRONMENTS, treat it like a name. Change NENVIRONMENTS to 10. * troff/groff.h: Remove definition of FONTS_MAX. * troff/node.h (class font_family): Make map a pointer instead of an array. Add a map_size member. Make it a class. Make nm const and public. Make invalidate_fontno a friend. * troff/node.c: Define font_table_size. Make font_info a pointer rather than an array. (class troff_output_file): Allocate font_position dynamically. Add nfont_positions member. (troff_output_file::set_font): Grow font_position if necessary. (troff_output_file::~troff_output_file): Delete font_position. (troff_output_file::troff_output_file): Allocate font_position. (grow_font_table): New function. (troff_output_file::really_begin_page, troff_output_file:really_copy_page): Use nfont_positions rather than FONTS_MAX. (mount_font_no_translate, mount_style): Call grow_font_table if necessary. (font_family::font_family): Allocate map. (font_family::make_definite): Grow map if necessary. Use font_table_size instead of FONTS_MAX. (font_family::~font_family): New function. (invalidate_fontno): Use font_family::map_size. (get_fontno, env_space_width, env_half_narrow_space_width, env_narrow_space_width, symbol_fontno, is_good_fontno, get_bold_fontno, make_glyph_node): Use font_table_size rather than FONTS_MAX. (next_available_font_position): Never return 0. Fri Oct 12 10:17:52 1990 James Clark (jjc at jclark) * ps/tmac.ps: Add font translations for compatibility with dpost. Thu Oct 11 12:09:03 1990 James Clark (jjc at jclark) * eqn/pile.c: Rename default_baseline_sep to baseline_sep. Move BASELINE_SEP_FORMAT and COLUMN_WIDTH_FORMAT into pbox.h. Move definitions baseline_sep, shift_down, column_sep, matrix_side_sep into... * eqn/box.c: Add them to param_table. * eqn/pbox.h: Add declarations to pbox.h. * troff/input.c (set_string): Cast value to unsigned char *. * troff/token.h (process_input_stack): Declare it static before declaring it a friend. Wed Oct 10 09:59:13 1990 James Clark (jjc at jclark) * dvi/devdvi/texex.map: Fix positions of extensible brace middle and bottom. * dvi/devdvi/EX: Regenerate. * troff/input.c (init_charset_table): Make ", ', ), ], *, \(dg transparent. Tue Oct 9 08:34:02 1990 James Clark (jjc at jclark) * eqn/lex.c: In defaults_table, make definition of `dot' call `dot_def'. Don't explicitly make it roman. Similarly for other accents. * pic/lex.c (for_input::for_input): Add by_is_multiplicative argument. (for_input::get, for_input::peek): Use this. (do_for): Add by_is_multiplicative argument. * pic/pic.y: Change optional_by clause to allow '*' after `by'. Change semantic value of optional_by to be a double plus a flag saying whethet the by clause is multiplicative. * eqn/lex.c (get_delimited_text): Remember location of start of definition. Improve error handling when EOF is encountered. * lib/font.h: Rename handle_x_command to handle_unknown_font_command. * lib/font.c (font::load): Call handle_unknown_font_command for any unknown command in the font description file. Don't call handle_x_command. Include the name of the command in the argv. Improve message for unknown command after kernpairs or charset command. * ps/ps.c (ps_font::handle_x_command): Rename to handle_unknown_font_command. Remove message about `x download' command. Give error message for wrong number of arguments. * ps/devps/afmtodit: Generate `encoding' instead of `x encoding'. * dvi/dvi.c (dvi_font::handle_x_command): Rename to handle_unknown_font_command. Give an error message for wrong number of arguments. Rename design_size to designsize. * dvi/tfmtodit.c (main): Generate `checksum' instead of `x checksum', `designsize' instead of `design_size'. Mon Oct 8 00:38:55 1990 James Clark (jjc at jclark) * eqn/*.[chy]: Change underaccent to uaccent. * eqn/eqn.y: Add rule for underaccent. Declare UNDERACCENT token; give it the same precedence as ACCENT. * eqn/other.c (make_underaccent_box): New function. * eqn/box.h: Declare it. * eqn/lex.c: Add UNDERACCENT to token_table. Add utilde to def_table. Sun Oct 7 11:25:16 1990 James Clark (jjc at jclark) * pic/pic.y (reset_all): New function. Called in rule for RESET. (parse_init): Call reset_all. (define_variable): When defining scale reset only those pre-defined variables that are scaled. (defaults_table): Add `scale' as non-scaled value. * pic/pic.y: Redo parsing of text adjustments: parse adjustments together with the text; allow any number of positioning words; allow center as a positioning word. * pic/object.c (output::compute_scale): Get picture maximum height and width from variables called maxpswid and maxpsht. * pic/pic.y: Add maxpswid and maxpsht to defaults_table. Sat Oct 6 10:16:56 1990 James Clark (jjc at jclark) * pic/object.c (object_spec::make_text): Multiply textht by number of text items. * pic/pic.y: Allow `sprintf("string", expr,...)' wherever text can occur. (do_sprintf): New function. (pic.gperf): Add sprintf token. (text, sprintf): New rules. * pic/pic.y: `rand()' with no arguments returns a random number in the range [0,1). * pic/pic.y: Allow a bare expression to be an attribute: change precedences to support this. Change optional_ordinal rule to optional_ordinal_last to avoid reduce/reduce conflict. * pic/object.c (object_spec::object_spec): Initialize direction. * pic/pic.y: Implement ^ operator meaning exponentiation. * troff/node.h: Add default argument to mount_font. * troff/node.c (font_position): Read an optional third argument giving the external_name. (mount_font): Add optional argument giving the external_name. (mount_font_not_translate): Have additional argument giving external name. Use this name to load the font. Pass both names to font_info::font_info. (font_info::font_info): Have additional argument giving external_name. (class tfont): New member external_name. (font_info::get_tfont): Use external name to construct tfont_spec. Fri Oct 5 04:03:13 1990 James Clark (jjc at jclark) * eqn/lex.c (init_table): Add argument giving device. Define name of device to be "1". (do_ifdef): Counts as true if the argument has been defined with `define'. * eqn/main.c (main): Call init_table with device argument. Make device local to main. * eqn/eqn.h: Change declaration of init_table. Remove declaration of device. * pic/lex.c (get_delimited): Allow text to be delimited by matching {}s. Don't recognize ending delimiter within a string. * troff/input.c (get_delim_name): New function. (token::next): Implement \C. * lib/font.c (font::load): Grok ---. Add an alias for each character based on its code. (font::get_code_width): Deleted. * lib/font.h (class font): Declare font::number_to_index(). Remove declaration of font::get_code_width. * lib/nametoindex.c (font::name_to_index): Add 512 rather than 256 to indices of named characters. (font::number_to_index): New function. * troff/input.c (font::number_to_index): New function. (get_charinfo_by_number, charinfo::get_number, charinfo::set_number): New functions. (token::next): Turn \N into a TOKEN_NUMBERED_CHAR. (token::process, token::description, token::get_char, token::add_to_node_list, token::operator==): Handle TOKEN_NUMBERED_CHAR. * troff/charinfo.h: Declare get_charinfo_by_number, charinfo::get_number, charinfo::set_number. Add NUMBERED flag to charinfo class. (charinfo::numbered): New function. * troff/token.h: Add TOKEN_NUMBERED_CHAR. * troff/env.h (class environment): Remove declaration of ... * troff/env.c (environment::make_numbered_char_node): Deleted. * troff/node.c (make_numbered_node): Deleted. (class numbered_glyph_node): Remove. (troff_output_file::put_char_width, troff_output_file::put_char): Handle numbered chars. (troff_output_file::numbered_char): Removed. (tfont::get_code_width): Removed. (make_glyph_node): Don't search special fonts for numbered characters. * troff/node.h: Remove declaration of make_numbered_node. * driver/input.c (do_file): Handle N command. * driver/printer.h: Add declaration of ... * driver/printer.c (printer::set_numbered_char): New function. * dvi/tfmtodit.c (main): Generate unnamed entries. * ps/devps/afmtodit: Likewise. * xditview/xtotroff.c (MapFont): Likewise. * xditview/libXdvi/parse.c (ParseInput): Grok N command. * tbl/main.c (process_format): If multiple widths are specified for a column but all the widths are the same, don't give an error message. * tbl/table.c (table::do_row): If the current row is all lines and the stuff doesn't contains a line, mark the top of the row after printing stuff before the row. If the current row is not all lines and the stuff doesn't contain a line, don't unnecessarily mark the top of the row before printing the stuff. Mon Oct 1 11:42:00 1990 James Clark (jjc at jclark) * troff/groff.h: Remove MAX_PATH. * troff/input.c (open_file): Dynamically allocate space for the path. (open_mac_file, process_macro_file): Corresponding changes. Sun Sep 23 18:56:26 1990 James Clark (jjc at jclark) * troff/node.h (class output_file): Make copy_file pure. Add vspace method ifdef COLUMN. Add is_printing method. * troff/node.c: Add class printing_reg. Add class real_output_file. Derive other output_file classes from real_output_file; in these classes rename begin_page to really_begin_page, print_line to really_print_line, copy_file to really_copy_file, transparent_char to really_transparent_char. Move output_file::flush to real_output_file. Add printing member to class output_file. * troff/div.h: Remove printing member from top_level_diversion. Add vspace member function to class diversion ifdef COLUMN. Add some declarations ifdef COLUMN. * troff/div.c (top_level_diversion::copy_file, top_level_diversion::transparent_output, top_level_diversion::output): Don't test printing member before output. * troff/input.c: Handle initial variable_space_request ifdef COLUMN. * troff/Makefile: Add column.c but comment it out. Add -DCOLUMN but comment it out. Sat Sep 22 11:32:22 1990 James Clark (jjc at jclark) * troff/div.c (diversion::need): Make any space forced. If we sprung a trap, set truncated_space to minus the distance to the trap and set needed_space to the amount that was needed. (top_level_diversion::space): A forced space turns no_space_mode off. (class constant_vunits_reg): New class. (init_div_requests): Implement number registers .trunc and .ne using constant_vunits_reg. (class truncated_space_reg): Deleted. * troff/div.h: Don't have a no_space_mode member in diversion. Instead have it in top_level_diversion. * troff/div.c (diversion::diversion): Don't initialize no_space_mode. (top_level_diversion::top_level_diversion): Initialize no_space_mode. (no_space, restore_spacing): Do nothing if curdiv != topdiv. (macro_diversion::output): Don't clear no_space_mode. * troff/input.c (diverted_space_node::reread): Don't call environment::do_break. In fill mode, act like a blank line. (diverted_copy_file_node::reread): Don't call environment::do_break. * troff/div.c (blank_line): New function. * troff/div.h: Declare it. * troff/input.c (process_input_stack): Call it. * troff/div.c (truncated_space_reg::get_string): New function. (init_div_requests): Bind to .trunc. (space_request, top_level_diversion::space, top_level_diversion::output, macro_diversion::space, macro_diversion::output): Update truncated_space. (macro_diversion::output): Redo calculations when trap sprung. (macro_diversion::output, macro_diversion::space): No need for trap_flag. * troff/div.c (top_level_diversion::output): Set nl_reg_contents after truncating post line spacing. Fri Sep 21 11:27:25 1990 James Clark (jjc at jclark) * ps/devps/prologue (MF, SF): Make them work even if setfont is defined as a procedure rather than as an operator. Thu Sep 20 12:55:05 1990 James Clark (jjc at jclark) * troff/div.c (macro_diversion::space): Ignore no_space_mode. Wed Sep 19 10:54:37 1990 James Clark (jjc at jclark) * troff/div.c (top_level_diversion::output): Merge output_file::print_line and output_file::end_of_line member functions. * troff/div.h (class output_file): * troff/node.c (troff_output_file::print_line, troff_output_file::end_of_line, output_file::end_of_line, ascii_output_file::print_line, suppress_output_file::print_line): Corresponding changes. Tue Sep 18 11:31:47 1990 James Clark (jjc at jclark) * troff/input.c (token::next): Don't give a warning for `\.'. * troff/env.c (environment::get_center_lines): New function. (init_env_requests): Bind number register .ce to it. * troff/env.h: Declare it. * tbl/table.c (table::init_output): Define reset macro to restore .ce. If center option not given, store .ce in SAVED_CENTER_REG. Then do .ce 0. (table::print): If center option not given, then imply center option if SAVED_CENTER_REG > 0. Mon Sep 17 09:19:19 1990 James Clark (jjc at jclark) * ps/devps/Makefile: Remove T from FONTS. Remove TSymbol.ps and Troff.ps from DOWNLOAD. * troff/Makefile: Change comment in DEFINES to avoid confusing System V make. * ps/ps.c (ps_printer::do_exec): Allow newlines within PostScript code. Don't try to catch errors with stopped. (check_line_lengths): New function. * ps/devps/prologue (EXEC): Deleted. (EBEGIN, EEND): New procedures. Sun Sep 16 14:51:15 1990 James Clark (jjc at jclark) * troff/input.c: Include request.h before node.h. * troff/node.c: Likewise. * troff/env.c: Likewise. * troff/div.c: Likewise. * troff/node.h (class special_node): Store argument as a macro rather than a char *. * troff/node.c (special_node::special_node, special_node::copy): Grok this. (special_node::~special_node): Deleted. (special_node::tprint): Deleted. (special_node::tprint_start, special_node::tprint_end, special_node::tprint_char): New functions. (troff_output_file::special): Deleted. (troff_output_file::start_special, troff_output_file::end_special, troff_output_file::special_char): New functions. * troff/input.c (special_node::tprint): New function. (do_special): Use macro not char *. (do_transparent_macro): Deleted. (token::next): Don't call do_transparent_macro. * troff/input.c (token::next): Add 'Y' case. (do_transparent_macro): New function. * troff/node.c (troff_output_file::special): Handle newlines with argument using new continuation convention. * driver/input.c (get_string): Cope with continuation convention. (do_file): Don't call skip_line after calling get_string(1). * ps/ps.c (ps_printer::special, ps_printer::do_import, ps_printer::do_def, ps_printer::do_exec): Cope with newlines in arg. * xditview/libXdvi/parse.c (ParseInput): Ignore lines starting with +. Sat Sep 15 19:00:10 1990 James Clark (jjc at jclark) * troff/input.c (asciify): By default, invalid input characters should return empty string. * troff/input.c (copy_file): Handle first page transition like title. (token::next, process_input_stack): Grok COPY_FILE_REQUEST. * troff/input.c (token::next): Improve error message for EOF after escape character. (input_char_description): New function. (get_char_for_escape_name): Use input_char_description. (token::next): Warn about unrecognized escape sequences. (warning_table): Add WARN_ESCAPE. * troff/groff.h: Declare WARN_ESCAPE. Change WARN_TOTAL accordingly. * troff/token.h: Remove declaration of process_input_stack. * troff/input.c: Remove declaration of init_hyphen_requests. * troff/request.h: Correct spelling in declaration of same. * troff/input.c (token::next): Check whether escape_char is 0. Fri Sep 14 12:09:25 1990 James Clark (jjc at jclark) * groff.c (main, usage, help): Implement -P and -L options. * groff.sh: Likewise. * troff/input.c (token::next): Use some gotos to avoid code duplication. * troff/input.c (get_long_name, get_name, read_long_ecsape_name): Avoid calling symbol::symbol if name empty. Thu Sep 13 06:21:45 1990 James Clark (jjc at jclark) * troff/input.c (init_input_requests): Make \n(.x return the major version number and \n(.y return the minor version number. * troff/Makefile: Construct file majorminor.c defining major_version and minor_version automatically from ../VERSION. * troff/node.c (class glyph_node): Make operator new and operator delete public. (class ligature_node): Similarly. * troff/input.c (operator==(const macro &, const macro &)): New function. (non_interpreted_node::same): Use this. (string_iterator::string_iterator): Make macro& argument const. * troff/input.c (input_iterator::get): New function. Don't make asciify_macro or class non_interpreted_node friends of class input_iterator. (non_interpreted_node::interpret): Use input_iterator::get. (asciify_macro): Likewise. * troff/input.c (~token_node, ~string_iterator, ~arg_list, ~non_interpreted_node): Deleted. * troff/node.c: (~suppress_output_file, ~ascii_output_file): Deleted. * troff/symbol.h: Make all symbol member functions const. * lib/strtol.c: New file. * lib/Makefile: Add strtol.c. * Makefile: Define STRTOL as strtol.o to include strtol in libgroff.a. Wed Sep 12 10:00:49 1990 James Clark (jjc at jclark) * pic/troff.c (troff_output::simple_circle): Divide by scale. Tue Sep 11 14:17:16 1990 James Clark (jjc at jclark) * troff/input.c (do_special): Use input_level. * troff/token.h (TOKEN_BACKSPACE): New token. (token::backspace): New function. * troff/input.c (token::description, token::next, token::process): Grok TOKEN_BACKSPACE. (do_special): Turn TOKEN_BACKSPACE back into \b. * troff/token.h (token::leader): New function. * troff/input.c (do_special): Turn TOKEN_LEADER back into \001. * troff/input.c (do_special): Turn TOKEN_TAB back into \t. * troff/input.c (do_special): Use token::description in error message. Mon Sep 10 11:06:27 1990 James Clark (jjc at jclark) * troff/input.c (decode_args): Combine quoted and quote_input_level variables. Make it a for (;;) loop. * troff/input.c (get_char_for_escape_name): Check for \001 and \b. * troff/input.c (read_long_escape_name): The test for whether to expand buffer was off by 1. (read_string): Similarly. Fri Sep 7 11:45:50 1990 James Clark (jjc at jclark) * troff/input.c: Use `const int' rather than `static const int'. * troff/div.h (diversion::copy_file): Declare as pure virtual. (macro_diversion::copy_file): New function. * troff/node.h: New class diverted_copy_file_node. * troff/node.c: Implement it. * troff/input.c (copy_file): Use diversion::copy_file. Handle first page transition by pushing a diverted_copy_file_node. * troff/input.c (token::next, process_input_stack): Don't handle COPY_FILE_REQUEST. Thu Sep 6 13:29:10 1990 James Clark (jjc at jclark) * ps/ps.c (flush_sbuf): Remember to add sbuf_kern when checking whether space widths need adjusting. * troff/charinfo.h: Generalize translated_to_space to special_translation so as to allow translation to \&. * troff/input.c (translate): Allow translation to \&. (charinfo::*): Corresponding changes. * troff/node.c (make_node, node::add_char): Corresponding changes. * troff/node.h (dummy_node::dummy_node): Allow optional first argument. * lib/lib.h: Make codes 0200 to 0237 invalid input characters. * troff/token.h: Remove TOKEN_TITLE. Remove token::title. Add TOKEN_REQUEST. * troff/input.c (token::next): Turn a TITLE_REQUEST into a TOKEN_REQUEST with an argument of TITLE_REQUEST. (token::process): Grok that. * troff/input.c (copy_file): Handle first page transition like title by pushing a COPY_FILE_REQUEST cookie. (token::next, process_input_stack): Grok that. * troff/node.h (output_file::copy_file): Add x and y arguments. Make it non-pure. * troff/div.c (top_level_diversion::copy_file): Supply them. * troff/node.c (troff_output_file::copy_file): Add x and y arguments; moveto specified position. Invalidate font_position array after copying file. (output_file::copy_file): New function. (suppressed_output_file::copy_file, ascii_output::copy_file): Removed. * troff/input.c (transparent_file): New function. (init_input_requests): Bind to "trf". (token::next): Handle TRANSPARENT_FILE_REQUEST cookie. (process_input_stack): Likewise. * troff/Makefile: Add ../lib/lib.h to GROFF_H. * troff/node.c (init_node_requests): New number registers .kern pointing to global_kern_mode, and .lg pointing to global_ligature_mode. * troff/node.c (ligature): Don't change it if we get a bad integer. * troff/input.c (do_define_string): Don't strip tabs. * troff/input.c (asciify_macro): Make the string_iterator auto. * troff/node.c (init_font_requests): Rename to... (init_node_requests): * troff/node.h: Change declaration. * troff/input.c (main): Change call. * troff/input.c (node::reread, diverted_space_node::reread): New methods. (process_input_stack): Call reread rather than get_diverted_space_node. * troff/node.c (node::get_diverted_space_node, diverted_space_node::get_diverted_space_node): Removed. * troff/node.h: Declare reread methods instead of get_diverted_space_node methods. Make `n' member private. * troff/input.c: (token::diverted_space): Removed. * troff/token.h: Removed declaration. Tue Sep 4 00:48:04 1990 James Clark (jjc at jclark) * eqn/script.c (script_box::compute_metrics): Don't let SUP_RAISE_FORMAT become negative. * tbl/table.c (table::do_row): Entries that don't end in the this row shouldn't make the row non-blank. * tbl/table.c (table::make_columns_equal): Only set the width of columns which are marked as equal. * tbl/main.c (process_data): Before issuing excess data error, if last character was a newline unget it; then get it again after the error. Also include the contents of the entry in the message. * groff.c: New file. * Makefile: Build groff from groff.c. Make it possible to use either groff.sh or groff.c as groff. * Makefile.bd: Similarly. Mon Sep 3 09:39:49 1990 James Clark (jjc at jclark) * groff.sh: Don't delay expansion of $@ in assignment to files. Remove occurrences of \". Sun Sep 2 09:56:59 1990 James Clark (jjc at jclark) * all Makefiles: Simplify and rearrange. * Makefile: Handle fmod like malloc. * lib/Makefile: Similarly. * lib/fmod.c: Remove #ifdef NEED_FMOD. * Makefile: Rename OPTIMISE to OPTIMIZE. * groff.sh: Remove assignment to PATH. * Makefile: Remove SHPATH variable. * Makefile.bd: Similarly. * groff.sh: Add -V option to print the pipeline instead of executing it. Fri Aug 31 00:56:46 1990 James Clark (jjc at jclark) * lib/font.c: Split off file searching into ... * lib/fontfile.c: New file. * lib/strerror.c (strerror): Use `Error %d' for unknown errors. Thu Aug 30 13:13:55 1990 James Clark (jjc at jclark) * tbl/table.c (table::do_hspan): Delete assertion that e != 0. Also change misleading comment. (table::do_vspan): Change similarly misleading comment. * tbl/main.c (process_data): A format row with an explicit `s' uses up a data line, even if all the other columns are `_' or `='. * troff/input.c (token::description): Fix description of TOKEN_DUMMY and TOKEN_EMPTY. Wed Aug 29 04:12:08 1990 James Clark (jjc at jclark) * groff.sh: Fix description of -Z in help message. Tue Aug 28 07:28:33 1990 James Clark (jjc at jclark) * pic/object.c (object_spec::make_object): Allow negative and zero line thicknesses. * pic/pic.y: Give linethick default value of -1.0. * pic/troff.c (troff_output::troff_output): Initialize last_line_thickness to BAD_THICKNESS. (troff_output::finish_picture): Set thickness to BAD_THICKNESS. (troff_output::line_thickness): Canonicalize negative thicknesses to RELATIVE_THICKNESS. * pic/tex.c (tex_output::set_pen_size): Silently map negative line thicknesses to DEFAULT_PEN_SIZE. Canonicalize negative pen sizes to -1.0. (tex_output::start_picture): Set pen_size to -2.0. * ps/ps.c (ps_printer::set_line_thickness): If line_thickness is 0, then use 0 linewidth. (ps_printer::ps_printer): Initialize line_thickness to -1. * pic/troff.c (troff_output::simple_ellipse): Divide by scale. * ps/devps/symbolchars: Remove `or'. * ps/tmac.ps: Implement \(or with .char. * ps/devps/symbolchars: Move most characters into textmap. * ps/devps/textmap: Add names for troff bracket characters. Remove ul, ru, br, bv. * ps/devps/TSymbol.ps: Removed. * ps/devps/FontMakefile: Make S from Symbol not TSymbol. * ps/tmac.ps: Do with .char what TSymbol did. * ps/devps/download: Remove TSymbol. * ps/devps/T: Removed. * ps/devps/Troff.ps: Removed. * ps/devps/Troff.afm: Removed. * ps/tmac.ps: Implement \(ru, \(ul, and \(br with .char. * ps/devps/download: Remove Troff. * ps/devps/FontMakefile: Remove T target. * ps/devps/DESC-A4: Remove T from font list. * ps/devps/DESC-letter: Likewise. * troff/input.c (macro_to_node): Rename to ... (charinfo_to_node): Don't pass mac argument. Temporarily remove the character's definition while processing it. * troff/node.c (node::add_char, make_node): Change calls to macro_to_node accordingly. * troff/input.c (token::next): Translate \_ to \(ul. * tty/devascii/R.proto: Add `|'. * tty/devlatin1/R.proto: Likewise. Mon Aug 27 11:25:41 1990 James Clark (jjc at jclark) * man: Put the version number in all the man pages. Sun Aug 26 11:40:05 1990 James Clark (jjc at jclark) * Makefile.bd: New file. * README.bd: New file. * VERSION: New file. * lib/version.c: Removed. * lib/Makefile: Create version.c from ../VERSION. Remove version.c in clean target. * troff/input.c (main): Get hyphen_file from GROFF_HYPHEN environment variable. * all Makefiles: Split install target into install.bin for binaries, and install.nobin for everything else. * Makefile: Add bindist target. * man/afmtodit.man: New file. * man/Makefile: Add afmtodit.n to MAN1PAGES. * ps/devps/Makefile: Add textmap to DEVICEFILES. Install afmtodit in BINDIR. * ps/Makefile: Pass BINDIR to make install in devps. * ps/ps.c (ps_printer::set_char): Do nothing if the character is the space character. * ps/devps/FontMakefile: Rename symbol.afm to tsymbol.afm. Sat Aug 25 15:39:03 1990 James Clark (jjc at jclark) * ps/ps.c: Redo font downloading. * ps/devps/download: New file. * ps/devps/Makefile: Add download to DEVICEFILES. * ps/devps/afmtodit: Remove -d option. * ps/devps/FontMakefile: Don't use -d option with afmtodit. * ps/devps/symbosl.ps: Add %%DocumentFonts comment. * ps/devps/zapfdr.ps: Likewise. * ps/devps/TSymbol.ps: Likewise. Fri Aug 24 20:10:30 1990 James Clark (jjc at jclark) * groff.sh: Initialize dev to ${GROFF_TYPESETTER:-@DEVICE@}. Thu Aug 23 10:03:47 1990 James Clark (jjc at yquem) * ps/ps.c (ps_output::include_file): If BROKEN_SPOOLER is defined, then strip the first line if it starts with %. * Makefile: Add a comment about this. * man/tfmtodit.man: New file. * man/Makefile: Add tfmtodit.n to MAN1PAGES. * dvi/Makefile: Install tfmtodit in BINDIR. * dvi/tfmtodit.c (usage): Mention -v option. Wed Aug 22 09:56:36 1990 James Clark (jjc at yquem) * troff/node.c (troff_output_file::end_of_line): Call do_motion. * troff/node.c (troff_output_file::transparent_char): Don't call flush_tbuf. * eqn: Add check_tabs method to most box classes. * eqn/box.c (box::top_level): Call check_tabs. * eqn/script.c (script_box::output): Use \Z. * eqn/limit.c (limit_box::output): Use \Z. * eqn/box.c (box::top_level): Use itoa. Tue Aug 21 09:29:28 1990 James Clark (jjc at yquem) * dvi/tmac.dvi: Add font translations for CR, C, TT. * dvi/devdvi/Makefile: Don't make links to CW. * ps/tmac.ps: Add font translations for C, CW, CO, CX, CD, H, HO, HX, HD. * xditview/tmac.X: Likewise. * troff/node.c: Add font translation feature. (get_font_translation): New function. (symbol_fontno): Translate the font name. (mount_font_no_translate): Rename to mount_font to this. (mount_font): New function. (font_family::make_definite): Call mount_font_no_translate instead of mount_font. (mount_style): Translate the font name. (font_translate): New function. (init_font_requests): Bind "ftr" to font_translate. * ps/devps/prologue (SN): New procedure that rounds a position to the nearest (pixel + (.25,.25)). (DL): Use SN to round endpoints. * lib/version.c: Changed version to 0.5. Sat Aug 18 04:43:21 1990 James Clark (jjc at yquem) * Makefile: Move definition of PAGE to the very beginning, so that people are less likely to miss it. Fri Aug 17 02:15:11 1990 James Clark (jjc at yquem) * man/Makefile: Don't need to sed out @UPCASE_PROG_PREFIX@. * troff/env.c (environment::choose_breakpoint): Make `can't find breakpoint' error a warning of type WARN_BREAK. Change message to `can't break line'. * troff/groff.h: Declare WARN_BREAK with code 4; change WARN_INPUT to code 040000. * troff/input.c: Add WARN_BREAK to warning_table. Include WARN_BREAK in DEFAULT_WARNING_MASK. * tty/tmac.tty: Add definition of \(+-. * groff.sh: Remove `--' option to set command. * dvi/devdvi/texsy.map: Remove duplicate md entry. * ps/devps/eqnchar: Better definition of cdot using md. * dvi/devdvi/eqnchar: Likewise. * xditview/devX100/eqnchar: Likewise. * xditview/devX75/eqnchar: Likewise. * eqn/lex.c: Add definition of cdot. Thu Aug 16 09:33:57 1990 James Clark (jjc at yquem) * troff/input.c (get_optional_char): New function. * troff/input.c (set_page_character): Use get_optional_char(), rather than has_arg() and tok.get_char(1). * troff/env.c (tab_character, leader_character, hyphen_char, field_characters): Likewise. (margin_character): Likewise. Also always delete the margin_character_node. * troff/input.c (token::get_char): Use token::description. * troff/input.c (has_arg): Don't skip over tab and \}. * troff/number.c (start_number): Give a warning if the number starts with \} (WARN_RIGHT_BRACE) or tab (WARN_TAB). Wed Aug 15 10:04:37 1990 James Clark (jjc at yquem) * troff/input.c (empty_name_warning, non_empty_name_warning): New functions. (get_name, get_long_name): Use these. Rename `warn' argument to `required'. * troff/node.c (get_fontno): Test that the symbol is not null. * troff/input.c (token::description): New function. * troff/number.c (parse_term): Use token::description in `numeric expression expected' message. * troff/groff.h: Add WARN_MISSING. * troff/number.c (start_number): New function. * troff/number.c (get_vunits, get_hunits, get_number, get_integer, get_incr_number): Use start_number(). * troff/input.c (DEFAULT_WARNING_MASK): Enable WARN_NUMBER by default. * troff/input.c (get_name, get_long_name): Use WARN_MISSING. * troff/reg.c (alter_format): Use WARN_MISSING. Also use token::descripion. * troff/input.c (token::get_char): Use WARN_MISSING. * troff/input.c (token::delimiter): Use token::description. * troff/env.c (environment_switch): Back out Aug 3 change. * troff/input.c (has_arg): Skip over \}s and tabs but give a warning. * troff/token.h (token::tab): New function. * troff/node.c (get_fontno): Use tok.skip() rather than has_arg(). * troff/reg.c (alter_format): Likewise. * troff/node.c (bold_font): Use has_arg() rather than tok.skip(). Tue Aug 14 10:11:21 1990 James Clark (jjc at yquem) * troff (most files): Redo warnings. Divide warnings into various categories; warning() has an additional first argument indicating the category it falls into. * troff/input.c (main): -w now takes an argument. New option -W. (enable_warning, disable_warning): New functions. * ps/devps/afmtodit: Add -a option to lie about the italic angle. * ps/devps/FontMakefile: Pretend TI has an angle of 7. Mon Aug 13 10:11:16 1990 James Clark (jjc at yquem) * ps/devps/eqnchar: Better definitions of dotdot, vec, dyad, inf. * xditview/devX100/eqnchar: Likewise. Remove definition of dot. * xditview/devX75/eqnchar: Likewise. * dvi/devdvi/eqnchar: Better definitions of vec, dyad, dotdot. * eqn/other.c: When bar or over applies to a single character don't produce an overline_box or an underline_box. Instead produce an accent_box or an underaccent_box, with the accent a line whose width is accent_width. New classes underaccent_box, overline_char_box and underline_char_box. * eqn/box.h: Move overline_box, underline_box, accent_box class declarations into eqn/other.c. Add declarations of make_underline_box, make_overline_box, make_accent_box. * eqn/eqn.y: Call make_overline_box, make_underline_box make_accent_box instead of constructors. * eqn/pbox.h, eqn/box.c: Add accent_width parameter. * eqn/other.c: Add accent_box::~accent_box. * eqn/box.h: Declare it. * groff.sh: With -Tps, use eqn -D. * eqn/other.c (overline_box::output): Use \Z. If draw_flag use \D rather than \l. (underline_box::output): Similarly. (accent_box::output): Use \Z. * xditview/tmac.X: Add definitions of ~ and ^ (so that they are a bit smaller.) Sun Aug 12 09:41:15 1990 James Clark (jjc at yquem) * troff/div.c (top_level_diversion::transparent_output(unsigned char)): Use asciify. * troff/input.c (asciify): Don't make it static. * troff/token.h (asciify): Declare it. * troff/input.c (get_name, get_long_name, token::get_char, token::delimiter): Add an extra default argument which says whether a warning should be printed. * troff: Pass a non-zero argument to one of these rather than printing a warning directly. Sat Aug 11 09:02:21 1990 James Clark (jjc at yquem) * troff: Consistently use symbol::is_null. * troff/dictionary.h: Move some inline functions into dictionary.c. * troff/request.h: Move inline functions into input.c. (request_or_macro::invoke): Make it pure. * troff/input.c, troff/reg.h: New class `constant_int_reg'. * troff/input.c (init_input_requests): Use class constant_int_reg. (class compatible_reg): Deleted. * troff/div.c (init_div_requests): Use class constant_int_reg. (class last_post_line_extra_space_reg): Deleted. * troff/env.c (tab_character): Don't change the tab character if we get an invalid argument. (hyphen_char): Similarly. * troff/reg.c (alter_format): Check that nm is not null. * Makefile, groff.sh: Make it possible to customize the commands used for printing PostScript and dvi files. Also make it possible to customize the path used by groff.sh. * eqn/eqn.y: Make `left' right associative. Fri Aug 10 18:20:39 1990 James Clark (jjc at yquem) * pic/pic.h: Added definition of M_SQRT2 for those systems that don't have it. * pic/pic.h: Removed definition of INT_MAX. * troff/node.c (italic_corrected_node::vertical_extent): Omit `return'. * troff/input.c (token::next): Handle \R like \n. Tue Aug 7 09:46:33 1990 James Clark (jjc at yquem) * ps/tmac.pc (PSPIC): Simplify. * troff/env.c (tab_stops::to_string): * pic/pic.y (object_type_name): * pic/troff.c (simple_output::line): * pic/tex.c (tex_output::spline): * pic/object.c (object_spec::make_object): * tbl/main.c (process_data): Add cases to switch statements to avoid cfront warnings. (Some of these are spurious, since the switch already has a default case.) * ps/tmac.ps (PSPIC): Reformatted. Prefix all local names with `ps-'. Don't test systat; instead check number of arguments to ps-bb. Mon Aug 6 00:13:07 1990 James Clark (jjc at yquem) * macros/tmac.e: Do not decrease the page offset by 0.5i. * ps/ps.c (ps_printer::ps_printer): Use mktemp instead of tempnam. Unlink the file as soon as we have opened it, so that we don't have to bother with signal handlers. (handler): Deleted. (fatal_error_exit): Deleted. (main): Don't call signal. * dvi/tfmtodit.c: Add -k option so that kerns with the skewchar can be ignored. * dvi/devdvi/Makefile: Use the -k option with S and MI. * pic/pic.y: If there is a label, or an nth construction before the first `.' in the argument to `with', ignore it and generate a warning. * pic/lex.c (lex_warning): New function. * tbl/table.c (table::init_output): In section keep and release macro, use 0 indent when diverting and the correct indent when rereading. * troff/input.c (interpolate_number_format): Do not interpolate anything if the number register is not defined. * tbl/main.c (process_data): Don't add entry when col >= ncolumns. Sat Aug 4 08:12:05 1990 James Clark (jjc at yquem) * ps/devps/prologue (PICTURE): Set components of graphics state to their default values. * ps/devps/text.enc: Add trademark * ps/devps/textmap: Add names for club, spade, heart, diamond, carriagereturn, suchthat. Use Upsilon1 rather than Upsilon. * ps/devps/symbolchars: Add names for summation and product. * dvi/devdvi/texsy.map: Add names for club, spade, heart, diamond, suchthat. Add pp. Add upper-case letters. * xditview/libXdvi/DviChar.c: Add names for club, spade, heart, diamond, carriagereturn, suchthat. Use Upsilon1 rather than Upsilon. * dvi/devdvi/texsy.map: Rename lA (left angle bracket) to la, and rA (right angle bracket) to ra. Introduce names for double-headed arrows and double-barred arrows: <>, va, lA, rA, hA, uA, dA, vA. * ps/devps/textmap: Likewise for ps device. * xditview/libXdvi/DviChar.c: Likewise for X100 and X75 devices. * tty/devascii/R.proto: Rename lA to la and rA to ra. * tty/devascii/R.proto: Likewise. * tty/tmac.tty: Provide definitions for \(<>, \(lA, \(rA, \(hA, \(uA, \(dA. * eqn/delim.c: In delim_table, rename \(lA to \(la and \(rA to \(ra. * xditview/tmac.X: Add definitions for \(fi \(fl \(ff \(Fi \(Fl. * eqn/lex.c: Added definitions of `approx', `grad' and `del' to def_table. Fri Aug 3 09:59:27 1990 James Clark (jjc at yquem) * troff/div.c (when_request): Use symbol::is_null rather than has_arg to determine whether we have an argument. (change_trap): Remove the trap if we get an invalid number. Give an error if we don't get at least the macro name. (diversion_trap): Remove trap if we get an invalid name or number. * troff/env.c (environment_switch): Pop if we get an invalid symbol or numeric expression. * troff/input.c (do_define_macro): If EOF is encountered while defining the macro, do tok.next() before returning. * troff/token.h (has_arg): Move definition from here, to ... * troff/input.c (has_arg): ... here * troff/env.c (space_size): Do nothing if we get an invalid argument. * troff/input.c (shift): Likewise. * pic/lex.c (get_token_after_dot): Accept `.center' as a synonym for `.c'. * pic/troff.c (troff_output::start_picture): Comment out calls to `..'. * eqn/main.c (do_file): Subtract 1 from current_lineno if interpret_lf_args succeeds. * eqn/main.c (do_file): Don't recognize delimiter if preceded by \\. This avoids problems with \$N. * groff.sh: Pass -C to preprocessors. * lib/lf.c (interpret_lf_args): Be more flexible. * tbl/main.c (main): Add -C option. (table_input::get): Do not recognize TE if followed by character other than a space or newline unless -C option given. (process_input_file): Likewise for lf, TS. (process_data): Likewise for lf in text blocks. * eqn/main.c (main): Add -C option. (do_file): Don't recognize EQ, EN or lf if followed by character other than space or newline unless -C option given. * eqn/lex.c (file_input::read_line): Similarly. * eqn/eqn.h: Declare compatible_flag. * etc/soelim.c (main): Add -C option. (interpret_lf_args): Use version in libgroff. (do_file): * pic/main.c (main): Add -C option, which sets compatible_flag. (top_input::get), (top_input::peek): If -C option not given, do not recognize .PS/.PE/.PF/.lf if followed by a character other than space or newline. * pic/lex.c (file_input::read_line): Similarly. * pic/pic.h: Add declaration of compatible_flag. Thu Aug 2 11:11:27 1990 James Clark (jjc at yquem) * ps/tmac.ps (PSPIC): Avoid use of `echo -n'. * troff/node.c, troff/node.h: Add `asciify' methods to classes derived from node. New class space_char_hmotion_node. * troff/input.c (asciify_macro): New function. * troff/input.c (init_input_requests): New request `asciify' bound to asciify_macro. * macros/mm.diff: New file. * Makefile: In install.mm target use `patch' to apply macros/mm.diff. * troff/input.c (macro::print_size): Just print the size in bytes. * troff/div.c (return_request): Correct the argument interpretation. Wed Aug 1 12:38:36 1990 James Clark (jjc at yquem) * troff/node.h (class composite_node): Add sz member. * troff/node.c (composite_node::size): Return sz. * troff/input.c (macro_to_node): Use the initial size in the environment as the size of the composite_node. * troff/node.c (node::zero_width_tprint): Provide a reasonable default. Tue Jul 31 10:07:10 1990 James Clark (jjc at yquem) * troff/div.c (change_trap): If we get a bad number expression, do nothing. Mon Jul 30 10:30:49 1990 James Clark (jjc at yquem) * lib/matherr.c (matherr): Define this only if math.h defines TLOSS. Sun Jul 29 10:34:27 1990 James Clark (jjc at yquem) * troff/div.c (macro_diversion::distance_to_next_trap): If there no diversion trap return vunits(INT_MAX - vresolution). Sat Jul 28 14:28:14 1990 James Clark (jjc at yquem) * troff/input.c (do_zero_width): New implementation that doesn't use a temporary environment. Use instead: (token::add_to_node_list): New function. * troff/env.c (environment::get_prev_char_height), (environment::get_prev_char_height), (environment::get_prev_char_skew): New functions. (environment::get_prev_char): New function. (environment::get_prev_char_width): Change to use get_prev_char. (init_env_request): Implement new registers .cht, .cdp, .csk. * eqn/sqrt.c (sqrt_box::output): Don't rely upon the argument to \Z being processed in a separate environment. Fri Jul 27 10:21:25 1990 James Clark (jjc at yquem) * tbl/table.c: Removed TABLE_BOTTOM_REG. * tbl/table.c (table::init_output): In the section release macro, give a warning message if the section won't fit on one page. * tbl/table.c (table::do_top): Emit table keep only if table is boxed. (table::do_bottom): Likewise for table release. (table::table), (table::add_vertical_rule): Remove reference to keep member. * tbl/table.h: Remove keep member. * tbl/table.c: New register SUPPRESS_BOTTOM_REG. In SECTION_RELEASE_MACRO, if there's not enough space before the next trap to output the diversion, call T# ourselves, set SUPPRESS_BOTTOM_REG to 1, spring the trap, then set SUPPRESS_BOTTOM_REG back to 0. In T#, do nothing if SUPPRESS_BOTTOM_REG is non-zero. In T#, always mark the current vertical position and return to it before turning traps on again. Thu Jul 26 02:54:32 1990 James Clark (jjc at yquem) * troff/node.c, troff/node.h: In classes derived from node, replace prev_char_width method by last_char_node method. * troff/env.c (environment::get_prev_char_width): Use node::last_char_node rather than node::get_prev_char_width. * Makefile: Added comment about -fno-inline on 68030-based Apollos. * troff/reg.c (number_format_to_ascii), eqn/delim.c (DELIM_TABLE_SIZE), tty/tty.c (tty_font::load_tty_font), dvi/tfmtodit.c (main): Cast expressions using sizeof to int. * dvi/dvi.c (dvi_font::handle_x_command): Avoid long->int warnings. * macros/tmac.e (TS): Don't move @f back past the current position. Wed Jul 25 09:11:08 1990 James Clark (jjc at yquem) * ps/ps.c (main): Buffer stderr. * dvi/dvi.c (main): Likewise. * tty/tty.c (main): Likewise. * ps/ps.c (ps_printer::do_import): Improve error handling. * troff/input.c (abort_request): Use asciify. * driver/printer.h (printer::draw), driver/printer.c (printer::draw), ps/ps.c (ps_printer::draw), dvi/dvi.c (dvi_printer::draw): Make type of first argument int rather than char. This works around a bug on the 68030 based Apollo using g++ 1.37.1. * tbl/table.h (class table): Add `keep' member. * tbl/table.c (table::table): Initialize `keep'. (table::add_vertical_rule): Set `keep' to 1. (table::do_top): Only emit table keep macro is `keep' is non-zero. (table::do_bottom): Likewise for table release macro. (table::do_row): Emit section keep macro even if the row is 0. Tue Jul 24 08:35:07 1990 James Clark (jjc at yquem) * macros/tmac.e (@C): Preserve the font family across the change in environments. Mon Jul 23 10:15:23 1990 James Clark (jjc at yquem) * lib/font.c: Initialize font::hor and font::vert to 1. (font::load_desc): Check the values of font::hor and font::vert. * lib/lib.h: Added definition of INT_DIGITS. Fix it so that it can be included in a C compilation. (iftoa): Use INT_DIGITS. Include lib.h. (itoa): Likewise. (as_string): Likewise. * tbl/table.c: Removed definition of INT_DIGITS. * eqn/box.c (box::top_level): Use INT_DIGITS + 1 instead of 12. * troff/input.c (input_input_requests): Likewise. * ps/ps.c (make_encoding_name): Likewise. (ps_printer::set_style): Likewise. (ps_output::put_number): Use 1 + INT_DIGITS + 1 instead of 12. * tty/devascii/R.proto: Map fm onto '. * tty/devlatin1/R.proto: Likewise. Sat Jul 21 12:45:07 1990 James Clark (jjc at yquem) * tbl/table.c: Use ' instead of DELIMITER_CHAR in places where the argument to \w is at a different input level. * tbl/table.c (table::init_output): Define a new macro REPEATED_VPT_MACRO, like vpt but if in a diversion also transparently outputs itself. (table::define_bottom_macro): Use REPEATED_VPT_MACRO instead of vpt. (table::do_row): Likewise. * tbl/table.c (vertical_rule::print): Prefix the .sp -1 line with TRANSPARENT_STRING_NAME. * tbl/table.c (table::init_output): In the table release macro print an error message and don't produce any output if after issuing the need request the table still will not fit. Also remove the diversion after bringing it back. * tbl/table.c (table::init_output): Define a new macro REPEATED_MARK_MACRO, like mk but if in a diversion also transparently outputs itself. (table::do_row): Mark row_top_reg using REPEATED_MARK_MACRO. This is necessary because .TH might not call .T#. (table::do_top): Likewise TOP_REG. (table::define_bottom_macro): If TOP_REG is no longer valid, use #T - DOUBLE_LINE_SEP rather than #T. This is necessary because the table header might contain just the two top rules. Fri Jul 20 10:51:42 1990 James Clark (jjc at yquem) * troff/div.c: Implement new request `ptr' to print all traps. * troff/env.c (init_env_requests): Implement `.tabs' reg with init_string_env_reg. * troff/env.c (class tab_reg): Deleted. Thu Jul 19 12:07:16 1990 James Clark (jjc at yquem) * troff/div.c: New number register .pn returns the number of the next page as set by the pn request. * macros/tmac.an: Redid headers and footers. Number each manual entry starting from 1 unless \nC is > 0, like Sun. Added an optional 5th argument to .TH which specifies the manual name and appears in the center of the header. Understand the X, P and D registers like Sun. Wed Jul 18 10:23:31 1990 James Clark (jjc at yquem) * troff/env.c (init_env_requests): New number register `.lt' to return the title length. * troff/node.h (class transparent_dummy_node): New class. * troff/node.c (class transparent_dummy_node): Provide member functions. * troff/env.c (interrupt): Add a transparent_dummy_node, rather than a dummy_node. * troff/input.c (token::next): New escape sequence \). * troff/input.c (get_copy): Recognize \) in copy mode. * troff/input.c (input_stack::clear): New function. * troff/input.c (exit_request): Use input_stack::clear. * troff/token.h: Removed TOKEN_NO_PRINT_CHAR. * troff/input.c (token::process): Removed case TOKEN_NO_PRINT_CHAR. * troff/env.c: Move set_page_character to input.c. Move page_character to input.c also. * troff/env.c (title): Split off the reading of the parts of the title into read_title_parts. * troff/input.c (read_title_parts): New function. Check the input_level when testing whether a token matches the delimiter. * troff/input.c (exit_request): New function. * troff/input.c (init_input_requests): Bind ex request to exit_request rather than exit_groff. * troff/input.c (exit_groff): Call tok.next() before process_input_stack(). Mon Jul 16 09:47:23 1990 James Clark (jjc at yquem) * troff/env.c: ifdef widow control support on WIDOW_CONTROL. * troff/env.h: ditto. * troff/input.c: ditto. * troff/env.c (environment::is_empty): Test pending_lines. * troff/env.c (environment::have_pending_lines): Removed. * troff/input.c: Add request to flush pending lines from the environment. * troff/env.c, troff/env.h: Add automatic widow control feature. * troff/input.c (exit_groff): Do process_input_stack() after do_break() but before setting exit_flag to 2. * troff/input.c: Remove FLUSH_PENDING_LINES and TOKEN_FLUSH_PENDING_LINES. Instead, flush pending lines from environment after END_TRAP token seen, but only if there aren't any more traps still unfinished. * troff/token.h: Remove TOKEN_FLUSH_PENDING_LINES. Sun Jul 15 10:50:08 1990 James Clark (jjc at yquem) * troff/env.c: Rename the `retain_size' member of class pending_output_line to `no_fill'. * troff/env.c (title): When the line is output, make the retain_size argument !fill. * troff/node.h: Add `hyphenated' member to struct breakpoint. * troff/node.c (space_node::get_breakpoints), (dbreak_node::get_breakpoints): Fill this in. * troff/env.c: Allow specification of maximum number of consecutive hyphenated lines. * troff/env.c (environment::is_empty): Add test for !current_tab. Sat Jul 14 11:23:01 1990 James Clark (jjc at yquem) * troff/env.c (environment::hyphenate_line): Don't completely give up if the word is not to be hyphenated; continue so that breaks can be made at break_char_node's. * lib/lib.h: Only define INT_MAX if it's not already defined; undef INT_MIN if it's already defined. * Makefile: Make it easy to define CFRONT_ANSI_BUG. * lib/lib.h: If CFRONT_ANSI_BUG is defined, cast INT_MIN to long. This works around a bug in AT&T C++ 2.0 used with an ANSI C compiler. * macros/tmac.an (an-header): Set no-space mode. * macros/tmac.an (TH): Start a new page if necessary. * Started using ChangeLog at version 0.4. Copyright 1990-1995 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. Local Variables: fill-column: 72 mode: change-log version-control: never End: vim:set autoindent textwidth=72: groff-1.24.1/tmac/0000755000175000017500000000000015155212142010625 500000000000000groff-1.24.1/tmac/pdf.tmac0000644000175000017500000007447115155205670012211 00000000000000.\" Configure groff output device "pdf". See gropdf(1). .ig Copyright 2011-2024 Free Software Foundation, Inc. Written by Deri James This file is part of groff, the GNU roff typesetting system. groff is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. groff is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Author's Note ============= Much of the code in this macro has come from the excellent original work by Keith Marshall (see attribution in the pdfmark.tmac file). I, however, am solely responsible for any bugs I may have introduced into this file. .. . .do nr *groff_pdf_tmac_C \n[.cp] .cp 0 . .if d pdfmark .nx . .mso ps.tmac . .char \[lh] \X'pdf: xrev'\[rh]\X'pdf: xrev' .nr pdf:bm.nl 1 .nr pdf:bm.nk 0 .de pdfmark . nop \!x X ps:exec [\\$* pdfmark .. . .ds pdf pdf.tmac\" for use in diagnostic messages . .de pdf:warn . tm \\*[pdf]:\\n[.F]:\\n[.c]: warning: \\$* .. .de pdf:error . tm \\*[pdf]:\\n[.F]:\\n[.c]: error: \\$* .. .de pdfinfo .\" ------------------------------------------------------------------- .\" Usage: .\" .pdfinfo /FieldName field content ... .\" Examples: .\" .pdfinfo /Title A PDF Document .\" .pdfinfo /Author Keith Marshall .\" ------------------------------------------------------------------- .\" .ds pdf:meta.field \\$1 .shift .ie '\\n(.z'' .pdfmark \\*[pdf:meta.field] (\\$*) /DOCINFO .el \!.pdfmark \\*[pdf:meta.field] (\\$*) /DOCINFO .rm pdf:meta.field .. .de pdfview .\" ------------------------------------------------------------------- .\" Usage: .\" .pdfview view parameters ... .\" Examples: .\" .pdfview /PageMode /UseOutlines .\" .pdfview /Page 2 /View [/FitH \n(.p u] .\" ------------------------------------------------------------------- .\" .ie '\\n(.z'' .pdfmark \\$* /DOCVIEW .el \!.pdfmark \\$* /DOCVIEW .. .\" ===================================================================== .\" Module PDFNOTE: Insert "Sticky Note" Style Comments in a PDF Document .\" ===================================================================== .\" .\" "PDFNOTE.WIDTH" and "PDFNOTE.HEIGHT" set the preferred size for .\" display of the "sticky note" pane, when opened. Acrobat Reader .\" seems not to honour these -- perhaps GhostScript doesn't encode .\" them correctly! Anyway, let's set some suitable default values, .\" in case the user has a set up which does work as advertised. .\" .\" [Deri] These dimensions are the size of the hotspot area containing .\" the popup icon, not the size of the window containing the popup .\" text, so ... .\" .nr PDFNOTE.WIDTH 1c .nr PDFNOTE.HEIGHT 1c .\" .\" "pdf:bbox" defines the expression used to set the size and location .\" of the bounding rectangle for display of notes and link "hot-spots". .\" This is defined, such that a note is placed at troff's current text .\" position on the current page, with its displayed image size defined .\" by the "PDFNOTE.WIDTH" and "PDFNOTE.HEIGHT" registers, while the .\" bounds for a link "hot-spot" are matched to the text region which .\" defines the "hot-spot". .\" .ds pdf:bbox \\n[pdf:llx] u \\n[pdf:lly] u \\n[pdf:urx] u \\n[pdf:ury] u .\" .\" Getting line breaks into the text of a PDFNOTE is tricky -- we need .\" to get a "\n" into the Postscript stream, but three levels of "\" are .\" swallowed, when we invoke "pdfnote". The following definition of "PDFLB", .\" (for LineBreak), is rather ugly, but does allow us to use .\" .\" .pdfnote Some text.\*[PDFLB]Some more text, on a new line. .\" .ds PDFLB \\012 .\" .\" "PDFNOTE.COLOUR" must be set to a sequence of three values, .\" each in the range 0.0 .. 1.0, representing the red, green, and .\" blue components of the colour specification in the RGB colour .\" domain, which is shared by "groff" and the PDF readers. .\" .ds PDFNOTE.COLOUR 1.00 1.00 0.00 .\" .\" Accommodate users who prefer the American spelling, COLOR, to .\" the British spelling, COLOUR. .\" .als PDFNOTE.COLOR PDFNOTE.COLOUR .\" .\" "PDFNOTE.OPACITY" set the opacity of the note icon (not the actual .\" popup window which is always opaque). Range 0->1 (opaque). .\" .ds PDFNOTE.OPACITY 0.60 .\" .de pdfnote .\" ---------------------------------------------------------------------- .\" Usage: .\" .pdfnote [-T "Text for Title"] Text of note ... .\" ---------------------------------------------------------------------- .\" .\" First, compute the bounding rectangle, .\" for this PDFNOTE instance .\" . mk pdf:ury . nr pdf:llx \\n(.k+\\n(.o+\\n[.in] . nr pdf:lly \\n[pdf:ury]+\\n[PDFNOTE.HEIGHT] . nr pdf:urx \\n[pdf:llx]+\\n[PDFNOTE.WIDTH] . ds pdf:note.instance /Rect [\\*[pdf:bbox]] .\" .\" Parse any specified (recognisable) PDFNOTE options .\" . while \A'\\$1' \{\ . if !d pdf:note\\$1 .break . pdf:note\\$1 \\$@ . shift \\n[pdf:note.argc] . \} .\" .\" Emit the note, and clean up .\" . pdfmark \\*[pdf:note.instance] /Subtype /Text /Contents (\\$*) /Color [\\*[PDFNOTE.COLOUR]] /CA \\*[PDFNOTE.OPACITY] /ANN . rm pdf:note.instance . rr pdf:note.argc .. .\" The -T flag gives a title to the note window, if not used but a .\" document author has been given previously, the author's name is .\" used as the window title. .\" .de pdf:note-T .nr pdf:note.argc 2 .as pdf:note.instance " /Title (\\$2) .. .\" ===================================================================== .\" Module PDFBOOKMARK: Add an Outline Reference in the PDF Bookmark Pane .\" ===================================================================== .\" .\" "PDFBOOKMARK.VIEW" controls how the document will be displayed, .\" when the user selects a bookmark. This default setting will fit .\" the page width to the viewing window, with the bookmarked entry .\" located at the top of the viewable area. .\" .ds PDFBOOKMARK.VIEW /FitH \\n[PDFPAGE.Y] u .\" .\" "PDFOUTLINE.FOLDLEVEL" controls how the document outline will be .\" displayed. It is a number, defining the maximum heading level .\" which will be visible, without outline expansion by the user, in .\" the initial view of the document outline. Assuming that no sane .\" document will ever extend to 10,000 levels of nested headings, .\" this initial default value causes outlines to be fully expanded. .\" .nr PDFOUTLINE.FOLDLEVEL 10000 .\" .\" Search defined bookmarks for a tag matching $1. This gets around .\" problems with *roff escape sequences embedded in identifiers (which .\" is not allowed by the language syntax), and the need to tediously .\" scrub the strings of them (and throw diagnostics in the user's face .\" if we don't do a good enough job) at the expense of an O(n) search .\" every time we reference a bookmark instead of an O(1) one. .\" .de pdf:lookup .nr pdf:index 0 1 .ds pdf:lookup-result \" empty .ds pdf:lookup-value \" empty .while d pdf:bm\\n+[pdf:index].tag \{\ . if '\\$1'\\*[pdf:bm\\n[pdf:index].tag]' \{\ . ds pdf:lookup-result \\*[pdf:bm\\n[pdf:index].tag]\" . ds pdf:lookup-value \\*[pdf:bm\\n[pdf:index].val]\" . break . \} . \} .. . .\" The actual job of creating an outline reference .\" is performed by the "pdfbookmark" macro. .\" .de pdfbookmark .\" ------------------------------------------------------------------ .\" Usage: .\" .pdfbookmark [-T tag] level "Text of Outline Entry" .\" .\" $1 = nesting level for bookmark (1 is top level) .\" $2 = text for bookmark, (in PDF viewer bookmarks list) .\" ------------------------------------------------------------------ .\" .ie '\\n(.z'' \{\ .\" .\" When we are at the top diversion level, i.e. actually emitting text .\" to the output device stream, then we compute the location of, and .\" plant this bookmark immediately. .\" . \" Make the bookmark name "untagged" by default, . \" then parse any specified options, to set a "tag", if required . \" . nr pdf:bm.nr +1 . ds pdf:href-T . while \A'\\$1' \{\ . if !d pdf:href.opt\\$1 .break . pdf:href.opt\\$1 \\$@ . shift \\n[pdf:href.argc] . \} . rr pdf:href.argc . \" . \" If we found "--" to mark the end of the options, discard it . \" . if '\\$1'--' .shift . \" . ie \B'\\$1' \ . nr pdf:bm.lev \\$1 . el \{\ . pdf:error bookmark level must be a numeric expression; got '\\$1' . nr pdf:bm.lev 1 . \} . if \\n[pdf:bm.lev]==0 .nr pdf:bm.lev 1 . if \\n[pdf:bm.lev]-1==\\n[PDFOUTLINE.FOLDLEVEL] .nr pdf:bm.lev \\n[pdf:bm.lev]*-1 . nr pdf:bm.abslev 0+\\n[pdf:bm.lev] . if \\n[pdf:bm.lev]<0 .nr pdf:bm.abslev 0+\\n[pdf:bm.abslev]*-1 . if \\n[pdf:bm.abslev]>\\n[pdf:bm.nl] .nr pdf:bm.nl \\n[pdf:bm.nl]+1 . ie \\n[pdf:bm.abslev]>\\n[pdf:bm.nl] \{\ . pdf:warn adjusted level \\n[pdf:bm.abslev] bookmark; should be <= \\n[pdf:bm.nl] . nr pdf:bm.abslev 0+\\n[pdf:bm.nl] . if \\n[pdf:bm.abslev]-1==\\n[PDFOUTLINE.FOLDLEVEL] .nr pdf:bm.lev \\n[pdf:bm.abslev]*-1 . \} . el .nr pdf:bm.nl \\n[pdf:bm.abslev] . if \\n[pdf:bm.lev]<0 .nr pdf:bm.abslev \\n[pdf:bm.abslev]*-1 . nr pdf:bm.lev 0+\\n[pdf:bm.abslev] . rr pdf:bm.abslev . shift . \" . \" Increment the bookmark serialisation index . \" in order to generate a uniquely serialised bookmark name, . \" ( which we return in the string "PDFBOOKMARK.NAME" ), . \" . ie '\\*[pdf:href-T]'' .ds PDFBOOKMARK.NAME pdf:bm\\n[pdf:bm.nr] . el .ds PDFBOOKMARK.NAME \\*[pdf:href-T] . pdf:href.sety . ds pdf:title \\$* . if !'\\*[pdf:href-T]'' \{\ . nr pdf:bm.nk +1 . if !d pdf:bm\\n[pdf:bm.nk].tag \{\ . ds pdf:bm\\n[pdf:bm.nk].tag \\*[PDFBOOKMARK.NAME] . ds pdf:bm\\n[pdf:bm.nk].val \\*[pdf:title] . \} . if d PDF.EXPORT \{\ . tm .ds pdf:bm\\n[pdf:bm.nk].tag \\*[PDFBOOKMARK.NAME] . tm .ds pdf:bm\\n[pdf:bm.nk].val \\*[pdf:title] . \} . \} . pdfmark /Dest /\\*[PDFBOOKMARK.NAME] /View [\\*[PDFBOOKMARK.VIEW]] /DEST . nop \!x X ps:exec [/Dest /\\*[PDFBOOKMARK.NAME] /Title (\\*[pdf:title]) /Level \\n[pdf:bm.lev] /OUT pdfmark . pdf:href.options.clear . rr PDFPAGE.Y . rm pdf:title . \} . \} .el \{\ .\" .\" But when we are collecting a diversion which will be written out later, .\" then we must defer bookmark placement, until we emit the diversion. .\" (don't rely on $0 == pdfbookmark here; it may be a volatile alias). .\" . nop \!.pdfbookmark \\$@ . \} .. . .\" .\" ============================================================= .\" Module PDFHREF: Create Hypertext References in a PDF Document .\" ============================================================= .\" .\" "PDFHREF.VIEW" controls how the document will be displayed, .\" when the user follows a link to a named reference. .\" .ds PDFHREF.VIEW /FitH \\n[PDFPAGE.Y] u .\" .\" This default setting will fit the page width to the viewing .\" window, with the bookmarked entry located close to the top .\" of the viewable area. "PDFHREF.VIEW.LEADING" controls the .\" actual distance below the top of the viewing window, where .\" the reference will be positioned; 5 points is a reasonable .\" default offset. .\" .nr PDFHREF.VIEW.LEADING 5.0p .\" .\" Yuk!!! .\" PDF view co-ordinates are mapped from the bottom left corner, .\" of the page, whereas page printing co-ordinates are mapped .\" conventionally, from top left. .\" .\" Macro "pdf:href.sety" transforms the vertical position of the .\" last printed baseline, from the printing co-ordinate domain to .\" the PDF view domain. .\" .de pdf:href.sety .\" ---------------------------------------------------------------- .\" Usage: .\" .pdf:href.sety .\" ---------------------------------------------------------------- .\" .\" This computation yields the vertical view co-ordinate .\" in groff's basic units; don't forget to append grops' "u" .\" conversion operator, when writing the pdfmark! .\" .nr PDFPAGE.Y (\\n[PDFHREF.VIEW.LEADING]-\\n(nl) .. .\" When we create a link "hot-spot" ... .\" "PDFHREF.LEADING" sets the distance above the top of the glyph .\" bounding boxes, in each line of link text, over which the link .\" hot-spot will extend, while "PDFHREF.HEIGHT" sets the hot-spot .\" height, PER LINE of text occupied by the reference. .\" .\" Since most fonts specify some leading space within the bounding .\" boxes of their glyphs, a better appearance may be achieved when .\" NEGATIVE leading is specified for link hot-spots; indeed, when .\" the default 10pt Times font is used, -1.0 point seems to be a .\" reasonable default value for "PDFHREF.LEADING" -- it may be .\" changed, if desired. .\" .\" "PDFHREF.HEIGHT" is initially set as one vertical spacing unit; .\" note that it is defined as a string, so it will adapt to changes .\" in the vertical spacing. Changing it is NOT RECOMMENDED. .\" .nr PDFHREF.LEADING 2.0p .ds PDFHREF.HEIGHT 1.0v .\" .\" PDF readers generally place a rectangular border around link .\" "hot-spots". Within text, this looks rather ugly, so we set .\" "PDFHREF.BORDER" to suppress it -- the three zeroes represent .\" the border parameters in the "/Border [0 0 0]" PDFMARK string, .\" and may be changed to any valid form, as defined in Adobe's .\" PDFMARK Reference Manual. .\" .ds PDFHREF.BORDER 0 0 0 .\" .\" "PDFHREF.COLOUR" (note British spelling) defines the colour to .\" be used for display of link "hot-spots". This will apply both .\" to borders, if used, and, by default to text; however, actual .\" text colour is set by "PDFHREF.TEXT.COLOUR", which may be reset .\" independently of "PDFHREF.COLOUR", to achieve contrasting text .\" and border colours. .\" .\" "PDFHREF.COLOUR" must be set to a sequence of three values, .\" each in the range 0.0 .. 1.0, representing the red, green, and .\" blue components of the colour specification in the RGB colour .\" domain, which is shared by "groff" and the PDF readers. .\" .ds PDFHREF.COLOUR 0.00 0.35 0.60 .defcolor pdf:href.colour rgb \*[PDFHREF.COLOUR] .\" .\" "PDFHREF.TEXT.COLOUR", on the other hand, is simply defined .\" using any "groff" colour name -- this default maps it to the .\" same colour value as "PDFHREF.COLOUR". .\" .ds PDFHREF.TEXT.COLOUR pdf:href.colour .\" .\" Accommodate users who prefer the American spelling, COLOR, to .\" the British spelling, COLOUR. .\" .als PDFHREF.COLOR PDFHREF.COLOUR .als PDFHREF.TEXT.COLOR PDFHREF.TEXT.COLOUR .\" .\" All PDF "Hypertext" reference capabilities are accessed .\" through the "pdfhref" macro .\" .de pdfhref .\" ----------------------------------------------------------------- .\" Usage: .\" .pdfhref ... .\" ----------------------------------------------------------------- .\" .\" .\" Loop over all subcommands specified in the argument list .\" . while \\n(.$ \{\ . \" . \" Initially, assume each subcommand will complete successfully . \" . nr pdf:href.ok 1 . \" . \" Initialise -E, -S, and -X flags in the OFF state . \" . nr pdf:href-E 0 . nr pdf:href-S 0 . nr pdf:href-X 0 . \" . \" Handle the case where subcommand is specified as "-class", . \" setting up appropriate macro aliases for subcommand handlers. . \" . if d pdf*href\\$1 .als pdf*href pdf*href\\$1 . if d pdf*href\\$1.link .als pdf*href.link pdf*href\\$1.link . if d pdf*href\\$1.file .als pdf*href.file pdf*href\\$1.file . \" . \" Repeat macro alias setup . \" for the case where the subcommand is specified as "class", . \" (without a leading hyphen) . \" . if d pdf*href-\\$1 .als pdf*href pdf*href-\\$1 . if d pdf*href-\\$1.link .als pdf*href.link pdf*href-\\$1.link . if d pdf*href-\\$1.file .als pdf*href.file pdf*href-\\$1.file . \" . \" Process one subcommand ... . \" . ds pdf*href.class \\$1 . ie d pdf*href \{\ . \" . \" Subcommand "class" is recognised ... . \" discard the "class" code from the argument list, . \" set the initial argument count to swallow all arguments, . \" and invoke the selected subcommand handler. . \" . shift . nr pdf:argc \\n(.$ . pdf*href \\$@ . \" . \" When done, . \" discard all arguments actually consumed by the handler, . \" before proceeding to the next subcommand (if any). . \" . shift \\n[pdf:argc] . \} . el \{\ . \" . \" Subcommand "class" is not recognised ... . \" issue a warning, and discard the entire argument list, . \" so aborting this "pdfhref" invocation . \" . pdf:warn \\$0: undefined reference class '\\$1' ignored . shift \\n(.$ . \} . \" . \" Clean up temporary reference data, . \" to ensure it doesn't propagate to any future reference . \" . rm pdf*href pdf:href.link pdf:href.files . rr pdf:href-E . pdf:href.options.clear . \} . rr pdf:href.ok .. .\" .\" Macros "pdf:href.flag" and "pdf:href.option" .\" provide a generic mechanism for switching on flag type options, .\" and for decoding options with arguments, respectively .\" .de pdf:href.flag .\" ---------------------------------------------------------------------- .\" ---------------------------------------------------------------------- .nr pdf:href\\$1 1 .nr pdf:href.argc 1 .. .de pdf:href.option .\" ---------------------------------------------------------------------- .\" ---------------------------------------------------------------------- .ds pdf:href\\$1 \\$2 .nr pdf:href.argc 2 .. .\" .\" Valid PDFHREF options are simply declared .\" by aliasing option handlers to "pdf:href.option", .\" or to "pdf:href.flag", as appropriate .\" .als pdf:href.opt-A pdf:href.option \" affixed text .als pdf:href.opt-D pdf:href.option \" destination name .als pdf:href.opt-E pdf:href.flag \" echo link descriptor .als pdf:href.opt-F pdf:href.option \" remote file specifier .als pdf:href.opt-N pdf:href.option \" reference name .als pdf:href.opt-S pdf:href.flag \" start mark only, "leaving open" .als pdf:href.opt-P pdf:href.option \" prefixed text .als pdf:href.opt-T pdf:href.option \" bookmark "tag" .als pdf:href.opt-X pdf:href.flag \" cross reference .\" .\" For references to another document file .\" we also need to support OS dependent file name specifiers .\" .als pdf:href.opt-DF pdf:href.option \" /DOSFile specifier .als pdf:href.opt-MF pdf:href.option \" /MacFile specifier .als pdf:href.opt-UF pdf:href.option \" /UnixFile specifier .als pdf:href.opt-WF pdf:href.option \" /WinFile specifier .\" .\" Macro "pdf:href.options.clear" ensures that ALL option .\" argument strings are deleted, after "pdfhref" has completed .\" all processing which depends on them .\" .de pdf:href.options.clear .\" ----------------------------------------------------------------- .\" Usage: .\" .pdf:href.options.clear [option ...] .\" ----------------------------------------------------------------- .\" .\" When an option list is specified ... .\" .ie \\n(.$ \{\ . \" . \" then loop through the list, . \" deleting each specified option argument string in turn . \" . while \\n(.$ \{\ . if d pdf:href-\\$1 .rm pdf:href-\\$1 . shift . \} . \} .\" .\" ... but when no list is specified, .\" then recurse, to clear all known option argument strings .\" .el .pdf:href.options.clear A D F N P T DF MF UF WF .. .\" .\" Macro "pdf*href-M" is the handler invoked by "pdfhref", when .\" called with the "M" reference class specifier, to create a .\" named cross reference mark, and to emit a cross reference .\" data record, as specified by "PDFHREF.INFO". .\" .de pdf*href-M .\" ----------------------------------------------------------------- .\" Usage: .\" .pdfhref M [-N name | -D name] [-E] descriptive text ... .\" ----------------------------------------------------------------- .\" .\" Initially, declare the -D and -N string options as empty, .\" so we avoid warning messages when we try to use them, and find .\" that they are undefined. .\" .ds pdf:href-D .ds pdf:href-N .\" .\" Parse, interpret, and strip any specified options from the .\" argument list. (Note that only options with a declared handler .\" will be processed; there is no provision for detecting invalid .\" options -- anything which is not recognised is assumed to start .\" the "descriptive text" component of the argument list). .\" .while \A'\\$1' \{\ . if !d pdf:href.opt\\$1 .break . pdf:href.opt\\$1 \\$@ . shift \\n[pdf:href.argc] . \} .\" .\" If we found "--", to mark the end of the options, .\" then we should discard it. .\" .if '\\$1'--' .shift .\" .\" All PDF reference markers MUST be named. The name may have been .\" supplied using the "-N Name" option, (or the "-D Name" option); .\" if not, deduce it from the first "word" in the "descriptive text", .\" if any, and set the marker -- if we still can't identify the name .\" for the destination, then this marker will not be created. .\" .nr pdf:bm.nk +1 .ds PDFBOOKMARK.NAME "\\*[pdf:href-N]\\*[pdf:href-D] .pdf*href.set \\*[PDFBOOKMARK.NAME] \\$1 .if !d pdf:bm\\n[pdf:bm.nk].tag \{\ . ds pdf:bm\\n[pdf:bm.nk].tag \\*[PDFBOOKMARK.NAME] . ds pdf:bm\\n[pdf:bm.nk].val \\$* .\} .if d PDF.EXPORT \{\ . tm .ds pdf:bm\\n[pdf:bm.nk].tag \\*[PDFBOOKMARK.NAME] . tm .ds pdf:bm\\n[pdf:bm.nk].val \\$* .\} .\" .\" .\" Irrespective of whether this marker is created, or not, .\" the descriptive text will be copied to the groff output stream, .\" provided the "-E" option was specified .\" .if \\n[pdf:href-E] \&\\$* .. .de pdf*href-F .\"do nothing .. .\" .de pdf*href.set .\" ---------------------------------------------------------------------- .\" ---------------------------------------------------------------------- .ie \\n(.$ \{\ . \" . \" a marker name has been supplied ... . \" if we are formatting for immediate output, . \" emit PDFMARK code to establish the associated view . \" . ds PDFBOOKMARK.NAME \\$1 . ie '\\n(.z'' \{\ . pdf:href.sety . pdfmark /Dest /\\$1 /View [\\*[PDFHREF.VIEW]] /DEST . rr PDFPAGE.Y . \} . \" . \" but, when formatting a diversion ... . \" delay output of the PDFMARK code, until the diversion . \" is eventually written out . \" . el \!.\\$0 \\$@ . \" . \} .el \{\ . \" marker is unnamed ... . \" issue error message; do not emit reference data . \" . pdf:warn pdfhref destination marker must be named . \} .. .\" .de pdf*href .\" ------------------------------------------------------------------ .\" Usage: .\" .pdf*href class [options ...] [link text ...] .\" ------------------------------------------------------------------ .\" .\" First, we initialise an empty string, which will be affixed to .\" the end of the "link text". (This is needed to cancel the effect .\" of a "\c" escape, which is placed at the end of the "link text" .\" to support the "-A" option -- any text supplied by the user, when .\" the "-A" option is specified, will replace this empty string). .\" .ds pdf:href-A .\" .\" Now we interpret, and remove any specified options from the .\" argument list. (Note that only options with a declared handler .\" will be processed; there is no provision for detecting invalid .\" options -- anything which is not recognised is assumed to start .\" the "link text" component of the argument list). .\" .while \A'\\$1' \{\ . if !d pdf:href.opt\\$1 .break . pdf:href.opt\\$1 \\$@ . shift \\n[pdf:href.argc] . \} .\" .\" If we found "--", to mark the end of the options, then we should .\" discard it. .\" .if '\\$1'--' .shift .\" .\" All PDF link classes REQUIRE a named destination. This may have .\" been supplied using the "-D Name" option, but, if not, deduce it .\" from the first "word" in the "link text", if any -- if we still .\" can't identify the destination, then set "pdf:href.ok" to zero, .\" so this link will not be created. .\" .if !d pdf:href-D .pdf:href.option -D \\$1 .if '\\*[pdf:href-D]'' \{\ . pdf:error pdfhref has no destination . nr pdf:href.ok 0 . \} .\" .\" Now, initialise a string, defining the PDFMARK code sequence .\" to create the reference, using the appropriate type indicators. .\" .ds pdf:href.link /Subtype /Link \\*[pdf*href.link] .\" .\" And now, we have no further use for "pdf*href.link". .\" .rm pdf*href.link .nr pdf:href.leave-mark-open 0 .\" .\" Does the user want to leave the mark hanging open (using the "-S" .\" flag)? If so, it's their responsibility to close it by issuing the .\" "pdf: markend" device extension command. .if \\n[pdf:href-S] \{\ . ie !'\\*[pdf:href-A]'' .pdf:error pdfhref flag '-S' cannot be used \ with '-A' option . el .nr pdf:href.leave-mark-open 1 .\} .\" .\" If the user specified any "link prefix" text, (using the "-P text" .\" option), then emit it BEFORE processing the "link text" itself. .\" .if d pdf:href-P \&\\*[pdf:href-P]\c .ie \\n[pdf:href.ok] \{\ . \" . \" This link is VALID (so far as we can determine) ... . \" Modify the "link text" argument specification, as required, . \" to include any pre-formatted cross reference information . \" . ie \\n(.$ \{\ . \" . \" One or more "link text" argument(s) are present, . \" so, set the link description from the argument(s) ... . \" . ds PDFHREF.DESC \\$* . \} . el \{\ . ds PDFHREF.DESC Unknown . ie '\\*[pdf*href.class]'W' \{\ . if !'\\*[pdf:href-D]'' .ds PDFHREF.DESC \\*[pdf:href-D] . \} . el \{\ . pdf:lookup \\*[pdf:href-D] . if !'\\*[pdf:lookup-result]'' .ds PDFHREF.DESC \\*[pdf:lookup-value] . \} . \} . \" Apply border and colour specifications to the PDFMARK string . \" definition, as required. . \" . if d PDFHREF.BORDER .as pdf:href.link " /Border [\\*[PDFHREF.BORDER]] . if d PDFHREF.COLOUR .as pdf:href.link " /Color [\\*[PDFHREF.COLOUR]] . \" . \" Emit the "link text", in its appropriate colour, marking the . \" limits of its bounding box(es), as the before and after output . \" text positions. . \" \#. if d PDFHREF.COLOUR .defcolor pdf:href.colour rgb \\*[PDFHREF.COLOUR] . ds pdf:curcol \\n[.m] . nr pdf:bm.width \\w'\\*[PDFHREF.DESC]' . nop \&\m[\\*[PDFHREF.TEXT.COLOUR]]\c . nop \X'pdf: markstart \\n[rst] \\n[rsb] \\n[PDFHREF.LEADING] \\*[pdf:href.link]'\c . if !\\n[pdf:href.leave-mark-open] \{\ . nop \&\\*[PDFHREF.DESC]\c . nop \m[\\*[pdf:curcol]]\c . nop \X'pdf: markend'\c . \} . \" . \" Clean up the temporary registers and strings, used to . \" compute the "hot-spot" bounds, and format the reference, . \" . rm PDFHREF.DESC . \} .\" .\" But when we identify an INVALID link ... .\" We simply emit the "link text", with no colour change, no border, .\" and no associated "hot-spot". .\" .el \&\\$*\c .\" .\" And then, if the user specified any affixed text, (using the .\" "-A text" option), we tack it on at the end. .\" .if !\\n[pdf:href.leave-mark-open] .nop \&\\*[pdf:href-A] .. .\" Macro "pdf*href-I" is used for one time initialisation of special .\" "pdfhref" features; (currently, only the above page trap hook is .\" supported, but it is implemented with one level of indirection, to .\" accommodate possible future expansion). . .de pdf*href-I .\" ---------------------------------------------------------------------- .\" Usage: .\" .pdfhref I -