File: build

package info (click to toggle)
libcaca 0.99.beta20-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 5,512 kB
  • sloc: ansic: 25,091; php: 2,763; python: 2,637; cs: 1,213; cpp: 1,127; java: 916; objc: 836; makefile: 543; perl: 505; sh: 472; asm: 297; ruby: 215; xml: 33
file content (70 lines) | stat: -rwxr-xr-x 1,474 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/sh
# autopkgtest check: Build and run a program against libcaca, to verify that
# the headers and pkg-config file are installed correctly
# (C) 2013 Canonical Ltd.
# Author: Vibhav Pant <vibhavp@ubuntu.com>

set -e

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

export TERM=linux

WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
cat <<EOF > caca_test.c
#include <caca.h>
#include <stdio.h>
#include <assert.h>

int main(void)
{
	caca_canvas_t *c;
	printf("Testing libcaca version %s\n", caca_get_version());

	c = caca_create_canvas(20,30);
	assert(c != NULL);

	assert(caca_free_canvas(c) != -1);

	return 0;
}
EOF

${CROSS_COMPILE}gcc -o caca_test caca_test.c `${CROSS_COMPILE}pkg-config --cflags --libs caca` -Wall
echo "build: OK"
[ -x caca_test ]
./caca_test
echo "run: OK"

${CROSS_COMPILE}gcc -o caca_test_legacy caca_test.c `caca-config --cflags --libs` -Wall -Werror
echo "build (legacy caca-config script): OK"
[ -x caca_test_legacy ]
./caca_test_legacy
echo "run: OK"

cat <<EOF > caca_test.cpp
#include <caca++.h>
#include <iostream>

int main(void)
{
	std::cout << "Testing libcaca version " << Caca::getVersion() << std::endl;

	Canvas c;
	c.Clear();

	return 0;
}
EOF

${CROSS_COMPILE}g++ -o caca_test_cpp caca_test.cpp `${CROSS_COMPILE}pkg-config --cflags --libs caca++` -Wall
echo "build C++: OK"
[ -x caca_test_cpp ]
./caca_test_cpp
echo "run C++: OK"