diff --git a/Makefile.am b/Makefile.am index 343d98a2bd..70bd1a73aa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -104,6 +104,10 @@ CORE_CFLAGS += -I$(switch_srcdir)/libs/srtp/include CORE_CFLAGS += -I$(switch_srcdir)/libs/srtp/crypto/include -Ilibs/srtp/crypto/include CORE_CFLAGS += -I$(switch_srcdir)/libs/spandsp/src -I$(switch_srcdir)/libs/tiff-3.8.2/libtiff +if ENABLE_CORE_CURL +CORE_CFLAGS += -DCORE_USE_CURL +endif + CORE_LIBS = libs/apr-util/libaprutil-1.la libs/apr/libapr-1.la CORE_LIBS += libs/sqlite/libsqlite3.la libs/pcre/libpcre.la libs/speex/libspeex/libspeexdsp.la if ENABLE_SRTP diff --git a/configure.in b/configure.in index 50351d69d6..c9952d855f 100644 --- a/configure.in +++ b/configure.in @@ -352,6 +352,11 @@ AC_ARG_ENABLE(srtp, AM_CONDITIONAL([ENABLE_SRTP],[test "${enable_srtp}" = "yes"]) +AC_ARG_ENABLE(core-curl, +[AC_HELP_STRING([--disable-core-curl],[build without core-curl support])],[enable_core_curl="$enableval"],[enable_core_curl="yes"]) + +AM_CONDITIONAL([ENABLE_CORE_CURL],[test "${enable_core_curl}" = "yes"]) + AC_ARG_ENABLE(zrtp, [AS_HELP_STRING([--enable-zrtp], [Compile with zrtp Support])],,[enable_zrtp="no"]) if test "x$enable_zrtp" = "xyes" ; then diff --git a/src/include/switch_curl.h b/src/include/switch_curl.h index 6f477e5500..f664b0bc95 100644 --- a/src/include/switch_curl.h +++ b/src/include/switch_curl.h @@ -1,4 +1,58 @@ +/* + * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * Copyright (C) 2005-2011, Anthony Minessale II + * + * Version: MPL 1.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * + * The Initial Developer of the Original Code is + * Anthony Minessale II + * Portions created by the Initial Developer are Copyright (C) + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Anthony Minessale II + * + * + * switch_curl.h -- Core cURL + * + */ +/*! \file switch_core.h + \brief Core Library + + This module is the main core library and is the intended location of all fundamental operations. +*/ + +#ifndef SWITCH_CURL_H +#define SWITCH_CURL_H + +SWITCH_BEGIN_EXTERN_C void switch_curl_init(switch_memory_pool_t *pool); -void switch_curl_destroy(); +void switch_curl_destroy(void); +SWITCH_END_EXTERN_C + +#endif +/* For Emacs: + * Local Variables: + * mode:c + * indent-tabs-mode:t + * tab-width:4 + * c-basic-offset:4 + * End: + * For VIM: + * vim:set softtabstop=4 shiftwidth=4 tabstop=4: + */ diff --git a/src/switch_curl.c b/src/switch_curl.c index 61c209eb43..d31332ec79 100644 --- a/src/switch_curl.c +++ b/src/switch_curl.c @@ -28,8 +28,9 @@ * */ - #include + +#ifdef CORE_USE_CURL #include #include @@ -79,17 +80,30 @@ static void switch_curl_destroy_ssl_locks() } -void switch_curl_init(switch_memory_pool_t *pool) +SWITCH_DECLARE(void) switch_curl_init(switch_memory_pool_t *pool) { curl_global_init(CURL_GLOBAL_ALL); switch_curl_init_ssl_locks(pool); } -void switch_curl_destroy() + +SWITCH_DECLARE(void) switch_curl_destroy() { switch_curl_destroy_ssl_locks(); curl_global_cleanup(); } +#else +SWITCH_DECLARE(void) switch_curl_init(switch_memory_pool_t *pool) +{ + return; +} + +SWITCH_DECLARE(void) switch_curl_destroy() +{ + return; +} +#endif + /* For Emacs: * Local Variables: * mode:c