Skip to content

Fixed finding CURL on systems with multiarch support #2632

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

Closed
wants to merge 1 commit into from
Closed
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
22 changes: 19 additions & 3 deletions ext/curl/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,23 @@ if test "$PHP_CURL" != "no"; then
break
fi
done
if test -z "$CURL_DIR"; then
AC_MSG_RESULT(not found)
if which dpkg-architecture>/dev/null; then
AC_MSG_CHECKING(for cURL in multiarch path)
CURL_MULTIARCH_INCLUDE=/usr/include/$(dpkg-architecture -qDEB_HOST_MULTIARCH)
if test -r $CURL_MULTIARCH_INCLUDE/curl/easy.h; then
CURL_DIR=/usr
AC_MSG_RESULT(found in $CURL_MULTIARCH_INCLUDE)
else
AC_MSG_RESULT(not found)
fi
fi
fi
fi

if test -z "$CURL_DIR"; then
AC_MSG_RESULT(not found)
AC_MSG_ERROR(Please reinstall the libcurl distribution -
AC_MSG_ERROR(Could not find cURL, please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/)
fi

Expand All @@ -45,7 +57,11 @@ if test "$PHP_CURL" != "no"; then
AC_MSG_ERROR(cURL version 7.10.5 or later is required to compile php with cURL support)
fi

PHP_ADD_INCLUDE($CURL_DIR/include)
if test -z "$CURL_MULTIARCH_INCLUDE"; then
PHP_ADD_INCLUDE($CURL_DIR/include)
else
PHP_ADD_INCLUDE($CURL_MULTIARCH_INCLUDE)
fi
PHP_EVAL_LIBLINE($CURL_LIBS, CURL_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/$PHP_LIBDIR, CURL_SHARED_LIBADD)

Expand Down