util-vserver-0.29
[util-vserver.git] / configure.ac
1 dnl $Id: configure.ac,v 1.1.2.1.2.31 2004/02/11 21:06:17 ensc Exp $
2
3 dnl Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
4 dnl  
5 dnl This program is free software; you can redistribute it and/or modify
6 dnl it under the terms of the GNU General Public License as published by
7 dnl the Free Software Foundation; either version 2, or (at your option)
8 dnl any later version.
9 dnl  
10 dnl This program is distributed in the hope that it will be useful,
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 dnl GNU General Public License for more details.
14 dnl  
15 dnl You should have received a copy of the GNU General Public License
16 dnl along with this program; if not, write to the Free Software
17 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 dnl  
19 dnl  
20 dnl As a special exception to the GNU General Public License, if you
21 dnl distribute this file as part of a program that contains a configuration
22 dnl script generated by Autoconf, you may include it under the same
23 dnl distribution terms that you use for the rest of that program.
24 dnl  
25
26 AC_PREREQ(2.57)
27
28 AC_INIT(util-vserver, 0.29, enrico.scholz@informatik.tu-chemnitz.de)
29 AC_CONFIG_SRCDIR([src/capchroot.c])
30 AC_CONFIG_HEADER([config.h])
31
32 AM_INIT_AUTOMAKE([gnu dist-bzip2 subdir-objects])
33 AM_MAINTAINER_MODE
34
35
36 # Checks for programs.
37 AC_PROG_CXX
38 AC_PROG_CC
39 AC_PROG_INSTALL
40 AC_PROG_LN_S
41 AC_PROG_RANLIB
42 AM_PROG_CC_C_O
43
44 ENSC_CHECK_CC_FLAG([-std=c99 -Wall -pedantic -W -Wno-unused-parameter])
45 ENSC_CHECK_CXX_FLAG([-ansi   -Wall -pedantic -W -fmessage-length=0])
46
47 AC_ARG_VAR(CC, [The C compiler])
48 ENSC_KERNEL_HEADERS(kernelincludedir)
49 ENSC_UV_VROOTDIR(vserverdir)
50 ENSC_CHANGELOG([SYSCALL_SWITCH])
51
52 dnl Check whether to enable linuxconf
53 AC_MSG_CHECKING([whether to enable linuxconf modules])
54 AC_ARG_ENABLE([linuxconf],
55               [AC_HELP_STRING([--enable-linuxconf],
56                               [enable 'newvserver' linuxconf module (default: no)])],
57               [case "$enableval" in
58                   yes|no) ;;
59                   *)      AC_MSG_ERROR(['$i' is not a supported value for '--enable-linuxconf']);;
60                esac],
61               [enable_linuxconf=no])
62
63 AM_CONDITIONAL(ENSC_ENABLE_LINUXCONF, [test x"$enable_linuxconf" = xyes])
64 AC_MSG_RESULT($enable_linuxconf)
65
66
67 dnl Check whether to use external kernel headers
68 AC_MSG_CHECKING([whether to use internal kernel headers])
69 AC_ARG_ENABLE([internal-headers],
70               [AC_HELP_STRING([--disable-internal-headers],
71                               [use vserver specific headers from the kernel instead of the shipped versions (default: no)])],
72               [case "$enableval" in
73                   yes|no) ;;
74                   *)      AC_MSG_ERROR(['$i' is not a supported value for '--disable-internal-headers']);;
75                esac],
76               [enable_internal_headers=yes])
77
78 AM_CONDITIONAL(ENSC_ENABLE_INTERNAL_HEADERS, [test x"$enable_internal_headers" = xyes])
79 AC_MSG_RESULT([$enable_internal_headers])
80
81
82 dnl Check for the APIs to be used
83 AC_MSG_CHECKING([for supported APIs])
84 AC_ARG_ENABLE([apis],
85               [AC_HELP_STRING([--enable-apis=APIS],
86                               [enable support for the given apis; possible values are: legacy,compat,v11,ALL (default: ALL)])],
87               [],
88               [enable_apis=ALL])
89
90 test x"$enable_apis" != xALL || enable_apis='legacy,compat,v11'
91 old_IFS=$IFS
92 IFS=,;
93 for i in $enable_apis; do
94         case "$i" in
95                 compat) AC_DEFINE(VC_ENABLE_API_COMPAT, 1, [Enable support for compatibily syscall API]);;
96                 legacy) AC_DEFINE(VC_ENABLE_API_LEGACY, 1, [Enable support for old, /proc parsing API]);;
97                 v11)    AC_DEFINE(VC_ENABLE_API_V11,    1, [Enable support for API of vserver 1.1.x]);;
98                 *)      AC_MSG_ERROR(['$i' is not a supported API]);;
99         esac
100 done
101 IFS=$old_IFS
102 AC_MSG_RESULT([$enable_apis])
103
104 ENSC_SYSCALL
105 ENSC_CHECK_EXT2FS_HEADER
106 AC_CHECK_FUNCS([vserver])
107 AC_CHECK_DECLS(MS_MOVE,,,[#include <linux/fs.h>])
108 AC_CHECK_TYPES(xid_t,,,[#include <sys/types.h>])
109
110 AC_CONFIG_FILES([util-vserver.spec Makefile])
111 AC_OUTPUT