2006-02-03 22:40:35 +08:00
|
|
|
# -*- autoconf -*-
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
2005-05-19 03:27:39 +08:00
|
|
|
|
2011-01-01 18:37:32 +08:00
|
|
|
# Copyright (C) 1991, 1993-2011 Free Software Foundation, Inc.
|
2005-05-19 03:27:39 +08:00
|
|
|
|
2007-07-23 20:35:58 +08:00
|
|
|
# This program is free software: you can redistribute it and/or modify
|
2006-02-03 22:40:35 +08:00
|
|
|
# it under the terms of the GNU General Public License as published by
|
2007-07-23 20:35:58 +08:00
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
2005-05-19 03:27:39 +08:00
|
|
|
|
2006-02-03 22:40:35 +08: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-19 03:27:39 +08:00
|
|
|
|
2006-02-03 22:40:35 +08:00
|
|
|
# You should have received a copy of the GNU General Public License
|
2007-07-23 20:35:58 +08:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2005-05-19 03:27:39 +08:00
|
|
|
|
|
|
|
dnl Written by Jim Meyering.
|
|
|
|
|
2011-06-03 19:28:15 +08:00
|
|
|
AC_PREREQ([2.64])
|
2007-08-26 06:48:41 +08: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.
|
2008-02-29 16:36:24 +08:00
|
|
|
AC_INIT([GNU coreutils],
|
2009-08-23 00:56:06 +08:00
|
|
|
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
|
|
|
|
[bug-coreutils@gnu.org])
|
2007-08-26 06:48:41 +08: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-31 02:16:08 +08:00
|
|
|
AC_CONFIG_SRCDIR([src/ls.c])
|
2002-07-01 16:08:43 +08: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-31 02:16:08 +08:00
|
|
|
AC_CONFIG_AUX_DIR([build-aux])
|
2006-08-24 02:37:27 +08:00
|
|
|
AC_CONFIG_HEADERS([lib/config.h:lib/config.hin])
|
2002-07-01 16:08:43 +08:00
|
|
|
|
2010-01-06 17:14:23 +08:00
|
|
|
AM_INIT_AUTOMAKE([1.11.1 dist-xz color-tests parallel-tests])
|
2009-04-19 19:41:52 +08:00
|
|
|
AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
|
2002-07-01 16:08:43 +08:00
|
|
|
|
2005-11-19 07:03:11 +08:00
|
|
|
AC_PROG_CC_STDC
|
2005-11-19 03:45:42 +08:00
|
|
|
AM_PROG_CC_C_O
|
2002-07-01 16:08:43 +08:00
|
|
|
AC_PROG_CPP
|
|
|
|
AC_PROG_GCC_TRADITIONAL
|
|
|
|
AC_PROG_RANLIB
|
2003-03-20 06:50:52 +08: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 15:30:45 +08:00
|
|
|
gl_EARLY
|
2006-10-13 04:37:02 +08:00
|
|
|
gl_INIT
|
|
|
|
coreutils_MACROS
|
2004-01-12 07:50:27 +08:00
|
|
|
|
2008-11-12 18:11:54 +08:00
|
|
|
AC_ARG_ENABLE([gcc-warnings],
|
|
|
|
[AS_HELP_STRING([--enable-gcc-warnings],
|
2009-08-23 00:56:06 +08:00
|
|
|
[turn on lots of GCC warnings (for developers)])],
|
2008-11-12 18:11:54 +08:00
|
|
|
[case $enableval in
|
|
|
|
yes|no) ;;
|
|
|
|
*) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
|
|
|
|
esac
|
|
|
|
gl_gcc_warnings=$enableval],
|
|
|
|
[gl_gcc_warnings=no]
|
|
|
|
)
|
|
|
|
|
2011-09-12 21:04:32 +08: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])
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
2008-11-12 18:11:54 +08:00
|
|
|
if test "$gl_gcc_warnings" = yes; then
|
|
|
|
gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
|
|
|
|
AC_SUBST([WERROR_CFLAGS])
|
2009-02-14 18:29:20 +08:00
|
|
|
|
2009-05-17 17:43:21 +08:00
|
|
|
nw=
|
|
|
|
# This, $nw, is the list of warnings we disable.
|
2009-02-14 18:29:20 +08:00
|
|
|
nw="$nw -Wdeclaration-after-statement" # too useful to forbid
|
|
|
|
nw="$nw -Waggregate-return" # anachronistic
|
2009-05-17 17:43:21 +08:00
|
|
|
nw="$nw -Wlong-long" # C90 is anachronistic (lib/gethrxtime.h)
|
2009-02-14 18:29:20 +08: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 -Wlogical-op" # any use of fwrite provokes this
|
|
|
|
nw="$nw -Wformat-nonliteral" # who.c and pinky.c strftime uses
|
|
|
|
nw="$nw -Wvla" # warnings in gettext.h
|
|
|
|
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 21:20:15 +08:00
|
|
|
nw="$nw -Wstack-protector" # not worth working around
|
2009-02-14 18:29:20 +08: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
|
2011-05-25 20:34:13 +08:00
|
|
|
|
|
|
|
# Using -Wstrict-overflow is a pain, but the alternative is worse.
|
|
|
|
# For an example, see the code that provoked this report:
|
|
|
|
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33498
|
|
|
|
# Code like that still infloops with gcc-4.6.0 and -O2. Scary indeed.
|
2009-02-14 18:29:20 +08: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
|
maint: use "const" and "pure" function attributes where possible
* configure.ac (WARN_CFLAGS): Add -Wsuggest-attribute=const,
-Wsuggest-attribute=pure and -Wsuggest-attribute=noreturn.
(GNULIB_WARN_CFLAGS): But do not add them here... yet.
* src/chown-core.h (chopt_free, uid_to_name): Add function attribute(s).
* src/copy.c (is_ancestor, valid_options): Likewise.
* src/copy.h (chown_failure_ok): Likewise.
* src/dd.c (operand_matches, operand_is): Likewise.
* src/df.c (selected_fstype, excluded_fstype): Likewise.
* src/expr.c (null looks_like_integer): Likewise.
* src/md5sum.c (hex_digits): Likewise.
* src/od.c (get_lcm): Likewise.
* src/pathchk.c (component_start, component_len): Likewise.
* src/pinky.c (count_ampersands): Likewise.
* src/pr.c (cols_ready_to_print): Likewise.
* src/ptx.c (search_table): Likewise.
* src/sort.c (find_unit_order): Likewise.
* src/stty.c (mode_type_flag, string_to_baud, baud_to_value): Likewise.
* src/system.h (gcd, lcm): Likewise.
* src/tr.c (is_char_class_member, look_up_char_class): Likewise.
(star_digits_closebracket): Likewise.
* src/uniq.c (find_field): Likewise.
* src/wc.c (compute_number_width): Likewise.
* lib/xfts.h (cycle_warning_required): Likewise.
* gl/lib/randint.h (randint_get_source): Likewise.
* gl/lib/randperm.c (ceil_lg): Likewise.
* gl/lib/randperm.h (randperm_bound): Likewise.
* lib/strnumcmp.h (strintcmp): Likewise.
2011-04-25 01:06:39 +08:00
|
|
|
gl_WARN_ADD([-Wsuggest-attribute=const])
|
|
|
|
gl_WARN_ADD([-Wsuggest-attribute=noreturn])
|
2009-05-17 19:47:39 +08:00
|
|
|
|
2011-09-12 21:04:32 +08:00
|
|
|
# Enable this warning only with gcc-4.7 and newer. With 4.6.1 20110824,
|
|
|
|
# it suggests test.c's advance function may be pure, even though it
|
|
|
|
# increments a global variable. Oops.
|
|
|
|
# Normally we'd write code to test for the precise failure, but that
|
|
|
|
# requires a relatively large input to make gcc exhibit the failure.
|
|
|
|
gl_GCC_VERSION_IFELSE([4], [7], [gl_WARN_ADD([-Wsuggest-attribute=pure])])
|
|
|
|
|
2009-05-17 19:47:39 +08:00
|
|
|
# In spite of excluding -Wlogical-op above, it is enabled, as of
|
|
|
|
# gcc 4.5.0 20090517, and it provokes warnings in cat.c, dd.c, truncate.c
|
|
|
|
gl_WARN_ADD([-Wno-logical-op])
|
|
|
|
|
2009-02-14 18:29:20 +08:00
|
|
|
gl_WARN_ADD([-fdiagnostics-show-option])
|
2009-10-22 01:27:29 +08:00
|
|
|
gl_WARN_ADD([-funit-at-a-time])
|
2009-02-14 18:29:20 +08:00
|
|
|
|
2008-11-12 18:11:54 +08:00
|
|
|
AC_SUBST([WARN_CFLAGS])
|
2009-02-14 18:29:20 +08: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-31 02:16:08 +08:00
|
|
|
AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.])
|
|
|
|
AC_DEFINE([_FORTIFY_SOURCE], [2],
|
2008-11-12 18:11:54 +08:00
|
|
|
[enable compile-time and run-time bounds-checking, and some warnings])
|
2009-02-14 18:29:20 +08:00
|
|
|
AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks])
|
2009-10-27 19:06:43 +08:00
|
|
|
|
|
|
|
# We use a slightly smaller set of warning options for lib/.
|
|
|
|
# Remove the following and save the result in GNULIB_WARN_CFLAGS.
|
|
|
|
nw=
|
2011-05-25 20:34:13 +08:00
|
|
|
nw="$nw -Wstrict-overflow"
|
2009-10-27 19:06:43 +08:00
|
|
|
nw="$nw -Wuninitialized"
|
|
|
|
nw="$nw -Wunused-macros"
|
|
|
|
nw="$nw -Wmissing-prototypes"
|
|
|
|
nw="$nw -Wold-style-definition"
|
maint: use "const" and "pure" function attributes where possible
* configure.ac (WARN_CFLAGS): Add -Wsuggest-attribute=const,
-Wsuggest-attribute=pure and -Wsuggest-attribute=noreturn.
(GNULIB_WARN_CFLAGS): But do not add them here... yet.
* src/chown-core.h (chopt_free, uid_to_name): Add function attribute(s).
* src/copy.c (is_ancestor, valid_options): Likewise.
* src/copy.h (chown_failure_ok): Likewise.
* src/dd.c (operand_matches, operand_is): Likewise.
* src/df.c (selected_fstype, excluded_fstype): Likewise.
* src/expr.c (null looks_like_integer): Likewise.
* src/md5sum.c (hex_digits): Likewise.
* src/od.c (get_lcm): Likewise.
* src/pathchk.c (component_start, component_len): Likewise.
* src/pinky.c (count_ampersands): Likewise.
* src/pr.c (cols_ready_to_print): Likewise.
* src/ptx.c (search_table): Likewise.
* src/sort.c (find_unit_order): Likewise.
* src/stty.c (mode_type_flag, string_to_baud, baud_to_value): Likewise.
* src/system.h (gcd, lcm): Likewise.
* src/tr.c (is_char_class_member, look_up_char_class): Likewise.
(star_digits_closebracket): Likewise.
* src/uniq.c (find_field): Likewise.
* src/wc.c (compute_number_width): Likewise.
* lib/xfts.h (cycle_warning_required): Likewise.
* gl/lib/randint.h (randint_get_source): Likewise.
* gl/lib/randperm.c (ceil_lg): Likewise.
* gl/lib/randperm.h (randperm_bound): Likewise.
* lib/strnumcmp.h (strintcmp): Likewise.
2011-04-25 01:06:39 +08:00
|
|
|
# FIXME: remove/reenable the following two, once gnulib is adjusted.
|
|
|
|
nw="$nw -Wsuggest-attribute=const"
|
|
|
|
nw="$nw -Wsuggest-attribute=pure"
|
2009-10-27 19:06:43 +08:00
|
|
|
gl_MANYWARN_COMPLEMENT([GNULIB_WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
|
|
|
|
AC_SUBST([GNULIB_WARN_CFLAGS])
|
2010-10-13 17:20:18 +08:00
|
|
|
|
|
|
|
# For gnulib-tests, the set is slightly smaller still.
|
|
|
|
nw=
|
|
|
|
nw="$nw -Wstrict-prototypes"
|
|
|
|
gl_MANYWARN_COMPLEMENT([GNULIB_TEST_WARN_CFLAGS],
|
|
|
|
[$GNULIB_WARN_CFLAGS], [$nw])
|
|
|
|
AC_SUBST([GNULIB_TEST_WARN_CFLAGS])
|
2008-11-12 18:11:54 +08: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 07:00:21 +08:00
|
|
|
AC_FUNC_FORK
|
|
|
|
|
2007-07-11 04:37:05 +08: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-31 02:16:08 +08:00
|
|
|
AC_CHECK_FUNCS([chroot],
|
2009-08-23 00:56:06 +08: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-31 02:16:08 +08:00
|
|
|
AC_CHECK_FUNCS([gethostid],
|
2009-08-23 00:56:06 +08:00
|
|
|
gl_ADD_PROG([optional_bin_progs], [hostid]))
|
2002-07-01 16:08:43 +08:00
|
|
|
|
2004-04-13 23:29:33 +08:00
|
|
|
gl_WINSIZE_IN_PTEM
|
2002-07-01 16:08:43 +08: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-31 02:16:08 +08:00
|
|
|
AC_MSG_CHECKING([whether localtime caches TZ])
|
|
|
|
AC_CACHE_VAL([utils_cv_localtime_cache],
|
2002-07-01 16:08:43 +08:00
|
|
|
[if test x$ac_cv_func_tzset = xyes; then
|
2002-11-17 18:10:26 +08:00
|
|
|
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <time.h>
|
2002-07-01 16:08:43 +08:00
|
|
|
#if STDC_HEADERS
|
|
|
|
# include <stdlib.h>
|
|
|
|
#endif
|
|
|
|
extern char **environ;
|
2006-10-13 04:39:33 +08:00
|
|
|
void unset_TZ (void)
|
2002-07-01 16:08:43 +08:00
|
|
|
{
|
|
|
|
char **from, **to;
|
|
|
|
for (to = from = environ; (*to = *from); from++)
|
|
|
|
if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
|
|
|
|
to++;
|
|
|
|
}
|
2006-10-13 04:39:33 +08:00
|
|
|
int main()
|
2002-07-01 16:08:43 +08:00
|
|
|
{
|
|
|
|
time_t now = time ((time_t *) 0);
|
|
|
|
int hour_GMT0, hour_unset;
|
|
|
|
if (putenv ("TZ=GMT0") != 0)
|
2011-03-14 21:26:38 +08:00
|
|
|
return 1;
|
2002-07-01 16:08:43 +08:00
|
|
|
hour_GMT0 = localtime (&now)->tm_hour;
|
|
|
|
unset_TZ ();
|
|
|
|
hour_unset = localtime (&now)->tm_hour;
|
|
|
|
if (putenv ("TZ=PST8") != 0)
|
2011-03-14 21:26:38 +08:00
|
|
|
return 1;
|
2002-07-01 16:08:43 +08:00
|
|
|
if (localtime (&now)->tm_hour == hour_GMT0)
|
2011-03-14 21:26:38 +08:00
|
|
|
return 1;
|
2002-07-01 16:08:43 +08:00
|
|
|
unset_TZ ();
|
|
|
|
if (localtime (&now)->tm_hour != hour_unset)
|
2011-03-14 21:26:38 +08:00
|
|
|
return 1;
|
|
|
|
return 0;
|
2002-11-17 18:10:26 +08:00
|
|
|
}]])],
|
|
|
|
[utils_cv_localtime_cache=no],
|
|
|
|
[utils_cv_localtime_cache=yes],
|
2002-07-01 16:08:43 +08:00
|
|
|
[# If we have tzset, assume the worst when cross-compiling.
|
|
|
|
utils_cv_localtime_cache=yes])
|
|
|
|
else
|
2009-08-23 00:56:06 +08: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 16:08:43 +08: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-31 02:16:08 +08:00
|
|
|
AC_MSG_RESULT([$utils_cv_localtime_cache])
|
2002-07-01 16:08:43 +08: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-31 02:16:08 +08:00
|
|
|
AC_DEFINE([LOCALTIME_CACHE], [1], [FIXME])
|
2002-07-01 16:08:43 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
# 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-31 02:16:08 +08:00
|
|
|
AC_CHECK_FUNCS([initgroups])
|
2002-07-01 16:08:43 +08: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-31 02:16:08 +08:00
|
|
|
AC_CHECK_LIB([os], [initgroups])
|
2002-07-01 16:08:43 +08: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-31 02:16:08 +08:00
|
|
|
AC_CHECK_FUNCS([syslog])
|
2002-07-01 16:08:43 +08: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-31 02:16:08 +08:00
|
|
|
AC_CHECK_LIB([$lib], [syslog], [AC_DEFINE([HAVE_SYSLOG], [1], [FIXME])
|
2002-07-01 16:08:43 +08:00
|
|
|
LIBS="$LIBS -l$lib"; break])
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2005-09-10 04:47:29 +08: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-23 00:56:06 +08:00
|
|
|
#include <sys/resource.h>
|
2005-09-10 04:47:29 +08: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 16:08:43 +08:00
|
|
|
fi
|
2005-09-10 04:47:29 +08:00
|
|
|
case $utils_cv_func_setpriority,$ac_cv_func_nice in
|
|
|
|
*yes*)
|
2007-07-11 04:37:05 +08:00
|
|
|
gl_ADD_PROG([optional_bin_progs], [nice])
|
2005-09-10 04:47:29 +08:00
|
|
|
esac
|
2002-07-01 16:08:43 +08:00
|
|
|
|
2004-04-13 23:29:33 +08:00
|
|
|
AC_DEFUN([coreutils_DUMMY_1],
|
2002-07-01 16:08:43 +08:00
|
|
|
[
|
2003-08-18 01:50:30 +08:00
|
|
|
AC_REQUIRE([gl_READUTMP])
|
2002-07-01 16:08:43 +08:00
|
|
|
if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
|
2007-07-11 04:37:05 +08: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 16:08:43 +08:00
|
|
|
fi
|
|
|
|
])
|
2004-04-13 23:29:33 +08:00
|
|
|
coreutils_DUMMY_1
|
2002-07-01 16:08:43 +08: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-31 02:16:08 +08:00
|
|
|
AC_MSG_CHECKING([ut_host in struct utmp])
|
|
|
|
AC_CACHE_VAL([su_cv_func_ut_host_in_utmp],
|
2002-11-17 18:10:26 +08:00
|
|
|
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
|
2006-10-13 04:39:33 +08:00
|
|
|
#include <utmp.h>]], [[struct utmp ut; return !sizeof ut.ut_host;]])],
|
2002-11-17 18:10:26 +08: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-31 02:16:08 +08:00
|
|
|
AC_MSG_RESULT([$su_cv_func_ut_host_in_utmp])
|
2002-07-01 16:08:43 +08: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-31 02:16:08 +08:00
|
|
|
AC_DEFINE([HAVE_UT_HOST], [1], [FIXME])
|
2002-07-01 16:08:43 +08: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-31 02:16:08 +08:00
|
|
|
AC_MSG_CHECKING([ut_host in struct utmpx])
|
|
|
|
AC_CACHE_VAL([su_cv_func_ut_host_in_utmpx],
|
2002-11-17 18:10:26 +08:00
|
|
|
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
|
2006-10-13 04:39:33 +08:00
|
|
|
#include <utmpx.h>]], [[struct utmpx ut; return !sizeof ut.ut_host;]])],
|
2002-11-17 18:10:26 +08: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-31 02:16:08 +08:00
|
|
|
AC_MSG_RESULT([$su_cv_func_ut_host_in_utmpx])
|
2002-07-01 16:08:43 +08: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-31 02:16:08 +08:00
|
|
|
AC_DEFINE([HAVE_UTMPX_H], [1], [FIXME])
|
|
|
|
AC_DEFINE([HAVE_UT_HOST], [1], [FIXME])
|
2002-07-01 16:08:43 +08:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2007-07-11 04:37:05 +08:00
|
|
|
GNULIB_BOOT_TIME([gl_ADD_PROG([optional_bin_progs], [uptime])])
|
2002-07-01 16:08:43 +08:00
|
|
|
|
2002-11-17 18:10:26 +08:00
|
|
|
AC_SYS_POSIX_TERMIOS()
|
2004-04-13 23:29:33 +08:00
|
|
|
gl_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
|
2002-07-01 16:08:43 +08:00
|
|
|
|
2002-08-05 20:21:42 +08:00
|
|
|
if test $ac_cv_sys_posix_termios = yes; then
|
2007-07-11 04:37:05 +08:00
|
|
|
gl_ADD_PROG([optional_bin_progs], [stty])
|
2002-07-01 16:08:43 +08: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-31 02:16:08 +08: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 16:08:43 +08: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-31 02:16:08 +08:00
|
|
|
AC_EGREP_CPP([yes], [#define _XOPEN_SOURCE
|
2002-07-01 16:08:43 +08: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-31 02:16:08 +08:00
|
|
|
AC_MSG_RESULT([$su_cv_sys_termios_needs_xopen_source])
|
2002-07-01 16:08:43 +08: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-31 02:16:08 +08:00
|
|
|
AC_DEFINE([TERMIOS_NEEDS_XOPEN_SOURCE], [1], [FIXME])
|
2002-07-01 16:08:43 +08: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-31 02:16:08 +08:00
|
|
|
AC_MSG_CHECKING([c_line in struct termios])
|
|
|
|
AC_CACHE_VAL([su_cv_sys_c_line_in_termios],
|
2002-11-17 18:10:26 +08:00
|
|
|
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if TERMIOS_NEEDS_XOPEN_SOURCE
|
2002-07-01 16:08:43 +08:00
|
|
|
#define _XOPEN_SOURCE
|
|
|
|
#endif
|
|
|
|
#include <sys/types.h>
|
2006-10-13 04:39:33 +08:00
|
|
|
#include <termios.h>]], [[struct termios t; return !sizeof t.c_line;]])],
|
2002-11-17 18:10:26 +08: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-31 02:16:08 +08:00
|
|
|
AC_MSG_RESULT([$su_cv_sys_c_line_in_termios])
|
2002-11-17 18:10:26 +08: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-31 02:16:08 +08:00
|
|
|
&& AC_DEFINE([HAVE_C_LINE], [1], [FIXME])
|
2002-07-01 16:08:43 +08: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 23:29:33 +08:00
|
|
|
gl_WINSIZE_IN_PTEM
|
2002-07-01 16:08:43 +08:00
|
|
|
|
2004-04-13 23:29:33 +08:00
|
|
|
gl_HEADER_TIOCGWINSZ_IN_TERMIOS_H
|
2002-07-01 16:08:43 +08:00
|
|
|
|
2007-11-02 01:35:04 +08: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-31 02:16:08 +08:00
|
|
|
AC_MSG_CHECKING([TIOCGWINSZ in sys/pty.h])
|
|
|
|
AC_CACHE_VAL([su_cv_sys_tiocgwinsz_in_sys_pty_h],
|
2002-11-17 18:10:26 +08:00
|
|
|
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
|
2002-07-01 16:08:43 +08: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 18:10:26 +08: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-31 02:16:08 +08:00
|
|
|
AC_MSG_RESULT([$su_cv_sys_tiocgwinsz_in_sys_pty_h])
|
2002-07-01 16:08:43 +08: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-31 02:16:08 +08:00
|
|
|
&& AC_DEFINE([GWINSZ_IN_SYS_PTY], [1],
|
2002-07-01 16:08:43 +08:00
|
|
|
[Define if your system defines TIOCGWINSZ in sys/pty.h.])
|
|
|
|
fi
|
|
|
|
|
|
|
|
# For src/kill.c.
|
2004-03-03 06:49:44 +08:00
|
|
|
AC_CHECK_DECLS([strsignal, sys_siglist, _sys_siglist, __sys_siglist], , ,
|
|
|
|
[AC_INCLUDES_DEFAULT
|
|
|
|
#include <signal.h>])
|
2002-07-01 16:08:43 +08:00
|
|
|
|
2005-05-19 03:27:39 +08:00
|
|
|
cu_LIB_CHECK
|
factor arbitrarily large numbers
* m4/gmp.m4: New file; adds cu_GMP, which detects GNU MP.
* configure.ac: Use cu_GMP.
* src/Makefile.am: Link factor against libgmp if available.
* src/factor.c: Use GNU MP if it is available.
(emit_factor, emit_ul_factor, factor_using_division,
factor_using_pollard_rho, extract_factors_multi,
sort_and_print_factors, free_factors): new functions
for the arbitrary-precision implementation, taken from an example
in GNU MP.
(factor_wheel): Renamed; was called factor.
(print_factors_single): Renamed; was called print_factors.
(print_factors): New function, chooses between the single- and
arbitrary-precision algorithms according to availability of GNU MP
and the length of the number to be factored.
(usage, main): New options --bignum and --no-bignum.
* coreutils.texi (factor invocation): Document new command-line
options for the MP implementation and update the performance
numbers to take into account the asymptotically faster algorithm.
* TODO: Remove item about factoring large primes (it's done).
* m4/gmp.m4: Add support for --without-gmp.
* NEWS: Mention the new feature.
2008-07-31 15:58:10 +08:00
|
|
|
cu_GMP
|
2002-07-01 16:08:43 +08:00
|
|
|
|
2007-07-11 04:37:05 +08: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
|
|
|
|
|
2008-12-17 19:30:03 +08:00
|
|
|
# Limit stdbuf to ELF systems with GCC
|
|
|
|
AC_MSG_CHECKING([whether this is an ELF system])
|
|
|
|
AC_EGREP_CPP([yes], [#if __ELF__
|
|
|
|
yes
|
|
|
|
#endif], [elf_sys=yes], [elf_sys=no])
|
|
|
|
AC_MSG_RESULT([$elf_sys])
|
|
|
|
if test "$elf_sys" = "yes" && \
|
|
|
|
test "$GCC" = "yes"; then
|
|
|
|
gl_ADD_PROG([optional_bin_progs], [stdbuf])
|
|
|
|
fi
|
|
|
|
|
2007-07-11 04:37:05 +08:00
|
|
|
############################################################################
|
2007-07-13 02:58:53 +08:00
|
|
|
mk="$srcdir/src/Makefile.am"
|
2007-07-11 04:37:05 +08:00
|
|
|
# Extract all literal names from the definition of $(EXTRA_PROGRAMS)
|
2007-07-13 02:58:53 +08:00
|
|
|
# in $mk but don't expand the variable references.
|
2007-07-11 04:37:05 +08:00
|
|
|
# Append each literal name to $optional_bin_progs.
|
|
|
|
v=EXTRA_PROGRAMS
|
2007-07-13 02:58:53 +08:00
|
|
|
for gl_i in `sed -n '/^'$v' =/,/[[^\]]$/p' $mk \
|
2007-07-11 04:37:05 +08:00
|
|
|
| sed 's/^ *//;/^\$.*/d;/^'$v' =/d' \
|
2008-06-11 20:04:45 +08:00
|
|
|
| tr -s '\\015\\012\\\\' ' '`; do
|
2007-07-11 04:37:05 +08:00
|
|
|
gl_ADD_PROG([optional_bin_progs], $gl_i)
|
|
|
|
done
|
|
|
|
|
|
|
|
# As above, extract literal names from the definition of $(no_install__progs)
|
2007-07-13 02:58:53 +08:00
|
|
|
# in $mk but don't expand the variable references.
|
2007-07-11 04:37:05 +08:00
|
|
|
v=no_install__progs
|
2007-07-13 02:58:53 +08:00
|
|
|
t=`sed -n '/^'$v' =/,/[[^\]]$/p' $mk \
|
2007-07-11 04:37:05 +08:00
|
|
|
| sed 's/^ *//;/^\$.*/d;/^'$v' =/d' \
|
2008-04-02 15:03:36 +08:00
|
|
|
| tr -s '\\015\\012\\\\' ' '`
|
2007-07-11 04:37:05 +08:00
|
|
|
# Remove any trailing space.
|
|
|
|
no_install_progs_default=`echo "$t"|sed 's/ $//'`
|
|
|
|
|
2007-08-21 16:34:33 +08:00
|
|
|
# Unfortunately, due to the way autoconf's AS_HELP_STRING works, the list
|
|
|
|
# of default-not-installed programs, "arch hostname su", must appear in two
|
2007-07-14 16:02:57 +08:00
|
|
|
# places: in this file below, and in $mk. Using "$no_install_progs_default"
|
|
|
|
# below cannot work. And we can't substitute the names into $mk because
|
|
|
|
# automake needs the literals, too.
|
2007-07-13 02:58:53 +08:00
|
|
|
# The compromise is to ensure that the space-separated list extracted
|
2007-07-14 16:02:57 +08:00
|
|
|
# above matches the literal 2nd argument below.
|
2007-07-13 02:58:53 +08:00
|
|
|
c="$srcdir/configure.ac"
|
2008-03-23 01:33:15 +08:00
|
|
|
re='^g''l_INCLUDE_EXCLUDE_PROG(.* [\[\(.*\)\]])'
|
|
|
|
t=`sed -n '/'"$re"'/{s/'"$re"'/\1/;s/,/ /gp
|
2008-01-13 16:16:09 +08:00
|
|
|
}' $c`
|
2007-07-14 16:02:57 +08:00
|
|
|
case $t in
|
2007-07-13 02:58:53 +08:00
|
|
|
$no_install_progs_default) ;;
|
|
|
|
*) AC_MSG_ERROR([[internal error: g'l_INCLUDE_EXCLUDE_PROG's 2nd arg, $t,
|
|
|
|
does not match the list of default-not-installed programs
|
2009-08-23 00:56:06 +08:00
|
|
|
($no_install_progs_default) also recorded in $mk]],
|
|
|
|
1) ;;
|
2007-07-13 02:58:53 +08:00
|
|
|
esac
|
|
|
|
|
2007-07-11 04:37:05 +08:00
|
|
|
# Given the name of a variable containing a space-separated list of
|
|
|
|
# install-by-default programs and the actual list do-not-install-by-default
|
|
|
|
# programs, modify the former variable to reflect any "do-install" and
|
|
|
|
# "don't-install" requests.
|
|
|
|
# I.e., add any program name specified via --enable-install-program=..., and
|
|
|
|
# remove any program name specified via --enable-no-install-program=...
|
2007-12-21 00:38:57 +08:00
|
|
|
# Note how the second argument below is a literal, with "," separators.
|
|
|
|
# That is required due to the way the macro works, and since the
|
|
|
|
# corresponding ./configure option argument is comma-separated on input.
|
|
|
|
gl_INCLUDE_EXCLUDE_PROG([optional_bin_progs], [arch,hostname,su])
|
2007-07-11 04:37:05 +08:00
|
|
|
|
2010-07-21 02:13:40 +08:00
|
|
|
# Now that we know which programs will actually be built up, figure out
|
|
|
|
# which optional helper progs should be compiled.
|
|
|
|
optional_pkglib_progs=
|
|
|
|
case " $optional_bin_progs " in
|
|
|
|
*' stdbuf '*) gl_ADD_PROG([optional_pkglib_progs], [libstdbuf.so]) ;;
|
|
|
|
esac
|
|
|
|
|
2007-07-11 04:37:05 +08:00
|
|
|
# Set INSTALL_SU if su installation has been requested via
|
|
|
|
# --enable-install-program=su.
|
|
|
|
AC_SUBST([INSTALL_SU])
|
|
|
|
case " $optional_bin_progs " in
|
|
|
|
*' su '*) INSTALL_SU=yes ;;
|
|
|
|
*) INSTALL_SU=no ;;
|
|
|
|
esac
|
|
|
|
|
2008-04-22 16:52:37 +08:00
|
|
|
MAN=`echo "$optional_bin_progs "|sed 's/ /.1 /g;s/ $//'|tr -d '\\015\\012'`
|
2007-07-12 17:41:32 +08:00
|
|
|
|
2011-06-18 19:03:54 +08:00
|
|
|
# Change "ginstall.1" to "install.1" in $MAN.
|
2008-04-22 16:52:37 +08:00
|
|
|
MAN=`for m in $MAN; do test $m = ginstall.1 && m=install.1; echo $m; done \
|
2008-06-11 14:06:56 +08:00
|
|
|
| tr '\015\012' ' '; echo`
|
2007-07-11 04:37:05 +08:00
|
|
|
|
|
|
|
# Remove [.1, since writing a portable rule for it in man/Makefile.am
|
|
|
|
# is not practical. The sed LHS below uses the autoconf quadrigraph
|
|
|
|
# representing '['.
|
|
|
|
MAN=`echo "$MAN"|sed 's/\@<:@\.1//'`
|
|
|
|
|
2007-07-12 17:41:32 +08:00
|
|
|
OPTIONAL_BIN_PROGS=`echo "$optional_bin_progs "|sed 's/ /\$(EXEEXT) /g;s/ $//'`
|
2007-07-23 00:26:23 +08:00
|
|
|
AC_SUBST([OPTIONAL_BIN_PROGS])
|
2008-12-17 19:30:03 +08:00
|
|
|
OPTIONAL_PKGLIB_PROGS=`echo "$optional_pkglib_progs " | sed 's/ $//'`
|
|
|
|
AC_SUBST([OPTIONAL_PKGLIB_PROGS])
|
2007-07-11 04:37:05 +08:00
|
|
|
NO_INSTALL_PROGS_DEFAULT=$no_install_progs_default
|
2007-07-23 00:26:23 +08:00
|
|
|
AC_SUBST([NO_INSTALL_PROGS_DEFAULT])
|
|
|
|
|
2008-09-10 01:53:14 +08:00
|
|
|
AM_CONDITIONAL([CROSS_COMPILING], [test "$cross_compiling" = yes])
|
|
|
|
|
2007-07-23 00:26:23 +08:00
|
|
|
# Arrange to rerun configure whenever the file, src/Makefile.am,
|
|
|
|
# containing the list of program names changes.
|
|
|
|
CONFIG_STATUS_DEPENDENCIES='$(top_srcdir)/src/Makefile.am'
|
|
|
|
AC_SUBST([CONFIG_STATUS_DEPENDENCIES])
|
2007-07-11 04:37:05 +08:00
|
|
|
############################################################################
|
|
|
|
|
2009-11-14 03:35:58 +08: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])
|
2011-08-12 02:42:03 +08:00
|
|
|
AM_GNU_GETTEXT_VERSION([0.18.1])
|
2002-07-01 16:08:43 +08:00
|
|
|
|
2008-04-26 15:28:48 +08:00
|
|
|
# For a test of uniq: it uses the $LOCALE_FR envvar.
|
|
|
|
gt_LOCALE_FR
|
|
|
|
|
2002-07-01 16:08:43 +08:00
|
|
|
AC_CONFIG_FILES(
|
|
|
|
Makefile
|
|
|
|
doc/Makefile
|
|
|
|
lib/Makefile
|
|
|
|
man/Makefile
|
|
|
|
po/Makefile.in
|
|
|
|
src/Makefile
|
|
|
|
tests/Makefile
|
2007-11-11 01:33:07 +08:00
|
|
|
gnulib-tests/Makefile
|
2002-07-01 16:08:43 +08:00
|
|
|
)
|
|
|
|
AC_OUTPUT
|