buildbot-os2.sh 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. export WATCOM="/usr/local/share/watcom"
  21. export PATH="$PATH:$WATCOM/binl"
  22. CFLAGS="-i=\"$WATCOM/h;$WATCOM/h/os2;../src\" -wx -zq -bt=os2 -fo=.obj -mf"
  23. WLIBFLAGS="-b -c -n -q -p=512"
  24. cd `dirname "$0"`
  25. cd ..
  26. mkdir -p buildbot
  27. cd buildbot
  28. rm -f test_physfs.obj
  29. OKAY="1"
  30. for src in ../src/*.c ; do
  31. echo wcc386 $src $CFLAGS
  32. wcc386 $src $CFLAGS || OKAY="0"
  33. done
  34. if [ "$OKAY" == "1" ]; then
  35. echo wlib $WLIBFLAGS physfs.lib *.obj
  36. wlib $WLIBFLAGS physfs.lib *.obj || OKAY="0"
  37. fi
  38. echo wcc386 ../test/test_physfs.c $CFLAGS
  39. wcc386 ../test/test_physfs.c $CFLAGS || OKAY="0"
  40. if [ "$OKAY" == "1" ]; then
  41. LDFLAGS="name test_physfs d all sys os2v2 op m libr physfs op q op symf FIL test_physfs.obj"
  42. echo wlink $LDFLAGS
  43. wlink $LDFLAGS || OKAY="0"
  44. fi
  45. if [ "$OKAY" == "1" ]; then
  46. F=`file ../buildbot/test_physfs.exe`
  47. echo "$F"
  48. if [ "$F" != '../buildbot/test_physfs.exe: MS-DOS executable, LX for OS/2 (console) i80386' ]; then
  49. echo 1>&2 "ERROR: final binary doesn't appear to be OS/2 executable."
  50. OKAY=0
  51. fi
  52. fi
  53. if [ "$OKAY" == "1" ]; then
  54. echo 1>&2 "Build succeeded."
  55. else
  56. echo 1>&2 "Build failed."
  57. fi