Compiling Smaug under OS X - Stalls at startup

Posted by Merwin on Wed 03 Sep 2003 05:00 PM — 7 posts, 22,450 views.

#0
I started out by doing "make all" in the src subdirecty and by changing "gcc" to "cc" in Makefile, like Nick suggest elsewhere in this forum.
After getting some warnings, like the examples below

cc -c -O -g3 -Wall -Wuninitialized -DSMAUG player.c
player.c:1024:10: warning: trigraph ??) ignored
save.c: In function `load_char_obj':
save.c:949: warning: suggest explicit braces to avoid ambiguous `else'

and this message at the end of the command

cc -o smaug act_comm.o act_info.o act_move.o act_obj.o act_wiz.o boards.o build.o clans.o comm.o comments.o const.o db.o deity.o fight.o handler.o hashstr.o ibuild.o ident.o interp.o magic.o makeobjs.o mapout.o misc.o mpxset.o mud_comm.o mud_prog.o player.o polymorph.o requests.o reset.o save.o shops.o skills.o special.o tables.o track.o update.o grub.o stat_obj.o ban.o services.o planes.o imm_host.o colorize.o
ld: Undefined symbols:
_re_exec
make[1]: *** [smaug] Error 1
make: *** [all] Error 2

After all this i tried to "startup 4000" within the area subdirectory and the whole thing just stalls. Probably something to do with above errors.
I know that Nick was successful in compiling Smaug under OS X and i would like to know what it was i did wrong.

Thanks in advance for all possible help.
Australia Forum Administrator #1
Search the forum for "_re_exec" - you need to tweak the makefile slightly and it should work. I have it running all the time on OS/X.
USA #2
I'm curious, was there anything special that needed to be done to make it compile on OS/X? Or is it as easy as suggested and all you have to do is drop it in and compile?
Australia Forum Administrator #3
Strangely enough, it was as easy as that. I just did it again to check. I assume you have the development environment loaded into OS/X (gcc, make etc.) which I think was an optional (however a free) install. I used the "with MXP" source from the download area of this site. Everything I did was what you see below, in bold type:


