How do I use the psptoolchain script?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

How do I use the psptoolchain script?

Post by ooPo »

As always, the latest version is available on my site: http://www.oopo.net/consoledev

Instructions are located on the wiki: http://wiki.pspdev.org/psp:programming_faq

Let's take a look at the included readme file:

Code: Select all

  ==================
   HOW DO I USE IT?
  ==================

   Basically, you run the toolchain script:

    ## Make the script executable.
    chmod a+x ./toolchain.sh

    ## Run the script.
    ./toolchain.sh

   First, this script will attempt to make sure you have all the programs
   you need to build the toolchain. Then it will download the source from
   various places on the internet. Finally, it will compile and build the
   source. This may take a long time.

   Once finished, you need to add the following to your login settings:

    ## PSPDEV SETTINGS
    export PSPDEV="/usr/local/pspdev"
    export PATH="$PATH:$PSPDEV/bin"

   Then you're done!

  =====================
   WHAT ELSE CAN I DO?
  =====================

   Thanks to Rinco, you can now select which parts of the process to
   perform. No longer will you have to rerun the whole script:

    -d          - Download the required files.
    -b          - Build and install binutils.
    -g          - Build and install gcc. (both c and c++)
    -n          - Build and install newlib.
    -p          - Download, build and install pspsdk.

   For example, say you wanted to update only pspsdk:

    ./toolchain.sh -p

   The script grabs the latest version of pspsdk from the svn repository.
That last part is important. Let's repeat it.

Code: Select all

   For example, say you wanted to update only pspsdk:

    ./toolchain.sh -p

   The script grabs the latest version of pspsdk from the svn repository.
Now you have no excuse for not knowing how to use it nor for not being up to date with the latest pspsdk.

Thanks for reading, and try the fish...
Last edited by ooPo on Sat Jan 06, 2007 2:29 pm, edited 3 times in total.
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

I'm probably an idiot but I can't get this to work at all. Have installed the full cygwin but from bash I the chmod a+x ./psptoolchain.sh won't even work. When I use the renamed version it can't find the file, and when I leave the file alone (i.e. with the date) it does the chmod, but then when trying to run it, it complains about being a bin file.

Should I have selected dosmode when I installed cygwin perhaps?
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Could you paste the actual error messages?

Are you using the cygwin shell, or a dos command line?

Could you try: sh ./toolchain.sh
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

ooPo wrote:Could you paste the actual error messages?

Are you using the cygwin shell, or a dos command line?

Could you try: sh ./toolchain.sh
I've been using the cygwin shell (as in the one that starts arwin@xxx> in nice green font ;) )

I'll try that, thanks. I'm noticing though that there are some version issues - there were three .17 versions already present on my machine, and I installed the latest cygwin. When trying to make sure the right one was installed with regsvr32.exe, I got another error I'd never seen before.

I didn't pursue it much yesterday, went on with trying to compile a few things, and was already very happy to have compiled and fixed the hello world example within 2.5 hours of setting out. :) All that, of course, thanks to all the great help on the boards. 8-)

My C skills haven't been used in, what, 10 years, and they were never great - but I've been hacking into WIN32 with VB6 a lot and learnt more about programming in C (or rather, using OS functions of course) from there than I did before programming C. :)
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

Arwin wrote:
ooPo wrote:Could you paste the actual error messages?

Are you using the cygwin shell, or a dos command line?

Could you try: sh ./toolchain.sh
I've been using the cygwin shell (as in the one that starts arwin@xxx> in nice green font ;) )

I'll try that, thanks.
No luck:

Image
User avatar
Agoln
Posts: 326
Joined: Wed Jun 08, 2005 3:14 am
Location: Fort Wayne, IN

Post by Agoln »

Just do a

Code: Select all

./toolchain.sh
.

No need for the 'sh' in front.
Lego of my Ago!
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

What's psptoolchain.sh? It should be toolchain.sh.
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

ooPo wrote:What's psptoolchain.sh? It should be toolchain.sh.
I think I get it. I mistakenly believed that winrar extracted the file, but it actually just dumped a binary.

