forked from apptainer/singularity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
135 lines (117 loc) · 4.21 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
AC_PREREQ(2.59)
AC_INIT([singularity],[2.0],[[email protected]])
if test -z "$prefix" -o "$prefix" = "NONE" ; then
prefix=${ac_default_prefix}
fi
AC_SUBST(PREFIX, $prefix)
AC_CANONICAL_TARGET
case $target_cpu in
x86_64)
SINGULARITY_ARCH=x86_64
;;
i?86)
SINGULARITY_ARCH=i386
;;
athlon)
SINGULARITY_ARCH=i386
;;
*)
AC_MSG_ERROR([Architecture $target_cpu not supported])
;;
esac
AC_SUBST(SINGULARITY_ARCH)
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_SRCDIR([.])
AC_CONFIG_HEADERS([src/config.h])
AC_CONFIG_MACRO_DIR([.])
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_PROG_CC
AM_INIT_AUTOMAKE
AM_PROG_CC_C_O
AC_MSG_CHECKING([for namespace: CLONE_NEWPID])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _GNU_SOURCE
#include <sched.h>
]],
[[unshare(CLONE_NEWPID);]])],
[
AC_MSG_RESULT([yes])
NAMESPACE_DEFINES="$NAMESPACE_DEFINES -DNS_CLONE_NEWPID"
], [
AC_MSG_RESULT([no])
]
)
AC_MSG_CHECKING([for namespace: CLONE_PID])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _GNU_SOURCE
#include <sched.h>
]],
[[unshare(CLONE_PID);]])],
[
AC_MSG_RESULT([yes])
NAMESPACE_DEFINES="$NAMESPACE_DEFINES -DNS_CLONE_PID"
], [
AC_MSG_RESULT([no])
]
)
AC_MSG_CHECKING([for namespace: CLONE_FS])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _GNU_SOURCE
#include <sched.h>
]],
[[unshare(CLONE_FS);]])],
[
AC_MSG_RESULT([yes])
NAMESPACE_DEFINES="$NAMESPACE_DEFINES -DNS_CLONE_FS"
], [
AC_MSG_RESULT([no])
]
)
AC_MSG_CHECKING([for namespace: CLONE_FILES])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _GNU_SOURCE
#include <sched.h>
]],
[[unshare(CLONE_FILES);]])],
[
AC_MSG_RESULT([yes])
NAMESPACE_DEFINES="$NAMESPACE_DEFINES -DNS_CLONE_FILES"
], [
AC_MSG_RESULT([no])
]
)
AC_MSG_CHECKING([for namespace: CLONE_NEWNS])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _GNU_SOURCE
#include <sched.h>
]],
[[unshare(CLONE_NEWNS);]])],
[
AC_MSG_RESULT([yes])
NAMESPACE_DEFINES="$NAMESPACE_DEFINES -DNS_CLONE_NEWNS"
], [
AC_MSG_RESULT([no])
echo
echo "ERROR!!!!!!"
echo
echo "This host does not support the CLONE_NEWNS (mount) namespace flag! You"
echo "really really really don't want to run Singularity containers without a"
echo "Separate mount name namespace! It is possible, but not a great idea."
echo
echo "Pausing for 5 second so you can digest the severity of this..."
echo
sleep 5
]
)
AC_SUBST(NAMESPACE_DEFINES)
#AC_CHECK_DECLS([MS_PRIVATE,MS_REC], [],
# [AC_MSG_ERROR([Required mount(2) flags not available])],
# [[#include <sys/mount.h>]])
AC_CONFIG_FILES([
Makefile
singularity.spec
src/Makefile
etc/Makefile
bin/Makefile
bin/singularity
libexec/Makefile
libexec/mods/Makefile
libexec/cli/Makefile
])
AC_OUTPUT