xref: /OK3568_Linux_fs/buildroot/package/gobject-introspection/g-ir-scanner-qemuwrapper.in (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#!/usr/bin/env sh
2
3GOI_LIBRARY_PATH="${GIR_EXTRA_LIBS_PATH:+${GIR_EXTRA_LIBS_PATH}:}.libs:$(dirname "$0")/../lib:$(dirname "$0")/../../lib"
4
5# Pass -r to qemu-user as to trick glibc into not erroring out if the host kernel
6# is older than the target kernel.
7# Use a modules directory which does not exist so we don't load random things
8# which may then get deleted (or their dependencies) and potentially segfault
9GIO_MODULE_DIR="$(dirname "$0")/../lib/gio/modules-dummy" \
10@QEMU_USER@ -r @TOOLCHAIN_HEADERS_VERSION@ \
11    @QEMU_USERMODE_ARGS@ \
12    -L "$(dirname "$0")/../../" \
13    -E LD_LIBRARY_PATH="${GOI_LIBRARY_PATH}" \
14    "$@"
15
16# shellcheck disable=SC2181
17if [ $? -ne 0 ]; then
18    echo "If the above error message is about missing .so libraries, then setting up GIR_EXTRA_LIBS_PATH in the .mk file should help."
19    # shellcheck disable=SC2016
20    echo 'Typically like this: PKG_MAKE_ENV += GIR_EXTRA_LIBS_PATH="$(@D)/.libs"'
21    exit 1
22fi
23