Pages:<< prev 1 next >>
Fledgling

GroupMembers
Posts10
JoinedAug 27, 2005
Would the new codebase compile on a Mac?
I have tried but getting the following:
I have tried but getting the following:
Building AFKMud.... make -s afkmud Compiling o/imc.o.... Compiling o/act_comm.o.... Compiling o/act_info.o.... Compiling o/act_move.o.... Compiling o/act_obj.o.... Compiling o/act_wiz.o.... Compiling o/archery.o.... Compiling o/area.o.... Compiling o/areaconvert.o.... Compiling o/auction.o.... Compiling o/ban.o.... Compiling o/bits.o.... Compiling o/boards.o.... Compiling o/build.o.... Compiling o/calendar.o.... calendar.cpp: In function 'char* c_time(time_t, int)': calendar.cpp:152: error: pointer to a function used in arithmetic calendar.cpp:152: error: invalid conversion from 'char* (*)(int, int)' to 'time_t' calendar.cpp: In function 'char* mini_c_time(time_t, int)': calendar.cpp:194: error: pointer to a function used in arithmetic calendar.cpp:194: error: invalid conversion from 'char* (*)(int, int)' to 'time_t' make[2]: *** [o/calendar.o] Error 1 make[1]: *** [all] Error 2 make: *** [clean] Error 2
Black Hand

GroupAdministrators
Posts3,707
JoinedJan 1, 2002
Well hmm. The only thing I can figure from that is that on the Mac, "timezone" is an actual function and not a variable of some sort. Without some further knowledge of how that works on a Mac, I wouldn't have any idea how to solve the problem for you.
Apprentice

GroupMembers
Posts62
JoinedAug 30, 2005
It should work the same way it does on a BSD system. I haven't tried compiling AFK, but I'll do it later if there's still a problem.
Sorcerer

GroupMembers
Posts902
JoinedJan 29, 2007
I had several issues compiling FUSS (not AFK) on a Mac some time ago. Somewhere around here I have a diff of what I needed to change, although I no longer have access to a Mac to play with this more.
Black Hand

GroupAdministrators
Posts3,707
JoinedJan 1, 2002
Noplex, how does it work on a BSD system? I don't have ready access to one to play with to find out
Apprentice

GroupMembers
Posts62
JoinedAug 30, 2005
Sorry about the delay. Calculus and Financial Mathematics are killing me. Ugh. I hate college.
With those changes it compiles and runs fine on my system, OS X 10.5.2 running GCC 4.0.1 (version shipped with Apple's Leopard xCode package). He was a little ambiguous about what version he is running. I am assuming he is using OS X and at least GCC 4 (although I can't quite remember what shipped with Tiger, I think it was GCC4). If he's using an old version of the operating system he can download Fink which is essentially apt-get for OS X. I believe they are distributing GCC 4.2.
diff stock/Makefile src/Makefile 12c12 < EXPORT_SYMBOLS = -export-dynamic --- > #EXPORT_SYMBOLS = -export-dynamic 72c72 < $(CC) -export-dynamic -o smaug $(O_FILES) $(L_FLAGS) --- > $(CC) $(EXPORT_SYMBOLS) -o smaug $(O_FILES) $(L_FLAGS) Only in src: dependencies.d diff stock/handler.c src/handler.c 463c463 < bug( "%s: midlist control block (%zd).", __FUNCTION__, *trash - trw_heap ); --- > bug( "%s: midlist control block (%zd).", __FUNCTION__, (signed size_t)(*trash - trw_heap) ); diff stock/interp.c src/interp.c 556c556 < ch->in_room ? ch->in_room->vnum : 0, time_used.tv_sec, time_used.tv_usec ); --- > ch->in_room ? ch->in_room->vnum : 0, time_used.tv_sec, (long int)time_used.tv_usec ); 937c937 < ch_printf( ch, "Timing took %ld.%06ld seconds.\r\n", etime.tv_sec, etime.tv_usec ); --- > ch_printf( ch, "Timing took %ld.%06ld seconds.\r\n", etime.tv_sec, (long int)etime.tv_usec ); 985,986c985,986 < "\r\n", vtime->min_time.tv_sec, vtime->min_time.tv_usec, ntime.tv_sec, < ntime.tv_usec, vtime->max_time.tv_sec, vtime->max_time.tv_usec ); --- > "\r\n", vtime->min_time.tv_sec, (long int)vtime->min_time.tv_usec, ntime.tv_sec, > (long int)ntime.tv_usec, vtime->max_time.tv_sec, (long int)vtime->max_time.tv_usec ); diff stock/mud.h src/mud.h 41a42,46 > #if defined(__APPLE__) > #include <sys/types.h> > #include <time.h> > #endif > Common subdirectories: stock/o and src/o Only in src: resolver Only in src: resolver.o diff stock/sha256.c src/sha256.c 34c34 < #else --- > #elif !defined(__APPLE__) Only in src: smaug
With those changes it compiles and runs fine on my system, OS X 10.5.2 running GCC 4.0.1 (version shipped with Apple's Leopard xCode package). He was a little ambiguous about what version he is running. I am assuming he is using OS X and at least GCC 4 (although I can't quite remember what shipped with Tiger, I think it was GCC4). If he's using an old version of the operating system he can download Fink which is essentially apt-get for OS X. I believe they are distributing GCC 4.2.
Apprentice

GroupMembers
Posts62
JoinedAug 30, 2005
Same changes apply to SmaugFUSS 1.9 (with my same configuration, obviously).
Sorcerer

GroupMembers
Posts902
JoinedJan 29, 2007
Here are the changes I made.
Apprentice

GroupMembers
Posts62
JoinedAug 30, 2005
I didn't think of checking to see if the endian was included. I'll find out later where it is on the Mac and include it in the SHA library. But you should change __ppc__ to __APPLE__ due to more recent Intel Macs. The only change that looks like might cause a problem is the endian include. Everything else is essentially the same thing I did.
Sorcerer

GroupMembers
Posts902
JoinedJan 29, 2007
Oh yeah. I should have mentioned that I did all that on a PPC, before having access to a MacIntel... __APPLE__ would be better, yes.
I found the conditionals on the printfs to be pretty annoying; I'm not sure a one-size-fits-all solution is appropriate because the data types are different IIRC. That's why I have those printfs whose format specifiers change depending on apple vs. non-apple... :sigh:
I found the conditionals on the printfs to be pretty annoying; I'm not sure a one-size-fits-all solution is appropriate because the data types are different IIRC. That's why I have those printfs whose format specifiers change depending on apple vs. non-apple... :sigh:
Apprentice

GroupMembers
Posts62
JoinedAug 30, 2005
sha256.c
That should work pcc/intel OS X.
#if !defined(WIN32) #include <sys/cdefs.h> #if defined(__FreeBSD__) #include <sys/endian.h> #elif defined(__APPLE__) #include <machine/endian.h> #else #include <endian.h> #endif
That should work pcc/intel OS X.
Pages:<< prev 1 next >>