🛠️🐜 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.

87 lines
2.3 KiB

  1. #!/bin/bash
  2. # This is used by the buildbot to cross-compile for OS/2 from Linux, using
  3. # OpenWatcom. In an ideal world, we wouldn't need this, but we need a few
  4. # things to do this "properly" ...
  5. #
  6. # - OS/2 running as a VMware guest on the build machine
  7. # - Buildbot-worker running on that OS/2 guest
  8. # - CMake for OS/2 that...
  9. # - ... has Open Watcom compiler support and...
  10. # - ... a Watcom WMake project generator.
  11. #
  12. # Some of these things are doable (there is a CMake port for OS/2, you can
  13. # use GCC with it), but since OpenWatcom will just target OS/2 on Linux just
  14. # like it could on OS/2, it's easier and more efficient to just have a
  15. # buildbot script compile it here.
  16. #
  17. # Note that we just blast all the C files through the wcc386 compiler and
  18. # skip CMake entirely. We should fix this at some point.
  19. set -e
  20. ZIPFILE="$1"
  21. if [ -z $ZIPFILE ]; then
  22. ZIPFILE=physfs-os2.zip
  23. fi
  24. export WATCOM="/usr/local/share/watcom"
  25. export PATH="$PATH:$WATCOM/binl"
  26. CFLAGS="-i=\"$WATCOM/h;$WATCOM/h/os2;../src\" -wx -d0 -otexan -6r -zq -bt=os2 -fo=.obj -mf"
  27. WLIBFLAGS="-b -c -n -q -p=512"
  28. cd `dirname "$0"`
  29. cd ..
  30. mkdir -p buildbot
  31. cd buildbot
  32. rm -f test_physfs.obj
  33. OKAY="1"
  34. for src in ../src/*.c ; do
  35. echo wcc386 $src $CFLAGS
  36. wcc386 $src $CFLAGS || OKAY="0"
  37. done
  38. if [ "$OKAY" == "1" ]; then
  39. echo wlib $WLIBFLAGS physfs.lib *.obj
  40. wlib $WLIBFLAGS physfs.lib *.obj || OKAY="0"
  41. fi
  42. echo wcc386 ../test/test_physfs.c $CFLAGS
  43. wcc386 ../test/test_physfs.c $CFLAGS || OKAY="0"
  44. if [ "$OKAY" == "1" ]; then
  45. LDFLAGS="name test_physfs d all sys os2v2 op m libr physfs op q op symf FIL test_physfs.obj"
  46. echo wlink $LDFLAGS
  47. wlink $LDFLAGS || OKAY="0"
  48. fi
  49. if [ "$OKAY" == "1" ]; then
  50. F=`file test_physfs.exe`
  51. echo "$F"
  52. if [ "$F" != 'test_physfs.exe: MS-DOS executable, LX for OS/2 (console) i80386' ]; then
  53. echo 1>&2 "ERROR: final binary doesn't appear to be OS/2 executable."
  54. OKAY=0
  55. fi
  56. fi
  57. if [ "$OKAY" == "1" ]; then
  58. echo 1>&2 "Build succeeded."
  59. set -e
  60. rm -rf "$ZIPFILE" physfs-os2
  61. mkdir -p physfs-os2
  62. echo "Zipping to '$ZIPFILE' ..."
  63. cp ../src/physfs.h physfs.lib physfs-os2
  64. chmod -R a+r physfs-os2
  65. chmod a+x physfs-os2
  66. chmod -R go-w physfs-os2
  67. zip -9r "$ZIPFILE" physfs-os2
  68. echo "Done."
  69. exit 0
  70. else
  71. echo 1>&2 "Build failed."
  72. exit 1
  73. fi