Rockbox Technical Forums

Rockbox Development => Starting Development and Compiling => Topic started by: nieroster on June 07, 2011, 05:29:38 PM

Title: troubles building Android App using Windows/Cygwin
Post by: nieroster on June 07, 2011, 05:29:38 PM
Hello,

I can compile for the iRiver targets without problems, but so far I did not succed compiling an android app. This is the output I get:


Using source code root directory: /cygdrive/h/Programming/rockbox/source
 (404)arm-linux-androideabi-gcc 4.4.3
 is not of the recommendeder arm-linux-androideabi-gcc 4.4.3
WARNING: version 4.4.3!
WARNING: This may cause your build to fail since it may be a version
WARNING: that isn't functional or known to not be the best choice.
WARNING: If you suffer from build problems, you know that this is
WARNING: a likely source for them...
Using arm-linux-androideabi-ld 2.19
Created Makefile
arm-linux-androideabi-gcc.exe: /cygdrive/h/Programming/rockbox/source/firmware/S
OURCES: No such file or directory
arm-linux-androideabi-gcc.exe: warning: '-x c' after last input file has no effe
ct
arm-linux-androideabi-gcc.exe: no input files
arm-linux-androideabi-gcc.exe: /cygdrive/h/Programming/rockbox/source/lib/skin_p
arser/SOURCES: No such file or directory
arm-linux-androideabi-gcc.exe: warning: '-x c' after last input file has no effe
ct
...


First I do not understand the WARNNG above. v 4.4.3 is recommended and that's exactly what I use, so why does it show this warning?

Second: I had to add the path of the cross compiler to the path manually just adding the lines:
  export ANDROID_SDK_PATH=C:\Android\SDK
  export ANDROID_NDK_PATH=C:\Android\NDK
to the build script is not suffucient, because the directory structure of the linux-NDK and the windows-NDK are slightly different (linux-x86/bin vs. windows/bin).

What I do not understand next is the line:
arm-linux-androideabi-gcc.exe: /cygdrive/h/Programming/rockbox/source/firmwar
e/SOURCES: No such file or directory

Of course there is a file called: "H:\Programming\rockbox\source\firmware\SOURCES"

Well, I'm stuck here... if anybody can help I would appreciate it.

Regards,
Franz
Title: Re: troubles building Android App using Windows/Cygwin
Post by: saratoga on June 07, 2011, 06:07:32 PM
First I do not understand the WARNNG above. v 4.4.3 is recommended and that's exactly what I use, so why does it show this warning?

The recommended version is 4.4.4 IIRC.
Title: Re: troubles building Android App using Windows/Cygwin
Post by: bluebrother on June 07, 2011, 07:10:44 PM
The recommended version is 4.4.4 IIRC.

configure checks for 4.4.3. That is not the problem however -- the problem is something completely different: nobody did build Rockbox for Android on Cygwin before, and therefore it's likely to be broken.

Second: I had to add the path of the cross compiler to the path manually just adding the lines:
  export ANDROID_SDK_PATH=C:\Android\SDK
  export ANDROID_NDK_PATH=C:\Android\NDK
to the build script is not suffucient, because the directory structure of the linux-NDK and the windows-NDK are slightly different (linux-x86/bin vs. windows/bin).

Please be very careful with separating DOS and Unix path separators. You need to export that in the Cygwin environment, so it should be a Cygwin path: export ANDROID_SDK_PATH=/cygdrive/c/Android/SDK. Second, what does uname on Cygwin return?

Quote
What I do not understand next is the line:
arm-linux-androideabi-gcc.exe: /cygdrive/h/Programming/rockbox/source/firmwar
e/SOURCES: No such file or directory

Carefully check the capitalization of the path *from Cygwin*. "Programming" and "programming" are the same on Windows but two completely different folders on Cygwin.
Title: Re: troubles building Android App using Windows/Cygwin
Post by: nieroster on June 08, 2011, 03:43:52 AM
First of all thank you for your quick answer!

The current NDK is r5 and it comes with cross compiler version 4.4.3. Where do I get the recommended v4.4.4 compiler?

I have changed the environment variables to cygwin notation:
   export ANDROID_SDK_PATH=/cygdrive/c/Android/SDK
   export ANDROID_NDK_PATH=/cygdrive/c/Android/NDK
but this does not change anything at all.

This is what uname returns on cygwin:
$ uname
CYGWIN_NT-6.1-WOW64

it is not 'windows' as assumed by tools/configure

I still keep getting messages like these:

arm-linux-androideabi-gcc.exe: /cygdrive/h/Programming/rockbox/source/firmware/S
OURCES: No such file or directory
arm-linux-androideabi-gcc.exe: warning: '-x c' after last input file has no effe
ct

