Add SELinux context store/restore/list support.
[tar.git] / acinclude.m4
blob30381d380df8573516bdbd65c73f2aa086c0c48b
1 dnl Special Autoconf macros for GNU Tar         -*- autoconf -*-
2 dnl Copyright (C) 2009 Free Software Foundation, Inc.
3 dnl
4 dnl GNU tar is free software; you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation; either version 3, or (at your option)
7 dnl any later version.
8 dnl
9 dnl GNU tar 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 along
15 dnl with GNU tar.  If not, see <http://www.gnu.org/licenses/>.
17 AC_DEFUN([TAR_COMPR_PROGRAM],[
18  m4_pushdef([tar_compr_define],translit($1,[a-z+-],[A-ZX_])[_PROGRAM])
19  m4_pushdef([tar_compr_var],[tar_cv_compressor_]translit($1,[+-],[x_]))
20  AC_ARG_WITH($1,
21              AC_HELP_STRING([--with-]$1[=PROG],
22                             [use PROG as ]$1[ compressor program]),
23              [tar_compr_var=${withval}],
24              [tar_compr_var=m4_if($2,,$1,$2)])
25  AC_DEFINE_UNQUOTED(tar_compr_define, "$tar_compr_var",
26                     [Define to the program name of ]$1[ compressor program])])
28 # Provide <attr/xattr.h>, if necessary
30 AC_DEFUN([TAR_HEADERS_ATTR_XATTR_H],
32   AC_ARG_WITH([xattrs],
33     AS_HELP_STRING([--without-xattrs], [don't use linux extended attributes]),
34     [], [with_xattrs=maybe]
35   )
37   AC_CHECK_HEADERS([attr/xattr.h])
38   AM_CONDITIONAL([TAR_COND_XATTR_H],[test "$ac_cv_header_attr_xattr_h" = yes])
39   if test "$ac_cv_header_attr_xattr_h" = yes; then
40     AC_CHECK_FUNCS(getxattr  fgetxattr  lgetxattr \
41                    setxattr  fsetxattr  lsetxattr \
42                    listxattr flistxattr llistxattr,
43         # only when functions are present
44         AC_DEFINE([HAVE_ATTR_XATTR_H], [1],
45                     [define to 1 if we have <attr/xattr.h> header])
46         if test "$with_xattrs" != no; then
47           AC_DEFINE([HAVE_XATTRS],,[Define when we have working linux xattrs.])
48         fi
49     )
50   fi
52