~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/pandora_have_libcurl.m4

  • Committer: Brian Aker
  • Date: 2010-06-05 00:15:57 UTC
  • mfrom: (1589.1.1 drizzle_events)
  • Revision ID: brian@gaz-20100605001557-j1k41ni5k9mis891
Merge in Barry.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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.
5
 
 
6
 
AC_DEFUN([_PANDORA_SEARCH_LIBCURL],[
7
 
  AC_REQUIRE([AC_LIB_PREFIX])
8
 
 
9
 
  dnl --------------------------------------------------------------------
10
 
  dnl  Check for libcurl
11
 
  dnl --------------------------------------------------------------------
12
 
 
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"])
18
 
 
19
 
  AS_IF([test "x$ac_enable_libcurl" = "xyes"],[
20
 
    AC_LIB_HAVE_LINKFLAGS(curl,,
21
 
      [#include <curl/curl.h>],
22
 
      [
23
 
        CURL *handle;
24
 
        handle=curl_easy_init();
25
 
      ])
26
 
    ],[
27
 
      ac_cv_libcurl="no"
28
 
    ])
29
 
 
30
 
  AC_CACHE_CHECK([if libcurl has CURLOPT_USERNAME],
31
 
                 [pandora_cv_curl_have_username],[
32
 
     AC_COMPILE_IFELSE([
33
 
       AC_LANG_PROGRAM(
34
 
         [[
35
 
           CURL *handle;
36
 
           handle=curl_easy_init();
37
 
           rv= curl_easy_setopt(curl_handle, CURLOPT_USERNAME, "foo");
38
 
         ]])],
39
 
       [pandora_cv_curl_have_username=yes],
40
 
       [pandora_cv_curl_have_username=no])
41
 
     ])
42
 
 
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]))
47
 
 
48
 
])
49
 
 
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.])
54
 
  ])
55
 
])
56
 
 
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}])
61
 
  ])
62
 
])