[pacman-dev] [PATCH] Configure: Check if libfetch version is >= 2.21

Henning Garus henning.garus at googlemail.com
Mon Aug 24 16:10:47 EDT 2009


Commit 6f97842 started using libfetch's conditional GET. This requires libfetch
to be version 2.21 or greater.

Change configure.ac to check for the existence of the last_modified field in
the url struct, which was introduced with libfetch 2.21.

Signed-off-by: Henning Garus <henning.garus at gmail.com>
---
 configure.ac |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index b2164b9..40d8e13 100644
--- a/configure.ac
+++ b/configure.ac
@@ -142,7 +142,12 @@ if test "x$internaldownload" = "xyes" ; then
 	AC_MSG_RESULT(yes)
 	AC_DEFINE([INTERNAL_DOWNLOAD], , [Use internal download library])
 	# Check for a download library if it was actually requested
-	AC_CHECK_LIB([fetch], [fetchParseURL], ,
+	AC_CHECK_LIB([fetch], [fetchParseURL],
+		# Check if libfetch supports conditional GET
+		# (version >=2.21, struct url has member last_modified)
+		AC_CHECK_MEMBER(struct url.last_modified, ,
+			AC_MSG_ERROR([libfetch must be version 2.21 or greater]),
+			[#include <fetch.h>] ),
 		AC_MSG_ERROR([libfetch is needed to compile with internal download support]) )
 else
 	AC_MSG_RESULT(no)
-- 
1.6.4.1



More information about the pacman-dev mailing list