[PATCH 1/2] jffs2: Do not use command line defines

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Mar 27 11:01:56 UTC 2018


Update #3375.
---
 cpukit/libfs/Makefile.am                  | 2 --
 cpukit/libfs/src/jffs2/src/build.c        | 2 ++
 cpukit/libfs/src/jffs2/src/compat-crc32.c | 2 ++
 cpukit/libfs/src/jffs2/src/compr.c        | 2 ++
 cpukit/libfs/src/jffs2/src/compr_rtime.c  | 2 ++
 cpukit/libfs/src/jffs2/src/compr_rubin.c  | 2 ++
 cpukit/libfs/src/jffs2/src/compr_zlib.c   | 2 ++
 cpukit/libfs/src/jffs2/src/debug.c        | 2 ++
 cpukit/libfs/src/jffs2/src/dir-rtems.c    | 2 ++
 cpukit/libfs/src/jffs2/src/erase.c        | 2 ++
 cpukit/libfs/src/jffs2/src/flashio.c      | 2 ++
 cpukit/libfs/src/jffs2/src/fs-rtems.c     | 2 ++
 cpukit/libfs/src/jffs2/src/gc.c           | 2 ++
 cpukit/libfs/src/jffs2/src/jffs2-config.h | 2 ++
 cpukit/libfs/src/jffs2/src/malloc-rtems.c | 2 ++
 cpukit/libfs/src/jffs2/src/nodelist.c     | 2 ++
 cpukit/libfs/src/jffs2/src/nodemgmt.c     | 2 ++
 cpukit/libfs/src/jffs2/src/read.c         | 2 ++
 cpukit/libfs/src/jffs2/src/readinode.c    | 2 ++
 cpukit/libfs/src/jffs2/src/scan.c         | 2 ++
 cpukit/libfs/src/jffs2/src/write.c        | 2 ++
 21 files changed, 40 insertions(+), 2 deletions(-)
 create mode 100644 cpukit/libfs/src/jffs2/src/jffs2-config.h

diff --git a/cpukit/libfs/Makefile.am b/cpukit/libfs/Makefile.am
index a76fa8ae2d..25da8a219e 100644
--- a/cpukit/libfs/Makefile.am
+++ b/cpukit/libfs/Makefile.am
@@ -140,8 +140,6 @@ libjffs2_a_CFLAGS =
 libjffs2_a_CFLAGS += -Wno-pointer-sign
 libjffs2_a_CPPFLAGS =
 libjffs2_a_CPPFLAGS += $(AM_CPPFLAGS) -I$(srcdir)/src/jffs2/include
-libjffs2_a_CPPFLAGS += -D__ECOS
-libjffs2_a_CPPFLAGS += '-DKBUILD_MODNAME="JFFS2"'
 
 # ---
 include $(top_srcdir)/automake/subdirs.am
diff --git a/cpukit/libfs/src/jffs2/src/build.c b/cpukit/libfs/src/jffs2/src/build.c
index a3750f902a..f4f94e60c9 100644
--- a/cpukit/libfs/src/jffs2/src/build.c
+++ b/cpukit/libfs/src/jffs2/src/build.c
@@ -1,3 +1,5 @@
+#include "jffs2-config.h"
+
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
diff --git a/cpukit/libfs/src/jffs2/src/compat-crc32.c b/cpukit/libfs/src/jffs2/src/compat-crc32.c
index 7e4ea269f2..ebcb4ef86d 100644
--- a/cpukit/libfs/src/jffs2/src/compat-crc32.c
+++ b/cpukit/libfs/src/jffs2/src/compat-crc32.c
@@ -1,3 +1,5 @@
+#include "jffs2-config.h"
+
 //==========================================================================
 //
 //      crc32.c
