-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
back to autotools build on unix for now
- Loading branch information
1 parent
ab262d6
commit 2b886e1
Showing
3 changed files
with
81 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
if [ "$(uname)" == "Linux" ]; | ||
then | ||
# protobuf uses PROTOBUF_OPT_FLAG to set the optimization level | ||
# unit test can fail if optmization above 0 are used. | ||
CPPFLAGS="${CPPFLAGS//-O[0-9]/}" | ||
CXXFLAGS="${CXXFLAGS//-O[0-9]/}" | ||
export PROTOBUF_OPT_FLAG="-O2" | ||
# to improve performance, disable checks intended for debugging | ||
CXXFLAGS="$CXXFLAGS -DNDEBUG" | ||
elif [ "$(uname)" == "Darwin" ]; | ||
then | ||
# remove pie from LDFLAGS | ||
LDFLAGS="${LDFLAGS//-pie/}" | ||
fi | ||
|
||
# required to pick up conda installed zlib | ||
export CPPFLAGS="${CPPFLAGS} -I${PREFIX}/include" | ||
export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib" | ||
|
||
# Build configure/Makefile as they are not present. | ||
aclocal | ||
libtoolize | ||
autoconf | ||
autoreconf -i | ||
automake --add-missing | ||
|
||
./configure --prefix="${PREFIX}" \ | ||
--build=${BUILD} \ | ||
--host=${HOST} \ | ||
--with-pic \ | ||
--with-zlib \ | ||
--enable-shared \ | ||
CC_FOR_BUILD=${CC} \ | ||
CXX_FOR_BUILD=${CXX} | ||
|
||
# Skip memory hungry tests | ||
export GTEST_FILTER="-IoTest.LargeOutput" | ||
if [ "${HOST}" == "powerpc64le-conda_cos7-linux-gnu" ]; then | ||
make -j 2 | ||
make check -j 2 || (cat src/test-suite.log; exit 1) | ||
else | ||
make -j ${CPU_COUNT} | ||
if [[ "$CONDA_BUILD_CROSS_COMPILATION" != 1 ]]; then | ||
make check -j ${CPU_COUNT} || (cat src/test-suite.log; exit 1) | ||
fi | ||
fi | ||
make install | ||
rm ${PREFIX}/lib/libprotobuf.a | ||
rm ${PREFIX}/lib/libprotobuf-lite.a | ||
rm ${PREFIX}/lib/libprotoc.a |
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,7 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
mkdir -p ${PREFIX}/lib | ||
ls -l ./src/.libs/libproto*.a | ||
cp ./src/.libs/libproto*.a ${PREFIX}/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