rolinh / dfc

Report file system space usage information with style
BSD 3-Clause "New" or "Revised" License
108 stars 9 forks source link

Build dfc for arm-linux-androideabi-gcc #15

Open sebma opened 7 years ago

sebma commented 7 years ago

Hi,

Here is what I get when I try and build dfc for CC=arm-linux-androideabi-gcc :

[ 40%] Building C object CMakeFiles/dfc.dir/src/util.c.o
/home/sebastien/src/dfc/src/util.c: In function 'getttywidth':
/home/sebastien/src/dfc/src/util.c:488:17: error: storage size of 'win' isn't known
/home/sebastien/src/dfc/src/util.c:488:17: warning: unused variable 'win' [-Wunused-variable]
make[2]: *** [CMakeFiles/dfc.dir/src/util.c.o] Error 1
make[1]: *** [CMakeFiles/dfc.dir/all] Error 2
make: *** [all] Error 2

Can you help ?

rolinh commented 7 years ago

Hi,

On which platform are you trying to build this? struct winsize, which is the type the the win variable, is usually defined in sys/ioctl.h but I know for a fact that it could be defined elsewhere (on Solaris for instance, it is defined in termios.h). In order to help, I need to know a bit more about the platform/environment on which you are trying to build.

sebma commented 7 years ago
$ echo $MACHTYPE 
x86_64-pc-linux-gnu
sebma commented 7 years ago

I'm using Ubuntu 14.04 LTS

rolinh commented 7 years ago

Thanks. I'll create a VM with Ubuntu 14.04 LTS and try to reproduce the issue.

rolinh commented 7 years ago

@sebma In #14, you were trying to build for arm-linux-gnueabi-gcc. I was able to build using the instructions I provided you with. Now, what you really want to do is to build for arm-linux-androideabi-gcc, is that correct?

rolinh commented 7 years ago

So as previously guessed, to cross compile for Android, termios.h needs to be included. However, that is not the only issue: sys/statvfs.h is not defined either. So I can conditionally include sys/vfs.h instead when the platform is Android but I then run into other issues. I guess there is no quick fix for this one (although I did not try to go further) and a bit of work is required to be able to cross-compile dfc for Android. As I really want to release dfc 3.1.0 now, I won't attempt to fix it for this release. Out of curiosity, what is your end goal with dfc cross-compiled for Android?