mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-26 17:51:26 -05:00
Modified libretroshare to compile under MacOSX.
1) b64.c used c++ functions -> b64.cc 2) OSX will use miniupnpc for now -> modified #defines. 3) change in openssl fn signature? 4) updated build file for OSX. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2344 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
4a5bd60880
commit
56e9536336
@ -16,6 +16,10 @@ debug {
|
|||||||
# DEFINES *= CONN_DEBUG P3DISC_DEBUG RSSERIAL_DEBUG RSITEM_DEBUG DEBUG_PQISSL DEBUG_PQISTREAMER
|
# DEFINES *= CONN_DEBUG P3DISC_DEBUG RSSERIAL_DEBUG RSITEM_DEBUG DEBUG_PQISSL DEBUG_PQISTREAMER
|
||||||
# DEFINES *= NET_DEBUG
|
# DEFINES *= NET_DEBUG
|
||||||
# DEFINES *= DISTRIB_DEBUG
|
# DEFINES *= DISTRIB_DEBUG
|
||||||
|
|
||||||
|
# DEFINES *= P3TURTLE_DEBUG FT_DEBUG DEBUG_FTCHUNK MPLEX_DEBUG
|
||||||
|
# DEFINES *= CONN_DEBUG
|
||||||
|
|
||||||
QMAKE_CXXFLAGS -= -fomit-frame-pointer
|
QMAKE_CXXFLAGS -= -fomit-frame-pointer
|
||||||
QMAKE_CXXFLAGS *= -g -fno-omit-frame-pointer
|
QMAKE_CXXFLAGS *= -g -fno-omit-frame-pointer
|
||||||
}
|
}
|
||||||
@ -103,6 +107,31 @@ win32 {
|
|||||||
|
|
||||||
INCLUDEPATH += . $${SSL_DIR}/include $${UPNPC_DIR} $${PTHREADS_DIR} $${ZLIB_DIR} $${GPGME_DIR}/src $${GPG_ERROR_DIR}/src
|
INCLUDEPATH += . $${SSL_DIR}/include $${UPNPC_DIR} $${PTHREADS_DIR} $${ZLIB_DIR} $${GPGME_DIR}/src $${GPG_ERROR_DIR}/src
|
||||||
}
|
}
|
||||||
|
|
||||||
|
################################# MacOSX ##########################################
|
||||||
|
|
||||||
|
mac {
|
||||||
|
QMAKE_CC = g++
|
||||||
|
OBJECTS_DIR = temp/obj
|
||||||
|
MOC_DIR = temp/moc
|
||||||
|
#DEFINES = WINDOWS_SYS WIN32 STATICLIB MINGW
|
||||||
|
#DEFINES *= MINIUPNPC_VERSION=13
|
||||||
|
DESTDIR = lib
|
||||||
|
|
||||||
|
#miniupnp implementation files
|
||||||
|
HEADERS += upnp/upnputil.h
|
||||||
|
SOURCES += upnp/upnputil.c
|
||||||
|
|
||||||
|
# Beautiful Hack to fix 64bit file access.
|
||||||
|
QMAKE_CXXFLAGS *= -Dfseeko64=fseeko -Dftello64=ftello -Dfopen64=fopen"
|
||||||
|
UPNPC_DIR = ../../../miniupnpc-1.0
|
||||||
|
GPG_ERROR_DIR = ../../../../libgpg-error-1.7
|
||||||
|
GPGME_DIR = ../../../../gpgme-1.1.8
|
||||||
|
|
||||||
|
INCLUDEPATH += . $${UPNPC_DIR}
|
||||||
|
#INCLUDEPATH += . $${UPNPC_DIR} $${GPGME_DIR}/src $${GPG_ERROR_DIR}/src
|
||||||
|
}
|
||||||
|
################################### COMMON stuff ##################################
|
||||||
################################### COMMON stuff ##################################
|
################################### COMMON stuff ##################################
|
||||||
|
|
||||||
#DEPENDPATH += . \
|
#DEPENDPATH += . \
|
||||||
@ -302,7 +331,7 @@ SOURCES += \
|
|||||||
upnp/upnphandler.cc \
|
upnp/upnphandler.cc \
|
||||||
dht/opendht.cc \
|
dht/opendht.cc \
|
||||||
dht/opendhtstr.cc \
|
dht/opendhtstr.cc \
|
||||||
dht/b64.c \
|
dht/b64.cc \
|
||||||
services/p3portservice.cc \
|
services/p3portservice.cc \
|
||||||
services/p3channels.cc \
|
services/p3channels.cc \
|
||||||
services/p3forums.cc \
|
services/p3forums.cc \
|
||||||
|
@ -1159,7 +1159,12 @@ X509 *AuthSSL::loadX509FromDER(const uint8_t *ptr, uint32_t len)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
X509 *tmp = NULL;
|
X509 *tmp = NULL;
|
||||||
|
#ifdef __APPLE__
|
||||||
|
unsigned char **certptr = (unsigned char **) &ptr;
|
||||||
|
#else
|
||||||
const unsigned char **certptr = (const unsigned char **) &ptr;
|
const unsigned char **certptr = (const unsigned char **) &ptr;
|
||||||
|
#endif
|
||||||
|
|
||||||
X509 *x509 = d2i_X509(&tmp, certptr, len);
|
X509 *x509 = d2i_X509(&tmp, certptr, len);
|
||||||
|
|
||||||
return x509;
|
return x509;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//Linux and macos implementation
|
//Linux only
|
||||||
#ifndef WINDOWS_SYS
|
#if !defined(WINDOWS_SYS) && !defined(__APPLE__)
|
||||||
|
|
||||||
/* This stuff is actually C */
|
/* This stuff is actually C */
|
||||||
|
|
||||||
@ -429,8 +429,8 @@ bool upnphandler::getExternalAddress(struct sockaddr_in &addr)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Windows / Mac version.
|
||||||
#ifdef WINDOWS_SYS
|
#if defined(WINDOWS_SYS) || defined(__APPLE__)
|
||||||
|
|
||||||
/* This stuff is actually C */
|
/* This stuff is actually C */
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//Linux and macos implementation
|
//Linux only...
|
||||||
#ifndef WINDOWS_SYS
|
#if !defined(WINDOWS_SYS) && !defined(__APPLE__)
|
||||||
|
|
||||||
#ifndef _RS_UPNP_IFACE_H
|
#ifndef _RS_UPNP_IFACE_H
|
||||||
#define _RS_UPNP_IFACE_H
|
#define _RS_UPNP_IFACE_H
|
||||||
@ -86,8 +86,8 @@ int CtrlPointCallbackEventHandler(Upnp_EventType ,void* , void*);
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(WINDOWS_SYS) || defined(__APPLE__)
|
||||||
|
|
||||||
#ifdef WINDOWS_SYS
|
|
||||||
//windows implementation
|
//windows implementation
|
||||||
#ifndef _RS_UPNP_IFACE_H
|
#ifndef _RS_UPNP_IFACE_H
|
||||||
#define _RS_UPNP_IFACE_H
|
#define _RS_UPNP_IFACE_H
|
||||||
|
@ -107,7 +107,7 @@ void ListRedirections(struct UPNPUrls * urls,
|
|||||||
* 2 - get extenal ip address
|
* 2 - get extenal ip address
|
||||||
* 3 - Add port mapping
|
* 3 - Add port mapping
|
||||||
* 4 - get this port mapping from the IGD */
|
* 4 - get this port mapping from the IGD */
|
||||||
bool SetRedirectAndTest(struct UPNPUrls * urls,
|
int SetRedirectAndTest(struct UPNPUrls * urls,
|
||||||
struct IGDdatas * data,
|
struct IGDdatas * data,
|
||||||
const char * iaddr,
|
const char * iaddr,
|
||||||
const char * iport,
|
const char * iport,
|
||||||
@ -209,7 +209,7 @@ bool SetRedirectAndTest(struct UPNPUrls * urls,
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TestRedirect(struct UPNPUrls * urls,
|
int TestRedirect(struct UPNPUrls * urls,
|
||||||
struct IGDdatas * data,
|
struct IGDdatas * data,
|
||||||
const char * iaddr,
|
const char * iaddr,
|
||||||
const char * iport,
|
const char * iport,
|
||||||
@ -261,7 +261,7 @@ bool TestRedirect(struct UPNPUrls * urls,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
int
|
||||||
RemoveRedirect(struct UPNPUrls * urls,
|
RemoveRedirect(struct UPNPUrls * urls,
|
||||||
struct IGDdatas * data,
|
struct IGDdatas * data,
|
||||||
const char * eport,
|
const char * eport,
|
||||||
|
@ -21,6 +21,13 @@
|
|||||||
#include <miniupnpc.h>
|
#include <miniupnpc.h>
|
||||||
#include <upnpcommands.h>
|
#include <upnpcommands.h>
|
||||||
|
|
||||||
|
/* Ensure linking names are okay on OSX platform. (C interface) */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* protofix() checks if protocol is "UDP" or "TCP"
|
/* protofix() checks if protocol is "UDP" or "TCP"
|
||||||
* returns NULL if not */
|
* returns NULL if not */
|
||||||
const char * protofix(const char * proto);
|
const char * protofix(const char * proto);
|
||||||
@ -33,24 +40,28 @@ void GetConnectionStatus(struct UPNPUrls * urls,
|
|||||||
void ListRedirections(struct UPNPUrls * urls,
|
void ListRedirections(struct UPNPUrls * urls,
|
||||||
struct IGDdatas * data);
|
struct IGDdatas * data);
|
||||||
|
|
||||||
bool SetRedirectAndTest(struct UPNPUrls * urls,
|
int SetRedirectAndTest(struct UPNPUrls * urls,
|
||||||
struct IGDdatas * data,
|
struct IGDdatas * data,
|
||||||
const char * iaddr,
|
const char * iaddr,
|
||||||
const char * iport,
|
const char * iport,
|
||||||
const char * eport,
|
const char * eport,
|
||||||
const char * proto);
|
const char * proto);
|
||||||
|
|
||||||
bool TestRedirect(struct UPNPUrls * urls,
|
int TestRedirect(struct UPNPUrls * urls,
|
||||||
struct IGDdatas * data,
|
struct IGDdatas * data,
|
||||||
const char * iaddr,
|
const char * iaddr,
|
||||||
const char * iport,
|
const char * iport,
|
||||||
const char * eport,
|
const char * eport,
|
||||||
const char * proto);
|
const char * proto);
|
||||||
|
|
||||||
bool RemoveRedirect(struct UPNPUrls * urls,
|
int RemoveRedirect(struct UPNPUrls * urls,
|
||||||
struct IGDdatas * data,
|
struct IGDdatas * data,
|
||||||
const char * eport,
|
const char * eport,
|
||||||
const char * proto);
|
const char * proto);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user