From: Brian Aker Date: Sun, 9 Sep 2012 01:35:56 +0000 (-0400) Subject: Compiler fixes. X-Git-Tag: 1.0.11~1^2~8 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=31048f6090b7c82605d2bbf7653d9884a14fe45b;p=awesomized%2Flibmemcached Compiler fixes. --- diff --git a/clients/utilities.h b/clients/utilities.h index d036bccc..da973b5f 100644 --- a/clients/utilities.h +++ b/clients/utilities.h @@ -49,10 +49,10 @@ extern "C" { char *strdup_cleanup(const char *str); void cleanup(void); long int timedif(struct timeval a, struct timeval b); -void version_command(const char *command_name); +void version_command(const char *command_name) __attribute__ ((noreturn)); void help_command(const char *command_name, const char *description, const struct option *long_options, - memcached_programs_help_st *options); + memcached_programs_help_st *options) __attribute__ ((noreturn)); void process_hash_option(memcached_st *memc, char *opt_hash); bool initialize_sasl(memcached_st *memc, char *user, char *password); void shutdown_sasl(void); diff --git a/configure.ac b/configure.ac index eeaccd82..83177bca 100644 --- a/configure.ac +++ b/configure.ac @@ -286,8 +286,11 @@ fi AX_CHECK_SOCK_CLOEXEC([AC_DEFINE([HAVE_SOCK_CLOEXEC], [1], [Check for SOCK_CLOEXEC.])], [AC_DEFINE([HAVE_SOCK_CLOEXEC], [0], [Check for SOCK_CLOEXEC.])]) +AX_PTHREAD(, [AC_MSG_ERROR(could not find libpthread)]) + AX_HARDEN_COMPILER_FLAGS -AX_PTHREAD + +AX_DEBUG AC_CONFIG_FILES([ Makefile diff --git a/m4/debug.m4 b/m4/debug.m4 new file mode 100644 index 00000000..60557659 --- /dev/null +++ b/m4/debug.m4 @@ -0,0 +1,18 @@ +AC_DEFUN([AX_DEBUG],[ + AC_ARG_WITH([debug], + [AS_HELP_STRING([--with-debug], + [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])], + [with_debug=$withval], + [with_debug=no]) + AS_IF([test "$with_debug" = "yes"],[ + # Debugging. No optimization. + AM_CFLAGS="${AM_CFLAGS} ${DEBUG_CFLAGS} -DDEBUG" + AM_CXXFLAGS="${AM_CXXFLAGS} ${DEBUG_CXXFLAGS} -DDEBUG" + AC_DEFINE(DEBUG, [ 1 ], [Define to 1 to enable debugging code.]) + ],[ + # Optimized version. No debug + AM_CFLAGS="${AM_CFLAGS} ${OPTIMIZE_CFLAGS}" + AM_CXXFLAGS="${AM_CXXFLAGS} ${OPTIMIZE_CXXFLAGS}" + AC_DEFINE(DEBUG, [ 0 ], [Define to 1 to enable debugging code.]) + ]) +])