summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/replace/libreplace.m42
-rw-r--r--lib/replace/replace.h7
-rw-r--r--lib/replace/wscript2
3 files changed, 10 insertions, 1 deletions
diff --git a/lib/replace/libreplace.m4 b/lib/replace/libreplace.m4
index 3dd64ef8b8..24fc5cdafe 100644
--- a/lib/replace/libreplace.m4
+++ b/lib/replace/libreplace.m4
@@ -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)])
diff --git a/lib/replace/replace.h b/lib/replace/replace.h
index f738658ffe..60aa3d4e2c 100644
--- a/lib/replace/replace.h
+++ b/lib/replace/replace.h
@@ -121,6 +121,13 @@
#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]
diff --git a/lib/replace/wscript b/lib/replace/wscript
index c6c4fe1fdf..9fbd3b5ffc 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -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')