~ubuntu-branches/ubuntu/quantal/lxc/quantal-201208301614

« back to all changes in this revision

Viewing changes to .pc/0200-liblxc/configure.ac

  • Committer: Package Import Robot
  • Author(s): Stéphane Graber, Stéphane Graber, Serge Hallyn
  • Date: 2012-08-22 11:50:51 UTC
  • Revision ID: package-import@ubuntu.com-20120822115051-2cmb0vjrkyadjovf
Tags: 0.8.0~rc1-4ubuntu28
[ Stéphane Graber ]
* Merge liblxc changes:
  - Build-depend on automake as autogen.sh is now run at build time.
  - Introduce new liblxc0 binary package
  - Make lxc to depend on liblxc0
  - Move library to the new binary package
  - Change libdir to be the public multi-arch path
  - Build with --disable-rpath
  - Move all the test binaries to a lxc-test-* namespace
* Merge python3-lxc changes:
  - Introduce new python3-lxc binary package
  - Update debian/rules to build the python3 code
* Update lxc-start-ephemeral:
  - Replace tabs by 4 spaces, fix indentation
  - Fix code to work properly as non-root (calling sudo where needed)

[ Serge Hallyn ]
* confile.c: support hooks in save_config().
* conf.h: Add array of hook names

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#                                               -*- Autoconf -*-
 
2
# Process this file with autoconf to produce a configure script.
 
3
 
 
4
AC_INIT([lxc], [0.8.0-rc1])
 
5
 
 
6
AC_CONFIG_SRCDIR([configure.ac])
 
7
AC_CONFIG_AUX_DIR([config])
 
8
AM_CONFIG_HEADER([src/config.h])
 
9
AM_INIT_AUTOMAKE([-Wno-portability])
 
10
AC_CANONICAL_HOST
 
11
AM_PROG_CC_C_O
 
12
AC_GNU_SOURCE
 
13
AC_CHECK_PROG(SETCAP, setcap, yes, no, $PATH$PATH_SEPARATOR/sbin)
 
14
 
 
15
AC_ARG_ENABLE([rpath],
 
16
        [AC_HELP_STRING([--disable-rpath], [do not set rpath in executables])],
 
17
        [], [enable_rpath=yes])
 
18
 
 
19
AM_CONDITIONAL([ENABLE_RPATH], [test "x$enable_rpath" = "xyes"])
 
20
 
 
21
AC_ARG_ENABLE([seccomp],
 
22
        [AC_HELP_STRING([--enable-seccomp], [enable seccomp])],
 
23
        [], [enable_seccomp=check])
 
24
 
 
25
AC_ARG_ENABLE([doc],
 
26
        [AC_HELP_STRING([--enable-doc], [make mans (require docbook2man installed) [default=auto]])],
 
27
        [], [enable_doc=auto])
 
28
 
 
29
if test "x$enable_doc" = "xyes" -o "x$enable_doc" = "xauto"; then
 
30
        AC_CHECK_PROG(have_docbook, [docbook2man], [yes], [no])
 
31
 
 
32
        test "x$have_docbook" = "xno" -a "x$enable_doc" = "xyes" && \
 
33
                AC_MSG_ERROR([docbook2man required by man request, but not found])
 
34
fi
 
35
 
 
36
if test "$enable_seccomp" = "check" ; then
 
37
    AC_CHECK_LIB([seccomp],[seccomp_init],[enable_seccomp=yes], [enable_seccomp=no])
 
38
fi
 
39
 
 
40
AM_CONDITIONAL([ENABLE_SECCOMP], [test "x$enable_seccomp" = "xyes"])
 
41
 
 
42
AM_COND_IF([ENABLE_SECCOMP],
 
43
    [AC_CHECK_HEADER([seccomp.h],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])])
 
44
     AC_CHECK_LIB([seccomp], [seccomp_init],[],[AC_MSG_ERROR([You must install the seccomp development package in order to compile lxc])])
 
45
     AC_DEFINE_UNQUOTED([ENABLE_SECCOMP], 1, [Seccomp is available])
 
46
     AC_SUBST([SECCOMP_LIBS], [-lseccomp])])
 
47
 
 
48
AM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$have_docbook" = "xyes"])
 
49
 
 
50
AC_ARG_ENABLE([examples],
 
51
        [AC_HELP_STRING([--disable-examples], [do not install configuration examples])],
 
52
        [], [enable_examples=yes])
 
53
 
 
54
AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"])
 
55
 
 
56
AS_AC_EXPAND(PREFIX, $prefix)
 
57
AS_AC_EXPAND(LIBDIR, $libdir)
 
58
AS_AC_EXPAND(BINDIR, $bindir)
 
59
AS_AC_EXPAND(INCLUDEDIR, $includedir)
 
60
AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
 
61
AS_AC_EXPAND(DATADIR, $datadir)
 
62
AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir)
 
63
AS_AC_EXPAND(DOCDIR, $docdir)
 
64
 
 
65
AC_ARG_WITH([config-path],
 
66
        [AC_HELP_STRING(
 
67
                [--with-config-path=dir],
 
68
                [lxc configuration repository path]
 
69
        )], [], [with_config_path=['${localstatedir}/lib/lxc']])
 
70
 
 
71
AC_ARG_WITH([rootfs-path],
 
72
        [AC_HELP_STRING(
 
73
                [--with-rootfs-path=dir],
 
74
                [lxc rootfs mount point]
 
75
        )], [], [with_rootfs_path=['${libdir}/lxc/rootfs']])
 
76
 
 
77
AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
 
