mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
Add tools/kconfig.bat
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5450 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -3811,3 +3811,5 @@
|
|||||||
tool.
|
tool.
|
||||||
* include/pthread.h: In sys/prctl.h because it is needed by
|
* include/pthread.h: In sys/prctl.h because it is needed by
|
||||||
pthread_[set|get]name_np()
|
pthread_[set|get]name_np()
|
||||||
|
* tools/kconfig.bat: Kludge to run kconfig-frontends from a DOS shell.
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ mainmenu "Nuttx/$ARCH Configuration"
|
|||||||
|
|
||||||
config APPSDIR
|
config APPSDIR
|
||||||
string
|
string
|
||||||
option env="APPSDIR"
|
default "../apps"
|
||||||
|
|
||||||
# This is a temporary kludge to let the build system know that we are using the new
|
# This is a temporary kludge to let the build system know that we are using the new
|
||||||
# configuration system
|
# configuration system
|
||||||
|
|||||||
+10
-7
@@ -252,7 +252,7 @@ LINKLIBS = $(patsubst lib\\%,%,$(NUTTXLIBS))
|
|||||||
BIN = nuttx$(EXEEXT)
|
BIN = nuttx$(EXEEXT)
|
||||||
|
|
||||||
all: $(BIN)
|
all: $(BIN)
|
||||||
.PHONY: context clean_context check_context export subdir_clean clean subdir_distclean distclean apps_clean apps_distclean
|
.PHONY: context clean_context check_context configenv config oldconfig menuconfig export subdir_clean clean subdir_distclean distclean apps_clean apps_distclean
|
||||||
|
|
||||||
# Target used to copy include\nuttx\math.h. If CONFIG_ARCH_MATH_H is
|
# Target used to copy include\nuttx\math.h. If CONFIG_ARCH_MATH_H is
|
||||||
# defined, then there is an architecture specific math.h header file
|
# defined, then there is an architecture specific math.h header file
|
||||||
@@ -647,14 +647,17 @@ pass2dep: context tools\mkdeps$(HOSTEXEEXT)
|
|||||||
# location: http://ymorin.is-a-geek.org/projects/kconfig-frontends. See
|
# location: http://ymorin.is-a-geek.org/projects/kconfig-frontends. See
|
||||||
# misc\tools\README.txt for additional information.
|
# misc\tools\README.txt for additional information.
|
||||||
|
|
||||||
config:
|
configenv:
|
||||||
$(Q) APPSDIR=${CONFIG_APPS_DIR} conf Kconfig
|
$(Q) set APPSDIR=${CONFIG_APPS_DIR}
|
||||||
|
|
||||||
oldconfig:
|
config: configenv
|
||||||
$(Q) APPSDIR=${CONFIG_APPS_DIR} conf --oldconfig Kconfig
|
$(Q) conf Kconfig
|
||||||
|
|
||||||
menuconfig:
|
oldconfig: configenv
|
||||||
$(Q) APPSDIR=${CONFIG_APPS_DIR} mconf Kconfig
|
$(Q) conf --oldconfig Kconfig
|
||||||
|
|
||||||
|
menuconfig: configenv
|
||||||
|
$(Q) mconf Kconfig
|
||||||
|
|
||||||
# export
|
# export
|
||||||
#
|
#
|
||||||
|
|||||||
+47
-1
@@ -10,6 +10,7 @@ README
|
|||||||
o Configuring NuttX
|
o Configuring NuttX
|
||||||
- Instantiating "Canned" Configurations
|
- Instantiating "Canned" Configurations
|
||||||
- NuttX Configuration Tool
|
- NuttX Configuration Tool
|
||||||
|
- NuttX Configuration Tool from DOS
|
||||||
o Toolchains
|
o Toolchains
|
||||||
- Cross-Development Toolchains
|
- Cross-Development Toolchains
|
||||||
- NuttX Buildroot Toolchain
|
- NuttX Buildroot Toolchain
|
||||||
@@ -249,7 +250,6 @@ easier. It is used as follows:
|
|||||||
cd ${TOPDIR}/tools
|
cd ${TOPDIR}/tools
|
||||||
./configure.sh <board-name>/<config-dir>
|
./configure.sh <board-name>/<config-dir>
|
||||||
|
|
||||||
|
|
||||||
NuttX Configuration Tool
|
NuttX Configuration Tool
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
@@ -292,6 +292,52 @@ NuttX Configuration Tool
|
|||||||
install 'mconf', make certain that your PATH variable includes
|
install 'mconf', make certain that your PATH variable includes
|
||||||
a path to that installation directory.
|
a path to that installation directory.
|
||||||
|
|
||||||
|
NuttX Configuration Tool from DOS
|
||||||
|
---------------------------------
|
||||||
|
|
||||||
|
Recent versions of NuttX support building NuttX from a native Windows
|
||||||
|
CMD.exe shell (see "Native Windows Build" below). But kconfig-frontends
|
||||||
|
is a Linux tool. There have been some successes building a Windows
|
||||||
|
native version of the kconfig-frontends tool, but that is not ready
|
||||||
|
for prime time.
|
||||||
|
|
||||||
|
At this point, there are only a few options for the Windows user:
|
||||||
|
|
||||||
|
1. You can run the configuration tool using Cygwin. However, the
|
||||||
|
Cygwin Makefile.win will complain so to do this will, you have
|
||||||
|
to manually edit the .config file:
|
||||||
|
|
||||||
|
a. Delete the line: CONFIG_WINDOWS_NATIVE=y
|
||||||
|
b. Change the apps/ directory path, CONFIG_APPS_DIR to use Unix
|
||||||
|
style delimiters. For example, change "..\apps" to "../apps"
|
||||||
|
|
||||||
|
And of course, after you use the configuration tool you need to
|
||||||
|
restore CONFIG_WINDOWS_NATIVE=y and the correct CONFIG_APPS_DIR.
|
||||||
|
|
||||||
|
2) You can, with some effort, run the the Cygwin mconf tool directly
|
||||||
|
in the CMD.exe shell. In this case, you do not have to modify the
|
||||||
|
.config file, but there are other complexities:
|
||||||
|
|
||||||
|
a. You need to temporarily set the Cgywin directories in the PATH
|
||||||
|
variable then run mconf manually like:
|
||||||
|
|
||||||
|
mconf Kconfig
|
||||||
|
|
||||||
|
There is a Windows bacht file at tools/kconfig.bat that automates
|
||||||
|
these steps:
|
||||||
|
|
||||||
|
tools/kconfig menuconfig
|
||||||
|
|
||||||
|
b. There is an issue with accessing DOS environment variables from
|
||||||
|
the Cygwin mconf running in the CMD.exe shell. The following
|
||||||
|
change to the top-level Kconfig file seems to work around these
|
||||||
|
problems:
|
||||||
|
|
||||||
|
config APPSDIR
|
||||||
|
string
|
||||||
|
- option env="APPSDIR"
|
||||||
|
+ default "../apps"
|
||||||
|
|
||||||
TOOLCHAINS
|
TOOLCHAINS
|
||||||
^^^^^^^^^^
|
^^^^^^^^^^
|
||||||
|
|
||||||
|
|||||||
@@ -413,6 +413,36 @@ unlink.bat
|
|||||||
NTFS mklink.exe command instead of copying files. That logic, however,
|
NTFS mklink.exe command instead of copying files. That logic, however,
|
||||||
has not been verified as of this writing.
|
has not been verified as of this writing.
|
||||||
|
|
||||||
|
kconfig.bat
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Recent versions of NuttX support building NuttX from a native Windows
|
||||||
|
CMD.exe shell. But kconfig-frontends is a Linux tool and is not yet
|
||||||
|
available in the pure CMD.exe environment. At this point, there are
|
||||||
|
only a few options for the Windows user (see the top-level README.txt
|
||||||
|
file).
|
||||||
|
|
||||||
|
You can, with some effort, run the the Cygwin mconf tool directly
|
||||||
|
in the CMD.exe shell. In this case, you do not have to modify the
|
||||||
|
.config file, but there are other complexities: You need to
|
||||||
|
temporarily set the Cgywin directories in the PATH variable and
|
||||||
|
then run mconf outside of the Make system.
|
||||||
|
|
||||||
|
kconfig.bat is a Windows batch file at tools/kconfig.bat that automates
|
||||||
|
these steps. It is used from the top-level NuttX directory like:
|
||||||
|
|
||||||
|
tools/kconfig menuconfig
|
||||||
|
|
||||||
|
NOTE: There is an currently an issue with accessing DOS environment
|
||||||
|
variables from the Cygwin mconf running in the CMD.exe shell. The
|
||||||
|
following change to the top-level Kconfig file seems to work around
|
||||||
|
these problems:
|
||||||
|
|
||||||
|
config APPSDIR
|
||||||
|
string
|
||||||
|
- option env="APPSDIR"
|
||||||
|
+ default "../apps"
|
||||||
|
|
||||||
mkimage.sh
|
mkimage.sh
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|||||||
Executable
+131
@@ -0,0 +1,131 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
rem tools/kconfig.bat
|
||||||
|
rem
|
||||||
|
rem Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||||
|
rem Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
rem
|
||||||
|
rem Redistribution and use in source and binary forms, with or without
|
||||||
|
rem modification, are permitted provided that the following conditions
|
||||||
|
rem are met:
|
||||||
|
rem
|
||||||
|
rem 1. Redistributions of source code must retain the above copyright
|
||||||
|
rem notice, this list of conditions and the following disclaimer.
|
||||||
|
rem 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
rem notice, this list of conditions and the following disclaimer in
|
||||||
|
rem the documentation and/or other materials provided with the
|
||||||
|
rem distribution.
|
||||||
|
rem 3. Neither the name NuttX nor the names of its contributors may be
|
||||||
|
rem used to endorse or promote products derived from this software
|
||||||
|
rem without specific prior written permission.
|
||||||
|
rem
|
||||||
|
rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
|
rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
rem POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
rem
|
||||||
|
|
||||||
|
rem Remember the state of the PATH variable on entry
|
||||||
|
|
||||||
|
set oldpath=%PATH%
|
||||||
|
|
||||||
|
rem Handle command line options
|
||||||
|
|
||||||
|
set action=%1
|
||||||
|
shift
|
||||||
|
if "%action%"=="" goto :MissingArgument
|
||||||
|
|
||||||
|
set appsdir=..\apps
|
||||||
|
set cygwindir=C:\Cygwin
|
||||||
|
|
||||||
|
:ArgLoop
|
||||||
|
|
||||||
|
if "%1"=="" goto :CheckArguments
|
||||||
|
|
||||||
|
if "%1"=="-a" (
|
||||||
|
shift
|
||||||
|
set appsdir=%1
|
||||||
|
goto :NextArg
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1"=="-c" (
|
||||||
|
shift
|
||||||
|
set cygwindir=%1
|
||||||
|
goto :NextArg
|
||||||
|
)
|
||||||
|
|
||||||
|
echo ERROR: Unrecognized option: %1
|
||||||
|
goto :ShowUsage
|
||||||
|
|
||||||
|
:NextArg
|
||||||
|
shift
|
||||||
|
goto :ArgLoop
|
||||||
|
|
||||||
|
rem Verify that all of the paths are valid
|
||||||
|
|
||||||
|
:CheckArguments
|
||||||
|
if exist "%appsdir%" goto :CheckCygwinDir
|
||||||
|
|
||||||
|
echo ERROR: %appsdir% does not exist
|
||||||
|
goto :ShowUsage
|
||||||
|
|
||||||
|
:CheckCygwinDir
|
||||||
|
|
||||||
|
if exist "%cygwindir%" goto :SetPath
|
||||||
|
|
||||||
|
echo ERROR: %cygwindir% does not exist
|
||||||
|
goto :ShowUsage
|
||||||
|
|
||||||
|
rem Setup some required environment variables and PATH settings
|
||||||
|
|
||||||
|
:SetPath
|
||||||
|
set PATH=%cygwindir%\usr\local\bin;%cygwindir%\usr\bin;%cygwindir%\bin;%PATH%
|
||||||
|
set APPSDIR=%appsdir%
|
||||||
|
|
||||||
|
rem Execute the requested action
|
||||||
|
|
||||||
|
if "%action%"=="config" goto :DoConfig
|
||||||
|
if "%action%"=="oldconfig" goto :DoOldConfig
|
||||||
|
if "%action%"=="menuconfig" goto :DoMenuConfig
|
||||||
|
|
||||||
|
echo ERROR: Unrecognized action: %action%
|
||||||
|
goto :ShowUsage
|
||||||
|
|
||||||
|
:DoConfig
|
||||||
|
conf Kconfig
|
||||||
|
goto End
|
||||||
|
|
||||||
|
:DoOldConfig
|
||||||
|
conf --oldconfig Kconfig
|
||||||
|
goto End
|
||||||
|
|
||||||
|
:DoMenuConfig
|
||||||
|
mconf Kconfig
|
||||||
|
goto End
|
||||||
|
|
||||||
|
:MissingArgument
|
||||||
|
|
||||||
|
echo ERROR: Missing required argument
|
||||||
|
|
||||||
|
:ShowUsage
|
||||||
|
echo USAGE: %0 ^<action^> [-a ^<appsdir^>] [-c ^<cygwindir^>]
|
||||||
|
echo Where:
|
||||||
|
echo ^<action^> is one of config, oldconf, or menuconfig
|
||||||
|
echo ^<appsdir^> is the relative path to the apps\ directory.
|
||||||
|
echo This defaults to ..\apps
|
||||||
|
echo ^<cygwindir^> is the relative path to the Cygwin installation
|
||||||
|
echo directory. This defaults to C:\Cygwin
|
||||||
|
|
||||||
|
rem Restore the original PATH settings
|
||||||
|
|
||||||
|
:End
|
||||||
|
set PATH=%oldpath%
|
||||||
|
|
||||||
Reference in New Issue
Block a user