home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / tar-1.11.8-src.tgz / tar.out / fsf / tar / configure.in < prev    next >
Text File  |  1996-09-28  |  6KB  |  221 lines

  1. # Configure template for GNU tar.
  2. # Copyright (C) 1991, 1994, 1995 Free Software Foundation, Inc.
  3. # Process this file with autoconf to produce a configure script.
  4.  
  5. AC_INIT(src/tar.c)
  6. AC_CONFIG_HEADER(config.h)
  7. AC_CANONICAL_SYSTEM
  8. AC_ARG_PROGRAM
  9.  
  10. PACKAGE=tar
  11. VERSION=1.11.8
  12. LINGUAS="de fr pt sv"
  13. PROGRAMS=tar
  14. AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
  15. AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
  16. AC_SUBST(PACKAGE)
  17. AC_SUBST(VERSION)
  18. AC_SUBST(PROGRAMS)
  19.  
  20. AC_PROG_GCC_TRADITIONAL
  21. AC_PROG_INSTALL
  22. AC_PROG_MAKE_SET
  23. AC_PROG_RANLIB
  24. AC_PROG_YACC
  25.  
  26. AC_AIX
  27. AC_ISC_POSIX
  28. AC_MINIX
  29. fp_C_PROTOTYPES
  30. AC_C_CONST
  31.  
  32. AC_CHECK_HEADERS(fcntl.h limits.h memory.h string.h \
  33. sys/gentape.h sys/io/trioctl.h sys/ioccom.h sys/mtio.h sys/param.h \
  34. sys/tape.h sys/time.h sys/timeb.h sys/wait.h unistd.h)
  35.  
  36. AC_MSG_CHECKING(for utime.h)
  37. AC_TRY_COMPILE([#include <sys/types.h>
  38. #include <utime.h>], [struct utimbuf foo],
  39.   [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_UTIME_H)], [AC_MSG_RESULT(no)])
  40.  
  41. if test "$ac_cv_header_sys_mtio_h" = yes; then
  42.   AC_MSG_CHECKING(for remote tape header files)
  43.   AC_CACHE_VAL(ac_cv_header_rmt,
  44.     [AC_TRY_CPP([#include <sgtty.h>
  45. #include <sys/socket.h>],
  46.     ac_cv_header_rmt=yes, ac_cv_header_rmt=no)])
  47.   AC_MSG_RESULT($ac_cv_header_rmt)
  48.   test $ac_cv_header_rmt = yes && PROGRAMS="$PROGRAMS rmt"
  49. fi
  50.  
  51. AC_MSG_CHECKING(for getgrgid declaration)
  52. AC_EGREP_HEADER(getgrgid, grp.h,
  53.   [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_GETGRGID)], [AC_MSG_RESULT(no)])
  54.  
  55. AC_MSG_CHECKING(for getpwuid declaration)
  56. AC_EGREP_HEADER(getpwuid, pwd.h,
  57.   [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_GETPWUID)], [AC_MSG_RESULT(no)])
  58.  
  59. AC_MSG_CHECKING(which field to test for reversed bytes in remote ioctl)
  60. AC_EGREP_HEADER(mt_model, sys/mtio.h, field=mt_model, field=mt_type)
  61. AC_MSG_RESULT($field)
  62. AC_DEFINE_UNQUOTED(MTIO_CHECK_FIELD, $field)
  63.  
  64. AC_HEADER_DIRENT
  65. AC_HEADER_MAJOR
  66. AC_HEADER_STAT
  67. AC_HEADER_STDC
  68. AC_HEADER_TIME
  69. AC_STRUCT_ST_BLKSIZE
  70. AC_STRUCT_ST_BLOCKS
  71. AC_TYPE_SIGNAL
  72. AC_TYPE_SIZE_T
  73. AC_TYPE_UID_T
  74.  
  75. AC_CHECK_FUNCS(ftime getcwd isascii mkfifo strstr rexec vfork)
  76. AC_MSG_CHECKING(for mknod)
  77. AC_CACHE_VAL(ac_cv_func_mknod,
  78.          AC_TRY_LINK([#include <sys/stat.h>], [mknod (0, 0, 0)],
  79.              ac_cv_func_mknod=yes, ac_cv_func_mknod=no))
  80. AC_MSG_RESULT($ac_cv_func_mknod)
  81. test $ac_cv_func_mknod = yes && AC_DEFINE(HAVE_MKNOD)
  82.  
  83. #
  84. # If -lnsl has gethostname() defined, and/or if -lsocket has an
  85. # undefined reference to gethostname(), then we need both -lsocket
  86. # and -lnsl.  Ideally, -lsocket and -lnsl should be tested both
  87. # at once, we rather test -lsocket after -lnsl.  Other ideas for
  88. # -lsocket: socket or ntohl.  For -lnsl: t_open or dial.
  89. #
  90. AC_CHECK_LIB(inet, gettimeofday, [LIBS="$LIBS -linet"])
  91. AC_CHECK_LIB(nsl, gethostname, [LIBS="$LIBS -lnsl"])
  92. AC_CHECK_LIB(socket, setsockopt, [LIBS="$LIBS -lsocket"])
  93. #
  94. AC_FUNC_ALLOCA
  95. AC_FUNC_VPRINTF
  96. AC_REPLACE_FUNCS(fnmatch ftruncate memset mkdir rename rmdir)
  97. test "$ac_cv_func_strstr" = yes || LIBOBJS="$LIBOBJS strstr.o"
  98.  
  99. AC_MSG_CHECKING(for HP-UX needing gmalloc)
  100. if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
  101.   AC_MSG_RESULT(yes)
  102.   LIBOBJS="$LIBOBJS gmalloc.o"
  103.   AC_DEFINE(HAVE_VALLOC)
  104. else
  105.   AC_MSG_RESULT(no)
  106.   AC_CHECK_FUNCS(valloc)
  107. fi
  108.  
  109. # The 3-argument open happens to go along with the O_* defines, which
  110. # are easier to check for. 
  111. AC_MSG_CHECKING(for 3-argument open)
  112. AC_TRY_COMPILE([#ifdef HAVE_FCNTL_H
  113. #include <fcntl.h>
  114. #else
  115. #include <sys/file.h>
  116. #endif], [int x = O_RDONLY],
  117.   [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); AC_DEFINE(EMUL_OPEN3)])
  118.  
  119. AC_MSG_CHECKING(for union wait)
  120. AC_TRY_COMPILE([#include <sys/types.h>
  121. #include <sys/wait.h>], [union wait status; int pid; pid = wait (&status);
  122. #ifdef WEXITSTATUS
  123. /* Some POSIXoid systems have both the new-style macros and the old
  124.    union wait type, and they do not work together.  If union wait
  125.    conflicts with WEXITSTATUS et al, we don't want to use it at all.  */
  126. if (WEXITSTATUS (status) != 0) pid = -1;
  127. #endif],
  128.   [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_UNION_WAIT)], [AC_MSG_RESULT(no)])
  129.  
  130. AC_MSG_CHECKING(for remote shell)
  131. AC_CACHE_VAL(ac_cv_path_RSH,
  132. [if test -n "$RSH"; then
  133.   ac_cv_path_RSH=$RSH
  134. else
  135.   ac_cv_path_RSH=no
  136.   for ac_file in \
  137.     /ade/ucb/rsh /ade/bin/remsh /ade/bin/rsh /ade/bsd/rsh /ade/bin/nsh
  138.   do
  139.     if test -f $ac_file; then
  140.       ac_cv_path_RSH=$ac_file
  141.       break
  142.     fi
  143.   done
  144. fi])
  145. AC_MSG_RESULT($ac_cv_path_RSH)
  146. if test $ac_cv_path_RSH = no; then
  147.   AC_CHECK_HEADERS(netdb.h)
  148. else
  149.   AC_DEFINE_UNQUOTED(REMOTE_SHELL, "$ac_cv_path_RSH")
  150. fi
  151.  
  152. AC_MSG_CHECKING(for default archive)
  153.  
  154. if test -z "$DEFAULT_ARCHIVE"; then
  155.   DEFAULT_ARCHIVE=-
  156. else
  157.   if test -z "`ls $DEFAULT_ARCHIVE 2>/dev/null`"; then
  158.     AC_MSG_WARN(DEFAULT_ARCHIVE \`$DEFAULT_ARCHIVE' not found on this system)
  159.   fi
  160.   # Look for DEFTAPE in <sys/mtio.h>.  Rearrange, here.  FIXME.
  161.   case $DEFAULT_ARCHIVE in
  162. changequote(, )dnl
  163.     *[0-7][lmh])
  164.       device_prefix=`echo $DEFAULT_ARCHIVE | sed 's/[0-7][lmh]$//'`
  165. changequote([, ])dnl
  166.       AC_DEFINE_UNQUOTED(DEVICE_PREFIX, "$device_prefix")
  167.       AC_DEFINE(DENSITY_LETTER)
  168.       ;;
  169. changequote(, )dnl
  170.     *[0-7])
  171.       device_prefix=`echo $DEFAULT_ARCHIVE | sed 's/[0-7]$//'`
  172. changequote([, ])dnl
  173.       AC_DEFINE_UNQUOTED(DEVICE_PREFIX, "$device_prefix")
  174.       ;;
  175.   esac
  176. fi
  177. AC_DEFINE_UNQUOTED(DEFAULT_ARCHIVE, "$DEFAULT_ARCHIVE")
  178. AC_MSG_RESULT($DEFAULT_ARCHIVE)
  179.  
  180. AC_MSG_CHECKING(for default blocking)
  181. DEFAULT_BLOCKING=${DEFAULT_BLOCKING-20}
  182. AC_DEFINE_UNQUOTED(DEFAULT_BLOCKING, $DEFAULT_BLOCKING)
  183. AC_MSG_RESULT($DEFAULT_BLOCKING)
  184.  
  185. fp_WITH_DMALLOC
  186. fp_WITH_REGEX
  187.  
  188. # ----------------------
  189. # Beginning of NLS block.
  190. #
  191. ud_GNU_GETTEXT
  192. for file in `cat $srcdir/po/POTFILES`; do
  193.   POTFILES="$POTFILES ../$file"
  194. done
  195. AC_SUBST(POTFILES)
  196. AC_HAVE_HEADERS(values.h)
  197. AC_C_INLINE
  198. AC_TYPE_OFF_T
  199. AC_SIZEOF_TYPE(unsigned short)
  200. AC_SIZEOF_TYPE(unsigned int)
  201. AC_FUNC_MMAP
  202. AC_CHECK_FUNCS(putenv setenv)
  203.  
  204. test -d intl || mkdir intl
  205. case "$target" in
  206.   *-linux*) cp $srcdir/intl/linux-msg.sed intl/po-to-msg.sed ;;
  207.   *)        cp $srcdir/intl/xopen-msg.sed intl/po-to-msg.sed ;;
  208. esac
  209. chmod +w intl/po-to-msg.sed
  210. if test -n "$nls_cv_header_libgt" && test -n "$nls_cv_header_intl"; then
  211.   cp $srcdir/$nls_cv_header_libgt $nls_cv_header_intl
  212.   chmod +w $nls_cv_header_intl
  213. fi
  214. #
  215. # End of NLS block.
  216. # -----------------
  217.  
  218. AC_OUTPUT([Makefile doc/Makefile intl/Makefile lib/Makefile po/Makefile \
  219. src/Makefile scripts/Makefile],
  220. [test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
  221.