From 5599c404621b2d8ac021c1427aee6e8974572042 Mon Sep 17 00:00:00 2001 From: Markus Metzger Date: Tue, 28 Jul 2015 15:47:40 +0200 Subject: 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. --- gdb/configure | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'gdb/configure') diff --git a/gdb/configure b/gdb/configure index 2949817..e420c03 100755 --- a/gdb/configure +++ b/gdb/configure @@ -1560,7 +1560,8 @@ Optional Packages: (auto/yes/no/) --with-guile[=GUILE] include guile support (auto/yes/no//) - --with-intel-pt include Intel(R) Processor Trace support (auto/yes/no) + --with-intel-pt include Intel(R) Processor Trace support + (auto/yes/no) --with-libipt-prefix[=DIR] search for libipt in DIR/include and DIR/lib --without-libipt-prefix don't search for libipt in includedir and libdir --without-included-regex @@ -10115,6 +10116,30 @@ if test "${with_intel_pt}" = no; then $as_echo "$as_me: WARNING: Intel(R) Processor Trace support disabled; some features may be unavailable." >&2;} HAVE_LIBIPT=no else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifndef PERF_ATTR_SIZE_VER5 +# error +#endif + +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + perf_event=yes +else + perf_event=no +fi +rm -f conftest.err conftest.$ac_ext + if test "$perf_event" != yes; then + if test "$with_intel_pt" = yes; then + as_fn_error "linux/perf_event.h missing or too old" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: linux/perf_event.h missing or too old; some features may be unavailable." >&5 +$as_echo "$as_me: WARNING: linux/perf_event.h missing or too old; some features may be unavailable." >&2;} + fi + fi + -- cgit v1.1