#!/bin/sh found=false printf >&2 "Checking for old/new clone mechanics... " cat > dummy.c < int clone(int (*fn)(void *), void *child_stack, int flags, void *arg, ...) { return 0; } EOF if ${CC} -c -o dummy.o dummy.c >/dev/null 2>&1; then rm -f dummy.c dummy.o echo >&2 "New clone." echo "linux/newclone" found=true fi cat > dummy.c < int clone(int (*fn)(void *), void *child_stack, int flags, void *arg) { return 0; } EOF if ! $found && ${CC} -c -o dummy.o dummy.c >/dev/null 2>&1; then rm -f dummy.c dummy.o echo >&2 "Old clone." echo "linux/oldclone" found=true fi rm -f dummy.c dummy.o if ! $found; then echo >&2 "Can't tell, omitting clone(2) support." fi if $port_xattr; then cat > dummy.c < #include #include int i; EOF if ! ${CC} -c -o dummy.o dummy.c >/dev/null 2>&1; then echo >&2 "Warning: Can't compile trivial program using ". echo >&2 " xattr support will require that header." fi echo "linux/xattr" else echo "linux/noxattr" fi rm -f dummy.c dummy.o cat > dummy.c < int i; EOF if ! ${CC} -c -o dummy.o dummy.c >/dev/null 2>&1; then echo >&2 "Warning: Can't compile trivial program using ". echo >&2 " xattr support will require that header." else echo "linux/statvfs" fi rm -f dummy.c dummy.o # For statx, we want a pseudo which can work with OE's uninative, i.e. build on a system without # statx but work on one with it. We have a header in nostatx to allow this. cat > dummy.c < struct statx x; EOF if ${CC} -c -o dummy.o dummy.c >/dev/null 2>&1; then echo "linux/statx" else echo "linux/nostatx" echo "linux/statx" fi rm -f dummy.c dummy.o