haveversions.awk 684 B

1234567891011121314151617181920212223
  1. # This script reads the contents of Versions.all and outputs a definition
  2. # of variable have-VERSION for each symbol version VERSION which is
  3. # defined.
  4. #
  5. # The have-VERSION variables can be used to check that a port supports a
  6. # particular symbol version in makefiles due to its base version. A test
  7. # for a compatibility symbol which was superseded with a GLIBC_2.15
  8. # version could be tested like this:
  9. #
  10. # ifdef HAVE-GLIBC_2.14
  11. # tests += tst-spawn4-compat
  12. # endif # HAVE-GLIBC_2.14
  13. #
  14. # (NB: GLIBC_2.14 is the symbol version that immediately precedes
  15. # GLIBC_2.15.)
  16. NF == 1 && $1 != "}" {
  17. haveversion[$1] = 1
  18. }
  19. END {
  20. for (i in haveversion)
  21. printf "have-%s = yes\n", i
  22. }