This repository has been archived by the owner on Oct 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
148 lines (130 loc) · 4.8 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
AC_INIT([afptest],[1.0.6])
AC_CONFIG_SRCDIR([test/spectest.c])
AM_INIT_AUTOMAKE(foreign)
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_MACRO_DIRS([macros])
AM_MAINTAINER_MODE([enable])
AC_CANONICAL_HOST
AC_PROG_CC
LT_INIT
case "$host_os" in
*aix*) this_os=aix ;;
*freebsd*) this_os=freebsd ;;
*hpux11*) this_os=hpux11 ;;
*irix*) this_os=irix ;;
*linux*) this_os=linux ;;
*osx*) this_os=macosx ;;
*darwin*) this_os=macosx ;;
*netbsd*) this_os=netbsd ;;
*openbsd*) this_os=openbsd ;;
*osf*) this_os=tru64 ;;
*solaris*) this_os=solaris ;;
esac
AC_SYS_LARGEFILE
AC_CHECK_HEADERS([byteswap.h fcntl.h strings.h sys/fcntl.h unistd.h sys/cdefs.h])
AC_CHECK_LIB(dl, dlopen)
AC_CHECK_LIB(nsl, main)
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(pthread, pthread_create)
AC_CHECK_FUNC(attropen, AC_DEFINE(HAVE_EAFD, 1, [Platform has seekable extended attributes fds]))
AC_CHECK_FUNCS(strlcpy strlcat)
AC_MSG_CHECKING(for bswap_64)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_BYTESWAP_H
#include <byteswap.h>
#endif
]], [[bswap_64(37);
]])],[neta_cv_bswap_64=yes],[neta_cv_bswap_64=no])
AC_MSG_RESULT($neta_cv_bswap_64)
if test x"$neta_cv_bswap_64" = xyes; then
AC_DEFINE(HAVE_BSWAP_64,1,[Define to 1 if bswap_64 is available via byteswap.h])
fi
dnl Check for Extended Attributes support
neta_cv_eas="ad"
neta_cv_eas_sys_found=no
neta_cv_eas_sys_not_found=no
AC_CHECK_HEADERS(sys/attributes.h attr/xattr.h sys/xattr.h sys/extattr.h sys/uio.h sys/ea.h)
case "$this_os" in
*osf*)
AC_SEARCH_LIBS(getproplist, [proplist])
AC_CHECK_FUNCS([getproplist fgetproplist setproplist fsetproplist],
[neta_cv_eas_sys_found=yes],
[neta_cv_eas_sys_not_found=yes])
AC_CHECK_FUNCS([delproplist fdelproplist add_proplist_entry get_proplist_entry],,
[neta_cv_eas_sys_not_found=yes])
AC_CHECK_FUNCS([sizeof_proplist_entry],,
[neta_cv_eas_sys_not_found=yes])
;;
*solaris*)
AC_CHECK_FUNCS([attropen],
[neta_cv_eas_sys_found=yes],
[neta_cv_eas_sys_not_found=yes])
;;
'freebsd')
AC_CHECK_FUNCS([extattr_delete_fd extattr_delete_file extattr_delete_link],
[neta_cv_eas_sys_found=yes],
[neta_cv_eas_sys_not_found=yes])
AC_CHECK_FUNCS([extattr_get_fd extattr_get_file extattr_get_link],,
[neta_cv_eas_sys_not_found=yes])
AC_CHECK_FUNCS([extattr_list_fd extattr_list_file extattr_list_link],,
[neta_cv_eas_sys_not_found=yes])
AC_CHECK_FUNCS([extattr_set_fd extattr_set_file extattr_set_link],,
[neta_cv_eas_sys_not_found=yes])
;;
*freebsd4* | *dragonfly* )
AC_DEFINE(BROKEN_EXTATTR, 1, [Does extattr API work])
;;
*)
AC_SEARCH_LIBS(getxattr, [attr])
if test "x$neta_cv_eas_sys_found" != "xyes" ; then
AC_CHECK_FUNCS([getxattr lgetxattr fgetxattr listxattr llistxattr],
[neta_cv_eas_sys_found=yes],
[neta_cv_eas_sys_not_found=yes])
AC_CHECK_FUNCS([flistxattr removexattr lremovexattr fremovexattr],,
[neta_cv_eas_sys_not_found=yes])
AC_CHECK_FUNCS([setxattr lsetxattr fsetxattr],,
[neta_cv_eas_sys_not_found=yes])
fi
if test "x$neta_cv_eas_sys_found" != "xyes" ; then
AC_CHECK_FUNCS([getea fgetea lgetea listea flistea llistea],
[neta_cv_eas_sys_found=yes],
[neta_cv_eas_sys_not_found=yes])
AC_CHECK_FUNCS([removeea fremoveea lremoveea setea fsetea lsetea],,
[neta_cv_eas_sys_not_found=yes])
fi
if test "x$neta_cv_eas_sys_found" != "xyes" ; then
AC_CHECK_FUNCS([attr_get attr_list attr_set attr_remove],,
[neta_cv_eas_sys_not_found=yes])
AC_CHECK_FUNCS([attr_getf attr_listf attr_setf attr_removef],,
[neta_cv_eas_sys_not_found=yes])
fi
;;
esac
# Do xattr functions take additional options like on Darwin?
if test x"$ac_cv_func_getxattr" = x"yes" ; then
AC_CACHE_CHECK([whether xattr interface takes additional options], smb_attr_cv_xattr_add_opt, [
old_LIBS=$LIBS
LIBS="$LIBS $ACL_LIBS"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#if HAVE_ATTR_XATTR_H
#include <attr/xattr.h>
#elif HAVE_SYS_XATTR_H
#include <sys/xattr.h>
#endif
]], [[
getxattr(0, 0, 0, 0, 0, 0);
]])],[smb_attr_cv_xattr_add_opt=yes],[smb_attr_cv_xattr_add_opt=no;LIBS=$old_LIBS])
])
if test x"$smb_attr_cv_xattr_add_opt" = x"yes"; then
AC_DEFINE(XATTR_ADD_OPT, 1, [xattr functions have additional options])
fi
fi
if test "x$neta_cv_eas_sys_found" = "xyes" ; then
if test "x$neta_cv_eas_sys_not_found" != "xyes" ; then
neta_cv_eas="$neta_cv_eas | sys"
fi
fi
AC_CONFIG_FILES([Makefile
macros/Makefile
test/Makefile])
AC_OUTPUT