Browse Source

apply scons header file definition scanner.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@372 bbd45198-f89e-11dd-88c7-29a3b14d5316
bernard.xiong 15 years ago
parent
commit
ce1868c241
2 changed files with 39 additions and 10 deletions
  1. 1 1
      bsp/mini2440/rtconfig.h
  2. 38 9
      bsp/mini2440/rtconfig.py

+ 1 - 1
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 */
 

+ 38 - 9
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'