home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / file / fileutil.13 / fileutil / fileutils-3.13 / configure.in < prev    next >
Encoding:
Text File  |  1996-07-12  |  15.4 KB  |  578 lines

  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT(src/ls.c)
  3. AC_CONFIG_HEADER(config.h)
  4. AC_PREREQ(2.10)dnl               dnl Minimum Autoconf version required.
  5. AC_PROG_MAKE_SET
  6. AC_ARG_PROGRAM
  7.  
  8. PACKAGE=fileutils
  9. VERSION=3.13
  10. PACKAGE_VERSION="GNU $PACKAGE-$VERSION"
  11. AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
  12. AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
  13. AC_DEFINE_UNQUOTED(PACKAGE_VERSION, "$PACKAGE_VERSION")
  14. AC_SUBST(PACKAGE)
  15. AC_SUBST(VERSION)
  16. AC_SUBST(PACKAGE_VERSION)
  17.  
  18. jm_MAINTAINER_MODE
  19.  
  20. ALL_LINGUAS="de fr pt sv"
  21.  
  22. AC_SUBST(PACKAGE)
  23. AC_SUBST(VERSION)
  24. AC_SUBST(README_ALPHA)
  25.  
  26. changequote(,)dnl
  27. case $VERSION in
  28.   *[a-z]) README_ALPHA=README-alpha;;
  29.   *) README_ALPHA=;;
  30. esac
  31. changequote([, ])dnl
  32.  
  33. AC_SUBST(DF_PROG)
  34. AC_SUBST(MVDIR_PROG)
  35. AC_PATH_PROG(LN, ln, ln)
  36. AC_PATH_PROG(MV, mv, mv)
  37. AC_PATH_PROG(RM, rm, rm)
  38. AC_PATH_PROG(PERL, perl)
  39. AC_PROG_CC
  40. AC_PROG_CPP
  41. AC_PROG_GCC_TRADITIONAL
  42. AC_PROG_INSTALL
  43. AC_PROG_RANLIB
  44. AC_PROG_YACC
  45. AC_AIX
  46. AC_MINIX
  47. AC_ISC_POSIX
  48.  
  49. dnl This test must precede tests of compiler characteristics like
  50. dnl that for the inline keyword, since it may change the degree to
  51. dnl which the compiler supports such features.
  52. fp_C_PROTOTYPES
  53.  
  54. AC_HEADER_MAJOR
  55. AC_HEADER_DIRENT
  56. AC_FUNC_CLOSEDIR_VOID
  57.  
  58. AC_TYPE_GETGROUPS
  59. AC_TYPE_MODE_T
  60. AC_TYPE_OFF_T
  61. AC_TYPE_SIGNAL
  62. AC_TYPE_SIZE_T
  63. AC_TYPE_UID_T
  64. AC_CHECK_TYPE(ino_t, unsigned long)
  65.  
  66. AC_C_CONST
  67. AC_HEADER_STDC
  68. AC_STRUCT_TM
  69. AC_STRUCT_ST_BLOCKS
  70. AC_HEADER_TIME
  71. AC_HEADER_STAT
  72.  
  73. AC_CHECK_HEADERS(string.h fcntl.h limits.h sys/time.h errno.h unistd.h \
  74.     sys/param.h sys/statfs.h sys/fstyp.h mnttab.h mntent.h utime.h \
  75.     sys/statvfs.h sys/vfs.h sys/mount.h sys/filsys.h sys/fs_types.h \
  76.     sys/wait.h sys/ioctl.h values.h)
  77. AC_REPLACE_FUNCS(basename euidaccess group_member memcpy memcmp memset \
  78.     mkdir mktime rename rmdir stpcpy strcasecmp strdup \
  79.     strndup strstr strtol strtoul)
  80. AC_REPLACE_GNU_GETOPT
  81. AC_CHECK_FUNCS(bcopy endgrent endpwent fchdir ftime ftruncate \
  82.     getcwd getgroups getmntinfo gettimeofday isascii lchown \
  83.     listmntent memcpy mkfifo strchr strerror strrchr)
  84.  
  85. AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
  86.  
  87. AC_FUNC_VPRINTF
  88. AC_FUNC_ALLOCA
  89. AC_FUNC_UTIME_NULL
  90.  
  91. dnl Some systems have utime.h but don't declare the struct anywhere.
  92. AC_MSG_CHECKING(for struct utimbuf)
  93. AC_CACHE_VAL(fu_cv_sys_struct_utimbuf,
  94. [AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
  95. #include <sys/time.h>
  96. #include <time.h>
  97. #else
  98. #ifdef HAVE_SYS_TIME_H
  99. #include <sys/time.h>
  100. #else
  101. #include <time.h>
  102. #endif
  103. #endif
  104. #ifdef HAVE_UTIME_H
  105. #include <utime.h>
  106. #endif], [static struct utimbuf x; x.actime = x.modtime;],
  107.   fu_cv_sys_struct_utimbuf=yes,
  108.   fu_cv_sys_struct_utimbuf=no)])
  109. AC_MSG_RESULT($fu_cv_sys_struct_utimbuf)
  110. if test $fu_cv_sys_struct_utimbuf = yes; then
  111.    AC_DEFINE(HAVE_STRUCT_UTIMBUF)
  112. fi
  113.  
  114. AC_MSG_CHECKING([for working fnmatch function])
  115. AC_CACHE_VAL(fu_cv_sys_working_fnmatch,
  116. [AC_TRY_RUN([
  117. #include <fnmatch.h>
  118. int
  119. main ()
  120. {
  121.   exit ((fnmatch ("a*", "abc", FNM_PATHNAME) == 0
  122.      && fnmatch ("a", "b", FNM_PATHNAME) == FNM_NOMATCH)
  123.     ? 0 : 1);
  124. }],
  125. fu_cv_sys_working_fnmatch=yes,
  126. fu_cv_sys_working_fnmatch=no,
  127. fu_cv_sys_working_fnmatch=no)])
  128. if test $fu_cv_sys_working_fnmatch = no; then
  129.   LIBOBJS="$LIBOBJS fnmatch.o"
  130. fi
  131. AC_MSG_RESULT($fu_cv_sys_working_fnmatch)
  132.  
  133. AC_MSG_CHECKING([for d_ino member in directory struct])
  134. AC_CACHE_VAL(fu_cv_sys_d_ino_in_dirent,
  135. [AC_TRY_LINK([
  136. #include <sys/types.h>
  137. #ifdef HAVE_DIRENT_H
  138. # include <dirent.h>
  139. #else /* not HAVE_DIRENT_H */
  140. # define dirent direct
  141. # ifdef HAVE_SYS_NDIR_H
  142. #  include <sys/ndir.h>
  143. # endif /* HAVE_SYS_NDIR_H */
  144. # ifdef HAVE_SYS_DIR_H
  145. #  include <sys/dir.h>
  146. # endif /* HAVE_SYS_DIR_H */
  147. # ifdef HAVE_NDIR_H
  148. #  include <ndir.h>
  149. # endif /* HAVE_NDIR_H */
  150. #endif /* HAVE_DIRENT_H */
  151. ],
  152.   [struct dirent dp; dp.d_ino = 0;],
  153.     fu_cv_sys_d_ino_in_dirent=yes,
  154.     fu_cv_sys_d_ino_in_dirent=no)])
  155. AC_MSG_RESULT($fu_cv_sys_d_ino_in_dirent)
  156. if test $fu_cv_sys_d_ino_in_dirent = yes; then
  157.   AC_DEFINE(D_INO_IN_DIRENT)
  158. fi
  159.  
  160. # Determine how to get the list of mounted filesystems.
  161. list_mounted_fs=
  162.  
  163. # If the getmntent function is available but not in the standard library,
  164. # make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX).
  165. AC_FUNC_GETMNTENT
  166.  
  167. # This test must precede the ones for getmntent because Unicos-9 is
  168. # reported to have the getmntent function, but its support is incompatible
  169. # with other getmntent implementations.
  170.  
  171. # NOTE: Normally, I wouldn't use a check for system type as I've done for
  172. # `CRAY' below since that goes against the whole autoconf philosophy.  But
  173. # I think there is too great a chance that some non-Cray system has a
  174. # function named listmntent to risk the false positive.
  175.  
  176. if test -z "$list_mounted_fs"; then
  177.   # Cray UNICOS 9
  178.   AC_MSG_CHECKING([for listmntent of Cray/Unicos-9])
  179.   AC_CACHE_VAL(fu_cv_sys_mounted_cray_listmntent,
  180.     [fu_cv_sys_mounted_cray_listmntent=no
  181.       AC_EGREP_CPP(yes,
  182.         [#ifdef _CRAY
  183. yes
  184. #endif
  185.         ], [test $ac_cv_func_listmntent = yes \
  186.         && fu_cv_sys_mounted_cray_listmntent=yes]
  187.       )
  188.     ]
  189.   )
  190.   AC_MSG_RESULT($fu_cv_sys_mounted_cray_listmntent)
  191.   if test $fu_cv_sys_mounted_cray_listmntent = yes; then
  192.     list_mounted_fs=found
  193.     AC_DEFINE(MOUNTED_LISTMNTENT)
  194.   fi
  195. fi
  196.  
  197. if test $ac_cv_func_getmntent = yes; then
  198.  
  199.   # This system has the getmntent function.
  200.   # Determine whether it's the one-argument variant or the two-argument one.
  201.  
  202.   if test -z "$list_mounted_fs"; then
  203.     # 4.3BSD, SunOS, HP-UX, Dynix, Irix
  204.     AC_MSG_CHECKING([for one-argument getmntent function])
  205.     AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1,
  206.          [test $ac_cv_header_mntent_h = yes \
  207.            && fu_cv_sys_mounted_getmntent1=yes \
  208.            || fu_cv_sys_mounted_getmntent1=no])
  209.     AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1)
  210.     if test $fu_cv_sys_mounted_getmntent1 = yes; then
  211.       list_mounted_fs=found
  212.       AC_DEFINE(MOUNTED_GETMNTENT1)
  213.     fi
  214.   fi
  215.  
  216.   if test -z "$list_mounted_fs"; then
  217.     # SVR4
  218.     AC_MSG_CHECKING([for two-argument getmntent function])
  219.     AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2,
  220.     [AC_EGREP_HEADER(getmntent, sys/mnttab.h,
  221.       fu_cv_sys_mounted_getmntent2=yes,
  222.       fu_cv_sys_mounted_getmntent2=no)])
  223.     AC_MSG_RESULT($fu_cv_sys_mounted_getmntent2)
  224.     if test $fu_cv_sys_mounted_getmntent2 = yes; then
  225.       list_mounted_fs=found
  226.       AC_DEFINE(MOUNTED_GETMNTENT2)
  227.     fi
  228.   fi
  229.  
  230.   if test -z "$list_mounted_fs"; then
  231.     AC_MSG_ERROR([could not determine how to read list of mounted filesystems])
  232.   fi
  233.  
  234. fi
  235.  
  236. if test -z "$list_mounted_fs"; then
  237.   # DEC Alpha running OSF/1.
  238.   AC_MSG_CHECKING([for getfsstat function])
  239.   AC_CACHE_VAL(fu_cv_sys_mounted_getsstat,
  240.   [AC_TRY_LINK([
  241. #include <sys/types.h>
  242. #include <sys/mount.h>
  243. #include <sys/fs_types.h>],
  244.   [struct statfs *stats;
  245.   numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT); ],
  246.     fu_cv_sys_mounted_getsstat=yes,
  247.     fu_cv_sys_mounted_getsstat=no)])
  248.   AC_MSG_RESULT($fu_cv_sys_mounted_getsstat)
  249.   if test $fu_cv_sys_mounted_getsstat = yes; then
  250.     list_mounted_fs=found
  251.     AC_DEFINE(MOUNTED_GETFSSTAT)
  252.   fi
  253. fi
  254.  
  255. if test -z "$list_mounted_fs"; then
  256.   # AIX.
  257.   AC_MSG_CHECKING([for mntctl function and struct vmount])
  258.   AC_CACHE_VAL(fu_cv_sys_mounted_vmount,
  259.   [AC_TRY_CPP([#include <fshelp.h>],
  260.     fu_cv_sys_mounted_vmount=yes,
  261.     fu_cv_sys_mounted_vmount=no)])
  262.   AC_MSG_RESULT($fu_cv_sys_mounted_vmount)
  263.   if test $fu_cv_sys_mounted_vmount = yes; then
  264.     list_mounted_fs=found
  265.     AC_DEFINE(MOUNTED_VMOUNT)
  266.   fi
  267. fi
  268.  
  269. if test -z "$list_mounted_fs"; then
  270.   # SVR3
  271.   AC_MSG_CHECKING([for FIXME existence of three headers])
  272.   AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp,
  273.     [AC_TRY_CPP([
  274. #include <sys/statfs.h>
  275. #include <sys/fstyp.h>
  276. #include <mnttab.h>],
  277.         fu_cv_sys_mounted_fread_fstyp=yes,
  278.         fu_cv_sys_mounted_fread_fstyp=no)])
  279.   AC_MSG_RESULT($fu_cv_sys_mounted_fread_fstyp)
  280.   if test $fu_cv_sys_mounted_fread_fstyp = yes; then
  281.     list_mounted_fs=found
  282.     AC_DEFINE(MOUNTED_FREAD_FSTYP)
  283.   fi
  284. fi
  285.  
  286. if test -z "$list_mounted_fs"; then
  287.   # 4.4BSD and DEC OSF/1.
  288.   AC_MSG_CHECKING([for getmntinfo function])
  289.   AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo,
  290.     [
  291.       ok=
  292.       if test $ac_cv_func_getmntinfo = yes; then
  293.     AC_EGREP_HEADER(f_type;, sys/mount.h,
  294.             ok=yes)
  295.       fi
  296.       test -n "$ok" \
  297.       && fu_cv_sys_mounted_getmntinfo=yes \
  298.       || fu_cv_sys_mounted_getmntinfo=no
  299.     ])
  300.   AC_MSG_RESULT($fu_cv_sys_mounted_getmntinfo)
  301.   if test $fu_cv_sys_mounted_getmntinfo = yes; then
  302.     list_mounted_fs=found
  303.     AC_DEFINE(MOUNTED_GETMNTINFO)
  304.   fi
  305. fi
  306.  
  307. # FIXME: add a test for netbsd-1.1 here
  308.  
  309. if test -z "$list_mounted_fs"; then
  310.   # Ultrix
  311.   AC_MSG_CHECKING([for getmnt function])
  312.   AC_CACHE_VAL(fu_cv_sys_mounted_getmnt,
  313.     [AC_TRY_CPP([
  314. #include <sys/fs_types.h>
  315. #include <sys/mount.h>],
  316.         fu_cv_sys_mounted_getmnt=yes,
  317.         fu_cv_sys_mounted_getmnt=no)])
  318.   AC_MSG_RESULT($fu_cv_sys_mounted_getmnt)
  319.   if test $fu_cv_sys_mounted_getmnt = yes; then
  320.     list_mounted_fs=found
  321.     AC_DEFINE(MOUNTED_GETMNT)
  322.   fi
  323. fi
  324.  
  325. if test -z "$list_mounted_fs"; then
  326.   # SVR2
  327.   AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
  328.   AC_CACHE_VAL(fu_cv_sys_mounted_fread,
  329.     [AC_TRY_CPP([#include <mnttab.h>],
  330.         fu_cv_sys_mounted_fread=yes,
  331.         fu_cv_sys_mounted_fread=no)])
  332.   AC_MSG_RESULT($fu_cv_sys_mounted_fread)
  333.   if test $fu_cv_sys_mounted_fread = yes; then
  334.     list_mounted_fs=found
  335.     AC_DEFINE(MOUNTED_FREAD)
  336.   fi
  337. fi
  338.  
  339. if test -z "$list_mounted_fs"; then
  340.   AC_MSG_ERROR([could not determine how to read list of mounted filesystems])
  341.   # FIXME -- no need to abort building the whole package
  342.   # Can't build mountlist.c or anything that needs its functions
  343. fi
  344.  
  345. AC_CHECKING(how to get filesystem space usage)
  346. space=no
  347.  
  348. # Here we'll compromise a little (and perform only the link test)
  349. # since it seems there are no variants of the statvfs function.
  350. if test $space = no; then
  351.   # SVR4
  352.   AC_CHECK_FUNCS(statvfs)
  353.   if test $ac_cv_func_statvfs = yes; then
  354.     space=yes
  355.     AC_DEFINE(STAT_STATVFS)
  356.   fi
  357. fi
  358.  
  359. if test $space = no; then
  360.   # DEC Alpha running OSF/1
  361.   AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
  362.   AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
  363.   [AC_TRY_RUN([
  364. #include <sys/param.h>
  365. #include <sys/types.h>
  366. #include <sys/mount.h>
  367.   main ()
  368.   {
  369.     struct statfs fsd;
  370.     fsd.f_fsize = 0;
  371.     exit (statfs (".", &fsd, sizeof (struct statfs)));
  372.   }],
  373.   fu_cv_sys_stat_statfs3_osf1=yes,
  374.   fu_cv_sys_stat_statfs3_osf1=no,
  375.   fu_cv_sys_stat_statfs3_osf1=no)])
  376.   AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
  377.   if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
  378.     space=yes
  379.     AC_DEFINE(STAT_STATFS3_OSF1)
  380.   fi
  381. fi
  382.  
  383. if test $space = no; then
  384. # AIX
  385.   AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
  386. member (AIX, 4.3BSD)])
  387.   AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
  388.   [AC_TRY_RUN([
  389. #ifdef HAVE_SYS_PARAM_H
  390. #include <sys/param.h>
  391. #endif
  392. #ifdef HAVE_SYS_MOUNT_H
  393. #include <sys/mount.h>
  394. #endif
  395. #ifdef HAVE_SYS_VFS_H
  396. #include <sys/vfs.h>
  397. #endif
  398.   main ()
  399.   {
  400.   struct statfs fsd;
  401.   fsd.f_bsize = 0;
  402.   exit (statfs (".", &fsd));
  403.   }],
  404.   fu_cv_sys_stat_statfs2_bsize=yes,
  405.   fu_cv_sys_stat_statfs2_bsize=no,
  406.   fu_cv_sys_stat_statfs2_bsize=no)])
  407.   AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
  408.   if test $fu_cv_sys_stat_statfs2_bsize = yes; then
  409.     space=yes
  410.     AC_DEFINE(STAT_STATFS2_BSIZE)
  411.   fi
  412. fi
  413.  
  414. if test $space = no; then
  415. # SVR3
  416.   AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
  417.   AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
  418.   [AC_TRY_RUN([#include <sys/types.h>
  419. #include <sys/statfs.h>
  420.   main ()
  421.   {
  422.   struct statfs fsd;
  423.   exit (statfs (".", &fsd, sizeof fsd, 0));
  424.   }],
  425.     fu_cv_sys_stat_statfs4=yes,
  426.     fu_cv_sys_stat_statfs4=no,
  427.     fu_cv_sys_stat_statfs4=no)])
  428.   AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
  429.   if test $fu_cv_sys_stat_statfs4 = yes; then
  430.     space=yes
  431.     AC_DEFINE(STAT_STATFS4)
  432.   fi
  433. fi
  434.  
  435. if test $space = no; then
  436. # 4.4BSD and NetBSD
  437.   AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
  438. member (4.4BSD and NetBSD)])
  439.   AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
  440.   [AC_TRY_RUN([#include <sys/types.h>
  441. #ifdef HAVE_SYS_PARAM_H
  442. #include <sys/param.h>
  443. #endif
  444. #ifdef HAVE_SYS_MOUNT_H
  445. #include <sys/mount.h>
  446. #endif
  447.   main ()
  448.   {
  449.   struct statfs fsd;
  450.   fsd.f_fsize = 0;
  451.   exit (statfs (".", &fsd));
  452.   }],
  453.   fu_cv_sys_stat_statfs2_fsize=yes,
  454.   fu_cv_sys_stat_statfs2_fsize=no,
  455.   fu_cv_sys_stat_statfs2_fsize=no)])
  456.   AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
  457.   if test $fu_cv_sys_stat_statfs2_fsize = yes; then
  458.     space=yes
  459.     AC_DEFINE(STAT_STATFS2_FSIZE)
  460.   fi
  461. fi
  462.  
  463. if test $space = no; then
  464.   # Ultrix
  465.   AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
  466.   AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
  467.   [AC_TRY_RUN([#include <sys/types.h>
  468. #ifdef HAVE_SYS_PARAM_H
  469. #include <sys/param.h>
  470. #endif
  471. #ifdef HAVE_SYS_MOUNT_H
  472. #include <sys/mount.h>
  473. #endif
  474. #ifdef HAVE_SYS_FS_TYPES_H
  475. #include <sys/fs_types.h>
  476. #endif
  477.   main ()
  478.   {
  479.   struct fs_data fsd;
  480.   /* Ultrix's statfs returns 1 for success,
  481.      0 for not mounted, -1 for failure.  */
  482.   exit (statfs (".", &fsd) != 1);
  483.   }],
  484.   fu_cv_sys_stat_fs_data=yes,
  485.   fu_cv_sys_stat_fs_data=no,
  486.   fu_cv_sys_stat_fs_data=no)])
  487.   AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
  488.   if test $fu_cv_sys_stat_fs_data = yes; then
  489.     space=yes
  490.     AC_DEFINE(STAT_STATFS2_FS_DATA)
  491.   fi
  492. fi
  493.  
  494. if test $space = no; then
  495. # SVR2
  496. AC_TRY_CPP([#include <sys/filsys.h>],
  497.   AC_DEFINE(STAT_READ_FILSYS) space=yes)
  498. fi
  499.  
  500. if test -n "$list_mounted_fs" && test $space != no; then
  501.   DF_PROG="df"
  502.   LIBOBJS="$LIBOBJS fsusage.o"
  503.   LIBOBJS="$LIBOBJS mountlist.o"
  504. fi
  505.  
  506. AC_CHECK_FUNCS(ftruncate, , [ftruncate_missing=yes])
  507.  
  508. if test "$ftruncate_missing" = yes; then
  509.   AC_MSG_CHECKING([fcntl emulation of ftruncate])
  510.   AC_CACHE_VAL(fu_cv_sys_ftruncate_emulation,
  511.   [AC_TRY_LINK([
  512. #include <sys/types.h>
  513. #include <fcntl.h>], [
  514. #if !defined(F_CHSIZE) && !defined(F_FREESP)
  515. chsize();
  516. #endif
  517. ],
  518.     fu_cv_sys_ftruncate_emulation=yes,
  519.     fu_cv_sys_ftruncate_emulation=no)])
  520.   AC_MSG_RESULT($fu_cv_sys_ftruncate_emulation)
  521.   if test $fu_cv_sys_ftruncate_emulation = yes; then
  522.     LIBOBJS="$LIBOBJS ftruncate.o"
  523.   fi
  524. fi
  525.  
  526. case "$LIBOBJS" in
  527. *rename.o*)
  528.   MVDIR_PROG="mvdir"
  529.   ;;
  530. esac
  531.  
  532. # Check for SunOS statfs brokenness wrt partitions 2GB and larger.
  533. # If <sys/vfs.h> exists and struct statfs has a member named f_spare,
  534. # enable the work-around code in fsusage.c.
  535. AC_MSG_CHECKING([for statfs that truncates block counts])
  536. AC_CACHE_VAL(fu_cv_sys_truncating_statfs,
  537. [AC_TRY_COMPILE([
  538. #include <sys/types.h>
  539. #include <sys/vfs.h>],
  540. [struct statfs t; long c = *(t.f_spare);],
  541. fu_cv_sys_truncating_statfs=yes,
  542. fu_cv_sys_truncating_statfs=no,
  543. )])
  544. if test $fu_cv_sys_truncating_statfs = yes; then
  545.   AC_DEFINE(STATFS_TRUNCATES_BLOCK_COUNTS)
  546. fi
  547. AC_MSG_RESULT($fu_cv_sys_truncating_statfs)
  548.  
  549. # If we don't yet have getgroups, see if it's in -lbsd.
  550. # This is reported to be necessary on an ITOS 3000WS running SEIUX 3.1.
  551. AC_CHECK_FUNC(getgroups, , AC_CHECK_LIB(bsd, getgroups))
  552.  
  553. # Check for libypsec.a on Dolphin M88K machines.
  554. AC_CHECK_LIB(ypsec, main)
  555.  
  556. # m88k running dgux 5.4 needs this
  557. AC_CHECK_LIB(ldgc, main)
  558.  
  559. AC_CHECKING(for AFS)
  560. test -d /afs && AC_DEFINE(AFS)
  561.  
  562. ud_GNU_GETTEXT
  563.  
  564. dnl In case the replacement group_member function will be used, the file
  565. dnl group_member.c must exist.  I refuse to rename the source
  566. dnl (changing the hyphen in `group-member.c' to an underscore) to
  567. dnl accomodate this.  So instead, just create a link with the expected name.
  568. dnl But due to a limitation of autoconf-2.10, we can't just do this:
  569. dnl AC_LINK_FILES(lib/group-member.c, lib/group_member.c)
  570.  
  571. AC_LINK_FILES($nls_cv_header_libgt lib/group-member.c,
  572.           $nls_cv_header_intl lib/group_member.c)
  573.  
  574. AC_OUTPUT([Makefile doc/Makefile intl/Makefile lib/Makefile man/Makefile \
  575. po/Makefile.in src/Makefile],
  576. [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
  577. test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
  578.