gen-libc-abis 576 B

1234567891011121314151617181920212223242526
  1. #!/bin/sh
  2. triple="$1"
  3. printf "#ifndef _LIBC_ABIS_H\n#define _LIBC_ABIS_H 1\n\n"
  4. printf "enum\n{\n LIBC_ABI_DEFAULT = 0,\n"
  5. while read s t; do
  6. if test "$s" = "#" || test -z "$s"; then continue; fi
  7. if test -z "$t"; then
  8. printf " LIBC_ABI_%s,\n" "$s"
  9. features="$features $s"
  10. else
  11. case "$triple" in
  12. $t) printf " LIBC_ABI_%s,\n" "$s"
  13. features="$features $s" ;;
  14. *) ;;
  15. esac
  16. fi
  17. done
  18. printf " LIBC_ABI_MAX\n};\n"
  19. printf "\n#endif\n"
  20. if test -n "$features"; then
  21. printf "#define LIBC_ABIS_STRING \"libc ABIs:%s\\\\n\"\n" "$features"
  22. fi