cbf365c42d420c13b4a64fe45f780e1f850053c5
[util-vserver.git] / m4 / ensc_uv_vrootdir.m4
1 dnl $Id: ensc_uv_vrootdir.m4,v 1.2 2003/12/26 00:22:49 uid68581 Exp $
2
3 dnl Copyright (C) 2002 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; version 2 of the License.
8 dnl  
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 dnl GNU General Public License for more details.
13 dnl  
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program; if not, write to the Free Software
16 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18 dnl Usage: ENSC_UV_VROOTDIR[(<vserverdir-variable>)]
19 dnl        <vserverdir-variable> ... name of variable which will get assigned
20 dnl                                  the dirname of the vserver-topdir 
21
22 AC_DEFUN([ENSC_UV_VROOTDIR],
23 [
24         AC_MSG_CHECKING([which vserver-rootdir is to use])
25         AC_ARG_WITH([vrootdir],
26                     [AC_HELP_STRING([--with-vrootdir=DIR],
27                                     [place vservers under DIR (default: /vservers)])],
28                     [case "$withval" in
29                         yes|no) AC_MSG_ERROR(['$withval' is not a valid value for vrootdir]);;
30                         *)      ensc_uv_path_vrootdir=$withval;;
31                      esac],
32                     [ensc_uv_path_vrootdir=/vservers])
33         AC_MSG_RESULT([$ensc_uv_path_vrootdir])
34
35         if test x"$1" != x; then
36                 $1=$ensc_uv_path_vrootdir
37                 AC_SUBST($1)
38         fi
39 ])