summaryrefslogtreecommitdiff
path: root/lib/replace/wscript
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-06-01 13:29:38 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-06-02 02:13:49 +0200
commitc290cdb9349220ba70b54143e1432da0230e2cee (patch)
tree4ebf0aa557376557eaec362eaa14f587c53ea1ec /lib/replace/wscript
parent664af060ac9ea83b565fbb817bb63d67d83843ef (diff)
downloadsamba-c290cdb9349220ba70b54143e1432da0230e2cee.tar.gz
samba-c290cdb9349220ba70b54143e1432da0230e2cee.tar.bz2
samba-c290cdb9349220ba70b54143e1432da0230e2cee.zip
lib/replace: xattr wrappers in lib/replace rather than source3/lib/system.c
This also moves all the still-used configure tests etc. The unused OSF API is also removed at this time. Andrew Bartlett
Diffstat (limited to 'lib/replace/wscript')
-rw-r--r--lib/replace/wscript30
1 files changed, 29 insertions, 1 deletions
diff --git a/lib/replace/wscript b/lib/replace/wscript
index d7b0634f3f..fc0cb00ae2 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -211,6 +211,32 @@ def configure(conf):
conf.CHECK_FUNCS('getgrent_r getgrgid_r getgrnam_r getgrouplist getpagesize')
conf.CHECK_FUNCS('getpwent_r getpwnam_r getpwuid_r epoll_create')
+ conf.SET_TARGET_TYPE('attr', 'EMPTY')
+
+ conf.CHECK_FUNCS_IN('''
+fgetxattr flistea flistxattr
+fremovexattr fsetxattr getxattr
+listxattr removexattr setxattr
+''', 'attr', checklibc=True)
+
+ # We need to check for linux xattrs first, as we do not wish to link to -lattr
+ # (the XFS compat API) on Linux systems with the native xattr API
+ if not conf.CONFIG_SET('HAVE_GETXATTR'):
+ conf.CHECK_FUNCS_IN('''
+attr_get attr_getf attr_list attr_listf attropen attr_remove
+attr_removef attr_set attr_setf extattr_delete_fd extattr_delete_file
+extattr_get_fd extattr_get_file extattr_list_fd extattr_list_file
+extattr_set_fd extattr_set_file fgetea flistea
+fremoveea fsetea getea listea
+removeea setea
+''', 'attr', checklibc=True)
+
+ # Darwin has extra options to xattr-family functions
+ conf.CHECK_CODE('getxattr(0, 0, 0, 0, 0, 0);',
+ 'XATTR_ADD_OPT',
+ msg="Checking whether xattr interface takes additional options",
+ headers='sys/types.h attr/xattr.h sys/xattr.h')
+
conf.CHECK_FUNCS_IN('dlopen dlsym dlerror dlclose', 'dl',
checklibc=True, headers='dlfcn.h dl.h')
@@ -474,6 +500,8 @@ def build(bld):
if not bld.CONFIG_SET('HAVE_INET_ATON'): REPLACE_SOURCE += ' inet_aton.c'
if not bld.CONFIG_SET('HAVE_INET_NTOP'): REPLACE_SOURCE += ' inet_ntop.c'
if not bld.CONFIG_SET('HAVE_INET_PTON'): REPLACE_SOURCE += ' inet_pton.c'
+ if not bld.CONFIG_SET('HAVE_GETXATTR') or bld.CONFIG_SET('XATTR_ADD_OPT'):
+ REPLACE_SOURCE += ' xattr.c'
bld.SAMBA_LIBRARY('replace',
source=REPLACE_SOURCE,
@@ -484,7 +512,7 @@ def build(bld):
# at the moment:
# hide_symbols=bld.BUILTIN_LIBRARY('replace'),
private_library=True,
- deps='crypt dl nsl socket rt' + extra_libs)
+ deps='crypt dl nsl socket rt attr' + extra_libs)
bld.SAMBA_SUBSYSTEM('replace-test',
source='''test/testsuite.c test/strptime.c