# HG changeset patch # User J. Ali Harlow # Date 1231257632 0 # Node ID 6f804141872ccaf5c4c408847c06ad021a7898e0 # Parent 53e1185e2366fa44ed4c9103269ef3b529fdadf7 Make curl an optional dependancy diff -r 53e1185e2366 -r 6f804141872c configure.ac --- a/configure.ac Tue Jan 06 14:06:00 2009 +0000 +++ b/configure.ac Tue Jan 06 16:00:32 2009 +0000 @@ -122,7 +122,16 @@ AC_MSG_RESULT($have_gcc4) -PKG_CHECK_MODULES(CURL, [libcurl]) +AC_ARG_WITH([curl], + [AS_HELP_STRING([--without-curl], [disable support for curl])], + [], + [with_curl=yes]) + +CURL_CFLAGS= +CURL_LIBS= +AS_IF([test "x$with_curl" != xno], + [PKG_CHECK_MODULES(CURL, [libcurl]) + AC_DEFINE([HAVE_CURL], [1], [Define if you have curl])]) AC_SUBST(CURL_CFLAGS) AC_SUBST(CURL_LIBS) diff -r 53e1185e2366 -r 6f804141872c src/main.c --- a/src/main.c Tue Jan 06 14:06:00 2009 +0000 +++ b/src/main.c Tue Jan 06 16:00:32 2009 +0000 @@ -19,6 +19,8 @@ #define _GNU_SOURCE +#include "config.h" + #include #include #include @@ -28,7 +30,9 @@ #include #include #include +#ifdef HAVE_CURL #include +#endif #include #include #include "razor.h" @@ -348,6 +352,9 @@ static int download_if_missing(const char *url, const char *file) { +#ifndef HAVE_CURL + return 1; +#else CURL *curl; struct stat buf; char error[256]; @@ -398,6 +405,7 @@ curl_easy_cleanup(curl); return 0; +#endif /* HAVE_CURL */ } #define YUM_URL "http://download.fedora.redhat.com" \