optimize configure when using system libcurl

This commit is contained in:
Michael Jerris 2010-06-08 15:17:46 -04:00
parent d888ebca27
commit 493fc64831
2 changed files with 27 additions and 6 deletions

View File

@ -56,10 +56,6 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG],
AH_TEMPLATE([LIBCURL_PROTOCOL_DICT],[Defined if libcurl supports DICT])
AH_TEMPLATE([LIBCURL_PROTOCOL_TFTP],[Defined if libcurl supports TFTP])
AC_ARG_WITH(libcurl,
AC_HELP_STRING([--with-libcurl=DIR],[look for the curl library in DIR]),
[_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[yes],[$1])])
if test "$_libcurl_with" != "no" ; then
AC_PROG_AWK

View File

@ -719,7 +719,29 @@ GETSOUNDS="${SHELL} $switch_builddir/build/getsounds.sh"
AC_SUBST(GETSOUNDS)
LIBCURL_CHECK_CONFIG([yes], [7.13.0], [LIBCURL_DEPS=''], [LIBCURL_DEPS='${switch_builddir}/libs/curl/lib/libcurl.la';LIBCURL='${switch_builddir}/libs/curl/lib/libcurl.la';LIBCURL_CPPFLAGS='-I${switch_srcdir}/libs/curl/include'])
LIBCURL_DEPS=
AC_ARG_WITH(libcurl,
AC_HELP_STRING([--with-libcurl=DIR],[look for the curl library in DIR]),
[_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[yes],[$1])])
if test "$_libcurl_with" = "no" ; then
ac_cv_use_system_curl=no;
fi
if test "$_libcurl_with" = "yes" ; then
ac_cv_use_system_curl=yes;
fi
AC_CACHE_CHECK([whether to use system libcurl library], [ac_cv_use_system_curl], [
LIBCURL_CHECK_CONFIG([yes], [7.13.0], [ac_cv_use_system_curl='yes'], [ac_cv_use_system_curl='no'])
])
if test "$ac_cv_use_system_curl" != "yes" ; then
LIBCURL_DEPS='${switch_builddir}/libs/curl/lib/libcurl.la'
LIBCURL='${switch_builddir}/libs/curl/lib/libcurl.la'
LIBCURL_CPPFLAGS='-I${switch_srcdir}/libs/curl/include'
fi
AC_SUBST(LIBCURL_DEPS)
@ -949,7 +971,10 @@ AC_CONFIG_SUBDIRS([libs/pcre])
AC_CONFIG_SUBDIRS([libs/apr])
AC_CONFIG_SUBDIRS([libs/apr-util])
AC_CONFIG_SUBDIRS([libs/ilbc])
AC_CONFIG_SUBDIRS([libs/curl])
if test "$ac_cv_use_system_curl" != "yes" ; then
AC_CONFIG_SUBDIRS([libs/curl])
fi
AC_CONFIG_SUBDIRS([libs/iksemel])
AC_CONFIG_SUBDIRS([libs/js/nsprpub])
AC_CONFIG_SUBDIRS([libs/js])