Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: Compiling Modules in Anope 1.9.0-P1 under Windows  (Read 4343 times)

0 Members and 1 Guest are viewing this topic.

Swampy

  • Guest
Compiling Modules in Anope 1.9.0-P1 under Windows
« on: September 04, 2009, 05:19:24 PM »

Currently, under 1.8 I have a batch file I call with the filename I want to compile, and it will compile it automatically with the correct commands, and also create the proper .DLL file needed without any modification.

1. I open the Visual Basic Command prompt, goto the directory  Anope\src\modules and simply issue "makedll dllname" (no extension)

It then calls a created batch file "MakeDLL" which I've setup as follows:

echo off
cls
echo Command: %1
if "%1"=="" goto nil

echo SRCS=%1.c >makefile.inc.win32
echo *** NMake..
nmake -f makefile.win32
echo *** Compile..
mt -manifest %1.dll.manifest -outputresource:%1.dll;2
echo.
goto end
:nil
echo.
echo Usage: %0 modulename   [Example: %0 cs_join]
echo         Do NOT add .DLL / .C extension !!
echo.
:end

Now this works fine for me, and I am also posting here to assist other users, but under 1.9 - would I simply use the same method, but replace "nmake" with "cmake" or not?

Once I have the General Idea how to perform such commands, I like to make a batch file so it make's it easier to compile them outta the box so to speak.

Please, if you could, post an example (I already have CMake installed for 1.9)

Many Thanks!
Logged

Naram Qashat

  • Team
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 192
    • CBX's Sprite Animations
Re: Compiling Modules in Anope 1.9.0-P1 under Windows
« Reply #1 on: September 05, 2009, 12:47:54 AM »

Right now, the way 1.9.0-p1 handles files in src/modules, it treats every file as a single file needed for a module with the same name.  For example, hs_request.c (or .cpp) in src/modules gets compiled into hs_request.so.  1.9's SVN has support for compiling multiple files into a single module (for example, you'd add a folder called ns_blah to src/modules, and have maybe 2 files in there, both would be compiled into ns_blah.so).

In order to compile your own module, place it into src/modules, run Config.bat from your build folder (you can use either nmake or the VS IDE), and build.  If you run Config.bat in a folder you had already built from before, CMake will automatically pick up the new files and they will be built automatically when you build.  You don't even need that batch file to do any of this.

I hope that clears it up.  If not, reply and I'll try to clarify any of it.
Logged
Pages: [1]   Go Up