bash-2.05a$ ls smau*
smaug1.4a_mxp.tgz
bash-2.05a$ tar xzf smaug1.4a_mxp.tgz
bash-2.05a$ cd smaug
bash-2.05a$ cd dist
bash-2.05a$ cd src
bash-2.05a$ make
make smaug
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG act_comm.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG act_info.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG act_move.c
act_move.c:393:10: warning: trigraph ??> ignored
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG act_obj.c
act_obj.c: In function `can_layer':
act_obj.c:1389: warning: suggest explicit braces to avoid ambiguous `else'
act_obj.c: In function `do_auction':
act_obj.c:2651: warning: suggest explicit braces to avoid ambiguous `else'
act_obj.c:2675: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG act_wiz.c
act_wiz.c:1637:19: warning: trigraph ??! ignored
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG boards.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG build.c
build.c: In function `fold_area':
build.c:6058: warning: suggest explicit braces to avoid ambiguous `else'
build.c:6061: warning: suggest explicit braces to avoid ambiguous `else'
build.c:6064: warning: suggest explicit braces to avoid ambiguous `else'
build.c:6070: warning: suggest explicit braces to avoid ambiguous `else'
build.c:6075: warning: suggest explicit braces to avoid ambiguous `else'
build.c:6078: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG clans.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG comm.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG comments.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG const.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG db.c
db.c: In function `load_resets':
db.c:1594: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG deity.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG fight.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG handler.c
handler.c: In function `get_eq_char':
handler.c:1335: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG hashstr.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG ibuild.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG ident.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG interp.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG magic.c
magic.c: In function `process_spell_components':
magic.c:985: warning: suggest explicit braces to avoid ambiguous `else'
magic.c:1003: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG makeobjs.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG mapout.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG misc.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG mpxset.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG mud_comm.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG mud_prog.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG player.c
player.c:1024:10: warning: trigraph ??) ignored
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG polymorph.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG requests.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG reset.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG save.c
save.c: In function `load_char_obj':
save.c:949: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG shops.c
shops.c: In function `appraise_all':
shops.c:1095: warning: suggest explicit braces to avoid ambiguous `else'
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG skills.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG special.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG tables.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG track.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG update.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG grub.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG stat_obj.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG ban.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG services.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG planes.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG imm_host.c
gcc -c -O -g3 -Wall -Wuninitialized -DSMAUG colorize.c
colorize.c: In function `load_colors':
colorize.c:39: warning: implicit declaration of function `strcpy'
rm -f smaug
gcc -o smaug act_comm.o act_info.o act_move.o act_obj.o act_wiz.o boards.o build.o clans.o comm.o comments.o const.o db.o deity.o fight.o handler.o hashstr.o ibuild.o ident.o interp.o magic.o makeobjs.o mapout.o misc.o mpxset.o mud_comm.o mud_prog.o player.o polymorph.o requests.o reset.o save.o shops.o skills.o special.o tables.o track.o update.o grub.o stat_obj.o ban.o services.o planes.o imm_host.o colorize.o
chmod g+w smaug
chmod a+x smaug
chmod g+w act_comm.o act_info.o act_move.o act_obj.o act_wiz.o boards.o build.o clans.o comm.o comments.o const.o db.o deity.o fight.o handler.o hashstr.o ibuild.o ident.o interp.o magic.o makeobjs.o mapout.o misc.o mpxset.o mud_comm.o mud_prog.o player.o polymorph.o requests.o reset.o save.o shops.o skills.o special.o tables.o track.o update.o grub.o stat_obj.o ban.o services.o planes.o imm_host.o colorize.o
bash-2.05a$ cd ../area
bash-2.05a$ ../src/smaug
Thu Sep 11 08:38:17 2003 :: Booting Database
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Thu Sep 11 08:38:17 2003 :: [*****] BOOT: ---------------------[ Boot Log ]--------------------
Thu Sep 11 08:38:17 2003 :: Loading commands
Thu Sep 11 08:38:17 2003 :: Loading sysdata configuration...
Thu Sep 11 08:38:17 2003 :: Loading socials
Thu Sep 11 08:38:17 2003 :: Loading skill table
Thu Sep 11 08:38:17 2003 :: Sorting skill table...
Thu Sep 11 08:38:17 2003 :: Remapping slots to sns
Thu Sep 11 08:38:17 2003 :: Loading classes
Thu Sep 11 08:38:17 2003 :: Loading races
Thu Sep 11 08:38:17 2003 :: Loading herb table
Thu Sep 11 08:38:17 2003 :: Loading tongues
Thu Sep 11 08:38:17 2003 :: Making wizlist
Thu Sep 11 08:38:17 2003 :: Initializing request pipe
Thu Sep 11 08:38:17 2003 :: Initializing random number generator
Thu Sep 11 08:38:17 2003 :: Setting time and weather
Thu Sep 11 08:38:17 2003 :: Assigning gsn's
Thu Sep 11 08:38:17 2003 :: Reading in area files...
(help.are)
(imc-help.are)
(ice-help.are)
gods.are : Rooms: 1200 - 1201 Objs: 1200 - 1200 Mobs: 1200 - 1200
limbo.are : Rooms: 1 - 43 Objs: 2 - 99 Mobs: 1 - 99
newacad.are : Rooms: 10300 - 10499 Objs: 10300 - 10499 Mobs: 10300 - 10499
newgate.are : Rooms: 100 - 199 Objs: 100 - 199 Mobs: 100 - 199
newdark.are : Rooms: 21000 - 21499 Objs: 21000 - 21435 Mobs: 21000 - 21499
haon.are : Rooms: 6000 - 6156 Objs: 6000 - 6155 Mobs: 6000 - 6117
midennir.are : Rooms: 3500 - 3590 Objs: 3500 - 3550 Mobs: 3500 - 3550
sewer.are : Rooms: 7001 - 7445 Objs: 7190 - 7310 Mobs: 7000 - 7206
redferne.are : Rooms: 7900 - 7918 Objs: 7909 - 7911 Mobs: 7900 - 7900
grove.are : Rooms: 8901 - 8999 Objs: 8900 - 8919 Mobs: 8900 - 8911
dwarven.are : Rooms: 6500 - 6554 Objs: 6502 - 6519 Mobs: 6500 - 6517
daycare.are : Rooms: 6601 - 6651 Objs: 6600 - 6647 Mobs: 6600 - 6610
grave.are : Rooms: 3600 - 3651 Objs: 3600 - 3613 Mobs: 3600 - 3605
chapel.are : Rooms: 3405 - 3475 Objs: 3400 - 3430 Mobs: 3400 - 3416
astral.are : Rooms: 800 - 899 Objs: 800 - 899 Mobs: 800 - 899
Build.are : Rooms: 9500 - 9589 Objs: 0 - 0 Mobs: 0 - 0
pixie.are : Rooms: 2070 - 2099 Objs: 2070 - 2076 Mobs: 2070 - 2073
export.are : Rooms: 9810 - 9899 Objs: 9810 - 9899 Mobs: 9800 - 9899
srefuge.are : Rooms: 1500 - 1599 Objs: 1500 - 1599 Mobs: 1500 - 1599
manor.are : Rooms: 2400 - 2499 Objs: 2400 - 2499 Mobs: 2405 - 2484
unholy.are : Rooms: 2101 - 2172 Objs: 2101 - 2150 Mobs: 2101 - 2120
gallery.are : Rooms: 24800 - 24899 Objs: 24800 - 24899 Mobs: 24800 - 24899
Thu Sep 11 08:38:17 2003 :: Fixing exits
Thu Sep 11 08:38:17 2003 :: Initializing economy
Thu Sep 11 08:38:17 2003 :: Resetting areas
Resetting: gods.are
Resetting: limbo.are
Resetting: newacad.are
Resetting: newgate.are
Resetting: newdark.are
Resetting: haon.are
Resetting: midennir.are
Resetting: sewer.are
Resetting: redferne.are
Resetting: grove.are
Resetting: dwarven.are
Resetting: daycare.are
Resetting: grave.are
Resetting: chapel.are
Resetting: astral.are
Resetting: Build.are
Resetting: pixie.are
Resetting: export.are
Resetting: srefuge.are
Resetting: manor.are
Resetting: unholy.are
Resetting: gallery.are
Thu Sep 11 08:38:17 2003 :: Loading buildlist
Thu Sep 11 08:38:17 2003 :: Loading boards
Thu Sep 11 08:38:17 2003 :: ../boards/immortal.brd
Thu Sep 11 08:38:17 2003 :: ../boards/highgod.brd
Thu Sep 11 08:38:17 2003 :: Loading clans
Thu Sep 11 08:38:17 2003 :: Loading clans...
Thu Sep 11 08:38:17 2003 :: vampire.gui
Thu Sep 11 08:38:17 2003 :: Cannot open clan vault
Thu Sep 11 08:38:17 2003 :: druid.gui
Thu Sep 11 08:38:17 2003 :: Cannot open clan vault
Thu Sep 11 08:38:17 2003 :: warrior.gui
Thu Sep 11 08:38:17 2003 :: Cannot open clan vault
Thu Sep 11 08:38:17 2003 :: augurer.gui
Thu Sep 11 08:38:17 2003 :: Cannot open clan vault
Thu Sep 11 08:38:17 2003 :: thief.gui
Thu Sep 11 08:38:17 2003 :: Cannot open clan vault
Thu Sep 11 08:38:17 2003 :: cleric.gui
Thu Sep 11 08:38:17 2003 :: Cannot open clan vault
Thu Sep 11 08:38:17 2003 :: mage.gui
Thu Sep 11 08:38:17 2003 :: Cannot open clan vault
Thu Sep 11 08:38:17 2003 :: ranger.gui
Thu Sep 11 08:38:17 2003 :: Cannot open clan vault
Thu Sep 11 08:38:17 2003 :: $
Thu Sep 11 08:38:17 2003 :: Done clans
Thu Sep 11 08:38:17 2003 :: Loading councils
Thu Sep 11 08:38:17 2003 :: Loading deities...
Thu Sep 11 08:38:17 2003 :: test.dty
Thu Sep 11 08:38:17 2003 :: $
Thu Sep 11 08:38:17 2003 :: Done deities
Thu Sep 11 08:38:17 2003 :: Loading deities
Thu Sep 11 08:38:17 2003 :: Loading councils...
Thu Sep 11 08:38:17 2003 :: $
Thu Sep 11 08:38:17 2003 :: Done councils
Thu Sep 11 08:38:17 2003 :: Loading watches
Thu Sep 11 08:38:17 2003 :: Loading bans
Thu Sep 11 08:38:17 2003 :: Done.
Thu Sep 11 08:38:17 2003 :: Loading reserved names
Thu Sep 11 08:38:17 2003 :: Loading corpses
Thu Sep 11 08:38:17 2003 :: Loading Immortal Hosts
Thu Sep 11 08:38:17 2003 :: Done.
Thu Sep 11 08:38:17 2003 :: Loading Projects
Thu Sep 11 08:38:17 2003 :: Loading Morphs
Thu Sep 11 08:38:17 2003 :: Optimizing Morphs.
Thu Sep 11 08:38:17 2003 :: Done.
Thu Sep 11 08:38:17 2003 :: Loading Colors
Thu Sep 11 08:38:17 2003 :: Initializing socket
Thu Sep 11 08:38:17 2003 :: (Name Not Set) ready at address imac on port 4000.
Resetting: newacad.are

Amended on Wed 10 Sep 2003 10:45 PM by Nick Gammon
USA #4
Nice. I don't have a Mac, I was just curious. Think you could do me a quick favor and see if AFKMud compiles on it, and if so what stuff needed to be flagged in the Makefile to do that? Been looking for someone who has OS/X to check that with. www.afkmud.com :)
Australia Forum Administrator #5
I was going quite well until I came to your use of dlopen and dlclose etc. I quote from the Mac OS/X web site:

Quote:

Many applications being ported to Mac OS X utilize APIs such as dlopen, dlgets, and dlclose these are not supported on Mac OS X. Below are listed these APIs along with some alternative APIs or suggestions that will allow port your application to Mac OS X.

If you decide to move to Apple's dyld format for dynamic libraries and bundles, here are alternatives, don't simply swap functions; make sure to appropriately adjust your code to handle the different data types.


See:

http://developer.apple.com/technotes/tn2002/tn2071.html

The question is, how central is your use of these functions to the code?
USA #6
Critical to the function unfortunately. The entire command, skill/spell, and spec_fun lookup system is dependent on those being there. I'll have a peek at that developer doc and see if it makes any sense to me. I'd be willing to adjust my release to allow OS/X compatibility provided it doesn't require massive changes.

You could have a look in tables.c and mspecial.c and see what you think. The lookup functions use the same names as classic Smaug.