Mercurial > hg > toybox
comparison scripts/genconfig.sh @ 860:a612857eb52d
Make genconfig use CFLAGS because building against a libc that isn't installed on the host may need --static to run the results.
author | Rob Landley <rob@landley.net> |
---|---|
date | Tue, 16 Apr 2013 22:45:47 -0500 |
parents | 52e69f6710ca |
children | 565980862743 |
comparison
equal
deleted
inserted
replaced
859:4edd1cb3f700 | 860:a612857eb52d |
---|---|
10 probeconfig() | 10 probeconfig() |
11 { | 11 { |
12 # Probe for container support on target | 12 # Probe for container support on target |
13 | 13 |
14 echo -e "# container support\nconfig TOYBOX_CONTAINER\n\tbool" || return 1 | 14 echo -e "# container support\nconfig TOYBOX_CONTAINER\n\tbool" || return 1 |
15 ${CROSS_COMPILE}${CC} -xc -o /dev/null - 2>/dev/null << EOF | 15 ${CROSS_COMPILE}${CC} $CFLAGS -xc -o /dev/null - 2>/dev/null << EOF |
16 #include <linux/sched.h> | 16 #include <linux/sched.h> |
17 int x=CLONE_NEWNS|CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWNET; | 17 int x=CLONE_NEWNS|CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWNET; |
18 | 18 |
19 int main(int argc, char *argv[]) { return unshare(x); } | 19 int main(int argc, char *argv[]) { return unshare(x); } |
20 EOF | 20 EOF |
49 done | 49 done |
50 } | 50 } |
51 | 51 |
52 headerprobes() | 52 headerprobes() |
53 { | 53 { |
54 ${CROSS_COMPILE}${CC} -xc -o /dev/null - 2>/dev/null << EOF | 54 ${CROSS_COMPILE}${CC} $CFLAGS -xc -o /dev/null - 2>/dev/null << EOF |
55 #include <fcntl.h> | 55 #include <fcntl.h> |
56 #ifndef O_NOFOLLOW | 56 #ifndef O_NOFOLLOW |
57 #error posix 2008 was a while ago now | 57 #error posix 2008 was a while ago now |
58 #endif | 58 #endif |
59 EOF | 59 EOF |
60 if [ $? -ne 0 ] | 60 if [ $? -ne 0 ] |
61 then | 61 then |
62 rm -f a.out | 62 rm -f a.out |
63 ${CROSS_COMPILE}${CC} -xc - 2>/dev/null << EOF | 63 ${CROSS_COMPILE}${CC} $CFLAGS -xc - 2>/dev/null << EOF |
64 #include <stdio.h> | 64 #include <stdio.h> |
65 #include <sys/types.h> | 65 #include <sys/types.h> |
66 #include <asm/fcntl.h> | 66 #include <asm/fcntl.h> |
67 | 67 |
68 int main(int argc, char *argv[]) | 68 int main(int argc, char *argv[]) |