lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 1 | #! /bin/sh |
| 2 | triple="$1" |
| 3 | |
| 4 | printf "#ifndef _LIBC_ABIS_H\n#define _LIBC_ABIS_H 1\n\n" |
| 5 | printf "enum\n{\n LIBC_ABI_DEFAULT = 0,\n" |
| 6 | |
| 7 | while read s t; do |
| 8 | if test "$s" = "#" || test -z "$s"; then continue; fi |
| 9 | if test -z "$t"; then |
| 10 | printf " LIBC_ABI_%s,\n" "$s" |
| 11 | features="$features $s" |
| 12 | else |
| 13 | case "$triple" in |
| 14 | $t) printf " LIBC_ABI_%s,\n" "$s" |
| 15 | features="$features $s" ;; |
| 16 | *) ;; |
| 17 | esac |
| 18 | fi |
| 19 | done |
| 20 | |
| 21 | printf " LIBC_ABI_MAX\n};\n" |
| 22 | printf "\n#endif\n" |
| 23 | |
| 24 | if test -n "$features"; then |
| 25 | printf "#define LIBC_ABIS_STRING \"libc ABIs:%s\\\\n\"\n" "$features" |
| 26 | fi |