From f08c5bea2e25221c3a09332fd8717811f89e5411 Mon Sep 17 00:00:00 2001 From: drbob Date: Sun, 19 Feb 2012 20:05:41 +0000 Subject: [PATCH] Added BSD specific changes - data directory and #including git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4968 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/rsserver/rsinit.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index fe4a2a441..d0cf3b146 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -51,6 +51,10 @@ #include #include +#if (defined(__unix__) || defined(unix)) && !defined(USG) +#include +#endif + // for blocking signals #include @@ -860,6 +864,8 @@ std::string RsInit::getRetroshareDataDirectory() #ifndef WINDOWS_SYS #ifdef __APPLE__ + /* NOTE: OSX also qualifies as BSD... so this #ifdef must be before the BSD check. */ + /* For OSX, applications are Bundled in a directory... * need to get the path to the executable Bundle. * @@ -878,6 +884,15 @@ std::string RsInit::getRetroshareDataDirectory() dataDirectory += "/Contents/Resources"; std::cerr << "getRetroshareDataDirectory() OSX: " << dataDirectory; + #elif (defined(BSD) && (BSD >= 199103)) + /* For BSD, the default is LOCALBASE which will be set + * before compilation via the ports/pkg-src mechanisms. + * For compilation without ports/pkg-src it is set to + * /usr/local (default on Open and Free; Net has /usr/pkg) + */ + dataDirectory = "/usr/local/share/retroshare"; + std::cerr << "getRetroshareDataDirectory() BSD: " << dataDirectory; + #else /* For Linux, we have a fixed standard data directory */ dataDirectory = "/usr/share/RetroShare";