Now I'm trying to untar the file with tar in cygwin, but I can't get it to work either. *sigh*

Found the xvf option, but now it says its not a proper tar file ... obsolete 64 headers and all that.
User avatar
Agoln
Posts: 326
Joined: Wed Jun 08, 2005 3:14 am
Location: Fort Wayne, IN

Post by Agoln »

if it is .tar.gz then you have to do a:

Code: Select all

tar -zxvf filename.tar.gz
the z option says it's gzip'd.
Lego of my Ago!
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

Agoln wrote:if it is .tar.gz then you have to do a:

Code: Select all

tar -zxvf filename.tar.gz
the z option says it's gzip'd.
Woohooo!

I'm totally out of this unix thing, apparently. It doesn't show the .gz, how cruel.
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

Now, however, I get

gmake: command not found
wget: command not found

Since I installed all the binaries under the devkit, I'm getting fed up. :(
User avatar
Agoln
Posts: 326
Joined: Wed Jun 08, 2005 3:14 am
Location: Fort Wayne, IN

Post by Agoln »

Arwin wrote:Now, however, I get

gmake: command not found
wget: command not found

Since I installed all the binaries under the devkit, I'm getting fed up. :(
Install wget and make from the cygwin setup.
Lego of my Ago!
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

Agoln wrote:
Arwin wrote:Now, however, I get

gmake: command not found
wget: command not found

Since I installed all the binaries under the devkit, I'm getting fed up. :(
Install wget and make from the cygwin setup.
Make I already installed, I can't any gmake anywhere - I looked through all of them. But I figured out (partly from this thread: http://www.pspupdates.com/forum/showthr ... #post54080) that I needed wget from somewhere too.

And hurray, now it seems to be downloading something. :) One small step at a time.
sexdwarf
Posts: 34
Joined: Thu Jul 14, 2005 12:07 am

Post by sexdwarf »

Arwin wrote:I think I get it. I mistakenly believed that winrar extracted the file, but it actually just dumped a binary.
this is actually a common issue with winrar - it works correctly with .tar.gz but for .tgz (which is the same thing) it only gunzips it... might be beneficial for novice users if ooPo changed it to .tar.gz ... just a suggestion :)
Make I already installed, I can't any gmake anywhere
you can ignore the gmake error since you have make...
...isn't it nice, sugar and spice...
...luring disco dollies to a life of vice...
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Yes, the toolchain script checks for gmake first (hooray for bsd folk) then tries make. As long as the script doesn't give an error message and stop, chances are it is running fine.

As for .tar.gz, well... No offense, but I really don't care if a foolish windows programs can't handle a very common archive format properly just because it isn't getting exactly the extension it wants. I'm actually kinda surprised it doesn't prefer a 'proper' 3-letter extension.

Really, you should be using tar/gunzip to unpack it anyway. Get those hands dirty and touch those unix tools you've committed to using when you decided you wanted to do psp development! :)
sexdwarf
Posts: 34
Joined: Thu Jul 14, 2005 12:07 am

Post by sexdwarf »

ooPo wrote:As for .tar.gz, well... No offense, but I really don't care if a foolish windows programs can't handle a very common archive format properly just because it isn't getting exactly the extension it wants. I'm actually kinda surprised it doesn't prefer a 'proper' 3-letter extension.

Really, you should be using tar/gunzip to unpack it anyway. Get those hands dirty and touch those unix tools you've committed to using when you decided you wanted to do psp development! :)
i agree fully that it is better to get your hands dirty using the appropriate tools,especially since linux/cygwin will be the development area - just thought i'd mention the extension issue... still amazes me that winrar has this issue after so many versions though...
...isn't it nice, sugar and spice...
...luring disco dollies to a life of vice...
bugkiller78
Posts: 5
Joined: Fri Jul 22, 2005 11:40 am

BINUTILS ERROR

Post by bugkiller78 »

Hi,

I'm beating my head against the wall because of this problem. I'm using Cygwin. It took me awhile after I ran ./toolchain.sh. And I got this far to this point:

Code: Select all

