aboutsummaryrefslogtreecommitdiffstats
path: root/ports/linux/subports
blob: 94d43e71b5f0598871560c592b4131087c9f5299 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/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

if	$port_xattr; then
	echo "linux/xattr"
else
	echo "linux/noxattr"
fi