Browse Source

Merge pull request #1062 from BernardXiong/master

[Kconfig] Rename all of KConfig files to 'Kconfig'
Bernard Xiong 7 years ago
parent
commit
fbe9571cca

+ 0 - 3
KConfig

@@ -1,3 +0,0 @@
-source "$RTT_DIR/src/KConfig"
-source "$RTT_DIR/libcpu/Kconfig"
-source "$RTT_DIR/components/KConfig"

+ 3 - 0
Kconfig

@@ -0,0 +1,3 @@
+source "$RTT_DIR/src/Kconfig"
+source "$RTT_DIR/libcpu/Kconfig"
+source "$RTT_DIR/components/Kconfig"

+ 3 - 10
bsp/asm9260t/KConfig → bsp/asm9260t/Kconfig

@@ -15,10 +15,8 @@ config $PKGS_DIR
     option env="PKGS_ROOT"
     default "packages"
 
-source "$RTT_DIR/KConfig"
-source "$PKGS_DIR/KConfig"
-
-menu "BSP_SPECIAL CONFIG"
+source "$RTT_DIR/Kconfig"
+source "$PKGS_DIR/Kconfig"
 
 config RT_USING_UART0
     bool "Using RT_USING_UART0"
@@ -37,9 +35,4 @@ config RT_USING_LED
 	default y
 	help
 		led blink demo
-endmenu
-
-
-
-    
-    
+ 

+ 2 - 2
bsp/imx6ul/KConfig → bsp/imx6ul/Kconfig

@@ -20,7 +20,7 @@ config BOARD_IMX6UL
     select ARCH_ARM_CORTEX_A7
     default y
 
-source "$RTT_DIR/KConfig"
-source "$PKGS_DIR/KConfig"
+source "$RTT_DIR/Kconfig"
+source "$PKGS_DIR/Kconfig"
 
 source "$BSP_DIR/drivers/Kconfig"

+ 3 - 11
bsp/imxrt1052-evk/KConfig → bsp/imxrt1052-evk/Kconfig

@@ -15,10 +15,8 @@ config $PKGS_DIR
     option env="PKGS_ROOT"
     default "packages"
 
-source "$RTT_DIR/KConfig"
-source "$PKGS_DIR/KConfig"
-
-menu "BSP_SPECIAL CONFIG"
+source "$RTT_DIR/Kconfig"
+source "$PKGS_DIR/Kconfig"
 
 config RT_USING_UART
     bool "Using RT_USING_UART"
@@ -29,10 +27,4 @@ config RT_USING_UART1
     bool "Using RT_USING_UART1"
     default y      
 endif
-    
-endmenu
-
-
-
-    
-    
+ 

+ 2 - 7
bsp/lpc54608-LPCXpresso/Kconfig

@@ -18,8 +18,8 @@ config $PKGS_DIR
     option env="PKGS_ROOT"
     default "packages"
 
-source "$RTT_DIR/KConfig"
-source "$PKGS_DIR/KConfig"
+source "$RTT_DIR/Kconfig"
+source "$PKGS_DIR/Kconfig"
 
 config SOC_LPC54608
     bool 
@@ -28,8 +28,3 @@ config SOC_LPC54608
 
 source "$BSP_DIR/drivers/Kconfig"
 
-
-
-
-    
-    

+ 2 - 2
bsp/qemu-vexpress-a9/Kconfig

@@ -15,6 +15,6 @@ config $PKGS_DIR
     option env="PKGS_ROOT"
     default "packages"
 
-source "$RTT_DIR/KConfig"
-source "$PKGS_DIR/KConfig"
+source "$RTT_DIR/Kconfig"
+source "$PKGS_DIR/Kconfig"
 source "$BSP_DIR/drivers/Kconfig"

+ 2 - 7
bsp/stm32f10x-HAL/KConfig → bsp/stm32f10x-HAL/Kconfig

@@ -15,8 +15,8 @@ config $PKGS_DIR
     option env="PKGS_ROOT"
     default "packages"
 
-source "$RTT_DIR/KConfig"
-source "$PKGS_DIR/KConfig"
+source "$RTT_DIR/Kconfig"
+source "$PKGS_DIR/Kconfig"
 
 choice
     prompt "Device type"
@@ -182,8 +182,3 @@ if RT_USING_SPI
         default n
 endif
 
-
-
-
-    
-    

+ 2 - 10
bsp/stm32f411-nucleo/KConfig → bsp/stm32f411-nucleo/Kconfig

@@ -15,18 +15,10 @@ config $PKGS_DIR
     option env="PKGS_ROOT"
     default "packages"
 
