Difference between revisions of "Building MTASA Server on macOS"

From Multi Theft Auto: Wiki
(Created page with ' == '''Building on Mac OS X''' == == Preparing your system == In order to build the Multi Theft Auto dedicated server, you will have to set up your system with the correct li…')
 
 
(18 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 
+
{{Needs Checking|Does not currently compile correctly on macOS}}
== '''Building on Mac OS X''' ==
 
 
 
 
 
 
== Preparing your system ==
 
== Preparing your system ==
  
  
In order to build the Multi Theft Auto dedicated server, you will have to set up your system with the correct libraries and tools. In order to get these, you will have to install the latest MacPorts release.
+
In order to build the Multi Theft Auto dedicated server, you will have to set up your system with the correct libraries and tools. In order to get these, you will have to install the latest [http://www.macports.org/ MacPorts release.]
 
 
Our network module is distributed as a precompiled binary library. The latest version for Mac OS X can be downloaded from our Downloads page on GitHub.
 
  
 +
Our network module is distributed as a precompiled binary library. The latest version for Mac OS X can be downloaded from our [http://mtasa-blue.google.com Downloads page] on Google Code.
  
 
== Setting up MacPorts ==
 
== Setting up MacPorts ==
  
  
Since our software relies on a number of well known libraries that are not shipped on a vanilla Mac OS X system, it may be necessary for you to install these first. With the MacPorts software you can easily download and install these libraries, so follow the installation instructions at macports.org.
+
Since our software relies on a number of well known libraries that are not shipped on a vanilla Mac OS X system, it may be necessary for you to install these first. With the MacPorts software you can easily download and install these libraries, so follow the [http://www.macports.org/install.php installation instructions] at macports.org.
  
 
After installing MacPorts, you should install the following packages:
 
After installing MacPorts, you should install the following packages:
Line 20: Line 16:
 
* pcre
 
* pcre
 
* zlib
 
* zlib
* google-sparsehash
+
* sparsehash
 
* curl
 
* curl
To install these packages, use the port install <package> command in your Terminal application. If you are not running as root, you will have to use sudo in front.
+
To install these packages, use the '''port install <package>''' command in your Terminal application. If you are not running as root, you will have to use '''sudo''' in front.
 
 
 
 
 
 
  
 
== Compiling the server ==
 
== Compiling the server ==
Line 31: Line 24:
  
  
MacPorts installs itself into /opt/local by default, so we will have to pass the appropriate compiler and linker search path flags to the configure command.
+
MacPorts installs itself into '''/opt/local''' by default, so we will have to pass the appropriate compiler and linker search path flags to the configure command.
  
 
<syntaxhighlight lang="lua">autoreconf -fi
 
<syntaxhighlight lang="lua">autoreconf -fi
 
CPPFLAGS="-I/opt/local/include" LDFLAGS="-L/opt/local/lib" ./configure
 
CPPFLAGS="-I/opt/local/include" LDFLAGS="-L/opt/local/lib" ./configure
 
make install</syntaxhighlight>
 
make install</syntaxhighlight>
Your vanilla server will now be compiled and installed into the MTA10_Server/output/ directory.
+
Your vanilla server will now be compiled and installed into the '''MTA10_Server/output/''' directory.
  
Run the server
+
 
Grab the latest net.so from the Downloads page on GitHub and place it in your output directory, install the accounts.xml, mtaserver.conf and acl.xml files into the mods/deathmatch/ directory and grab the latest resources from the multitheftauto-resources project. You can then run your server.
+
== Run the server ==
 +
 
 +
 
 +
Grab the latest '''net.so''' from the Downloads page on GitHub and place it in your output directory, install the '''accounts.xml''', '''mtaserver.conf''' and '''acl.xml''' files into the '''mods/deathmatch/''' directory and grab the latest resources from the [http://code.google.com/p/mtasa-resources/ multitheftauto-resources project]. You can then run your server.
  
 
<syntaxhighlight lang="lua">cd MTA10_Server/output
 
<syntaxhighlight lang="lua">cd MTA10_Server/output
 
./mta-server</syntaxhighlight>
 
./mta-server</syntaxhighlight>
 +
 +
= todo =
 +
this section is for a work-in-progress effort to make mta compilable on macOS
 +
 +
* Use brew to install ncurses (brew install ncurses) ---actually I think macOS comes with ncurses
 +
 +
[[ru:Building MTASA Server on Mac OS X]]
 +
[[Category: Development]]

Latest revision as of 22:48, 20 May 2019

Dialog-information.png This article needs checking.

Reason(s): Does not currently compile correctly on macOS

Preparing your system

In order to build the Multi Theft Auto dedicated server, you will have to set up your system with the correct libraries and tools. In order to get these, you will have to install the latest MacPorts release.

Our network module is distributed as a precompiled binary library. The latest version for Mac OS X can be downloaded from our Downloads page on Google Code.

Setting up MacPorts

Since our software relies on a number of well known libraries that are not shipped on a vanilla Mac OS X system, it may be necessary for you to install these first. With the MacPorts software you can easily download and install these libraries, so follow the installation instructions at macports.org.

After installing MacPorts, you should install the following packages:

  • pcre
  • zlib
  • sparsehash
  • curl

To install these packages, use the port install <package> command in your Terminal application. If you are not running as root, you will have to use sudo in front.

Compiling the server

MacPorts installs itself into /opt/local by default, so we will have to pass the appropriate compiler and linker search path flags to the configure command.

autoreconf -fi
CPPFLAGS="-I/opt/local/include" LDFLAGS="-L/opt/local/lib" ./configure
make install

Your vanilla server will now be compiled and installed into the MTA10_Server/output/ directory.


Run the server

Grab the latest net.so from the Downloads page on GitHub and place it in your output directory, install the accounts.xml, mtaserver.conf and acl.xml files into the mods/deathmatch/ directory and grab the latest resources from the multitheftauto-resources project. You can then run your server.

cd MTA10_Server/output
./mta-server

todo

this section is for a work-in-progress effort to make mta compilable on macOS

  • Use brew to install ncurses (brew install ncurses) ---actually I think macOS comes with ncurses