Skip to content
Browse files

Use pandora build system

Change-Id: Idd13e9c5460ba0ffebe5efcf53a00ec7b0b07a41
Reviewed-on: http://review.northscale.com/2185
Reviewed-by: Dustin Sallings <dustin@spy.net>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
  • Loading branch information...
1 parent b35e6fd commit 3dd4e50341dffe0fa74b8ff2fd6fcb7d37adad97 @trondn trondn committed Aug 30, 2010
Showing with 263 additions and 197 deletions.
  1. +20 −10 Makefile.am
  2. +15 −0 adhoc_commands.c
  3. +39 −165 configure.ac
  4. +23 −1 examples/bot.c
  5. +2 −0 logging.c
  6. +62 −0 m4/pandora_have_libcurl.m4
  7. +43 −0 m4/pandora_have_libstrophe.m4
  8. +1 −1 m4/pandora_use_pipe.m4
  9. +20 −9 m4/pandora_warnings.m4
  10. +18 −0 persist.c
  11. +3 −3 rest.c
  12. +8 −8 tests/Makefile.am
  13. +9 −0 xmpp.c
View
30 Makefile.am
@@ -11,19 +11,29 @@ pkgconfig_DATA = libconflate.pc
BUILT_SOURCES=
-SUBDIRS= $(MAYBE_LIBSTROPHE) . tests
-DIST_SUBDIRS = $(MAYBE_LIBSTROPHE) . tests
+SUBDIRS= . tests
+DIST_SUBDIRS = . tests
examples_bot_DEPENDENCIES = libconflate.la
examples_bot_SOURCES = examples/bot.c
-examples_bot_CFLAGS = $(libstrophe_CFLAGS)
-examples_bot_LDADD = -L. -lconflate @PROFILER_LDFLAGS@
-
-libconflate_la_CFLAGS = @PROFILER_FLAGS@ $(libstrophe_CFLAGS)
-libconflate_la_SOURCES = conflate.h conflate_internal.h conflate_convenience.h alarm.h rest.h\
- alarm.c kvpair.c util.c persist.c xmpp.c logging.c adhoc_commands.c \
- conflate.c rest.c
-libconflate_la_LIBADD = $(libstrophe_LIBS)
+examples_bot_LDADD = libconflate.la $(GCOV_LIBS)
+
+libconflate_la_SOURCES = adhoc_commands.c \
+ alarm.c \
+ alarm.h \
+ conflate.c \
+ conflate.h \
+ conflate_convenience.h \
+ conflate_internal.h \
+ kvpair.c \
+ logging.c \
+ persist.c \
+ rest.c \
+ rest.h \
+ util.c \
+ xmpp.c
+
+libconflate_la_LIBADD = $(LIBCONFLATE_LINKFLAGS) $(LTLIBCURL)
MOSTLYCLEANFILES = *.gcov *.gcno *.gcda *.tcov
View
15 adhoc_commands.c
@@ -17,6 +17,10 @@ static enum conflate_mgmt_cb_result process_serverlist(void *opaque,
kvpair_t *conf,
conflate_form_result *r)
{
+ (void)opaque;
+ (void)cmd;
+ (void)r;
+
/* If we have "config_is_private" set to "yes" we should only
process this if it's direct (i.e. ignore pubsub) */
if (!direct) {
@@ -52,6 +56,10 @@ static enum conflate_mgmt_cb_result process_set_private(void *opaque,
kvpair_t *form,
conflate_form_result *r)
{
+ (void)opaque;
+ (void)cmd;
+ (void)r;
+
/* Only direct stat requests are handled. */
assert(direct);
enum conflate_mgmt_cb_result rv = RV_ERROR;
@@ -78,6 +86,9 @@ static enum conflate_mgmt_cb_result process_get_private(void *opaque,
kvpair_t *form,
conflate_form_result *r)
{
+ (void)opaque;
+ (void)cmd;
+
/* Only direct stat requests are handled. */
assert(direct);
enum conflate_mgmt_cb_result rv = RV_ERROR;
@@ -109,6 +120,10 @@ static enum conflate_mgmt_cb_result process_delete_private(void *opaque,
kvpair_t *form,
conflate_form_result *r)
{
+ (void)opaque;
+ (void)cmd;
+ (void)r;
+
/* Only direct stat requests are handled. */
assert(direct);
enum conflate_mgmt_cb_result rv = RV_ERROR;
View
204 configure.ac
@@ -1,98 +1,19 @@
-AC_PREREQ(2.52)
-AC_INIT(libconflate, 1.0, dustin@spy.net)
+AC_PREREQ(2.59)
+m4_include([m4/version.m4])
+AC_INIT(libconflate, VERSION_NUMBER, dustin@spy.noet)
+AC_CONFIG_SRCDIR([conflate.h])
+AC_CONFIG_AUX_DIR(config)
+AM_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
-AC_CANONICAL_SYSTEM
-AC_CONFIG_SRCDIR(conflate.h)
-AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
-AM_CONFIG_HEADER(config.h)
-AC_PROG_LIBTOOL
+AC_DISABLE_STATIC
-AC_PROG_CC
-AC_PROG_CC_C99
+PANDORA_CANONICAL_TARGET(less-warnings, warnings-always-on, force-gcc42)
+PANDORA_REQUIRE_PTHREAD
+PANDORA_HAVE_LIBCURL
+PANDORA_HAVE_LIBSQLITE3
+PANDORA_HAVE_LIBSTROPHE
-dnl **********************************************************************
-dnl DETECT_ICC ([ACTION-IF-YES], [ACTION-IF-NO])
-dnl
-dnl check if this is the Intel ICC compiler, and if so run the ACTION-IF-YES
-dnl sets the $ICC variable to "yes" or "no"
-dnl **********************************************************************
-AC_DEFUN([DETECT_ICC],
-[
- ICC="no"
- AC_MSG_CHECKING([for icc in use])
- if test "$GCC" = "yes"; then
- dnl check if this is icc acting as gcc in disguise
- AC_EGREP_CPP([^__INTEL_COMPILER], [__INTEL_COMPILER],
- AC_MSG_RESULT([no])
- [$2],
- AC_MSG_RESULT([yes])
- [$1]
- ICC="yes")
- else
- AC_MSG_RESULT([no])
- [$2]
- fi
-])
-
-DETECT_ICC([], [])
-
-dnl **********************************************************************
-dnl DETECT_SUNCC ([ACTION-IF-YES], [ACTION-IF-NO])
-dnl
-dnl check if this is the Sun Studio compiler, and if so run the ACTION-IF-YES
-dnl sets the $SUNCC variable to "yes" or "no"
-dnl **********************************************************************
-AC_DEFUN([DETECT_SUNCC],
-[
- SUNCC="no"
- AC_MSG_CHECKING([for Sun cc in use])
- AC_EGREP_CPP([^__SUNPRO_C], [__SUNPRO_C],
- AC_MSG_RESULT([no])
- [$2],
- AC_MSG_RESULT([yes])
- [$1]
- SUNCC="yes")
-])
-
-AS_IF(test "$GCC" != "yes", DETECT_SUNCC([CFLAGS="-mt $CFLAGS"], []))
-
-AM_PROG_CC_C_O
-AC_PROG_INSTALL
-
-AC_ARG_ENABLE(coverage,
- [AS_HELP_STRING([--enable-coverage],
- [Enable code coverage @<:@default=off@:>@])],
- [ac_cv_enable_coverage="$enableval"],
- [ac_cv_enable_coverage="no"])
-
-AS_IF(test "x$enable_coverage" = "xyes", [
- AS_IF([ test "$ICC" = "yes" -o "$SUNCC" = "yes"],
- [ AC_MSG_ERROR([coverage only supported for gcc])])
- AC_PATH_PROG([PROFILER], [gcov], "no", [$PATH])
- AS_IF([test "x$PROFILER" = "xno"],
- [ AC_MSG_ERROR([Can't do code coverage without gcov])])
- AC_CHECK_LIB(gcov, main,
- [
- PROFILER_FLAGS="-fprofile-arcs -ftest-coverage"
- PROFILER_LDFLAGS="-lgcov"
- ], [
- AC_MSG_ERROR([Can't do code coverage without libgcov])])
- ])
-AC_SUBST(PROFILER_LDFLAGS)
-AC_SUBST(PROFILER_FLAGS)
-
-AC_SEARCH_LIBS(pthread_create, pthread,
- [], AC_MSG_ERROR([Can't enable pthreads.]))
-
-AC_ARG_WITH([curl],
- [AS_HELP_STRING([--with-curl=yes], [search libs for curl])])
-
-if test "x$with_curl" != "xno"; then
- AC_SEARCH_LIBS(curl_global_init, curl, [],
- AC_MSG_ERROR([Can't find curl]))
-else
- AC_MSG_NOTICE([skipping search for curl library])
-fi
+AC_HEADER_STDBOOL
AC_ARG_WITH([check],
[AS_HELP_STRING([--with-check=yes], [look for check tool for unit tests])])
@@ -103,97 +24,50 @@ else
PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
fi
-AC_HEADER_STDBOOL
-
AC_ARG_WITH([rest],
[AS_HELP_STRING([--without-rest],
[Use XMPP instead of REST (yes|no) @<:@default=no@:>@])],
[with_rest=$withval],
[with_rest=yes])
AC_ARG_WITH([sqlite],
- [AS_HELP_STRING([--with-sqlite=no], [use sqlite to store configs locally])])
-
-AC_ARG_WITH([bundled-libstrophe],
- [AS_HELP_STRING([--with-bundled-libstrophe=no], [force building with bundled libstrophe])])
-
-if test "x$with_sqlite" = "xyes"; then
- CFLAGS="$CFLAGS -DCONFLATE_USE_SQLITE"
- AC_SEARCH_LIBS(sqlite3_open, sqlite3, [],
- AC_MSG_ERROR([Can't locate sqlite3]))
-else
- CFLAGS="$CFLAGS -DCONFLATE_NO_SQLITE"
-fi
-
-if test "x$with_rest" = "xyes"; then
- CFLAGS="$CFLAGS -DCONFLATE_USE_REST"
-else
- CFLAGS="$CFLAGS -DCONFLATE_USE_XMPP"
-
- if test "x$with_bundled_libstrophe" = "xyes"; then
- libstrophe_pkg_missing=yes
- else
- PKG_CHECK_MODULES([libstrophe], [libstrophe], [], [
- libstrophe_pkg_missing=yes
- ])
- fi
-
- if test "x$libstrophe_pkg_missing" = "xyes"; then
- if test -f "$srcdir/libstrophe/configure"; then
- if test "x$with_bundled_libstrophe" = "xyes"; then
- AC_MSG_NOTICE([forced use of bundled libstrophe])
- else
- AC_MSG_NOTICE([will use bundled libstrophe])
- fi
- AC_CONFIG_SUBDIRS([libstrophe])
- libstrophe_CFLAGS='-I$(top_srcdir)/libstrophe'
- libstrophe_LIBS="-Llibstrophe -lstrophe"
- AC_SUBST([MAYBE_LIBSTROPHE], [libstrophe])
- else
- if test "x$with_bundled_libstrophe" = "xyes"; then
- AC_MSG_FAILURE([use of bundled libstrophe is requested, but libstrophe/configure is missing])
- fi
- AC_MSG_CHECKING([for old version of libstrophe])
- AC_CHECK_HEADER(strophe.h,
- [], AC_MSG_ERROR([Ensure strophe.h is available.]))
- AC_SEARCH_LIBS(xmpp_initialize, strophe,
- [], AC_MSG_ERROR([Can't find libstrophe.]))
- fi
- fi
-fi
-
-AM_CONDITIONAL([BUILD_BUNDLED_LIBSTROPHE], [test "x$build_bundled_libstrophe" = xyes])
-
-AC_C_CONST
+ [AS_HELP_STRING([--with-sqlite], [Use sqlite to store configs locally @<:@default=no@:>@])],
+ [with_sqlite=$withval],
+ [with_sqlite=no])
+
+AS_IF([test "x$with_sqlite" = "xyes" ],
+ [ AS_IF([test "x${ac_cv_libsqlite3}" != "xyes"],
+ AC_MSG_ERROR([libsqlite3 is required for ${PACKAGE}]))
+ AM_CFLAGS="$AM_CFLAGS -DCONFLATE_USE_SQLITE"
+ LIBCONFLATE_LINKFLAGS="$LTLIBSQLITE3"
+ ],
+ [AM_CFLAGS="$AM_CFLAGS -DCONFLATE_NO_SQLITE"])
+
+AS_IF([test "x$with_rest" = "xyes"],
+ [AM_CFLAGS="$AM_CFLAGS -DCONFLATE_USE_REST"],
+ [AS_IF([test "x${ac_cv_libstrophe}" != "xyes"],
+ AC_MSG_ERROR([libstrophe is required for ${PACKAGE}]))
+ AM_CFLAGS="$AM_CFLAGS -DCONFLATE_USE_XMPP"
+ LIBCONFLATE_LINKFLAGS="$LIBCONFLATE_LINKFLAGS $LTLIBSTROPHE"
+ ])
+
+AC_SUBST(LIBCONFLATE_LINKFLAGS)
AC_CHECK_HEADERS_ONCE([syslog.h])
AC_CHECK_FUNCS_ONCE(strsep)
AH_BOTTOM([
+/* There is a problem with some of the macros in typecheck-gcc.h that
+** generates warnings with -Wlogical-op. Just disable the checks instead
+*/
+#define __CURL_TYPECHECK_GCC_H 1
+
#ifdef WIN32
#include <windows.h>
#define pause(a) while (1) { Sleep(100000); }
#define sleep(a) Sleep(a * 1000)
#endif
])
-
-dnl Let the compiler be a bit more picky. Please note that you cannot
-dnl specify these flags to the compiler before AC_CHECK_FUNCS, because
-dnl the test program will generate a compilation warning and hence fail
-dnl to detect the function ;-)
-dnl Lines borrowed from memcached.
-if test "$ICC" = "yes"
-then
- dnl ICC trying to be gcc.
- CFLAGS="$CFLAGS -w2 -Wcheck -Wall -Werror"
-elif test "$GCC" = "yes"
-then
- CFLAGS="$CFLAGS -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls"
-elif test "$SUNCC" = "yes"
-then
- CFLAGS="$CFLAGS -errfmt=error -erroff=E_ATTRIBUTE_UNKNOWN"
-fi
-
AC_CONFIG_FILES(Makefile tests/Makefile libconflate.pc)
AC_OUTPUT
View
24 examples/bot.c
@@ -21,6 +21,7 @@
*/
static bool config_visitor(void *opaque, const char *key, const char **values)
{
+ (void)opaque;
printf("\t%s\n", key);
for (int i = 0; values[i]; i++) {
@@ -51,6 +52,10 @@ static enum conflate_mgmt_cb_result process_stats(void *opaque,
kvpair_t *form,
conflate_form_result *r)
{
+ (void)opaque;
+ (void)handle;
+ (void)cmd;
+
/* Only direct stat requests are handled. */
assert(direct);
@@ -75,6 +80,11 @@ static enum conflate_mgmt_cb_result process_reset_stats(void *opaque,
kvpair_t *form,
conflate_form_result *r)
{
+ (void)opaque;
+ (void)handle;
+ (void)cmd;
+ (void)direct;
+ (void)r;
char *subtype = get_simple_kvpair_val(form, "-subtype-");
fprintf(stderr, "Handling stats reset with subtype: %s\n",
@@ -93,6 +103,11 @@ static enum conflate_mgmt_cb_result process_ping_test(void *opaque,
kvpair_t *form,
conflate_form_result *r)
{
+ (void)opaque;
+ (void)handle;
+ (void)cmd;
+ (void)direct;
+
kvpair_t *servers_p = find_kvpair(form, "servers");
if (!servers_p) {
return RV_BADARG;
@@ -122,7 +137,14 @@ static enum conflate_mgmt_cb_result process_alarm_create(void *opaque,
kvpair_t *form,
conflate_form_result *r)
{
- if(add_alarm(handle->alarms, "test", "This is a test alarm!")) {
+ (void)opaque;
+ (void)handle;
+ (void)cmd;
+ (void)direct;
+ (void)form;
+ (void)r;
+
+ if(add_alarm(handle->alarms, "test", "This is a test alarm!")) {
fprintf(stderr, "Created alarm!\n");
} else {
fprintf(stderr, "Error queueing an alarm.\n");
View
2 logging.c
@@ -50,6 +50,7 @@ static int prio_map(enum conflate_log_level lvl)
void conflate_syslog_logger(void *userdata, enum conflate_log_level lvl,
const char *msg, ...)
{
+ (void)userdata;
char fmt[strlen(msg) + 16];
snprintf(fmt, sizeof(fmt), "%s: %s\n", lvl_name(lvl), msg);
@@ -63,6 +64,7 @@ void conflate_syslog_logger(void *userdata, enum conflate_log_level lvl,
void conflate_stderr_logger(void *userdata, enum conflate_log_level lvl,
const char *msg, ...)
{
+ (void)userdata;
char fmt[strlen(msg) + 16];
snprintf(fmt, sizeof(fmt), "%s: %s\n", lvl_name(lvl), msg);
View
62 m4/pandora_have_libcurl.m4
@@ -0,0 +1,62 @@
+dnl Copyright (C) 2010 Monty Taylor
+dnl This file is free software; Monty Taylor
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([_PANDORA_SEARCH_LIBCURL],[
+ AC_REQUIRE([AC_LIB_PREFIX])
+
+ dnl --------------------------------------------------------------------
+ dnl Check for libcurl
+ dnl --------------------------------------------------------------------
+
+ AC_ARG_ENABLE([libcurl],
+ [AS_HELP_STRING([--disable-libcurl],
+ [Build with libcurl support @<:@default=on@:>@])],
+ [ac_enable_libcurl="$enableval"],
+ [ac_enable_libcurl="yes"])
+
+ AS_IF([test "x$ac_enable_libcurl" = "xyes"],[
+ AC_LIB_HAVE_LINKFLAGS(curl,,
+ [#include <curl/curl.h>],
+ [
+ CURL *handle;
+ handle=curl_easy_init();
+ ])
+ ],[
+ ac_cv_libcurl="no"
+ ])
+
+ AC_CACHE_CHECK([if libcurl has CURLOPT_USERNAME],
+ [pandora_cv_curl_have_username],[
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM(
+ [[
+ CURL *handle;
+ handle=curl_easy_init();
+ rv= curl_easy_setopt(curl_handle, CURLOPT_USERNAME, "foo");
+ ]])],
+ [pandora_cv_curl_have_username=yes],
+ [pandora_cv_curl_have_username=no])
+ ])
+
+ AM_CONDITIONAL(HAVE_LIBCURL,[test "x${ac_cv_libcurl}" = "xyes"])
+ AS_IF([test "x$pandora_cv_curl_have_username" = "xyes"],
+ AC_DEFINE([HAVE_CURLOPT_USERNAME],[1],
+ [Does libcurl provide the CURLOPT_USERNAME constant]))
+
+])
+
+AC_DEFUN([PANDORA_HAVE_LIBCURL],[
+ AC_REQUIRE([_PANDORA_SEARCH_LIBCURL])
+ AS_IF([test "x${ac_cv_libcurl}" = "xno"],[
+ AC_MSG_WARN([libcurl development lib not found. On Debian this is found in libcurl4-gnutls-dev. On RHEL5/Fedora11 it's in curl-devel. On RHEL6/Fedora12 it's in libcurl-devel.])
+ ])
+])
+
+AC_DEFUN([PANDORA_REQUIRE_LIBCURL],[
+ PANDORA_HAVE_LIBCURL($1)
+ AS_IF([test "x${ac_cv_libcurl}" = "xno"],[
+ AC_MSG_ERROR([libcurl is required for ${PACKAGE}])
+ ])
+])
View
43 m4/pandora_have_libstrophe.m4
@@ -0,0 +1,43 @@
+dnl Copyright (C) 2010 NorthScale
+dnl This file is free software; NorthScale
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+AC_DEFUN([_PANDORA_SEARCH_LIBSTROPHE],[
+ AC_REQUIRE([AC_LIB_PREFIX])
+
+ dnl --------------------------------------------------------------------
+ dnl Check for libstrophe
+ dnl --------------------------------------------------------------------
+
+ AC_ARG_ENABLE([libstrophe],
+ [AS_HELP_STRING([--disable-libstrophe],
+ [Build with libstrophe support @<:@default=on@:>@])],
+ [ac_enable_libstrophe="$enableval"],
+ [ac_enable_libstrophe="yes"])
+
+ AS_IF([test "x$ac_enable_libstrophe" = "xyes"],[
+ AC_LIB_HAVE_LINKFLAGS(strophe,,[
+ #include <stdio.h>
+ #include <strophe.h>
+ ],[
+ xmpp_conn_t *conn = NULL;
+ xmpp_ctx_t *ctx = NULL;
+ xmpp_stanza_t *reply = NULL;
+ xmpp_initialize();
+ ])
+ ],[
+ ac_cv_libstrophe="no"
+ ])
+
+ AM_CONDITIONAL(HAVE_LIBSTROPHE, [test "x${ac_cv_libstrophe}" = "xyes"])
+])
+
+AC_DEFUN([PANDORA_HAVE_LIBSTROPHE],[
+ AC_REQUIRE([_PANDORA_SEARCH_LIBSTROPHE])
+])
+
+AC_DEFUN([PANDORA_REQUIRE_LIBSTROPHE],[
+ AC_REQUIRE([PANDORA_HAVE_LIBSTROPHE])
+ AS_IF([test x$ac_cv_libstrophe = xno],
+ AC_MSG_ERROR([libstrophe is required for ${PACKAGE}]))
+])
View
2 m4/pandora_use_pipe.m4
@@ -16,7 +16,7 @@ AC_DEFUN([PANDORA_USE_PIPE],[
AS_IF([test "$GCC" = "yes"],[
AC_CACHE_CHECK([for working -pipe], [pandora_cv_use_pipe], [
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <stdio.h>
int main(int argc, char** argv)
View
29 m4/pandora_warnings.m4
@@ -30,7 +30,7 @@ AC_DEFUN([PANDORA_WARNINGS],[
AC_REQUIRE([PANDORA_BUILDING_FROM_VC])
m4_if(PW_WARN_ALWAYS_ON, [yes],
[ac_cv_warnings_as_errors=yes],
- AS_IF([test "$ac_cv_building_from_vc" = "yes"],
+ AS_IF([test "$pandora_building_from_vc" = "yes"],
[ac_cv_warnings_as_errors=yes],
[ac_cv_warnings_as_errors=no]))
@@ -50,6 +50,7 @@ AC_DEFUN([PANDORA_WARNINGS],[
AS_IF([test "$ac_profiling" = "yes"],[
CC_PROFILING="-pg"
+ GCOV_LIBS="-pg -lgcov"
save_LIBS="${LIBS}"
LIBS=""
AC_CHECK_LIB(c_p, read)
@@ -61,7 +62,12 @@ AC_DEFUN([PANDORA_WARNINGS],[
])
AS_IF([test "$ac_coverage" = "yes"],
- [CC_COVERAGE="-fprofile-arcs -ftest-coverage"])
+ [
+ CC_COVERAGE="--coverage"
+ GCOV_LIBS="-lgcov"
+ ])
+
+
AS_IF([test "$ac_cv_warnings_as_errors" = "yes"],
[W_FAIL="-Werror"])
@@ -129,17 +135,19 @@ uint16_t x= htons(80);
AS_IF([test "$INTELCC" = "yes"],[
m4_if(PW_LESS_WARNINGS,[no],[
- BASE_WARNINGS="-w1 -Wall -Werror -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual"
+ BASE_WARNINGS="-w1 -Werror -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual"
],[
- BASE_WARNINGS="-w1 -Wall -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 981"
+ BASE_WARNINGS="-w1 -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 981"
])
CC_WARNINGS="${BASE_WARNINGS}"
CXX_WARNINGS="${BASE_WARNINGS}"
],[
m4_if(PW_LESS_WARNINGS,[no],[
BASE_WARNINGS_FULL="-Wformat=2 ${W_CONVERSION} -Wstrict-aliasing"
CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings"
- #CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast"
+ CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast"
+ NO_OLD_STYLE_CAST="-Wno-old-style-cast"
+ NO_EFF_CXX="-Wno-effc++"
],[
BASE_WARNINGS_FULL="-Wformat ${NO_STRICT_ALIASING}"
])
@@ -217,8 +225,8 @@ template <> void C<int>::foo();
AC_INCLUDES_DEFAULT])],
[ac_cv_safe_to_use_Wredundant_decls_=yes],
[ac_cv_safe_to_use_Wredundant_decls_=no])
- CXXFLAGS="${save_CXXFLAGS}"
- AC_LANG_POP()])
+ CXXFLAGS="${save_CXXFLAGS}"
+ AC_LANG_POP()])
AS_IF([test "$ac_cv_safe_to_use_Wredundant_decls_" = "yes"],
[CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"],
[CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"])
@@ -323,8 +331,8 @@ inline const EnumDescriptor* GetEnumDescriptor<Table_TableOptions_RowType>() {
CXX_WARNINGS_FULL="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint"
])
- CC_WARNINGS="-v -errtags=yes ${W_FAIL} ${CC_WARNINGS_FULL}"
- CXX_WARNINGS="+w +w2 -xwe -xport64 -errtags=yes ${CXX_WARNINGS_FULL} ${W_FAIL}"
+ CC_WARNINGS="-v -errtags=yes ${W_FAIL} ${CC_WARNINGS_FULL} ${CFLAG_VISIBILITY}"
+ CXX_WARNINGS="+w +w2 -xwe -xport64 -errtags=yes ${CXX_WARNINGS_FULL} ${W_FAIL} ${CFLAG_VISIBILITY}"
PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn,partinit,notused,badargtype2w,wbadinit"
NO_UNREACHED="-erroff=E_STATEMENT_NOT_REACHED"
NO_WERROR="-errwarn=%none"
@@ -336,8 +344,11 @@ inline const EnumDescriptor* GetEnumDescriptor<Table_TableOptions_RowType>() {
AC_SUBST(NO_UNREACHED)
AC_SUBST(NO_SHADOW)
AC_SUBST(NO_STRICT_ALIASING)
+ AC_SUBST(NO_EFF_CXX)
+ AC_SUBST(NO_OLD_STYLE_CAST)
AC_SUBST(PROTOSKIP_WARNINGS)
AC_SUBST(INNOBASE_SKIP_WARNINGS)
AC_SUBST(NO_WERROR)
+ AC_SUBST([GCOV_LIBS])
])
View
18 persist.c
@@ -47,6 +47,7 @@ struct table_mask_userdata {
static int set_table_mask(void* arg, int n, char **vals, char **cols)
{
+ (void)cols;
struct table_mask_userdata *udata = (struct table_mask_userdata*)arg;
assert(n == 1);
@@ -267,6 +268,8 @@ bool save_kvpairs(conflate_handle_t *handle, kvpair_t* kvpair,
static int append_kvpair_from_db(void* arg, int n, char **vals, char **cols)
{
+ (void)n;
+ (void)cols;
kvpair_t** pairs = (kvpair_t**)arg;
kvpair_t* pair = find_kvpair(*pairs, vals[0]);
@@ -456,30 +459,45 @@ char *conflate_get_private(conflate_handle_t *handle,
kvpair_t* load_kvpairs(conflate_handle_t *handle, const char *filename)
{
+ (void)handle;
+ (void)filename;
return NULL;
}
bool save_kvpairs(conflate_handle_t *handle, kvpair_t* kvpair,
const char *filename)
{
+ (void)handle;
+ (void)kvpair;
+ (void)filename;
return true;
}
bool conflate_delete_private(conflate_handle_t *handle,
const char *k, const char *filename)
{
+ (void)handle;
+ (void)k;
+ (void)filename;
return true;
}
bool conflate_save_private(conflate_handle_t *handle,
const char *k, const char *v, const char *filename)
{
+ (void)handle;
+ (void)k;
+ (void)v;
+ (void)filename;
return true;
}
char *conflate_get_private(conflate_handle_t *handle,
const char *k, const char *filename)
{
+ (void)handle;
+ (void)k;
+ (void)filename;
return NULL;
}
View
6 rest.c
@@ -157,17 +157,17 @@ static size_t handle_response(void *data, size_t s, size_t num, void *cb) {
static void setup_handle(CURL *handle, char *user, char *pass, char *uri,
char *uri_suffix, conflate_handle_t *chandle,
- size_t (handle_response)(void *, size_t, size_t, void *)) {
+ size_t (response_handler)(void *, size_t, size_t, void *)) {
size_t buff_size = strlen(uri) + strlen (uri_suffix) + 1;
char *url = (char *) malloc(buff_size);
if (url != NULL) {
snprintf(url,buff_size,"%s%s",uri,uri_suffix);
CURLcode c;
- c = curl_easy_setopt(handle,CURLOPT_WRITEDATA,chandle);
+ c = curl_easy_setopt(handle, CURLOPT_WRITEDATA, chandle);
assert(c == CURLE_OK);
- c = curl_easy_setopt(handle,CURLOPT_WRITEFUNCTION,handle_response);
+ c = curl_easy_setopt(handle,CURLOPT_WRITEFUNCTION,response_handler);
assert(c == CURLE_OK);
c = curl_easy_setopt(handle,CURLOPT_URL,url);
assert(c == CURLE_OK);
View
16 tests/Makefile.am
@@ -2,17 +2,17 @@ TESTS = check_kvpair check_xmpp check_persist check_alarm
check_PROGRAMS = check_kvpair check_xmpp check_persist check_alarm
check_kvpair_SOURCES = check_kvpair.c test_common.c $(top_builddir)/conflate.h test_common.h
-check_kvpair_CFLAGS = @CHECK_CFLAGS@ $(libstrophe_CFLAGS)
-check_kvpair_LDADD = $(top_builddir)/libconflate.la @CHECK_LIBS@ @PROFILER_LDFLAGS@
+check_kvpair_CFLAGS = @CHECK_CFLAGS@
+check_kvpair_LDADD = $(top_builddir)/libconflate.la @CHECK_LIBS@ $(GCOV_LIBS)
check_xmpp_SOURCES = check_xmpp.c $(top_builddir)/conflate.h test_common.h
-check_xmpp_CFLAGS = @CHECK_CFLAGS@ $(libstrophe_CFLAGS)
-check_xmpp_LDADD = $(top_builddir)/libconflate.la @CHECK_LIBS@ @PROFILER_LDFLAGS@
+check_xmpp_CFLAGS = @CHECK_CFLAGS@
+check_xmpp_LDADD = $(top_builddir)/libconflate.la @CHECK_LIBS@ $(GCOV_LIBS)
check_persist_SOURCES = check_persist.c test_common.c $(top_builddir)/conflate.h test_common.h
-check_persist_CFLAGS = @CHECK_CFLAGS@ $(libstrophe_CFLAGS)
-check_persist_LDADD = $(top_builddir)/libconflate.la @CHECK_LIBS@ @PROFILER_LDFLAGS@
+check_persist_CFLAGS = @CHECK_CFLAGS@
+check_persist_LDADD = $(top_builddir)/libconflate.la @CHECK_LIBS@ $(GCOV_LIBS)
check_alarm_SOURCES = check_alarm.c $(top_builddir)/alarm.h test_common.h
-check_alarm_CFLAGS = @CHECK_CFLAGS@ $(libstrophe_CFLAGS)
-check_alarm_LDADD = $(top_builddir)/libconflate.la @CHECK_LIBS@ @PROFILER_LDFLAGS@
+check_alarm_CFLAGS = @CHECK_CFLAGS@
+check_alarm_LDADD = $(top_builddir)/libconflate.la @CHECK_LIBS@ $(GCOV_LIBS)
View
9 xmpp.c
@@ -747,22 +747,31 @@ void* run_conflate(void *arg) {
void conflate_init_form(conflate_form_result *r)
{
+ (void)r;
}
void conflate_next_fieldset(conflate_form_result *r) {
+ (void)r;
assert(0);
}
void conflate_add_field(conflate_form_result *r, const char *k, const char *v) {
+ (void)r;
+ (void)k;
+ (void)v;
assert(0);
}
void conflate_add_field_multi(conflate_form_result *r, const char *k,
const char **v) {
+ (void)r;
+ (void)k;
+ (void)v;
assert(0);
}
void* run_conflate(void *arg) {
+ (void)arg;
assert(0);
return NULL;
}

0 comments on commit 3dd4e50

Please sign in to comment.
Something went wrong with that request. Please try again.