Jump to content

Compiling Mac OS X Build


Luke9

Recommended Posts

Posted

OpenJK


 


I downloaded OpenJK source code zip file.


 


Then I downloaded and installed the dependencies as instructed.


 


I then took a look at the Compilation guide.


 


I went to the build folder in the code folder and typed:


 


cmake -DCMAKE_OSX_ARCHITECTURES=i386 ..


 


which seemed to work fine.


 


Then when I type:


 


make


 


from the build folder, I get the following error message:


 


Linking CXX executable ../openjk_sp.x86.app/Contents/MacOS/openjk_sp.x86


ld: framework not found SDL2


collect2: ld returned 1 exit status


make[2]: *** [openjk_sp.x86.app/Contents/MacOS/openjk_sp.x86] Error 1


make[1]: *** [code/CMakeFiles/openjk_sp.x86.dir/all] Error 2


make: *** [all] Error 2


 


How do I fix this?


 


Thanks.


 


Luke9

Posted

Right now I am using Mac OS X 10.6.8 to compile.

 

It seems it might work in Mac OS X 10.7, 10.8, or even 10.9, however I am wondering if it will work with those three and also 10.6.8 as well, depending on what operating system that it is compiled on.

 

Thanks.

 

 

Posted

Here is my cmake output:

 

 

cmake -DCMAKE_OSX_ARCHITECTURES=i386 ..

-- The C compiler identification is GNU 4.2.1

-- The CXX compiler identification is GNU 4.2.1

CMake Warning at /Applications/CMake 2.8-12.app/Contents/share/cmake-2.8/Modules/Platform/Darwin.cmake:316 (message):

  The SDK Library/Frameworks path

 

   /Developer/SDKs/MacOSX10.6.sdk/Library/Frameworks

 

  is not set up correctly on this system.  This is known to occur when

  installing Xcode 3.2.6:

 

   http://bugs.python.org/issue14018

 

  The problem may cause build errors that report missing system frameworks.

  Fix your SDK symlinks to resolve this issue and avoid this warning.

Call Stack (most recent call first):

  /Applications/CMake 2.8-12.app/Contents/share/cmake-2.8/Modules/CMakeSystemSpecificInformation.cmake:36 (include)

  CMakeLists.txt:7 (project)

 

 

-- Checking whether C compiler has -isysroot

-- Checking whether C compiler has -isysroot - yes

-- Checking whether C compiler supports OSX deployment target flag

-- Checking whether C compiler supports OSX deployment target flag - yes

-- Check for working C compiler: /usr/bin/cc

-- Check for working C compiler: /usr/bin/cc -- works

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Checking whether CXX compiler has -isysroot

-- Checking whether CXX compiler has -isysroot - yes

-- Checking whether CXX compiler supports OSX deployment target flag

-- Checking whether CXX compiler supports OSX deployment target flag - yes

-- Check for working CXX compiler: /usr/bin/c++

-- Check for working CXX compiler: /usr/bin/c++ -- works

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

Architecture is x86

Git revision is GITDIR-NOTFOUND

No build type selected, default to RELEASE

-- Found ZLIB: /usr/local/lib/libz.dylib (found version "1.2.8") 

-- Found PNG: /usr/local/lib/libpng.dylib  

-- Found OpenGL: /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/OpenGL.framework  

-- Found SDL2: /Library/Frameworks/SDL2.framework;-framework Cocoa  

-- Configuring done

-- Generating done

-- Build files have been written to: /Users/Luke/Games/Jedi Knight/Jedi Academy/base/OpenJK-master/build

 

How do I change the /Library/Frameworks path in Xcode 3.2.6?

 

Thanks.

Posted

After I fix the /Library/Frameworks path for the Mac OS X 10.6.8 SDK as detailed in:

 

http://bugs.python.org/issue14018

 

I get the following error in the build when I type:

 

make

 

 

