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

allow to redefine ar and ranlib #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

svlobanov
Copy link

Makefiles call 'ar r' and 'ranlib' command. It causes issues on
cross-compilation (e.g. build on macos for linux target)

This patch allows to redifine ar and ranlib using AR and RANLIB
Makefile variables

This patch is fully backward compatible. Default values for AR=ar
and RANLIB=ranlib to reproduce current behaviour if these variables
are not set.

Signed-off-by: Sergey V. Lobanov [email protected]

Additional comment: Looks like makefiles were deleted in dev/main tree but this (stable) tree is still actual so please accept this patch to stable tree to simplify cross-compile builds

Makefiles call 'ar r' and 'ranlib' command. It causes issues on
cross-compilation (e.g. build on macos for linux target)

This patch allows to redifine ar and ranlib using AR and RANLIB
Makefile variables

This patch is fully backward compatible. Default values for AR=ar
and RANLIB=ranlib to reproduce current behaviour if these variables
are not set.

Signed-off-by: Sergey V. Lobanov <[email protected]>
Copy link

@paulmenzel paulmenzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a test line, how to cross-compile it under macOS now.

@svlobanov
Copy link
Author

Maybe add a test line, how to cross-compile it under macOS now.

cross-compile example is in OpenWrt project, my version working on macos (build host=macos, target=linux): https://github.com/openwrt/packages/blob/bc8e3e3d7903b5160b2d3a42f80877a1e06e8c0f/net/softethervpn/Makefile

General idea is:

  1. make hamcore.se2 using host compiler (apple clang on macos) with src/makefiles/macos_XXX.mak Makefile
  2. shift timestamp for hamcore.se2 to protect it from rebuilding with target toolchain (otherwise, it will fail if target and build hosts are different)
  3. build everything else using target toolchain with src/makefiles/linux_XXX.mak

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