File: build

package info (click to toggle)
libchewing 0.10.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,040 kB
  • sloc: ansic: 7,031; python: 190; sh: 127; makefile: 44
file content (36 lines) | stat: -rwxr-xr-x 629 bytes parent folder | download | duplicates (6)
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
#!/bin/sh
set -e

WORKDIR=`mktemp -d`
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
cat <<EOF >buildtest.c
#include <stdarg.h>
#include <stdio.h>

#include <chewing.h>

void logger(void *data, int level, const char *fmt, ...)
{
    va_list ap;

    va_start(ap, fmt);
    vprintf(fmt, ap);
    va_end(ap);
}

int main()
{
    ChewingContext *ctx;
    ctx = chewing_new2(NULL, NULL, logger, NULL);
    if (!ctx) {
        fprintf(stderr, "chewing_new() fails.\n");
        return -1;
    };
    chewing_delete(ctx);
    return 0;
}
EOF

gcc -o buildtest buildtest.c `pkg-config --cflags --libs chewing`
./buildtest