[gjs/gnome-3-28] build: Check for SIGEV_THREAD_ID if profiler enabled



commit fc550820fd987d420f2ef5c470d2ff669b257e5c
Author: Philip Chimento <philip chimento gmail com>
Date:   Mon Jul 23 19:21:59 2018 -0400

    build: Check for SIGEV_THREAD_ID if profiler enabled
    
    Apparently this is not available in some standard libraries, so it should
    be checked during configure.
    
    Closes: #132

 configure.ac | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/configure.ac b/configure.ac
index bcc744e2..19f1e518 100644
--- a/configure.ac
+++ b/configure.ac
@@ -152,9 +152,20 @@ AS_IF([test x$have_gtk = xyes], [
 AC_ARG_ENABLE([profiler],
   [AS_HELP_STRING([--disable-profiler], [Don't build profiler])])
 AS_IF([test x$enable_profiler != xno], [
+  # Requires timer_settime() - only on Linux
   gl_TIMER_TIME
-  AS_IF([test x$ac_cv_func_timer_settime = xno],
+  # Requires SIGEV_THREAD_ID - not in some stdlibs
+  have_sigev_thread_id=no
+  AC_MSG_CHECKING([for Linux SIGEV_THREAD_ID])
+  AC_COMPILE_IFELSE([
+    AC_LANG_PROGRAM([[#include <signal.h>]], [return SIGEV_THREAD_ID;])
+  ], [
+    have_sigev_thread_id=yes
+    AC_MSG_RESULT([yes])
+  ], [AC_MSG_RESULT([no])])
+  AS_IF([test x$ac_cv_func_timer_settime = xno -o x$have_sigev_thread_id = xno],
     [AC_MSG_ERROR([The profiler is currently only supported on Linux.
+The standard library must support timer_settime() and SIGEV_THREAD_ID.
 Configure with --disable-profiler to skip it on other platforms.])])
   AC_DEFINE([ENABLE_PROFILER], [1], [Define if the profiler should be built.])
 ])


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]