@@ -12,34 +12,39 @@ if test "$PHP_XPASS" != "no"; then
12
12
PHP_EVAL_LIBLINE([ $LIBXCRYPT_LIBS] , [ XPASS_SHARED_LIBADD] )
13
13
14
14
old_CFLAGS=$CFLAGS; CFLAGS="$CFLAGS $LIBXCRYPT_CFLAGS"
15
- old_LIBS="$LIBS"; LIBS="$LIBXCRYPT_LIBS"
15
+ old_LDFLAGS=$LDFLAGS; LDFLAGS="$LIBXCRYPT_LIBS $LDFLAGS"
16
+ old_LIBS=$LIBS; LIBS="$LIBS $LIBXCRYPT_LIBS"
16
17
17
18
AC_MSG_CHECKING ( [ for yescrypt] )
18
- AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ [
19
- #include <crypt.h>
20
- #include <string.h>
21
- ] ] , [ [
22
- struct crypt_data data;
23
- memset(&data, 0, sizeof(data));
24
- char *result = crypt_r("password", "$y$", &data);
25
- return (result != NULL && strncmp(result, "$y$", 3) == 0) ? 0 : 1;
26
- ] ] ) ] , [
27
- AC_MSG_RESULT ( [ available] )
28
- AC_DEFINE ( [ HAVE_CRYPT_YESCRYPT] , [ 1] , [ Have yescrypt hash support ] )
19
+ AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [ [
20
+ #include <string.h>
21
+ #include <unistd.h>
22
+ #include <crypt.h>
23
+ #include <stdlib.h>
24
+
25
+ int main(void) {
26
+ char salt[ 8] ;
27
+ salt[ 0] ='$'; salt[ 1] ='y'; salt[ 2] ='$'; salt[ 3] =0;
28
+ return crypt_gensalt(salt, 0, NULL, 0) ? 0 : 1;
29
+ }] ] ) ] ,[
30
+ AC_DEFINE ( [ HAVE_CRYPT_YESCRYPT] , [ 1] , [ Have yescrypt hash support ] )
31
+ AC_MSG_RESULT ( [ available] )
29
32
] , [
30
- AC_MSG_RESULT ( [ missing] )
33
+ AC_MSG_RESULT ( [ missing] )
31
34
] )
32
35
33
36
AC_MSG_CHECKING ( [ for sha512 algo] )
34
- AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ [
35
- #include <crypt.h>
36
- #include <string.h>
37
- ] ] , [ [
38
- struct crypt_data data;
39
- memset(&data, 0, sizeof(data));
40
- char *result = crypt_r("password", "$6 $salt", &data);
41
- return (result != NULL && strncmp(result, "$6 $", 3) == 0) ? 0 : 1;
42
- ] ] ) ] ,[
37
+ AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [ [
38
+ #include <string.h>
39
+ #include <unistd.h>
40
+ #include <crypt.h>
41
+ #include <stdlib.h>
42
+
43
+ int main(void) {
44
+ char salt[ 8] ;
45
+ salt[ 0] ='$'; salt[ 1] ='6'; salt[ 2] ='$'; salt[ 3] =0;
46
+ return crypt_gensalt(salt, 0, NULL, 0) ? 0 : 1;
47
+ }] ] ) ] ,[
43
48
AC_DEFINE ( [ HAVE_CRYPT_SHA512] , [ 1] , [ Have sha512 hash support ] )
44
49
AC_MSG_RESULT ( [ available] )
45
50
] , [
@@ -48,6 +53,7 @@ if test "$PHP_XPASS" != "no"; then
48
53
49
54
CFLAGS=$old_CFLAGS
50
55
LDFLAGS=$old_LDFLAGS
56
+ LIBS=$old_LIBS
51
57
52
58
PHP_SUBST([ XPASS_SHARED_LIBADD] )
53
59
0 commit comments