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) 2008 Neil Ferguson <nferguso@eso.org>
21 # Copying and distribution of this file, with or without modification, are
22 # permitted in any medium without royalty provided the copyright notice
23 # and this notice are preserved. This file is offered as-is, without any
28 AC_DEFUN([AX_CXX_GCC_ABI_DEMANGLE],
29 [AC_CACHE_CHECK([whether the compiler supports GCC C++ ABI name demangling],
30 [ax_cv_cxx_gcc_abi_demangle],
40 template<typename TYPE> class A {};
46 c_name = abi::__cxa_demangle(typeid(instance).name(), 0, 0, &status);
47 std::string name(c_name);
49 return name == "A<int>";
51 [ax_cv_cxx_gcc_abi_demangle=yes],
52 [ax_cv_cxx_gcc_abi_demangle=no])
56 if test "$ax_cv_cxx_gcc_abi_demangle" = yes; then
57 AC_DEFINE(HAVE_GCC_ABI_DEMANGLE, [1], [define if the compiler supports GCC C++ ABI name demangling])