Building SDL2 for 32-bit on a 64-bit Linux

There is probably a simple answer for this but I’m just not seeing it… what do I need to do with “configure” to pull this off? I need to build the 32-bit

gcc -m32
I use this to compile for 32-bit machines:

CFLAGS = -Wall -Wextra -m32 `sdl-config --cflags`

Something like this for autotools:

./configure --build=i686-pc-linux-gnu “CFLAGS=-m32” “CXXFLAGS=-m32” “LDFLAGS=-m32”

Maybe your Distro has something like multilib, I can simply install lib32-sdl2.


Great! That did the trick (the configure with env vars added) to build SDL2 2.0.8 on Ubuntu 16.04.

Oh yeah, Ubuntu is slacking a bit with SDL2 packages. I experienced that while I was trying to integrate Travis with in a repo, I had to use this yml file cause SDL_PointInRect was not taken into account.


    - |
      travis_retry curl -L | tar xz
      cd SDL2-2.0.8


Alright, glad it worked.