[PATCH] cpukit: Move zlib into librtemcpu.a and do not install libz.a.

Chris Johns chrisj at rtems.org
Wed Sep 17 00:26:50 UTC 2014


The JFFS2 file system can optionally use zlib as a compressor and
if this is the only reference to zlib the application will not link.

Adding -lz does not work because librtemscpu.a is added to the end of
ld's command line via the bsp_specs hack and user added libraries
appear before this.
---
 cpukit/wrapup/Makefile.am |  2 ++
 cpukit/zlib/Makefile.am   |  2 +-
 cpukit/zlib/preinstall.am | 14 --------------
 3 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/cpukit/wrapup/Makefile.am b/cpukit/wrapup/Makefile.am
index e89426f..b8c0ee2 100644
--- a/cpukit/wrapup/Makefile.am
+++ b/cpukit/wrapup/Makefile.am
@@ -77,6 +77,8 @@ if NEWLIB
 TMP_LIBS += ../libmd/libmd.a
 endif
 
+TMP_LIBS += ../zlib/libz.a
+
 librtemscpu.a: $(TMP_LIBS)
 	rm -f $@
 	$(MKDIR_P) $(ARCH)
diff --git a/cpukit/zlib/Makefile.am b/cpukit/zlib/Makefile.am
index 478134b..54be345 100644
--- a/cpukit/zlib/Makefile.am
+++ b/cpukit/zlib/Makefile.am
@@ -1,6 +1,6 @@
 include $(top_srcdir)/automake/compile.am
 
-project_lib_LIBRARIES = libz.a
+noinst_LIBRARIES = libz.a
 
 libz_a_SOURCES = adler32.c
 libz_a_SOURCES += compress.c
diff --git a/cpukit/zlib/preinstall.am b/cpukit/zlib/preinstall.am
index 7eb8f7b..a17f25c 100644
--- a/cpukit/zlib/preinstall.am
+++ b/cpukit/zlib/preinstall.am
@@ -13,25 +13,11 @@ all-am: $(PREINSTALL_FILES)
 PREINSTALL_FILES =
 CLEANFILES += $(PREINSTALL_FILES)
 
-all-local: $(TMPINSTALL_FILES)
-
-TMPINSTALL_FILES =
-CLEANFILES += $(TMPINSTALL_FILES)
-
-$(PROJECT_LIB)/$(dirstamp):
-	@$(MKDIR_P) $(PROJECT_LIB)
-	@: > $(PROJECT_LIB)/$(dirstamp)
-PREINSTALL_DIRS += $(PROJECT_LIB)/$(dirstamp)
-
 $(PROJECT_INCLUDE)/$(dirstamp):
 	@$(MKDIR_P) $(PROJECT_INCLUDE)
 	@: > $(PROJECT_INCLUDE)/$(dirstamp)
 PREINSTALL_DIRS += $(PROJECT_INCLUDE)/$(dirstamp)
 
-$(PROJECT_LIB)/libz.a: libz.a $(PROJECT_LIB)/$(dirstamp)
-	$(INSTALL_DATA) $< $(PROJECT_LIB)/libz.a
-TMPINSTALL_FILES += $(PROJECT_LIB)/libz.a
-
 $(PROJECT_INCLUDE)/zlib.h: zlib.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/zlib.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/zlib.h
-- 
1.8.5.2 (Apple Git-48)



More information about the devel mailing list