File: build

package info (click to toggle)
libthai 0.1.30-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,280 kB
  • sloc: sh: 5,015; ansic: 4,528; makefile: 288
file content (33 lines) | stat: -rwxr-xr-x 724 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
31
32
33
#!/bin/sh
# autopkgtest check: Build and run a program against libthai, 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

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

cat <<EOF > libthaitest.c
#include <thai/tis.h>
#include <thai/thinp.h>
#include <assert.h>

int main (int argc, char *argv[])
{
  assert (th_isaccept (TIS_KO_KAI, TIS_SARA_AA, ISC_STRICT));
  return 0;
}
EOF

${CROSS_COMPILE}gcc -o libthaitest libthaitest.c $(${CROSS_COMPILE}pkg-config --cflags --libs libthai)
echo "build: OK"
[ -x libthaitest ]
./libthaitest
echo "run: OK"