Blame singularity-Configure-for-_GNU_SOURCE-and-make-config.h-first-he.patch

57c4797
From a1c211c91c63e6ab7b1f3eaae8ed006a6fae1976 Mon Sep 17 00:00:00 2001
57c4797
From: Dave Love <dave.love@manchester.ac.uk>
57c4797
Date: Sun, 14 May 2017 23:52:02 +0100
57c4797
Subject: [PATCH 21/30] Configure for _GNU_SOURCE and make config.h first
57c4797
 header included Fixes build with -std=c11
57c4797
57c4797
---
57c4797
 configure.ac            | 3 ++-
57c4797
 src/get-section.c       | 3 +--
57c4797
 src/image-bind.c        | 3 +--
57c4797
 src/image-create.c      | 3 +--
57c4797
 src/image-expand.c      | 3 +--
57c4797
 src/image-mount.c       | 3 +--
57c4797
 src/lib/config_parser.c | 3 +--
57c4797
 src/lib/loop-control.c  | 3 +--
57c4797
 src/lib/message.c       | 2 +-
57c4797
 src/lib/privilege.c     | 3 +--
57c4797
 src/lib/singularity.c   | 4 ++--
57c4797
 src/sexec.c             | 2 +-
57c4797
 src/util/file.c         | 4 +---
57c4797
 src/util/util.c         | 4 +---
57c4797
 14 files changed, 16 insertions(+), 27 deletions(-)
57c4797
57c4797
diff --git a/configure.ac b/configure.ac
57c4797
index b843ce94..6f07a1aa 100644
57c4797
--- a/configure.ac
57c4797
+++ b/configure.ac
57c4797
@@ -1,4 +1,4 @@
57c4797
-AC_PREREQ(2.59)
57c4797
+AC_PREREQ(2.60)
57c4797
 AC_INIT([singularity],[2.2.1],[gmkurtzer@lbl.gov])
57c4797
 
57c4797
 if test -z "$prefix" -o "$prefix" = "NONE" ; then
57c4797
@@ -27,6 +27,7 @@ AC_SUBST(SINGULARITY_ARCH)
57c4797
 # https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1232579.html
57c4797
 #AM_INIT_AUTOMAKE([foreign subdir-objects])
57c4797
 
57c4797
+AC_USE_SYSTEM_EXTENSIONS([_GNU_SOURCE])
57c4797
 AM_INIT_AUTOMAKE([foreign subdir-objects]) ## SEE ABOVE BEFORE CHANGING
57c4797
 AC_CONFIG_SRCDIR([src])
57c4797
 AC_CONFIG_HEADERS([src/config.h])
57c4797
diff --git a/src/get-section.c b/src/get-section.c
57c4797
index 6110a46f..00825cb6 100644
57c4797
--- a/src/get-section.c
57c4797
+++ b/src/get-section.c
57c4797
@@ -18,7 +18,7 @@
57c4797
  * 
57c4797
  */
57c4797
 
57c4797
-#define _GNU_SOURCE
57c4797
+#include "config.h"
57c4797
 #include <stdio.h>
57c4797
 #include <stdlib.h>
57c4797
 #include <unistd.h>
57c4797
@@ -29,7 +29,6 @@
57c4797
 #include <fcntl.h>  
57c4797
 #include <linux/limits.h>
57c4797
 
57c4797
-#include "config.h"
57c4797
 #include "util/file.h"
57c4797
 #include "util/util.h"
57c4797
 #include "lib/singularity.h"
57c4797
diff --git a/src/image-bind.c b/src/image-bind.c
57c4797
index 509f958f..0fdaedc1 100644
57c4797
--- a/src/image-bind.c
57c4797
+++ b/src/image-bind.c
57c4797
@@ -18,7 +18,7 @@
57c4797
  * 
57c4797
  */
57c4797
 
57c4797
-#define _GNU_SOURCE
57c4797
+#include "config.h"
57c4797
 #include <stdio.h>
57c4797
 #include <stdlib.h>
57c4797
 #include <unistd.h>
57c4797
@@ -36,7 +36,6 @@
57c4797
 #include <libgen.h>
57c4797
 #include <linux/limits.h>
57c4797
 
57c4797
-#include "config.h"
57c4797
 #include "lib/singularity.h"
57c4797
 #include "util/file.h"
57c4797
 #include "util/util.h"
57c4797
diff --git a/src/image-create.c b/src/image-create.c
57c4797
index b3cface0..a9968c7a 100644
57c4797
--- a/src/image-create.c
57c4797
+++ b/src/image-create.c
57c4797
@@ -18,7 +18,7 @@
57c4797
  * 
