mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 02:53:34 +08:00
NuttX upgrade cmake wrapper (#7873)
* NuttX cmake * px4_macros:Pass the stringified predicate as second arg to static assert CC_ASSERT mapes to the c++ static_assert or provides the same funtionality for c via the other macros. The c++ static assert takes 2 argumants the prdicate and a message. This fixes the lacking second argument. * Updated nuttx and apps submodule to upstream nuttx 7.21+==master This is the latest uptake of upstream nuttx and apps. * ROMFS generate with xxd instead of objcopy * delete nuttx-patches * NuttX update submodules to latest px4_nuttx-master * fix nuttx apps and board dependency * docker_run update to latest container 2017-08-29 * cmake ROMFS portable sed usage * NuttX update submodules to latest px4_nuttx-master
This commit is contained in:
+5
-5
@@ -4,23 +4,23 @@ if [ -z ${PX4_DOCKER_REPO+x} ]; then
|
||||
echo "guessing PX4_DOCKER_REPO based on input";
|
||||
if [[ $@ =~ .*px4fmu.* ]]; then
|
||||
# nuttx-px4fmu-v{1,2,3,4,5}
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-nuttx:2017-07-27"
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-nuttx:2017-08-29"
|
||||
elif [[ $@ =~ .*rpi.* ]] || [[ $@ =~ .*bebop.* ]]; then
|
||||
# posix_rpi_cross, posix_bebop_default
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-raspi:2017-07-27"
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-raspi:2017-08-29"
|
||||
elif [[ $@ =~ .*eagle.* ]] || [[ $@ =~ .*excelsior.* ]]; then
|
||||
# eagle, excelsior
|
||||
PX4_DOCKER_REPO="lorenzmeier/px4-dev-snapdragon:2017-07-28"
|
||||
elif [[ $@ =~ .*clang.* ]] || [[ $@ =~ .*scan-build.* ]]; then
|
||||
# clang tools
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-clang:2017-07-27"
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-clang:2017-08-29"
|
||||
elif [[ $@ =~ .*cppcheck.* ]]; then
|
||||
# need Ubuntu 17.04 for cppcheck cmake support
|
||||
# TODO: remove this once px4io/px4-dev-base updates
|
||||
PX4_DOCKER_REPO=px4io/px4-dev-base:ubuntu17.04
|
||||
elif [[ $@ =~ .*tests* ]]; then
|
||||
# run all tests with simulation
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-simulation:2017-07-27"
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-simulation:2017-08-29"
|
||||
fi
|
||||
else
|
||||
echo "PX4_DOCKER_REPO is set to '$PX4_DOCKER_REPO'";
|
||||
@@ -28,7 +28,7 @@ fi
|
||||
|
||||
# otherwise default to nuttx
|
||||
if [ -z ${PX4_DOCKER_REPO+x} ]; then
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-nuttx:2017-07-27"
|
||||
PX4_DOCKER_REPO="px4io/px4-dev-nuttx:2017-08-29"
|
||||
fi
|
||||
|
||||
# docker hygiene
|
||||
|
||||
@@ -79,7 +79,7 @@ fi
|
||||
|
||||
# Find a reasonable tmp directory.
|
||||
# First make a list of all build directories by looking for a CMakeCache.txt in them. Sort them so the most recent one is first.
|
||||
CMAKECACHE_FILES=$(find "$BASEDIR" -mindepth 2 -maxdepth 2 -type f -name CMakeCache.txt -wholename "$BASEDIR/build_*/CMakeCache.txt" | xargs /bin/ls -td)
|
||||
CMAKECACHE_FILES=$(find "$BASEDIR" -mindepth 2 -maxdepth 2 -type f -name CMakeCache.txt -wholename "$BASEDIR/build/*/CMakeCache.txt" | xargs /bin/ls -td)
|
||||
# Make a list of all candidate tmp directories.
|
||||
TMPDIRS=
|
||||
for f in $CMAKECACHE_FILES; do
|
||||
@@ -195,7 +195,7 @@ for subm in $SUBMODULES; do
|
||||
done
|
||||
|
||||
echo -n "Finding all source files with #include's (excluding submodules and build directory)... "
|
||||
find $BASEDIR -mindepth 2 -type f ! \( -wholename $BASEDIR/build_* -o $EXCLUDE_ARGS -o $SUBMODULES_ARGS \) \( $INCLUDE_C_ARGS -o $INCLUDE_H_ARGS \) > $TMPDIR/fix_headers_sources
|
||||
find $BASEDIR -mindepth 2 -type f ! \( -wholename $BASEDIR/build/* -o $EXCLUDE_ARGS -o $SUBMODULES_ARGS \) \( $INCLUDE_C_ARGS -o $INCLUDE_H_ARGS \) > $TMPDIR/fix_headers_sources
|
||||
cat "$TMPDIR/fix_headers_sources" | xargs grep -l "$INCLUDE_RE" > $TMPDIR/fix_headers_sources_with_includes
|
||||
echo "done"
|
||||
number_of_files=$(sed -n '$=' "$TMPDIR/fix_headers_sources_with_includes")
|
||||
@@ -206,7 +206,7 @@ find $BASEDIR -type f ! \( $EXCLUDE_ARGS \) \( $SUBMODULES_ARGS \) \( $INCLUDE_H
|
||||
echo "done"
|
||||
|
||||
echo -n "Finding all header files (excluding stdc++ headers)... "
|
||||
find $BASEDIR -type f ! \( $EXCLUDE_ARGS \) -wholename $BASEDIR/build_* \( $INCLUDE_H_ARGS \) > $TMPDIR/fix_headers_HEADERS
|
||||
find $BASEDIR -type f ! \( $EXCLUDE_ARGS \) -wholename $BASEDIR/build/* \( $INCLUDE_H_ARGS \) > $TMPDIR/fix_headers_HEADERS
|
||||
grep -E "$HEADER_RE" $TMPDIR/fix_headers_sources >> $TMPDIR/fix_headers_HEADERS
|
||||
cat $TMPDIR/fix_headers_SUBMODULE_HEADERS >> $TMPDIR/fix_headers_HEADERS
|
||||
echo "done"
|
||||
@@ -233,7 +233,7 @@ function include_path()
|
||||
foo=0
|
||||
for includedir in $(grep "/$PATH_RE\$" $TMPDIR/fix_headers_HEADERS | cut -c $striplen-); do
|
||||
# If the include directory is NuttX header that was copied to the build directory, then it's still a system file.
|
||||
if [[ $includedir/ =~ ^build_.*/NuttX/ ]]; then
|
||||
if [[ $includedir/ =~ ^build/.*/NuttX/ ]]; then
|
||||
issubmodule=1
|
||||
# If the include directory is a submodule, then treat it as a system file.
|
||||
elif [[ $includedir/ =~ ^$SUBMODULES_RE/ ]]; then
|
||||
|
||||
@@ -168,6 +168,6 @@ fi
|
||||
sed -i -r -e 's%("(magic|description|summary)": ")([^"]*)(",).*%\1FIXME (was: \3)\4%' "Images/${newname}.prototype"
|
||||
|
||||
echo "*** The following files contain a reference to $oldconfig (this might take a while):"
|
||||
find . -path './build_*' -o -path './.git' -o -name 'defconfig' -prune -o -type f -exec grep -l -- "$oldconfig" {} \;
|
||||
find . -path './build/*' -o -path './.git' -o -name 'defconfig' -prune -o -type f -exec grep -l -- "$oldconfig" {} \;
|
||||
echo "*** Run 'git diff' to check the changes that this script already made relative to the copied prototype files."
|
||||
echo "*** Use 'git status' to see other (added) files, that likely need fixing."
|
||||
|
||||
@@ -156,24 +156,24 @@ installpx4() {
|
||||
if [ $mode == 0 ]; then
|
||||
# copy default binaries
|
||||
echo -e "Copying the PX4 binaries from the eagle_default build tree..."
|
||||
adb push $workspace/build_qurt_eagle_default/src/firmware/qurt/libpx4.so /usr/share/data/adsp
|
||||
adb push $workspace/build_qurt_eagle_default/src/firmware/qurt/libpx4muorb_skel.so /usr/share/data/adsp
|
||||
adb push $workspace/build_posix_eagle_default/src/firmware/posix/px4 /home/linaro
|
||||
adb push $workspace/build/qurt_eagle_default/src/firmware/qurt/libpx4.so /usr/share/data/adsp
|
||||
adb push $workspace/build/qurt_eagle_default/src/firmware/qurt/libpx4muorb_skel.so /usr/share/data/adsp
|
||||
adb push $workspace/build/posix_eagle_default/src/firmware/posix/px4 /home/linaro
|
||||
adb push $workspace/posix-configs/eagle/flight/px4.config /usr/share/data/adsp
|
||||
adb push $workspace/posix-configs/eagle/flight/mainapp.config /home/linaro
|
||||
elif [ $mode == 1 ]; then
|
||||
# copy legacy binaries
|
||||
echo -e "Copying the PX4 binaries from the eagle_legacy build tree..."
|
||||
adb push $workspace/build_qurt_eagle_legacy/src/firmware/qurt/libpx4.so /usr/share/data/adsp
|
||||
adb push $workspace/build_qurt_eagle_legacy/src/firmware/qurt/libpx4muorb_skel.so /usr/share/data/adsp
|
||||
adb push $workspace/build_posix_eagle_legacy/src/firmware/posix/px4 /home/linaro
|
||||
adb push $workspace/build/qurt_eagle_legacy/src/firmware/qurt/libpx4.so /usr/share/data/adsp
|
||||
adb push $workspace/build/qurt_eagle_legacy/src/firmware/qurt/libpx4muorb_skel.so /usr/share/data/adsp
|
||||
adb push $workspace/build/posix_eagle_legacy/src/firmware/posix/px4 /home/linaro
|
||||
adb push $workspace/posix-configs/eagle/200qx/px4.config /usr/share/data/adsp
|
||||
adb push $workspace/posix-configs/eagle/200qx/mainapp.config /home/linaro
|
||||
else
|
||||
echo -e "Copying the PX4 binaries from the excelsior_legacy build tree..."
|
||||
adb push $workspace/build_qurt_excelsior_legacy/src/firmware/qurt/libpx4.so /usr/lib/rfsa/adsp
|
||||
adb push $workspace/build_qurt_excelsior_legacy/src/firmware/qurt/libpx4muorb_skel.so /usr/lib/rfsa/adsp
|
||||
adb push $workspace/build_posix_excelsior_legacy/src/firmware/posix/px4 /home/root
|
||||
adb push $workspace/build/qurt_excelsior_legacy/src/firmware/qurt/libpx4.so /usr/lib/rfsa/adsp
|
||||
adb push $workspace/build/qurt_excelsior_legacy/src/firmware/qurt/libpx4muorb_skel.so /usr/lib/rfsa/adsp
|
||||
adb push $workspace/build/posix_excelsior_legacy/src/firmware/posix/px4 /home/root
|
||||
adb push $workspace/posix-configs/excelsior/px4.config /usr/lib/rfsa/adsp
|
||||
adb push $workspace/posix-configs/excelsior/mainapp.config /home/root
|
||||
fi
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
from __future__ import print_function
|
||||
|
||||
import sys
|
||||
import subprocess
|
||||
import re
|
||||
|
||||
filename = sys.argv[1]
|
||||
|
||||
try:
|
||||
fp_header = open(filename, 'r')
|
||||
old_header = fp_header.read()
|
||||
except:
|
||||
old_header = ''
|
||||
|
||||
git_tag = subprocess.check_output('git describe --always --tags --dirty'.split(),
|
||||
stderr=subprocess.STDOUT).decode('utf-8').strip()
|
||||
git_version = subprocess.check_output('git rev-parse --verify HEAD'.split(),
|
||||
stderr=subprocess.STDOUT).decode('utf-8').strip()
|
||||
try:
|
||||
git_branch_name = subprocess.check_output('git symbolic-ref -q --short HEAD'.split(),
|
||||
stderr=subprocess.STDOUT).decode('utf-8').strip()
|
||||
except:
|
||||
git_branch_name = ''
|
||||
git_version_short = git_version[0:16]
|
||||
nuttx_git_tag = subprocess.check_output('git describe --always --tags --match nuttx-* --dirty'.split(),
|
||||
cwd='NuttX/nuttx', stderr=subprocess.STDOUT).decode('utf-8').strip().replace("nuttx-","v")
|
||||
nuttx_git_tag = re.sub('-.*','.0',nuttx_git_tag)
|
||||
nuttx_git_version = subprocess.check_output('git rev-parse --verify HEAD'.split(),
|
||||
cwd='NuttX/nuttx', stderr=subprocess.STDOUT).decode('utf-8').strip()
|
||||
nuttx_git_version_short = nuttx_git_version[0:16]
|
||||
mavlink_git_version = subprocess.check_output('git rev-parse --verify HEAD'.split(),
|
||||
cwd='mavlink/include/mavlink/v2.0', stderr=subprocess.STDOUT).decode('utf-8').strip()
|
||||
mavlink_git_version_short = mavlink_git_version[0:16]
|
||||
|
||||
# Generate the header file content
|
||||
header = """
|
||||
/* Auto Magically Generated file */
|
||||
/* Do not edit! */
|
||||
#pragma once
|
||||
#define PX4_GIT_VERSION_STR "{git_version}"
|
||||
#define PX4_GIT_VERSION_BINARY 0x{git_version_short}
|
||||
#define PX4_GIT_TAG_STR "{git_tag}"
|
||||
#define PX4_GIT_BRANCH_NAME "{git_branch_name}"
|
||||
|
||||
#define NUTTX_GIT_VERSION_STR "{nuttx_git_version}"
|
||||
#define NUTTX_GIT_VERSION_BINARY 0x{nuttx_git_version_short}
|
||||
#define NUTTX_GIT_TAG_STR "{nuttx_git_tag}"
|
||||
|
||||
#define MAVLINK_LIB_GIT_VERSION_STR "{mavlink_git_version}"
|
||||
#define MAVLINK_LIB_GIT_VERSION_BINARY 0x{mavlink_git_version_short}
|
||||
""".format(git_tag=git_tag,
|
||||
git_version=git_version,
|
||||
git_version_short=git_version_short,
|
||||
git_branch_name=git_branch_name,
|
||||
nuttx_git_version=nuttx_git_version,
|
||||
nuttx_git_version_short=nuttx_git_version_short,
|
||||
nuttx_git_tag=nuttx_git_tag,
|
||||
mavlink_git_version=mavlink_git_version,
|
||||
mavlink_git_version_short=mavlink_git_version_short)
|
||||
|
||||
if old_header != header:
|
||||
print('Updating header {}'.format(sys.argv[1]))
|
||||
fp_header = open(filename, 'w')
|
||||
fp_header.write(header)
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
make px4fmu-v4_default
|
||||
cp build_px4fmu-v4_default/parameters.xml ../qgroundcontrol/src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml
|
||||
cp build_px4fmu-v4_default/airframes.xml ../qgroundcontrol/src/AutoPilotPlugins/PX4/AirframeFactMetaData.xml
|
||||
cp build/px4fmu-v4_default/parameters.xml ../qgroundcontrol/src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml
|
||||
cp build/px4fmu-v4_default/airframes.xml ../qgroundcontrol/src/AutoPilotPlugins/PX4/AirframeFactMetaData.xml
|
||||
|
||||
@@ -17,7 +17,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
src_path="$SCRIPT_DIR/.."
|
||||
|
||||
rc_script="posix-configs/SITL/init/ekf2/multiple_iris"
|
||||
build_path=${src_path}/build_posix_sitl_default
|
||||
build_path=${src_path}/build/posix_sitl_default
|
||||
|
||||
echo "killing running instances"
|
||||
pkill -x px4 || true
|
||||
|
||||
@@ -23,7 +23,6 @@ echo src_path: $src_path
|
||||
echo build_path: $build_path
|
||||
|
||||
working_dir=`pwd`
|
||||
sitl_bin=$build_path/src/firmware/posix/px4
|
||||
rootfs=$build_path/tmp/rootfs
|
||||
|
||||
if [ "$chroot" == "1" ]
|
||||
|
||||
Reference in New Issue
Block a user