configure.ac 4.11 KB
Newer Older
1
AC_INIT([libcloudstorage], [1.2])
2 3
AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_CONFIG_MACRO_DIRS([m4])
4
AC_USE_SYSTEM_EXTENSIONS
5 6 7 8

AM_SILENT_RULES([yes])
AM_MAINTAINER_MODE([enable])

Paweł Wegner committed
9
AC_LANG(C++)
10 11

LT_INIT([win32-dll shared disable-static])
12 13 14 15 16

AC_PROG_CXX

AX_CXX_COMPILE_STDCXX_11

17
PKG_CHECK_MODULES([libjsoncpp], [jsoncpp])
Paweł Wegner committed
18
PKG_CHECK_MODULES([libtinyxml2], [tinyxml2])
19

Paweł Wegner committed
20
HAVE_MEGA=0
Paweł Wegner committed
21
AC_ARG_WITH([mega], AS_HELP_STRING([--with-mega]))
Paweł Wegner committed
22
AS_IF([test "x$with_mega" != "xno"], [
Paweł Wegner committed
23 24 25 26 27 28 29
  PKG_CHECK_MODULES([libmega], [libmega], [
    HAVE_MEGA=1
    AC_DEFINE(WITH_MEGA)
  ], [
    HAVE_MEGA=0
    AS_IF([test "x$with_mega" = "xyes"], [AC_MSG_ERROR([libmega not found])])
  ])
Paweł Wegner committed
30
])
Paweł Wegner committed
31
AM_CONDITIONAL([WITH_MEGA], [test "$HAVE_MEGA" -eq 1])
Paweł Wegner committed
32

33
HAVE_CRYPTOPP=0
Paweł Wegner committed
34
AC_ARG_WITH([cryptopp], AS_HELP_STRING([--with-cryptopp]))
35 36 37 38 39 40 41 42
AS_IF([test "x$with_cryptopp" != "xno"], [
  PKG_CHECK_MODULES([libcryptopp], [libcrypto++], [
    HAVE_CRYPTOPP=1
    AC_DEFINE(WITH_CRYPTOPP)
  ], [
    HAVE_CRYPTOPP=0
    AS_IF([test "x$with_mega" = "xyes"], [AC_MSG_ERROR([libcrypto++ not found])])
  ])
Paweł Wegner committed
43
])
44
AM_CONDITIONAL([WITH_CRYPTOPP], [test "$HAVE_CRYPTOPP" -eq 1])
Paweł Wegner committed
45

46
HAVE_CURL=0
47
AC_ARG_WITH([curl], AS_HELP_STRING([--with-curl]))
48 49 50 51 52 53 54 55
AS_IF([test "x$with_curl" != "xno"], [
  PKG_CHECK_MODULES([libcurl], [libcurl], [
    HAVE_CURL=1
    AC_DEFINE(WITH_CURL)
  ], [
    HAVE_CURL=0
    AS_IF([test "x$with_curl" = "xyes"], [AC_MSG_ERROR([libcurl not found])])
  ])
56
])
57
AM_CONDITIONAL([WITH_CURL], [test "$HAVE_CURL" -eq 1])
58

59
HAVE_MICROHTTPD=0
60
AC_ARG_WITH([microhttpd], AS_HELP_STRING([--with-microhttpd]))
61 62 63 64 65 66 67 68
AS_IF([test "x$with_microhttpd" != "xno"], [
  PKG_CHECK_MODULES([libmicrohttpd], [libmicrohttpd], [
    HAVE_MICROHTTPD=1
    AC_DEFINE(WITH_MICROHTTPD)
  ], [
    HAVE_MICROHTTPD=0
    AS_IF([test "x$with_microhttpd" = "xyes"], [AC_MSG_ERROR([libmicrohttpd not found])])
  ])
69
])
70
AM_CONDITIONAL([WITH_MICROHTTPD], [test "$HAVE_MICROHTTPD" -eq 1])
71

