gcc.m4 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. dnl -*- Autoconf -*-
  2. dnl
  3. dnl Copyright (C) 2011 Institut National de Recherche en Informatique et Automatique
  4. dnl
  5. dnl StarPU is free software; you can redistribute it and/or modify
  6. dnl it under the terms of the GNU Lesser General Public License as published by
  7. dnl the Free Software Foundation; either version 2.1 of the License, or (at
  8. dnl your option) any later version.
  9. dnl
  10. dnl StarPU is distributed in the hope that it will be useful, but
  11. dnl WITHOUT ANY WARRANTY; without even the implied warranty of
  12. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. dnl
  14. dnl See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. dnl Check whether GCC plug-in support is available (GCC 4.5+).
  16. AC_DEFUN([STARPU_GCC_PLUGIN_SUPPORT], [
  17. AC_REQUIRE([AC_PROG_CC])
  18. AC_CACHE_CHECK([whether GCC supports plug-ins], [ac_cv_have_gcc_plugins], [
  19. if test "x$GCC" = xyes; then
  20. GCC_PLUGIN_INCLUDE_DIR="`"$CC" -print-file-name=plugin`/include"
  21. save_CPPFLAGS="$CPPFLAGS"
  22. CPPFLAGS="-I$GCC_PLUGIN_INCLUDE_DIR"
  23. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <gcc-plugin.h>
  24. #include <tree.h>
  25. #include <gimple.h>
  26. tree fndecl; gimple call;]],
  27. [[fndecl = lookup_name (get_identifier ("puts"));
  28. call = gimple_build_call (fndecl, 0);]])],
  29. [ac_cv_have_gcc_plugins="yes"],
  30. [ac_cv_have_gcc_plugins="no"])
  31. CPPFLAGS="$save_CPPFLAGS"
  32. else
  33. ac_cv_have_gcc_plugins="no"
  34. fi
  35. ])
  36. AC_SUBST([GCC_PLUGIN_INCLUDE_DIR])
  37. ])