Changes for MacOS. Can be compiled, but there are still some issues.
This commit is contained in:
+3
-1
@@ -12,12 +12,14 @@
|
|||||||
|
|
||||||
QT_FW_PATH="/Library/Frameworks"
|
QT_FW_PATH="/Library/Frameworks"
|
||||||
SDL_FW_PATH="/Library/Frameworks"
|
SDL_FW_PATH="/Library/Frameworks"
|
||||||
APPLICATION="./bin/pokerth.app"
|
APPLICATION="./pokerth.app"
|
||||||
BINARY="$APPLICATION/Contents/MacOs/pokerth"
|
BINARY="$APPLICATION/Contents/MacOs/pokerth"
|
||||||
|
RESOURCES="$APPLICATION/Contents/Resources/"
|
||||||
|
|
||||||
# strip binary
|
# strip binary
|
||||||
strip $BINARY
|
strip $BINARY
|
||||||
|
|
||||||
|
cp -R ./data $RESOURCES
|
||||||
# create framework-path
|
# create framework-path
|
||||||
BINARY_FW_PATH="$APPLICATION/Contents/Frameworks"
|
BINARY_FW_PATH="$APPLICATION/Contents/Frameworks"
|
||||||
mkdir $BINARY_FW_PATH
|
mkdir $BINARY_FW_PATH
|
||||||
|
|||||||
+9
-5
@@ -3,8 +3,8 @@
|
|||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
CODECFORSRC = UTF-8
|
CODECFORSRC = UTF-8
|
||||||
|
|
||||||
#CONFIG += qt thread embed_manifest_exe warn_on release
|
#CONFIG += qt thread embed_manifest_exe exceptions rtti stl warn_on release
|
||||||
CONFIG += qt thread embed_manifest_exe warn_on debug
|
CONFIG += qt thread embed_manifest_exe exceptions rtti stl warn_on debug
|
||||||
|
|
||||||
#Uncomment this for RELEASE
|
#Uncomment this for RELEASE
|
||||||
#QTPLUGIN += qjpeg qgif
|
#QTPLUGIN += qjpeg qgif
|
||||||
@@ -348,6 +348,8 @@ mac{
|
|||||||
# on Intel-Mac you have to comment this line out or build will fail.
|
# on Intel-Mac you have to comment this line out or build will fail.
|
||||||
# QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk/
|
# QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk/
|
||||||
|
|
||||||
|
LIBPATH += lib
|
||||||
|
LIBS += -lpokerth_lib
|
||||||
# Qt static (path is standard for self-compiling qt)
|
# Qt static (path is standard for self-compiling qt)
|
||||||
#LIBS += /usr/local/Trolltech/Qt-4.2.3/lib/libQtCore.a
|
#LIBS += /usr/local/Trolltech/Qt-4.2.3/lib/libQtCore.a
|
||||||
#LIBS += /usr/local/Trolltech/Qt-4.2.3/lib/libQtGui.a
|
#LIBS += /usr/local/Trolltech/Qt-4.2.3/lib/libQtGui.a
|
||||||
@@ -359,13 +361,15 @@ mac{
|
|||||||
LIBS += -framework SDL_mixer
|
LIBS += -framework SDL_mixer
|
||||||
# standard path for darwinports
|
# standard path for darwinports
|
||||||
# make sure you have a universal version of boost
|
# make sure you have a universal version of boost
|
||||||
LIBS += /opt/local/lib/libboost_thread.a
|
LIBS += /opt/local/lib/libboost_thread-gcc40-mt-1_34.a
|
||||||
|
LIBS += /opt/local/lib/libboost_filesystem-gcc40-mt-1_34.a
|
||||||
# libraries installed on every mac
|
# libraries installed on every mac
|
||||||
LIBS += -lcrypto -lz -framework Carbon
|
LIBS += -lcrypto -lz -framework Carbon
|
||||||
# set the application icon
|
# set the application icon
|
||||||
RC_FILE = pokerth.icns
|
RC_FILE = pokerth.icns
|
||||||
LIBPATH += /Developer/SDKs/MacOSX10.4u.sdk/usr/lib
|
LIBPATH += /Developer/SDKs/MacOSX10.5.sdk/usr/lib
|
||||||
INCLUDEPATH += /Developer/SDKs/MacOSX10.4u.sdk/usr/include/
|
INCLUDEPATH += /Developer/SDKs/MacOSX10.5.sdk/usr/include/
|
||||||
INCLUDEPATH += /Library/Frameworks/SDL.framework/Headers
|
INCLUDEPATH += /Library/Frameworks/SDL.framework/Headers
|
||||||
INCLUDEPATH += /Library/Frameworks/SDL_mixer.framework/Headers
|
INCLUDEPATH += /Library/Frameworks/SDL_mixer.framework/Headers
|
||||||
|
INCLUDEPATH += /opt/local/include
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-3
@@ -3,8 +3,8 @@
|
|||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
CODECFORSRC = UTF-8
|
CODECFORSRC = UTF-8
|
||||||
|
|
||||||
#CONFIG += staticlib thread warn_on release
|
#CONFIG += staticlib thread exceptions rtti stl warn_on release
|
||||||
CONFIG += staticlib thread warn_on debug
|
CONFIG += staticlib thread exceptions rtti stl warn_on debug
|
||||||
|
|
||||||
UI_DIR = uics
|
UI_DIR = uics
|
||||||
TARGET = lib/pokerth_lib
|
TARGET = lib/pokerth_lib
|
||||||
@@ -197,7 +197,8 @@ mac{
|
|||||||
# on Intel-Mac you have to comment this line out or build will fail.
|
# on Intel-Mac you have to comment this line out or build will fail.
|
||||||
# QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk/
|
# QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk/
|
||||||
|
|
||||||
INCLUDEPATH += /Developer/SDKs/MacOSX10.4u.sdk/usr/include/
|
INCLUDEPATH += /Developer/SDKs/MacOSX10.5.sdk/usr/include/
|
||||||
INCLUDEPATH += /Library/Frameworks/SDL.framework/Headers
|
INCLUDEPATH += /Library/Frameworks/SDL.framework/Headers
|
||||||
INCLUDEPATH += /Library/Frameworks/SDL_mixer.framework/Headers
|
INCLUDEPATH += /Library/Frameworks/SDL_mixer.framework/Headers
|
||||||
|
INCLUDEPATH += /opt/local/include
|
||||||
}
|
}
|
||||||
|
|||||||
+27
-2
@@ -3,8 +3,8 @@
|
|||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
CODECFORSRC = UTF-8
|
CODECFORSRC = UTF-8
|
||||||
|
|
||||||
#CONFIG += thread console embed_manifest_exe warn_on release
|
#CONFIG += thread console embed_manifest_exe exceptions rtti stl warn_on release
|
||||||
CONFIG += thread console embed_manifest_exe warn_on debug
|
CONFIG += thread console embed_manifest_exe exceptions rtti stl warn_on debug
|
||||||
|
|
||||||
UI_DIR = uics
|
UI_DIR = uics
|
||||||
TARGET = bin/pokerth_server
|
TARGET = bin/pokerth_server
|
||||||
@@ -194,3 +194,28 @@ unix : !mac {
|
|||||||
## My release static libs
|
## My release static libs
|
||||||
#LIBS += -lcrypto
|
#LIBS += -lcrypto
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mac{
|
||||||
|
# make it universal
|
||||||
|
CONFIG += x86
|
||||||
|
CONFIG += ppc
|
||||||
|
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.3
|
||||||
|
|
||||||
|
# for universal-compilation on PPC-Mac uncomment the following line
|
||||||
|
# on Intel-Mac you have to comment this line out or build will fail.
|
||||||
|
# QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk/
|
||||||
|
|
||||||
|
LIBPATH += lib
|
||||||
|
LIBS += -lpokerth_lib
|
||||||
|
# standard path for darwinports
|
||||||
|
# make sure you have a universal version of boost
|
||||||
|
LIBS += /opt/local/lib/libboost_thread-gcc40-mt-1_34.a
|
||||||
|
LIBS += /opt/local/lib/libboost_filesystem-gcc40-mt-1_34.a
|
||||||
|
# libraries installed on every mac
|
||||||
|
LIBS += -lcrypto -liconv
|
||||||
|
# set the application icon
|
||||||
|
RC_FILE = pokerth.icns
|
||||||
|
LIBPATH += /Developer/SDKs/MacOSX10.5.sdk/usr/lib
|
||||||
|
INCLUDEPATH += /Developer/SDKs/MacOSX10.5.sdk/usr/include/
|
||||||
|
INCLUDEPATH += /opt/local/include
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
/* include/config.h.in. Generated from configure.in by autoheader. */
|
/* include/config.h.in. Generated from configure.in by autoheader. */
|
||||||
|
|
||||||
/* Define to 1 if you have the `gethostbyname_r' function. */
|
/* Define to 1 if you have the `gethostbyname_r' function. */
|
||||||
|
#ifndef __APPLE__
|
||||||
#define HAVE_GETHOSTBYNAME_R 1
|
#define HAVE_GETHOSTBYNAME_R 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if you have the `inet_ntoa' function. */
|
/* Define to 1 if you have the `inet_ntoa' function. */
|
||||||
#define HAVE_INET_NTOA 1
|
#define HAVE_INET_NTOA 1
|
||||||
|
|||||||
@@ -82,10 +82,15 @@ ClientStateInit::Process(ClientThread &client)
|
|||||||
if (IOCTLSOCKET(context.GetSocket(), FIONBIO, &mode) == SOCKET_ERROR)
|
if (IOCTLSOCKET(context.GetSocket(), FIONBIO, &mode) == SOCKET_ERROR)
|
||||||
throw ClientException(__FILE__, __LINE__, ERR_SOCK_CREATION_FAILED, SOCKET_ERRNO());
|
throw ClientException(__FILE__, __LINE__, ERR_SOCK_CREATION_FAILED, SOCKET_ERRNO());
|
||||||
|
|
||||||
// The following call is optional - the return value is not checked.
|
// The following calls are optional - the return value is not checked.
|
||||||
int nodelay = 1;
|
int nodelay = 1;
|
||||||
setsockopt(context.GetSocket(), SOL_SOCKET, TCP_NODELAY, (char *)&nodelay, sizeof(nodelay));
|
setsockopt(context.GetSocket(), SOL_SOCKET, TCP_NODELAY, (char *)&nodelay, sizeof(nodelay));
|
||||||
|
|
||||||
|
#ifdef SO_NOSIGPIPE
|
||||||
|
int nosigpipe = 1;
|
||||||
|
setsockopt(context.GetSocket(), SOL_SOCKET, SO_NOSIGPIPE, (char *)&nosigpipe, sizeof(nosigpipe));
|
||||||
|
#endif
|
||||||
|
|
||||||
client.SetState(ClientStateStartResolve::Instance());
|
client.SetState(ClientStateStartResolve::Instance());
|
||||||
|
|
||||||
return MSG_SOCK_INIT_DONE;
|
return MSG_SOCK_INIT_DONE;
|
||||||
|
|||||||
@@ -182,11 +182,16 @@ ServerAcceptThread::AcceptLoop()
|
|||||||
{
|
{
|
||||||
throw ServerException(__FILE__, __LINE__, ERR_SOCK_CREATION_FAILED, SOCKET_ERRNO());
|
throw ServerException(__FILE__, __LINE__, ERR_SOCK_CREATION_FAILED, SOCKET_ERRNO());
|
||||||
}
|
}
|
||||||
// Optional call - don't check return value.
|
// Optional calls - don't check return value.
|
||||||
// Enable keepalive - won't be of much use but better than nothing.
|
// Enable keepalive - won't be of much use but better than nothing.
|
||||||
int keepalive = 1;
|
int keepalive = 1;
|
||||||
setsockopt(tmpData->GetSocket(), SOL_SOCKET, SO_KEEPALIVE, (char *)&keepalive, sizeof(keepalive));
|
setsockopt(tmpData->GetSocket(), SOL_SOCKET, SO_KEEPALIVE, (char *)&keepalive, sizeof(keepalive));
|
||||||
|
|
||||||
|
#ifdef SO_NOSIGPIPE
|
||||||
|
int nosigpipe = 1;
|
||||||
|
setsockopt(tmpData->GetSocket(), SOL_SOCKET, SO_NOSIGPIPE, (char *)&nosigpipe, sizeof(nosigpipe));
|
||||||
|
#endif
|
||||||
|
|
||||||
GetLobbyThread().AddConnection(tmpData);
|
GetLobbyThread().AddConnection(tmpData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,11 @@ typedef unsigned char u_char;
|
|||||||
#define IOCTLSOCKET ioctl
|
#define IOCTLSOCKET ioctl
|
||||||
#define SOCKET_ERR_NOTCONN ENOTCONN
|
#define SOCKET_ERR_NOTCONN ENOTCONN
|
||||||
#define SOCKET_ERR_NOTSOCK ENOTSOCK
|
#define SOCKET_ERR_NOTSOCK ENOTSOCK
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#define SOCKET_SEND_FLAGS 0
|
||||||
|
#else
|
||||||
#define SOCKET_SEND_FLAGS MSG_NOSIGNAL
|
#define SOCKET_SEND_FLAGS MSG_NOSIGNAL
|
||||||
|
#endif
|
||||||
|
|
||||||
#define IS_SOCKET_ERR_WOULDBLOCK(_e) ((_e) == EINPROGRESS || (_e) == EAGAIN)
|
#define IS_SOCKET_ERR_WOULDBLOCK(_e) ((_e) == EINPROGRESS || (_e) == EAGAIN)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user