Need Help Compiling Against Framework [Mac OSX]


#1

So, I’m trying to compile the open source project Freeciv using SDL2_mixer. Both SDL2_mixer.framework and SDL2.framework exist in /Library/Frameworks. However, the configure script doesn’t find them:

checking for sdl-config… no
checking for SDL - version >= 1.0.0… no
*** The sdl-config script installed by SDL could not be found

I tried passing the flag “–with- sdl2-prefix=/Library/Frameworks”, but that didn’t help. Where does sdl-config live in a framework setup?


#2

Hi there. Yes, working frameworks is a bit confusing at the moment (I’ve been working to make it a bit simpler on iOS and tvOS, see here). To back up a second, if you just need SDL2 development libraries and headers on macOS, easiest way is via Homebrew, e.g. with brew install sdl2 sdl2_mixer <etc...>
If you absolutely need the libraries to be in framework form for whatever reason, I can walk you through some options (including building them from the Xcode projects included in the source repos.)


#3

Um, i already have Fink installed for my own personal use and SDL works fine inside that environment. What i’m looking for now is a way to build a self-contained bundle, and i can’t use a private build environment to accomplish that.

So, you’re implying these frameworks don’t contain headers? I thought that was the point of frameworks in the first place??


#4

Got it, and yes, frameworks do contain headers, and optionally many other things. I guess I was confused, sounds like you already have working SDL2 and SDL2_mixer frameworks, and the Freeciv configure script can’t find sdl-config, is that correct? If so, that’s a problem as frameworks don’t contain the SDL config script (they’re not really relevant in this context), and a better route would be compiling/installing SDL via the standard ./configure && make && make install method installing to usr/local/ (which is what Homebrew also does) where headers, libs, and config scripts can be found. Also to note, sdl-config would be SDL v1 — SDL2 uses sdl2-config
Sorry if I’m missing something, I don’t have experience compiling Freeciv specifically.


#5

No problem, and thanks for the clarification. I will install the standard form of SDL as a backup plan. However, what might be even better is if i (or anyone, really) could offer the Freeciv project a patched SDL.m4 that does detect the frameworks. Can you kindly point me towards another project i could crib off of?


#6

It turns out that’s not really an option, either. SDL v1 has apparently bit-rotted enough that it no longer compiles, sigh. I’ll get back to the Freeciv project and see if i can force it to pick up SDL2 & SDL2-mixer [which DID compile fine].