Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

configure: fix cross pkg-config detection

When cross-compiling, CURL_CHECK_PKGCONFIG was checking for the cross
pkg-config using ${host}-pkg-config.

The gold standard for doing this correctly is pkg-config's own macro,
PKG_PROG_PKG_CONFIG.  However, on the assumption that you have a good
reason not to use that directly (reduced dependencies for maintainer
builds?), the behaviour of cURL's version should at least match.
PKG_PROG_PKG_CONFIG uses AC_PATH_TOOL, which ultimately ends up trying
${host_alias}-pkg-config; this is not quite the same as what cURL does,
and may differ because ${host} has been run through config.sub.  For
instance, when cross-building to the armhf architecture on Ubuntu,
${host_alias} is arm-linux-gnueabihf while ${host} is
arm-unknown-linux-gnueabihf.  This may also have been the cause of the
problem reported at http://curl.haxx.se/mail/lib-2012-04/0224.html.

AC_PATH_TOOL is significantly simpler than cURL's current code, and
dates back to well before the current minimum of Autoconf 2.57, so let's
use it instead.
  • Loading branch information...
commit c07a6f3ff36c85ce1daec34c16dea8ab95ec4c78 1 parent d021f2e
@cjwatson cjwatson authored committed
Showing with 3 additions and 11 deletions.
  1. +3 −11 acinclude.m4
View
14 acinclude.m4
@@ -3256,8 +3256,8 @@ AC_DEFUN([CURL_EXPORT_PCDIR], [
dnl CURL_CHECK_PKGCONFIG ($module, [$pcdir])
dnl ------------------------
-dnl search for the pkg-config tool (if not cross-compiling). Set the PKGCONFIG
-dnl variable to hold the path to it, or 'no' if not found/present.
+dnl search for the pkg-config tool. Set the PKGCONFIG variable to hold the
+dnl path to it, or 'no' if not found/present.
dnl
dnl If pkg-config is present, check that it has info about the $module or
dnl return "no" anyway!
@@ -3269,15 +3269,7 @@ AC_DEFUN([CURL_CHECK_PKGCONFIG], [
PKGCONFIG="no"
- if test x$cross_compiling = xyes; then
- dnl see if there's a pkg-specific for this host setup
- AC_PATH_PROG( PKGCONFIG, ${host}-pkg-config, no,
- $PATH:/usr/bin:/usr/local/bin)
- fi
-
- if test x$PKGCONFIG = xno; then
- AC_PATH_PROG( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
- fi
+ AC_PATH_TOOL( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
if test x$PKGCONFIG != xno; then
AC_MSG_CHECKING([for $1 options with pkg-config])
Please sign in to comment.
Something went wrong with that request. Please try again.