I haven't even tried to use make check here, that will take a chunk of work. I assume that's where the python detection is. I'm just directly calling the test executables after copying them to the emulator, like this:
From my very vague understanding of the all the bits of the test suite, I'm guessing there will be some that won't be worth porting to run in the Android emulator. So I think the question now is: what parts must be ported to have decent coverage? What parts are you worried about?
Since Android has no /tmp/ or mkdtemp(), I changed this to fake it, and check the results of mkdir() in the process.
That took too long, ./configure with cross bulids is always painful, and tor is unfortunately no exception. Then the tests have to run in an emulator. I spent at least 3 hours updating this.
I never found that changes file, so I've made a new one. I've also fixed a couple of bugs in the old code (failure to delete correct directory, using decimal for chmod bits) and tried to document the stuff that wasn't explained.
[before mereging, we should IMO either understand the permissions issue that makes the setuid/setgid bits and the subdirectory necessary, or conclude that those are not necessary and remove them. ]
FYI, I'm using and maintaining this in the Guardian Project fork. All other versions of this could be outdated, as far as I know. https://github.com/guardianproject/tor specifically the tor-android-0.4.2 and tor-android-0.4.1 branches NOT master.
Ahh, it looks like your current patch is much simpler:
+#elif defined(__ANDROID__)+ /* tor might not like the default perms, so create a subdir */+ tor_snprintf(temp_dir, sizeof(temp_dir),+ "/data/local/tmp/tor_%d_%d_%s",+ (int) getuid(), (int) getpid(), rnd32);+ r = mkdir(temp_dir, 0700);+ if (r) {+ fprintf(stderr, "Can't create directory %s:", temp_dir);+ perror("");+ exit(1);
This is a lot more reasonable than what was in the branch before. I'll see if I can extract that into something mergeable.