Imported Upstream version 2.6.1
[debian/amanda] / config / amanda / s3-device.m4
1 # SYNOPSIS
2 #
3 #   AMANDA_S3_DEVICE
4 #
5 # OVERVIEW
6 #
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.
9 #
10 AC_DEFUN([AMANDA_S3_DEVICE], [
11     AC_REQUIRE([AMANDA_CHECK_LIBCURL])
12     AC_REQUIRE([AMANDA_CHECK_HMAC])
13
14     AC_ARG_ENABLE([s3-device],
15         AS_HELP_STRING([--disable-s3-device],
16                        [disable the S3 device]),
17         [ WANT_S3_DEVICE=$enableval ], [ WANT_S3_DEVICE=maybe ])
18
19     AC_MSG_CHECKING([whether to include the Amazon S3 device])
20     # if the user didn't specify 'no', then check for support
21     if test x"$WANT_S3_DEVICE" != x"no"; then
22         if test x"$HAVE_CURL" = x"yes" -a x"$HAVE_HMAC" = x"yes"; then
23             WANT_S3_DEVICE=yes
24         else
25             # no support -- if the user explicitly enabled the device,
26             # then this is an error
27             if test x"$WANT_S3_DEVICE" = x"yes"; then
28                 AC_MSG_RESULT(no)
29                 AC_MSG_ERROR([Cannot build the Amazon S3 device: one or more prerequisites are missing.])
30             else
31                 WANT_S3_DEVICE=no
32             fi
33         fi
34     fi
35     AC_MSG_RESULT($WANT_S3_DEVICE)
36
37     AM_CONDITIONAL([WANT_S3_DEVICE], [test x"$WANT_S3_DEVICE" = x"yes"])
38
39     # Now handle any setup for S3, if we want it.
40     if test x"$WANT_S3_DEVICE" = x"yes"; then
41         AC_DEFINE(WANT_S3_DEVICE, [], [Compile Amazon S3 driver])
42     fi
43 ])