Mercurial > hg > toybox
comparison scripts/genconfig.sh @ 813:52e69f6710ca 0.4.4
Compile time probe to fish O_NOFOLLOW out of linux headers when fcntl doesn't conform to posix-2008.
author | Rob Landley <rob@landley.net> |
---|---|
date | Mon, 11 Mar 2013 22:23:46 -0500 |
parents | 68d6c1ce7bba |
children | a612857eb52d |
comparison
equal
deleted
inserted
replaced
812:5a2b83a92521 | 813:52e69f6710ca |
---|---|
47 | 47 |
48 echo endmenu | 48 echo endmenu |
49 done | 49 done |
50 } | 50 } |
51 | 51 |
52 headerprobes() | |
53 { | |
54 ${CROSS_COMPILE}${CC} -xc -o /dev/null - 2>/dev/null << EOF | |
55 #include <fcntl.h> | |
56 #ifndef O_NOFOLLOW | |
57 #error posix 2008 was a while ago now | |
58 #endif | |
59 EOF | |
60 if [ $? -ne 0 ] | |
61 then | |
62 rm -f a.out | |
63 ${CROSS_COMPILE}${CC} -xc - 2>/dev/null << EOF | |
64 #include <stdio.h> | |
65 #include <sys/types.h> | |
66 #include <asm/fcntl.h> | |
67 | |
68 int main(int argc, char *argv[]) | |
69 { | |
70 printf("0x%x\n", O_NOFOLLOW); | |
71 } | |
72 EOF | |
73 X=$(./a.out) 2>/dev/null | |
74 rm -f a.out | |
75 echo "#define O_NOFOLLOW ${X:-0}" | |
76 fi | |
77 } | |
78 | |
52 probeconfig > generated/Config.probed || rm generated/Config.probed | 79 probeconfig > generated/Config.probed || rm generated/Config.probed |
53 genconfig > generated/Config.in || rm generated/Config.in | 80 genconfig > generated/Config.in || rm generated/Config.in |
81 headerprobes > generated/portability.h || rm generated/portability.h |