🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
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.

213 lines
6.7 KiB

  1. #!/bin/sh
  2. # Copyright 2022 Collabora Ltd.
  3. # SPDX-License-Identifier: Zlib
  4. set -eu
  5. cd `dirname $0`/..
  6. ref_major=$(sed -ne 's/^#define SDL_MAJOR_VERSION *//p' include/SDL_version.h)
  7. ref_minor=$(sed -ne 's/^#define SDL_MINOR_VERSION *//p' include/SDL_version.h)
  8. ref_micro=$(sed -ne 's/^#define SDL_PATCHLEVEL *//p' include/SDL_version.h)
  9. ref_version="${ref_major}.${ref_minor}.${ref_micro}"
  10. tests=0
  11. failed=0
  12. ok () {
  13. tests=$(( tests + 1 ))
  14. echo "ok - $*"
  15. }
  16. not_ok () {
  17. tests=$(( tests + 1 ))
  18. echo "not ok - $*"
  19. failed=1
  20. }
  21. major=$(sed -ne 's/^SDL_MAJOR_VERSION=//p' configure.ac)
  22. minor=$(sed -ne 's/^SDL_MINOR_VERSION=//p' configure.ac)
  23. micro=$(sed -ne 's/^SDL_MICRO_VERSION=//p' configure.ac)
  24. version="${major}.${minor}.${micro}"
  25. if [ "$ref_version" = "$version" ]; then
  26. ok "configure.ac $version"
  27. else
  28. not_ok "configure.ac $version disagrees with SDL_version.h $ref_version"
  29. fi
  30. major=$(sed -ne 's/^SDL_MAJOR_VERSION=//p' configure)
  31. minor=$(sed -ne 's/^SDL_MINOR_VERSION=//p' configure)
  32. micro=$(sed -ne 's/^SDL_MICRO_VERSION=//p' configure)
  33. version="${major}.${minor}.${micro}"
  34. if [ "$ref_version" = "$version" ]; then
  35. ok "configure $version"
  36. else
  37. not_ok "configure $version disagrees with SDL_version.h $ref_version"
  38. fi
  39. major=$(sed -ne 's/^set(SDL_MAJOR_VERSION \([0-9]*\))$/\1/p' CMakeLists.txt)
  40. minor=$(sed -ne 's/^set(SDL_MINOR_VERSION \([0-9]*\))$/\1/p' CMakeLists.txt)
  41. micro=$(sed -ne 's/^set(SDL_MICRO_VERSION \([0-9]*\))$/\1/p' CMakeLists.txt)
  42. version="${major}.${minor}.${micro}"
  43. if [ "$ref_version" = "$version" ]; then
  44. ok "CMakeLists.txt $version"
  45. else
  46. not_ok "CMakeLists.txt $version disagrees with SDL_version.h $ref_version"
  47. fi
  48. major=$(sed -ne 's/.*SDL_MAJOR_VERSION = \([0-9]*\);/\1/p' android-project/app/src/main/java/org/libsdl/app/SDLActivity.java)
  49. minor=$(sed -ne 's/.*SDL_MINOR_VERSION = \([0-9]*\);/\1/p' android-project/app/src/main/java/org/libsdl/app/SDLActivity.java)
  50. micro=$(sed -ne 's/.*SDL_MICRO_VERSION = \([0-9]*\);/\1/p' android-project/app/src/main/java/org/libsdl/app/SDLActivity.java)
  51. version="${major}.${minor}.${micro}"
  52. if [ "$ref_version" = "$version" ]; then
  53. ok "SDLActivity.java $version"
  54. else
  55. not_ok "android-project/app/src/main/java/org/libsdl/app/SDLActivity.java $version disagrees with SDL_version.h $ref_version"
  56. fi
  57. major=$(sed -ne 's/^MAJOR_VERSION *= *//p' Makefile.os2)
  58. minor=$(sed -ne 's/^MINOR_VERSION *= *//p' Makefile.os2)
  59. micro=$(sed -ne 's/^MICRO_VERSION *= *//p' Makefile.os2)
  60. version="${major}.${minor}.${micro}"
  61. if [ "$ref_version" = "$version" ]; then
  62. ok "Makefile.os2 $version"
  63. else
  64. not_ok "Makefile.os2 $version disagrees with SDL_version.h $ref_version"
  65. fi
  66. major=$(sed -ne 's/^MAJOR_VERSION *= *//p' Makefile.w32)
  67. minor=$(sed -ne 's/^MINOR_VERSION *= *//p' Makefile.w32)
  68. micro=$(sed -ne 's/^MICRO_VERSION *= *//p' Makefile.w32)
  69. version="${major}.${minor}.${micro}"
  70. if [ "$ref_version" = "$version" ]; then
  71. ok "Makefile.w32 $version"
  72. else
  73. not_ok "Makefile.w32 $version disagrees with SDL_version.h $ref_version"
  74. fi
  75. tuple=$(sed -ne 's/^ *FILEVERSION *//p' src/main/windows/version.rc | tr -d '\r')
  76. ref_tuple="${ref_major},${ref_minor},${ref_micro},0"
  77. if [ "$ref_tuple" = "$tuple" ]; then
  78. ok "version.rc FILEVERSION $tuple"
  79. else
  80. not_ok "version.rc FILEVERSION $tuple disagrees with SDL_version.h $ref_tuple"
  81. fi
  82. tuple=$(sed -ne 's/^ *PRODUCTVERSION *//p' src/main/windows/version.rc | tr -d '\r')
  83. if [ "$ref_tuple" = "$tuple" ]; then
  84. ok "version.rc PRODUCTVERSION $tuple"
  85. else
  86. not_ok "version.rc PRODUCTVERSION $tuple disagrees with SDL_version.h $ref_tuple"
  87. fi
  88. tuple=$(sed -Ene 's/^ *VALUE "FileVersion", "([0-9, ]*)\\0"\r?$/\1/p' src/main/windows/version.rc | tr -d '\r')
  89. ref_tuple="${ref_major}, ${ref_minor}, ${ref_micro}, 0"
  90. if [ "$ref_tuple" = "$tuple" ]; then
  91. ok "version.rc FileVersion $tuple"
  92. else
  93. not_ok "version.rc FileVersion $tuple disagrees with SDL_version.h $ref_tuple"
  94. fi
  95. tuple=$(sed -Ene 's/^ *VALUE "ProductVersion", "([0-9, ]*)\\0"\r?$/\1/p' src/main/windows/version.rc | tr -d '\r')
  96. if [ "$ref_tuple" = "$tuple" ]; then
  97. ok "version.rc ProductVersion $tuple"
  98. else
  99. not_ok "version.rc ProductVersion $tuple disagrees with SDL_version.h $ref_tuple"
  100. fi
  101. version=$(sed -Ene '/CFBundleShortVersionString/,+1 s/.*<string>(.*)<\/string>.*/\1/p' Xcode/SDL/Info-Framework.plist)
  102. if [ "$ref_version" = "$version" ]; then
  103. ok "Info-Framework.plist CFBundleShortVersionString $version"
  104. else
  105. not_ok "Info-Framework.plist CFBundleShortVersionString $version disagrees with SDL_version.h $ref_version"
  106. fi
  107. version=$(sed -Ene '/CFBundleVersion/,+1 s/.*<string>(.*)<\/string>.*/\1/p' Xcode/SDL/Info-Framework.plist)
  108. if [ "$ref_version" = "$version" ]; then
  109. ok "Info-Framework.plist CFBundleVersion $version"
  110. else
  111. not_ok "Info-Framework.plist CFBundleVersion $version disagrees with SDL_version.h $ref_version"
  112. fi
  113. version=$(sed -Ene 's/Title SDL (.*)/\1/p' Xcode/SDL/pkg-support/SDL.info)
  114. if [ "$ref_version" = "$version" ]; then
  115. ok "SDL.info Title $version"
  116. else
  117. not_ok "SDL.info Title $version disagrees with SDL_version.h $ref_version"
  118. fi
  119. marketing=$(sed -Ene 's/.*MARKETING_VERSION = (.*);/\1/p' Xcode/SDL/SDL.xcodeproj/project.pbxproj)
  120. ref="$ref_version
  121. $ref_version"
  122. if [ "$ref" = "$marketing" ]; then
  123. ok "project.pbxproj MARKETING_VERSION is consistent"
  124. else
  125. not_ok "project.pbxproj MARKETING_VERSION is inconsistent, expected $ref, got $marketing"
  126. fi
  127. # For simplicity this assumes we'll never break ABI before SDL 3.
  128. dylib_compat=$(sed -Ene 's/.*DYLIB_COMPATIBILITY_VERSION = (.*);$/\1/p' Xcode/SDL/SDL.xcodeproj/project.pbxproj)
  129. case "$ref_minor" in
  130. (*[02468])
  131. major="$(( ref_minor * 100 + 1 ))"
  132. minor="0"
  133. ;;
  134. (*)
  135. major="$(( ref_minor * 100 + ref_micro + 1 ))"
  136. minor="0"
  137. ;;
  138. esac
  139. ref="${major}.${minor}.0
  140. ${major}.${minor}.0
  141. ${major}.${minor}.0
  142. ${major}.${minor}.0"
  143. if [ "$ref" = "$dylib_compat" ]; then
  144. ok "project.pbxproj DYLIB_COMPATIBILITY_VERSION is consistent"
  145. else
  146. not_ok "project.pbxproj DYLIB_COMPATIBILITY_VERSION is inconsistent, expected $ref, got $dylib_compat"
  147. fi
  148. dylib_cur=$(sed -Ene 's/.*DYLIB_CURRENT_VERSION = (.*);$/\1/p' Xcode/SDL/SDL.xcodeproj/project.pbxproj)
  149. case "$ref_minor" in
  150. (*[02468])
  151. major="$(( ref_minor * 100 + 1 ))"
  152. minor="$ref_micro"
  153. ;;
  154. (*)
  155. major="$(( ref_minor * 100 + ref_micro + 1 ))"
  156. minor="0"
  157. ;;
  158. esac
  159. ref="${major}.${minor}.0
  160. ${major}.${minor}.0
  161. ${major}.${minor}.0
  162. ${major}.${minor}.0"
  163. if [ "$ref" = "$dylib_cur" ]; then
  164. ok "project.pbxproj DYLIB_CURRENT_VERSION is consistent"
  165. else
  166. not_ok "project.pbxproj DYLIB_CURRENT_VERSION is inconsistent, expected $ref, got $dylib_cur"
  167. fi
  168. echo "1..$tests"
  169. exit "$failed"