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