1 dnl Process this file with autoconf to produce a configure script. -*-m4-*-
2 AC_INIT(GNU coreutils, 0.1.0, bug-coreutils@gnu.org)
3 AC_CONFIG_SRCDIR(src/ls.c)
5 AC_CONFIG_AUX_DIR(config)
6 AM_CONFIG_HEADER(config.h:config.hin)
9 AM_INIT_AUTOMAKE([1.6b gnits dist-bzip2])
15 AC_PROG_GCC_TRADITIONAL
21 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS uname" MAN="$MAN uname.1")
22 AC_CHECK_FUNCS(chroot,
23 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS chroot" MAN="$MAN chroot.1")
24 AC_CHECK_FUNCS(gethostid,
25 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS hostid" MAN="$MAN hostid.1")
29 AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
32 # Check for SunOS statfs brokenness wrt partitions 2GB and larger.
33 # If <sys/vfs.h> exists and struct statfs has a member named f_spare,
34 # enable the work-around code in fsusage.c.
35 AC_MSG_CHECKING([for statfs that truncates block counts])
36 AC_CACHE_VAL(fu_cv_sys_truncating_statfs,
38 #if !defined(sun) && !defined(__sun)
39 choke -- this is a workaround for a Sun-specific problem
41 #include <sys/types.h>
42 #include <sys/vfs.h>],
43 [struct statfs t; long c = *(t.f_spare);],
44 fu_cv_sys_truncating_statfs=yes,
45 fu_cv_sys_truncating_statfs=no,
47 if test $fu_cv_sys_truncating_statfs = yes; then
48 AC_DEFINE(STATFS_TRUNCATES_BLOCK_COUNTS, 1,
49 [ Define if the block counts reported by statfs may be truncated to 2GB
50 and the correct values may be stored in the f_spare array.
51 (SunOS 4.1.2, 4.1.3, and 4.1.3_U1 are reported to have this problem.
52 SunOS 4.1.1 seems not to be affected.)])
54 AC_MSG_RESULT($fu_cv_sys_truncating_statfs)
56 AC_MSG_CHECKING(whether localtime caches TZ)
57 AC_CACHE_VAL(utils_cv_localtime_cache,
58 [if test x$ac_cv_func_tzset = xyes; then
59 AC_TRY_RUN([#include <time.h>
63 extern char **environ;
67 for (to = from = environ; (*to = *from); from++)
68 if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
73 time_t now = time ((time_t *) 0);
74 int hour_GMT0, hour_unset;
75 if (putenv ("TZ=GMT0") != 0)
77 hour_GMT0 = localtime (&now)->tm_hour;
79 hour_unset = localtime (&now)->tm_hour;
80 if (putenv ("TZ=PST8") != 0)
82 if (localtime (&now)->tm_hour == hour_GMT0)
85 if (localtime (&now)->tm_hour != hour_unset)
88 }], utils_cv_localtime_cache=no, utils_cv_localtime_cache=yes,
89 [# If we have tzset, assume the worst when cross-compiling.
90 utils_cv_localtime_cache=yes])
92 # If we lack tzset, report that localtime does not cache TZ,
93 # since we can't invalidate the cache if we don't have tzset.
94 utils_cv_localtime_cache=no
96 AC_MSG_RESULT($utils_cv_localtime_cache)
97 if test $utils_cv_localtime_cache = yes; then
98 AC_DEFINE(LOCALTIME_CACHE, 1, [FIXME])
101 # SCO-ODT-3.0 is reported to need -los to link programs using initgroups
102 AC_CHECK_FUNCS(initgroups)
103 if test $ac_cv_func_initgroups = no; then
104 AC_CHECK_LIB(os, initgroups)
107 AC_CHECK_FUNCS(syslog)
108 if test $ac_cv_func_syslog = no; then
109 # syslog is not in the default libraries. See if it's in some other.
110 for lib in bsd socket inet; do
111 AC_CHECK_LIB($lib, syslog, [AC_DEFINE(HAVE_SYSLOG, 1, [FIXME])
112 LIBS="$LIBS -l$lib"; break])
116 AC_MSG_CHECKING(for 3-argument setpriority function)
117 AC_CACHE_VAL(utils_cv_func_setpriority,
118 [AC_TRY_LINK([#include <sys/time.h>
119 #include <sys/resource.h>],
120 [setpriority(0, 0, 0);],
121 utils_cv_func_setpriority=yes, utils_cv_func_setpriority=no)])
122 AC_MSG_RESULT($utils_cv_func_setpriority)
123 if test $utils_cv_func_setpriority = yes; then
124 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS nice"
125 OPTIONAL_BIN_ZCRIPTS="$OPTIONAL_BIN_ZCRIPTS nohup"
126 MAN="$MAN nice.1 nohup.1"
128 AC_MSG_CHECKING(for nice function)
129 AC_CACHE_VAL(utils_cv_func_nice,
130 [AC_TRY_LINK([], nice();,
131 utils_cv_func_nice=yes, utils_cv_func_nice=no)])
132 AC_MSG_RESULT($utils_cv_func_nice)
133 if test $utils_cv_func_nice = yes; then
134 AC_DEFINE(NICE_PRIORITY, 1, [FIXME])
135 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS nice"
136 OPTIONAL_BIN_ZCRIPTS="$OPTIONAL_BIN_ZCRIPTS nohup"
137 MAN="$MAN nice.1 nohup.1"
143 AC_REQUIRE([jm_PREREQ_READUTMP])
144 if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
145 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS pinky users who"
146 MAN="$MAN pinky.1 users.1 who.1"
151 AC_MSG_CHECKING(ut_host in struct utmp)
152 AC_CACHE_VAL(su_cv_func_ut_host_in_utmp,
153 [AC_TRY_LINK([#include <sys/types.h>
154 #include <utmp.h>], [struct utmp ut; ut.ut_host;],
155 su_cv_func_ut_host_in_utmp=yes, su_cv_func_ut_host_in_utmp=no)])
156 AC_MSG_RESULT($su_cv_func_ut_host_in_utmp)
157 if test $su_cv_func_ut_host_in_utmp = yes; then
159 AC_DEFINE(HAVE_UT_HOST, 1, [FIXME])
162 if test -z "$have_ut_host"; then
163 AC_MSG_CHECKING(ut_host in struct utmpx)
164 AC_CACHE_VAL(su_cv_func_ut_host_in_utmpx,
165 [AC_TRY_LINK([#include <sys/types.h>
166 #include <utmpx.h>], [struct utmpx ut; ut.ut_host;],
167 su_cv_func_ut_host_in_utmpx=yes, su_cv_func_ut_host_in_utmpx=no)])
168 AC_MSG_RESULT($su_cv_func_ut_host_in_utmpx)
169 if test $su_cv_func_ut_host_in_utmpx = yes; then
170 AC_DEFINE(HAVE_UTMPX_H, 1, [FIXME])
171 AC_DEFINE(HAVE_UT_HOST, 1, [FIXME])
176 [OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS uptime" MAN="$MAN uptime.1"])
179 jm_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
181 if test $ac_cv_sys_posix_termios = yes; then
182 OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS stty" MAN="$MAN stty.1"
184 AC_MSG_CHECKING(whether termios.h needs _XOPEN_SOURCE)
185 AC_CACHE_VAL(su_cv_sys_termios_needs_xopen_source,
186 [AC_EGREP_CPP(yes, [#include <termios.h>
189 #endif], su_cv_sys_termios_needs_xopen_source=no,
190 AC_EGREP_CPP(yes, [#define _XOPEN_SOURCE
194 #endif], su_cv_sys_termios_needs_xopen_source=yes,
195 su_cv_sys_termios_needs_xopen_source=no))])
196 AC_MSG_RESULT($su_cv_sys_termios_needs_xopen_source)
197 test $su_cv_sys_termios_needs_xopen_source = yes &&
198 AC_DEFINE(TERMIOS_NEEDS_XOPEN_SOURCE, 1, [FIXME])
200 AC_MSG_CHECKING(c_line in struct termios)
201 AC_CACHE_VAL(su_cv_sys_c_line_in_termios,
202 [AC_TRY_LINK([#if TERMIOS_NEEDS_XOPEN_SOURCE
203 #define _XOPEN_SOURCE
205 #include <sys/types.h>
206 #include <termios.h>],
207 [struct termios t; t.c_line;],
208 su_cv_sys_c_line_in_termios=yes,
209 su_cv_sys_c_line_in_termios=no)])
210 AC_MSG_RESULT($su_cv_sys_c_line_in_termios)
211 test $su_cv_sys_c_line_in_termios = yes && AC_DEFINE(HAVE_C_LINE, 1, [FIXME])
214 # FIXME: note that this macro appears above, too.
215 # I'm leaving it here for now. This whole thing needs to be modernized...
218 jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H
220 if test $jm_cv_sys_tiocgwinsz_needs_termios_h = no && \
221 test $jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h = no; then
222 AC_MSG_CHECKING(TIOCGWINSZ in sys/pty.h)
223 AC_CACHE_VAL(su_cv_sys_tiocgwinsz_in_sys_pty_h,
224 [AC_TRY_LINK([#include <sys/types.h>
225 #ifdef WINSIZE_IN_PTEM
226 # include <sys/stream.h>
227 # include <sys/ptem.h>
229 #include <sys/ioctl.h>
231 #include <sys/pty.h>],
232 [int x = TIOCGWINSZ;],
233 su_cv_sys_tiocgwinsz_in_sys_pty_h=yes,
234 su_cv_sys_tiocgwinsz_in_sys_pty_h=no)])
235 AC_MSG_RESULT($su_cv_sys_tiocgwinsz_in_sys_pty_h)
237 test $su_cv_sys_tiocgwinsz_in_sys_pty_h = yes \
238 && AC_DEFINE(GWINSZ_IN_SYS_PTY, 1,
239 [Define if your system defines TIOCGWINSZ in sys/pty.h.])
243 AC_CHECK_DECLS([strsignal, strtoimax, sys_siglist, _sys_siglist])
247 AM_GNU_GETTEXT([external])
258 tests/basename/Makefile
266 tests/dircolors/Makefile
269 tests/factor/Makefile
272 tests/install/Makefile
277 tests/md5sum/Makefile
286 tests/sha1sum/Makefile
292 tests/tail-2/Makefile
298 tests/unexpand/Makefile
302 old/fileutils/Makefile
303 old/sh-utils/Makefile
304 old/textutils/Makefile