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

  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT(src/stty.c)
  3. AC_PREREQ(1.120)
  4. AC_CONFIG_HEADER(config.h)
  5. AC_SUBST(PROGS)
  6. AC_SUBST(MAN)
  7. AC_PROG_MAKE_SET
  8. AC_PROG_CC
  9. AC_PROG_CPP
  10. AC_PROG_GCC_TRADITIONAL
  11. AC_PROG_INSTALL
  12. AC_PROG_RANLIB
  13. AC_PROG_YACC
  14. AC_AIX
  15. AC_MINIX
  16. AC_ISC_POSIX
  17. AC_CHECK_FUNCS(uname, PROGS="$PROGS uname" MAN="$MAN uname.1")
  18. AC_C_CONST
  19. AC_HEADER_STDC
  20. AC_C_BIGENDIAN
  21.  
  22. AC_STRUCT_TM
  23. AC_HEADER_TIME
  24. AC_STRUCT_TIMEZONE
  25. AC_HEADER_STAT
  26. AC_TYPE_UID_T
  27. AC_TYPE_GETGROUPS
  28. AC_TYPE_SIZE_T
  29.  
  30. AC_CHECK_FUNCS(bcopy endgrent endpwent ftime getcwd getgroups gettimeofday \
  31.            isascii memcpy sethostname strerror sysinfo)
  32.  
  33. # SCO-ODT-3.0 is reported to need -los to link programs using initgroups
  34. AC_CHECK_FUNCS(initgroups)
  35. if test $ac_cv_func_initgroups = no; then
  36.   AC_CHECK_LIB(os, initgroups)
  37. fi
  38.  
  39. AC_CHECK_FUNCS(syslog)
  40. if test $ac_cv_func_syslog = no; then
  41.   # syslog is not in the default libraries.  See if it's in some other.
  42.   for lib in bsd socket inet; do
  43.     AC_CHECK_LIB($lib, syslog, [AC_DEFINE(HAVE_SYSLOG)
  44.       LIBS="$LIBS -l$lib"; break])
  45.   done
  46. fi
  47.  
  48. AC_CHECK_HEADERS(string.h fcntl.h limits.h syslog.h sys/time.h unistd.h \
  49.          sys/timeb.h float.h sys/systeminfo.h sys/param.h)
  50.  
  51. AC_REPLACE_FUNCS(gethostname getusershell mktime stime \
  52.          strcspn strstr strtol strtoul strtod)
  53. AC_FUNC_MEMCMP
  54. AC_FUNC_VPRINTF
  55. AC_FUNC_ALLOCA
  56.  
  57. AC_MSG_CHECKING(for 3-argument setpriority function)
  58. AC_CACHE_VAL(utils_cv_func_setpriority,
  59. [AC_TRY_LINK([#include <sys/time.h>
  60. #include <sys/resource.h>],
  61. [setpriority(0, 0, 0);],
  62. utils_cv_func_setpriority=yes, utils_cv_func_setpriority=no)])
  63. AC_MSG_RESULT($utils_cv_func_setpriority)
  64. if test $utils_cv_func_setpriority = yes; then
  65.   PROGS="$PROGS nice nohup"
  66.   MAN="$MAN nice.1 nohup.1"
  67. else
  68.   AC_MSG_CHECKING(for nice function)
  69.   AC_CACHE_VAL(utils_cv_func_nice,
  70.   [AC_TRY_LINK([], nice();, 
  71.   utils_cv_func_nice=yes, utils_cv_func_nice=no)])
  72.   AC_MSG_RESULT($utils_cv_func_nice)
  73.   if test $utils_cv_func_nice = yes; then
  74.     AC_DEFINE(NICE_PRIORITY)
  75.     PROGS="$PROGS nice nohup"
  76.     MAN="$MAN nice.1 nohup.1"
  77.   fi
  78. fi
  79.  
  80. AC_MSG_CHECKING(ut_host in struct utmp)
  81. AC_CACHE_VAL(su_cv_func_ut_host_in_utmp,
  82. [AC_TRY_LINK([#include <sys/types.h>
  83. #include <utmp.h>], [struct utmp ut; ut.ut_host;],
  84. su_cv_func_ut_host_in_utmp=yes, su_cv_func_ut_host_in_utmp=no)])
  85. AC_MSG_RESULT($su_cv_func_ut_host_in_utmp)
  86. if test $su_cv_func_ut_host_in_utmp = yes; then
  87.   have_ut_host=1
  88.   AC_DEFINE(HAVE_UT_HOST)
  89. fi
  90.  
  91. if test -z "$have_ut_host"; then
  92.   AC_MSG_CHECKING(ut_host in struct utmpx)
  93.   AC_CACHE_VAL(su_cv_func_ut_host_in_utmpx,
  94.   [AC_TRY_LINK([#include <sys/types.h>
  95. #include <utmpx.h>], [struct utmpx ut; ut.ut_host;],
  96.   su_cv_func_ut_host_in_utmpx=yes, su_cv_func_ut_host_in_utmpx=no)])
  97.   AC_MSG_RESULT($su_cv_func_ut_host_in_utmpx)
  98.   if test $su_cv_func_ut_host_in_utmpx = yes; then
  99.     AC_DEFINE(HAVE_UTMPX_H)
  100.     AC_DEFINE(HAVE_UT_HOST)
  101.   fi
  102. fi
  103.  
  104. AC_MSG_CHECKING(POSIX termios)
  105. AC_CACHE_VAL(su_cv_sys_posix_termios,
  106. [AC_TRY_LINK([#include <sys/types.h>
  107. #include <unistd.h>
  108. #include <termios.h>],
  109. [/* SunOS 4.0.3 has termios.h but not the library calls.  */
  110. tcgetattr(0, 0);],
  111.   su_cv_sys_posix_termios=yes,
  112.   su_cv_sys_posix_termios=no)])
  113. AC_MSG_RESULT($su_cv_sys_posix_termios)
  114.  
  115. if test $su_cv_sys_posix_termios = yes; then
  116.   PROGS="$PROGS stty" MAN="$MAN stty.1"
  117.  
  118.   AC_MSG_CHECKING(c_line in struct termios)
  119.   AC_CACHE_VAL(su_cv_sys_c_line_in_termios,
  120.   [AC_TRY_LINK([#include <sys/types.h>
  121. #include <termios.h>],
  122.           [struct termios t; t.c_line;],
  123.           su_cv_sys_c_line_in_termios=yes,
  124.           su_cv_sys_c_line_in_termios=no)])
  125.   AC_MSG_RESULT($su_cv_sys_c_line_in_termios)
  126.   test $su_cv_sys_c_line_in_termios = yes && AC_DEFINE(HAVE_C_LINE)
  127.  
  128.   AC_MSG_CHECKING(TIOCGWINSZ in termios.h)
  129.   AC_CACHE_VAL(su_cv_sys_tiocgwinsz_in_termios_h,
  130.   [AC_TRY_LINK([#include <sys/types.h>
  131. #include <termios.h>],
  132.         [int x = TIOCGWINSZ;],
  133.         su_cv_sys_tiocgwinsz_in_termios_h=yes,
  134.         su_cv_sys_tiocgwinsz_in_termios_h=no)])
  135.   AC_MSG_RESULT($su_cv_sys_tiocgwinsz_in_termios_h)
  136. else
  137.   su_cv_sys_tiocgwinsz_in_termios_h=no
  138. fi
  139.  
  140. if test $su_cv_sys_tiocgwinsz_in_termios_h = no; then
  141.   AC_MSG_CHECKING(TIOCGWINSZ in sys/ioctl.h)
  142.   AC_CACHE_VAL(su_cv_sys_tiocgwinsz_in_sys_ioctl_h,
  143.   [AC_TRY_LINK([#include <sys/types.h>
  144. #include <sys/ioctl.h>],
  145.           [int x = TIOCGWINSZ;],
  146.           su_cv_sys_tiocgwinsz_in_sys_ioctl_h=yes,
  147.           su_cv_sys_tiocgwinsz_in_sys_ioctl_h=no)])
  148.   AC_MSG_RESULT($su_cv_sys_tiocgwinsz_in_sys_ioctl_h)
  149.  
  150.   test $su_cv_sys_tiocgwinsz_in_sys_ioctl_h = yes \
  151.       && AC_DEFINE(GWINSZ_IN_SYS_IOCTL)
  152. fi
  153.  
  154. AC_CHECK_HEADER([sys/ptem.h],
  155.         AC_DEFINE(WINSIZE_IN_PTEM))
  156.  
  157. # The -lsun library is required for YP support on Irix-4.0.5 systems.
  158. AC_CHECK_LIB(sun, yp_match)
  159.  
  160. AC_CHECKING(for shadow password routines)
  161. # Needed on SysV for shadow passwords.
  162. AC_CHECK_LIB(sec, main)
  163.  
  164. # Needed on Linux for shadow passwords.
  165. AC_CHECK_LIB(shadow, main)
  166.  
  167. AC_EGREP_HEADER(sp_pwdp, shadow.h,
  168.         AC_CHECK_FUNC(getspnam, AC_DEFINE(HAVE_SHADOW_H)))
  169.  
  170. AC_CHECK_FUNCS(crypt)
  171. if test $ac_cv_func_crypt = no; then
  172.   # SCO-ODT-3.0 is reported to need this library for crypt.  
  173.   AC_CHECK_LIB(ufc, crypt, LIBS="$LIBS -lufc",
  174.     [# NetBSD needs this library for crypt.  
  175.     AC_CHECK_LIB(crypt, crypt)])
  176. fi
  177.  
  178. AC_OUTPUT(Makefile doc/Makefile lib/Makefile man/Makefile src/Makefile,
  179. [date > stamp-h])dnl
  180.