summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2007-12-03 16:46:45 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:47:30 +0100
commitcbdad76b0d6b893a26c5dc20def034149fb3aa97 (patch)
tree36c7aa106448b2d48b888adb634e831c81f48afd /source4/lib
parentb08a82de587afdd561d55580957fec7cbeb2e43f (diff)
downloadsamba-cbdad76b0d6b893a26c5dc20def034149fb3aa97.tar.gz
samba-cbdad76b0d6b893a26c5dc20def034149fb3aa97.tar.bz2
samba-cbdad76b0d6b893a26c5dc20def034149fb3aa97.zip
r26255: Work around another broken aspect of sys/capability.h on RHEL5.
This is synced from samba3 v3-2-test/11bcdf780e164659b89: The /usr/include/sys/capability.h defines _LINUX_TYPES_H which prevents /usr/include/linux/types.h from being parsed (when included afterwards). Thus certain types are undefined that are for instance needed in /usr/include/linux/dqblk_xfs.h. This breaks the build of lib/sysquotas_xfs.c in Samba3. This commit adds a configure check and a workaround for this. Michael (This used to be commit df3e151992f0b942554034dd143ab8d7f0d7a75b)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/replace/system/capability.h9
-rw-r--r--source4/lib/replace/system/config.m416
2 files changed, 25 insertions, 0 deletions
diff --git a/source4/lib/replace/system/capability.h b/source4/lib/replace/system/capability.h
index 59b5845721..a7b78f0275 100644
--- a/source4/lib/replace/system/capability.h
+++ b/source4/lib/replace/system/capability.h
@@ -33,8 +33,17 @@
#define BROKEN_REDHAT_7_STATFS_WORKAROUND
#endif
+#if defined(BROKEN_RHEL5_SYS_CAP_HEADER) && !defined(_LINUX_TYPES_H)
+#define BROKEN_RHEL5_SYS_CAP_HEADER_WORKAROUND
+#endif
+
#include <sys/capability.h>
+#ifdef BROKEN_RHEL5_SYS_CAP_HEADER_WORKAROUND
+#undef _LINUX_TYPES_H
+#undef BROKEN_RHEL5_SYS_CAP_HEADER_WORKAROUND
+#endif
+
#ifdef BROKEN_REDHAT_7_STATFS_WORKAROUND
#undef _PPC_STATFS_H
#undef _I386_STATFS_H
diff --git a/source4/lib/replace/system/config.m4 b/source4/lib/replace/system/config.m4
index 64143fe371..799187af7d 100644
--- a/source4/lib/replace/system/config.m4
+++ b/source4/lib/replace/system/config.m4
@@ -35,6 +35,22 @@ AC_TRY_COMPILE([
if test x"$samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS" = x"yes"; then
AC_DEFINE(BROKEN_REDHAT_7_SYSTEM_HEADERS,1,[Broken RedHat 7.2 system header files])
fi
+
+AC_CACHE_CHECK([for broken RHEL5 sys/capability.h],samba_cv_BROKEN_RHEL5_SYS_CAP_HEADER,[
+AC_TRY_COMPILE([
+ #ifdef HAVE_SYS_CAPABILITY_H
+ #include <sys/capability.h>
+ #endif
+ #include <linux/types.h>
+ ],[
+ __s8 i;
+ ],
+ samba_cv_BROKEN_RHEL5_SYS_CAP_HEADER=no,
+ samba_cv_BROKEN_RHEL5_SYS_CAP_HEADER=yes
+)])
+if test x"$samba_cv_BROKEN_RHEL5_SYS_CAP_HEADER" = x"yes"; then
+ AC_DEFINE(BROKEN_RHEL5_SYS_CAP_HEADER,1,[Broken RHEL5 sys/capability.h])
+fi
;;
esac