🔒 Repository is read-only – file editing is disabled.

PaganLinux/tmp-gir-test.sh main

12 linii Raw ← Powrót
123456789101112
#!/bin/bash
set +e
cd /tmp
rm -rf girtest && mkdir girtest && cd girtest
printf '#include <glib-object.h>\nvoid foo(void);\n' > t.c
printf 'void foo(void) {}\n' > t2.c
gcc -c t.c -o t.o -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include $(pkg-config --cflags gobject-2.0 2>/dev/null)
gcc -shared t2.c -o libt.so -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include $(pkg-config --cflags gobject-2.0 2>/dev/null) -lgobject-2.0 -lglib-2.0
echo "=== scanner run ==="
g-ir-scanner --no-libtool --namespace=T --nsversion=1.0 --output /tmp/t.gir --library t --library-path . t.c 2>&1 | tail -8
echo "RC=$?"
ls -la /tmp/t.gir 2>/dev/null