2013-01-05 05:37:31 +08:00
|
|
|
@echo off
|
|
|
|
|
|
|
|
rem tools/configure.bat
|
|
|
|
rem
|
2017-07-10 23:38:45 +08:00
|
|
|
rem Copyright (C) 2012, 2017 Gregory Nutt. All rights reserved.
|
2013-01-05 05:37:31 +08:00
|
|
|
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
|
|
|
|
|
2020-01-17 01:22:36 +08:00
|
|
|
if exist tools goto :GoToolDir
|
|
|
|
if exist ..\tools goto :SetToolDir
|
|
|
|
|
|
|
|
echo Cannot find tools\ directory
|
|
|
|
goto End
|
|
|
|
|
|
|
|
:GoToolDir
|
|
|
|
cd tools
|
|
|
|
|
|
|
|
:SetTooldir
|
|
|
|
set tooldir=%CD%
|
|
|
|
|
2013-01-05 05:37:31 +08:00
|
|
|
rem Parse command line arguments
|
|
|
|
|
|
|
|
set debug=
|
2017-07-10 23:38:45 +08:00
|
|
|
set fmt=-b
|
2013-01-05 05:37:31 +08:00
|
|
|
set posix=
|
|
|
|
set help=
|
|
|
|
set appdir=
|
|
|
|
set config=
|
2017-07-10 23:38:45 +08:00
|
|
|
set hostopt=
|
2013-01-05 05:37:31 +08:00
|
|
|
|
|
|
|
:ArgLoop
|
|
|
|
if "%1"=="" goto :NoConfig
|
|
|
|
if "%1"=="-h" goto :ShowUsage
|
|
|
|
if "%1"=="-d" goto :SetDebug
|
2017-07-10 23:38:45 +08:00
|
|
|
if "%1"=="-f" goto :SetFormat
|
|
|
|
if "%1"=="-b" goto :SetFormat
|
|
|
|
if "%1"=="-l" goto :SetHostOption
|
|
|
|
if "%1"=="-c" goto :SetHostOption
|
|
|
|
if "%1"=="-u" goto :SetHostOption
|
|
|
|
if "%1"=="-n" goto :SetHostOption
|
2013-01-05 05:37:31 +08:00
|
|
|
if "%1"=="-a" goto :SetAppDir
|
|
|
|
|
|
|
|
set config=%1
|
|
|
|
goto EndOfLoop
|
|
|
|
|
|
|
|
:SetDebug
|
2017-07-10 23:38:45 +08:00
|
|
|
set debug=%1
|
2013-01-05 05:37:31 +08:00
|
|
|
goto :NextArg
|
|
|
|
|
2017-07-10 23:38:45 +08:00
|
|
|
:SetFormat
|
|
|
|
set fmt=%1
|
2013-01-05 05:37:31 +08:00
|
|
|
goto :NextArg
|
|
|
|
|
2017-07-10 23:38:45 +08:00
|
|
|
:SetHostOption
|
|
|
|
set hostopt=%1
|
2013-01-05 05:37:31 +08:00
|
|
|
goto :NextArg
|
|
|
|
|
|
|
|
:SetAppDir
|
|
|
|
shift
|
|
|
|
set appdir=-a %1
|
|
|
|
|
|
|
|
:NextArg
|
|
|
|
shift
|
|
|
|
goto :ArgLoop
|
|
|
|
|
|
|
|
:EndOfLoop
|
|
|
|
|
|
|
|
rem Check if we have to build configure.exe
|
|
|
|
|
|
|
|
if exist configure.exe goto :HaveConfigureExe
|
|
|
|
|
|
|
|
set cc=mingw32-gcc.exe
|
|
|
|
set cflags=-Wall -Wstrict-prototypes -Wshadow -g -pipe -I. -DCONFIG_WINDOWS_NATIVE=y
|
2020-01-17 01:22:36 +08:00
|
|
|
echo %cc% %cflags% -o configure.exe configure.c cfgparser.c
|
2013-01-05 05:37:31 +08:00
|
|
|
%cc% %cflags% -o configure.exe configure.c cfgparser.c
|
|
|
|
if errorlevel 1 (
|
|
|
|
echo ERROR: %cc% failed
|
|
|
|
echo Is ming32-gcc.exe installed? Is it in the PATH variable?
|
|
|
|
goto End
|
|
|
|
)
|
|
|
|
|
|
|
|
:HaveConfigureExe
|
2020-01-17 01:22:36 +08:00
|
|
|
cd ..
|
|
|
|
tools\configure.exe %debug% %fmt% %hostopt% %appdir% %config%
|
2013-01-05 05:37:31 +08:00
|
|
|
if errorlevel 1 echo configure.exe failed
|
|
|
|
goto End
|
|
|
|
|
|
|
|
:NoConfig
|
2020-01-17 01:22:36 +08:00
|
|
|
echo Missing ^<board-name^>:^<config-name^> argument
|
2013-01-05 05:37:31 +08:00
|
|
|
|
|
|
|
:ShowUsage
|
2020-01-17 01:22:36 +08:00
|
|
|
echo USAGE: %0 [-d] [-b|f] [-a ^<app-dir^>] ^<board-name^>:^<config-name^>
|
2017-07-10 23:38:45 +08:00
|
|
|
echo %0 [-h]
|
2013-01-05 05:37:31 +08:00
|
|
|
echo\nWhere:
|
2017-07-10 23:38:45 +08:00
|
|
|
echo -d:
|
2013-01-05 05:37:31 +08:00
|
|
|
echo Enables debug output
|
2017-07-10 23:38:45 +08:00
|
|
|
echo -b:
|
2013-01-05 05:37:31 +08:00
|
|
|
echo Informs the tool that it should use Windows style paths like C:\\Program Files
|
|
|
|
echo instead of POSIX style paths are used like /usr/local/bin. Windows
|
|
|
|
echo style paths are used by default.
|
2017-07-10 23:38:45 +08:00
|
|
|
echo -f:
|
2013-01-05 05:37:31 +08:00
|
|
|
echo Informs the tool that it should use POSIX style paths like /usr/local/bin.
|
|
|
|
echo By default, Windows style paths like C:\\Program Files are used.
|
2017-07-10 23:38:45 +08:00
|
|
|
echo -l selects the Linux (l) host environment. The [-c^|u^|n] options
|
2020-01-06 00:29:59 +08:00
|
|
|
echo select one of the Windows environments. Default: Use host setup
|
|
|
|
echo in the defconfig file
|
2017-07-10 23:38:45 +08:00
|
|
|
echo [-c^|u^|n] selects the Windows host and a Windows environment: Cygwin (c),
|
2020-01-06 00:29:59 +08:00
|
|
|
echo Ubuntu under Windows 10 (u), or Windows native (n). Default Cygwin
|
2013-01-05 05:37:31 +08:00
|
|
|
echo -a ^<app-dir^>:
|
|
|
|
echo Informs the configuration tool where the application build
|
|
|
|
echo directory. This is a relative path from the top-level NuttX
|
|
|
|
echo build directory. But default, this tool will look in the usual
|
|
|
|
echo places to try to locate the application directory: ../apps or
|
|
|
|
echo ../apps-xx.yy where xx.yy is the NuttX version number.
|
2017-07-10 23:38:45 +08:00
|
|
|
echo ^<board-name^>:
|
|
|
|
echo Identifies the board. This must correspond to a board directory
|
2019-08-05 20:04:14 +08:00
|
|
|
echo under nuttx/boards/.
|
2017-07-10 23:38:45 +08:00
|
|
|
echo ^<config-name^>:
|
|
|
|
echo Identifies the specific configuratin for the selected ^<board-name^>.
|
|
|
|
echo This must correspond to a sub-directory under the board directory at
|
2019-08-05 22:30:34 +08:00
|
|
|
echo under nuttx/boards/^<board-name^>/configs/.
|
2017-07-10 23:38:45 +08:00
|
|
|
echo -h:
|
2013-01-05 05:37:31 +08:00
|
|
|
echo Prints this message and exits.
|
|
|
|
|
|
|
|
:End
|