-source "$RTT_DIR/KConfig"
-source "$PKGS_DIR/KConfig"
-
-menu "BSP_SPECIAL CONFIG"
+source "$RTT_DIR/Kconfig"
+source "$PKGS_DIR/Kconfig"
 
 config RT_USING_UART2
     bool "Using RT_USING_UART2"
     default y    
-	
-endmenu
-
-
 
-    
-    

+ 2 - 2
bsp/stm32f429-apollo/KConfig → bsp/stm32f429-apollo/Kconfig

@@ -20,7 +20,7 @@ config BOARD_STM32F429_APPOLO
     select ARCH_ARM_CORTEX_M4
     default y
 
-source "$RTT_DIR/KConfig"
-source "$PKGS_DIR/KConfig"
+source "$RTT_DIR/Kconfig"
+source "$PKGS_DIR/Kconfig"
 
 source "$BSP_DIR/drivers/Kconfig"

+ 2 - 8
bsp/stm32f429-disco/Kconfig

@@ -18,14 +18,8 @@ config $PKGS_DIR
     option env="PKGS_ROOT"
     default "packages"
 
-source "$RTT_DIR/KConfig"
-source "$PKGS_DIR/KConfig"
+source "$RTT_DIR/Kconfig"
+source "$PKGS_DIR/Kconfig"
 
 source "$BSP_DIR/drivers/Kconfig"
 
-
-
-
-
-    
-    

+ 3 - 3
bsp/stm32f4xx-HAL/KConfig → bsp/stm32f4xx-HAL/Kconfig

@@ -15,8 +15,8 @@ config $PKGS_DIR
     option env="PKGS_ROOT"
     default "packages"
 
-source "$RTT_DIR/KConfig"
-source "$PKGS_DIR/KConfig"
+source "$RTT_DIR/Kconfig"
+source "$PKGS_DIR/Kconfig"
 
 
 choice
@@ -339,4 +339,4 @@ endif
 
 
     
-    
+    

+ 2 - 2
bsp/stm32l476-nucleo/Kconfig

@@ -18,6 +18,6 @@ config $PKGS_DIR
     option env="PKGS_ROOT"
     default "packages"
 
-source "$RTT_DIR/KConfig"
-source "$PKGS_DIR/KConfig"
+source "$RTT_DIR/Kconfig"
+source "$PKGS_DIR/Kconfig"
 source "$BSP_DIR/drivers/Kconfig"

+ 3 - 11
bsp/tm4c129x/KConfig → bsp/tm4c129x/Kconfig

@@ -15,18 +15,10 @@ config $PKGS_DIR
     option env="PKGS_ROOT"
     default "packages"
 
-source "$RTT_DIR/KConfig"
-source "$PKGS_DIR/KConfig"
-
-menu "BSP_SPECIAL CONFIG"
+source "$RTT_DIR/Kconfig"
+source "$PKGS_DIR/Kconfig"
 
 config RT_USING_UART0
     bool "Using RT_USING_UART0"
     default y    
-	
-endmenu
-
-
-
-    
-    
+ 

+ 2 - 2
bsp/x1000/Kconfig

@@ -18,8 +18,8 @@ config $PKGS_DIR
     option env="PKGS_ROOT"
     default "packages"
 
-source "$RTT_DIR/KConfig"
-source "$PKGS_DIR/KConfig"
+source "$RTT_DIR/Kconfig"
+source "$PKGS_DIR/Kconfig"
 
 config BOARD_X1000_REALBOARD
     bool 

+ 6 - 6
components/KConfig → components/Kconfig

@@ -10,17 +10,17 @@ if RT_USING_COMPONENTS_INIT
         default y
 endif
 
-source "$RTT_DIR/components/cplusplus/KConfig"
+source "$RTT_DIR/components/cplusplus/Kconfig"
 
-source "$RTT_DIR/components/finsh/KConfig"
+source "$RTT_DIR/components/finsh/Kconfig"
 
-source "$RTT_DIR/components/dfs/KConfig"
+source "$RTT_DIR/components/dfs/Kconfig"
 
-source "$RTT_DIR/components/drivers/KConfig"
+source "$RTT_DIR/components/drivers/Kconfig"
 
-source "$RTT_DIR/components/libc/KConfig"
+source "$RTT_DIR/components/libc/Kconfig"
 
-source "$RTT_DIR/components/net/KConfig"
+source "$RTT_DIR/components/net/Kconfig"
 
 source "$RTT_DIR/components/gui/Kconfig"
 

