]>
Commit | Line | Data |
---|---|---|
2183082c SH |
1 | # Process this file with autoconf to produce a configure script. |
2 | ||
3 | AC_PREREQ(2.61) | |
9d494a0f | 4 | AC_INIT([lxcfs], [3.1.2], [lxc-devel@lists.linuxcontainers.org]) |
7456f3b5 SG |
5 | AC_SUBST(ACLOCAL_AMFLAGS, "-I m4") |
6 | AC_CONFIG_MACRO_DIR([m4]) | |
2183082c | 7 | |
b46e63e2 | 8 | AM_INIT_AUTOMAKE([subdir-objects -Wno-portability]) |
df54106a | 9 | |
2183082c SH |
10 | AC_GNU_SOURCE |
11 | AC_CONFIG_HEADERS([config.h]) | |
12 | AC_CONFIG_FILES([ | |
c1f9bbee | 13 | Makefile |
3cd4195e | 14 | lxcfs.spec |
6cb7f996 SH |
15 | config/Makefile |
16 | config/init/Makefile | |
17 | config/init/systemd/Makefile | |
18 | config/init/sysvinit/Makefile | |
19 | config/init/upstart/Makefile | |
7456f3b5 SG |
20 | share/Makefile |
21 | share/00-lxcfs.conf | |
22 | share/lxc.mount.hook | |
5d6df2dd | 23 | share/lxc.reboot.hook |
c1f9bbee | 24 | tests/Makefile ]) |
2183082c | 25 | |
2183082c SH |
26 | LT_INIT |
27 | AC_PROG_CC | |
28 | ||
29 | AC_PROG_CC_C99 | |
30 | ||
2c51f8dd SH |
31 | AC_CHECK_LIB(pthread, main) |
32 | ||
2183082c SH |
33 | PKG_CHECK_MODULES(FUSE, fuse) |
34 | ||
35 | AC_PATH_PROG(HELP2MAN, help2man, false // No help2man //) | |
d85bd3de | 36 | AM_CONDITIONAL([HAVE_HELP2MAN], [test "x$HELP2MAN" != "xfalse // No help2man //" ]) |
2183082c | 37 | |
35482f91 SH |
38 | AC_ARG_WITH([runtime-path], |
39 | [AC_HELP_STRING( | |
40 | [--with-runtime-path=dir], | |
41 | [runtime directory (default: /run)] | |
42 | )], [], [with_runtime_path=['/run']]) | |
43 | ||
44 | AS_AC_EXPAND(RUNTIME_PATH, "$with_runtime_path") | |
7456f3b5 | 45 | AS_AC_EXPAND(LXCFSSHAREDIR, "$datarootdir/lxcfs") |
b4851b56 | 46 | AS_AC_EXPAND(LXCCONFDIR, "$datarootdir/lxc/config/common.conf.d") |
7456f3b5 SG |
47 | AS_AC_EXPAND(LXCFSTARGETDIR, "$localstatedir/lib/lxcfs") |
48 | ||
6cb7f996 SH |
49 | # Detect the distribution. This is used for the default configuration and |
50 | # for some distro-specific build options. | |
51 | AC_MSG_CHECKING([host distribution]) | |
52 | AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO], [Specify the Linux distribution to target: One of redhat, oracle, centos, fedora, suse, gentoo, debian, arch, slackware, paldo, openmandriva or pardus.])) | |
53 | if type lsb_release >/dev/null 2>&1 && test "z$with_distro" = "z"; then | |
54 | with_distro=`lsb_release -is` | |
55 | fi | |
56 | if test "z$with_distro" = "z"; then | |
57 | AC_CHECK_FILE(/etc/redhat-release,with_distro="redhat") | |
58 | AC_CHECK_FILE(/etc/oracle-release,with_distro="oracle") | |
59 | AC_CHECK_FILE(/etc/centos-release,with_distro="centos") | |
60 | AC_CHECK_FILE(/etc/fedora-release,with_distro="fedora") | |
61 | AC_CHECK_FILE(/etc/SuSE-release,with_distro="suse") | |
62 | AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo") | |
63 | AC_CHECK_FILE(/etc/debian_version,with_distro="debian") | |
64 | AC_CHECK_FILE(/etc/arch-release,with_distro="arch") | |
65 | AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware") | |
66 | AC_CHECK_FILE(/etc/frugalware-release,with_distro="frugalware") | |
67 | AC_CHECK_FILE(/etc/mandrakelinux-release, with_distro="openmandriva") | |
68 | AC_CHECK_FILE(/etc/mandriva-release,with_distro="openmandriva") | |
69 | AC_CHECK_FILE(/etc/pardus-release,with_distro="pardus") | |
00d7fdd8 | 70 | AC_CHECK_FILE(/etc/pld-release,with_distro="pld") |
6cb7f996 SH |
71 | fi |
72 | with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]'` | |
73 | ||
74 | if test "z$with_distro" = "z"; then | |
75 | with_distro="unknown" | |
76 | fi | |
77 | case $with_distro in | |
78 | ubuntu) | |
79 | distroconf=default.conf.ubuntu | |
80 | ;; | |
00d7fdd8 | 81 | redhat|centos|fedora|oracle|oracleserver|pld) |
6cb7f996 SH |
82 | distroconf=default.conf.libvirt |
83 | ;; | |
84 | *) | |
85 | distroconf=default.conf.unknown | |
86 | ;; | |
87 | esac | |
88 | AC_MSG_RESULT([$with_distro]) | |
89 | AM_CONDITIONAL([HAVE_DEBIAN], [test x"$with_distro" = "xdebian" -o x"$with_distro" = "xubuntu"]) | |
90 | AM_CONDITIONAL([DISTRO_UBUNTU], [test "x$with_distro" = "xubuntu"]) | |
91 | ||
92 | # Check for init system type | |
93 | AC_MSG_CHECKING([for init system type]) | |
94 | AC_ARG_WITH([init-script], | |
95 | [AC_HELP_STRING([--with-init-script@<:@=TYPE@<:@,TYPE,...@:>@@:>@], | |
96 | [Type(s) of init script to install: bsd, openrc, sysvinit, systemd, upstart, | |
97 | distro @<:@default=distro@:>@])],[],[with_init_script=distro]) | |
98 | case "$with_init_script" in | |
99 | distro) | |
100 | case $with_distro in | |
101 | fedora) | |
102 | init_script=systemd | |
103 | ;; | |
104 | redhat|centos|oracle|oracleserver) | |
105 | init_script=sysvinit | |
106 | ;; | |
107 | debian) | |
ef2256ce | 108 | init_script=upstart,systemd,sysvinit |
6cb7f996 SH |
109 | ;; |
110 | ubuntu) | |
ef2256ce | 111 | init_script=upstart,systemd,sysvinit |
6cb7f996 | 112 | ;; |
00d7fdd8 ER |
113 | pld) |
114 | init_script=systemd,sysvinit | |
115 | ;; | |
6cb7f996 SH |
116 | slackware) |
117 | echo -n "Warning: bsd init job not yet implemented" | |
118 | init_script= | |
119 | ;; | |
120 | gentoo) | |
121 | echo -n "Warning: openrc init job not yet implemented" | |
122 | init_script= | |
123 | ;; | |
124 | *) | |
125 | echo -n "Linux distribution init system unknown." | |
126 | init_script= | |
127 | ;; | |
128 | esac | |
129 | ;; | |
130 | *) | |
131 | init_script=$with_init_script | |
132 | ;; | |
133 | esac | |
134 | ||
135 | # Check valid init systems were given, run in subshell so we don't mess up IFS | |
136 | (IFS="," ; for init_sys in $init_script; | |
137 | do | |
138 | case "$init_sys" in | |
139 | none|bsd|openrc|sysvinit|systemd|upstart) | |
140 | ;; | |
141 | *) | |
142 | exit 1 | |
143 | ;; | |
144 | esac | |
145 | done) || AC_MSG_ERROR([Unknown init system type in $init_script]) | |
146 | ||
147 | AM_CONDITIONAL([INIT_SCRIPT_BSD], [echo "$init_script" |grep -q "bsd"]) | |
148 | AM_CONDITIONAL([INIT_SCRIPT_OPENRC], [echo "$init_script" |grep -q "openrc"]) | |
149 | AM_CONDITIONAL([INIT_SCRIPT_SYSV], [echo "$init_script" |grep -q "sysvinit"]) | |
150 | AM_CONDITIONAL([INIT_SCRIPT_SYSTEMD], [echo "$init_script" |grep -q "systemd"]) | |
151 | AM_CONDITIONAL([INIT_SCRIPT_UPSTART], [echo "$init_script" |grep -q "upstart"]) | |
152 | AC_MSG_RESULT($init_script) | |
153 | ||
369154d6 | 154 | AC_SUBST([lxcfsdir], "${libdir}/lxcfs") |
df54106a | 155 | |
237e200e SH |
156 | # Rootfs path, where the container mount structure is assembled |
157 | AC_ARG_WITH([rootfs-path], | |
158 | [AC_HELP_STRING( | |
159 | [--with-rootfs-path=dir], | |
160 | [lxc rootfs mount point] | |
161 | )], [], [with_rootfs_path=['${libdir}/lxc/rootfs']]) | |
162 | ||
163 | AS_AC_EXPAND(LIBDIR, "$libdir") | |
164 | ||
5fbea8a6 CB |
165 | AC_CHECK_FUNCS([strlcpy], |
166 | AM_CONDITIONAL(HAVE_STRLCPY, true) | |
167 | AC_DEFINE(HAVE_STRLCPY,1,[Have strlcpy]), | |
168 | AM_CONDITIONAL(HAVE_STRLCPY, false)) | |
169 | AC_CHECK_FUNCS([strlcat], | |
170 | AM_CONDITIONAL(HAVE_STRLCAT, true) | |
171 | AC_DEFINE(HAVE_STRLCAT,1,[Have strlcat]), | |
172 | AM_CONDITIONAL(HAVE_STRLCAT, false)) | |
173 | ||
2aa59b2e CB |
174 | AC_CHECK_FUNCS([pidfd_open], |
175 | AM_CONDITIONAL(HAVE_PIDFD_OPEN, true) | |
176 | AC_DEFINE(HAVE_PIDFD_OPEN,1,[Supports pidfd_open]), | |
177 | AM_CONDITIONAL(HAVE_PIDFD_OPEN, false)) | |
178 | ||
179 | AC_CHECK_FUNCS([pidfd_send_signal], | |
180 | AM_CONDITIONAL(HAVE_PIDFD_SEND_SIGNAL, true) | |
181 | AC_DEFINE(HAVE_PIDFD_SEND_SIGNAL,1,[Supports pidfd_send_signal]), | |
182 | AM_CONDITIONAL(HAVE_PIDFD_SEND_SIGNAL, false)) | |
183 | ||
2183082c | 184 | AC_OUTPUT |