Scanning dependencies of target openjk_sp.x86
[  0%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/client/cl_cgame.cpp.o
[  0%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/client/cl_cin.cpp.o
[  0%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/client/cl_console.cpp.o
[  0%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/client/cl_input.cpp.o
[  0%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/client/cl_keys.cpp.o
[  0%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/client/cl_main.cpp.o
[  1%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/client/cl_mp3.cpp.o
[  1%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/client/cl_parse.cpp.o
[  1%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/client/cl_scrn.cpp.o
[  1%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/client/cl_ui.cpp.o
[  1%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/client/snd_ambient.cpp.o
[  1%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/client/snd_dma.cpp.o
[  1%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/client/snd_mem.cpp.o
[  1%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/client/snd_mix.cpp.o
[  2%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/client/snd_music.cpp.o
[  2%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/client/vmachine.cpp.o
[  2%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/qcommon/cm_load.cpp.o
[  2%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/qcommon/cm_patch.cpp.o
/Users/Luke/Games/Jedi Knight/Jedi Academy/base/OpenJK-master/code/qcommon/cm_patch.cpp: In function ‘void CM_TraceThroughPatchCollide(traceWork_t*, const patchCollide_s*)’:
/Users/Luke/Games/Jedi Knight/Jedi Academy/base/OpenJK-master/code/qcommon/cm_patch.cpp:1531: warning: ‘bestplane[0]’ may be used uninitialized in this function
/Users/Luke/Games/Jedi Knight/Jedi Academy/base/OpenJK-master/code/qcommon/cm_patch.cpp:1531: warning: ‘bestplane[1]’ may be used uninitialized in this function
/Users/Luke/Games/Jedi Knight/Jedi Academy/base/OpenJK-master/code/qcommon/cm_patch.cpp:1531: warning: ‘bestplane[2]’ may be used uninitialized in this function
/Users/Luke/Games/Jedi Knight/Jedi Academy/base/OpenJK-master/code/qcommon/cm_patch.cpp:1531: warning: ‘bestplane[3]’ may be used uninitialized in this function
[  2%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/qcommon/cm_polylib.cpp.o
[  2%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/qcommon/cm_test.cpp.o
[  2%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/qcommon/cm_trace.cpp.o
[  3%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/qcommon/cmd.cpp.o
[  3%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/qcommon/common.cpp.o
[  3%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/qcommon/cvar.cpp.o
[  3%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/qcommon/files_common.cpp.o
[  3%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/qcommon/files_pc.cpp.o
[  3%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/qcommon/md4.cpp.o
[  3%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/qcommon/msg.cpp.o
[  3%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/qcommon/net_chan.cpp.o
[  4%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/qcommon/q_math.cpp.o
[  4%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/qcommon/q_shared.cpp.o
[  4%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/qcommon/stringed_ingame.cpp.o
[  4%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/qcommon/stringed_interface.cpp.o
[  4%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/qcommon/strip.cpp.o
[  4%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/qcommon/persistence.cpp.o
[  4%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/qcommon/z_memman_pc.cpp.o
[  4%] Building C object code/CMakeFiles/openjk_sp.x86.dir/__/lib/minizip/ioapi.c.o
[  5%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/__/lib/minizip/unzip.cpp.o
[  5%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/server/exe_headers.cpp.o
[  5%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/server/sv_ccmds.cpp.o
[  5%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/server/sv_client.cpp.o
[  5%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/server/sv_game.cpp.o
[  5%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/server/sv_init.cpp.o
[  5%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/server/sv_main.cpp.o
[  5%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/server/sv_savegame.cpp.o
[  6%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/server/sv_snapshot.cpp.o
[  6%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/server/sv_world.cpp.o
[  6%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/game/genericparser2.cpp.o
[  6%] Building C object code/CMakeFiles/openjk_sp.x86.dir/mp3code/cdct.c.o
[  6%] Building C object code/CMakeFiles/openjk_sp.x86.dir/mp3code/csbt.c.o
[  6%] Building C object code/CMakeFiles/openjk_sp.x86.dir/mp3code/csbtb.c.o
[  6%] Building C object code/CMakeFiles/openjk_sp.x86.dir/mp3code/csbtl3.c.o
[  7%] Building C object code/CMakeFiles/openjk_sp.x86.dir/mp3code/cup.c.o
[  7%] Building C object code/CMakeFiles/openjk_sp.x86.dir/mp3code/cupini.c.o
[  7%] Building C object code/CMakeFiles/openjk_sp.x86.dir/mp3code/cupl1.c.o
[  7%] Building C object code/CMakeFiles/openjk_sp.x86.dir/mp3code/cupl3.c.o
[  7%] Building C object code/CMakeFiles/openjk_sp.x86.dir/mp3code/cwin.c.o
[  7%] Building C object code/CMakeFiles/openjk_sp.x86.dir/mp3code/cwinb.c.o
[  7%] Building C object code/CMakeFiles/openjk_sp.x86.dir/mp3code/cwinm.c.o
[  7%] Building C object code/CMakeFiles/openjk_sp.x86.dir/mp3code/hwin.c.o
[  8%] Building C object code/CMakeFiles/openjk_sp.x86.dir/mp3code/l3dq.c.o
[  8%] Building C object code/CMakeFiles/openjk_sp.x86.dir/mp3code/l3init.c.o
[  8%] Building C object code/CMakeFiles/openjk_sp.x86.dir/mp3code/mdct.c.o
[  8%] Building C object code/CMakeFiles/openjk_sp.x86.dir/mp3code/mhead.c.o
[  8%] Building C object code/CMakeFiles/openjk_sp.x86.dir/mp3code/msis.c.o
[  8%] Building C object code/CMakeFiles/openjk_sp.x86.dir/mp3code/towave.c.o
[  8%] Building C object code/CMakeFiles/openjk_sp.x86.dir/mp3code/uph.c.o
[  8%] Building C object code/CMakeFiles/openjk_sp.x86.dir/mp3code/upsf.c.o
[  9%] Building C object code/CMakeFiles/openjk_sp.x86.dir/mp3code/wavep.c.o
[  9%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/ui/ui_atoms.cpp.o
[  9%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/ui/ui_connect.cpp.o
[  9%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/ui/ui_main.cpp.o
[  9%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/ui/ui_saber.cpp.o
[  9%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/ui/ui_shared.cpp.o
/Users/Luke/Games/Jedi Knight/Jedi Academy/base/OpenJK-master/code/ui/ui_shared.cpp: In function ‘int Script_Transition3(itemDef_t*, const char**)’:
/Users/Luke/Games/Jedi Knight/Jedi Academy/base/OpenJK-master/code/ui/ui_shared.cpp:2477: warning: ‘name’ may be used uninitialized in this function
[  9%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/ui/ui_syscalls.cpp.o
[  9%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/sys/sys_main.cpp.o
/Users/Luke/Games/Jedi Knight/Jedi Academy/base/OpenJK-master/code/sys/sys_main.cpp: In function ‘int SDL_main(int, char**)’:
/Users/Luke/Games/Jedi Knight/Jedi Academy/base/OpenJK-master/code/sys/sys_main.cpp:385: warning: no return statement in function returning non-void
[ 10%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/sys/sys_unix.cpp.o
[ 10%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/sdl/sdl_snd.cpp.o
/Users/Luke/Games/Jedi Knight/Jedi Academy/base/OpenJK-master/code/sdl/sdl_snd.cpp: In function ‘int SNDDMA_Init()’:
/Users/Luke/Games/Jedi Knight/Jedi Academy/base/OpenJK-master/code/sdl/sdl_snd.cpp:166: error: ‘SDL_GetCurrentAudioDriver’ was not declared in this scope
make[2]: *** [code/CMakeFiles/openjk_sp.x86.dir/sdl/sdl_snd.cpp.o] Error 1
make[1]: *** [code/CMakeFiles/openjk_sp.x86.dir/all] Error 2
make: *** [all] Error 2
 
How do I fix this?
 
Thanks.
Posted

How the heck do I get the SDL2 devel stuff?

 

Thanks.

 

I think he means this. Put it in your /Users/USER/Library/Frameworks/ folder.

Posted

I went to the Simple DirectMedia Layer - SDL version 2.0.3 (stable) page and downloaded the versions of SDL2 for Mac OS X.  They seem to be the same.  There seems to be no devel stuff there for the Mac.

 

Where is the devel stuff that I would need to compile the OpenJK source code?  Do I need to install a SDL2-devel.pkg file somewhere if I could find it?  Or is it actually on that SDL page?

 

Thanks.

 

 

Posted

I did copy the SDL2.framework folder to the /Library/Frameworks folder.  That took care of some of the compile errors, however, the same compile errors show up as above where I listed the errors already:

 

 

[  0%] Building CXX object code/CMakeFiles/openjk_sp.x86.dir/sdl/sdl_snd.cpp.o
/Users/Luke/Games/Jedi Knight/Jedi Academy/base/OpenJK-master/code/sdl/sdl_snd.cpp: In function ‘int SNDDMA_Init()’:
/Users/Luke/Games/Jedi Knight/Jedi Academy/base/OpenJK-master/code/sdl/sdl_snd.cpp:166: error: ‘SDL_GetCurrentAudioDriver’ was not declared in this scope
make[2]: *** [code/CMakeFiles/openjk_sp.x86.dir/sdl/sdl_snd.cpp.o] Error 1
make[1]: *** [code/CMakeFiles/openjk_sp.x86.dir/all] Error 2
make: *** [all] Error 2
 
It seems that I might need the SDLMain.h and SDLMain.m files from the devel-lite folder of SDL included in the compile somehow.
 
The ReadMe file states:
 
To build from the command line, your gcc line will look something like this:
 
gcc -I/Library/Frameworks/SDL.framework/Headers MyProgram.c SDLmain.m -framework SDL -framework Cocoa
 
An SDL/OpenGL based application might look like:
 
gcc -I/Library/Frameworks/SDL.framework/Headers -I/System/Library/Frameworks/OpenGL.framework/Headers MyProgram.c SDLmain.m -framework SDL -framework Cocoa -framework OpenGL
 
How do I incorporate all of this including the files and the gcc call into my build procedure for make?
 
Thanks.
 

 

Posted

Just tried building in a 10.6 VM, this is what I did and it seemed to build ok:

 

1. Make sure you have Xcode installed
2. Download SDL2.framework and put it in /Users/YOURUSER/Library/Frameworks/ - you might need to create the folder.
3. Download cmake and run installer. Install command line stuff when prompted to.
4. Download code, either with git (BEST VALUE) or by downloading the zip.
5. Go to the OpenJK folder in terminal. mkdir build, cd build. then..
6. cmake .. -G "Unix Makefiles" -DCMAKE_OSX_ARCHITECTURES=i386 -i
7. Select most defaults, except CMAKE_INSTALL_PREFIX should be a sensible install path and UseInternalPNG should be ON not OFF
8. make install -j8

 
if you're building for 10.6 on >10.6 you should also set CMAKE_OSX_DEPLOYMENT_TARGET to 10.6
 

It looks like if you build on 10.6 there are some kind of issues with zlib, but if you have a more up to date zlib installed when building it should be fine (not necessary for actually running?)

Cerez likes this
Posted

How do I get the compiled apps to run?  I just have a "base" folder with assets0.pk3 through assets3.pk3 from the Mac Jedi Academy discs.  Thanks.

Posted

I put the compiled apps in the directory just above the base directory and the game works great on 10.6.8 now!  Multiplayer is in effect!

 

Now to get the single player working!....

Posted

I put the compiled apps in the directory just above the base directory and the game works great on 10.6.8 now!  Multiplayer is in effect!

 

Now to get the single player working!....

thfydh8egnt8he5esoz8.gif

JKG Developer

Posted

On a note, I had to compile to source code on an iMac with 10.7 Lion on it for the base system of 10.6 as instructed by redsaurus, then I copied the app files to the Mac mini with 10.6.8 on it and the files worked great!

 

Still not able to compile on the Mac mini with 10.6.8.  Something to do with zlib file declarations.  I even downloaded the latest and a previous versions of zlib to try to get the compile to work.  To no avail.

 

The game works great though from what I compiled on the Mac OS X 10.7 machine!  The apps work great on the 10.6.8 Mac and the 10.7 Mac!  Now to try on the 10.9 Mavericks Mac!  Thanks again!

Circa and Cerez like this

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...