Skip to content

Autotools: Check for crypt and crypt_r with AC_* macros #15060

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions UPGRADING.INTERNALS
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ PHP 8.4 INTERNALS UPGRADE NOTES
- Symbol HAVE_PHPDBG has been removed.
- Symbols PHP_HAVE_AVX512_SUPPORTS and PHP_HAVE_AVX512_VBMI_SUPPORTS are now
either defined to 1 or undefined.
- Symbol HAVE_LIBCRYPT has been removed.
- M4 macro PHP_DEFINE (atomic includes) removed (use AC_DEFINE and config.h).
- M4 macro PHP_WITH_SHARED has been removed (use PHP_ARG_WITH).
- M4 macro PHP_STRUCT_FLOCK has been removed (use AC_CHECK_TYPES).
Expand Down
20 changes: 12 additions & 8 deletions ext/standard/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,18 @@ AS_VAR_IF([PHP_EXTERNAL_LIBCRYPT], [no], [
PHP_ADD_SOURCES([PHP_EXT_DIR([standard])],
[crypt_freesec.c crypt_blowfish.c crypt_sha512.c crypt_sha256.c php_crypt_r.c])
], [
PHP_CHECK_FUNC(crypt, crypt)
PHP_CHECK_FUNC(crypt_r, crypt)
AC_CHECK_HEADERS([crypt.h])
AS_VAR_IF([ac_cv_func_crypt], [yes],,
[AC_MSG_ERROR([Cannot use external libcrypt as crypt() is missing.])])
AS_VAR_IF([ac_cv_func_crypt_r], [yes],
[PHP_CRYPT_R_STYLE],
[AC_MSG_ERROR([Cannot use external libcrypt as crypt_r() is missing.])])
AC_SEARCH_LIBS([crypt], [crypt],
[AC_DEFINE([HAVE_CRYPT], [1],
[Define to 1 if you have the 'crypt' function.])],
[AC_MSG_ERROR([Cannot use external libcrypt as crypt() is missing.])])

AC_SEARCH_LIBS([crypt_r], [crypt],
[AC_DEFINE([HAVE_CRYPT_R], [1],
[Define to 1 if you have the 'crypt_r' function.])],
[AC_MSG_ERROR([Cannot use external libcrypt as crypt_r() is missing.])])

PHP_CRYPT_R_STYLE
AC_CHECK_HEADERS([crypt.h])

AC_CACHE_CHECK(for standard DES crypt, ac_cv_crypt_des,[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
Expand Down
Loading