EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   Mac Server (https://www.eqemulator.org/forums/showthread.php?t=37339)

Corysia 09-30-2013 03:58 PM

Mac Server
 
I'm still working on this, so there may be updates/changes coming. But this is what I have today. Currently, I can't build the loginserver because I don't have a libEQEmuAuthCrypto.a for Mac. Also, luabind won't compile.

First, a super-short guide on prerequisites:

Code:

Assuming starting with a clean Mountain Lion installation.

1. Install Xcode

2. Install Mac Ports from http://www.macports.org/

3. install MySQL 5.1 from mac ports
        sudo port install mysql51 mysql51-server
        sudo port select --set mysql mysql51
        sudo -u _mysql /opt/local/lib/mysql51/bin/mysql_install_db
        sudo /opt/local/share/mysql51/mysql/mysql.server start
        sudo /opt/local/lib/mysql51/bin/mysql_secure_installation

4. install gcc 4.8
        sudo port install gcc48
        sudo port select --set gcc mp-gcc48

5. Install cmake
        sudo port install cmake

6. Install Perl
        sudo port install perl5.12 p5.12-dbi
        sudo ln -s /opt/local/bin/perl5.12 /opt/local/bin/perl

7. Install lua
        sudo port install lua
        sudo port install python27
        sudo port select --set python python27
        sudo port install boost
       
8. Update values with cmake . -i
        Say "yes" to the advanced options

        Set installation prefix to /opt/EQ/Server

        Do not enable loginserver
        Do not enable luaparser

        Set the compilers to
                /opt/local/bin/gcc
                /opt/local/bin/g++
        Set the SQL Libraries and paths
                MySQL_INCLUDE_DIR=/opt/local/include/mysql51/mysql
                MySQL_LIBRARY_RELEASE=/opt/local/lib/mysql51/mysql/libmysqlclient_r.dylib
                MySQL_LIBRARY_DEBUG=/opt/local/lib/mysql51/mysql/libmysqlclient_r.dylib

9. configure with: cmake -G "Unix Makefiles"

10. make
11. sudo make install

And the patch:

Code:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 215a356..61b8915 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -94,6 +94,10 @@ IF(UNIX)
                ADD_DEFINITIONS(-DFREEBSD)
                SET(FREEBSD TRUE)
        ENDIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+        IF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+                ADD_DEFINITIONS(-DDARWIN)
+                SET(DARWIN TRUE)
+        ENDIF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
 ENDIF(UNIX)
 
 #use stdint.h types if they exist for this platform (we have to guess otherwise)
diff --git a/common/TCPConnection.cpp b/common/TCPConnection.cpp
index 5fe7b7b..d1bfb5e 100644
--- a/common/TCPConnection.cpp
+++ b/common/TCPConnection.cpp
@@ -30,6 +30,10 @@
 #ifdef FREEBSD //Timothy Whitman - January 7, 2003
        #define MSG_NOSIGNAL 0
 #endif
+#ifdef DARWIN
+        #define MSG_NOSIGNAL SO_NOSIGPIPE // Corysia Taware - Sept. 27, 2013
+        // See http://lists.apple.com/archives/macnetworkprog/2002/Dec/msg00091.html
+#endif        // DARWIN
 
 #ifdef _WINDOWS
 InitWinsock winsock;
diff --git a/eqlaunch/CMakeLists.txt b/eqlaunch/CMakeLists.txt
index 5c9ad6a..467c08e 100644
--- a/eqlaunch/CMakeLists.txt
+++ b/eqlaunch/CMakeLists.txt
@@ -32,7 +32,9 @@ IF(UNIX)
        ENDIF(NOT FREEBSD)
        TARGET_LINK_LIBRARIES(eqlaunch "z")
        TARGET_LINK_LIBRARIES(eqlaunch "m")
-        TARGET_LINK_LIBRARIES(eqlaunch "rt")
+        IF(NOT DARWIN)
+                TARGET_LINK_LIBRARIES(eqlaunch "rt")
+        ENDIF(NOT DARWIN)
        TARGET_LINK_LIBRARIES(eqlaunch "pthread")
        ADD_DEFINITIONS(-fPIC)
 ENDIF(UNIX)
diff --git a/loginserver/CMakeLists.txt b/loginserver/CMakeLists.txt
index 7a4272a..4507c7a 100644
--- a/loginserver/CMakeLists.txt
+++ b/loginserver/CMakeLists.txt
@@ -60,7 +60,9 @@ IF(UNIX)
        ENDIF(NOT FREEBSD)
        TARGET_LINK_LIBRARIES(loginserver "z")
        TARGET_LINK_LIBRARIES(loginserver "m")
-        TARGET_LINK_LIBRARIES(loginserver "rt")
+        IF(NOT DARWIN)
+                TARGET_LINK_LIBRARIES(loginserver "rt")
+        ENDIF(NOT DARWIN)
        TARGET_LINK_LIBRARIES(loginserver "pthread")
        TARGET_LINK_LIBRARIES(loginserver "EQEmuAuthCrypto")
        TARGET_LINK_LIBRARIES(loginserver "cryptopp")
diff --git a/queryserv/CMakeLists.txt b/queryserv/CMakeLists.txt
index 8b8196b..460a422 100644
--- a/queryserv/CMakeLists.txt
+++ b/queryserv/CMakeLists.txt
@@ -38,7 +38,9 @@ IF(UNIX)
        ENDIF(NOT FREEBSD)
        TARGET_LINK_LIBRARIES(queryserv "z")
        TARGET_LINK_LIBRARIES(queryserv "m")
-        TARGET_LINK_LIBRARIES(queryserv "rt")
+        IF(NOT DARWIN)
+                TARGET_LINK_LIBRARIES(queryserv "rt")
+        ENDIF(NOT DARWIN)
        TARGET_LINK_LIBRARIES(queryserv "pthread")
        ADD_DEFINITIONS(-fPIC)
 ENDIF(UNIX)
diff --git a/shared_memory/CMakeLists.txt b/shared_memory/CMakeLists.txt
index 76c8b75..ba188fc 100644
--- a/shared_memory/CMakeLists.txt
+++ b/shared_memory/CMakeLists.txt
@@ -38,7 +38,9 @@ IF(UNIX)
        ENDIF(NOT FREEBSD)
        TARGET_LINK_LIBRARIES(shared_memory "z")
        TARGET_LINK_LIBRARIES(shared_memory "m")
-        TARGET_LINK_LIBRARIES(shared_memory "rt")
+        IF(NOT DARWIN)
+                TARGET_LINK_LIBRARIES(shared_memory "rt")
+        ENDIF(NOT DARWIN)
        TARGET_LINK_LIBRARIES(shared_memory "pthread")
        ADD_DEFINITIONS(-fPIC)
 ENDIF(UNIX)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 649285b..eedf67e 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -30,7 +30,9 @@ IF(UNIX)
        TARGET_LINK_LIBRARIES(tests "dl")
        TARGET_LINK_LIBRARIES(tests "z")
        TARGET_LINK_LIBRARIES(tests "m")
-        TARGET_LINK_LIBRARIES(tests "rt")
+        IF(NOT DARWIN)
+                TARGET_LINK_LIBRARIES(loginserver "rt")
+        ENDIF(NOT DARWIN)
        TARGET_LINK_LIBRARIES(tests "pthread")
        ADD_DEFINITIONS(-fPIC)
 ENDIF(UNIX)
diff --git a/ucs/CMakeLists.txt b/ucs/CMakeLists.txt
index 6603470..6d23812 100644
--- a/ucs/CMakeLists.txt
+++ b/ucs/CMakeLists.txt
@@ -41,7 +41,9 @@ IF(UNIX)
        ENDIF(NOT FREEBSD)
        TARGET_LINK_LIBRARIES(ucs "z")
        TARGET_LINK_LIBRARIES(ucs "m")
-        TARGET_LINK_LIBRARIES(ucs "rt")
+        IF(NOT DARWIN)
+                TARGET_LINK_LIBRARIES(ucs "rt")
+        ENDIF(NOT DARWIN)
        TARGET_LINK_LIBRARIES(ucs "pthread")
        ADD_DEFINITIONS(-fPIC)
 ENDIF(UNIX)
diff --git a/world/CMakeLists.txt b/world/CMakeLists.txt
index a145054..d2c1704 100644
--- a/world/CMakeLists.txt
+++ b/world/CMakeLists.txt
@@ -87,7 +87,9 @@ IF(UNIX)
        ENDIF(NOT FREEBSD)
        TARGET_LINK_LIBRARIES(world "z")
        TARGET_LINK_LIBRARIES(world "m")
-        TARGET_LINK_LIBRARIES(world "rt")
+        IF(NOT DARWIN)
+                TARGET_LINK_LIBRARIES(world "rt")
+        ENDIF(NOT DARWIN)
        TARGET_LINK_LIBRARIES(world "pthread")
        ADD_DEFINITIONS(-fPIC)
 ENDIF(UNIX)
diff --git a/world/net.cpp b/world/net.cpp
index 057367b..8be3283 100644
--- a/world/net.cpp
+++ b/world/net.cpp
@@ -56,7 +56,7 @@
        #include <sys/ipc.h>
        #include <sys/sem.h>
        #include <sys/shm.h>
-        #ifndef FREEBSD
+        #if not defined (FREEBSD) && not defined (DARWIN)
                union semun {
                        int val;
                        struct semid_ds *buf;
diff --git a/zone/CMakeLists.txt b/zone/CMakeLists.txt
index 3cf5b0c..7264b6c 100644
--- a/zone/CMakeLists.txt
+++ b/zone/CMakeLists.txt
@@ -228,7 +228,9 @@ IF(UNIX)
        ENDIF(NOT FREEBSD)
        TARGET_LINK_LIBRARIES(zone "z")
        TARGET_LINK_LIBRARIES(zone "m")
-        TARGET_LINK_LIBRARIES(zone "rt")
+        IF(NOT DARWIN)
+                TARGET_LINK_LIBRARIES(zone "rt")
+        ENDIF(NOT DARWIN)
        TARGET_LINK_LIBRARIES(zone "pthread")
        ADD_DEFINITIONS(-fPIC)
 ENDIF(UNIX)


KLS 10-01-2013 02:20 AM

What is the error on luabind?

Corysia 10-01-2013 12:48 PM

Quote:

Originally Posted by KLS (Post 224544)
What is the error on luabind?

Code:

[  1%] Building CXX object luabind/CMakeFiles/luabind.dir/src/class.cpp.o
In file included from /Users/corysia/EQ/EQServer/luabind/luabind/detail/convert_to_lua.hpp:28:0,
                from /Users/corysia/EQ/EQServer/luabind/luabind/detail/call_member.hpp:30,
                from /Users/corysia/EQ/EQServer/luabind/luabind/wrapper_base.hpp:31,
                from /Users/corysia/EQ/EQServer/luabind/luabind/back_reference.hpp:27,
                from /Users/corysia/EQ/EQServer/luabind/luabind/class.hpp:93,
                from /Users/corysia/EQ/EQServer/luabind/src/class.cpp:30:
/Users/corysia/EQ/EQServer/luabind/luabind/detail/policy.hpp: In member function 'std::string luabind::default_converter<std::basic_string<char> >::from(lua_State*, int)':
/Users/corysia/EQ/EQServer/luabind/luabind/detail/policy.hpp:748:71: error: 'lua_strlen' was not declared in this scope
        return std::string(lua_tostring(L, index), lua_strlen(L, index));

I also see:

Code:

/Users/corysia/EQ/EQServer/luabind/luabind/object.hpp:1210:32: error: 'LUA_GLOBALSINDEX' was not declared in this scope

/Users/corysia/EQ/EQServer/luabind/luabind/object.hpp:526:49: error: 'lua_equal' was not declared in this scope

I've got lua 5.2.2 installed
Code:

/Users/corysia/EQ/EQServer> lua -v
Lua 5.2.2  Copyright (C) 1994-2013 Lua.org, PUC-Rio


demonstar55 10-01-2013 12:52 PM

https://github.com/Bertram25/ValyriaTear/issues/80 see this issue

EDIT:
http://www.lua.org/manual/5.2/manual.html#lua_rawlen and http://www.lua.org/manual/5.2/manual.html#lua_rawlen and http://www.lua.org/manual/5.2/manual.html#lua_compare

KLS 10-05-2013 02:18 AM

Looked into this and: I've got 5.2 working currently locally but will be a little bit before i can push this out to master.

cavedude 10-05-2013 02:29 PM

If somebody can hook me up with a working VMWare MacOS image with the developmental environment already setup (not sure if there is some sort of trial, self destruct timer, or other legal means to do this), I can attempt to compile libEQEmuAuthCrypto.a and upload it to git. I don't have an Intel Mac, and don't know a lot about the platform so it isn't worth my time to set it up from scratch.

The source for the crypto cannot be released.

Corysia 10-10-2013 02:20 PM

Quote:

Originally Posted by KLS (Post 224635)
Looked into this and: I've got 5.2 working currently locally but will be a little bit before i can push this out to master.

I think I'll wait for that. I've all kinds of lua_compare() errors and the globals. I tried introducing a -DLUA52 param to ifdef around, but it seems too much like a kluge. I don't know enough about LUA or cmake to do this right.

Corysia 03-31-2014 04:34 PM

Here's the latest version of my patch. With the updates to LUA, everything now builds and installs except the loginserver. I haven't any hope of that working until I can work with CaveDude.

This patch is much the same as the previous one. Just two more CMakeList.txt files needed a test to avoid linking in librt on OSX.


Code:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e390336..e567b1d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -99,6 +99,10 @@ IF(UNIX)
                ADD_DEFINITIONS(-DFREEBSD)
                SET(FREEBSD TRUE)
        ENDIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+        IF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+                ADD_DEFINITIONS(-DDARWIN)
+                SET(DARWIN TRUE)
+        ENDIF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
 ENDIF(UNIX)
 
 #use stdint.h types if they exist for this platform (we have to guess otherwise)
diff --git a/client_files/export/CMakeLists.txt b/client_files/export/CMakeLists.txt
index 1911840..851aa05 100644
--- a/client_files/export/CMakeLists.txt
+++ b/client_files/export/CMakeLists.txt
@@ -26,7 +26,9 @@ IF(UNIX)
        TARGET_LINK_LIBRARIES(export_client_files "${CMAKE_DL_LIBS}")
        TARGET_LINK_LIBRARIES(export_client_files "z")
        TARGET_LINK_LIBRARIES(export_client_files "m")
-        TARGET_LINK_LIBRARIES(export_client_files "rt")
+        IF(NOT DARWIN)
+                TARGET_LINK_LIBRARIES(export_client_files "rt")
+        ENDIF(NOT DARWIN)
        TARGET_LINK_LIBRARIES(export_client_files "pthread")
        ADD_DEFINITIONS(-fPIC)
 ENDIF(UNIX)
diff --git a/client_files/import/CMakeLists.txt b/client_files/import/CMakeLists.txt
index 9487530..0b6c45b 100644
--- a/client_files/import/CMakeLists.txt
+++ b/client_files/import/CMakeLists.txt
@@ -26,7 +26,9 @@ IF(UNIX)
        TARGET_LINK_LIBRARIES(import_client_files "${CMAKE_DL_LIBS}")
        TARGET_LINK_LIBRARIES(import_client_files "z")
        TARGET_LINK_LIBRARIES(import_client_files "m")
-        TARGET_LINK_LIBRARIES(import_client_files "rt")
+        IF(NOT DARWIN)
+                TARGET_LINK_LIBRARIES(import_client_files "rt")
+        ENDIF(NOT DARWIN)
        TARGET_LINK_LIBRARIES(import_client_files "pthread")
        ADD_DEFINITIONS(-fPIC)
 ENDIF(UNIX)
diff --git a/common/TCPConnection.cpp b/common/TCPConnection.cpp
index e576f95..1e5f496 100644
--- a/common/TCPConnection.cpp
+++ b/common/TCPConnection.cpp
@@ -30,6 +30,10 @@
 #ifdef FREEBSD //Timothy Whitman - January 7, 2003
        #define MSG_NOSIGNAL 0
 #endif
+#ifdef DARWIN
+        #define MSG_NOSIGNAL SO_NOSIGPIPE // Corysia Taware - Sept. 27, 2013
+        // See http://lists.apple.com/archives/macnetworkprog/2002/Dec/msg00091.html
+#endif        // DARWIN
 
 #ifdef _WINDOWS
 InitWinsock winsock;
diff --git a/eqlaunch/CMakeLists.txt b/eqlaunch/CMakeLists.txt
index 0f0114c..b636a18 100644
--- a/eqlaunch/CMakeLists.txt
+++ b/eqlaunch/CMakeLists.txt
@@ -30,7 +30,9 @@ IF(UNIX)
        TARGET_LINK_LIBRARIES(eqlaunch "${CMAKE_DL_LIBS}")
        TARGET_LINK_LIBRARIES(eqlaunch "z")
        TARGET_LINK_LIBRARIES(eqlaunch "m")
-        TARGET_LINK_LIBRARIES(eqlaunch "rt")
+        IF(NOT DARWIN)
+                TARGET_LINK_LIBRARIES(eqlaunch "rt")
+        ENDIF(NOT DARWIN)
        TARGET_LINK_LIBRARIES(eqlaunch "pthread")
        ADD_DEFINITIONS(-fPIC)
 ENDIF(UNIX)
diff --git a/loginserver/CMakeLists.txt b/loginserver/CMakeLists.txt
index ba96b1f..9ded859 100644
--- a/loginserver/CMakeLists.txt
+++ b/loginserver/CMakeLists.txt
@@ -58,7 +58,9 @@ IF(UNIX)
        TARGET_LINK_LIBRARIES(loginserver "${CMAKE_DL_LIBS}")
        TARGET_LINK_LIBRARIES(loginserver "z")
        TARGET_LINK_LIBRARIES(loginserver "m")
-        TARGET_LINK_LIBRARIES(loginserver "rt")
+        IF(NOT DARWIN)
+                TARGET_LINK_LIBRARIES(loginserver "rt")
+        ENDIF(NOT DARWIN)
        TARGET_LINK_LIBRARIES(loginserver "pthread")
        TARGET_LINK_LIBRARIES(loginserver "EQEmuAuthCrypto")
        TARGET_LINK_LIBRARIES(loginserver "cryptopp")
diff --git a/queryserv/CMakeLists.txt b/queryserv/CMakeLists.txt
index a8480ca..33be865 100644
--- a/queryserv/CMakeLists.txt
+++ b/queryserv/CMakeLists.txt
@@ -36,7 +36,9 @@ IF(UNIX)
        TARGET_LINK_LIBRARIES(queryserv "${CMAKE_DL_LIBS}")
        TARGET_LINK_LIBRARIES(queryserv "z")
        TARGET_LINK_LIBRARIES(queryserv "m")
-        TARGET_LINK_LIBRARIES(queryserv "rt")
+        IF(NOT DARWIN)
+                TARGET_LINK_LIBRARIES(queryserv "rt")
+        ENDIF(NOT DARWIN)
        TARGET_LINK_LIBRARIES(queryserv "pthread")
        ADD_DEFINITIONS(-fPIC)
 ENDIF(UNIX)
diff --git a/shared_memory/CMakeLists.txt b/shared_memory/CMakeLists.txt
index 863b563..3d23a1b 100644
--- a/shared_memory/CMakeLists.txt
+++ b/shared_memory/CMakeLists.txt
@@ -38,7 +38,9 @@ IF(UNIX)
        TARGET_LINK_LIBRARIES(shared_memory "${CMAKE_DL_LIBS}")
        TARGET_LINK_LIBRARIES(shared_memory "z")
        TARGET_LINK_LIBRARIES(shared_memory "m")
-        TARGET_LINK_LIBRARIES(shared_memory "rt")
+        IF(NOT DARWIN)
+                TARGET_LINK_LIBRARIES(shared_memory "rt")
+        ENDIF(NOT DARWIN)
        TARGET_LINK_LIBRARIES(shared_memory "pthread")
        ADD_DEFINITIONS(-fPIC)
 ENDIF(UNIX)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 80f6a2f..aef5124 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -32,7 +32,9 @@ IF(UNIX)
        TARGET_LINK_LIBRARIES(tests "${CMAKE_DL_LIBS}")
        TARGET_LINK_LIBRARIES(tests "z")
        TARGET_LINK_LIBRARIES(tests "m")
-        TARGET_LINK_LIBRARIES(tests "rt")
+        IF(NOT DARWIN)
+                TARGET_LINK_LIBRARIES(loginserver "rt")
+        ENDIF(NOT DARWIN)
        TARGET_LINK_LIBRARIES(tests "pthread")
        ADD_DEFINITIONS(-fPIC)
 ENDIF(UNIX)
diff --git a/ucs/CMakeLists.txt b/ucs/CMakeLists.txt
index 27a8a07..4468183 100644
--- a/ucs/CMakeLists.txt
+++ b/ucs/CMakeLists.txt
@@ -38,7 +38,9 @@ IF(UNIX)
        TARGET_LINK_LIBRARIES(ucs "${CMAKE_DL_LIBS}")
        TARGET_LINK_LIBRARIES(ucs "z")
        TARGET_LINK_LIBRARIES(ucs "m")
-        TARGET_LINK_LIBRARIES(ucs "rt")
+        IF(NOT DARWIN)
+                TARGET_LINK_LIBRARIES(ucs "rt")
+        ENDIF(NOT DARWIN)
        TARGET_LINK_LIBRARIES(ucs "pthread")
        ADD_DEFINITIONS(-fPIC)
 ENDIF(UNIX)
diff --git a/world/CMakeLists.txt b/world/CMakeLists.txt
index 2decbf4..3ac0082 100644
--- a/world/CMakeLists.txt
+++ b/world/CMakeLists.txt
@@ -84,7 +84,9 @@ IF(UNIX)
        TARGET_LINK_LIBRARIES(world "${CMAKE_DL_LIBS}")
        TARGET_LINK_LIBRARIES(world "z")
        TARGET_LINK_LIBRARIES(world "m")
-        TARGET_LINK_LIBRARIES(world "rt")
+        IF(NOT DARWIN)
+                TARGET_LINK_LIBRARIES(world "rt")
+        ENDIF(NOT DARWIN)
        TARGET_LINK_LIBRARIES(world "pthread")
        ADD_DEFINITIONS(-fPIC)
 ENDIF(UNIX)
diff --git a/world/net.cpp b/world/net.cpp
index 057367b..8be3283 100644
--- a/world/net.cpp
+++ b/world/net.cpp
@@ -56,7 +56,7 @@
        #include <sys/ipc.h>
        #include <sys/sem.h>
        #include <sys/shm.h>
-        #ifndef FREEBSD
+        #if not defined (FREEBSD) && not defined (DARWIN)
                union semun {
                        int val;
                        struct semid_ds *buf;
diff --git a/zone/CMakeLists.txt b/zone/CMakeLists.txt
index 49410f0..e582e0c 100644
--- a/zone/CMakeLists.txt
+++ b/zone/CMakeLists.txt
@@ -230,7 +230,9 @@ IF(UNIX)
        TARGET_LINK_LIBRARIES(zone "${CMAKE_DL_LIBS}")
        TARGET_LINK_LIBRARIES(zone "z")
        TARGET_LINK_LIBRARIES(zone "m")
-        TARGET_LINK_LIBRARIES(zone "rt")
+        IF(NOT DARWIN)
+                TARGET_LINK_LIBRARIES(zone "rt")
+        ENDIF(NOT DARWIN)
        TARGET_LINK_LIBRARIES(zone "pthread")
        ADD_DEFINITIONS(-fPIC)
 ENDIF(UNIX)


Corysia 04-02-2014 04:19 PM

Here are some updated instructions for how to compile and install the binaries without the loginserver.

Assuming starting with a clean Mountain Lion installation.

Code:

1. Install Xcode

2. Install Mac Ports from http://www.macports.org/

3. Install MySQL 5.1 from mac ports and configure

    3a. Install
        sudo port install mysql51 mysql51-server
        sudo port select --set mysql mysql51
        sudo -u _mysql /opt/local/lib/mysql51/bin/mysql_install_db

    3b. Set up mysql's listening port
        sudo cp /opt/local/etc/mysql51/my.cnf /opt/local/etc/mysql51/my.cnf.old
        sudo cp /opt/local/etc/mysql51/macports-default.cnf /opt/local/etc/mysql51/my.cnf
        Edit /opt/local/etc/mysql51/my.cnf with the editor of your choice (remember to sudo) and comment out the "skip-networking" line.  Example:
        sudo sed -i '' -e's/^skip/#skip/' /opt/local/etc/mysql51/my.cnf
       
    3c. Start mysql by hand
        sudo /opt/local/share/mysql51/mysql/mysql.server start
        sudo /opt/local/lib/mysql51/bin/mysql_secure_installation

4. install gcc 4.8
        sudo port install gcc48
        sudo port select --set gcc mp-gcc48

5. Install cmake
        sudo port install cmake

6. Install Perl
        sudo port install perl5.12 p5.12-dbi
        sudo ln -s /opt/local/bin/perl5.12 /opt/local/bin/perl

7. Install lua
        sudo port install lua
        sudo port install python27
        sudo port select --set python python27
        sudo port install boost

8. Download the EQEmulator server source code.  I will assume you'll put this in your home directory under EQServer/source.
        mkdir ~/EQServer
        cd ~/EQServer
        git clone git://github.com/EQEmu/Server.git source

9. If my changes have not been applied to support Mac, patch the source with my patch.  I will assume you've copied them into a file called "corysia-mac.patch" and placed it in to the source directory.

        cd ~/EQServer/source

    9a.        First, test that the patch is going to still work.
        patch --dry-run -p 1 -i corysia-mac.patch

        *** NOTE***
        If you get a message like:
                can't find file to patch at input line 5
                Perhaps you used the wrong -p or --strip option?
        Then you forgot to CD into the source directory.

    9b. If that command didn't produce any errors, go ahead and patch.
        patch -p 1 -i corysia-mac.patch

10. Update values with cmake . -i

        Answer "yes" to the question about advanced options.

        It's now going to ask you a lot of questions.  I suggest opening a second terminal window and for each program it asks about, use the 'which' command to find the right path to it.  For example:

                Variable Name: CMAKE_AR
                Description: Path to a program.
                Current Value: /usr/bin/ar
                New Value (Enter to keep current value):

                Now in the other terminal, type "which ar" and it will come back with "/opt/local/bin/ar".  Enter that as the value instead of the default "usr/bin/ar".  This is tedious, but necessary.  You only need to do this once, however.

        Set installation prefix to /opt/EQServer/bin

        Do not enable loginserver

        Set the compilers to
                /opt/local/bin/gcc
                /opt/local/bin/g++
        Set the SQL Libraries and paths
                MySQL_INCLUDE_DIR=/opt/local/include/mysql51/mysql
                MySQL_LIBRARY_RELEASE=/opt/local/lib/mysql51/mysql/libmysqlclient_r.dylib
                MySQL_LIBRARY_DEBUG=/opt/local/lib/mysql51/mysql/libmysqlclient_r.dylib

11. configure with: cmake -G "Unix Makefiles"

        *** NOTE ***
        Often at this point, I get this error:
                CMake Error at /opt/local/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
                    Could NOT find MySQL (missing: MySQL_LIBRARY_DEBUG MySQL_LIBRARY_RELEASE MySQL_INCLUDE_DIR)

        To fix it, I just run "cmake . -i" again.  This time I answer 'no' to the advanced options.  And, I always find that my choices for servers and destination directory on install hasn't been set.

        I usually run cmake . -i a third time and review the settings, answering 'no' to advanced options.

12. make
13. sudo make install



All times are GMT -4. The time now is 12:46 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.