From 3e7b90ff6950d1efe2aa8c16b8031b05fbe2f310 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 2 Sep 2010 12:29:29 -0500 Subject: Clean up libfetch checking in configure Model it after the new OpenSSL check, and have it be a bit more useful. If you do not explicitly pass a command line option, it will be linked if available but will not error out if it is missing. Also bump the version to that where connection caching was introduced as we use these new features in the codebase. Signed-off-by: Dan McGee --- lib/libalpm/alpm.c | 6 +++--- lib/libalpm/dload.c | 6 +++--- lib/libalpm/error.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c index 7bcfc8f1..6f4f4a4c 100644 --- a/lib/libalpm/alpm.c +++ b/lib/libalpm/alpm.c @@ -24,7 +24,7 @@ #include "config.h" /* connection caching setup */ -#if defined(INTERNAL_DOWNLOAD) +#ifdef HAVE_FETCH #include #endif @@ -59,7 +59,7 @@ int SYMEXPORT alpm_initialize(void) bindtextdomain("libalpm", LOCALEDIR); #endif -#ifdef INTERNAL_DOWNLOAD +#ifdef HAVE_FETCH fetchConnectionCacheInit(5, 1); #endif @@ -82,7 +82,7 @@ int SYMEXPORT alpm_release(void) _alpm_handle_free(handle); handle = NULL; -#ifdef INTERNAL_DOWNLOAD +#ifdef HAVE_FETCH fetchConnectionCacheClose(); #endif diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index 3185d2aa..32096e24 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -38,7 +38,7 @@ #include /* MAXHOSTNAMELEN */ #endif -#if defined(INTERNAL_DOWNLOAD) +#ifdef HAVE_FETCH #include #endif @@ -58,7 +58,7 @@ static char *get_filename(const char *url) { return(filename); } -#if defined(INTERNAL_DOWNLOAD) +#ifdef HAVE_FETCH static char *get_destfile(const char *path, const char *filename) { char *destfile; /* len = localpath len + filename len + null */ @@ -338,7 +338,7 @@ cleanup: static int download(const char *url, const char *localpath, int force) { if(handle->fetchcb == NULL) { -#if defined(INTERNAL_DOWNLOAD) +#ifdef HAVE_FETCH return(download_internal(url, localpath, force)); #else RET_ERR(PM_ERR_EXTERNAL_DOWNLOAD, -1); diff --git a/lib/libalpm/error.c b/lib/libalpm/error.c index 8d8d0458..b64ee67c 100644 --- a/lib/libalpm/error.c +++ b/lib/libalpm/error.c @@ -31,7 +31,7 @@ #include /* MAXHOSTNAMELEN */ #endif -#if defined(INTERNAL_DOWNLOAD) +#ifdef HAVE_FETCH #include /* fetchLastErrString */ #endif @@ -145,7 +145,7 @@ const char SYMEXPORT *alpm_strerror(int err) * error string instead. */ return _("libarchive error"); case PM_ERR_LIBFETCH: -#if defined(INTERNAL_DOWNLOAD) +#ifdef HAVE_FETCH return fetchLastErrString; #else /* obviously shouldn't get here... */ -- cgit v1.2.3-24-g4f1b