Tools: move from ENABLE_SCRIPTING to AP_SCRIPTING_ENABLED

This commit is contained in:
Peter Barker 2021-11-15 16:08:36 +11:00 committed by Peter Barker
parent 9a5520a811
commit 8ae1a58eae
5 changed files with 30 additions and 11 deletions

View File

@ -214,7 +214,7 @@ void AP_Periph_FW::init()
notify.init();
#endif
#if ENABLE_SCRIPTING
#if AP_SCRIPTING_ENABLED
scripting.init();
#endif
start_ms = AP_HAL::native_millis();

View File

@ -219,13 +219,13 @@ public:
// Handled under LUA script to control LEDs
float get_yaw_earth() { return yaw_earth; }
uint32_t get_vehicle_state() { return vehicle_state; }
#elif defined(ENABLE_SCRIPTING)
#elif defined(AP_SCRIPTING_ENABLED)
// create dummy methods for the case when the user doesn't want to use the notify object
float get_yaw_earth() { return 0.0; }
uint32_t get_vehicle_state() { return 0.0; }
#endif
#if ENABLE_SCRIPTING
#if AP_SCRIPTING_ENABLED
AP_Scripting scripting;
#endif

View File

@ -347,7 +347,7 @@ const AP_Param::Info AP_Periph_FW::var_info[] = {
GOBJECT(serial_manager, "SERIAL", AP_SerialManager),
#endif
#if ENABLE_SCRIPTING
#if AP_SCRIPTING_ENABLED
// @Group: SCR_
// @Path: ../libraries/AP_Scripting/AP_Scripting.cpp
GOBJECT(scripting, "SCR_", AP_Scripting),

View File

@ -49,7 +49,7 @@ class Board:
self.configure_env(cfg, env)
env.DEFINES.update(
ENABLE_SCRIPTING = 0,
AP_SCRIPTING_ENABLED = 0,
)
# Setup scripting, had to defer this to allow checking board size
@ -60,7 +60,7 @@ class Board:
(cfg.env.BOARD_FLASH_SIZE > 1024))):
env.DEFINES.update(
ENABLE_SCRIPTING = 1,
AP_SCRIPTING_ENABLED = 1,
LUA_32BITS = 1,
)

View File

@ -76,7 +76,10 @@ elif [ ${RELEASE_CODENAME} == 'focal' ] || [ ${RELEASE_CODENAME} == 'ulyssa' ];
SITLCFML_VERSION="2.5"
PYTHON_V="python3"
PIP=pip3
elif [ ${RELEASE_CODENAME} == 'groovy' ] || [ ${RELEASE_CODENAME} == 'hirsute' ] || [ ${RELEASE_CODENAME} == 'bullseye' ]; then
elif [ ${RELEASE_CODENAME} == 'groovy' ] ||
[ ${RELEASE_CODENAME} == 'hirsute' ] ||
[ ${RELEASE_CODENAME} == 'bullseye' ] ||
[ ${RELEASE_CODENAME} == 'impish' ]; then
SITLFML_VERSION="2.5"
SITLCFML_VERSION="2.5"
PYTHON_V="python3"
@ -187,10 +190,15 @@ sudo usermod -a -G dialout $USER
echo "Done!"
# Add back python symlink to python interpreter on Ubuntu >= 20.04
if [ ${RELEASE_CODENAME} == 'focal' ] || [ ${RELEASE_CODENAME} == 'ulyssa' ]; then
if [ ${RELEASE_CODENAME} == 'focal' ] ||
[ ${RELEASE_CODENAME} == 'ulyssa' ];
then
BASE_PKGS+=" python-is-python3"
SITL_PKGS+=" libpython3-stdlib" # for argparse
elif [ ${RELEASE_CODENAME} == 'groovy' ] || [ ${RELEASE_CODENAME} == 'hirsute' ] || [ ${RELEASE_CODENAME} == 'bullseye' ]; then
elif [ ${RELEASE_CODENAME} == 'groovy' ] ||
[ ${RELEASE_CODENAME} == 'hirsute' ] ||
[ ${RELEASE_CODENAME} == 'bullseye' ] ||
[ ${RELEASE_CODENAME} == 'impish' ]; then
BASE_PKGS+=" python-is-python3"
SITL_PKGS+=" libpython3-stdlib" # for argparse
else
@ -201,16 +209,27 @@ fi
if [[ $SKIP_AP_GRAPHIC_ENV -ne 1 ]]; then
if [ ${RELEASE_CODENAME} == 'bullseye' ]; then
SITL_PKGS+=" libjpeg62-turbo-dev"
elif [ ${RELEASE_CODENAME} == 'groovy' ] || [ ${RELEASE_CODENAME} == 'hirsute' ] || [ ${RELEASE_CODENAME} == 'focal' ] || [ ${RELEASE_CODENAME} == 'ulyssa' ]; then
elif [ ${RELEASE_CODENAME} == 'groovy' ] ||
[ ${RELEASE_CODENAME} == 'hirsute' ] ||
[ ${RELEASE_CODENAME} == 'focal' ] ||
[ ${RELEASE_CODENAME} == 'ulyssa' ]; then
SITL_PKGS+=" libjpeg8-dev"
elif apt-cache search python-wxgtk3.0 | grep wx; then
SITL_PKGS+=" python-wxgtk3.0"
elif apt-cache search python3-wxgtk4.0 | grep wx; then
# see below
:
else
# we only support back to trusty:
SITL_PKGS+=" python-wxgtk2.8"
SITL_PKGS+=" fonts-freefont-ttf libfreetype6-dev libjpeg8-dev libpng12-0 libportmidi-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev" # for pygame
fi
if [ ${RELEASE_CODENAME} == 'bullseye' ] || [ ${RELEASE_CODENAME} == 'groovy' ] || [ ${RELEASE_CODENAME} == 'hirsute' ] || [ ${RELEASE_CODENAME} == 'focal' ] || [ ${RELEASE_CODENAME} == 'ulyssa' ]; then
if [ ${RELEASE_CODENAME} == 'bullseye' ] ||
[ ${RELEASE_CODENAME} == 'groovy' ] ||
[ ${RELEASE_CODENAME} == 'hirsute' ] ||
[ ${RELEASE_CODENAME} == 'focal' ] ||
[ ${RELEASE_CODENAME} == 'ulyssa' ] ||
[ ${RELEASE_CODENAME} == 'impish' ]; then
SITL_PKGS+=" python3-wxgtk4.0"
SITL_PKGS+=" fonts-freefont-ttf libfreetype6-dev libpng16-16 libportmidi-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev" # for pygame
fi