5 cat >$TOP/myctest.c
<<END
16 int main(int argc, char *argv[])
20 printf("%d ",sizeof(long));
21 printf("%d ",sizeof(short));
22 printf("%d ",sizeof(int));
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
]
47 echo "#ifndef LITT_ENDIAN"
48 echo "#define LITT_ENDIAN 1"
49 echo "#endif /* LITT_ENDIAN */"
51 echo "#ifndef LITT_ENDIAN"
52 echo "#endif /* LITT_ENDIAN */"