The official "ZDoom on Mac OS X" thread.

Handy guides on how to do things, written by users for users.

Moderators: GZDoom Developers, Raze Developers

Forum rules
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.
User avatar
Rachael
Posts: 13897
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: The unofficial "ZDoom on Mac OS X" thread.

Post by Rachael »

Ok, I am sorry to bump such an old thread, but I am hoping someone can help me with this.

When compiling r1661, I am bumping into this error:

Code: Select all

[ 44%] Building CXX object src/CMakeFiles/zdoom.dir/m_alloc.o
/Users/xero5/zdoom/trunk/src/m_alloc.cpp:39:20: error: malloc.h: No such file or directory
/Users/xero5/zdoom/trunk/src/m_alloc.cpp: In function ‘void* M_Malloc(size_t)’:
/Users/xero5/zdoom/trunk/src/m_alloc.cpp:61: error: ‘malloc_usable_size’ was not declared in this scope
/Users/xero5/zdoom/trunk/src/m_alloc.cpp: In function ‘void* M_Realloc(void*, size_t)’:
/Users/xero5/zdoom/trunk/src/m_alloc.cpp:69: error: ‘malloc_usable_size’ was not declared in this scope
/Users/xero5/zdoom/trunk/src/m_alloc.cpp:76: error: ‘malloc_usable_size’ was not declared in this scope
/Users/xero5/zdoom/trunk/src/m_alloc.cpp: In function ‘void M_Free(void*)’:
/Users/xero5/zdoom/trunk/src/m_alloc.cpp:115: error: ‘malloc_usable_size’ was not declared in this scope
make[2]: *** [src/CMakeFiles/zdoom.dir/m_alloc.o] Error 1
make[1]: *** [src/CMakeFiles/zdoom.dir/all] Error 2
make: *** [all] Error 2
xero5s-macbook:release xero5$ 
I've tried some of the more intuitive fixes, even switching it to the FreeBSD #ifdef, but to no success.

I am trying to create a patch to make ZDoom cross-platform friendly to not just Macs, but all platforms, "out-of-the-box."
lamacq

Re: The unofficial "ZDoom on Mac OS X" thread.

Post by lamacq »

Thanks so much for this ZDoom Mac port, guys -- It works great, I just have one problem though. I have never used the standard WASD control setup; instead I have always used mouse2 for forward and left-alt for back. So my left thumb is "back". I think this works for me because it's kind of like driving a car, where your right foot is the accelerator and left foot is the brake.

Anyway, I can't do this on the Mac it seems because what was left-alt on a PC is the left command key, and ZDoom doesn't seem to recognize when just the left command key is pressed (this may be an OS-level thing, where the keypress isn't sent to the application until the entire command key chord is pressed, I don't know). Unfortunately I think my control setup is just far too hardwired into my brain to be able to switch to WASD at this point. Does anybody have an idea how I can get ZDoom on Mac to recognize the left command key? Interestingly, it does actually recognize the right command key as "alt", it just doesn't work for the left command key.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm

Re: The unofficial "ZDoom on Mac OS X" thread.

Post by randi »

I have an idea: Use the toolkits Mac OS X provides for getting input instead of SDL. There's a reason I don't use SDL on Windows, and I think it's probably just as valid on the Mac.
User avatar
Rachael
Posts: 13897
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: The unofficial "ZDoom on Mac OS X" thread.

Post by Rachael »

I'm still kinda a newbie at programming so I would need help in figuring that out, randee. :(
Gez
 
 
Posts: 17937
Joined: Fri Jul 06, 2007 3:22 pm

Re: The unofficial "ZDoom on Mac OS X" thread.

Post by Gez »

SoulPriestess wrote:Ok, I am sorry to bump such an old thread, but I am hoping someone can help me with this.

When compiling r1661, I am bumping into this error:

Code: Select all

