write_stackdriver plugin: Check message for NULL before calling strdup().
[collectd.git] / Makefile.am
index ce8c92b..12d6fa4 100644 (file)
@@ -576,8 +576,8 @@ liboconfig_la_LDFLAGS = -avoid-version $(LEXLIB)
 
 if BUILD_WITH_LIBCURL
 if BUILD_WITH_LIBSSL
-if BUILD_WITH_LIBYAJL
-noinst_LTLIBRARIES += liboauth.la
+if BUILD_WITH_LIBYAJL2
+EXTRA_LTLIBRARIES += liboauth.la
 liboauth_la_SOURCES = \
        src/utils_oauth.c \
        src/utils_oauth.h
@@ -593,12 +593,49 @@ liboauth_la_LIBADD = \
 
 check_PROGRAMS += test_utils_oauth
 TESTS += test_utils_oauth
-test_utils_oauth_SOURCES = utils_oauth_test.c
-test_utils_oauth_LDADD = liboauth.la daemon/libcommon.la daemon/libplugin_mock.la
+test_utils_oauth_SOURCES = \
+       src/utils_oauth_test.c
+test_utils_oauth_LDADD = \
+       liboauth.la \
+       libcommon.la \
+       libplugin_mock.la
+
+EXTRA_LTLIBRARIES += libgce.la
+libgce_la_SOURCES = \
+       src/utils_gce.c \
+       src/utils_gce.h
+libgce_la_CPPFLAGS = \
+       $(AM_CPPFLAGS) \
+       $(BUILD_WITH_LIBCURL_CFLAGS)
+libgce_la_LIBADD = \
+       $(BUILD_WITH_LIBCURL_LIBS)
 endif
 endif
 endif
 
+if BUILD_WITH_LIBYAJL2
+EXTRA_LTLIBRARIES += libformat_stackdriver.la
+libformat_stackdriver_la_SOURCES = \
+       src/utils_format_stackdriver.c \
+       src/utils_format_stackdriver.h
+libformat_stackdriver_la_CPPFLAGS = \
+       $(AM_CPPFLAGS) \
+       $(BUILD_WITH_LIBYAJL_CPPFLAGS)
+libformat_stackdriver_la_LIBADD = \
+       libavltree.la \
+       $(BUILD_WITH_LIBSSL_LIBS) \
+       $(BUILD_WITH_LIBYAJL_LIBS)
+
+check_PROGRAMS += test_format_stackdriver
+TESTS += test_format_stackdriver
+test_format_stackdriver_SOURCES = \
+       src/utils_format_stackdriver_test.c \
+       src/testing.h
+test_format_stackdriver_LDADD = \
+       libformat_stackdriver.la \
+       libplugin_mock.la \
+       -lm
+endif
 
 if BUILD_PLUGIN_AGGREGATION
 pkglib_LTLIBRARIES += aggregation.la
@@ -2002,6 +2039,15 @@ write_sensu_la_SOURCES = src/write_sensu.c
 write_sensu_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 endif
 
+if BUILD_PLUGIN_WRITE_STACKDRIVER
+pkglib_LTLIBRARIES += write_stackdriver.la
+write_stackdriver_la_SOURCES = src/write_stackdriver.c
+write_stackdriver_la_LDFLAGS = $(PLUGIN_LDFLAGS)
+write_stackdriver_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBCURL_CFLAGS)
+write_stackdriver_la_LIBADD = libformat_stackdriver.la libgce.la liboauth.la \
+                     $(BUILD_WITH_LIBCURL_LIBS)
+endif
+
 if BUILD_PLUGIN_WRITE_TSDB
 pkglib_LTLIBRARIES += write_tsdb.la
 write_tsdb_la_SOURCES = src/write_tsdb.c