File: build

package info (click to toggle)
dbus 1.16.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,048 kB
  • sloc: ansic: 106,015; xml: 9,270; sh: 1,967; python: 242; makefile: 230; cpp: 27
file content (52 lines) | stat: -rwxr-xr-x 995 bytes parent folder | download | duplicates (2)
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
#!/bin/sh

set -e
exec 2>&1
set -u

if [ -z "${HOME-}" ] || ! [ -w "${HOME}" ]; then
    export HOME="${AUTOPKGTEST_TMP}"
fi

cd "$AUTOPKGTEST_TMP"

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

echo "1..1"

cat > connect.c <<'EOF'
#include <stdio.h>

#include <dbus/dbus.h>

int main (void)
{
    DBusError error;
    DBusConnection *connection;

    dbus_error_init(&error);
    connection = dbus_bus_get(DBUS_BUS_SESSION, &error);

    if (connection == NULL) {
        fprintf(stderr, "%s: %s", error.name, error.message);
        dbus_error_free(&error);
        return 1;
    }

    dbus_connection_unref(connection);
    printf ("ok 1\n");
    return 0;
}
EOF

# We don't exercise static linking because libsystemd is not available
# as a static library.

${CROSS_COMPILE}gcc -o connect connect.c $(${CROSS_COMPILE}pkg-config --cflags --libs dbus-1)
test -x connect
dbus-run-session -- ./connect
echo "# everything seems OK"