File: build

package info (click to toggle)
libdatrie 0.2.13-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,156 kB
  • sloc: sh: 4,331; ansic: 4,282; makefile: 204
file content (34 lines) | stat: -rwxr-xr-x 710 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
#!/bin/sh
# autopkgtest check: Build and run a program against libdatrie, to verify that
# the headers and pkg-config file are installed correctly

set -e

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

int main (int argc, char *argv[])
{
  AlphaMap* m = alpha_map_new();
  assert (m != 0);
  assert (alpha_map_add_range (m, 0x0061, 0x007a) == 0);

  Trie* t = trie_new (m);
  assert (t != 0);

  alpha_map_free (m);
  trie_free (t);

  return 0;
}
EOF

gcc -o libdatrietest libdatrietest.c $(pkg-config --cflags --libs datrie-0.2)
echo "build: OK"
[ -x libdatrietest ]
./libdatrietest
echo "run: OK"