diff --git a/cpukit/libfs/src/jffs2/src/compr.c b/cpukit/libfs/src/jffs2/src/compr.c
index 985964997e..0509a04abe 100644
--- a/cpukit/libfs/src/jffs2/src/compr.c
+++ b/cpukit/libfs/src/jffs2/src/compr.c
@@ -1,3 +1,5 @@
+#include "jffs2-config.h"
+
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
diff --git a/cpukit/libfs/src/jffs2/src/compr_rtime.c b/cpukit/libfs/src/jffs2/src/compr_rtime.c
index 3386d1e1da..3e6bca3caf 100644
--- a/cpukit/libfs/src/jffs2/src/compr_rtime.c
+++ b/cpukit/libfs/src/jffs2/src/compr_rtime.c
@@ -1,3 +1,5 @@
+#include "jffs2-config.h"
+
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
diff --git a/cpukit/libfs/src/jffs2/src/compr_rubin.c b/cpukit/libfs/src/jffs2/src/compr_rubin.c
index 92e0644bf8..24da0a9d1b 100644
--- a/cpukit/libfs/src/jffs2/src/compr_rubin.c
+++ b/cpukit/libfs/src/jffs2/src/compr_rubin.c
@@ -1,3 +1,5 @@
+#include "jffs2-config.h"
+
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
diff --git a/cpukit/libfs/src/jffs2/src/compr_zlib.c b/cpukit/libfs/src/jffs2/src/compr_zlib.c
index 8bfbacfbb7..453d363bf5 100644
--- a/cpukit/libfs/src/jffs2/src/compr_zlib.c
+++ b/cpukit/libfs/src/jffs2/src/compr_zlib.c
@@ -1,3 +1,5 @@
+#include "jffs2-config.h"
+
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
diff --git a/cpukit/libfs/src/jffs2/src/debug.c b/cpukit/libfs/src/jffs2/src/debug.c
index 1090eb64b9..226644f136 100644
--- a/cpukit/libfs/src/jffs2/src/debug.c
+++ b/cpukit/libfs/src/jffs2/src/debug.c
@@ -1,3 +1,5 @@
+#include "jffs2-config.h"
+
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
diff --git a/cpukit/libfs/src/jffs2/src/dir-rtems.c b/cpukit/libfs/src/jffs2/src/dir-rtems.c
index 7bbbabc309..87863a7bce 100644
--- a/cpukit/libfs/src/jffs2/src/dir-rtems.c
+++ b/cpukit/libfs/src/jffs2/src/dir-rtems.c
@@ -1,3 +1,5 @@
+#include "jffs2-config.h"
+
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
diff --git a/cpukit/libfs/src/jffs2/src/erase.c b/cpukit/libfs/src/jffs2/src/erase.c
index d0d8a6972f..42fbedf971 100644
--- a/cpukit/libfs/src/jffs2/src/erase.c
+++ b/cpukit/libfs/src/jffs2/src/erase.c
@@ -1,3 +1,5 @@
+#include "jffs2-config.h"
+
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
diff --git a/cpukit/libfs/src/jffs2/src/flashio.c b/cpukit/libfs/src/jffs2/src/flashio.c
index af93168cea..11593f6dbd 100644
--- a/cpukit/libfs/src/jffs2/src/flashio.c
+++ b/cpukit/libfs/src/jffs2/src/flashio.c
@@ -1,3 +1,5 @@
+#include "jffs2-config.h"
+
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
diff --git a/cpukit/libfs/src/jffs2/src/fs-rtems.c b/cpukit/libfs/src/jffs2/src/fs-rtems.c
index 652a8e7dbe..08b9144c1c 100644
--- a/cpukit/libfs/src/jffs2/src/fs-rtems.c
+++ b/cpukit/libfs/src/jffs2/src/fs-rtems.c
@@ -1,3 +1,5 @@
+#include "jffs2-config.h"
+
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
diff --git a/cpukit/libfs/src/jffs2/src/gc.c b/cpukit/libfs/src/jffs2/src/gc.c
index 2f42ee2d70..e31d51c527 100644
--- a/cpukit/libfs/src/jffs2/src/gc.c
+++ b/cpukit/libfs/src/jffs2/src/gc.c
@@ -1,3 +1,5 @@
+#include "jffs2-config.h"
+
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
diff --git a/cpukit/libfs/src/jffs2/src/jffs2-config.h b/cpukit/libfs/src/jffs2/src/jffs2-config.h
new file mode 100644
index 0000000000..11d3646ae9
--- /dev/null
+++ b/cpukit/libfs/src/jffs2/src/jffs2-config.h
@@ -0,0 +1,2 @@
+#define __ECOS 1
+#define KBUILD_MODNAME "JFFS2"
diff --git a/cpukit/libfs/src/jffs2/src/malloc-rtems.c b/cpukit/libfs/src/jffs2/src/malloc-rtems.c
index 100b619e07..57442c6466 100644
--- a/cpukit/libfs/src/jffs2/src/malloc-rtems.c
+++ b/cpukit/libfs/src/jffs2/src/malloc-rtems.c
@@ -1,3 +1,5 @@
+#include "jffs2-config.h"
+
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
diff --git a/cpukit/libfs/src/jffs2/src/nodelist.c b/cpukit/libfs/src/jffs2/src/nodelist.c
index 975a1f562c..80a11b6e72 100644
--- a/cpukit/libfs/src/jffs2/src/nodelist.c
+++ b/cpukit/libfs/src/jffs2/src/nodelist.c
@@ -1,3 +1,5 @@
+#include "jffs2-config.h"
+
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
diff --git a/cpukit/libfs/src/jffs2/src/nodemgmt.c b/cpukit/libfs/src/jffs2/src/nodemgmt.c
index 0331072171..c8b91662d1 100644
--- a/cpukit/libfs/src/jffs2/src/nodemgmt.c
+++ b/cpukit/libfs/src/jffs2/src/nodemgmt.c
@@ -1,3 +1,5 @@
+#include "jffs2-config.h"
+
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
diff --git a/cpukit/libfs/src/jffs2/src/read.c b/cpukit/libfs/src/jffs2/src/read.c
index 0b042b1fc8..1fc5975f28 100644
--- a/cpukit/libfs/src/jffs2/src/read.c
+++ b/cpukit/libfs/src/jffs2/src/read.c
@@ -1,3 +1,5 @@
+#include "jffs2-config.h"
+
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
diff --git a/cpukit/libfs/src/jffs2/src/readinode.c b/cpukit/libfs/src/jffs2/src/readinode.c
index 7c0f1bf631..b26c53b2df 100644
--- a/cpukit/libfs/src/jffs2/src/readinode.c
+++ b/cpukit/libfs/src/jffs2/src/readinode.c
@@ -1,3 +1,5 @@
+#include "jffs2-config.h"
+
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
diff --git a/cpukit/libfs/src/jffs2/src/scan.c b/cpukit/libfs/src/jffs2/src/scan.c
index 4d45ca2ea4..f86b515384 100644
--- a/cpukit/libfs/src/jffs2/src/scan.c
+++ b/cpukit/libfs/src/jffs2/src/scan.c
@@ -1,3 +1,5 @@
+#include "jffs2-config.h"
+
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
diff --git a/cpukit/libfs/src/jffs2/src/write.c b/cpukit/libfs/src/jffs2/src/write.c
index b634de4c81..a71d516bfb 100644
--- a/cpukit/libfs/src/jffs2/src/write.c
+++ b/cpukit/libfs/src/jffs2/src/write.c
@@ -1,3 +1,5 @@
+#include "jffs2-config.h"
+
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
-- 
2.12.3



More information about the devel mailing list