diff --git a/.travis.yml b/.travis.yml index 9a40a3d7..e15daf58 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,12 @@ language: cpp compiler: - g++ -dist: trusty -sudo: false +matrix: + include: + - os: linux + dist: trusty + sudo: false + - os: osx addons: apt: sources: @@ -14,6 +18,11 @@ addons: - libcurl4-openssl-dev - gcc - g++ +before_install: + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list scons &>/dev/null || brew install scons ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list boost &>/dev/null || brew install boost ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list openssl &>/dev/null || brew install openssl ; fi cache: apt: true script: scons install apps samples diff --git a/BUILD.md b/BUILD.md index 313c8e18..6b3a423d 100644 --- a/BUILD.md +++ b/BUILD.md @@ -11,7 +11,7 @@ FreeLAN depends on the following libraries: - OpenSSL - iconv (Windows) -Generally Linux users can just use the binaries provided by their package manager, but other platforms such as Mac OSX or Windows may need to build these libraries explicitely. +Generally Linux users can just use the binaries provided by their package manager, Mac OSX users can use brew but other platforms such as Windows may need to build these libraries explicitely. To build the third-party libraries, you can use [teapot](https://github.com/freelan-developers/teapot). Check its [documentation](http://teapot-builder.readthedocs.org/en/latest/) for details, or just type the following command at the root of FreeLAN's repository: @@ -25,6 +25,16 @@ To install the required dependencies on Debian Linux (Or Ubuntu), type the follo > sudo apt-get install scons python libssl-dev libcurl4-openssl-dev libboost-system-dev libboost-thread-dev libboost-program-options-dev libboost-filesystem-dev libboost-iostreams-dev build-essential +### Mac OSX + +To install the required dependencies on Mac OS, type the following commands: + +> /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + +> brew update + +> brew install scons boost openssl + Building FreeLAN ---------------- diff --git a/SConstruct b/SConstruct index 55b0a48c..14413490 100644 --- a/SConstruct +++ b/SConstruct @@ -117,7 +117,11 @@ class FreelanEnvironment(Environment): self.Append(CXXFLAGS=['-arch', 'x86_64']) self.Append(CXXFLAGS=['-DBOOST_ASIO_DISABLE_KQUEUE']) self.Append(CXXFLAGS=['--stdlib=libc++']) + self.Append(CXXFLAGS=['-I/usr/local/opt/openssl/include']) + self.Append(CFLAGS=['-I/usr/local/opt/openssl/include']) self.Append(LDFLAGS=['--stdlib=libc++']) + self.Append(LDFLAGS=['-L/usr/local/opt/openssl/lib']) + self.Append(LIBPATH=['/usr/local/opt/openssl/lib']) if self.mode == 'debug': self.Append(CXXFLAGS=['-g']) diff --git a/apps/freelan/SConscript b/apps/freelan/SConscript index e1e057fd..d3ae84a7 100644 --- a/apps/freelan/SConscript +++ b/apps/freelan/SConscript @@ -12,7 +12,6 @@ libraries = [ 'kfather', 'iconvplus', 'boost_system', - 'boost_thread', 'boost_filesystem', 'boost_date_time', 'boost_program_options', @@ -22,6 +21,15 @@ libraries = [ 'crypto', ] +if sys.platform.startswith('darwin'): + libraries.extend([ + 'boost_thread-mt', + ]) +else: + libraries.extend([ + 'boost_thread', + ]) + if sys.platform.startswith('linux'): libraries.extend([ 'pthread', diff --git a/samples/fscp/client/SConscript b/samples/fscp/client/SConscript index d3133279..b77fd312 100644 --- a/samples/fscp/client/SConscript +++ b/samples/fscp/client/SConscript @@ -5,11 +5,19 @@ import sys libraries = [ 'fscp', 'cryptoplus', - 'boost_thread', 'boost_system', 'crypto', ] +if sys.platform.startswith('darwin'): + libraries.extend([ + 'boost_thread-mt', + ]) +else: + libraries.extend([ + 'boost_thread', + ]) + if sys.platform.startswith('linux'): libraries.extend([ 'pthread', diff --git a/samples/fscp/schat/SConscript b/samples/fscp/schat/SConscript index d3133279..b77fd312 100644 --- a/samples/fscp/schat/SConscript +++ b/samples/fscp/schat/SConscript @@ -5,11 +5,19 @@ import sys libraries = [ 'fscp', 'cryptoplus', - 'boost_thread', 'boost_system', 'crypto', ] +if sys.platform.startswith('darwin'): + libraries.extend([ + 'boost_thread-mt', + ]) +else: + libraries.extend([ + 'boost_thread', + ]) + if sys.platform.startswith('linux'): libraries.extend([ 'pthread',