File: build

package info (click to toggle)
libacpi 0.2-7
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 1,120 kB
  • sloc: ansic: 870; makefile: 83; sh: 19
file content (30 lines) | stat: -rw-r--r-- 589 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
#!/bin/sh
# autopkgtest check: Build and run a program against libacpi, to verify that the
# headers are correctly installed
# (C) 2013 Vibhav Pant
# Author: Vibhav Pant <vibhavp@ubuntu.com>

set -e

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

int main(void)
{
	global_t global;

	check_acpi_support();
	init_acpi_thermal(&global);
	read_acpi_acstate(&global);
	return 0;
}
EOF

gcc -o libacpi_test libacpi_test.c -lacpi -Wall -Werror
echo "build: OK"
[ -x libacpi_test ]
./libacpi_test
echo "run: OK"