Changes for MacOS. Can be compiled, but there are still some issues.
This commit is contained in:
+4
-2
@@ -12,12 +12,14 @@
|
||||
|
||||
QT_FW_PATH="/Library/Frameworks"
|
||||
SDL_FW_PATH="/Library/Frameworks"
|
||||
APPLICATION="./bin/pokerth.app"
|
||||
APPLICATION="./pokerth.app"
|
||||
BINARY="$APPLICATION/Contents/MacOs/pokerth"
|
||||
RESOURCES="$APPLICATION/Contents/Resources/"
|
||||
|
||||
# strip binary
|
||||
strip $BINARY
|
||||
|
||||
cp -R ./data $RESOURCES
|
||||
# create framework-path
|
||||
BINARY_FW_PATH="$APPLICATION/Contents/Frameworks"
|
||||
mkdir $BINARY_FW_PATH
|
||||
@@ -45,4 +47,4 @@ if [ "$1" != "--without-qt" ] ; then
|
||||
QTCORE_LINK=$(otool -L $BINARY_FW_PATH/$QTGUI | grep QtCore | cut -d"(" -f1 | cut -f2)
|
||||
install_name_tool -change $QTCORE_LINK @executable_path/../Frameworks/$QTCORE $BINARY_FW_PATH/$QTGUI
|
||||
|
||||
fi
|
||||
fi
|
||||
|
||||
+10
-6
@@ -3,8 +3,8 @@
|
||||
TEMPLATE = app
|
||||
CODECFORSRC = UTF-8
|
||||
|
||||
#CONFIG += qt thread embed_manifest_exe warn_on release
|
||||
CONFIG += qt thread embed_manifest_exe warn_on debug
|
||||
#CONFIG += qt thread embed_manifest_exe exceptions rtti stl warn_on release
|
||||
CONFIG += qt thread embed_manifest_exe exceptions rtti stl warn_on debug
|
||||
|
||||
#Uncomment this for RELEASE
|
||||
#QTPLUGIN += qjpeg qgif
|
||||
@@ -348,6 +348,8 @@ mac{
|
||||
# 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
|
||||
# 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/libQtGui.a
|
||||
@@ -359,13 +361,15 @@ mac{
|
||||
LIBS += -framework SDL_mixer
|
||||
# standard path for darwinports
|
||||
# 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
|
||||
LIBS += -lcrypto -lz -framework Carbon
|
||||
# set the application icon
|
||||
RC_FILE = pokerth.icns
|
||||
LIBPATH += /Developer/SDKs/MacOSX10.4u.sdk/usr/lib
|
||||
INCLUDEPATH += /Developer/SDKs/MacOSX10.4u.sdk/usr/include/
|
||||
LIBPATH += /Developer/SDKs/MacOSX10.5.sdk/usr/lib
|
||||
INCLUDEPATH += /Developer/SDKs/MacOSX10.5.sdk/usr/include/
|
||||
INCLUDEPATH += /Library/Frameworks/SDL.framework/Headers
|
||||
INCLUDEPATH += /Library/Frameworks/SDL_mixer.framework/Headers
|
||||
INCLUDEPATH += /Library/Frameworks/SDL_mixer.framework/Headers
|
||||
INCLUDEPATH += /opt/local/include
|
||||
}
|
||||
|
||||
+5
-4
@@ -3,8 +3,8 @@
|
||||
TEMPLATE = lib
|
||||
CODECFORSRC = UTF-8
|
||||
|
||||
#CONFIG += staticlib thread warn_on release
|
||||
CONFIG += staticlib thread warn_on debug
|
||||
#CONFIG += staticlib thread exceptions rtti stl warn_on release
|
||||
CONFIG += staticlib thread exceptions rtti stl warn_on debug
|
||||
|
||||
UI_DIR = uics
|
||||
TARGET = lib/pokerth_lib
|
||||
@@ -197,7 +197,8 @@ mac{
|
||||
# on Intel-Mac you have to comment this line out or build will fail.
|
||||
# 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_mixer.framework/Headers
|
||||
INCLUDEPATH += /Library/Frameworks/SDL_mixer.framework/Headers
|
||||
INCLUDEPATH += /opt/local/include
|
||||
}
|
||||
|
||||
+27
-2
@@ -3,8 +3,8 @@
|
||||
TEMPLATE = app
|
||||
CODECFORSRC = UTF-8
|
||||
|
||||
#CONFIG += thread console embed_manifest_exe warn_on release
|
||||
CONFIG += thread console embed_manifest_exe warn_on debug
|
||||
#CONFIG += thread console embed_manifest_exe exceptions rtti stl warn_on release
|
||||
CONFIG += thread console embed_manifest_exe exceptions rtti stl warn_on debug
|
||||
|
||||
UI_DIR = uics
|
||||
TARGET = bin/pokerth_server
|
||||
@@ -194,3 +194,28 @@ unix : !mac {
|
||||
## My release static libs
|
||||
#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. */
|
||||
|
||||
/* Define to 1 if you have the `gethostbyname_r' function. */
|
||||
#define HAVE_GETHOSTBYNAME_R 1
|
||||
#ifndef __APPLE__
|
||||
#define HAVE_GETHOSTBYNAME_R 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if you have the `inet_ntoa' function. */
|
||||
#define HAVE_INET_NTOA 1
|
||||
|
||||
@@ -82,10 +82,15 @@ ClientStateInit::Process(ClientThread &client)
|
||||
if (IOCTLSOCKET(context.GetSocket(), FIONBIO, &mode) == SOCKET_ERROR)
|
||||
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;
|
||||
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());
|
||||
|
||||
return MSG_SOCK_INIT_DONE;
|
||||
|
||||
@@ -182,11 +182,16 @@ ServerAcceptThread::AcceptLoop()
|
||||
{
|
||||
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.
|
||||
int keepalive = 1;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,11 @@ typedef unsigned char u_char;
|
||||
#define IOCTLSOCKET ioctl
|
||||
#define SOCKET_ERR_NOTCONN ENOTCONN
|
||||
#define SOCKET_ERR_NOTSOCK ENOTSOCK
|
||||
#define SOCKET_SEND_FLAGS MSG_NOSIGNAL
|
||||
#ifdef __APPLE__
|
||||
#define SOCKET_SEND_FLAGS 0
|
||||
#else
|
||||
#define SOCKET_SEND_FLAGS MSG_NOSIGNAL
|
||||
#endif
|
||||
|
||||
#define IS_SOCKET_ERR_WOULDBLOCK(_e) ((_e) == EINPROGRESS || (_e) == EAGAIN)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user