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