Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 09-30-2013, 03:58 PM
Corysia
Fire Beetle
 
Join Date: Jul 2007
Location: Pacific Northwest
Posts: 22
Default 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)
Reply With Quote
  #2  
Old 10-01-2013, 02:20 AM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

What is the error on luabind?
Reply With Quote
  #3  
Old 10-01-2013, 12:48 PM
Corysia
Fire Beetle
 
Join Date: Jul 2007
Location: Pacific Northwest
Posts: 22
Default

Quote:
Originally Posted by KLS View Post
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
Reply With Quote
  #5  
Old 10-05-2013, 02:18 AM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

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.
Reply With Quote
  #6  
Old 10-05-2013, 02:29 PM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

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.
Reply With Quote
  #7  
Old 10-10-2013, 02:20 PM
Corysia
Fire Beetle
 
Join Date: Jul 2007
Location: Pacific Northwest
Posts: 22
Default

Quote:
Originally Posted by KLS View Post
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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 06:26 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3