1 dnl Copyright (C) 2010 Monty Taylor
2 dnl This file is free software; Monty Taylor
3 dnl gives unlimited permission to copy and/or distribute it,
4 dnl with or without modifications, as long as this notice is preserved.
6 AC_DEFUN([_PANDORA_SEARCH_LIBCURL],[
7 AC_REQUIRE([AC_LIB_PREFIX])
9 dnl --------------------------------------------------------------------
11 dnl --------------------------------------------------------------------
13 AC_ARG_ENABLE([libcurl],
14 [AS_HELP_STRING([--disable-libcurl],
15 [Build with libcurl support @<:@default=on@:>@])],
16 [ac_enable_libcurl="$enableval"],
17 [ac_enable_libcurl="yes"])
19 AS_IF([test "x$ac_enable_libcurl" = "xyes"],[
20 AC_LIB_HAVE_LINKFLAGS(curl,,
21 [#include <curl/curl.h>],
24 handle=curl_easy_init();
30 AC_CACHE_CHECK([if libcurl has CURLOPT_USERNAME],
31 [pandora_cv_curl_have_username],[
36 handle=curl_easy_init();
37 rv= curl_easy_setopt(curl_handle, CURLOPT_USERNAME, "foo");
39 [pandora_cv_curl_have_username=yes],
40 [pandora_cv_curl_have_username=no])
43 AM_CONDITIONAL(HAVE_LIBCURL,[test "x${ac_cv_libcurl}" = "xyes"])
44 AS_IF([test "x$pandora_cv_curl_have_username" = "xyes"],
45 AC_DEFINE([HAVE_CURLOPT_USERNAME],[1],
46 [Does libcurl provide the CURLOPT_USERNAME constant]))
50 AC_DEFUN([PANDORA_HAVE_LIBCURL],[
51 AC_REQUIRE([_PANDORA_SEARCH_LIBCURL])
52 AS_IF([test "x${ac_cv_libcurl}" = "xno"],[
53 AC_MSG_WARN([libcurl development lib not found. On Debian this is found in libcurl4-gnutls-dev. On RHEL5/Fedora11 it's in curl-devel. On RHEL6/Fedora12 it's in libcurl-devel.])
57 AC_DEFUN([PANDORA_REQUIRE_LIBCURL],[
58 PANDORA_HAVE_LIBCURL($1)
59 AS_IF([test "x${ac_cv_libcurl}" = "xno"],[
60 AC_MSG_ERROR([libcurl is required for ${PACKAGE}])