1 # Configure template for GNU tar.
2 # Copyright (C) 1991, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
3 # Process this file with autoconf to produce a configure script.
6 AM_CONFIG_HEADER(config.h)
8 AM_INIT_AUTOMAKE(tar, 1.12)
10 ALL_LINGUAS="de fr it ko nl no pl pt sl sv"
13 test $fp_cv_prog_echo_nonl = no \
14 && echo 2>&1 "WARNING: \`echo' not powerful enough for \`make check'"
16 AC_PROG_GCC_TRADITIONAL
26 AC_CHECK_SIZEOF(unsigned long, 4)
27 AC_CHECK_SIZEOF(long long, 0)
29 AC_CHECK_HEADERS(fcntl.h limits.h linux/fd.h memory.h net/errno.h poll.h \
30 sgtty.h string.h stropts.h \
31 sys/buf.h sys/device.h sys/gentape.h sys/inet.h sys/io/trioctl.h sys/ioccom.h \
32 sys/mtio.h sys/param.h sys/tprintf.h sys/tape.h sys/time.h sys/timeb.h \
35 # It seems that that many machines where <utime.h> seems to be
36 # broken just require something like -D_XXX_SOURCE, where XXX might
37 # be POSIX, POSIX_C, ALL, HPUX or whatever, depending on the machine.
39 AC_CACHE_CHECK(for utime.h, tar_cv_header_utime_h,
41 #include <sys/types.h>
42 #include <utime.h>], [struct utimbuf foo],
43 tar_cv_header_utime_h=yes, tar_cv_header_utime_h=no)])
44 test $tar_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H)
46 if test $ac_cv_header_sys_mtio_h = yes; then
47 AC_CACHE_CHECK(for remote tape header files, tar_cv_header_rmt,
52 #include <sys/socket.h>],
53 tar_cv_header_rmt=yes, tar_cv_header_rmt=no)])
54 test $tar_cv_header_rmt = yes && RMT=rmt
58 AC_CACHE_CHECK(for getgrgid declaration, tar_cv_header_getgrgid,
59 [AC_EGREP_HEADER(getgrgid, grp.h,
60 tar_cv_header_getgrgid=yes, tar_cv_header_getgrgid=no)])
61 test $tar_cv_header_getgrgid = yes && AC_DEFINE(HAVE_GETGRGID)
63 AC_CACHE_CHECK(for getpwuid declaration, tar_cv_header_getpwuid,
64 [AC_EGREP_HEADER(getpwuid, pwd.h,
65 tar_cv_header_getpwuid=yes, tar_cv_header_getpwuid=no)])
66 test $tar_cv_header_getpwuid = yes && AC_DEFINE(HAVE_GETPWUID)
68 AC_CACHE_CHECK(which ioctl field to test for reversed bytes,
69 tar_cv_header_mtio_check_field,
70 [AC_EGREP_HEADER(mt_model, sys/mtio.h,
71 tar_cv_header_mtio_check_field=mt_model,
72 tar_cv_header_mtio_check_field=mt_type)])
73 AC_DEFINE_UNQUOTED(MTIO_CHECK_FIELD, $tar_cv_header_mtio_check_field)
86 AC_CHECK_FUNCS(fsync ftime getcwd isascii lchown mkfifo nap napms poll \
87 select strerror strstr usleep)
89 AC_CACHE_CHECK(for mknod, tar_cv_func_mknod,
91 #include <sys/types.h>
92 #include <sys/stat.h>],
94 tar_cv_func_mknod=yes, tar_cv_func_mknod=no)])
95 test $tar_cv_func_mknod = yes && AC_DEFINE(HAVE_MKNOD)
97 # Whenever both -lsocket and -lnsl are needed, it seems to be always the
98 # case that gethostbyname requires -lnsl. So, check -lnsl first, for it
99 # to be in LIBS before the setsockopt checks are performed. *However*,
100 # on SINIX-N 5.43, this is false, and gethostent seems to be a better
101 # candidate. So, let's use it below instead of gethostbyname, and see.
103 AC_CHECK_FUNC(gethostent)
104 if test $ac_cv_func_gethostent = no; then
105 AC_CHECK_LIB(nsl, gethostent)
107 AC_CHECK_FUNC(setsockopt)
108 if test $ac_cv_func_setsockopt = no; then
109 AC_CHECK_LIB(socket, setsockopt)
114 test $ac_cv_func_fnmatch_works = yes || LIBOBJS="$LIBOBJS fnmatch.o"
116 AC_REPLACE_FUNCS(basename dirname execlp ftruncate memset mkdir rename rmdir)
117 test "$ac_cv_func_strstr" = yes || LIBOBJS="$LIBOBJS strstr.o"
119 # The 3-argument open happens to go along with the O_* defines, which
120 # are easier to check for.
122 AC_CACHE_CHECK(for 3-argument open, tar_cv_func_open3,
127 # include <sys/file.h>
130 tar_cv_func_open3=yes, tar_cv_func_open3=no)])
131 if test $tar_cv_func_open3 = no; then
132 AC_DEFINE(EMUL_OPEN3)
135 # `union wait' is preferrably avoided. We merely assume below
136 # that if `int pid;' fails, `union wait pid;' would have worked.
137 # Directly trying `union wait pid;' is seeking for trouble, as
138 # some POSIX systems are offering compatibility hacks generating
139 # ugly diagnostics. Also, on some systems, WEXITSTATUS exists,
140 # but fails when called on `union wait' variables.
142 AC_CACHE_CHECK(for union wait, tar_cv_header_union_wait,
144 #include <sys/types.h>
146 # include <sys/wait.h>
148 [int status; int pid; pid = wait (&status);],
149 tar_cv_header_union_wait=no, tar_cv_header_union_wait=yes)])
150 test $tar_cv_header_union_wait = yes && AC_DEFINE(HAVE_UNION_WAIT)
152 AC_CACHE_CHECK(for remote shell, tar_cv_path_RSH,
153 [if test -n "$RSH"; then
157 for ac_file in /usr/ucb/rsh /usr/bin/remsh /usr/bin/rsh /usr/bsd/rsh \
158 /usr/bin/nsh /usr/bin/rcmd
160 if test -f $ac_file; then
161 tar_cv_path_RSH=$ac_file
166 if test $tar_cv_path_RSH = no; then
167 AC_CHECK_HEADERS(netdb.h)
169 AC_DEFINE_UNQUOTED(REMOTE_SHELL, "$tar_cv_path_RSH")
172 AC_MSG_CHECKING(for default archive)
174 if test -z "$DEFAULT_ARCHIVE"; then
177 if test -z "`ls $DEFAULT_ARCHIVE 2>/dev/null`"; then
178 AC_MSG_WARN(DEFAULT_ARCHIVE \`$DEFAULT_ARCHIVE' not found on this system)
180 # FIXME: Look for DEFTAPE in <sys/mtio.h>.
181 # FIXME: Let DEVICE_PREFIX be configured from the environment.
182 # FIXME: Rearrange, here.
183 case $DEFAULT_ARCHIVE in
186 device_prefix=`echo $DEFAULT_ARCHIVE | sed 's/[0-7][lmh]$//'`
188 AC_DEFINE_UNQUOTED(DEVICE_PREFIX, "$device_prefix")
189 AC_DEFINE(DENSITY_LETTER)
193 device_prefix=`echo $DEFAULT_ARCHIVE | sed 's/[0-7]$//'`
195 AC_DEFINE_UNQUOTED(DEVICE_PREFIX, "$device_prefix")
199 AC_DEFINE_UNQUOTED(DEFAULT_ARCHIVE, "$DEFAULT_ARCHIVE")
200 AC_MSG_RESULT($DEFAULT_ARCHIVE)
202 AC_MSG_CHECKING(for default blocking)
203 DEFAULT_BLOCKING=${DEFAULT_BLOCKING-20}
204 AC_DEFINE_UNQUOTED(DEFAULT_BLOCKING, $DEFAULT_BLOCKING)
205 AC_MSG_RESULT($DEFAULT_BLOCKING)
207 fp_WITH_INCLUDED_MALLOC
211 AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
213 AC_OUTPUT([Makefile doc/Makefile intl/Makefile lib/Makefile po/Makefile.in \
214 scripts/Makefile src/Makefile tests/Makefile tests/preset],
215 [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])