4
0

configure.ac 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. # Configure template for GNU tar.
  2. # Copyright (C) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
  3. # 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. # You should have received a copy of the GNU General Public License
  13. # along with this program; if not, write to the Free Software
  14. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  15. # 02110-1301, USA.
  16. AC_INIT([GNU tar], [1.15.2], [[email protected]])
  17. AC_CONFIG_SRCDIR([src/tar.c])
  18. AC_CONFIG_AUX_DIR([build-aux])
  19. AC_CONFIG_HEADERS([config.h:config.hin])
  20. AC_PREREQ([2.59])
  21. AM_INIT_AUTOMAKE([1.8 gnits dist-bzip2 dist-shar std-options])
  22. gl_USE_SYSTEM_EXTENSIONS
  23. AC_PROG_CC
  24. AC_EXEEXT
  25. AC_PROG_RANLIB
  26. AC_PROG_YACC
  27. AC_SYS_LARGEFILE
  28. AC_ISC_POSIX
  29. AC_C_INLINE
  30. AC_CHECK_HEADERS(fcntl.h linux/fd.h memory.h net/errno.h \
  31. sgtty.h string.h \
  32. sys/param.h sys/device.h sys/gentape.h \
  33. sys/inet.h sys/io/trioctl.h \
  34. sys/mtio.h sys/time.h sys/tprintf.h sys/tape.h \
  35. unistd.h locale.h)
  36. AC_CHECK_HEADERS([sys/buf.h], [], [],
  37. [#if HAVE_SYS_PARAM_H
  38. #include <sys/param.h>
  39. #endif])
  40. AC_HEADER_SYS_WAIT
  41. AM_STDBOOL_H
  42. AC_HEADER_DIRENT
  43. AC_HEADER_MAJOR
  44. AC_HEADER_STAT
  45. AC_HEADER_STDC
  46. AC_STRUCT_ST_BLKSIZE
  47. AC_STRUCT_ST_BLOCKS
  48. AC_MSG_CHECKING([for st_fstype string in struct stat])
  49. AC_CACHE_VAL(diff_cv_st_fstype_string,
  50. [AC_TRY_COMPILE([#include <sys/types.h>
  51. #include <sys/stat.h>], [struct stat s; s.st_fstype[0] = 'x';],
  52. diff_cv_st_fstype_string=yes,
  53. diff_cv_st_fstype_string=no)])
  54. AC_MSG_RESULT($diff_cv_st_fstype_string)
  55. if test $diff_cv_st_fstype_string = yes; then
  56. AC_DEFINE(HAVE_ST_FSTYPE_STRING, 1,
  57. [Define if struct stat has a char st_fstype[] member.])
  58. fi
  59. AC_TYPE_SIGNAL
  60. AC_TYPE_MODE_T
  61. AC_TYPE_PID_T
  62. AC_TYPE_OFF_T
  63. AC_TYPE_SIZE_T
  64. AC_TYPE_UID_T
  65. AC_CHECK_TYPE(major_t, , AC_DEFINE(major_t, int,
  66. [Type of major device numbers.]))
  67. AC_CHECK_TYPE(minor_t, , AC_DEFINE(minor_t, int,
  68. [Type of minor device numbers.]))
  69. AC_CHECK_TYPE(dev_t, unsigned)
  70. AC_CHECK_TYPE(ino_t, unsigned)
  71. gt_TYPE_SSIZE_T
  72. gl_AC_TYPE_INTMAX_T
  73. jm_AC_TYPE_UINTMAX_T
  74. # gnulib modules
  75. tar_GNULIB
  76. # paxutils modules
  77. tar_PAXUTILS
  78. AC_CHECK_MEMBERS([struct stat.st_spare1, struct stat.st_atim.tv_nsec, struct stat.st_atimespec.tv_nsec, struct stat.st_atimensec], , ,
  79. [
  80. #include <sys/types.h>
  81. #include <sys/stat.h>])
  82. # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all*
  83. # programs in the package would end up linked with that potentially-shared
  84. # library, inducing unnecessary run-time overhead.
  85. # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
  86. # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
  87. tar_save_LIBS=$LIBS
  88. LIB_CLOCK_GETTIME=
  89. AC_SEARCH_LIBS(clock_gettime, [rt posix4])
  90. case "$ac_cv_search_clock_gettime" in
  91. -l*) LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime;;
  92. esac
  93. AC_SUBST(LIB_CLOCK_GETTIME)
  94. AC_CHECK_FUNCS(clock_gettime)
  95. LIBS=$tar_save_LIBS
  96. AC_CHECK_FUNCS(fsync lstat mkfifo readlink strerror symlink setlocale utimes)
  97. AC_CHECK_DECLS([getgrgid],,, [#include <grp.h>])
  98. AC_CHECK_DECLS([getpwuid],,, [#include <pwd.h>])
  99. AC_CHECK_DECLS([time],,, [#include <time.h>])
  100. AC_REPLACE_FUNCS(waitpid)
  101. AC_CACHE_CHECK(for remote shell, tar_cv_path_RSH,
  102. [if test -n "$RSH"; then
  103. tar_cv_path_RSH=$RSH
  104. else
  105. tar_cv_path_RSH=no
  106. for ac_file in /usr/ucb/rsh /usr/bin/remsh /usr/bin/rsh /usr/bsd/rsh \
  107. /usr/bin/nsh /usr/bin/rcmd
  108. do
  109. # Prefer a non-symlink rsh to a symlink one, so that binaries built
  110. # on AIX 4.1.4, where /usr/ucb/rsh is a symlink to /usr/bin/rsh
  111. # will run on AIX 4.3.0, which has only /usr/bin/rsh.
  112. if test -f $ac_file; then
  113. if (test -h $ac_file) 2>/dev/null; then
  114. test $tar_cv_path_RSH = no && tar_cv_path_RSH=$ac_file
  115. else
  116. tar_cv_path_RSH=$ac_file
  117. break
  118. fi
  119. fi
  120. done
  121. fi])
  122. if test $tar_cv_path_RSH = no; then
  123. AC_CHECK_HEADERS(netdb.h)
  124. else
  125. AC_DEFINE_UNQUOTED(REMOTE_SHELL, "$tar_cv_path_RSH",
  126. [Define to the full path of your rsh, if any.])
  127. fi
  128. AC_MSG_CHECKING(for default archive format)
  129. AC_ARG_VAR([DEFAULT_ARCHIVE_FORMAT],
  130. [Set the default archive format. Allowed values are: V7, OLDGNU, USTAR, POSIX, GNU. Default is GNU])
  131. if test -z "$DEFAULT_ARCHIVE_FORMAT"; then
  132. DEFAULT_ARCHIVE_FORMAT="GNU"
  133. fi
  134. case $DEFAULT_ARCHIVE_FORMAT in
  135. V7|OLDGNU|USTAR|POSIX|GNU) ;;
  136. *) AC_MSG_ERROR(Invalid format name);;
  137. esac
  138. AC_DEFINE_UNQUOTED(DEFAULT_ARCHIVE_FORMAT, ${DEFAULT_ARCHIVE_FORMAT}_FORMAT,
  139. [By default produce archives of this format])
  140. AC_MSG_RESULT($DEFAULT_ARCHIVE_FORMAT)
  141. AC_MSG_CHECKING(for default archive)
  142. AC_ARG_VAR([DEFAULT_ARCHIVE],
  143. [Set the name of the default archive (default: -)])
  144. if test -z "$DEFAULT_ARCHIVE"; then
  145. DEFAULT_ARCHIVE=-
  146. else
  147. if test -z "`ls $DEFAULT_ARCHIVE 2>/dev/null`"; then
  148. AC_MSG_WARN(DEFAULT_ARCHIVE \`$DEFAULT_ARCHIVE' not found on this system)
  149. fi
  150. # FIXME: Look for DEFTAPE in <sys/mtio.h>.
  151. # FIXME: Let DEVICE_PREFIX be configured from the environment.
  152. # FIXME: Rearrange, here.
  153. case $DEFAULT_ARCHIVE in
  154. *[[0-7][lmh]])
  155. AC_DEFINE(DENSITY_LETTER, 1,
  156. [[Define to 1 if density may be indicated by [lmh] at end of device.]])
  157. device_prefix=`echo $DEFAULT_ARCHIVE | sed 's/[0-7][lmh]$//'`
  158. ;;
  159. *[[0-7]])
  160. device_prefix=`echo $DEFAULT_ARCHIVE | sed 's/[0-7]$//'`
  161. ;;
  162. *)
  163. device_prefix=
  164. ;;
  165. esac
  166. case "$device_prefix" in
  167. ?*)
  168. AC_DEFINE_UNQUOTED(DEVICE_PREFIX, "$device_prefix",
  169. [Define to a string giving the prefix of the default device, without the part specifying the unit and density.])
  170. ;;
  171. esac
  172. fi
  173. AC_DEFINE_UNQUOTED(DEFAULT_ARCHIVE, "$DEFAULT_ARCHIVE",
  174. [Define to a string giving the full name of the default archive file.])
  175. AC_MSG_RESULT($DEFAULT_ARCHIVE)
  176. AC_ARG_VAR([DEFAULT_BLOCKING],
  177. [Define default blocking factor (default: 20)])
  178. AC_MSG_CHECKING(for default blocking)
  179. DEFAULT_BLOCKING=${DEFAULT_BLOCKING-20}
  180. AC_DEFINE_UNQUOTED(DEFAULT_BLOCKING, $DEFAULT_BLOCKING,
  181. [Define to a number giving the default blocking size for archives.])
  182. AC_MSG_RESULT($DEFAULT_BLOCKING)
  183. # Iconv
  184. AM_ICONV
  185. AC_CHECK_HEADERS(iconv.h)
  186. AC_CHECK_TYPE(iconv_t,:,
  187. AC_DEFINE(iconv_t, int,
  188. [Conversion descriptor type]),
  189. [
  190. #ifdef HAVE_ICONV_H
  191. # include <iconv.h>
  192. #endif
  193. ])
  194. # Gettext.
  195. AM_GNU_GETTEXT([external], [need-ngettext])
  196. AM_GNU_GETTEXT_VERSION(0.12.1)
  197. # Initialize the test suite.
  198. AC_CONFIG_TESTDIR(tests)
  199. AC_CONFIG_FILES([tests/Makefile tests/atlocal]) # FIXME: tests/preset?
  200. AM_MISSING_PROG([AUTOM4TE], [autom4te])
  201. AC_SUBST(BACKUP_LIBEXEC_SCRIPTS)
  202. AC_SUBST(BACKUP_SBIN_SCRIPTS)
  203. AC_ARG_ENABLE(backup-scripts,
  204. AC_HELP_STRING([--enable-backup-scripts],
  205. [Create and install backup and restore scripts]),
  206. [case $enableval in
  207. yes) BACKUP_LIBEXEC_SCRIPTS='$(BACKUP_LIBEXEC_SCRIPTS_LIST)'
  208. BACKUP_SBIN_SCRIPTS='$(BACKUP_SBIN_SCRIPTS_LIST)'
  209. ;;
  210. esac])
  211. AC_SUBST(BACKUP_SED_COND)
  212. if date +%Y-%m-%d 2>/dev/null >&2; then
  213. BACKUP_SED_COND='/^\#ELSE_DATE_FORMAT_OK/,/^\#ENDIF_DATE_FORMAT_OK/d;/^\#IF_DATE_FORMAT_OK/d'
  214. else
  215. BACKUP_SED_COND='/^\#IF_DATE_FORMAT_OK/,/^\#ELSE_DATE_FORMAT_OK/d;/^\#ENDIF_DATE_FORMAT_OK/d'
  216. fi
  217. AC_OUTPUT([Makefile\
  218. doc/Makefile\
  219. lib/Makefile\
  220. po/Makefile.in\
  221. scripts/Makefile\
  222. rmt/Makefile\
  223. src/Makefile])