From: Brian Aker Date: Tue, 27 Nov 2012 11:39:25 +0000 (-0500) Subject: Updating m4 X-Git-Tag: 1.0.15~13^2~1 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=02e76bdf89bf11934a8c47a9c2d67dc67952b73b;p=m6w6%2Flibmemcached Updating m4 --- diff --git a/m4/ax_check_library.m4 b/m4/ax_check_library.m4 index 8177acf0..f8d7962f 100644 --- a/m4/ax_check_library.m4 +++ b/m4/ax_check_library.m4 @@ -32,6 +32,7 @@ # # LICENSE # +# Copyright (c) 2012 Brian Aker # Copyright (c) 2010 Diego Elio Petteno` # # This program is free software: you can redistribute it and/or modify it @@ -62,38 +63,34 @@ #serial 6 -AC_DEFUN([AX_CHECK_LIBRARY], [ - AC_ARG_VAR($1[_CPPFLAGS], [C preprocessor flags for ]$1[ headers]) - AC_ARG_VAR($1[_LDFLAGS], [linker flags for ]$1[ libraries]) +AC_DEFUN([AX_CHECK_LIBRARY], + [AC_ARG_VAR($1[_CPPFLAGS],[C preprocessor flags for ]$1[ headers]) + AC_ARG_VAR($1[_LDFLAGS],[linker flags for ]$1[ libraries]) - AC_CACHE_VAL(AS_TR_SH([ax_cv_have_]$1), - [save_CPPFLAGS="$CPPFLAGS" - save_LDFLAGS="$LDFLAGS" - save_LIBS="$LIBS" + AC_CACHE_VAL(AS_TR_SH([ax_cv_have_]$1), + [AX_SAVE_FLAGS - AS_IF([test "x$]$1[_CPPFLAGS" != "x"], - [CPPFLAGS="$CPPFLAGS $]$1[_CPPFLAGS"]) + AS_IF([test "x$]$1[_CPPFLAGS" != "x"], + [CPPFLAGS="$CPPFLAGS $]$1[_CPPFLAGS"]) - AS_IF([test "x$]$1[_LDFLAGS" != "x"], - [LDFLAGS="$LDFLAGS $]$1[_LDFLAGS"]) + AS_IF([test "x$]$1[_LDFLAGS" != "x"], + [LDFLAGS="$LDFLAGS $]$1[_LDFLAGS"]) - AC_CHECK_HEADER($2, [ - AC_CHECK_LIB($3, [main], - [AS_TR_SH([ax_cv_have_]$1)=yes], - [AS_TR_SH([ax_cv_have_]$1)=no]) - ], [AS_TR_SH([ax_cv_have_]$1)=no]) + AC_CHECK_HEADER($2, [ + AC_CHECK_LIB($3, [main], + [AS_TR_SH([ax_cv_have_]$1)=yes], + [AS_TR_SH([ax_cv_have_]$1)=no]) + ], [AS_TR_SH([ax_cv_have_]$1)=no]) - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ]) + AX_RESTORE_FLAGS + ]) - AS_IF([test "$]AS_TR_SH([ax_cv_have_]$1)[" = "yes"], - [AC_DEFINE([HAVE_]$1, [1], [Define to 1 if ]$1[ is found]) - AC_SUBST($1[_CPPFLAGS]) - AC_SUBST($1[_LDFLAGS]) - AC_SUBST($1[_LIB],[-l]$3) - m4_ifval( m4_normalize([$4]), [$4]), - m4_ifval( m4_normalize([$5]), [$5])]) - AM_CONDITIONAL([HAVE_]$1,[test "$]AS_TR_SH([ax_cv_have_]$1)[" = "yes"]) - ]) + AS_IF([test "$]AS_TR_SH([ax_cv_have_]$1)[" = "yes"], + [AC_DEFINE([HAVE_]$1, [1], [Define to 1 if ]$1[ is found]) + AC_SUBST($1[_CPPFLAGS]) + AC_SUBST($1[_LDFLAGS]) + AC_SUBST($1[_LIB],[-l]$3) + ifelse([$4], , :, [$4])], + [ifelse([$5], , :, [$5])]) + AM_CONDITIONAL([HAVE_]$1,[test "$]AS_TR_SH([ax_cv_have_]$1)[" = "yes"]) + ]) diff --git a/m4/ax_cxx_gcc_abi_demangle.m4 b/m4/ax_cxx_gcc_abi_demangle.m4 index 2da0057e..02c718ec 100644 --- a/m4/ax_cxx_gcc_abi_demangle.m4 +++ b/m4/ax_cxx_gcc_abi_demangle.m4 @@ -16,6 +16,7 @@ # # LICENSE # +# Copyright (c) 2012 Brian Aker # Copyright (c) 2008 Neil Ferguson # # Copying and distribution of this file, with or without modification, are @@ -25,35 +26,28 @@ #serial 9 - AC_DEFUN([AX_CXX_GCC_ABI_DEMANGLE], - [AC_CACHE_CHECK([whether the compiler supports GCC C++ ABI name demangling], - [ax_cv_cxx_gcc_abi_demangle], - [AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [ -#include +AC_DEFUN([AX_CXX_GCC_ABI_DEMANGLE], + [AC_CACHE_CHECK([whether the compiler supports GCC C++ ABI name demangling], + [ax_cv_cxx_gcc_abi_demangle], + [AC_LANG_PUSH([C++]) + AC_RUN_IFELSE([AC_LANG_PROGRAM([#include #include #include -#include +#include ], + [template + class A {}; + ],[A instance; + int status = 0; + char* c_name = abi::__cxa_demangle(typeid(instance).name(), 0, 0, &status); -template class A {}; - ],[ -A instance; -int status = 0; -char* c_name = 0; + std::string name(c_name); + ::free(c_name); -c_name = abi::__cxa_demangle(typeid(instance).name(), 0, 0, &status); -std::string name(c_name); -::free(c_name); -return name == "A"; - ])], - [ax_cv_cxx_gcc_abi_demangle=yes], + return name == "A"; + ])],[ax_cv_cxx_gcc_abi_demangle=yes], + [ax_cv_cxx_gcc_abi_demangle=no], [ax_cv_cxx_gcc_abi_demangle=no]) - AC_LANG_POP() - ]) - - if test "$ax_cv_cxx_gcc_abi_demangle" = yes; then - AC_DEFINE(HAVE_GCC_ABI_DEMANGLE, [1], [define if the compiler supports GCC C++ ABI name demangling]) - fi - ]) + AC_LANG_POP]) + AS_IF([test "x$ax_cv_cxx_gcc_abi_demangle" = xyes], + [AC_DEFINE([HAVE_GCC_ABI_DEMANGLE],[1],[define if the compiler supports GCC C++ ABI name demangling])]) + ])