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
|
|
|
|
2006-02-03 22:40:35 +08:00
|
|
|
# Copyright (C) 1991, 1993-2006 Free Software Foundation, Inc.
|
2005-05-19 03:27:39 +08:00
|
|
|
|
2006-02-03 22:40:35 +08:00
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2, 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
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2005-05-19 03:27:39 +08:00
|
|
|
|
|
|
|
dnl Written by Jim Meyering.
|
|
|
|
|
2005-10-23 18:41:18 +08:00
|
|
|
AC_INIT([GNU coreutils],[6.0-cvs],[bug-coreutils@gnu.org])
|
2002-07-01 16:08:43 +08:00
|
|
|
AC_CONFIG_SRCDIR(src/ls.c)
|
|
|
|
|
2005-03-22 23:09:54 +08:00
|
|
|
AC_CONFIG_AUX_DIR(build-aux)
|
2002-11-17 18:10:26 +08:00
|
|
|
AC_CONFIG_HEADERS([config.h:config.hin])
|
2002-07-01 16:08:43 +08:00
|
|
|
|
2005-09-13 21:53:55 +08:00
|
|
|
AB_INIT()
|
2006-02-03 22:40:35 +08:00
|
|
|
AM_INIT_AUTOMAKE([1.9.6 gnits dist-bzip2])
|
2002-07-01 16:08:43 +08:00
|
|
|
|
2004-01-12 07:50:27 +08:00
|
|
|
gl_DEFAULT_POSIX2_VERSION
|
2003-08-09 22:02:52 +08:00
|
|
|
gl_USE_SYSTEM_EXTENSIONS
|
2004-04-13 23:29:33 +08:00
|
|
|
gl_PERL
|
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
|
2006-01-07 09:55:49 +08:00
|
|
|
gl_IGNORE_UNUSED_LIBRARIES
|
2002-07-01 16:08:43 +08:00
|
|
|
|
2004-01-12 07:50:27 +08:00
|
|
|
|
2002-07-01 16:08:43 +08:00
|
|
|
AC_CHECK_FUNCS(uname,
|
2003-03-19 17:06:40 +08:00
|
|
|
OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS uname\$(EXEEXT)"
|
|
|
|
MAN="$MAN uname.1")
|
2002-07-01 16:08:43 +08:00
|
|
|
AC_CHECK_FUNCS(chroot,
|
2003-03-19 17:06:40 +08:00
|
|
|
OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS chroot\$(EXEEXT)"
|
|
|
|
MAN="$MAN chroot.1")
|
2002-07-01 16:08:43 +08:00
|
|
|
AC_CHECK_FUNCS(gethostid,
|
2003-03-19 17:06:40 +08:00
|
|
|
OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS hostid\$(EXEEXT)"
|
|
|
|
MAN="$MAN hostid.1")
|
2002-07-01 16:08:43 +08:00
|
|
|
|
2004-04-13 23:29:33 +08:00
|
|
|
gl_MACROS
|
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
|
|
|
|
|
|
|
AC_MSG_CHECKING(whether localtime caches TZ)
|
|
|
|
AC_CACHE_VAL(utils_cv_localtime_cache,
|
|
|
|
[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;
|
|
|
|
unset_TZ ()
|
|
|
|
{
|
|
|
|
char **from, **to;
|
|
|
|
for (to = from = environ; (*to = *from); from++)
|
|
|
|
if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
|
|
|
|
to++;
|
|
|
|
}
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
time_t now = time ((time_t *) 0);
|
|
|
|
int hour_GMT0, hour_unset;
|
|
|
|
if (putenv ("TZ=GMT0") != 0)
|
|
|
|
exit (1);
|
|
|
|
hour_GMT0 = localtime (&now)->tm_hour;
|
|
|
|
unset_TZ ();
|
|
|
|
hour_unset = localtime (&now)->tm_hour;
|
|
|
|
if (putenv ("TZ=PST8") != 0)
|
|
|
|
exit (1);
|
|
|
|
if (localtime (&now)->tm_hour == hour_GMT0)
|
|
|
|
exit (1);
|
|
|
|
unset_TZ ();
|
|
|
|
if (localtime (&now)->tm_hour != hour_unset)
|
|
|
|
exit (1);
|
|
|
|
exit (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
|
|
|
|
# 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
|
|
|
|
fi])dnl
|
|
|
|
AC_MSG_RESULT($utils_cv_localtime_cache)
|
|
|
|
if test $utils_cv_localtime_cache = yes; then
|
|
|
|
AC_DEFINE(LOCALTIME_CACHE, 1, [FIXME])
|
|
|
|
fi
|
|
|
|
|
|
|
|
# SCO-ODT-3.0 is reported to need -los to link programs using initgroups
|
|
|
|
AC_CHECK_FUNCS(initgroups)
|
|
|
|
if test $ac_cv_func_initgroups = no; then
|
|
|
|
AC_CHECK_LIB(os, initgroups)
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_CHECK_FUNCS(syslog)
|
|
|
|
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
|
|
|
|
AC_CHECK_LIB($lib, syslog, [AC_DEFINE(HAVE_SYSLOG, 1, [FIXME])
|
|
|
|
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>
|
|
|
|
#include <sys/resource.h>
|
|
|
|
]],
|
|
|
|
[[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*)
|
|
|
|
OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS nice\$(EXEEXT)"
|
|
|
|
MAN="$MAN nice.1";;
|
|
|
|
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
|
2003-03-19 17:06:40 +08:00
|
|
|
OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS pinky\$(EXEEXT)"
|
|
|
|
OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS users\$(EXEEXT)"
|
|
|
|
OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS who\$(EXEEXT)"
|
2002-07-01 16:08:43 +08:00
|
|
|
MAN="$MAN pinky.1 users.1 who.1"
|
|
|
|
fi
|
|
|
|
])
|
2004-04-13 23:29:33 +08:00
|
|
|
coreutils_DUMMY_1
|
2002-07-01 16:08:43 +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>
|
|
|
|
#include <utmp.h>]], [[struct utmp ut; ut.ut_host;]])],
|
|
|
|
[su_cv_func_ut_host_in_utmp=yes],
|
|
|
|
[su_cv_func_ut_host_in_utmp=no])])
|
2002-07-01 16:08:43 +08:00
|
|
|
AC_MSG_RESULT($su_cv_func_ut_host_in_utmp)
|
|
|
|
if test $su_cv_func_ut_host_in_utmp = yes; then
|
|
|
|
have_ut_host=1
|
|
|
|
AC_DEFINE(HAVE_UT_HOST, 1, [FIXME])
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -z "$have_ut_host"; then
|
|
|
|
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>
|
|
|
|
#include <utmpx.h>]], [[struct utmpx ut; ut.ut_host;]])],
|
|
|
|
[su_cv_func_ut_host_in_utmpx=yes],
|
|
|
|
[su_cv_func_ut_host_in_utmpx=no])])
|
2002-07-01 16:08:43 +08:00
|
|
|
AC_MSG_RESULT($su_cv_func_ut_host_in_utmpx)
|
|
|
|
if test $su_cv_func_ut_host_in_utmpx = yes; then
|
|
|
|
AC_DEFINE(HAVE_UTMPX_H, 1, [FIXME])
|
|
|
|
AC_DEFINE(HAVE_UT_HOST, 1, [FIXME])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2002-07-17 18:49:46 +08:00
|
|
|
GNULIB_BOOT_TIME(
|
2003-03-19 17:06:40 +08:00
|
|
|
[OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS uptime\$(EXEEXT)"
|
|
|
|
MAN="$MAN uptime.1"])
|
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
|
2003-03-19 17:06:40 +08:00
|
|
|
OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS stty\$(EXEEXT)" MAN="$MAN stty.1"
|
2002-07-01 16:08:43 +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>
|
|
|
|
#ifdef IUCLC
|
|
|
|
yes
|
|
|
|
#endif], su_cv_sys_termios_needs_xopen_source=no,
|
|
|
|
AC_EGREP_CPP(yes, [#define _XOPEN_SOURCE
|
|
|
|
#include <termios.h>
|
|
|
|
#ifdef IUCLC
|
|
|
|
yes
|
|
|
|
#endif], su_cv_sys_termios_needs_xopen_source=yes,
|
|
|
|
su_cv_sys_termios_needs_xopen_source=no))])
|
|
|
|
AC_MSG_RESULT($su_cv_sys_termios_needs_xopen_source)
|
|
|
|
test $su_cv_sys_termios_needs_xopen_source = yes &&
|
|
|
|
AC_DEFINE(TERMIOS_NEEDS_XOPEN_SOURCE, 1, [FIXME])
|
|
|
|
|
|
|
|
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>
|
2002-11-17 18:10:26 +08:00
|
|
|
#include <termios.h>]], [[struct termios t; t.c_line;]])],
|
|
|
|
[su_cv_sys_c_line_in_termios=yes],
|
|
|
|
[su_cv_sys_c_line_in_termios=no])])
|
2002-07-01 16:08:43 +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 \
|
|
|
|
&& 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
|
|
|
|
|
|
|
if test $jm_cv_sys_tiocgwinsz_needs_termios_h = no && \
|
|
|
|
test $jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h = no; then
|
|
|
|
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])])
|
2002-07-01 16:08:43 +08:00
|
|
|
AC_MSG_RESULT($su_cv_sys_tiocgwinsz_in_sys_pty_h)
|
|
|
|
|
|
|
|
test $su_cv_sys_tiocgwinsz_in_sys_pty_h = yes \
|
|
|
|
&& AC_DEFINE(GWINSZ_IN_SYS_PTY, 1,
|
|
|
|
[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
|
|
|
|
2004-07-28 14:58:09 +08:00
|
|
|
# For src/kill.c and src/printf.c.
|
|
|
|
AC_CHECK_DECLS([strtoimax, strtoumax])
|
|
|
|
|
2005-05-19 03:27:39 +08:00
|
|
|
cu_LIB_CHECK
|
2002-07-01 16:08:43 +08:00
|
|
|
|
2002-09-20 16:18:39 +08:00
|
|
|
AM_GNU_GETTEXT([external], [need-ngettext])
|
2006-08-11 06:49:26 +08:00
|
|
|
AM_GNU_GETTEXT_VERSION([0.15])
|
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
|
|
|
|
tests/chgrp/Makefile
|
|
|
|
tests/chmod/Makefile
|
|
|
|
tests/chown/Makefile
|
|
|
|
tests/cp/Makefile
|
|
|
|
tests/cut/Makefile
|
|
|
|
tests/dd/Makefile
|
|
|
|
tests/dircolors/Makefile
|
|
|
|
tests/du/Makefile
|
|
|
|
tests/expr/Makefile
|
|
|
|
tests/factor/Makefile
|
|
|
|
tests/fmt/Makefile
|
|
|
|
tests/head/Makefile
|
|
|
|
tests/install/Makefile
|
|
|
|
tests/join/Makefile
|
|
|
|
tests/ln/Makefile
|
|
|
|
tests/ls-2/Makefile
|
|
|
|
tests/ls/Makefile
|
|
|
|
tests/md5sum/Makefile
|
|
|
|
tests/misc/Makefile
|
|
|
|
tests/mkdir/Makefile
|
|
|
|
tests/mv/Makefile
|
|
|
|
tests/od/Makefile
|
|
|
|
tests/pr/Makefile
|
2004-07-07 00:13:17 +08:00
|
|
|
tests/readlink/Makefile
|
2002-07-01 16:08:43 +08:00
|
|
|
tests/rm/Makefile
|
|
|
|
tests/rmdir/Makefile
|
|
|
|
tests/seq/Makefile
|
|
|
|
tests/sha1sum/Makefile
|
|
|
|
tests/shred/Makefile
|
|
|
|
tests/sort/Makefile
|
|
|
|
tests/stty/Makefile
|
|
|
|
tests/sum/Makefile
|
|
|
|
tests/tac/Makefile
|
|
|
|
tests/tail-2/Makefile
|
|
|
|
tests/tail/Makefile
|
2005-04-05 19:44:32 +08:00
|
|
|
tests/tee/Makefile
|
2002-07-01 16:08:43 +08:00
|
|
|
tests/test/Makefile
|
|
|
|
tests/touch/Makefile
|
|
|
|
tests/tr/Makefile
|
|
|
|
tests/tsort/Makefile
|
|
|
|
tests/unexpand/Makefile
|
|
|
|
tests/uniq/Makefile
|
|
|
|
tests/wc/Makefile
|
|
|
|
)
|
|
|
|
AC_OUTPUT
|