-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Azure put get: Adding dependent libs and wrapper scripts.
Added openssl 1.1.1b.tar.gz Added util-linux.tar.gz (Azure sdk requires UUID and uuid is part of util-linux) Added dependency uuid and Azure sdk to build_dependencies script build_openssl.sh: Now untars the tar and builds the library. build_uuid.sh: Untars the util-linux and only builds the UUID build_zlib.sh: Builds the zlib. CMakeLists.txt: Add findlibrary Azure
- Loading branch information
1 parent
26f20d8
commit 0b3d66f
Showing
10 changed files
with
193 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
#!/bin/bash -e | ||
# | ||
# build azure-cpp-lite | ||
# | ||
function usage() { | ||
echo "Usage: `basename $0` [-t <Release|Debug>]" | ||
echo "Build AZURE SDK" | ||
echo "-t <Release/Debug> : Release or Debug builds" | ||
exit 2 | ||
} | ||
set -o pipefail | ||
|
||
export CC="/usr/lib64/ccache/gcc52 -g" | ||
export CXX="/usr/lib64/ccache/g++52 -g" | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
source $DIR/_init.sh $@ | ||
AZURE_SOURCE_DIR=$DEPS_DIR/azure-storage-cpplite | ||
AZURE_BUILD_DIR=$DEPENDENCY_DIR/azure | ||
AZURE_CMAKE_BUILD_DIR=$AZURE_SOURCE_DIR/cmake-build | ||
|
||
GIT_REPO="https://github.com/snowflakedb/azure-storage-cpplite.git" | ||
CLONE_CMD="git clone -b master $GIT_REPO $AZURE_SOURCE_DIR" | ||
VERSION="v0.1.1" | ||
|
||
if [ ! -d $AZURE_SOURCE_DIR ]; then | ||
n=0 | ||
# retry 5 times on cloning | ||
until [ $n -ge 5 ] | ||
do | ||
if $CLONE_CMD ; then | ||
break | ||
fi | ||
n=$[$n+1] | ||
done | ||
|
||
if [ ! -d $AZURE_SOURCE_DIR ]; then | ||
echo "[Error] failed to clone repo from $GIT_REPO" | ||
exit 1 | ||
fi | ||
|
||
cd $AZURE_SOURCE_DIR | ||
git checkout tags/$VERSION -b $VERSION | ||
else | ||
cd $AZURE_SOURCE_DIR | ||
git fetch | ||
git checkout tags/$VERSION -b $VERSION || true | ||
fi | ||
|
||
|
||
azure_configure_opts=() | ||
if [[ "$target" != "Release" ]]; then | ||
azure_configure_opts+=("-DCMAKE_BUILD_TYPE=Debug") | ||
AZURE_CMAKE_BUILD_DIR=$AZURE_SOURCE_DIR/cmake-build-debug | ||
else | ||
azure_configure_opts+=("-DCMAKE_BUILD_TYPE=Release") | ||
fi | ||
azure_configure_opts+=( | ||
"-DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF" | ||
"-DCMAKE_C_COMPILER=$GCC" | ||
"-DCMAKE_CXX_COMPILER=$GXX" | ||
"-DCMAKE_INSTALL_PREFIX=$AZURE_BUILD_DIR" | ||
"-DBUILD_SHARED_LIBS=OFF" | ||
"-DUSE_OPENSSL=true" | ||
"-DOPENSSL_VERSION_NUMBER=0x11100000L" | ||
"-DBUILD_SAMPLES=true" | ||
"-DBUILD_TESTS=false" | ||
"-DOPENSSL_INCLUDE_DIR=$DEPENDENCY_DIR/openssl/include" | ||
"-DOPENSSL_CRYPTO_LIBRARY=$DEPENDENCY_DIR/openssl/lib/libcrypto.a" | ||
"-DOPENSSL_SSL_LIBRARY=$DEPENDENCY_DIR/openssl/lib/libssl.a" | ||
"-DUUID_INCLUDE_DIR=$DEPENDENCY_DIR/uuid/include" | ||
"-DUUID_LIBRARIES=$DEPENDENCY_DIR/uuid/lib/libuuid.a" | ||
"-DCURL_INCLUDE_DIRS=$DEPENDENCY_DIR/curl/include" | ||
"-DCURL_LIBRARIES=$DEPENDENCY_DIR/curl/lib/libcurl.a" | ||
"-DEXTRA_INCLUDE=$DEPENDENCY_DIR/zlib/include" | ||
) | ||
|
||
|
||
ADDITIONAL_CXXFLAGS= | ||
if [[ "$PLATFORM" == "darwin" ]]; then | ||
azure_configure_opts+=("-DCMAKE_OSX_ARCHITECTURES=x86_64;i386") | ||
ADDITIONAL_CXXFLAGS="-mmacosx-version-min=10.11" | ||
fi | ||
|
||
rm -rf $AZURE_BUILD_DIR | ||
rm -rf $AZURE_CMAKE_BUILD_DIR | ||
mkdir $AZURE_BUILD_DIR | ||
mkdir $AZURE_CMAKE_BUILD_DIR | ||
|
||
export GIT_DIR=/tmp | ||
|
||
cd $AZURE_CMAKE_BUILD_DIR | ||
$CMAKE -E env CXXFLAGS=$ADDITIONAL_CXXFLAGS $CMAKE ${azure_configure_opts[@]} -DEXTRA_LIBRARIES="-lrt -ldl -pthread $DEPENDENCY_DIR/zlib/lib/libz.a" ../ | ||
|
||
make | ||
make install | ||
|
||
#make install does not do much here | ||
cp -dfr $AZURE_SOURCE_DIR/include $DEPENDENCY_DIR/azure/ | ||
mkdir -p $DEPENDENCY_DIR/azure/lib | ||
cp -dfr $AZURE_CMAKE_BUILD_DIR/libazure-storage-lite.a $DEPENDENCY_DIR/azure/lib/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash -e | ||
# | ||
# Build libuuid | ||
# | ||
|
||
set -o pipefail | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
source $DIR/_init.sh $@ | ||
|
||
UTIL_LINUX_TAR_GZ=$DEPS_DIR/util-linux.tar.gz | ||
SOURCE_DIR=$DEPS_DIR/util-linux | ||
|
||
tar -xzf $UTIL_LINUX_TAR_GZ -C $DEPS_DIR | ||
|
||
if [ ! -d "$SOURCE_DIR" ] ; then | ||
echo "Could not extract $UTIL_LINUX_TAR_GZ" | ||
exit 1 | ||
fi | ||
|
||
cd $SOURCE_DIR | ||
|
||
if [[ "$PLATFORM" == "linux" ]]; then | ||
echo "Generating UUID build system" | ||
./autogen.sh || true | ||
# Make sure the compiled binary is position independent as ODBC is a shared library | ||
export CFLAGS="-fPIC" | ||
export AL_OPTS="-I/usr/share/aclocal" | ||
./configure --disable-all-programs --enable-libuuid --prefix=$DEPENDENCY_DIR/uuid || true | ||
echo "Compiling UUID source" | ||
make install || true | ||
else | ||
echo "[ERROR] Unknown platform: $PLATFORM" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash -e | ||
# | ||
# Build zlib | ||
# | ||
function usage() { | ||
echo "Usage: `basename $0` [-t <Release|Debug>]" | ||
echo "Builds zlib" | ||
echo "-t <Release/Debug> : Release or Debug builds" | ||
exit 2 | ||
} | ||
set -o pipefail | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
SOURCE_DIR=$DIR/../deps/zlib-1.2.11 | ||
source $DIR/_init.sh $@ | ||
|
||
# init environment | ||
#init_environment $DIR | ||
|
||
# build | ||
BUILD_DIR=../deps-build/linux/zlib | ||
rm -rf $BUILD_DIR | ||
mkdir -p $BUILD_DIR | ||
|
||
zlib_config_opts=() | ||
zlib_config_opts+=( | ||
"--static" | ||
"--prefix=$BUILD_DIR" | ||
) | ||
cd $SOURCE_DIR | ||
if [[ "$PLATFORM" == "linux" ]]; then | ||
# Linux 64 bit | ||
export CC=gcc52 | ||
if [ -e "Makefile" ] ; then | ||
make distclean clean > /dev/null || true | ||
fi | ||
./configure ${zlib_config_opts[@]} > /dev/null || true | ||
make install > /dev/null || true | ||
else | ||
echo "[ERROR] Unknown platform: $PLATFORM" | ||
exit 1 | ||
fi |