1 dnl Process this file with autoconf to produce a configure script. -*-m4-*-
2 AC_INIT([GNU coreutils],[5.1.0],[bug-coreutils@gnu.org])
3 AC_CONFIG_SRCDIR(src/ls.c)
5 AC_CONFIG_AUX_DIR(config)
6 AC_CONFIG_HEADERS([config.h:config.hin])
8 AM_INIT_AUTOMAKE([1.8 gnits dist-bzip2])
10 gl_USE_SYSTEM_EXTENSIONS
14 AC_PROG_GCC_TRADITIONAL
20 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS uname\$(EXEEXT)"
22 AC_CHECK_FUNCS(chroot,
23 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS chroot\$(EXEEXT)"
25 AC_CHECK_FUNCS(gethostid,
26 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS hostid\$(EXEEXT)"
31 AC_HEADER_TIOCGWINSZ()
34 AC_MSG_CHECKING(whether localtime caches TZ)
35 AC_CACHE_VAL(utils_cv_localtime_cache,
36 [if test x$ac_cv_func_tzset = xyes; then
37 AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <time.h>
41 extern char **environ;
45 for (to = from = environ; (*to = *from); from++)
46 if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
51 time_t now = time ((time_t *) 0);
52 int hour_GMT0, hour_unset;
53 if (putenv ("TZ=GMT0") != 0)
55 hour_GMT0 = localtime (&now)->tm_hour;
57 hour_unset = localtime (&now)->tm_hour;
58 if (putenv ("TZ=PST8") != 0)
60 if (localtime (&now)->tm_hour == hour_GMT0)
63 if (localtime (&now)->tm_hour != hour_unset)
67 [utils_cv_localtime_cache=no],
68 [utils_cv_localtime_cache=yes],
69 [# If we have tzset, assume the worst when cross-compiling.
70 utils_cv_localtime_cache=yes])
72 # If we lack tzset, report that localtime does not cache TZ,
73 # since we can't invalidate the cache if we don't have tzset.
74 utils_cv_localtime_cache=no
76 AC_MSG_RESULT($utils_cv_localtime_cache)
77 if test $utils_cv_localtime_cache = yes; then
78 AC_DEFINE(LOCALTIME_CACHE, 1, [FIXME])
81 # SCO-ODT-3.0 is reported to need -los to link programs using initgroups
82 AC_CHECK_FUNCS(initgroups)
83 if test $ac_cv_func_initgroups = no; then
84 AC_CHECK_LIB(os, initgroups)
87 AC_CHECK_FUNCS(syslog)
88 if test $ac_cv_func_syslog = no; then
89 # syslog is not in the default libraries. See if it's in some other.
90 for lib in bsd socket inet; do
91 AC_CHECK_LIB($lib, syslog, [AC_DEFINE(HAVE_SYSLOG, 1, [FIXME])
92 LIBS="$LIBS -l$lib"; break])
96 AC_MSG_CHECKING(for 3-argument setpriority function)
97 AC_CACHE_VAL(utils_cv_func_setpriority,
98 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/time.h>
99 #include <sys/resource.h>]], [[setpriority(0, 0, 0);]])],
100 [utils_cv_func_setpriority=yes],
101 [utils_cv_func_setpriority=no])])
102 AC_MSG_RESULT($utils_cv_func_setpriority)
103 if test $utils_cv_func_setpriority = yes; then
104 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS nice\$(EXEEXT)"
107 AC_MSG_CHECKING(for nice function)
108 AC_CACHE_VAL(utils_cv_func_nice,
109 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[nice();]])],
110 [utils_cv_func_nice=yes],
111 [utils_cv_func_nice=no])])
112 AC_MSG_RESULT($utils_cv_func_nice)
113 if test $utils_cv_func_nice = yes; then
114 AC_DEFINE(NICE_PRIORITY, 1, [FIXME])
115 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS nice\$(EXEEXT)"
122 AC_REQUIRE([gl_READUTMP])
123 if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
124 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS pinky\$(EXEEXT)"
125 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS users\$(EXEEXT)"
126 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS who\$(EXEEXT)"
127 MAN="$MAN pinky.1 users.1 who.1"
132 AC_MSG_CHECKING(ut_host in struct utmp)
133 AC_CACHE_VAL(su_cv_func_ut_host_in_utmp,
134 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
135 #include <utmp.h>]], [[struct utmp ut; ut.ut_host;]])],
136 [su_cv_func_ut_host_in_utmp=yes],
137 [su_cv_func_ut_host_in_utmp=no])])
138 AC_MSG_RESULT($su_cv_func_ut_host_in_utmp)
139 if test $su_cv_func_ut_host_in_utmp = yes; then
141 AC_DEFINE(HAVE_UT_HOST, 1, [FIXME])
144 if test -z "$have_ut_host"; then
145 AC_MSG_CHECKING(ut_host in struct utmpx)
146 AC_CACHE_VAL(su_cv_func_ut_host_in_utmpx,
147 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
148 #include <utmpx.h>]], [[struct utmpx ut; ut.ut_host;]])],
149 [su_cv_func_ut_host_in_utmpx=yes],
150 [su_cv_func_ut_host_in_utmpx=no])])
151 AC_MSG_RESULT($su_cv_func_ut_host_in_utmpx)
152 if test $su_cv_func_ut_host_in_utmpx = yes; then
153 AC_DEFINE(HAVE_UTMPX_H, 1, [FIXME])
154 AC_DEFINE(HAVE_UT_HOST, 1, [FIXME])
159 [OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS uptime\$(EXEEXT)"
160 MAN="$MAN uptime.1"])
162 AC_SYS_POSIX_TERMIOS()
163 jm_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
165 if test $ac_cv_sys_posix_termios = yes; then
166 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS stty\$(EXEEXT)" MAN="$MAN stty.1"
168 AC_MSG_CHECKING(whether termios.h needs _XOPEN_SOURCE)
169 AC_CACHE_VAL(su_cv_sys_termios_needs_xopen_source,
170 [AC_EGREP_CPP(yes, [#include <termios.h>
173 #endif], su_cv_sys_termios_needs_xopen_source=no,
174 AC_EGREP_CPP(yes, [#define _XOPEN_SOURCE
178 #endif], su_cv_sys_termios_needs_xopen_source=yes,
179 su_cv_sys_termios_needs_xopen_source=no))])
180 AC_MSG_RESULT($su_cv_sys_termios_needs_xopen_source)
181 test $su_cv_sys_termios_needs_xopen_source = yes &&
182 AC_DEFINE(TERMIOS_NEEDS_XOPEN_SOURCE, 1, [FIXME])
184 AC_MSG_CHECKING(c_line in struct termios)
185 AC_CACHE_VAL(su_cv_sys_c_line_in_termios,
186 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if TERMIOS_NEEDS_XOPEN_SOURCE
187 #define _XOPEN_SOURCE
189 #include <sys/types.h>
190 #include <termios.h>]], [[struct termios t; t.c_line;]])],
191 [su_cv_sys_c_line_in_termios=yes],
192 [su_cv_sys_c_line_in_termios=no])])
193 AC_MSG_RESULT($su_cv_sys_c_line_in_termios)
194 test $su_cv_sys_c_line_in_termios = yes \
195 && AC_DEFINE(HAVE_C_LINE, 1, [FIXME])
198 # FIXME: note that this macro appears above, too.
199 # I'm leaving it here for now. This whole thing needs to be modernized...
202 jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H
204 if test $jm_cv_sys_tiocgwinsz_needs_termios_h = no && \
205 test $jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h = no; then
206 AC_MSG_CHECKING(TIOCGWINSZ in sys/pty.h)
207 AC_CACHE_VAL(su_cv_sys_tiocgwinsz_in_sys_pty_h,
208 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
209 #ifdef WINSIZE_IN_PTEM
210 # include <sys/stream.h>
211 # include <sys/ptem.h>
213 #include <sys/ioctl.h>
215 #include <sys/pty.h>]], [[int x = TIOCGWINSZ;]])],
216 [su_cv_sys_tiocgwinsz_in_sys_pty_h=yes],
217 [su_cv_sys_tiocgwinsz_in_sys_pty_h=no])])
218 AC_MSG_RESULT($su_cv_sys_tiocgwinsz_in_sys_pty_h)
220 test $su_cv_sys_tiocgwinsz_in_sys_pty_h = yes \
221 && AC_DEFINE(GWINSZ_IN_SYS_PTY, 1,
222 [Define if your system defines TIOCGWINSZ in sys/pty.h.])
226 AC_CHECK_DECLS([strsignal, strtoimax, sys_siglist, _sys_siglist, __sys_siglist])
230 AM_GNU_GETTEXT([external], [need-ngettext])
231 AM_GNU_GETTEXT_VERSION(0.11.5)
242 tests/basename/Makefile
250 tests/dircolors/Makefile
253 tests/factor/Makefile
256 tests/install/Makefile
261 tests/md5sum/Makefile
270 tests/sha1sum/Makefile
276 tests/tail-2/Makefile
282 tests/unexpand/Makefile