checking for gmsgfmt... msgfmt
checking for xgettext... :
updating cache ./config.cache
creating ./config.status
creating Makefile
creating config.h
linking ../../intl/libgettext.h to libintl.h
C:\cygwin\bin\gmake.exe[1]: Entering directory `C:/cygwin/tmp/pspdev/binutils-2.16/build-psp/intl'
gcc -c -DLOCALEDIR=\"/usr/local/pspdev/share/locale\" -DGNULOCALEDIR=\"/usr/local/pspdev/share/locale\" -DLOCALE_ALIAS_PATH=\"/usr/local/pspdev/share/locale:.\" -DHAVE_CONFIG_H -I.
 -I../../intl  -g -O2   ../../intl/intl-compat.c
process_begin: CreateProcess((null), gcc -c -DLOCALEDIR=\"/usr/local/pspdev/share/locale\" -DGNULOCALEDIR=\"/usr/local/pspdev/share/locale\" -DLOCALE_ALIAS_PATH=\"/usr/local/pspdev
/share/locale:.\" -DHAVE_CONFIG_H -I. -I../../intl -g -O2 ../../intl/intl-compat.c, ...) failed.
make (e=2): The system cannot find the file specified.
C:\cygwin\bin\gmake.exe[1]: *** [intl-compat.o] Error 2
C:\cygwin\bin\gmake.exe[1]: Leaving directory `C:/cygwin/tmp/pspdev/binutils-2.16/build-psp/intl'
C:\cygwin\bin\gmake.exe: *** [all-intl] Error 2
ERROR BUILDING BINUTILS
Any1 got any idea? Please help me out!!!
Thanks
User avatar
Agoln
Posts: 326
Joined: Wed Jun 08, 2005 3:14 am
Location: Fort Wayne, IN

Post by Agoln »

How old is your toolchain?
Lego of my Ago!
bugkiller78
Posts: 5
Joined: Fri Jul 22, 2005 11:40 am

thanks

Post by bugkiller78 »

The latest one I just downloaded from here. I think it's 20050625.

I had to go thru a lot of stuff to get this far. Here are my installations:

1. cygwin
2. mingw (I need this for gcc, otherwise the toolchain did NOT even run)
3. additional Unix utils: patch.exe. flex.exe...
4. I also downloaded gmake.exe from some1 (I wasnt able to compile the gnu make sources). This explains why I failed?


Please tell me what I did wrong. Is it helpful if you send me all of the compiled utils such as gcc.exe, gmake.exe, autoconf.exe, automake.exe, gmake.exe, etc... and whatever I need

Thanks, Agoln
Oobles
Site Admin
Posts: 347
Joined: Sat Jan 17, 2004 9:49 am
Location: Melbourne, Australia
Contact:

Post by Oobles »

bugkiller78, you shouldn't need to install mingw, or manually install patch and other tools. gmake.exe is also not required if you use cygwin. The cygwin setup.exe program allows you to select packages to install. It is here that you select gcc, patch, and other things as listed at the following URL.

http://wiki.ps2dev.org/psp:toolchain
http://wiki.ps2dev.org/psp:programming_faq

I'd suggest you start a fresh. If you have the correct packages installed through setup.exe of cygwin you should find the toolchain script works perfectly.

Hope it helps.
David. aka Oobles.
User avatar
Agoln
Posts: 326
Joined: Wed Jun 08, 2005 3:14 am
Location: Fort Wayne, IN

Re: thanks

Post by Agoln »

bugkiller78 wrote:The latest one I just downloaded from here. I think it's 20050625.
That's not the latest one.

Update your toolchain. Like oobles said, I'd start fresh with those sites.
Lego of my Ago!
bugkiller78
Posts: 5
Joined: Fri Jul 22, 2005 11:40 am

thanks

Post by bugkiller78 »

It's working!!! yay!!!

thanks, guys!!!
User avatar
RobbieTheRabbit
Posts: 5
Joined: Fri Jul 15, 2005 7:19 am
Location: France

Post by RobbieTheRabbit »

Hello,

I have this error and I don't know where does it come from, any advice is welcome :D

Image

Edit : OMG I understood.... I let the image to show how much I'm stupid :P

