[PATCH] jffs2: Move into separate library
Sebastian Huber
sebastian.huber at embedded-brains.de
Tue May 26 13:30:22 UTC 2015
In case the zlib compression was used, then the librtemscpu.a depended
on libz.a. To avoid a GCC patch or complicated link flags move the
JFFS2 support into a separate library to use a simple "-ljffs2 -lz" to
link the executable.
---
cpukit/libfs/Makefile.am | 2 +-
cpukit/libfs/preinstall.am | 17 +++++++++++++++++
cpukit/wrapup/Makefile.am | 1 -
testsuites/fstests/jffs2_fserror/Makefile.am | 3 ++-
testsuites/fstests/jffs2_fslink/Makefile.am | 3 ++-
testsuites/fstests/jffs2_fspatheval/Makefile.am | 3 ++-
testsuites/fstests/jffs2_fspermission/Makefile.am | 3 ++-
testsuites/fstests/jffs2_fsrdwr/Makefile.am | 3 ++-
testsuites/fstests/jffs2_fsscandir01/Makefile.am | 3 ++-
testsuites/fstests/jffs2_fssymlink/Makefile.am | 3 ++-
testsuites/fstests/jffs2_fstime/Makefile.am | 3 ++-
11 files changed, 34 insertions(+), 10 deletions(-)
diff --git a/cpukit/libfs/Makefile.am b/cpukit/libfs/Makefile.am
index 531e080..678234b 100644
--- a/cpukit/libfs/Makefile.am
+++ b/cpukit/libfs/Makefile.am
@@ -109,7 +109,7 @@ librfs_a_SOURCES = \
src/rfs/rtems-rfs-trace.c
# JFFS2
-noinst_LIBRARIES += libjffs2.a
+project_lib_LIBRARIES = libjffs2.a
libjffs2_a_SOURCES =
libjffs2_a_SOURCES += src/jffs2/src/build.c
libjffs2_a_SOURCES += src/jffs2/src/compat-crc32.c
diff --git a/cpukit/libfs/preinstall.am b/cpukit/libfs/preinstall.am
index dba6cc4..2aca1ef 100644
--- a/cpukit/libfs/preinstall.am
+++ b/cpukit/libfs/preinstall.am
@@ -5,3 +5,20 @@ $(srcdir)/preinstall.am: Makefile.am
$(AMPOLISH3) $(srcdir)/Makefile.am > $(srcdir)/preinstall.am
endif
+PREINSTALL_DIRS =
+DISTCLEANFILES = $(PREINSTALL_DIRS)
+
+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_LIB)/libjffs2.a: libjffs2.a $(PROJECT_LIB)/$(dirstamp)
+ $(INSTALL_DATA) $< $(PROJECT_LIB)/libjffs2.a
+TMPINSTALL_FILES += $(PROJECT_LIB)/libjffs2.a
+
diff --git a/cpukit/wrapup/Makefile.am b/cpukit/wrapup/Makefile.am
index 6fafad5..53861df 100644
--- a/cpukit/wrapup/Makefile.am
+++ b/cpukit/wrapup/Makefile.am
@@ -29,7 +29,6 @@ TMP_LIBS += ../libfs/libdefaultfs.a
TMP_LIBS += ../libfs/libdevfs.a
TMP_LIBS += ../libfs/libimfs.a
TMP_LIBS += ../libfs/librfs.a
-TMP_LIBS += ../libfs/libjffs2.a
TMP_LIBS += ../libmisc/libmonitor.a
TMP_LIBS += ../libmisc/libuntar.a
diff --git a/testsuites/fstests/jffs2_fserror/Makefile.am b/testsuites/fstests/jffs2_fserror/Makefile.am
index 6b99c79..fbf2d77 100644
--- a/testsuites/fstests/jffs2_fserror/Makefile.am
+++ b/testsuites/fstests/jffs2_fserror/Makefile.am
@@ -7,6 +7,7 @@ jffs2_fserror_SOURCES += ../support/fstest.h
jffs2_fserror_SOURCES += ../../psxtests/include/pmacros.h
jffs2_fserror_SOURCES += ../jffs2_support/fs_support.c
jffs2_fserror_SOURCES += ../jffs2_support/fs_config.h
+jffs2_fserror_LDADD = -ljffs2
dist_rtems_tests_DATA = jffs2_fserror.scn
#dist_rtems_tests_DATA += jffs2_fserror.doc
@@ -21,7 +22,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/jffs2_support
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
-LINK_OBJS = $(jffs2_fserror_OBJECTS)
+LINK_OBJS = $(jffs2_fserror_OBJECTS) $(jffs2_fserror_LDADD)
LINK_LIBS = $(jffs2_fserror_LDLIBS)
jffs2_fserror$(EXEEXT): $(jffs2_fserror_OBJECTS) $(jffs2_fserror_DEPENDENCIES)
diff --git a/testsuites/fstests/jffs2_fslink/Makefile.am b/testsuites/fstests/jffs2_fslink/Makefile.am
index af11dd3..9daa2ac 100644
--- a/testsuites/fstests/jffs2_fslink/Makefile.am
+++ b/testsuites/fstests/jffs2_fslink/Makefile.am
@@ -7,6 +7,7 @@ jffs2_fslink_SOURCES += ../support/fstest.h
jffs2_fslink_SOURCES += ../../psxtests/include/pmacros.h
jffs2_fslink_SOURCES += ../jffs2_support/fs_support.c
jffs2_fslink_SOURCES += ../jffs2_support/fs_config.h
+jffs2_fslink_LDADD = -ljffs2
dist_rtems_tests_DATA = jffs2_fslink.scn
#dist_rtems_tests_DATA += jffs2_fslink.doc
@@ -21,7 +22,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/jffs2_support
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
-LINK_OBJS = $(jffs2_fslink_OBJECTS)
+LINK_OBJS = $(jffs2_fslink_OBJECTS) $(jffs2_fslink_LDADD)
LINK_LIBS = $(jffs2_fslink_LDLIBS)
jffs2_fslink$(EXEEXT): $(jffs2_fslink_OBJECTS) $(jffs2_fslink_DEPENDENCIES)
diff --git a/testsuites/fstests/jffs2_fspatheval/Makefile.am b/testsuites/fstests/jffs2_fspatheval/Makefile.am
index 810f208..ae5e0f7 100644
--- a/testsuites/fstests/jffs2_fspatheval/Makefile.am
+++ b/testsuites/fstests/jffs2_fspatheval/Makefile.am
@@ -7,6 +7,7 @@ jffs2_fspatheval_SOURCES += ../support/fstest.h
jffs2_fspatheval_SOURCES += ../../psxtests/include/pmacros.h
jffs2_fspatheval_SOURCES += ../jffs2_support/fs_support.c
jffs2_fspatheval_SOURCES += ../jffs2_support/fs_config.h
+jffs2_fspatheval_LDADD = -ljffs2
dist_rtems_tests_DATA = jffs2_fspatheval.scn
#dist_rtems_tests_DATA += jffs2_fspatheval.doc
@@ -21,7 +22,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/jffs2_support
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
-LINK_OBJS = $(jffs2_fspatheval_OBJECTS)
+LINK_OBJS = $(jffs2_fspatheval_OBJECTS) $(jffs2_fspatheval_LDADD)
LINK_LIBS = $(jffs2_fspatheval_LDLIBS)
jffs2_fspatheval$(EXEEXT): $(jffs2_fspatheval_OBJECTS) $(jffs2_fspatheval_DEPENDENCIES)
diff --git a/testsuites/fstests/jffs2_fspermission/Makefile.am b/testsuites/fstests/jffs2_fspermission/Makefile.am
index c5a6570..3ac1617 100644
--- a/testsuites/fstests/jffs2_fspermission/Makefile.am
+++ b/testsuites/fstests/jffs2_fspermission/Makefile.am
@@ -7,6 +7,7 @@ jffs2_fspermission_SOURCES += ../support/fstest.h
jffs2_fspermission_SOURCES += ../../psxtests/include/pmacros.h
jffs2_fspermission_SOURCES += ../jffs2_support/fs_support.c
jffs2_fspermission_SOURCES += ../jffs2_support/fs_config.h
+jffs2_fspermission_LDADD = -ljffs2
dist_rtems_tests_DATA = jffs2_fspermission.scn
#dist_rtems_tests_DATA += jffs2_fspermission.doc
@@ -21,7 +22,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/jffs2_support
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
-LINK_OBJS = $(jffs2_fspermission_OBJECTS)
+LINK_OBJS = $(jffs2_fspermission_OBJECTS) $(jffs2_fspermission_LDADD)
LINK_LIBS = $(jffs2_fspermission_LDLIBS)
jffs2_fspermission$(EXEEXT): $(jffs2_fspermission_OBJECTS) $(jffs2_fspermission_DEPENDENCIES)
diff --git a/testsuites/fstests/jffs2_fsrdwr/Makefile.am b/testsuites/fstests/jffs2_fsrdwr/Makefile.am
index 2ed04b8..2eca660 100644
--- a/testsuites/fstests/jffs2_fsrdwr/Makefile.am
+++ b/testsuites/fstests/jffs2_fsrdwr/Makefile.am
@@ -7,6 +7,7 @@ jffs2_fsrdwr_SOURCES += ../support/fstest.h
jffs2_fsrdwr_SOURCES += ../../psxtests/include/pmacros.h
jffs2_fsrdwr_SOURCES += ../jffs2_support/fs_support.c
jffs2_fsrdwr_SOURCES += ../jffs2_support/fs_config.h
+jffs2_fsrdwr_LDADD = -ljffs2
dist_rtems_tests_DATA = jffs2_fsrdwr.scn
#dist_rtems_tests_DATA += jffs2_fsrdwr.doc
@@ -21,7 +22,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/jffs2_support
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
-LINK_OBJS = $(jffs2_fsrdwr_OBJECTS)
+LINK_OBJS = $(jffs2_fsrdwr_OBJECTS) $(jffs2_fsrdwr_LDADD)
LINK_LIBS = $(jffs2_fsrdwr_LDLIBS)
jffs2_fsrdwr$(EXEEXT): $(jffs2_fsrdwr_OBJECTS) $(jffs2_fsrdwr_DEPENDENCIES)
diff --git a/testsuites/fstests/jffs2_fsscandir01/Makefile.am b/testsuites/fstests/jffs2_fsscandir01/Makefile.am
index 8fad0b3..9f64e3f 100644
--- a/testsuites/fstests/jffs2_fsscandir01/Makefile.am
+++ b/testsuites/fstests/jffs2_fsscandir01/Makefile.am
@@ -7,6 +7,7 @@ jffs2_fsscandir01_SOURCES += ../support/fstest.h
jffs2_fsscandir01_SOURCES += ../../psxtests/include/pmacros.h
jffs2_fsscandir01_SOURCES += ../jffs2_support/fs_support.c
jffs2_fsscandir01_SOURCES += ../jffs2_support/fs_config.h
+jffs2_fsscandir01_LDADD = -ljffs2
dist_rtems_tests_DATA = jffs2_fsscandir01.scn
#dist_rtems_tests_DATA += jffs2_fsscandir01.doc
@@ -21,7 +22,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/jffs2_support
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
-LINK_OBJS = $(jffs2_fsscandir01_OBJECTS)
+LINK_OBJS = $(jffs2_fsscandir01_OBJECTS) $(jffs2_fsscandir01_LDADD)
LINK_LIBS = $(jffs2_fsscandir01_LDLIBS)
jffs2_fsscandir01$(EXEEXT): $(jffs2_fsscandir01_OBJECTS) $(jffs2_fsscandir01_DEPENDENCIES)
diff --git a/testsuites/fstests/jffs2_fssymlink/Makefile.am b/testsuites/fstests/jffs2_fssymlink/Makefile.am
index 79b3ea8..6dbb639 100644
--- a/testsuites/fstests/jffs2_fssymlink/Makefile.am
+++ b/testsuites/fstests/jffs2_fssymlink/Makefile.am
@@ -7,6 +7,7 @@ jffs2_fssymlink_SOURCES += ../support/fstest.h
jffs2_fssymlink_SOURCES += ../../psxtests/include/pmacros.h
jffs2_fssymlink_SOURCES += ../jffs2_support/fs_support.c
jffs2_fssymlink_SOURCES += ../jffs2_support/fs_config.h
+jffs2_fssymlink_LDADD = -ljffs2
dist_rtems_tests_DATA = jffs2_fssymlink.scn
#dist_rtems_tests_DATA += jffs2_fssymlink.doc
@@ -21,7 +22,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/jffs2_support
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
-LINK_OBJS = $(jffs2_fssymlink_OBJECTS)
+LINK_OBJS = $(jffs2_fssymlink_OBJECTS) $(jffs2_fssymlink_LDADD)
LINK_LIBS = $(jffs2_fssymlink_LDLIBS)
jffs2_fssymlink$(EXEEXT): $(jffs2_fssymlink_OBJECTS) $(jffs2_fssymlink_DEPENDENCIES)
diff --git a/testsuites/fstests/jffs2_fstime/Makefile.am b/testsuites/fstests/jffs2_fstime/Makefile.am
index 5beba81..a65dc23 100644
--- a/testsuites/fstests/jffs2_fstime/Makefile.am
+++ b/testsuites/fstests/jffs2_fstime/Makefile.am
@@ -7,6 +7,7 @@ jffs2_fstime_SOURCES += ../support/fstest.h
jffs2_fstime_SOURCES += ../../psxtests/include/pmacros.h
jffs2_fstime_SOURCES += ../jffs2_support/fs_support.c
jffs2_fstime_SOURCES += ../jffs2_support/fs_config.h
+jffs2_fstime_LDADD = -ljffs2
dist_rtems_tests_DATA = jffs2_fstime.scn
#dist_rtems_tests_DATA += jffs2_fstime.doc
@@ -21,7 +22,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/jffs2_support
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include
-LINK_OBJS = $(jffs2_fstime_OBJECTS)
+LINK_OBJS = $(jffs2_fstime_OBJECTS) $(jffs2_fstime_LDADD)
LINK_LIBS = $(jffs2_fstime_LDLIBS)
jffs2_fstime$(EXEEXT): $(jffs2_fstime_OBJECTS) $(jffs2_fstime_DEPENDENCIES)
--
1.8.4.5
More information about the devel
mailing list