configure.in
上传用户:s81996212
上传日期:2007-01-04
资源大小:722k
文件大小:3k
源码类别:

WEB邮件程序

开发平台:

C/C++

  1. dnl Process this file with autoconf to produce a configure script.
  2. dnl
  3. dnl $Id: configure.in,v 1.10 1999/12/27 02:51:51 mrsam Exp $
  4. dnl
  5. dnl Copyright 1998 - 1999 Double Precision, Inc.  See COPYING for
  6. dnl distribution information.
  7. AC_INIT(userdb.c)
  8. AM_INIT_AUTOMAKE(libuserdb, 0.10)
  9. AM_CONFIG_HEADER(config.h)
  10. dnl Checks for programs.
  11. AC_PROG_AWK
  12. AC_PROG_CC
  13. AC_PROG_INSTALL
  14. AC_PROG_LN_S
  15. AC_PROG_RANLIB
  16. AC_PATH_PROGS(PERL, perl5 perl, perl)
  17. if test "$PERL" = "perl"
  18. then
  19. AC_MSG_ERROR(Perl not found.)
  20. fi
  21. if test "$GCC" = "yes"
  22. then
  23. CFLAGS="$CFLAGS -Wall"
  24. fi
  25. CFLAGS="$CFLAGS -I.. -I${srcdir}/.."
  26. dnl Checks for libraries.
  27. AC_ARG_WITH(userdb, [ ], userdb="$withval", userdb="/etc/userdb")
  28. AC_SUBST(userdb)
  29. AC_ARG_WITH(userdbmandir, [ ], mandir="$withval")
  30. AC_ARG_WITH(userdbtmpdir, [ ], tmpdir="$withval", tmpdir="")
  31. changequote({,})
  32. if test "$tmpdir" = ""
  33. then
  34. tmpdir=`echo "$userdb" | sed 's//[^/]*$//'`
  35. fi
  36. changequote([,])
  37. AC_SUBST(userdbtmpdir)
  38. AC_SUBST(tmpdir)
  39. AC_ARG_WITH(makedatprog, [ ], makedat="$withval", makedat="$bindir/makedat")
  40. AC_SUBST(makedat)
  41. if test -d ${srcdir}/../md5
  42. then
  43. AC_DEFINE_UNQUOTED(HAVE_MD5,1)
  44. MD5LIB=../md5/libmd5.a
  45. else
  46. MD5LIB=""
  47. fi
  48. AC_SUBST(MD5LIB)
  49. if test -d ${srcdir}/../sha1
  50. then
  51. SHA1LIB=../sha1/libsha1.a
  52. else
  53. SHA1LIB=""
  54. fi
  55. AC_SUBST(SHA1LIB)
  56. if test -d ${srcdir}/../libhmac
  57. then
  58. AC_DEFINE_UNQUOTED(HAVE_HMAC,1)
  59. HMACLIB=../libhmac/libhmac.a
  60. else
  61. HMACLIB=""
  62. fi
  63. AC_SUBST(HMACLIB)
  64. dnl Checks for header files.
  65. AC_HEADER_STDC
  66. AC_CHECK_HEADERS(sys/stat.h sys/time.h unistd.h fcntl.h termios.h crypt.h)
  67. AC_HEADER_TIME
  68. dnl Checks for typedefs, structures, and compiler characteristics.
  69. AC_C_CONST
  70. AC_PID_T
  71. AC_TYPE_UID_T
  72. AC_TYPE_SIGNAL
  73. dnl Other checks
  74. AC_CHECK_LIB(crypt, crypt, CRYPTLIBS="-lcrypt")
  75. saveLIBS="$LIBS"
  76. LIBS="$CRYPTLIBS $LIBS"
  77. AC_CHECK_FUNC(crypt, AC_DEFINE_UNQUOTED(HAVE_CRYPT,1))
  78. LIBS="$saveLIBS"
  79. AC_CACHE_CHECK([for crypt() prototype],userdb_cv_NEED_CRYPT_PROTOTYPE,
  80. AC_TRY_COMPILE( [
  81.        #if HAVE_CRYPT_H
  82.        #include <crypt.h>
  83.        #endif
  84.        #if HAVE_UNISTD_H
  85.        #include <unistd.h>
  86.        #endif
  87.        int crypt(int, int);
  88. ], [], userdb_cv_NEED_CRYPT_PROTOTYPE=1,
  89. userdb_cv_NEED_CRYPT_PROTOTYPE=0 )
  90. )
  91. AC_DEFINE_UNQUOTED(NEED_CRYPT_PROTOTYPE, $userdb_cv_NEED_CRYPT_PROTOTYPE)
  92. AC_SUBST(CRYPTLIBS)
  93. AC_CHECK_FUNCS(isatty gettimeofday)
  94. AC_ARG_WITH(random, [ --with-random=/dev/urandom - location of the system random file generator
  95. --without-random            - there is no system random file generator ],
  96. random="$enableval",
  97. random="y")
  98. case "$random" in
  99. /*)
  100. ;;
  101. y*|1*)
  102. AC_CACHE_CHECK([for random source],userdb_cv_RANDOM,
  103. if test -c /dev/urandom
  104. then
  105. userdb_cv_RANDOM=/dev/urandom
  106. else
  107. if test -c /dev/random
  108. then
  109. userdb_cv_RANDOM=/dev/random
  110. else
  111. userdb_cv_RANDOM="none"
  112. fi
  113. fi
  114. )
  115. random="$userdb_cv_RANDOM"
  116. ;;
  117. *)
  118. random="none"
  119. ;;
  120. esac
  121. if test "$random" != "none"
  122. then
  123. AC_DEFINE_UNQUOTED(RANDOM, "$userdb_cv_RANDOM")
  124. fi
  125. AC_OUTPUT(Makefile html2man.pl userdb.pl makeuserdb.html userdb.html userdbpw.html makeuserdb pw2userdb vchkpw2userdb)