PtokaX wiki

Hub (server) for Direct Connect

User Tools

Site Tools



This is an old revision of the document!

Compile on FreeBSD

This guide was tested on clean installation of FreeBSD 7.2.
Everything is done from command line, that means everything can be done over ssh on remote server.

In my case was only base system installed, that means after startup and login i was already in command line and working directory was my home directory.
If you are not in command line then you need to go here some way (ie if gnome is installed then open terminal).

1. Prerequisites.

To download PtokaX and TinyXml source you need wget.
For PtokaX compile you need gmake (tool controlling executable generation from sources) and Lua (programming language used for scripting).
They can be installed using package manager (Note: to install packages using package manager you need root permissions).

  • a. Wget
    Install it with command: pkg_add -r wget
  • b. Gmake
    Install it with command: pkg_add -r gmake
  • c. Lua 5.1
    Install it with command: pkg_add -r lua51

2. Downloading source and compile.

  • a. PtokaX source
    Download it with command: wget
    Unpack downloaded archive with command: tar -xf
    Now we have in actual directory new directory PtokaX. Go to that directory with command: cd PtokaX
  • b. TinyXml source
    TinyXml is library used by PtokaX for reading and writing xml files.
    Download TinyXml with command: wget
    Unpack downloaded archive with command: tar -xf tinyxml_2_6_2.tar.gz
  • c. TinyXml compile
    Go to TinyXml directory with command: cd tinyxml
    Compile TinyXml with command: gmake
    Return back to PtokaX directory with command: cd ..
  • d. PtokaX compile
    PtokaX makefile need three changes.
    Open makefile with command: vim makefile

    1. Search for this line INCLUDE = -Itinyxml/src -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1 and change it to INCLUDE = -Itinyxml/src -I/usr/include -I/usr/local/include -I/usr/local/include/lua51 -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1
    2. Search for this line $(CXX) -lpthread -lz -llua5.1 -lrt -o PtokaX \ and change it to $(CXX) -lpthread -lz -lrt -o PtokaX \
    3. Search for this line $(CURDIR)/tinyxml/tinyxml.a and change it to $(CURDIR)/tinyxml/tinyxml.a /usr/local/lib/lua51/liblua.a

    4. Now you can finally compile PtokaX with command: gmake

3. Setup and run.

guides/freebsd.1350256011.txt.gz · Last modified: 14/10/2012 23:06 by ppk