Difference between revisions of "Installation"
Jump to navigation
Jump to search
m | |||
You can either change it in the mineserver source code - or - move it to the right location. | You can either change it in the mineserver source code - or - move it to the right location. | ||
| + | ====OS X==== | ||
| + | You can install zlib and libevent using Macports: | ||
| + | |||
| + | sudo port install zlib libevent | ||
| + | |||
| + | You will need to build libnoise yourself. On OS X, this is best done by using qknight's unofficial branch. First install the libnoise prerequisities: | ||
| + | |||
| + | sudo port install cmake doxygen | ||
| + | |||
| + | Now you can get the code: | ||
| + | |||
| + | git clone https://github.com/qknight/libnoise | ||
| + | cd libnoise | ||
| + | mkdir build | ||
| + | cd build | ||
| + | cmake .. | ||
| + | make | ||
| + | sudo make install | ||
| + | |||
| + | Finally, we need to create a symlink so that Mineserver finds the header files where it expects them (this saves us using sed on the source code): | ||
| + | |||
| + | sudo ln -s /usr/local/include/noise /usr/local/include/libnoise | ||
| + | |||
===== Change the source code ===== | ===== Change the source code ===== | ||
If you want to replace all instances of 'libnoise' with 'noise' in the source code, you can simply run the <code>sed</code> application (it's usually released with all major distributions), like so: | If you want to replace all instances of 'libnoise' with 'noise' in the source code, you can simply run the <code>sed</code> application (it's usually released with all major distributions), like so: | ||
Ensure that you have all the prerequisites installed. <code>zlib.h</code> is zlib, <code>event.h</code> is libevent and <code>noise.h</code>, <code>interp.h</code> or <code>mathconsts.h</code> are libnoise. | Ensure that you have all the prerequisites installed. <code>zlib.h</code> is zlib, <code>event.h</code> is libevent and <code>noise.h</code>, <code>interp.h</code> or <code>mathconsts.h</code> are libnoise. | ||
| + | ====OS X==== | ||
| + | |||
| + | Firstly, until batterseapowers patches are merged, you need to change these lines in src/Makefile: | ||
| + | |||
| + | LDFLAGS = -L/usr/local/lib -L/usr/lib -levent -lz -lnoise $(LFLAGS) | ||
| + | CXXFLAGS = $(DFLAGS) -I. -I/usr/Local/include -I/usr/include | ||
| + | |||
| + | To these: | ||
| + | |||
| + | LDFLAGS += -L/usr/local/lib -L/usr/lib -levent -lz -lnoise $(LFLAGS) | ||
| + | CXXFLAGS += $(DFLAGS) -I. -I/usr/Local/include -I/usr/include | ||
| + | |||
| + | This just allows us to supply some extra LDFLAGS and CXXFLAGS on the command line. Now you can build, ensuring that you point the compiler to any Macports-installed headers and libraries: | ||
| + | |||
| + | cd src | ||
| + | CXXFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib make | ||
| + | |||
===Editing the Config=== | ===Editing the Config=== | ||