Paweł Wegner committed
72
HAVE_FUSE=0
73
HAVE_LEGACY_FUSE=0
Paweł Wegner committed
74 75 76 77 78 79
AC_ARG_WITH([fuse], AS_HELP_STRING([--with-fuse]))
AS_IF([test "x$with_fuse" != "xno"], [
  PKG_CHECK_MODULES([fuse], [fuse3], [
    HAVE_FUSE=1
    AC_DEFINE(WITH_FUSE)
  ], [
80 81 82 83 84 85
    PKG_CHECK_MODULES([fuse2], [fuse], [
      HAVE_LEGACY_FUSE=1
      AC_DEFINE(WITH_LEGACY_FUSE)
    ], [
      AS_IF([test "x$with_fuse" = "xyes"], [AC_MSG_ERROR([fuse3 not found])])
    ])
Paweł Wegner committed
86 87 88
  ])
])
AM_CONDITIONAL([WITH_FUSE], [test "$HAVE_FUSE" -eq 1])
89
AM_CONDITIONAL([WITH_LEGACY_FUSE], [test "$HAVE_LEGACY_FUSE" -eq 1])
Paweł Wegner committed
90

91 92 93 94 95 96 97 98 99
case "${host_os}" in
  *mingw32*)
    SYS=mingw32
    ;;
  *)
    SYS=linux
    ;;
esac

100 101
AC_CONFIG_FILES([
  Makefile
Paweł Wegner committed
102
  src/libcloudstorage.pc
103 104
  src/Makefile
  test/Makefile
Paweł Wegner committed
105 106
  bin/Makefile
  bin/fuse/Makefile
107 108
  examples/Makefile
  examples/cloudbrowser/Makefile
109
  examples/commandlinebrowser/Makefile
110 111 112 113 114 115 116 117 118 119 120
])

SOCKET_LIBS=""
AS_IF([test "${SYS}" = "mingw32"], [
  SOCKET_LIBS="-lws2_32"
])
AC_SUBST(SOCKET_LIBS)

AC_ARG_WITH([examples], AS_HELP_STRING([--with-examples]))
AM_CONDITIONAL([EXAMPLES], [test "x$with_examples" = "xyes"])

121
HAVE_QT=0
122
HAVE_QTWEBVIEW=0
123
HAVE_THUMBNAILER=0
124
HAVE_VLC_QT=0
125

126
AS_IF([test "x$with_examples" = "xyes"], [
127
  PKG_CHECK_MODULES([qt], [Qt5Core Qt5Gui Qt5Quick], [
128
    HAVE_QT=1
129 130 131 132 133
    QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
    QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
    AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
    AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
    AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
134 135
    AC_DEFINE(WITH_QT)
  ], [HAVE_QT=0])
136 137 138 139
  PKG_CHECK_MODULES([qtwebview], [Qt5WebView], [
    HAVE_QTWEBVIEW=1
    AC_DEFINE(WITH_QTWEBVIEW)
  ], [HAVE_QTWEBVIEW=0])
140 141 142 143
  PKG_CHECK_MODULES([libffmpegthumbnailer], [libffmpegthumbnailer], [
    HAVE_THUMBNAILER=1
    AC_DEFINE(WITH_THUMBNAILER)
  ], [HAVE_THUMBNAILER=0])
144 145 146 147
  PKG_CHECK_MODULES([vlcqt], [libVLCQtQml], [
    HAVE_VLC_QT=1
    AC_DEFINE(WITH_VLC_QT)
  ], [HAVE_VLC_QT=0])
148 149
])

150
AM_CONDITIONAL([WITH_QT], [test "$HAVE_QT" -eq 1])
151
AM_CONDITIONAL([WITH_QTWEBVIEW], [test "$HAVE_QTWEBVIEW" -eq 1])
152
AM_CONDITIONAL([WITH_THUMBNAILER], [test "$HAVE_THUMBNAILER" -eq 1])
153
AM_CONDITIONAL([WITH_VLC_QT], [test "$HAVE_VLC_QT" -eq 1])
Paweł Wegner committed
154

155
AC_OUTPUT