| View previous topic :: View next topic |
| Author |
Message |
Neo-Rio
Joined: 03 Jul 2008 Posts: 11
|
Posted: Thu Jul 03, 2008 5:38 pm Post subject: Issues porting libraries for PSP development |
|
|
Hi everyone,
I'm trying to build a PSP dev/build environment on Ubuntu
So far I have managed to successfully build the psptoolchain (from trunk/psptoolchain) as well as all the libraries from trunk/psplibraries.
Now I have turned my attention to getting some of the other libraries to build and I am having issues. I'm using svn revision 2399
Mainly I want zziplib to build, but the trunk/zziplib is unported. I've tried copying the config.sub from libtremor over to zziplib/uses (in order to get configure to recognise host=psp), and I can get as far as a proper configure (again, borrowing from the configure details of the libtremor install script from trunk/psplibraries) - although it starts whining about requiring aclocal-1.9
Thing is, the compile breaks (mmapped.c contains multiple errors)
Where to I pick up aclocal from?
aalib has similar issues (and doesn't even require a configure). Something goes wrong in aastdin.c (function stdin_getchar contains undeclared fd_set and readfds)
I have no idea how to get these builds to compile properly, but I think they'll need patches of one kind or another.
Any help? |
|
| Back to top |
|
 |
Heimdall
Joined: 10 Nov 2005 Posts: 259 Location: Netherlands
|
|
| Back to top |
|
 |
Neo-Rio
Joined: 03 Jul 2008 Posts: 11
|
Posted: Thu Jul 03, 2008 7:27 pm Post subject: |
|
|
autotools-dev is already installed (I have tried on both Debian and Ubuntu)
the configure looks for aclocal in the pspdev directory (as well as pkgconfig for that matter)
Thing is, there's no aclocal in there, but there IS an aclocal.m4 and an acinclude.m4 in the zziplib directory
Anyone got zziplib to build for PSP? I'm pulling my hair out here. |
|
| Back to top |
|
 |
Heimdall
Joined: 10 Nov 2005 Posts: 259 Location: Netherlands
|
Posted: Thu Jul 03, 2008 7:39 pm Post subject: |
|
|
| have you tried to run autoreconf to install the missing stuff? |
|
| Back to top |
|
 |
Neo-Rio
Joined: 03 Jul 2008 Posts: 11
|
Posted: Mon Jul 07, 2008 6:34 pm Post subject: |
|
|
yes, but that doesn't solve my problem. Autoconf on 8.04 Ubuntu is 2.61
I ran autoreconf on the zziplib source directory and it made a few changes. However it still refuses to configure correctly for building for the PSP.
I'm now using the latest psp2dev revision as well
I copied across the config.sub from sqlite for zziplib to use so that it understands what --host psp means. Now, however, the configure crashes out complaining:-
checking build system type... Invalid configureation `elf' : machine `elf' not recognised
I'm pretty sure the problem lies with config.sub, but I have no idea where to start trying to debug this. |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Tue Jul 08, 2008 2:17 am Post subject: |
|
|
Typically all you need is to add an alias for psp into the config.sub file:
| Code: | psp)
basic_machine=mipsallegrexel-psp
os=-elf
;;
|
When you specify 'psp' as the target, you're actually building for a machine called 'mipsallegrexel-psp-elf' in a standard way. (cpu + hardware + os/executable type).
Just copying over the config.sub from another place may have some unintended consequences. You might want to try just adding the psp lines above, or manually specifying the full platform name to see if you can get it to build and worry about naming it 'psp' later on. |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Tue Jul 08, 2008 2:26 am Post subject: |
|
|
I've added the stuff to config.sub in zziplib in the repository. I then configured it with this:
| Code: | | LDFLAGS="-L$(psp-config --pspsdk-path)/lib -lc -lpspuser" ./configure --host psp --prefix=$(psp-config --psp-prefix) |
Then started to build, but got this:
| Code: | In file included from ../../zzip/mmapped.c:25:
../../zzip/mmapped.h:49: warning: type qualifiers ignored on function return type
../../zzip/mmapped.h:52: warning: type qualifiers ignored on function return type
../../zzip/mmapped.h:58: warning: type qualifiers ignored on function return type
../../zzip/mmapped.h:74: warning: type qualifiers ignored on function return type
../../zzip/mmapped.h:91: warning: type qualifiers ignored on function return type
../../zzip/mmapped.h:94: warning: type qualifiers ignored on function return type
../../zzip/mmapped.c:79: warning: type qualifiers ignored on function return type
../../zzip/mmapped.c:95: warning: type qualifiers ignored on function return type
../../zzip/mmapped.c:128: warning: type qualifiers ignored on function return type
../../zzip/mmapped.c:174: warning: type qualifiers ignored on function return type
../../zzip/mmapped.c:188: error: expected ';', ',' or ')' before 'a'
../../zzip/mmapped.c:242: warning: type qualifiers ignored on function return type
../../zzip/mmapped.c: In function 'zzip_disk_findfile':
../../zzip/mmapped.c:358: error: '_zzip_strcasecmp' undeclared (first use in this function)
../../zzip/mmapped.c:358: error: (Each undeclared identifier is reported only once
../../zzip/mmapped.c:358: error: for each function it appears in.)
../../zzip/mmapped.c: In function '_zzip_fnmatch':
../../zzip/mmapped.c:385: warning: implicit declaration of function 'puts'
../../zzip/mmapped.c: At top level:
../../zzip/mmapped.c:456: warning: type qualifiers ignored on function return type
../../zzip/mmapped.c: In function 'zzip_disk_entry_fopen':
../../zzip/mmapped.c:473: warning: pointer targets in assignment differ in signedness
../../zzip/mmapped.c: At top level:
../../zzip/mmapped.c:490: warning: type qualifiers ignored on function return type
make[3]: *** [mmapped.lo] Error 1
make[3]: Leaving directory `/home/danpeori/Coding/psp/zziplib/mipsallegrexel-psp-elf/zzip'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/danpeori/Coding/psp/zziplib/mipsallegrexel-psp-elf'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/danpeori/Coding/psp/zziplib/mipsallegrexel-psp-elf'
make: *** [all-all] Error 2 |
I don't have time right now to spend on it, but that should at least give you a bit of a head start on porting it... |
|
| Back to top |
|
 |
Neo-Rio
Joined: 03 Jul 2008 Posts: 11
|
Posted: Tue Jul 08, 2008 12:18 pm Post subject: |
|
|
| ooPo wrote: | I've added the stuff to config.sub in zziplib in the repository. I then configured it with this:
| Code: | | LDFLAGS="-L$(psp-config --pspsdk-path)/lib -lc -lpspuser" ./configure --host psp --prefix=$(psp-config --psp-prefix) |
|
This is the same configure line that I used.
| Code: |
../../zzip/mmapped.c: In function 'zzip_disk_findfile':
../../zzip/mmapped.c:358: error: '_zzip_strcasecmp' undeclared (first use in this function)
../../zzip/mmapped.c:358: error: (Each undeclared identifier is reported only once
../../zzip/mmapped.c:358: error: for each function it appears in.)
|
This seems to be a common problem across some of the other libraries. It seems that the compiler has a few issues with code where certain things go undeclared. I have seen the same problem in aalib and the psppacker as well. |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Tue Jul 08, 2008 1:44 pm Post subject: |
|
|
This was the important line:
| Code: | | ../../zzip/mmapped.c:188: error: expected ';', ',' or ')' before 'a' |
It ends up that there was an extra underscore in this line:
| Code: | static int _zzip_strcasecmp(char* _zzip_restrict a, char* _zzip_restrict b)
|
Change __zzip_restrict to _zzip_restrict and it builds fine. Well, almost fine - the bins directory has to be skipped but that was easily removed from the makefile.
Its seems to build fine now and I've committed it to the repository. Feel free to test it. |
|
| Back to top |
|
 |
Neo-Rio
Joined: 03 Jul 2008 Posts: 11
|
Posted: Tue Jul 08, 2008 1:47 pm Post subject: |
|
|
| Cheers for that. I'll try it out! |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Tue Jul 08, 2008 1:50 pm Post subject: |
|
|
| I've also added it to the psplibraries script as #23. |
|
| Back to top |
|
 |
Neo-Rio
Joined: 03 Jul 2008 Posts: 11
|
Posted: Tue Jul 08, 2008 2:10 pm Post subject: |
|
|
Great, I'll try that too.
I was having problems installing the libraries in Ubuntu because of file permissions. (I used sudo to build the psptoolchain and libraries), so maybe your script will sort this out. I'll let you know how it goes. |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Tue Jul 08, 2008 2:21 pm Post subject: |
|
|
| When you use sudo, it clears out your path and other environment variables. This is usually why a 'sudo make install' will fail. You can either make the destination directory user-writable, or re-set the environment variables after calling sudo. (This is all toolchain-sudo.sh does, btw... a wrapper to set the environment before calling toolchain.sh.) |
|
| Back to top |
|
 |
Neo-Rio
Joined: 03 Jul 2008 Posts: 11
|
Posted: Tue Jul 08, 2008 7:28 pm Post subject: |
|
|
You might want to tweak your zzlib scirpt. It didn't svn the sources before it attempted to build for me (on a completely new install), so we end up with
| Code: | | can't cd to zziplib |
...because the script looks for the existance of a zlib directory in "build", and not zziplib. (and since zlib already exists, it failes to svn the zziplib sources)
no biggie to fix |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Tue Jul 08, 2008 9:44 pm Post subject: |
|
|
| Doh! Fixed. :) |
|
| Back to top |
|
 |
|