2013-01-05 05:37:31 +08:00
|
|
|
@echo off
|
|
|
|
|
|
|
|
rem tools/configure.bat
|
|
|
|
rem
|
2024-09-10 20:15:58 +08:00
|
|
|
rem SPDX-License-Identifier: Apache-2.0
|
|
|
|
rem
|
2021-02-18 20:48:10 +08:00
|
|
|
rem Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
rem contributor license agreements. See the NOTICE file distributed with
|
|
|
|
rem this work for additional information regarding copyright ownership. The
|
|
|
|
rem ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
rem "License"); you may not use this file except in compliance with the
|
|
|
|
rem License. You may obtain a copy of the License at
|
2023-02-26 02:14:11 +08:00
|
|
|
rem
|
2021-02-18 20:48:10 +08:00
|
|
|
rem http://www.apache.org/licenses/LICENSE-2.0
|
2023-02-26 02:14:11 +08:00
|
|
|
rem
|
2021-02-18 20:48:10 +08:00
|
|
|
rem Unless required by applicable law or agreed to in writing, software
|
|
|
|
rem distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
rem WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
rem License for the specific language governing permissions and limitations
|
|
|
|
rem under the License.
|
2013-01-05 05:37:31 +08:00
|
|
|
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=
|
2022-11-12 07:24:02 +08:00
|
|
|
set enforce_distclean=
|
|
|
|
set distclean=
|
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
|
2022-11-12 07:24:02 +08:00
|
|
|
if "%1"=="-E" goto :SetEnforceDistclean
|
|
|
|
if "%1"=="-e" goto :SetDistclean
|
2017-07-10 23:38:45 +08:00
|
|
|
if "%1"=="-f" goto :SetFormat
|
|
|
|
if "%1"=="-b" goto :SetFormat
|
|
|
|
if "%1"=="-l" goto :SetHostOption
|
2022-11-12 07:24:02 +08:00
|
|
|
if "%1"=="-m" goto :SetHostOption
|
2017-07-10 23:38:45 +08:00
|
|
|
if "%1"=="-c" goto :SetHostOption
|
|
|
|
if "%1"=="-n" goto :SetHostOption
|
2022-11-12 07:24:02 +08:00
|
|
|
if "%1"=="-B" goto :SetHostOption
|
2020-09-03 02:04:33 +08:00
|
|
|
if "%1"=="-L" goto :SetList
|
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
|
|
|
|
|
2022-11-12 07:24:02 +08:00
|
|
|
:SetEnforceDistclean
|
|
|
|
set enforce_distclean=%1
|
|
|
|
goto :NextArg
|
|
|
|
|
|
|
|
:SetDistclean
|
|
|
|
set distclean=%1
|
|
|
|
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
|
|
|
|
|
2020-09-03 02:04:33 +08:00
|
|
|
:SetList
|
|
|
|
set list=%1
|
|
|
|
goto :EndOfLoop
|
|
|
|
|
2013-01-05 05:37:31 +08:00
|
|
|
: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
|
2024-08-05 21:52:14 +08:00
|
|
|
set cflags=-Wall -Wstrict-prototypes -Wshadow -g -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
|
2022-11-12 07:24:02 +08:00
|
|
|
echo Is mingw32-gcc.exe installed? Is it in the PATH variable?
|
2013-01-05 05:37:31 +08:00
|
|
|
goto End
|
|
|
|
)
|
|
|
|
|
|
|
|
:HaveConfigureExe
|
2020-01-17 01:22:36 +08:00
|
|
|
cd ..
|
2022-11-12 07:24:02 +08:00
|
|
|
tools\configure.exe %debug% %enforce_distclean% %distclean% %fmt% %hostopt% %appdir% %config% %list%
|
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
|
2022-11-15 00:31:48 +08:00
|
|
|
echo USAGE: %0 [-d] [-E] [-e] [-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
|
2022-11-15 00:31:48 +08:00
|
|
|
echo -E:
|
|
|
|
echo Enforces distclean if already configured.
|
|
|
|
echo -e:
|
|
|
|
echo Performs distclean if configuration changed.
|
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.
|
2020-10-18 21:28:35 +08:00
|
|
|
echo -l selects the Linux (l) host environment. The [-c^|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
|
2020-10-18 21:28:35 +08:00
|
|
|
echo [-c^|n] selects the Windows host and a Windows environment:
|
|
|
|
echo Cygwin (c), or Windows native (n). Default Cygwin
|
2020-09-03 02:04:33 +08:00
|
|
|
echo -L:
|
|
|
|
echo List all available configurations.
|
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^>:
|
2020-02-23 16:50:23 +08:00
|
|
|
echo Identifies the specific configuration for the selected ^<board-name^>.
|
2017-07-10 23:38:45 +08:00
|
|
|
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
|