Fix El Capitan OSX 10.11 Compil

This commit is contained in:
Phenom 2016-07-16 23:10:00 +02:00
parent 46dd5be2f2
commit 2db8dbd45f
11 changed files with 502 additions and 448 deletions

View File

@ -1,27 +1,31 @@
##Compilation on MacOS # Compilation on MacOS
### Qt Installation ## Qt Installation
Install Qt via: [Qt Download](http://www.qt.io/download/) Install Qt via: [Qt Download](http://www.qt.io/download/)
Use default options. Use default options. And add Qt Script support.
Add to the PATH environment variable with this temporary solution.
export PATH=/users/$USER/Qt/5.5/clang_64/bin:$PATH Add to the PATH environment variable by editing your *~/.profile* file.
export PATH="/users/$USER/Qt/5.5/clang_64/bin:$PATH"
Depends on wich version of Qt you use. Depends on wich version of Qt you use.
###MacPort Installation ## ***Choose if you use MacPort or HomeBrew***
### MacPort Installation
Install MacPort and XCode following this guide: [MacPort and XCode](http://guide.macports.org/#installing.xcode) Install MacPort and XCode following this guide: [MacPort and XCode](http://guide.macports.org/#installing.xcode)
Start XCode to get it updated and to able C compiler to create executables. Start XCode to get it updated and to able C compiler to create executables.
###Install libraries #### Install libraries
$sudo port -v selfupdate $sudo port -v selfupdate
$sudo port install openssl $sudo port install openssl
$sudo port install miniupnpc $sudo port install miniupnpc
$sudo port install libmicrohttpd
For VOIP Plugin: For VOIP Plugin:
@ -30,36 +34,50 @@ For VOIP Plugin:
Get Your OSX SDK if missing: [MacOSX-SDKs](https://github.com/phracker/MacOSX-SDKs) Get Your OSX SDK if missing: [MacOSX-SDKs](https://github.com/phracker/MacOSX-SDKs)
###Last Settings ### HOMEBREW Installation
In QtCreator Option Git add its path: Install HomeBrew following this guide: [HomeBrew](http://brew.sh/)
C:\Program Files\Git\bin Install XCode command line developer tools:
and select "Pull" with "Rebase" $xcode-select --install
###Compil missing libraries Start XCode to get it updated and to able C compiler to create executables.
####SQLCipher
#### Install libraries
$brew install openssl
$brew install miniupnpc
$brew install libmicrohttpd
If you have error in linking, run this:
$sudo chown -R $(whoami) /usr/local/lib/pkgconfig
For VOIP Plugin:
$brew install speex
$brew install homebrew/science/opencv
$brew install ffmpeg
Get Your OSX SDK if missing: [MacOSX-SDKs](https://github.com/phracker/MacOSX-SDKs)
## Last Settings
In QtCreator Option Git select "Pull" with "Rebase"
## Compil missing libraries
### SQLCipher
cd <your development directory> cd <your development directory>
git clone https://github.com/sqlcipher/sqlcipher.git git clone https://github.com/sqlcipher/sqlcipher.git
cd sqlcipher cd sqlcipher
./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto" ./configure --disable-shared --disable-tcl --enable-static --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC -I/opt/local/include" LDFLAGS="-lcrypto"
make make
sudo make install sudo make install
NOTE, might be necessary to *chmod 000 /usr/local/ssl* temporarily during *./configure* if NOTE, might be necessary to *chmod 000 /usr/local/ssl* temporarily during *./configure* if
homebrew uses newer, non-stock ssl dependencies found there. configure might get confused. homebrew uses newer, non-stock ssl dependencies found there. Configure might get confused.
####libMicroHTTPD
The one with port don't have good support.
cd <your development directory>
wget http://ftpmirror.gnu.org/libmicrohttpd/libmicrohttpd-0.9.46.tar.gz
tar zxvf libmicrohttpd-0.9.46.tar.gz
cd libmicrohttpd-0.9.46
bash ./configure
sudo make install
You can now compile RS into Qt Creator or with terminal You can now compile RS into Qt Creator or with terminal
@ -68,4 +86,6 @@ You can now compile RS into Qt Creator or with terminal
cd retroshare cd retroshare
qmake; make qmake; make
You can change Target and SDK in *./retroshare.pri:82* changing value of QMAKE_MACOSX_DEPLOYMENT_TARGET and QMAKE_MAC_SDK
You can find compiled application on *./retroshare/retroshare-gui/src/RetroShare06.app* You can find compiled application on *./retroshare/retroshare-gui/src/RetroShare06.app*

View File

@ -113,7 +113,8 @@ libresapihttpserver {
} else { } else {
mac { mac {
INCLUDEPATH += . $$INC_DIR INCLUDEPATH += . $$INC_DIR
for(lib, LIB_DIR):exists($$lib/libmicrohttpd.a){ LIBS *= $$lib/libmicrohttpd.a} #for(lib, LIB_DIR):exists($$lib/libmicrohttpd.a){ LIBS *= $$lib/libmicrohttpd.a}
LIBS *= -lmicrohttpd
} else { } else {
LIBS *= -lmicrohttpd LIBS *= -lmicrohttpd
} }

View File

@ -295,7 +295,7 @@ mac {
OBJECTS_DIR = temp/obj OBJECTS_DIR = temp/obj
MOC_DIR = temp/moc MOC_DIR = temp/moc
#DEFINES = WINDOWS_SYS WIN32 STATICLIB MINGW #DEFINES = WINDOWS_SYS WIN32 STATICLIB MINGW
DEFINES *= MINIUPNPC_VERSION=13 #DEFINES *= MINIUPNPC_VERSION=13
CONFIG += upnp_miniupnpc CONFIG += upnp_miniupnpc
CONFIG += c++11 CONFIG += c++11
@ -305,7 +305,7 @@ mac {
#CONFIG += zcnatassist #CONFIG += zcnatassist
# Beautiful Hack to fix 64bit file access. # Beautiful Hack to fix 64bit file access.
QMAKE_CXXFLAGS *= -Dfseeko64=fseeko -Dftello64=ftello -Dfopen64=fopen -Dvstatfs64=vstatfs QMAKE_CXXFLAGS *= -Dfseeko64=fseeko -Dftello64=ftello -Dfopen64=fopen -Dvstatfs64=vstatfs
#GPG_ERROR_DIR = ../../../../libgpg-error-1.7 #GPG_ERROR_DIR = ../../../../libgpg-error-1.7
#GPGME_DIR = ../../../../gpgme-1.1.8 #GPGME_DIR = ../../../../gpgme-1.1.8
@ -315,6 +315,7 @@ mac {
DEPENDPATH += . $$INC_DIR DEPENDPATH += . $$INC_DIR
INCLUDEPATH += . $$INC_DIR INCLUDEPATH += . $$INC_DIR
INCLUDEPATH += ../../../.
# We need a explicit path here, to force using the home version of sqlite3 that really encrypts the database. # We need a explicit path here, to force using the home version of sqlite3 that really encrypts the database.
LIBS += /usr/local/lib/libsqlcipher.a LIBS += /usr/local/lib/libsqlcipher.a

View File

@ -30,7 +30,17 @@
#include <iostream> #include <iostream>
#include <time.h> #include <time.h>
#ifdef __APPLE__
int __attribute__((weak)) pthread_setname_np(const char *__buf) ;
int RS_pthread_setname_np(pthread_t /*__target_thread*/, const char *__buf) {
return pthread_setname_np(__buf);
}
#else
int __attribute__((weak)) pthread_setname_np(pthread_t __target_thread, const char *__buf) ; int __attribute__((weak)) pthread_setname_np(pthread_t __target_thread, const char *__buf) ;
int RS_pthread_setname_np(pthread_t __target_thread, const char *__buf) {
return pthread_setname_np(__target_thread, __buf);
}
#endif
#ifdef RSMUTEX_DEBUG #ifdef RSMUTEX_DEBUG
#include <stdio.h> #include <stdio.h>
@ -167,19 +177,21 @@ void RsThread::start(const std::string &threadName)
// set name // set name
if(pthread_setname_np) if(pthread_setname_np)
if(!threadName.empty()) {
{ if(!threadName.empty())
// thread names are restricted to 16 characters including the terminating null byte {
if(threadName.length() > 15) // thread names are restricted to 16 characters including the terminating null byte
{ if(threadName.length() > 15)
{
#ifdef DEBUG_THREADS #ifdef DEBUG_THREADS
THREAD_DEBUG << "RsThread::start called with to long name '" << name << "' truncating..." << std::endl; THREAD_DEBUG << "RsThread::start called with to long name '" << name << "' truncating..." << std::endl;
#endif #endif
pthread_setname_np(mTid, threadName.substr(0, 15).c_str()); RS_pthread_setname_np(mTid, threadName.substr(0, 15).c_str());
} else { } else {
pthread_setname_np(mTid, threadName.c_str()); RS_pthread_setname_np(mTid, threadName.c_str());
} }
} }
}
} }
else else
{ {

View File

@ -1,11 +1,7 @@
!include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri") !include("../../retroshare.pri"): error("Could not include file ../../retroshare.pri")
TEMPLATE = lib TEMPLATE = lib
macx { CONFIG += staticlib
CONFIG = staticlib
} else {
CONFIG += staticlib
}
DEFINES *= OPENSSL_NO_IDEA DEFINES *= OPENSSL_NO_IDEA
@ -13,8 +9,8 @@ QMAKE_CXXFLAGS *= -Wall -Werror -W
TARGET = ops TARGET = ops
DESTDIR = lib DESTDIR = lib
DEPENDPATH += . DEPENDPATH += . $$INC_DIR
INCLUDEPATH += . INCLUDEPATH += . $$INC_DIR
#################################### Windows ##################################### #################################### Windows #####################################
@ -34,9 +30,13 @@ win32 {
# Switch on optimization for debug version # Switch on optimization for debug version
#QMAKE_CXXFLAGS_DEBUG += -O2 #QMAKE_CXXFLAGS_DEBUG += -O2
#QMAKE_CFLAGS_DEBUG += -O2 #QMAKE_CFLAGS_DEBUG += -O2
}
DEPENDPATH += $$INC_DIR
INCLUDEPATH += $$INC_DIR macx {
for(lib, LIB_DIR):LIBS += -L"$$lib"
for(bin, BIN_DIR):LIBS += -L"$$bin"
DEFINES += OPENSSL_NO_CAMELLIA
} }
# Input # Input
@ -73,8 +73,10 @@ HEADERS += openpgpsdk/writer.h \
openpgpsdk/armour.h \ openpgpsdk/armour.h \
openpgpsdk/parse_local.h \ openpgpsdk/parse_local.h \
openpgpsdk/keyring_local.h \ openpgpsdk/keyring_local.h \
openpgpsdk/opsdir.h \ openpgpsdk/opsdir.h
openpgpsdk/opsstring.h win32{
HEADERS += openpgpsdk/opsstring.h
}
SOURCES += openpgpsdk/accumulate.c \ SOURCES += openpgpsdk/accumulate.c \
openpgpsdk/compress.c \ openpgpsdk/compress.c \
@ -113,5 +115,7 @@ SOURCES += openpgpsdk/accumulate.c \
openpgpsdk/writer_memory.c \ openpgpsdk/writer_memory.c \
openpgpsdk/writer_skey_checksum.c \ openpgpsdk/writer_skey_checksum.c \
openpgpsdk/writer_stream_encrypt_se_ip.c \ openpgpsdk/writer_stream_encrypt_se_ip.c \
openpgpsdk/opsdir.c \ openpgpsdk/opsdir.c
openpgpsdk/opsstring.c win32{
SOURCES += openpgpsdk/opsstring.c
}

View File

@ -1,6 +1,7 @@
#include "opsdir.h" #include "opsdir.h"
#ifdef WIN32
#include "opsstring.h" #include "opsstring.h"
#endif
#include <fcntl.h> #include <fcntl.h>
int ops_open(const char* filename, int flag, int pmode) int ops_open(const char* filename, int flag, int pmode)

View File

@ -584,10 +584,13 @@ void GenCertDialog::genPerson()
QCoreApplication::processEvents(); QCoreApplication::processEvents();
QAbstractEventDispatcher* ed = QAbstractEventDispatcher::instance(); QAbstractEventDispatcher* ed = QAbstractEventDispatcher::instance();
std::cout << "Waiting ed->processEvents()" << std::endl;
time_t waitEnd = time(NULL) + 10;//Wait no more than 10 sec to processEvents
if (ed->hasPendingEvents()) if (ed->hasPendingEvents())
while(ed->processEvents(QEventLoop::AllEvents)); while(ed->processEvents(QEventLoop::AllEvents) && (time(NULL) < waitEnd));
std::string email_str = "" ; std::string email_str = "" ;
std::cout << "RsAccounts::GeneratePGPCertificate" << std::endl;
RsAccounts::GeneratePGPCertificate( RsAccounts::GeneratePGPCertificate(
ui.name_input->text().toUtf8().constData(), ui.name_input->text().toUtf8().constData(),
email_str.c_str(), email_str.c_str(),
@ -609,6 +612,7 @@ void GenCertDialog::genPerson()
std::cerr << "GenCertDialog::genPerson() Generating SSL cert with gpg id : " << PGPId << std::endl; std::cerr << "GenCertDialog::genPerson() Generating SSL cert with gpg id : " << PGPId << std::endl;
std::string err; std::string err;
this->hide();//To show dialog asking password PGP Key. this->hide();//To show dialog asking password PGP Key.
std::cout << "RsAccounts::GenerateSSLCertificate" << std::endl;
bool okGen = RsAccounts::GenerateSSLCertificate(PGPId, "", genLoc, "", isHiddenLoc, sslPasswd, sslId, err); bool okGen = RsAccounts::GenerateSSLCertificate(PGPId, "", genLoc, "", isHiddenLoc, sslPasswd, sslId, err);
if (okGen) if (okGen)

View File

@ -234,6 +234,9 @@ macx {
mac_icon.files = $$files($$PWD/rsMacIcon.icns) mac_icon.files = $$files($$PWD/rsMacIcon.icns)
mac_icon.path = Contents/Resources mac_icon.path = Contents/Resources
QMAKE_BUNDLE_DATA += mac_icon QMAKE_BUNDLE_DATA += mac_icon
mac_webui.files = $$files($$PWD/../../libresapi/src/webui)
mac_webui.path = Contents/Resources
QMAKE_BUNDLE_DATA += mac_webui
CONFIG += version_detail_bash_script CONFIG += version_detail_bash_script
LIBS += -lssl -lcrypto -lz LIBS += -lssl -lcrypto -lz

View File

@ -77,12 +77,12 @@ macx {
LIB_DIR += "/usr/local/lib" LIB_DIR += "/usr/local/lib"
LIB_DIR += "/opt/local/lib" LIB_DIR += "/opt/local/lib"
!QMAKE_MACOSX_DEPLOYMENT_TARGET { !QMAKE_MACOSX_DEPLOYMENT_TARGET {
message(***retroshare.pri: No Target, set it to MacOS 10.10 ) message(***retroshare.pri: No Target. Set it to MacOS 10.11 )
QMAKE_MACOSX_DEPLOYMENT_TARGET=10.10 QMAKE_MACOSX_DEPLOYMENT_TARGET=10.11
} }
!QMAKE_MAC_SDK { !QMAKE_MAC_SDK {
message(***retroshare.pri: No SDK, set it to MacOS 10.10 ) message(***retroshare.pri: No SDK. Set it to MacOS 10.11 )
QMAKE_MAC_SDK = macosx10.10 QMAKE_MAC_SDK = macosx10.11
} }
CONFIG += c++11 CONFIG += c++11
} }

View File

@ -182,33 +182,40 @@ win32 {
################################# MacOSX ########################################## ################################# MacOSX ##########################################
mac { mac {
QMAKE_CC = $${QMAKE_CXX} QMAKE_CC = $${QMAKE_CXX}
OBJECTS_DIR = temp/obj OBJECTS_DIR = temp/obj
MOC_DIR = temp/moc MOC_DIR = temp/moc
#DEFINES = WINDOWS_SYS WIN32 STATICLIB MINGW #DEFINES = WINDOWS_SYS WIN32 STATICLIB MINGW
#DEFINES *= MINIUPNPC_VERSION=13 #DEFINES *= MINIUPNPC_VERSION=13
DESTDIR = lib DESTDIR = lib
CONFIG += upnp_miniupnpc CONFIG += upnp_miniupnpc
# zeroconf disabled at the end of libretroshare.pro (but need the code) # zeroconf disabled at the end of libretroshare.pro (but need the code)
CONFIG += zeroconf #CONFIG += zeroconf
CONFIG += zcnatassist #CONFIG += zcnatassist
# Beautiful Hack to fix 64bit file access. # Beautiful Hack to fix 64bit file access.
QMAKE_CXXFLAGS *= -Dfseeko64=fseeko -Dftello64=ftello -Dfopen64=fopen -Dvstatfs64=vstatfs QMAKE_CXXFLAGS *= -Dfseeko64=fseeko -Dftello64=ftello -Dfopen64=fopen -Dvstatfs64=vstatfs
UPNPC_DIR = ../../../miniupnpc-1.0 #UPNPC_DIR = ../../../miniupnpc-1.0
#GPG_ERROR_DIR = ../../../../libgpg-error-1.7 #GPG_ERROR_DIR = ../../../../libgpg-error-1.7
#GPGME_DIR = ../../../../gpgme-1.1.8 #GPGME_DIR = ../../../../gpgme-1.1.8
#OPENPGPSDK_DIR = ../../openpgpsdk/src
#INCLUDEPATH += . $${UPNPC_DIR}
#INCLUDEPATH += $${OPENPGPSDK_DIR}
OPENPGPSDK_DIR = ../../openpgpsdk/src #for(lib, LIB_DIR):exists($$lib/libminiupnpc.a){ LIBS += $$lib/libminiupnpc.a}
for(lib, LIB_DIR):LIBS += -L"$$lib"
for(bin, BIN_DIR):LIBS += -L"$$bin"
INCLUDEPATH += . $${UPNPC_DIR} DEPENDPATH += . $$INC_DIR
INCLUDEPATH += $${OPENPGPSDK_DIR} INCLUDEPATH += . $$INC_DIR
INCLUDEPATH += ../../../.
#../openpgpsdk # We need a explicit path here, to force using the home version of sqlite3 that really encrypts the database.
#INCLUDEPATH += . $${UPNPC_DIR} $${GPGME_DIR}/src $${GPG_ERROR_DIR}/src LIBS += /usr/local/lib/libsqlcipher.a
#LIBS += -lsqlite3
} }
################################# FreeBSD ########################################## ################################# FreeBSD ##########################################

View File

@ -171,34 +171,35 @@ win32 {
##################################### MacOS ###################################### ##################################### MacOS ######################################
macx { macx {
# ENABLE THIS OPTION FOR Univeral Binary BUILD. # ENABLE THIS OPTION FOR Univeral Binary BUILD.
CONFIG += ppc x86 #CONFIG += ppc x86
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4 #QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4
CONFIG += version_detail_bash_script CONFIG += version_detail_bash_script
LIBS += ../../libretroshare/src/lib/libretroshare.a LIBS += ../../libretroshare/src/lib/libretroshare.a
LIBS += ../librssimulator/lib/librssimulator.a LIBS += ../librssimulator/lib/librssimulator.a
LIBS += ../../openpgpsdk/src/lib/libops.a -lbz2 LIBS += ../../openpgpsdk/src/lib/libops.a -lbz2
LIBS += -lssl -lcrypto -lz LIBS += -lssl -lcrypto -lz
#LIBS += -lssl -lcrypto -lz -lgpgme -lgpg-error -lassuan #LIBS += -lssl -lcrypto -lz -lgpgme -lgpg-error -lassuan
LIBS += ../../../miniupnpc-1.0/libminiupnpc.a for(lib, LIB_DIR):exists($$lib/libminiupnpc.a){ LIBS += $$lib/libminiupnpc.a}
LIBS += -framework CoreFoundation LIBS += -framework CoreFoundation
LIBS += -framework Security LIBS += -framework Security
gxs {
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
LIBS += ../../../lib/libsqlcipher.a for(lib, LIB_DIR):LIBS += -L"$$lib"
#LIBS += -lsqlite3 for(bin, BIN_DIR):LIBS += -L"$$bin"
} DEPENDPATH += . $$INC_DIR
INCLUDEPATH += . $$INC_DIR
#LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
# We need a explicit path here, to force using the home version of sqlite3 that really encrypts the database.
LIBS += /usr/local/lib/libsqlcipher.a
#LIBS += -lsqlite3
INCLUDEPATH += .
#DEFINES* = MAC_IDLE # for idle feature #DEFINES* = MAC_IDLE # for idle feature
CONFIG -= uitools CONFIG -= uitools
} }
##################################### FreeBSD ###################################### ##################################### FreeBSD ######################################