Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
compiling modules in linux

 
Post new topic   Reply to topic Printable version
 View previous topic  ASSS Documentation Post :: Post Loading modules... I <cmod> load...  View next topic  
Author Message
tcsoccerman guest
Guest


Offline

PostPosted: Sat Dec 12, 2009 9:48 pm    Post subject: compiling modules in linux Reply to topic Reply with quote

Hey everyone, i'm back!

I'm just curious if there is a tutorial or wiki page that explains how to make and compile a simple module in asss on linux. I've been searching for a while and can't find anything.

Thank you.
Back to top
Dr Brain
Flip-flopping like a wind surfer


Age:38
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Sat Dec 12, 2009 10:05 pm    Post subject: Reply to topic Reply with quote

Once you've got the basic asss core compiling on linux (and you really should do that first), then adding a new module is relatively easy:

1. make a new directory for the module in src/, e.g. src/my_mod
2. create a new .mk file for it, e.g. src/my_mod/my_mod.mk. Look at the other .mk files for examples. Post if you get confused on this step and I'll provide an example.
3. create/copy the source file into the directory, e.g. src/my_mod/my_mod.c
4. run "make" in the src directory. A "make deps" may be necessary after the first creation of source files.
5. enjoy your new module

Sorry if this post was a bit rushed, but it should be enough to get you started. Let me know if you need clarification on any point.
_________________
Hyperspace Owner

Smong> so long as 99% deaths feel lame it will always be hyperspace to me
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
JoWie
Server Help Squatter


Gender:Gender:Male
Joined: Feb 25 2004
Posts: 215
Offline

PostPosted: Sun Dec 13, 2009 8:17 am    Post subject: Reply to topic Reply with quote

http://wiki.minegoboom.com/index.php/Installing_New_Modules#Using_Makefile_fragments
Back to top
View users profile Send private message Add User to Ignore List
tcsoccerman
Server Help Squatter


Age:31
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Sun Dec 13, 2009 11:35 am    Post subject: Reply to topic Reply with quote

Thank you for the reply.

I'm having trouble with my make file.

I named it troops.mk and put it in src/troops/ and put this code in it:

Code: Show/Hide
troops_mods = troops

$(eval $(call dl_template,troops))


and i went to asss/src/ and did a "make deps" and got this:

Code: Show/Hide
python ../scripts/makedeps.py -I. -Iinclude -I../build  -D_REENTRANT -D_GNU_SOURCE -fPIC -I/opt/db-4.0.14/include -I/opt/mysql/include -I/usr/include/python2.4 \
      */*.c -P '$(BUILDDIR)/' -o ../build/deps.mk
makedeps: ignoring option: -D_REENTRANT
makedeps: ignoring option: -D_GNU_SOURCE
makedeps: ignoring option: -fPIC
makedeps: ignoring option: -I/opt/db-4.0.14/include
makedeps: ignoring option: -I/opt/mysql/include
makedeps: ignoring option: -I/usr/include/python2.4
makedeps: warning: "pthread.h" not found
makedeps: warning: "zlib.h" not found
makedeps: warning: "mysql.h" not found
makedeps: warning: "db.h" not found
makedeps: warning: "errno.h" not found
makedeps: warning: "Python.h" not found
makedeps: warning: "structmember.h" not found
makedeps: warning: "troops.h" not found


(troops.h is one of my modules files)

then i called make in asss/src and got
Code: Show/Hide

gcc -std=gnu99 -pipe -I. -Iinclude -I../build  -D_REENTRANT -D_GNU_SOURCE -fPIC -g -Wall   -c -o ../build/admincmd.o core/admincmd.c
core/admincmd.c: In function ?Cdelfile?:
core/admincmd.c:63: error: ?PATH_MAX? undeclared (first use in this function)
core/admincmd.c:63: error: (Each undeclared identifier is reported only once
core/admincmd.c:63: error: for each function it appears in.)
core/admincmd.c:63: warning: unused variable ?path?
core/admincmd.c:63: warning: unused variable ?wd?
core/admincmd.c: In function ?Crenfile?:
core/admincmd.c:85: error: ?PATH_MAX? undeclared (first use in this function)
core/admincmd.c:85: warning: unused variable ?newpath?
core/admincmd.c:85: warning: unused variable ?oldpath?
core/admincmd.c:85: warning: unused variable ?wd?
core/admincmd.c: In function ?Cgetfile?:
core/admincmd.c:124: error: ?PATH_MAX? undeclared (first use in this function)
core/admincmd.c:124: warning: unused variable ?path?
core/admincmd.c:124: warning: unused variable ?wd?
core/admincmd.c: In function ?Cputfile?:
core/admincmd.c:241: error: ?PATH_MAX? undeclared (first use in this function)
core/admincmd.c:241: warning: unused variable ?serverpath?
core/admincmd.c:241: warning: unused variable ?wd?
core/admincmd.c: In function ?Cputzip?:
core/admincmd.c:288: error: ?PATH_MAX? undeclared (first use in this function)
core/admincmd.c:288: warning: unused variable ?serverpath?
core/admincmd.c:288: warning: unused variable ?wd?
core/admincmd.c: In function ?Cpwd?:
core/admincmd.c:379: error: ?PATH_MAX? undeclared (first use in this function)
core/admincmd.c:379: warning: unused variable ?wd?
make: *** [../build/admincmd.o] Error 1


it looks like it isn't compiling, which prob. has something to do w/ my newly added module because it compiled successfully when i compiled it on a clean install.

Lastly, when i try and "make -f troops.mk" in src/troops/ (my custom module), i get this:

Code: Show/Hide
make: *** No targets.  Stop.


Any ideas?
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
BDwinsAlt
Agurus's Posse


Age:33
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Sun Dec 13, 2009 12:48 pm    Post subject: Reply to topic Reply with quote

Edit: Hmm didn't read the last part of your post. Make sure your using the right options, check your cases, I don't think the Makefile is setup correctly.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
tcsoccerman
Server Help Squatter


Age:31
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Sun Dec 13, 2009 1:54 pm    Post subject: Reply to topic Reply with quote

I think there is something wrong w/ the way I am calling the make in terminal, because when I try to make turf.mk, I get the same errors. So to clarify:

1. cd /home/scott/asss-1.4.4/src/turf/
2. make deps
3. make -f turf.mk

Right? Or am i doing something wrong?
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Dr Brain
Flip-flopping like a wind surfer


Age:38
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Sun Dec 13, 2009 3:20 pm    Post subject: Reply to topic Reply with quote

No, you were doing it right the first time. You're using an older version of ASSS without the patch on admincmd.c. You have to add
Code: Show/Hide

#include <limits.h>

near the top of admincmd.c. The errors weren't about your new stuff, they were about compiling parts of the core.

There's nothing to be concerned about with those warnings for make deps.
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
tcsoccerman
Server Help Squatter


Age:31
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Sun Dec 13, 2009 4:50 pm    Post subject: Reply to topic Reply with quote

Ok. Do you suggest I use the 1.50rc I saw you were working on?

And also, what about my custom module problem?
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Dr Brain
Flip-flopping like a wind surfer


Age:38
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Sun Dec 13, 2009 5:38 pm    Post subject: Reply to topic Reply with quote

If you're compiling modules to run on a zone, then you should be compiling whatever version they're running (probably 1.4.4). If you're making your own zone then I recommend using the 1.5.0rc1 version.

I didn't see any problems relating to your custom module.
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
tcsoccerman
Server Help Squatter


Age:31
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Sun Dec 13, 2009 9:18 pm    Post subject: Reply to topic Reply with quote

I switched to 1.5.0rc1 as you suggested since it is my own zone.

I'm stilling having trouble compiling my own module though. "make deps" and "make -f troops.mk" in "~/asss-1.5.0rc1/src/troops/" still returns "make: *** No rule to make target `deps'. Stop." and "'make: *** No targets. Stop." respectively and does not make any .so file.

my troops.mk:

Code: Show/Hide
troops_mods = troops

$(eval $(call dl_template,troops))


Thanks for the help.

EDIT: I am trying all of this after compiling asss as a whole.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Dr Brain
Flip-flopping like a wind surfer


Age:38
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Sun Dec 13, 2009 9:47 pm    Post subject: Reply to topic Reply with quote

You build everything (including your module) with a "make" in src.
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
tcsoccerman
Server Help Squatter


Age:31
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Sun Dec 13, 2009 10:43 pm    Post subject: Reply to topic Reply with quote

Ohhhh... I get it now.

I got it to work thank you.the problem was actually with python. I just set have_python or w/e that variable is in system.mk to 'no'. Will have to fix that later.

Thank you.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 661 page(s) served in previous 5 minutes.

phpBB Created this page in 0.518156 seconds : 37 queries executed (92.1%): GZIP compression disabled