Page 1 of 1

building android

Posted: Sat Oct 17, 2015 9:53 am
by monte
I'm getting setup to build android again... haven't done it since gyp. Anyway, I'm getting this:

Code: Select all

android-ndk-r10e/build/tools/make-standalone-toolchain.sh \
>     --toolchain=arm-linux-androideabi-clang3.5 \
>     --platform=android-10 \
>     --install-dir=/users/montegoulding/android/toolchain/standalone
Auto-config: --toolchain=arm-linux-androideabi-4.8, --llvm-version=3.5
Invalid platform name: android-10
Please use --platform=<name> with one of: android-12 android-13 android-14 android-15 android-16 android-17 android-18 android-19 android-21 android-3 android-4 android-5 android-8 android-9
Odd that the one I want is the one that isn't listed...

Re: building android

Posted: Tue Oct 20, 2015 7:44 am
by monte
Some googling found a few other folks have had missing platforms over the years. This turned up in my search results and I'm wondering if it indicates I should be (and perhaps the docs should suggest) making the toolchain with android-9

https://android.googlesource.com/platfo ... /platforms

Perhaps for some reason the symlinks weren't made?

Re: building android

Posted: Tue Oct 27, 2015 5:53 am
by monte
bump... any ideas

Re: building android

Posted: Tue Oct 27, 2015 11:35 am
by LCfraser
I think using android-9 will be fine. Try it and let us know how it goes and we can update the notes appropriately.

Re: building android

Posted: Wed Oct 28, 2015 12:23 pm
by monte
Thanks @LCFraser... For some reason the symlinks aren't in my sdk either so I had to symlink android-10 to android-9 in the sdks to get it to build also... all a bit odd. I'm getting there with the build now but I get lots of these errors:

Code: Select all

../../toolchain/gentle/gentle/cyfront.c:2921:11: error: variable 'yyb' is uninitialized when used here [-Werror,-Wuninitialized]
yy yysb = yyb;
Perhaps you want to turn off the errors on uninitialised vars in the gentle project... Couldn't gentle & lc-compile etc be skipped for android anyway?

Re: building android

Posted: Wed Oct 28, 2015 1:10 pm
by monte
OK... so I removed the -Werror=uninitialized from the gyp files I found it in, rebuilt the config, and now I hit this error:

Code: Select all

/Users/montegoulding/livecode/build-android-armv6/livecode/../../libcore/src/core.cpp:187: multiple definition of `__MCLog(char const*, unsigned int, char const*, ...)'
out/Debug/obj.target/libfoundation/libFoundation.a(foundation-debug.o):/Users/montegoulding/livecode/build-android-armv6/livecode/../../libfoundation/src/foundation-debug.cpp:192: first defined here
clang35: error: linker command failed with exit code 1 (use -v to see invocation)
And.. yep, libcore and libfoundation do appear to have matching definitions of __MCLog. Is android not meant to have one of these?

I'm thinking I'm hitting these errors because the gyp files have been schmoozed to build android on linux and some of the OS == or != linux should also check to see if it's an android build on mac.

Re: building android

Posted: Wed Oct 28, 2015 8:46 pm
by monte
Aha!

From android.gypi. Shouldn't we be including appropriate settings for the build platform. In my case mac.

Code: Select all

'target_conditions':
		[
			[
				'_toolset == "host"',
				{
					'includes':
					[
						'linux-settings.gypi',
					],
				},
				{
					'includes':
					[
						'android-settings.gypi',
					],
				},
			],
		],

Re: building android

Posted: Thu Oct 29, 2015 8:51 am
by monte
OK... so I worked out that the bug is only for debug builds. So.. setting MODE to release and it's building. Someone should look at the conflicting definitions of __MCLog etc though. Seems very odd they would be in two places.

Re: building android

Posted: Tue Dec 08, 2015 4:00 pm
by LCfraser
Thread necromancy at its finest, but I thought I should explain why Android is including the Linux settings!

Mainly, we want the toolchain to be as Linux-like as possible. The Mac settings as they are are only really suitable for building with Xcode but, when doing the Android build, all the host tools are built using Make. Gyp unfortunately contributes to the problem here - unless you force it to do otherwise, it'll generate OSX-style makefiles for the Android portion of the build, which (unsurprisingly) upsets the Android toolchain.

Re: building android

Posted: Wed Dec 09, 2015 4:25 am
by monte
@LCFraser thanks for looking in here ;-)

Any ideas on the redefinition of __MCLog?

Re: building android

Posted: Tue Dec 15, 2015 5:30 am
by mwieder
I don't think this is Android-related, but since you're looking at gyp things, I'm now getting

make config-linux-x86_64
make[1]: Entering directory `/home/mwieder/livecode7'
./config.sh --platform linux-x86_64
gyp/gyp --format make-linux --depth . --generator-output build-linux-x86_64/livecode -G default_target=default -DOS=linux -Dtarget_arch=x86_64
static library thirdparty/libiodbc/libiodbc.gyp:libiodbc#target has several files with the same basename:
Info: src/inst/Info.c src/trace/Info.c
misc: src/misc.c src/inst/misc.c
Some build systems, e.g. MSVC08, cannot handle that.
gyp: Duplicate basenames in sources section, see list above
make[1]: *** [config-linux-x86_64] Error 1
make[1]: Leaving directory `/home/mwieder/livecode7'
make: *** [all-linux-x86_64] Error 2

I looked at the log, and it seems that the libiodbc.gyp file hasn't changed in months. What has?