Maybe the cross compiler behaves differntly depending on the host system?
What else can I do?

Regards,
Franz
Title: Re: troubles building Android App using Windows/Cygwin
Post by: bluebrother on June 08, 2011, 04:37:36 AM
The current NDK is r5 and it comes with cross compiler version 4.4.3. Where do I get the recommended v4.4.4 compiler?

You don't get it. You use 4.4.3. That's the recommended version for Android since it's the latest version with the current NDK.

Quote
I have changed the environment variables to cygwin notation:
   export ANDROID_SDK_PATH=/cygdrive/c/Android/SDK
   export ANDROID_NDK_PATH=/cygdrive/c/Android/NDK
but this does not change anything at all.

is that the base path of the NDK, i.e. the path that contains the file ndk-build?

Quote
it is not 'windows' as assumed by tools/configure

configure doesn't assume that to be windows, it doesn't handle that case.

Quote
arm-linux-androideabi-gcc.exe: /cygdrive/h/Programming/rockbox/source/firmware/S
OURCES: No such file or directory
arm-linux-androideabi-gcc.exe: warning: '-x c' after last input file has no effe
ct

How did you check out? Did you use the Cygwin svn client?

Quote
Maybe the cross compiler behaves differntly depending on the host system?

If that would be the case it would be impossible to compile Rockbox on Windows at all. As I said in a different thread, nobody did adjust the Android parts of the build system to work on Cygwin yet so it doesn't surprise it doesn't work. Either fix the problems or wait until someone else does.
Title: Re: troubles building Android App using Windows/Cygwin
Post by: nieroster on June 08, 2011, 04:50:15 AM
You don't get it. You use 4.4.3. That's the recommended version for Android since it's the latest version with the current NDK.

ok. But why does the warning show up?

is that the base path of the NDK, i.e. the path that contains the file ndk-build?

yes

How did you check out? Did you use the Cygwin svn client?

No I used tortoise SVN, until now I had no problem when building other targets like iRiver. Although I have seen that for example android/installToolchain.sh has the eol-style:native property set which leads to CRLF line endings when checked out on a windows machine.

Either fix the problems or wait until someone else does.

Well, if I would know where to start, I'd gladly do so. For example how do I make the commands issued visible?

Regards,
Franz
Title: Re: troubles building Android App using Windows/Cygwin
Post by: [Saint] on June 09, 2011, 03:25:03 AM
I don't even think it's currently possible to build RaaA on CygWin...

There's some  ancient patch (http://www.rockbox.org/tracker/task/11234) on the tracker that seems to imply that someone figured it out at some point, but I wouldn't count on it to apply cleanly still.

My best advice, and almost certainly the advice of many others, would be to set up a "sane" (if you don't know what distro is best for you...use Ubuntu) Linux distro in a virtual machine.


[St.]
Title: Re: troubles building Android App using Windows/Cygwin
Post by: paulheu on June 09, 2011, 08:09:45 AM
Trust me, just get VirtualBox and install Ubuntu on a VM.. you'll never look back
Title: Re: troubles building Android App using Windows/Cygwin
Post by: bluebrother on June 11, 2011, 05:32:25 PM
You don't get it. You use 4.4.3. That's the recommended version for Android since it's the latest version with the current NDK.

ok. But why does the warning show up?

Because of a line ending issue when calling the Android gcc. I've changed this locally and now configure runs without warnings for me -- but it doesn't fix building because there are other problems left. Haven't figured those yet but I wouldn't be surprised if those are similar.

Basically, building for Android using Cygwin is broken.
Title: Re: troubles building Android App using Windows/Cygwin
Post by: nieroster on June 12, 2011, 02:31:25 PM
@bluebrother

Thank you for your effort! If I understand correctly the windows version of Android gcc cannot handle windows style line endings correctly?

Btw. the shellscript installToolchain still has the svn property eol-style:native. This should either be removed or changed to eol-style:LF, otherwise it will not work.

Regards,
Franz
Title: Re: troubles building Android App using Windows/Cygwin
Post by: bluebrother on June 12, 2011, 04:17:56 PM
Thank you for your effort! If I understand correctly the windows version of Android gcc cannot handle windows style line endings correctly?

The problem is that the Android gcc seems to produce DOS line endings in its output while Cygwin expects Unix ones. That's at least the reason for the version check to produce a false warning about the wrong version. After that it seems like make gets confused but I haven't figured what caused that. So it's not gcc having problems with the line endings of input files (as far as I understand right now).

Quote
Btw. the shellscript installToolchain still has the svn property eol-style:native. This should either be removed or changed to eol-style:LF, otherwise it will not work.

Only if you do not use Cygwin for checkout, which I strongly recommend to use when working on Cygwin. It does work fine for me in Cygwin (with Cygwin svn :) )