mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@67026 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
61
configure
vendored
61
configure
vendored
@@ -1,5 +1,5 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# From configure.ac Revision: 66157 .
|
# From configure.ac Revision: 66160 .
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.61.
|
# Generated by GNU Autoconf 2.61.
|
||||||
#
|
#
|
||||||
@@ -30528,6 +30528,64 @@ fi
|
|||||||
if test $(printf "%d" 0x$(${CURL_CONFIG} --vernum)) -ge $(printf "%d" 0x070907); then
|
if test $(printf "%d" 0x$(${CURL_CONFIG} --vernum)) -ge $(printf "%d" 0x070907); then
|
||||||
CURL_INCLUDE=$(${CURL_CONFIG} --cflags)
|
CURL_INCLUDE=$(${CURL_CONFIG} --cflags)
|
||||||
CURL_LIB=$(${CURL_CONFIG} --libs)
|
CURL_LIB=$(${CURL_CONFIG} --libs)
|
||||||
|
|
||||||
|
{ echo "$as_me:$LINENO: checking for curl_version() in curl/curl.h" >&5
|
||||||
|
echo $ECHO_N "checking for curl_version() in curl/curl.h... $ECHO_C" >&6; }
|
||||||
|
saved_cppflags="${CPPFLAGS}"
|
||||||
|
CPPFLAGS="${CPPFLAGS} ${CURL_INCLUDE}"
|
||||||
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
|
/* confdefs.h. */
|
||||||
|
_ACEOF
|
||||||
|
cat confdefs.h >>conftest.$ac_ext
|
||||||
|
cat >>conftest.$ac_ext <<_ACEOF
|
||||||
|
/* end confdefs.h. */
|
||||||
|
#include <curl/curl.h>
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
curl_version();
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
_ACEOF
|
||||||
|
rm -f conftest.$ac_objext
|
||||||
|
if { (ac_try="$ac_compile"
|
||||||
|
case "(($ac_try" in
|
||||||
|
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||||
|
*) ac_try_echo=$ac_try;;
|
||||||
|
esac
|
||||||
|
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||||
|
(eval "$ac_compile") 2>conftest.er1
|
||||||
|
ac_status=$?
|
||||||
|
grep -v '^ *+' conftest.er1 >conftest.err
|
||||||
|
rm -f conftest.er1
|
||||||
|
cat conftest.err >&5
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); } && {
|
||||||
|
test -z "$ac_c_werror_flag" ||
|
||||||
|
test ! -s conftest.err
|
||||||
|
} && test -s conftest.$ac_objext; then
|
||||||
|
|
||||||
|
{ echo "$as_me:$LINENO: result: yes" >&5
|
||||||
|
echo "${ECHO_T}yes" >&6; }
|
||||||
|
ac_cv_curl_h="yes"
|
||||||
|
|
||||||
|
else
|
||||||
|
echo "$as_me: failed program was:" >&5
|
||||||
|
sed 's/^/| /' conftest.$ac_ext >&5
|
||||||
|
|
||||||
|
|
||||||
|
{ echo "$as_me:$LINENO: result: no" >&5
|
||||||
|
echo "${ECHO_T}no" >&6; }
|
||||||
|
ac_cv_curl_h="no"
|
||||||
|
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||||
|
CPPFLAGS="${saved_cppflags}"
|
||||||
|
if test "${ac_cv_curl_h}" = "yes"; then
|
||||||
PBX_CURL=1
|
PBX_CURL=1
|
||||||
|
|
||||||
cat >>confdefs.h <<\_ACEOF
|
cat >>confdefs.h <<\_ACEOF
|
||||||
@@ -30537,6 +30595,7 @@ _ACEOF
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
ac_config_files="$ac_config_files build_tools/menuselect-deps makeopts channels/h323/Makefile"
|
ac_config_files="$ac_config_files build_tools/menuselect-deps makeopts channels/h323/Makefile"
|
||||||
|
|
||||||
|
19
configure.ac
19
configure.ac
@@ -1130,11 +1130,30 @@ if test "${USE_CURL}" != "no"; then
|
|||||||
if test $(printf "%d" 0x$(${CURL_CONFIG} --vernum)) -ge $(printf "%d" 0x070907); then
|
if test $(printf "%d" 0x$(${CURL_CONFIG} --vernum)) -ge $(printf "%d" 0x070907); then
|
||||||
CURL_INCLUDE=$(${CURL_CONFIG} --cflags)
|
CURL_INCLUDE=$(${CURL_CONFIG} --cflags)
|
||||||
CURL_LIB=$(${CURL_CONFIG} --libs)
|
CURL_LIB=$(${CURL_CONFIG} --libs)
|
||||||
|
|
||||||
|
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
|
PBX_CURL=1
|
||||||
AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
|
AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
AC_CONFIG_FILES([build_tools/menuselect-deps makeopts channels/h323/Makefile])
|
AC_CONFIG_FILES([build_tools/menuselect-deps makeopts channels/h323/Makefile])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
Reference in New Issue
Block a user