Thanks.
Do you like rabbits ?...
cable16
Posts: 22
Joined: Tue Mar 22, 2005 9:43 am
Contact:

Post by cable16 »

nm just looked at the wiki, answered my question.
t-nooby
Posts: 6
Joined: Sun Jul 31, 2005 3:29 am

Post by t-nooby »

hey man just waited a long time and the end shows this

Code: Select all

config.status: creating Makefile
config.status: creating testsuite/Makefile
config.status: creating config.h
config.status: executing default commands
mkdir -p -- ./bfd
Configuring in bfd
configure: creating cache ./config.cache
checking build system type... i686-pc-cygwin
checking host system type... i686-pc-cygwin
checking target system type... Invalid configuration `psp': machine `psp' not re
cognized
configure: error: /bin/sh ../../bfd/../config.sub psp failed
make: *** [configure-bfd] Error 1
ERROR BUILDING BINUTILS
is that normal?

edit: the sdk test works tho
Soban
Posts: 14
Joined: Sat Aug 06, 2005 12:08 pm

Post by Soban »

I'm using cygwin on winxp with gcc 4.0.1 and the latest version of both the sdk and toolchain.
I just ran the script and after about an hour it tells me this:

Code: Select all

c:\pspdec\bin\psp-ar.exe (3220): *** proc magic mismatch detected - 0xD94C588A/0
xD079E02
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows->Find/Search facility
and delete all but the most recent version. The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution. Rebooting is also suggested if you
are unable to find another cygwin DLL.
make[2]: *** [libgcc.a] Error 128
make[2]: Leaving directory '/tmp/pspdev/gcc-4.0.1/build-psp/gcc'
make[1]: *** [stmp-multilib] Error 2
make[1]: Leaving directory '/tmp/pspdev/gcc-4.0.1/build-psp/gcc'
ERROR BUILDING GCC
So I tried doing what it said. No other versions, so I rebooted and ran it again.
Another hour later it gives me the same thing.
I just reinstalled cygwin, changed a few things, and restarted the script, but it takes an hour to get to the point where it stops so if anyone knows how to solve this problem it would save me a lot of time.

Thanks.

ps: Yes, I read the readme and tried searching this forum for similar questions. No luck.

[edit]
Nevermind... I feel kinda dumb now. I think one of the environment variables from another compiler was interfering with it. Anyway, it works now.
DarknessFX
Posts: 2
Joined: Thu Sep 01, 2005 4:08 am
Location: Brazil

Post by DarknessFX »

Hi,

Im having some troubles to execute the toolchain script, its locking without reason or error message. I tried to reinstall a fresh Cygwin everytime the toolchain fail and its still locking at random stages.

Sry if answered before, I swear I had used the forum search.

"Where it lock" samples (it does lock on other commands too, but most of time its on config.status):
===
checking how to link with libintl... -lintl
checking for aclocal... aclocal
checking for autoconf... autoconf
checking for autoheader... autoheader
updating cache ./config.cache
configure: creating ./config.status
(lock/stall, CPU goes 0%, FileMon says no I/O at HDD)

---- some other times ----
checking whether canonicalize_file_name must be declared... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for getpagesize... (cached) yes
checking for working mmap... no
checking for working strncmp... yes
updating cache ../config.cache
configure: creating ./config.status
(lock/stall, CPU goes 0%, FileMon says no I/O at HDD)

--- unable to use CTRL+C or CTRL+Break ---
--- when I try to close the CygWin Window ---
4 [main] ? 3880 fork_copy: cygheap pass 0 failed, 0x611548E0..0x6115B778, done 0, windows pid 4028, Win32 error 5

--- yesterday the CTRL+C worked and I got ---
Hangup
(and back to the prompt)
===


Some additional info:
===
- Toolchains tested from ooPo and SVN, PSPSDK sync with SVN.
- W2K3 + CygWin (tried Full and "Wiki" Style), Intel with HT enabled, Chkdisk and Defrag = Ok, no bad sectors.
- While the script is running, Im leaving the machine alone and the CygWin with focus. Already tried to leave it running from one day to other without luck.
- I have it running fine in other 2 machines, can I just copy/duplicate my CygWin folder from the working ones?
===