+ 0 - 0
components/cplusplus/KConfig → components/cplusplus/Kconfig


+ 0 - 0
components/dfs/KConfig → components/dfs/Kconfig


+ 0 - 0
components/drivers/KConfig → components/drivers/Kconfig


+ 0 - 0
components/finsh/KConfig → components/finsh/Kconfig


+ 0 - 0
components/libc/KConfig → components/libc/Kconfig


+ 1 - 1
components/net/KConfig → components/net/Kconfig

@@ -180,7 +180,7 @@ config RT_USING_LWIP
 
 endmenu
 
-source "$RTT_DIR/components/net/freemodbus/KConfig"
+source "$RTT_DIR/components/net/freemodbus/Kconfig"
 
 if RT_USING_LWIP
 config RT_USING_NETUTILS

+ 0 - 0
components/net/freemodbus/KConfig → components/net/freemodbus/Kconfig


+ 3 - 2
include/rtdef.h

@@ -30,7 +30,8 @@
  * 2012-12-30     Bernard      add more control command for graphic.
  * 2013-01-09     Bernard      change version number.
  * 2015-02-01     Bernard      change version number to v2.1.0
- * 2016-08-31     Bernard      change version number to v3.0.0
+ * 2017-08-31     Bernard      change version number to v3.0.0
+ * 2017-11-30     Bernard      change version number to v3.0.1
  */
 
 #ifndef __RT_DEF_H__
