7 # Perform the necessary checks for the S3 Device. If the S3 device should be built,
8 # WANT_S3_DEVICE is DEFINEd and set up as an AM_CONDITIONAL.
10 # The subsidiary DevPay support, if enabled, defines and AM_CONDITIONALizes
13 AC_DEFUN([AMANDA_S3_DEVICE], [
14 AC_REQUIRE([AMANDA_CHECK_LIBCURL])
15 AC_REQUIRE([AMANDA_CHECK_HMAC])
17 if test "$libcurl_feature_SSL" != "yes" ||
18 test "$libcurl_protocol_HTTPS" != "yes"; then
24 AC_ARG_ENABLE([s3-device],
25 AS_HELP_STRING([--disable-s3-device],
26 [disable the S3 device]),
27 [ WANT_S3_DEVICE=$enableval ], [ WANT_S3_DEVICE=maybe ])
29 AC_MSG_CHECKING([whether to include the Amazon S3 device])
30 # if the user didn't specify 'no', then check for support
31 if test x"$WANT_S3_DEVICE" != x"no"; then
32 if test x"$HAVE_CURL" = x"yes" -a x"$HAVE_HMAC" = x"yes"; then
35 # no support -- if the user explicitly enabled the device,
36 # then this is an error
37 if test x"$WANT_S3_DEVICE" = x"yes"; then
39 AC_MSG_ERROR([Cannot build the Amazon S3 device: one or more prerequisites are missing.])
45 AC_MSG_RESULT($WANT_S3_DEVICE)
47 AM_CONDITIONAL([WANT_S3_DEVICE], [test x"$WANT_S3_DEVICE" = x"yes"])
49 # Now handle any setup for S3, if we want it.
50 if test x"$WANT_S3_DEVICE" = x"yes"; then
51 AC_DEFINE(WANT_S3_DEVICE, [], [Compile Amazon S3 driver])
52 if test x"$s3_ssl" = x"no"; then
53 AMANDA_MSG_WARN([Encryption support is not available for S3; requests will be sent in plaintext.])
58 AC_ARG_ENABLE([devpay],
59 AS_HELP_STRING([--enable-devpay],
60 [Use devpay authentication for Amazon S3 driver]),
61 [WANT_DEVPAY=$enableval], [WANT_DEVPAY=no])
63 AC_MSG_CHECKING([whether to include the Amazon S3 device's DevPay support])
64 if test x"$WANT_DEVPAY" = x"yes"; then
65 if test x"$WANT_S3_DEVICE" != x"yes"; then
67 AC_MSG_ERROR([DevPay support requires the S3 device (--enable-s3-device)])
70 if test "$s3_ssl" != "yes"; then
72 AC_MSG_ERROR([Cannot use devpay without HTTPS/SSL support in libcurl.])
75 AC_DEFINE([WANT_DEVPAY], [], [Compile Amazon DevPay support])
77 AC_MSG_RESULT($WANT_DEVPAY)
79 AM_CONDITIONAL([WANT_DEVPAY], [test "$WANT_DEVPAY" = "yes"])