09-16-2012, 05:47 AM | #631 |
Zealot
Posts: 140
Karma: 23528
Join Date: Nov 2009
Location: London
Device: Kobo Aura One,HD,H2O,Touch,Mini,Kindle 3+DXG,Nook Simple Touch
|
Kai771
For ARM you need this file arm-kindle-linux-x-tools-glibc2.5-gcc4.2.4.tar.gz (45741995 bytes). Just unpack it's "arm-kindle-linux-gnueabi" subdirectory into /usr/local/arm and add /usr/local/arm/arm-kindle-linux-gnueabi/bin/ to PATH and everything will be OK. (compile with make HOST=arm-kindle-linux-gnueabi) For emulator, on my system (FC12, 32bit) everything compiles fine, with no adjustments to the Makefile. Just to add that the x-tools file is very hard to find, but you will find it in one of those "forbidden to even mention" places I have no idea why, but this fact prevented me from hosting it on my own site, just in case... The x-tools toolchain is preferable because it already contains the correct sysroot stuff for the Kindle, so you don't have to pick the libraries from Kindle's actual root manually. And, btw, if you are interested in just a PDF/DjVu viewer (without builtin CoolReader) then you can build the kpdfdjview branch (git checkout kpdfdjview) which has fewer dependencies and builds much faster, resulting in a smaller program. Also, to build an installable package you need to do "make HOST=arm-kindle-linux-gnueabi customupdate". Last edited by tigran; 09-16-2012 at 05:52 AM. Reason: added a few more advices |
09-16-2012, 06:16 AM | #632 | ||||
Just a Noob
Posts: 145
Karma: 162610
Join Date: Aug 2011
Device: Kindle 3
|
Quote:
Quote:
Quote:
Quote:
Thanks for taking the time to help a noob. Last edited by Kai771; 09-17-2012 at 04:32 PM. Reason: typo |
||||
09-16-2012, 06:35 AM | #633 |
Zealot
Posts: 140
Karma: 23528
Join Date: Nov 2009
Location: London
Device: Kobo Aura One,HD,H2O,Touch,Mini,Kindle 3+DXG,Nook Simple Touch
|
And thank you for pointing me to VirtualBox! I know that my FC12 installation is ancient (and also, using 32bit OS on a 64bit machine is stupid, as I have to use PAE mode), but I have too many "mission critical" things (e.g. my entire typesetting environment for all the books I publish) which depend on it. So, now I can try the latest FC17/64bit and see if all my "mission critical" things still work on it and switch to it if all is fine. Thank you!
Btw, I am now installing FC17/64bit in VirtualBox and will then install the development environment for kindlepdfviewer in it, so I will let you know if it all went smoothly. Then you could just repeat the same on your machine. Last edited by tigran; 09-16-2012 at 07:09 AM. |
09-16-2012, 07:48 AM | #634 |
Just a Noob
Posts: 145
Karma: 162610
Join Date: Aug 2011
Device: Kindle 3
|
There were reports of problems with using 64bit linux and compiling for kindles in other threads (twobob iirc). That's why I installed 32-bit Linux in my VM. Just saying .
|
09-16-2012, 08:22 AM | #635 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Usually when cross-compiling, you want to set: "TARGET=" which describes the system on which the generated code will execute. |
|
09-16-2012, 08:39 AM | #636 |
Zealot
Posts: 140
Karma: 23528
Join Date: Nov 2009
Location: London
Device: Kobo Aura One,HD,H2O,Touch,Mini,Kindle 3+DXG,Nook Simple Touch
|
knc1
In the case of kindlepdfviewer you do need to set HOST= manually when you run make, it is not "computed" by anything. And you don't need to set TARGET= either. Kai771 Yes, you are right --- I just found out that on FC17 64bit one cannot run arm x-tools because of /lib/ld-linux.so.2 ELF interpreter issues. So, using VirtualBox saved me a lot of time and trouble attempting to switch to the latest 64bit OS --- now I know that I should stay with my old good FC12 32bit But I like the VirtualBox idea... Is it portable? I.e. can I take my vdi files and use them on some other system using any OS (obviously installing VirtualBox software for that OS first)? Or is each vdi image bound to a specific host OS on which it was produced? And the main achievement of today is that I don't need to dual-boot into Windows XP on my main machine any longer --- I can just install Windows 7 (or XP) inside VirtualBox and run all the Windows-specific programs (Mathematica, Matlab, yes, I know there are Linux versions but they don't really work) in it! Last edited by tigran; 09-16-2012 at 08:41 AM. |
09-16-2012, 08:55 AM | #637 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
|
09-16-2012, 09:00 AM | #638 |
Zealot
Posts: 140
Karma: 23528
Join Date: Nov 2009
Location: London
Device: Kobo Aura One,HD,H2O,Touch,Mini,Kindle 3+DXG,Nook Simple Touch
|
Kai771
Also, just for completeness (maybe someone is curious) I should mention that even the emulator stuff cannot be compiled on a 64bit OS --- here the problems are easier (djvulibre just fails to compile, but surely it can be made to compile somehow, otherwise we would have no such thing as djview4 on 64bit) but still require work to fix, so it is easier to just stick to 32bit environment. |
09-16-2012, 09:02 AM | #639 |
Zealot
Posts: 140
Karma: 23528
Join Date: Nov 2009
Location: London
Device: Kobo Aura One,HD,H2O,Touch,Mini,Kindle 3+DXG,Nook Simple Touch
|
In the case of a program written for a specific hardware and specific OS platform and which cannot be ported to a different OS or hardware, it is the "usual practice" to write Makefile by hand. And kindlepdfviewer fits this description perfectly.
|
09-16-2012, 09:19 AM | #640 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
So no defense of that practice is required. |
|
09-16-2012, 09:33 AM | #641 | |||
Just a Noob
Posts: 145
Karma: 162610
Join Date: Aug 2011
Device: Kindle 3
|
@tigran
Quote:
Quote:
Now, back to kindle. I tried using x-tools and it failed. This is what I did: Code:
$ tar xzvf x-tools-glibc2.5-gcc4.2.4.tar.gz Code:
$ cd x-tools-glib2.5 $ mv arm-kindle-linux-gnueabi arm $ sudo mv arm /usr/local/ PATH="/usr/local/arm/arm-kindle-linux-gnueabi/bin:$PATH" and then relogged. I checked if it's all ok: Code:
$ echo $PATH /usr/local/arm/arm-kindle-linux-gnueabi/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games then I did Code:
$ HOST=arm-kindle-linux-gnueabi make thirdparty Code:
make -C mupdf CC="gcc" build/debug/cmapdump make[1]: Entering directory `/home/kai771/kindlepdfviewer/mupdf' MKDIR build/debug CC build/debug/cmapdump.o gcc: error trying to exec 'cc1': execvp: No such file or directory make[1]: *** [build/debug/cmapdump.o] Error 1 make[1]: Leaving directory `/home/kai771/kindlepdfviewer/mupdf' make: *** [mupdf/cmapdump.host] Error 2 I am positive that I'm using 32bit Ubuntu: Quote:
|
|||
09-16-2012, 10:14 AM | #642 |
Zealot
Posts: 140
Karma: 23528
Join Date: Nov 2009
Location: London
Device: Kobo Aura One,HD,H2O,Touch,Mini,Kindle 3+DXG,Nook Simple Touch
|
Kai771
You moved the directory to the wrong level. The end result should look like: $ l /usr/local/arm/arm-kindle-linux-gnueabi/ total 912 dr-xr-xr-x 6 1000 1000 4096 2011-02-12 01:58 arm-kindle-linux-gnueabi/ dr-xr-xr-x 2 1000 1000 4096 2011-02-12 01:58 bin/ -r--r--r-- 1 1000 1000 907913 2011-02-12 01:58 build.log.bz2 dr-xr-xr-x 4 1000 1000 4096 2011-02-12 01:55 lib/ dr-xr-xr-x 3 1000 1000 4096 2011-02-12 01:55 libexec/ dr-xr-xr-x 2 1000 1000 4096 2011-02-12 01:58 share/ drwxr-xr-x 3 1000 1000 4096 2011-02-12 01:57 test-suite/ i.e. one level deeper. The confusion is perhaps because there is yet another "arm-kindle-linux-gueabi" inside which looks like this: $ l /usr/local/arm/arm-kindle-linux-gnueabi/arm-kindle-linux-gnueabi/ total 16 dr-xr-xr-x 2 1000 1000 4096 2011-02-12 01:58 bin/ dr-xr-xr-x 2 1000 1000 4096 2011-02-11 23:36 debug-root/ dr-xr-xr-x 3 1000 1000 4096 2011-02-12 01:55 include/ dr-xr-xr-x 6 1000 1000 4096 2011-02-12 01:58 sysroot/ and this is my PATH: $ echo $PATH /usr/local/arm/arm-kindle-linux-gnueabi/bin/:the_rest_deleted_as_irrelevant_ Why did I have an "arm" directory at all? Because I was trying different ARM toolchains and that was an easy way to switch between them. But you can skip "arm" level altogether and adjust PATH accordingly. and to make sure that the compiler is found do this: $ type arm-kindle-linux-gnueabi-gcc arm-kindle-linux-gnueabi-gcc is /usr/local/arm/arm-kindle-linux-gnueabi/bin/arm-kindle-linux-gnueabi-gcc |
09-16-2012, 10:56 AM | #643 |
Just a Noob
Posts: 145
Karma: 162610
Join Date: Aug 2011
Device: Kindle 3
|
Thank you! I moved it to appropriate level, and now it compiles. As you suspected, the confusion was caused by the presence of 2 dirs with the same name, arm-kindle-linux-gnueabi. The PATH was ok from the beginning - it was just the wrong content there .
|
09-16-2012, 12:32 PM | #644 |
Addict
Posts: 251
Karma: 183457
Join Date: Jan 2012
Device: k3G, KDXG, AuraHD
|
Kai771
Previously the emulate mode compiled with no error in my Gentoo x64 machine. But it fails on my freshly installed x86 Ubuntu today. I modified the Makefile and now it works on my Ubuntu too. You may want to checkout the latest code from the official repo Still I have no idea why it worked on my Gentoo before this modification. I just moved all the "-l" to the end of GCC call. Last edited by dave2008; 09-16-2012 at 12:38 PM. |
09-16-2012, 12:38 PM | #645 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Ubuntu (depending on the version and update level) recently "Borked" the built-in search path order for includes and libraries in an attempt to re-vamp the multi-lib / multi-arch support. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
KOReader: a document reader for PDF, DJVU, EPUB, FB2, HTML, ... (GPLv3) | hawhill | Kindle Developer's Corner | 1268 | 02-27-2024 11:49 AM |
Librerator - multi-format e-reader, fork of KPV | Kai771 | Kindle Developer's Corner | 432 | 10-06-2017 12:20 PM |
Yet another PDF viewer (muPDF based) | melihron | PocketBook | 66 | 09-02-2014 03:03 AM |
Text-based PDF to Mobi, etc./Kindle 3 | kidblue | Calibre | 41 | 07-20-2012 03:19 PM |
muPDF on Kindle DX!! | DairyKnight | Kindle Developer's Corner | 8 | 03-21-2010 03:39 AM |