How to compile SDL2 and extensions for 32-bit?

I’m trying to compile SDL2 with -m32 by cloning the current repo. It compiles normally but basically everything throws assertation errors.

Ignore the “couldn’t find texture” message, that’s my own thing and that error is supposed to happen.
I compiled SDL2, SDL2_image, SDL2_ttf and SDL2_mixer using the same commands.

./configure --build=i686-linux-gnu --prefix=/usr --libdir=/usr/lib/i386-linux-gnu/ --sysconfdir=/etc --localstatedir=/var "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32 -L/usr/lib/i386-linux-gnu"
sudo make install

I ended doing it the stupid way and downloading libsdl2-dev:i386 as there is a bug on Ubuntu that is to do with that package specifically for almost 2 years now.

I still want to know what I did wrong, in the future if I might need to edit the source.