From: Brian Aker Date: Sun, 16 Sep 2012 06:58:44 +0000 (-0400) Subject: Update m4 rules. X-Git-Tag: 1.0.11~1^2~2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=f5b5250c862c98dadbe30cebc1f92962c76125c3;p=m6w6%2Flibmemcached Update m4 rules. --- diff --git a/ChangeLog b/ChangeLog index 7005b567..868923e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -1.0.10 Sun Jul 29 21:50:15 PDT 2012 +1.0.10 * --disable-assert has been removed from configure, and --enable-assert has been added in its place. * Compiling fixes for Clang on OSX Mountain Lion. diff --git a/bootstrap.sh b/bootstrap.sh index 109767bc..b8c45e51 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,8 +1,47 @@ #!/bin/bash +# +# Copyright (C) 2012 Brian Aker +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# +# * The names of its contributors may not be used to endorse or +# promote products derived from this software without specific prior +# written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -if test -f configure; then make clean; make merge-clean; make distclean; fi; +if test -n $MAKE; then + MAKE="make" +fi + +if test -n $MAKE_J; then + MAKE_J="-j2" +fi -rm -r -f autom4te.cache/ config.h config.log config.status +if test -f configure; then $MAKE $MAKE_J clean; $MAKE $MAKE_J merge-clean; $MAKE $MAKE_J distclean; fi; + +rm -r -f autom4te.cache/ config.h config.log config.status configure ./config/autorun.sh if [ $(uname) = "Darwin" ]; then @@ -10,4 +49,7 @@ then else ./configure --enable-assert fi -make + +if test -z $JENKINS_URL; then +$MAKE $MAKE_J +fi diff --git a/m4/ax_harden_compiler_flags.m4 b/m4/ax_harden_compiler_flags.m4 index 8cc288ab..4cdf0147 100644 --- a/m4/ax_harden_compiler_flags.m4 +++ b/m4/ax_harden_compiler_flags.m4 @@ -47,66 +47,72 @@ # The Following flags are not checked for # -Wdeclaration-after-statement is counter to C99 +# AX_APPEND_COMPILE_FLAGS([-std=c++11]) -- Not ready yet +# AX_APPEND_COMPILE_FLAGS([-pedantic]) -- ? +# AX_APPEND_COMPILE_FLAGS([-Wstack-protector]) -- Issues on 32bit compile +# AX_APPEND_COMPILE_FLAGS([-fstack-protector-all]) -- Issues on 32bit compile #serial 1 -AC_DEFUN([AX_HARDEN_COMPILER_FLAGS], -[AC_REQUIRE([AX_APPEND_COMPILE_FLAGS]) -AC_REQUIRE([AX_CHECK_LINK_FLAG]) -AC_LANG_PUSH([C]) -AX_APPEND_COMPILE_FLAGS([-O2]) -AX_APPEND_COMPILE_FLAGS([-Werror]) -AX_APPEND_COMPILE_FLAGS([-Wall]) -AX_APPEND_COMPILE_FLAGS([-Wextra]) -AX_APPEND_COMPILE_FLAGS([-std=c99]) -AX_APPEND_COMPILE_FLAGS([-Wbad-function-cast]) -AX_APPEND_COMPILE_FLAGS([-Wmissing-prototypes]) -AX_APPEND_COMPILE_FLAGS([-Wnested-externs]) -AX_APPEND_COMPILE_FLAGS([-Wold-style-definition]) -AX_APPEND_COMPILE_FLAGS([-Woverride-init]) -AX_APPEND_COMPILE_FLAGS([-Wstrict-prototypes]) -AC_LANG_POP -AC_LANG_PUSH([C++]) -AX_APPEND_COMPILE_FLAGS([-O2]) -AX_APPEND_COMPILE_FLAGS([-Werror]) -AX_APPEND_COMPILE_FLAGS([-Wall]) -AX_APPEND_COMPILE_FLAGS([-Wextra]) -dnl AX_APPEND_COMPILE_FLAGS([-std=c++11]) -AX_APPEND_COMPILE_FLAGS([-Wpragmas]) -dnl AX_APPEND_COMPILE_FLAGS([-pedantic]) -AX_APPEND_COMPILE_FLAGS([--paramssp-buffer-size=1]) -AX_APPEND_COMPILE_FLAGS([-D_FORTIFY_SOURCE=2]) -AX_APPEND_COMPILE_FLAGS([-Waddress]) -AX_APPEND_COMPILE_FLAGS([-Warray-bounds]) -AX_APPEND_COMPILE_FLAGS([-Wchar-subscripts]) -AX_APPEND_COMPILE_FLAGS([-Wcomment]) -AX_APPEND_COMPILE_FLAGS([-Wctor-dtor-privacy]) -AX_APPEND_COMPILE_FLAGS([-Wfloat-equal]) -AX_APPEND_COMPILE_FLAGS([-Wformat=2]) -dnl AX_APPEND_COMPILE_FLAGS([-Wlong-long]) -AX_APPEND_COMPILE_FLAGS([-Wmaybe-uninitialized]) -AX_APPEND_COMPILE_FLAGS([-Wmissing-field-initializers]) -AX_APPEND_COMPILE_FLAGS([-Wmissing-noreturn]) -AX_APPEND_COMPILE_FLAGS([-Wnon-virtual-dtor]) -AX_APPEND_COMPILE_FLAGS([-Wnormalized=id]) -AX_APPEND_COMPILE_FLAGS([-Woverloaded-virtual]) -AX_APPEND_COMPILE_FLAGS([-Wpointer-arith]) -AX_APPEND_COMPILE_FLAGS([-Wredundant-decls]) -AX_APPEND_COMPILE_FLAGS([-Wshadow]) -AX_APPEND_COMPILE_FLAGS([-Wshorten-64-to-32]) -AX_APPEND_COMPILE_FLAGS([-Wsign-compare]) -AX_APPEND_COMPILE_FLAGS([-Wstack-protector]) -AX_APPEND_COMPILE_FLAGS([-Wstrict-overflow=1]) -AX_APPEND_COMPILE_FLAGS([-Wswitch-enum]) -AX_APPEND_COMPILE_FLAGS([-Wundef]) -AX_APPEND_COMPILE_FLAGS([-Wunused-result]) -AX_APPEND_COMPILE_FLAGS([-Wunused-variable]) -AX_APPEND_COMPILE_FLAGS([-Wwrite-strings]) -AX_APPEND_COMPILE_FLAGS([-floop-parallelize-all]) -AX_APPEND_COMPILE_FLAGS([-fstack-protector-all]) -AX_APPEND_COMPILE_FLAGS([-fwrapv]) -AX_APPEND_COMPILE_FLAGS([-ggdb]) -AX_CHECK_LINK_FLAG([-Werror]) -AX_CHECK_LINK_FLAG([-z relro -z now]) -AC_LANG_POP -])dnl AX_HARDEN_COMPILER_FLAGS + AC_DEFUN([AX_HARDEN_C_COMPILER_FLAGS], [ + AC_REQUIRE([AX_APPEND_COMPILE_FLAGS]) + AC_REQUIRE([AX_CHECK_LINK_FLAG]) + AC_REQUIRE([AX_VCS_CHECKOUT]) + + AC_LANG_PUSH([C]) + AX_APPEND_COMPILE_FLAGS([-O2]) + AX_APPEND_COMPILE_FLAGS([-Werror]) + AX_APPEND_COMPILE_FLAGS([-Wall]) + AX_APPEND_COMPILE_FLAGS([-Wextra]) + AX_APPEND_COMPILE_FLAGS([-std=c99]) + AX_APPEND_COMPILE_FLAGS([-Wbad-function-cast]) + AX_APPEND_COMPILE_FLAGS([-Wmissing-prototypes]) + AX_APPEND_COMPILE_FLAGS([-Wnested-externs]) + AX_APPEND_COMPILE_FLAGS([-Wold-style-definition]) + AX_APPEND_COMPILE_FLAGS([-Woverride-init]) + AX_APPEND_COMPILE_FLAGS([-Wstrict-prototypes]) + AC_LANG_POP + ]) + + AC_DEFUN([AX_HARDEN_CC_COMPILER_FLAGS], [ + AC_REQUIRE([AX_HARDEN_C_COMPILER_FLAGS]) + AC_LANG_PUSH([C++]) + AX_APPEND_COMPILE_FLAGS([-O2]) + AX_APPEND_COMPILE_FLAGS([-Werror]) + AX_APPEND_COMPILE_FLAGS([-Wall]) + AX_APPEND_COMPILE_FLAGS([-Wextra]) + AX_APPEND_COMPILE_FLAGS([-Wpragmas]) + AX_APPEND_COMPILE_FLAGS([--paramssp-buffer-size=1]) + AX_APPEND_COMPILE_FLAGS([-D_FORTIFY_SOURCE=2]) + AX_APPEND_COMPILE_FLAGS([-Waddress]) + AX_APPEND_COMPILE_FLAGS([-Warray-bounds]) + AX_APPEND_COMPILE_FLAGS([-Wchar-subscripts]) + AX_APPEND_COMPILE_FLAGS([-Wcomment]) + AX_APPEND_COMPILE_FLAGS([-Wctor-dtor-privacy]) + AX_APPEND_COMPILE_FLAGS([-Wfloat-equal]) + AX_APPEND_COMPILE_FLAGS([-Wformat=2]) + AX_APPEND_COMPILE_FLAGS([-Wlong-long]) + AX_APPEND_COMPILE_FLAGS([-Wmaybe-uninitialized]) + AX_APPEND_COMPILE_FLAGS([-Wmissing-field-initializers]) + AX_APPEND_COMPILE_FLAGS([-Wmissing-noreturn]) + AX_APPEND_COMPILE_FLAGS([-Wnon-virtual-dtor]) + AX_APPEND_COMPILE_FLAGS([-Wnormalized=id]) + AX_APPEND_COMPILE_FLAGS([-Woverloaded-virtual]) + AX_APPEND_COMPILE_FLAGS([-Wpointer-arith]) + AX_APPEND_COMPILE_FLAGS([-Wredundant-decls]) + AX_APPEND_COMPILE_FLAGS([-Wshadow]) + AX_APPEND_COMPILE_FLAGS([-Wshorten-64-to-32]) + AX_APPEND_COMPILE_FLAGS([-Wsign-compare]) + AX_APPEND_COMPILE_FLAGS([-Wstrict-overflow=1]) + AX_APPEND_COMPILE_FLAGS([-Wswitch-enum]) + AX_APPEND_COMPILE_FLAGS([-Wundef]) + AX_APPEND_COMPILE_FLAGS([-Wunused-result]) + AX_APPEND_COMPILE_FLAGS([-Wunused-variable]) + AX_APPEND_COMPILE_FLAGS([-Wwrite-strings]) + AX_APPEND_COMPILE_FLAGS([-floop-parallelize-all]) + AX_APPEND_COMPILE_FLAGS([-fwrapv]) + AX_APPEND_COMPILE_FLAGS([-ggdb]) + AX_CHECK_LINK_FLAG([-Werror]) + AX_CHECK_LINK_FLAG([-z relro -z now]) + AC_LANG_POP + ]) diff --git a/m4/uuid.m4 b/m4/uuid.m4 index 1122bb49..67d5fa37 100644 --- a/m4/uuid.m4 +++ b/m4/uuid.m4 @@ -23,66 +23,71 @@ #serial 3 AC_DEFUN([AX_UUID], [ - AC_CHECK_HEADER([uuid/uuid.h], [ - AC_CACHE_CHECK([check to see if we need -luuid], [ax_cv_libuuid_is_required], [ - save_LDFLAGS="$LDFLAGS" - LDFLAGS="-luuid" - AC_LANG_PUSH([C]) - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([#include ], [ - uuid_t out; - uuid_generate(out); - ])], - [ax_cv_libuuid_is_required=yes], - []) - AC_LANG_POP - LDFLAGS="$save_LDFLAGS" - ]) - AS_IF([test x"ax_cv_libuuid_is_required" = xyes], [ - LIBUUID_LDFLAGS="-luuid" - UUID_UUID_H=yes - ],[ - AC_CACHE_CHECK([check to see if -luuid is not needed], [ax_cv_libuuid_is_not_required], [ - AC_LANG_PUSH([C]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([#include ], [ - uuid_t out; - uuid_generate(out); - ])], - [ax_cv_libuuid_is_not_required=yes], - [ax_cv_libuuid_is_not_required=no]) - AC_LANG_POP - ]) - AS_IF([test x"ax_cv_libuuid_is_not_required" = xyes], [UUID_UUID_H=yes], [UUID_UUID_H=]) - ]) - ], [UUID_UUID_H=]) - -AS_IF([test x"$UUID_UUID_H" = xyes], [ - AC_DEFINE([HAVE_UUID_UUID_H], [ 1 ], [Have uuid/uuid.h]) - ],[ - AC_DEFINE([HAVE_UUID_UUID_H], [ 0 ], [Have uuid/uuid.h]) - ]) -]) - -AC_DEFUN([AX_UUID_GENERATE_TIME_SAFE], [ - AC_REQUIRE([AX_UUID]) - AC_CACHE_CHECK([for uuid_generate_time_safe], [ax_cv_uuid_generate_time_safe], [ - save_LDFLAGS="$LDFLAGS" - LDFLAGS=$LIBUUID_LDFLAGS + AC_CHECK_HEADER([uuid/uuid.h], [ + AC_CACHE_CHECK([check to see if -luuid is not needed], [ax_cv_libuuid_is_required], [ AC_LANG_PUSH([C]) - AC_LINK_IFELSE([ + AC_RUN_IFELSE([ + AC_LANG_PROGRAM([#include ], [ + uuid_t out; + uuid_generate(out); + ])], + [ax_cv_libuuid_is_required=no], + [ax_cv_libuuid_is_required=maybe], + [AC_MSG_WARN([test program execution failed])]) + AC_LANG_POP + ]) + + AS_IF([test "$ax_cv_libuuid_is_required" = maybe], [ + AC_CACHE_CHECK([check to see if -luuid is needed], [ax_cv_libuuid_works], [ + save_LIBS="$LIBS" + LIBS="-luuid $LIBS" + AC_LANG_PUSH([C]) + AC_RUN_IFELSE([ AC_LANG_PROGRAM([#include ], [ - uuid_t out; - uuid_generate_time_safe(out); - ])], - [ax_cv_uuid_generate_time_safe=yes], - [ax_cv_uuid_generate_time_safe=no]) + uuid_t out; + uuid_generate(out); + ])], + [ax_cv_libuuid_works=yes], + [ax_cv_libuuid_works=no], + [AC_MSG_WARN([test program execution failed])]) AC_LANG_POP - LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" ]) + AS_IF([test "$ax_cv_libuuid_works" = yes], [ + AC_SUBST([LIBUUID_LDFLAGS],[-luuid])]) + ]) + + AS_IF([test "$ax_cv_libuuid_is_required" = no], [UUID_UUID_H=yes]) + AS_IF([test "$ax_cv_libuuid_works" = yes], [UUID_UUID_H=yes]) + ]) - AS_IF([test "$ax_cv_uuid_generate_time_safe" = yes],[ - AC_DEFINE(HAVE_UUID_GENERATE_TIME_SAFE,[1],[Define if uuid_generate_time_safe is present in uuid/uuid.h.])],[ - AC_DEFINE(HAVE_UUID_GENERATE_TIME_SAFE,[0],[Define if uuid_generate_time_safe is present in uuid/uuid.h.]) + AS_IF([test "$UUID_UUID_H" = yes], [ + AC_DEFINE([HAVE_UUID_UUID_H], [1], [Have uuid/uuid.h]) + ],[ + AC_DEFINE([HAVE_UUID_UUID_H], [0], [Have uuid/uuid.h]) + ]) ]) -]) + + AC_DEFUN([AX_UUID_GENERATE_TIME_SAFE], [ + AC_REQUIRE([AX_UUID]) + AC_CACHE_CHECK([for uuid_generate_time_safe], [ax_cv_uuid_generate_time_safe], [ + save_LIBS="$LIBS" + LIBS="$LIBUUID_LDFLAGS $LIBS" + AC_LANG_PUSH([C]) + AC_RUN_IFELSE([ + AC_LANG_PROGRAM([#include ], [ + uuid_t out; + uuid_generate_time_safe(out); + ])], + [ax_cv_uuid_generate_time_safe=yes], + [ax_cv_uuid_generate_time_safe=no], + [AC_MSG_WARN([test program execution failed])]) + AC_LANG_POP + LIBS="$save_LIBS" + ]) + + AS_IF([test "$ax_cv_uuid_generate_time_safe" = yes],[ + AC_DEFINE(HAVE_UUID_GENERATE_TIME_SAFE,[1],[Define if uuid_generate_time_safe is present in uuid/uuid.h.])],[ + AC_DEFINE(HAVE_UUID_GENERATE_TIME_SAFE,[0],[Define if uuid_generate_time_safe is present in uuid/uuid.h.]) + ]) + ])