Issues porting libraries for PSP development
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?
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?
aclocal is part of autotools, they provide you:
autoconf
automake
aclocal
and others.
You can get the version you need from your debian package repository or build them from source yourself from here:
http://www.gnu.org/software/autoconf/
http://www.gnu.org/software/automake/
http://www.gnu.org/software/libtool/
Not sure if you need the last one. Then download the version you need and build. The procedure is always the same:
./configure --prefix=/usr/local
make
make install
autoconf
automake
aclocal
and others.
You can get the version you need from your debian package repository or build them from source yourself from here:
http://www.gnu.org/software/autoconf/
http://www.gnu.org/software/automake/
http://www.gnu.org/software/libtool/
Not sure if you need the last one. Then download the version you need and build. The procedure is always the same:
./configure --prefix=/usr/local
make
make install
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.
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.
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.
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.
Typically all you need is to add an alias for psp into the config.sub file:
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.
Code: Select all
psp)
basic_machine=mipsallegrexel-psp
os=-elf
;;
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.
I've added the stuff to config.sub in zziplib in the repository. I then configured it with this:
Then started to build, but got this:
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...
Code: Select all
LDFLAGS="-L$(psp-config --pspsdk-path)/lib -lc -lpspuser" ./configure --host psp --prefix=$(psp-config --psp-prefix)
Code: Select all
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
This is the same configure line that I used.ooPo wrote:I've added the stuff to config.sub in zziplib in the repository. I then configured it with this:
Code: Select all
LDFLAGS="-L$(psp-config --pspsdk-path)/lib -lc -lpspuser" ./configure --host psp --prefix=$(psp-config --psp-prefix)
Code: Select all
../../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 was the important line:
It ends up that there was an extra underscore in this line:
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.
Code: Select all
../../zzip/mmapped.c:188: error: expected ';', ',' or ')' before 'a'
Code: Select all
static int _zzip_strcasecmp(char* _zzip_restrict a, char* _zzip_restrict b)
Its seems to build fine now and I've committed it to the repository. Feel free to test it.
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.)
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
...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
Code: Select all
can't cd to zziplib
no biggie to fix