build-scripts/os2-buildbot.sh
author Cameron Gutman <aicommander@gmail.com>
Sun, 28 Apr 2019 17:37:49 -0700
changeset 12746 132a2af7edac
parent 12396 50b071ef40ab
permissions -rwxr-xr-x
Fix use-after-free when pumping the event loop after SDL_DestroyWindow()

Closing the window is asynchronous, but we free the window data immediately,
so we can get an updateLayer callback before the window is really destroyed which
will cause us to access the freed memory.

Clearing the content view will cause it to be immediately released, so no further
updateLayer callbacks will occur.
     1 #!/bin/bash
     2 
     3 # This is the script buildbot.libsdl.org uses to cross-compile SDL2 from
     4 #  x86 Linux to OS/2, using OpenWatcom.
     5 
     6 # The final zipfile can be unpacked on any machine that supports OpenWatcom
     7 #  (Windows, Linux, OS/2, etc). Point the compiler at the include directory
     8 #  and link against the SDL2.lib file. Ship the SDL2.dll with your app.
     9 
    10 if [ -z "$WATCOM" ]; then
    11     echo "This script expects \$WATCOM to be set to the OpenWatcom install dir." 1>&2
    12     echo "This is often something like '/usr/local/share/watcom'" 1>&2
    13     exit 1
    14 fi
    15 
    16 export PATH="$WATCOM/binl:$PATH"
    17 
    18 ZIPFILE="$1"
    19 if [ -z $1 ]; then
    20     ZIPFILE=sdl-os2.zip
    21 fi
    22 ZIPDIR=SDL2-os2
    23 
    24 set -e
    25 set -x
    26 
    27 cd `dirname "$0"`
    28 cd ..
    29 
    30 rm -f $ZIPFILE
    31 wmake -f Makefile.os2
    32 rm -rf $ZIPDIR
    33 mkdir $ZIPDIR
    34 chmod a+r SDL2.lib SDL2.dll
    35 mv SDL2.lib SDL2.dll $ZIPDIR/
    36 cp -R include $ZIPDIR/
    37 zip -9r "$ZIPFILE" $ZIPDIR
    38 
    39 wmake -f Makefile.os2 distclean
    40 
    41 set +x
    42 echo "All done. Final installable is in $ZIPFILE ...";