Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.5KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_cxx_rtti.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CXX_RTTI
  8. #
  9. # DESCRIPTION
  10. #
  11. # If the compiler supports Run-Time Type Identification (typeinfo header
  12. # and typeid keyword), define HAVE_RTTI.
  13. #
  14. # LICENSE
  15. #
  16. # Copyright (c) 2008 Todd Veldhuizen
  17. # Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
  18. #
  19. # Copying and distribution of this file, with or without modification, are
  20. # permitted in any medium without royalty provided the copyright notice
  21. # and this notice are preserved. This file is offered as-is, without any
  22. # warranty.
  23. #serial 7
  24. AU_ALIAS([AC_CXX_RTTI], [AX_CXX_RTTI])
  25. AC_DEFUN([AX_CXX_RTTI],
  26. [AC_CACHE_CHECK(whether the compiler supports Run-Time Type Identification,
  27. ax_cv_cxx_rtti,
  28. [AC_LANG_SAVE
  29. AC_LANG_CPLUSPLUS
  30. AC_TRY_COMPILE([#include <typeinfo>
  31. class Base { public :
  32. Base () {}
  33. virtual int f () { return 0; }
  34. };
  35. class Derived : public Base { public :
  36. Derived () {}
  37. virtual int f () { return 1; }
  38. };
  39. ],[Derived d;
  40. Base *ptr = &d;
  41. return typeid (*ptr) == typeid (Derived);
  42. ],
  43. ax_cv_cxx_rtti=yes, ax_cv_cxx_rtti=no)
  44. AC_LANG_RESTORE
  45. ])
  46. if test "$ax_cv_cxx_rtti" = yes; then
  47. AC_DEFINE(HAVE_RTTI,,
  48. [define if the compiler supports Run-Time Type Identification])
  49. fi
  50. ])