78
 
 
79
AC_SUBST(LXCPATH, "${with_config_path}")
 
80
AC_SUBST(LXCROOTFSMOUNT, "${with_rootfs_path}")
 
81
AC_SUBST(LXCINITDIR, ['${libexecdir}'])
 
82
AC_SUBST(LXCTEMPLATEDIR, ['/usr/share/lxc/templates'])
 
83
 
 
84
AC_CHECK_HEADERS([linux/netlink.h linux/genetlink.h],
 
85
                                  [],
 
86
                                  AC_MSG_ERROR([netlink headers not found. Please install the linux kernel headers.]),
 
87
                                  [#include <sys/socket.h>
 
88
                 ])
 
89
 
 
90
AC_CHECK_HEADERS([sys/capability.h], [], AC_MSG_ERROR([please install libcap-devel.]),
 
91
[#include <sys/types.h>
 
92
#include <sys/capability.h>])
 
93
AC_CHECK_LIB(cap,cap_set_proc,caplib=yes,caplib=no)
 
94
AC_MSG_CHECKING([linux capabilities])
 
95
if test "x$caplib" = "xyes" ; then
 
96
   CAP_LIBS="-lcap"
 
97
   AC_MSG_RESULT([$CAP_LIBS])
 
98
else
 
99
   AC_MSG_ERROR([not found])
 
100
fi
 
101
AC_SUBST([CAP_LIBS])
 
102
 
 
103
# Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
 
104
AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
 
105
 
 
106
AC_CHECK_HEADERS([sys/signalfd.h])
 
107
 
 
108
AC_PROG_GCC_TRADITIONAL
 
109
 
 
110
AC_LINUX
 
111
 
 
112
if test "x$GCC" = "xyes"; then
 
113
  CFLAGS="$CFLAGS -Wall"
 
114
fi
 
115
 
 
116
AC_CONFIG_FILES([
 
117
        Makefile
 
118
        lxc.pc
 
119
        lxc.spec
 
120
        config/Makefile
 
121
 
 
122
        doc/Makefile
 
123
        doc/lxc-create.sgml
 
124
        doc/lxc-destroy.sgml
 
125
        doc/lxc-execute.sgml
 
126
        doc/lxc-start.sgml
 
127
        doc/lxc-checkpoint.sgml
 
128
        doc/lxc-restart.sgml
 
129
        doc/lxc-stop.sgml
 
130
        doc/lxc-console.sgml
 
131
        doc/lxc-freeze.sgml
 
132
        doc/lxc-unfreeze.sgml
 
133
        doc/lxc-monitor.sgml
 
134
        doc/lxc-wait.sgml
 
135
        doc/lxc-ls.sgml
 
136
        doc/lxc-ps.sgml
 
137
        doc/lxc-cgroup.sgml
 
138
        doc/lxc-kill.sgml
 
139
        doc/lxc-attach.sgml
 
140
        doc/lxc.conf.sgml
 
141
        doc/lxc.sgml
 
142
        doc/common_options.sgml
 
143
        doc/see_also.sgml
 
144
 
 
145
        doc/rootfs/Makefile
 
146
 
 
147
        doc/examples/Makefile
 
148
        doc/examples/lxc-macvlan.conf
 
149
        doc/examples/lxc-vlan.conf
 
150
        doc/examples/lxc-no-netns.conf
 
151
        doc/examples/lxc-empty-netns.conf
 
152
        doc/examples/lxc-phys.conf
 
153
        doc/examples/lxc-veth.conf
 
154
        doc/examples/lxc-complex.conf
 
155
 
 
156
        templates/Makefile
 
157
        templates/lxc-lenny
 
158
        templates/lxc-debian
 
159
        templates/lxc-ubuntu
 
160
        templates/lxc-ubuntu-cloud
 
161
        templates/lxc-opensuse
 
162
        templates/lxc-busybox
 
163
        templates/lxc-fedora
 
164
        templates/lxc-altlinux
 
165
        templates/lxc-sshd
 
166
        templates/lxc-archlinux
 
167
 
 
168
        src/Makefile
 
169
        src/lxc/Makefile
 
170
        src/lxc/lxc-ps
 
171
        src/lxc/lxc-ls
 
172
        src/lxc/lxc-netstat
 
173
        src/lxc/lxc-checkconfig
 
174
        src/lxc/lxc-setcap
 
175
        src/lxc/lxc-setuid
 
176
        src/lxc/lxc-version
 
177
        src/lxc/lxc-create
 
178
        src/lxc/lxc-clone
 
179
        src/lxc/lxc-shutdown
 
180
        src/lxc/lxc-destroy
 
181
 
 
182
])
 
183
AC_CONFIG_COMMANDS([default],[[]],[[]])
 
184
AC_OUTPUT
 
185
 
 
186
if test "x$SETCAP" = "xno"; then
 
187
   AC_MSG_NOTICE([
 
188
 
 
189
Warning:
 
190
--------
 
191
 
 
192
The setcap binary was not found. This means the tools to set the
 
193
privilege for the lxc commands are not available, that's ok, but you
 
194
will need to run these commands as root or install libcap-2.
 
195
 
 
196
])
 
197
 
 
198
else
 
199
 
 
200
   AC_MSG_NOTICE([
 
201
 
 
202
Advice:
 
203
-------
 
204
 
 
205
If you wish to have a non root user to use the lxc tools,
 
206
you can add the needed capabilities to the tools by invoking
 
207
the 'lxc-setcap' script. To remove the capabilities, use
 
208
'lxc-setcap -d'.
 
209
])
 
210
 
 
211
fi