Linux On iPod Forum Index
 FAQ  •  Search  •  Memberlist  •  Usergroups  •  Profile  •  Log in to check your private messages  •  Log in
 Podzilla 2 Compiling Tutorial from Scratch (via Cygwin) View next topic
View previous topic
Post new topicReply to topic
Author Message
Keripo Test Account
Contributor


Joined: 11 Apr 2006

Location: Ontario, Canada

PostPosted: Tue Dec 19, 2006 1:59 am Reply with quoteBack to top

For the lazy...
It's still in its testing state but I've created a pre-installed Cygwin environment with both the 3.4.3 toolchain as well as the 2.95.3 toolchain (ie. can compile kernel, pz0, pz2, and just about anything else for iPL like iBoy, etc.). I can't guarantee it'll work but it has been tested on a few XPs and even on Vista. I'll be doing an official release and accompanying installation tutorial later, but for now, if you're too lazy to follow this tutorial and do a manual installation, you can try it out here:

http://www.mediafire.com/download.php?2vvwwbzclcd

Happy compiling!

==========================================================================================
==========================================================================================

Update:
A new, OS-independent tutorial for PZ0 and PZ2 can be found > here <. The new tutorial is more user-friendly, uses a portable Linux distro, and requires little-to-no setup. This tutorial should be used for reference purposes only (though I've updated the svn paths and removed podfile).

Note to self: also install the "xorg-x11-bin-lndir" package as well as "patchutils".

==========================================================================================
==========================================================================================

This is ONLY for compiling Podzilla 2 for the iPod on Windows using Cygwin! (ie, this is not for desktop builds!)

Note for those with slow internet: Some of the files needed (especially the toolchain) require a long time to download. I suggest you skip right down to the download section and start downloading the necessary files (you shouldn't download the second toolchain file though) before you continue on.

Well, due to much thanks from mike (ichaelmay8), I've been able to fully set up a Cygwin compiling environment in Windows XP SP2 without any previous development files. I was able to delete/uninstall everything and completely rebuild that exact working environment and thus am able to narrow down every necessity in this compiling process.

This tutorial will show you how to set up a Cygwin environment complete enough to compile podzilla 2 and basic modules from svn or source. The basic requirements are a computer able to run a Windows version compatible with Cygwin, a good enough internet connection for downloading files, administrative access on the computer, and an hour or so of free time on your hand. Also, basic intelligence is required, meaning, if you don't really understand a term or is having a bit of trouble with anything, consult other sources first, ie the Search option of the iPL forums, Google, Wikipedia, or even your home dictionary. Also note that info from this tutorial is collected from a variety of sources and is far more accurate than that on the iPL wiki (as far as newbie-friendliness goes). So here's the tutorial, enjoy! ~Keripo

==============================================
==============================================

Setting up Cygwin

Cygwin is basically a program that provides a Linux-like environment for compiling and running things Linux-style. Since iPodLinux is built and compiled primarily on the Linux OS, Cygwin is basically a window's alternative for compiling things.

1. First thing is installing Cygwin on your computer.
Download Cygwin's installer file (setup.exe) from Cygwin's website or the direct download link >here<. Don't use a download accelerator here as you'll probably get a corrupt file (it happens).

2. Run the setup.exe installer. For the installation directory, choose "C:/Cygwin/Installation" where "C:/" can be replaced with any other valid drive letter. Next, for the packages directory, use "C:/Cygwin/Packages".

3. Select any mirror and wait. After a while, you'll be presented with a list.

4. Open up the "Devel" section and select the following packages:
Code:
flex (2.5.4a-3)
gettext (0.15-1)
gcc-core (3.4.4-1)
make (3.81-1)
perl-ExtUtils-Depends (0.205-1)
subversion (1.4.2-1)

The numbers in brackets are just the version numbers that I used but any version for each should work. Also, you'll notice that selecting certain packages will also auto-select a few others. These should be: mktemp (1.5-4), binutils (220060817-1), gcc-mingw-core (20050522-1), mingw-runtime (3.11-1), libxml2 (2.6.26-1) and expat (1.95.8-1). Just keep them selected as they are probably dependencies. If you notice any other packages also selected in the Devel section, leave them selected just in case.

Also, because it's important, DO NOT SELECT EVERYTHING!!! The entire Cygwin installation, if you want everything, will take a day or so and be 4 GB. You don't need everything in Cygwin nor everything in the Devel section!!!

5. Click next and install. Wait. A long time.
At a speed of about an average of 15-20 kb/s (note: downloading speed really depends on the downloading mirror chosen rather than your max downloading speed - my max speed is just over 350 kb/s), the whole process takes about 30 minutes [25 minutes for downloading, 5 minutes for installing]. In the meantime, just chill or do something, [/u]but do not close the window![/u]

6. After you're done, the full installation folder (C:/Cygwin/Installation) will be between 60 and 80 MB depending on the packages you installed. Open the Cygwin bash shell (if you didn't select the option) and wait for it to configure a bit. If you've done everything right, you'll see, in green text, something along the lines of AccountName@ComputerName:~. If you do, congratulations, you now have a good Cygwin environment installed on your computer.

If you ever realized that you're missing a package because you're getting a "***: command not found" or other errors, you can check and re/install them by running the setup.exe file, keeping the same install and package directories, and selecting the new packages.

Also, since Cygwin installs to "C:/Cygwin/Installation", from now on, the starting "/" or the "root" of your environment will mean "C:/Cygwin/Installation/" For example, the starting location of the bash shell (~ = "/home/") is actually "C:/Cygwin/Installation/home/". Also, to reopen the bash shell at any time, double click the "cygwin.bat" in "C:/Cygwin/Installation/" and your starting directory will be /home ("~").


Installing the Toolchain

Next, you'll need to install the basic toolchain for compiling things for the iPodLinux kernel (a modified version of uClinux). The one you'll be installing (3.4.3) is for building Podzilla 2 and current iPL applications but not for building Podzilla 0.

1. Download the toolchain file from >here< directly to "/". The file is 32 mb or so, so do the long download with a download accelerator (with ~310 kb/s downloading using Firefox's DownloadThemAll, took about 3 minutes). Rename the file from "arm-uclinux-tools-cygwin-20060116.tar.bz2" to "tc.tar.bz2" for simplicity reasons.

2. Open the Cygwin bash shell. (Don't remember how? Do back to the Cygwin part, last section) Type:
Code:
cd /
tar -C / -xvjf tc.tar.bz2

Wait a while for lots of text to scroll by, installing the toolchain to /usr/local/arm-uclinux-elf-tools
The whole process takes about 2 minutes (Pentium 4, 2.79 GHz). Now close the bash shell.

3. Next, you'll need to edit the Cygwin "profile" file using an advanced text editor. The "profile" file can be found in /etc/ but I strongly suggest you first make a few backups of the important file cause here you can majorly screw up. Either way, you'll need an advanced text editor that can read the LF (Linux File) format.
I strongly suggest using Notepad++ (direct link >here< ) which is not only fast and far better than Notepad/Wordpad, but can also be used for source file editing, hex editing, as well as opening the LF file we'll be editing. Its a great overall replacement for the crappy Windows Notepad ; P
Either way, once you've got Notepad++ installed, open up the "profile" file.

4. Find (Ctrl+F) "PATH=/usr" and replace the entire line ("PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:$PATH") with "PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/local/arm-uclinux-elf-tools/bin:$PATH" and save. The file should still be named "profile" with no extensions.

5. Reopen the Cygwin bash and make sure things look the same as before (ie "Name@ComputerName" in Green). If you see weird text and something like "bash-3.2$" and maybe a bunch of errors, all in white, that means you screwed up your profile editing. Take one of the copies of the profile file you made, make another copy of it and rename it to "profile". Then re-edit things properly using Notepad++. If you keep getting stuck here, delete the "profile" file and just run the Cygwin installer again without installing anything and your profile will be re-set up.

6. Type "arm-elf-gcc". If you get the response "arm-elf-gcc: no input files", you've installed the toolchain correctly. Otherwise, delete the /usr/local/arm-uclinux-elf-tools folder and reinstall the toolchain. If you did get the correct response, however, that means the toolchain is basically installed; however, theres a few Cygwin-specific tweaks needed to be made.


Fixing the Toolchain

The Cygwin version of the toolchain has a few problems.
First off, it's missing the important library file, "libintl.a". There's two ways of getting this file:

1 a) Download the file from >here<. Extract the file using any standard file archiver (I suggest 7-zip but Winzip/WinRar's fine) and copy the file to /usr/local/arm-uclinux-elf-tools/arm-uclinux-elf/lib/ among a list of other lib*.a files.

OR

1 b) Install the basic Linux-version toolchain ( http://www.so2.sys-techs.com/ipod/toolchain/linux-x86/arm-uclinux-elf-tools-base-gcc3.4.3-20050722.sh ) to / and rename it to tc2.sh (for simplicity). Install the toolchain by typing: "sh ./tc2.sh". Wait for it to full install to /usr/local/arm-uclinux-tools2. Now copy the libintl.a file from /usr/local/arm-uclinux-tools2/arm-uclinux-elf/lib/ to /usr/local/arm-uclinux-elf-tools/arm-uclinux-elf/lib amoung a list of other lib*.a files.

(Note that the first method is far easier but the second method is where the original file comes from.)

The second problem is the short-cutting of the "asm" folder. Cygwin treats symbolic links (symlinks) as Windows shortcuts but the toolchain has a problem understanding that. So, instead of keeping a shortcut, the whole directory must be duplicated.

2. You can fix this problem by typing (in the Cygwin bash):
Code:
cd /usr/local/arm-uclinux-elf-tools/arm-uclinux-elf/include
rm asm
ln -s asm-armnommu asm

Alternatively, you can just duplicate the asm-armnommu folder by deleting the asm link and making a copy of the asm-armnonnu folder, renaming it to "asm" (you can do this via Windows Explorer or Cygwin's rm and cp).

Either way, once these two changes are done, you've got a filed toolchain ready for compiling. Hopefully you'll never have to touch it again. Test it one more time by typing in the bash shell "arm-elf-gcc" and hope for the "arm-elf-gcc: no input files" response. If you've got that, its time to set up things for building Podzilla 2.


Setting up Podzilla 2

Podzilla 2, like almost everything that you'll ever compile, also has a few dependencies and libraries needed when compiling. For image-ing and GUI, ttk and hotdog is needed. For modules, podfile is needed.

1. First, get all files from svn. These files will be saved in a general "iPodLinux" folder for organization. In the bash shell, type:
Code:
cd /
mkdir iPodLinux
cd iPodLinux
svn co https://ipodlinux.svn.sourceforge.net/svnroot/ipodlinux/libs/hotdog/ hotdog
svn co https://ipodlinux.svn.sourceforge.net/svnroot/ipodlinux/libs/ttk/ ttk
svn co https://ipodlinux.svn.sourceforge.net/svnroot/ipodlinux/apps/ipod/podzilla2 podzilla2


Do each command one by one and after everything is svn'd, you will have the folder /iPodLinux containing the hotdog, ttk and podzilla2 folder.
Note: If you are getting the error "svn: command not found", that means you don't have subversion installed! Go back to the Cygwin installation section and reinstall the subversion package.

2. Now each of these things need to be compiled. Start with hotdog:
Code:
cd hotdog
make IPOD=1


3. Next, ttk:
Code:
cd ..
cd ttk
make NOMWIN=1 NOX11=1 NOHDOG=1

Note: You'll probably get the error "rm: cannot remove 'lndir': No such file or directory" but you can ignore that.

Now that everything's all set up, its time to actually compile Podzilla 2 and its modules. Yay!


Building Podzilla 2

Finally, if hotdog and ttkcompiled successfully, you'll hopefully never need to touch them again. Now onto Podzilla 2 compiling.

1. If you just want the binary and not the modules, delete all the folders in the podzilla2/modules folder. You can do this by typing:
Code:
rm -r /iPodLinux/podzilla2/modules

... and pressing "y" a lot of times, or you can do it by GUI through selecting everything and deleting.

^ [Do this only if you just want the Podzilla 2 binary and are too lazy to wait for the long module-compiling time ; P]

2. Now you can compile Podzilla 2:
Code:
cd /iPodLinux
cd podzilla2
make IPOD=1


Wait a bit as everything gets compiled. Hopefully, if all went right, it'll compile and you'll get a binary called "podzilla" in /iPodlinux/podzilla2/ ; D
(If you get the error "cannot find -lintl", you didn't do the toolchain's "libintl.a" fixing correctly! Go back to the "Fixing the Toolchain" section!)

Now to recompile from svn any time:
Code:
cd /iPodLinux
rm -r podzilla2
svn co https://ipodlinux.svn.sourceforge.net/svnroot/ipodlinux/apps/ipod/podzilla2 podzilla2
cd podzilla2
make IPOD=1



[~End of Tutorial~]

Downloads

Here's the entire list of files that you'll need to download at one point or another. All links are direct downloads so that you can download them when you have free time before you start the tutorial.

Cygwin installer ("setup.exe") [< 1 MB]
http://www.cygwin.com/setup.exe

Cygwin Toolchain 3.4.3 ("arm-uclinux-tools-cygwin-20060116.tar.bz2", rename to "tc.tar.bz2") [32.8 MB]
http://www.josh.sys-techs.com/ipl/arm-uclinux-tools-cygwin-20060116.tar.bz2

Libintl Library (Libintl.zip)[< 1 MB]
http://www.ipodlinux.org/images/8/82/Libintl.zip
OR
Linux Toolchain 3.4.3 ("arm-uclinux-elf-tools-base-gcc3.4.3-20050722.sh", rename to "tc2.sh") [29.3 MB]
http://www.so2.sys-techs.com/ipod/toolchain/linux-x86/arm-uclinux-elf-tools-base-gcc3.4.3-20050722.sh

Cygwin Profile backup file (Profile.zip) [< 1 MB] (optional)
http://www.ipodlinux.org/images/5/53/Profile.zip

Resources (Sources where all this info has basically come from - for reference purposes)

http://ipodlinux.org/Easy_Programming_Tutorial
http://ipodlinux.org/Building_podzilla
http://ipodlinux.org/Toolchain
http://ipodlinux.org/forums/viewtopic.php?p=52179#52179

Thanks to... for...

ichmaelmay8 (Michael) - helping me an guiding me (somewhat) through the whole process and comparing results
fiftyfour123 - trying to help me with ttk (though not end up really helping much, though thats besides the point ; )
mundo (mundi) - being the original person who fully helped me set up the PZ0 environment on Slax
AriX (Ari) - helping me test out the compiled podzilla 2 binary when I didn't have my iPod and also for just being an awesome person ; )

and of course

Confused fishcake - writing the original "Easy Programming Tutorial"
Der Papst - finding out how to fix the libintl.a problem and posting the solution
iPodLinux Dev Team (commonly known as leachbj, jonrelay, fxb, davidc, courtc, slowcoder, aegray, BleuLlama, macPod, josh, coob, etc.) - being awsome and making Linux on iPod possible!

==============================================
==============================================

Now hopefully, if everything went along smoothly and you followed this tutorial exactly, you now have a Cygwin environment capable of compiling the Podzilla 2 binary from source or svn as well as basic modules (ie not requiring outside, crazy stuff) from source or svn. Enjoy your new compiling environment and hope you'll be able to contribute (useful) custom builds/patches or new modules to the iPodLinux community ; )

Enjoy!

~Keripo

Last updated: Dec 8, 2007

_________________
Project ZeroSlackr
http://sourceforge.net/projects/zeroslackr/
http://ipodlinux.org/forums/viewtopic.php?t=29636

Last edited by Keripo Test Account on Sat Dec 08, 2007 11:32 pm; edited 20 times in total
View user's profileSend private messageSend e-mailVisit poster's websiteAIM AddressMSN Messenger
jgjake2



Joined: 04 Mar 2006

Location: Texas

PostPosted: Tue Dec 19, 2006 6:34 am Reply with quoteBack to top

*slow clap* (i beat virtuallball 2 it Twisted Evil )

_________________
http://ipodlinux.org/allin1
http://www.myspace.com/xxxdiefckr
ajpsk8: (iPod)
i put it in the microwave and it... pops...
View user's profileSend private messageVisit poster's website
Rufus
Moderator


Joined: 28 Apr 2005

Location: Australia

PostPosted: Tue Dec 19, 2006 6:46 am Reply with quoteBack to top

Thank gad for you, I've been trying to get a working development environment for a long time, I will do this tutorial tonight.

This is just what the community needs to encourage people to develop, if you can't build apps how will anyone in the community be able to contribute?

Pity this thing didnt exist earlier, there would probably be a lot more entries in the Contribution Contest.

EDIT: Success! You are a champ

I recommend you update the wiki with this information as none of the tutorials I've tried there were succesful.

_________________
Do not PM me with questions about installing things.
View user's profileSend private messageVisit poster's website
zacaj



Joined: 13 Jul 2006

Location: alone. :(

PostPosted: Tue Dec 19, 2006 12:04 pm Reply with quoteBack to top

what do you have to do to compile pz2 for the desktop? It gives me the error,
mod.0: mod.c: (.text+0some#): undefined reference to _ttk_mkcol
and about 100 others. I used a premade cygwin enviorment I already set up but I just put the forgotten .a in and it compiled pz2 for ipod. when I try to build ttk for the desktop I get errors.

_________________
If you have a problem, or want to chat,
PM ME
http://zacaj.com/donate.html
View user's profileSend private messageSend e-mailVisit poster's websiteMSN Messenger
Rufus
Moderator


Joined: 28 Apr 2005

Location: Australia

PostPosted: Tue Dec 19, 2006 12:54 pm Reply with quoteBack to top

Try using a fresh install of cygwin, it works for me.

EDIT: whoops yeah, desktop builds don't work with this tutorial, as was stated by the author.

Keripo Test Account wrote:
this is not for desktop builds!

_________________
Do not PM me with questions about installing things.

Last edited by Rufus on Wed Dec 20, 2006 4:58 pm; edited 1 time in total
View user's profileSend private messageVisit poster's website
miz dawg



Joined: 08 Mar 2005

Location: Toronto, Canada

PostPosted: Tue Dec 19, 2006 8:29 pm Reply with quoteBack to top

zacaj wrote:
what do you have to do to compile pz2 for the desktop? It gives me the error,
mod.0: mod.c: (.text+0some#): undefined reference to _ttk_mkcol
and about 100 others. I used a premade cygwin enviorment I already set up but I just put the forgotten .a in and it compiled pz2 for ipod. when I try to build ttk for the desktop I get errors.


It is not possible to compile a desktop build of pz2 on windows without some extreme hacking of sdl. At least, I'm pretty sure that's what Josh told me.
View user's profileSend private message
AriX



Joined: 22 Nov 2005

Location: Pennsylvania

PostPosted: Wed Dec 20, 2006 1:01 am Reply with quoteBack to top

Nice tutorial! I am almost done editing a version for the wiki if that's OK with you. It seems that I wasn't compiling all the libraries and that's why it didn't work for me...

_________________
iPodLinux Manager! (Now v1.1)
http://www.ipodlinux.org/forums/viewtopic.php?p=192609
View user's profileSend private messageSend e-mailVisit poster's websiteAIM AddressMSN Messenger
KyleV



Joined: 02 Jan 2006

Location: Arima, Trinidad & Tobago.

PostPosted: Wed Dec 20, 2006 1:04 am Reply with quoteBack to top

nice Very Happy
now i can finally build something for iPL after one and a half years of bewilderment as to why Cygwin wasn't nice to me.

Well done

_________________
improved...Loader2.4 Arguments Tutorial
See:-
http://ipodlinux.org/forums/viewtopic.php?t=9615
View user's profileSend private message
Keripo Test Account
Contributor


Joined: 11 Apr 2006

Location: Ontario, Canada

PostPosted: Thu Dec 21, 2006 9:56 pm Reply with quoteBack to top

Edited to remove the part about not compiling the mpdc module and just added a generic command for removing all modules. Apparently it was something just for that day with the mpdc module that prevented me from compiling properly. Either way, now the mpdc module (svn) compiles normally along with all the other modules.

Also, great to see that it's working for other people ; )

~Keripo

Ps. Question: Other than the original installation folder, where else does Cygwin install files to? I'm trying to carry around a portable version of Cygwin but when I run it, I only have access to the original bash shell and cannot log in (when using a computer without Cygwin previously installed). Any ideas of where Cygwin stores its profiles/other computer-specific files?

_________________
Project ZeroSlackr
http://sourceforge.net/projects/zeroslackr/
http://ipodlinux.org/forums/viewtopic.php?t=29636
View user's profileSend private messageSend e-mailVisit poster's websiteAIM AddressMSN Messenger
ichaelmay8



Joined: 05 May 2005


PostPosted: Thu Dec 21, 2006 10:55 pm Reply with quoteBack to top

Maybe the cygwin installer sets some windows environment variables or something. You might want to check that out.
View user's profileSend private messageVisit poster's websiteAIM Address
nimedon



Joined: 16 Dec 2006


PostPosted: Thu Dec 21, 2006 11:22 pm Reply with quoteBack to top

Your tutorial it's great, but I am getting a problem while trying to compile podzilla2 folder:
Code:

Linking podzilla.
 LD        podzilla
/usr/local/arm-uclinux-elf-tools/lib/gcc/arm-uclinux-elf/3.4.3/../../../../arm-uclinux-elf/bin/ld.real: cannot find -lintl
collect2: ld returned 1 exit status
amke: *** [all] Error 1


Can anyone help me fixing this problem?

Thanks !
View user's profileSend private message
nimedon



Joined: 16 Dec 2006


PostPosted: Thu Dec 21, 2006 11:41 pm Reply with quoteBack to top

nvm, I fixed it, I put the libintl in a wrong directory
View user's profileSend private message
Rufus
Moderator


Joined: 28 Apr 2005

Location: Australia

PostPosted: Fri Dec 22, 2006 1:32 pm Reply with quoteBack to top

I recommend sticky because the other tutorial that's stickied is out of date.

_________________
Do not PM me with questions about installing things.
View user's profileSend private messageVisit poster's website
AriX



Joined: 22 Nov 2005

Location: Pennsylvania

PostPosted: Sun Dec 24, 2006 4:20 pm Reply with quoteBack to top

Rufus wrote:
I recommend sticky because the other tutorial that's stickied is out of date.


The other topic's objective is completely different than this one...

_________________
iPodLinux Manager! (Now v1.1)
http://www.ipodlinux.org/forums/viewtopic.php?p=192609
View user's profileSend private messageSend e-mailVisit poster's websiteAIM AddressMSN Messenger
Rufus
Moderator


Joined: 28 Apr 2005

Location: Australia

PostPosted: Sat Dec 30, 2006 4:29 pm Reply with quoteBack to top

You might want to read the second and third posts, it was stickied because somebody posted a tutorial in it that was not updated and thus is now out of date.

_________________
Do not PM me with questions about installing things.
View user's profileSend private messageVisit poster's website
Display posts from previous:      
Post new topicReply to topic


 Jump to:   



View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group :: FI Theme :: All times are GMT