diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-04 16:02:31 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-04 16:02:31 +0000 |
commit | e92a13ec571678fcf5132945935edc8ba26fcb75 (patch) | |
tree | fb656efb15e0110aec86b59c9a0340aed91ba48b /configure.ac | |
parent | 7be30db4648a746035e75f3e5eeff65137950068 (diff) |
Change the configure script to build a test program against libcurl to make
sure the results from curl-config can be used to compile successfully. This is
intended to help prevent a situation where you are cross compiling, and the
configure script finds the curl library installed on the host.
(issue #9865, reported and patched by zandbelt)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@67026 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 44ce0278c..5b565fbd7 100644 --- a/configure.ac +++ b/configure.ac @@ -1130,8 +1130,27 @@ if test "${USE_CURL}" != "no"; then if test $(printf "%d" 0x$(${CURL_CONFIG} --vernum)) -ge $(printf "%d" 0x070907); then CURL_INCLUDE=$(${CURL_CONFIG} --cflags) CURL_LIB=$(${CURL_CONFIG} --libs) - PBX_CURL=1 - AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.]) + + AC_MSG_CHECKING(for curl_version() in curl/curl.h) + saved_cppflags="${CPPFLAGS}" + CPPFLAGS="${CPPFLAGS} ${CURL_INCLUDE}" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [#include <curl/curl.h>], + [curl_version();]) + ],[ + AC_MSG_RESULT(yes) + ac_cv_curl_h="yes" + ],[ + AC_MSG_RESULT(no) + ac_cv_curl_h="no" + ] + ) + CPPFLAGS="${saved_cppflags}" + if test "${ac_cv_curl_h}" = "yes"; then + PBX_CURL=1 + AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.]) + fi fi fi fi |