[Edit]
> I have it running fine in other 2 machines, can I just
> copy/duplicate my CygWin folder from the working ones?

- Did work. Im compiling again.
lantree
Posts: 1
Joined: Mon Sep 05, 2005 1:15 pm

X86_64

Post by lantree »

This toolchain will not work natively under Windows XP 64bit edition. I had to modify it to have the --host=i686-pc-cygwin since it doesn't seem to reconignise the x86_64 as the platform identifier. So be warned if you have that problem add that flag above to everything but pspsdk in the ./configure's
Ratty
Posts: 18
Joined: Sun Sep 18, 2005 12:04 pm

Problem installing in Ubuntu

Post by Ratty »

Hi

I'm attempting to install the toolchain in ubuntu 5.04. I'm using toolchain version 20050906. Below is where it dies off, any ideas what's wrong?:

aclocal: configure.ac: 19: macro `AM_PROG_AS' not found in library
configure.ac: 7: `automake requires `AM_CONFIG_HEADER', not `AC_CONFIG_HEADER'
automake: configure.ac: installing `./install-sh'
automake: configure.ac: installing `./mkinstalldirs'
automake: configure.ac: installing `./missing'
Makefile.am:35: DX_COND_doc does not appear in AM_CONDITIONAL
Makefile.am:41: DX_COND_html does not appear in AM_CONDITIONAL
Makefile.am:51: DX_COND_chm does not appear in AM_CONDITIONAL
Makefile.am:55: DX_COND_chi does not appear in AM_CONDITIONAL
Makefile.am:67: DX_COND_man does not appear in AM_CONDITIONAL
Makefile.am:77: DX_COND_rtf does not appear in AM_CONDITIONAL
Makefile.am:87: DX_COND_xml does not appear in AM_CONDITIONAL
Makefile.am:97: DX_COND_ps does not appear in AM_CONDITIONAL
Makefile.am:126: DX_COND_pdf does not appear in AM_CONDITIONAL
Makefile.am:155: DX_COND_latex does not appear in AM_CONDITIONAL
automake: Makefile.am: unterminated conditionals: @DX_COND_doc_TRUE@ @DX_COND_html_TRUE@ @DX_COND_chm_TRUE@ @DX_COND_chi_TRUE@ @DX_COND_man_TRUE@ @DX_COND_rtf_TRUE@ @DX_COND_xml_TRUE@ @DX_COND_ps_TRUE@ @DX_COND_pdf_TRUE@ @DX_COND_latex_TRUE@
automake: Makefile.am: unterminated conditionals: @DX_COND_doc_TRUE@ @DX_COND_html_TRUE@ @DX_COND_chm_TRUE@ @DX_COND_chi_TRUE@ @DX_COND_man_TRUE@ @DX_COND_rtf_TRUE@ @DX_COND_xml_TRUE@ @DX_COND_ps_TRUE@ @DX_COND_pdf_TRUE@ @DX_COND_latex_TRUE@
configure.ac: 7: required file `./[config.h].in' not found
automake: Makefile.am: warning: automake does not support EXTRA_DIST being defined conditionally
Makefile.am:10: variable `DX_CONFIG' not defined
configure.ac:8: error: possibly undefined macro: AC_PSPSDK_VERSION
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:9: error: possibly undefined macro: AC_PSPDEV_PATH
configure.ac:11: error: possibly undefined macro: AM_INIT_AUTOMAKE
configure.ac:14: error: possibly undefined macro: AC_PSPDEV_TOOLCHAIN
configure.ac:19: error: possibly undefined macro: AM_PROG_AS
./configure: line 1312: AC_1.0+beta: command not found
./configure: line 1313: AC_PSPDEV_PATH: command not found
./configure: line 1315: syntax error near unexpected token `pspsdk,'
./configure: line 1315: `AM_INIT_AUTOMAKE(pspsdk, 1.0+beta)'
ERROR RUNNING PSPSDK CONFIGURE
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

Your autotools is too old.
Post Reply