diff --git a/build_deps.sh b/build_deps.sh index f7ffc42..66eb5c5 100755 --- a/build_deps.sh +++ b/build_deps.sh @@ -8,14 +8,14 @@ KERNEL=$(echo $(lsb_release -ds 2>/dev/null || cat /etc/*release 2>/dev/null | h case $OS in Linux) case $KERNEL in - CentOS) + CentOS) echo "Linux, CentOS" - sudo yum install automake cmake gcc-c++ git libtool openssl-devel wget + sudo yum -y install automake cmake gcc-c++ git libtool openssl-devel wget if echo "$(ldconfig -p | grep libuv)" then echo "libuv has already been installed" else pushd /tmp - wget http://libuv.org/dist/v1.4.2/libuv-v1.4.2.tar.gz + wget http://dist.libuv.org/dist/v1.4.2/libuv-v1.4.2.tar.gz tar xzf libuv-v1.4.2.tar.gz pushd libuv-v1.4.2 sh autogen.sh @@ -24,11 +24,12 @@ case $OS in popd popd sudo grep -q -F '/usr/local/lib' /etc/ld.so.conf.d/usrlocal.conf || echo '/usr/local/lib' | sudo tee --append /etc/ld.so.conf.d/usrlocal.conf > /dev/null - fi + ldconfig -v + fi ;; Ubuntu) echo "Linux, Ubuntu" - + sudo apt-add-repository -y ppa:linuxjedi/ppa sudo apt-get -y update sudo apt-get -y install g++ make cmake libuv-dev libssl-dev @@ -37,12 +38,12 @@ case $OS in esac ;; Darwin) - sudo brew install libuv cmake + brew install libuv cmake ;; *) echo "Your system $OS is not supported" esac -mkdir -p deps/cpp-driver/build -cd deps/cpp-driver/build +mkdir -p ../cpp-driver/build +cd ../cpp-driver/build cmake .. make diff --git a/rebar.config b/rebar.config index 37be6e0..9229128 100644 --- a/rebar.config +++ b/rebar.config @@ -1,35 +1,21 @@ -{ - deps, - [ - {'cpp-driver', ".*", {git, "https://github.com/datastax/cpp-driver", "40221db6be9103cc21f169e70b55e440000624e7"}, [raw]} - ] +{deps, [ + {'cpp-driver', ".*", + {git, "https://github.com/datastax/cpp-driver", "40221db6be9103cc21f169e70b55e440000624e7"}, [raw]}] }. +{deps_dir, "../"}. +{post_hooks,[{'get-deps',"sh -c './build_deps.sh'"}]}. -{post_hooks,[{'get-deps',"sh -c './build_deps.sh'"} - ]}. - -{port_specs, - [ - {"darwin","priv/erlcass.so", ["c_src/*.cc"], - [ - {env, - [ - {".*", "CXXFLAGS", "$CXXFLAGS -g -Wall -fno-exceptions -fno-rtti -Os -Ideps/cpp-driver/include -Ideps/cpp-driver/src -I/usr/local/include/"}, - {".*", "LDFLAGS", "$LDFLAGS -L/usr/local/lib/ -Ldeps/cpp-driver/build -lcassandra_static -luv -lssl -lcrypto"} - ] - } - ] - }, - - {"linux","priv/erlcass.so", ["c_src/*.cc"], - [ - {env, - [ - {".*", "CXXFLAGS", "$CXXFLAGS -g -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-local-typedefs -fno-exceptions -fno-rtti -Os -Ideps/cpp-driver/include -Ideps/cpp-driver/src"}, - {".*", "LDFLAGS", "$LDFLAGS -L/usr/local/lib/ -Ldeps/cpp-driver/build -lcassandra_static -luv -lstdc++ -lssl -lcrypto"} - ] - } - ] - } - ] -}. +{port_specs, [ + {"darwin","priv/erlcass.so", ["c_src/*.cc"],[ + {env, [ + {".*", "CXXFLAGS", "$CXXFLAGS -g -Wall -fno-exceptions -fno-rtti -Os -I../cpp-driver/include -I../cpp-driver/src -I/usr/local/include/"}, + {".*", "LDFLAGS", "$LDFLAGS -L/usr/local/lib/ -L../cpp-driver/build -lcassandra_static -luv -lssl -lcrypto"} + ]} + ]}, + {"linux","priv/erlcass.so", ["c_src/*.cc"],[ + {env, [ + {".*", "CXXFLAGS", "$CXXFLAGS -g -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-local-typedefs -fno-exceptions -fno-rtti -Os -I../cpp-driver/include -I../cpp-driver/src"}, + {".*", "LDFLAGS", "$LDFLAGS -L/usr/local/lib/ -L../cpp-driver/build -lcassandra_static -luv -lstdc++ -lssl -lcrypto"} + ]} + ]} +]}.