File: build-cpp

package info (click to toggle)
srt 1.5.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,804 kB
  • sloc: cpp: 52,175; ansic: 5,746; tcl: 1,183; sh: 318; python: 99; makefile: 38
file content (32 lines) | stat: -rwxr-xr-x 856 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash

set -e
set -x

if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
    CROSS_COMPILE=${DEB_HOST_GNU_TYPE}-
else
    CROSS_COMPILE=
fi

IP='127.0.0.1'
PORT='54321'
WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM

PKGCONFIG="$(pkg-config --cflags --libs srt)"
for i in examples/*.cpp; do
    ${CROSS_COMPILE}g++ -pedantic -Wall -Werror -o "$WORKDIR/$(basename $i .cpp)" "$i" $PKGCONFIG -pthread # -pthread only used by sendfile.cpp
done

# sendfile often hangs / dies with an exception, so it does not work reliably enough for autopkgtest
#$WORKDIR/sendfile $PORT > $WORKDIR/sendfile.logs &
#PID=$!
#sleep 2
#$WORKDIR/recvfile $IP $PORT /etc/hosts $WORKDIR/hosts
#sleep 2
#kill -9 $PID || true # ensure sendfile really terminates
#sleep 2
#cat $WORKDIR/sendfile.logs
#diff -u /etc/hosts $WORKDIR/hosts && echo 'no differences found'