[ 44%] Building CXX object src/CMakeFiles/zdoom.dir/m_alloc.o
/Users/xero5/zdoom/trunk/src/m_alloc.cpp:39:20: error: malloc.h: No such file or directory
When typing "malloc.h" in google, its AJAX autocompletion feature brings "malloc.h mac os x" and "malloc.h no such file or directory" as the top two searches. Got any luck with them?

One of the results said to use this:

Code: Select all

#ifdef MACOSX
#include "sys/malloc.h" // mac os x
#else
#include "malloc.h" // linux, windows
#endif
Is that what you tried?
User avatar
Rachael
Posts: 13897
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: The unofficial "ZDoom on Mac OS X" thread.

Post by Rachael »

Haven't tried that, yet. Will try it now.


EDIT:
#ifdef __APPLE__ worked.

However, it still does not recognize malloc_usable_size(), and that is causing issues. I'm trying some hacky workarounds but haven't found one that works yet.

It would appear that the function is missing entirely from the Mac API - and possibly with a bit of reason. But I don't know of any good substitute without it - otherwise I'd just write the function in.
skadoomer
Posts: 1026
Joined: Fri Sep 05, 2003 12:49 pm

Re: The unofficial "ZDoom on Mac OS X" thread.

Post by skadoomer »

Bump

Hows this coming along?
User avatar
Rachael
Posts: 13897
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: The unofficial "ZDoom on Mac OS X" thread.

Post by Rachael »

Not coming along at all. I have little or no help from anyone knowledgable with Unix and how to make things compile, so really, this project is almost moot. Google isn't being real helpful, either.
User avatar
Ardekantur
Posts: 2
Joined: Wed Jul 29, 2009 8:04 am

Re: The unofficial "ZDoom on Mac OS X" thread.

Post by Ardekantur »

Hello all -

My name is Ardekantur and I just spend the better part of an evening trying to get ZDoom working on my Intel Mac, using Leopard and gcc 4.2 (I've upgraded to 4.4 using Macports in an attempt to fix an error, but 4.2 is the minimum, I think, to get this working at all). I wasn't successful, but I did make a little progress.

I should warn that I am not an expert in anything I was doing and was more often than not choosing the quickest solution to make things work. None of this should be submitted as patches until someone more competent than I look over these things. Additionally, this was all done against r1739.

The build error I received with regards to crashcatcher.c:387 was fixed by using Darwin's conventions for certain flags. To wit:

Code: Select all

...
#elif defined(__APPLE__)
	sa.sa_flags = SA_RESETHAND | SA_NODEFER | SA_SIGINFO;
...
The build error I received with regards to files.h:262 (error: ‘CLzmaDec’ does not name a type) was fixed by altering the include declaration for LzmaDec.h. Specifically, pointing it explicitly to "../lzma/C/LzmaDec.h" allowed the error to go away.

Code: Select all

 #include "../lzma/C/LzmaDec.h"
The error in i_system.cpp (src/sdl/i_system.cpp:537: error: invalid conversion from ‘int (*)(const dirent*)’ to ‘int (*)(dirent*)’) was mentioned elsewhere on the boards, I think in a bug report.

Finally, the error you guys have been getting with regards to malloc_usable_size() is due to the fact that Unix doesn't use the de facto Linux standard malloc library, written by Doug Lea.

I revised the relevant preprocessor directives in m_alloc.cpp to look like the following:

Code: Select all

 #ifdef __FreeBSD__
 #include <stdlib.h>
 #include <malloc_np.h>
 #elif __APPLE__
 #include <stdlib.h>
 #include "dlmalloc.h"
 #else
 #include <malloc.h>
 #endif
 #include "i_system.h"
 #include "dobject.h"
And included "dlmalloc.h", which is the file "dlmalloc.c" renamed, in the /src directory. "dlmalloc.c" can be found by googling, and will have the MD5 sum 39ba26754209092e0d45172ef918f4e1.

After that, I commented out the majority of the code used to determine CPUID, since I don't trust myself to alter assembly.

From there I was able to compile successfully until the a_armor.o target, when the compiler/linker totally borked and gave me the following error.

Code: Select all

[ 40%] Building CXX object src/CMakeFiles/zdoom.dir/g_shared/a_armor.o
/var/folders/jz/jzdbZxG4E-yVWBJvuS8CYE+++TI/-Tmp-//ccSreTER.s:507:non-relocatable subtraction expression, "LC6" minus "L00000000008$pb"
/var/folders/jz/jzdbZxG4E-yVWBJvuS8CYE+++TI/-Tmp-//ccSreTER.s:507:symbol: "L00000000008$pb" can't be undefined in a subtraction expression
/var/folders/jz/jzdbZxG4E-yVWBJvuS8CYE+++TI/-Tmp-//ccSreTER.s:unknown:Undefined local symbol L00000000008$pb
make[2]: *** [src/CMakeFiles/zdoom.dir/g_shared/a_armor.o] Error 1
make[1]: *** [src/CMakeFiles/zdoom.dir/all] Error 2
I hope this was useful, and I hope this allows the community to make a little more progress :-)
jonw1987

