diff options
Diffstat (limited to 'ports/linux/subports')
-rw-r--r-- | ports/linux/subports | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ports/linux/subports b/ports/linux/subports new file mode 100644 index 0000000..02a4688 --- /dev/null +++ b/ports/linux/subports @@ -0,0 +1,27 @@ +#!/bin/sh +found=false +printf >&2 "Checking for old/new clone mechanics..." +cat > dummy.c <<EOF +#include <sched.h> +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 <<EOF +#include <sched.h> +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 |