Skip to content

Autotools: Replace AC_MSG_ERROR with AC_MSG_FAILURE #15209

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 3 commits into from
Aug 4, 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
4 changes: 2 additions & 2 deletions Zend/Zend.m4
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ dnl as a fallback since AC_CHECK_FUNC cannot detect macros.
dnl
AC_CHECK_FUNC([sigsetjmp],,
[AC_CHECK_DECL([sigsetjmp],,
[AC_MSG_ERROR([Required sigsetjmp not found. Please, check config.log])],
[AC_MSG_FAILURE([Required sigsetjmp not found.])],
[#include <setjmp.h>])])

ZEND_CHECK_STACK_DIRECTION
Expand Down Expand Up @@ -381,7 +381,7 @@ int main(void)
[php_cv_align_mm=failed],
[php_cv_align_mm="(size_t)8 (size_t)3 0"])])
AS_VAR_IF([php_cv_align_mm], [failed],
[AC_MSG_ERROR([ZEND_MM alignment defines failed. Please, check config.log])],
[AC_MSG_FAILURE([ZEND_MM alignment defines failed.])],
[zend_mm_alignment=$(echo $php_cv_align_mm | cut -d ' ' -f 1)
zend_mm_alignment_log2=$(echo $php_cv_align_mm | cut -d ' ' -f 2)
zend_mm_8byte_realign=$(echo $php_cv_align_mm | cut -d ' ' -f 3)
Expand Down
14 changes: 6 additions & 8 deletions build/php.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,7 @@ int main(void) {
[ac_cv_ebcdic=no],
[ac_cv_ebcdic=no])])
AS_VAR_IF([ac_cv_ebcdic], [yes],
[AC_MSG_ERROR([PHP does not support EBCDIC targets.])])
[AC_MSG_FAILURE([PHP does not support EBCDIC targets.])])
])

