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