Skip to content
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

WIP call vendor/configure and vendor/make to create libzmq.a #3

Closed

Conversation

AxelNennker
Copy link

Signed-off-by: Axel Nennker axel.nennker@telekom.de

I suggest to call zeromq's autogen.sh && configure && make to build libzmq.a

How to use this:

  • clone the repository
    git clone --recursive https://github.com/AxelNennker/zeromq-src-rs
  • cd
    cd zeromq-src-rs
  • Install Android Studio if you haven't
    Please see https://developer.android.com/studio/
  • set environment (on Ubuntu)
export HOST_TAG=linux-x86_64
export NDK=$HOME/Android/Sdk/ndk-bundle
  • call cargo build
    ANDROID_API=28 PATH=$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH CC=$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android28-clang CXX=$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android28-clang++ cargo build --target=aarch64-linux-android
  • the resulting library is in vendor/src/.libs/libzmq.a

Possible improvements:

  • copy vendor code to OUT_DIR/vendor before configuring and building so that cargo clean removes everything built
  • tell crate using this crate where the new static library is

Signed-off-by: Axel Nennker <axel.nennker@telekom.de>
@jean-airoldie
Copy link
Owner

Hi Axel,

Could you explain to me what problem using cmake causes that using make directly would solve?

From what I recall you were unable to cross-compile for android using cmake. Why not open an issue for that?

@AxelNennker AxelNennker changed the title call vendor/configure and vendor/make to create libzmq.a WIP call vendor/configure and vendor/make to create libzmq.a May 24, 2019
@AxelNennker
Copy link
Author

Added WIP to the title of this PR.
I will follow openssl-rs's example and copy the source_dir to OUT_DIR
https://github.com/alexcrichton/openssl-src-rs/blob/master/src/lib.rs#L80
This way it gets removed when cargo clean is called.

Also integrate with testcrate again following openssl_rs's example.

@AxelNennker
Copy link
Author

I now build from the testcrate to see who the src-crate is used.

Sub-problem is now that the cloned git submodule is not on the stable branch and the configure script is complaining about that.

--- stderr
configure: WARNING: You are building an unreleased version of 0MQ and asciidoc or xmlto are not installed.

Is that something you could change for the git submodule?

@jean-airoldie
Copy link
Owner

Yes the master branch uses a unreleased version for zmq. The latest_release branch tracks the lastest zmq stable release.

@AxelNennker
Copy link
Author

I suggest to add the stable branch here as a submodule like described here.
https://stackoverflow.com/questions/1777854/how-can-i-specify-a-branch-tag-when-adding-a-git-submodule
Maybe even a fixed version (which would be needed to be updated from time to time)

@jean-airoldie
Copy link
Owner

Currently latest_release tracks the stable branch. However the stable branch is not a fixed version.

I'm not sure I understand your previous comment.

@AxelNennker
Copy link
Author

AxelNennker commented May 25, 2019

I think that the submodule should be 'stable' not master.

cd zeromq-src-rs/vendor
git checkout stable
cd ..
git add zeromq-src-rs
git commit -m "moved src directory vendor to stable"
git push

This way the submodule directory 'vendor' contains the branch 'stable' when zeromq-src-rs is checked out.

@jean-airoldie
Copy link
Owner

The master branch mirrors libzmq's master branch. It is a preview branch.

The lastest_release mirros follows libzmq's lastest_release branch. This is a the stable branch.

Do you mean that you think either of these branches should be renamed?

Signed-off-by: Axel Nennker <axel.nennker@telekom.de>
Signed-off-by: Axel Nennker <axel.nennker@telekom.de>
Signed-off-by: Axel Nennker <axel.nennker@telekom.de>
Signed-off-by: Axel Nennker <axel.nennker@telekom.de>
Signed-off-by: Axel Nennker <axel.nennker@telekom.de>
@AxelNennker AxelNennker deleted the vendor_configure branch May 26, 2019 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants