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.
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
