summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbernard.xiong <[email protected]>2010-02-04 15:16:28 +0000
committerbernard.xiong <[email protected]>2010-02-04 15:16:28 +0000
commitce1868c241668485fee27ea0acdb1a4c7bccf8ff (patch)
treea130ec15cd1e3e15d3350bd3b19d774fec5c4d13
parent95fd101d515e1d3819840207a9bdc6c1343bf9b8 (diff)
apply scons header file definition scanner.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@372 bbd45198-f89e-11dd-88c7-29a3b14d5316
-rw-r--r--bsp/mini2440/rtconfig.h2
-rw-r--r--bsp/mini2440/rtconfig.py47
2 files changed, 39 insertions, 10 deletions
diff --git a/bsp/mini2440/rtconfig.h b/bsp/mini2440/rtconfig.h
index 6cf7dc716a..c45d2794bf 100644
--- a/bsp/mini2440/rtconfig.h
+++ b/bsp/mini2440/rtconfig.h
@@ -89,7 +89,7 @@
/* using DFS support */
#define RT_USING_DFS
#define RT_USING_DFS_EFSL
-#define RT_USING_DFS_YAFFS2
+/* #define RT_USING_DFS_YAFFS2 */
/* #define DFS_USING_WORKDIR */
diff --git a/bsp/mini2440/rtconfig.py b/bsp/mini2440/rtconfig.py
index ae3d48f2fe..cb3bb45c96 100644
--- a/bsp/mini2440/rtconfig.py
+++ b/bsp/mini2440/rtconfig.py
@@ -1,20 +1,49 @@
-# component options
+import SCons.cpp
-# finsh shell option
-RT_USING_FINSH = True
+# component options
-# device file system options
-RT_USING_DFS = True
-RT_USING_DFS_EFSL = True
+# make all component false
+RT_USING_FINSH = False
+RT_USING_DFS = False
+RT_USING_DFS_EFSL = False
RT_USING_DFS_ELMFAT = False
RT_USING_DFS_YAFFS2 = False
+RT_USING_LWIP = False
+RT_USING_WEBSERVER = False
+RT_USING_RTGUI = False
+
+# parse rtconfig.h to get used component
+PreProcessor = SCons.cpp.PreProcessor()
+f = file('rtconfig.h', 'r')
+contents = f.read(4096)
+f.close()
+PreProcessor.process_contents(contents)
+rtconfig_ns = PreProcessor.cpp_namespace
+
+# finsh shell options
+if rtconfig_ns.has_key('RT_USING_FINSH'):
+ RT_USING_FINSH = True
+
+# device virtual filesystem options
+if rtconfig_ns.has_key('RT_USING_DFS'):
+ RT_USING_DFS = True
+
+ if rtconfig_ns.has_key('RT_USING_DFS_EFSL'):
+ RT_USING_DFS_EFSL = True
+ if rtconfig_ns.has_key('RT_USING_DFS_ELMFAT'):
+ RT_USING_DFS_ELMFAT = True
+ if rtconfig_ns.has_key('RT_USING_DFS_YAFFS2'):
+ RT_USING_DFS_YAFFS2 = True
# lwip options
-RT_USING_LWIP = True
-RT_USING_WEBSERVER = False
+if rtconfig_ns.has_key('RT_USING_LWIP'):
+ RT_USING_LWIP = True
+ if rtconfig_ns.has_key('RT_USING_WEBSERVER'):
+ RT_USING_WEBSERVER = True
# rtgui options
-RT_USING_RTGUI = True
+if rtconfig_ns.has_key('RT_USING_RTGUI'):
+ RT_USING_RTGUI = True
# panel options
# 'PNL_A70','PNL_N35', 'PNL_T35'