From 04014f8d6c3b9fbb7f203eb886f4efdf001c3674 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Fri, 10 May 2019 16:49:36 +0100
Subject: [PATCH] Give libglnx subproject its own config.h

Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 config.h.in         |  3 ---
 meson.build         | 28 ----------------------------
 src/flatpak-bwrap.c |  1 +
 src/flatpak-utils.c |  1 +
 src/wrap.c          |  1 +
 5 files changed, 3 insertions(+), 31 deletions(-)

diff --git a/config.h.in b/config.h.in
index 19a264dad..f845cc620 100644
--- a/config.h.in
+++ b/config.h.in
@@ -1,6 +1,3 @@
 #define _GNU_SOURCE
 #define G_LOG_DOMAIN "pressure-vessel"
-#mesondefine HAVE_DECL_COPY_FILE_RANGE
-#mesondefine HAVE_DECL_MEMFD_CREATE
-#mesondefine HAVE_DECL_RENAMEAT2
 #mesondefine VERSION
diff --git a/meson.build b/meson.build
index 72c348c64..42daa055f 100644
--- a/meson.build
+++ b/meson.build
@@ -167,34 +167,6 @@ cc = meson.get_compiler('c')
 conf_data = configuration_data()
 conf_data.set('VERSION', version)
 
-check_functions = [
-  'renameat2',
-  'memfd_create',
-  'copy_file_range',
-]
-foreach check_function : check_functions
-  if cc.compiles('''
-    #include <sys/types.h>
-    #include <unistd.h>
-    #include <stdio.h>
-    #include <sys/mount.h>
-    #include <fcntl.h>
-    #include <sched.h>
-    #include <linux/loop.h>
-    #include <linux/random.h>
-    #include <sys/mman.h>
-
-    int func (void) {
-      (void) ''' + check_function + ''';
-    }
-    ''',
-    args : '-D_GNU_SOURCE',
-    name : check_function + '() is declared',
-  )
-    conf_data.set('HAVE_DECL_' + check_function.underscorify().to_upper(), 1)
-  endif
-endforeach
-
 configure_file(
   input : 'config.h.in',
   output : 'config.h',
diff --git a/src/flatpak-bwrap.c b/src/flatpak-bwrap.c
index 1f8e976eb..aecedf406 100644
--- a/src/flatpak-bwrap.c
+++ b/src/flatpak-bwrap.c
@@ -19,6 +19,7 @@
  */
 
 #include "config.h"
+#include "subprojects/libglnx/config.h"
 
 #include <string.h>
 #include <fcntl.h>
diff --git a/src/flatpak-utils.c b/src/flatpak-utils.c
index d86832134..3cbc57267 100644
--- a/src/flatpak-utils.c
+++ b/src/flatpak-utils.c
@@ -21,6 +21,7 @@
  */
 
 #include "config.h"
+#include "subprojects/libglnx/config.h"
 
 #include "flatpak-utils-private.h"
 
diff --git a/src/wrap.c b/src/wrap.c
index d606fa9ca..9cccc972c 100644
--- a/src/wrap.c
+++ b/src/wrap.c
@@ -23,6 +23,7 @@
  */
 
 #include "config.h"
+#include "subprojects/libglnx/config.h"
 
 #include <glib.h>
 #include <glib/gstdio.h>
-- 
GitLab