1 dnl Process this file with autoconf to produce a configure script. -*-m4-*-
2 AC_INIT([GNU coreutils],[5.2.1],[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_DEFAULT_POSIX2_VERSION
11 gl_USE_SYSTEM_EXTENSIONS
15 AC_PROG_GCC_TRADITIONAL
22 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS uname\$(EXEEXT)"
24 AC_CHECK_FUNCS(chroot,
25 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS chroot\$(EXEEXT)"
27 AC_CHECK_FUNCS(gethostid,
28 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS hostid\$(EXEEXT)"
33 AC_HEADER_TIOCGWINSZ()
36 AC_MSG_CHECKING(whether localtime caches TZ)
37 AC_CACHE_VAL(utils_cv_localtime_cache,
38 [if test x$ac_cv_func_tzset = xyes; then
39 AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <time.h>
43 extern char **environ;
47 for (to = from = environ; (*to = *from); from++)
48 if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
53 time_t now = time ((time_t *) 0);
54 int hour_GMT0, hour_unset;
55 if (putenv ("TZ=GMT0") != 0)
57 hour_GMT0 = localtime (&now)->tm_hour;
59 hour_unset = localtime (&now)->tm_hour;
60 if (putenv ("TZ=PST8") != 0)
62 if (localtime (&now)->tm_hour == hour_GMT0)
65 if (localtime (&now)->tm_hour != hour_unset)
69 [utils_cv_localtime_cache=no],
70 [utils_cv_localtime_cache=yes],
71 [# If we have tzset, assume the worst when cross-compiling.
72 utils_cv_localtime_cache=yes])
74 # If we lack tzset, report that localtime does not cache TZ,
75 # since we can't invalidate the cache if we don't have tzset.
76 utils_cv_localtime_cache=no
78 AC_MSG_RESULT($utils_cv_localtime_cache)
79 if test $utils_cv_localtime_cache = yes; then
80 AC_DEFINE(LOCALTIME_CACHE, 1, [FIXME])
83 # SCO-ODT-3.0 is reported to need -los to link programs using initgroups
84 AC_CHECK_FUNCS(initgroups)
85 if test $ac_cv_func_initgroups = no; then
86 AC_CHECK_LIB(os, initgroups)
89 AC_CHECK_FUNCS(syslog)
90 if test $ac_cv_func_syslog = no; then
91 # syslog is not in the default libraries. See if it's in some other.
92 for lib in bsd socket inet; do
93 AC_CHECK_LIB($lib, syslog, [AC_DEFINE(HAVE_SYSLOG, 1, [FIXME])
94 LIBS="$LIBS -l$lib"; break])
98 AC_MSG_CHECKING(for 3-argument setpriority function)
99 AC_CACHE_VAL(utils_cv_func_setpriority,
100 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/time.h>
101 #include <sys/resource.h>]], [[setpriority(0, 0, 0);]])],
102 [utils_cv_func_setpriority=yes],
103 [utils_cv_func_setpriority=no])])
104 AC_MSG_RESULT($utils_cv_func_setpriority)
105 if test $utils_cv_func_setpriority = yes; then
106 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS nice\$(EXEEXT)"
109 AC_MSG_CHECKING(for nice function)
110 AC_CACHE_VAL(utils_cv_func_nice,
111 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[nice();]])],
112 [utils_cv_func_nice=yes],
113 [utils_cv_func_nice=no])])
114 AC_MSG_RESULT($utils_cv_func_nice)
115 if test $utils_cv_func_nice = yes; then
116 AC_DEFINE(NICE_PRIORITY, 1, [FIXME])
117 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS nice\$(EXEEXT)"
122 AC_DEFUN([jm_DUMMY_1],
124 AC_REQUIRE([gl_READUTMP])
125 if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
126 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS pinky\$(EXEEXT)"
127 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS users\$(EXEEXT)"
128 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS who\$(EXEEXT)"
129 MAN="$MAN pinky.1 users.1 who.1"
134 AC_MSG_CHECKING(ut_host in struct utmp)
135 AC_CACHE_VAL(su_cv_func_ut_host_in_utmp,
136 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
137 #include <utmp.h>]], [[struct utmp ut; ut.ut_host;]])],
138 [su_cv_func_ut_host_in_utmp=yes],
139 [su_cv_func_ut_host_in_utmp=no])])
140 AC_MSG_RESULT($su_cv_func_ut_host_in_utmp)
141 if test $su_cv_func_ut_host_in_utmp = yes; then
143 AC_DEFINE(HAVE_UT_HOST, 1, [FIXME])
146 if test -z "$have_ut_host"; then
147 AC_MSG_CHECKING(ut_host in struct utmpx)
148 AC_CACHE_VAL(su_cv_func_ut_host_in_utmpx,
149 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
150 #include <utmpx.h>]], [[struct utmpx ut; ut.ut_host;]])],
151 [su_cv_func_ut_host_in_utmpx=yes],
152 [su_cv_func_ut_host_in_utmpx=no])])
153 AC_MSG_RESULT($su_cv_func_ut_host_in_utmpx)
154 if test $su_cv_func_ut_host_in_utmpx = yes; then
155 AC_DEFINE(HAVE_UTMPX_H, 1, [FIXME])
156 AC_DEFINE(HAVE_UT_HOST, 1, [FIXME])
161 [OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS uptime\$(EXEEXT)"
162 MAN="$MAN uptime.1"])
164 AC_SYS_POSIX_TERMIOS()
165 jm_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
167 if test $ac_cv_sys_posix_termios = yes; then
168 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS stty\$(EXEEXT)" MAN="$MAN stty.1"
170 AC_MSG_CHECKING(whether termios.h needs _XOPEN_SOURCE)
171 AC_CACHE_VAL(su_cv_sys_termios_needs_xopen_source,
172 [AC_EGREP_CPP(yes, [#include <termios.h>
175 #endif], su_cv_sys_termios_needs_xopen_source=no,
176 AC_EGREP_CPP(yes, [#define _XOPEN_SOURCE
180 #endif], su_cv_sys_termios_needs_xopen_source=yes,
181 su_cv_sys_termios_needs_xopen_source=no))])
182 AC_MSG_RESULT($su_cv_sys_termios_needs_xopen_source)
183 test $su_cv_sys_termios_needs_xopen_source = yes &&
184 AC_DEFINE(TERMIOS_NEEDS_XOPEN_SOURCE, 1, [FIXME])
186 AC_MSG_CHECKING(c_line in struct termios)
187 AC_CACHE_VAL(su_cv_sys_c_line_in_termios,
188 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if TERMIOS_NEEDS_XOPEN_SOURCE
189 #define _XOPEN_SOURCE
191 #include <sys/types.h>
192 #include <termios.h>]], [[struct termios t; t.c_line;]])],
193 [su_cv_sys_c_line_in_termios=yes],
194 [su_cv_sys_c_line_in_termios=no])])
195 AC_MSG_RESULT($su_cv_sys_c_line_in_termios)
196 test $su_cv_sys_c_line_in_termios = yes \
197 && AC_DEFINE(HAVE_C_LINE, 1, [FIXME])
200 # FIXME: note that this macro appears above, too.
201 # I'm leaving it here for now. This whole thing needs to be modernized...
204 jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H
206 if test $jm_cv_sys_tiocgwinsz_needs_termios_h = no && \
207 test $jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h = no; then
208 AC_MSG_CHECKING(TIOCGWINSZ in sys/pty.h)
209 AC_CACHE_VAL(su_cv_sys_tiocgwinsz_in_sys_pty_h,
210 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
211 #ifdef WINSIZE_IN_PTEM
212 # include <sys/stream.h>
213 # include <sys/ptem.h>
215 #include <sys/ioctl.h>
217 #include <sys/pty.h>]], [[int x = TIOCGWINSZ;]])],
218 [su_cv_sys_tiocgwinsz_in_sys_pty_h=yes],
219 [su_cv_sys_tiocgwinsz_in_sys_pty_h=no])])
220 AC_MSG_RESULT($su_cv_sys_tiocgwinsz_in_sys_pty_h)
222 test $su_cv_sys_tiocgwinsz_in_sys_pty_h = yes \
223 && AC_DEFINE(GWINSZ_IN_SYS_PTY, 1,
224 [Define if your system defines TIOCGWINSZ in sys/pty.h.])
228 AC_CHECK_DECLS([strsignal, strtoimax, sys_siglist, _sys_siglist, __sys_siglist])
232 AM_GNU_GETTEXT([external], [need-ngettext])
233 AM_GNU_GETTEXT_VERSION(0.13.1)
244 tests/basename/Makefile
252 tests/dircolors/Makefile
255 tests/factor/Makefile
258 tests/install/Makefile
263 tests/md5sum/Makefile
272 tests/sha1sum/Makefile
278 tests/tail-2/Makefile
284 tests/unexpand/Makefile