home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / fileutils-3.6 / configure.in < prev    next >
Encoding:
Text File  |  1993-05-11  |  4.0 KB  |  177 lines

  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT(src/ls.c)
  3. AC_SUBST(PROGS)dnl
  4. AC_SUBST(LIBPROGS)dnl
  5.  
  6. # We want these before the checks, so the checks can modify their values.
  7. test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
  8. test -z "$LDFLAGS" && LDFLAGS=-g
  9.  
  10. AC_PROG_CC
  11.  
  12. # If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
  13. test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
  14.  
  15. AC_SUBST(CFLAGS)dnl
  16. AC_SUBST(LDFLAGS)dnl
  17.  
  18. AC_PROG_CPP
  19. AC_GCC_TRADITIONAL
  20. AC_PROG_RANLIB
  21. AC_PROG_YACC
  22. AC_AIX
  23. AC_MINIX
  24. AC_ISC_POSIX
  25. AC_MAJOR_HEADER
  26. AC_DIR_HEADER
  27. AC_RETSIGTYPE
  28.  
  29. echo checking how to get list of mounted filesystems
  30. mounted=
  31.  
  32. # DEC Alpha running OSF/1.
  33. AC_COMPILE_CHECK(, [
  34. #include <sys/types.h>
  35. #include <sys/mount.h>
  36. #include <sys/fs_types.h>],
  37. [struct statfs *stats;
  38. numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT); ],
  39.   AC_DEFINE(MOUNTED_GETFSSTAT) mounted=1)
  40. if test -z "$mounted"; then
  41. # SVR4
  42. AC_HEADER_EGREP(getmntent, sys/mnttab.h,
  43.   AC_DEFINE(MOUNTED_GETMNTENT2) mounted=1)
  44. fi
  45. if test -z "$mounted"; then
  46. # AIX.
  47. AC_TEST_CPP([#include <fshelp.h>], 
  48.   AC_DEFINE(MOUNTED_VMOUNT) mounted=1)
  49. fi
  50. if test -z "$mounted"; then
  51. # SVR3
  52. AC_TEST_CPP([#include <sys/statfs.h>
  53. #include <sys/fstyp.h>
  54. #include <mnttab.h>], 
  55.   AC_DEFINE(MOUNTED_FREAD_FSTYP) mounted=1)
  56. fi
  57. if test -z "$mounted"; then
  58. # 4.3BSD
  59. AC_TEST_CPP([#include <mntent.h>], 
  60.   AC_DEFINE(MOUNTED_GETMNTENT1) mounted=1)
  61. fi
  62. if test -z "$mounted"; then
  63. # 4.4BSD and DEC OSF/1.
  64. AC_HEADER_EGREP(f_type;, sys/mount.h,  
  65.   AC_DEFINE(MOUNTED_GETMNTINFO) mounted=1)
  66. fi
  67. if test -z "$mounted"; then
  68. # Ultrix
  69. AC_TEST_CPP([#include <sys/fs_types.h>
  70. #include <sys/mount.h>],
  71.   AC_DEFINE(MOUNTED_GETMNT) mounted=1)
  72. fi
  73. if test -z "$mounted"; then
  74. # SVR2
  75. AC_TEST_CPP([#include <mnttab.h>],
  76.   AC_DEFINE(MOUNTED_FREAD) mounted=1)
  77. fi
  78.  
  79. echo checking how to get filesystem space usage
  80. space= 
  81.  
  82. # DEC Alpha running OSF/1
  83. AC_TEST_PROGRAM([
  84. #include <sys/types.h>
  85. #include <sys/mount.h>
  86. main ()
  87. {
  88. struct statfs fsd;
  89. exit (statfs (".", &fsd, sizeof (struct statfs)));
  90. }], AC_DEFINE(STATFS_OSF1) space=1)
  91. if test -z "$space"; then
  92. # SVR4
  93. AC_TEST_CPP([#include <sys/statvfs.h>
  94. #include <sys/fstyp.h>], AC_DEFINE(STAT_STATVFS) space=1)
  95. fi
  96. if test -z "$space"; then
  97. # AIX
  98. AC_HEADER_EGREP(f_nlsdirtype, sys/statfs.h, 
  99.   AC_DEFINE(STAT_STATFS2_BSIZE) space=1)
  100. fi
  101. if test -z "$space"; then
  102. # SVR3
  103. AC_TEST_CPP([#include <sys/statfs.h>], 
  104.   AC_DEFINE(STAT_STATFS4) space=1)
  105. fi
  106. if test -z "$space"; then
  107. # 4.3BSD
  108. AC_TEST_CPP([#include <sys/vfs.h>],
  109.   AC_DEFINE(STAT_STATFS2_BSIZE) space=1)
  110. fi
  111. if test -z "$space"; then
  112. # 4.4BSD
  113. AC_HEADER_EGREP(MOUNT_UFS, sys/mount.h,
  114.   AC_DEFINE(STAT_STATFS2_FSIZE) space=1)
  115. fi
  116. if test -z "$space"; then
  117. # SVR2
  118. AC_TEST_CPP([#include <sys/filsys.h>],
  119.   AC_DEFINE(STAT_READ) space=1)
  120. fi
  121. if test -z "$space"; then
  122. # Ultrix
  123. AC_TEST_CPP([#include <sys/mount.h>],
  124.   AC_DEFINE(STAT_STATFS2_FS_DATA) space=1)
  125. fi
  126. if test -n "$mounted" && test -n "$space"; then
  127.   PROGS="$PROGS df" LIBOBJS="$LIBOBJS fsusage.o mountlist.o"
  128. fi
  129.  
  130. AC_UID_T
  131. AC_GETGROUPS_T
  132. AC_INT_16_BITS
  133. AC_CONST
  134. AC_STDC_HEADERS
  135. AC_UNISTD_H
  136. AC_STRUCT_TM
  137. AC_TIME_WITH_SYS_TIME
  138. AC_HAVE_HEADERS(string.h fcntl.h limits.h sys/time.h errno.h)
  139. AC_REPLACE_FUNCS(fnmatch mkdir mktime stpcpy strdup strstr rename)
  140. AC_HAVE_FUNCS(strerror ftime getcwd mkfifo memcpy bcopy gettimeofday)
  141. AC_COMPILE_CHECK(ftruncate, , [ftruncate();],
  142.   AC_DEFINE(HAVE_FTRUNCATE), ftruncate_missing=1)
  143. if test -n "$ftruncate_missing"; then
  144. AC_COMPILE_CHECK(fcntl emulation of ftruncate,
  145. [#include <sys/types.h>
  146. #include <fcntl.h>], [
  147. #if !defined(F_CHSIZE) && !defined(F_FREESP)
  148. chsize();
  149. #endif
  150. ], AC_DEFINE(HAVE_FTRUNCATE) LIBOBJS="$LIBOBJS ftruncate.o")
  151. fi
  152.  
  153. case "$LIBOBJS" in
  154. *rename.o*)
  155.   LIBPROGS="$LIBPROGS mvdir"
  156.   AC_DEFINE(MVDIR, "\"$(libdir)/mvdir\"")
  157.   ;;
  158. esac
  159.  
  160. AC_VPRINTF
  161. AC_ALLOCA
  162. AC_ST_BLOCKS
  163. AC_UTIME_NULL
  164. AC_XENIX_DIR
  165. AC_IRIX_SUN
  166. AC_DYNIX_SEQ
  167. # Check for libypsec.a on Dolphin M88K machines.
  168. AC_HAVE_LIBRARY(ypsec)
  169.  
  170. # m88k running dgux 5.4 needs this
  171. AC_HAVE_LIBRARY(-ldgc)
  172.  
  173. echo checking for AFS
  174. test -d /afs && AC_DEFINE(AFS)
  175.  
  176. AC_OUTPUT(Makefile lib/Makefile src/Makefile man/Makefile)
  177.