px4-firmware/Tools/check_submodules.sh

145 lines
3.5 KiB
Bash
Raw Normal View History

#!/bin/sh
2014-07-07 12:35:47 -03:00
[ -n "$GIT_SUBMODULES_ARE_EVIL" ] && {
# GIT_SUBMODULES_ARE_EVIL is set, meaning user doesn't want submodules
echo "Skipping submodules. NUTTX_SRC is set to $NUTTX_SRC"
exit 0
}
2014-07-07 12:35:47 -03:00
if [ -d NuttX/nuttx ];
then
2014-07-10 11:14:21 -03:00
STATUSRETVAL=$(git submodule summary | grep -A20 -i "NuttX" | grep "<")
if [ -z "$STATUSRETVAL" ]; then
2014-07-07 17:20:55 -03:00
echo "Checked NuttX submodule, correct version found"
2014-07-07 12:35:47 -03:00
else
2015-02-03 15:27:51 -04:00
echo ""
echo ""
echo "New commits required:"
echo "$(git submodule summary)"
2014-07-12 14:28:10 -03:00
echo ""
echo ""
echo " NuttX sub repo not at correct version. Try 'git submodule update'"
echo " or follow instructions on http://pixhawk.org/dev/git/submodules"
echo ""
echo " DO NOT FORGET TO RUN 'make distclean && make archives' AFTER EACH NUTTX UPDATE!"
2014-07-07 12:35:47 -03:00
exit 1
fi
else
2015-06-21 16:15:59 -03:00
git submodule update --init --recursive
fi
2014-07-07 12:35:47 -03:00
if [ -d mavlink/include/mavlink/v1.0 ];
then
2014-07-10 11:14:21 -03:00
STATUSRETVAL=$(git submodule summary | grep -A20 -i "mavlink/include/mavlink/v1.0" | grep "<")
if [ -z "$STATUSRETVAL" ]; then
2014-07-07 17:20:55 -03:00
echo "Checked mavlink submodule, correct version found"
2014-07-07 12:35:47 -03:00
else
2014-07-10 11:14:21 -03:00
echo ""
echo ""
echo "New commits required:"
echo "$(git submodule summary)"
echo ""
2015-02-03 15:27:51 -04:00
echo ""
echo "mavlink sub repo not at correct version. Try 'git submodule update'"
echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
2014-07-07 12:35:47 -03:00
exit 1
fi
2014-07-07 12:18:54 -03:00
else
2015-06-21 16:15:59 -03:00
git submodule update --init --recursive
2014-07-07 12:18:54 -03:00
fi
2014-07-08 13:19:17 -03:00
2014-07-12 10:45:05 -03:00
if [ -d uavcan ]
2014-07-08 13:19:17 -03:00
then
2014-07-12 10:45:05 -03:00
STATUSRETVAL=$(git submodule summary | grep -A20 -i uavcan | grep "<")
if [ -z "$STATUSRETVAL" ]
then
2014-07-08 13:19:17 -03:00
echo "Checked uavcan submodule, correct version found"
else
2015-02-03 15:27:51 -04:00
echo ""
echo ""
echo "New commits required:"
echo "$(git submodule summary)"
2014-07-12 10:45:05 -03:00
echo ""
echo ""
echo "uavcan sub repo not at correct version. Try 'git submodule update'"
2014-07-08 13:19:17 -03:00
echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
2015-02-03 15:27:51 -04:00
exit 1
fi
else
2015-06-21 16:15:59 -03:00
git submodule update --init --recursive
2015-02-03 15:27:51 -04:00
fi
2015-03-19 20:00:54 -03:00
if [ -d src/lib/eigen ]
then
Fixes for qurt HIL build Workaround required Eigen downgrade to 3.2. Hexagon toolchain does not support C++11 features of newest version of Eigen. Running make qurt_fixup will downgrade and patch Eigen for qurt. Running make restore will revert the patch and do a git submodule update to restore the expected Eigen version. Added a "restore" target to undo qurt_fixup Before doing a qurt build run: make qurt_fixup That will downgrade Eigen to 3.2 and apply the require patch. To build another target after downgrading: make restore Them make the desired target (other than qurt). Fixed type used in orb_priority to be consistent with the code (int* was used in declaration but int32_t* used in code) Removed unused class member variable in sensors.cpp Added cmake fix for unit tests. The location of px4_log.c changed. Fixed the qurt drv_hrt.c implementation to use us instead of ms for time resolution Added px4_led.c to nuttx platform layer Use the posix version of px4_led.c for nuttx so we don't end up with duplicate files. It was moved out of common because it is not used by qurt. Changed PX4_DEBUG to PX4_WARN when checking for the error condition for store_poll_waiter in vdev.cpp Updated the px4_log.h file to make calls to the qurt_log functions. The qurt_log function is defined in the platforms/qurt layer. Added an option to control starting the commander module in HIL mode. Moved the flight specific drivers to the configuration file instead of adding them to the common tool chain file because HIL mode does not need them. Added the uorb Subscriber and Publisher classes Call PX4_ISFINITE macro instead of isfinite(). Added px4_led.c to nuttx platform layer Use the posix version of px4_led.c for nuttx so we don't end up with duplicate files. It was moved out of common because it is not used by qurt. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-08-26 01:59:01 -03:00
echo "ARG = $1"
if [ $1 = "qurt" ]
2015-03-19 20:00:54 -03:00
then
Fixes for qurt HIL build Workaround required Eigen downgrade to 3.2. Hexagon toolchain does not support C++11 features of newest version of Eigen. Running make qurt_fixup will downgrade and patch Eigen for qurt. Running make restore will revert the patch and do a git submodule update to restore the expected Eigen version. Added a "restore" target to undo qurt_fixup Before doing a qurt build run: make qurt_fixup That will downgrade Eigen to 3.2 and apply the require patch. To build another target after downgrading: make restore Them make the desired target (other than qurt). Fixed type used in orb_priority to be consistent with the code (int* was used in declaration but int32_t* used in code) Removed unused class member variable in sensors.cpp Added cmake fix for unit tests. The location of px4_log.c changed. Fixed the qurt drv_hrt.c implementation to use us instead of ms for time resolution Added px4_led.c to nuttx platform layer Use the posix version of px4_led.c for nuttx so we don't end up with duplicate files. It was moved out of common because it is not used by qurt. Changed PX4_DEBUG to PX4_WARN when checking for the error condition for store_poll_waiter in vdev.cpp Updated the px4_log.h file to make calls to the qurt_log functions. The qurt_log function is defined in the platforms/qurt layer. Added an option to control starting the commander module in HIL mode. Moved the flight specific drivers to the configuration file instead of adding them to the common tool chain file because HIL mode does not need them. Added the uorb Subscriber and Publisher classes Call PX4_ISFINITE macro instead of isfinite(). Added px4_led.c to nuttx platform layer Use the posix version of px4_led.c for nuttx so we don't end up with duplicate files. It was moved out of common because it is not used by qurt. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-08-26 01:59:01 -03:00
# QuRT needs to use Eigen 3.2 because the toolchain doews not support C++11
STATUSRETVAL=$(true)
2015-03-19 20:00:54 -03:00
else
Fixes for qurt HIL build Workaround required Eigen downgrade to 3.2. Hexagon toolchain does not support C++11 features of newest version of Eigen. Running make qurt_fixup will downgrade and patch Eigen for qurt. Running make restore will revert the patch and do a git submodule update to restore the expected Eigen version. Added a "restore" target to undo qurt_fixup Before doing a qurt build run: make qurt_fixup That will downgrade Eigen to 3.2 and apply the require patch. To build another target after downgrading: make restore Them make the desired target (other than qurt). Fixed type used in orb_priority to be consistent with the code (int* was used in declaration but int32_t* used in code) Removed unused class member variable in sensors.cpp Added cmake fix for unit tests. The location of px4_log.c changed. Fixed the qurt drv_hrt.c implementation to use us instead of ms for time resolution Added px4_led.c to nuttx platform layer Use the posix version of px4_led.c for nuttx so we don't end up with duplicate files. It was moved out of common because it is not used by qurt. Changed PX4_DEBUG to PX4_WARN when checking for the error condition for store_poll_waiter in vdev.cpp Updated the px4_log.h file to make calls to the qurt_log functions. The qurt_log function is defined in the platforms/qurt layer. Added an option to control starting the commander module in HIL mode. Moved the flight specific drivers to the configuration file instead of adding them to the common tool chain file because HIL mode does not need them. Added the uorb Subscriber and Publisher classes Call PX4_ISFINITE macro instead of isfinite(). Added px4_led.c to nuttx platform layer Use the posix version of px4_led.c for nuttx so we don't end up with duplicate files. It was moved out of common because it is not used by qurt. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-08-26 01:59:01 -03:00
STATUSRETVAL=$(git submodule summary | grep -A20 -i eigen | grep "<")
if [ -z "$STATUSRETVAL" ]
then
echo "Checked Eigen submodule, correct version found"
else
echo ""
echo ""
echo "New commits required:"
echo "$(git submodule summary)"
echo ""
echo ""
echo "eigen sub repo not at correct version. Try 'git submodule update'"
echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
exit 1
fi
2015-03-19 20:00:54 -03:00
fi
else
2015-06-21 16:15:59 -03:00
git submodule update --init --recursive
2015-03-19 20:00:54 -03:00
fi
2015-02-03 15:27:51 -04:00
if [ -d Tools/gencpp ]
then
STATUSRETVAL=$(git submodule summary | grep -A20 -i gencpp | grep "<")
if [ -z "$STATUSRETVAL" ]
then
echo "Checked gencpp submodule, correct version found"
else
2014-07-12 10:45:05 -03:00
echo ""
echo ""
echo "New commits required:"
echo "$(git submodule summary)"
echo ""
2015-02-03 15:27:51 -04:00
echo ""
echo "gencpp sub repo not at correct version. Try 'git submodule update'"
echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
exit 1
fi
else
2015-06-21 16:15:59 -03:00
git submodule update --init --recursive
2015-02-03 15:27:51 -04:00
fi
if [ -d Tools/genmsg ]
then
STATUSRETVAL=$(git submodule summary | grep -A20 -i genmsg | grep "<")
if [ -z "$STATUSRETVAL" ]
then
echo "Checked genmsg submodule, correct version found"
else
echo ""
echo ""
echo "New commits required:"
echo "$(git submodule summary)"
echo ""
echo ""
echo "genmsg sub repo not at correct version. Try 'git submodule update'"
echo "or follow instructions on http://pixhawk.org/dev/git/submodules"
2014-07-08 13:19:17 -03:00
exit 1
fi
else
2015-06-21 16:15:59 -03:00
git submodule update --init --recursive
2014-07-08 13:19:17 -03:00
fi
exit 0