home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 4 / FreshFish_May-June1994.bin / bbs / gnu / shellutils-1.9.4-src.lha / src / amiga / shellutils-1.9.4 / configure.in < prev    next >
Encoding:
Text File  |  1994-01-28  |  4.3 KB  |  177 lines

  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT(src/stty.c)
  3. AC_CONFIG_HEADER(config.h)
  4. AC_SUBST(PROGS)dnl
  5. AC_SUBST(MAN)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.  
  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_INSTALL
  21. AC_PROG_RANLIB
  22. AC_PROG_YACC
  23. AC_AIX
  24. AC_MINIX
  25. AC_ISC_POSIX
  26. AC_SCO_INTL
  27. AC_FUNC_CHECK(uname, PROGS="$PROGS uname" MAN="$MAN uname.1" have_uname=1)
  28. echo checking for shadow password routines
  29. AC_HEADER_EGREP(sp_pwdp, shadow.h, AC_DEFINE(HAVE_SHADOW_H))
  30. AC_CONST
  31. AC_STDC_HEADERS
  32. AC_HAVE_FUNCS(strerror ftime memcpy bcopy gettimeofday syslog initgroups \
  33.           isascii)
  34.  
  35. # This check must be performed before HAVE_SYSLOG_H can be defined.
  36. case "$DEFS" in
  37. *-DHAVE_SYSLOG*) ;;
  38. *)
  39.   # syslog is not in the default libraries.  See if it's in some other.
  40.   saved_LIBS="$LIBS"
  41.   for lib in bsd socket inet; do
  42.     echo checking for syslog in -l$lib
  43.     LIBS="$saved_LIBS -l$lib"
  44.     AC_HAVE_FUNCS(syslog)
  45.     case "$DEFS" in
  46.     *-DHAVE_SYSLOG*) break ;;
  47.     *) ;;
  48.     esac
  49.     LIBS="$saved_LIBS"
  50.   done
  51.   ;;
  52. esac
  53.  
  54. # SCO-ODT-3.0 is reported to need -los to link programs using initgroups
  55. case "$DEFS" in
  56. *-DHAVE_INITGROUPS*) ;;
  57. *)
  58.   # initgroups is not in the default libraries.  See if it's in some other.
  59.   saved_LIBS="$LIBS"
  60.   for lib in os; do
  61.     echo checking for initgroups in -l$lib
  62.     LIBS="$saved_LIBS -l$lib"
  63.     AC_HAVE_FUNCS(initgroups)
  64.     case "$DEFS" in
  65.     *-DHAVE_INITGROUPS*) break ;;
  66.     *) ;;
  67.     esac
  68.     LIBS="$saved_LIBS"
  69.   done
  70.   ;;
  71. esac
  72.  
  73. AC_HAVE_HEADERS(string.h fcntl.h limits.h syslog.h sys/time.h unistd.h \
  74.         sys/timeb.h float.h)
  75. AC_UID_T
  76. AC_GETGROUPS_T
  77. AC_SIZE_T
  78. AC_REPLACE_FUNCS(gethostname getusershell memcmp mktime stime \
  79.          strcspn strstr strtol strtoul strtod)
  80.  
  81. case "$LIBOBJS" in
  82. *memcmp*) ;;
  83. *)
  84. echo "checking if memcmp is 8-bit clean"
  85. AC_TEST_PROGRAM([
  86. main()
  87. {
  88.   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
  89.   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
  90. }
  91. ],[
  92. test -n "$verbose" && echo "    memcmp is 8-bit clean"
  93. ],[
  94. test -n "$verbose" && echo "    memcmp is NOT 8-bit clean -- using replacement"
  95. LIBOBJS="$LIBOBJS memcmp.o"
  96. ])
  97.   ;;
  98. esac
  99.  
  100. AC_COMPILE_CHECK(setpriority,
  101. [#include <sys/time.h>
  102. #include <sys/resource.h>],
  103. [setpriority(0, 0, 0);],
  104. PROGS="$PROGS nice nohup" MAN="$MAN nice.1 nohup.1")
  105. case "$PROGS" in
  106. *nice*) ;;
  107. *)
  108. AC_COMPILE_CHECK(nice, , nice();, 
  109. AC_DEFINE(NICE_PRIORITY) PROGS="$PROGS nice nohup" MAN="$MAN nice.1 nohup.1") ;;
  110. esac
  111.  
  112. case "$LIBOBJS" in
  113. *gethostname*) test -n "$have_uname" && AC_DEFINE(HAVE_UNAME)
  114. ;;
  115. esac
  116.  
  117. AC_COMPILE_CHECK(ut_host in struct utmp,
  118. [#include <sys/types.h>
  119. #include <utmp.h>], [struct utmp ut; ut.ut_host;],
  120. AC_DEFINE(HAVE_UT_HOST))
  121.  
  122. case "$DEFS" in
  123. *HAVE_UT_HOST*) ;;
  124. *) AC_COMPILE_CHECK(ut_host in struct utmpx,
  125. [#include <sys/types.h>
  126. #include <utmpx.h>], [struct utmpx ut; ut.ut_host;],
  127. AC_DEFINE(HAVE_UTMPX_H)
  128. AC_DEFINE(HAVE_UT_HOST)) ;;
  129. esac
  130.  
  131. AC_COMPILE_CHECK(POSIX termios,
  132. [#include <sys/types.h>
  133. #include <unistd.h>
  134. #include <termios.h>],
  135. [/* SunOS 4.0.3 has termios.h but not the library calls.  */
  136. tcgetattr(0, 0);], have_termios=1)
  137. if test -n "$have_termios"; then
  138. PROGS="$PROGS stty" MAN="$MAN stty.1"
  139. AC_COMPILE_CHECK(c_line in struct termios,
  140. [#include <sys/types.h>
  141. #include <termios.h>], [struct termios t; t.c_line;], AC_DEFINE(HAVE_C_LINE))
  142. AC_COMPILE_CHECK(TIOCGWINSZ in termios.h,
  143. [#include <sys/types.h>
  144. #include <termios.h>], [int x = TIOCGWINSZ;], have_tiocgwinsz=1)
  145. fi
  146.  
  147. if test -z "$have_tiocgwinsz"; then
  148. AC_COMPILE_CHECK(TIOCGWINSZ in sys/ioctl.h,
  149. [#include <sys/types.h>
  150. #include <sys/ioctl.h>], [int x = TIOCGWINSZ;],
  151. AC_DEFINE(GWINSZ_IN_SYS_IOCTL))
  152. AC_HEADER_CHECK([sys/ptem.h], have_ptem=1
  153. AC_DEFINE(WINSIZE_IN_PTEM))
  154. fi
  155.  
  156. AC_VPRINTF
  157. AC_ALLOCA
  158. AC_STRUCT_TM
  159. AC_TIME_WITH_SYS_TIME
  160. AC_TIMEZONE
  161. AC_XENIX_DIR
  162. AC_IRIX_SUN
  163. AC_STAT_MACROS_BROKEN
  164.  
  165. # Needed on SysV for shadow passwords.
  166. AC_HAVE_LIBRARY(sec)
  167.  
  168. # Needed on Linux for shadow passwords.
  169. AC_HAVE_LIBRARY(shadow)
  170.  
  171. # SCO-ODT-3.0 is reported to need this library for crypt.  
  172. AC_HAVE_LIBRARY(ufc)
  173.  
  174. AC_OUTPUT(Makefile lib/Makefile src/Makefile man/Makefile, [
  175. # Makefile uses this timestamp file to record whether config.h is up to date.
  176. touch stamp-config])
  177.