57c4797
  */
57c4797
 
57c4797
-#define _GNU_SOURCE
57c4797
+#include "config.h"
57c4797
 #include <stdio.h>
57c4797
 #include <stdlib.h>
57c4797
 #include <unistd.h>
57c4797
@@ -28,7 +28,6 @@
57c4797
 #include <string.h>
57c4797
 #include <fcntl.h>  
57c4797
 
57c4797
-#include "config.h"
57c4797
 #include "lib/singularity.h"
57c4797
 #include "util/util.h"
57c4797
 #include "util/file.h"
57c4797
diff --git a/src/image-expand.c b/src/image-expand.c
57c4797
index 259af86b..90e99a8a 100644
57c4797
--- a/src/image-expand.c
57c4797
+++ b/src/image-expand.c
57c4797
@@ -18,7 +18,7 @@
57c4797
  * 
57c4797
  */
57c4797
 
57c4797
-#define _GNU_SOURCE
57c4797
+#include "config.h"
57c4797
 #include <stdio.h>
57c4797
 #include <stdlib.h>
57c4797
 #include <unistd.h>
57c4797
@@ -28,7 +28,6 @@
57c4797
 #include <string.h>
57c4797
 #include <fcntl.h>  
57c4797
 
57c4797
-#include "config.h"
57c4797
 #include "lib/singularity.h"
57c4797
 #include "util/file.h"
57c4797
 #include "util/util.h"
57c4797
diff --git a/src/image-mount.c b/src/image-mount.c
57c4797
index 995bae09..feeee6b1 100644
57c4797
--- a/src/image-mount.c
57c4797
+++ b/src/image-mount.c
57c4797
@@ -18,7 +18,7 @@
57c4797
  * 
57c4797
  */
57c4797
 
57c4797
-#define _GNU_SOURCE
57c4797
+#include "config.h"
57c4797
 #include <stdio.h>
57c4797
 #include <stdlib.h>
57c4797
 #include <unistd.h>
57c4797
@@ -36,7 +36,6 @@
57c4797
 #include <libgen.h>
57c4797
 #include <linux/limits.h>
57c4797
 
57c4797
-#include "config.h"
57c4797
 #include "lib/singularity.h"
57c4797
 #include "util/file.h"
57c4797
 #include "util/util.h"
57c4797
diff --git a/src/lib/config_parser.c b/src/lib/config_parser.c
57c4797
index b9ef97b6..8a36d67f 100644
57c4797
--- a/src/lib/config_parser.c
57c4797
+++ b/src/lib/config_parser.c
57c4797
@@ -18,7 +18,7 @@
57c4797
  * 
57c4797
  */
57c4797
 
57c4797
-#define _GNU_SOURCE
57c4797
+#include "config.h"
57c4797
 #include <stdio.h>
57c4797
 #include <stdlib.h>
57c4797
 #include <unistd.h>
57c4797
@@ -29,7 +29,6 @@
57c4797
 #include <fcntl.h>  
57c4797
 #include <limits.h>
57c4797
 
57c4797
-#include "config.h"
57c4797
 #include "util/util.h"
57c4797
 #include "lib/message.h"
57c4797
 #include "util/file.h"
57c4797
diff --git a/src/lib/loop-control.c b/src/lib/loop-control.c
57c4797
index cf60b756..f13b4408 100644
57c4797
--- a/src/lib/loop-control.c
57c4797
+++ b/src/lib/loop-control.c
57c4797
@@ -18,7 +18,7 @@
57c4797
  * 
57c4797
  */
57c4797
 
57c4797
-#define _GNU_SOURCE
57c4797
+#include "config.h"
57c4797
 #include <stdio.h>
57c4797
 #include <stdlib.h>
57c4797
 #include <linux/loop.h>
57c4797
@@ -31,7 +31,6 @@
57c4797
 #include <fcntl.h>
57c4797
 #include <sys/ioctl.h>
57c4797
 
57c4797
-#include "config.h"
57c4797
 #include "lib/loop-control.h"
57c4797
 #include "lib/image-util.h"
57c4797
 #include "util/util.h"
57c4797
diff --git a/src/lib/message.c b/src/lib/message.c
57c4797
index f84537c7..1036b052 100644
57c4797
--- a/src/lib/message.c
57c4797
+++ b/src/lib/message.c
57c4797
@@ -19,6 +19,7 @@
57c4797
  */
57c4797
 
57c4797
 
57c4797
+#include "config.h"
57c4797
 #include <ctype.h>
