]> Dogcows Code - chaz/tar/blob - acinclude.m4
Options to control option handling in file lists.
[chaz/tar] / acinclude.m4
1 dnl Special Autoconf macros for GNU tar -*- autoconf -*-
2
3 dnl Copyright 2009, 2013-2014 Free Software Foundation, Inc.
4 dnl
5 dnl This file is part of GNU tar.
6 dnl
7 dnl GNU tar is free software; you can redistribute it and/or modify
8 dnl it under the terms of the GNU General Public License as published by
9 dnl the Free Software Foundation; either version 3 of the License, or
10 dnl (at your option) any later version.
11 dnl
12 dnl GNU tar is distributed in the hope that it will be useful,
13 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 dnl GNU General Public License for more details.
16 dnl
17 dnl You should have received a copy of the GNU General Public License
18 dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20 AC_DEFUN([TAR_COMPR_PROGRAM],[
21 m4_pushdef([tar_compr_define],translit($1,[a-z+-],[A-ZX_])[_PROGRAM])
22 m4_pushdef([tar_compr_var],[tar_cv_compressor_]translit($1,[+-],[x_]))
23 AC_ARG_WITH($1,
24 AC_HELP_STRING([--with-]$1[=PROG],
25 [use PROG as ]$1[ compressor program]),
26 [tar_compr_var=${withval}],
27 [tar_compr_var=m4_if($2,,$1,$2)])
28 AC_DEFINE_UNQUOTED(tar_compr_define, "$tar_compr_var",
29 [Define to the program name of ]$1[ compressor program])])
30
31 # Provide <attr/xattr.h>, if necessary
32
33 AC_DEFUN([TAR_HEADERS_ATTR_XATTR_H],
34 [
35 AC_ARG_WITH([xattrs],
36 AS_HELP_STRING([--without-xattrs], [don't use linux extended attributes]),
37 [], [with_xattrs=maybe]
38 )
39
40 # First check for <sys/xattr.h>
41 AC_CHECK_HEADERS([sys/xattr.h])
42 AM_CONDITIONAL([TAR_COND_XATTR_H],[test "$ac_cv_header_sys_xattr_h" = yes])
43 AM_CONDITIONAL([TAR_LIB_ATTR],[false])
44 if test "$ac_cv_header_sys_xattr_h" = yes; then
45 AC_CHECK_FUNCS(getxattr fgetxattr lgetxattr \
46 setxattr fsetxattr lsetxattr \
47 listxattr flistxattr llistxattr,
48 # only when functions are present
49 AC_DEFINE([HAVE_SYS_XATTR_H], [1],
50 [define to 1 if we have <sys/xattr.h> header])
51 if test "$with_xattrs" != no; then
52 AC_DEFINE([HAVE_XATTRS],,[Define when we have working linux xattrs.])
53 fi
54 )
55 fi
56
57 # If <sys/xattr.h> is not found, then check for <attr/xattr.h>
58 if test "$ac_cv_header_sys_xattr_h" != yes; then
59 AC_CHECK_HEADERS([attr/xattr.h])
60 AM_CONDITIONAL([TAR_COND_XATTR_H],[test "$ac_cv_header_attr_xattr_h" = yes])
61 AC_CHECK_LIB([attr],[fgetxattr])
62 AM_CONDITIONAL([TAR_LIB_ATTR],[test "$ac_cv_lib_attr_fgetxattr" = yes])
63 if test "$ac_cv_header_attr_xattr_h" = yes; then
64 AC_CHECK_FUNCS(getxattr fgetxattr lgetxattr \
65 setxattr fsetxattr lsetxattr \
66 listxattr flistxattr llistxattr,
67 # only when functions are present
68 AC_DEFINE([HAVE_ATTR_XATTR_H], [1],
69 [define to 1 if we have <attr/xattr.h> header])
70 if test "$with_xattrs" != no; then
71 AC_DEFINE([HAVE_XATTRS],,[Define when we have working linux xattrs.])
72 fi
73 )
74 fi
75 fi
76 ])
This page took 0.033534 seconds and 4 git commands to generate.