typo
[AROS.git] / tools / copytoafs / myconf.aros
blob98743632136432cbf38232ab17bc9440b3ef54b0
1 #! /bin/sh
3 TOP=$1
5 cat >$TOP/myctest.c <<END
7 #include<stdio.h>
9 union u{
10 long l;
11 char c[4];
16 int main(int argc, char *argv[])
18 union u val;
20 printf("%d ",sizeof(long));
21 printf("%d ",sizeof(short));
22 printf("%d ",sizeof(int));
24 val.l=1L;
25 if (val.c[3]==1)
26 puts("BIG");
27 else
28 puts("LITTLE");
31 END
33 gcc $TOP/myctest.c -o $TOP/myctest
35 if [ `$TOP/myctest |cut -d' ' -f 1` != 4 ]
36 then echo "#error sizeof(long)!=4"
38 if [ `$TOP/myctest |cut -d' ' -f 2` != 2 ]
39 then echo "#error sizeof(short)!=2"
41 if [ `$TOP/myctest |cut -d' ' -f 3` != 4 ]
42 then echo "#error sizeof(int)!=4"
45 if [ `$TOP/myctest |cut -d' ' -f 4` = LITTLE ]
46 then
47 echo "#ifndef LITT_ENDIAN"
48 echo "#define LITT_ENDIAN 1"
49 echo "#endif /* LITT_ENDIAN */"
50 else
51 echo "#ifndef LITT_ENDIAN"
52 echo "#endif /* LITT_ENDIAN */"
55 rm $TOP/myctest*