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

  1. dnl configure.in for cvs
  2. dnl "$CVSid$"
  3. AC_INIT(src/cvs.h)
  4. AC_PREREQ(2.4)dnl Required Autoconf version.
  5. AC_CONFIG_HEADER(config.h src/options.h)
  6.  
  7. AC_PROG_CC
  8.  
  9. AC_AIX
  10. AC_MINIX
  11. AC_ISC_POSIX
  12. if test "$ISC" = yes; then
  13. CFLAGS="$CFLAGS -D_SYSV3"
  14. fi
  15.  
  16. AC_PREFIX_PROGRAM(cvs)
  17.  
  18. AC_C_CROSS
  19.  
  20. AC_C_CONST
  21.  
  22. AC_PROG_INSTALL
  23. AC_CHECK_TOOL(RANLIB, ranlib, :)
  24. AC_CHECK_TOOL(AR, ar)
  25. AC_PROG_YACC
  26. AC_PROG_MAKE_SET
  27.  
  28. AC_PATH_PROG(perl_path, perl, no)
  29. AC_PATH_PROG(csh_path, csh, no)
  30.  
  31. AC_SYS_INTERPRETER
  32. if test X"$ac_cv_sys_interpreter" != X"yes" ; then
  33.   # silly trick to avoid problems in AC macros...
  34.   ac_msg='perl scripts using #! may not be invoked properly'
  35.   AC_MSG_WARN($ac_msg)
  36. fi
  37.  
  38. AC_HEADER_STDC
  39. AC_CHECK_HEADERS(errno.h unistd.h string.h memory.h utime.h fcntl.h ndbm.h \
  40.                  sys/param.h sys/select.h sys/time.h sys/timeb.h \
  41.                  io.h direct.h sys/bsdtypes.h sys/resource.h)
  42. AC_HEADER_SYS_WAIT
  43. AC_HEADER_STAT
  44. AC_HEADER_TIME
  45. AC_HEADER_DIRENT
  46. AC_TYPE_SIGNAL
  47. AC_TYPE_UID_T
  48. AC_TYPE_MODE_T
  49. AC_TYPE_SIZE_T
  50. AC_TYPE_PID_T
  51. AC_REPLACE_FUNCS(getwd mkdir rename strdup strstr dup2 strerror valloc waitpid vasprintf strtoul)
  52. AC_CHECK_FUNCS(fchmod fsync ftime mkfifo putenv setvbuf vfork vprintf ftruncate timezone getpagesize initgroups fchdir sigaction sigprocmask sigvec sigsetmask sigblock getspnam readlink)
  53. AC_CHECK_FUNC(re_exec, :, LIBOBJS="$LIBOBJS regex.o")
  54. AC_FUNC_UTIME_NULL
  55. AC_SYS_LONG_FILE_NAMES
  56.  
  57. AC_MSG_CHECKING([for working fnmatch function])
  58. AC_CACHE_VAL(ccvs_cv_sys_working_fnmatch,
  59. [AC_TRY_RUN([
  60. #include <fnmatch.h>
  61. int
  62. main ()
  63. {
  64.   exit ((fnmatch ("a", "a", FNM_PATHNAME) == 0
  65.      && fnmatch ("a", "b", FNM_PATHNAME) == FNM_NOMATCH)
  66.     ? 0 : 1);
  67. }],
  68. ccvs_cv_sys_working_fnmatch=yes,
  69. ccvs_cv_sys_working_fnmatch=no,
  70. ccvs_cv_sys_working_fnmatch=no)])
  71. if test $ccvs_cv_sys_working_fnmatch = no; then
  72.   LIBOBJS="$LIBOBJS fnmatch.o"
  73. fi
  74. AC_MSG_RESULT($ccvs_cv_sys_working_fnmatch)
  75.  
  76. dnl
  77. dnl set $(KRB4) from --with-krb4=value -- WITH_KRB4
  78. dnl
  79. KRB4=/usr/kerberos
  80. define(WITH_KRB4,[
  81. AC_ARG_WITH([krb4],
  82.   [  --with-krb4=value       set default \$(KRB4) from value],
  83.   [KRB4=$withval],
  84. )dnl
  85. echo "default place for krb4 is $KRB4"
  86. AC_SUBST(KRB4)])dnl
  87. WITH_KRB4
  88.  
  89. AC_CHECK_SIZEOF(long)
  90. AC_CHECK_SIZEOF(int)
  91.  
  92. krb_h=
  93. AC_MSG_CHECKING([for krb.h])
  94. AC_TRY_LINK([#include <krb.h>],[int i;],
  95.   [krb_h=yes krb_incdir=],
  96.   [if test "$cross_compiling" != yes && test -r $KRB4/include/krb.h; then
  97.      hold_cflags=$CFLAGS
  98.      CFLAGS="$CFLAGS -I$KRB4/include"
  99.      AC_TRY_LINK([#include <krb.h>],[int i;],
  100.        [krb_h=yes krb_incdir=$KRB4/include])
  101.      CFLAGS=$hold_cflags
  102.    fi])
  103. if test -z "$krb_h"; then
  104.   AC_TRY_LINK([#include <krb.h>],[int i;],
  105.     [krb_h=yes krb_incdir=],
  106.     [if test "$cross_compiling" != yes && test -r $KRB4/include/kerberosIV/krb.h; then
  107.        hold_cflags=$CFLAGS
  108.        CFLAGS="$CFLAGS -I$KRB4/include/kerberosIV"
  109.        AC_TRY_LINK([#include <krb.h>],[int i;],
  110.      [krb_h=yes krb_incdir=$KRB4/include/kerberosIV])
  111.        CFLAGS=$hold_cflags
  112.      fi])
  113. fi
  114. AC_MSG_RESULT($krb_h)
  115.  
  116. if test -n "$krb_h"; then
  117.   krb_lib=
  118.   AC_CHECK_LIB(krb,printf,[krb_lib=yes krb_libdir=],
  119.     [if test "$cross_compiling" != yes && test -r $KRB4/lib/libkrb.a; then
  120.        krb_lib=yes krb_libdir=$KRB4/lib
  121.      fi])
  122.   if test -n "$krb_lib"; then
  123.     AC_DEFINE(HAVE_KERBEROS)
  124.     test -n "${krb_libdir}" && LIBS="${LIBS} -L${krb_libdir}"
  125.     LIBS="${LIBS} -lkrb"
  126.     # Put -L${krb_libdir} in LDFLAGS temporarily so that it appears before
  127.     # -ldes in the command line.  Don't do it permanently so that we honor
  128.     # the user's setting for LDFLAGS
  129.     hold_ldflags=$LDFLAGS
  130.     test -n "${krb_libdir}" && LDFLAGS="$LDFLAGS -L${krb_libdir}"
  131.     AC_CHECK_LIB(des,printf,[LIBS="${LIBS} -ldes"])
  132.     LDFLAGS=$hold_ldflags
  133.     if test -n "$krb_incdir"; then
  134.       includeopt="${includeopt} -I$krb_incdir"
  135.       AC_SUBST(includeopt)
  136.     fi
  137.   fi
  138. fi
  139. AC_CHECK_FUNCS(krb_get_err_text)
  140. # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
  141. # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
  142. # libsocket.so which has a bad implementation of gethostbyname (it
  143. # only looks in /etc/hosts), so we only look for -lsocket if we need
  144. # it.
  145. unset ac_cv_func_connect
  146. AC_CHECK_FUNC(connect, :, 
  147. [case "$LIBS" in
  148. *-lnsl*) ;;
  149. *) AC_CHECK_LIB(nsl_s, printf) ;;
  150. esac
  151. case "$LIBS" in
  152. *-lnsl*) ;;
  153. *) AC_CHECK_LIB(nsl, printf) ;;
  154. esac
  155. case "$LIBS" in
  156. *-lsocket*) ;;
  157. *) AC_CHECK_LIB(socket, connect) ;;
  158. esac
  159. case "$LIBS" in
  160. *-linet*) ;;
  161. *) AC_CHECK_LIB(inet, connect) ;;
  162. esac
  163. unset ac_cv_func_connect
  164. AC_CHECK_FUNCS(connect)])
  165.  
  166. AC_CHECK_FUNC(gethostname, :, LIBOBJS="$LIBOBJS hostname.o")
  167.  
  168. # If we have connect(), we want the full client & server arrangement.
  169. if test "$ac_cv_func_connect" = yes; then
  170. AC_DEFINE(CLIENT_SUPPORT)
  171. AC_DEFINE(SERVER_SUPPORT)
  172. # Define AUTH_SERVER_SUPPORT only if we could locate the crypt() function
  173. unset ac_cv_func_crypt
  174. AC_CHECK_FUNC(crypt, :,
  175. [case "$LIBS" in
  176. *-lcrypt*) ;;
  177. *) AC_CHECK_LIB(crypt, crypt) ;;
  178. esac
  179. unset ac_cv_func_crypt
  180. AC_CHECK_FUNCS(crypt)])
  181.   if test "$ac_cv_func_crypt" = yes; then
  182.   AC_DEFINE(AUTH_SERVER_SUPPORT)
  183.   fi
  184. fi
  185.  
  186. test -f src/options.h && (
  187.   AC_MSG_WARN(saving ./src/options.h in ./src/options.h-SAVED)
  188.   AC_MSG_WARN(You may wish to check that local options have not been lost.)
  189.   AC_MSG_WARN(Do not re-run ./configure or ./config.status until you have....)
  190.   cp ./src/options.h ./src/options.h-SAVED
  191. )
  192.  
  193. AC_OUTPUT(Makefile lib/Makefile src/Makefile zlib/Makefile doc/Makefile \
  194.       man/Makefile tools/Makefile tools/pcl-cvs/Makefile \
  195.       contrib/Makefile contrib/elib/Makefile \
  196.       windows-NT/Makefile os2/Makefile macintosh/Makefile stamp-h)
  197.