| 1 |
# Copyright 2016 Colin Walters |
| 2 |
# Copyright 2020 Endless OS Foundation LLC |
| 3 |
# SPDX-License-Identifier: LGPL-2.1-or-later |
| 4 |
|
| 5 |
AC_DEFUN([LIBGLNX_CONFIGURE], |
| 6 |
[ |
| 7 |
dnl This defines HAVE_DECL_FOO to 1 if found or 0 if not |
| 8 |
AC_CHECK_DECLS([ |
| 9 |
renameat2, |
| 10 |
memfd_create, |
| 11 |
copy_file_range], |
| 12 |
[], [], [[ |
| 13 |
#include <sys/types.h> |
| 14 |
#include <unistd.h> |
| 15 |
#include <stdio.h> |
| 16 |
#include <sys/mount.h> |
| 17 |
#include <fcntl.h> |
| 18 |
#include <sched.h> |
| 19 |
#include <linux/loop.h> |
| 20 |
#include <linux/random.h> |
| 21 |
#include <sys/mman.h> |
| 22 |
]]) |
| 23 |
dnl This defines HAVE_FOO to 1 if found, or leaves it undefined if not: |
| 24 |
dnl not the same! |
| 25 |
AC_CHECK_FUNCS([close_range]) |
| 26 |
|
| 27 |
AC_ARG_ENABLE(otmpfile, |
| 28 |
[AS_HELP_STRING([--disable-otmpfile], |
| 29 |
[Disable use of O_TMPFILE [default=no]])],, |
| 30 |
[enable_otmpfile=yes]) |
| 31 |
AS_IF([test $enable_otmpfile = yes], [], [ |
| 32 |
AC_DEFINE([DISABLE_OTMPFILE], 1, [Define if we should avoid using O_TMPFILE])]) |
| 33 |
|
| 34 |
AC_ARG_ENABLE(wrpseudo-compat, |
| 35 |
[AS_HELP_STRING([--enable-wrpseudo-compat], |
| 36 |
[Disable use of syscall() in some cases for compatibility with pseudo [default=no]])],, |
| 37 |
[enable_wrpseudo_compat=no]) |
| 38 |
AS_IF([test $enable_wrpseudo_compat = no], [], [ |
| 39 |
AC_DEFINE([ENABLE_WRPSEUDO_COMPAT], 1, [Define if we should be compatible with pseudo])]) |
| 40 |
|
| 41 |
dnl end LIBGLNX_CONFIGURE |
| 42 |
]) |