2012-12-22 17:47:02 +01:00
|
|
|
@echo off
|
|
|
|
|
|
|
|
rem tools/kconfig.bat
|
|
|
|
rem
|
2021-02-18 13:48:10 +01: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
|
2012-12-22 17:47:02 +01:00
|
|
|
rem
|
2021-02-18 13:48:10 +01:00
|
|
|
rem http://www.apache.org/licenses/LICENSE-2.0
|
2012-12-22 17:47:02 +01:00
|
|
|
rem
|
2021-02-18 13:48:10 +01: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.
|
2012-12-22 17:47:02 +01:00
|
|
|
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
|
2013-01-09 13:55:13 +01:00
|
|
|
kconfig-conf Kconfig
|
2012-12-22 17:47:02 +01:00
|
|
|
goto End
|
|
|
|
|
|
|
|
:DoOldConfig
|
2013-01-09 13:55:13 +01:00
|
|
|
kconfig-conf --oldconfig Kconfig
|
2012-12-22 17:47:02 +01:00
|
|
|
goto End
|
|
|
|
|
|
|
|
:DoMenuConfig
|
2013-01-09 13:55:13 +01:00
|
|
|
kconfig-mconf Kconfig
|
2012-12-22 17:47:02 +01:00
|
|
|
goto End
|
|
|
|
|
|
|
|
:MissingArgument
|
|
|
|
|
|
|
|
echo ERROR: Missing required argument
|
|
|
|
|
|
|
|
:ShowUsage
|
|
|
|
echo USAGE: %0 ^<action^> [-a ^<appsdir^>] [-c ^<cygwindir^>]
|
|
|
|
echo Where:
|
2020-01-05 17:29:59 +01:00
|
|
|
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
|
2012-12-22 17:47:02 +01:00
|
|
|
|
|
|
|
rem Restore the original PATH settings
|
|
|
|
|
|
|
|
:End
|
|
|
|
set PATH=%oldpath%
|