57c4797
 #include <stdio.h>
57c4797
 #include <stdlib.h>
57c4797
@@ -28,7 +29,6 @@
57c4797
 #include <syslog.h>
57c4797
 #include <limits.h>
57c4797
 
57c4797
-#include "config.h"
57c4797
 #include "util/util.h"
57c4797
 #include "lib/message.h"
57c4797
 
57c4797
diff --git a/src/lib/privilege.c b/src/lib/privilege.c
57c4797
index 412756d1..1f688506 100644
57c4797
--- a/src/lib/privilege.c
57c4797
+++ b/src/lib/privilege.c
57c4797
@@ -19,7 +19,7 @@
57c4797
  */
57c4797
 
57c4797
 
57c4797
-#define _GNU_SOURCE
57c4797
+#include "config.h"
57c4797
 #include <stdio.h>
57c4797
 #include <stdlib.h>
57c4797
 #include <unistd.h>
57c4797
@@ -35,7 +35,6 @@
57c4797
 #include <sched.h>
57c4797
 
57c4797
 #include "lib/privilege.h"
57c4797
-#include "config.h"
57c4797
 #include "util/file.h"
57c4797
 #include "util/util.h"
57c4797
 #include "lib/message.h"
57c4797
diff --git a/src/lib/singularity.c b/src/lib/singularity.c
57c4797
index db71d3a1..8987b271 100644
57c4797
--- a/src/lib/singularity.c
57c4797
+++ b/src/lib/singularity.c
57c4797
@@ -18,12 +18,12 @@
57c4797
  * 
57c4797
  */
57c4797
 
57c4797
+#include "config.h"
57c4797
+
57c4797
 #include <stdio.h>
57c4797
 #include <stdlib.h>
57c4797
 #include <unistd.h>
57c4797
 
57c4797
-#include "config.h"
57c4797
-
57c4797
 
57c4797
 
57c4797
 
57c4797
diff --git a/src/sexec.c b/src/sexec.c
57c4797
index 1d0b7b69..f0ce1b98 100644
57c4797
--- a/src/sexec.c
57c4797
+++ b/src/sexec.c
57c4797
@@ -18,6 +18,7 @@
57c4797
  * 
57c4797
  */
57c4797
 
57c4797
+#include "config.h"
57c4797
 #include <stdio.h>
57c4797
 #include <stdlib.h>
57c4797
 #include <unistd.h>
57c4797
@@ -26,7 +27,6 @@
57c4797
 #include <errno.h>
57c4797
 #include <string.h>
57c4797
 
57c4797
-#include "config.h"
57c4797
 #include "lib/singularity.h"
57c4797
 #include "util/util.h"
57c4797
 #include "util/file.h"
57c4797
diff --git a/src/util/file.c b/src/util/file.c
57c4797
index 67e262e3..f43e11f1 100644
57c4797
--- a/src/util/file.c
57c4797
+++ b/src/util/file.c
57c4797
@@ -19,8 +19,7 @@
57c4797
  */
57c4797
 
57c4797
 
57c4797
-#define _XOPEN_SOURCE 500 // For nftw
57c4797
-#define _GNU_SOURCE
57c4797
+#include "config.h"
57c4797
 #include <stdio.h>
57c4797
 #include <stdlib.h>
57c4797
 #include <unistd.h>
57c4797
@@ -35,7 +34,6 @@
57c4797
 #include <ftw.h>
57c4797
 #include <time.h>
57c4797
 
57c4797
-#include "config.h"
57c4797
 #include "util/util.h"
57c4797
 #include "lib/message.h"
57c4797
 #include "lib/privilege.h"
57c4797
diff --git a/src/util/util.c b/src/util/util.c
57c4797
index 8bd0de36..1202b142 100644
57c4797
--- a/src/util/util.c
57c4797
+++ b/src/util/util.c
57c4797
@@ -19,8 +19,7 @@
57c4797
  */
57c4797
 
57c4797
 
57c4797
-#define _XOPEN_SOURCE 500 // For nftw
57c4797
-#define _GNU_SOURCE
57c4797
+#include "config.h"
57c4797
 #include <stdio.h>
57c4797
 #include <stdlib.h>
57c4797
 #include <unistd.h>
57c4797
@@ -37,7 +36,6 @@
57c4797
 #include <linux/limits.h>
57c4797
 #include <ctype.h>
57c4797
 
57c4797
-#include "config.h"
57c4797
 #include "util/util.h"
57c4797
 #include "lib/message.h"
57c4797
 
57c4797
-- 
57c4797
2.11.0
57c4797