forked from HormyAJP/pam_sqlite3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
200 lines (175 loc) · 4.32 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
dnl Configure template for pam_sqlite3
dnl $Id: configure.in,v 1.7 2003/06/22 22:59:45 ek Exp $
AC_INIT(pam_get_pass.c)
AC_CONFIG_HEADER(config.h)
dnl Checks for libraries.
AC_CHECK_LIB(pam, pam_get_user)
dnl Checks for header files.
AC_CANONICAL_HOST
AC_HEADER_STDC
dnl check system headers
AC_CHECK_HEADERS([crypt.h syslog.h unistd.h sys/types.h])
dnl Check for library functions
AC_CHECK_FUNCS([crypt])
dnl
dnl Check for crypt() capabilities
dnl
AC_DEFUN(AC_CRYPT_CAP,[
if test "$ac_cv_func_crypt" = "no"; then
AC_CHECK_LIB(crypt, crypt, [
LIBS="-lcrypt $LIBS -lcrypt"
AC_DEFINE(HAVE_CRYPT, 1, [ ])
])
fi
AC_CACHE_CHECK(for standard DES crypt, ac_cv_crypt_des,[
AC_TRY_RUN([
#if HAVE_CRYPT_H
#include <crypt.h>
#endif
main() {
#if HAVE_CRYPT
exit (strcmp((char *)crypt("rasmuslerdorf","rl"),"rl.3StKT.4T8M"));
#else
exit(0);
#endif
}],[
ac_cv_crypt_des=yes
],[
ac_cv_crypt_des=no
],[
ac_cv_crypt_des=yes
])
])
if test "$ac_cv_crypt_des" = "yes"; then
ac_result=1
else
ac_result=0
fi
AC_DEFINE_UNQUOTED(HAVE_STD_DES_CRYPT, $ac_result, [Whether the system supports standard DES salt])
AC_CACHE_CHECK(for extended DES crypt, ac_cv_crypt_ext_des,[
AC_TRY_RUN([
#if HAVE_CRYPT_H
#include <crypt.h>
#endif
main() {
#if HAVE_CRYPT
exit (strcmp((char *)crypt("rasmuslerdorf","_J9..rasm"),"_J9..rasmBYk8r9AiWNc"));
#else
exit(0);
#endif
}],[
ac_cv_crypt_ext_des=yes
],[
ac_cv_crypt_ext_des=no
],[
ac_cv_crypt_ext_des=no
])
])
if test "$ac_cv_crypt_ext_des" = "yes"; then
ac_result=1
else
ac_result=0
fi
AC_DEFINE_UNQUOTED(HAVE_EXT_DES_CRYPT, $ac_result, [Whether the system supports extended DES salt])
AC_CACHE_CHECK(for MD5 crypt, ac_cv_crypt_md5,[
AC_TRY_RUN([
#if HAVE_CRYPT_H
#include <crypt.h>
#endif
main() {
#if HAVE_CRYPT
char salt[15], answer[40];
salt[0]='$'; salt[1]='1'; salt[2]='$';
salt[3]='r'; salt[4]='a'; salt[5]='s';
salt[6]='m'; salt[7]='u'; salt[8]='s';
salt[9]='l'; salt[10]='e'; salt[11]='$';
salt[12]='\0';
strcpy(answer,salt);
strcat(answer,"rISCgZzpwk3UhDidwXvin0");
exit (strcmp((char *)crypt("rasmuslerdorf",salt),answer));
#else
exit(0);
#endif
}],[
ac_cv_crypt_md5=yes
],[
ac_cv_crypt_md5=no
],[
ac_cv_crypt_md5=no
])
])
if test "$ac_cv_crypt_md5" = "yes"; then
ac_result=1
else
dnl if test "$ac_cv_crypt_des" != "yes"; then
dnl PHP_DEBUG_MACRO(debug.log)
dnl fi
ac_result=0
fi
AC_DEFINE_UNQUOTED(HAVE_MD5_CRYPT, $ac_result, [Whether the system supports MD5 salt])
AC_CACHE_CHECK(for Blowfish crypt, ac_cv_crypt_blowfish,[
AC_TRY_RUN([
#if HAVE_CRYPT_H
#include <crypt.h>
#endif
main() {
#if HAVE_CRYPT
char salt[30], answer[70];
salt[0]='$'; salt[1]='2'; salt[2]='a'; salt[3]='$'; salt[4]='0'; salt[5]='7'; salt[6]='$'; salt[7]='\0';
strcat(salt,"rasmuslerd............");
strcpy(answer,salt);
strcpy(&answer[29],"nIdrcHdxcUxWomQX9j6kvERCFjTg7Ra");
exit (strcmp((char *)crypt("rasmuslerdorf",salt),answer));
#else
exit(0);
#endif
}],[
ac_cv_crypt_blowfish=yes
],[
ac_cv_crypt_blowfish=no
],[
ac_cv_crypt_blowfish=no
])
])
if test "$ac_cv_crypt_blowfish" = "yes"; then
ac_result=1
else
ac_result=0
fi
AC_DEFINE_UNQUOTED(HAVE_BLOWFISH_CRYPT, $ac_result, [Whether the system supports BlowFish salt])
])
AC_CRYPT_CAP
AC_MSG_CHECKING(for SQLite headers)
for d in /usr/local /usr ; do
test -f $d/include/sqlite3.h && {
AC_SUBST(SQLITE_INC)
SQLITE_INC="-I$d/include"
SQLITE_DIR="$d"
AC_MSG_RESULT(found in $d/include)
}
done
old_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -L$SQLITE_DIR/lib"
AC_CHECK_LIB(sqlite3, sqlite3_open,
[LIBS="$LIBS -lsqlite3"
SQLITE_LIB=-L$SQLITE_DIR/lib
],
[AC_MSG_ERROR(could not determine SQLite library location)])
LDFLAGS="$old_LDFLAGS"
if test "`uname`" = "Linux" >/dev/null 2>/dev/null; then
# Debian needs this
LIBS="$LIBS -lpam_misc"
fi
AC_MSG_CHECKING(for debug build)
AC_ARG_ENABLE(debug,
[ --enable-debug Enable debugging routines],
[AC_MSG_RESULT(yes)
AC_DEFINE(DEBUG)
CFLAGS="-g -DDEBUG $CFLAGS"],
[AC_MSG_RESULT(no); DEBUG=""; DEBUG_LIB=""])
AC_SUBST(LIBS)
AC_SUBST(SQLITE_LIB)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_SUBST(host_os)
AC_OUTPUT(Makefile)