diff options
author | Michael Adam <obnox@samba.org> | 2007-11-16 00:45:44 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2007-11-16 00:45:59 +0100 |
commit | 6028176a392e095d8600e3c27704ee454c152b3f (patch) | |
tree | a40bfe446ee3e762f6fd275c56c2af450b1e56e2 | |
parent | 3f437f681aa130438774cc5f4b8f16d00b43b377 (diff) | |
download | samba-6028176a392e095d8600e3c27704ee454c152b3f.tar.gz samba-6028176a392e095d8600e3c27704ee454c152b3f.tar.bz2 samba-6028176a392e095d8600e3c27704ee454c152b3f.zip |
Fix the build on RHEL5, when libcap-devel is installed.
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.
This commit adds a configure check and a workaround for this.
Michael
(This used to be commit 11bcdf780e164659b89a66e24edc27e89da7619a)
-rw-r--r-- | source3/configure.in | 12 | ||||
-rw-r--r-- | source3/lib/replace/system/capability.h | 9 |
2 files changed, 21 insertions, 0 deletions
diff --git a/source3/configure.in b/source3/configure.in index be2b2628d9..d37e3925aa 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -3242,6 +3242,18 @@ 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 diff --git a/source3/lib/replace/system/capability.h b/source3/lib/replace/system/capability.h index 4fe7c8d51b..b3142371f9 100644 --- a/source3/lib/replace/system/capability.h +++ b/source3/lib/replace/system/capability.h @@ -32,8 +32,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 _I386_STATFS_H #undef BROKEN_REDHAT_7_STATFS_WORKAROUND |