summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac72
1 files changed, 54 insertions, 18 deletions
diff --git a/configure.ac b/configure.ac
index b922ad5bf..c65e406fd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -437,6 +437,14 @@ else
AC_DEFINE_UNQUOTED([unlikely(x)], [(x)], [gcc branch optimization])
fi
+if test "${GCC}" = "yes"; then
+ AC_DEFINE([__always_unused], [__attribute__((unused))], [gcc unused attribute])
+ AC_DEFINE([__maybe_unused], [__attribute__((unused))], [gcc unused attribute])
+else
+ AC_DEFINE([__always_unused], [], [dummy unused attribute])
+ AC_DEFINE([__maybe_unused], [], [dummy unused attribute])
+fi
+
if test "${enable_pedantic}" = "yes"; then
enable_strict="yes"
CFLAGS="${CFLAGS} -pedantic -Wall -Wextra -Wno-long-long"
@@ -816,17 +824,17 @@ if test "${have_libaws_cpp_sdk_core}" = "yes" -a "${have_libcrypto}" = "yes" -a
CXXFLAGS="${CXXFLAGS} -std=c++11"
AC_TRY_LINK(
- [
- #include <aws/core/Aws.h>
- #include <aws/core/client/ClientConfiguration.h>
- #include <aws/core/auth/AWSCredentials.h>
- #include <aws/core/utils/Outcome.h>
- #include <aws/kinesis/KinesisClient.h>
- #include <aws/kinesis/model/PutRecordRequest.h>
- ],
- [Aws::Kinesis::Model::PutRecordRequest request;],
- [have_libaws_cpp_sdk_kinesis=yes],
- [have_libaws_cpp_sdk_kinesis=no]
+ [
+ #include <aws/core/Aws.h>
+ #include <aws/core/client/ClientConfiguration.h>
+ #include <aws/core/auth/AWSCredentials.h>
+ #include <aws/core/utils/Outcome.h>
+ #include <aws/kinesis/KinesisClient.h>
+ #include <aws/kinesis/model/PutRecordRequest.h>
+ ],
+ [Aws::Kinesis::Model::PutRecordRequest request;],
+ [have_libaws_cpp_sdk_kinesis=yes],
+ [have_libaws_cpp_sdk_kinesis=no]
)
LIBS="${save_LIBS}"
@@ -879,12 +887,40 @@ PKG_CHECK_MODULES(
[have_libprotobuf=no]
)
-PKG_CHECK_MODULES(
- [SNAPPY],
- [snappy],
- [have_libsnappy=yes],
- [have_libsnappy=no]
-)
+AC_MSG_CHECKING([for snappy::RawCompress in -lsnappy])
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ save_LIBS="${LIBS}"
+ LIBS="-lsnappy"
+ save_CXXFLAGS="${CXXFLAGS}"
+ CXXFLAGS="${CXXFLAGS} -std=c++11"
+
+ AC_TRY_LINK(
+ [
+ #include <stdlib.h>
+ #include <snappy.h>
+ ],
+ [
+ const char *input = "test";
+ size_t compressed_length;
+ char *buffer = (char *)malloc(5 * sizeof(char));
+ snappy::RawCompress(input, 4, buffer, &compressed_length);
+ free(buffer);
+ ],
+ [
+ have_libsnappy=yes
+ SNAPPY_CFLAGS=""
+ SNAPPY_LIBS="-lsnappy"
+ ],
+ [have_libsnappy=no]
+ )
+
+ LIBS="${save_LIBS}"
+ CXXFLAGS="${save_CXXFLAGS}"
+ AC_LANG_RESTORE
+
+AC_MSG_RESULT([${have_libsnappy}])
AC_PATH_PROG([PROTOC], [protoc], [no])
AS_IF(
@@ -919,7 +955,7 @@ if test "${enable_backend_prometeus_remote_write}" != "no" -a "${have_libprotobu
AC_DEFINE([ENABLE_PROMETHEUS_REMOTE_WRITE], [1], [Prometheus remote write API usability])
OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS="${PROTOBUF_CFLAGS} ${SNAPPY_CFLAGS}"
CXX11FLAG="-std=c++11"
- OPTIONAL_PROMETHEUS_REMOTE_WRITE_LIBS="${PROTOBUF_LIBS} ${SNAPPY_LIBS} "
+ OPTIONAL_PROMETHEUS_REMOTE_WRITE_LIBS="${PROTOBUF_LIBS} ${SNAPPY_LIBS}"
else
enable_backend_prometheus_remote_write="no"
fi