60ef970f0cc10c7220f1f4d89dd9945204961521
[util-vserver.git] / util-vserver / configure.ac
1 dnl $Id$
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.24.92, 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 AC_MSG_CHECKING([whether to enable linuxconf modules])
53 AC_ARG_ENABLE([linuxconf],
54               [AC_HELP_STRING([--enable-linuxconf],
55                               [enable 'newvserver' linuxconf module (default: no)])],
56               [case "$enableval" in
57                   yes|no) ;;
58                   *)      AC_MSG_ERROR(['$i' is not a supported value for '--enable-linuxconf']);;
59                esac],
60               [enable_linuxconf=no])
61
62 AC_MSG_RESULT($enable_linuxconf)
63 AM_CONDITIONAL(ENSC_ENABLE_LINUXCONF, [test x"$enable_linuxconf" = xyes])
64
65
66 AC_MSG_CHECKING([for supported APIs])
67 AC_ARG_ENABLE([apis],
68               [AC_HELP_STRING([--enable-apis=APIS],
69                               [enable support for the given apis; possible values are: legacy,compat,ALL (default: ALL)])],
70               [],
71               [supported_apis=ALL])
72
73 test x"$supported_apis" != xALL || supported_apis='legacy,compat,v11'
74 old_IFS=$IFS
75 IFS=,;
76 for i in $supported_apis; do
77         case "$i" in
78                 compat) AC_DEFINE(VC_ENABLE_API_COMPAT, 1, [Enable support for compatibily syscall API]);;
79                 legacy) AC_DEFINE(VC_ENABLE_API_LEGACY, 1, [Enable support for old, /proc parsing API]);;
80                 v11)    AC_DEFINE(VC_ENABLE_API_V11,    1, [Enable support for API of vserver 1.1.x]);;
81                 *)      AC_MSG_ERROR(['$i' is not a supported API]);;
82         esac
83 done
84 IFS=$old_IFS
85 AC_MSG_RESULT([$supported_apis])
86
87 AC_CHECK_HEADERS([ext2fs/ext2fs.h], [],
88   [AC_CHECK_HEADERS([linux/ext2_fs.h], [],
89                     [AC_MSG_ERROR([Sorry, do not know, how to include 'ext2fs.h'])])])
90
91 AC_CHECK_FUNCS([sys_virtual_context])
92 AC_CHECK_DECLS(MS_MOVE,,,[#include <linux/fs.h>])
93 AC_CHECK_TYPES(ctx_t,,,[#include <sys/types.h>])
94
95 AC_CONFIG_FILES([util-vserver.spec Makefile])
96 AC_OUTPUT