@@ -52,7 +53,7 @@ extern "C" {
 /* RT-Thread version information */
 #define RT_VERSION                      3L              /**< major version number */
 #define RT_SUBVERSION                   0L              /**< minor version number */
-#define RT_REVISION                     0L              /**< revise version number */
+#define RT_REVISION                     1L              /**< revise version number */
 
 /* RT-Thread version */
 #define RTTHREAD_VERSION                ((RT_VERSION * 10000) + \

+ 0 - 0
src/KConfig → src/Kconfig


+ 11 - 0
tools/building.py

@@ -274,6 +274,17 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
         genconfig()
         exit(0)
 
+    if env['PLATFORM'] != 'win32':
+        AddOption('--menuconfig', 
+                    dest = 'menuconfig',
+                    action = 'store_true',
+                    default = False,
+                    help = 'make menuconfig for RT-Thread BSP')
+        if GetOption('menuconfig'):
+            from menuconfig import menuconfig
+            menuconfig(Rtt_Root)
+            exit(0)
+
     # add comstr option
     AddOption('--verbose',
                 dest='verbose',

+ 66 - 2
tools/menuconfig.py

@@ -29,23 +29,87 @@ def mk_rtconfig(filename):
                 empty_line = 1
                 continue
 
-            rtconfig.write('/*%s */\n' % line[1:])
+            comment_line = line[1:]
+            if line.startswith('# CONFIG_'): line = ' ' + line[9:]
+            else: line = line[1:]
+
+            rtconfig.write('/*%s */\n' % line)
             empty_line = 0
         else:
             empty_line = 0
-            setting = line.split('=', 1)
+            setting = line.split('=')
             if len(setting) >= 2:
                 if setting[0].startswith('CONFIG_'):
                     setting[0] = setting[0][7:]
 
+                # remove CONFIG_PKG_XX_PATH or CONFIG_PKG_XX_VER
+                if type(setting[0]) == type('a') and (setting[0].endswith('_PATH') or setting[0].endswith('_VER')):
+                    continue
+
                 if setting[1] == 'y':
                     rtconfig.write('#define %s\n' % setting[0])
                 else:
                     rtconfig.write('#define %s %s\n' % (setting[0], setting[1]))
 
+    if os.path.isfile('rtconfig_project.h'):
+        rtconfig.write('#include "rtconfig_project.h"\n')
+
+    rtconfig.write('\n')
     rtconfig.write('#endif\n')
     rtconfig.close()
 
 def config():
     mk_rtconfig('.config')
 
+def get_env_dir():
+    if os.environ.get('ENV_ROOT'):
+        return os.environ.get('ENV_ROOT')
+
+    home_dir = os.environ['HOME']
+    env_dir  = os.path.join(home_dir, '.env')
+
+    if not os.path.exists(env_dir):
+        return None
+
+    return env_dir
+
+def touch_env():
+    home_dir = os.environ['HOME']
+    env_dir  = os.path.join(home_dir, '.env')
+    if not os.path.exists(env_dir):
+        os.mkdir(env_dir)
+        os.mkdir(os.path.join(env_dir, 'local_pkgs'))
+        os.mkdir(os.path.join(env_dir, 'packages'))
+        kconfig = file(os.path.join(env_dir, 'packages', 'Kconfig'), 'w')
+
+# menuconfig for Linux
+def menuconfig(RTT_ROOT):
+    kconfig_dir = os.path.join(RTT_ROOT, 'tools', 'kconfig-frontends')
+    os.system('scons -C ' + kconfig_dir)
+
+    env_dir = get_env_dir()
+    if not env_dir:
+        touch_env()
+        env_dir = get_env_dir()
+
+    os.environ['PKGS_ROOT'] = os.path.join(env_dir, 'packages')
+
+    fn = '.config'
+
+    if os.path.isfile(fn):
+        mtime = os.path.getmtime(fn)
+    else:
+        mtime = -1
+
+    kconfig_cmd = os.path.join(RTT_ROOT, 'tools', 'kconfig-frontends', 'kconfig-mconf')
+    os.system(kconfig_cmd + ' Kconfig')
+
+    if os.path.isfile(fn):
+        mtime2 = os.path.getmtime(fn)
+    else:
+        mtime2 = -1
+
+    # make rtconfig.h
+    if mtime != mtime2:
+        mk_rtconfig(fn)
+

+ 4 - 4
tools/mkdist.py

@@ -121,7 +121,7 @@ def MakeCopy(program, BSP_ROOT, RTT_ROOT, Env):
     # copy tools directory
     print("=> tools")
     do_copy_folder(os.path.join(RTT_ROOT, "tools"), os.path.join(target_path, "tools"), ignore_patterns('*.pyc'))
-    do_copy_file(os.path.join(RTT_ROOT, 'KConfig'), os.path.join(target_path, 'KConfig'))
+    do_copy_file(os.path.join(RTT_ROOT, 'Kconfig'), os.path.join(target_path, 'Kconfig'))
     do_copy_file(os.path.join(RTT_ROOT, 'AUTHORS'), os.path.join(target_path, 'AUTHORS'))
     do_copy_file(os.path.join(RTT_ROOT, 'COPYING'), os.path.join(target_path, 'COPYING'))
     do_copy_file(os.path.join(RTT_ROOT, 'README.md'), os.path.join(target_path, 'README.md'))
@@ -170,7 +170,7 @@ def MakeCopyHeader(program, BSP_ROOT, RTT_ROOT, Env):
     # copy tools directory
     print "=>  tools"
     do_copy_folder(os.path.join(RTT_ROOT, "tools"), os.path.join(target_path, "tools"), ignore_patterns('*.pyc'))
-    do_copy_file(os.path.join(RTT_ROOT, 'KConfig'), os.path.join(target_path, 'KConfig'))
+    do_copy_file(os.path.join(RTT_ROOT, 'Kconfig'), os.path.join(target_path, 'Kconfig'))
     do_copy_file(os.path.join(RTT_ROOT, 'AUTHORS'), os.path.join(target_path, 'AUTHORS'))
     do_copy_file(os.path.join(RTT_ROOT, 'COPYING'), os.path.join(target_path, 'COPYING'))
     do_copy_file(os.path.join(RTT_ROOT, 'README.md'), os.path.join(target_path, 'README.md'))
@@ -242,7 +242,7 @@ def MkDist(program, BSP_ROOT, RTT_ROOT, Env):
     # copy tools directory
     print("=> tools")
     do_copy_folder(os.path.join(RTT_ROOT, "tools"), os.path.join(target_path, "tools"), ignore_patterns('*.pyc'))
-    do_copy_file(os.path.join(RTT_ROOT, 'KConfig'), os.path.join(target_path, 'KConfig'))
+    do_copy_file(os.path.join(RTT_ROOT, 'Kconfig'), os.path.join(target_path, 'Kconfig'))
     do_copy_file(os.path.join(RTT_ROOT, 'AUTHORS'), os.path.join(target_path, 'AUTHORS'))
     do_copy_file(os.path.join(RTT_ROOT, 'COPYING'), os.path.join(target_path, 'COPYING'))
     do_copy_file(os.path.join(RTT_ROOT, 'README.md'), os.path.join(target_path, 'README.md'))
@@ -265,7 +265,7 @@ def MkDist(program, BSP_ROOT, RTT_ROOT, Env):
     except :
         print('')
 
-    # change RTT_ROOT in KConfig
+    # change RTT_ROOT in Kconfig
     try:
         if os.path.exists(os.path.join(BSP_ROOT, 'Kconfig')):
             Kconfig = file(os.path.join(BSP_ROOT, 'Kconfig'))

+ 0 - 0
tools/wizard.py