aboutsummaryrefslogtreecommitdiff
path: root/gdb/configure.ac
diff options
context:
space:
mode:
authorMarkus Metzger <markus.t.metzger@intel.com>2015-07-28 15:47:40 +0200
committerMarkus Metzger <markus.t.metzger@intel.com>2015-08-07 10:19:01 +0200
commit5599c404621b2d8ac021c1427aee6e8974572042 (patch)
treeaf85eaa5ab37a6be42ba78d1578c46bbf0a1d89f /gdb/configure.ac
parent016a3251631341bf4d8fe50966d2b70f8ea69e96 (diff)
configure: check for perf_event.h version
Intel(R) Processor Trace support requires a recent linux/perf_event.h header. When GDB is built on an older system, Intel(R) Processor Trace will not be available and there is no indication in the configure and build log as to what went wrong. Check for a compatible linux/perf_event.h at configure-time. gdb/ * configure.ac: Check for PERF_ATTR_SIZE_VER5 in linux/perf_event.h * configure: Regenerate.
Diffstat (limited to 'gdb/configure.ac')
-rw-r--r--gdb/configure.ac14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 905c27b72f..16bcd56c28 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1252,6 +1252,20 @@ if test "${with_intel_pt}" = no; then
AC_MSG_WARN([Intel(R) Processor Trace support disabled; some features may be unavailable.])
HAVE_LIBIPT=no
else
+ AC_PREPROC_IFELSE(AC_LANG_SOURCE([[
+#include <linux/perf_event.h>
+#ifndef PERF_ATTR_SIZE_VER5
+# error
+#endif
+ ]]), [perf_event=yes], [perf_event=no])
+ if test "$perf_event" != yes; then
+ if test "$with_intel_pt" = yes; then
+ AC_MSG_ERROR([linux/perf_event.h missing or too old])
+ else
+ AC_MSG_WARN([linux/perf_event.h missing or too old; some features may be unavailable.])
+ fi
+ fi
+
AC_LIB_HAVE_LINKFLAGS([ipt], [], [#include "intel-pt.h"], [pt_insn_alloc_decoder (0);])
if test "$HAVE_LIBIPT" != yes; then
if test "$with_intel_pt" = yes; then