update changelog
[platform/upstream/acl.git] / m4 / package_attrdev.m4
1 dnl Copyright (C) 2003, 2004, 2006, 2007  Silicon Graphics, Inc.
2 dnl
3 dnl This program is free software: you can redistribute it and/or modify it
4 dnl under the terms of the GNU General Public License as published by
5 dnl the Free Software Foundation, either version 2 of the License, or
6 dnl (at your option) any later version.
7 dnl
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.
12 dnl
13 dnl You should have received a copy of the GNU General Public License
14 dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
15 AC_DEFUN([AC_PACKAGE_NEED_ATTR_XATTR_H],
16   [ AC_CHECK_HEADERS([attr/xattr.h])
17     if test "$ac_cv_header_attr_xattr_h" != "yes"; then
18         echo
19         echo 'FATAL ERROR: attr/xattr.h does not exist.'
20         echo 'Install the extended attributes (attr) development package.'
21         echo 'Alternatively, run "make install-dev" from the attr source.'
22         exit 1
23     fi
24   ])
25
26 AC_DEFUN([AC_PACKAGE_NEED_ATTR_ERROR_H],
27   [ AC_CHECK_HEADERS([attr/error_context.h])
28     if test "$ac_cv_header_attr_error_context_h" != "yes"; then
29         echo
30         echo 'FATAL ERROR: attr/error_context.h does not exist.'
31         echo 'Install the extended attributes (attr) development package.'
32         echo 'Alternatively, run "make install-dev" from the attr source.'
33         exit 1
34     fi
35   ])
36
37 AC_DEFUN([AC_PACKAGE_NEED_ATTRIBUTES_H],
38   [ have_attributes_h=false
39     AC_CHECK_HEADERS([attr/attributes.h sys/attributes.h], [have_attributes_h=true], )
40     if test "$have_attributes_h" = "false"; then
41         echo
42         echo 'FATAL ERROR: attributes.h does not exist.'
43         echo 'Install the extended attributes (attr) development package.'
44         echo 'Alternatively, run "make install-dev" from the attr source.'
45         exit 1
46     fi
47   ])
48
49 AC_DEFUN([AC_PACKAGE_WANT_ATTRLIST_LIBATTR],
50   [ AC_CHECK_LIB(attr, attr_list, [have_attr_list=true], [have_attr_list=false])
51     AC_SUBST(have_attr_list)
52   ])
53
54 AC_DEFUN([AC_PACKAGE_NEED_GETXATTR_LIBATTR],
55   [ AC_CHECK_LIB(attr, getxattr,, [
56         echo
57         echo 'FATAL ERROR: could not find a valid Extended Attributes library.'
58         echo 'Install the extended attributes (attr) development package.'
59         echo 'Alternatively, run "make install-lib" from the attr source.'
60         exit 1
61     ])
62     libattr="-lattr"
63     test -f `pwd`/../attr/libattr/libattr.la && \
64         libattr="`pwd`/../attr/libattr/libattr.la"
65     AC_SUBST(libattr)
66   ])
67
68 AC_DEFUN([AC_PACKAGE_NEED_ATTRGET_LIBATTR],
69   [ AC_CHECK_LIB(attr, attr_get,, [
70         echo
71         echo 'FATAL ERROR: could not find a valid Extended Attributes library.'
72         echo 'Install the extended attributes (attr) development package.'
73         echo 'Alternatively, run "make install-lib" from the attr source.'
74         exit 1
75     ])
76     libattr="-lattr"
77     test -f `pwd`/../attr/libattr/libattr.la && \
78         libattr="`pwd`/../attr/libattr/libattr.la"
79     AC_SUBST(libattr)
80   ])
81
82 AC_DEFUN([AC_PACKAGE_NEED_ATTRIBUTES_MACROS],
83   [ AC_MSG_CHECKING([macros in attr/attributes.h])
84     AC_TRY_LINK([
85 #include <sys/types.h>
86 #include <attr/attributes.h>],
87     [ int x = ATTR_SECURE; ], [ echo ok ], [
88         echo
89         echo 'FATAL ERROR: could not find a current attributes header.'
90         echo 'Upgrade the extended attributes (attr) development package.'
91         echo 'Alternatively, run "make install-dev" from the attr source.'
92         exit 1 ])
93   ])