OSX 10.4 compiling help

Posted by Mightyfoo on Wed 06 Apr 2005 05:01 PM — 3 posts, 16,632 views.

#0
Hi! I'd like to thank all the folks who are running and contributing to this forum. All of your posts and suggestions really helped out a lot.

I'm a (currently)non-programmer(but learning), but a MUD lover, and wanted to set up a mud for the gaming community I hang out in, and decided on ROM after much reading.

I wanted to install it on a spare mini-Mac that I have and ran into quite a few compiling problems. Luckily I found this forum, and applied a lot of the suggestions to make it all work out. So I'm posting here to help any Mac users out.

Here's the Makefile I used for Rom 2.4b6

CC      = gcc
PROF    = -O -g
NOCRYPT =
C_FLAGS =  -Wall $(PROF) $(NOCRYPT) -Dunix -DOLD_RAND
L_FLAGS =  $(PROF)

O_FILES = act_comm.o act_enter.o act_info.o act_move.o act_obj.o act_wiz.o \
          alias.o ban.o comm.o const.o db.o db2.o effects.o fight.o flags.o \
          handler.o healer.o interp.o note.o lookup.o magic.o magic2.o \
          music.o recycle.o save.o scan.o skills.o special.o tables.o \
          update.o

rom: $(O_FILES)
        rm -f rom
        $(CC) $(L_FLAGS) -o rom $(O_FILES)

.c.o: merc.h
        $(CC) -c $(C_FLAGS) $<


Now, since I'm a COMPLETE noob and don't know how to modify header paths, I kept having compiler issues saying it couldn't find malloc.h, so I performed a cardinal sin and copied the malloc.h from /usr/include/malloc/malloc.h to /usr/include/malloc.h and after it compiled fine, I deleted it from it's incorrect location.

That's all, it works fine under 10.4 now. Just wanted to share and maybe save someone some time.

Thanks all!
Australia #1
Your shouldnt delete the libraries from there current locations, this can break a great many things that rely on that library to funbction.

A simple fix you your problem would have been to change -Dunix in your make file with -Dmacintosh.

If you look in the top section of your .c files you will see #if defined(macintosh), it i think is also used in other places throughtout the code, so that mac's can use mac specific code, rather than what ever is the default.

Hope that helps some.

Peace.
#2
Thanks for the tips. I didn't delete the header from it's initial location, I copied it to a different location so it would compile, then I deleted it from it's new location when it was done compiling.

I was afraid to use the Macintosh switch, since the original code predates OSX I was assuming that 'macintosh' meant OS 9 and previous, which is definitely different than OSX.

Thanks again!