Skip to content

Commit 3fd7d81

Browse files
cebekrakjoe
authored andcommitted
Fixed finding CURL on systems with multiarch support
fixes https://bugs.php.net/bug.php?id=74125 This commit makes the cURL config script aware of debian/ubuntu [multiarch support][1] which installs architecture specific headers in a different location. It checks whether the `dpkg-architecture` script exists and is executeable, if that is the case, the multiarch architecture is detected by calling `dpkg-architecture -qDEB_HOST_MULTIARCH` as documented in [debian multiarch implementation docs][2]: > `/usr/include/<triplet>`: used for arch-varying headers [1]: https://wiki.debian.org/Multiarch [2]: https://wiki.debian.org/Multiarch/Implementation
1 parent 69b48f8 commit 3fd7d81

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ PHP NEWS
66
. Fixed bug #74947 (Segfault in scanner on INF number). (Laruence)
77
. Fixed bug #74954 (null deref and segfault in zend_generator_resume()). (Bob)
88

9+
- cURL:
10+
. Fixed bug #74125 (Fixed finding CURL on systems with multiarch support).
11+
(cebe)
12+
913
- Mbstring:
1014
. Fixed bug #71606 (Segmentation fault mb_strcut with HTML-ENTITIES encoding).
1115
(cmb)

ext/curl/config.m4

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,23 @@ if test "$PHP_CURL" != "no"; then
1717
break
1818
fi
1919
done
20+
if test -z "$CURL_DIR"; then
21+
AC_MSG_RESULT(not found)
22+
if which dpkg-architecture>/dev/null; then
23+
AC_MSG_CHECKING(for cURL in multiarch path)
24+
CURL_MULTIARCH_INCLUDE=/usr/include/$(dpkg-architecture -qDEB_HOST_MULTIARCH)
25+
if test -r $CURL_MULTIARCH_INCLUDE/curl/easy.h; then
26+
CURL_DIR=/usr
27+
AC_MSG_RESULT(found in $CURL_MULTIARCH_INCLUDE)
28+
else
29+
AC_MSG_RESULT(not found)
30+
fi
31+
fi
32+
fi
2033
fi
2134

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

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

48-
PHP_ADD_INCLUDE($CURL_DIR/include)
60+
if test -z "$CURL_MULTIARCH_INCLUDE"; then
61+
PHP_ADD_INCLUDE($CURL_DIR/include)
62+
else
63+
PHP_ADD_INCLUDE($CURL_MULTIARCH_INCLUDE)
64+
fi
4965
PHP_EVAL_LIBLINE($CURL_LIBS, CURL_SHARED_LIBADD)
5066
PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/$PHP_LIBDIR, CURL_SHARED_LIBADD)
5167

0 commit comments

Comments
 (0)