File: build

package info (click to toggle)
gconf 3.2.6-8
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 15,128 kB
  • sloc: ansic: 39,709; sh: 11,189; python: 1,107; makefile: 444; xml: 332
file content (28 lines) | stat: -rw-r--r-- 714 bytes parent folder | download | duplicates (5)
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
#!/bin/sh
# autopkgtest check: Builds a small application against libgconf2, checking
# if it compiles, links and runs successfully.
# Author: Rafał Cieślak <rafalcieslak256@ubuntu.com>

set -e

WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
cat <<EOF > build_test.c
#include <gconf/gconf-client.h>
#include <glib-object.h>
int main(int argc, char** argv) {
#if !defined(GLIB_VERSION_2_36)
    g_type_init();
#endif
    GConfClient* client = gconf_client_get_default();
    if (!client) return 1;
    return 0;
}
EOF

gcc -o build_test build_test.c -Wall -Werror `pkg-config --libs --cflags gobject-2.0 gconf-2.0`
echo "build: OK"
[ -x build_test ]
./build_test
echo "run: OK"