dnl
Expand Down Expand Up @@ -2016,13 +2016,11 @@ AS_VAR_IF([found_pgsql], [yes], [dnl
PHP_EVAL_INCLINE([$PGSQL_CFLAGS])
PHP_EVAL_LIBLINE([$PGSQL_LIBS], [$1])
dnl PostgreSQL minimum version sanity check.
PHP_CHECK_LIBRARY([pq], [PQencryptPasswordConn],, [AC_MSG_ERROR(m4_normalize([
PostgreSQL check failed: libpq 10.0 or later is required, please see
config.log for details.
]))],
PHP_CHECK_LIBRARY([pq], [PQencryptPasswordConn],,
[AC_MSG_FAILURE([PostgreSQL check failed: libpq 10.0 or later is required.])],
[$PGSQL_LIBS])
$2],
[m4_default([$3], [AC_MSG_ERROR(m4_normalize([
[m4_default([$3], [AC_MSG_FAILURE(m4_normalize([
Cannot find libpq-fe.h or pq library (libpq). Please specify the correct
PostgreSQL installation path with environment variables PGSQL_CFLAGS and
PGSQL_LIBS or provide the PostgreSQL installation directory.
Expand Down Expand Up @@ -2251,7 +2249,7 @@ AS_VAR_IF([php_cv_crypt_r_style], [struct_crypt_data_gnu_source],
[Define to 1 if struct crypt_data requires _GNU_SOURCE.])])

AS_VAR_IF([php_cv_crypt_r_style], [none],
[AC_MSG_ERROR([Unable to detect data struct used by crypt_r.])])
[AC_MSG_FAILURE([Unable to detect data struct used by crypt_r.])])
])

dnl
Expand Down Expand Up @@ -2293,7 +2291,7 @@ dnl extensions.
dnl
AC_DEFUN([PHP_INIT_DTRACE],
[AC_CHECK_HEADER([sys/sdt.h],,
[AC_MSG_ERROR([Cannot find sys/sdt.h which is required for DTrace support.])])
[AC_MSG_FAILURE([Cannot find required <sys/sdt.h> to enable DTrace support.])])

dnl Set paths properly when called from extension.
case "$4" in
Expand Down
10 changes: 5 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,8 @@ AC_CHECK_FUNCS(m4_normalize([
vasprintf
]))

AC_CHECK_FUNC([inet_ntop],,[AC_MSG_ERROR([Required inet_ntop not found.])])
AC_CHECK_FUNC([inet_pton],,[AC_MSG_ERROR([Required inet_pton not found.])])
AC_CHECK_FUNC([inet_ntop],, [AC_MSG_FAILURE([Required inet_ntop not found.])])
AC_CHECK_FUNC([inet_pton],, [AC_MSG_FAILURE([Required inet_pton not found.])])

dnl Check for strerror_r, and if its a POSIX-compatible or a GNU specific version.
AC_FUNC_STRERROR_R
Expand Down Expand Up @@ -856,7 +856,7 @@ fi

AS_VAR_IF([PHP_THREAD_SAFETY], [yes], [
AS_VAR_IF([pthreads_working], [yes], [],
[AC_MSG_ERROR(m4_normalize([
[AC_MSG_FAILURE(m4_normalize([
Unable to verify system support for POSIX Threads, which are required for
PHP thread safety (ZTS) build.
]))])
Expand Down Expand Up @@ -978,7 +978,7 @@ AS_VAR_IF([PHP_DMALLOC], [yes],
[PHP_ADD_LIBRARY([dmalloc])
AC_DEFINE([HAVE_DMALLOC], [1], [Define to 1 if you have dmalloc.])
AS_VAR_APPEND([CPPFLAGS], [" -DDMALLOC_FUNC_CHECK"])],
[AC_MSG_ERROR([Problem with enabling dmalloc. Please, check config.log for details.])])])
[AC_MSG_FAILURE([The dmalloc check failed. Cannot enable dmalloc.])])])

PHP_ARG_ENABLE([ipv6],
[whether to enable IPv6 support],
Expand Down Expand Up @@ -1312,7 +1312,7 @@ else
AC_CHECK_HEADER([ucontext.h],
[AC_DEFINE([ZEND_FIBER_UCONTEXT], [1],
[Define to 1 if Zend fiber uses ucontext instead of boost context.])],
[AC_MSG_ERROR([fibers not available on this platform])])
[AC_MSG_FAILURE([fibers not available on this platform])])
fi

ZEND_INIT
Expand Down
2 changes: 1 addition & 1 deletion ext/bz2/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if test "$PHP_BZ2" != "no"; then
AC_DEFINE([HAVE_BZ2], [1],
[Define to 1 if the PHP extension 'bz2' is available.])
],
[AC_MSG_ERROR([bz2 module requires libbz2 >= 1.0.0])],
[AC_MSG_FAILURE([The bz2 extension requires libbz2 >= 1.0.0])],
[-L$BZIP_DIR/$PHP_LIBDIR])

PHP_NEW_EXTENSION([bz2], [bz2.c bz2_filter.c], [$ext_shared])
Expand Down
2 changes: 1 addition & 1 deletion ext/curl/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ if test "$PHP_CURL" != "no"; then
[curl_easy_perform],
[AC_DEFINE([HAVE_CURL], [1],
[Define to 1 if the PHP extension 'curl' is available.])],
[AC_MSG_ERROR([The libcurl check failed. Please, check config.log for details.])],
[AC_MSG_FAILURE([The libcurl check failed.])],
[$CURL_LIBS])

PHP_NEW_EXTENSION([curl],
Expand Down
11 changes: 6 additions & 5 deletions ext/gd/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,11 @@ dnl Various checks for GD features

PHP_INSTALL_HEADERS([ext/gd], [php_gd.h libgd/])

PHP_TEST_BUILD(foobar, [], [
AC_MSG_ERROR([GD build test failed. Please check the config.log for details.])
], [ $GD_SHARED_LIBADD ], [char foobar(void) { return '\0'; }])

PHP_TEST_BUILD([foobar],
[],
[AC_MSG_FAILURE([GD library build test failed.])],
[$GD_SHARED_LIBADD],
[char foobar(void) { return '\0'; }])
else
extra_sources="gd_compat.c"
PKG_CHECK_MODULES([GDLIB], [gdlib >= 2.1.0])
Expand All @@ -290,7 +291,7 @@ dnl Various checks for GD features
PHP_INSTALL_HEADERS([ext/gd], [php_gd.h])
PHP_CHECK_LIBRARY([gd], [gdImageCreate],
[],
[AC_MSG_ERROR([GD build test failed. Please check the config.log for details.])],
[AC_MSG_FAILURE([GD library build test failed.])],
[$GD_SHARED_LIBADD])
fi

Expand Down
2 changes: 1 addition & 1 deletion ext/gettext/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if test "$PHP_GETTEXT" != "no"; then
GETTEXT_LIBS=
GETTEXT_CHECK_IN_LIB=c
],
[AC_MSG_ERROR([Unable to find required gettext library])])])
[AC_MSG_FAILURE([Unable to find required intl library for gettext.])])])

AC_DEFINE([HAVE_LIBINTL], [1], [Define to 1 if you have the 'intl' library.])
PHP_NEW_EXTENSION([gettext], [gettext.c], [$ext_shared])
Expand Down
4 changes: 2 additions & 2 deletions ext/gmp/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if test "$PHP_GMP" != "no"; then
if test "$PHP_GMP" = "yes"; then
PHP_CHECK_LIBRARY([gmp], [__gmpz_rootrem],
[],
[AC_MSG_ERROR([GNU MP Library version 4.2 or greater required.])])
[AC_MSG_FAILURE([GNU MP Library version 4.2 or greater required.])])

PHP_ADD_LIBRARY([gmp],, [GMP_SHARED_LIBADD])
else
Expand All @@ -17,7 +17,7 @@ if test "$PHP_GMP" != "no"; then

PHP_CHECK_LIBRARY([gmp], [__gmpz_rootrem],
[],
[AC_MSG_ERROR([GNU MP Library version 4.2 or greater required.])],
[AC_MSG_FAILURE([GNU MP Library version 4.2 or greater required.])],
[-L$PHP_GMP/$PHP_LIBDIR])

PHP_ADD_LIBRARY_WITH_PATH([gmp],
Expand Down
4 changes: 2 additions & 2 deletions ext/iconv/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PHP_ARG_WITH([iconv],

if test "$PHP_ICONV" != "no"; then
PHP_SETUP_ICONV([ICONV_SHARED_LIBADD],,
[AC_MSG_ERROR([The iconv not found. Please, check config.log for details.])])
[AC_MSG_FAILURE([The iconv not found.])])

save_LDFLAGS="$LDFLAGS"
save_CFLAGS="$CFLAGS"
Expand Down Expand Up @@ -93,7 +93,7 @@ int main(void) {
[php_cv_iconv_errno=no],
[php_cv_iconv_errno=yes])])
AS_VAR_IF([php_cv_iconv_errno], [yes],,
[AC_MSG_ERROR([iconv does not support errno])])
[AC_MSG_FAILURE([The iconv check failed, 'errno' is missing.])])

