diff options
author | <philippe colliot> | 2015-06-12 18:14:07 +0200 |
---|---|---|
committer | <philippe colliot> | 2015-06-12 18:14:07 +0200 |
commit | 03e58571d8f9e24eac7019fbe9ccac5975fe2826 (patch) | |
tree | 2a28850c6df834ddb9d22f04fab5d84e6217b4b3 /src/script | |
parent | 2124036ef91b534a94bf6b98105394739b3cc96f (diff) | |
download | navigation-03e58571d8f9e24eac7019fbe9ccac5975fe2826.tar.gz |
migration to cmake achieved
Diffstat (limited to 'src/script')
-rwxr-xr-x | src/script/build.sh | 165 | ||||
-rw-r--r-- | src/script/fsa-config.sh | 89 | ||||
-rwxr-xr-x | src/script/get-apt-packets.sh | 10 | ||||
-rwxr-xr-x | src/script/run | 297 |
4 files changed, 0 insertions, 561 deletions
diff --git a/src/script/build.sh b/src/script/build.sh deleted file mode 100755 index 8912b26..0000000 --- a/src/script/build.sh +++ /dev/null @@ -1,165 +0,0 @@ -#!/bin/bash - -########################################################################### -# @licence app begin@ -# SPDX-License-Identifier: MPL-2.0 -# -# Component Name: fuel stop advisor application -# Author: Philippe Colliot <philippe.colliot@mpsa.com> -# -# Copyright (C) 2013-2014, PCA Peugeot Citroen -# -# License: -# This Source Code Form is subject to the terms of the -# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with -# this file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# @licence end@ -########################################################################### -TOP_DIR=$PWD/.. -TOP_BIN_DIR=$TOP_DIR/../bin - -#include common settings -source fsa-config.sh - -# by default no ilm -lm=0 - -# by default no debug -dbg=0 - - -#-------------------------------------------------------------------------- -# Compiler Flags -#-------------------------------------------------------------------------- -# modify the following flags as needed: -#-------------------------------------------------------------------------- - -usage() { - echo "Usage: ./build.sh [command]" - echo - echo "command:" - echo " make Build" - echo " makelm Build with layer manager" - echo " maked Build in debug mode" - echo " clean Clean the bin" - echo " src-clean Clean the cloned sources and the bin" - echo " clone Clone the sources" - echo " help Print Help" - echo - echo -} - -clone() { - echo '' - echo 'Clone/update version of additional sources if needed' - - cd $TOP_DIR/.. - mkdir -p bin - cd $TOP_BIN_DIR - cmake $TOP_DIR - - cd $TOP_BIN_DIR - mkdir -p $NAVIGATION_SERVICE - cd $NAVIGATION_SERVICE_BUILD_SCRIPT_DIR - # call the bash script of navigation, set the bin dir to navigation-service and tell it where to clone the positioning and the ilm - bash ./build.sh clone $NAVIGATION_SERVICE_BIN_DIR $POSITIONING_SRC_DIR $IVI_LAYER_MANAGER_SRC_DIR -} - -build() { - - echo '' - echo 'Building fuel stop advisor' - - cd $TOP_DIR/.. - mkdir -p bin - - cd $TOP_BIN_DIR - mkdir -p $NAVIGATION_SERVICE - - # Build the navigation service (including DBus files generation) - cd $NAVIGATION_SERVICE_BUILD_SCRIPT_DIR - if [ $lm -eq 0 ]; then - if [ $dbg -eq 0 ]; then - bash ./build.sh make $NAVIGATION_SERVICE_BIN_DIR $POSITIONING_SRC_DIR $IVI_LAYER_MANAGER_SRC_DIR - else - bash ./build.sh maked $NAVIGATION_SERVICE_BIN_DIR $POSITIONING_SRC_DIR $IVI_LAYER_MANAGER_SRC_DIR - fi - else - bash ./build.sh makelm $NAVIGATION_SERVICE_BIN_DIR $POSITIONING_SRC_DIR $IVI_LAYER_MANAGER_SRC_DIR - fi - cd $TOP_BIN_DIR - mkdir -p $FUEL_STOP_ADVISOR - cd $FUEL_STOP_ADVISOR_BIN_DIR - cmake -Dgenerated_api_DIR=$GENERATED_API_DIR $FUEL_STOP_ADVISOR_FLAGS $FUEL_STOP_ADVISOR_SRC_DIR && make - - cd $TOP_BIN_DIR - mkdir -p $AUTOMOTIVE_MESSAGE_BROKER - cd $AUTOMOTIVE_MESSAGE_BROKER_BIN_DIR - cmake $AUTOMOTIVE_MESSAGE_BROKER_SRC_DIR && make - sudo make install - - cd $TOP_BIN_DIR - mkdir -p $LOG_REPLAYER - cd $LOG_REPLAYER_BIN_DIR - cmake $FUEL_STOP_ADVISOR_FLAGS $LOG_REPLAYER_SRC_DIR && make - - cd $TOP_BIN_DIR - mkdir -p $GENIVI_LOGREPLAYER - cd $GENIVI_LOGREPLAYER_BIN_DIR - cmake -Dautomotive-message-broker_SRC=$AUTOMOTIVE_MESSAGE_BROKER_SRC_DIR -Dautomotive-message-broker_BIN=$AUTOMOTIVE_MESSAGE_BROKER_BIN_DIR $GENIVI_LOGREPLAYER_SRC_DIR && make - - cd $TOP_BIN_DIR - mkdir -p $HMI_LAUNCHER - cd $HMI_LAUNCHER_BIN_DIR - cmake -DLM=$lm -Dnavigation-service_API=$NAVIGATION_SERVICE_API_DIR -Dpositioning_API=$ENHANCED_POSITION_SERVICE_API_DIR -Dfuel-stop-advisor_API=$FUEL_STOP_ADVISOR_SRC_DIR $HMI_LAUNCHER_SRC_DIR && make - - cd $TOP_BIN_DIR - mkdir -p $POI_SERVER - cd $POI_SERVER_BIN_DIR - cmake -Dapi_DIR=$NAVIGATION_SERVICE_API_DIR -Dpositioning_API=$ENHANCED_POSITION_SERVICE_API_DIR -Dgenerated_api_DIR=$GENERATED_API_DIR $POI_SERVER_SRC_DIR && make - -} - -clean() { - echo 'delete' $TOP_BIN_DIR - rm -rf $TOP_BIN_DIR -} - -src-clean() { - echo 'delete' $POSITIONING_SRC_DIR - rm -rf $POSITIONING_SRC_DIR - echo 'delete' $NAVIGATION_SERVICE_SRC_DIR - rm -rf $NAVIGATION_SERVICE_SRC_DIR - echo 'delete' $AUTOMOTIVE_MESSAGE_BROKER_SRC_DIR - rm -rf $AUTOMOTIVE_MESSAGE_BROKER_SRC_DIR - clean -} - -if [ $# -ge 1 ]; then - if [ $1 = help ]; then - usage - elif [ $1 = make ]; then - FUEL_STOP_ADVISOR_FLAGS='-DWITH_DEBUG=OFF' - build - elif [ $1 = makelm ]; then - FUEL_STOP_ADVISOR_FLAGS='-DWITH_DEBUG=OFF' - lm=1 - build - elif [ $1 = maked ]; then - FUEL_STOP_ADVISOR_FLAGS='-DWITH_DEBUG=ON' - dbg=1 - build - elif [ $1 = clean ]; then - clean - elif [ $1 = src-clean ]; then - src-clean - elif [ $1 = clone ]; then - clone - else - usage - fi -else - usage -fi - diff --git a/src/script/fsa-config.sh b/src/script/fsa-config.sh deleted file mode 100644 index bdd32b9..0000000 --- a/src/script/fsa-config.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/bash - -########################################################################### -# @licence app begin@ -# SPDX-License-Identifier: MPL-2.0 -# -# Component Name: fuel stop advisor application -# Author: Philippe Colliot <philippe.colliot@mpsa.com> -# -# Copyright (C) 2013-2014, PCA Peugeot Citroen -# -# License: -# This Source Code Form is subject to the terms of the -# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with -# this file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# @licence end@ -########################################################################### - -#settings and path used by the build.sh and run -#these settings are related to TOP_DIR and TOP_BIN_DIR defined into the parent script - -NAVIGATION_SERVICE=navigation -NAVIGATION_SERVICE_SRC_DIR=$TOP_DIR/$NAVIGATION_SERVICE -NAVIGATION_SERVICE_BIN_DIR=$TOP_BIN_DIR/$NAVIGATION_SERVICE -NAVIGATION_SERVICE_API_DIR=$NAVIGATION_SERVICE_SRC_DIR/api -NAVIGATION_SERVICE_BUILD_SCRIPT_DIR=$NAVIGATION_SERVICE_SRC_DIR/src/navigation/script -GENERATED_API_DIR=$NAVIGATION_SERVICE_API_DIR/include - -NAVIT=navit -#the binaries of navit are located into the navigation-service binaries -NAVIT_BIN_DIR=$NAVIGATION_SERVICE_BIN_DIR/navit/navit - -POI_SERVER=poi-server -POI_SERVER_SRC_DIR=$NAVIGATION_SERVICE_SRC_DIR/src/poi-service/$POI_SERVER -POI_SERVER_BIN_DIR=$TOP_BIN_DIR/$POI_SERVER - -FUEL_STOP_ADVISOR=fuel-stop-advisor -FUEL_STOP_ADVISOR_SRC_DIR=$TOP_DIR/$FUEL_STOP_ADVISOR -FUEL_STOP_ADVISOR_BIN_DIR=$TOP_BIN_DIR/$FUEL_STOP_ADVISOR - -POSITIONING=positioning -POSITIONING_SRC_DIR=$TOP_DIR/$POSITIONING -#the binaries of positioning are located into the navigation-service binaries -POSITIONING_BIN_DIR=$NAVIGATION_SERVICE_BIN_DIR/$POSITIONING - -GNSS_SERVICE=gnss-service -GNSS_SERVICE_SRC_DIR=$POSITIONING_SRC_DIR/$GNSS_SERVICE -GNSS_SERVICE_BIN_DIR=$POSITIONING_BIN_DIR/$GNSS_SERVICE - -SENSORS_SERVICE=sensors-service -SENSORS_SERVICE_SRC_DIR=$POSITIONING_SRC_DIR/$SENSORS_SERVICE -SENSORS_SERVICE_BIN_DIR=$POSITIONING_BIN_DIR/$SENSORS_SERVICE - -ENHANCED_POSITION_SERVICE=enhanced-position-service -ENHANCED_POSITION_SERVICE_SRC_DIR=$POSITIONING_SRC_DIR/$ENHANCED_POSITION_SERVICE -ENHANCED_POSITION_SERVICE_BIN_DIR=$POSITIONING_BIN_DIR/$ENHANCED_POSITION_SERVICE -ENHANCED_POSITION_SERVICE_API_DIR=$ENHANCED_POSITION_SERVICE_SRC_DIR/api - -POSITIONING_LOG_REPLAYER=log-replayer -POSITIONING_LOG_REPLAYER_SRC_DIR=$POSITIONING_SRC_DIR/$POSITIONING_LOG_REPLAYER -POSITIONING_LOG_REPLAYER_BIN_DIR=$POSITIONING_BIN_DIR/$POSITIONING_LOG_REPLAYER - -AUTOMOTIVE_MESSAGE_BROKER=automotive-message-broker -AUTOMOTIVE_MESSAGE_BROKER_SRC_DIR=$TOP_DIR/$AUTOMOTIVE_MESSAGE_BROKER -AUTOMOTIVE_MESSAGE_BROKER_BIN_DIR=$TOP_BIN_DIR/$AUTOMOTIVE_MESSAGE_BROKER - -IVI_LAYER_MANAGER=ilm -IVI_LAYER_MANAGER_SRC_DIR=$TOP_DIR/$IVI_LAYER_MANAGER -#the binaries of ilm are located into the navigation-service binaries -IVI_LAYER_MANAGER_BIN_DIR=$NAVIGATION_SERVICE_BIN_DIR/$IVI_LAYER_MANAGER - -LOG_REPLAYER=log-replayer -LOG_REPLAYER_SRC_DIR=$TOP_DIR/$LOG_REPLAYER -LOG_REPLAYER_BIN_DIR=$TOP_BIN_DIR/$LOG_REPLAYER - -GENIVI_LOGREPLAYER=genivilogreplayer -GENIVI_LOGREPLAYER_SRC_DIR=$TOP_DIR/$GENIVI_LOGREPLAYER -GENIVI_LOGREPLAYER_BIN_DIR=$TOP_BIN_DIR/$GENIVI_LOGREPLAYER - -HMI_LAUNCHER=hmi-launcher -HMI_LAUNCHER_SRC_DIR=$TOP_DIR/hmi/qml/$HMI_LAUNCHER -HMI_LAUNCHER_BIN_DIR=$TOP_BIN_DIR/$HMI_LAUNCHER - -HMI_QML_DIR=$TOP_DIR/hmi/qml - -STYLE_SHEETS_GENERATED_INDICATOR=$HMI_QML_DIR/Core/style-sheets/the-style-sheets-have-been-generated-css.js - - diff --git a/src/script/get-apt-packets.sh b/src/script/get-apt-packets.sh deleted file mode 100755 index 812dc57..0000000 --- a/src/script/get-apt-packets.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -sudo apt-get install \ -git subversion build-essential cmake xsltproc moc \ -libdbus-c++-dev libdbus-1-dev libdbus-c++-bin libsqlite3-dev sqlite3 \ -libboost-dev libjson0-dev libtool uuid-dev \ -glibmm-2.4 \ -qtdeclarative5-dev qtdeclarative5-quicklayouts-plugin qtdeclarative5-dialogs-plugin qtdeclarative5-controls-plugin qtdeclarative5-qtquick2-plugin qtdeclarative5-window-plugin libqt5declarative5 \ -libglib2.0-dev - - diff --git a/src/script/run b/src/script/run deleted file mode 100755 index 9d55331..0000000 --- a/src/script/run +++ /dev/null @@ -1,297 +0,0 @@ -#! /bin/bash -########################################################################### -# @licence app begin@ -# SPDX-License-Identifier: MPL-2.0 -# -# \copyright Copyright (C) 2013-2014, PCA Peugeot Citroen -# -# \file run -# -# \brief This file is part of the Build System. -# -# \author # Author: Martin Schaller <martin.schaller@it-schaller.de> -# -# \version 1.0 -# -# This Source Code Form is subject to the terms of the -# Mozilla Public License (MPL), v. 2.0. -# If a copy of the MPL was not distributed with this file, -# You can obtain one at http://mozilla.org/MPL/2.0/. -# -# For further information see http://www.genivi.org/. -# -# List of changes: -# -# 5-8-2014, Philippe Colliot, Refine, add a sleep and improve comments -# 30-9-2014, Philippe Colliot, Make it simpler and add a check for availability of hmi style-sheets -# -# @licence end@ -########################################################################### - -TOP_DIR=$PWD/.. -TOP_BIN_DIR=$TOP_DIR/../bin -SCRIPT_DIR=$PWD - - -#include common settings -source fsa-config.sh - -# function to start a process by freezing some of the options -function run -{ - local x=$xterm - local g=$gdb - local l=$log - local title="$1" - shift - if [ "$1" = "-n" ] - then - shift - x=0 - log=0 - fi - if [ "$1" = -"g" ] - then - shift - g=0 - fi - if [ "$x" = 1 ] - then - if [ "$g" = 1 ] - then - set -- gdb -ex run --args "$@" - fi - xterm -T "$title" -sb -sl 5000 -e "$@" & - elif [ "$log" = 1 ] - then - "$@" >"$CUR_DIR/$title.log" 2>&1 & - else - "$@" & - fi - PIDS="$PIDS $!" -} - -# function to wait for the dbus service to be started, exit if too long -function wait_for_service -{ - for i in $(seq 1 50) - do - if dbus-send --dest=$1 $2 org.freedesktop.DBus.Introspectable.Introspect - then - return - fi - echo "Waiting for $1" - sleep 0.1 - done - exit 1 -} - -# function to catch the ctrl C or exit and to stop cleanly -function terminate -{ - set +e - trap "" EXIT INT - kill $PIDS 2>/dev/null - if [ "$gdb" = 1 ] - then - kill -9 $PIDS 2>/dev/null - fi - if [ -n "$wm" ] - then - sleep 2 - cd - nohup $wm >/dev/null 2>/dev/null & - fi -} - -# default settings -gdb=0 #no debug -xterm=0 #no subprocess into a separate xterm -log=0 #no log file -enhpos=1 #enhanced position server enabled -replayer=1 #replayer enabled -lm=0 #layer manager disabled -wm="" #to store the current window manager (in case of start with the layer manager) -verbose=0 #no debug or log messages displayed -center="4612 N 0608 E" - -# hmi panel launched -app=$HMI_QML_DIR/application.qml - -while getopts a:c:glnorvx opt -do - case $opt in - a) #select another hmi panel - app=$OPTARG - ;; - c) #set the map center - case "$OPTARG" in - paris) - center="2.34 48.86" - ;; - tokyo) - center="139.74 35.70" - ;; - [0-9-]*) - center=$OPTARG - ;; - *) - echo "Unsupported center $OPTARG" >&2 - exit 1 - ;; - esac - ;; - g) #enable the debugger - gdb=1 - ;; - l) #enable the layer manager - lm=1 - ;; - n) #disable the enhanced position server - enhpos=0 - ;; - o) #enable the log file - log=1 - ;; - r) #disable the log replayer - replayer=0 - ;; - v) #enable log messages - verbose=1 - ;; - x) #enable subprocess in a separate xterm - xterm=1 - ;; - \?) - echo "Usage:" - echo "$0 [-a application][-c center][-glnoprx]" - echo "-a: Set application (default application.qml)" - echo "-c: Set center (supported values: paris,tokyo,longitude latitude). Default is geneve" - echo "-g: Run subprocesses within gdb (only with -x)" - echo "-l: Use layermanager" - echo "-n: Don't start enhanced positioning service" - echo "-o: Create log file of subprocess output" - echo "-r: Don't start replayer" - echo "-v: Enable the output of log or debug messages" - echo "-x: Run subprocesses in own xterm to get separated log messages (doesn't make sense with -l)" - exit 1 - esac -done - -# check if style sheets have been generated -if [ ! -f $STYLE_SHEETS_GENERATED_INDICATOR ] -then - echo "Please generate the style sheets before" - ./prepare.sh -h - exit 1 -fi - -REPLAYER_LOG_FILE=none -export REPLAYER_LOG_FILE - -# initialization for the layer manager -if [ "$lm" = "1" ] -then - # D-Bus setup - #eval `dbus-launch --sh-syntax` - export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket - #export DBUS_SESSION_BUS_PID=335 - #export DBUS_SESSION_BUS_PID=185 - - export XDG_RUNTIME_DIR=/var/run/user/5000 - - # Platform is wayland of drm-backend - export QT_QPA_PLATFORM=wayland - - # Create Window OpenGL (Default gtk_drawing_area) - export NAVIT_GRAPHICS=opengl - - # Graphics OpenGL Platfrom - export NAVIT_PLATFORM=wayland - - # ILM library path(for hmi-launcher& genivi_mapviewer_mapviewercontrol.cxx) - #export LD_LIBRARY_PATH=/home/user/usrfs/lib:$LD_LIBRARY_PATH - - # Create Layer(layer of navigation-application) - #export PATH=/home/user/usrfs/bin:$PATH - LAYER=2000 - LayerManagerControl create layer $LAYER 800 480 - LayerManagerControl set layer $LAYER source region 0 0 800 480 - LayerManagerControl set layer $LAYER destination region 0 0 800 480 - LayerManagerControl set layer $LAYER visibility 1 - LayerManagerControl set screen 0 render order $LAYER -fi - -export | egrep " LM_PLUGIN_PATH=|LM_USE_SESSION_BUS=| DBUS_SESSION_BUS_ADDRESS=| LD_LIBRARY_PATH=| PATH=| DISPLAY=" >env.sh - -trap "terminate" EXIT INT -set -e #exit on error now - -# start the automotive message broker and wait for dbus service -cd $AUTOMOTIVE_MESSAGE_BROKER_BIN_DIR -if [ "$verbose" = "1" ] -then - run "Automotive Message Broker" ./ambd/ambd --config $GENIVI_LOGREPLAYER_SRC_DIR/logreplayerconfig -else - run "Automotive Message Broker" ./ambd/ambd > /dev/null 2>&1 --config $GENIVI_LOGREPLAYER_SRC_DIR/logreplayerconfig -fi -wait_for_service org.automotive.message.broker / - -# start the poi server and wait for dbus service -run "POI service" $POI_SERVER_BIN_DIR/$POI_SERVER -f $SCRIPT_DIR/empty.db -wait_for_service org.genivi.poiservice.POISearch /org/genivi/poiservice/POISearch - -if [ "$enhpos" = 1 ] -then # start the enhanced position service - run "EnhancedPositionService" $ENHANCED_POSITION_SERVICE_BIN_DIR/src/$ENHANCED_POSITION_SERVICE - wait_for_service org.genivi.positioning.EnhancedPosition /org/genivi/positioning/EnhancedPosition -fi - -# start the two instances of navit with plugins (one for navigation core and another one for map viewer) -cd $NAVIT_BIN_DIR ->bookmark.txt -echo "$center" >center.txt -run "MapViewer" ./$NAVIT navit_genivi_mapviewer.xml - -wait_for_service org.genivi.mapviewer.Configuration /org/genivi/mapviewer -wait_for_service org.genivi.mapviewer.MapViewerControl /org/genivi/mapviewer -wait_for_service org.genivi.mapviewer.Session /org/genivi/mapviewer - -run "NavigationCore" ./$NAVIT navit_genivi_navigationcore.xml -wait_for_service org.genivi.navigationcore.Configuration /org/genivi/navigationcore -wait_for_service org.genivi.navigationcore.Guidance /org/genivi/navigationcore -wait_for_service org.genivi.navigationcore.LocationInput /org/genivi/navigationcore -wait_for_service org.genivi.navigationcore.MapMatchedPosition /org/genivi/navigationcore -wait_for_service org.genivi.navigationcore.Routing /org/genivi/navigationcore -wait_for_service org.genivi.navigationcore.Session /org/genivi/navigationcore - -if [ "$replayer" = 1 ] -then # start the log replayer (of the fsa) with a sample log file - run "Log Replayer" $LOG_REPLAYER_BIN_DIR/src/$LOG_REPLAYER $POSITIONING_LOG_REPLAYER_SRC_DIR/logs/geneve-cologny.log -fi - -sleep 3 # need a sleep here (to be improved) -# start the fuel stop advisor application -run "Fuel Stop Advisor" $FUEL_STOP_ADVISOR_BIN_DIR/$FUEL_STOP_ADVISOR - -# log trace into a file -if [ "$log" = 1 ] -then - exec >$CUR_DIR/fsa.log - exec 2>&1 -fi - -if [ "$lm" = 1 ] -then # start the hmi into the layer manager - # wait for launch hmi-launcher - sleep 5 - #SURFACE=`pgrep -f hmi-launcher` - SURFACE=2002 - if [ -n $SURFACE ]; then - LayerManagerControl set surface $SURFACE visibility 1 - LayerManagerControl set layer $LAYER render order $SURFACE - fi -else # start the hmi - $HMI_LAUNCHER_BIN_DIR/$HMI_LAUNCHER $app -fi - |