09-16-2012, 12:41 PM | #646 |
Addict
Posts: 251
Karma: 183457
Join Date: Jan 2012
Device: k3G, KDXG, AuraHD
|
knc1
Oh, I see! That make sense, I am using 12.04 |
09-16-2012, 01:32 PM | #647 | |
Just a Noob
Posts: 145
Karma: 162610
Join Date: Aug 2011
Device: Kindle 3
|
Quote:
On another note: can someone please explain why make HOST=arm-kindle-linux-gnueabi thirdparty works, and HOST=arm-kindle-linux-gnueabi make thirdparty doesn't, and readme specifies EMULATE_READER=1 make thirdparty kpdfview (setting variable first). Not that it matters, but I'm curious. Sorry if the question is basic, but I'm a noob afterall . |
|
09-16-2012, 01:34 PM | #648 |
BLAM!
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@Kai771: Has to do with how gnu make handles env vars vs. make vars & recursion. Can be headache inducing.
|
09-17-2012, 09:00 AM | #649 | |
Connoisseur
Posts: 61
Karma: 116628
Join Date: May 2011
Location: Zagreb, Croatia
Device: Kindle K3G and DXG
|
Quote:
When variable is defiend with := in Makefile you can override it with arg after make like this: Code:
make customupdate HOST=arm-linux-gnueabi |
|
09-17-2012, 01:26 PM | #650 | ||
Connoisseur
Posts: 83
Karma: 322
Join Date: Mar 2009
Device: Kindle DXG, Sony T1
|
I've been hesitating to try more with kpv because I'll need the emulation but I'm not familiar with the c stuff. I used linux before and mainly programmed in java.
Following Kai771's detailed log, I'm trying to compile an emulation now. I'm using linux mint 13 with vmware, and the compilation seemed ok except this one when I was doing "make kpdfview" Quote:
Quote:
|
||
09-17-2012, 02:52 PM | #651 |
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
|
dracodoc
To run in emulation mode you have to compile both thirdparty and kpdfview in emulation mode. The output you have shown contains compilation for arm, not for i386. So, before running "make thirdparty kpdfview" do this: export EMULATE_READER_W=600 EMULATE_READER_H=800 EMULATE_READER=1 But now that you have already compiled for arm you have to clean everything first: make clean make cleanthirdparty |
09-17-2012, 03:13 PM | #652 | |
Connoisseur
Posts: 83
Karma: 322
Join Date: Mar 2009
Device: Kindle DXG, Sony T1
|
Thanks tigran, I was compiling separately, now following your suggestions , the emulation runs perfectly now.
Quote:
Last edited by dracodoc; 09-17-2012 at 03:56 PM. |
|
09-17-2012, 03:20 PM | #653 |
Connoisseur
Posts: 83
Karma: 322
Join Date: Mar 2009
Device: Kindle DXG, Sony T1
|
In emulator, I found that "back" is backspace in keyboard, but what is the "menu" button in keyboard?
|
09-17-2012, 03:40 PM | #654 |
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
|
Menu is F1. If you open the file keys.lua and look for the function setEmuKeycodes() you will find out all the assignments. And if some numeric value is uncertain, just look at the debug output --- it shows the value.
|
09-17-2012, 03:57 PM | #655 |
Connoisseur
Posts: 83
Karma: 322
Join Date: Mar 2009
Device: Kindle DXG, Sony T1
|
Thanks, I knew there are key codes in keys.lua but I didn't realized there are emulated key codes in there too!
|
09-17-2012, 04:17 PM | #656 |
Just a Noob
Posts: 145
Karma: 162610
Join Date: Aug 2011
Device: Kindle 3
|
@NiLuJe
So, basically, rtfm? Fine, I'll do it... eventually @dpavlin Well, modifying the Makefile or adding HOST=arm-linux-gnueabi to make is practically the same thing, isn't it? Anyway, I switched to using arm-kindle-linux-gnueabi and now there aren't any problems . Last edited by Kai771; 09-17-2012 at 04:31 PM. Reason: typo |
09-17-2012, 04:28 PM | #657 |
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
|
Good. You saved yourself lots of future troubles with sysroot and libstdc++ when you would actually try running your freshly compiled arm binary on Kindle and fail. I went through all these nightmares before discovering x-tools toolchain, i.e. arm-kindle-linux-gnueabi.
|
09-17-2012, 04:30 PM | #658 |
Just a Noob
Posts: 145
Karma: 162610
Join Date: Aug 2011
Device: Kindle 3
|
Noob 2 Noob - KindlePDFViewer Development Guide
Now that I managed to properly compile kindlepdfviewer, I thought I should write a guide about it while my memory is still fresh. The developers had plans of writing DEVELOPMENT.TXT - see https://github.com/hwhw/kindlepdfviewer/issues/62, but they never did, and there isn't much info in the wiki too, so, as a thank you to them for their efforts and their help I'm writing this guide in hope that in absence of other info someone might find it helpful, at least until something better comes along.
Let me start by saying that what you are about to read isn't the only way. There are always multiple ways of doing the same thing. I can't cover them all, even if I knew them (which I don't). This text will be just one way - not necessarily correct way - but the way that works, described step by step, in as much detail as I can, that anyone should be able to follow and achieve the same results. For this way, you will need 32-bit Linux installed. To save you from reading the previous posts, the reason is because other people reported problems with using 64-bit Linux and compiling for kindle (twobob), even if compiling in emulation mode (tigran). So to avoid all that, we will use 32-bit Linux, specifically Ubuntu 12.04 LTS Desktop 32-bit (you can download iso image here: http://www.ubuntu.com/download/desktop). If you feel really adventurous, you can use Linux Mint 13 "Maya" - Cinnamon (32-bit) (you can download iso here: http://www.linuxmint.com/edition.php?id=105) Note: I'm kidding about the adventurous part. These two distros are the ones I tested. Other distros should also work, especially those based on Ubuntu or Debian (other might have different commands for installing packages), but I can't guarantee it since I never tried. So if you're following this guide, please pick one of the above. If you're running Windows, 64-bit Linux, or some other distro - I suggest you install VirtualBox and install Ubuntu or Linux Mint in Virtual Machine. Creating the virtual machine should be outside the scope of this guide, but since I'm the one recommending it, I guess I'll have to cover it at least briefly. So, here it goes: - Start Oracle VM VirtualBox Manager - click New, then Next - Enter Name (for example "Ubuntu VM"), select Operating System: Linux, Version: Ubuntu. Click Next - If your real computer has more than 2GB of RAM, move the slider to 1024. If not, leave it at 512. Click Next. - Leave Start-up Disk and Create new hard disk selected. Just click Next. - Leave VDI (VirtualBox Disk Image) selected. Just click Next. - Leave Dynamically allocated selected. Just click Next. - again, leave default values untouched. Just click Next. Then click Create, then Create again. - click on the Ubuntu VM on the left, then click Settings - Click Storage on the left. Then in the middle click on CD icon under IDE Controller. Then on the CD icon near the right edge of the window, next to IDE Secondary Master. Select Choose a Virtual CD/DVD Disk File... and select Ubuntu-12.04-deskto-i386.iso. Click OK. - Click again on Ubuntu VM on the left, and then click Start. The Virtual Machine will start booting. Follow instructions on screen to install Ubuntu as you would on a real computer. If anyone's wondering, I'm running Windows 7 64-bit, and Ubuntu 12.04 32-bit under VirtualBox. You'll also need a GitHub account. So if you don't have one, go to github.com and create it. If you have problems with creating github account, you can find help here: https://help.github.com/articles/sig...github-account. Log in to GitHub, and go here: https://github.com/hwhw/kindlepdfviewer/. Click on Fork. Wait until it's done, and then you can sign out. Now, if you just installed Ubuntu with default settings (or Linux Mint), you'll need to install some more packages. On your Ubuntu box, open terminal and type: Code:
$ sudo apt-get install git subversion g++ lua5.1 cmake libsdl1.2-dev Then type: Code:
$ git config --global user.name "kai771" $ git config --global user.email "kai771@somewhere.com" $ git clone https://github.com/kai771/kindlepdfviewer.git Code:
$ cd kindlepdfviewer $ git remote add upstream https://github.com/hwhw/kindlepdfviewer.git $ make fetchthirdparty $ EMULATE_READER_W=600 EMULATE_READER_H=800 EMULATE_READER=1 make thirdparty kpdfview Code:
$./reader.lua test Cross-Compile If you want to make installation package for kindle, you'll need the cross-compile toolchain. You have two options here: let's call them controversial and mainstream . I'll cover controversial first, since that option worked first for me. However, I recommend you use mainstream, especially if you have trouble finding the file needed for controversial. Update: As of 2012-10-03, KindlePDFViewer's Makefile went through extensive changes. It might not be possible to build it successfully using Controversial Way anymore. Preferred ToolChain is Code Sourcery/Mentor Graphics 2012.03. Follow the instructions for Mainstream way, but use newer version. Version 2007q3 will still work, but 2012.03 is preferred. Controversial Way I call this way controversial because of the file you'll need - it seems it can't be freely distributed, probably because it contains kindle libraries and headers that are under copyright (my guess - I don't know for sure). The name of the file you need is x-tools-glibc2.5-gcc4.2.4.tar.gz, and it's 45,741,995 bytes long. You shouldn't have much trouble finding it. With that file in your home dir, type this: Code:
$ cd ~ $ tar xzvf x-tools-glibc2.5-gcc4.2.4.tar.gz $ cd x-tools-glib2.5 $ sudo mv arm-kindle-linux-gnueabi /usr/local Code:
PATH="/usr/local/arm-kindle-linux-gnueabi/bin:$PATH" Code:
$ cd kindlepdfviewer $ make clean cleanthirdparty $ make thirdparty kpdfview customupdate HOST=arm-kindle-linux-gnueabi Mainstream Way We'll use Code Sourcery/Mentor Graphics toolchain here. Go to http://www.mentor.com/embedded-software/codesourcery, and click "Download Lite Edition". In the "ARM processors" section, click on "Download the GNU/Linux Release". Fill in the form with your Name and e-mail, and click "Get Lite!". You'll receive an e-mail with a link to download page. On the download page, click on "Sourcery CodeBench Lite 2012.03-57", and then on "IA32 GNU/Linux TAR". You'll download the file arm-2012.03-57-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2. Put that file in your home dir, and then type: Code:
$ cd ~ $ tar xvf arm-2012.03-57-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 $ sudo mv arm-2012.03 /opt Code:
PATH="/opt/arm-2012.03/bin:$PATH" Code:
$ cd kindlepdfviewer $ make clean cleanthirdparty $ make thirdparty kpdfview customupdate Update: The following is already fixed, so you don't need to do it anymore. I'm still leaving it so people would know what tigran refered to in his next message Note: at the time of testing all this, it failed in the end because README.TXT file is not there anymore, and there's README.md file instead. If this happens to you, type Code:
$ cp README.md README.TXT Code:
$ make customupdate HOST=arm-kindle-linux-gnueabi Tigran reports that it also works on FC17 64-bit version. See his posts https://www.mobileread.com/forums/sho...&postcount=680 and https://www.mobileread.com/forums/sho...&postcount=682 Last edited by Kai771; 10-04-2012 at 05:37 AM. Reason: New TC version |
09-17-2012, 04:55 PM | #659 |
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
Makefile has been updated already, so the stuff about cp README.md README.TXT is no longer necessary. |
09-17-2012, 05:00 PM | #660 |
Connoisseur
Posts: 60
Karma: 494362
Join Date: Nov 2010
Location: Budapest, Hungary
Device: Kindle 3
|
Nice, thanks! :-)
|
Thread Tools | Search this Thread |
|
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 | 1269 | 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 |