PageRenderTime 24ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/configure.in

https://github.com/dtjm/pam_sqlite3
Autoconf | 279 lines | 191 code | 32 blank | 56 comment | 10 complexity | 11b2df4a2dbd7ec4e6e64c48a69305fa MD5 | raw file
Possible License(s): GPL-3.0
  1. dnl Configure template for pam_sqlite3
  2. dnl $Id: configure.in,v 1.7 2003/06/22 22:59:45 ek Exp $
  3. AC_INIT(pam_get_pass.c)
  4. AC_CONFIG_HEADER(config.h)
  5. dnl Checks for libraries.
  6. AC_CHECK_LIB(pam, pam_get_user)
  7. dnl Checks for header files.
  8. AC_CANONICAL_HOST
  9. AC_HEADER_STDC
  10. dnl check system headers
  11. AC_CHECK_HEADERS([crypt.h syslog.h unistd.h sys/types.h])
  12. dnl Check for library functions
  13. AC_CHECK_FUNCS([crypt])
  14. dnl
  15. dnl Check for crypt() capabilities
  16. dnl
  17. AC_DEFUN(AC_CRYPT_CAP,[
  18. if test "$ac_cv_func_crypt" = "no"; then
  19. AC_CHECK_LIB(crypt, crypt, [
  20. LIBS="-lcrypt $LIBS -lcrypt"
  21. AC_DEFINE(HAVE_CRYPT, 1, [ ])
  22. ])
  23. fi
  24. AC_CACHE_CHECK(for standard DES crypt, ac_cv_crypt_des,[
  25. AC_TRY_RUN([
  26. #if HAVE_CRYPT_H
  27. #include <crypt.h>
  28. #endif
  29. main() {
  30. #if HAVE_CRYPT
  31. exit (strcmp((char *)crypt("rasmuslerdorf","rl"),"rl.3StKT.4T8M"));
  32. #else
  33. exit(0);
  34. #endif
  35. }],[
  36. ac_cv_crypt_des=yes
  37. ],[
  38. ac_cv_crypt_des=no
  39. ],[
  40. ac_cv_crypt_des=yes
  41. ])
  42. ])
  43. if test "$ac_cv_crypt_des" = "yes"; then
  44. ac_result=1
  45. else
  46. ac_result=0
  47. fi
  48. AC_DEFINE_UNQUOTED(HAVE_STD_DES_CRYPT, $ac_result, [Whether the system supports standard DES salt])
  49. AC_CACHE_CHECK(for extended DES crypt, ac_cv_crypt_ext_des,[
  50. AC_TRY_RUN([
  51. #if HAVE_CRYPT_H
  52. #include <crypt.h>
  53. #endif
  54. main() {
  55. #if HAVE_CRYPT
  56. exit (strcmp((char *)crypt("rasmuslerdorf","_J9..rasm"),"_J9..rasmBYk8r9AiWNc"));
  57. #else
  58. exit(0);
  59. #endif
  60. }],[
  61. ac_cv_crypt_ext_des=yes
  62. ],[
  63. ac_cv_crypt_ext_des=no
  64. ],[
  65. ac_cv_crypt_ext_des=no
  66. ])
  67. ])
  68. if test "$ac_cv_crypt_ext_des" = "yes"; then
  69. ac_result=1
  70. else
  71. ac_result=0
  72. fi
  73. AC_DEFINE_UNQUOTED(HAVE_EXT_DES_CRYPT, $ac_result, [Whether the system supports extended DES salt])
  74. AC_CACHE_CHECK(for MD5 crypt, ac_cv_crypt_md5,[
  75. AC_TRY_RUN([
  76. #if HAVE_CRYPT_H
  77. #include <crypt.h>
  78. #endif
  79. main() {
  80. #if HAVE_CRYPT
  81. char salt[15], answer[40];
  82. salt[0]='$'; salt[1]='1'; salt[2]='$';
  83. salt[3]='r'; salt[4]='a'; salt[5]='s';
  84. salt[6]='m'; salt[7]='u'; salt[8]='s';
  85. salt[9]='l'; salt[10]='e'; salt[11]='$';
  86. salt[12]='\0';
  87. strcpy(answer,salt);
  88. strcat(answer,"rISCgZzpwk3UhDidwXvin0");
  89. exit (strcmp((char *)crypt("rasmuslerdorf",salt),answer));
  90. #else
  91. exit(0);
  92. #endif
  93. }],[
  94. ac_cv_crypt_md5=yes
  95. ],[
  96. ac_cv_crypt_md5=no
  97. ],[
  98. ac_cv_crypt_md5=no
  99. ])
  100. ])
  101. if test "$ac_cv_crypt_md5" = "yes"; then
  102. ac_result=1
  103. else
  104. dnl if test "$ac_cv_crypt_des" != "yes"; then
  105. dnl PHP_DEBUG_MACRO(debug.log)
  106. dnl fi
  107. ac_result=0
  108. fi
  109. AC_DEFINE_UNQUOTED(HAVE_MD5_CRYPT, $ac_result, [Whether the system supports MD5 salt])
  110. AC_CACHE_CHECK(for Blowfish crypt, ac_cv_crypt_blowfish,[
  111. AC_TRY_RUN([
  112. #if HAVE_CRYPT_H
  113. #include <crypt.h>
  114. #endif
  115. main() {
  116. #if HAVE_CRYPT
  117. char salt[30], answer[70];
  118. salt[0]='$'; salt[1]='2'; salt[2]='a'; salt[3]='$'; salt[4]='0'; salt[5]='7'; salt[6]='$'; salt[7]='\0';
  119. strcat(salt,"rasmuslerd............");
  120. strcpy(answer,salt);
  121. strcpy(&answer[29],"nIdrcHdxcUxWomQX9j6kvERCFjTg7Ra");
  122. exit (strcmp((char *)crypt("rasmuslerdorf",salt),answer));
  123. #else
  124. exit(0);
  125. #endif
  126. }],[
  127. ac_cv_crypt_blowfish=yes
  128. ],[
  129. ac_cv_crypt_blowfish=no
  130. ],[
  131. ac_cv_crypt_blowfish=no
  132. ])
  133. ])
  134. if test "$ac_cv_crypt_blowfish" = "yes"; then
  135. ac_result=1
  136. else
  137. ac_result=0
  138. fi
  139. AC_DEFINE_UNQUOTED(HAVE_BLOWFISH_CRYPT, $ac_result, [Whether the system supports BlowFish salt])
  140. AC_CACHE_CHECK(for SHA-256 crypt, ac_cv_crypt_sha256,[
  141. AC_TRY_RUN([
  142. #if HAVE_CRYPT_H
  143. #include <crypt.h>
  144. #endif
  145. main() {
  146. #if HAVE_CRYPT
  147. char salt[15], answer[56];
  148. salt[0]='$'; salt[1]='5'; salt[2]='$';
  149. salt[3]='r'; salt[4]='a'; salt[5]='s';
  150. salt[6]='m'; salt[7]='u'; salt[8]='s';
  151. salt[9]='l'; salt[10]='e'; salt[11]='$';
  152. salt[12]='\0';
  153. strcpy(answer,salt);
  154. strcat(answer,"zT/mnnwZ08rpjUkGny1q7nyMdeK9jsZ2n191fLovz64");
  155. exit (strcmp((char *)crypt("rasmuslerdorf",salt),answer));
  156. #else
  157. exit(0);
  158. #endif
  159. }],[
  160. ac_cv_crypt_sha256=yes
  161. ],[
  162. ac_cv_crypt_sha256=no
  163. ],[
  164. ac_cv_crypt_sha256=no
  165. ])
  166. ])
  167. if test "$ac_cv_crypt_sha256" = "yes"; then
  168. ac_result=1
  169. else
  170. dnl if test "$ac_cv_crypt_des" != "yes"; then
  171. dnl PHP_DEBUG_MACRO(debug.log)
  172. dnl fi
  173. ac_result=0
  174. fi
  175. AC_DEFINE_UNQUOTED(HAVE_SHA256_CRYPT, $ac_result, [Whether the system supports SHA256 salt])
  176. AC_CACHE_CHECK(for SHA-512 crypt, ac_cv_crypt_sha512,[
  177. AC_TRY_RUN([
  178. #if HAVE_CRYPT_H
  179. #include <crypt.h>
  180. #endif
  181. main() {
  182. #if HAVE_CRYPT
  183. char salt[15], answer[100];
  184. salt[0]='$'; salt[1]='6'; salt[2]='$';
  185. salt[3]='r'; salt[4]='a'; salt[5]='s';
  186. salt[6]='m'; salt[7]='u'; salt[8]='s';
  187. salt[9]='l'; salt[10]='e'; salt[11]='$';
  188. salt[12]='\0';
  189. strcpy(answer,salt);
  190. strcat(answer,"ZRs4F6hXxPTFC/fISAvfOHHPgJRnuvYLVtveKEpuDxOja47nB.HHTYRj9MMn4AL0UVzzFPnkYkdA2wSEcV/if.");
  191. exit (strcmp((char *)crypt("rasmuslerdorf",salt),answer));
  192. #else
  193. exit(0);
  194. #endif
  195. }],[
  196. ac_cv_crypt_sha512=yes
  197. ],[
  198. ac_cv_crypt_sha512=no
  199. ],[
  200. ac_cv_crypt_sha512=no
  201. ])
  202. ])
  203. if test "$ac_cv_crypt_sha512" = "yes"; then
  204. ac_result=1
  205. else
  206. dnl if test "$ac_cv_crypt_des" != "yes"; then
  207. dnl PHP_DEBUG_MACRO(debug.log)
  208. dnl fi
  209. ac_result=0
  210. fi
  211. AC_DEFINE_UNQUOTED(HAVE_SHA512_CRYPT, $ac_result, [Whether the system supports SHA512 salt])
  212. ])
  213. AC_CRYPT_CAP
  214. AC_MSG_CHECKING(for SQLite headers)
  215. for d in /usr/local /usr ; do
  216. test -f $d/include/sqlite3.h && {
  217. AC_SUBST(SQLITE_INC)
  218. SQLITE_INC="-I$d/include"
  219. SQLITE_DIR="$d"
  220. AC_MSG_RESULT(found in $d/include)
  221. }
  222. done
  223. old_LDFLAGS="$LDFLAGS"
  224. LDFLAGS="$LDFLAGS -L$SQLITE_DIR/lib"
  225. AC_CHECK_LIB(sqlite3, sqlite3_open,
  226. [LIBS="$LIBS -lsqlite3"
  227. SQLITE_LIB=-L$SQLITE_DIR/lib
  228. ],
  229. [AC_MSG_ERROR(could not determine SQLite library location)])
  230. LDFLAGS="$old_LDFLAGS"
  231. if test "`uname`" = "Linux" >/dev/null 2>/dev/null; then
  232. # Debian needs this
  233. LIBS="$LIBS -lpam_misc"
  234. fi
  235. AC_MSG_CHECKING(for debug build)
  236. AC_ARG_ENABLE(debug,
  237. [ --enable-debug Enable debugging routines],
  238. [AC_MSG_RESULT(yes)
  239. AC_DEFINE(DEBUG)
  240. CFLAGS="-g -DDEBUG $CFLAGS"],
  241. [AC_MSG_RESULT(no); DEBUG=""; DEBUG_LIB=""])
  242. AC_SUBST(LIBS)
  243. AC_SUBST(SQLITE_LIB)
  244. dnl Checks for typedefs, structures, and compiler characteristics.
  245. AC_C_CONST
  246. AC_SUBST(host_os)
  247. AC_OUTPUT(Makefile)