2006-02-03 14:40:35 +00:00
|
|
|
# -*- autoconf -*-
|
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
2005-05-18 19:27:39 +00:00
|
|
|
|
2022-01-02 15:42:45 +00:00
|
|
|
# Copyright (C) 1991-2022 Free Software Foundation, Inc.
|
2005-05-18 19:27:39 +00:00
|
|
|
|
2007-07-23 14:35:58 +02:00
|
|
|
# This program is free software: you can redistribute it and/or modify
|
2006-02-03 14:40:35 +00:00
|
|
|
# it under the terms of the GNU General Public License as published by
|
2007-07-23 14:35:58 +02:00
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
# (at your option) any later version.
|
2005-05-18 19:27:39 +00:00
|
|
|
|
2006-02-03 14:40:35 +00:00
|
|
|
# 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.
|
2005-05-18 19:27:39 +00:00
|
|
|
|
2006-02-03 14:40:35 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
2017-09-19 01:13:23 -07:00
|
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2005-05-18 19:27:39 +00:00
|
|
|
|
|
|
|
|
dnl Written by Jim Meyering.
|
|
|
|
|
|
2015-05-28 02:25:29 +01:00
|
|
|
AC_PREREQ([2.69])
|
2007-08-26 00:48:41 +02:00
|
|
|
|
|
|
|
|
# Make inter-release version strings look like, e.g., v6.9-219-g58ddd, which
|
|
|
|
|
# indicates that it is built from the 219th delta (in _some_ repository)
|
|
|
|
|
# following the v6.9 tag, and that 58ddd is a prefix of the commit SHA1.
|
2017-11-05 16:28:12 -08:00
|
|
|
# The explicit URL can be removed when autoconf > 2.69 is released.
|
2008-02-29 09:36:24 +01:00
|
|
|
AC_INIT([GNU coreutils],
|
2009-08-22 18:56:06 +02:00
|
|
|
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
|
2017-11-05 16:28:12 -08:00
|
|
|
[bug-coreutils@gnu.org],
|
|
|
|
|
[coreutils],
|
|
|
|
|
[https://www.gnu.org/software/coreutils/])
|
2007-08-26 00:48:41 +02:00
|
|
|
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_CONFIG_SRCDIR([src/ls.c])
|
2002-07-01 08:08:43 +00:00
|
|
|
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_CONFIG_AUX_DIR([build-aux])
|
2006-08-23 18:37:27 +00:00
|
|
|
AC_CONFIG_HEADERS([lib/config.h:lib/config.hin])
|
2002-07-01 08:08:43 +00:00
|
|
|
|
2020-02-27 21:40:23 +00:00
|
|
|
AM_INIT_AUTOMAKE([1.11.2 dist-xz color-tests parallel-tests subdir-objects])
|
2009-04-19 13:41:52 +02:00
|
|
|
AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
|
2002-07-01 08:08:43 +00:00
|
|
|
|
2011-01-24 11:07:51 -07:00
|
|
|
dnl POSIXCHECK is worthwhile for maintainers, but adds several seconds
|
|
|
|
|
dnl (more than 10% execution time) to ./configure, with no benefit for
|
|
|
|
|
dnl most users. Using it to look for bugs requires:
|
|
|
|
|
dnl GNULIB_POSIXCHECK=1 autoreconf -f
|
|
|
|
|
dnl ./configure
|
|
|
|
|
dnl make
|
|
|
|
|
dnl make -C src clean
|
|
|
|
|
dnl make CFLAGS=-DGNULIB_POSIXCHECK=1
|
|
|
|
|
dnl FIXME: Once we figure out how to avoid false positives, we should
|
|
|
|
|
dnl have 'make my-distcheck' in dist-check.mk exercise this.
|
|
|
|
|
m4_syscmd([test "${GNULIB_POSIXCHECK+set}" = set])
|
|
|
|
|
m4_if(m4_sysval, [0], [], [dnl
|
|
|
|
|
gl_ASSERT_NO_GNULIB_POSIXCHECK])
|
|
|
|
|
|
2021-04-26 23:27:59 -07:00
|
|
|
AC_PROG_CC
|
2005-11-18 19:45:42 +00:00
|
|
|
AM_PROG_CC_C_O
|
2002-07-01 08:08:43 +00:00
|
|
|
AC_PROG_CPP
|
|
|
|
|
AC_PROG_GCC_TRADITIONAL
|
|
|
|
|
AC_PROG_RANLIB
|
2003-03-19 22:50:52 +00:00
|
|
|
AC_PROG_LN_S
|
Add a bootstrap procedure, so that the CVS version contains fewer
files and we bootstrap the rest from gnulib, gettext, etc.
* README-cvs: New file.
* bootstrap: New file.
* bootstrap.conf: New file.
* .x-sc_trailing_blank: Remove config-log, .gdb-history. Add .po.
* configure.ac (AC_PREREQ): Move here from m4/*.m4, for benefit
of gnulib-tool.
(gl_DEFAULT_POSIX2_VERSION, gl_USE_SYSTEM_EXTENSIONS, gl_PERL):
(gl_IGNORE_UNUSED_LIBRARIES): Remove; now done by gnulib.
(gl_EARLY): Add.
(gl_MACROS): Call just after gl_EARLY, just for clarity.
* src/c99-to-c98.diff: Remove patch to ls.c; no longer needed.
* src/kill.c (strtoimax): Remove decl.
* src/ls.c: Include "wcwidth.h" instead of rolling it ourselves.
* src/wc.c: Likewise.
* src/ls.c (sort_files): Rewrite to avoid need for C99-style
declaration, so that we don't need to patch this file.
* src/printf.c (strtoimax, strtoumax): Remove decls.
* src/su.c: Include getpass.h.
(getpass): remove.
* src/system.h: Include mempcpy.h, stpcpy.h, strpbrk.h.
Include inttypes.h unconditionally; remove decls it handles.
* lib/Makefile.am: include gnulib.mk, so that we can remove most of
this file.
(AM_CPPFLAGS): Don't mention -I$(srcdir), since that's now done
for us.
(noinst_LIBRARIES, LDDADD, DEFS): Remove.
(libcoreutils_a_SOURCES): Trim down greatly, just to the files
that aren't in gnulib.
Remove defns gnulib does for us.
* m4/check-decl.m4 (gl_CHECK_DECLS):
Don't include stdio.h, string.h, stdlib.h, unistd.h, sys/time.h,
time.h. Use AC_CHECK_DECLS_ONCE for free, getenv, geteuid, getlogin,
getuid, lseek, malloc, memchr, realloc. Don't check for getutent,
memrchr, nanosleep, stpcpy, strndup, strnlen, strstr, strtoul,
strtoull.
(_gl_DECL_HEADERS): Remove; all uses removed.
* m4/jm-macros.m4 (gl_MACROS): Move AC_PREREQ into configure.ac
for the benefit of gnulib-tool. Call gl_INIT.
Do not call or require macros that gnulib will handle for us.
Don't check for fchmod, hasmntopt, isascii, lchown, listmntent,
mempcpy, realpath, wcrtomb, tzset.
(gl_CHECK_ALL_HEADERS): Don't check for sys/statvfs.h, sys/vfs.h,
sys/mount.h.
(gl_CHECK_ALL_TYPES): Require AC_TYPE_UNSIGNED_LONG_LONG_INT.
Don't check for struct stat.st_blksize.
Don't require AC_STRUCT_ST_DM_MODE, gt_TYPE_SSIZE_T,
gl_AC_TYPE_UINT32_T, gl_AC_TYPE_UINTMAX_T, gl_AC_TYPE_UINTPTR_T,
gl_AC_TYPE_UNSIGNED_LONG_LONG.
* m4/prereq.m4 (gl_PREREQ): Require gl_FUNC_XFTS, gl_ROOT_DEV_INO.
Don't require macros that gnulib does for us.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Don't check for
sys/sysmacros.h. Don't check for statvfs. Use AC_CHECK_HEADERS_ONCE
for netinet/in.h, nfs/nfs_clnt.h, nfs/vfs.h.
Don't require gl_AC_TYPE_LONG_LONG, gt_HEADER_INTTYPES_H.
2006-08-21 07:30:45 +00:00
|
|
|
gl_EARLY
|
2020-01-01 17:43:53 +00:00
|
|
|
gl_SET_CRYPTO_CHECK_DEFAULT([auto-gpl-compat])
|
2006-10-12 20:37:02 +00:00
|
|
|
gl_INIT
|
|
|
|
|
coreutils_MACROS
|
2004-01-11 23:50:27 +00:00
|
|
|
|
2012-08-30 14:13:11 +02:00
|
|
|
# The test suite needs to know if we have a working perl.
|
2021-12-28 02:03:21 -08:00
|
|
|
AM_CONDITIONAL([HAVE_PERL], [test "$gl_cv_prog_perl" != no])
|
2012-08-30 14:13:11 +02:00
|
|
|
|
2011-09-12 15:04:32 +02:00
|
|
|
# gl_GCC_VERSION_IFELSE([major], [minor], [run-if-found], [run-if-not-found])
|
|
|
|
|
# ------------------------------------------------
|
|
|
|
|
# If $CPP is gcc-MAJOR.MINOR or newer, then run RUN-IF-FOUND.
|
|
|
|
|
# Otherwise, run RUN-IF-NOT-FOUND.
|
|
|
|
|
AC_DEFUN([gl_GCC_VERSION_IFELSE],
|
|
|
|
|
[AC_PREPROC_IFELSE(
|
|
|
|
|
[AC_LANG_PROGRAM(
|
|
|
|
|
[[
|
|
|
|
|
#if ($1) < __GNUC__ || (($1) == __GNUC__ && ($2) <= __GNUC_MINOR__)
|
|
|
|
|
/* ok */
|
|
|
|
|
#else
|
|
|
|
|
# error "your version of gcc is older than $1.$2"
|
|
|
|
|
#endif
|
|
|
|
|
]]),
|
|
|
|
|
], [$3], [$4])
|
|
|
|
|
]
|
|
|
|
|
)
|
|
|
|
|
|
2022-01-31 22:08:56 -08:00
|
|
|
AC_ARG_ENABLE([single-binary],
|
|
|
|
|
[AS_HELP_STRING([--enable-single-binary=[shebangs|symlinks]],
|
|
|
|
|
[Compile all the tools in a single binary, reducing the overall size.
|
|
|
|
|
When compiled this way, shebangs (default when enabled) or symlinks are
|
|
|
|
|
installed for each tool that points to the single binary.])],
|
|
|
|
|
[gl_single_binary=no ;
|
|
|
|
|
case $enableval in
|
|
|
|
|
yes) gl_single_binary=shebangs ;;
|
|
|
|
|
no|shebangs|symlinks) gl_single_binary=$enableval ;;
|
|
|
|
|
*) AC_MSG_ERROR([bad value $enableval for single-binary option.
|
|
|
|
|
Options are: symlinks, shebangs, no.]) ;;
|
|
|
|
|
esac],
|
|
|
|
|
[gl_single_binary=no]
|
|
|
|
|
)
|
|
|
|
|
AC_ARG_ENABLE([single-binary-exceptions],
|
|
|
|
|
[AS_HELP_STRING([--enable-single-binary-exceptions=PROG_LIST],
|
|
|
|
|
[When used with --enable-single-binary, exclude the PROG_LIST from
|
|
|
|
|
it, so these programs are compiled as separated files
|
|
|
|
|
(comma-separated, default none))])],
|
|
|
|
|
[gl_single_binary_exceptions=$enableval],
|
|
|
|
|
[gl_single_binary_exceptions=]
|
|
|
|
|
)
|
|
|
|
|
if test "$gl_single_binary" = 'symlinks'; then
|
|
|
|
|
if ! test "`echo ls | sed \"$program_transform_name\"`" = 'ls'; then
|
|
|
|
|
AC_MSG_ERROR([program name transformations are not currently supported
|
|
|
|
|
with --enable-single-binary=symlinks.])
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
AM_CONDITIONAL([SINGLE_BINARY], [test "$gl_single_binary" != no])
|
|
|
|
|
|
2022-02-14 21:36:29 +00:00
|
|
|
AC_ARG_ENABLE([bold-man-page-references],
|
|
|
|
|
[AS_HELP_STRING([--disable-bold-man-page-references],
|
|
|
|
|
[When generating man pages, do not apply bold style around any
|
|
|
|
|
references like name(1) etc.])],
|
|
|
|
|
[gl_bold_manpages=yes ;
|
|
|
|
|
case $enableval in
|
|
|
|
|
no|yes) gl_bold_manpages=$enableval ;;
|
|
|
|
|
*) AC_MSG_ERROR([bad value $enableval for bold-man-page-references.
|
|
|
|
|
Options are: yes, no.]) ;;
|
|
|
|
|
esac],
|
|
|
|
|
[gl_bold_manpages=yes]
|
|
|
|
|
)
|
|
|
|
|
AM_CONDITIONAL([BOLD_MAN_REFS], [test "$gl_bold_manpages" != no])
|
|
|
|
|
|
2012-12-19 09:13:21 +00:00
|
|
|
AC_ARG_ENABLE([gcc-warnings],
|
2020-07-10 15:54:51 -07:00
|
|
|
[AS_HELP_STRING([--enable-gcc-warnings@<:@=TYPE@:>@],
|
|
|
|
|
[control generation of GCC warnings. The TYPE 'no' disables
|
|
|
|
|
warnings (default for non-developer builds); 'yes' generates
|
|
|
|
|
cheap warnings if available (default for developer builds);
|
|
|
|
|
'expensive' in addition generates expensive-to-compute warnings
|
|
|
|
|
if available.])],
|
2012-12-19 09:13:21 +00:00
|
|
|
[case $enableval in
|
2020-07-10 15:54:51 -07:00
|
|
|
no|yes|expensive) ;;
|
2012-12-19 09:13:21 +00:00
|
|
|
*) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
|
|
|
|
|
esac
|
|
|
|
|
gl_gcc_warnings=$enableval],
|
|
|
|
|
[
|
|
|
|
|
# GCC provides fine-grained control over diagnostics which
|
|
|
|
|
# is used in gnulib for example to suppress warnings from
|
|
|
|
|
# certain sections of code. So if this is available and
|
|
|
|
|
# we're running from a git repo, then auto enable the warnings.
|
|
|
|
|
gl_gcc_warnings=no
|
2012-12-19 11:44:28 +00:00
|
|
|
gl_GCC_VERSION_IFELSE([4], [6],
|
2014-06-02 09:54:56 +01:00
|
|
|
[test -d "$srcdir"/.git \
|
|
|
|
|
&& ! test -f "$srcdir"/.tarball-version \
|
|
|
|
|
&& gl_gcc_warnings=yes])]
|
2012-12-19 09:13:21 +00:00
|
|
|
)
|
|
|
|
|
|
2020-07-10 15:54:51 -07:00
|
|
|
if test $gl_gcc_warnings != no; then
|
2008-11-12 11:11:54 +01:00
|
|
|
gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
|
|
|
|
|
AC_SUBST([WERROR_CFLAGS])
|
2009-02-14 11:29:20 +01:00
|
|
|
|
2020-07-10 15:54:51 -07:00
|
|
|
ew=
|
|
|
|
|
AS_IF([test $gl_gcc_warnings != expensive],
|
|
|
|
|
[# -fanalyzer and related options slow GCC considerably.
|
|
|
|
|
ew="$ew -fanalyzer -Wno-analyzer-double-free -Wno-analyzer-malloc-leak"
|
|
|
|
|
ew="$ew -Wno-analyzer-null-dereference -Wno-analyzer-use-after-free"])
|
|
|
|
|
|
2009-05-17 11:43:21 +02:00
|
|
|
# This, $nw, is the list of warnings we disable.
|
2020-07-10 15:54:51 -07:00
|
|
|
nw=$ew
|
2009-02-14 11:29:20 +01:00
|
|
|
nw="$nw -Wdeclaration-after-statement" # too useful to forbid
|
|
|
|
|
nw="$nw -Waggregate-return" # anachronistic
|
2009-05-17 11:43:21 +02:00
|
|
|
nw="$nw -Wlong-long" # C90 is anachronistic (lib/gethrxtime.h)
|
2009-02-14 11:29:20 +01:00
|
|
|
nw="$nw -Wc++-compat" # We don't care about C++ compilers
|
|
|
|
|
nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib
|
|
|
|
|
nw="$nw -Wtraditional" # Warns on #elif which we use often
|
|
|
|
|
nw="$nw -Wcast-qual" # Too many warnings for now
|
|
|
|
|
nw="$nw -Wconversion" # Too many warnings for now
|
|
|
|
|
nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
|
|
|
|
|
nw="$nw -Wsign-conversion" # Too many warnings for now
|
|
|
|
|
nw="$nw -Wtraditional-conversion" # Too many warnings for now
|
|
|
|
|
nw="$nw -Wunreachable-code" # Too many warnings for now
|
|
|
|
|
nw="$nw -Wpadded" # Our structs are not padded
|
|
|
|
|
nw="$nw -Wredundant-decls" # openat.h declares e.g., mkdirat
|
|
|
|
|
nw="$nw -Wformat-nonliteral" # who.c and pinky.c strftime uses
|
|
|
|
|
nw="$nw -Wnested-externs" # use of XARGMATCH/verify_function__
|
|
|
|
|
nw="$nw -Wswitch-enum" # Too many warnings for now
|
|
|
|
|
nw="$nw -Wswitch-default" # Too many warnings for now
|
2009-07-09 15:20:15 +02:00
|
|
|
nw="$nw -Wstack-protector" # not worth working around
|
2017-08-12 13:51:19 -07:00
|
|
|
nw="$nw -Wformat-overflow=2" # False alarms due to GCC bug 80776
|
|
|
|
|
nw="$nw -Wformat-truncation=2" # False alarm in ls.c, probably related
|
2009-02-14 11:29:20 +01:00
|
|
|
# things I might fix soon:
|
|
|
|
|
nw="$nw -Wfloat-equal" # sort.c, seq.c
|
|
|
|
|
nw="$nw -Wmissing-format-attribute" # copy.c
|
|
|
|
|
nw="$nw -Wunsafe-loop-optimizations" # a few src/*.c
|
|
|
|
|
nw="$nw -Winline" # system.h's readdir_ignoring_dot_and_dotdot
|
2020-02-02 16:24:18 +00:00
|
|
|
nw="$nw -Wvector-operation-performance" # warns about randperm.c
|
|
|
|
|
|
2022-01-31 22:08:56 -08:00
|
|
|
# Suppress noreturn warnings with single binaries; otherwise
|
|
|
|
|
# GCC complains about the renamed 'main' not being declared noreturn
|
|
|
|
|
# because 'main_exit' calls 'exit' when linting.
|
|
|
|
|
if test "$gl_single_binary" != no; then
|
|
|
|
|
nw="$nw -Wsuggest-attribute=noreturn"
|
|
|
|
|
fi
|
2011-05-25 14:34:13 +02:00
|
|
|
|
|
|
|
|
# Using -Wstrict-overflow is a pain, but the alternative is worse.
|
|
|
|
|
# For an example, see the code that provoked this report:
|
2017-01-14 22:57:51 -08:00
|
|
|
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33498
|
2011-05-25 14:34:13 +02:00
|
|
|
# Code like that still infloops with gcc-4.6.0 and -O2. Scary indeed.
|
2009-02-14 11:29:20 +01:00
|
|
|
|
|
|
|
|
gl_MANYWARN_ALL_GCC([ws])
|
|
|
|
|
gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw])
|
|
|
|
|
for w in $ws; do
|
|
|
|
|
gl_WARN_ADD([$w])
|
|
|
|
|
done
|
|
|
|
|
gl_WARN_ADD([-Wno-sign-compare]) # Too many warnings for now
|
|
|
|
|
gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
|
2011-11-22 21:45:24 +01:00
|
|
|
gl_WARN_ADD([-Wno-format-nonliteral])
|
2009-05-17 13:47:39 +02:00
|
|
|
|
2013-05-18 17:49:32 -07:00
|
|
|
# clang is unduly picky about some things.
|
|
|
|
|
AC_CACHE_CHECK([whether the compiler is clang], [utils_cv_clang],
|
|
|
|
|
[AC_COMPILE_IFELSE(
|
|
|
|
|
[AC_LANG_PROGRAM([[
|
|
|
|
|
#ifndef __clang__
|
|
|
|
|
#error "not clang"
|
|
|
|
|
#endif
|
|
|
|
|
]])],
|
|
|
|
|
[utils_cv_clang=yes],
|
|
|
|
|
[utils_cv_clang=no])])
|
|
|
|
|
if test $utils_cv_clang = yes; then
|
|
|
|
|
gl_WARN_ADD([-Wno-format-extra-args])
|
|
|
|
|
gl_WARN_ADD([-Wno-tautological-constant-out-of-range-compare])
|
|
|
|
|
fi
|
|
|
|
|
|
2009-02-14 11:29:20 +01:00
|
|
|
gl_WARN_ADD([-fdiagnostics-show-option])
|
2009-10-21 11:27:29 -06:00
|
|
|
gl_WARN_ADD([-funit-at-a-time])
|
2009-02-14 11:29:20 +01:00
|
|
|
|
2008-11-12 11:11:54 +01:00
|
|
|
AC_SUBST([WARN_CFLAGS])
|
2009-02-14 11:29:20 +01:00
|
|
|
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.])
|
2012-08-31 12:07:54 -07:00
|
|
|
AH_VERBATIM([FORTIFY_SOURCE],
|
|
|
|
|
[/* Enable compile-time and run-time bounds-checking, and some warnings,
|
|
|
|
|
without upsetting glibc 2.15+. */
|
2012-10-23 15:20:07 -04:00
|
|
|
#if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
|
2012-08-31 12:07:54 -07:00
|
|
|
# define _FORTIFY_SOURCE 2
|
|
|
|
|
#endif
|
|
|
|
|
])
|
2009-02-14 11:29:20 +01:00
|
|
|
AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks])
|
2009-10-27 12:06:43 +01:00
|
|
|
|
|
|
|
|
# We use a slightly smaller set of warning options for lib/.
|
|
|
|
|
# Remove the following and save the result in GNULIB_WARN_CFLAGS.
|
2020-07-10 15:54:51 -07:00
|
|
|
nw=$ew
|
2017-08-12 13:51:19 -07:00
|
|
|
nw="$nw -Wduplicated-branches" # Too many false alarms
|
|
|
|
|
nw="$nw -Wformat-truncation=2"
|
2011-05-25 14:34:13 +02:00
|
|
|
nw="$nw -Wstrict-overflow"
|
2009-10-27 12:06:43 +01:00
|
|
|
nw="$nw -Wuninitialized"
|
|
|
|
|
nw="$nw -Wunused-macros"
|
|
|
|
|
nw="$nw -Wmissing-prototypes"
|
|
|
|
|
nw="$nw -Wold-style-definition"
|
2011-11-22 21:45:24 +01:00
|
|
|
# FIXME: it may be easy to remove this, since it affects only one file:
|
|
|
|
|
# the snprintf call at ftoastr.c:132.
|
|
|
|
|
nw="$nw -Wdouble-promotion"
|
2020-02-06 09:00:26 -08:00
|
|
|
|
|
|
|
|
# FIXME: remove this line when gcc improves
|
2020-02-09 14:18:55 +00:00
|
|
|
# FP in careadlinkat.c w/gcc 10.0.1 20200205
|
|
|
|
|
gl_WARN_ADD([-Wno-return-local-addr])
|
2020-02-06 09:00:26 -08:00
|
|
|
|
2009-10-27 12:06:43 +01:00
|
|
|
gl_MANYWARN_COMPLEMENT([GNULIB_WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
|
|
|
|
|
AC_SUBST([GNULIB_WARN_CFLAGS])
|
2010-10-13 11:20:18 +02:00
|
|
|
|
|
|
|
|
# For gnulib-tests, the set is slightly smaller still.
|
|
|
|
|
nw=
|
|
|
|
|
nw="$nw -Wstrict-prototypes"
|
2011-11-27 16:13:26 +01:00
|
|
|
# It's not worth being this picky about test programs.
|
|
|
|
|
nw="$nw -Wsuggest-attribute=const"
|
2021-10-31 22:30:38 -07:00
|
|
|
nw="$nw -Wsuggest-attribute=format"
|
2011-11-27 16:13:26 +01:00
|
|
|
nw="$nw -Wsuggest-attribute=pure"
|
2010-10-13 11:20:18 +02:00
|
|
|
gl_MANYWARN_COMPLEMENT([GNULIB_TEST_WARN_CFLAGS],
|
|
|
|
|
[$GNULIB_WARN_CFLAGS], [$nw])
|
|
|
|
|
AC_SUBST([GNULIB_TEST_WARN_CFLAGS])
|
2008-11-12 11:11:54 +01:00
|
|
|
fi
|
|
|
|
|
|
* src/sort.c (MAX_FORK_RETRIES_COMPRESS, MAX_FORK_RETRIES_DECOMPRESS):
In pipe_fork callers, use these named constants, not "2" and "8".
(proctab, nprocs): Declare to be "static".
(pipe_fork) [lint]: Initialize local, pid,
to avoid unwarranted may-be-used-uninitialized warning.
(create_temp): Use the active voice. Describe parameters, too.
2007-01-21 James Youngman <jay@gnu.org>
Centralize all the uses of sigprocmask(). Don't restore an invalid
saved mask.
* src/sort.c (enter_cs, leave_cs): New functions for protecting
code sequences against signal delivery.
* (exit_cleanup): Use enter_cs and leave_cs instead of
calling sigprocmask directly.
(create_temp_file, pipe_fork, zaptemp): Likewise
2007-01-21 Dan Hipschman <dsh@linux.ucla.edu>
Add compression of temp files to sort.
* NEWS: Mention this.
* bootstrap.conf: Import findprog.
* configure.ac: Add AC_FUNC_FORK.
* doc/coreutils.texi: Document GNUSORT_COMPRESSOR environment
variable.
* src/sort.c (compress_program): New global, holds the name of the
external compression program.
(struct sortfile): New type used by mergepfs and friends instead
of filenames to hold PIDs of compressor processes.
(proctab): New global, holds compressor PIDs on which to wait.
(enum procstate, struct procnode): New types used by proctab.
(proctab_hasher, proctab_comparator): New functions for proctab.
(nprocs): New global, number of forked but unreaped children.
(reap, reap_some): New function, wait for/cleanup forked processes.
(register_proc, update_proc, wait_proc): New functions for adding,
modifying and removing proctab entries.
(create_temp_file): Change parameter type to pointer to file
descriptor, and return type to pointer to struct tempnode.
(dup2_or_die): New function used in create_temp and open_temp.
(pipe_fork): New function, creates a pipe and child process.
(create_temp): Creates a temp file and possibly a compression
program to which we filter output.
(open_temp): Opens a compressed temp file and creates a
decompression process through which to filter the input.
(mergefps): Change FILES parameter type to struct sortfile array
and update access accordingly. Use open_temp and reap_some.
(avoid_trashing_input, merge): Change FILES parameter like
mergefps and call create_temp instead of create_temp_file.
(sort): Call create_temp instead of create_temp_file.
Use reap_some.
(avoid_trashing_input, merge, sort, main): Adapt to mergefps.
2007-01-24 00:00:21 +01:00
|
|
|
AC_FUNC_FORK
|
|
|
|
|
|
2007-07-10 22:37:05 +02:00
|
|
|
optional_bin_progs=
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_CHECK_FUNCS([chroot],
|
2009-08-22 18:56:06 +02:00
|
|
|
gl_ADD_PROG([optional_bin_progs], [chroot]))
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_CHECK_FUNCS([gethostid],
|
2009-08-22 18:56:06 +02:00
|
|
|
gl_ADD_PROG([optional_bin_progs], [hostid]))
|
2017-02-05 13:23:22 +01:00
|
|
|
AC_CHECK_FUNCS([sigsuspend],
|
|
|
|
|
gl_ADD_PROG([optional_bin_progs], [timeout]))
|
2002-07-01 08:08:43 +00:00
|
|
|
|
2004-04-13 15:29:33 +00:00
|
|
|
gl_WINSIZE_IN_PTEM
|
2002-07-01 08:08:43 +00:00
|
|
|
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_MSG_CHECKING([whether localtime caches TZ])
|
|
|
|
|
AC_CACHE_VAL([utils_cv_localtime_cache],
|
2002-07-01 08:08:43 +00:00
|
|
|
[if test x$ac_cv_func_tzset = xyes; then
|
2002-11-17 10:10:26 +00:00
|
|
|
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <time.h>
|
2002-07-01 08:08:43 +00:00
|
|
|
#if STDC_HEADERS
|
|
|
|
|
# include <stdlib.h>
|
|
|
|
|
#endif
|
|
|
|
|
extern char **environ;
|
2006-10-12 20:39:33 +00:00
|
|
|
void unset_TZ (void)
|
2002-07-01 08:08:43 +00:00
|
|
|
{
|
|
|
|
|
char **from, **to;
|
|
|
|
|
for (to = from = environ; (*to = *from); from++)
|
|
|
|
|
if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
|
|
|
|
|
to++;
|
|
|
|
|
}
|
2021-07-18 00:12:29 -05:00
|
|
|
int
|
|
|
|
|
main ()
|
2002-07-01 08:08:43 +00:00
|
|
|
{
|
|
|
|
|
time_t now = time ((time_t *) 0);
|
|
|
|
|
int hour_GMT0, hour_unset;
|
|
|
|
|
if (putenv ("TZ=GMT0") != 0)
|
2011-03-14 14:26:38 +01:00
|
|
|
return 1;
|
2002-07-01 08:08:43 +00:00
|
|
|
hour_GMT0 = localtime (&now)->tm_hour;
|
|
|
|
|
unset_TZ ();
|
|
|
|
|
hour_unset = localtime (&now)->tm_hour;
|
|
|
|
|
if (putenv ("TZ=PST8") != 0)
|
2011-03-14 14:26:38 +01:00
|
|
|
return 1;
|
2002-07-01 08:08:43 +00:00
|
|
|
if (localtime (&now)->tm_hour == hour_GMT0)
|
2011-03-14 14:26:38 +01:00
|
|
|
return 1;
|
2002-07-01 08:08:43 +00:00
|
|
|
unset_TZ ();
|
|
|
|
|
if (localtime (&now)->tm_hour != hour_unset)
|
2011-03-14 14:26:38 +01:00
|
|
|
return 1;
|
|
|
|
|
return 0;
|
2002-11-17 10:10:26 +00:00
|
|
|
}]])],
|
|
|
|
|
[utils_cv_localtime_cache=no],
|
|
|
|
|
[utils_cv_localtime_cache=yes],
|
2002-07-01 08:08:43 +00:00
|
|
|
[# If we have tzset, assume the worst when cross-compiling.
|
|
|
|
|
utils_cv_localtime_cache=yes])
|
|
|
|
|
else
|
2009-08-22 18:56:06 +02:00
|
|
|
# If we lack tzset, report that localtime does not cache TZ,
|
|
|
|
|
# since we can't invalidate the cache if we don't have tzset.
|
|
|
|
|
utils_cv_localtime_cache=no
|
2002-07-01 08:08:43 +00:00
|
|
|
fi])dnl
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_MSG_RESULT([$utils_cv_localtime_cache])
|
2002-07-01 08:08:43 +00:00
|
|
|
if test $utils_cv_localtime_cache = yes; then
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_DEFINE([LOCALTIME_CACHE], [1], [FIXME])
|
2002-07-01 08:08:43 +00:00
|
|
|
fi
|
|
|
|
|
|
2021-11-21 15:07:18 -08:00
|
|
|
# macOS >= 10.12
|
|
|
|
|
AC_CHECK_FUNCS([fclonefileat])
|
|
|
|
|
|
2014-03-18 16:12:26 -07:00
|
|
|
# Assume that if getattrat exists, it's compatible with Solaris 11.
|
|
|
|
|
AC_CHECK_FUNCS([getattrat])
|
|
|
|
|
if test $ac_cv_func_getattrat = yes; then
|
|
|
|
|
LIB_NVPAIR=-lnvpair
|
|
|
|
|
AC_SUBST([LIB_NVPAIR])
|
|
|
|
|
fi
|
|
|
|
|
|
2019-03-02 19:57:17 -08:00
|
|
|
# glibc >= 2.28 and linux kernel >= 4.11
|
|
|
|
|
AC_CHECK_FUNCS([statx])
|
|
|
|
|
|
2002-07-01 08:08:43 +00:00
|
|
|
# SCO-ODT-3.0 is reported to need -los to link programs using initgroups
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_CHECK_FUNCS([initgroups])
|
2002-07-01 08:08:43 +00:00
|
|
|
if test $ac_cv_func_initgroups = no; then
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_CHECK_LIB([os], [initgroups])
|
2002-07-01 08:08:43 +00:00
|
|
|
fi
|
|
|
|
|
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_CHECK_FUNCS([syslog])
|
2002-07-01 08:08:43 +00:00
|
|
|
if test $ac_cv_func_syslog = no; then
|
|
|
|
|
# syslog is not in the default libraries. See if it's in some other.
|
|
|
|
|
for lib in bsd socket inet; do
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_CHECK_LIB([$lib], [syslog], [AC_DEFINE([HAVE_SYSLOG], [1], [FIXME])
|
2002-07-01 08:08:43 +00:00
|
|
|
LIBS="$LIBS -l$lib"; break])
|
|
|
|
|
done
|
|
|
|
|
fi
|
|
|
|
|
|
2005-09-09 20:47:29 +00:00
|
|
|
AC_CACHE_CHECK([for 3-argument setpriority function],
|
|
|
|
|
[utils_cv_func_setpriority],
|
|
|
|
|
[AC_LINK_IFELSE(
|
|
|
|
|
[AC_LANG_PROGRAM(
|
|
|
|
|
[[#include <sys/time.h>
|
2009-08-22 18:56:06 +02:00
|
|
|
#include <sys/resource.h>
|
2005-09-09 20:47:29 +00:00
|
|
|
]],
|
|
|
|
|
[[setpriority (0, 0, 0);]])],
|
|
|
|
|
[utils_cv_func_setpriority=yes],
|
|
|
|
|
[utils_cv_func_setpriority=no])])
|
|
|
|
|
if test $utils_cv_func_setpriority = no; then
|
|
|
|
|
AC_CHECK_FUNCS([nice])
|
2002-07-01 08:08:43 +00:00
|
|
|
fi
|
2005-09-09 20:47:29 +00:00
|
|
|
case $utils_cv_func_setpriority,$ac_cv_func_nice in
|
|
|
|
|
*yes*)
|
2007-07-10 22:37:05 +02:00
|
|
|
gl_ADD_PROG([optional_bin_progs], [nice])
|
2005-09-09 20:47:29 +00:00
|
|
|
esac
|
2002-07-01 08:08:43 +00:00
|
|
|
|
2019-05-28 12:42:24 -07:00
|
|
|
if test "$cross_compiling" = yes || test -c /dev/stdin <.; then
|
|
|
|
|
AC_DEFINE([DEV_FD_MIGHT_BE_CHR], [1],
|
|
|
|
|
[Define to 1 if /dev/std{in,out,err} and /dev/fd/N, if they exist, might be
|
|
|
|
|
character-special devices whose minor device number is the file
|
|
|
|
|
descriptor number, such as on Solaris. Leave undefined if they are
|
|
|
|
|
definitely the actual files. This determination should be done after any
|
|
|
|
|
symbolic links are followed.])
|
|
|
|
|
fi
|
|
|
|
|
|
2004-04-13 15:29:33 +00:00
|
|
|
AC_DEFUN([coreutils_DUMMY_1],
|
2002-07-01 08:08:43 +00:00
|
|
|
[
|
2003-08-17 17:50:30 +00:00
|
|
|
AC_REQUIRE([gl_READUTMP])
|
2002-07-01 08:08:43 +00:00
|
|
|
if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
|
2007-07-10 22:37:05 +02:00
|
|
|
gl_ADD_PROG([optional_bin_progs], [who])
|
|
|
|
|
gl_ADD_PROG([optional_bin_progs], [users])
|
|
|
|
|
gl_ADD_PROG([optional_bin_progs], [pinky])
|
2002-07-01 08:08:43 +00:00
|
|
|
fi
|
|
|
|
|
])
|
2004-04-13 15:29:33 +00:00
|
|
|
coreutils_DUMMY_1
|
2002-07-01 08:08:43 +00:00
|
|
|
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_MSG_CHECKING([ut_host in struct utmp])
|
|
|
|
|
AC_CACHE_VAL([su_cv_func_ut_host_in_utmp],
|
2002-11-17 10:10:26 +00:00
|
|
|
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
|
2015-12-03 13:55:44 -08:00
|
|
|
#include <utmp.h>
|
|
|
|
|
struct utmp ut;
|
|
|
|
|
int s = sizeof ut.ut_host;]])],
|
2002-11-17 10:10:26 +00:00
|
|
|
[su_cv_func_ut_host_in_utmp=yes],
|
|
|
|
|
[su_cv_func_ut_host_in_utmp=no])])
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_MSG_RESULT([$su_cv_func_ut_host_in_utmp])
|
2002-07-01 08:08:43 +00:00
|
|
|
if test $su_cv_func_ut_host_in_utmp = yes; then
|
|
|
|
|
have_ut_host=1
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_DEFINE([HAVE_UT_HOST], [1], [FIXME])
|
2002-07-01 08:08:43 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if test -z "$have_ut_host"; then
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_MSG_CHECKING([ut_host in struct utmpx])
|
|
|
|
|
AC_CACHE_VAL([su_cv_func_ut_host_in_utmpx],
|
2002-11-17 10:10:26 +00:00
|
|
|
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
|
2015-12-03 13:55:44 -08:00
|
|
|
#include <utmpx.h>
|
|
|
|
|
struct utmpx ut;
|
|
|
|
|
int s = sizeof ut.ut_host;]])],
|
2002-11-17 10:10:26 +00:00
|
|
|
[su_cv_func_ut_host_in_utmpx=yes],
|
|
|
|
|
[su_cv_func_ut_host_in_utmpx=no])])
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_MSG_RESULT([$su_cv_func_ut_host_in_utmpx])
|
2002-07-01 08:08:43 +00:00
|
|
|
if test $su_cv_func_ut_host_in_utmpx = yes; then
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_DEFINE([HAVE_UTMPX_H], [1], [FIXME])
|
|
|
|
|
AC_DEFINE([HAVE_UT_HOST], [1], [FIXME])
|
2002-07-01 08:08:43 +00:00
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
2007-07-10 22:37:05 +02:00
|
|
|
GNULIB_BOOT_TIME([gl_ADD_PROG([optional_bin_progs], [uptime])])
|
2002-07-01 08:08:43 +00:00
|
|
|
|
2002-11-17 10:10:26 +00:00
|
|
|
AC_SYS_POSIX_TERMIOS()
|
2004-04-13 15:29:33 +00:00
|
|
|
gl_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
|
2002-07-01 08:08:43 +00:00
|
|
|
|
2002-08-05 12:21:42 +00:00
|
|
|
if test $ac_cv_sys_posix_termios = yes; then
|
2007-07-10 22:37:05 +02:00
|
|
|
gl_ADD_PROG([optional_bin_progs], [stty])
|
2002-07-01 08:08:43 +00:00
|
|
|
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_MSG_CHECKING([whether termios.h needs _XOPEN_SOURCE])
|
|
|
|
|
AC_CACHE_VAL([su_cv_sys_termios_needs_xopen_source],
|
|
|
|
|
[AC_EGREP_CPP([yes], [#include <termios.h>
|
2002-07-01 08:08:43 +00:00
|
|
|
#ifdef IUCLC
|
|
|
|
|
yes
|
|
|
|
|
#endif], su_cv_sys_termios_needs_xopen_source=no,
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_EGREP_CPP([yes], [#define _XOPEN_SOURCE
|
2002-07-01 08:08:43 +00:00
|
|
|
#include <termios.h>
|
|
|
|
|
#ifdef IUCLC
|
|
|
|
|
yes
|
|
|
|
|
#endif], su_cv_sys_termios_needs_xopen_source=yes,
|
|
|
|
|
su_cv_sys_termios_needs_xopen_source=no))])
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_MSG_RESULT([$su_cv_sys_termios_needs_xopen_source])
|
2002-07-01 08:08:43 +00:00
|
|
|
test $su_cv_sys_termios_needs_xopen_source = yes &&
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_DEFINE([TERMIOS_NEEDS_XOPEN_SOURCE], [1], [FIXME])
|
2002-07-01 08:08:43 +00:00
|
|
|
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_MSG_CHECKING([c_line in struct termios])
|
|
|
|
|
AC_CACHE_VAL([su_cv_sys_c_line_in_termios],
|
2002-11-17 10:10:26 +00:00
|
|
|
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if TERMIOS_NEEDS_XOPEN_SOURCE
|
2015-12-03 13:55:44 -08:00
|
|
|
#define _XOPEN_SOURCE
|
|
|
|
|
#endif
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
#include <termios.h>
|
|
|
|
|
struct termios t;
|
|
|
|
|
int s = sizeof t.c_line;]])],
|
2002-11-17 10:10:26 +00:00
|
|
|
[su_cv_sys_c_line_in_termios=yes],
|
|
|
|
|
[su_cv_sys_c_line_in_termios=no])])
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_MSG_RESULT([$su_cv_sys_c_line_in_termios])
|
2002-11-17 10:10:26 +00:00
|
|
|
test $su_cv_sys_c_line_in_termios = yes \
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
&& AC_DEFINE([HAVE_C_LINE], [1], [FIXME])
|
2002-07-01 08:08:43 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# FIXME: note that this macro appears above, too.
|
|
|
|
|
# I'm leaving it here for now. This whole thing needs to be modernized...
|
2004-04-13 15:29:33 +00:00
|
|
|
gl_WINSIZE_IN_PTEM
|
2002-07-01 08:08:43 +00:00
|
|
|
|
2004-04-13 15:29:33 +00:00
|
|
|
gl_HEADER_TIOCGWINSZ_IN_TERMIOS_H
|
2002-07-01 08:08:43 +00:00
|
|
|
|
2007-11-01 18:35:04 +01:00
|
|
|
if test $gl_cv_sys_tiocgwinsz_needs_termios_h = no && \
|
|
|
|
|
test $gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h = no; then
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_MSG_CHECKING([TIOCGWINSZ in sys/pty.h])
|
|
|
|
|
AC_CACHE_VAL([su_cv_sys_tiocgwinsz_in_sys_pty_h],
|
2002-11-17 10:10:26 +00:00
|
|
|
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
|
2002-07-01 08:08:43 +00:00
|
|
|
#ifdef WINSIZE_IN_PTEM
|
|
|
|
|
# include <sys/stream.h>
|
|
|
|
|
# include <sys/ptem.h>
|
|
|
|
|
#endif
|
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
|
#include <sys/tty.h>
|
2002-11-17 10:10:26 +00:00
|
|
|
#include <sys/pty.h>]], [[int x = TIOCGWINSZ;]])],
|
|
|
|
|
[su_cv_sys_tiocgwinsz_in_sys_pty_h=yes],
|
|
|
|
|
[su_cv_sys_tiocgwinsz_in_sys_pty_h=no])])
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
AC_MSG_RESULT([$su_cv_sys_tiocgwinsz_in_sys_pty_h])
|
2002-07-01 08:08:43 +00:00
|
|
|
|
|
|
|
|
test $su_cv_sys_tiocgwinsz_in_sys_pty_h = yes \
|
improve M4 quoting
* configure.ac: Add quotes.
* gl/m4/mgetgroups.m4 (gl_MGETGROUPS): Likewise.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Likewise.
* m4/check-decl.m4 (gl_CHECK_DECLS): Likewise.
* m4/gmp.m4 (cu_GMP): Likewise.
* m4/jm-macros.m4 (coreutils_MACROS, gl_CHECK_ALL_HEADERS): Likewise.
(gl_CHECK_ALL_TYPES): Likewise.
* m4/lib-check.m4 (cu_LIB_CHECK): Likewise.
* m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Likewise.
FYI, I first ran this command:
git ls-files | grep -E '\.(m4|ac)$' | xargs perl -pi \
-e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\(\[[^,]+?\], )([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g'
Then I updated serial numbers and copyright dates manually.
Also, I manually added two pairs of quotes in boottime.m4.
2008-12-30 19:16:08 +01:00
|
|
|
&& AC_DEFINE([GWINSZ_IN_SYS_PTY], [1],
|
2002-07-01 08:08:43 +00:00
|
|
|
[Define if your system defines TIOCGWINSZ in sys/pty.h.])
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# For src/kill.c.
|
2004-03-02 22:49:44 +00:00
|
|
|
AC_CHECK_DECLS([strsignal, sys_siglist, _sys_siglist, __sys_siglist], , ,
|
|
|
|
|
[AC_INCLUDES_DEFAULT
|
|
|
|
|
#include <signal.h>])
|
2002-07-01 08:08:43 +00:00
|
|
|
|
2007-07-10 22:37:05 +02:00
|
|
|
# Build df only if there's a point to it.
|
|
|
|
|
if test $gl_cv_list_mounted_fs = yes && test $gl_cv_fs_space = yes; then
|
|
|
|
|
gl_ADD_PROG([optional_bin_progs], [df])
|
|
|
|
|
fi
|
|
|
|
|
|
2015-06-06 14:17:14 +01:00
|
|
|
# Build stdbuf only if supported
|
2015-06-05 17:33:54 -07:00
|
|
|
ac_save_CFLAGS=$CFLAGS
|
|
|
|
|
ac_save_LDFLAGS=$LDFLAGS
|
2019-05-14 09:20:56 -07:00
|
|
|
cu_save_c_werror_flag=$ac_c_werror_flag
|
|
|
|
|
AC_LANG_WERROR
|
2015-06-05 17:33:54 -07:00
|
|
|
# Detect warnings about ignored "constructor" attributes.
|
|
|
|
|
gl_WARN_ADD([-Werror], [CFLAGS])
|
|
|
|
|
gl_WARN_ADD([-errwarn], [CFLAGS])
|
|
|
|
|
# Put this message here, after gl_WARN_ADD's chatter.
|
|
|
|
|
AC_MSG_CHECKING([whether this system supports stdbuf])
|
|
|
|
|
CFLAGS="-fPIC $CFLAGS"
|
|
|
|
|
LDFLAGS="-shared $LDFLAGS"
|
|
|
|
|
stdbuf_supported=no
|
2015-06-06 14:17:14 +01:00
|
|
|
# Note we only LINK here rather than RUN to support cross compilation
|
2015-06-05 17:33:54 -07:00
|
|
|
AC_LINK_IFELSE(
|
2014-05-10 04:53:29 +01:00
|
|
|
[AC_LANG_PROGRAM([[
|
|
|
|
|
static int stdbuf = 0;
|
|
|
|
|
|
|
|
|
|
void __attribute__ ((constructor))
|
|
|
|
|
stdbuf_init (void)
|
|
|
|
|
{
|
2015-06-06 14:17:14 +01:00
|
|
|
stdbuf = 1;
|
2014-05-10 04:53:29 +01:00
|
|
|
}]],[[
|
2015-12-03 13:55:44 -08:00
|
|
|
if (stdbuf != 1)
|
|
|
|
|
return 1;]])
|
2014-05-10 04:53:29 +01:00
|
|
|
],
|
2015-06-05 17:33:54 -07:00
|
|
|
[stdbuf_supported=yes])
|
2014-05-10 04:53:29 +01:00
|
|
|
AC_MSG_RESULT([$stdbuf_supported])
|
2014-07-16 16:47:50 +01:00
|
|
|
if test "$stdbuf_supported" = "yes" && test -z "$EXEEXT"; then
|
2008-12-17 11:30:03 +00:00
|
|
|
gl_ADD_PROG([optional_bin_progs], [stdbuf])
|
|
|
|
|
fi
|
2015-06-05 17:33:54 -07:00
|
|
|
CFLAGS=$ac_save_CFLAGS
|
|
|
|
|
LDFLAGS=$ac_save_LDFLAGS
|
2019-05-14 09:20:56 -07:00
|
|
|
ac_c_werror_flag=$cu_save_c_werror_flag
|
2008-12-17 11:30:03 +00:00
|
|
|
|
2021-02-03 10:35:22 +01:00
|
|
|
AC_MSG_CHECKING([if __get_cpuid available])
|
2021-05-10 05:22:11 -05:00
|
|
|
AC_LINK_IFELSE(
|
2021-02-03 10:35:22 +01:00
|
|
|
[AC_LANG_SOURCE([[
|
|
|
|
|
#include <cpuid.h>
|
|
|
|
|
|
2021-07-18 00:12:29 -05:00
|
|
|
int
|
|
|
|
|
main (void)
|
2021-02-03 10:35:22 +01:00
|
|
|
{
|
|
|
|
|
unsigned int eax, ebx, ecx, edx;
|
2021-07-18 00:12:29 -05:00
|
|
|
__get_cpuid (1, &eax, &ebx, &ecx, &edx);
|
2021-02-03 10:35:22 +01:00
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
]])
|
|
|
|
|
],[
|
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
|
AC_DEFINE([HAVE_CPUID], [1], [__get_cpuid available])
|
|
|
|
|
cpuid_exists=yes
|
|
|
|
|
],[
|
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
ac_save_CFLAGS=$CFLAGS
|
|
|
|
|
CFLAGS="-mavx -mpclmul $CFLAGS"
|
|
|
|
|
AC_MSG_CHECKING([if pclmul intrinsic exists])
|
|
|
|
|
AC_COMPILE_IFELSE(
|
|
|
|
|
[AC_LANG_SOURCE([[
|
|
|
|
|
#include <x86intrin.h>
|
|
|
|
|
|
2021-07-18 00:12:29 -05:00
|
|
|
int
|
|
|
|
|
main (void)
|
2021-02-03 10:35:22 +01:00
|
|
|
{
|
|
|
|
|
__m128i a, b;
|
2021-07-18 00:12:29 -05:00
|
|
|
a = _mm_clmulepi64_si128 (a, b, 0x00);
|
2021-02-03 10:35:22 +01:00
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
]])
|
|
|
|
|
],[
|
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
|
AC_DEFINE([HAVE_PCLMUL_INTRINSIC], [1], [pclmul intrinsic exists])
|
|
|
|
|
pclmul_intrinsic_exists=yes
|
|
|
|
|
],[
|
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
|
])
|
|
|
|
|
if test "x$cpuid_exists" = "xyes" &&
|
|
|
|
|
test "x$pclmul_intrinsic_exists" = "xyes"; then
|
|
|
|
|
AC_DEFINE([USE_PCLMUL_CRC32], [1],
|
|
|
|
|
[CRC32 calculation by pclmul hardware instruction enabled])
|
|
|
|
|
fi
|
|
|
|
|
AM_CONDITIONAL([USE_PCLMUL_CRC32],
|
|
|
|
|
[test "x$cpuid_exists" = "xyes" &&
|
|
|
|
|
test "x$pclmul_intrinsic_exists" = "xyes"])
|
|
|
|
|
CFLAGS=$ac_save_CFLAGS
|
|
|
|
|
|
2021-02-20 12:27:17 +01:00
|
|
|
AC_MSG_CHECKING([if __get_cpuid_count exists])
|
2021-05-10 05:22:11 -05:00
|
|
|
AC_LINK_IFELSE(
|
2021-02-20 12:27:17 +01:00
|
|
|
[AC_LANG_SOURCE([[
|
|
|
|
|
#include <cpuid.h>
|
|
|
|
|
|
2021-07-18 00:12:29 -05:00
|
|
|
int
|
|
|
|
|
main (void)
|
2021-02-20 12:27:17 +01:00
|
|
|
{
|
|
|
|
|
unsigned int eax = 0, ebx = 0, ecx = 0, edx = 0;
|
2021-07-18 00:12:29 -05:00
|
|
|
__get_cpuid_count (7, 0, &eax, &ebx, &ecx, &edx);
|
2021-02-20 12:27:17 +01:00
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
]])
|
|
|
|
|
],[
|
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
|
get_cpuid_count_exists=yes
|
|
|
|
|
],[
|
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
CFLAGS="-mavx2 $CFLAGS"
|
|
|
|
|
AC_MSG_CHECKING([if avx2 intrinstics exists])
|
|
|
|
|
AC_COMPILE_IFELSE(
|
|
|
|
|
[AC_LANG_SOURCE([[
|
|
|
|
|
#include <x86intrin.h>
|
|
|
|
|
|
2021-07-18 00:12:29 -05:00
|
|
|
int
|
|
|
|
|
main (void)
|
2021-02-20 12:27:17 +01:00
|
|
|
{
|
|
|
|
|
__m256i a, b;
|
2021-07-18 00:12:29 -05:00
|
|
|
a = _mm256_sad_epu8 (a, b);
|
2021-02-20 12:27:17 +01:00
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
]])
|
|
|
|
|
],[
|
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
|
AC_DEFINE([HAVE_AVX2_INTRINSIC], [1], [avx2 intrinsics exists])
|
|
|
|
|
avx2_intrinsic_exists=yes
|
|
|
|
|
],[
|
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
|
])
|
|
|
|
|
if test "x$get_cpuid_count_exists" = "xyes" &&
|
|
|
|
|
test "x$avx2_intrinsic_exists" = "xyes"; then
|
|
|
|
|
AC_DEFINE([USE_AVX2_WC_LINECOUNT], [1], [Counting lines with AVX2 enabled])
|
|
|
|
|
fi
|
|
|
|
|
AM_CONDITIONAL([USE_AVX2_WC_LINECOUNT],
|
|
|
|
|
[test "x$get_cpuid_count_exists" = "xyes" &&
|
|
|
|
|
test "x$avx2_intrinsic_exists" = "xyes"])
|
|
|
|
|
|
|
|
|
|
CFLAGS=$ac_save_CFLAGS
|
|
|
|
|
|
2007-07-10 22:37:05 +02:00
|
|
|
############################################################################
|
2007-07-12 20:58:53 +02:00
|
|
|
|
build: refactor how lists of coreutils programs are defined
This is in preparation of future changes. Still, this patch
leaves the build system in a better shape; true, with more
indirections, but also with less convoluted and brittle hacks.
Unfortunately, this commit also makes some rebuild rules
incomplete; that will son be fixed by follow-up patches.
* build-aux/gen-lists-of-programs.sh: New, generates autoconf
and automake input fragments that define "lists" of all coreutils
programs, with further distinctions about how and when these
programs should be built (by default; if the system is capable
enough; only if the user asks for them explicitly). This is
useful to avoid duplicating the definitions of these lists among
several files (at least 'configure.ac' 'src/Makefile.am'); such
duplication had proved a source of inconsistencies and bugs in
the past. And the pre-existing way to avoid such duplication,
as implemented in 'configure.ac' before this patch, was overly
complex and brittle.
* Makefile.am (EXTRA_DIST): Distribute the new script.
* bootstrap.conf (bootstrap_post_import_hook): Run the new script
to generate 'm4/cu-progs.m4' and 'src/cu-progs.mk'.
* .gitignore: Ignore those files.
* configure.ac: Include 'm4/cu-progs.m4', and decidedly simplify
most of the program lists definition and processing accordingly.
* src/Makefile.am: Similarly include 'src/cu-progs.mk', containing
definition of variables $(default__progs), $(no_install__progs)
and $(build_if_possible__progs). Accordingly ...
(no_install__progs, build_if_possible__progs): ... remove.
(EXTRA_DIST): Adjust definition.
Adjust a comment.
2012-09-01 01:46:39 +02:00
|
|
|
dnl Autogenerated by the 'gen-lists-of-programs.sh' auxiliary script.
|
|
|
|
|
dnl Issue proper calls to the macros gl_INCLUDE_EXCLUDE_PROG and
|
|
|
|
|
dnl gl_ADD_PROG (updating $optional_bin_progs), and generate the list
|
|
|
|
|
dnl of coreutils programs to be built only upon explicit user request,
|
|
|
|
|
dnl saving that list in the $no_install_progs_default shell variable.
|
|
|
|
|
m4_include([m4/cu-progs.m4])
|
2007-07-10 22:37:05 +02:00
|
|
|
|
2012-09-01 01:46:54 +02:00
|
|
|
# Now that we know which programs will actually be built, determine
|
2010-07-20 19:13:40 +01:00
|
|
|
# which optional helper progs should be compiled.
|
2014-09-09 15:50:07 +01:00
|
|
|
# Note it adding to pkglibexec_PROGRAMS, $(transform) in src/local.mk
|
|
|
|
|
# may need to be updated accordingly.
|
2010-07-20 19:13:40 +01:00
|
|
|
case " $optional_bin_progs " in
|
2012-09-01 01:46:54 +02:00
|
|
|
*' stdbuf '*) pkglibexec_PROGRAMS='src/libstdbuf.so';;
|
|
|
|
|
*) pkglibexec_PROGRAMS='';;
|
2010-07-20 19:13:40 +01:00
|
|
|
esac
|
|
|
|
|
|
2012-09-01 01:46:51 +02:00
|
|
|
man1_MANS=`
|
2012-08-29 15:18:08 +02:00
|
|
|
for p in $optional_bin_progs; do
|
2012-09-01 01:46:51 +02:00
|
|
|
# Change "ginstall.1" to "install.1".
|
2012-08-29 15:18:08 +02:00
|
|
|
test $p = ginstall && p=install
|
|
|
|
|
# Ignore the "[" program, since writing a portable make rule to
|
|
|
|
|
# generate its manpage is not practical.
|
|
|
|
|
dnl Use the autoconf-provided quadrigraph to represent "[",
|
|
|
|
|
dnl otherwise we will incur in dreadful quoting issues.
|
|
|
|
|
test x$p = x'@<:@' && continue
|
2012-08-29 16:37:24 +02:00
|
|
|
echo "man/$p.1"
|
2012-08-29 15:18:08 +02:00
|
|
|
done`
|
2012-09-01 01:46:40 +02:00
|
|
|
|
build: simplify and make more portable to non-GNU make
The AC_SUBST'd variable '$(NO_INSTALL_PROGS_DEFAULT)' is only used in
makefile expressions expanding the list of manual pages that are not
built by default (but might need to be when a distribution tarball
is created). Such expressions exploited a feature of make variable
expansion -- namely, $(VAR:%=dir/%.x) -- that, while seemingly quite
portable in practice, is not POSIX-conforming, and could break on
lesser vendor make implementations. So kill two birds with one stone,
by getting rid of the $(NO_INSTALL_PROGS_DEFAULT) intermediate variable
and improving makefile portability in the process.
While at it, we also clean up some other minor naming inconsistency
and useless indirection.
* configure.ac (NO_INSTALL_PROGS_DEFAULT): Don't define or AC_SUBST
anymore; instead ...
(EXTRA_MANS): ... define and AC_SUBST these.
* man/local.mk (extra_man_1): Rename ...
(EXTRA_MANS): ... like this, explicitly making clear it's AC_SUBST'd.
(extra_man_x): It's used only once, no need to define it; just inline
its only expansion where needed.
(EXTRA_DIST): Adjust.
(ALL_MANS): New, union of $(EXTRA_MANS) and $(dist_man1_MANS).
* cfg.mk (check-x-vs-1, sc_option_desc_uppercase): Rely on $(ALL_MANS)
rather than on $(NO_INSTALL_PROGS_DEFAULT) and $(dist_man1_MANS).
2012-09-01 01:46:48 +02:00
|
|
|
# Not installed by "make install", but must be built when creating
|
|
|
|
|
# a distribution tarball.
|
2015-11-10 14:05:50 +00:00
|
|
|
EXTRA_MANS=`for p in $no_install_progs_default $gl_no_install_prog; do
|
|
|
|
|
echo man/$p.1
|
|
|
|
|
done`
|
2012-09-01 01:46:47 +02:00
|
|
|
|
2014-06-05 19:50:32 -07:00
|
|
|
# Replace all the programs by the single binary and symlinks if specified.
|
|
|
|
|
single_binary_progs=
|
|
|
|
|
single_binary_libs=
|
|
|
|
|
single_binary_deps=
|
|
|
|
|
single_binary_install_type=
|
|
|
|
|
if test "$gl_single_binary" != no; then
|
|
|
|
|
man1_MANS="$man1_MANS man/coreutils.1"
|
|
|
|
|
# Convert the list to a space separated list
|
|
|
|
|
gl_single_binary_exceptions=`echo $gl_single_binary_exceptions | tr ',' ' '`
|
|
|
|
|
|
|
|
|
|
single_binary_progs=`echo $optional_bin_progs`
|
|
|
|
|
optional_bin_progs="coreutils"
|
|
|
|
|
for prog in $gl_single_binary_exceptions; do
|
|
|
|
|
# Fail if requested to exclude a program than was not part of coreutils.
|
|
|
|
|
case " $single_binary_progs " in
|
|
|
|
|
*" $prog "*)
|
|
|
|
|
gl_REMOVE_PROG([single_binary_progs], [$prog]) ;
|
|
|
|
|
gl_ADD_PROG([optional_bin_progs], [$prog]) ;;
|
|
|
|
|
*) AC_MSG_ERROR(['$prog' is not being compiled.]) ;;
|
|
|
|
|
esac
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# single_binary_libs holds the list of libs required by the selected
|
|
|
|
|
# programs, such as for example -lrt.
|
|
|
|
|
single_binary_libs=`
|
|
|
|
|
for p in $single_binary_progs; do
|
|
|
|
|
# Convert '[' to '_'
|
|
|
|
|
test x"$p" = x'@<:@' && p='_'
|
|
|
|
|
printf '$(src_libsinglebin_%s_a_ldadd) ' "$p"
|
|
|
|
|
done`
|
|
|
|
|
# single_binary_deps holds the list of libsinglebin_*.a files that have the
|
|
|
|
|
# compiled code of each selected program in a "library" format.
|
|
|
|
|
single_binary_deps=`
|
|
|
|
|
for p in $single_binary_progs; do
|
|
|
|
|
# Convert '[' to '_'
|
|
|
|
|
test x"$p" = x'@<:@' && p='_'
|
|
|
|
|
printf 'src/libsinglebin_%s.a ' "$p"
|
|
|
|
|
done`
|
|
|
|
|
single_binary_install_type="$gl_single_binary"
|
|
|
|
|
fi
|
|
|
|
|
AC_SUBST([single_binary_progs], [$single_binary_progs])
|
|
|
|
|
AC_SUBST([single_binary_libs], [$single_binary_libs])
|
|
|
|
|
AC_SUBST([single_binary_deps], [$single_binary_deps])
|
|
|
|
|
AC_SUBST([single_binary_install_type], [$single_binary_install_type])
|
|
|
|
|
|
|
|
|
|
|
2012-09-01 01:46:47 +02:00
|
|
|
# The programs built and installed by "make && make install".
|
2012-09-01 01:46:40 +02:00
|
|
|
# Since this is AC_SUBST'd, Automake won't be able to perform rewrite
|
2012-09-01 01:46:47 +02:00
|
|
|
# with $(EXEEXT) appending on it, so we have to do it ourselves -- in
|
|
|
|
|
# this case, only for $(bin_PROGRAMS).
|
|
|
|
|
bin_PROGRAMS=`
|
2012-09-01 01:46:54 +02:00
|
|
|
for p in $optional_bin_progs; do echo src/"$p"'$(EXEEXT)'; done`
|
2012-09-01 01:46:40 +02:00
|
|
|
|
2012-08-29 15:18:08 +02:00
|
|
|
# Normalize whitespace.
|
2012-09-01 01:46:51 +02:00
|
|
|
man1_MANS=`echo $man1_MANS`
|
build: simplify and make more portable to non-GNU make
The AC_SUBST'd variable '$(NO_INSTALL_PROGS_DEFAULT)' is only used in
makefile expressions expanding the list of manual pages that are not
built by default (but might need to be when a distribution tarball
is created). Such expressions exploited a feature of make variable
expansion -- namely, $(VAR:%=dir/%.x) -- that, while seemingly quite
portable in practice, is not POSIX-conforming, and could break on
lesser vendor make implementations. So kill two birds with one stone,
by getting rid of the $(NO_INSTALL_PROGS_DEFAULT) intermediate variable
and improving makefile portability in the process.
While at it, we also clean up some other minor naming inconsistency
and useless indirection.
* configure.ac (NO_INSTALL_PROGS_DEFAULT): Don't define or AC_SUBST
anymore; instead ...
(EXTRA_MANS): ... define and AC_SUBST these.
* man/local.mk (extra_man_1): Rename ...
(EXTRA_MANS): ... like this, explicitly making clear it's AC_SUBST'd.
(extra_man_x): It's used only once, no need to define it; just inline
its only expansion where needed.
(EXTRA_DIST): Adjust.
(ALL_MANS): New, union of $(EXTRA_MANS) and $(dist_man1_MANS).
* cfg.mk (check-x-vs-1, sc_option_desc_uppercase): Rely on $(ALL_MANS)
rather than on $(NO_INSTALL_PROGS_DEFAULT) and $(dist_man1_MANS).
2012-09-01 01:46:48 +02:00
|
|
|
EXTRA_MANS=`echo $EXTRA_MANS`
|
2012-09-01 01:46:47 +02:00
|
|
|
bin_PROGRAMS=`echo $bin_PROGRAMS`
|
|
|
|
|
pkglibexec_PROGS=`echo $pkglibexec_PROGRAMS`
|
2007-07-10 22:37:05 +02:00
|
|
|
|
2012-09-01 01:46:47 +02:00
|
|
|
AC_SUBST([bin_PROGRAMS]) AM_SUBST_NOTMAKE([bin_PROGRAMS])
|
|
|
|
|
AC_SUBST([pkglibexec_PROGRAMS]) AM_SUBST_NOTMAKE([pkglibexec_PROGRAMS])
|
2012-09-01 01:46:51 +02:00
|
|
|
AC_SUBST([man1_MANS]) AM_SUBST_NOTMAKE([man1_MANS])
|
|
|
|
|
AC_SUBST([EXTRA_MANS]) AM_SUBST_NOTMAKE([EXTRA_MANS])
|
2007-07-22 18:26:23 +02:00
|
|
|
|
2012-09-02 21:55:11 +02:00
|
|
|
AC_SUBST([built_programs], [$optional_bin_progs])
|
|
|
|
|
|
2008-09-09 19:53:14 +02:00
|
|
|
AM_CONDITIONAL([CROSS_COMPILING], [test "$cross_compiling" = yes])
|
|
|
|
|
|
2007-07-10 22:37:05 +02:00
|
|
|
############################################################################
|
|
|
|
|
|
2009-11-13 20:35:58 +01:00
|
|
|
# As long as "grep 'PRI[diouxX]' po/*.pot" reports matches in
|
|
|
|
|
# translatable strings, we must use need-formatstring-macros here.
|
|
|
|
|
AM_GNU_GETTEXT([external], [need-formatstring-macros])
|
2015-04-27 10:14:14 +01:00
|
|
|
AM_GNU_GETTEXT_VERSION([0.19.2])
|
2002-07-01 08:08:43 +00:00
|
|
|
|
2008-04-26 09:28:48 +02:00
|
|
|
# For a test of uniq: it uses the $LOCALE_FR envvar.
|
|
|
|
|
gt_LOCALE_FR
|
|
|
|
|
|
2002-07-01 08:08:43 +00:00
|
|
|
AC_CONFIG_FILES(
|
|
|
|
|
Makefile
|
|
|
|
|
po/Makefile.in
|
2007-11-10 18:33:07 +01:00
|
|
|
gnulib-tests/Makefile
|
2002-07-01 08:08:43 +00:00
|
|
|
)
|
|
|
|
|
AC_OUTPUT
|