Skip to content

Commit

Permalink
compile-flickernoise: fix zlib compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiangfu Liu committed Aug 25, 2011
1 parent 6ec4142 commit dbfef34
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compile-flickernoise/Makefile
Expand Up @@ -220,6 +220,8 @@ rtems: $(BUILD_DIR)/bsp-milkymist/Makefile

$(BUILD_DIR)/bsp-milkymist/Makefile:
mkdir -p $(BUILD_DIR)/bsp-milkymist
(cd $(MILKYMIST_GIT_DIR)/rtems.git && patch -Np1 < ${CURDIR}/patches/rtems-0001-zlib-git-cvs-bug.patch)
#workaround git cvs bug
(cd $(MILKYMIST_GIT_DIR)/rtems.git && ./bootstrap -c && ./bootstrap -p && ./bootstrap)
(cd $(BUILD_DIR)/bsp-milkymist && ../../$(MILKYMIST_GIT_DIR)/rtems.git/configure $(RTEMS_CONFIGURE_FLAGS))

Expand Down
74 changes: 74 additions & 0 deletions compile-flickernoise/patches/rtems-0001-zlib-git-cvs-bug.patch
@@ -0,0 +1,74 @@
diff --git a/cpukit/zlib/zconf.h.in b/cpukit/zlib/zconf.h.in
index 15b7cfd..beca553 100644
--- a/cpukit/zlib/zconf.h.in
+++ b/cpukit/zlib/zconf.h.in
@@ -3,7 +3,7 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/

-/* @(#) $Id: zconf.h.in,v 1.1 2010/02/21 22:38:24 ralf Exp $ */
+/* @(#) $Id: zconf.h.in,v 1.1.1.2 2010/04/18 17:58:06 ralf Exp $ */

#ifndef ZCONF_H
#define ZCONF_H
@@ -315,10 +315,6 @@
# endif
#endif

-#ifdef HAVE_VISIBILITY_PRAGMA
-# define ZEXTERN __attribute__((visibility ("default"))) extern
-#endif
-
#ifndef ZEXTERN
# define ZEXTERN extern
#endif
@@ -364,8 +360,21 @@ typedef uLong FAR uLongf;
# define Z_HAVE_UNISTD_H
#endif

-#ifdef Z_HAVE_UNISTD_H
+#ifdef STDC
# include <sys/types.h> /* for off_t */
+#endif
+
+/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
+ * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
+ * though the former does not conform to the LFS document), but considering
+ * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
+ * equivalently requesting no 64-bit operations
+ */
+#if -_LARGEFILE64_SOURCE - -1 == 1
+# undef _LARGEFILE64_SOURCE
+#endif
+
+#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
# include <unistd.h> /* for SEEK_* and off_t */
# ifdef VMS
# include <unixio.h> /* for off_t */
@@ -375,19 +384,22 @@ typedef uLong FAR uLongf;
# endif
#endif

-#ifdef _LARGEFILE64_SOURCE
-# include <sys/types.h>
-#endif
-
#ifndef SEEK_SET
# define SEEK_SET 0 /* Seek from beginning of file. */
# define SEEK_CUR 1 /* Seek from current position. */
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
#endif
+
#ifndef z_off_t
# define z_off_t long
#endif

+#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
+# define z_off64_t off64_t
+#else
+# define z_off64_t z_off_t
+#endif
+
#if defined(__OS400__)
# define NO_vsnprintf
#endif

0 comments on commit dbfef34

Please sign in to comment.