1 ------------------------------------------------------------------------
2 AGL-Unicens binding expose Unicens-V2 APIs through AGL framework
3 ------------------------------------------------------------------------
6 AFB_daemon dependency on Standard Linux Distributions
7 -------------------------------------------------------
8 # handle dependencies > (OpenSuse-42.2, Fedora-25, Ubuntu 16.04.2LTS)
10 systemd-devel (libsystemd-dev>=222)
12 file-devel(OpenSuSe) or libmagic-dev(Ubuntu)
15 ElectricFence (BUG should not be mandatory)
16 libopenssl-devel libgcrypt-devel libgnutls-devel (optional but requested by libmicrohttpd for https)
19 zypper in gcc5 gdb gcc5-c++ git cmake make ElectricFence systemd-devel libopenssl-devel libuuid-devel alsa-devel libgcrypt-devel libgnutls-devel libjson-c-devel file-devel mxml-devel
21 Ubuntu >= 16.4 libuuid-devel
22 apt-get install cmake git electric-fence libsystemd-dev libssl-dev uuid-dev libasound2-dev libgcrypt20-dev libgnutls-dev libgnutls-dev libjson-c-dev libmagic-dev libmxml-dev
24 libmicrohttpd>=0.9.54 (as today OpenSuse-42.2 or Ubuntu-.16.4 ship older versions)
25 afb-daemon from AGL Gerrit git clone https://gerrit.automotivelinux.org/gerrit/src/app-framework-binder
28 # Might want to add following variables into ~/.bashrc
29 echo "#---------- AGL options Start ---------" >>~/.bashrc
30 echo "# Object: AGL cmake option for binder/bindings" >>~/.bashrc
31 echo "# Date: `date`" >>~/.bashrc
32 echo 'export CC=gcc-5; export CXX=g++-5' >>~/.bashrc # if using gcc5
33 echo 'export INSTALL_PREFIX=$HOME/opt' >>~/.bashrc
34 echo 'export LD_LIBRARY_PATH=$INSTALL_PREFIX/lib64:$INSTALL_PREFIX/lib' >>~/.bashrc
35 echo 'export LIBRARY_PATH=$INSTALL_PREFIX/lib64:$INSTALL_PREFIX/lib' >>~/.bashrc
36 echo 'export PKG_CONFIG_PATH=$INSTALL_PREFIX/lib64/pkgconfig:$INSTALL_PREFIX/lib/pkgconfig' >>~/.bashrc
37 echo 'export PATH=$INSTALL_PREFIX/bin:$PATH' >>~/.bashrc
38 echo 'export RSYNC_TARGET=MY_TARGET_HOSTNAME' >>~/.bashrc
39 echo 'export RSYNC_PREFIX=./opt' >>~/.bashrc
41 echo "#---------- AGL options End ---------" >>~/.bashrc
44 # install LibMicroHttpd
45 wget https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.54.tar.gz
46 tar -xzf libmicrohttpd-0.9.54.tar.gz
47 cd libmicrohttpd-0.9.54
48 ./configure --prefix=$INSTALL_PREFIX
52 # retrieve last AFB_daemon from AGL
53 git clone https://gerrit.automotivelinux.org/gerrit/src/app-framework-binder
55 # Warning: previous GCC options should be set before initial cmake (clean Build/*)
56 cd app-framework-binder; mkdir -p build; cd build
57 cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX ..
66 source ~/.bashrc # or any other file where your have place your compilation preferences
69 cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX ..
72 afb-daemon --workdir=.. --ldpaths=build --port=1234 --roothttp=./htdocs --token="" --verbose
74 speaker-test -twav -D hw:ep01 -c 2
75 firefox http://localhost:1234
83 PKG_NAME=unicens-agent
84 git archive --format=tar.gz --prefix=${PKG_NAME}-${VERSION}/ ${GIT_TAG} -o ${PKG_NAME}_${VERSION}.orig.tar.gz
87 # Local Source Debug with GDB
89 Warning: technically AGL bindings are shared libraries loaded thought 'dlopen'. GDB supports source debug of dynamically
90 loaded libraries, but user should be warn that the actual path to sharelib symbols is directly inherited from DLOPEN.
91 As a result if you change your directory after binder start with --workdir=xxx then GDB will not find symbols anymore
97 # WORK when running in direct
98 afb-daemon --workdir=.. --ldpaths=build --port=1234 --roothttp=./htdocs
100 # FAIL when using GDB with warning: Could not load shared library ....
101 gdb -args afb-daemon --workdir=.. --ldpaths=build --port=1234 --roothttp=./htdocs
103 warning: Could not load shared library symbols for ./build/ucs2-afb/afb-ucs2.so.
104 Do you need "set solib-search-path" or "set sysroot"?
108 To debug sharelib symbol path: start your binder under GDB. Then break your session after the binder has
109 loaded its bindings. Finally use "info sharedlibrary" and check 'SymsRead'. If equal to 'No' then either you start GDB
110 from the wrong relative directory, either you have to use 'set solib-search-path' to force the path.
113 gdb -args afb-daemon --workdir=.. --ldpaths=build --port=1234 --roothttp=./htdocs
116 NOTICE: API unicens added
117 NOTICE: Waiting port=1234 rootdir=.
118 NOTICE: Browser URL= http://localhost:1234
119 (hit Ctrl-C to break the execution)
120 info sharedlibrary afb-*
124 # Running an debugging on a target
127 export RSYNC_TARGET=root@xx.xx.xx.xx
128 export RSYNC_PREFIX=/opt # WARNING: installation directory should exist
133 cmake -DRSYNC_TARGET=$RSYNC_TARGET -DRSYNC_PREFIX=$RSYNC_PREFIX ..
134 make remote-target-populate
136 ./build/target/start-${RSYNC_TARGET}.sh
137 firefox http://localhost:1234 # WARNING: do not forget firewall if any
139 ssh -tt ${RSYNC_TARGET} speaker-test -twav -D hw:ep01 -c 2
142 Note: remote-target-populate will
143 - create a script to remotely start the binder on the target in ./build/target/start-on-target-name.sh
144 - create a gdbinit file to transparently debug remotely in source code with gdb -x ./build/target/gdb-on-target-name.ini
145 - to run and debug directly from your IDE just configure the run and debug properties with the corresponding filename
147 Note that Netbeans impose to set debug directory to ./build/pkgout or it won't find binding symbols for source debugging