AC_CACHE_CHECK([if iconv supports //IGNORE], [php_cv_iconv_ignore],
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
Expand Down
2 changes: 1 addition & 1 deletion ext/ldap/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ if test "$PHP_LDAP" != "no"; then
dnl Sanity check
AC_CHECK_FUNC([ldap_sasl_bind_s],,
[AC_CHECK_FUNC([ldap_simple_bind_s],,
[AC_MSG_ERROR([LDAP build check failed. Please check config.log for details.])])])
[AC_MSG_ERROR([LDAP library build check failed.])])])

dnl Restore original values
CPPFLAGS=$_SAVE_CPPFLAGS
Expand Down
13 changes: 6 additions & 7 deletions ext/odbc/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -197,19 +197,18 @@ PHP_ARG_WITH([ibm-db2],,
ODBC_TYPE=ibm-db2
ODBC_LIBS=-ldb2

PHP_TEST_BUILD(SQLExecute, [
PHP_TEST_BUILD([SQLExecute], [
AC_DEFINE(HAVE_IBMDB2,1,[ ])
AC_MSG_RESULT([$ext_output])
], [
AC_MSG_RESULT([no])
AC_MSG_ERROR([
build test failed. Please check the config.log for details.
You need to source your DB2 environment before running PHP configure:
AC_MSG_FAILURE([
ODBC build test failed. You need to source your DB2 environment before running
PHP configure:
# . \$IBM_DB2/db2profile
])
], [
$ODBC_LFLAGS $ODBC_LIBS
])
],
[$ODBC_LFLAGS $ODBC_LIBS])
else
AC_MSG_RESULT([no])
fi
Expand Down
2 changes: 1 addition & 1 deletion ext/opcache/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ int main(void) {
PHP_ADD_EXTENSION_DEP(opcache, pcre)

if test "$php_cv_shm_ipc" != "yes" && test "$php_cv_shm_mmap_posix" != "yes" && test "$php_cv_shm_mmap_anon" != "yes"; then
AC_MSG_ERROR([No supported shared memory caching support was found when configuring opcache. Check config.log for any errors or missing dependencies.])
AC_MSG_FAILURE([No supported shared memory caching support was found when configuring opcache.])
fi

if test "$PHP_OPCACHE_JIT" = "yes"; then
Expand Down
2 changes: 1 addition & 1 deletion ext/pcntl/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PHP_ARG_ENABLE([pcntl],
if test "$PHP_PCNTL" != "no"; then
for function in fork sigaction waitpid; do
AC_CHECK_FUNC([$function],,
[AC_MSG_ERROR([ext/pcntl: required function $function() not found.])])
[AC_MSG_FAILURE([ext/pcntl: required function $function() not found.])])
done

AC_CHECK_FUNCS(m4_normalize([
Expand Down
2 changes: 1 addition & 1 deletion ext/pdo_dblib/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if test "$PHP_PDO_DBLIB" != "no"; then
dnl Only perform a sanity check that this is really the case.
PHP_CHECK_LIBRARY([sybdb], [dbsqlexec],
[],
[AC_MSG_ERROR([Cannot find FreeTDS in known installation directories])])
[AC_MSG_FAILURE([Cannot find FreeTDS in known installation directories.])])
PHP_ADD_LIBRARY([sybdb],, [PDO_DBLIB_SHARED_LIBADD])
elif test "$PHP_PDO_DBLIB" != "no"; then

Expand Down
2 changes: 1 addition & 1 deletion ext/pdo_firebird/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if test "$PHP_PDO_FIREBIRD" != "no"; then
[FIREBIRD_LIBNAME=gds],
[PHP_CHECK_LIBRARY([ib_util], [isc_detach_database],
[FIREBIRD_LIBNAME=ib_util],
[AC_MSG_ERROR([libfbclient, libgds or libib_util not found! Check config.log for more information.])],
[AC_MSG_FAILURE([libfbclient, libgds or libib_util not found.])],
[$FIREBIRD_LIBDIR_FLAG])],
[$FIREBIRD_LIBDIR_FLAG])],
[$FIREBIRD_LIBDIR_FLAG])
Expand Down
4 changes: 2 additions & 2 deletions ext/pdo_odbc/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ if test "$PHP_PDO_ODBC" != "no"; then
PHP_CHECK_LIBRARY([$pdo_odbc_def_lib], [SQLBindCol],
[PHP_CHECK_LIBRARY([$pdo_odbc_def_lib], [SQLAllocHandle],
[],
[AC_MSG_ERROR([
[AC_MSG_FAILURE([
Your ODBC library does not appear to be ODBC 3 compatible.
You should consider using iODBC or unixODBC instead, and loading your
libraries as a driver in that environment; it will emulate the
functions required for PDO support.
])],
[$PDO_ODBC_LIBS])],
[AC_MSG_ERROR([Your ODBC library does not exist or there was an error. Check config.log for more information])],
[AC_MSG_FAILURE([Your ODBC library does not exist or there was an error.])],
[$PDO_ODBC_LIBS])
fi

Expand Down
6 changes: 3 additions & 3 deletions ext/readline/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ if test "$PHP_READLINE" && test "$PHP_READLINE" != "no"; then
[PHP_ADD_LIBRARY_WITH_PATH([readline],
[$READLINE_DIR/$PHP_LIBDIR],
[READLINE_SHARED_LIBADD])],
[AC_MSG_ERROR([readline library not found])],
[AC_MSG_FAILURE([The readline library not found.])],
[-L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS])

PHP_CHECK_LIBRARY([readline], [rl_pending_input],
[],
[AC_MSG_ERROR([invalid readline installation detected. Try --with-libedit instead.])],
[AC_MSG_FAILURE([Invalid readline installation detected. Try --with-libedit instead.])],
[-L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS])

PHP_CHECK_LIBRARY([readline], [rl_callback_read_char],
Expand Down Expand Up @@ -98,7 +98,7 @@ elif test "$PHP_LIBEDIT" != "no"; then

PHP_CHECK_LIBRARY([edit], [readline],
[],
[AC_MSG_ERROR([edit library required by readline not found])],
[AC_MSG_FAILURE([The edit library required by readline extension not found.])],
[$READLINE_SHARED_LIBADD])

PHP_CHECK_LIBRARY([edit], [rl_callback_read_char],
Expand Down
4 changes: 2 additions & 2 deletions ext/skeleton/config.m4.in
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ AS_VAR_IF([PHP_%EXTNAMECAPS%], [no],, [
dnl PHP_CHECK_LIBRARY([$LIBNAME], [$LIBSYMBOL],
dnl [AC_DEFINE([HAVE_%EXTNAMECAPS%_FEATURE], [1],
dnl [Define to 1 if %EXTNAME% has the 'FEATURE'.])],
dnl [AC_MSG_ERROR([FEATURE not supported by your %EXTNAME% library.])],
dnl [AC_MSG_FAILURE([FEATURE not supported by your %EXTNAME% library.])],
dnl [$LIBFOO_LIBS])
dnl

Expand Down Expand Up @@ -89,7 +89,7 @@ AS_VAR_IF([PHP_%EXTNAMECAPS%], [no],, [
dnl AC_DEFINE([HAVE_%EXTNAMECAPS%_FEATURE], [1],
dnl [Define to 1 if %EXTNAME% has the 'FEATURE'.])
dnl ],
dnl [AC_MSG_ERROR([FEATURE not supported by your %EXTNAME% library.])],
dnl [AC_MSG_FAILURE([FEATURE not supported by your %EXTNAME% library.])],
dnl [-L$%EXTNAMECAPS%_DIR/$PHP_LIBDIR -lm])
dnl

Expand Down
2 changes: 1 addition & 1 deletion ext/snmp/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if test "$PHP_SNMP" != "no"; then
PHP_CHECK_LIBRARY([$SNMP_LIBNAME], [init_snmp],
[AC_DEFINE([HAVE_SNMP], [1],
[Define to 1 if the PHP extension 'snmp' is available.])],
[AC_MSG_ERROR([SNMP sanity check failed. Please check config.log for more information.])],
[AC_MSG_FAILURE([SNMP sanity check failed.])],
[$SNMP_SHARED_LIBADD])

dnl Check whether shutdown_snmp_logging() exists.
Expand Down
6 changes: 3 additions & 3 deletions ext/standard/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ AS_VAR_IF([PHP_EXTERNAL_LIBCRYPT], [no], [
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_MSG_FAILURE([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.])])
[AC_MSG_FAILURE([Cannot use external libcrypt as crypt_r() is missing.])])

PHP_CRYPT_R_STYLE
AC_CHECK_HEADERS([crypt.h])
Expand Down Expand Up @@ -279,7 +279,7 @@ int main(void) {


if test "$ac_cv_crypt_blowfish" = "no" || test "$ac_cv_crypt_des" = "no" || test "$ac_cv_crypt_ext_des" = "no" || test "$ac_cv_crypt_md5" = "no" || test "$ac_cv_crypt_sha512" = "no" || test "$ac_cv_crypt_sha256" = "no"; then
AC_MSG_ERROR([Cannot use external libcrypt as some algo are missing])
AC_MSG_FAILURE([Cannot use external libcrypt as some algo are missing.])
fi

AC_DEFINE([PHP_USE_PHP_CRYPT_R], [0])
Expand Down
5 changes: 4 additions & 1 deletion ext/sysvmsg/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ PHP_ARG_ENABLE([sysvmsg],

if test "$PHP_SYSVMSG" != "no"; then
AC_CHECK_HEADER([sys/msg.h],,
[AC_MSG_ERROR([Cannot enable System V IPC support, sys/msg.h is missing])])
[AC_MSG_FAILURE(m4_normalize([
Cannot enable System V IPC support. Required <sys/msg.h> header file not
found.
]))])

AC_DEFINE([HAVE_SYSVMSG], [1],
[Define to 1 if the PHP extension 'sysvmsg' is available.])
Expand Down
Loading