#!/bin/sh
set -e

echo "=== bstring pkg-config sanity ==="
pkg-config --modversion bstring
pkg-config --cflags bstring
pkg-config --libs bstring

echo "=== compile and link ==="
cd "$AUTOPKGTEST_TMP"
cat > smoke.c << 'EOF'
#include <bstrlib.h>
int main(void) {
    bstring b = bfromcstr("hello");
    if (!b) return 1;
    bdestroy(b);
    return 0;
}
EOF
gcc -o smoke smoke.c $(pkg-config --cflags --libs bstring)
./smoke
echo "bstring smoke test PASS"

