1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

Merged in james-duley/librepilot/config (pull request #304)

LP-380: Rework configuration system and document it
This commit is contained in:
Philippe Renon 2016-08-28 18:47:59 +02:00
commit 4d73443543
6 changed files with 79 additions and 18 deletions

View File

@ -8,10 +8,10 @@ before_install:
- sudo add-apt-repository ppa:librepilot/tools -y
- sudo apt-get update -q
- sudo apt-get install -y libc6-i386 libudev-dev libusb-1.0-0-dev libsdl1.2-dev python libopenscenegraph-dev libosgearth-dev qt56-meta-minimal qt56svg qt56script qt56serialport qt56multimedia qt56translations qt56tools
- make arm_sdk_install
- make build_sdk_install
script:
- make config_new CCACHE=ccache GCS_EXTRA_CONF='osg osgearth'
- make config_new CCACHE=ccache
- make all_flight
- make opfw_resource
- make gcs

View File

@ -127,11 +127,20 @@ include $(ROOT_DIR)/make/tools.mk
# We almost need to consider autoconf/automake instead of this
ifeq ($(UNAME), Linux)
UAVOBJGENERATOR := $(BUILD_DIR)/uavobjgenerator/uavobjgenerator
UAVOBJGENERATOR := $(BUILD_DIR)/uavobjgenerator/uavobjgenerator
GCS_WITH_OSG := 1
GCS_WITH_OSGEARTH := 1
GCS_COPY_OSG := 0
else ifeq ($(UNAME), Darwin)
UAVOBJGENERATOR := $(BUILD_DIR)/uavobjgenerator/uavobjgenerator
UAVOBJGENERATOR := $(BUILD_DIR)/uavobjgenerator/uavobjgenerator
GCS_WITH_OSG := 1
GCS_WITH_OSGEARTH := 0
GCS_COPY_OSG := 1
else ifeq ($(UNAME), Windows)
UAVOBJGENERATOR := $(BUILD_DIR)/uavobjgenerator/uavobjgenerator.exe
GCS_WITH_OSG := 1
GCS_WITH_OSGEARTH := 1
GCS_COPY_OSG := 1
endif
export UAVOBJGENERATOR
@ -140,9 +149,14 @@ export UAVOBJGENERATOR
GCS_BUILD_CONF := release
# Set extra configuration
GCS_EXTRA_CONF += osg copy_osg
ifeq ($(UNAME), Windows)
GCS_EXTRA_CONF += osgearth
ifeq ($(GCS_WITH_OSG), 1)
GCS_EXTRA_CONF += osg
ifeq ($(GCS_COPY_OSG), 1)
GCS_EXTRA_CONF += copy_osg
endif
ifeq ($(GCS_WITH_OSGEARTH), 1)
GCS_EXTRA_CONF += osgearth
endif
endif
##############################
@ -510,12 +524,59 @@ config_append:
.PHONY: config_show
config_show:
@cat $(CONFIG_FILE)
@cat $(CONFIG_FILE) | sed 's/override *//'
.PHONY: config_clean
config_clean:
rm -f $(CONFIG_FILE)
.PHONY: config_help
config_help:
@$(ECHO) " The build system has a simple system for persistent configuration"
@$(ECHO)
@$(ECHO) " To set persistent configuration variables you, for example, do:"
@$(ECHO) " $(MAKE) config_new CCACHE=ccache GCS_WITH_OSG=0"
@$(ECHO)
@$(ECHO) " To add to the existing configuration do:"
@$(ECHO) " $(MAKE) config_append GCS_BUILD_CONF=debug"
@$(ECHO)
@$(ECHO) " To reset the configuration to defaults do:"
@$(ECHO) " $(MAKE) config_clean"
@$(ECHO)
@$(ECHO) " To show the current configuration:"
@$(ECHO) " $(MAKE) config_show"
@$(ECHO)
@$(ECHO) " You can override any make variable this way, but these are the useful ones"
@$(ECHO) " shown with their current (or default values):"
@$(ECHO)
@$(ECHO) " GCS_BUILD_CONF=$(GCS_BUILD_CONF)"
@$(ECHO) " GCS build type"
@$(ECHO) " Options: debug or release"
@$(ECHO)
@$(ECHO) " GCS_WITH_OSG=$(GCS_WITH_OSG)"
@$(ECHO) " Build the GCS with OpenSceneGraph support, this enables the PFD Model View"
@$(ECHO) " Options: 0 or 1"
@$(ECHO)
@$(ECHO) " GCS_WITH_OSGEARTH=$(GCS_WITH_OSGEARTH)"
@$(ECHO) " Build the GCS with osgEarth support, this enables extra PFD terrain views"
@$(ECHO) " Options: 0 or 1"
@$(ECHO)
@$(ECHO) " GCS_COPY_OSG=$(GCS_COPY_OSG)"
@$(ECHO) " Copy OpenSceneGraph/osgEarth libraries into the build"
@$(ECHO) " (Needed unless using system versions)"
@$(ECHO) " Options: 0 or 1"
@$(ECHO)
@$(ECHO) " CCACHE=$(CCACHE)"
@$(ECHO) " A prefix to compiler invocations, usually 'ccache' or 'path/to/ccache'"
@$(ECHO)
@$(ECHO) " QMAKE=$(QMAKE)"
@$(ECHO) " How to invoke qmake, usually 'qmake', 'qmake-qt5' or 'path/to/qmake'"
@$(ECHO)
@$(ECHO) " WITH_PREBUILT_FIRMWARE=$(WITH_PREBUILT_FIRMWARE)"
@$(ECHO) " Set to path of prebuilt firmware or empty to build firmware when needed"
# TODO: add other things like downloads and tools directories, linux make install parameters
##############################
#
@ -669,6 +730,7 @@ help:
@$(ECHO) " docs_all_clean - Delete all generated documentation"
@$(ECHO)
@$(ECHO) " [Configuration]"
@$(ECHO) " config_help - Show information on how to configure the build"
@$(ECHO) " config_new - Place your make arguments in the config file"
@$(ECHO) " config_append - Place your make arguments in the config file but append"
@$(ECHO) " config_clean - Removes the config file"

View File

@ -5,8 +5,7 @@ pipelines:
- add-apt-repository ppa:librepilot/tools -y
- apt-get update -q
- apt-get install -y libc6-i386 libudev-dev libusb-1.0-0-dev libsdl1.2-dev python libopenscenegraph-dev libosgearth-dev qt56-meta-minimal qt56svg qt56script qt56serialport qt56multimedia qt56translations qt56tools
- make arm_sdk_install
- make config_new GCS_EXTRA_CONF='osg osgearth'
- make build_sdk_install
- make all_flight
- make opfw_resource
- make gcs

View File

@ -165,7 +165,8 @@ endif
BUILD_SDK_TARGETS := arm_sdk
ifeq ($(UNAME), Windows)
BUILD_SDK_TARGETS += nsis mesawin
else
endif
ifeq ($(UNAME), Darwin)
BUILD_SDK_TARGETS += qt_sdk osg
endif
ALL_SDK_TARGETS := $(BUILD_SDK_TARGETS) gtest uncrustify doxygen
@ -829,7 +830,7 @@ ifeq ($(shell [ -d "$(OSG_SDK_DIR)" ] && $(ECHO) "exists"), exists)
export OSG_SDK_DIR := $(OSG_SDK_DIR)
else
# not installed, hope it's in the path...
$(info $(EMPTY) WARNING $(call toprel, $(OSG_SDK_DIR)) not found (make osg_install), using system PATH)
# $(info $(EMPTY) WARNING $(call toprel, $(OSG_SDK_DIR)) not found (make osg_install), using system PATH)
endif
.PHONY: osg_version
@ -852,7 +853,7 @@ ifeq ($(shell [ -d "$(OSGEARTH_SDK_DIR)" ] && $(ECHO) "exists"), exists)
export OSGEARTH_SDK_DIR := $(OSGEARTH_SDK_DIR)
else
# not installed, hope it's in the path...
$(info $(EMPTY) WARNING $(call toprel, $(OSGEARTH_SDK_DIR)) not found (make osgearth_install), using system PATH)
# $(info $(EMPTY) WARNING $(call toprel, $(OSGEARTH_SDK_DIR)) not found (make osgearth_install), using system PATH)
endif
.PHONY: osgearth_version

View File

@ -12,7 +12,7 @@ export DH_OPTIONS
dh $@
override_dh_auto_configure:
$(MAKE) config_new GCS_EXTRA_CONF='osg osgearth' WITH_PREBUILT_FW=$(CURDIR)/firmware
$(MAKE) config_new WITH_PREBUILT_FW=$(CURDIR)/firmware
override_dh_auto_build:
dh_auto_build -- opfw_resource gcs

View File

@ -25,7 +25,7 @@ BuildRequires: qt5-qtsvg-devel
BuildRequires: qt5-qttools-devel
BuildRequires: qt5-qttranslations
BuildRequires: OpenSceneGraph-devel
%{!?fc22:BuildRequires: osgearth-devel}
BuildRequires: osgearth-devel
BuildRequires: dwz
BuildRequires: pkgconfig
BuildRequires: python
@ -41,7 +41,7 @@ Requires: qt5-qtscript
Requires: qt5-qtserialport
Requires: qt5-qtsvg
Requires: OpenSceneGraph-libs
%{!?fc22:Requires: osgearth}
Requires: osgearth
%description
@ -59,8 +59,7 @@ make config_new \
prefix=%{_prefix} \
QMAKE=qmake-qt5 \
udevrulesdir=%{_udevrulesdir} \
WITH_PREBUILT_FW=$(pwd)/build/firmware \
GCS_EXTRA_CONF='osg%{!?fc22: osgearth}'
WITH_PREBUILT_FW=$(pwd)/build/firmware
make %{?_smp_mflags} opfw_resource gcs