Historical:Compiling 1.0 Under Windows

From the makers of InspIRCd.
(Redirected from Compiling 1.0 Under Windows)
Jump to: navigation, search
Historical Historical Material - Information posted here may be inaccurate as a result of being obsolete. This information is kept for historical reference purposes.

As it stands, there is no real way to include custom modules in the windows build of 1.0 without compiling it yourself so this tutorial indicates how to do so. Note that 1.0 is depreciated and you should be using 1.1 instead, but this document is being preserved for historical reasons and in case cygwin becomes properly supported again at any point in the future.

Version Note

InspIRCd 1.1 and beyond will not build under current versions of cygwin. For users on windows wishing to run 1.1, install the pre-built binaries, or see the page on Compiling 1.1 Under Windows.

This tutorial applies to versions in the 1.0 release or before.

Requirements

A Copy of Cygwin, ensuring at least the following packages are installed:

  • Perl
  • GCC
  • G++
  • The Development Tools Set

Starting Off

Head over to our download page and downloading the latest version of InspIRCd to your /home/<username>/ directory. Use cygwin to extract it:

 tar -jxvf InspIRCd-1.0-Beta6.tar.bz2

If you wish to install custom modules along with Insp, place them in the src/modules folder as .cpp files.

Move into the inspircd directory, then run ./configure. It should identify that you are running cygwin:

 Your operating system is: CYGWIN_NT-5.1 (i-br0ked-it 1.5.17(0.129/4/2) i686), fd max: 1024

For ease of use, I'd recommend installing everything to a separate directory, for example /home/<username>/insp (base path) then use all the following default paths. Feel free to change every other setting that's there. Once ./configure is complete, it will generate cygwin specific Makefiles, which will statically build all the modules into the core.

include/inspircd_config.h

Fire up inspircd_config.h in your favourite editor (You can do this either inside Windows, or the cygwin environment). See that big line at the top that says:

 /* Auto generated by configure, do not modify! */

Point to it.. laugh at it.. then ignore it.. time to modify the file!

Find the line which reads:

 #define CONFIG_FILE "/path/to/inspircd.conf"

That's the important line, if we want inspircd to work outside the cygwin environment, we're going to need to change that. We use some clever trickery here, because InspIRCd won't use Win32 paths, we need to turn that into what's known as a 'relative' location, so, change that to:

 #define CONFIG_FILE "./conf/inspircd.conf"

That should be all that needs to be changed there. Save the file then close it.

Building

This is the easy part.. look in your terminal, and type in 'make'. InspIRCd will now build and install itself. During this stage, modules will be built into the core, and executables created.

Leaving the Cygwin environment

Due to cygwins nature, you won't ever leave (mwahah), however, it is possible to take the runtime DLLs with you, and run programs outside the prompt.

Firstly, lets copy out our built copy of InspIRCd, using windows Explorer, locate your installation dir (If cygwin is installed to H:\cygwin, it will be in H:\cygwin\home\<username>\insp and copy the bin and conf directories to somewhere safe, for the purposes of this tutorial, we'll assume you are installing it to D:\InspIRCd, so you should now have a directory structure that looks a bit like this:

 D:\InspIRCD
 |
 |`-- bin
 |  `-- inspircd.exe
  `-- conf
    `-- Loads of Config Files

We need to go back to our cygwin folder browse into the bin directory, and find the file called 'cygwin1.dll', this important file does all our emulation and runtime stuff which allows Insp to work. Copy that into your inspircd bin directory, which would leave you with a file structure similar too:

 D:\InspIRCD
 |
 |`-- bin
 |  |
 |  |`-- cygwin1.dll 
 |   `-- inspircd.exe
  `-- conf
    `-- Loads of Config Files

Configuring

There are a couple of differences between the Windows and Linux builds of InspIRCd, again because absolute paths are not possible, we have to use relative paths again, the most important of which is the PID file, without this, InspIRCd can't run, even though under Windows this file is redundant. Change the <pid:file> tag to read:

 <pid file="./inspircd.pid">

As well as any other files which use absolute paths, MOTD, Rules file etc, give them ./<path> instead of the full path:

 <files  motd="./conf/inspire.motd"
         rules="./conf/inspire.rules">

Launching

There are two options for this, generally the first is easier

Using the Official Launcher

Download the official Windows Build of InspIRCd from our download page, install it, then replace the inspircd.exe file (in the bin directory) provided with the one you have made yourself, then use the official launcher, this will allow you to install as a service and run InspIRCd in the background.

Creating a Batch File

Fire up notepad, and place the following into the file:

 @echo off
 bin\inspircd.exe
 pause

Go File -> Save as, browse to your InspIRCd directory, and save the file as "InspIRCd.bat" (The quotation marks are important!), this should leave you with a directory structure similar to:

 D:\InspIRCD
 |
 |`-- InspIRCd.bat
 |`-- bin
 |  |
 |  |`-- cygwin1.dll 
 |   `-- inspircd.exe
  `-- conf
    `-- Loads of Config Files

Congratulations

You've now built your own copy of InspIRCd under windows, Use it as you wish, and enjoy :)
Run InspIRCd.bat, and your IRCd will be running!