[PATCH] configure: Workaround for broken linux header(__u64 depends on __GNUC__)

Detlef Riekenberg wine.dev at web.de
Tue Dec 23 07:22:45 CST 2008


---
 configure.ac |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 53 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 99fe000..65e72bf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -247,6 +247,14 @@ AC_CHECK_LIB(pthread,pthread_create,AC_SUBST(LIBPTHREAD,"-lpthread"))
 AC_SUBST(XLIB,"")
 AC_SUBST(OPENGL_LIBS,"")
 
+dnl **** Do we need to workaround broken typedef (__u64 / __s64) on linux (before 2.6.26)? ****
+AC_CHECK_HEADERS(\
+    linux/types.h \
+    stdint.h
+)
+AC_CHECK_TYPES([__u64],,,[#include <linux/types.h>])
+AC_CHECK_TYPES([uint64_t],,,[#include <stdint.h>])
+
 dnl **** Check for header files ****
 
 AC_CHECK_HEADERS(\
@@ -315,7 +323,6 @@ AC_CHECK_HEADERS(\
 	scsi/scsi_ioctl.h \
 	scsi/sg.h \
 	soundcard.h \
-	stdint.h \
 	strings.h \
 	sys/asoundlib.h \
 	sys/cdio.h \
@@ -363,8 +370,52 @@ AC_CHECK_HEADERS(\
 	unistd.h \
 	utime.h \
 	valgrind/memcheck.h \
-	valgrind/valgrind.h
+	valgrind/valgrind.h \
+,,,[#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#ifdef HAVE_LINUX_TYPES_H
+# ifndef HAVE___U64
+#  ifdef HAVE_UINT64_T
+#   define __GNUC__ 1
+#   include <linux/types.h>
+#   undef __GNUC__
+#  endif
+# endif
+# include <linux/types.h>
+#endif]
 )
+
 AC_HEADER_STAT()
 
 dnl **** Checks for headers that depend on other ones ****
-- 
1.5.4.3


--=-qDAiBEXrqY3Qc6UJo1/x--




More information about the wine-patches mailing list