replace: Try to fix broken sys/capabilites.h on Linux.
authorStefan Metzmacher <metze@samba.org>
Wed, 2 Feb 2011 09:40:06 +0000 (10:40 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 3 Feb 2011 04:26:11 +0000 (05:26 +0100)
As this is more or less a broken header we need to include linux/types.h
before sys/capabilities.h to avoid redefinitions.

Systems like ClearOS 5.2 need linux/types.h very early.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Feb  3 05:26:12 CET 2011 on sn-devel-104

lib/replace/libreplace.m4
lib/replace/replace.h
lib/replace/wscript

index 3dd64ef8b8798fe0ac43014d39664c497a6bf34b..24fc5cdafe2a7cd4dc71852fefef41edaed411e3 100644 (file)
@@ -89,6 +89,8 @@ AC_INCLUDES_DEFAULT
 #endif]
 )
 
+AC_CHECK_HEADERS(linux/types.h)
+
 AC_CACHE_CHECK([for working mmap],libreplace_cv_HAVE_MMAP,[
 AC_TRY_RUN([#include "$libreplacedir/test/shared_mmap.c"],
            libreplace_cv_HAVE_MMAP=yes,libreplace_cv_HAVE_MMAP=no,libreplace_cv_HAVE_MMAP=cross)])
index f738658ffef8f3b565835f0470ff203d07c01dc1..60aa3d4e2c498fbb231fa1fc6e8de932ee18b7d0 100644 (file)
 #include <stddef.h>
 #endif
 
+#ifdef HAVE_LINUX_TYPES_H
+/*
+ * This is needed as some broken header files require this to be included early
+ */
+#include <linux/types.h>
+#endif
+
 #ifndef HAVE_STRERROR
 extern char *sys_errlist[];
 #define strerror(i) sys_errlist[i]
index c6c4fe1fdf808b1ec6cd1549c1d83d9394383cd0..9fbd3b5ffca50c5e2d5ef3e69ae695e7a0e045be 100644 (file)
@@ -37,7 +37,7 @@ def configure(conf):
         conf.DEFINE('_OSF_SOURCE', 1, add_to_cflags=True)
         conf.DEFINE('_XOPEN_SOURCE', 600, add_to_cflags=True)
 
-    conf.CHECK_HEADERS('crypt.h locale.h acl/libacl.h compat.h')
+    conf.CHECK_HEADERS('linux/types.h crypt.h locale.h acl/libacl.h compat.h')
     conf.CHECK_HEADERS('acl/libacl.h attr/xattr.h compat.h ctype.h dustat.h')
     conf.CHECK_HEADERS('fcntl.h fnmatch.h glob.h history.h krb5.h langinfo.h')
     conf.CHECK_HEADERS('libaio.h locale.h ndir.h pwd.h')