define __KERNEL_STRICT_NAMES to avoid inclusion of kernel types on systems that carry...
[cake.git] / tools / adflib / myconf
blob1b2c35e9cffe1bd3e85254b6cea0e3ac7cc09c57
1 #!/bin/sh
3 cat >myctest.c <<END
5 #include<stdio.h>
7 union u{
8 long l;
9 char c[4];
14 int main(int argc, char *argv[])
16 union u val;
18 printf("%d ",sizeof(long));
19 printf("%d ",sizeof(short));
20 printf("%d ",sizeof(int));
22 val.l=1L;
23 if (val.c[3]==1)
24 puts("BIG");
25 else
26 puts("LITTLE");
29 END
31 gcc myctest.c -o myctest
32 rm myctest.c
34 if [ `./myctest |cut -d' ' -f 1` != 4 ]
35 then echo "Error : sizeof(long)!=4"
37 if [ `./myctest |cut -d' ' -f 2` != 2 ]
38 then echo "Error : sizeof(short)!=2"
40 if [ `./myctest |cut -d' ' -f 3` != 4 ]
41 then echo "Error :sizeof(int)!=4"
44 if [ `./myctest |cut -d' ' -f 4` = LITTLE ]
45 then
46 echo "#ifndef LITT_ENDIAN" >defendian.h
47 echo "#define LITT_ENDIAN 1" >>defendian.h
48 echo "#endif /* LITT_ENDIAN */" >>defendian.h
49 echo Little Endian machine detected
50 else
51 echo "#ifndef LITT_ENDIAN" >defendian.h
52 echo "#endif /* LITT_ENDIAN */" >>defendian.h
53 echo Big Endian machine detected
56 rm myctest