-
-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
back to autotools build on unix for now #130
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching with 3.22 is not a good idea. We want to be able to switch between cmake and autotools build if the need arises. Therefore #49 is the best way forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see this comment. Upstream already aligned the names and soversions, but it still broke.
I also don't see the benefit of being able to switch back to autotools. It just a large surface for breakage for very little gain AFAICT, especially now that upstream has graduated CMake to first class citizen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know. Please see my comment on #49 about fixing
protobuf_SO_VERSION
and other variables.AFAICT, CMake was not a first class citizen up-to-now. If that becomes the default installation, that is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it was done by someone without a good understanding of how autotools works. I specifically added a feature to CMake to make it easier to replicate autotools behaviour because of protobuf.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is how I interpret protocolbuffers/protobuf#9596