Skip to content

Commit

Permalink
Added missing scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredsburrows committed Jun 29, 2015
1 parent f9cfbc0 commit 7e63a96
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
@@ -1,4 +1,4 @@
language: c
language: cpp

os:
- linux
Expand Down
58 changes: 58 additions & 0 deletions scripts/install-clang.sh
@@ -0,0 +1,58 @@
#!/bin/bash

# Exit if fail
set -e

if [ "$TRAVIS_OS_NAME" = linux -o -z "$TRAVIS_OS_NAME" ]; then

# Repository for clang
sudo add-apt-repository -y ppa:h-rayflood/llvm
sudo add-apt-repository -y ppa:h-rayflood/llvm-upper
sudo add-apt-repository -y ppa:h-rayflood/gcc-upper

# Update packages
sudo apt-get update -qq

# Install clang
sudo apt-get -qq --allow-unauthenticated install clang-${CLANG_VERSION} clang++-${CLANG_VERSION}

# Install libc++ for clang
CWD=$(pwd)
export CXXFLAGS="-std=c++0x -stdlib=libc++"
svn co --quiet http://llvm.org/svn/llvm-project/libcxx/trunk libcxx
cd libcxx/lib && bash buildit
sudo cp ./libc++.so.1.0 /usr/lib/
sudo mkdir /usr/include/c++/v1
cd .. && sudo cp -r include/* /usr/include/c++/v1/
cd /usr/lib && sudo ln -sf libc++.so.1.0 libc++.so
sudo ln -sf libc++.so.1.0 libc++.so.1 && cd $CWD

# Update alternatives for clang
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${CLANG_VERSION} 50
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${CLANG_VERSION} 50

elif [ "$TRAVIS_OS_NAME" = osx ]; then

# Make sure xcode is setup
xcode-select --install

# Update brew
brew update || echo "suppress failures in order to ignore warnings"
brew doctor || echo "suppress failures in order to ignore warnings"
brew list clang || echo "suppress failures in order to ignore warnings"
sudo brew uninstall --force clang || "suppress failures in order to ignore warnings"
brew search clang || echo "suppress failures in order to ignore warnings"

# Install clang
brew install clang || echo "suppress failures in order to ignore warnings"
brew upgrade clang || echo "suppress failures in order to ignore warnings"
fi

# Export clang
export CXX="clang++-${CLANG_VERSION}"
export CC="clang-${CLANG_VERSION}"

# Debug information
clang --version
clang++ --version

35 changes: 35 additions & 0 deletions scripts/install-cmake.sh
@@ -0,0 +1,35 @@
#!/bin/sh

# Exit if fail
set -e

if [ "$TRAVIS_OS_NAME" = linux -o -z "$TRAVIS_OS_NAME" ]; then

# Download cmake
wget http://www.cmake.org/files/v3.2/cmake-3.2.3-Linux-x86_64.sh
chmod a+x cmake-3.2.3-Linux-x86_64.sh

# Install
sudo ./cmake-3.2.3-Linux-x86_64.sh --skip-license --prefix=/usr/local
export PATH=/usr/local/bin:$PATH

elif [ "$TRAVIS_OS_NAME" = osx ]; then

# Make sure xcode is setup
xcode-select --install

# Update brew
brew update || echo "suppress failures in order to ignore warnings"
brew doctor || echo "suppress failures in order to ignore warnings"
brew list cmake || echo "suppress failures in order to ignore warnings"
sudo brew uninstall --force cmake || "suppress failures in order to ignore warnings"
brew search cmake || echo "suppress failures in order to ignore warnings"

# Install cmake
brew install cmake || echo "suppress failures in order to ignore warnings"
brew upgrade cmake || echo "suppress failures in order to ignore warnings"
fi

# Debug information
cmake --version

46 changes: 46 additions & 0 deletions scripts/install-gcc.sh
@@ -0,0 +1,46 @@
#!/bin/bash

# Exit if fail
set -e

if [ "$TRAVIS_OS_NAME" = linux -o -z "$TRAVIS_OS_NAME" ]; then

# Repository for gcc
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test

# Update packages
sudo apt-get update -qq

# Install gcc
sudo apt-get -qq --allow-unauthenticated install gcc-${LIBSTDC_VERSION} g++-${LIBSTDC_VERSION}

# Update alternatives for gcc
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${LIBSTDC_VERSION} 50
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${LIBSTDC_VERSION} 50

elif [ "$TRAVIS_OS_NAME" = osx ]; then

# Make sure xcode is setup
xcode-select --install

# Update brew
brew update || echo "suppress failures in order to ignore warnings"
brew doctor || echo "suppress failures in order to ignore warnings"
brew list gcc || echo "suppress failures in order to ignore warnings"
sudo brew uninstall --force gcc || "suppress failures in order to ignore warnings"
brew search gcc || echo "suppress failures in order to ignore warnings"

# Install gcc
brew install homebrew/versions/gcc${LIBSTDC_VERSION} || echo "suppress failures in order to ignore warnings"
brew upgrade homebrew/versions/gcc${LIBSTDC_VERSION} || echo "suppress failures in order to ignore warnings"

fi

# Export gcc
export CXX="g++-${LIBSTDC_VERSION}"
export CC="gcc-${LIBSTDC_VERSION}"

# Debug information
gcc --version
g++ --version

0 comments on commit 7e63a96

Please sign in to comment.