1 dnl Copyright (C) 2002,2003,2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
3 dnl This program is free software; you can redistribute it and/or modify
4 dnl it under the terms of the GNU General Public License as published by
5 dnl the Free Software Foundation; either version 2, or (at your option)
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 dnl GNU General Public License for more details.
13 dnl You should have received a copy of the GNU General Public License
14 dnl along with this program; if not, write to the Free Software
15 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 dnl As a special exception to the GNU General Public License, if you
19 dnl distribute this file as part of a program that contains a configuration
20 dnl script generated by Autoconf, you may include it under the same
21 dnl distribution terms that you use for the rest of that program.
25 AC_INIT(util-vserver-pl, 0.3, support@planet-lab.org)
26 AC_CONFIG_SRCDIR([python/vserverimpl.c])
27 AC_CONFIG_HEADER([config.h])
29 AM_INIT_AUTOMAKE([1.8.3 gnu dist-bzip2 subdir-objects])
35 # Checks for programs.
45 AC_ARG_VAR(CC, [The C compiler])
48 AC_CHECK_HEADERS([asm/types.h stdint.h], [ : ],
49 [ ensc_have_vserver=no ])
50 AC_CHECK_TYPES([xid_t], [ : ], [AC_DEFINE_UNQUOTED([xid_t], [uint32_t],
51 [Define this to an unsigned integer type])],
52 [AC_INCLUDES_DEFAULT()
53 #ifdef HAVE_ASM_TYPES_H
54 # include <asm/types.h>
56 AC_CHECK_TYPES([nid_t], [ : ], [AC_DEFINE_UNQUOTED([nid_t], [uint32_t],
57 [Define this to an unsigned integer type])],
58 [AC_INCLUDES_DEFAULT()
59 #ifdef HAVE_ASM_TYPES_H
60 # include <asm/types.h>
62 AC_CHECK_TYPES([tag_t], [ : ], [AC_DEFINE_UNQUOTED([tag_t], [uint32_t],
63 [Define this to an unsigned integer type])],
64 [AC_INCLUDES_DEFAULT()
65 #ifdef HAVE_ASM_TYPES_H
66 # include <asm/types.h>
69 AC_CHECK_HEADER([vserver.h], [ : ],
70 [ AC_MSG_ERROR([No vserver.h found!]) ])
72 AC_CHECK_LIB(vserver, vc_ctx_create, [ : ],
73 [ AC_MSG_ERROR([No libvserver found!]) ])
80 if test x"$ensc_have_libnl" = xyes; then
81 AC_CHECK_HEADERS([asm/types.h stdint.h], [ : ],
82 [ ensc_have_libnl=no ])
83 AC_CHECK_TYPES([__s64], [ : ], [AC_DEFINE_UNQUOTED([__s64], [int64_t],
84 [Define this to a signed 64-bit integer type])],
85 [AC_INCLUDES_DEFAULT()
86 #ifdef HAVE_ASM_TYPES_H
87 # include <asm/types.h>
89 AC_CHECK_TYPES([__u64], [ : ], [AC_DEFINE_UNQUOTED([__u64], [uint64_t],
90 [Define this to an unsigned 64-bit integer type])],
91 [AC_INCLUDES_DEFAULT()
92 #ifdef HAVE_ASM_TYPES_H
93 # include <asm/types.h>
97 if test x"$ensc_have_libnl" = xyes; then
98 AC_CHECK_HEADERS([netlink/netlink.h netlink/route/addr.h], [ : ],
99 [ ensc_have_libnl=no ], [AC_INCLUDES_DEFAULT()
100 #ifdef HAVE_ASM_TYPES_H
101 # include <asm/types.h>
106 if test x"$ensc_have_libnl" = xyes; then
107 AC_CHECK_LIB(nl, nl_handle_alloc_cb, [
108 AC_DEFINE(HAVE_LIBNL_1_1, [],
109 [Define this to use the libnl 1.1 API])],
110 [AC_CHECK_LIB(nl, nlmsg_get_src,
111 [AC_DEFINE(HAVE_LIBNL_1_0, [],
112 [Define this to use the libnl 1.0-pre6 API])],
113 [ensc_have_libnl=no])])
116 if test x"$ensc_have_libnl" != xyes; then
119 **** 'libnl' could not be found;
120 **** this will disable the build of 'vip6-autod'
124 AM_CONDITIONAL(ENSC_HAVE_LIBNL, test x"$ensc_have_libnl" = xyes)
127 dnl libnl stuff ends here}
129 dnl #######################
132 dnl Get python includes
135 AC_MSG_CHECKING([for python includes])
136 PYTHON_INCLUDES=`python-config --includes 2>/dev/null`
137 if test x"$PYTHON_INCLUDES" = x; then
138 python_inc_plat=`$PYTHON -c "from distutils.sysconfig import get_python_inc; print get_python_inc(1)"`
139 python_inc=`$PYTHON -c "from distutils.sysconfig import get_python_inc; print get_python_inc()"`
140 if test x"$python_inc_plat" != x; then
141 PYTHON_INCLUDES="$PYTHON_INCLUDES -I$python_inc_plat"
143 if test x"$python_inc" != x; then
144 PYTHON_INCLUDES="$PYTHON_INCLUDES -I$python_inc"
147 AC_MSG_RESULT([$PYTHON_INCLUDES])
148 AC_SUBST(PYTHON_INCLUDES)
152 dnl Figure out util-vserver directories
156 PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin"
158 AC_MSG_CHECKING([for vserver-Rootdir])
159 DEFAULT_VSERVERDIR=`vserver-info 2>/dev/null | awk '$1 == "vserver-Rootdir:" { print $2 }'`
160 if test x"$DEFAULT_VSERVERDIR" = x; then
161 AC_MSG_ERROR([No vserver-Rootdir could be found!])
163 AC_MSG_RESULT([$DEFAULT_VSERVERDIR])
164 AC_DEFINE_UNQUOTED([DEFAULT_VSERVERDIR], ["$DEFAULT_VSERVERDIR"],
165 [Define this to the path where your guests live])
167 AC_MSG_CHECKING([for util-vserver-vars])
168 UV_PREFIX=`vserver-info 2>/dev/null | awk '$1 == "prefix:" { print $2 }'`
169 UV_PKGLIBDIR=`echo "$UV_PREFIX"/lib*/util-vserver`
170 if test x"$UV_PREFIX" = x -o ! -d "$UV_PKGLIBDIR" -o ! -r "$UV_PKGLIBDIR/util-vserver-vars"; then
171 AC_MSG_ERROR([No util-vserver-vars could be found in $UV_PKGLIBDIR])
173 AC_MSG_RESULT([$UV_PKGLIBDIR])
174 AC_SUBST(UV_PKGLIBDIR)
180 AC_DEFINE_UNQUOTED([LOCALSTATEDIR], ["$localstatedir"],
181 [Define this to the local state directory])
182 AC_ARG_WITH([initrddir], [AC_HELP_STRING([--with-initrddir <DIR>],
183 [use <DIR> as directory for SysV init-files (default: $sysconfdir/init.d)])],
185 yes|no) AC_MSG_ERROR(['$withval' is not a valid value for '--with-initrddir']);;
186 *) sysvdir="$withval";;
188 [sysvdir="${sysconfdir}/init.d"])
192 AC_DEFINE(_FILE_OFFSET_BITS, [64], [Use 64bit interface for filesystem operations])
194 AC_CONFIG_FILES([Makefile])