Skip to content

modify Makefile so that tor-android can be compiled on MacOS#186

Merged
bitmold merged 1 commit intoguardianproject:masterfrom
cyBerta:build_darwin
Feb 6, 2026
Merged

modify Makefile so that tor-android can be compiled on MacOS#186
bitmold merged 1 commit intoguardianproject:masterfrom
cyBerta:build_darwin

Conversation

@cyBerta
Copy link
Copy Markdown
Contributor

@cyBerta cyBerta commented Feb 6, 2026

several build steps were failing.

  • zlib was defaulting to libtool during the configure phase before compiling.
if "${CROSS_PREFIX}libtool" -V 2>&1 | grep Apple > /dev/null; then
            AR="${CROSS_PREFIX}libtool"
        elif libtool -V 2>&1 | grep Apple > /dev/null; then
            AR="libtool"
        else
            AR="/usr/bin/libtool"
        fi

However generating the resulting lib using that libtool failed (Maybe because that isn't the gnu libtool?). Setting the environment variables for AR to a libtool provided by the NDK as well as setting the CHOST allowed to overcome that issue.

  • the wrong toolchain (linux-x86_64) was hardcoded and added to the path, which resulted in a subsequent build error
  • the tor binary build failed since jni_md.h was missing. Adding the correct include path to the CPPFLAGS, fixed that.

@bitmold bitmold merged commit f516216 into guardianproject:master Feb 6, 2026
@bitmold
Copy link
Copy Markdown
Contributor

bitmold commented Feb 6, 2026

Thanks so much for figuring this out! I just also confirmed that everything still works fine on Linux after applying your changes

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