mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
656 B

  1. #include <stdio.h>
  2. char * isbigendian () {
  3. /* Are we little or big endian? From Harbison&Steele. */
  4. union { long l; char c[sizeof (long)]; } u;
  5. u.l=1; return (u.c[0] == 1)?"no":"yes";
  6. }
  7. int main() {
  8. printf("arch_sizeof_short=%d\n",sizeof(short));
  9. printf("arch_sizeof_int=%d\n",sizeof(int));
  10. printf("arch_sizeof_long=%d\n",sizeof(long));
  11. printf("arch_sizeof_long_long=%d\n",sizeof(long long));
  12. printf("arch_sizeof_char_p=%d\n",sizeof(char *));
  13. printf("arch_bigendian=%s\n",isbigendian());
  14. printf("arch_machine="); fflush(stdout); system("uname -m");
  15. system("echo arch_target=`uname -m -p | tr ' ' -`-linux");
  16. return 0;
  17. }