1 # ===========================================================================
2 # http://www.gnu.org/software/autoconf-archive/ax_cxx_gcc_abi_demangle.html
3 # ===========================================================================
7 # AX_CXX_GCC_ABI_DEMANGLE
11 # If the compiler supports GCC C++ ABI name demangling (has header
12 # cxxabi.h and abi::__cxa_demangle() function), define
13 # HAVE_GCC_ABI_DEMANGLE
15 # Adapted from AX_CXX_RTTI by Luc Maisonobe
19 # Copyright (c) 2012 Brian Aker <brian@tangent.org>
20 # Copyright (c) 2008 Neil Ferguson <nferguso@eso.org>
22 # Copying and distribution of this file, with or without modification, are
23 # permitted in any medium without royalty provided the copyright notice
24 # and this notice are preserved. This file is offered as-is, without any
29 AC_DEFUN([AX_CXX_GCC_ABI_DEMANGLE],
30 [AC_CACHE_CHECK([whether the compiler supports GCC C++ ABI name demangling],
31 [ax_cv_cxx_gcc_abi_demangle],
33 AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <typeinfo>
37 [template<typename TYPE>
41 char* c_name = abi::__cxa_demangle(typeid(instance).name(), 0, 0, &status);
43 std::string name(c_name);
46 return name == "A<int>";
47 ])],[ax_cv_cxx_gcc_abi_demangle=yes],
48 [ax_cv_cxx_gcc_abi_demangle=no],
49 [ax_cv_cxx_gcc_abi_demangle=no])
51 AS_IF([test "x$ax_cv_cxx_gcc_abi_demangle" = xyes],
52 [AC_DEFINE([HAVE_GCC_ABI_DEMANGLE],[1],[define if the compiler supports GCC C++ ABI name demangling])])