| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Message
| Out of curiosity, I downloaded the Borland C 5.5 compiler from the site you mentioned (www.borland.com), and tried to compile SMAUG, just to see what would happen.
After a considerable amount of mucking around I got it to compile. First, you can simplify your job if you replace the makefile with the lines below. Note that the two lines in bold start with leading tab, not spaces, or it won't work.
In the example the compiler is on the C drive, you would change the "c:" on the first line (in two places) if it is somewhere else.
CPP = bcc32 -Ic:\borland\bcc55\include -Lc:\borland\bcc55\lib -DSMAUG
CPPFLAGS = -w-8057 -w-8066 -w-8004 -w-8060 -w-8065 -w-8012 -w-8075 -w-8008
O_FILES = act_comm.obj act_info.obj act_move.obj act_obj.obj act_wiz.obj boards.obj \
build.obj clans.obj comm.obj comments.obj const.obj db.obj deity.obj fight.obj \
handler.obj hashstr.obj ibuild.obj ident.obj interp.obj magic.obj makeobjs.obj \
mapout.obj misc.obj mpxset.obj mud_comm.obj mud_prog.obj player.obj polymorph.obj \
requests.obj reset.obj save.obj shops.obj skills.obj special.obj tables.obj \
track.obj update.obj grub.obj stat_obj.obj ban.obj services.obj planes.obj \
imm_host.obj colorize.obj
all:
make smaug
smaug: $(O_FILES)
$(CPP) -esmaug.exe $(O_FILES)
clean:
-@if exist *.obj del *.obj >nul
-@if exist *.exe del *.exe >nul
.c.obj:
$(CPP) $(CPPFLAGS) -c {$? }
Then various files needed minor tweaking. I will paste below the patches needed to change from the "smaug with MXP" source on my downloads page, to the version that compiled OK under Borland.
You can use the patch utility (that comes with Cygwin) to apply them, or assuming you don't have Cygwin (or you may as well compile with that) you can apply them by hand. Each patch consists of the file name (eg. the first one is to the file comm.c) then a line number (eg. line 34), and then "from" lines (preceded by a < sign), and then "to" lines (preceded by a > sign).
Thus, the first patch means "add the line '#define WIN32'" at line 34.
The second patch means "change line 56 by adding '(unsigned char)' as indicated, and so on.
diff orig_src/comm.c src/comm.c
34c34
<
---
> #define WIN32
56c56
< #define IAC '\xFF'
---
> #define IAC (unsigned char) '\xFF'
125a126,128
> bool DONT_UPPER;
> int area_version;
> bool MOBtrigger;
163,165c166,168
< #ifdef WIN32
< int mainthread( int argc, char **argv )
< #else
---
> //#ifdef WIN32
> // int mainthread( int argc, char **argv )
> //#else
167c170
< #endif
---
> //#endif
275,276c278,281
< signal(SIGINT, (void *) bailout);
< signal(SIGTERM, (void *) bailout);
---
> // signal(SIGINT, (void *) bailout);
> // signal(SIGTERM, (void *) bailout);
> signal(SIGINT, bailout);
> signal(SIGTERM, bailout);
336c341
< shutdown_checkpoint ();
---
> // shutdown_checkpoint ();
diff orig_src/db.c src/db.c
29a30
> #define strcasecmp strcmp
diff orig_src/deity.c src/deity.c
24a25,26
> #undef WIN32
>
diff orig_src/ident.c src/ident.c
23a24
> /*
27a29
> */
diff orig_src/magic.c src/magic.c
729c729
< if ( (*exp == '(') && !index(exp+1,'(') && exp[strlen(exp)-1] == ')' )
---
> if ( (*exp == '(') && !strchr(exp+1,'(') && exp[strlen(exp)-1] == ')' )
diff orig_src/misc.c src/misc.c
27a28,29
> #undef WIN32
>
2098,2101d2099
< #ifdef WIN32
<
< /* routines not in Windows runtime libraries */
<
2106a2105,2109
>
>
> #ifdef WIN32
>
> /* routines not in Windows runtime libraries */
diff orig_src/mud.h src/mud.h
34a35
> /*
41a43
> */
42a45,47
> #include <time.h>
> #include <winsock.h>
>
273c278
< bool DONT_UPPER;
---
> extern bool DONT_UPPER;
293c298
< int area_version;
---
> extern int area_version;
1049c1054
< bool MOBtrigger;
---
> extern bool MOBtrigger;
5434a5440
> /*
5452a5459,5460
> */
>
5463,5464c5471,5472
< #define exit(arg) Win32_Exit(arg)
< void Win32_Exit(int exit_code);
---
> //#define exit(arg) Win32_Exit(arg)
> //void Win32_Exit(int exit_code);
diff orig_src/save.c src/save.c
236c236
< fchmod(fileno(fp), S_IRUSR|S_IWUSR | S_IRGRP|S_IWGRP | S_IROTH|S_IWOTH);
---
> // fchmod(fileno(fp), S_IRUSR|S_IWUSR | S_IRGRP|S_IWGRP | S_IROTH|S_IWOTH);
I added the path to the Borland compiler (eg. "c:\borland\bcc55\bin") into my "PATH" variable so it could find "make" and bcc32, and then just typed "make".
Make sure you create a "gods" directory at the same level as the player directories, or you will get a crash shortly after starting the server.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|