From 699299ae8ac351241d0fffed99fe52f4df8c95f0 Mon Sep 17 00:00:00 2001 From: Jenster Date: Fri, 20 Nov 2015 08:10:59 -0800 Subject: [PATCH 1/2] latest OSX patches --- libresapi/src/libresapi.pro | 7 ++++++- libretroshare/src/grouter/p3grouter.h | 8 ++++++-- libretroshare/src/libretroshare.pro | 4 ++-- libretroshare/src/rsserver/rsinit.cc | 4 ++++ libretroshare/src/util/argstream.h | 6 ++++++ retroshare-gui/src/retroshare-gui.pro | 4 ++-- retroshare-nogui/src/retroshare-nogui.pro | 3 ++- 7 files changed, 28 insertions(+), 8 deletions(-) diff --git a/libresapi/src/libresapi.pro b/libresapi/src/libresapi.pro index 9ad461ea2..80e4650ae 100644 --- a/libresapi/src/libresapi.pro +++ b/libresapi/src/libresapi.pro @@ -32,7 +32,12 @@ libmicrohttpd{ CONFIG += link_pkgconfig PKGCONFIG *= libmicrohttpd } else { - LIBS *= -lmicrohttpd + mac { + INCLUDEPATH += /usr/local/include + LIBS *= /usr/local/lib/libmicrohttpd.a + } else { + LIBS *= -lmicrohttpd + } } SOURCES += \ api/ApiServerMHD.cpp diff --git a/libretroshare/src/grouter/p3grouter.h b/libretroshare/src/grouter/p3grouter.h index 0dbadd345..98beac792 100644 --- a/libretroshare/src/grouter/p3grouter.h +++ b/libretroshare/src/grouter/p3grouter.h @@ -225,7 +225,9 @@ private: void handleLowLevelTransactionAckItem(RsGRouterTransactionAcknItem*) ; static Sha1CheckSum computeDataItemHash(RsGRouterGenericDataItem *data_item); - +#ifdef __APPLE__ +public: +#endif class nullstream: public std::ostream {}; std::ostream& grouter_debug() const @@ -234,7 +236,9 @@ private: return _debug_enabled?(std::cerr):null; } - +#ifdef __APPLE__ +private: +#endif void routePendingObjects() ; void handleTunnels() ; void autoWash() ; diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index 59f11dba8..e64420b43 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -274,7 +274,7 @@ mac { # Beautiful Hack to fix 64bit file access. QMAKE_CXXFLAGS *= -Dfseeko64=fseeko -Dftello64=ftello -Dfopen64=fopen -Dvstatfs64=vstatfs - UPNPC_DIR = ../../../miniupnpc-1.3 + UPNPC_DIR = /usr/local/include #GPG_ERROR_DIR = ../../../../libgpg-error-1.7 #GPGME_DIR = ../../../../gpgme-1.1.8 @@ -283,7 +283,7 @@ mac { #INCLUDEPATH += . $${UPNPC_DIR} $${GPGME_DIR}/src $${GPG_ERROR_DIR}/src # We need a explicit path here, to force using the home version of sqlite3 that really encrypts the database. - LIBS += ../../../lib/libsqlcipher.a + LIBS += /usr/local/lib/libsqlcipher.a #LIBS += -lsqlite3 } diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index 9f6ba9b0b..80d950767 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -365,7 +365,11 @@ int RsInit::InitRetroShare(int argcIgnored, char **argvIgnored, bool strictCheck #ifdef LOCALNET_TESTING >> parameter('R',"restrict-port" ,portRestrictions ,"port1-port2","Apply port restriction" ,false) #endif +#ifdef __APPLE__ + >> help('h',"help","Display this Help") ; +#else >> help() ; +#endif as.defaultErrorHandling(true) ; diff --git a/libretroshare/src/util/argstream.h b/libretroshare/src/util/argstream.h index c239398d7..83fb30f0a 100644 --- a/libretroshare/src/util/argstream.h +++ b/libretroshare/src/util/argstream.h @@ -141,9 +141,15 @@ namespace inline OptionHolder(char s, const char* l, const char* desc); +#ifdef __APPLE__ + friend OptionHolder help(char s, + const char* l, + const char* desc); +#else friend OptionHolder help(char s='h', const char* l="help", const char* desc="Display this help"); +#endif private: std::string shortName_; std::string longName_; diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index cc7392ec3..32dc37b2c 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -212,12 +212,12 @@ macx { CONFIG += version_detail_bash_script LIBS += -lssl -lcrypto -lz #LIBS += -lssl -lcrypto -lz -lgpgme -lgpg-error -lassuan - LIBS += ../../../miniupnpc-1.3/libminiupnpc.a + LIBS += /usr/local/lib/libminiupnpc.a LIBS += -framework CoreFoundation LIBS += -framework Security LIBS += -framework Carbon INCLUDEPATH += . /usr/local/include - DEFINES *= MAC_IDLE # for idle feature + #DEFINES *= MAC_IDLE # for idle feature CONFIG -= uitools } diff --git a/retroshare-nogui/src/retroshare-nogui.pro b/retroshare-nogui/src/retroshare-nogui.pro index 8d809e218..96fc2a0d0 100644 --- a/retroshare-nogui/src/retroshare-nogui.pro +++ b/retroshare-nogui/src/retroshare-nogui.pro @@ -96,9 +96,10 @@ macx { LIBS += -Wl,-search_paths_first LIBS += -lssl -lcrypto -lz - LIBS += ../../../miniupnpc-1.0/libminiupnpc.a + LIBS += /usr/local/lib/libminiupnpc.a LIBS += -framework CoreFoundation LIBS += -framework Security + INCLUDEPATH += /usr/local/include sshserver { LIBS += -L../../../lib From 1f9cb27bbd255bd841ca2d1e0bb2c165c5fc9931 Mon Sep 17 00:00:00 2001 From: Jenster Date: Fri, 20 Nov 2015 20:40:00 -0800 Subject: [PATCH 2/2] other_osx_patch --- retroshare-nogui/src/retroshare.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/retroshare-nogui/src/retroshare.cc b/retroshare-nogui/src/retroshare.cc index 1da48dc6b..59a1bf1b4 100644 --- a/retroshare-nogui/src/retroshare.cc +++ b/retroshare-nogui/src/retroshare.cc @@ -86,8 +86,11 @@ int main(int argc, char **argv) // unfinished //args >> parameter("http-listen", listenAddress, "ipv6 address", "Listen only on the specified address.", false); args >> option("http-allow-all", allowAllIps, "allow connections from all IP adresses (default= localhost only)"); +#ifdef __APPLE__ + args >> help('h',"help","Display this Help"); +#else args >> help(); - +#endif if (args.helpRequested()) { std::cerr << args.usage() << std::endl; @@ -99,7 +102,7 @@ int main(int argc, char **argv) resource_api::ApiServer api; resource_api::RsControlModule ctrl_mod(argc, argv, api.getStateTokenServer(), &api, true); - api.addResourceHandler("control", dynamic_cast(&ctrl_mod), &resource_api::RsControlModule::handleRequest); + api.addResourceHandler("control", dynamic_cast(&ctrl_mod), &resource_api::RsControlModule::handleRequest); resource_api::ApiServerMHD* httpd = 0; if(httpPort != 0) @@ -192,8 +195,11 @@ int main(int argc, char **argv) >> parameter('P',"ssh-p-hash" ,sshPwdHash ,"hash" ,"Ssh login password hash (Generated by retroshare-nogui -G)",false) >> parameter('K',"ssh-key-file" ,sshRsaFile ,"RSA key file", "RSA key file for SSH login (not yet implemented).",false )// NOT FINISHED YET. +#ifdef __APPLE__ + >> help('h',"help","Display this Help"); +#else >> help() ; - +#endif // Normally argstream would handle this by itself, if we called // as.defaultErrorHandling() ; //