Re: The unofficial "ZDoom on Mac OS X" thread.

Post by jonw1987 »

I'm having trouble running ZDoom OS X. When I run it it gives me the following message:

"ZDoom OS X could not find any IWADs (doom.wad, doom2.wad, etc.). Make sure you have them in this folder before trying to launch ZDoom:
[Home Folder]/Library/Application Support/zdoom"

The problem with that is when I installed the application on my Mac, it didn't create that folder in Application Support. So I created a folder with that title. Still the same message pops up, and the folder is full of IWADs, including DOOM2.WAD. What's going on?
Gez
 
 
Posts: 17937
Joined: Fri Jul 06, 2007 3:22 pm

Re: The unofficial "ZDoom on Mac OS X" thread.

Post by Gez »

User avatar
macman134
Posts: 3
Joined: Tue Sep 01, 2009 3:42 pm

Re: The unofficial "ZDoom on Mac OS X" thread.

Post by macman134 »

i am obviously a mac lover (you can tell by my username) and would love to test this. i havean old g4 ppc with 2 gigs of ram running 10.5.7, it's pretty old, but it still kicks but. and prboom sucks bigtime on controls/environment/bugs.
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed

Re: The unofficial "ZDoom on Mac OS X" thread.

Post by wildweasel »

macman134 wrote:i am obviously a mac lover (you can tell by my username) and would love to test this. i havean old g4 ppc with 2 gigs of ram running 10.5.7, it's pretty old, but it still kicks but. and prboom sucks bigtime on controls/environment/bugs.
Unfortunately, you may be out of luck; as far as I've seen, ZDoom for OS X is Intel-only.
Blzut3
 
 
Posts: 3201
Joined: Wed Nov 24, 2004 12:59 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: The unofficial "ZDoom on Mac OS X" thread.

Post by Blzut3 »

I have to wonder what all of this stuff is about then:

Code: Select all

if( CMAKE_SYSTEM_PROCESSOR MATCHES powerpc )
    if( NOT NO_ASM )
        message( STATUS "Disabling assembly code for PowerPC." )
        set( NO_ASM ON )
    endif( NOT NO_ASM )
endif( CMAKE_SYSTEM_PROCESSOR MATCHES powerpc )
and
http://zdoom.org/svndiff/1780/zdoom/tru ... m_swap.h#0

Not sure if fmodex is powerpc compatible, but I'm not sure why it wouldn't be.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm

Re: The unofficial "ZDoom on Mac OS X" thread.

Post by randi »

I'm disappointed in CMake. It can make Xcode projects, but they don't work out of the box (for ZDoom). At least the Unix makefiles still work fine.

Return to “Tutorials”