Building SDL2 & Peripheral Libraries on OS X El Capitan

SDL2 Build Report:
Build successful. Installed in /usr/local

Comments & Concerns: SDL2 is using an Apple audio compositor from the outdated Carbon interface.

WARNING: 140: This application, or a library it uses, is using the deprecated Carbon Component Manager for hosting Audio Units. Support for this will be removed in a future release. Also, this makes the host incompatible with version 3 audio units. Please transition to the API’s in AudioComponent.h.

Perhaps additions should be made for compatibility with future releases of OS X, & further compatibility with versions >= 10.7, but all in due time, I suppose.

SDL2_gfx Build Report:
Build successful. Installed in /usr/local

SDL2_image Build Report:
Build successful. Installed in /usr/local

SDL2_mixer Build Report:
Build successful.* Installed in /usr/local

*MOD support via libmikmod

Comments & Concerns: SDL2_mixer’s configuration script reported libmodplug missing, despite it having been installed in /usr/local along with other libraries including libFLAC, libogg, libvorbis, and smpeg2. I suspect this is because, unlike the others, libmodplug lacked an object file with the extension “.a”.
Perhaps searching through extensions, “.la” or “.dylib” would help correct this issue. But who knows, maybe the existence of libmodplug.a is required, in which case it can’t be helped.

Addendum: On a somewhat related note, libvorbis apparently searches for libogg in /opt/local (or perhaps that’s just the configuration of my workstation), yet installs in /usr/local along with all the others. If libvorbis’ configuration script reports libogg missing, despite it being installed, I recommend copying installed libogg files into /opt/local to proceed with installing libvorbis. If this fails, the installation and activation of libogg through MacPorts may be necessary.

SDL2_net Build Report:
Build successful. Installed in /usr/local

SDL2_ttf Build Report:
Build Successful. Installed in /usr/local

Please note these steps before attempting to build SDL2*:

  1. Install Xcode or Command Line Tools for Xcode (10.11)

  2. Download the source code archives for SDL2* and all dependencies (Notably the dependencies for SDL2_mixer for format support: libogg, libvorbis, libFLAC, limodplug/libmikmod, and libsmpeg2).

  3. In the terminal, go to each of their respective directories (dependencies first), then type

3a. Assuming SDL2_mixer still fails to find libmodplug, install libmikmod using these steps and type
./configure --enable-music-mod-mikmod

  1. type

sudo make install

4a. repeat steps 2-4 until you have installed all of the libraries you need.

I hope some OS X El Capitan users find this useful for SDL2 programming without necessitating the use of Xcode, or the Frameworks provided.