| 1 | #!/bin/sh |
| 2 | |
| 3 | set -e |
| 4 | exec 2>&1 |
| 5 | set -u |
| 6 | |
| 7 | cd "$AUTOPKGTEST_TMP" |
| 8 | |
| 9 | if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then |
| 10 | CROSS_COMPILE="$DEB_HOST_GNU_TYPE-" |
| 11 | else |
| 12 | CROSS_COMPILE= |
| 13 | fi |
| 14 | |
| 15 | echo "1..1" |
| 16 | |
| 17 | cat > simple.c <<'EOF' |
| 18 | #include <glib-object.h> |
| 19 | #include <librsvg/rsvg.h> |
| 20 | |
| 21 | int main (void) |
| 22 | { |
| 23 | RsvgHandle *handle; |
| 24 | |
| 25 | handle = rsvg_handle_new (); |
| 26 | g_object_unref (handle); |
| 27 | |
| 28 | g_print ("ok 1\n"); |
| 29 | return 0; |
| 30 | } |
| 31 | EOF |
| 32 | |
| 33 | # Deliberately word-splitting, that's how pkg-config works: |
| 34 | # shellcheck disable=SC2046 |
| 35 | "${CROSS_COMPILE}gcc" -o simple simple.c $("${CROSS_COMPILE}pkg-config" --cflags --libs librsvg-2.0 gobject-2.0) |
| 36 | test -x simple |
| 37 | ./simple |
| 38 | echo "# everything seems OK" |