1

Topic: Compiling on OSX 10.9 Mavericks

Hello,

I've been working at it for a while to try and solve this but I'm hoping someone in the community can help me figure this out so it will be available for everyone. I will gladly make a tutorial once I get it sorted smile

I have teeworlds 0.6.2 source, I have successfully compiled bam 0.40, I have installed SDL 1.2 and 2.0 to /Library/Frameworks/

I have changed bam.lua to

11:  config:Add(OptTestCompileC("minmacosxsdk", "int main(){return 0;}", "-mmacosx-version-min=10.5 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk"))

157:  settings.cc.flags:Add("-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk")
158:     settings.link.flags:Add("-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk")

I have changed sdl.lua to the SDL2 location (as a test, didn't work)

I'm not really sure where the final puzzle piece goes here, any help would be appreciated


Here is the error I'm getting

./bam client_release
auto configuration

configuration:
AUTO  compiler             gcc
AUTO  stackprotector       yes
AUTO  minmacosxsdk         yes
AUTO  macosxppc            no
AUTO  zlib                 (in system path)
AUTO  sdl                  using osx framework
AUTO  freetype             using freetype-config

notes:
saved configuration to 'config.lua'

[1/2] #1 link teeworlds_x86_64
ld: framework not found SDL.framework
clang: error: linker command failed with exit code 1 (use -v to see invocation)
bam: 'teeworlds_x86_64' error 256
[2/2] #1 link teeworlds_x86
ld: framework not found SDL.framework
clang: error: linker command failed with exit code 1 (use -v to see invocation)
bam: 'teeworlds_x86' error 256
bam: error: a build step failed

2

Re: Compiling on OSX 10.9 Mavericks

I created a soft link instead of manually changing the bam.lua file, but that shouldn't make a difference (unless somewhere else there is a reference to the SDK location).

sudo mkdir -p /Developer/SDKs/
sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk /Developer/SDKs/MacOSX10.5.sdk

I did not need to edit any other files (eg. sdl.lua), in fact I could compile with no modifications to the git repo after making the soft link.

And to confirm, you have both the following correct?:

/Library/Frameworks/SDL.framework
/Library/Frameworks/SDL2.framework

Are you working from a clone of the git repo or the downloaded source .zip?

3

Re: Compiling on OSX 10.9 Mavericks

I had this problem, too. It seems like "/Library/Frameworks" is not in the default framework search part anymore. What I did to solve this problem is siply adding that path to the framework search path by the following line in bam.lua (right after line 155):

settings.link.flags:Add("-F/Library/Frameworks")

Here is my complete bam.lua:

http://pastebin.f3l.de/telemoreti.lua

4 (edited by Frozenfire 2014-01-16 14:52:03)

Re: Compiling on OSX 10.9 Mavericks

ghost wrote:

I had this problem, too. It seems like "/Library/Frameworks" is not in the default framework search part anymore. What I did to solve this problem is siply adding that path to the framework search path by the following line in bam.lua (right after line 155):

settings.link.flags:Add("-F/Library/Frameworks")

Here is my complete bam.lua:

http://pastebin.f3l.de/telemoreti.lua

Your bam.lua fixed it, thanks!

5

Re: Compiling on OSX 10.9 Mavericks

By the way, for 0.6.2 and also for the current master branch on github, you only need SDL1.2.

6

Re: Compiling on OSX 10.9 Mavericks

Perfect, what does the -F do?

7 (edited by ghost 2014-01-17 16:46:08)

Re: Compiling on OSX 10.9 Mavericks

taken from the clang++ manpage:

-Fdirectory
    Add the specified directory to the search path for framework
    include files.

Note that on OS X 10.9 with Xcode 5 (which is the only version of Xcode running on OS X 10.9) calling gcc/g++ is actually calling clang/clang++.

EDIT: However, it seems that something strange is going on here. I just created a quick test application using SDL and when compiling it, it did not need to do the fix, I described here. This means, that when compiling teeworlds, something strange happens, don't know what it is though...

EDIT2: I am totally confused now, I can not reproduce the problem anymore... oO