diff -r 000000000000 -r 6474c204b198 build/autoconf/linux.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/build/autoconf/linux.m4 Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,39 @@ +dnl This Source Code Form is subject to the terms of the Mozilla Public +dnl License, v. 2.0. If a copy of the MPL was not distributed with this +dnl file, You can obtain one at http://mozilla.org/MPL/2.0/. + +AC_DEFUN([MOZ_LINUX_PERF_EVENT], +[ + +MOZ_ARG_WITH_STRING(linux-headers, +[ --with-linux-headers=DIR + location where the Linux kernel headers can be found], + linux_headers=$withval) + +LINUX_HEADERS_INCLUDES= + +if test "$linux_headers"; then + LINUX_HEADERS_INCLUDES="-I$linux_headers" +fi + +_SAVE_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS $LINUX_HEADERS_INCLUDES" + +dnl Performance measurement headers. +MOZ_CHECK_HEADER(linux/perf_event.h, + [AC_CACHE_CHECK(for perf_event_open system call,ac_cv_perf_event_open, + [AC_TRY_COMPILE([#include ],[return sizeof(__NR_perf_event_open);], + ac_cv_perf_event_open=yes, + ac_cv_perf_event_open=no)])]) +if test "$ac_cv_perf_event_open" = "yes"; then + HAVE_LINUX_PERF_EVENT_H=1 +else + HAVE_LINUX_PERF_EVENT_H= + LINUX_HEADERS_INCLUDES= +fi +AC_SUBST(HAVE_LINUX_PERF_EVENT_H) +AC_SUBST(LINUX_HEADERS_INCLUDES) + +CFLAGS="$_SAVE_CFLAGS" + +])