#!/bin/sh set -e WORKDIR=`mktemp -d` trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM cd $WORKDIR cat <buildtest.c #include #include #include 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