Skip to content

Commit

Permalink
将scons --menuconfig/--pyconfig/--pyconfig-silent统一调用kconfiglib
Browse files Browse the repository at this point in the history
  • Loading branch information
ComerLater authored Apr 19, 2024
1 parent 202bacb commit 6311bca
Show file tree
Hide file tree
Showing 32 changed files with 8,836 additions and 378 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bsp_buildings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ jobs:
chmod 777 install_ubuntu.sh
./install_ubuntu.sh
git config --global http.postBuffer 524288000
python -c "import tools.menuconfig; tools.menuconfig.touch_env()"
python -c "import tools.menukconfig; tools.menukconfig.touch_env()"
echo "RTT_ROOT=${{ github.workspace }}" >> $GITHUB_ENV
echo "RTT_CC=gcc" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/compile_bsp_with_drivers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
git config --global http.postBuffer 524288000
git remote -v
git fetch origin
python -c "import tools.menuconfig; tools.menuconfig.touch_env()"
python -c "import tools.menukconfig; tools.menukconfig.touch_env()"
- name: Install Arm ToolChains
if: ${{ success() }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual_dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
chmod 777 install_ubuntu.sh
./install_ubuntu.sh
git config --global http.postBuffer 524288000
python -c "import tools.menuconfig; tools.menuconfig.touch_env()"
python -c "import tools.menukconfig; tools.menukconfig.touch_env()"
echo "RTT_ROOT=${{ github.workspace }}" >> $GITHUB_ENV
echo "RTT_CC=gcc" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual_trigger_scons_STM32_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ jobs:
chmod 777 install_ubuntu.sh
./install_ubuntu.sh
git config --global http.postBuffer 524288000
python -c "import tools.menuconfig; tools.menuconfig.touch_env()"
python -c "import tools.menukconfig; tools.menukconfig.touch_env()"
echo "RTT_ROOT=${{ github.workspace }}" >> $GITHUB_ENV
echo "RTT_CC=gcc" >> $GITHUB_ENV
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ jobs:
chmod 777 install_ubuntu.sh
./install_ubuntu.sh
git config --global http.postBuffer 524288000
python -c "import tools.menuconfig; tools.menuconfig.touch_env()"
python -c "import tools.menukconfig; tools.menukconfig.touch_env()"
echo "RTT_ROOT=${{ github.workspace }}" >> $GITHUB_ENV
echo "RTT_CC=gcc" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual_trigger_scons_fail_bsp_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
chmod 777 install_ubuntu.sh
./install_ubuntu.sh
git config --global http.postBuffer 524288000
python -c "import tools.menuconfig; tools.menuconfig.touch_env()"
python -c "import tools.menukconfig; tools.menukconfig.touch_env()"
echo "RTT_ROOT=${{ github.workspace }}" >> $GITHUB_ENV
echo "RTT_CC=gcc" >> $GITHUB_ENV
Expand Down
30 changes: 20 additions & 10 deletions tools/building.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,20 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [

# set RTT_ROOT in ENV
Env['RTT_ROOT'] = Rtt_Root
os.environ["RTT_DIR"] = Rtt_Root
# set BSP_ROOT in ENV
Env['BSP_ROOT'] = Dir('#').abspath
os.environ["BSP_DIR"] = Dir('#').abspath
# set PKGS_ROOT in ENV
if not "PKGS_DIR" in os.environ:
if "ENV_ROOT" in os.environ:
os.environ["PKGS_DIR"] = os.path.join(os.environ["ENV_ROOT"], "packages")
elif sys.platform == "win32":
os.environ["PKGS_DIR"] = os.path.join(os.environ["USERPROFILE"], ".env/packages")
else:
os.environ["PKGS_DIR"] = os.path.join(os.environ["HOME"], ".env/packages")

sys.path = sys.path + [os.path.join(Rtt_Root, 'tools')]
sys.path = sys.path + [os.path.join(Rtt_Root, 'tools'), os.path.join(Rtt_Root, 'tools/kconfiglib')]

# {target_name:(CROSS_TOOL, PLATFORM)}
tgt_dict = {'mdk':('keil', 'armcc'),
Expand Down Expand Up @@ -303,33 +313,33 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
print('--global-macros arguments are illegal!')

if GetOption('genconfig'):
from genconf import genconfig
from menukconfig import genconfig
genconfig()
exit(0)

if GetOption('stackanalysis'):
from WCS import ThreadStackStaticAnalysis
ThreadStackStaticAnalysis(Env)
exit(0)
if platform.system() != 'Windows':
if GetOption('menuconfig'):
from menuconfig import menuconfig
menuconfig(Rtt_Root)
exit(0)

if GetOption('menuconfig'):
from menukconfig import menuconfig
menuconfig(Rtt_Root)
exit(0)

if GetOption('pyconfig-silent'):
from menuconfig import guiconfig_silent
from menukconfig import guiconfig_silent
guiconfig_silent(Rtt_Root)
exit(0)

elif GetOption('pyconfig'):
from menuconfig import guiconfig
from menukconfig import guiconfig
guiconfig(Rtt_Root)
exit(0)

configfn = GetOption('useconfig')
if configfn:
from menuconfig import mk_rtconfig
from menukconfig import mk_rtconfig
mk_rtconfig(configfn)
exit(0)

Expand Down
32 changes: 0 additions & 32 deletions tools/genconf.py

This file was deleted.

4 changes: 4 additions & 0 deletions tools/kconfiglib/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.py[co]
build/
*.egg-info/
dist/
5 changes: 5 additions & 0 deletions tools/kconfiglib/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Copyright (c) 2011-2019, Ulf Magnusson <[email protected]>

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2 changes: 2 additions & 0 deletions tools/kconfiglib/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Include the license file in source distributions
include LICENSE.txt
Loading

0 comments on commit 6311bca

Please sign in to comment.