[gnome-photos/gnome-3-22] build: Define _GNU_SOURCE when using the Linux kernel for sched_getcpu



commit aff66f06e3ef3cad3ee677fd5c99215bc94c59da
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Sep 26 18:19:42 2016 +0200

    build: Define _GNU_SOURCE when using the Linux kernel for sched_getcpu
    
    Original patch from Christian Hergert for gnome-builder.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771995

 configure.ac |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 9e0cb17..121dfff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,6 +20,7 @@ AX_IS_RELEASE([git-directory])
 AX_CHECK_ENABLE_DEBUG([yes],,, [$ax_is_release])
 AX_COMPILER_FLAGS([WARN_CFLAGS], [WARN_LDFLAGS], [$ax_is_release])
 
+AC_CANONICAL_HOST
 AC_PROG_CC
 AC_PROG_CC_C_O
 AC_HEADER_STDC
@@ -87,6 +88,7 @@ int main (int argc, char *argv[]) { int cpu; __builtin_ia32_rdtscp (&cpu); retur
               AS_IF([test "$have_rdtscp" = "yes"],
               [CFLAGS="$CFLAGS -DEGG_HAVE_RDTSCP"])
 
+AS_CASE(["$host"], [*-*-linux*], [CFLAGS="$CFLAGS -D_GNU_SOURCE"], [])
 AC_CHECK_FUNCS([sched_getcpu])
 
 AC_CHECK_FUNCS([shm_open], [LIBRT=], [AC_CHECK_LIB([rt], [shm_open], [LIBRT=-lrt], [LIBRT=])])


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