Skip to content

Autotools: Refactor PHP_TEST_BUILD checks #15798

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
Sep 8, 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
16 changes: 11 additions & 5 deletions ext/gd/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,17 @@ dnl Various checks for GD features

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

PHP_TEST_BUILD([foobar],
[],
[AC_MSG_FAILURE([GD library build test failed.])],
[$GD_SHARED_LIBADD],
[char foobar(void) { return '\0'; }])
dnl Sanity check.
AC_CACHE_CHECK([whether build works], [php_cv_lib_gd_works], [
LIBS_SAVED=$LIBS
LIBS="$GD_SHARED_LIBADD $LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM()],
[php_cv_lib_gd_works=yes],
[php_cv_lib_gd_works=no])
LIBS=$LIBS_SAVED
])
AS_VAR_IF([php_cv_lib_gd_works], [yes],,
[AC_MSG_FAILURE([GD library build test failed.])])
else
extra_sources="gd_compat.c"
PKG_CHECK_MODULES([GDLIB], [gdlib >= 2.1.0])
Expand Down
9 changes: 6 additions & 3 deletions ext/odbc/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,18 @@ PHP_ARG_WITH([ibm-db2],
ODBC_TYPE=ibm-db2
ODBC_LIBS=-ldb2

PHP_TEST_BUILD([SQLExecute],
dnl Sanity check.
old_LIBS=$LIBS
LIBS="$ODBC_LFLAGS $ODBC_LIBS $LIBS"
AC_CHECK_FUNC([SQLExecute],
[AC_DEFINE([HAVE_IBMDB2], [1],
[Define to 1 if the odbc extension uses the IBM DB2.])],
[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])
])])
LIBS=$old_LIBS
])
])

Expand Down
Loading