8d18bc9dc107305656109f97f8ff4f07e87a8049
[util-vserver.git] / m4 / ensc_e2fscheck.m4
1 dnl $Id: ensc_e2fscheck.m4,v 1.3 2004/02/19 22:31:04 ensc Exp $
2
3 dnl Copyright (C) 2004 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 AC_DEFUN([ENSC_CHECK_EXT2FS_HEADER],
19 [
20     AC_LANG_PUSH(C++)
21     AC_CACHE_CHECK([for ext2fs-headers], [ensc_cv_test_ext2fs_header],[
22         AC_COMPILE_IFELSE(AC_LANG_SOURCE([#include <ext2fs/ext2_fs.h>
23                                           int main() { return 0; }]),
24                           [ensc_cv_test_ext2fs_header=e2fsprogs],[
25         AC_COMPILE_IFELSE(AC_LANG_SOURCE([#include <linux/ext2_fs.h>
26                                           int main() { return 0; }]),
27                           [ensc_cv_test_ext2fs_header=kernel],[
28         ensc_cv_test_ext2fs_header=none])])])
29
30     case x"$ensc_cv_test_ext2fs_header" in
31         (xe2fsprogs)
32                 AC_CHECK_HEADER([ext2fs/ext2_fs.h],
33                         [AC_DEFINE(ENSC_HAVE_EXT2FS_EXT2_FS_H, 1, [define when <ext2fs/ext2_fs.h> is usable])],
34                         [AC_MSG_FAILURE([unexpected error while checkin for <ext2fs/ext2_fs.h>])])
35                 ;;
36         (xkernel)
37                 AC_CHECK_HEADER([linux/ext2_fs.h],
38                         [AC_DEFINE(ENSC_HAVE_LINUX_EXT2_FS_H, 1, [define when <linux/ext2_fs.h> is usable])],
39                         [AC_MSG_FAILURE([unexpected error while checkin for <linux/ext2_fs.h>])])
40                 ;;
41         (*)
42                 AC_MSG_FAILURE([
43 ext2fs headers were not found, or they are not usable. This can have
44 the following reasons:
45
46 * you have neither the e2fsprogs nor the kernel headers installed
47
48 * kernel headers are broken (e.g. these of linux 2.6 are known to be)
49   and you do not have e2fsprogs headers installed; please try to install
50   - e2fsprogs-devel (for Red Hat), or
51   - libext2fs2-devel (for Mandrake), or
52   - e2fslibs-dev (for Debian)
53   in this case.
54
55 * kernel headers are broken and your e2fsprogs headers are too old;
56   until version 1.27 (inclusive), they are using reserved C++ keywords
57
58 * kernel headers are broken and your e2fsprogs headers are too new;
59   recent (January 2004) BK snapshots of e2fsprogs are unusable for
60   C++, for details and a solution see
61   https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=112448
62
63
64 In the latter two cases you have the following options:
65 * fix the headers manually, or
66 * install a stable version of e2fsprogs (e.g. 1.34), or
67 * use good kernel headers (from linux 2.4.x)
68 ])
69                 ;;
70     esac
71     AC_LANG_POP
72 ])