How to compile custom scripts on Linux / Mac OS X
This guide is for ArcEmu but if you are on Ascent use your common sense when replacing things.
Okay , in this tutorial the directory with my arcemu revision is /arcemu . All the bits in green have to be replaced by the corresponding names.
1. Open /YOUR_ARCEMU_ROOT_DIR/src/scripts/Makefile.am
2. You will see something similar to
Code:
SUBDIRS = InstanceScripts GossipScripts ExtraScripts ServerStatusPlugin SpellHandlers LUAScripting QuestScripts EventScripts MiscScripts
Add you script directory name (in my case it is MyScript) so it will look like this :
Code:
SUBDIRS = InstanceScripts GossipScripts ExtraScripts ServerStatusPlugin SpellHandlers LUAScripting QuestScripts EventScripts MiscScripts YOUR_SCRIPT_DIRECORY_NAME
3. Create a new directory with the name you have just added to Makefile.am
4. Open that directory and create a new make file (Makefile.am)
5. Paste that into the makefile replacing CPPFILE with the script's CPP file and LIBNAME with your preferred library name (directory name).
Code:
INCLUDES = -I$(top_srcdir)/src/arcemu-logonserver \
-I$(top_srcdir)/src/arcemu-realmserver -I$(top_srcdir)/src/arcemu-shared -I$(top_srcdir)/src/arcemu-voicechat \
-I$(top_srcdir)/src/arcemu-world -I$(srcdir) -I$(srcdir)/../../../../dep/include \
-I$(srcdir)/../../../../dep/src -I$(srcdir)/../../../../src
AM_CXXFLAGS = -DSCRIPTLIB
lib_LTLIBRARIES = libLIBNAME.la
libLIBNAME_la_SOURCES = Setup.cpp \
CPPFILE.cpp
6. Copy Setup.cpp and Setup.h from any of the script directories for example GossipScripts
7. Get rid of all but one Setup***(mgr); entries.
8. In both of the setup files replace Setup***(mgr); with SetupYOUR_SCRIPT_CLASS_NAME(mgr);
9. If you haven't done it already paste your script's CPP file into the directory
10. In the root direcory open configure.ac. In the "AC_CONFIG_FILES([" section add new line just above "])" : src/scripts/src/YOUR_SCRIPT_DIRECTORY/Makefile
11. Run (in the root directory) 'autoreconf'. This will create makefile input files.
12. You can now compile your server (./configure , make , make install)