aboutsummaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorMarcelo Araujo <araujo@FreeBSD.org>2009-08-21 00:54:33 +0000
committerMarcelo Araujo <araujo@FreeBSD.org>2009-08-21 00:54:33 +0000
commit8cbd3957fb9309b77590faad70c31ada2caee71f (patch)
tree6e6dc53459a6b9a79b032994edb9301bd33d61c2 /devel
parent074f004e7be95f94905b7f7e9a1d2145f99f3948 (diff)
Notes
Diffstat (limited to 'devel')
-rw-r--r--devel/Makefile8
-rw-r--r--devel/psptoolchain-binutils/Makefile53
-rw-r--r--devel/psptoolchain-binutils/distinfo3
-rw-r--r--devel/psptoolchain-binutils/files/patch-bfd-Makefile.am11
-rw-r--r--devel/psptoolchain-binutils/files/patch-bfd-Makefile.in11
-rw-r--r--devel/psptoolchain-binutils/files/patch-bfd-archures.c10
-rw-r--r--devel/psptoolchain-binutils/files/patch-bfd-bfd-in2.h10
-rw-r--r--devel/psptoolchain-binutils/files/patch-bfd-configure13
-rw-r--r--devel/psptoolchain-binutils/files/patch-bfd-cpu-mips.c20
-rw-r--r--devel/psptoolchain-binutils/files/patch-bfd-elfxx-mips.c48
-rw-r--r--devel/psptoolchain-binutils/files/patch-bfd-version.h7
-rw-r--r--devel/psptoolchain-binutils/files/patch-binutils-readelf.c10
-rw-r--r--devel/psptoolchain-binutils/files/patch-config.sub29
-rw-r--r--devel/psptoolchain-binutils/files/patch-configure20
-rw-r--r--devel/psptoolchain-binutils/files/patch-gas-config-tc-mips.c1943
-rw-r--r--devel/psptoolchain-binutils/files/patch-gas-configure12
-rw-r--r--devel/psptoolchain-binutils/files/patch-gas-configure.in12
-rw-r--r--devel/psptoolchain-binutils/files/patch-gas-testsuite-gas-mips-mips.exp12
-rw-r--r--devel/psptoolchain-binutils/files/patch-include-bin-bugs.h7
-rw-r--r--devel/psptoolchain-binutils/files/patch-include-elf-common.h10
-rw-r--r--devel/psptoolchain-binutils/files/patch-include-elf-mips.h10
-rw-r--r--devel/psptoolchain-binutils/files/patch-include-opcode-mips.h356
-rw-r--r--devel/psptoolchain-binutils/files/patch-include-opcode-vfpu.h264
-rw-r--r--devel/psptoolchain-binutils/files/patch-ld-Makefile.am20
-rw-r--r--devel/psptoolchain-binutils/files/patch-ld-Makefile.in20
-rw-r--r--devel/psptoolchain-binutils/files/patch-ld-configure.tgt11
-rw-r--r--devel/psptoolchain-binutils/files/patch-ld-emulparams-elf_mipsallegrexel_psp.sh25
-rw-r--r--devel/psptoolchain-binutils/files/patch-ld-scripttempl-elf_psp.sc499
-rw-r--r--devel/psptoolchain-binutils/files/patch-opcodes-configure13
-rw-r--r--devel/psptoolchain-binutils/files/patch-opcodes-mips-dis.c556
-rw-r--r--devel/psptoolchain-binutils/files/patch-opcodes-mips-opc.c606
-rw-r--r--devel/psptoolchain-binutils/pkg-descr4
-rw-r--r--devel/psptoolchain-binutils/pkg-plist51
-rw-r--r--devel/psptoolchain-gcc-stage1/Makefile69
-rw-r--r--devel/psptoolchain-gcc-stage1/distinfo3
-rw-r--r--devel/psptoolchain-gcc-stage1/files/patch-config.sub29
-rw-r--r--devel/psptoolchain-gcc-stage1/files/patch-gcc-c-incpath.c28
-rw-r--r--devel/psptoolchain-gcc-stage1/files/patch-gcc-config-mips-allegrex.md186
-rw-r--r--devel/psptoolchain-gcc-stage1/files/patch-gcc-config-mips-mips.c223
-rw-r--r--devel/psptoolchain-gcc-stage1/files/patch-gcc-config-mips-mips.h98
-rw-r--r--devel/psptoolchain-gcc-stage1/files/patch-gcc-config-mips-mips.md140
-rw-r--r--devel/psptoolchain-gcc-stage1/files/patch-gcc-config-mips-psp.h34
-rw-r--r--devel/psptoolchain-gcc-stage1/files/patch-gcc-config-mips-t-allegrex32
-rw-r--r--devel/psptoolchain-gcc-stage1/files/patch-gcc-config.gcc46
-rw-r--r--devel/psptoolchain-gcc-stage1/files/patch-gcc-version.c20
-rw-r--r--devel/psptoolchain-gcc-stage1/pkg-descr4
-rw-r--r--devel/psptoolchain-gcc-stage1/pkg-plist63
-rw-r--r--devel/psptoolchain-gcc-stage2/Makefile22
-rw-r--r--devel/psptoolchain-gcc-stage2/pkg-plist557
-rw-r--r--devel/psptoolchain-gdb/Makefile37
-rw-r--r--devel/psptoolchain-gdb/distinfo3
-rw-r--r--devel/psptoolchain-gdb/files/patch-bfd-archures.c10
-rw-r--r--devel/psptoolchain-gdb/files/patch-bfd-bfd-in2.h10
-rw-r--r--devel/psptoolchain-gdb/files/patch-bfd-cpu-mips.c20
-rw-r--r--devel/psptoolchain-gdb/files/patch-bfd-elfxx-mips.c31
-rw-r--r--devel/psptoolchain-gdb/files/patch-config.sub29
-rw-r--r--devel/psptoolchain-gdb/files/patch-gdb-remote.c32
-rw-r--r--devel/psptoolchain-gdb/files/patch-include-bin-bugs.h7
-rw-r--r--devel/psptoolchain-gdb/files/patch-include-elf-common.h10
-rw-r--r--devel/psptoolchain-gdb/files/patch-include-elf-mips.h10
-rw-r--r--devel/psptoolchain-gdb/files/patch-include-opcode-mips.h194
-rw-r--r--devel/psptoolchain-gdb/files/patch-opcodes-mips-dis.c557
-rw-r--r--devel/psptoolchain-gdb/files/patch-opcodes-mips-opc.c608
-rw-r--r--devel/psptoolchain-gdb/pkg-descr4
-rw-r--r--devel/psptoolchain-gdb/pkg-plist6
-rw-r--r--devel/psptoolchain-newlib/Makefile41
-rw-r--r--devel/psptoolchain-newlib/distinfo3
-rw-r--r--devel/psptoolchain-newlib/files/patch-config.sub29
-rw-r--r--devel/psptoolchain-newlib/files/patch-configure12
-rw-r--r--devel/psptoolchain-newlib/files/patch-configure.in12
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-Makefile.am21
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-Makefile.in21
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-configure.host27
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-include-machine-time.h13
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-include-sys-config.h15
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-include-sys-types.h55
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-include-time.h19
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-configure21
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-configure.in10
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-Makefile.am74
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-Makefile.in467
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-README19
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-aclocal.m4883
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-arpa-inet.h29
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-confdefs.h4
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-configure4089
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-configure.in17
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-crt0.c6
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-fdman.c118
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-fdman.h47
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-include-netdb.h39
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-interrupt.S69
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-libcglue.c939
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-netdb.c106
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-netinet-in.h274
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-netinet-tcp.h15
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-pipe.c308
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-pspcwd.c169
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-select.c202
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-socket.c393
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-sys-dirent.h42
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-sys-errno.h161
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-sys-fd_set.h72
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-sys-ioctl.h4
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-sys-select.h57
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-sys-socket.h297
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-syscalls.c22
-rw-r--r--devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-xprintf.c987
-rw-r--r--devel/psptoolchain-newlib/pkg-descr4
-rw-r--r--devel/psptoolchain-newlib/pkg-plist105
-rw-r--r--devel/psptoolchain-pspsdk-stage1/Makefile43
-rw-r--r--devel/psptoolchain-pspsdk-stage1/distinfo3
-rw-r--r--devel/psptoolchain-pspsdk-stage1/files/patch-src-libc-libcglue.c11
-rw-r--r--devel/psptoolchain-pspsdk-stage1/pkg-descr4
-rw-r--r--devel/psptoolchain-pspsdk-stage1/pkg-plist416
-rw-r--r--devel/psptoolchain-pspsdk-stage2/Makefile25
-rw-r--r--devel/psptoolchain-pspsdk-stage2/pkg-plist493
-rw-r--r--devel/psptoolchain/Makefile40
-rw-r--r--devel/psptoolchain/pkg-descr4
119 files changed, 19162 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile
index 9aaabb39400f..2029ab1a194e 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -2299,6 +2299,14 @@
SUBDIR += protobuf
SUBDIR += prototype
SUBDIR += pstreams
+ SUBDIR += psptoolchain
+ SUBDIR += psptoolchain-binutils
+ SUBDIR += psptoolchain-gcc-stage1
+ SUBDIR += psptoolchain-gcc-stage2
+ SUBDIR += psptoolchain-gdb
+ SUBDIR += psptoolchain-newlib
+ SUBDIR += psptoolchainpspsdk-stage1
+ SUBDIR += psptoolchainpspsdk-stage2
SUBDIR += psvn
SUBDIR += pth
SUBDIR += pth-hard
diff --git a/devel/psptoolchain-binutils/Makefile b/devel/psptoolchain-binutils/Makefile
new file mode 100644
index 000000000000..95d20bde724d
--- /dev/null
+++ b/devel/psptoolchain-binutils/Makefile
@@ -0,0 +1,53 @@
+# New ports collection makefile for: psptoolchain-binutils
+# Date created: 13 February 2009
+# Whom: Tassilo Philipp <tphilipp@potion-studios.com>
+#
+# $FreeBSD$
+#
+
+PORTNAME= binutils
+PORTVERSION= 2.16.1
+CATEGORIES= devel
+MASTER_SITES= ftp://ftp.gnu.org/pub/gnu/${PORTNAME}/ \
+ ${MASTER_SITE_SOURCEWARE}
+MASTER_SITE_SUBDIR= ${PORTNAME}/releases
+PKGNAMEPREFIX= psptoolchain-
+
+MAINTAINER= tphilipp@potion-studios.com
+COMMENT= PlayStation Portable development toolchain ${PORTNAME}
+
+USE_BZIP2= yes
+USE_GMAKE= yes
+
+HAS_CONFIGURE= yes
+CONFIGURE_ARGS= --prefix=${PREFIX} --target="psp" --enable-install-libbfd --disable-nls
+
+MAN1= psp-addr2line.1 \
+ psp-ar.1 \
+ psp-as.1 \
+ psp-c++filt.1 \
+ psp-dlltool.1 \
+ psp-gprof.1 \
+ psp-ld.1 \
+ psp-nlmconv.1 \
+ psp-nm.1 \
+ psp-objcopy.1 \
+ psp-objdump.1 \
+ psp-ranlib.1 \
+ psp-readelf.1 \
+ psp-size.1 \
+ psp-strings.1 \
+ psp-strip.1 \
+ psp-windres.1
+
+# Disable installation of .info files and libiberty.
+post-patch:
+ @${REINPLACE_CMD} -E 's/^(INFO_DEPS.*=)(.*)/\1#\2/' ${WRKSRC}/bfd/doc/Makefile.in
+ @${REINPLACE_CMD} -E 's/^(INFO_DEPS.*=)(.*)/\1#\2/' ${WRKSRC}/binutils/doc/Makefile.in
+ @${REINPLACE_CMD} -E 's/^(INFO_DEPS.*=)(.*)/\1#\2/' ${WRKSRC}/gas/doc/Makefile.in
+ @${REINPLACE_CMD} -E 's/^(INFO_DEPS.*=)(.*)/\1#\2/' ${WRKSRC}/gprof/Makefile.in
+ @${REINPLACE_CMD} -E 's/^(INFO_DEPS.*=)(.*)/\1#\2/' ${WRKSRC}/ld/Makefile.in
+ @${REINPLACE_CMD} -E 's/^(install:.*)(install-info.*)/\1#\2/' ${WRKSRC}/etc/Makefile.in
+ @${REINPLACE_CMD} -E 's/^(install:)(.*)/\1#\2/' ${WRKSRC}/libiberty/Makefile.in
+
+.include <bsd.port.mk>
diff --git a/devel/psptoolchain-binutils/distinfo b/devel/psptoolchain-binutils/distinfo
new file mode 100644
index 000000000000..03585c305a26
--- /dev/null
+++ b/devel/psptoolchain-binutils/distinfo
@@ -0,0 +1,3 @@
+MD5 (binutils-2.16.1.tar.bz2) = 6a9d529efb285071dad10e1f3d2b2967
+SHA256 (binutils-2.16.1.tar.bz2) = 351a6846ee179a37ed87a487971547159a7f4f92a1dec598c727f184a0de61ae
+SIZE (binutils-2.16.1.tar.bz2) = 12549917
diff --git a/devel/psptoolchain-binutils/files/patch-bfd-Makefile.am b/devel/psptoolchain-binutils/files/patch-bfd-Makefile.am
new file mode 100644
index 000000000000..4923066191c1
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-bfd-Makefile.am
@@ -0,0 +1,11 @@
+--- bfd/Makefile.am.orig 2005-06-12 19:58:52.000000000 +0100
++++ bfd/Makefile.am 2006-05-09 02:55:36.000000000 +0100
+@@ -3,7 +3,7 @@
+ AUTOMAKE_OPTIONS = 1.9 cygnus
+
+ # Uncomment the following line when doing a release.
+-RELEASE=y
++#RELEASE=y
+
+ INCDIR = $(srcdir)/../include
+ CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
diff --git a/devel/psptoolchain-binutils/files/patch-bfd-Makefile.in b/devel/psptoolchain-binutils/files/patch-bfd-Makefile.in
new file mode 100644
index 000000000000..8b03560dc31d
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-bfd-Makefile.in
@@ -0,0 +1,11 @@
+--- bfd/Makefile.in.orig 2005-06-12 19:58:55.000000000 +0100
++++ bfd/Makefile.in 2006-05-09 02:55:36.000000000 +0100
+@@ -250,7 +250,7 @@
+ AUTOMAKE_OPTIONS = 1.9 cygnus
+
+ # Uncomment the following line when doing a release.
+-RELEASE=y
++#RELEASE=y
+ INCDIR = $(srcdir)/../include
+ CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
+ MKDEP = gcc -MM
diff --git a/devel/psptoolchain-binutils/files/patch-bfd-archures.c b/devel/psptoolchain-binutils/files/patch-bfd-archures.c
new file mode 100644
index 000000000000..21ffe9688bd4
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-bfd-archures.c
@@ -0,0 +1,10 @@
+--- bfd/archures.c.orig 2005-01-17 14:08:03.000000000 +0000
++++ bfd/archures.c 2006-05-09 02:55:36.000000000 +0100
+@@ -155,6 +155,7 @@
+ .#define bfd_mach_mips16 16
+ .#define bfd_mach_mips5 5
+ .#define bfd_mach_mips_sb1 12310201 {* octal 'SB', 01 *}
++.#define bfd_mach_mips_allegrex 10111431 {* octal 'AL', 31 *}
+ .#define bfd_mach_mipsisa32 32
+ .#define bfd_mach_mipsisa32r2 33
+ .#define bfd_mach_mipsisa64 64
diff --git a/devel/psptoolchain-binutils/files/patch-bfd-bfd-in2.h b/devel/psptoolchain-binutils/files/patch-bfd-bfd-in2.h
new file mode 100644
index 000000000000..cbc568daaad2
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-bfd-bfd-in2.h
@@ -0,0 +1,10 @@
+--- bfd/bfd-in2.h.orig 2005-03-02 21:23:20.000000000 +0000
++++ bfd/bfd-in2.h 2006-05-09 02:55:36.000000000 +0100
+@@ -1600,6 +1600,7 @@
+ #define bfd_mach_mips16 16
+ #define bfd_mach_mips5 5
+ #define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */
++#define bfd_mach_mips_allegrex 10111431 /* octal 'AL', 31 */
+ #define bfd_mach_mipsisa32 32
+ #define bfd_mach_mipsisa32r2 33
+ #define bfd_mach_mipsisa64 64
diff --git a/devel/psptoolchain-binutils/files/patch-bfd-configure b/devel/psptoolchain-binutils/files/patch-bfd-configure
new file mode 100644
index 000000000000..c38bc8a97165
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-bfd-configure
@@ -0,0 +1,13 @@
+--- bfd/configure.orig 2009-02-26 14:37:44.000000000 +0100
++++ bfd/configure 2009-02-26 14:38:23.000000000 +0100
+@@ -4366,8 +4366,8 @@
+ bfdlibdir='$(libdir)'
+ bfdincludedir='$(includedir)'
+ if test "${host}" != "${target}"; then
+- bfdlibdir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/lib'
+- bfdincludedir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/include'
++ bfdlibdir='$(exec_prefix)/$(target_noncanonical)/lib'
++ bfdincludedir='$(exec_prefix)/$(target_noncanonical)/include'
+ fi
+
+
diff --git a/devel/psptoolchain-binutils/files/patch-bfd-cpu-mips.c b/devel/psptoolchain-binutils/files/patch-bfd-cpu-mips.c
new file mode 100644
index 000000000000..5038cb9f73f2
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-bfd-cpu-mips.c
@@ -0,0 +1,20 @@
+--- bfd/cpu-mips.c.orig 2005-03-03 11:40:58.000000000 +0000
++++ bfd/cpu-mips.c 2006-05-09 02:55:36.000000000 +0100
+@@ -86,6 +86,7 @@
+ I_mipsisa64,
+ I_mipsisa64r2,
+ I_sb1,
++ I_allegrex,
+ };
+
+ #define NN(index) (&arch_info_struct[(index) + 1])
+@@ -118,7 +119,8 @@
+ N (32, 32, bfd_mach_mipsisa32r2,"mips:isa32r2", FALSE, NN(I_mipsisa32r2)),
+ N (64, 64, bfd_mach_mipsisa64, "mips:isa64", FALSE, NN(I_mipsisa64)),
+ N (64, 64, bfd_mach_mipsisa64r2,"mips:isa64r2", FALSE, NN(I_mipsisa64r2)),
+- N (64, 64, bfd_mach_mips_sb1, "mips:sb1", FALSE, 0),
++ N (64, 64, bfd_mach_mips_sb1, "mips:sb1", FALSE, NN(I_sb1)),
++ N (32, 32, bfd_mach_mips_allegrex, "mips:allegrex", FALSE, 0),
+ };
+
+ /* The default architecture is mips:3000, but with a machine number of
diff --git a/devel/psptoolchain-binutils/files/patch-bfd-elfxx-mips.c b/devel/psptoolchain-binutils/files/patch-bfd-elfxx-mips.c
new file mode 100644
index 000000000000..57efe9bedec6
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-bfd-elfxx-mips.c
@@ -0,0 +1,48 @@
+--- bfd/elfxx-mips.c.orig 2005-05-28 22:58:29.000000000 +0100
++++ bfd/elfxx-mips.c 2006-05-09 02:55:36.000000000 +0100
+@@ -4669,6 +4669,9 @@
+ case E_MIPS_MACH_SB1:
+ return bfd_mach_mips_sb1;
+
++ case E_MIPS_MACH_ALLEGREX:
++ return bfd_mach_mips_allegrex;
++
+ default:
+ switch (flags & EF_MIPS_ARCH)
+ {
+@@ -7941,6 +7944,10 @@
+ val = E_MIPS_ARCH_64 | E_MIPS_MACH_SB1;
+ break;
+
++ case bfd_mach_mips_allegrex:
++ val = E_MIPS_ARCH_2 | E_MIPS_MACH_ALLEGREX;
++ break;
++
+ case bfd_mach_mipsisa32:
+ val = E_MIPS_ARCH_32;
+ break;
+@@ -8422,6 +8429,8 @@
+ if (dynobj != NULL && force_local && h->root.type != STT_TLS)
+ {
+ got = mips_elf_got_section (dynobj, FALSE);
++ if (got)
++ {
+ g = mips_elf_section_data (got)->u.got_info;
+
+ if (g->next)
+@@ -8472,6 +8481,7 @@
+ g->global_gotno--;
+ }
+ }
++ }
+
+ _bfd_elf_link_hash_hide_symbol (info, &h->root, force_local);
+ }
+@@ -9641,6 +9651,7 @@
+ /* MIPS II extensions. */
+ { bfd_mach_mips4000, bfd_mach_mips6000 },
+ { bfd_mach_mipsisa32, bfd_mach_mips6000 },
++ { bfd_mach_mips_allegrex, bfd_mach_mips6000 },
+
+ /* MIPS I extensions. */
+ { bfd_mach_mips6000, bfd_mach_mips3000 },
diff --git a/devel/psptoolchain-binutils/files/patch-bfd-version.h b/devel/psptoolchain-binutils/files/patch-bfd-version.h
new file mode 100644
index 000000000000..310820689f38
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-bfd-version.h
@@ -0,0 +1,7 @@
+--- bfd/version.h.orig 2005-06-12 18:37:59.000000000 +0100
++++ bfd/version.h 2006-05-09 02:55:36.000000000 +0100
+@@ -1,3 +1,3 @@
+-#define BFD_VERSION_DATE 20050612
++#define BFD_VERSION_DATE (PSPDEV 20060116)
+ #define BFD_VERSION @bfd_version@
+ #define BFD_VERSION_STRING @bfd_version_string@
diff --git a/devel/psptoolchain-binutils/files/patch-binutils-readelf.c b/devel/psptoolchain-binutils/files/patch-binutils-readelf.c
new file mode 100644
index 000000000000..dd61bd39a56e
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-binutils-readelf.c
@@ -0,0 +1,10 @@
+--- binutils/readelf.c.orig 2005-04-20 19:43:36.000000000 +0100
++++ binutils/readelf.c 2006-05-09 02:55:36.000000000 +0100
+@@ -2043,6 +2043,7 @@
+ case E_MIPS_MACH_5500: strcat (buf, ", 5500"); break;
+ case E_MIPS_MACH_SB1: strcat (buf, ", sb1"); break;
+ case E_MIPS_MACH_9000: strcat (buf, ", 9000"); break;
++ case E_MIPS_MACH_ALLEGREX: strcat (buf, ", allegrex"); break;
+ case 0:
+ /* We simply ignore the field in this case to avoid confusion:
+ MIPS ELF does not specify EF_MIPS_MACH, it is a GNU
diff --git a/devel/psptoolchain-binutils/files/patch-config.sub b/devel/psptoolchain-binutils/files/patch-config.sub
new file mode 100644
index 000000000000..38fabdd9af32
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-config.sub
@@ -0,0 +1,29 @@
+--- config.sub.orig 2005-01-19 00:34:56.000000000 +0000
++++ config.sub 2006-05-09 02:55:36.000000000 +0100
+@@ -253,6 +253,7 @@
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
++ | mipsallegrex | mipsallegrexel \
+ | mn10200 | mn10300 \
+ | msp430 \
+ | ns16k | ns32k \
+@@ -326,6 +327,7 @@
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
++ | mipsallegrex-* | mipsallegrexel-* \
+ | mmix-* \
+ | msp430-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+@@ -665,6 +667,10 @@
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
++ psp)
++ basic_machine=mipsallegrexel-psp
++ os=-elf
++ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
diff --git a/devel/psptoolchain-binutils/files/patch-configure b/devel/psptoolchain-binutils/files/patch-configure
new file mode 100644
index 000000000000..881866d32e72
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-configure
@@ -0,0 +1,20 @@
+--- configure.orig 2005-02-28 14:06:59.000000000 +0000
++++ configure 2006-05-09 02:55:10.000000000 +0100
+@@ -1034,7 +1034,7 @@
+
+ # Some tools are only suitable for building in a "native" situation.
+ # Remove these if host!=target.
+-native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
++native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
+
+ # Similarly, some are only suitable for cross toolchains.
+ # Remove these if host=target.
+@@ -1516,7 +1516,7 @@
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ ;;
+ mips*-*-*)
+- noconfigdirs="$noconfigdirs gprof ${libgcj}"
++ noconfigdirs="$noconfigdirs ${libgcj}"
+ ;;
+ romp-*-*)
+ noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
diff --git a/devel/psptoolchain-binutils/files/patch-gas-config-tc-mips.c b/devel/psptoolchain-binutils/files/patch-gas-config-tc-mips.c
new file mode 100644
index 000000000000..910a6a6290c9
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-gas-config-tc-mips.c
@@ -0,0 +1,1943 @@
+--- gas/config/tc-mips.c.orig 2005-06-12 19:07:03.000000000 +0100
++++ gas/config/tc-mips.c 2006-05-09 02:55:36.000000000 +0100
+@@ -92,6 +92,32 @@
+
+ #define ZERO 0
+ #define AT 1
++#define V0 2
++#define V1 3
++#define A0 4
++#define A1 5
++#define A2 6
++#define A3 7
++#define T0 8
++#define T1 9
++#define T2 10
++#define T3 11
++#define T4 12
++#define T5 13
++#define T6 14
++#define T7 15
++#define S0 16
++#define S1 17
++#define S2 18
++#define S3 19
++#define S4 20
++#define S5 21
++#define S6 22
++#define S7 23
++#define T8 24
++#define T9 25
++#define K0 26
++#define K1 27
+ #define TREG 24
+ #define PIC_CALL_REG 25
+ #define KT0 26
+@@ -365,11 +391,15 @@
+ #define CPU_HAS_MDMX(cpu) (FALSE \
+ )
+
++/* True if the given CPU belongs to the Allegrex family. */
++#define CPU_IS_ALLEGREX(CPU) ((CPU) == CPU_ALLEGREX \
++ )
++
+ /* True if CPU has a dror instruction. */
+ #define CPU_HAS_DROR(CPU) ((CPU) == CPU_VR5400 || (CPU) == CPU_VR5500)
+
+ /* True if CPU has a ror instruction. */
+-#define CPU_HAS_ROR(CPU) CPU_HAS_DROR (CPU)
++#define CPU_HAS_ROR(CPU) CPU_HAS_DROR (CPU) || CPU_IS_ALLEGREX (CPU)
+
+ /* True if mflo and mfhi can be immediately followed by instructions
+ which write to the HI and LO registers.
+@@ -393,6 +423,7 @@
+ || mips_opts.arch == CPU_R12000 \
+ || mips_opts.arch == CPU_RM7000 \
+ || mips_opts.arch == CPU_VR5500 \
++ || mips_opts.arch == CPU_ALLEGREX \
+ )
+
+ /* Whether the processor uses hardware interlocks to protect reads
+@@ -1142,6 +1173,8 @@
+ static expressionS imm_expr;
+ static expressionS imm2_expr;
+ static expressionS offset_expr;
++static expressionS vimm_expr[4];
++static expressionS voffset_expr[4];
+
+ /* Relocs associated with imm_expr and offset_expr. */
+
+@@ -1150,6 +1183,15 @@
+ static bfd_reloc_code_real_type offset_reloc[3]
+ = {BFD_RELOC_UNUSED, BFD_RELOC_UNUSED, BFD_RELOC_UNUSED};
+
++/* set by vfpu code for prefix instructions */
++
++static bfd_boolean vfpu_dprefix;
++static char vfpu_dprefix_str[64];
++static bfd_boolean vfpu_sprefix;
++static char vfpu_sprefix_str[64];
++static bfd_boolean vfpu_tprefix;
++static char vfpu_tprefix_str[64];
++
+ /* These are set by mips16_ip if an explicit extension is used. */
+
+ static bfd_boolean mips16_small, mips16_ext;
+@@ -1641,6 +1683,62 @@
+ return;
+ }
+
++ /* If we've generated operands for a VFPU prefix instruction then we need
++ to assemble and append the prefix instruction before emitting the
++ instruction it prefixes. Note that in mips_ip prefix operands do not
++ cause any side effects with imm_expr or offset_expr. If they did
++ we'd have to save and restore them here. */
++ if (CPU_IS_ALLEGREX (mips_opts.arch) && ((vfpu_dprefix || vfpu_sprefix || vfpu_tprefix)))
++ {
++
++ if (mips_opts.noreorder
++ && ( history[0].insn_mo->pinfo & (INSN_UNCOND_BRANCH_DELAY
++ | INSN_COND_BRANCH_DELAY
++ | INSN_COND_BRANCH_LIKELY)))
++ {
++ as_bad (_("instruction with prefix cannot be used in branch delay slot"));
++ }
++
++ if (vfpu_dprefix)
++ {
++ struct mips_cl_insn prefix;
++ bfd_reloc_code_real_type unused_reloc[3]
++ = {BFD_RELOC_UNUSED, BFD_RELOC_UNUSED, BFD_RELOC_UNUSED};
++ char buf[256];
++
++ sprintf (buf, "vpfxd %s", vfpu_dprefix_str);
++ mips_ip (buf, &prefix);
++ append_insn (&prefix, NULL, unused_reloc);
++ vfpu_dprefix = FALSE;
++ }
++
++ if (vfpu_sprefix)
++ {
++ struct mips_cl_insn prefix;
++ bfd_reloc_code_real_type unused_reloc[3]
++ = {BFD_RELOC_UNUSED, BFD_RELOC_UNUSED, BFD_RELOC_UNUSED};
++ char buf[256];
++
++ sprintf (buf, "vpfxs %s", vfpu_sprefix_str);
++ mips_ip (buf, &prefix);
++ append_insn ( &prefix, NULL, unused_reloc);
++ vfpu_sprefix = FALSE;
++ }
++
++ if (vfpu_tprefix)
++ {
++ struct mips_cl_insn prefix;
++ bfd_reloc_code_real_type unused_reloc[3]
++ = {BFD_RELOC_UNUSED, BFD_RELOC_UNUSED, BFD_RELOC_UNUSED};
++ char buf[256];
++
++ sprintf (buf, "vpfxt %s", vfpu_tprefix_str);
++ mips_ip (buf, &prefix);
++ append_insn (&prefix, NULL, unused_reloc);
++ vfpu_tprefix = FALSE;
++ }
++ }
++
+ if (insn.insn_mo->pinfo == INSN_MACRO)
+ {
+ macro_start ();
+@@ -3128,6 +3226,55 @@
+ insn.insn_opcode |= va_arg (args, unsigned long);
+ continue;
+
++ /* VFPU fields */
++ case '?':
++ switch (*fmt++)
++ {
++ case 'o':
++ *r = (bfd_reloc_code_real_type) va_arg (args, int);
++ assert (*r == BFD_RELOC_GPREL16
++ || *r == BFD_RELOC_MIPS_LITERAL
++ || *r == BFD_RELOC_MIPS_HIGHER
++ || *r == BFD_RELOC_HI16_S
++ || *r == BFD_RELOC_LO16
++ || *r == BFD_RELOC_MIPS_GOT16
++ || *r == BFD_RELOC_MIPS_CALL16
++ || *r == BFD_RELOC_MIPS_GOT_DISP
++ || *r == BFD_RELOC_MIPS_GOT_PAGE
++ || *r == BFD_RELOC_MIPS_GOT_OFST
++ || *r == BFD_RELOC_MIPS_GOT_LO16
++ || *r == BFD_RELOC_MIPS_CALL_LO16);
++ break;
++ case 'd':
++ insn.insn_opcode |= va_arg (args, int) << VF_SH_VD;
++ fmt += 2;
++ break;
++ case 's':
++ insn.insn_opcode |= va_arg (args, int) << VF_SH_VS;
++ fmt += 2;
++ break;
++ case 'm':
++ {
++ int vtreg = va_arg (args, int);
++ insn.insn_opcode |= (vtreg & VF_MASK_VML) << VF_SH_VML;
++ insn.insn_opcode |= ((vtreg >> 5) & VF_MASK_VMH) << VF_SH_VMH;
++ fmt += 2;
++ }
++ break;
++ case 'n':
++ {
++ int vtreg = va_arg (args, int);
++ insn.insn_opcode |= (vtreg & VF_MASK_VNL) << VF_SH_VNL;
++ insn.insn_opcode |= ((vtreg >> 5) & VF_MASK_VNH) << VF_SH_VNH;
++ fmt += 2;
++ }
++ break;
++ case 'e':
++ insn.insn_opcode |= va_arg (args, int) << VF_SH_MCOND;
++ break;
++ }
++ continue;
++
+ default:
+ internalError ();
+ }
+@@ -4103,6 +4250,7 @@
+ macro (struct mips_cl_insn *ip)
+ {
+ register int treg, sreg, dreg, breg;
++ int vsreg, vtreg, vdreg, vmreg, vwb;
+ int tempreg;
+ int mask;
+ int used_at = 0;
+@@ -4128,6 +4276,13 @@
+ sreg = breg = (ip->insn_opcode >> 21) & 0x1f;
+ mask = ip->insn_mo->mask;
+
++ vmreg = ((ip->insn_opcode >> 16) & 0x1f)
++ | ((ip->insn_opcode << 5) & 0x60);
++ vtreg = (ip->insn_opcode >> 16) & 0x7f;
++ vsreg = (ip->insn_opcode >> 8) & 0x7f;
++ vdreg = (ip->insn_opcode >> 0) & 0x7f;
++ vwb = (ip->insn_opcode >> 1) & 0x1;
++
+ expr1.X_op = O_constant;
+ expr1.X_op_symbol = NULL;
+ expr1.X_add_symbol = NULL;
+@@ -5654,6 +5809,26 @@
+ /* Itbl support may require additional care here. */
+ coproc = 1;
+ goto ld;
++ case M_LV_S_AB:
++ s = "lv.s";
++ /* Itbl support may require additional care here. */
++ coproc = 1;
++ goto ld;
++ case M_LV_Q_AB:
++ s = "lv.q";
++ /* Itbl support may require additional care here. */
++ coproc = 1;
++ goto ld;
++ case M_LVL_Q_AB:
++ s = "lvl.q";
++ /* Itbl support may require additional care here. */
++ coproc = 1;
++ goto ld;
++ case M_LVR_Q_AB:
++ s = "lvr.q";
++ /* Itbl support may require additional care here. */
++ coproc = 1;
++ goto ld;
+ case M_LWL_AB:
+ s = "lwl";
+ lr = 1;
+@@ -5738,6 +5913,29 @@
+ /* Itbl support may require additional care here. */
+ coproc = 1;
+ goto st;
++ case M_SV_S_AB:
++ s = "sv.s";
++ /* Itbl support may require additional care here. */
++ coproc = 1;
++ goto st;
++ case M_SV_Q_AB:
++ if (vwb)
++ s = "vwb.q";
++ else
++ s = "sv.q";
++ /* Itbl support may require additional care here. */
++ coproc = 1;
++ goto st;
++ case M_SVL_Q_AB:
++ s = "svl.q";
++ /* Itbl support may require additional care here. */
++ coproc = 1;
++ goto st;
++ case M_SVR_Q_AB:
++ s = "svr.q";
++ /* Itbl support may require additional care here. */
++ coproc = 1;
++ goto st;
+ case M_SWL_AB:
+ s = "swl";
+ goto st;
+@@ -5787,6 +5985,22 @@
+ || mask == M_L_DAB
+ || mask == M_S_DAB)
+ fmt = "T,o(b)";
++ else if (mask == M_LV_S_AB
++ || mask == M_SV_S_AB)
++ {
++ fmt = "?m0x,?o(b)";
++ treg = vmreg;
++ }
++ else if (mask == M_LV_Q_AB
++ || mask == M_SV_Q_AB
++ || mask == M_LVL_Q_AB
++ || mask == M_LVR_Q_AB
++ || mask == M_SVL_Q_AB
++ || mask == M_SVR_Q_AB)
++ {
++ fmt = "?n3x,?o(b)";
++ treg = vmreg;
++ }
+ else if (coproc)
+ fmt = "E,o(b)";
+ else
+@@ -6150,6 +6364,138 @@
+ break;
+ }
+
++ case M_LVI_S_SS:
++ case M_LVI_P_SS:
++ case M_LVI_T_SS:
++ case M_LVI_Q_SS:
++ {
++ int mtx = (vtreg >> VF_SH_MR_MTX) & VF_MASK_MR_MTX;
++ int idx = (vtreg >> VF_SH_MR_IDX) & VF_MASK_MR_IDX;
++ int fsl = 0;
++ int rxc = 0;
++ int vtreg_s = 0;
++ int vnum = 0;
++ int vat = 0;
++ int i;
++
++ switch (mask)
++ {
++ case M_LVI_S_SS:
++ vnum = 1;
++ fsl = (vtreg >> VF_SH_MR_FSL) & VF_MASK_MR_FSL;
++ rxc = 0;
++ break;
++ case M_LVI_P_SS:
++ vnum = 2;
++ fsl = ((vtreg >> VF_SH_MR_VFSL) & VF_MASK_MR_VFSL) << 1;
++ rxc = (vtreg >> VF_SH_MR_RXC) & VF_MASK_MR_RXC;
++ break;
++ case M_LVI_T_SS:
++ vnum = 3;
++ fsl = (vtreg >> VF_SH_MR_VFSL) & VF_MASK_MR_VFSL;
++ rxc = (vtreg >> VF_SH_MR_RXC) & VF_MASK_MR_RXC;
++ break;
++ case M_LVI_Q_SS:
++ vnum = 4;
++ fsl = 0;
++ rxc = (vtreg >> VF_SH_MR_RXC) & VF_MASK_MR_RXC;
++ break;
++ }
++ if (rxc)
++ vtreg_s = (mtx << VF_SH_MR_MTX) | (idx << VF_SH_MR_FSL)
++ | (fsl << VF_SH_MR_IDX);
++ else
++ vtreg_s = (mtx << VF_SH_MR_MTX) | (idx << VF_SH_MR_IDX)
++ | (fsl << VF_SH_MR_FSL);
++
++ for (i = 0; i < vnum; i++) {
++ imm_expr = vimm_expr[i];
++ offset_expr = voffset_expr[i];
++
++ if (imm_expr.X_op == O_constant)
++ {
++ load_register (AT, &imm_expr, 0);
++ macro_build ((expressionS *) NULL,
++ "mtv", "t,?d0z", AT, vtreg_s);
++ vat = 1;
++ }
++ else
++ {
++ assert (offset_expr.X_op == O_symbol
++ && strcmp (segment_name (S_GET_SEGMENT
++ (offset_expr.X_add_symbol)),
++ ".lit4") == 0
++ && offset_expr.X_add_number == 0);
++ macro_build (&offset_expr,
++ "lv.s", "?m0x,?o(b)", vtreg_s,
++ (int) BFD_RELOC_MIPS_LITERAL, mips_gp_register);
++ }
++
++ if (rxc)
++ vtreg_s += (1 << VF_SH_MR_IDX);
++ else
++ vtreg_s += (1 << VF_SH_MR_FSL);
++ }
++
++ if (vat)
++ break;
++ else
++ return;
++ }
++
++ case M_LVHI_S_SS:
++ case M_LVHI_P_SS:
++ {
++ int mtx = (vtreg >> VF_SH_MR_MTX) & VF_MASK_MR_MTX;
++ int idx = (vtreg >> VF_SH_MR_IDX) & VF_MASK_MR_IDX;
++ int fsl = 0;
++ int rxc = 0;
++ int vtreg_s = 0;
++ int vnum = 0;
++ int i;
++ unsigned int f16v;
++ char f16v_str[16];
++
++ switch (mask)
++ {
++ case M_LVHI_S_SS:
++ vnum = 2;
++ fsl = (vtreg >> VF_SH_MR_FSL) & VF_MASK_MR_FSL;
++ rxc = 0;
++ break;
++ case M_LVHI_P_SS:
++ vnum = 4;
++ fsl = ((vtreg >> VF_SH_MR_VFSL) & VF_MASK_MR_VFSL) << 1;
++ rxc = (vtreg >> VF_SH_MR_RXC) & VF_MASK_MR_RXC;
++ break;
++ }
++ if (rxc)
++ vtreg_s = (mtx << VF_SH_MR_MTX) | (idx << VF_SH_MR_FSL)
++ | (fsl << VF_SH_MR_IDX);
++ else
++ vtreg_s = (mtx << VF_SH_MR_MTX) | (idx << VF_SH_MR_IDX)
++ | (fsl << VF_SH_MR_FSL);
++
++
++ for (i = 0; i < vnum; i += 2) {
++ f16v = ((vimm_expr[i + 1].X_add_number & 0xffff) << 16)
++ | (vimm_expr[i].X_add_number & 0xffff);
++ sprintf(f16v_str, "0x%08x", f16v);
++ my_getExpression (&imm_expr, f16v_str);
++
++ load_register (AT, &imm_expr, 0);
++ macro_build ((expressionS *) NULL,
++ "mtv", "t,?d0z", AT, vtreg_s);
++
++ if (rxc)
++ vtreg_s += (1 << VF_SH_MR_IDX);
++ else
++ vtreg_s += (1 << VF_SH_MR_FSL);
++ }
++
++ break;
++ }
++
+ case M_LI_D:
+ /* Check if we have a constant in IMM_EXPR. If the GPRs are 64 bits
+ wide, IMM_EXPR is the entire value. Otherwise IMM_EXPR is the high
+@@ -6672,6 +7018,27 @@
+ move_register (dreg, sreg);
+ break;
+
++ case M_VCMOV_S:
++ s = "vcmovt.s";
++ fmt = "?d0d,?s0s,?e";
++ goto vcmov;
++ case M_VCMOV_P:
++ s = "vcmovt.p";
++ fmt = "?d1d,?s1s,?e";
++ goto vcmov;
++ case M_VCMOV_T:
++ s = "vcmovt.t";
++ fmt = "?d2d,?s2s,?e";
++ goto vcmov;
++ case M_VCMOV_Q:
++ s = "vcmovt.q";
++ fmt = "?d3d,?s3s,?e";
++ vcmov:
++ macro_build ((expressionS *) NULL, s, fmt,
++ vdreg, vsreg,
++ (ip->insn_opcode >> VF_SH_MCOND) & VF_MASK_MCOND);
++ return;
++
+ #ifdef LOSING_COMPILER
+ default:
+ /* Try and see if this is a new itbl instruction.
+@@ -7348,6 +7715,39 @@
+ move_register (treg, tempreg);
+ break;
+
++ case M_ULV_S:
++ if (mips_opts.arch == CPU_ALLEGREX)
++ as_bad (_("opcode not supported on this processor"));
++ off = 3;
++ if (offset_expr.X_add_number >= 0x8000 - off)
++ as_bad (_("operand overflow"));
++ if (! target_big_endian)
++ offset_expr.X_add_number += off;
++ macro_build (&offset_expr, "lwl", "t,o(b)",
++ AT, (int) BFD_RELOC_LO16, breg);
++ if (! target_big_endian)
++ offset_expr.X_add_number -= off;
++ else
++ offset_expr.X_add_number += off;
++ macro_build (&offset_expr, "lwr", "t,o(b)",
++ AT, (int) BFD_RELOC_LO16, breg);
++
++ macro_build ((expressionS *) NULL, "mtv", "t,?d0z",
++ AT, vmreg);
++ break;
++
++ case M_ULV_Q:
++ off = 12;
++ if (offset_expr.X_add_number >= 0x8000 - off)
++ as_bad (_("operand overflow"));
++ offset_expr.X_add_number += off;
++ macro_build (&offset_expr, "lvl.q", "?n3x,?o(b)",
++ vmreg, (int) BFD_RELOC_LO16, breg);
++ offset_expr.X_add_number -= off;
++ macro_build (&offset_expr, "lvr.q", "?n3x,?o(b)",
++ vmreg, (int) BFD_RELOC_LO16, breg);
++ return;
++
+ case M_ULD_A:
+ s = "ldl";
+ s2 = "ldr";
+@@ -7430,6 +7830,55 @@
+ macro_build (&offset_expr, s2, "t,o(b)", treg, BFD_RELOC_LO16, breg);
+ break;
+
++ case M_USV_S:
++ off = 3;
++ if (offset_expr.X_add_number >= 0x8000 - off)
++ as_bad (_("operand overflow"));
++ macro_build ((expressionS *) NULL, "mfv", "t,?d0z",
++ AT, vmreg);
++ if (mips_opts.arch != CPU_ALLEGREX)
++ {
++ if (! target_big_endian)
++ offset_expr.X_add_number += off;
++ macro_build (&offset_expr, "swl", "t,o(b)",
++ AT, (int) BFD_RELOC_LO16, breg);
++ if (! target_big_endian)
++ offset_expr.X_add_number -= off;
++ else
++ offset_expr.X_add_number += off;
++ macro_build (&offset_expr, "swr", "t,o(b)",
++ AT, (int) BFD_RELOC_LO16, breg);
++ }
++ else
++ {
++ if (target_big_endian)
++ offset_expr.X_add_number += off;
++ while (off-- >= 0)
++ {
++ macro_build (&offset_expr, "sb", "t,o(b)",
++ AT, (int) BFD_RELOC_LO16, breg);
++ macro_build ((expressionS *) NULL, "ror",
++ "d,w,<", AT, AT, 8);
++ if (target_big_endian)
++ --offset_expr.X_add_number;
++ else
++ ++offset_expr.X_add_number;
++ }
++ }
++ break;
++
++ case M_USV_Q:
++ off = 12;
++ if (offset_expr.X_add_number >= 0x8000 - off)
++ as_bad (_("operand overflow"));
++ offset_expr.X_add_number += off;
++ macro_build (&offset_expr, "svl.q", "?n3x,?o(b)",
++ vmreg, (int) BFD_RELOC_LO16, breg);
++ offset_expr.X_add_number -= off;
++ macro_build (&offset_expr, "svr.q", "?n3x,?o(b)",
++ vmreg, (int) BFD_RELOC_LO16, breg);
++ return;
++
+ case M_USD_A:
+ s = "sdl";
+ s2 = "sdr";
+@@ -7817,6 +8266,103 @@
+ case '%': USE_BITS (OP_MASK_VECALIGN, OP_SH_VECALIGN); break;
+ case '[': break;
+ case ']': break;
++
++ /* VFPU fields */
++ case '?':
++ switch (c = *p++)
++ {
++ case '[': break;
++ case ']': break;
++ case 'y':
++ {
++ if ((*p != '0') && (*p != '1') && (*p != '2') && (*p != '3'))
++ {
++ as_bad (_("internal: bad mips opcode : %s %s"),
++ opc->name, opc->args);
++ return 0;
++ }
++ p++;
++ }
++ break;
++
++ case 'o': USE_BITS (VF_MASK_OFFSET, VF_SH_OFFSET); break;
++
++ case 's':
++ case 't':
++ case 'd':
++ case 'v':
++ case 'x':
++ case 'm':
++ case 'n':
++ {
++ if ((*p != '0') && (*p != '1') && (*p != '2') && (*p != '3')
++ && (*p != '5') && (*p != '6') && (*p != '7'))
++ {
++ as_bad (_("internal: bad mips opcode (vreg type `?%c'): %s %s"),
++ *p, opc->name, opc->args);
++ return 0;
++ }
++ p++;
++
++ if ((*p != 's') && (*p != 't') && (*p != 'd')
++ && (*p != 'y') && (*p != 'x') && (*p != 'z')
++ && (*p != 'w') && (*p != 'm'))
++ {
++ as_bad (_("internal: bad mips opcode (vreg type `?%c'): %s %s"),
++ *(p - 1), opc->name, opc->args);
++ }
++ p++;
++
++ switch (c)
++ {
++ case 's': USE_BITS (VF_MASK_VS, VF_SH_VS); break;
++ case 't': USE_BITS (VF_MASK_VT, VF_SH_VT); break;
++ case 'd':
++ case 'v':
++ case 'x': USE_BITS (VF_MASK_VD, VF_SH_VD); break;
++ case 'm': USE_BITS (VF_MASK_VML, VF_SH_VML);
++ USE_BITS (VF_MASK_VMH, VF_SH_VMH); break;
++ case 'n': USE_BITS (VF_MASK_VNL, VF_SH_VNL);
++ USE_BITS (VF_MASK_VNH, VF_SH_VNH); break;
++ }
++ }
++ break;
++
++ case 'f': USE_BITS (VF_MASK_CC, VF_SH_CC);
++ p++; break;
++
++ case 'a': USE_BITS (VF_MASK_CONST, VF_SH_CONST); break;
++ case 'b': USE_BITS (VF_MASK_SCALE, VF_SH_SCALE); break;
++ case 'c': USE_BITS (VF_MASK_BCOND, VF_SH_BCOND); break;
++ case 'e': USE_BITS (VF_MASK_MCOND, VF_SH_MCOND); break;
++
++ case 'i': USE_BITS (VF_MASK_WRAP, VF_SH_WRAP); break;
++
++ case 'q': USE_BITS (VF_MASK_VCD, VF_SH_VCD); break;
++ case 'r': USE_BITS (VF_MASK_VCS, VF_SH_VCS); break;
++
++ case 'u': USE_BITS (VF_MASK_HFLOAT, VF_SH_HFLOAT); break;
++
++ case 'w': USE_BITS (VF_MASK_ROT, VF_SH_ROT); break;
++ case 'z': USE_BITS (VF_MASK_RWB, VF_SH_RWB); break;
++
++ case '0': USE_BITS (VF_MASK_PFX, VF_SH_PFX); break;
++ case '1': USE_BITS (VF_MASK_PFX, VF_SH_PFX); break;
++ case '2': USE_BITS (VF_MASK_PFX, VF_SH_PFX); break;
++ case '3': USE_BITS (VF_MASK_PFX, VF_SH_PFX); break;
++ case '4': USE_BITS (VF_MASK_PFX, VF_SH_PFX); break;
++ case '5': USE_BITS (VF_MASK_PFX, VF_SH_PFX); break;
++ case '6': USE_BITS (VF_MASK_PFX, VF_SH_PFX); break;
++ case '7': USE_BITS (VF_MASK_PFX, VF_SH_PFX); break;
++
++ default:
++ as_bad (_("internal: bad mips opcode (unknown extension operand type `?%c'): %s %s"),
++ c, opc->name, opc->args);
++ return 0;
++
++ }
++ break;
++
+ default:
+ as_bad (_("internal: bad mips opcode (unknown operand type `%c'): %s %s"),
+ c, opc->name, opc->args);
+@@ -7845,12 +8391,15 @@
+ char c = 0;
+ struct mips_opcode *insn;
+ char *argsStart;
+- unsigned int regno;
++ unsigned int regno = 0;
+ unsigned int lastregno = 0;
+ unsigned int lastpos = 0;
+ unsigned int limlo, limhi;
+ char *s_reset;
+ char save_c = 0;
++ unsigned int vdregno = 0xffff;
++ char vdregt = 0;
++ char vdregl = 0;
+
+ insn_error = NULL;
+
+@@ -8238,26 +8787,1171 @@
+ s = expr_end;
+ continue;
+
+- case 'b': /* base register */
+- case 'd': /* destination register */
+- case 's': /* source register */
+- case 't': /* target register */
+- case 'r': /* both target and source */
+- case 'v': /* both dest and source */
+- case 'w': /* both dest and target */
+- case 'E': /* coprocessor target register */
+- case 'G': /* coprocessor destination register */
+- case 'K': /* 'rdhwr' destination register */
+- case 'x': /* ignore register name */
+- case 'z': /* must be zero register */
+- case 'U': /* destination register (clo/clz). */
+- s_reset = s;
+- if (s[0] == '$')
++ /* VFPU fields */
++ case '?':
++ switch (*++args)
+ {
++ case '[':
++ case ']':
++ if (*s++ == *args)
++ continue;
++ break;
+
+- if (ISDIGIT (s[1]))
+- {
+- ++s;
++ case 'y': /* immediate separator */
++ ++args;
++ vimm_expr[*args - '0'] = imm_expr;
++ voffset_expr[*args - '0'] = offset_expr;
++
++ imm_expr.X_op = O_absent;
++ offset_expr.X_op = O_absent;
++ imm_reloc[0] = BFD_RELOC_UNUSED;
++ imm_reloc[1] = BFD_RELOC_UNUSED;
++ imm_reloc[2] = BFD_RELOC_UNUSED;
++ offset_reloc[0] = BFD_RELOC_UNUSED;
++ offset_reloc[1] = BFD_RELOC_UNUSED;
++ offset_reloc[2] = BFD_RELOC_UNUSED;
++
++ continue;
++
++ case 'o': /* 16 bit offset */
++ /* Check whether there is only a single bracketed expression
++ left. If so, it must be the base register and the
++ constant must be zero. */
++ if (*s == '(' && strchr (s + 1, '(') == 0)
++ {
++ offset_expr.X_op = O_constant;
++ offset_expr.X_add_number = 0;
++ continue;
++ }
++
++ /* If this value won't fit into a 16 bit offset, then go
++ find a macro that will generate the 32 bit offset
++ code pattern. */
++ if (my_getSmallExpression (&offset_expr, offset_reloc, s) == 0
++ && (offset_expr.X_op != O_constant
++ || offset_expr.X_add_number >= 0x8000
++ || offset_expr.X_add_number < -0x8000))
++ break;
++
++ s = expr_end;
++ continue;
++
++ case 's': /* VFPU source register */
++ case 't': /* VFPU target register */
++ case 'd': /* VFPU destination register */
++ case 'v': /* VFPU destination register */
++ case 'x': /* VFPU destination register */
++ case 'm': /* VFPU target regsiter (load/store) */
++ case 'n': /* VFPU target regsiter (load/store) */
++ {
++ int dtype_err = 0;
++ int dnum_err = 0;
++ int dlen = 0;
++ char dtype = s[0];
++ char regtype = *(args + 1);
++
++ int mtx = 0;
++ int idx = 0;
++ int rxc = 0;
++ int fsl = 0;
++ int vidx = 0;
++ int vfsl = 0;
++
++ if (ISDIGIT (s[1]))
++ {
++ int num = 0;
++ s++;
++ do
++ {
++ num *= 10;
++ num += *s - '0';
++ dlen++;
++ s++;
++ }
++ while (ISDIGIT (*s));
++
++ if ((s[0] == '.')
++ && (s[1] == 's' || s[1] == 'p'
++ || s[1] == 't' || s[1] == 'q'))
++ s += 2;
++
++ if (ISUPPER(dtype))
++ dtype -= 'A' - 'a';
++
++ if (dtype == '$')
++ {
++ regno = num;
++ if (regno > VF_MAX_MR)
++ as_bad (_("Invalid VFPU register number (%d)"),
++ regno);
++
++ idx = (num >> VF_SH_MR_IDX) & VF_MASK_MR_IDX;
++ vfsl = (num >> VF_SH_MR_VFSL) & VF_MASK_MR_VFSL;
++ switch (regtype)
++ {
++ case '0': /* single word */
++ break;
++ case '1': /* pare word */
++ dnum_err = (vfsl & 0x1);
++ break;
++ case '2': /* triple word */
++ dnum_err = (vfsl > 1);
++ break;
++ case '3': /* quad word */
++ dnum_err = (vfsl > 0);
++ break;
++ case '5': /* 2x2 word */
++ dnum_err = (vfsl & 0x1) || (idx & 0x1);
++ break;
++ case '6': /* 3x3 word */
++ dnum_err = (vfsl > 1) || (idx > 1);
++ break;
++ case '7': /* 4x4 word */
++ dnum_err = (vfsl > 0) || (idx > 0);
++ break;
++ }
++
++ if (dnum_err)
++ as_bad (_("Improper VFPU register number (%d)"),
++ regno);
++
++ }
++ else if ((dlen == 3)
++ && ((dtype == 's')
++ || (dtype == 'c') || (dtype == 'r')
++ || (dtype == 'm') || (dtype == 'e')))
++ {
++ mtx = num / 100;
++ if ((dtype == 'r') || (dtype == 'e'))
++ {
++ vfsl = (num / 10) % 10;
++ vidx = num % 10;
++ rxc = 1;
++ }
++ else
++ {
++ vidx = (num / 10) % 10;
++ vfsl = num % 10;
++ rxc = 0;
++ }
++
++ switch (regtype)
++ {
++ case '0': /* single word */
++ idx = vidx;
++ fsl = vfsl;
++ dtype_err = (dtype != 's');
++ break;
++ case '1': /* pare word */
++ idx = vidx;
++ fsl = (vfsl & 0x2) | rxc;
++ dnum_err = (vfsl & 0x1);
++ dtype_err = (dtype != 'c') && (dtype != 'r');
++ break;
++ case '2': /* triple word */
++ idx = vidx;
++ fsl = ((vfsl & 0x1) << 1) | rxc;
++ dnum_err = (vfsl > 1);
++ dtype_err = (dtype != 'c') && (dtype != 'r');
++ break;
++ case '3': /* quad word */
++ idx = vidx;
++ fsl = rxc;
++ dnum_err = (vfsl > 0);
++ dtype_err = (dtype != 'c') && (dtype != 'r');
++ break;
++ case '5': /* 2x2 word */
++ idx = vidx & 0x2;
++ fsl = (vfsl & 0x2) | rxc;
++ dnum_err = (vfsl & 0x1) || (vidx & 0x1);
++ dtype_err = (dtype != 'm') && (dtype != 'e');
++ break;
++ case '6': /* 3x3 word */
++ idx = vidx & 0x1;
++ fsl = ((vfsl & 0x1) << 1) | rxc;
++ dnum_err = (vfsl > 1) || (vidx > 1);
++ dtype_err = (dtype != 'm') && (dtype != 'e');
++ break;
++ case '7': /* 4x4 word */
++ idx = 0;
++ fsl = rxc;
++ dnum_err = (vfsl > 0) || (vidx > 0);
++ dtype_err = (dtype != 'm') && (dtype != 'e');
++ break;
++ }
++
++ if (dtype_err)
++ as_bad (_("Improper VFPU register prefix '%c'"),
++ dtype);
++ if (dnum_err)
++ as_bad (_("Improper VFPU register number (%03d)"),
++ num);
++
++ if (mtx > VF_MAX_MR_MTX)
++ as_bad (_("VFPU matrix range over %d"), mtx);
++ if (vidx > VF_MAX_MR_IDX)
++ as_bad (_("VFPU index range over %d"), idx);
++ if (vfsl > VF_MAX_MR_FSL)
++ as_bad (_("VFPU field select range over %d"), fsl);
++
++ regno = ((fsl & VF_MASK_MR_FSL) << VF_SH_MR_FSL)
++ | ((mtx & VF_MASK_MR_MTX) << VF_SH_MR_MTX)
++ | ((idx & VF_MASK_MR_IDX) << VF_SH_MR_IDX);
++ }
++ else
++ {
++ as_bad (_("Improper VFPU register prefix '%c'"),
++ dtype);
++ }
++ }
++ else
++ {
++ as_bad (_("bad operand %s"), s);
++ }
++
++ if ((*args == 'v') || (*args == 'x'))
++ {
++ vdregno = regno;
++ vdregt = regtype;
++ vdregl = (*args == 'v');
++ }
++ else if (vdregno <= VF_MAX_MR)
++ {
++ static unsigned short used_vreg[8][16] = {
++ { 0x0001, 0x0010, 0x0100, 0x1000,
++ 0x0002, 0x0020, 0x0200, 0x2000,
++ 0x0004, 0x0040, 0x0400, 0x4000,
++ 0x0008, 0x0080, 0x0800, 0x8000 },
++ { 0x0003, 0x0030, 0x0300, 0x3000,
++ 0x0011, 0x0022, 0x0044, 0x0088,
++ 0x000c, 0x00c0, 0x0c00, 0xc000,
++ 0x1100, 0x2200, 0x4400, 0x8800 },
++ { 0x0007, 0x0070, 0x0700, 0x7000,
++ 0x0111, 0x0222, 0x0444, 0x0888,
++ 0x000e, 0x00e0, 0x0e00, 0xe000,
++ 0x1110, 0x2220, 0x4440, 0x8880 },
++ { 0x000f, 0x00f0, 0x0f00, 0xf000,
++ 0x1111, 0x2222, 0x4444, 0x8888,
++ 0x000f, 0x00f0, 0x0f00, 0xf000,
++ 0x1111, 0x2222, 0x4444, 0x8888 },
++ { 0x0000, 0x0000, 0x0000, 0x0000,
++ 0x0000, 0x0000, 0x0000, 0x0000,
++ 0x0000, 0x0000, 0x0000, 0x0000,
++ 0x0000, 0x0000, 0x0000, 0x0000 },
++ { 0x0033, 0x0033, 0x3300, 0x3300,
++ 0x0033, 0x0033, 0x00cc, 0x00cc,
++ 0x00cc, 0x00cc, 0xcc00, 0xcc00,
++ 0x3300, 0x3300, 0xcc00, 0xcc00 },
++ { 0x0777, 0x7770, 0x0777, 0x7770,
++ 0x0777, 0x0eee, 0x0777, 0x0eee,
++ 0x0eee, 0xeee0, 0x0eee, 0xeee0,
++ 0x7770, 0xeee0, 0x7770, 0xeee0 },
++ { 0xffff, 0xffff, 0xffff, 0xffff,
++ 0xffff, 0xffff, 0xffff, 0xffff,
++ 0xffff, 0xffff, 0xffff, 0xffff,
++ 0xffff, 0xffff, 0xffff, 0xffff },
++ };
++ int dmtx, smtx;
++ int dfsl, sfsl;
++ int didx, sidx;
++ int drxc, srxc;
++
++ dmtx = (vdregno >> VF_SH_MR_MTX) & VF_MASK_MR_MTX;
++ smtx = (regno >> VF_SH_MR_MTX) & VF_MASK_MR_MTX;
++
++ if (dmtx == smtx)
++ {
++ unsigned short dused, sused;
++ int dtype, stype;
++
++ dfsl = (vdregno >> VF_SH_MR_FSL) & VF_MASK_MR_FSL;
++ didx = (vdregno >> VF_SH_MR_IDX) & VF_MASK_MR_IDX;
++ drxc = (vdregno >> VF_SH_MR_RXC) & VF_MASK_MR_RXC;
++ sfsl = (regno >> VF_SH_MR_FSL) & VF_MASK_MR_FSL;
++ sidx = (regno >> VF_SH_MR_IDX) & VF_MASK_MR_IDX;
++ srxc = (regno >> VF_SH_MR_RXC) & VF_MASK_MR_RXC;
++
++ dtype = vdregt - '0';
++ stype = regtype - '0';
++ dused = used_vreg[dtype][(dfsl << 2) + didx];
++ sused = used_vreg[stype][(sfsl << 2) + sidx];
++
++ if ((dused & sused)
++ && (vdregl || (dused ^ sused) || (drxc != srxc)))
++ {
++ int dvfsl;
++ dvfsl = (vdregno >> VF_SH_MR_VFSL) & VF_MASK_MR_VFSL;
++ switch (vdregt)
++ {
++ case '1':
++ dvfsl <<= 1;
++ case '2':
++ case '3':
++ if (drxc)
++ as_bad (_("VFPU register conflict(R%d%d%d)"),
++ dmtx, dvfsl, didx);
++ else
++ as_bad (_("VFPU register conflict(C%d%d%d)"),
++ dmtx, didx, dvfsl);
++ break;
++ case '5':
++ dvfsl <<= 1;
++ case '6':
++ case '7':
++ if (drxc)
++ as_bad (_("VFPU register conflict(E%d%d%d)"),
++ dmtx, dvfsl, didx);
++ else
++ as_bad (_("VFPU register conflict(M%d%d%d)"),
++ dmtx, didx, dvfsl);
++ break;
++ }
++ }
++ }
++ }
++
++ switch (*args++)
++ {
++ case 's':
++ if (
++ (ip->insn_opcode
++ & VFPU_MASK_RPT_MMUL) == VFPU_INST_RPT_MMUL)
++ {
++ if (regno & (VF_MASK_MR_RXC << VF_SH_MR_RXC))
++ regno &= ~(VF_MASK_MR_RXC << VF_SH_MR_RXC);
++ else
++ regno |= (VF_MASK_MR_RXC << VF_SH_MR_RXC);
++ }
++ ip->insn_opcode |= (regno & VF_MASK_VS) << VF_SH_VS;
++ break;
++ case 't':
++ ip->insn_opcode |= (regno & VF_MASK_VT) << VF_SH_VT;
++ break;
++ case 'd':
++ case 'v':
++ case 'x':
++ ip->insn_opcode |= (regno & VF_MASK_VD) << VF_SH_VD;
++ break;
++ case 'm':
++ {
++ int vmregL = (regno >> 0) & VF_MASK_VML;
++ int vmregH = (regno >> 5) & VF_MASK_VMH;
++ ip->insn_opcode |= (vmregL << VF_SH_VML)
++ | (vmregH << VF_SH_VMH);
++ }
++ break;
++ case 'n':
++ {
++ int vmregL = (regno >> 0) & VF_MASK_VNL;
++ int vmregH = (regno >> 5) & VF_MASK_VNH;
++ ip->insn_opcode |= (vmregL << VF_SH_VNL)
++ | (vmregH << VF_SH_VNH);
++ }
++ break;
++ }
++ args++;
++
++ /* now check for vfpu prefixes if necessary */
++ if (*s == '[')
++ {
++ char *prefix_out = NULL;
++ bfd_boolean *prefix_bool = NULL;
++ char *prefix_type = NULL;
++ int num_args = 0;
++ char *ob = ++s;
++ bfd_boolean has_w = FALSE;
++ bfd_boolean has_z = FALSE;
++ bfd_boolean has_y = FALSE;
++ bfd_boolean has_operator = FALSE;
++ bfd_boolean has_saturater = FALSE;
++
++ switch (*args)
++ {
++ case 'w': /* only swizzle */
++ case 's': /* source prefix */
++ prefix_bool = &vfpu_sprefix;
++ prefix_out = vfpu_sprefix_str;
++ prefix_type = "source";
++ break;
++ case 't': /* target prefix */
++ prefix_bool = &vfpu_tprefix;
++ prefix_out = vfpu_tprefix_str;
++ prefix_type = "target";
++ break;
++ case 'm': /* only write mask */
++ case 'd': /* destination prefix */
++ prefix_bool = &vfpu_dprefix;
++ prefix_out = vfpu_dprefix_str;
++ prefix_type = "destination";
++ break;
++ case 'y': /* inhibit */
++ prefix_bool = NULL;
++ prefix_type = "source";
++ break;
++ case 'x': /* inhibit */
++ prefix_bool = NULL;
++ prefix_type = "target";
++ break;
++ case 'z': /* inhibit */
++ prefix_bool = NULL;
++ prefix_type = "destination";
++ break;
++ }
++
++ for ( ; *s != '\0' && *s != ']'; s++)
++ {
++ switch (*s)
++ {
++ case ',':
++ /* count no. of params for syntax check */
++ num_args++;
++ break;
++ case ' ':
++ case '\t':
++ break;
++ case 'm':
++ case 'M':
++ case 'x':
++ case 'X':
++ break;
++ case 'y':
++ case 'Y':
++ has_y = TRUE;
++ break;
++ case 'z':
++ case 'Z':
++ has_z = TRUE;
++ break;
++ case 'w':
++ case 'W':
++ has_w = TRUE;
++ break;
++ default:
++ if (*args == 'w')
++ has_operator = TRUE;
++ if (*args == 'm')
++ has_saturater = TRUE;
++ }
++ }
++
++ if (*s == ']')
++ {
++ if (prefix_bool)
++ {
++ *prefix_bool = TRUE;
++ strncpy (prefix_out, ob, s - ob);
++ prefix_out[s - ob] = '\0';
++ s++;
++ }
++ else
++ {
++ as_bad (_("%s cannot use %s prefix"),
++ insn->name, prefix_type);
++ s++;
++ continue;
++ }
++ }
++ else
++ {
++ as_bad (_("parse error (%s)"), ob - 1);
++ return;
++ }
++
++ if (num_args != regtype - '0')
++ {
++ as_bad (_("%s prefix specification requires %d parameters - [%s]"),
++ prefix_type, regtype - '0' + 1,
++ prefix_out);
++ }
++ else
++ {
++ int i = 8 - ((3 - num_args) * 2);
++ char dummy_d[] = " m,m,m,m";
++ char dummy_st[] = " x,y,z,w";
++
++ if (*args == 'd' || *args == 'm')
++ {
++ strcat (prefix_out, dummy_d + i);
++ if (has_saturater)
++ {
++ as_bad (_("%s is restricted to mask destination prefixes only"),
++ insn->name);
++ }
++ }
++ else
++ {
++ strcat (prefix_out, dummy_st + i);
++ if (has_operator)
++ {
++ as_bad (_("%s is restricted to swizzle %s prefixes only"),
++ insn->name, prefix_type);
++ }
++ /* semantic check, w can't be specified for
++ s, p, or t instructions same goes for
++ z for p and s, and y for scalars */
++ if ((has_y && num_args == 0)
++ || (has_z && num_args < 2)
++ || (has_w && num_args < 3))
++ {
++ as_bad (_("%s swizzle operand is out of range in [%s]"),
++ prefix_type, prefix_out);
++ }
++ }
++ }
++ }
++
++ continue;
++ }
++ break;
++
++ case 'q': /* VFPU destination control register */
++ case 'r': /* VFPU source control register */
++ {
++ if ((s[0] == '$') && ISDIGIT (s[1]))
++ {
++ s++;
++ regno = 0;
++ do
++ {
++ regno *= 10;
++ regno += *s - '0';
++ ++s;
++ }
++ while (ISDIGIT (*s));
++
++ if ((regno < VF_MIN_CR) || (regno > VF_MAX_CR))
++ as_bad (_("Invalid VFPU control register number (%d)"),
++ regno);
++
++ else if (!((regno >= VF_MIN_VCR) && (regno <= VF_MAX_VCR)))
++ as_bad (_("Improper VFPU control register number (%d)"),
++ regno);
++
++ switch (*args)
++ {
++ case 'q':
++ ip->insn_opcode |= (regno & VF_MASK_VCD) << VF_SH_VCD;
++ break;
++ case 'r':
++ ip->insn_opcode |= (regno & VF_MASK_VCS) << VF_SH_VCS;
++ break;
++ }
++ }
++ else
++ {
++ as_bad (_("Invalid VFPU control register name (%s)"), s);
++ }
++
++ continue;
++ }
++ break;
++
++ case 'f': /* condition code */
++ {
++ int cond = 0;
++ if (ISDIGIT (s[0]))
++ {
++ my_getExpression (&imm_expr, s);
++ check_absolute_expr (ip, &imm_expr);
++ cond = imm_expr.X_add_number;
++ if ((cond < VF_MIN_CC) || (cond > VF_MAX_CC))
++ as_bad (_("Invalid VFPU condition code (%d)"), cond);
++ imm_expr.X_op = O_absent;
++ s = expr_end;
++ }
++ else
++ {
++ static const char * const vfpu_cond_names[] = {
++ "FL", "EQ", "LT", "LE",
++ "TR", "NE", "GE", "GT",
++ "EZ", "EN", "EI", "ES",
++ "NZ", "NN", "NI", "NS" };
++ for (cond = VF_MIN_CC; cond <= VF_MAX_CC; cond++)
++ {
++ if (strncasecmp(vfpu_cond_names[cond], s, 2) == 0)
++ break;
++ }
++ if ((cond < VF_MIN_CC) || (cond > VF_MAX_CC))
++ as_bad (_("Invalid VFPU condition code (%s)"), s);
++
++ s += 2;
++ }
++
++ args++;
++ if ((cond == 0) || (cond == 4))
++ {
++ }
++ else if (cond & 0x8)
++ {
++ if (*args - '0' < 1)
++ as_bad (_("Invalid VFPU condition oparetion"));
++ }
++ else
++ {
++ if (*args - '0' < 2)
++ as_bad (_("Invalid VFPU condition oparetion"));
++ }
++
++ ip->insn_opcode |= (cond & VF_MASK_CC) << VF_SH_CC;
++ continue;
++ }
++ break;
++
++ case 'a': /* constant code */
++ {
++ int cst = 0;
++ if (ISDIGIT (s[0]))
++ {
++ my_getExpression (&imm_expr, s);
++ check_absolute_expr (ip, &imm_expr);
++ cst = imm_expr.X_add_number;
++ if ((cst < VF_MIN_CONST) || (cst > VF_MAX_CONST))
++ {
++ as_bad (_("Improper constant code (%d)"), cst);
++ cst &= VF_MASK_CONST;
++ }
++ imm_expr.X_op = O_absent;
++ s = expr_end;
++ }
++ else
++ {
++ static const char * const vfpu_const_names[] = {
++ "", "VFPU_HUGE", "VFPU_SQRT2", "VFPU_SQRT1_2",
++ "VFPU_2_SQRTPI", "VFPU_2_PI", "VFPU_1_PI", "VFPU_PI_4",
++ "VFPU_PI_2", "VFPU_PI", "VFPU_E", "VFPU_LOG2E",
++ "VFPU_LOG10E", "VFPU_LN2", "VFPU_LN10", "VFPU_2PI",
++ "VFPU_PI_6", "VFPU_LOG10TWO", "VFPU_LOG2TEN",
++ "VFPU_SQRT3_2"};
++ for (cst = VF_MIN_CONST; cst <= VF_MAX_CONST; cst++)
++ {
++ if (strcasecmp(vfpu_const_names[cst], s) == 0)
++ break;
++ }
++ if ((cst < VF_MIN_CONST) || (cst > VF_MAX_CONST))
++ as_bad (_("Invalid constant code (%s)"), s);
++ else
++ s += strlen(vfpu_const_names[cst]);
++ }
++
++ ip->insn_opcode |= cst << VF_SH_CONST;
++ }
++ continue;
++
++ case 'b': /* scale exponent */
++ my_getExpression (&imm_expr, s);
++ check_absolute_expr (ip, &imm_expr);
++ if ((unsigned long) imm_expr.X_add_number > VF_MAX_SCALE)
++ {
++ as_bad (_("Improper scale (%lu)"),
++ (unsigned long) imm_expr.X_add_number);
++ imm_expr.X_add_number &= VF_MASK_SCALE;
++ }
++ ip->insn_opcode |= imm_expr.X_add_number << VF_SH_SCALE;
++ imm_expr.X_op = O_absent;
++ s = expr_end;
++ continue;
++
++ case 'c': /* branch condition code bit */
++ my_getExpression (&imm_expr, s);
++ check_absolute_expr (ip, &imm_expr);
++ if ((unsigned long) imm_expr.X_add_number > VF_MAX_BCOND)
++ {
++ as_bad (_("Improper condition bit (%lu)"),
++ (unsigned long) imm_expr.X_add_number);
++ imm_expr.X_add_number &= VF_MASK_BCOND;
++ }
++ ip->insn_opcode |= imm_expr.X_add_number << VF_SH_BCOND;
++ imm_expr.X_op = O_absent;
++ s = expr_end;
++ continue;
++
++ case 'e': /* move condition code bit */
++ my_getExpression (&imm_expr, s);
++ check_absolute_expr (ip, &imm_expr);
++ if ((unsigned long) imm_expr.X_add_number > VF_MAX_MCOND)
++ {
++ as_bad (_("Improper condition bit (%lu)"),
++ (unsigned long) imm_expr.X_add_number);
++ imm_expr.X_add_number &= VF_MASK_MCOND;
++ }
++ ip->insn_opcode |= imm_expr.X_add_number << VF_SH_MCOND;
++ imm_expr.X_op = O_absent;
++ s = expr_end;
++ continue;
++
++ case 'i': /* wrap exponent */
++ my_getExpression (&imm_expr, s);
++ check_absolute_expr (ip, &imm_expr);
++ if ((unsigned long) imm_expr.X_add_number > VF_MAX_WRAP)
++ {
++ as_bad (_("Improper wrap (%lu)"),
++ (unsigned long) imm_expr.X_add_number);
++ imm_expr.X_add_number &= VF_MASK_WRAP;
++ }
++ ip->insn_opcode |= imm_expr.X_add_number << VF_SH_WRAP;
++ imm_expr.X_op = O_absent;
++ s = expr_end;
++ continue;
++
++ case 'w': /* rotation code */
++ if (s[0] == '[')
++ {
++ char *rot_str = s;
++ int rot_idx = 0;
++ int rot_neg = 0;
++ int rot_sin = 3;
++ int rot_cos = 3;
++ int rot_err = 0;
++ int rot_n;
++ int rot_neg_n = 0;
++ int rot_sin_n = 0;
++ int rot_cos_n = 0;
++ int rot_code;
++
++ if ((ip->insn_opcode & VFPU_MASK_DTYPE) == VFPU_PAIR)
++ rot_n = 2;
++ else if ((ip->insn_opcode & VFPU_MASK_DTYPE) == VFPU_TRIPLE)
++ rot_n = 3;
++ else if ((ip->insn_opcode & VFPU_MASK_DTYPE) == VFPU_QUAD)
++ rot_n = 4;
++ else
++ rot_n = 0;
++
++ s++;
++ while ((s[0] != ']') && (s[0] != '\0'))
++ {
++ if (s[0] == '-')
++ {
++ if ((s[1] != 's') && (s[1] != 'S'))
++ {
++ rot_err = 1;
++ break;
++ }
++ rot_neg = 1;
++ rot_neg_n++;
++ s++;
++ }
++
++ if (s[0] == ',')
++ rot_idx++;
++ else if ((s[0] == 'c') || (s[0] == 'C'))
++ {
++ rot_cos = rot_idx;
++ rot_cos_n++;
++ }
++ else if ((s[0] == 's') || (s[0] == 'S'))
++ {
++ rot_sin = rot_idx;
++ rot_sin_n++;
++ }
++ else if (ISSPACE(s[0]) || (s[0] == '0'))
++ ;
++ else
++ {
++ rot_err = 1;
++ break;
++ }
++
++ s++;
++ }
++
++ if (s[0] == ']')
++ rot_idx++;
++ else
++ rot_err = 1;
++ s++;
++
++ if ((rot_sin_n == 0) && (rot_cos_n == 0))
++ {
++ if (rot_n == 2)
++ rot_sin = 2;
++ else if ((rot_n == 4) || (rot_n == 3))
++ rot_err = 1;
++ }
++
++ if (rot_cos_n > 1)
++ rot_err = 1;
++
++ if (rot_sin_n > 1)
++ {
++ if (((rot_sin_n + rot_cos_n) != rot_n)
++ || ((rot_n == 4) && (rot_cos_n == 0)))
++ rot_err = 1;
++ }
++
++ if (rot_neg && (rot_neg_n != rot_sin_n))
++ rot_err = 1;
++
++ if (rot_sin_n > 1)
++ rot_sin = rot_cos;
++
++ if (rot_err || (rot_n != rot_idx))
++ as_bad (_("Invalid rotation code (%s)"), rot_str);
++
++ rot_code = ((rot_neg & VF_MASK_ROT_NEG) << VF_SH_ROT_NEG)
++ | ((rot_cos & VF_MASK_ROT_COS) << VF_SH_ROT_COS)
++ | ((rot_sin & VF_MASK_ROT_SIN) << VF_SH_ROT_SIN);
++ ip->insn_opcode |= rot_code << VF_SH_ROT;
++ }
++ else
++ {
++ my_getExpression (&imm_expr, s);
++ check_absolute_expr (ip, &imm_expr);
++ if ((unsigned long) imm_expr.X_add_number > VF_MAX_ROT)
++ {
++ as_bad (_("Improper rotation code (%lu)"),
++ (unsigned long) imm_expr.X_add_number);
++ imm_expr.X_add_number &= VF_MASK_ROT;
++ }
++ ip->insn_opcode |= imm_expr.X_add_number << VF_SH_ROT;
++ imm_expr.X_op = O_absent;
++ s = expr_end;
++ }
++ continue;
++
++ case 'u': /* half float */
++ if ((s[0] == '0') && ((s[1] == 'x') || (s[1] == 'X')))
++ {
++ my_getExpression (&imm_expr, s);
++ check_absolute_expr (ip, &imm_expr);
++ if ((unsigned long) imm_expr.X_add_number > VF_MAX_HFLOAT)
++ {
++ as_bad (_("Improper half floating point constant: (%lu)"),
++ (unsigned long) imm_expr.X_add_number);
++ imm_expr.X_add_number &= VF_MASK_HFLOAT;
++ }
++ ip->insn_opcode |= imm_expr.X_add_number << VF_SH_HFLOAT;
++ imm_expr.X_op = O_absent;
++ s = expr_end;
++ continue;
++ }
++ else
++ {
++ char *save_in;
++ char *err;
++ int len;
++ unsigned int length;
++ unsigned char temp[8];
++ unsigned int f32, f16;
++ int exponent32, exponent16;
++ int fraction32, fraction16;
++ int sign;
++ char f16_str[8];
++
++ save_in = input_line_pointer;
++ input_line_pointer = s;
++ err = md_atof ('f', (char *) temp, &len);
++ length = len;
++ s = input_line_pointer;
++ input_line_pointer = save_in;
++ if (err != NULL && *err != '\0')
++ {
++ as_bad (_("Bad half floating point constant: %s"), err);
++ memset (temp, '\0', sizeof temp);
++ length = 4;
++ }
++
++ if (! target_big_endian)
++ f32 = bfd_getl32 (temp);
++ else
++ f32 = bfd_getb32 (temp);
++
++ sign = (f32 >> VF_SH_F32_SIGN) & VF_MASK_F32_SIGN;
++ exponent32 = (f32 >> VF_SH_F32_EXP) & VF_MASK_F32_EXP;
++ fraction32 = (f32 >> VF_SH_F32_FRA) & VF_MASK_F32_FRA;
++ exponent16 = exponent32
++ - VF_BIAS_F32_EXP + VF_BIAS_F16_EXP;
++
++ if (exponent16 < VF_MIN_F16_EXP)
++ {
++ if ((exponent32 == VF_MIN_F32_EXP)
++ && (fraction32 == 0))
++ { // zero
++ exponent16 = VF_MIN_F16_EXP;
++ fraction16 = 0;
++ }
++ else
++ { // underflow
++ float* p;
++ p = (float*) &f32;
++ as_warn (_("Half floating point underflow: %g"),
++ *p);
++ exponent16 = VF_MIN_F16_EXP;
++ fraction16 = 0;
++ }
++ }
++ else if (exponent16 > VF_MAX_F16_EXP)
++ {
++ if (exponent32 != VF_MAX_F32_EXP)
++ { // overflow
++ as_warn (_("Half floating point overflow: %g"),
++ *(float *)&f32);
++ exponent16 = VF_MAX_F16_EXP;
++ fraction16 = 0;
++ }
++ else
++ {
++ if (fraction32 == 0)
++ { // infinity
++ exponent16 = VF_MAX_F16_EXP;
++ fraction16 = 0;
++ }
++ else
++ { // NaN
++ exponent16 = VF_MAX_F16_EXP;
++ fraction16 = 1;
++ }
++ }
++ }
++ else
++ {
++ fraction16 = (f32 >> (VF_SH_F32_EXP - VF_SH_F16_EXP))
++ & VF_MASK_F16_FRA;
++ }
++
++ f16 = (sign << VF_SH_F16_SIGN)
++ | (exponent16 << VF_SH_F16_EXP)
++ | (fraction16 << VF_SH_F16_FRA);
++ ip->insn_opcode |= (f16 & VF_MASK_HFLOAT) << VF_SH_HFLOAT;
++
++ sprintf(f16_str, "0x%04x", f16);
++ my_getExpression (&imm_expr, f16_str);
++
++ continue;
++ }
++ break;
++
++ case 'z': /* read/write access code */
++ {
++ int rwb = 0;
++
++ if (strncasecmp (s, "WT", 2) == 0)
++ rwb = 0x0;
++ else if (strncasecmp (s, "WB", 2) == 0)
++ rwb = 0x1;
++ else
++ as_bad (_("Invalid memory access type (%s)"), s);
++
++ s += 2;
++ ip->insn_opcode |= (rwb & VF_MASK_RWB) << VF_SH_RWB;
++
++ continue;
++ }
++
++ case '0': /* source or target prefix code (X) */
++ case '1': /* source or target prefix code (Y) */
++ case '2': /* source or target prefix code (Z) */
++ case '3': /* source or target prefix code (W) */
++ {
++ int operand;
++ int shift;
++
++ int pfx_neg = 0;
++ int pfx_cst = 0;
++ int pfx_abs = 0;
++ int pfx_swz = 0;
++ int pfx_err = 0;
++ int cst = 0;
++ char *pfx_str = s;
++
++ if (s[0] == '-')
++ { // sign code
++ pfx_neg = 1;
++ s++;
++ }
++
++ if (ISDIGIT (s[0]))
++ { // constant
++ pfx_cst = 1;
++
++ if (s[0] == '0')
++ cst = 0;
++ else if (s[0] == '1')
++ {
++ if (s[1] == '/')
++ {
++ s += 2;
++ if (s[0] == '2')
++ cst = 3;
++ else if (s[0] == '3')
++ cst = 5;
++ else if (s[0] == '4')
++ cst = 6;
++ else if (s[0] == '6')
++ cst = 7;
++ else
++ pfx_err = 1;
++ }
++ else
++ {
++ cst = 1;
++ }
++ }
++ else if (s[0] == '2')
++ cst = 2;
++ else if (s[0] == '3')
++ cst = 4;
++ else
++ pfx_err = 1;
++
++ pfx_abs = (cst >> 2) & 0x1;
++ pfx_swz = (cst >> 0) & 0x3;
++ s++;
++ }
++ else
++ { // variable
++
++ if (s[0] == '|')
++ { // abs
++ pfx_abs = 1;
++ s++;
++ }
++
++ if ((s[0] == 'X') || (s[0] == 'x'))
++ {
++ pfx_swz = 0;
++ s++;
++ }
++ else if ((s[0] == 'Y') || (s[0] == 'y'))
++ {
++ pfx_swz = 1;
++ s++;
++ }
++ else if ((s[0] == 'Z') || (s[0] == 'z'))
++ {
++ pfx_swz = 2;
++ s++;
++ }
++ else if ((s[0] == 'W') || (s[0] == 'w'))
++ {
++ pfx_swz = 3;
++ s++;
++ }
++ else if ((s[0] == ',') || IS_SPACE_OR_NUL (s[0])
++ || (s[0] == '|'))
++ {
++ pfx_swz = *args - '0';
++ }
++ else
++ pfx_err = 1;
++
++ if (pfx_err == 0)
++ {
++ if (s[0] == '|')
++ {
++ s++;
++ if (pfx_abs == 0)
++ pfx_err = 1;
++ }
++ else
++ {
++ if (pfx_abs == 1)
++ pfx_err = 1;
++ }
++ }
++ }
++
++ if (! ((s[0] == ',') || IS_SPACE_OR_NUL (s[0])))
++ pfx_err = 1;
++
++ if (pfx_err)
++ as_bad (_("Invalid prefix format (%s)"), pfx_str);
++
++ shift = *args - '0';
++
++ operand = (pfx_neg << (VF_SH_PFX_NEG + shift))
++ | (pfx_cst << (VF_SH_PFX_CST + shift))
++ | (pfx_abs << (VF_SH_PFX_ABS + shift))
++ | (pfx_swz << (VF_SH_PFX_SWZ + shift * 2));
++
++ ip->insn_opcode |= operand;
++ continue;
++ }
++
++ case '4': /* destination prefix code (X) */
++ case '5': /* destination prefix code (Y) */
++ case '6': /* destination prefix code (Z) */
++ case '7': /* destination prefix code (W) */
++ {
++ int operand;
++ int shift;
++ static const char order[] = "xyzwXYZW";
++
++ int pfx_msk = 0;
++ int pfx_sat = 0;
++ char *pfx_str = s;
++
++ if (s[0] == '[')
++ s++;
++ if (s[0] == '-') /* -1:1, skip the minus symbol */
++ s++;
++
++ if ((s[0] == 'm') || (s[0] == 'M'))
++ {
++ pfx_msk = 1;
++ s++;
++ }
++ else if (s[0] == '0') /* 0:1 */
++ {
++ pfx_sat = 1;
++ s++;
++ }
++ else if (s[0] == '1') /* -1:1 or -1:+1 */
++ {
++ pfx_sat = 3;
++ s++;
++ }
++ else if ((s[0] == order[(*args) - '4'])
++ || (s[0] == order[(*args) - '4' + 4]))
++ {
++ pfx_sat = 0;
++ s++;
++ }
++
++ if (s[0] == ':') /* skip the :1 or :+1 part of the expression */
++ {
++ s++;
++ if (s[0] == '+')
++ s++;
++ if (s[0] == '1')
++ s++;
++ }
++ if (s[0] == ']')
++ s++;
++
++ if (! ((s[0] == ',') || IS_SPACE_OR_NUL (s[0])))
++ as_bad (_("Invalid prefix format (%s)"), pfx_str);
++
++ shift = *args - '4';
++ operand = (pfx_msk << (VF_SH_PFX_MSK + shift))
++ | (pfx_sat << (VF_SH_PFX_SAT + shift * 2));
++
++ ip->insn_opcode |= operand;
++ continue;
++ }
++ }
++ break;
++
++ case 'b': /* base register */
++ case 'd': /* destination register */
++ case 's': /* source register */
++ case 't': /* target register */
++ case 'r': /* both target and source */
++ case 'v': /* both dest and source */
++ case 'w': /* both dest and target */
++ case 'E': /* coprocessor target register */
++ case 'G': /* coprocessor destination register */
++ case 'K': /* 'rdhwr' destination register */
++ case 'x': /* ignore register name */
++ case 'z': /* must be zero register */
++ case 'U': /* destination register (clo/clz). */
++ s_reset = s;
++ if (s[0] == '$')
++ {
++
++ if (ISDIGIT (s[1]))
++ {
++ ++s;
+ regno = 0;
+ do
+ {
+@@ -8273,30 +9967,27 @@
+ goto notreg;
+ else
+ {
+- if (s[1] == 'r' && s[2] == 'a')
++ const char regName[32][5] =
+ {
+- s += 3;
+- regno = RA;
+- }
+- else if (s[1] == 'f' && s[2] == 'p')
++ "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3",
++ "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7",
++ "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
++ "t8", "t9", "k0", "k1", "gp", "sp", "fp", "ra"
++ };
++ int i;
++
++ for(i = 0; i < 32; i++)
+ {
+- s += 3;
+- regno = FP;
+- }
+- else if (s[1] == 's' && s[2] == 'p')
++ if(strncmp(&s[1], regName[i], strlen(regName[i])) == 0)
+ {
+- s += 3;
+- regno = SP;
++ break;
+ }
+- else if (s[1] == 'g' && s[2] == 'p')
+- {
+- s += 3;
+- regno = GP;
+ }
+- else if (s[1] == 'a' && s[2] == 't')
++
++ if(i < 32)
+ {
+- s += 3;
+- regno = AT;
++ s += strlen(regName[i]) + 1;
++ regno = i;
+ }
+ else if (s[1] == 'k' && s[2] == 't' && s[3] == '0')
+ {
+@@ -8485,6 +10176,7 @@
+
+ if ((regno & 1) != 0
+ && HAVE_32BIT_FPRS
++ && ! CPU_IS_ALLEGREX (mips_opts.arch)
+ && ! (strcmp (str, "mtc1") == 0
+ || strcmp (str, "mfc1") == 0
+ || strcmp (str, "lwc1") == 0
+@@ -13743,6 +15435,8 @@
+
+ /* MIPS II */
+ { "r6000", 0, ISA_MIPS2, CPU_R6000 },
++ /* Sony PSP "Allegrex" CPU core */
++ { "allegrex", 0, ISA_MIPS2, CPU_ALLEGREX },
+
+ /* MIPS III */
+ { "r4000", 0, ISA_MIPS3, CPU_R4000 },
diff --git a/devel/psptoolchain-binutils/files/patch-gas-configure b/devel/psptoolchain-binutils/files/patch-gas-configure
new file mode 100644
index 000000000000..37f31b79f9b6
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-gas-configure
@@ -0,0 +1,12 @@
+--- gas/configure.orig 2005-03-01 00:43:51.000000000 +0000
++++ gas/configure 2006-05-09 02:55:36.000000000 +0100
+@@ -4537,6 +4537,9 @@
+ mips64vr | mips64vrel)
+ mips_cpu=vr4100
+ ;;
++ mipsallegrex | mipsallegrexel)
++ mips_cpu=allegrex
++ ;;
+ mipsisa32r2* | mipsisa64r2*)
+ mips_cpu=`echo $target_cpu | sed -e 's/[a-z]*..r2//' -e 's/el$//'`
+ ;;
diff --git a/devel/psptoolchain-binutils/files/patch-gas-configure.in b/devel/psptoolchain-binutils/files/patch-gas-configure.in
new file mode 100644
index 000000000000..d04040aeb62a
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-gas-configure.in
@@ -0,0 +1,12 @@
+--- gas/configure.in.orig 2005-03-01 00:43:57.000000000 +0000
++++ gas/configure.in 2006-05-09 02:55:36.000000000 +0100
+@@ -222,6 +222,9 @@
+ mips64vr | mips64vrel)
+ mips_cpu=vr4100
+ ;;
++ mipsallegrex | mipsallegrexel)
++ mips_cpu=allegrex
++ ;;
+ mipsisa32r2* | mipsisa64r2*)
+ changequote(,)dnl
+ mips_cpu=`echo $target_cpu | sed -e 's/[a-z]*..r2//' -e 's/el$//'`
diff --git a/devel/psptoolchain-binutils/files/patch-gas-testsuite-gas-mips-mips.exp b/devel/psptoolchain-binutils/files/patch-gas-testsuite-gas-mips-mips.exp
new file mode 100644
index 000000000000..98a482dd1fe1
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-gas-testsuite-gas-mips-mips.exp
@@ -0,0 +1,12 @@
+--- gas/testsuite/gas/mips/mips.exp.orig 2005-04-19 18:09:45.000000000 +0100
++++ gas/testsuite/gas/mips/mips.exp 2006-05-09 02:55:36.000000000 +0100
+@@ -382,6 +382,9 @@
+ mips_arch_create sb1 64 mips64 { mips3d } \
+ { -march=sb1 -mtune=sb1 } { -mmips:sb1 } \
+ { mipsisa64sb1-*-* mipsisa64sb1el-*-* }
++mips_arch_create allegrex 32 mips2 { ror } \
++ { -march=allegrex -mtune=allegrex } { -mmips:allegrex } \
++ { mipsallegrex-*-* mipsallegrexel-*-* }
+
+
+ #
diff --git a/devel/psptoolchain-binutils/files/patch-include-bin-bugs.h b/devel/psptoolchain-binutils/files/patch-include-bin-bugs.h
new file mode 100644
index 000000000000..7641f1c926c3
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-include-bin-bugs.h
@@ -0,0 +1,7 @@
+--- include/bin-bugs.h.orig 2004-07-23 16:40:19.000000000 +0100
++++ include/bin-bugs.h 2006-05-09 02:55:36.000000000 +0100
+@@ -1,3 +1,3 @@
+ #ifndef REPORT_BUGS_TO
+-#define REPORT_BUGS_TO "<URL:http://www.sourceware.org/bugzilla/>"
++#define REPORT_BUGS_TO "<URL:http://wiki.pspdev.org/psp:toolchain#bugs>"
+ #endif
diff --git a/devel/psptoolchain-binutils/files/patch-include-elf-common.h b/devel/psptoolchain-binutils/files/patch-include-elf-common.h
new file mode 100644
index 000000000000..4def0f93523a
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-include-elf-common.h
@@ -0,0 +1,10 @@
+--- include/elf/common.h.orig 2004-10-08 14:55:08.000000000 +0100
++++ include/elf/common.h 2006-05-09 02:55:36.000000000 +0100
+@@ -93,6 +93,7 @@
+ #define ET_HIOS 0xFEFF /* Operating system-specific */
+ #define ET_LOPROC 0xFF00 /* Processor-specific */
+ #define ET_HIPROC 0xFFFF /* Processor-specific */
++#define ET_PSPEXEC 0xFFA0 /* Sony PSP executable file */
+
+ /* Values for e_machine, which identifies the architecture. These numbers
+ are officially assigned by registry@caldera.com. See below for a list of
diff --git a/devel/psptoolchain-binutils/files/patch-include-elf-mips.h b/devel/psptoolchain-binutils/files/patch-include-elf-mips.h
new file mode 100644
index 000000000000..2f38ce3688b1
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-include-elf-mips.h
@@ -0,0 +1,10 @@
+--- include/elf/mips.h.orig 2005-03-03 11:58:06.000000000 +0000
++++ include/elf/mips.h 2006-05-09 02:55:36.000000000 +0100
+@@ -212,6 +212,7 @@
+ #define E_MIPS_MACH_5400 0x00910000
+ #define E_MIPS_MACH_5500 0x00980000
+ #define E_MIPS_MACH_9000 0x00990000
++#define E_MIPS_MACH_ALLEGREX 0x00A20000
+
+ /* Processor specific section indices. These sections do not actually
+ exist. Symbols with a st_shndx field corresponding to one of these
diff --git a/devel/psptoolchain-binutils/files/patch-include-opcode-mips.h b/devel/psptoolchain-binutils/files/patch-include-opcode-mips.h
new file mode 100644
index 000000000000..f046ecb244dc
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-include-opcode-mips.h
@@ -0,0 +1,356 @@
+--- include/opcode/mips.h.orig 2005-03-03 11:58:10.000000000 +0000
++++ include/opcode/mips.h 2006-05-09 02:55:36.000000000 +0100
+@@ -171,6 +171,228 @@
+ #define MDMX_FMTSEL_VEC_QH 0x15
+ #define MDMX_FMTSEL_VEC_OB 0x16
+
++#include "vfpu.h"
++
++#define VF_MASK_VT 0x7f
++#define VF_SH_VT 16
++#define VF_MASK_VS 0x7f
++#define VF_SH_VS 8
++#define VF_MASK_VD 0x7f
++#define VF_SH_VD 0
++#define VF_MASK_VML 0x1f
++#define VF_SH_VML 16
++#define VF_MASK_VMH 0x3
++#define VF_SH_VMH 0
++#define VF_MASK_VNL 0x1f
++#define VF_SH_VNL 16
++#define VF_MASK_VNH 0x1
++#define VF_SH_VNH 0
++#define VF_MASK_OFFSET 0x3fff
++#define VF_SH_OFFSET 2
++#define VF_MASK_CC 0xf
++#define VF_SH_CC 0
++#define VF_MASK_CONST 0x1f
++#define VF_SH_CONST 16
++#define VF_MASK_SCALE 0x1f
++#define VF_SH_SCALE 16
++#define VF_MASK_BCOND 0x7
++#define VF_SH_BCOND 18
++#define VF_MASK_MCOND 0x7
++#define VF_SH_MCOND 16
++#define VF_MASK_VCD 0xff
++#define VF_SH_VCD 0
++#define VF_MASK_VCS 0xff
++#define VF_SH_VCS 8
++#define VF_MASK_ROT 0x1f
++#define VF_SH_ROT 16
++#define VF_MASK_WRAP 0xff
++#define VF_SH_WRAP 16
++#define VF_MASK_TSIGN 0x1
++#define VF_SH_TSIGN 5
++#define VF_MASK_BMCOND 0x1f
++#define VF_SH_BMCOND 0
++#define VF_MASK_HFLOAT 0xffff
++#define VF_SH_HFLOAT 0
++#define VF_MASK_PFX 0xffffff
++#define VF_SH_PFX 0
++#define VF_MASK_RWB 0x1
++#define VF_SH_RWB 1
++
++#define VF_MASK_PFX_SWZ 0x3
++#define VF_SH_PFX_SWZ 0
++#define VF_MASK_PFX_ABS 0x1
++#define VF_SH_PFX_ABS 8
++#define VF_MASK_PFX_CST 0x1
++#define VF_SH_PFX_CST 12
++#define VF_MASK_PFX_NEG 0x1
++#define VF_SH_PFX_NEG 16
++#define VF_MASK_PFX_SAT 0x3
++#define VF_SH_PFX_SAT 0
++#define VF_MASK_PFX_MSK 0x1
++#define VF_SH_PFX_MSK 8
++
++#define VF_MASK_ROT_COS 0x3
++#define VF_SH_ROT_COS 0
++#define VF_MASK_ROT_SIN 0x3
++#define VF_SH_ROT_SIN 2
++#define VF_MASK_ROT_NEG 0x1
++#define VF_SH_ROT_NEG 4
++
++#define VF_MASK_MR_MTX 0x7
++#define VF_SH_MR_MTX 2
++#define VF_MASK_MR_IDX 0x3
++#define VF_SH_MR_IDX 0
++#define VF_MASK_MR_FSL 0x3
++#define VF_SH_MR_FSL 5
++#define VF_MASK_MR_RXC 0x1
++#define VF_SH_MR_RXC 5
++#define VF_MASK_MR_VFSL 0x1
++#define VF_SH_MR_VFSL 6
++
++#define VF_MAX_MR_MTX 7
++#define VF_MAX_MR_IDX 3
++#define VF_MAX_MR_FSL 3
++#define VF_MAX_MR_VIDX 1
++#define VF_MAX_MR_VFSL 1
++
++#define VF_MIN_MR 0
++#define VF_MAX_MR 127
++#define VF_MIN_CR 128
++#define VF_MAX_CR 255
++#define VF_MIN_VCR 128
++#define VF_MAX_VCR 143
++#define VF_MIN_CC 0
++#define VF_MAX_CC 15
++#define VF_MIN_CONST 1
++#define VF_MAX_CONST 19
++#define VF_MIN_SCALE 0
++#define VF_MAX_SCALE 31
++#define VF_MIN_BCOND 0
++#define VF_MAX_BCOND 5
++#define VF_MIN_MCOND 0
++#define VF_MAX_MCOND 6
++#define VF_MIN_WRAP 0
++#define VF_MAX_WRAP 255
++#define VF_MIN_ROT 0
++#define VF_MAX_ROT 31
++#define VF_MIN_TSIGN 0
++#define VF_MAX_TSIGN 1
++#define VF_MIN_BMCOND 0
++#define VF_MAX_BMCOND 31
++#define VF_MIN_HFLOAT 0
++#define VF_MAX_HFLOAT 0xffff
++
++#define VF_MASK_F32_SIGN 0x1
++#define VF_SH_F32_SIGN 31
++#define VF_MASK_F32_EXP 0xff
++#define VF_SH_F32_EXP 23
++#define VF_MASK_F32_FRA 0x7fffff
++#define VF_SH_F32_FRA 0
++#define VF_MASK_F16_SIGN 0x1
++#define VF_SH_F16_SIGN 15
++#define VF_MASK_F16_EXP 0x1f
++#define VF_SH_F16_EXP 10
++#define VF_MASK_F16_FRA 0x3ff
++#define VF_SH_F16_FRA 0
++
++#define VF_MIN_F32_EXP 0
++#define VF_MAX_F32_EXP 255
++#define VF_BIAS_F32_EXP 127
++#define VF_MIN_F16_EXP 0
++#define VF_MAX_F16_EXP 31
++#define VF_BIAS_F16_EXP 15
++
++#define OP_SH_VFPU_DELTA 0
++#define OP_MASK_VFPU_DELTA 0xfffc
++#define OP_SH_VFPU_IMM3 16
++#define OP_MASK_VFPU_IMM3 0x7
++#define OP_SH_VFPU_IMM5 16
++#define OP_MASK_VFPU_IMM5 0x1f
++#define OP_SH_VFPU_IMM8 16
++#define OP_MASK_VFPU_IMM8 0xff
++#define OP_SH_VFPU_CC 18 /* Condition code. */
++#define OP_MASK_VFPU_CC 0x7
++#define OP_SH_VFPU_CONST 16
++#define OP_MASK_VFPU_CONST 0x1f
++#define OP_SH_VFPU_COND 0 /* Conditional compare. */
++#define OP_MASK_VFPU_COND 0xf
++#define OP_SH_VFPU_VMTVC 0
++#define OP_MASK_VFPU_VMTVC 0xff
++#define OP_SH_VFPU_VMFVC 8
++#define OP_MASK_VFPU_VMFVC 0xff
++#define OP_SH_VFPU_RWB 1
++#define OP_MASK_VFPU_RWB 0x1
++#define OP_SH_VFPU_ROT 16 /* Rotators used in vrot. */
++#define OP_MASK_VFPU_ROT 0x1f
++#define OP_SH_VFPU_FLOAT16 0
++#define OP_MASK_VFPU_FLOAT16 0xffff
++
++/* VFPU registers. */
++#define OP_SH_VFPU_VD 0
++#define OP_MASK_VFPU_VD 0x7f
++#define OP_SH_VFPU_VS 8
++#define OP_MASK_VFPU_VS 0x7f
++#define OP_SH_VFPU_VT 16
++#define OP_MASK_VFPU_VT 0x7f
++#define OP_SH_VFPU_VT_LO 16 /* Bits 0-4 of vt. */
++#define OP_MASK_VFPU_VT_LO 0x1f
++#define OP_SH_VFPU_VT_HI 5 /* Right-shifted. */
++#define OP_MASK_VFPU_VT_HI1 0x1 /* Bit 5 of vt. */
++#define OP_MASK_VFPU_VT_HI2 0x3 /* Bits 5-6 of vt. */
++/* Special handling of vs in vmmul instructions. */
++#define VFPU_OP_VT_VS_VD 0xff800000
++#define VFPU_OPCODE_VMMUL 0xf0000000
++
++/* VFPU condition codes. FL and TR accept no arguments, while any conditions
++ above and including EZ only accept one argument. The rest require two
++ arguments. */
++enum
++{
++ VFPU_COND_FL, VFPU_COND_EQ, VFPU_COND_LT, VFPU_COND_LE,
++ VFPU_COND_TR, VFPU_COND_NE, VFPU_COND_GE, VFPU_COND_GT,
++ VFPU_COND_EZ, VFPU_COND_EN, VFPU_COND_EI, VFPU_COND_ES,
++ VFPU_COND_NZ, VFPU_COND_NN, VFPU_COND_NI, VFPU_COND_NS,
++ VFPU_NUM_CONDS
++};
++
++/* VFPU prefix instruction operands. The *_SH_* values really specify where
++ the bitfield begins, as VFPU prefix instructions have four operands
++ encoded within the immediate field. */
++#define VFPU_SH_PFX_NEG 16
++#define VFPU_MASK_PFX_NEG 0x1 /* Negation. */
++#define VFPU_SH_PFX_CST 12
++#define VFPU_MASK_PFX_CST 0x1 /* Constant. */
++#define VFPU_SH_PFX_ABS_CSTHI 8
++#define VFPU_MASK_PFX_ABS_CSTHI 0x1 /* Abs/Constant (bit 2). */
++#define VFPU_SH_PFX_SWZ_CSTLO 0
++#define VFPU_MASK_PFX_SWZ_CSTLO 0x3 /* Swizzle/Constant (bits 0-1). */
++#define VFPU_SH_PFX_MASK 8
++#define VFPU_MASK_PFX_MASK 0x1 /* Mask. */
++#define VFPU_SH_PFX_SAT 0
++#define VFPU_MASK_PFX_SAT 0x3 /* Saturation. */
++
++/* Special handling of the vrot instructions. */
++#define VFPU_MASK_OP_SIZE 0x8080 /* Masks the operand size (pair, triple, quad). */
++#define VFPU_OP_SIZE_PAIR 0x80
++#define VFPU_OP_SIZE_TRIPLE 0x8000
++#define VFPU_OP_SIZE_QUAD 0x8080
++/* Note that these are within the rotators field, and not the full opcode. */
++#define VFPU_SH_ROT_HI 2
++#define VFPU_MASK_ROT_HI 0x3
++#define VFPU_SH_ROT_LO 0
++#define VFPU_MASK_ROT_LO 0x3
++#define VFPU_SH_ROT_NEG 4 /* Negation. */
++#define VFPU_MASK_ROT_NEG 0x1
++
++/* VFPU 16-bit floating-point format. */
++#define VFPU_FLOAT16_EXP_MAX 0x1f
++#define VFPU_SH_FLOAT16_SIGN 15
++#define VFPU_MASK_FLOAT16_SIGN 0x1
++#define VFPU_SH_FLOAT16_EXP 10
++#define VFPU_MASK_FLOAT16_EXP 0x1f
++#define VFPU_SH_FLOAT16_FRAC 0
++#define VFPU_MASK_FLOAT16_FRAC 0x3ff
++
+ /* This structure holds information for a particular instruction. */
+
+ struct mips_opcode
+@@ -258,6 +480,29 @@
+ Requires that "+A" or "+E" occur first to set position.
+ Enforces: 32 < (pos+size) <= 64.
+
++ Sony Allegrex VFPU instructions:
++ "?o"
++ "?0" - "?3"
++ "?4" - "?7"
++ "?a"
++ "?b"
++ "?c"
++ "?e"
++ "?f"
++ "?i"
++ "?q"
++ "?r"
++ "?u"
++ "?w"
++ "?d"
++ "?m"
++ "?n"
++ "?s"
++ "?t"
++ "?v"
++ "?x"
++ "?z"
++
+ Floating point instructions:
+ "D" 5 bit destination register (OP_*_FD)
+ "M" 3 bit compare condition code (OP_*_CCC) (only used for mips4 and up)
+@@ -442,6 +687,8 @@
+ #define INSN_5400 0x01000000
+ /* NEC VR5500 instruction. */
+ #define INSN_5500 0x02000000
++/* Sony Allegrex instruction. */
++#define INSN_ALLEGREX 0x10000000
+
+ /* MIPS ISA defines, use instead of hardcoding ISA level. */
+
+@@ -489,6 +736,7 @@
+ #define CPU_MIPS64 64
+ #define CPU_MIPS64R2 65
+ #define CPU_SB1 12310201 /* octal 'SB', 01. */
++#define CPU_ALLEGREX 10111431 /* octal 'AL', 31. */
+
+ /* Test for membership in an ISA including chip specific ISAs. INSN
+ is pointer to an element of the opcode table; ISA is the specified
+@@ -510,6 +758,7 @@
+ || (cpu == CPU_VR4120 && ((insn)->membership & INSN_4120) != 0) \
+ || (cpu == CPU_VR5400 && ((insn)->membership & INSN_5400) != 0) \
+ || (cpu == CPU_VR5500 && ((insn)->membership & INSN_5500) != 0) \
++ || (cpu == CPU_ALLEGREX && ((insn)->membership & INSN_ALLEGREX) != 0) \
+ || 0) /* Please keep this term for easier source merging. */
+
+ /* This is a list of macro expanded instructions.
+@@ -622,9 +871,25 @@
+ M_LI_DD,
+ M_LI_S,
+ M_LI_SS,
++ M_LVHI_S_SS,
++ M_LVHI_P_SS,
++ M_LVI_S_SS,
++ M_LVI_P_SS,
++ M_LVI_T_SS,
++ M_LVI_Q_SS,
+ M_LL_AB,
+ M_LLD_AB,
+ M_LS_A,
++ M_LVHI_P,
++ M_LVHI_S,
++ M_LVI_P,
++ M_LVI_Q,
++ M_LVI_S,
++ M_LVI_T,
++ M_LVL_Q_AB,
++ M_LVR_Q_AB,
++ M_LV_Q_AB,
++ M_LV_Q_AB_2,
+ M_LW_A,
+ M_LW_AB,
+ M_LWC0_A,
+@@ -635,6 +900,7 @@
+ M_LWC2_AB,
+ M_LWC3_A,
+ M_LWC3_AB,
++ M_LV_S_AB,
+ M_LWL_A,
+ M_LWL_AB,
+ M_LWR_A,
+@@ -714,6 +980,10 @@
+ M_SUB_I,
+ M_SUBU_I,
+ M_SUBU_I_2,
++ M_SVL_Q_AB,
++ M_SV_Q_AB,
++ M_SVR_Q_AB,
++ M_SV_S_AB,
+ M_TEQ_I,
+ M_TGE_I,
+ M_TGEU_I,
+@@ -728,14 +998,24 @@
+ M_ULH_A,
+ M_ULHU,
+ M_ULHU_A,
++ M_ULV_Q,
++ M_ULV_Q_AB,
++ M_ULV_S,
+ M_ULW,
+ M_ULW_A,
+ M_USH,
+ M_USH_A,
++ M_USV_Q,
++ M_USV_Q_AB,
++ M_USV_S,
+ M_USW,
+ M_USW_A,
+ M_USD,
+ M_USD_A,
++ M_VCMOV_P,
++ M_VCMOV_Q,
++ M_VCMOV_S,
++ M_VCMOV_T,
+ M_XOR_I,
+ M_COP0,
+ M_COP1,
diff --git a/devel/psptoolchain-binutils/files/patch-include-opcode-vfpu.h b/devel/psptoolchain-binutils/files/patch-include-opcode-vfpu.h
new file mode 100644
index 000000000000..c2b159021cba
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-include-opcode-vfpu.h
@@ -0,0 +1,264 @@
+--- include/opcode/vfpu.h.orig 1970-01-01 01:00:00.000000000 +0100
++++ include/opcode/vfpu.h 2006-05-09 02:55:36.000000000 +0100
+@@ -0,0 +1,261 @@
++#ifndef _VFPU_H_
++#define _VFPU_H_
++
++////////////////////////////////////
++// data type
++#define VFPU_MASK_DTYPE 0x8080
++#define VFPU_QUAD 0x8080
++#define VFPU_TRIPLE 0x8000
++#define VFPU_PAIR 0x0080
++#define VFPU_SINGLE 0x0000
++
++////////////////////////////////////
++// register index
++#define VFPU_MASK_VT 0x7f0000
++#define VFPU_MASK_VS 0x007f00
++#define VFPU_MASK_VD 0x00007f
++
++////////////////////////////////////
++// condition and comapre inst
++#define VFPU_PADD_BIN_CMP 0x70
++
++////////////////////////////////////
++// load/store left/right
++#define VFPU_MASK_LDST_LR 0x2
++#define VFPU_LDST_L 0x0
++#define VFPU_LDST_R 0x2
++
++////////////////////////////////////
++// load/store memory/buffer
++#define VFPU_MASK_LDST_MB 0x2
++#define VFPU_LDST_M 0x0
++#define VFPU_LDST_B 0x2
++
++////////////////////////////////////
++// coprocessor move
++#define VFPU_MASK_COP_MV 0xff80
++#define VFPU_MASK_COP_MVC 0xff00
++
++////////////////////////////////////
++// sync code
++#define VFPU_MASK_SYNC_CODE 0xffff
++#define VFPU_SYNC_CODE_DEFAULT 0x0320
++#define VFPU_SYNC_CODE_NOP 0x0000
++#define VFPU_SYNC_CODE_FLUSH 0x040d
++
++////////////////////////////////////
++#define VFPU_INST_BR_F 0x49000000
++#define VFPU_MASK_BR_F 0xffe30000
++#define VFPU_INST_BR_FL 0x49020000
++#define VFPU_MASK_BR_FL 0xffe30000
++#define VFPU_INST_BR_T 0x49010000
++#define VFPU_MASK_BR_T 0xffe30000
++#define VFPU_INST_BR_TL 0x49030000
++#define VFPU_MASK_BR_TL 0xffe30000
++
++#define VFPU_INST_COP_LD_S 0xc8000000
++#define VFPU_MASK_COP_LD_S 0xfc000000
++#define VFPU_INST_COP_ST_S 0xe8000000
++#define VFPU_MASK_COP_ST_S 0xfc000000
++#define VFPU_INST_COP_LD_Q 0xd8000000
++#define VFPU_MASK_COP_LD_Q 0xfc000000
++#define VFPU_INST_COP_ST_Q 0xf8000000
++#define VFPU_MASK_COP_ST_Q 0xfc000000
++#define VFPU_INST_COP_LD_U 0xd4000000
++#define VFPU_MASK_COP_LD_U 0xfc000000
++#define VFPU_INST_COP_ST_U 0xf4000000
++#define VFPU_MASK_COP_ST_U 0xfc000000
++#define VFPU_INST_COP_MF 0x48600000
++#define VFPU_MASK_COP_MF 0xffe00000
++#define VFPU_INST_COP_MT 0x48e00000
++#define VFPU_MASK_COP_MT 0xffe00000
++
++#define VFPU_INST_BIN_ADD 0x60000000
++#define VFPU_MASK_BIN_ADD 0xff800000
++#define VFPU_INST_BIN_SUB 0x60800000
++#define VFPU_MASK_BIN_SUB 0xff800000
++#define VFPU_INST_BIN_SBN 0x61000000
++#define VFPU_MASK_BIN_SBN 0xff800000
++#define VFPU_INST_BIN_DIV 0x63800000
++#define VFPU_MASK_BIN_DIV 0xff800000
++#define VFPU_INST_BIN_MUL 0x64000000
++#define VFPU_MASK_BIN_MUL 0xff800000
++#define VFPU_INST_BIN_DOT 0x64800000
++#define VFPU_MASK_BIN_DOT 0xff800000
++#define VFPU_INST_BIN_SCL 0x65000000
++#define VFPU_MASK_BIN_SCL 0xff800000
++#define VFPU_INST_BIN_HDP 0x66000000
++#define VFPU_MASK_BIN_HDP 0xff800000
++#define VFPU_INST_BIN_CRS 0x66800000
++#define VFPU_MASK_BIN_CRS 0xff800000
++#define VFPU_INST_BIN_DET 0x67000000
++#define VFPU_MASK_BIN_DET 0xff800000
++#define VFPU_INST_BIN_CMP 0x6c000000
++#define VFPU_MASK_BIN_CMP 0xff800000
++#define VFPU_INST_BIN_MIN 0x6d000000
++#define VFPU_MASK_BIN_MIN 0xff800000
++#define VFPU_INST_BIN_MAX 0x6d800000
++#define VFPU_MASK_BIN_MAX 0xff800000
++#define VFPU_INST_BIN_SCMP 0x6e800000
++#define VFPU_MASK_BIN_SCMP 0xff800000
++#define VFPU_INST_BIN_SGE 0x6f000000
++#define VFPU_MASK_BIN_SGE 0xff800000
++#define VFPU_INST_BIN_SLT 0x6f800000
++#define VFPU_MASK_BIN_SLT 0xff800000
++
++#define VFPU_INST_UNR_MOV 0xd0000000
++#define VFPU_MASK_UNR_MOV 0xffff0000
++#define VFPU_INST_UNR_ABS 0xd0010000
++#define VFPU_MASK_UNR_ABS 0xffff0000
++#define VFPU_INST_UNR_NEG 0xd0020000
++#define VFPU_MASK_UNR_NEG 0xffff0000
++#define VFPU_INST_UNR_IDT 0xd0030000
++#define VFPU_MASK_UNR_IDT 0xffff0000
++#define VFPU_INST_UNR_SAT0 0xd0040000
++#define VFPU_MASK_UNR_SAT0 0xffff0000
++#define VFPU_INST_UNR_SAT1 0xd0050000
++#define VFPU_MASK_UNR_SAT1 0xffff0000
++#define VFPU_INST_UNR_ZERO 0xd0060000
++#define VFPU_MASK_UNR_ZERO 0xffff0000
++#define VFPU_INST_UNR_ONE 0xd0070000
++#define VFPU_MASK_UNR_ONE 0xffff0000
++#define VFPU_INST_UNR_RCP 0xd0100000
++#define VFPU_MASK_UNR_RCP 0xffff0000
++#define VFPU_INST_UNR_RSQ 0xd0110000
++#define VFPU_MASK_UNR_RSQ 0xffff0000
++#define VFPU_INST_UNR_SIN 0xd0120000
++#define VFPU_MASK_UNR_SIN 0xffff0000
++#define VFPU_INST_UNR_COS 0xd0130000
++#define VFPU_MASK_UNR_COS 0xffff0000
++#define VFPU_INST_UNR_EXP2 0xd0140000
++#define VFPU_MASK_UNR_EXP2 0xffff0000
++#define VFPU_INST_UNR_LOG2 0xd0150000
++#define VFPU_MASK_UNR_LOG2 0xffff0000
++#define VFPU_INST_UNR_SQR 0xd0160000
++#define VFPU_MASK_UNR_SQR 0xffff0000
++#define VFPU_INST_UNR_ASIN 0xd0170000
++#define VFPU_MASK_UNR_ASIN 0xffff0000
++#define VFPU_INST_UNR_NRCP 0xd0180000
++#define VFPU_MASK_UNR_NRCP 0xffff0000
++#define VFPU_INST_UNR_NSIN 0xd01a0000
++#define VFPU_MASK_UNR_NSIN 0xffff0000
++#define VFPU_INST_UNR_REXP2 0xd01c0000
++#define VFPU_MASK_UNR_REXP2 0xffff0000
++#define VFPU_INST_UNR_RNDS 0xd0200000
++#define VFPU_MASK_UNR_RNDS 0xffff0000
++#define VFPU_INST_UNR_RNDI 0xd0210000
++#define VFPU_MASK_UNR_RNDI 0xffff0000
++#define VFPU_INST_UNR_RNDF1 0xd0220000
++#define VFPU_MASK_UNR_RNDF1 0xffff0000
++#define VFPU_INST_UNR_RNDF2 0xd0230000
++#define VFPU_MASK_UNR_RNDF2 0xffff0000
++#define VFPU_INST_UNR_F2H 0xd0320000
++#define VFPU_MASK_UNR_F2H 0xffff0000
++#define VFPU_INST_UNR_H2F 0xd0330000
++#define VFPU_MASK_UNR_H2F 0xffff0000
++#define VFPU_INST_UNR_SBZ 0xd0360000
++#define VFPU_MASK_UNR_SBZ 0xffff0000
++#define VFPU_INST_UNR_LGB 0xd0370000
++#define VFPU_MASK_UNR_LGB 0xffff0000
++#define VFPU_INST_UNR_US2I 0xd03a0000
++#define VFPU_MASK_UNR_US2I 0xffff0000
++#define VFPU_INST_UNR_S2I 0xd03b0000
++#define VFPU_MASK_UNR_S2I 0xffff0000
++#define VFPU_INST_UNR_I2UC 0xd03c0000
++#define VFPU_MASK_UNR_I2UC 0xffff0000
++#define VFPU_INST_UNR_I2C 0xd03d0000
++#define VFPU_MASK_UNR_I2C 0xffff0000
++#define VFPU_INST_UNR_I2US 0xd03e0000
++#define VFPU_MASK_UNR_I2US 0xffff0000
++#define VFPU_INST_UNR_I2S 0xd03f0000
++#define VFPU_MASK_UNR_I2S 0xffff0000
++#define VFPU_INST_UNR_SRT1 0xd0400000
++#define VFPU_MASK_UNR_SRT1 0xffff0000
++#define VFPU_INST_UNR_SRT2 0xd0410000
++#define VFPU_MASK_UNR_SRT2 0xffff0000
++#define VFPU_INST_UNR_BFY1 0xd0420000
++#define VFPU_MASK_UNR_BFY1 0xffff0000
++#define VFPU_INST_UNR_BFY2 0xd0430000
++#define VFPU_MASK_UNR_BFY2 0xffff0000
++#define VFPU_INST_UNR_OCP 0xd0440000
++#define VFPU_MASK_UNR_OCP 0xffff0000
++#define VFPU_INST_UNR_SOCP 0xd0450000
++#define VFPU_MASK_UNR_SOCP 0xffff0000
++#define VFPU_INST_UNR_FAD 0xd0460000
++#define VFPU_MASK_UNR_FAD 0xffff0000
++#define VFPU_INST_UNR_AVG 0xd0470000
++#define VFPU_MASK_UNR_AVG 0xffff0000
++#define VFPU_INST_UNR_SRT3 0xd0480000
++#define VFPU_MASK_UNR_SRT3 0xffff0000
++#define VFPU_INST_UNR_SRT4 0xd0490000
++#define VFPU_MASK_UNR_SRT4 0xffff0000
++#define VFPU_INST_UNR_SGN 0xd04a0000
++#define VFPU_MASK_UNR_SGN 0xffff0000
++#define VFPU_INST_UNR_CF 0xd0500000
++#define VFPU_MASK_UNR_CF 0xffff0080
++#define VFPU_INST_UNR_CT 0xd0510000
++#define VFPU_MASK_UNR_CT 0xffff8000
++#define VFPU_INST_UNR_T4444 0xd0590000
++#define VFPU_MASK_UNR_T4444 0xffff0000
++#define VFPU_INST_UNR_T5551 0xd05a0000
++#define VFPU_MASK_UNR_T5551 0xffff0000
++#define VFPU_INST_UNR_T5650 0xd05b0000
++#define VFPU_MASK_UNR_T5650 0xffff0000
++#define VFPU_INST_UNR_CST 0xd0600000
++#define VFPU_MASK_UNR_CST 0xffe00000
++
++#define VFPU_INST_UNRI_F2I_N 0xd2000000
++#define VFPU_MASK_UNRI_F2I_N 0xffe00000
++#define VFPU_INST_UNRI_F2I_Z 0xd2200000
++#define VFPU_MASK_UNRI_F2I_Z 0xffe00000
++#define VFPU_INST_UNRI_F2I_U 0xd2400000
++#define VFPU_MASK_UNRI_F2I_U 0xffe00000
++#define VFPU_INST_UNRI_F2I_D 0xd2600000
++#define VFPU_MASK_UNRI_F2I_D 0xffe00000
++#define VFPU_INST_UNRI_I2F 0xd2800000
++#define VFPU_MASK_UNRI_I2F 0xffe00000
++#define VFPU_INST_UNRI_CMOV_T 0xd2a00000
++#define VFPU_MASK_UNRI_CMOV_T 0xfff80000
++#define VFPU_INST_UNRI_CMOV_F 0xd2a80000
++#define VFPU_MASK_UNRI_CMOV_F 0xfff80000
++#define VFPU_INST_UNRI_WBN 0xd3000000
++#define VFPU_MASK_UNRI_WBN 0xff000000
++
++#define VFPU_INST_PFX_RA 0xdc000000
++#define VFPU_MASK_PFX_RA 0xff000000
++#define VFPU_INST_PFX_RB 0xdd000000
++#define VFPU_MASK_PFX_RB 0xff000000
++#define VFPU_INST_PFX_W 0xde000000
++#define VFPU_MASK_PFX_W 0xff000000
++#define VFPU_INST_IIM 0xdf000000
++#define VFPU_MASK_IIM 0xff800000
++#define VFPU_INST_FIM 0xdf800000
++#define VFPU_MASK_FIM 0xff800000
++
++#define VFPU_INST_RPT_MMUL 0xf0000000
++#define VFPU_MASK_RPT_MMUL 0xff800000
++#define VFPU_INST_RPT_TFM2 0xf0800000
++#define VFPU_MASK_RPT_TFM2 0xff800000
++#define VFPU_INST_RPT_TFM3 0xf1000000
++#define VFPU_MASK_RPT_TFM3 0xff800000
++#define VFPU_INST_RPT_TFM4 0xf1800000
++#define VFPU_MASK_RPT_TFM4 0xff800000
++#define VFPU_INST_RPT_MSCL 0xf2000000
++#define VFPU_MASK_RPT_MSCL 0xff800000
++#define VFPU_INST_RPT_QMUL 0xf2800000
++#define VFPU_MASK_RPT_QMUL 0xff800000
++#define VFPU_INST_RPT_MMOV 0xf3800000
++#define VFPU_MASK_RPT_MMOV 0xffff0000
++#define VFPU_INST_RPT_MIDT 0xf3830000
++#define VFPU_MASK_RPT_MIDT 0xffff0000
++#define VFPU_INST_RPT_MZERO 0xf3860000
++#define VFPU_MASK_RPT_MZERO 0xffff0000
++#define VFPU_INST_RPT_MONE 0xf3870000
++#define VFPU_MASK_RPT_MONE 0xffff0000
++#define VFPU_INST_RPT_ROT 0xf3a00000
++#define VFPU_MASK_RPT_ROT 0xffe00000
++
++#define VFPU_INST_SYNC 0xffff0000
++#define VFPU_MASK_SYNC 0xffff0000
++
++#endif /* _VFPU_H_ */
diff --git a/devel/psptoolchain-binutils/files/patch-ld-Makefile.am b/devel/psptoolchain-binutils/files/patch-ld-Makefile.am
new file mode 100644
index 000000000000..8461f7f8cd19
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-ld-Makefile.am
@@ -0,0 +1,20 @@
+--- ld/Makefile.am.orig 2005-01-20 19:37:49.000000000 +0000
++++ ld/Makefile.am 2006-05-09 02:55:36.000000000 +0100
+@@ -190,6 +190,7 @@
+ eelf_i386_chaos.o \
+ eelf_i386_fbsd.o \
+ eelf_i386_ldso.o \
++ eelf_mipsallegrexel_psp.o \
+ eelf_s390.o \
+ egld960.o \
+ egld960coff.o \
+@@ -864,6 +865,9 @@
+ eelf_i386_ldso.c: $(srcdir)/emulparams/elf_i386_ldso.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf_i386_ldso "$(tdir_elf_i386_ldso)"
++eelf_mipsallegrexel_psp.c: $(srcdir)/emulparams/elf_mipsallegrexel_psp.sh \
++ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf_psp.sc ${GEN_DEPENDS}
++ ${GENSCRIPTS} elf_mipsallegrexel_psp "$(tdir_elf_mipsallegrexel_psp)"
+ eelf_s390.c: $(srcdir)/emulparams/elf_s390.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf_s390 "$(tdir_elf_s390)"
diff --git a/devel/psptoolchain-binutils/files/patch-ld-Makefile.in b/devel/psptoolchain-binutils/files/patch-ld-Makefile.in
new file mode 100644
index 000000000000..9f69f489b25a
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-ld-Makefile.in
@@ -0,0 +1,20 @@
+--- ld/Makefile.in.orig 2005-01-23 05:36:37.000000000 +0000
++++ ld/Makefile.in 2006-05-09 02:55:36.000000000 +0100
+@@ -315,6 +315,7 @@
+ eelf_i386_chaos.o \
+ eelf_i386_fbsd.o \
+ eelf_i386_ldso.o \
++ eelf_mipsallegrexel_psp.o \
+ eelf_s390.o \
+ egld960.o \
+ egld960coff.o \
+@@ -1601,6 +1602,9 @@
+ eelf_i386_ldso.c: $(srcdir)/emulparams/elf_i386_ldso.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf_i386_ldso "$(tdir_elf_i386_ldso)"
++eelf_mipsallegrexel_psp.c: $(srcdir)/emulparams/elf_mipsallegrexel_psp.sh \
++ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf_psp.sc ${GEN_DEPENDS}
++ ${GENSCRIPTS} elf_mipsallegrexel_psp "$(tdir_elf_mipsallegrexel_psp)"
+ eelf_s390.c: $(srcdir)/emulparams/elf_s390.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf_s390 "$(tdir_elf_s390)"
diff --git a/devel/psptoolchain-binutils/files/patch-ld-configure.tgt b/devel/psptoolchain-binutils/files/patch-ld-configure.tgt
new file mode 100644
index 000000000000..ba5092d62b25
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-ld-configure.tgt
@@ -0,0 +1,11 @@
+--- ld/configure.tgt.orig 2005-02-08 19:54:27.000000000 +0000
++++ ld/configure.tgt 2006-05-09 02:55:36.000000000 +0100
+@@ -428,6 +428,8 @@
+ mips*vr4100-*-elf*) targ_emul=elf32b4300 ;;
+ mips*vr5000el-*-elf*) targ_emul=elf32l4300 ;;
+ mips*vr5000-*-elf*) targ_emul=elf32b4300 ;;
++mips*allegrexel-psp-elf*) targ_emul=elf_mipsallegrexel_psp
++ targ_extra_emuls="elf32elmip" ;;
+ mips*el-*-elf*) targ_emul=elf32elmip ;;
+ mips*-*-elf*) targ_emul=elf32ebmip ;;
+ mips*el-*-rtems*) targ_emul=elf32elmip ;;
diff --git a/devel/psptoolchain-binutils/files/patch-ld-emulparams-elf_mipsallegrexel_psp.sh b/devel/psptoolchain-binutils/files/patch-ld-emulparams-elf_mipsallegrexel_psp.sh
new file mode 100644
index 000000000000..0db09c50b9cb
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-ld-emulparams-elf_mipsallegrexel_psp.sh
@@ -0,0 +1,25 @@
+--- ld/emulparams/elf_mipsallegrexel_psp.sh.orig 1970-01-01 01:00:00.000000000 +0100
++++ ld/emulparams/elf_mipsallegrexel_psp.sh 2006-05-09 02:55:36.000000000 +0100
+@@ -0,0 +1,22 @@
++# Based off of the default elf32 MIPS target. However, we use a seperate
++# script template because the PSP architecture defines sections that normally
++# cannot be overriden here and would normally get absorbed (i.e.
++# .rodata.sceModuleInfo would be absorbed into .rodata).
++
++EMBEDDED=yes
++. ${srcdir}/emulparams/elf32lmip.sh
++unset NONPAGED_TEXT_START_ADDR
++unset SHLIB_TEXT_START_ADDR
++unset COMMONPAGESIZE
++
++SCRIPT_NAME=elf_psp
++TEXT_START_ADDR=0x08900000
++MAXPAGESIZE=256
++ARCH="mips:allegrex"
++MACHINE=
++TEMPLATE_NAME=elf32
++GENERATE_SHLIB_SCRIPT=yes
++DYNAMIC_LINK=FALSE
++
++# Discard the .comment and .pdr sections.
++OTHER_SECTIONS="/DISCARD/ : { *(.comment) *(.pdr) }"
diff --git a/devel/psptoolchain-binutils/files/patch-ld-scripttempl-elf_psp.sc b/devel/psptoolchain-binutils/files/patch-ld-scripttempl-elf_psp.sc
new file mode 100644
index 000000000000..9a6c206ae071
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-ld-scripttempl-elf_psp.sc
@@ -0,0 +1,499 @@
+--- ld/scripttempl/elf_psp.sc.orig 1970-01-01 01:00:00.000000000 +0100
++++ ld/scripttempl/elf_psp.sc 2006-05-09 02:55:36.000000000 +0100
+@@ -0,0 +1,496 @@
++#
++# Unusual variables checked by this code:
++# NOP - four byte opcode for no-op (defaults to 0)
++# NO_SMALL_DATA - no .sbss/.sbss2/.sdata/.sdata2 sections if not
++# empty.
++# SMALL_DATA_CTOR - .ctors contains small data.
++# SMALL_DATA_DTOR - .dtors contains small data.
++# DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
++# INITIAL_READONLY_SECTIONS - at start of text segment
++# OTHER_READONLY_SECTIONS - other than .text .init .rodata ...
++# (e.g., .PARISC.milli)
++# OTHER_TEXT_SECTIONS - these get put in .text when relocating
++# OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ...
++# (e.g., .PARISC.global)
++# OTHER_RELRO_SECTIONS - other than .data.rel.ro ...
++# (e.g. PPC32 .fixup, .got[12])
++# OTHER_BSS_SECTIONS - other than .bss .sbss ...
++# OTHER_SECTIONS - at the end
++# EXECUTABLE_SYMBOLS - symbols that must be defined for an
++# executable (e.g., _DYNAMIC_LINK)
++# TEXT_START_ADDR - the first byte of the text segment, after any
++# headers.
++# TEXT_BASE_ADDRESS - the first byte of the text segment.
++# TEXT_START_SYMBOLS - symbols that appear at the start of the
++# .text section.
++# DATA_START_SYMBOLS - symbols that appear at the start of the
++# .data section.
++# OTHER_GOT_SYMBOLS - symbols defined just before .got.
++# OTHER_GOT_SECTIONS - sections just after .got.
++# OTHER_SDATA_SECTIONS - sections just after .sdata.
++# OTHER_BSS_SYMBOLS - symbols that appear at the start of the
++# .bss section besides __bss_start.
++# DATA_PLT - .plt should be in data segment, not text segment.
++# PLT_BEFORE_GOT - .plt just before .got when .plt is in data segement.
++# BSS_PLT - .plt should be in bss segment
++# TEXT_DYNAMIC - .dynamic in text segment, not data segment.
++# EMBEDDED - whether this is for an embedded system.
++# SHLIB_TEXT_START_ADDR - if set, add to SIZEOF_HEADERS to set
++# start address of shared library.
++# INPUT_FILES - INPUT command of files to always include
++# WRITABLE_RODATA - if set, the .rodata section should be writable
++# INIT_START, INIT_END - statements just before and just after
++# combination of .init sections.
++# FINI_START, FINI_END - statements just before and just after
++# combination of .fini sections.
++# STACK_ADDR - start of a .stack section.
++# OTHER_END_SYMBOLS - symbols to place right at the end of the script.
++# SEPARATE_GOTPLT - if set, .got.plt should be separate output section,
++# so that .got can be in the RELRO area. It should be set to
++# the number of bytes in the beginning of .got.plt which can be
++# in the RELRO area as well.
++#
++# When adding sections, do note that the names of some sections are used
++# when specifying the start address of the next.
++#
++
++# Many sections come in three flavours. There is the 'real' section,
++# like ".data". Then there are the per-procedure or per-variable
++# sections, generated by -ffunction-sections and -fdata-sections in GCC,
++# and useful for --gc-sections, which for a variable "foo" might be
++# ".data.foo". Then there are the linkonce sections, for which the linker
++# eliminates duplicates, which are named like ".gnu.linkonce.d.foo".
++# The exact correspondences are:
++#
++# Section Linkonce section
++# .text .gnu.linkonce.t.foo
++# .rodata .gnu.linkonce.r.foo
++# .data .gnu.linkonce.d.foo
++# .bss .gnu.linkonce.b.foo
++# .sdata .gnu.linkonce.s.foo
++# .sbss .gnu.linkonce.sb.foo
++# .sdata2 .gnu.linkonce.s2.foo
++# .sbss2 .gnu.linkonce.sb2.foo
++# .debug_info .gnu.linkonce.wi.foo
++# .tdata .gnu.linkonce.td.foo
++# .tbss .gnu.linkonce.tb.foo
++#
++# Each of these can also have corresponding .rel.* and .rela.* sections.
++
++test -z "$ENTRY" && ENTRY=_start
++test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
++test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
++if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi
++test -z "${ELFSIZE}" && ELFSIZE=32
++test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8"
++test "$LD_FLAG" = "N" && DATA_ADDR=.
++test -n "$CREATE_SHLIB$CREATE_PIE" && test -n "$SHLIB_DATA_ADDR" && COMMONPAGESIZE=""
++test -z "$CREATE_SHLIB$CREATE_PIE" && test -n "$DATA_ADDR" && COMMONPAGESIZE=""
++test -n "$RELRO_NOW" && unset SEPARATE_GOTPLT
++DATA_SEGMENT_ALIGN="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))"
++DATA_SEGMENT_RELRO_END=""
++DATA_SEGMENT_RELRO_GOTPLT_END=""
++DATA_SEGMENT_END=""
++if test -n "${COMMONPAGESIZE}"; then
++ DATA_SEGMENT_ALIGN="ALIGN (${SEGMENT_SIZE}) - ((${MAXPAGESIZE} - .) & (${MAXPAGESIZE} - 1)); . = DATA_SEGMENT_ALIGN (${MAXPAGESIZE}, ${COMMONPAGESIZE})"
++ DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);"
++ if test -n "${SEPARATE_GOTPLT}"; then
++ DATA_SEGMENT_RELRO_GOTPLT_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT}, .);"
++ else
++ DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (0, .);"
++ fi
++fi
++INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
++PLT=".plt ${RELOCATING-0} : { *(.plt) }"
++if test -z "$GOT"; then
++ if test -z "$SEPARATE_GOTPLT"; then
++ GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.got) }"
++ else
++ GOT=".got ${RELOCATING-0} : { *(.got) }"
++ GOTPLT="${RELOCATING+${DATA_SEGMENT_RELRO_GOTPLT_END}}
++ .got.plt ${RELOCATING-0} : { *(.got.plt) }"
++ fi
++fi
++DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }"
++RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
++DATARELRO=".data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) }"
++STACKNOTE="/DISCARD/ : { *(.note.GNU-stack) }"
++if test -z "${NO_SMALL_DATA}"; then
++ SBSS=".sbss ${RELOCATING-0} :
++ {
++ ${RELOCATING+PROVIDE (__sbss_start = .);}
++ ${RELOCATING+PROVIDE (___sbss_start = .);}
++ ${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)}
++ *(.dynsbss)
++ *(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*})
++ *(.scommon)
++ ${RELOCATING+PROVIDE (__sbss_end = .);}
++ ${RELOCATING+PROVIDE (___sbss_end = .);}
++ }"
++ SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }"
++ SDATA="/* We want the small data sections together, so single-instruction offsets
++ can access them all, and initialized data all before uninitialized, so
++ we can shorten the on-disk segment size. */
++ .sdata ${RELOCATING-0} :
++ {
++ ${RELOCATING+${SDATA_START_SYMBOLS}}
++ ${CREATE_SHLIB+*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)}
++ *(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*})
++ }"
++ SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) }"
++ REL_SDATA=".rel.sdata ${RELOCATING-0} : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) }
++ .rela.sdata ${RELOCATING-0} : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }"
++ REL_SBSS=".rel.sbss ${RELOCATING-0} : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) }
++ .rela.sbss ${RELOCATING-0} : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }"
++ REL_SDATA2=".rel.sdata2 ${RELOCATING-0} : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) }
++ .rela.sdata2 ${RELOCATING-0} : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }"
++ REL_SBSS2=".rel.sbss2 ${RELOCATING-0} : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) }
++ .rela.sbss2 ${RELOCATING-0} : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }"
++else
++ NO_SMALL_DATA=" "
++fi
++test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" "
++CTOR=".ctors ${CONSTRUCTING-0} :
++ {
++ ${CONSTRUCTING+${CTOR_START}}
++ /* gcc uses crtbegin.o to find the start of
++ the constructors, so we make sure it is
++ first. Because this is a wildcard, it
++ doesn't matter if the user does not
++ actually link against crtbegin.o; the
++ linker won't look for a file to match a
++ wildcard. The wildcard also means that it
++ doesn't matter which directory crtbegin.o
++ is in. */
++
++ KEEP (*crtbegin*.o(.ctors))
++
++ /* We don't want to include the .ctor section from
++ from the crtend.o file until after the sorted ctors.
++ The .ctor section from the crtend file contains the
++ end of ctors marker and it must be last */
++
++ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .ctors))
++ KEEP (*(SORT(.ctors.*)))
++ KEEP (*(.ctors))
++ ${CONSTRUCTING+${CTOR_END}}
++ }"
++DTOR=".dtors ${CONSTRUCTING-0} :
++ {
++ ${CONSTRUCTING+${DTOR_START}}
++ KEEP (*crtbegin*.o(.dtors))
++ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .dtors))
++ KEEP (*(SORT(.dtors.*)))
++ KEEP (*(.dtors))
++ ${CONSTRUCTING+${DTOR_END}}
++ }"
++STACK=" .stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} :
++ {
++ ${RELOCATING+_stack = .;}
++ *(.stack)
++ }"
++
++# if this is for an embedded system, don't add SIZEOF_HEADERS.
++if [ -z "$EMBEDDED" ]; then
++ test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR} + SIZEOF_HEADERS"
++else
++ test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR}"
++fi
++
++cat <<EOF
++OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
++ "${LITTLE_OUTPUT_FORMAT}")
++OUTPUT_ARCH(${OUTPUT_ARCH})
++ENTRY(${ENTRY})
++
++${RELOCATING+${LIB_SEARCH_DIRS}}
++${RELOCATING+/* Do we need any of these for elf?
++ __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */}
++${RELOCATING+${EXECUTABLE_SYMBOLS}}
++${RELOCATING+${INPUT_FILES}}
++${RELOCATING- /* For some reason, the Solaris linker makes bad executables
++ if gld -r is used and the intermediate file has sections starting
++ at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
++ bug. But for now assigning the zero vmas works. */}
++
++SECTIONS
++{
++ /* Read-only sections, merged into text segment: */
++ ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+PROVIDE (__executable_start = ${TEXT_START_ADDR}); . = ${TEXT_BASE_ADDRESS};}}}
++ ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}}
++ ${CREATE_PIE+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}}
++ ${CREATE_SHLIB-${INTERP}}
++ ${INITIAL_READONLY_SECTIONS}
++ ${TEXT_DYNAMIC+${DYNAMIC}}
++ .hash ${RELOCATING-0} : { *(.hash) }
++ .dynsym ${RELOCATING-0} : { *(.dynsym) }
++ .dynstr ${RELOCATING-0} : { *(.dynstr) }
++ .gnu.version ${RELOCATING-0} : { *(.gnu.version) }
++ .gnu.version_d ${RELOCATING-0}: { *(.gnu.version_d) }
++ .gnu.version_r ${RELOCATING-0}: { *(.gnu.version_r) }
++
++EOF
++if [ "x$COMBRELOC" = x ]; then
++ COMBRELOCCAT=cat
++else
++ COMBRELOCCAT="cat > $COMBRELOC"
++fi
++eval $COMBRELOCCAT <<EOF
++ .rel.init ${RELOCATING-0} : { *(.rel.init) }
++ .rela.init ${RELOCATING-0} : { *(.rela.init) }
++ .rel.text ${RELOCATING-0} : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) }
++ .rela.text ${RELOCATING-0} : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) }
++ .rel.fini ${RELOCATING-0} : { *(.rel.fini) }
++ .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
++
++ /* PSP-specific relocations. */
++ .rel.sceStub.text ${RELOCATING-0} : { *(.rel.sceStub.text) *(SORT(.rel.sceStub.text.*)) }
++ .rel.lib.ent.top ${RELOCATING-0} : { *(.rel.lib.ent.top) }
++ .rel.lib.ent ${RELOCATING-0} : { *(.rel.lib.ent) }
++ .rel.lib.ent.btm ${RELOCATING-0} : { *(.rel.lib.ent.btm) }
++ .rel.lib.stub.top ${RELOCATING-0} : { *(.rel.lib.stub.top) }
++ .rel.lib.stub ${RELOCATING-0} : { *(.rel.lib.stub) }
++ .rel.lib.stub.btm ${RELOCATING-0} : { *(.rel.lib.stub.btm) }
++ .rel.rodata.sceModuleInfo ${RELOCATING-0} : { *(.rel.rodata.sceModuleInfo) }
++ .rel.rodata.sceResident ${RELOCATING-0} : { *(.rel.rodata.sceResident) }
++ .rel.rodata.sceNid ${RELOCATING-0} : { *(.rel.rodata.sceNid) }
++ .rel.rodata.sceVstub ${RELOCATING-0} : { *(.rel.rodata.sceVstub) *(SORT(.rel.rodata.sceVstub.*)) }
++
++ .rel.rodata ${RELOCATING-0} : { *(.rel.rodata${RELOCATING+ .rel.rodata.* .rel.gnu.linkonce.r.*}) }
++ .rela.rodata ${RELOCATING-0} : { *(.rela.rodata${RELOCATING+ .rela.rodata.* .rela.gnu.linkonce.r.*}) }
++ ${OTHER_READONLY_RELOC_SECTIONS}
++ .rel.data.rel.ro ${RELOCATING-0} : { *(.rel.data.rel.ro${RELOCATING+*}) }
++ .rela.data.rel.ro ${RELOCATING-0} : { *(.rel.data.rel.ro${RELOCATING+*}) }
++ .rel.data ${RELOCATING-0} : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) }
++ .rela.data ${RELOCATING-0} : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) }
++ .rel.tdata ${RELOCATING-0} : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) }
++ .rela.tdata ${RELOCATING-0} : { *(.rela.tdata${RELOCATING+ .rela.tdata.* .rela.gnu.linkonce.td.*}) }
++ .rel.tbss ${RELOCATING-0} : { *(.rel.tbss${RELOCATING+ .rel.tbss.* .rel.gnu.linkonce.tb.*}) }
++ .rela.tbss ${RELOCATING-0} : { *(.rela.tbss${RELOCATING+ .rela.tbss.* .rela.gnu.linkonce.tb.*}) }
++ .rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
++ .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
++ .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
++ .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
++ .rel.got ${RELOCATING-0} : { *(.rel.got) }
++ .rela.got ${RELOCATING-0} : { *(.rela.got) }
++ ${OTHER_GOT_RELOC_SECTIONS}
++ ${REL_SDATA}
++ ${REL_SBSS}
++ ${REL_SDATA2}
++ ${REL_SBSS2}
++ .rel.bss ${RELOCATING-0} : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) }
++ .rela.bss ${RELOCATING-0} : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) }
++EOF
++if [ -n "$COMBRELOC" ]; then
++cat <<EOF
++ .rel.dyn ${RELOCATING-0} :
++ {
++EOF
++sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC
++cat <<EOF
++ }
++ .rela.dyn ${RELOCATING-0} :
++ {
++EOF
++sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC
++cat <<EOF
++ }
++EOF
++fi
++cat <<EOF
++ .rel.plt ${RELOCATING-0} : { *(.rel.plt) }
++ .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
++ ${OTHER_PLT_RELOC_SECTIONS}
++
++ .init ${RELOCATING-0} :
++ {
++ ${RELOCATING+${INIT_START}}
++ KEEP (*(.init))
++ ${RELOCATING+${INIT_END}}
++ } =${NOP-0}
++
++ ${DATA_PLT-${BSS_PLT-${PLT}}}
++ .text ${RELOCATING-0} :
++ {
++ ${RELOCATING+${TEXT_START_SYMBOLS}}
++ *(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
++ KEEP (*(.text.*personality*))
++ /* .gnu.warning sections are handled specially by elf32.em. */
++ *(.gnu.warning)
++ ${RELOCATING+${OTHER_TEXT_SECTIONS}}
++ } =${NOP-0}
++ .fini ${RELOCATING-0} :
++ {
++ ${RELOCATING+${FINI_START}}
++ KEEP (*(.fini))
++ ${RELOCATING+${FINI_END}}
++ } =${NOP-0}
++
++ /* PSP library stub functions. */
++ .sceStub.text ${RELOCATING-0} : { *(.sceStub.text) *(SORT(.sceStub.text.*)) }
++
++ ${RELOCATING+PROVIDE (__etext = .);}
++ ${RELOCATING+PROVIDE (_etext = .);}
++ ${RELOCATING+PROVIDE (etext = .);}
++
++ /* PSP library entry table and library stub table. */
++ .lib.ent.top ${RELOCATING-0} : { *(.lib.ent.top) }
++ .lib.ent ${RELOCATING-0} : { *(.lib.ent) }
++ .lib.ent.btm ${RELOCATING-0} : { *(.lib.ent.btm) }
++
++ .lib.stub.top ${RELOCATING-0} : { *(.lib.stub.top) }
++ .lib.stub ${RELOCATING-0} : { *(.lib.stub) }
++ .lib.stub.btm ${RELOCATING-0} : { *(.lib.stub.btm) }
++
++ /* PSP read-only data for module info, NIDs, and Vstubs. The
++ .rodata.sceModuleInfo section must appear before the .rodata section
++ otherwise it would get absorbed into .rodata and the PSP bootloader
++ would be unable to locate the module info structure. */
++ .rodata.sceModuleInfo ${RELOCATING-0} : { *(.rodata.sceModuleInfo) }
++ .rodata.sceResident ${RELOCATING-0} : { *(.rodata.sceResident) }
++ .rodata.sceNid ${RELOCATING-0} : { *(.rodata.sceNid) }
++ .rodata.sceVstub ${RELOCATING-0} : { *(.rodata.sceVstub) *(SORT(.rodata.sceVstub.*)) }
++
++ ${WRITABLE_RODATA-${RODATA}}
++ .rodata1 ${RELOCATING-0} : { *(.rodata1) }
++ ${CREATE_SHLIB-${SDATA2}}
++ ${CREATE_SHLIB-${SBSS2}}
++ ${OTHER_READONLY_SECTIONS}
++ .eh_frame_hdr : { *(.eh_frame_hdr) }
++ .eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
++ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
++
++ /* Adjust the address for the data segment. We want to adjust up to
++ the same address within the page on the next page up. */
++ ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}}
++ ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
++ ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
++
++ /* Exception handling */
++ .eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
++ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
++
++ /* Thread Local Storage sections */
++ .tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
++ .tbss ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
++
++ /* Ensure the __preinit_array_start label is properly aligned. We
++ could instead move the label definition inside the section, but
++ the linker would then create the section even if it turns out to
++ be empty, which isn't pretty. */
++ ${RELOCATING+. = ALIGN(${ALIGNMENT});}
++ ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_start = .);}}
++ .preinit_array ${RELOCATING-0} : { KEEP (*(.preinit_array)) }
++ ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_end = .);}}
++
++ ${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_start = .);}}
++ .init_array ${RELOCATING-0} : { KEEP (*(.init_array)) }
++ ${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_end = .);}}
++
++ ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_start = .);}}
++ .fini_array ${RELOCATING-0} : { KEEP (*(.fini_array)) }
++ ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_end = .);}}
++
++ ${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}}
++ ${SMALL_DATA_DTOR-${RELOCATING+${DTOR}}}
++ .jcr ${RELOCATING-0} : { KEEP (*(.jcr)) }
++
++ ${RELOCATING+${DATARELRO}}
++ ${OTHER_RELRO_SECTIONS}
++ ${TEXT_DYNAMIC-${DYNAMIC}}
++ ${NO_SMALL_DATA+${RELRO_NOW+${GOT}}}
++ ${NO_SMALL_DATA+${RELRO_NOW-${SEPARATE_GOTPLT+${GOT}}}}
++ ${NO_SMALL_DATA+${RELRO_NOW-${SEPARATE_GOTPLT+${GOTPLT}}}}
++ ${RELOCATING+${DATA_SEGMENT_RELRO_END}}
++ ${NO_SMALL_DATA+${RELRO_NOW-${SEPARATE_GOTPLT-${GOT}}}}
++
++ ${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}}
++
++ .data ${RELOCATING-0} :
++ {
++ ${RELOCATING+${DATA_START_SYMBOLS}}
++ *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*})
++ KEEP (*(.gnu.linkonce.d.*personality*))
++ ${CONSTRUCTING+SORT(CONSTRUCTORS)}
++ }
++ .data1 ${RELOCATING-0} : { *(.data1) }
++ ${WRITABLE_RODATA+${RODATA}}
++ ${OTHER_READWRITE_SECTIONS}
++ ${SMALL_DATA_CTOR+${RELOCATING+${CTOR}}}
++ ${SMALL_DATA_DTOR+${RELOCATING+${DTOR}}}
++ ${DATA_PLT+${PLT_BEFORE_GOT+${PLT}}}
++ ${RELOCATING+${OTHER_GOT_SYMBOLS}}
++ ${NO_SMALL_DATA-${GOT}}
++ ${OTHER_GOT_SECTIONS}
++ ${SDATA}
++ ${OTHER_SDATA_SECTIONS}
++ ${RELOCATING+_edata = .;}
++ ${RELOCATING+PROVIDE (edata = .);}
++ ${RELOCATING+__bss_start = .;}
++ ${RELOCATING+${OTHER_BSS_SYMBOLS}}
++ ${SBSS}
++ ${BSS_PLT+${PLT}}
++ .bss ${RELOCATING-0} :
++ {
++ *(.dynbss)
++ *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
++ *(COMMON)
++ /* Align here to ensure that the .bss section occupies space up to
++ _end. Align after .bss to ensure correct alignment even if the
++ .bss section disappears because there are no input sections. */
++ ${RELOCATING+. = ALIGN(${ALIGNMENT});}
++ }
++ ${OTHER_BSS_SECTIONS}
++ ${RELOCATING+. = ALIGN(${ALIGNMENT});}
++ ${RELOCATING+_end = .;}
++ ${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
++ ${RELOCATING+PROVIDE (end = .);}
++ ${RELOCATING+${DATA_SEGMENT_END}}
++
++ /* Stabs debugging sections. */
++ .stab 0 : { *(.stab) }
++ .stabstr 0 : { *(.stabstr) }
++ .stab.excl 0 : { *(.stab.excl) }
++ .stab.exclstr 0 : { *(.stab.exclstr) }
++ .stab.index 0 : { *(.stab.index) }
++ .stab.indexstr 0 : { *(.stab.indexstr) }
++
++ .comment 0 : { *(.comment) }
++
++ /* DWARF debug sections.
++ Symbols in the DWARF debugging sections are relative to the beginning
++ of the section so we begin them at 0. */
++
++ /* DWARF 1 */
++ .debug 0 : { *(.debug) }
++ .line 0 : { *(.line) }
++
++ /* GNU DWARF 1 extensions */
++ .debug_srcinfo 0 : { *(.debug_srcinfo) }
++ .debug_sfnames 0 : { *(.debug_sfnames) }
++
++ /* DWARF 1.1 and DWARF 2 */
++ .debug_aranges 0 : { *(.debug_aranges) }
++ .debug_pubnames 0 : { *(.debug_pubnames) }
++
++ /* DWARF 2 */
++ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
++ .debug_abbrev 0 : { *(.debug_abbrev) }
++ .debug_line 0 : { *(.debug_line) }
++ .debug_frame 0 : { *(.debug_frame) }
++ .debug_str 0 : { *(.debug_str) }
++ .debug_loc 0 : { *(.debug_loc) }
++ .debug_macinfo 0 : { *(.debug_macinfo) }
++
++ /* SGI/MIPS DWARF 2 extensions */
++ .debug_weaknames 0 : { *(.debug_weaknames) }
++ .debug_funcnames 0 : { *(.debug_funcnames) }
++ .debug_typenames 0 : { *(.debug_typenames) }
++ .debug_varnames 0 : { *(.debug_varnames) }
++
++ ${STACK_ADDR+${STACK}}
++ ${OTHER_SECTIONS}
++ ${RELOCATING+${OTHER_END_SYMBOLS}}
++ ${RELOCATING+${STACKNOTE}}
++}
++EOF
diff --git a/devel/psptoolchain-binutils/files/patch-opcodes-configure b/devel/psptoolchain-binutils/files/patch-opcodes-configure
new file mode 100644
index 000000000000..806d3bd115ef
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-opcodes-configure
@@ -0,0 +1,13 @@
+--- opcodes/configure.orig 2009-02-26 14:47:03.000000000 +0100
++++ opcodes/configure 2009-02-26 14:47:35.000000000 +0100
+@@ -4345,8 +4345,8 @@
+ bfdlibdir='$(libdir)'
+ bfdincludedir='$(includedir)'
+ if test "${host}" != "${target}"; then
+- bfdlibdir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/lib'
+- bfdincludedir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/include'
++ bfdlibdir='$(exec_prefix)/$(target_noncanonical)/lib'
++ bfdincludedir='$(exec_prefix)/$(target_noncanonical)/include'
+ fi
+
+
diff --git a/devel/psptoolchain-binutils/files/patch-opcodes-mips-dis.c b/devel/psptoolchain-binutils/files/patch-opcodes-mips-dis.c
new file mode 100644
index 000000000000..3e9113d22460
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-opcodes-mips-dis.c
@@ -0,0 +1,556 @@
+--- opcodes/mips-dis.c.orig 2005-03-03 11:49:50.000000000 +0000
++++ opcodes/mips-dis.c 2006-05-09 02:55:36.000000000 +0100
+@@ -140,6 +140,139 @@
+ "c0_taglo", "c0_taghi", "c0_errorepc", "c0_desave",
+ };
+
++static const char * const vfpu_sreg_names[128] = {
++ "S000", "S010", "S020", "S030", "S100", "S110", "S120", "S130",
++ "S200", "S210", "S220", "S230", "S300", "S310", "S320", "S330",
++ "S400", "S410", "S420", "S430", "S500", "S510", "S520", "S530",
++ "S600", "S610", "S620", "S630", "S700", "S710", "S720", "S730",
++ "S001", "S011", "S021", "S031", "S101", "S111", "S121", "S131",
++ "S201", "S211", "S221", "S231", "S301", "S311", "S321", "S331",
++ "S401", "S411", "S421", "S431", "S501", "S511", "S521", "S531",
++ "S601", "S611", "S621", "S631", "S701", "S711", "S721", "S731",
++ "S002", "S012", "S022", "S032", "S102", "S112", "S122", "S132",
++ "S202", "S212", "S222", "S232", "S302", "S312", "S322", "S332",
++ "S402", "S412", "S422", "S432", "S502", "S512", "S522", "S532",
++ "S602", "S612", "S622", "S632", "S702", "S712", "S722", "S732",
++ "S003", "S013", "S023", "S033", "S103", "S113", "S123", "S133",
++ "S203", "S213", "S223", "S233", "S303", "S313", "S323", "S333",
++ "S403", "S413", "S423", "S433", "S503", "S513", "S523", "S533",
++ "S603", "S613", "S623", "S633", "S703", "S713", "S723", "S733"
++};
++
++static const char * const vfpu_vpreg_names[128] = {
++ "C000", "C010", "C020", "C030", "C100", "C110", "C120", "C130",
++ "C200", "C210", "C220", "C230", "C300", "C310", "C320", "C330",
++ "C400", "C410", "C420", "C430", "C500", "C510", "C520", "C530",
++ "C600", "C610", "C620", "C630", "C700", "C710", "C720", "C730",
++ "R000", "R001", "R002", "R003", "R100", "R101", "R102", "R103",
++ "R200", "R201", "R202", "R203", "R300", "R301", "R302", "R303",
++ "R400", "R401", "R402", "R403", "R500", "R501", "R502", "R503",
++ "R600", "R601", "R602", "R603", "R700", "R701", "R702", "R703",
++ "C002", "C012", "C022", "C032", "C102", "C112", "C122", "C132",
++ "C202", "C212", "C222", "C232", "C302", "C312", "C322", "C332",
++ "C402", "C412", "C422", "C432", "C502", "C512", "C522", "C532",
++ "C602", "C612", "C622", "C632", "C702", "C712", "C722", "C732",
++ "R020", "R021", "R022", "R023", "R120", "R121", "R122", "R123",
++ "R220", "R221", "R222", "R223", "R320", "R321", "R322", "R323",
++ "R420", "R421", "R422", "R423", "R520", "R521", "R522", "R523",
++ "R620", "R621", "R622", "R623", "R720", "R721", "R722", "R723"
++};
++
++static const char * const vfpu_vtreg_names[128] = {
++ "C000", "C010", "C020", "C030", "C100", "C110", "C120", "C130",
++ "C200", "C210", "C220", "C230", "C300", "C310", "C320", "C330",
++ "C400", "C410", "C420", "C430", "C500", "C510", "C520", "C530",
++ "C600", "C610", "C620", "C630", "C700", "C710", "C720", "C730",
++ "R000", "R001", "R002", "R003", "R100", "R101", "R102", "R103",
++ "R200", "R201", "R202", "R203", "R300", "R301", "R302", "R303",
++ "R400", "R401", "R402", "R403", "R500", "R501", "R502", "R503",
++ "R600", "R601", "R602", "R603", "R700", "R701", "R702", "R703",
++ "C001", "C011", "C021", "C031", "C101", "C111", "C121", "C131",
++ "C201", "C211", "C221", "C231", "C301", "C311", "C321", "C331",
++ "C401", "C411", "C421", "C431", "C501", "C511", "C521", "C531",
++ "C601", "C611", "C621", "C631", "C701", "C711", "C721", "C731",
++ "R010", "R011", "R012", "R013", "R110", "R111", "R112", "R113",
++ "R210", "R211", "R212", "R213", "R310", "R311", "R312", "R313",
++ "R410", "R411", "R412", "R413", "R510", "R511", "R512", "R513",
++ "R610", "R611", "R612", "R613", "R710", "R711", "R712", "R713"
++};
++
++static const char * const vfpu_vqreg_names[128] = {
++ "C000", "C010", "C020", "C030", "C100", "C110", "C120", "C130",
++ "C200", "C210", "C220", "C230", "C300", "C310", "C320", "C330",
++ "C400", "C410", "C420", "C430", "C500", "C510", "C520", "C530",
++ "C600", "C610", "C620", "C630", "C700", "C710", "C720", "C730",
++ "R000", "R001", "R002", "R003", "R100", "R101", "R102", "R103",
++ "R200", "R201", "R202", "R203", "R300", "R301", "R302", "R303",
++ "R400", "R401", "R402", "R403", "R500", "R501", "R502", "R503",
++ "R600", "R601", "R602", "R603", "R700", "R701", "R702", "R703",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", ""
++};
++
++static const char * const vfpu_mpreg_names[128] = {
++ "M000", "", "M020", "", "M100", "", "M120", "",
++ "M200", "", "M220", "", "M300", "", "M320", "",
++ "M400", "", "M420", "", "M500", "", "M520", "",
++ "M600", "", "M620", "", "M700", "", "M720", "",
++ "E000", "", "E002", "", "E100", "", "E102", "",
++ "E200", "", "E202", "", "E300", "", "E302", "",
++ "E400", "", "E402", "", "E500", "", "E502", "",
++ "E600", "", "E602", "", "E700", "", "E702", "",
++ "M002", "", "M022", "", "M102", "", "M122", "",
++ "M202", "", "M222", "", "M302", "", "M322", "",
++ "M402", "", "M422", "", "M502", "", "M522", "",
++ "M602", "", "M622", "", "M702", "", "M722", "",
++ "E020", "", "E022", "", "E120", "", "E122", "",
++ "E220", "", "E222", "", "E320", "", "E322", "",
++ "E420", "", "E422", "", "E520", "", "E522", "",
++ "E620", "", "E622", "", "E720", "", "E722", ""
++};
++
++static const char * const vfpu_mtreg_names[128] = {
++ "M000", "M010", "", "", "M100", "M110", "", "",
++ "M200", "M210", "", "", "M300", "M310", "", "",
++ "M400", "M410", "", "", "M500", "M510", "", "",
++ "M600", "M610", "", "", "M700", "M710", "", "",
++ "E000", "E001", "", "", "E100", "E101", "", "",
++ "E200", "E201", "", "", "E300", "E301", "", "",
++ "E400", "E401", "", "", "E500", "E501", "", "",
++ "E600", "E601", "", "", "E700", "E701", "", "",
++ "M001", "M011", "", "", "M101", "M111", "", "",
++ "M201", "M211", "", "", "M301", "M311", "", "",
++ "M401", "M411", "", "", "M501", "M511", "", "",
++ "M601", "M611", "", "", "M701", "M711", "", "",
++ "E010", "E011", "", "", "E110", "E111", "", "",
++ "E210", "E211", "", "", "E310", "E311", "", "",
++ "E410", "E411", "", "", "E510", "E511", "", "",
++ "E610", "E611", "", "", "E710", "E711", "", ""
++};
++
++static const char * const vfpu_mqreg_names[128] = {
++ "M000", "", "", "", "M100", "", "", "",
++ "M200", "", "", "", "M300", "", "", "",
++ "M400", "", "", "", "M500", "", "", "",
++ "M600", "", "", "", "M700", "", "", "",
++ "E000", "", "", "", "E100", "", "", "",
++ "E200", "", "", "", "E300", "", "", "",
++ "E400", "", "", "", "E500", "", "", "",
++ "E600", "", "", "", "E700", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", ""
++};
++
+ static const struct mips_cp0sel_name mips_cp0sel_names_mips3264[] = {
+ { 16, 1, "c0_config1" },
+ { 16, 2, "c0_config2" },
+@@ -288,6 +421,54 @@
+ "$24", "$25", "$26", "$27", "$28", "$29", "$30", "$31"
+ };
+
++static const char * const vfpu_cond_names[16] = {
++ "FL", "EQ", "LT", "LE", "TR", "NE", "GE", "GT",
++ "EZ", "EN", "EI", "ES", "NZ", "NN", "NI", "NS"
++};
++
++static const char * const vfpu_const_names[20] = {
++ "",
++ "VFPU_HUGE",
++ "VFPU_SQRT2",
++ "VFPU_SQRT1_2",
++ "VFPU_2_SQRTPI",
++ "VFPU_2_PI",
++ "VFPU_1_PI",
++ "VFPU_PI_4",
++ "VFPU_PI_2",
++ "VFPU_PI",
++ "VFPU_E",
++ "VFPU_LOG2E",
++ "VFPU_LOG10E",
++ "VFPU_LN2",
++ "VFPU_LN10",
++ "VFPU_2PI",
++ "VFPU_PI_6",
++ "VFPU_LOG10TWO",
++ "VFPU_LOG2TEN",
++ "VFPU_SQRT3_2"
++};
++
++#define VFPU_NUM_CONSTANTS \
++ ((sizeof vfpu_const_names) / (sizeof (vfpu_const_names[0])))
++const unsigned int vfpu_num_constants = VFPU_NUM_CONSTANTS;
++
++static const char * const vfpu_rwb_names[4] = {
++ "wt", "wb", "", ""
++};
++
++static const char * const pfx_cst_names[8] = {
++ "0", "1", "2", "1/2", "3", "1/3", "1/4", "1/6"
++};
++
++static const char * const pfx_swz_names[4] = {
++ "x", "y", "z", "w"
++};
++
++static const char * const pfx_sat_names[4] = {
++ "", "[0:1]", "", "[-1:1]"
++};
++
+ struct mips_abi_choice {
+ const char *name;
+ const char * const *gpr_names;
+@@ -359,6 +540,8 @@
+ mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
+ { "mips5", 1, bfd_mach_mips5, CPU_MIPS5, ISA_MIPS5,
+ mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
++ { "allegrex", 1, bfd_mach_mips_allegrex, CPU_ALLEGREX, ISA_MIPS2,
++ mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
+
+ /* For stock MIPS32, disassemble all applicable MIPS-specified ASEs.
+ Note that MIPS-3D and MDMX are not applicable to MIPS32. (See
+@@ -1031,6 +1214,349 @@
+ (l >> OP_SH_FT) & OP_MASK_FT);
+ break;
+
++ case '?':
++ /* VFPU extensions. */
++ d++;
++ switch (*d)
++ {
++ case '\0':
++ /* xgettext:c-format */
++ (*info->fprintf_func) (info->stream,
++ _("# internal error, incomplete VFPU extension sequence (?)"));
++ return;
++
++ case 'o':
++ delta = (l >> OP_SH_VFPU_DELTA) & OP_MASK_VFPU_DELTA;
++ if (delta & 0x8000)
++ delta |= ~0xffff;
++ (*info->fprintf_func) (info->stream, "%d",
++ delta);
++ break;
++
++ case '0':
++ case '1':
++ case '2':
++ case '3':
++ {
++ unsigned int pos = *d, base = '0';
++ unsigned int negation = (l >> (pos - (base - VFPU_SH_PFX_NEG))) & VFPU_MASK_PFX_NEG;
++ unsigned int constant = (l >> (pos - (base - VFPU_SH_PFX_CST))) & VFPU_MASK_PFX_CST;
++ unsigned int abs_consthi =
++ (l >> (pos - (base - VFPU_SH_PFX_ABS_CSTHI))) & VFPU_MASK_PFX_ABS_CSTHI;
++ unsigned int swz_constlo = (l >> ((pos - base) * 2)) & VFPU_MASK_PFX_SWZ_CSTLO;
++
++ if (negation)
++ (*info->fprintf_func) (info->stream, "-");
++ if (constant)
++ {
++ (*info->fprintf_func) (info->stream, "%s",
++ pfx_cst_names[(abs_consthi << 2) | swz_constlo]);
++ }
++ else
++ {
++ if (abs_consthi)
++ (*info->fprintf_func) (info->stream, "|%s|",
++ pfx_swz_names[swz_constlo]);
++ else
++ (*info->fprintf_func) (info->stream, "%s",
++ pfx_swz_names[swz_constlo]);
++ }
++ }
++ break;
++
++ case '4':
++ case '5':
++ case '6':
++ case '7':
++ {
++ unsigned int pos = *d, base = '4';
++ unsigned int mask = (l >> (pos - (base - VFPU_SH_PFX_MASK))) & VFPU_MASK_PFX_MASK;
++ unsigned int saturation = (l >> ((pos - base) * 2)) & VFPU_MASK_PFX_SAT;
++
++ if (mask)
++ (*info->fprintf_func) (info->stream, "m");
++ else
++ (*info->fprintf_func) (info->stream, "%s",
++ pfx_sat_names[saturation]);
++ }
++ break;
++
++ case 'a':
++ {
++ unsigned int c = (l >> OP_SH_VFPU_CONST) & OP_MASK_VFPU_CONST;
++ if (c < vfpu_num_constants)
++ {
++ (*info->fprintf_func) (info->stream, "%s",
++ vfpu_const_names[c]);
++ }
++ break;
++ }
++
++ case 'b':
++ /* 5-bit immediate value. */
++ (*info->fprintf_func) (info->stream, "%d",
++ (l >> OP_SH_VFPU_IMM5) & OP_MASK_VFPU_IMM5);
++ break;
++
++ case 'c':
++ /* VFPU condition code. */
++ (*info->fprintf_func) (info->stream, "%d",
++ (l >> OP_SH_VFPU_CC) & OP_MASK_VFPU_CC);
++ break;
++
++ case 'e':
++ /* 3-bit immediate value. */
++ (*info->fprintf_func) (info->stream, "%d",
++ (l >> OP_SH_VFPU_IMM3) & OP_MASK_VFPU_IMM3);
++ break;
++
++ case 'f':
++ /* Conditional compare. */
++ (*info->fprintf_func) (info->stream, "%s",
++ vfpu_cond_names[(l >> OP_SH_VFPU_COND) & OP_MASK_VFPU_COND]);
++ /* Apparently this specifier is unused. */
++ d++;
++ break;
++
++ case 'i':
++ /* 8-bit immediate value. */
++ (*info->fprintf_func) (info->stream, "0x%02x",
++ (l >> OP_SH_VFPU_IMM8) & OP_MASK_VFPU_IMM8);
++ break;
++
++ case 'q':
++ /* VFPU control register (vmtvc). */
++ (*info->fprintf_func) (info->stream, "$%d",
++ (l >> OP_SH_VFPU_VMTVC) & OP_MASK_VFPU_VMTVC);
++ break;
++
++ case 'r':
++ /* VFPU control register (vmfvc). */
++ (*info->fprintf_func) (info->stream, "$%d",
++ (l >> OP_SH_VFPU_VMFVC) & OP_MASK_VFPU_VMFVC);
++ break;
++
++ case 'u':
++ /* Convert a VFPU 16-bit floating-point number to IEEE754. */
++ {
++ union float2int {
++ unsigned int i;
++ float f;
++ } float2int;
++ unsigned short float16 = (l >> OP_SH_VFPU_FLOAT16) & OP_MASK_VFPU_FLOAT16;
++ unsigned int sign = (float16 >> VFPU_SH_FLOAT16_SIGN) & VFPU_MASK_FLOAT16_SIGN;
++ int exponent = (float16 >> VFPU_SH_FLOAT16_EXP) & VFPU_MASK_FLOAT16_EXP;
++ unsigned int fraction = float16 & VFPU_MASK_FLOAT16_FRAC;
++ char signchar = '+' + ((sign == 1) * 2);
++
++ if (exponent == VFPU_FLOAT16_EXP_MAX)
++ {
++ if (fraction == 0)
++ (*info->fprintf_func) (info->stream, "%cInf", signchar);
++ else
++ (*info->fprintf_func) (info->stream, "%cNaN", signchar);
++ }
++ else if (exponent == 0 && fraction == 0)
++ {
++ (*info->fprintf_func) (info->stream, "%c0", signchar);
++ }
++ else
++ {
++ if (exponent == 0)
++ {
++ do
++ {
++ fraction <<= 1;
++ exponent--;
++ }
++ while (!(fraction & (VFPU_MASK_FLOAT16_FRAC + 1)));
++
++ fraction &= VFPU_MASK_FLOAT16_FRAC;
++ }
++
++ /* Convert to 32-bit single-precision IEEE754. */
++ float2int.i = sign << 31;
++ float2int.i |= (exponent + 112) << 23;
++ float2int.i |= fraction << 13;
++ (*info->fprintf_func) (info->stream, "%g", float2int.f);
++ }
++ }
++ break;
++
++ case 'w':
++ {
++ const char *elements[4];
++ unsigned int opcode = l & VFPU_MASK_OP_SIZE;
++ unsigned int rotators = (l >> OP_SH_VFPU_ROT) & OP_MASK_VFPU_ROT;
++ unsigned int opsize, rothi, rotlo, negation, i;
++
++ /* Determine the operand size so we'll know how many elements to output. */
++ if (opcode == VFPU_OP_SIZE_PAIR)
++ opsize = 2;
++ else if (opcode == VFPU_OP_SIZE_TRIPLE)
++ opsize = 3;
++ else
++ opsize = (opcode == VFPU_OP_SIZE_QUAD) * 4; /* Sanity check. */
++
++ rothi = (rotators >> VFPU_SH_ROT_HI) & VFPU_MASK_ROT_HI;
++ rotlo = (rotators >> VFPU_SH_ROT_LO) & VFPU_MASK_ROT_LO;
++ negation = (rotators >> VFPU_SH_ROT_NEG) & VFPU_MASK_ROT_NEG;
++
++ if (rothi == rotlo)
++ {
++ if (negation)
++ {
++ elements[0] = "-s";
++ elements[1] = "-s";
++ elements[2] = "-s";
++ elements[3] = "-s";
++ }
++ else
++ {
++ elements[0] = "s";
++ elements[1] = "s";
++ elements[2] = "s";
++ elements[3] = "s";
++ }
++ }
++ else
++ {
++ elements[0] = "0";
++ elements[1] = "0";
++ elements[2] = "0";
++ elements[3] = "0";
++ }
++ if (negation)
++ elements[rothi] = "-s";
++ else
++ elements[rothi] = "s";
++ elements[rotlo] = "c";
++
++ (*info->fprintf_func) (info->stream, "[");
++ i = 0;
++ for (;;)
++ {
++ (*info->fprintf_func) (info->stream, "%s",
++ elements[i++]);
++ if (i >= opsize)
++ break;
++ (*info->fprintf_func) (info->stream, ",");
++ }
++ (*info->fprintf_func) (info->stream, "]");
++ }
++ break;
++
++ case 'd':
++ case 'm':
++ case 'n':
++ case 's':
++ case 't':
++ case 'v':
++ case 'x':
++ {
++ unsigned int vreg = 0;
++
++ /* The first char specifies the bitfield that contains the register number. */
++ switch (*d)
++ {
++ case 'd':
++ case 'v':
++ case 'x':
++ vreg = (l >> OP_SH_VFPU_VD) & OP_MASK_VFPU_VD;
++ break;
++
++ case 'm':
++ /* Combine bits 0-4 of vt with bits 5-6 of vt. */
++ vreg = ((l >> OP_SH_VFPU_VT_LO) & OP_MASK_VFPU_VT_LO)
++ | ((l & OP_MASK_VFPU_VT_HI2) << OP_SH_VFPU_VT_HI);
++ break;
++
++ case 'n':
++ /* Combine bits 0-4 of vt with bit 5 of vt. */
++ vreg = ((l >> OP_SH_VFPU_VT_LO) & OP_MASK_VFPU_VT_LO)
++ | ((l & OP_MASK_VFPU_VT_HI1) << OP_SH_VFPU_VT_HI);
++ break;
++
++ case 's':
++ {
++ unsigned int temp_vreg = l >> OP_SH_VFPU_VS;
++
++ vreg = temp_vreg & OP_MASK_VFPU_VS;
++ if ((l & VFPU_OP_VT_VS_VD) == VFPU_OPCODE_VMMUL)
++ {
++ /* vmmul instructions have the RXC bit (bit 13) inverted. */
++ if (temp_vreg & 0x20)
++ vreg = temp_vreg & 0x5f;
++ else
++ vreg |= 0x20;
++ }
++ }
++ break;
++
++ case 't':
++ vreg = (l >> OP_SH_VFPU_VT) & OP_MASK_VFPU_VT;
++ break;
++ }
++
++ /* The next char is the register set vreg comes from. */
++ d++;
++ switch (*d)
++ {
++ case '0':
++ (*info->fprintf_func) (info->stream, "%s.s",
++ vfpu_sreg_names[vreg]);
++ break;
++
++ case '1':
++ (*info->fprintf_func) (info->stream, "%s.p",
++ vfpu_vpreg_names[vreg]);
++ break;
++
++ case '2':
++ (*info->fprintf_func) (info->stream, "%s.t",
++ vfpu_vtreg_names[vreg]);
++ break;
++
++ case '3':
++ (*info->fprintf_func) (info->stream, "%s.q",
++ vfpu_vqreg_names[vreg]);
++ break;
++
++ case '5':
++ (*info->fprintf_func) (info->stream, "%s.p",
++ vfpu_mpreg_names[vreg]);
++ break;
++
++ case '6':
++ (*info->fprintf_func) (info->stream, "%s.t",
++ vfpu_mtreg_names[vreg]);
++ break;
++
++ case '7':
++ (*info->fprintf_func) (info->stream, "%s.q",
++ vfpu_mqreg_names[vreg]);
++ break;
++
++ default:
++ /* xgettext:c-format */
++ (*info->fprintf_func) (info->stream,
++ _("# internal error, undefined vreg modifier(%c)"),
++ *d);
++ break;
++ }
++
++ /* The last char is unused for disassembly. */
++ d++;
++ }
++ break;
++
++ case 'z':
++ (*info->fprintf_func) (info->stream, "%s",
++ vfpu_rwb_names[(l >> OP_SH_VFPU_RWB) & OP_MASK_VFPU_RWB]);
++ break;
++ }
++ break;
++
+ default:
+ /* xgettext:c-format */
+ (*info->fprintf_func) (info->stream,
diff --git a/devel/psptoolchain-binutils/files/patch-opcodes-mips-opc.c b/devel/psptoolchain-binutils/files/patch-opcodes-mips-opc.c
new file mode 100644
index 000000000000..a584f20a4ac6
--- /dev/null
+++ b/devel/psptoolchain-binutils/files/patch-opcodes-mips-opc.c
@@ -0,0 +1,606 @@
+--- opcodes/mips-opc.c.orig 2005-03-03 11:49:50.000000000 +0000
++++ opcodes/mips-opc.c 2006-05-09 02:55:36.000000000 +0100
+@@ -109,6 +109,7 @@
+ #define N5 (INSN_5400 | INSN_5500)
+ #define N54 INSN_5400
+ #define N55 INSN_5500
++#define AL INSN_ALLEGREX
+
+ #define G1 (T3 \
+ )
+@@ -271,6 +272,7 @@
+ {"bnel", "s,t,p", 0x54000000, 0xfc000000, CBL|RD_s|RD_t, 0, I2|T3 },
+ {"bnel", "s,I,p", 0, (int) M_BNEL_I, INSN_MACRO, 0, I2|T3 },
+ {"break", "", 0x0000000d, 0xffffffff, TRAP, 0, I1 },
++{"break", "B", 0x0000000d, 0xfc00003f, TRAP, 0, AL },
+ {"break", "c", 0x0000000d, 0xfc00ffff, TRAP, 0, I1 },
+ {"break", "c,q", 0x0000000d, 0xfc00003f, TRAP, 0, I1 },
+ {"c.f.d", "S,T", 0x46200030, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I1 },
+@@ -432,7 +434,7 @@
+ {"cabs.un.d", "M,S,T", 0x46200071, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
+ {"cabs.un.ps", "M,S,T", 0x46c00071, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
+ {"cabs.un.s", "M,S,T", 0x46000071, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, M3D },
+-{"cache", "k,o(b)", 0xbc000000, 0xfc000000, RD_b, 0, I3|I32|T3},
++{"cache", "k,o(b)", 0xbc000000, 0xfc000000, RD_b, 0, I3|I32|T3|AL},
+ {"ceil.l.d", "D,S", 0x4620000a, 0xffff003f, WR_D|RD_S|FP_D, 0, I3 },
+ {"ceil.l.s", "D,S", 0x4600000a, 0xffff003f, WR_D|RD_S|FP_S, 0, I3 },
+ {"ceil.w.d", "D,S", 0x4620000e, 0xffff003f, WR_D|RD_S|FP_D, 0, I2 },
+@@ -443,7 +445,9 @@
+ /* cfc2 is at the bottom of the table. */
+ {"cfc3", "t,G", 0x4c400000, 0xffe007ff, LCD|WR_t|RD_C3, 0, I1 },
+ {"clo", "U,s", 0x70000021, 0xfc0007ff, WR_d|WR_t|RD_s, 0, I32|N55 },
++{"clo", "d,s", 0x00000017, 0xfc1f07ff, WR_d|RD_s, 0, AL },
+ {"clz", "U,s", 0x70000020, 0xfc0007ff, WR_d|WR_t|RD_s, 0, I32|N55 },
++{"clz", "d,s", 0x00000016, 0xfc1f07ff, WR_d|RD_s, 0, AL },
+ {"ctc0", "t,G", 0x40c00000, 0xffe007ff, COD|RD_t|WR_CC, 0, I1 },
+ {"ctc1", "t,G", 0x44c00000, 0xffe007ff, COD|RD_t|WR_CC|FP_S, 0, I1 },
+ {"ctc1", "t,S", 0x44c00000, 0xffe007ff, COD|RD_t|WR_CC|FP_S, 0, I1 },
+@@ -465,13 +469,15 @@
+ {"cvt.ps.s","D,V,T", 0x46000026, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, I5 },
+ {"cvt.pw.ps", "D,S", 0x46c00024, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, M3D },
+ {"dabs", "d,v", 0, (int) M_DABS, INSN_MACRO, 0, I3 },
++{"max", "d,v,t", 0x0000002c, 0xfc0007ff, WR_d|RD_s|RD_t, 0, AL },
+ {"dadd", "d,v,t", 0x0000002c, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I3 },
+ {"dadd", "t,r,I", 0, (int) M_DADD_I, INSN_MACRO, 0, I3 },
+ {"daddi", "t,r,j", 0x60000000, 0xfc000000, WR_t|RD_s, 0, I3 },
+ {"daddiu", "t,r,j", 0x64000000, 0xfc000000, WR_t|RD_s, 0, I3 },
++{"min", "d,v,t", 0x0000002d, 0xfc0007ff, WR_d|RD_s|RD_t, 0, AL },
+ {"daddu", "d,v,t", 0x0000002d, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I3 },
+ {"daddu", "t,r,I", 0, (int) M_DADDU_I, INSN_MACRO, 0, I3 },
+-{"dbreak", "", 0x7000003f, 0xffffffff, 0, 0, N5 },
++{"dbreak", "", 0x7000003f, 0xffffffff, 0, 0, N5|AL },
+ {"dclo", "U,s", 0x70000025, 0xfc0007ff, RD_s|WR_d|WR_t, 0, I64|N55 },
+ {"dclz", "U,s", 0x70000024, 0xfc0007ff, RD_s|WR_d|WR_t, 0, I64|N55 },
+ /* dctr and dctw are used on the r5000. */
+@@ -558,7 +564,7 @@
+ {"dremu", "z,s,t", 0x0000001f, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, I3 },
+ {"dremu", "d,v,t", 3, (int) M_DREMU_3, INSN_MACRO, 0, I3 },
+ {"dremu", "d,v,I", 3, (int) M_DREMU_3I, INSN_MACRO, 0, I3 },
+-{"dret", "", 0x7000003e, 0xffffffff, 0, 0, N5 },
++{"dret", "", 0x7000003e, 0xffffffff, 0, 0, N5|AL },
+ {"drol", "d,v,t", 0, (int) M_DROL, INSN_MACRO, 0, I3 },
+ {"drol", "d,v,I", 0, (int) M_DROL_I, INSN_MACRO, 0, I3 },
+ {"dror", "d,v,t", 0, (int) M_DROR, INSN_MACRO, 0, I3 },
+@@ -595,8 +601,8 @@
+ {"dsubu", "d,v,I", 0, (int) M_DSUBU_I, INSN_MACRO, 0, I3 },
+ {"ei", "", 0x41606020, 0xffffffff, WR_t|WR_C0, 0, I33 },
+ {"ei", "t", 0x41606020, 0xffe0ffff, WR_t|WR_C0, 0, I33 },
+-{"eret", "", 0x42000018, 0xffffffff, 0, 0, I3|I32 },
+-{"ext", "t,r,+A,+C", 0x7c000000, 0xfc00003f, WR_t|RD_s, 0, I33 },
++{"eret", "", 0x42000018, 0xffffffff, 0, 0, I3|I32|AL },
++{"ext", "t,r,+A,+C", 0x7c000000, 0xfc00003f, WR_t|RD_s, 0, I33|AL },
+ {"floor.l.d", "D,S", 0x4620000b, 0xffff003f, WR_D|RD_S|FP_D, 0, I3 },
+ {"floor.l.s", "D,S", 0x4600000b, 0xffff003f, WR_D|RD_S|FP_S, 0, I3 },
+ {"floor.w.d", "D,S", 0x4620000f, 0xffff003f, WR_D|RD_S|FP_D, 0, I2 },
+@@ -605,7 +611,7 @@
+ {"flushd", "", 0xbc020000, 0xffffffff, 0, 0, L1 },
+ {"flushid", "", 0xbc030000, 0xffffffff, 0, 0, L1 },
+ {"hibernate","", 0x42000023, 0xffffffff, 0, 0, V1 },
+-{"ins", "t,r,+A,+B", 0x7c000004, 0xfc00003f, WR_t|RD_s, 0, I33 },
++{"ins", "t,r,+A,+B", 0x7c000004, 0xfc00003f, WR_t|RD_s, 0, I33|AL },
+ {"jr", "s", 0x00000008, 0xfc1fffff, UBD|RD_s, 0, I1 },
+ {"jr.hb", "s", 0x00000408, 0xfc1fffff, UBD|RD_s, 0, I33 },
+ {"j", "s", 0x00000008, 0xfc1fffff, UBD|RD_s, 0, I1 }, /* jr */
+@@ -639,18 +645,10 @@
+ {"ld", "t,o(b)", 0xdc000000, 0xfc000000, WR_t|RD_b, 0, I3 },
+ {"ld", "t,o(b)", 0, (int) M_LD_OB, INSN_MACRO, 0, I1 },
+ {"ld", "t,A(b)", 0, (int) M_LD_AB, INSN_MACRO, 0, I1 },
+-{"ldc1", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 },
+-{"ldc1", "E,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 },
+-{"ldc1", "T,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, 0, I2 },
+-{"ldc1", "E,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, 0, I2 },
+-{"l.d", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, /* ldc1 */
+-{"l.d", "T,o(b)", 0, (int) M_L_DOB, INSN_MACRO, 0, I1 },
+-{"l.d", "T,A(b)", 0, (int) M_L_DAB, INSN_MACRO, 0, I1 },
+-{"ldc2", "E,o(b)", 0xd8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 },
+-{"ldc2", "E,A(b)", 0, (int) M_LDC2_AB, INSN_MACRO, 0, I2 },
+-{"ldc3", "E,o(b)", 0xdc000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 },
+-{"ldc3", "E,A(b)", 0, (int) M_LDC3_AB, INSN_MACRO, 0, I2 },
+-{"ldl", "t,o(b)", 0x68000000, 0xfc000000, LDD|WR_t|RD_b, 0, I3 },
++/* ldc1 is at the bottom of the table. */
++/* ldc2 is at the bottom of the table. */
++/* ldc3 is at the bottom of the table. */
++{"ldl", "t,o(b)", 0x68000000, 0xfc000000, LDD|WR_t|RD_b, 0, I3|AL },
+ {"ldl", "t,A(b)", 0, (int) M_LDL_AB, INSN_MACRO, 0, I3 },
+ {"ldr", "t,o(b)", 0x6c000000, 0xfc000000, LDD|WR_t|RD_b, 0, I3 },
+ {"ldr", "t,A(b)", 0, (int) M_LDR_AB, INSN_MACRO, 0, I3 },
+@@ -680,8 +678,7 @@
+ {"lwc1", "E,A(b)", 0, (int) M_LWC1_AB, INSN_MACRO, 0, I1 },
+ {"l.s", "T,o(b)", 0xc4000000, 0xfc000000, CLD|RD_b|WR_T|FP_S, 0, I1 }, /* lwc1 */
+ {"l.s", "T,A(b)", 0, (int) M_LWC1_AB, INSN_MACRO, 0, I1 },
+-{"lwc2", "E,o(b)", 0xc8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I1 },
+-{"lwc2", "E,A(b)", 0, (int) M_LWC2_AB, INSN_MACRO, 0, I1 },
++/* lwc2 is at the bottom of the table. */
+ {"lwc3", "E,o(b)", 0xcc000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I1 },
+ {"lwc3", "E,A(b)", 0, (int) M_LWC3_AB, INSN_MACRO, 0, I1 },
+ {"lwl", "t,o(b)", 0x88000000, 0xfc000000, LDD|RD_b|WR_t, 0, I1 },
+@@ -713,10 +710,12 @@
+ {"madd.s", "D,R,S,T", 0x4c000020, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_S, 0, I4 },
+ {"madd.ps", "D,R,S,T", 0x4c000026, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0, I5 },
+ {"madd", "s,t", 0x0000001c, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 },
++{"madd", "s,t", 0x0000001c, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, AL },
+ {"madd", "s,t", 0x70000000, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55},
+ {"madd", "s,t", 0x70000000, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, G1 },
+ {"madd", "d,s,t", 0x70000000, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d|IS_M, 0, G1 },
+ {"maddu", "s,t", 0x0000001d, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 },
++{"maddu", "s,t", 0x0000001d, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, AL },
+ {"maddu", "s,t", 0x70000001, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55},
+ {"maddu", "s,t", 0x70000001, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, G1 },
+ {"maddu", "d,s,t", 0x70000001, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d|IS_M, 0, G1 },
+@@ -739,7 +738,7 @@
+ /* mfhc2 is at the bottom of the table. */
+ {"mfc3", "t,G", 0x4c000000, 0xffe007ff, LCD|WR_t|RD_C3, 0, I1 },
+ {"mfc3", "t,G,H", 0x4c000000, 0xffe007f8, LCD|WR_t|RD_C3, 0, I32 },
+-{"mfdr", "t,G", 0x7000003d, 0xffe007ff, LCD|WR_t|RD_C0, 0, N5 },
++{"mfdr", "t,G", 0x7000003d, 0xffe007ff, LCD|WR_t|RD_C0, 0, N5|AL },
+ {"mfhi", "d", 0x00000010, 0xffff07ff, WR_d|RD_HI, 0, I1 },
+ {"mflo", "d", 0x00000012, 0xffff07ff, WR_d|RD_LO, 0, I1 },
+ {"min.ob", "X,Y,Q", 0x78000006, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX|SB1 },
+@@ -756,7 +755,7 @@
+ {"movf.l", "X,Y,N", 0x46a00011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, MX|SB1 },
+ {"movf.s", "D,S,N", 0x46000011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_S, 0, I4|I32 },
+ {"movf.ps", "D,S,N", 0x46c00011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, I5 },
+-{"movn", "d,v,t", 0x0000000b, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I4|I32 },
++{"movn", "d,v,t", 0x0000000b, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I4|I32|AL },
+ {"ffc", "d,v", 0x0000000b, 0xfc1f07ff, WR_d|RD_s, 0, L1 },
+ {"movn.d", "D,S,t", 0x46200013, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, I4|I32 },
+ {"movn.l", "D,S,t", 0x46a00013, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, MX|SB1 },
+@@ -769,7 +768,7 @@
+ {"movt.l", "X,Y,N", 0x46a10011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, MX|SB1 },
+ {"movt.s", "D,S,N", 0x46010011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_S, 0, I4|I32 },
+ {"movt.ps", "D,S,N", 0x46c10011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, I5 },
+-{"movz", "d,v,t", 0x0000000a, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I4|I32 },
++{"movz", "d,v,t", 0x0000000a, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I4|I32|AL },
+ {"ffs", "d,v", 0x0000000a, 0xfc1f07ff, WR_d|RD_s, 0, L1 },
+ {"movz.d", "D,S,t", 0x46200012, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, I4|I32 },
+ {"movz.l", "D,S,t", 0x46a00012, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, MX|SB1 },
+@@ -786,8 +785,10 @@
+ {"msub.s", "D,R,S,T", 0x4c000028, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_S, 0, I4 },
+ {"msub.ps", "D,R,S,T", 0x4c00002e, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0, I5 },
+ {"msub", "s,t", 0x0000001e, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 },
++{"msub", "s,t", 0x0000002e, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, AL },
+ {"msub", "s,t", 0x70000004, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55 },
+ {"msubu", "s,t", 0x0000001f, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 },
++{"msubu", "s,t", 0x0000002f, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, AL },
+ {"msubu", "s,t", 0x70000005, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55 },
+ {"mtpc", "t,P", 0x4080c801, 0xffe0ffc1, COD|RD_t|WR_C0, 0, M1|N5 },
+ {"mtps", "t,P", 0x4080c800, 0xffe0ffc1, COD|RD_t|WR_C0, 0, M1|N5 },
+@@ -802,7 +803,7 @@
+ /* mthc2 is at the bottom of the table. */
+ {"mtc3", "t,G", 0x4c800000, 0xffe007ff, COD|RD_t|WR_C3|WR_CC, 0, I1 },
+ {"mtc3", "t,G,H", 0x4c800000, 0xffe007f8, COD|RD_t|WR_C3|WR_CC, 0, I32 },
+-{"mtdr", "t,G", 0x7080003d, 0xffe007ff, COD|RD_t|WR_C0, 0, N5 },
++{"mtdr", "t,G", 0x7080003d, 0xffe007ff, COD|RD_t|WR_C0, 0, N5|AL },
+ {"mthi", "s", 0x00000011, 0xfc1fffff, RD_s|WR_HI, 0, I1 },
+ {"mtlo", "s", 0x00000013, 0xfc1fffff, RD_s|WR_LO, 0, I1 },
+ {"mul.d", "D,V,T", 0x46200002, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, I1 },
+@@ -936,13 +937,13 @@
+ {"rol", "d,v,I", 0, (int) M_ROL_I, INSN_MACRO, 0, I1 },
+ {"ror", "d,v,t", 0, (int) M_ROR, INSN_MACRO, 0, I1 },
+ {"ror", "d,v,I", 0, (int) M_ROR_I, INSN_MACRO, 0, I1 },
+-{"ror", "d,w,<", 0x00200002, 0xffe0003f, WR_d|RD_t, 0, N5|I33 },
+-{"rorv", "d,t,s", 0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d, 0, N5|I33 },
+-{"rotl", "d,v,t", 0, (int) M_ROL, INSN_MACRO, 0, I33 },
+-{"rotl", "d,v,I", 0, (int) M_ROL_I, INSN_MACRO, 0, I33 },
+-{"rotr", "d,v,t", 0, (int) M_ROR, INSN_MACRO, 0, I33 },
+-{"rotr", "d,v,I", 0, (int) M_ROR_I, INSN_MACRO, 0, I33 },
+-{"rotrv", "d,t,s", 0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d, 0, I33 },
++{"ror", "d,w,<", 0x00200002, 0xffe0003f, WR_d|RD_t, 0, N5|I33|AL },
++{"rorv", "d,t,s", 0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d, 0, N5|I33|AL },
++{"rotl", "d,v,t", 0, (int) M_ROL, INSN_MACRO, 0, I33|AL },
++{"rotl", "d,v,I", 0, (int) M_ROL_I, INSN_MACRO, 0, I33|AL },
++{"rotr", "d,v,t", 0, (int) M_ROR, INSN_MACRO, 0, I33|AL },
++{"rotr", "d,v,I", 0, (int) M_ROR_I, INSN_MACRO, 0, I33|AL },
++{"rotrv", "d,t,s", 0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d, 0, I33|AL },
+ {"round.l.d", "D,S", 0x46200008, 0xffff003f, WR_D|RD_S|FP_D, 0, I3 },
+ {"round.l.s", "D,S", 0x46000008, 0xffff003f, WR_D|RD_S|FP_S, 0, I3 },
+ {"round.w.d", "D,S", 0x4620000c, 0xffff003f, WR_D|RD_S|FP_D, 0, I2 },
+@@ -974,24 +975,17 @@
+ {"sdbbp", "c,q", 0x0000000e, 0xfc00003f, TRAP, 0, G2 },
+ {"sdbbp", "", 0x7000003f, 0xffffffff, TRAP, 0, I32 },
+ {"sdbbp", "B", 0x7000003f, 0xfc00003f, TRAP, 0, I32 },
+-{"sdc1", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 },
+-{"sdc1", "E,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 },
+-{"sdc1", "T,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, 0, I2 },
+-{"sdc1", "E,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, 0, I2 },
+-{"sdc2", "E,o(b)", 0xf8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I2 },
+-{"sdc2", "E,A(b)", 0, (int) M_SDC2_AB, INSN_MACRO, 0, I2 },
+-{"sdc3", "E,o(b)", 0xfc000000, 0xfc000000, SM|RD_C3|RD_b, 0, I2 },
+-{"sdc3", "E,A(b)", 0, (int) M_SDC3_AB, INSN_MACRO, 0, I2 },
+-{"s.d", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 },
+-{"s.d", "T,o(b)", 0, (int) M_S_DOB, INSN_MACRO, 0, I1 },
+-{"s.d", "T,A(b)", 0, (int) M_S_DAB, INSN_MACRO, 0, I1 },
+-{"sdl", "t,o(b)", 0xb0000000, 0xfc000000, SM|RD_t|RD_b, 0, I3 },
++/* sdc1 is at the bottom of the table. */
++/* sdc2 is at the bottom of the table. */
++/* sdc3 is at the bottom of the table. */
++/* s.d (sdc1 is at the bottom of the table. */
++{"sdl", "t,o(b)", 0xb0000000, 0xfc000000, SM|RD_t|RD_b, 0, I3|AL },
+ {"sdl", "t,A(b)", 0, (int) M_SDL_AB, INSN_MACRO, 0, I3 },
+ {"sdr", "t,o(b)", 0xb4000000, 0xfc000000, SM|RD_t|RD_b, 0, I3 },
+ {"sdr", "t,A(b)", 0, (int) M_SDR_AB, INSN_MACRO, 0, I3 },
+ {"sdxc1", "S,t(b)", 0x4c000009, 0xfc0007ff, SM|RD_S|RD_t|RD_b, 0, I4 },
+-{"seb", "d,w", 0x7c000420, 0xffe007ff, WR_d|RD_t, 0, I33 },
+-{"seh", "d,w", 0x7c000620, 0xffe007ff, WR_d|RD_t, 0, I33 },
++{"seb", "d,w", 0x7c000420, 0xffe007ff, WR_d|RD_t, 0, I33|AL },
++{"seh", "d,w", 0x7c000620, 0xffe007ff, WR_d|RD_t, 0, I33|AL },
+ {"selsl", "d,v,t", 0x00000005, 0xfc0007ff, WR_d|RD_s|RD_t, 0, L1 },
+ {"selsr", "d,v,t", 0x00000001, 0xfc0007ff, WR_d|RD_s|RD_t, 0, L1 },
+ {"seq", "d,v,t", 0, (int) M_SEQ, INSN_MACRO, 0, I1 },
+@@ -1083,8 +1077,7 @@
+ {"swc1", "E,A(b)", 0, (int) M_SWC1_AB, INSN_MACRO, 0, I1 },
+ {"s.s", "T,o(b)", 0xe4000000, 0xfc000000, SM|RD_T|RD_b|FP_S, 0, I1 }, /* swc1 */
+ {"s.s", "T,A(b)", 0, (int) M_SWC1_AB, INSN_MACRO, 0, I1 },
+-{"swc2", "E,o(b)", 0xe8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I1 },
+-{"swc2", "E,A(b)", 0, (int) M_SWC2_AB, INSN_MACRO, 0, I1 },
++/* swc2 is at the bottom of the table. */
+ {"swc3", "E,o(b)", 0xec000000, 0xfc000000, SM|RD_C3|RD_b, 0, I1 },
+ {"swc3", "E,A(b)", 0, (int) M_SWC3_AB, INSN_MACRO, 0, I1 },
+ {"swl", "t,o(b)", 0xa8000000, 0xfc000000, SM|RD_t|RD_b, 0, I1 },
+@@ -1169,7 +1162,8 @@
+ {"waiti", "", 0x42000020, 0xffffffff, TRAP, 0, L1 },
+ {"wb", "o(b)", 0xbc040000, 0xfc1f0000, SM|RD_b, 0, L1 },
+ {"wrpgpr", "d,w", 0x41c00000, 0xffe007ff, RD_t, 0, I33 },
+-{"wsbh", "d,w", 0x7c0000a0, 0xffe007ff, WR_d|RD_t, 0, I33 },
++{"wsbh", "d,w", 0x7c0000a0, 0xffe007ff, WR_d|RD_t, 0, I33|AL },
++{"wsbw", "d,t", 0x7c0000e0, 0xffe007ff, WR_d|RD_t, 0, AL },
+ {"xor", "d,v,t", 0x00000026, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I1 },
+ {"xor", "t,r,I", 0, (int) M_XOR_I, INSN_MACRO, 0, I1 },
+ {"xor.ob", "X,Y,Q", 0x7800000d, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX|SB1 },
+@@ -1179,6 +1173,319 @@
+ {"xor.qh", "X,Y,Q", 0x7820000d, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX },
+ {"xori", "t,r,i", 0x38000000, 0xfc000000, WR_t|RD_s, 0, I1 },
+
++/* Sony Allegrex CPU core. */
++{"bitrev", "d,t", 0x7c000520, 0xffe007ff, WR_d|RD_t, 0, AL },
++{"mfic", "t,G", 0x70000024, 0xffe007ff, LCD|WR_t|RD_C0, 0, AL },
++{"mtic", "t,G", 0x70000026, 0xffe007ff, COD|RD_t|WR_C0, 0, AL },
++
++/* Sony Allegrex VFPU instructions. */
++{"bvf", "?c,p", 0x49000000, 0xffe30000, CBD|RD_CC, 0, AL },
++{"bvfl", "?c,p", 0x49020000, 0xffe30000, CBL|RD_CC, 0, AL },
++{"bvt", "?c,p", 0x49010000, 0xffe30000, CBD|RD_CC, 0, AL },
++{"bvtl", "?c,p", 0x49030000, 0xffe30000, CBL|RD_CC, 0, AL },
++{"lv.s", "?m0x,?o(b)", 0xc8000000, 0xfc000000, CLD|RD_s|WR_CC, 0, AL },
++{"lv.s", "?m0x,A(b)", 0, (int) M_LV_Q_AB, INSN_MACRO, 0, AL },
++{"ulv.s", "?m0x,o(b)", 0, (int) M_ULV_S, INSN_MACRO, 0, AL },
++{"lv.q", "?n3x,?o(b)", 0xd8000000, 0xfc000002, CLD|RD_s|WR_CC, 0, AL },
++{"lv.q", "?n3x,A(b)", 0, (int) M_LV_Q_AB_2, INSN_MACRO, 0, AL },
++{"ulv.q", "?n3x,?o(b)", 0, (int) M_ULV_Q, INSN_MACRO, 0, AL },
++{"ulv.q", "?n3x,A(b)", 0, (int) M_ULV_Q_AB, INSN_MACRO, 0, AL },
++{"lvi.s", "?t0x,l?y0", 0, (int) M_LVI_S, INSN_MACRO, 0, AL },
++{"lvi.p", "?t1x,?[l?y0,l?y1?]", 0, (int) M_LVI_P, INSN_MACRO, 0, AL },
++{"lvi.t", "?t2x,?[l?y0,l?y1,l?y2?]", 0, (int) M_LVI_T, INSN_MACRO, 0, AL },
++{"lvi.q", "?t3x,?[l?y0,l?y1,l?y2,l?y3?]", 0, (int) M_LVI_Q, INSN_MACRO, 0, AL },
++{"lvhi.s", "?t0x,?[?u?y0,?u?y1?]", 0, (int) M_LVHI_S, INSN_MACRO, 0, AL },
++{"lvhi.p", "?t1x,?[?u?y0,?u?y1,?u?y2,?u?y3?]", 0, (int) M_LVHI_P, INSN_MACRO, 0, AL },
++{"sv.s", "?m0x,?o(b)", 0xe8000000, 0xfc000000, SM|RD_s|RD_C2, 0, AL },
++{"sv.s", "?m0x,A(b)", 0, (int) M_SV_S_AB, INSN_MACRO, 0, AL },
++{"usv.s", "?m0x,o(b)", 0, (int) M_USV_S, INSN_MACRO, 0, AL },
++{"sv.q", "?n3x,?o(b)", 0xf8000000, 0xfc000002, SM|RD_s|RD_C2, 0, AL },
++{"sv.q", "?n3x,?o(b),?z", 0xf8000000, 0xfc000000, SM|RD_s|RD_C2, 0, AL },
++{"sv.q", "?n3x,A(b)", 0, (int) M_SV_Q_AB, INSN_MACRO, 0, AL },
++{"sv.q", "?n3x,A(b),?z", 0, (int) M_SV_Q_AB, INSN_MACRO, 0, AL },
++{"sv.q", "?n3x,A,?z", 0, (int) M_SV_Q_AB, INSN_MACRO, 0, AL },
++{"usv.q", "?n3x,?o(b)", 0, (int) M_USV_Q, INSN_MACRO, 0, AL },
++{"usv.q", "?n3x,A(b)", 0, (int) M_USV_Q_AB, INSN_MACRO, 0, AL },
++{"vwb.q", "?n3x,?o(b)", 0xf8000002, 0xfc000002, SM|RD_s|RD_C2, 0, AL },
++{"lvl.q", "?n3x,?o(b)", 0xd4000000, 0xfc000002, CLD|RD_s|WR_CC, 0, AL },
++{"lvl.q", "?n3x,A(b)", 0, (int) M_LVL_Q_AB, INSN_MACRO, 0, AL },
++{"lvr.q", "?n3x,?o(b)", 0xd4000002, 0xfc000002, CLD|RD_s|WR_CC, 0, AL },
++{"lvr.q", "?n3x,A(b)", 0, (int) M_LVR_Q_AB, INSN_MACRO, 0, AL },
++{"svl.q", "?n3x,?o(b)", 0xf4000000, 0xfc000002, SM|RD_s|RD_C2, 0, AL },
++{"svl.q", "?n3x,A(b)", 0, (int) M_SVL_Q_AB, INSN_MACRO, 0, AL },
++{"svr.q", "?n3x,?o(b)", 0xf4000002, 0xfc000002, SM|RD_s|RD_C2, 0, AL },
++{"svr.q", "?n3x,A(b)", 0, (int) M_SVR_Q_AB, INSN_MACRO, 0, AL },
++{"mtv", "t,?d0z", 0x48e00000, 0xffe0ff80, LCD|WR_t|WR_C2, 0, AL },
++{"mfv", "t,?d0z", 0x48600000, 0xffe0ff80, COD|RD_t|WR_CC|RD_C2, 0, AL },
++{"mtvc", "t,?q", 0x48e00000, 0xffe0ff00, LCD|WR_t|WR_C2, 0, AL },
++{"mfvc", "t,?q", 0x48600000, 0xffe0ff00, COD|RD_t|WR_CC|RD_C2, 0, AL },
++{"vmtvc", "?q,?s0y", 0xd0510000, 0xffff8000, WR_C2, 0, AL },
++{"vmfvc", "?d0z,?r", 0xd0500000, 0xffff0080, RD_C2, 0, AL },
++{"vadd.q", "?d3d,?s3s,?t3t", 0x60008080, 0xff808080, RD_C2, 0, AL },
++{"vsub.q", "?d3d,?s3s,?t3t", 0x60808080, 0xff808080, RD_C2, 0, AL },
++{"vdiv.q", "?x3z,?s3y,?t3x", 0x63808080, 0xff808080, RD_C2, 0, AL },
++{"vmul.q", "?d3d,?s3s,?t3t", 0x64008080, 0xff808080, RD_C2, 0, AL },
++{"vdot.q", "?d0d,?s3s,?t3t", 0x64808080, 0xff808080, RD_C2, 0, AL },
++{"vscl.q", "?d3d,?s3s,?t0x", 0x65008080, 0xff808080, RD_C2, 0, AL },
++{"vhdp.q", "?d0d,?s3y,?t3t", 0x66008080, 0xff808080, RD_C2, 0, AL },
++{"vcmp.q", "?f2,?s3s,?t3t", 0x6c008080, 0xff8080f0, RD_C2, 0, AL },
++{"vcmp.q", "?f1,?s3s", 0x6c008080, 0xffff80f0, RD_C2, 0, AL },
++{"vcmp.q", "?f0", 0x6c008080, 0xfffffff0, RD_C2, 0, AL },
++{"vmin.q", "?d3d,?s3s,?t3t", 0x6d008080, 0xff808080, RD_C2, 0, AL },
++{"vmax.q", "?d3d,?s3s,?t3t", 0x6d808080, 0xff808080, RD_C2, 0, AL },
++{"vsgn.q", "?d3d,?s3s", 0xd04a8080, 0xffff8080, RD_C2, 0, AL },
++{"vcst.q", "?d3d,?a", 0xd0608080, 0xffe0ff80, RD_C2, 0, AL },
++{"vscmp.q", "?d3d,?s3s,?t3t", 0x6e808080, 0xff808080, RD_C2, 0, AL },
++{"vsge.q", "?d3d,?s3s,?t3t", 0x6f008080, 0xff808080, RD_C2, 0, AL },
++{"vslt.q", "?d3d,?s3s,?t3t", 0x6f808080, 0xff808080, RD_C2, 0, AL },
++{"vi2uc.q", "?d0m,?s3w", 0xd03c8080, 0xffff8080, RD_C2, 0, AL },
++{"vi2c.q", "?d0m,?s3w", 0xd03d8080, 0xffff8080, RD_C2, 0, AL },
++{"vi2us.q", "?d1m,?s3w", 0xd03e8080, 0xffff8080, RD_C2, 0, AL },
++{"vi2s.q", "?d1m,?s3w", 0xd03f8080, 0xffff8080, RD_C2, 0, AL },
++{"vmov.q", "?d3d,?s3s", 0xd0008080, 0xffff8080, RD_C2, 0, AL },
++{"vabs.q", "?d3d,?s3w", 0xd0018080, 0xffff8080, RD_C2, 0, AL },
++{"vneg.q", "?d3d,?s3w", 0xd0028080, 0xffff8080, RD_C2, 0, AL },
++{"vidt.q", "?d3d", 0xd0038080, 0xffffff80, RD_C2, 0, AL },
++{"vsat0.q", "?d3z,?s3s", 0xd0048080, 0xffff8080, RD_C2, 0, AL },
++{"vsat1.q", "?d3z,?s3s", 0xd0058080, 0xffff8080, RD_C2, 0, AL },
++{"vzero.q", "?d3d", 0xd0068080, 0xffffff80, RD_C2, 0, AL },
++{"vone.q", "?d3d", 0xd0078080, 0xffffff80, RD_C2, 0, AL },
++{"vrcp.q", "?x3z,?s3y", 0xd0108080, 0xffff8080, RD_C2, 0, AL },
++{"vrsq.q", "?x3z,?s3y", 0xd0118080, 0xffff8080, RD_C2, 0, AL },
++{"vsin.q", "?x3z,?s3y", 0xd0128080, 0xffff8080, RD_C2, 0, AL },
++{"vcos.q", "?x3z,?s3y", 0xd0138080, 0xffff8080, RD_C2, 0, AL },
++{"vexp2.q", "?x3z,?s3y", 0xd0148080, 0xffff8080, RD_C2, 0, AL },
++{"vlog2.q", "?x3z,?s3y", 0xd0158080, 0xffff8080, RD_C2, 0, AL },
++{"vsqrt.q", "?x3z,?s3y", 0xd0168080, 0xffff8080, RD_C2, 0, AL },
++{"vasin.q", "?x3z,?s3y", 0xd0178080, 0xffff8080, RD_C2, 0, AL },
++{"vnrcp.q", "?x3z,?s3y", 0xd0188080, 0xffff8080, RD_C2, 0, AL },
++{"vnsin.q", "?x3z,?s3y", 0xd01a8080, 0xffff8080, RD_C2, 0, AL },
++{"vrexp2.q", "?x3z,?s3y", 0xd01c8080, 0xffff8080, RD_C2, 0, AL },
++{"vrndi.q", "?d3z", 0xd0218080, 0xffffff80, RD_C2, 0, AL },
++{"vrndf1.q", "?d3z", 0xd0228080, 0xffffff80, RD_C2, 0, AL },
++{"vrndf2.q", "?d3z", 0xd0238080, 0xffffff80, RD_C2, 0, AL },
++{"vf2h.q", "?d1m,?s3s", 0xd0328080, 0xffff8080, RD_C2, 0, AL },
++{"vsrt1.q", "?d3d,?s3s", 0xd0408080, 0xffff8080, RD_C2, 0, AL },
++{"vsrt2.q", "?d3d,?s3s", 0xd0418080, 0xffff8080, RD_C2, 0, AL },
++{"vsrt3.q", "?d3d,?s3s", 0xd0488080, 0xffff8080, RD_C2, 0, AL },
++{"vsrt4.q", "?d3d,?s3s", 0xd0498080, 0xffff8080, RD_C2, 0, AL },
++{"vbfy1.q", "?d3d,?s3s", 0xd0428080, 0xffff8080, RD_C2, 0, AL },
++{"vbfy2.q", "?d3d,?s3s", 0xd0438080, 0xffff8080, RD_C2, 0, AL },
++{"vocp.q", "?d3d,?s3y", 0xd0448080, 0xffff8080, RD_C2, 0, AL },
++{"vfad.q", "?d0d,?s3s", 0xd0468080, 0xffff8080, RD_C2, 0, AL },
++{"vavg.q", "?d0d,?s3s", 0xd0478080, 0xffff8080, RD_C2, 0, AL },
++{"vf2in.q", "?d3m,?s3s,?b", 0xd2008080, 0xffe08080, RD_C2, 0, AL },
++{"vf2iz.q", "?d3m,?s3s,?b", 0xd2208080, 0xffe08080, RD_C2, 0, AL },
++{"vf2iu.q", "?d3m,?s3s,?b", 0xd2408080, 0xffe08080, RD_C2, 0, AL },
++{"vf2id.q", "?d3m,?s3s,?b", 0xd2608080, 0xffe08080, RD_C2, 0, AL },
++{"vi2f.q", "?d3d,?s3w,?b", 0xd2808080, 0xffe08080, RD_C2, 0, AL },
++{"vcmov.q", "?d3d,?s3s,?e", 0, (int) M_VCMOV_Q, INSN_MACRO, 0, AL },
++{"vcmovt.q", "?d3d,?s3s,?e", 0xd2a08080, 0xfff88080, RD_C2, 0, AL },
++{"vcmovf.q", "?d3d,?s3s,?e", 0xd2a88080, 0xfff88080, RD_C2, 0, AL },
++{"vmmul.q", "?v7z,?s7y,?t7x", 0xf0008080, 0xff808080, RD_C2, 0, AL },
++{"vtfm4.q", "?v3z,?s7y,?t3x", 0xf1808080, 0xff808080, RD_C2, 0, AL },
++{"vhtfm4.q", "?v3z,?s7y,?t3x", 0xf1808000, 0xff808080, RD_C2, 0, AL },
++{"vmscl.q", "?x7z,?s7y,?t0x", 0xf2008080, 0xff808080, RD_C2, 0, AL },
++{"vqmul.q", "?v3z,?s3y,?t3x", 0xf2808080, 0xff808080, RD_C2, 0, AL },
++{"vmmov.q", "?x7z,?s7y", 0xf3808080, 0xffff8080, RD_C2, 0, AL },
++{"vmidt.q", "?d7z", 0xf3838080, 0xffffff80, RD_C2, 0, AL },
++{"vmzero.q", "?d7z", 0xf3868080, 0xffffff80, RD_C2, 0, AL },
++{"vmone.q", "?d7z", 0xf3878080, 0xffffff80, RD_C2, 0, AL },
++{"vrot.q", "?x3z,?s0y,?w", 0xf3a08080, 0xffe08080, RD_C2, 0, AL },
++{"vt4444.q", "?d1z,?s3w", 0xd0598080, 0xffff8080, RD_C2, 0, AL },
++{"vt5551.q", "?d1z,?s3w", 0xd05a8080, 0xffff8080, RD_C2, 0, AL },
++{"vt5650.q", "?d1z,?s3w", 0xd05b8080, 0xffff8080, RD_C2, 0, AL },
++{"vadd.t", "?d2d,?s2s,?t2t", 0x60008000, 0xff808080, RD_C2, 0, AL },
++{"vsub.t", "?d2d,?s2s,?t2t", 0x60808000, 0xff808080, RD_C2, 0, AL },
++{"vdiv.t", "?x2z,?s2y,?t2x", 0x63808000, 0xff808080, RD_C2, 0, AL },
++{"vmul.t", "?d2d,?s2s,?t2t", 0x64008000, 0xff808080, RD_C2, 0, AL },
++{"vdot.t", "?d0d,?s2s,?t2t", 0x64808000, 0xff808080, RD_C2, 0, AL },
++{"vscl.t", "?d2d,?s2s,?t0x", 0x65008000, 0xff808080, RD_C2, 0, AL },
++{"vhdp.t", "?d0d,?s2y,?t2t", 0x66008000, 0xff808080, RD_C2, 0, AL },
++{"vcrs.t", "?d2d,?s2y,?t2x", 0x66808000, 0xff808080, RD_C2, 0, AL },
++{"vcmp.t", "?f2,?s2s,?t2t", 0x6c008000, 0xff8080f0, RD_C2, 0, AL },
++{"vcmp.t", "?f1,?s2s", 0x6c008000, 0xffff80f0, RD_C2, 0, AL },
++{"vcmp.t", "?f0", 0x6c008000, 0xfffffff0, RD_C2, 0, AL },
++{"vmin.t", "?d2d,?s2s,?t2t", 0x6d008000, 0xff808080, RD_C2, 0, AL },
++{"vmax.t", "?d2d,?s2s,?t2t", 0x6d808000, 0xff808080, RD_C2, 0, AL },
++{"vsgn.t", "?d2d,?s2s", 0xd04a8000, 0xffff8080, RD_C2, 0, AL },
++{"vcst.t", "?d2d,?a", 0xd0608000, 0xffe0ff80, RD_C2, 0, AL },
++{"vscmp.t", "?d2d,?s2s,?t2t", 0x6e808000, 0xff808080, RD_C2, 0, AL },
++{"vsge.t", "?d2d,?s2s,?t2t", 0x6f008000, 0xff808080, RD_C2, 0, AL },
++{"vslt.t", "?d2d,?s2s,?t2t", 0x6f808000, 0xff808080, RD_C2, 0, AL },
++{"vmov.t", "?d2d,?s2s", 0xd0008000, 0xffff8080, RD_C2, 0, AL },
++{"vabs.t", "?d2d,?s2w", 0xd0018000, 0xffff8080, RD_C2, 0, AL },
++{"vneg.t", "?d2d,?s2w", 0xd0028000, 0xffff8080, RD_C2, 0, AL },
++{"vsat0.t", "?d2z,?s2s", 0xd0048000, 0xffff8080, RD_C2, 0, AL },
++{"vsat1.t", "?d2z,?s2s", 0xd0058000, 0xffff8080, RD_C2, 0, AL },
++{"vzero.t", "?d2d", 0xd0068000, 0xffffff80, RD_C2, 0, AL },
++{"vone.t", "?d2d", 0xd0078000, 0xffffff80, RD_C2, 0, AL },
++{"vrcp.t", "?x2z,?s2y", 0xd0108000, 0xffff8080, RD_C2, 0, AL },
++{"vrsq.t", "?x2z,?s2y", 0xd0118000, 0xffff8080, RD_C2, 0, AL },
++{"vsin.t", "?x2z,?s2y", 0xd0128000, 0xffff8080, RD_C2, 0, AL },
++{"vcos.t", "?x2z,?s2y", 0xd0138000, 0xffff8080, RD_C2, 0, AL },
++{"vexp2.t", "?x2z,?s2y", 0xd0148000, 0xffff8080, RD_C2, 0, AL },
++{"vlog2.t", "?x2z,?s2y", 0xd0158000, 0xffff8080, RD_C2, 0, AL },
++{"vsqrt.t", "?x2z,?s2y", 0xd0168000, 0xffff8080, RD_C2, 0, AL },
++{"vasin.t", "?x2z,?s2y", 0xd0178000, 0xffff8080, RD_C2, 0, AL },
++{"vnrcp.t", "?x2z,?s2y", 0xd0188000, 0xffff8080, RD_C2, 0, AL },
++{"vnsin.t", "?x2z,?s2y", 0xd01a8000, 0xffff8080, RD_C2, 0, AL },
++{"vrexp2.t", "?x2z,?s2y", 0xd01c8000, 0xffff8080, RD_C2, 0, AL },
++{"vrndi.t", "?d2z", 0xd0218000, 0xffffff80, RD_C2, 0, AL },
++{"vrndf1.t", "?d2z", 0xd0228000, 0xffffff80, RD_C2, 0, AL },
++{"vrndf2.t", "?d2z", 0xd0238000, 0xffffff80, RD_C2, 0, AL },
++{"vocp.t", "?d2d,?s2y", 0xd0448000, 0xffff8080, RD_C2, 0, AL },
++{"vfad.t", "?d0d,?s2s", 0xd0468000, 0xffff8080, RD_C2, 0, AL },
++{"vavg.t", "?d0d,?s2s", 0xd0478000, 0xffff8080, RD_C2, 0, AL },
++{"vf2in.t", "?d2m,?s2s,?b", 0xd2008000, 0xffe08080, RD_C2, 0, AL },
++{"vf2iz.t", "?d2m,?s2s,?b", 0xd2208000, 0xffe08080, RD_C2, 0, AL },
++{"vf2iu.t", "?d2m,?s2s,?b", 0xd2408000, 0xffe08080, RD_C2, 0, AL },
++{"vf2id.t", "?d2m,?s2s,?b", 0xd2608000, 0xffe08080, RD_C2, 0, AL },
++{"vi2f.t", "?d2d,?s2w,?b", 0xd2808000, 0xffe08080, RD_C2, 0, AL },
++{"vcmov.t", "?d2d,?s2s,?e", 0, (int) M_VCMOV_T, INSN_MACRO, 0, AL },
++{"vcmovt.t", "?d2d,?s2s,?e", 0xd2a08000, 0xfff88080, RD_C2, 0, AL },
++{"vcmovf.t", "?d2d,?s2s,?e", 0xd2a88000, 0xfff88080, RD_C2, 0, AL },
++{"vmmul.t", "?v6z,?s6y,?t6x", 0xf0008000, 0xff808080, RD_C2, 0, AL },
++{"vtfm3.t", "?v2z,?s6y,?t2x", 0xf1008000, 0xff808080, RD_C2, 0, AL },
++{"vhtfm3.t", "?v2z,?s6y,?t2x", 0xf1000080, 0xff808080, RD_C2, 0, AL },
++{"vmscl.t", "?x6z,?s6y,?t0x", 0xf2008000, 0xff808080, RD_C2, 0, AL },
++{"vmmov.t", "?x6z,?s6y", 0xf3808000, 0xffff8080, RD_C2, 0, AL },
++{"vmidt.t", "?d6z", 0xf3838000, 0xffffff80, RD_C2, 0, AL },
++{"vmzero.t", "?d6z", 0xf3868000, 0xffffff80, RD_C2, 0, AL },
++{"vmone.t", "?d6z", 0xf3878000, 0xffffff80, RD_C2, 0, AL },
++{"vrot.t", "?x2z,?s0y,?w", 0xf3a08000, 0xffe08080, RD_C2, 0, AL },
++{"vcrsp.t", "?d2z,?s2y,?t2x", 0xf2808000, 0xff808080, RD_C2, 0, AL },
++{"vadd.p", "?d1d,?s1s,?t1t", 0x60000080, 0xff808080, RD_C2, 0, AL },
++{"vsub.p", "?d1d,?s1s,?t1t", 0x60800080, 0xff808080, RD_C2, 0, AL },
++{"vdiv.p", "?x1z,?s1y,?t1x", 0x63800080, 0xff808080, RD_C2, 0, AL },
++{"vmul.p", "?d1d,?s1s,?t1t", 0x64000080, 0xff808080, RD_C2, 0, AL },
++{"vdot.p", "?d0d,?s1s,?t1t", 0x64800080, 0xff808080, RD_C2, 0, AL },
++{"vscl.p", "?d1d,?s1s,?t0x", 0x65000080, 0xff808080, RD_C2, 0, AL },
++{"vhdp.p", "?d0d,?s1y,?t1t", 0x66000080, 0xff808080, RD_C2, 0, AL },
++{"vdet.p", "?d0d,?s1s,?t1x", 0x67000080, 0xff808080, RD_C2, 0, AL },
++{"vcmp.p", "?f2,?s1s,?t1t", 0x6c000080, 0xff8080f0, RD_C2, 0, AL },
++{"vcmp.p", "?f1,?s1s", 0x6c000080, 0xffff80f0, RD_C2, 0, AL },
++{"vcmp.p", "?f0", 0x6c000080, 0xfffffff0, RD_C2, 0, AL },
++{"vmin.p", "?d1d,?s1s,?t1t", 0x6d000080, 0xff808080, RD_C2, 0, AL },
++{"vmax.p", "?d1d,?s1s,?t1t", 0x6d800080, 0xff808080, RD_C2, 0, AL },
++{"vsgn.p", "?d1d,?s1s", 0xd04a0080, 0xffff8080, RD_C2, 0, AL },
++{"vcst.p", "?d1d,?a", 0xd0600080, 0xffe0ff80, RD_C2, 0, AL },
++{"vscmp.p", "?d1d,?s1s,?t1t", 0x6e800080, 0xff808080, RD_C2, 0, AL },
++{"vsge.p", "?d1d,?s1s,?t1t", 0x6f000080, 0xff808080, RD_C2, 0, AL },
++{"vslt.p", "?d1d,?s1s,?t1t", 0x6f800080, 0xff808080, RD_C2, 0, AL },
++{"vus2i.p", "?d3m,?s1y", 0xd03a0080, 0xffff8080, RD_C2, 0, AL },
++{"vs2i.p", "?d3m,?s1y", 0xd03b0080, 0xffff8080, RD_C2, 0, AL },
++{"vi2us.p", "?d0m,?s1w", 0xd03e0080, 0xffff8080, RD_C2, 0, AL },
++{"vi2s.p", "?d0m,?s1w", 0xd03f0080, 0xffff8080, RD_C2, 0, AL },
++{"vmov.p", "?d1d,?s1s", 0xd0000080, 0xffff8080, RD_C2, 0, AL },
++{"vabs.p", "?d1d,?s1w", 0xd0010080, 0xffff8080, RD_C2, 0, AL },
++{"vneg.p", "?d1d,?s1w", 0xd0020080, 0xffff8080, RD_C2, 0, AL },
++{"vidt.p", "?d1d", 0xd0030080, 0xffffff80, RD_C2, 0, AL },
++{"vsat0.p", "?d1z,?s1s", 0xd0040080, 0xffff8080, RD_C2, 0, AL },
++{"vsat1.p", "?d1z,?s1s", 0xd0050080, 0xffff8080, RD_C2, 0, AL },
++{"vzero.p", "?d1d", 0xd0060080, 0xffffff80, RD_C2, 0, AL },
++{"vone.p", "?d1d", 0xd0070080, 0xffffff80, RD_C2, 0, AL },
++{"vrcp.p", "?x1z,?s1y", 0xd0100080, 0xffff8080, RD_C2, 0, AL },
++{"vrsq.p", "?x1z,?s1y", 0xd0110080, 0xffff8080, RD_C2, 0, AL },
++{"vsin.p", "?x1z,?s1y", 0xd0120080, 0xffff8080, RD_C2, 0, AL },
++{"vcos.p", "?x1z,?s1y", 0xd0130080, 0xffff8080, RD_C2, 0, AL },
++{"vexp2.p", "?x1z,?s1y", 0xd0140080, 0xffff8080, RD_C2, 0, AL },
++{"vlog2.p", "?x1z,?s1y", 0xd0150080, 0xffff8080, RD_C2, 0, AL },
++{"vsqrt.p", "?x1z,?s1y", 0xd0160080, 0xffff8080, RD_C2, 0, AL },
++{"vasin.p", "?x1z,?s1y", 0xd0170080, 0xffff8080, RD_C2, 0, AL },
++{"vnrcp.p", "?x1z,?s1y", 0xd0180080, 0xffff8080, RD_C2, 0, AL },
++{"vnsin.p", "?x1z,?s1y", 0xd01a0080, 0xffff8080, RD_C2, 0, AL },
++{"vrexp2.p", "?x1z,?s1y", 0xd01c0080, 0xffff8080, RD_C2, 0, AL },
++{"vrndi.p", "?d1z", 0xd0210080, 0xffffff80, RD_C2, 0, AL },
++{"vrndf1.p", "?d1z", 0xd0220080, 0xffffff80, RD_C2, 0, AL },
++{"vrndf2.p", "?d1z", 0xd0230080, 0xffffff80, RD_C2, 0, AL },
++{"vf2h.p", "?d0m,?s1s", 0xd0320080, 0xffff8080, RD_C2, 0, AL },
++{"vh2f.p", "?d3d,?s1y", 0xd0330080, 0xffff8080, RD_C2, 0, AL },
++{"vbfy1.p", "?d1d,?s1s", 0xd0420080, 0xffff8080, RD_C2, 0, AL },
++{"vocp.p", "?d1d,?s1y", 0xd0440080, 0xffff8080, RD_C2, 0, AL },
++{"vsocp.p", "?d3z,?s1y", 0xd0450080, 0xffff8080, RD_C2, 0, AL },
++{"vfad.p", "?d0d,?s1s", 0xd0460080, 0xffff8080, RD_C2, 0, AL },
++{"vavg.p", "?d0d,?s1s", 0xd0470080, 0xffff8080, RD_C2, 0, AL },
++{"vf2in.p", "?d1m,?s1s,?b", 0xd2000080, 0xffe08080, RD_C2, 0, AL },
++{"vf2iz.p", "?d1m,?s1s,?b", 0xd2200080, 0xffe08080, RD_C2, 0, AL },
++{"vf2iu.p", "?d1m,?s1s,?b", 0xd2400080, 0xffe08080, RD_C2, 0, AL },
++{"vf2id.p", "?d1m,?s1s,?b", 0xd2600080, 0xffe08080, RD_C2, 0, AL },
++{"vi2f.p", "?d1d,?s1w,?b", 0xd2800080, 0xffe08080, RD_C2, 0, AL },
++{"vcmov.p", "?d1d,?s1s,?e", 0, (int) M_VCMOV_P, INSN_MACRO, 0, AL },
++{"vcmovt.p", "?d1d,?s1s,?e", 0xd2a00080, 0xfff88080, RD_C2, 0, AL },
++{"vcmovf.p", "?d1d,?s1s,?e", 0xd2a80080, 0xfff88080, RD_C2, 0, AL },
++{"vmmul.p", "?v5z,?s5y,?t5x", 0xf0000080, 0xff808080, RD_C2, 0, AL },
++{"vtfm2.p", "?v1z,?s5y,?t1x", 0xf0800080, 0xff808080, RD_C2, 0, AL },
++{"vhtfm2.p", "?v1z,?s5y,?t1x", 0xf0800000, 0xff808080, RD_C2, 0, AL },
++{"vmscl.p", "?x5z,?s5y,?t0x", 0xf2000080, 0xff808080, RD_C2, 0, AL },
++{"vmmov.p", "?x5z,?s5y", 0xf3800080, 0xffff8080, RD_C2, 0, AL },
++{"vmidt.p", "?d5z", 0xf3830080, 0xffffff80, RD_C2, 0, AL },
++{"vmzero.p", "?d5z", 0xf3860080, 0xffffff80, RD_C2, 0, AL },
++{"vmone.p", "?d5z", 0xf3870080, 0xffffff80, RD_C2, 0, AL },
++{"vrot.p", "?x1z,?s0y,?w", 0xf3a00080, 0xffe08080, RD_C2, 0, AL },
++{"vadd.s", "?d0d,?s0s,?t0t", 0x60000000, 0xff808080, RD_C2, 0, AL },
++{"vsub.s", "?d0d,?s0s,?t0t", 0x60800000, 0xff808080, RD_C2, 0, AL },
++{"vdiv.s", "?x0d,?s0s,?t0t", 0x63800000, 0xff808080, RD_C2, 0, AL },
++{"vmul.s", "?d0d,?s0s,?t0t", 0x64000000, 0xff808080, RD_C2, 0, AL },
++{"vcmp.s", "?f2,?s0s,?t0t", 0x6c000000, 0xff8080f0, RD_C2, 0, AL },
++{"vcmp.s", "?f1,?s0s", 0x6c000000, 0xffff80f0, RD_C2, 0, AL },
++{"vcmp.s", "?f0", 0x6c000000, 0xfffffff0, RD_C2, 0, AL },
++{"vmin.s", "?d0d,?s0s,?t0t", 0x6d000000, 0xff808080, RD_C2, 0, AL },
++{"vmax.s", "?d0d,?s0s,?t0t", 0x6d800000, 0xff808080, RD_C2, 0, AL },
++{"vsgn.s", "?d0d,?s0s", 0xd04a0000, 0xffff8080, RD_C2, 0, AL },
++{"vcst.s", "?d0d,?a", 0xd0600000, 0xffe0ff80, RD_C2, 0, AL },
++{"vscmp.s", "?d0d,?s0s,?t0t", 0x6e800000, 0xff808080, RD_C2, 0, AL },
++{"vsge.s", "?d0d,?s0s,?t0t", 0x6f000000, 0xff808080, RD_C2, 0, AL },
++{"vslt.s", "?d0d,?s0s,?t0t", 0x6f800000, 0xff808080, RD_C2, 0, AL },
++{"vus2i.s", "?d1m,?s0y", 0xd03a0000, 0xffff8080, RD_C2, 0, AL },
++{"vs2i.s", "?d1m,?s0y", 0xd03b0000, 0xffff8080, RD_C2, 0, AL },
++{"vmov.s", "?d0d,?s0s", 0xd0000000, 0xffff8080, RD_C2, 0, AL },
++{"vabs.s", "?d0d,?s0w", 0xd0010000, 0xffff8080, RD_C2, 0, AL },
++{"vneg.s", "?d0d,?s0w", 0xd0020000, 0xffff8080, RD_C2, 0, AL },
++{"vsat0.s", "?d0z,?s0s", 0xd0040000, 0xffff8080, RD_C2, 0, AL },
++{"vsat1.s", "?d0z,?s0s", 0xd0050000, 0xffff8080, RD_C2, 0, AL },
++{"vzero.s", "?d0d", 0xd0060000, 0xffffff80, RD_C2, 0, AL },
++{"vone.s", "?d0d", 0xd0070000, 0xffffff80, RD_C2, 0, AL },
++{"vrcp.s", "?x0d,?s0s", 0xd0100000, 0xffff8080, RD_C2, 0, AL },
++{"vrsq.s", "?x0d,?s0s", 0xd0110000, 0xffff8080, RD_C2, 0, AL },
++{"vsin.s", "?x0d,?s0s", 0xd0120000, 0xffff8080, RD_C2, 0, AL },
++{"vcos.s", "?x0d,?s0s", 0xd0130000, 0xffff8080, RD_C2, 0, AL },
++{"vexp2.s", "?x0d,?s0s", 0xd0140000, 0xffff8080, RD_C2, 0, AL },
++{"vlog2.s", "?x0d,?s0s", 0xd0150000, 0xffff8080, RD_C2, 0, AL },
++{"vsqrt.s", "?x0d,?s0s", 0xd0160000, 0xffff8080, RD_C2, 0, AL },
++{"vasin.s", "?x0d,?s0s", 0xd0170000, 0xffff8080, RD_C2, 0, AL },
++{"vnrcp.s", "?x0d,?s0y", 0xd0180000, 0xffff8080, RD_C2, 0, AL },
++{"vnsin.s", "?x0d,?s0y", 0xd01a0000, 0xffff8080, RD_C2, 0, AL },
++{"vrexp2.s", "?x0d,?s0y", 0xd01c0000, 0xffff8080, RD_C2, 0, AL },
++{"vrnds.s", "?s0y", 0xd0200000, 0xffff80ff, RD_C2, 0, AL },
++{"vrndi.s", "?d0d", 0xd0210000, 0xffffff80, RD_C2, 0, AL },
++{"vrndf1.s", "?d0d", 0xd0220000, 0xffffff80, RD_C2, 0, AL },
++{"vrndf2.s", "?d0d", 0xd0230000, 0xffffff80, RD_C2, 0, AL },
++{"vh2f.s", "?d1d,?s0y", 0xd0330000, 0xffff8080, RD_C2, 0, AL },
++{"vsbz.s", "?d0d,?s0s", 0xd0360000, 0xffff8080, RD_C2, 0, AL },
++{"vsbn.s", "?d0d,?s0s,?t0t", 0x61000000, 0xff808080, RD_C2, 0, AL },
++{"vlgb.s", "?d0d,?s0s", 0xd0370000, 0xffff8080, RD_C2, 0, AL },
++{"vocp.s", "?d0d,?s0y", 0xd0440000, 0xffff8080, RD_C2, 0, AL },
++{"vsocp.s", "?d1z,?s0y", 0xd0450000, 0xffff8080, RD_C2, 0, AL },
++{"vf2in.s", "?d0m,?s0s,?b", 0xd2000000, 0xffe08080, RD_C2, 0, AL },
++{"vf2iz.s", "?d0m,?s0s,?b", 0xd2200000, 0xffe08080, RD_C2, 0, AL },
++{"vf2iu.s", "?d0m,?s0s,?b", 0xd2400000, 0xffe08080, RD_C2, 0, AL },
++{"vf2id.s", "?d0m,?s0s,?b", 0xd2600000, 0xffe08080, RD_C2, 0, AL },
++{"vi2f.s", "?d0d,?s0w,?b", 0xd2800000, 0xffe08080, RD_C2, 0, AL },
++{"vcmov.s", "?d0d,?s0s,?e", 0, (int) M_VCMOV_S, INSN_MACRO, 0, AL },
++{"vcmovt.s", "?d0d,?s0s,?e", 0xd2a00000, 0xfff88080, RD_C2, 0, AL },
++{"vcmovf.s", "?d0d,?s0s,?e", 0xd2a80000, 0xfff88080, RD_C2, 0, AL },
++{"vwbn.s", "?d0d,?s0s,?i", 0xd3000000, 0xff008080, RD_C2, 0, AL },
++{"vpfxs", "?0,?1,?2,?3", 0xdc000000, 0xff000000, RD_C2, 0, AL },
++{"vpfxt", "?0,?1,?2,?3", 0xdd000000, 0xff000000, RD_C2, 0, AL },
++{"vpfxd", "?4,?5,?6,?7", 0xde000000, 0xff000000, RD_C2, 0, AL },
++{"viim.s", "?t0d,j", 0xdf000000, 0xff800000, RD_C2, 0, AL },
++{"vfim.s", "?t0d,?u", 0xdf800000, 0xff800000, RD_C2, 0, AL },
++{"vnop", "", 0xffff0000, 0xffffffff, RD_C2, 0, AL },
++{"vflush", "", 0xffff040d, 0xffffffff, RD_C2, 0, AL },
++{"vsync", "", 0xffff0320, 0xffffffff, RD_C2, 0, AL },
++{"vsync", "i", 0xffff0000, 0xffff0000, RD_C2, 0, AL },
++
+ /* Coprocessor 2 move/branch operations overlap with VR5400 .ob format
+ instructions so they are here for the latters to take precedence. */
+ {"bc2f", "p", 0x49000000, 0xffff0000, CBD|RD_CC, 0, I1 },
+@@ -1198,6 +1505,36 @@
+ {"mtc2", "t,G,H", 0x48800000, 0xffe007f8, COD|RD_t|WR_C2|WR_CC, 0, I32 },
+ {"mthc2", "t,i", 0x48e00000, 0xffe00000, COD|RD_t|WR_C2|WR_CC, 0, I33 },
+
++/* Coprocessor 2 load/store operations overlap with the Allegrex VFPU
++ instructions so they are here for the latters to take precedence. */
++/* COP1 ldc1 and sdc1 and COP3 ldc3 and sdc3 also overlap with the VFPU. */
++{"ldc1", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 },
++{"ldc1", "E,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 },
++{"ldc1", "T,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, 0, I2 },
++{"ldc1", "E,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, 0, I2 },
++{"l.d", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, /* ldc1 */
++{"l.d", "T,o(b)", 0, (int) M_L_DOB, INSN_MACRO, 0, I1 },
++{"l.d", "T,A(b)", 0, (int) M_L_DAB, INSN_MACRO, 0, I1 },
++{"ldc2", "E,o(b)", 0xd8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 },
++{"ldc2", "E,A(b)", 0, (int) M_LDC2_AB, INSN_MACRO, 0, I2 },
++{"ldc3", "E,o(b)", 0xdc000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 },
++{"ldc3", "E,A(b)", 0, (int) M_LDC3_AB, INSN_MACRO, 0, I2 },
++{"lwc2", "E,o(b)", 0xc8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I1 },
++{"lwc2", "E,A(b)", 0, (int) M_LWC2_AB, INSN_MACRO, 0, I1 },
++{"sdc1", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 },
++{"sdc1", "E,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 },
++{"sdc1", "T,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, 0, I2 },
++{"sdc1", "E,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, 0, I2 },
++{"s.d", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 },
++{"s.d", "T,o(b)", 0, (int) M_S_DOB, INSN_MACRO, 0, I1 },
++{"s.d", "T,A(b)", 0, (int) M_S_DAB, INSN_MACRO, 0, I1 },
++{"sdc2", "E,o(b)", 0xf8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I2 },
++{"sdc2", "E,A(b)", 0, (int) M_SDC2_AB, INSN_MACRO, 0, I2 },
++{"sdc3", "E,o(b)", 0xfc000000, 0xfc000000, SM|RD_C3|RD_b, 0, I2 },
++{"sdc3", "E,A(b)", 0, (int) M_SDC3_AB, INSN_MACRO, 0, I2 },
++{"swc2", "E,o(b)", 0xe8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I1 },
++{"swc2", "E,A(b)", 0, (int) M_SWC2_AB, INSN_MACRO, 0, I1 },
++
+ /* No hazard protection on coprocessor instructions--they shouldn't
+ change the state of the processor and if they do it's up to the
+ user to put in nops as necessary. These are at the end so that the
diff --git a/devel/psptoolchain-binutils/pkg-descr b/devel/psptoolchain-binutils/pkg-descr
new file mode 100644
index 000000000000..ebd84fb39295
--- /dev/null
+++ b/devel/psptoolchain-binutils/pkg-descr
@@ -0,0 +1,4 @@
+The PlayStation Portable Toolchain is a collection of tools and utilities
+for homebrew PSP development.
+
+WWW: http://www.ps2dev.org
diff --git a/devel/psptoolchain-binutils/pkg-plist b/devel/psptoolchain-binutils/pkg-plist
new file mode 100644
index 000000000000..df50a1cdf736
--- /dev/null
+++ b/devel/psptoolchain-binutils/pkg-plist
@@ -0,0 +1,51 @@
+psp/lib/libopcodes.la
+psp/lib/libopcodes.a
+psp/lib/libbfd.la
+psp/lib/libbfd.a
+psp/lib/ldscripts/elf_mipsallegrexel_psp.xu
+psp/lib/ldscripts/elf_mipsallegrexel_psp.xs
+psp/lib/ldscripts/elf_mipsallegrexel_psp.xr
+psp/lib/ldscripts/elf_mipsallegrexel_psp.xn
+psp/lib/ldscripts/elf_mipsallegrexel_psp.xbn
+psp/lib/ldscripts/elf_mipsallegrexel_psp.x
+psp/lib/ldscripts/elf32elmip.xw
+psp/lib/ldscripts/elf32elmip.xu
+psp/lib/ldscripts/elf32elmip.xsw
+psp/lib/ldscripts/elf32elmip.xsc
+psp/lib/ldscripts/elf32elmip.xs
+psp/lib/ldscripts/elf32elmip.xr
+psp/lib/ldscripts/elf32elmip.xn
+psp/lib/ldscripts/elf32elmip.xc
+psp/lib/ldscripts/elf32elmip.xbn
+psp/lib/ldscripts/elf32elmip.x
+psp/include/symcat.h
+psp/include/dis-asm.h
+psp/include/bfdlink.h
+psp/include/bfd.h
+psp/include/ansidecl.h
+psp/bin/strip
+psp/bin/ranlib
+psp/bin/objdump
+psp/bin/nm
+psp/bin/ld
+psp/bin/as
+psp/bin/ar
+bin/psp-strip
+bin/psp-strings
+bin/psp-size
+bin/psp-readelf
+bin/psp-ranlib
+bin/psp-objdump
+bin/psp-objcopy
+bin/psp-nm
+bin/psp-ld
+bin/psp-gprof
+bin/psp-c++filt
+bin/psp-as
+bin/psp-ar
+bin/psp-addr2line
+@dirrm psp/lib/ldscripts
+@dirrmtry psp/lib
+@dirrmtry psp/include
+@dirrmtry psp/bin
+@dirrmtry psp
diff --git a/devel/psptoolchain-gcc-stage1/Makefile b/devel/psptoolchain-gcc-stage1/Makefile
new file mode 100644
index 000000000000..e827393250b8
--- /dev/null
+++ b/devel/psptoolchain-gcc-stage1/Makefile
@@ -0,0 +1,69 @@
+# New ports collection makefile for: psptoolchain-gcc-stage1
+# Date created: 19 July 2009
+# Whom: Tassilo Philipp <tphilipp@potion-studios.com>
+#
+# $FreeBSD$
+#
+
+PORTNAME= gcc
+PORTVERSION= 4.1.0
+CATEGORIES= devel
+MASTER_SITES= ${MASTER_SITE_GCC}
+MASTER_SITE_SUBDIR= releases/${DISTNAME}/
+PKGNAMEPREFIX= psptoolchain-
+PKGNAMESUFFIX?= -stage1
+
+MAINTAINER= tphilipp@potion-studios.com
+COMMENT= PlayStation Portable development toolchain ${PORTNAME}
+
+PSP_GCC_STAGE_PREFIX= psp/stage1
+
+BUILD_DEPENDS+= psp-addr2line:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-ar:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-as:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-c++filt:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-gprof:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-ld:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-nm:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-objcopy:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-objdump:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-ranlib:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-readelf:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-size:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-strings:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-strip:${PORTSDIR}/devel/psptoolchain-binutils
+
+USE_BZIP2= yes
+USE_GMAKE= yes
+
+HAS_CONFIGURE= yes
+MAKE_ENV+= PATH=${PREFIX}/${PSP_GCC_STAGE_PREFIX}/bin:${PATH}
+CONFIGURE_ARGS?= --prefix=${PREFIX}/${PSP_GCC_STAGE_PREFIX} --target="psp" --enable-languages="c" --with-newlib --without-headers --disable-libssp --disable-nls --with-as=`which psp-as` --with-ld=`which psp-ld`
+
+# Don't install documentation for psptoolchain's gcc stage 1 - makes no sense.
+.if ${PKGNAMESUFFIX} == "-stage1"
+
+post-patch:
+ @${REINPLACE_CMD} -E 's/^(install-info:)(.*)/\1#\2/' ${WRKSRC}/gcc/Makefile.in
+ @${REINPLACE_CMD} -E 's/^(install-man:)(.*)/\1#\2/' ${WRKSRC}/gcc/Makefile.in
+ @${REINPLACE_CMD} -E 's/^(install:)(.*)/\1#\2/' ${WRKSRC}/libiberty/Makefile.in
+
+.else
+
+# Disable installation of .info files and libiberty.
+post-patch:
+ @${REINPLACE_CMD} -E 's/^(install-info:)(.*)/\1#\2/' ${WRKSRC}/gcc/Makefile.in
+ @${REINPLACE_CMD} -E 's/^(install:)(.*)/\1#\2/' ${WRKSRC}/libiberty/Makefile.in
+
+MAN1+= psp-cpp.1 \
+ psp-gcc.1 \
+ psp-gcov.1
+MAN7= fsf-funding.7 \
+ gfdl.7 \
+ gpl.7
+
+.endif
+
+PLIST_SUB+= PSP_GCC_STAGE_PREFIX=${PSP_GCC_STAGE_PREFIX}
+
+.include <bsd.port.mk>
diff --git a/devel/psptoolchain-gcc-stage1/distinfo b/devel/psptoolchain-gcc-stage1/distinfo
new file mode 100644
index 000000000000..0c93d7d9eadc
--- /dev/null
+++ b/devel/psptoolchain-gcc-stage1/distinfo
@@ -0,0 +1,3 @@
+MD5 (gcc-4.1.0.tar.bz2) = 88785071f29ed0e0b6b61057a1079442
+SHA256 (gcc-4.1.0.tar.bz2) = 1159457a0e4c054b709547ae21ff624aebab2033e0d9e5bf46c9cf88b1970606
+SIZE (gcc-4.1.0.tar.bz2) = 38639061
diff --git a/devel/psptoolchain-gcc-stage1/files/patch-config.sub b/devel/psptoolchain-gcc-stage1/files/patch-config.sub
new file mode 100644
index 000000000000..e59e912a62f4
--- /dev/null
+++ b/devel/psptoolchain-gcc-stage1/files/patch-config.sub
@@ -0,0 +1,29 @@
+--- config.sub.orig 2005-12-16 12:57:40.000000000 +0000
++++ config.sub 2006-05-07 13:27:40.000000000 +0100
+@@ -264,6 +264,7 @@
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
++ | mipsallegrex | mipsallegrexel \
+ | mn10200 | mn10300 \
+ | mt \
+ | msp430 \
+@@ -346,6 +347,7 @@
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
++ | mipsallegrex-* | mipsallegrexel-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+@@ -689,6 +691,10 @@
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
++ psp)
++ basic_machine=mipsallegrexel-psp
++ os=-elf
++ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
diff --git a/devel/psptoolchain-gcc-stage1/files/patch-gcc-c-incpath.c b/devel/psptoolchain-gcc-stage1/files/patch-gcc-c-incpath.c
new file mode 100644
index 000000000000..71d7ec4fa8dd
--- /dev/null
+++ b/devel/psptoolchain-gcc-stage1/files/patch-gcc-c-incpath.c
@@ -0,0 +1,28 @@
+--- gcc/c-incpath.c.orig 2005-06-25 03:02:01.000000000 +0100
++++ gcc/c-incpath.c 2006-05-07 13:27:40.000000000 +0100
+@@ -331,13 +331,18 @@
+ cpp_dir *p;
+
+ #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+- /* Convert all backslashes to slashes. The native CRT stat()
+- function does not recognize a directory that ends in a backslash
+- (unless it is a drive root dir, such "c:\"). Forward slashes,
+- trailing or otherwise, cause no problems for stat(). */
+- char* c;
+- for (c = path; *c; c++)
+- if (*c == '\\') *c = '/';
++ /* Remove unnecessary trailing slashes. On some versions of MS
++ Windows, trailing _forward_ slashes cause no problems for stat().
++ On newer versions, stat() does not recognise a directory that ends
++ in a '\\' or '/', unless it is a drive root dir, such as "c:/",
++ where it is obligatory. */
++ int pathlen = strlen (path);
++ char* end = path + pathlen - 1;
++ /* Preserve the lead '/' or lead "c:/". */
++ char* start = path + (pathlen > 2 && path[1] == ':' ? 3 : 1);
++
++ for (; end > start && IS_DIR_SEPARATOR (*end); end--)
++ *end = 0;
+ #endif
+
+ p = xmalloc (sizeof (cpp_dir));
diff --git a/devel/psptoolchain-gcc-stage1/files/patch-gcc-config-mips-allegrex.md b/devel/psptoolchain-gcc-stage1/files/patch-gcc-config-mips-allegrex.md
new file mode 100644
index 000000000000..55c789359831
--- /dev/null
+++ b/devel/psptoolchain-gcc-stage1/files/patch-gcc-config-mips-allegrex.md
@@ -0,0 +1,186 @@
+--- gcc/config/mips/allegrex.md.orig 1970-01-01 01:00:00.000000000 +0100
++++ gcc/config/mips/allegrex.md 2006-05-07 13:27:40.000000000 +0100
+@@ -0,0 +1,183 @@
++;; Sony ALLEGREX instructions.
++;; Copyright (C) 2005 Free Software Foundation, Inc.
++;;
++;; This file is part of GCC.
++;;
++;; GCC is free software; you can redistribute it and/or modify
++;; it under the terms of the GNU General Public License as published by
++;; the Free Software Foundation; either version 2, or (at your option)
++;; any later version.
++;;
++;; GCC is distributed in the hope that it will be useful,
++;; but WITHOUT ANY WARRANTY; without even the implied warranty of
++;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++;; GNU General Public License for more details.
++;;
++;; You should have received a copy of the GNU General Public License
++;; along with GCC; see the file COPYING. If not, write to
++;; the Free Software Foundation, 59 Temple Place - Suite 330,
++;; Boston, MA 02111-1307, USA.
++
++; Multiply Add and Subtract.
++
++(define_insn "allegrex_madd"
++ [(set (match_operand:SI 0 "register_operand" "+l")
++ (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "d")
++ (match_operand:SI 2 "register_operand" "d"))
++ (match_dup 0)))
++ (clobber (match_scratch:SI 3 "=h"))]
++ "TARGET_ALLEGREX"
++ "madd\t%1,%2"
++ [(set_attr "type" "imadd")
++ (set_attr "mode" "SI")])
++
++(define_insn "allegrex_msub"
++ [(set (match_operand:SI 0 "register_operand" "+l")
++ (minus:SI (match_dup 0)
++ (mult:SI (match_operand:SI 1 "register_operand" "d")
++ (match_operand:SI 2 "register_operand" "d"))))
++ (clobber (match_scratch:SI 3 "=h"))]
++ "TARGET_ALLEGREX"
++ "msub\t%1,%2"
++ [(set_attr "type" "imadd")
++ (set_attr "mode" "SI")])
++
++
++; Min and max.
++
++(define_insn "sminsi3"
++ [(set (match_operand:SI 0 "register_operand" "=d")
++ (smin:SI (match_operand:SI 1 "register_operand" "d")
++ (match_operand:SI 2 "register_operand" "d")))]
++ "TARGET_ALLEGREX"
++ "min\t%0,%1,%2"
++ [(set_attr "type" "arith")
++ (set_attr "mode" "SI")])
++
++(define_insn "smaxsi3"
++ [(set (match_operand:SI 0 "register_operand" "=d")
++ (smax:SI (match_operand:SI 1 "register_operand" "d")
++ (match_operand:SI 2 "register_operand" "d")))]
++ "TARGET_ALLEGREX"
++ "max\t%0,%1,%2"
++ [(set_attr "type" "arith")
++ (set_attr "mode" "SI")])
++
++
++; Extended shift instructions.
++
++(define_insn "allegrex_bitrev"
++ [(set (match_operand:SI 0 "register_operand" "=d")
++ (unspec:SI [(match_operand:SI 1 "register_operand" "d")]
++ UNSPEC_BITREV))]
++ "TARGET_ALLEGREX"
++ "bitrev\t%0,%1"
++ [(set_attr "type" "arith")
++ (set_attr "mode" "SI")])
++
++(define_insn "allegrex_wsbh"
++ [(set (match_operand:SI 0 "register_operand" "=d")
++ (unspec:SI [(match_operand:SI 1 "register_operand" "d")]
++ UNSPEC_WSBH))]
++ "TARGET_ALLEGREX"
++ "wsbh\t%0,%1"
++ [(set_attr "type" "arith")
++ (set_attr "mode" "SI")])
++
++(define_insn "allegrex_wsbw"
++ [(set (match_operand:SI 0 "register_operand" "=d")
++ (unspec:SI [(match_operand:SI 1 "register_operand" "d")]
++ UNSPEC_WSBW))]
++ "TARGET_ALLEGREX"
++ "wsbw\t%0,%1"
++ [(set_attr "type" "arith")
++ (set_attr "mode" "SI")])
++
++
++; Count leading ones, count trailing zeros, and count trailing ones (clz is
++; already defined).
++
++(define_insn "allegrex_clo"
++ [(set (match_operand:SI 0 "register_operand" "=d")
++ (unspec:SI [(match_operand:SI 1 "register_operand" "d")]
++ UNSPEC_CLO))]
++ "TARGET_ALLEGREX"
++ "clo\t%0,%1"
++ [(set_attr "type" "clz")
++ (set_attr "mode" "SI")])
++
++(define_expand "ctzsi2"
++ [(set (match_operand:SI 0 "register_operand")
++ (ctz:SI (match_operand:SI 1 "register_operand")))]
++ "TARGET_ALLEGREX"
++{
++ rtx r1;
++
++ r1 = gen_reg_rtx (SImode);
++ emit_insn (gen_allegrex_bitrev (r1, operands[1]));
++ emit_insn (gen_clzsi2 (operands[0], r1));
++ DONE;
++})
++
++(define_expand "allegrex_cto"
++ [(set (match_operand:SI 0 "register_operand")
++ (unspec:SI [(match_operand:SI 1 "register_operand")]
++ UNSPEC_CTO))]
++ "TARGET_ALLEGREX"
++{
++ rtx r1;
++
++ r1 = gen_reg_rtx (SImode);
++ emit_insn (gen_allegrex_bitrev (r1, operands[1]));
++ emit_insn (gen_allegrex_clo (operands[0], r1));
++ DONE;
++})
++
++
++; Misc.
++
++(define_insn "allegrex_sync"
++ [(unspec_volatile [(const_int 0)] UNSPEC_SYNC)]
++ "TARGET_ALLEGREX"
++ "sync"
++ [(set_attr "type" "unknown")
++ (set_attr "mode" "none")])
++
++(define_insn "allegrex_cache"
++ [(unspec_volatile [(match_operand:SI 0 "const_int_operand" "")
++ (match_operand:SI 1 "register_operand" "d")]
++ UNSPEC_CACHE)]
++ "TARGET_ALLEGREX"
++ "cache\t%0,0(%1)"
++ [(set_attr "type" "unknown")
++ (set_attr "mode" "none")])
++
++
++; Floating-point builtins.
++
++(define_insn "allegrex_ceil_w_s"
++ [(set (match_operand:SI 0 "register_operand" "=f")
++ (unspec:SI [(match_operand:SF 1 "register_operand" "f")]
++ UNSPEC_CEIL_W_S))]
++ "TARGET_ALLEGREX"
++ "ceil.w.s\t%0,%1"
++ [(set_attr "type" "fcvt")
++ (set_attr "mode" "SF")])
++
++(define_insn "allegrex_floor_w_s"
++ [(set (match_operand:SI 0 "register_operand" "=f")
++ (unspec:SI [(match_operand:SF 1 "register_operand" "f")]
++ UNSPEC_FLOOR_W_S))]
++ "TARGET_ALLEGREX"
++ "floor.w.s\t%0,%1"
++ [(set_attr "type" "fcvt")
++ (set_attr "mode" "SF")])
++
++(define_insn "allegrex_round_w_s"
++ [(set (match_operand:SI 0 "register_operand" "=f")
++ (unspec:SI [(match_operand:SF 1 "register_operand" "f")]
++ UNSPEC_ROUND_W_S))]
++ "TARGET_ALLEGREX"
++ "round.w.s\t%0,%1"
++ [(set_attr "type" "fcvt")
++ (set_attr "mode" "SF")])
diff --git a/devel/psptoolchain-gcc-stage1/files/patch-gcc-config-mips-mips.c b/devel/psptoolchain-gcc-stage1/files/patch-gcc-config-mips-mips.c
new file mode 100644
index 000000000000..d042c79b30ca
--- /dev/null
+++ b/devel/psptoolchain-gcc-stage1/files/patch-gcc-config-mips-mips.c
@@ -0,0 +1,223 @@
+--- gcc/config/mips/mips.c.orig 2005-12-09 08:15:58.000000000 +0000
++++ gcc/config/mips/mips.c 2006-05-07 18:37:50.000000000 +0100
+@@ -179,6 +179,12 @@
+ MIPS_VOID_FTYPE_V2HI_V2HI,
+ MIPS_VOID_FTYPE_V4QI_V4QI,
+
++ /* For the Sony ALLEGREX. */
++ MIPS_SI_FTYPE_QI,
++ MIPS_SI_FTYPE_HI,
++ MIPS_VOID_FTYPE_VOID,
++ MIPS_SI_FTYPE_SF,
++
+ /* The last type. */
+ MIPS_MAX_FTYPE_MAX
+ };
+@@ -220,6 +226,11 @@
+ /* As above, but the instruction only sets a single $fcc register. */
+ MIPS_BUILTIN_CMP_SINGLE,
+
++ /* The builtin corresponds to the ALLEGREX cache instruction. Operand 0
++ is the function code (must be less than 32) and operand 1 is the base
++ address. */
++ MIPS_BUILTIN_CACHE,
++
+ /* For generating bposge32 branch instructions in MIPS32 DSP ASE. */
+ MIPS_BUILTIN_BPOSGE32
+ };
+@@ -405,6 +416,7 @@
+ static rtx mips_expand_builtin_compare (enum mips_builtin_type,
+ enum insn_code, enum mips_fp_condition,
+ rtx, tree);
++static rtx mips_expand_builtin_cache (enum insn_code icode, rtx, tree);
+ static rtx mips_expand_builtin_bposge (enum mips_builtin_type, rtx);
+ static void mips_encode_section_info (tree, rtx, int);
+
+@@ -721,6 +733,7 @@
+
+ /* MIPS II */
+ { "r6000", PROCESSOR_R6000, 2 },
++ { "allegrex", PROCESSOR_ALLEGREX, 2 },
+
+ /* MIPS III */
+ { "r4000", PROCESSOR_R4000, 3 },
+@@ -10169,6 +10182,67 @@
+ BPOSGE_BUILTIN (32, MASK_DSP)
+ };
+
++/* Builtin functions for the Sony ALLEGREX processor.
++
++ These have the `__builtin_allgrex_' prefix instead of `__builtin_mips_'
++ to maintain compatibility with Sony's ALLEGREX GCC port.
++
++ Some of the builtins may seem redundant, but they are the same as the
++ builtins defined in the Sony compiler. I chose to map redundant and
++ trivial builtins to the original instruction instead of creating
++ duplicate patterns specifically for the ALLEGREX (as Sony does). */
++
++/* Define a MIPS_BUILTIN_DIRECT function for instruction CODE_FOR_allegrex_<INSN>.
++ FUNCTION_TYPE and TARGET_FLAGS are builtin_description fields. */
++#define DIRECT_ALLEGREX_BUILTIN(INSN, FUNCTION_TYPE, TARGET_FLAGS) \
++ { CODE_FOR_allegrex_ ## INSN, 0, "__builtin_allegrex_" #INSN, \
++ MIPS_BUILTIN_DIRECT, FUNCTION_TYPE, TARGET_FLAGS }
++
++/* Same as the above, but mapped to an instruction that doesn't share the
++ NAME. NAME is the name of the builtin without the builtin prefix. */
++#define DIRECT_ALLEGREX_NAMED_BUILTIN(NAME, INSN, FUNCTION_TYPE, TARGET_FLAGS) \
++ { CODE_FOR_ ## INSN, 0, "__builtin_allegrex_" #NAME, \
++ MIPS_BUILTIN_DIRECT, FUNCTION_TYPE, TARGET_FLAGS }
++
++/* Define a MIPS_BUILTIN_DIRECT_NO_TARGET function for instruction
++ CODE_FOR_allegrex_<INSN>. FUNCTION_TYPE and TARGET_FLAGS are
++ builtin_description fields. */
++#define DIRECT_ALLEGREX_NO_TARGET_BUILTIN(INSN, FUNCTION_TYPE, TARGET_FLAGS) \
++ { CODE_FOR_allegrex_ ## INSN, 0, "__builtin_allegrex_" #INSN, \
++ MIPS_BUILTIN_DIRECT_NO_TARGET, FUNCTION_TYPE, TARGET_FLAGS }
++
++/* Define a builtin with a specific function TYPE. */
++#define SPECIAL_ALLEGREX_BUILTIN(TYPE, INSN, FUNCTION_TYPE, TARGET_FLAGS) \
++ { CODE_FOR_allegrex_ ## INSN, 0, "__builtin_allegrex_" #INSN, \
++ MIPS_BUILTIN_ ## TYPE, FUNCTION_TYPE, TARGET_FLAGS }
++
++static const struct builtin_description allegrex_bdesc[] =
++{
++ DIRECT_ALLEGREX_BUILTIN(bitrev, MIPS_SI_FTYPE_SI, 0),
++ DIRECT_ALLEGREX_BUILTIN(wsbh, MIPS_SI_FTYPE_SI, 0),
++ DIRECT_ALLEGREX_BUILTIN(wsbw, MIPS_SI_FTYPE_SI, 0),
++ DIRECT_ALLEGREX_NAMED_BUILTIN(clz, clzsi2, MIPS_SI_FTYPE_SI, 0),
++ DIRECT_ALLEGREX_BUILTIN(clo, MIPS_SI_FTYPE_SI, 0),
++ DIRECT_ALLEGREX_NAMED_BUILTIN(ctz, ctzsi2, MIPS_SI_FTYPE_SI, 0),
++ DIRECT_ALLEGREX_BUILTIN(cto, MIPS_SI_FTYPE_SI, 0),
++ DIRECT_ALLEGREX_NAMED_BUILTIN(rotr, rotrsi3, MIPS_SI_FTYPE_SI_SI, 0),
++ DIRECT_ALLEGREX_NAMED_BUILTIN(rotl, rotlsi3, MIPS_SI_FTYPE_SI_SI, 0),
++
++ DIRECT_ALLEGREX_NAMED_BUILTIN(seb, extendqisi2, MIPS_SI_FTYPE_QI, 0),
++ DIRECT_ALLEGREX_NAMED_BUILTIN(seh, extendhisi2, MIPS_SI_FTYPE_HI, 0),
++ DIRECT_ALLEGREX_NAMED_BUILTIN(max, smaxsi3, MIPS_SI_FTYPE_SI_SI, 0),
++ DIRECT_ALLEGREX_NAMED_BUILTIN(min, sminsi3, MIPS_SI_FTYPE_SI_SI, 0),
++
++ DIRECT_ALLEGREX_NO_TARGET_BUILTIN(sync, MIPS_VOID_FTYPE_VOID, 0),
++ SPECIAL_ALLEGREX_BUILTIN(CACHE, cache, MIPS_VOID_FTYPE_SI_SI, 0),
++
++ DIRECT_ALLEGREX_NAMED_BUILTIN(sqrt_s, sqrtsf2, MIPS_SF_FTYPE_SF, 0),
++ DIRECT_ALLEGREX_BUILTIN(ceil_w_s, MIPS_SI_FTYPE_SF, 0),
++ DIRECT_ALLEGREX_BUILTIN(floor_w_s, MIPS_SI_FTYPE_SF, 0),
++ DIRECT_ALLEGREX_BUILTIN(round_w_s, MIPS_SI_FTYPE_SF, 0),
++ DIRECT_ALLEGREX_NAMED_BUILTIN(trunc_w_s, fix_truncsfsi2_insn, MIPS_SI_FTYPE_SF, 0)
++};
++
+ /* This helps provide a mapping from builtin function codes to bdesc
+ arrays. */
+
+@@ -10189,6 +10263,7 @@
+ {
+ { mips_bdesc, ARRAY_SIZE (mips_bdesc), PROCESSOR_MAX },
+ { sb1_bdesc, ARRAY_SIZE (sb1_bdesc), PROCESSOR_SB1 },
++ { allegrex_bdesc, ARRAY_SIZE (allegrex_bdesc), PROCESSOR_ALLEGREX },
+ { dsp_bdesc, ARRAY_SIZE (dsp_bdesc), PROCESSOR_MAX }
+ };
+
+@@ -10292,6 +10367,9 @@
+ case MIPS_BUILTIN_BPOSGE32:
+ return mips_expand_builtin_bposge (type, target);
+
++ case MIPS_BUILTIN_CACHE:
++ return mips_expand_builtin_cache (icode, target, arglist);
++
+ default:
+ return 0;
+ }
+@@ -10310,8 +10388,8 @@
+ tree V4QI_type_node;
+ unsigned int offset;
+
+- /* We have only builtins for -mpaired-single, -mips3d and -mdsp. */
+- if (!TARGET_PAIRED_SINGLE_FLOAT && !TARGET_DSP)
++ /* We have only builtins for -mpaired-single, -mips3d and -mdsp and the Sony ALLEGREX. */
++ if (!TARGET_PAIRED_SINGLE_FLOAT && !TARGET_DSP && !TARGET_ALLEGREX)
+ return;
+
+ if (TARGET_PAIRED_SINGLE_FLOAT)
+@@ -10376,6 +10454,44 @@
+ double_type_node, double_type_node, NULL_TREE);
+ }
+
++ if (TARGET_ALLEGREX)
++ {
++ types[MIPS_SI_FTYPE_QI]
++ = build_function_type_list (intSI_type_node,
++ intQI_type_node,
++ NULL_TREE);
++
++ types[MIPS_SI_FTYPE_HI]
++ = build_function_type_list (intSI_type_node,
++ intHI_type_node,
++ NULL_TREE);
++
++ types[MIPS_SI_FTYPE_SI]
++ = build_function_type_list (intSI_type_node,
++ intSI_type_node,
++ NULL_TREE);
++
++ types[MIPS_SI_FTYPE_SI_SI]
++ = build_function_type_list (intSI_type_node,
++ intSI_type_node, intSI_type_node,
++ NULL_TREE);
++
++ types[MIPS_VOID_FTYPE_VOID]
++ = build_function_type_list (void_type_node, void_type_node, NULL_TREE);
++
++ types[MIPS_VOID_FTYPE_SI_SI]
++ = build_function_type_list (void_type_node,
++ intSI_type_node, intSI_type_node, NULL_TREE);
++
++ types[MIPS_SF_FTYPE_SF]
++ = build_function_type_list (float_type_node,
++ float_type_node, NULL_TREE);
++
++ types[MIPS_SI_FTYPE_SF]
++ = build_function_type_list (intSI_type_node,
++ float_type_node, NULL_TREE);
++ }
++
+ if (TARGET_DSP)
+ {
+ V2HI_type_node = build_vector_type_for_mode (intHI_type_node, V2HImode);
+@@ -10557,6 +10673,10 @@
+
+ switch (i)
+ {
++ case 0:
++ emit_insn (GEN_FCN (icode) (0));
++ break;
++
+ case 2:
+ emit_insn (GEN_FCN (icode) (ops[0], ops[1]));
+ break;
+@@ -10767,4 +10887,26 @@
+ }
+ }
+
++/* Expand a __builtin_allegrex_cache() function. Make sure the passed
++ cache function code is less than 32. */
++
++static rtx
++mips_expand_builtin_cache (enum insn_code icode, rtx target, tree arglist)
++{
++ rtx op0, op1;
++
++ op0 = mips_prepare_builtin_arg (icode, 0, &arglist);
++ op1 = mips_prepare_builtin_arg (icode, 1, &arglist);
++
++ if (GET_CODE (op0) == CONST_INT)
++ if (INTVAL (op0) < 0 || INTVAL (op0) > 0x1f)
++ {
++ error ("invalid function code '%d'", INTVAL (op0));
++ return const0_rtx;
++ }
++
++ emit_insn (GEN_FCN (icode) (op0, op1));
++ return target;
++}
++
+ #include "gt-mips.h"
diff --git a/devel/psptoolchain-gcc-stage1/files/patch-gcc-config-mips-mips.h b/devel/psptoolchain-gcc-stage1/files/patch-gcc-config-mips-mips.h
new file mode 100644
index 000000000000..b1f746b8ffca
--- /dev/null
+++ b/devel/psptoolchain-gcc-stage1/files/patch-gcc-config-mips-mips.h
@@ -0,0 +1,98 @@
+--- gcc/config/mips/mips.h.orig 2006-02-17 21:38:59.000000000 +0000
++++ gcc/config/mips/mips.h 2006-05-07 18:37:54.000000000 +0100
+@@ -59,6 +59,7 @@
+ PROCESSOR_R9000,
+ PROCESSOR_SB1,
+ PROCESSOR_SR71000,
++ PROCESSOR_ALLEGREX,
+ PROCESSOR_MAX
+ };
+
+@@ -194,6 +195,7 @@
+ #define TARGET_MIPS9000 (mips_arch == PROCESSOR_R9000)
+ #define TARGET_SB1 (mips_arch == PROCESSOR_SB1)
+ #define TARGET_SR71K (mips_arch == PROCESSOR_SR71000)
++#define TARGET_ALLEGREX (mips_arch == PROCESSOR_ALLEGREX)
+
+ /* Scheduling target defines. */
+ #define TUNE_MIPS3000 (mips_tune == PROCESSOR_R3000)
+@@ -208,6 +210,7 @@
+ #define TUNE_MIPS7000 (mips_tune == PROCESSOR_R7000)
+ #define TUNE_MIPS9000 (mips_tune == PROCESSOR_R9000)
+ #define TUNE_SB1 (mips_tune == PROCESSOR_SB1)
++#define TUNE_ALLEGREX (mips_tune == PROCESSOR_ALLEGREX)
+
+ /* True if the pre-reload scheduler should try to create chains of
+ multiply-add or multiply-subtract instructions. For example,
+@@ -578,6 +581,9 @@
+ && !TARGET_MIPS5500 \
+ && !TARGET_MIPS16)
+
++/* ISA has just the integer condition move instructions (movn,movz) */
++#define ISA_HAS_INT_CONDMOVE (TARGET_ALLEGREX)
++
+ /* ISA has the mips4 FP condition code instructions: FP-compare to CC,
+ branch on CC, and move (both FP and non-FP) on CC. */
+ #define ISA_HAS_8CC (ISA_MIPS4 \
+@@ -594,7 +600,8 @@
+
+ /* ISA has conditional trap instructions. */
+ #define ISA_HAS_COND_TRAP (!ISA_MIPS1 \
+- && !TARGET_MIPS16)
++ && !TARGET_MIPS16 \
++ && !TARGET_ALLEGREX)
+
+ /* ISA has integer multiply-accumulate instructions, madd and msub. */
+ #define ISA_HAS_MADD_MSUB ((ISA_MIPS32 \
+@@ -612,6 +619,7 @@
+ #define ISA_HAS_CLZ_CLO ((ISA_MIPS32 \
+ || ISA_MIPS32R2 \
+ || ISA_MIPS64 \
++ || TARGET_ALLEGREX \
+ ) && !TARGET_MIPS16)
+
+ /* ISA has double-word count leading zeroes/ones instruction (not
+@@ -659,6 +667,7 @@
+ || TARGET_MIPS5400 \
+ || TARGET_MIPS5500 \
+ || TARGET_SR71K \
++ || TARGET_ALLEGREX \
+ ))
+
+ /* ISA has 64-bit rotate right instruction. */
+@@ -692,11 +701,13 @@
+ /* ISA includes the MIPS32r2 seb and seh instructions. */
+ #define ISA_HAS_SEB_SEH (!TARGET_MIPS16 \
+ && (ISA_MIPS32R2 \
++ || TARGET_ALLEGREX \
+ ))
+
+ /* ISA includes the MIPS32/64 rev 2 ext and ins instructions. */
+ #define ISA_HAS_EXT_INS (!TARGET_MIPS16 \
+ && (ISA_MIPS32R2 \
++ || TARGET_ALLEGREX \
+ ))
+
+ /* True if the result of a load is not available to the next instruction.
+@@ -727,7 +738,8 @@
+ #define ISA_HAS_HILO_INTERLOCKS (ISA_MIPS32 \
+ || ISA_MIPS32R2 \
+ || ISA_MIPS64 \
+- || TARGET_MIPS5500)
++ || TARGET_MIPS5500 \
++ || TARGET_ALLEGREX)
+
+ /* Add -G xx support. */
+
+@@ -1143,6 +1155,11 @@
+ #define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) \
+ ((VALUE) = GET_MODE_BITSIZE (MODE), true)
+
++/* The [d]clz instructions have the natural values at 0. */
++
++#define CLZ_DEFINED_VALUE_AT_ZERO(MODE, VALUE) \
++ ((VALUE) = GET_MODE_BITSIZE (MODE), true)
++
+ /* Standard register usage. */
+
+ /* Number of hardware registers. We have:
diff --git a/devel/psptoolchain-gcc-stage1/files/patch-gcc-config-mips-mips.md b/devel/psptoolchain-gcc-stage1/files/patch-gcc-config-mips-mips.md
new file mode 100644
index 000000000000..08bbc397d660
--- /dev/null
+++ b/devel/psptoolchain-gcc-stage1/files/patch-gcc-config-mips-mips.md
@@ -0,0 +1,140 @@
+--- gcc/config/mips/mips.md.orig 2005-07-29 18:25:27.000000000 +0100
++++ gcc/config/mips/mips.md 2006-05-07 14:59:33.000000000 +0100
+@@ -142,6 +142,21 @@
+ (UNSPEC_MTHLIP 365)
+ (UNSPEC_WRDSP 366)
+ (UNSPEC_RDDSP 367)
++
++ ;; Sony ALLEGREX instructions
++ (UNSPEC_WSBH 401)
++ (UNSPEC_WSBW 402)
++
++ (UNSPEC_CLO 403)
++ (UNSPEC_CTO 404)
++
++ (UNSPEC_CACHE 405)
++ (UNSPEC_SYNC 406)
++
++ (UNSPEC_CEIL_W_S 407)
++ (UNSPEC_FLOOR_W_S 408)
++ (UNSPEC_ROUND_W_S 409)
++
+ ]
+ )
+
+@@ -1601,9 +1616,9 @@
+ (mult:DI
+ (any_extend:DI (match_operand:SI 1 "register_operand" "d"))
+ (any_extend:DI (match_operand:SI 2 "register_operand" "d")))))]
+- "!TARGET_64BIT && ISA_HAS_MSAC"
++ "!TARGET_64BIT && (ISA_HAS_MSAC || TARGET_ALLEGREX)"
+ {
+- if (TARGET_MIPS5500)
++ if (TARGET_MIPS5500 || TARGET_ALLEGREX)
+ return "msub<u>\t%1,%2";
+ else
+ return "msac<u>\t$0,%1,%2";
+@@ -1718,12 +1733,12 @@
+ (mult:DI (any_extend:DI (match_operand:SI 1 "register_operand" "d"))
+ (any_extend:DI (match_operand:SI 2 "register_operand" "d")))
+ (match_operand:DI 3 "register_operand" "0")))]
+- "(TARGET_MAD || ISA_HAS_MACC)
++ "(TARGET_MAD || ISA_HAS_MACC || TARGET_ALLEGREX)
+ && !TARGET_64BIT"
+ {
+ if (TARGET_MAD)
+ return "mad<u>\t%1,%2";
+- else if (TARGET_MIPS5500)
++ else if (TARGET_MIPS5500 || TARGET_ALLEGREX)
+ return "madd<u>\t%1,%2";
+ else
+ /* See comment in *macc. */
+@@ -1995,6 +2010,32 @@
+ ;;
+ ;; ....................
+ ;;
++;; FIND FIRST BIT INSTRUCTION
++;;
++;; ....................
++;;
++
++(define_expand "ffs<mode>2"
++ [(set (match_operand:GPR 0 "register_operand" "")
++ (ffs:GPR (match_operand:GPR 1 "register_operand" "")))]
++ "ISA_HAS_CLZ_CLO"
++{
++ rtx r1, r2, r3, r4;
++
++ r1 = gen_reg_rtx (<MODE>mode);
++ r2 = gen_reg_rtx (<MODE>mode);
++ r3 = gen_reg_rtx (<MODE>mode);
++ r4 = gen_reg_rtx (<MODE>mode);
++ emit_insn (gen_neg<mode>2 (r1, operands[1]));
++ emit_insn (gen_and<mode>3 (r2, operands[1], r1));
++ emit_insn (gen_clz<mode>2 (r3, r2));
++ emit_move_insn (r4, GEN_INT (GET_MODE_BITSIZE (<MODE>mode)));
++ emit_insn (gen_sub<mode>3 (operands[0], r4, r3));
++ DONE;
++})
++;;
++;; ....................
++;;
+ ;; NEGATION and ONE'S COMPLEMENT
+ ;;
+ ;; ....................
+@@ -4193,6 +4234,25 @@
+ [(set_attr "type" "shift")
+ (set_attr "mode" "<MODE>")])
+
++(define_expand "rotl<mode>3"
++ [(set (match_operand:GPR 0 "register_operand")
++ (rotate:GPR (match_operand:GPR 1 "register_operand")
++ (match_operand:SI 2 "arith_operand")))]
++ "ISA_HAS_ROTR_<MODE>"
++{
++ rtx temp;
++
++ if (GET_CODE (operands[2]) == CONST_INT)
++ temp = GEN_INT (GET_MODE_BITSIZE (<MODE>mode) - INTVAL (operands[2]));
++ else
++ {
++ temp = gen_reg_rtx (<MODE>mode);
++ emit_insn (gen_neg<mode>2 (temp, operands[2]));
++ }
++ emit_insn (gen_rotr<mode>3 (operands[0], operands[1], temp));
++ DONE;
++})
++
+ ;;
+ ;; ....................
+ ;;
+@@ -5306,7 +5366,7 @@
+ (const_int 0)])
+ (match_operand:GPR 2 "reg_or_0_operand" "dJ,0")
+ (match_operand:GPR 3 "reg_or_0_operand" "0,dJ")))]
+- "ISA_HAS_CONDMOVE"
++ "ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE"
+ "@
+ mov%T4\t%0,%z2,%1
+ mov%t4\t%0,%z3,%1"
+@@ -5336,8 +5396,12 @@
+ (if_then_else:GPR (match_dup 5)
+ (match_operand:GPR 2 "reg_or_0_operand")
+ (match_operand:GPR 3 "reg_or_0_operand")))]
+- "ISA_HAS_CONDMOVE"
++ "ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE"
+ {
++ if (ISA_HAS_INT_CONDMOVE
++ && GET_MODE_CLASS (GET_MODE (cmp_operands[0])) == MODE_FLOAT)
++ FAIL;
++
+ gen_conditional_move (operands);
+ DONE;
+ })
+@@ -5428,3 +5492,6 @@
+ ; The MIPS DSP Instructions.
+
+ (include "mips-dsp.md")
++
++; Sony ALLEGREX instructions.
++(include "allegrex.md")
diff --git a/devel/psptoolchain-gcc-stage1/files/patch-gcc-config-mips-psp.h b/devel/psptoolchain-gcc-stage1/files/patch-gcc-config-mips-psp.h
new file mode 100644
index 000000000000..346633c951a7
--- /dev/null
+++ b/devel/psptoolchain-gcc-stage1/files/patch-gcc-config-mips-psp.h
@@ -0,0 +1,34 @@
+--- gcc/config/mips/psp.h.orig 1970-01-01 01:00:00.000000000 +0100
++++ gcc/config/mips/psp.h 2006-05-07 13:27:43.000000000 +0100
+@@ -0,0 +1,31 @@
++/* Support for Sony's Playstation Portable (PSP).
++ Copyright (C) 2005 Free Software Foundation, Inc.
++ Contributed by Marcus R. Brown <mrbrown@ocgnet.org>
++
++This file is part of GCC.
++
++GCC is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 2, or (at your option)
++any later version.
++
++GCC is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with GCC; see the file COPYING. If not, write to
++the Free Software Foundation, 59 Temple Place - Suite 330,
++Boston, MA 02111-1307, USA. */
++
++/* Override the startfile spec to include crt0.o. */
++#undef STARTFILE_SPEC
++#define STARTFILE_SPEC "crt0%O%s crti%O%s crtbegin%O%s"
++
++#undef SUBTARGET_CPP_SPEC
++#define SUBTARGET_CPP_SPEC "-DPSP=1 -D__psp__=1 -D_PSP=1"
++
++/* Get rid of the .pdr section. */
++#undef SUBTARGET_ASM_SPEC
++#define SUBTARGET_ASM_SPEC "-mno-pdr"
diff --git a/devel/psptoolchain-gcc-stage1/files/patch-gcc-config-mips-t-allegrex b/devel/psptoolchain-gcc-stage1/files/patch-gcc-config-mips-t-allegrex
new file mode 100644
index 000000000000..8325a46872d8
--- /dev/null
+++ b/devel/psptoolchain-gcc-stage1/files/patch-gcc-config-mips-t-allegrex
@@ -0,0 +1,32 @@
+--- gcc/config/mips/t-allegrex.orig 1970-01-01 01:00:00.000000000 +0100
++++ gcc/config/mips/t-allegrex 2006-05-07 13:27:43.000000000 +0100
+@@ -0,0 +1,29 @@
++# Suppress building libgcc1.a, since the MIPS compiler port is complete
++# and does not need anything from libgcc1.a.
++LIBGCC1 =
++CROSS_LIBGCC1 =
++
++EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o
++# Don't let CTOR_LIST end up in sdata section.
++CRTSTUFF_T_CFLAGS = -G 0
++
++# Assemble startup files.
++$(T)crti.o: $(srcdir)/config/mips/crti.asm $(GCC_PASSES)
++ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
++ -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mips/crti.asm
++
++$(T)crtn.o: $(srcdir)/config/mips/crtn.asm $(GCC_PASSES)
++ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
++ -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm
++
++# We must build libgcc2.a with -G 0, in case the user wants to link
++# without the $gp register.
++TARGET_LIBGCC2_CFLAGS = -G 0
++
++# Build the libraries for both hard and soft floating point
++
++MULTILIB_OPTIONS =
++MULTILIB_DIRNAMES =
++
++LIBGCC = stmp-multilib
++INSTALL_LIBGCC = install-multilib
diff --git a/devel/psptoolchain-gcc-stage1/files/patch-gcc-config.gcc b/devel/psptoolchain-gcc-stage1/files/patch-gcc-config.gcc
new file mode 100644
index 000000000000..93b13a289527
--- /dev/null
+++ b/devel/psptoolchain-gcc-stage1/files/patch-gcc-config.gcc
@@ -0,0 +1,46 @@
+--- gcc/config.gcc.orig 2006-02-06 16:07:46.000000000 +0000
++++ gcc/config.gcc 2006-05-07 13:27:40.000000000 +0100
+@@ -406,12 +406,6 @@
+ tm_defines="${tm_defines} FBSD_MAJOR=5" ;;
+ *-*-freebsd6 | *-*-freebsd[6].*)
+ tm_defines="${tm_defines} FBSD_MAJOR=6" ;;
+- *-*-freebsd7 | *-*-freebsd[7].*)
+- tm_defines="${tm_defines} FBSD_MAJOR=7" ;;
+- *-*-freebsd8 | *-*-freebsd[8].*)
+- tm_defines="${tm_defines} FBSD_MAJOR=8" ;;
+- *-*-freebsd9 | *-*-freebsd[9].*)
+- tm_defines="${tm_defines} FBSD_MAJOR=9" ;;
+ *)
+ echo 'Please update *-*-freebsd* in gcc/config.gcc'
+ exit 1
+@@ -756,11 +750,6 @@
+ tmake_file=bfin/t-bfin-elf
+ use_collect2=no
+ ;;
+-bfin*-uclinux*)
+- tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h bfin/uclinux.h"
+- tmake_file=bfin/t-bfin-elf
+- use_collect2=no
+- ;;
+ bfin*-*)
+ tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h"
+ tmake_file=bfin/t-bfin
+@@ -1584,6 +1573,18 @@
+ tmake_file=mips/t-r3900
+ use_fixproto=yes
+ ;;
++mipsallegrex-*-elf* | mipsallegrexel-*-elf*)
++ tm_file="elfos.h ${tm_file} mips/elf.h"
++ tmake_file=mips/t-allegrex
++ target_cpu_default="MASK_SINGLE_FLOAT|MASK_DIVIDE_BREAKS"
++ tm_defines="MIPS_ISA_DEFAULT=2 MIPS_CPU_STRING_DEFAULT=\\\"allegrex\\\" MIPS_ABI_DEFAULT=ABI_EABI"
++ case ${target} in
++ mipsallegrex*-psp-elf*)
++ tm_file="${tm_file} mips/psp.h"
++ ;;
++ esac
++ use_fixproto=yes
++ ;;
+ mmix-knuth-mmixware)
+ need_64bit_hwint=yes
+ ;;
diff --git a/devel/psptoolchain-gcc-stage1/files/patch-gcc-version.c b/devel/psptoolchain-gcc-stage1/files/patch-gcc-version.c
new file mode 100644
index 000000000000..de27520bf021
--- /dev/null
+++ b/devel/psptoolchain-gcc-stage1/files/patch-gcc-version.c
@@ -0,0 +1,20 @@
+--- gcc/version.c.orig 2005-03-16 06:04:10.000000000 +0000
++++ gcc/version.c 2006-05-07 13:47:56.000000000 +0100
+@@ -8,7 +8,7 @@
+ in parentheses. You may also wish to include a number indicating
+ the revision of your modified compiler. */
+
+-#define VERSUFFIX ""
++#define VERSUFFIX " (PSPDEV 20060507)"
+
+ /* This is the location of the online document giving instructions for
+ reporting bugs. If you distribute a modified version of GCC,
+@@ -17,7 +17,7 @@
+ forward us bugs reported to you, if you determine that they are
+ not bugs in your modifications.) */
+
+-const char bug_report_url[] = "<URL:http://gcc.gnu.org/bugs.html>";
++const char bug_report_url[] = "<URL:http://wiki.pspdev.org/psp:toolchain#bugs>";
+
+ /* The complete version string, assembled from several pieces.
+ BASEVER, DATESTAMP, and DEVPHASE are defined by the Makefile. */
diff --git a/devel/psptoolchain-gcc-stage1/pkg-descr b/devel/psptoolchain-gcc-stage1/pkg-descr
new file mode 100644
index 000000000000..ebd84fb39295
--- /dev/null
+++ b/devel/psptoolchain-gcc-stage1/pkg-descr
@@ -0,0 +1,4 @@
+The PlayStation Portable Toolchain is a collection of tools and utilities
+for homebrew PSP development.
+
+WWW: http://www.ps2dev.org
diff --git a/devel/psptoolchain-gcc-stage1/pkg-plist b/devel/psptoolchain-gcc-stage1/pkg-plist
new file mode 100644
index 000000000000..2fabad952a07
--- /dev/null
+++ b/devel/psptoolchain-gcc-stage1/pkg-plist
@@ -0,0 +1,63 @@
+%%PSP_GCC_STAGE_PREFIX%%/libexec/gcc/psp/4.1.0/install-tools/mkheaders
+%%PSP_GCC_STAGE_PREFIX%%/libexec/gcc/psp/4.1.0/install-tools/fixproto
+%%PSP_GCC_STAGE_PREFIX%%/libexec/gcc/psp/4.1.0/install-tools/fixincl
+%%PSP_GCC_STAGE_PREFIX%%/libexec/gcc/psp/4.1.0/install-tools/fixinc.sh
+%%PSP_GCC_STAGE_PREFIX%%/libexec/gcc/psp/4.1.0/install-tools/fix-header
+%%PSP_GCC_STAGE_PREFIX%%/libexec/gcc/psp/4.1.0/collect2
+%%PSP_GCC_STAGE_PREFIX%%/libexec/gcc/psp/4.1.0/cc1
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/libgcov.a
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/libgcc.a
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/install-tools/mkheaders.conf
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/install-tools/macro_list
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/install-tools/include/varargs.h
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/install-tools/include/unwind.h
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/install-tools/include/stddef.h
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/install-tools/include/stdbool.h
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/install-tools/include/stdarg.h
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/install-tools/include/limits.h
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/install-tools/include/iso646.h
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/install-tools/include/float.h
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/install-tools/include/README
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/install-tools/gsyslimits.h
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/include/varargs.h
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/include/unwind.h
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/include/syslimits.h
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/include/stddef.h
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/include/stdbool.h
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/include/stdarg.h
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/include/limits.h
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/include/iso646.h
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/include/float.h
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/include/fixed
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/include/README
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/crtn.o
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/crti.o
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/crtend.o
+%%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/crtbegin.o
+%%PSP_GCC_STAGE_PREFIX%%/bin/psp-gcov
+%%PSP_GCC_STAGE_PREFIX%%/bin/psp-gccbug
+%%PSP_GCC_STAGE_PREFIX%%/bin/psp-gcc-4.1.0
+%%PSP_GCC_STAGE_PREFIX%%/bin/psp-gcc
+%%PSP_GCC_STAGE_PREFIX%%/bin/psp-cpp
+@dirrm %%PSP_GCC_STAGE_PREFIX%%/libexec/gcc/psp/4.1.0/install-tools
+@dirrm %%PSP_GCC_STAGE_PREFIX%%/libexec/gcc/psp/4.1.0
+@dirrm %%PSP_GCC_STAGE_PREFIX%%/libexec/gcc/psp
+@dirrm %%PSP_GCC_STAGE_PREFIX%%/libexec/gcc
+@dirrm %%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/install-tools/include
+@dirrm %%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/install-tools
+@dirrm %%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0/include
+@dirrm %%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp/4.1.0
+@dirrm %%PSP_GCC_STAGE_PREFIX%%/lib/gcc/psp
+@dirrm %%PSP_GCC_STAGE_PREFIX%%/lib/gcc
+@dirrmtry %%PSP_GCC_STAGE_PREFIX%%/psp/lib
+@dirrmtry %%PSP_GCC_STAGE_PREFIX%%/psp
+@dirrmtry %%PSP_GCC_STAGE_PREFIX%%/include
+@dirrmtry %%PSP_GCC_STAGE_PREFIX%%/lib
+@dirrmtry %%PSP_GCC_STAGE_PREFIX%%/libexec
+@dirrmtry %%PSP_GCC_STAGE_PREFIX%%/bin
+@dirrmtry %%PSP_GCC_STAGE_PREFIX%%/share
+@dirrmtry %%PSP_GCC_STAGE_PREFIX%%/info
+@dirrmtry %%PSP_GCC_STAGE_PREFIX%%/man/man7
+@dirrmtry %%PSP_GCC_STAGE_PREFIX%%/man/man1
+@dirrmtry %%PSP_GCC_STAGE_PREFIX%%/man
+@dirrmtry %%PSP_GCC_STAGE_PREFIX%%
diff --git a/devel/psptoolchain-gcc-stage2/Makefile b/devel/psptoolchain-gcc-stage2/Makefile
new file mode 100644
index 000000000000..ab63f3c381d7
--- /dev/null
+++ b/devel/psptoolchain-gcc-stage2/Makefile
@@ -0,0 +1,22 @@
+# New ports collection makefile for: psptoolchain-gcc-stage2
+# Date created: 15 February 2009
+# Whom: Tassilo Philipp <tphilipp@potion-studios.com>
+#
+# $FreeBSD$
+#
+
+PKGNAMESUFFIX= -stage2
+
+MAINTAINER= tphilipp@potion-studios.com
+
+BUILD_DEPENDS= ${LOCALBASE}/psp/lib/libc.a:${PORTSDIR}/devel/psptoolchain-newlib
+
+MAKE_ENV= CFLAGS_FOR_TARGET="-G0"
+CONFIGURE_ARGS= --prefix=${PREFIX} --target="psp" --enable-languages="c,c++" --with-newlib --enable-cxx-flags="-G0" --disable-nls
+
+MAN1= psp-g++.1
+
+PLIST= ${.CURDIR}/pkg-plist
+MASTERDIR= ${.CURDIR}/../psptoolchain-gcc-stage1
+
+.include "${MASTERDIR}/Makefile"
diff --git a/devel/psptoolchain-gcc-stage2/pkg-plist b/devel/psptoolchain-gcc-stage2/pkg-plist
new file mode 100644
index 000000000000..ff19deeb479d
--- /dev/null
+++ b/devel/psptoolchain-gcc-stage2/pkg-plist
@@ -0,0 +1,557 @@
+psp/lib/libsupc++.la
+psp/lib/libsupc++.a
+psp/lib/libstdc++.la
+psp/lib/libstdc++.a
+psp/lib/libssp_nonshared.la
+psp/lib/libssp_nonshared.a
+psp/lib/libssp.la
+psp/lib/libssp.a
+psp/bin/gcc
+psp/bin/g++
+psp/bin/c++
+libexec/gcc/psp/4.1.0/install-tools/mkheaders
+libexec/gcc/psp/4.1.0/install-tools/fixproto
+libexec/gcc/psp/4.1.0/install-tools/fixincl
+libexec/gcc/psp/4.1.0/install-tools/fixinc.sh
+libexec/gcc/psp/4.1.0/install-tools/fix-header
+libexec/gcc/psp/4.1.0/collect2
+libexec/gcc/psp/4.1.0/cc1plus
+libexec/gcc/psp/4.1.0/cc1
+lib/gcc/psp/4.1.0/libgcov.a
+lib/gcc/psp/4.1.0/libgcc.a
+lib/gcc/psp/4.1.0/install-tools/mkheaders.conf
+lib/gcc/psp/4.1.0/install-tools/macro_list
+lib/gcc/psp/4.1.0/install-tools/include/varargs.h
+lib/gcc/psp/4.1.0/install-tools/include/unwind.h
+lib/gcc/psp/4.1.0/install-tools/include/stddef.h
+lib/gcc/psp/4.1.0/install-tools/include/stdbool.h
+lib/gcc/psp/4.1.0/install-tools/include/stdarg.h
+lib/gcc/psp/4.1.0/install-tools/include/limits.h
+lib/gcc/psp/4.1.0/install-tools/include/iso646.h
+lib/gcc/psp/4.1.0/install-tools/include/float.h
+lib/gcc/psp/4.1.0/install-tools/include/README
+lib/gcc/psp/4.1.0/install-tools/gsyslimits.h
+lib/gcc/psp/4.1.0/include/varargs.h
+lib/gcc/psp/4.1.0/include/unwind.h
+lib/gcc/psp/4.1.0/include/syslimits.h
+lib/gcc/psp/4.1.0/include/stddef.h
+lib/gcc/psp/4.1.0/include/stdbool.h
+lib/gcc/psp/4.1.0/include/stdarg.h
+lib/gcc/psp/4.1.0/include/ssp/unistd.h
+lib/gcc/psp/4.1.0/include/ssp/string.h
+lib/gcc/psp/4.1.0/include/ssp/stdio.h
+lib/gcc/psp/4.1.0/include/ssp/ssp.h
+lib/gcc/psp/4.1.0/include/limits.h
+lib/gcc/psp/4.1.0/include/iso646.h
+lib/gcc/psp/4.1.0/include/float.h
+lib/gcc/psp/4.1.0/include/fixed
+lib/gcc/psp/4.1.0/include/README
+lib/gcc/psp/4.1.0/crtn.o
+lib/gcc/psp/4.1.0/crti.o
+lib/gcc/psp/4.1.0/crtend.o
+lib/gcc/psp/4.1.0/crtbegin.o
+include/c++/4.1.0/vector
+include/c++/4.1.0/valarray
+include/c++/4.1.0/utility
+include/c++/4.1.0/typeinfo
+include/c++/4.1.0/tr1/utility
+include/c++/4.1.0/tr1/unordered_set
+include/c++/4.1.0/tr1/unordered_map
+include/c++/4.1.0/tr1/type_traits_fwd.h
+include/c++/4.1.0/tr1/type_traits
+include/c++/4.1.0/tr1/tuple_iterate.h
+include/c++/4.1.0/tr1/tuple
+include/c++/4.1.0/tr1/repeat.h
+include/c++/4.1.0/tr1/ref_wrap_iterate.h
+include/c++/4.1.0/tr1/ref_fwd.h
+include/c++/4.1.0/tr1/mu_iterate.h
+include/c++/4.1.0/tr1/memory
+include/c++/4.1.0/tr1/hashtable
+include/c++/4.1.0/tr1/functional_iterate.h
+include/c++/4.1.0/tr1/functional
+include/c++/4.1.0/tr1/boost_shared_ptr.h
+include/c++/4.1.0/tr1/bind_repeat.h
+include/c++/4.1.0/tr1/bind_iterate.h
+include/c++/4.1.0/tr1/array
+include/c++/4.1.0/string
+include/c++/4.1.0/streambuf
+include/c++/4.1.0/stdexcept
+include/c++/4.1.0/stack
+include/c++/4.1.0/sstream
+include/c++/4.1.0/set
+include/c++/4.1.0/queue
+include/c++/4.1.0/psp/bits/time_members.h
+include/c++/4.1.0/psp/bits/stdc++.h.gch/O2g.gch
+include/c++/4.1.0/psp/bits/stdc++.h.gch/O0g.gch
+include/c++/4.1.0/psp/bits/os_defines.h
+include/c++/4.1.0/psp/bits/messages_members.h
+include/c++/4.1.0/psp/bits/gthr.h
+include/c++/4.1.0/psp/bits/gthr-tpf.h
+include/c++/4.1.0/psp/bits/gthr-single.h
+include/c++/4.1.0/psp/bits/gthr-posix.h
+include/c++/4.1.0/psp/bits/gthr-default.h
+include/c++/4.1.0/psp/bits/cxxabi_tweaks.h
+include/c++/4.1.0/psp/bits/ctype_noninline.h
+include/c++/4.1.0/psp/bits/ctype_inline.h
+include/c++/4.1.0/psp/bits/ctype_base.h
+include/c++/4.1.0/psp/bits/cpu_defines.h
+include/c++/4.1.0/psp/bits/c++locale.h
+include/c++/4.1.0/psp/bits/c++io.h
+include/c++/4.1.0/psp/bits/c++config.h
+include/c++/4.1.0/psp/bits/c++allocator.h
+include/c++/4.1.0/psp/bits/basic_file.h
+include/c++/4.1.0/psp/bits/atomic_word.h
+include/c++/4.1.0/ostream
+include/c++/4.1.0/numeric
+include/c++/4.1.0/new
+include/c++/4.1.0/memory
+include/c++/4.1.0/map
+include/c++/4.1.0/locale
+include/c++/4.1.0/list
+include/c++/4.1.0/limits
+include/c++/4.1.0/iterator
+include/c++/4.1.0/istream
+include/c++/4.1.0/iostream
+include/c++/4.1.0/iosfwd
+include/c++/4.1.0/ios
+include/c++/4.1.0/iomanip
+include/c++/4.1.0/functional
+include/c++/4.1.0/fstream
+include/c++/4.1.0/ext/vstring_util.h
+include/c++/4.1.0/ext/vstring_fwd.h
+include/c++/4.1.0/ext/vstring.tcc
+include/c++/4.1.0/ext/vstring.h
+include/c++/4.1.0/ext/typelist.h
+include/c++/4.1.0/ext/stdio_sync_filebuf.h
+include/c++/4.1.0/ext/stdio_filebuf.h
+include/c++/4.1.0/ext/sso_string_base.h
+include/c++/4.1.0/ext/slist
+include/c++/4.1.0/ext/ropeimpl.h
+include/c++/4.1.0/ext/rope
+include/c++/4.1.0/ext/rc_string_base.h
+include/c++/4.1.0/ext/rb_tree
+include/c++/4.1.0/ext/pool_allocator.h
+include/c++/4.1.0/ext/pod_char_traits.h
+include/c++/4.1.0/ext/pb_assoc/trivial_iterator_def.hpp
+include/c++/4.1.0/ext/pb_assoc/tree_policy.hpp
+include/c++/4.1.0/ext/pb_assoc/ms_trait.hpp
+include/c++/4.1.0/ext/pb_assoc/lu_policy.hpp
+include/c++/4.1.0/ext/pb_assoc/hash_policy.hpp
+include/c++/4.1.0/ext/pb_assoc/exception.hpp
+include/c++/4.1.0/ext/pb_assoc/ds_trait.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/value_type_adapter/value_type_traits.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/value_type_adapter/value_type_adapter.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/value_type_adapter/ref_pair.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/value_type_adapter/iterator_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/value_type_adapter/iterator.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/value_type_adapter/it_value_type_traits.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/value_type_adapter/invalidation_guarantee_selector.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/value_type_adapter/insert_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/value_type_adapter/info_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/value_type_adapter/find_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/value_type_adapter/erase_if_pred.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/value_type_adapter/erase_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/value_type_adapter/constructor_destructor_and_related.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/unordered_iterator/iterator.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/unordered_iterator/find_iterator.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/unordered_iterator/const_iterator.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/unordered_iterator/const_find_iterator.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/types_traits.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/typelist/typelist_typelist_append.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/typelist/typelist_transform.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/typelist/typelist_filter.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/typelist/typelist_contains.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/typelist/typelist_at_index.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/typelist/typelist_apply.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/typelist/typelist_append.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/typelist.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/type_utils.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/tree_policy/order_statistics_imp.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/tree_policy/null_node_updator_imp.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/tree_assoc_cntnr/constructor_destructor_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/standard_sizes.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/standard_policies.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/splay_tree_/split_join_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/splay_tree_/splay_tree_.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/splay_tree_/splay_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/splay_tree_/node.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/splay_tree_/insert_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/splay_tree_/info_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/splay_tree_/find_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/splay_tree_/erase_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/splay_tree_/debug_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/splay_tree_/constructors_destructor_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/resize_policy/size_base.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/resize_policy/ht_prime_size_policy_imp.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/resize_policy/hash_standard_resize_policy_imp.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/resize_policy/hash_prime_size_policy_imp.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/resize_policy/hash_exponential_size_policy_imp.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/resize_policy/cc_hash_max_collision_resize_trigger_imp.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/rb_tree_map_/split_join_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/rb_tree_map_/rb_tree_.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/rb_tree_map_/node.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/rb_tree_map_/insert_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/rb_tree_map_/info_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/rb_tree_map_/find_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/rb_tree_map_/erase_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/rb_tree_map_/debug_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/rb_tree_map_/constructors_destructor_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/ov_tree_map_/split_join_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/ov_tree_map_/ov_tree_map_.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/ov_tree_map_/node_iterators.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/ov_tree_map_/iterators_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/ov_tree_map_/insert_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/ov_tree_map_/info_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/ov_tree_map_/find_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/ov_tree_map_/erase_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/ov_tree_map_/debug_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/ov_tree_map_/cond_dtor.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/order_statistics_imp.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/ms_trait_imp.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/ms_category_imp.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/mapping_level_imp.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/map_debug_base.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/lu_policy/mtf_lu_policy_imp.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/lu_policy/counter_lu_policy_imp.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/lu_policy/counter_lu_metadata_imp.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/lu_map_/policy_access_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/lu_map_/lu_map_.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/lu_map_/iterators_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/lu_map_/insert_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/lu_map_/info_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/lu_map_/find_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/lu_map_/erase_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/lu_map_/debug_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/lu_map_/constructor_destructor_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/lu_assoc_cntnr/policy_access_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/lu_assoc_cntnr/constructor_destructor_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/hash_types_traits.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/hash_fn/ranged_probe_fn.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/hash_fn/ranged_hash_fn.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/hash_fn/quadratic_probe_fn_imp.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/hash_fn/probe_fn_base.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/hash_fn/mod_based_range_hashing.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/hash_fn/mask_based_range_hashing.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/hash_fn/linear_probe_fn_imp.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/hash_fn/direct_mod_range_hashing_imp.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/hash_fn/direct_mask_range_hashing_imp.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/gp_ht_map_/resize_store_hash_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/gp_ht_map_/resize_no_store_hash_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/gp_ht_map_/resize_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/gp_ht_map_/policy_access_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/gp_ht_map_/iterator_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/gp_ht_map_/insert_store_hash_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/gp_ht_map_/insert_no_store_hash_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/gp_ht_map_/insert_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/gp_ht_map_/info_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/gp_ht_map_/gp_ht_map_.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/gp_ht_map_/find_store_hash_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/gp_ht_map_/find_no_store_hash_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/gp_ht_map_/find_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/gp_ht_map_/erase_store_hash_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/gp_ht_map_/erase_no_store_hash_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/gp_ht_map_/erase_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/gp_ht_map_/debug_store_hash_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/gp_ht_map_/debug_no_store_hash_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/gp_ht_map_/debug_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/gp_ht_map_/constructor_destructor_store_hash_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/gp_ht_map_/constructor_destructor_no_store_hash_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/gp_ht_map_/constructor_destructor_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/gp_hash_assoc_cntnr/constructor_destructor_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/eq_fn/hash_eq_fn.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/eq_fn/eq_by_less.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/ds_trait_imp.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/constructors_destructor_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cond_dealtor.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/standard_policies.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/size_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/resize_store_hash_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/resize_no_store_hash_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/resize_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/policy_access_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/iterators_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/insert_store_hash_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/insert_no_store_hash_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/insert_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/info_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/find_store_hash_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/find_no_store_hash_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/find_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/erase_store_hash_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/erase_no_store_hash_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/erase_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/entry_list_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/debug_store_hash_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/debug_no_store_hash_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/debug_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/constructor_destructor_store_hash_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/constructor_destructor_no_store_hash_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/constructor_destructor_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/cond_key_dtor_entry_dealtor.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/cmp_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_/cc_ht_map_.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/cc_hash_assoc_cntnr/constructor_destructor_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/bin_search_tree_/split_join_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/bin_search_tree_/rotate_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/bin_search_tree_/r_erase_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/bin_search_tree_/node_iterators.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/bin_search_tree_/iterators_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/bin_search_tree_/insert_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/bin_search_tree_/info_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/bin_search_tree_/find_iterators.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/bin_search_tree_/find_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/bin_search_tree_/erase_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/bin_search_tree_/debug_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/bin_search_tree_/cond_key_dtor_entry_dealtor.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/bin_search_tree_/cond_dtor_entry_dealtor.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/bin_search_tree_/bin_search_tree_.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/basic_tree_assoc_cntnr/split_join_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/basic_tree_assoc_cntnr/range_iteration_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/basic_tree_assoc_cntnr/r_range_iteration_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/basic_tree_assoc_cntnr/r_erase_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/basic_tree_assoc_cntnr/policy_access_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/basic_tree_assoc_cntnr/node_iteration_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/basic_tree_assoc_cntnr/erase_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/basic_tree_assoc_cntnr/constructors_destructor_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/basic_tree_assoc_cntnr/constructor_destructor_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/basic_hash_assoc_cntnr/resize_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/basic_hash_assoc_cntnr/constructors_destructor_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/basic_hash_assoc_cntnr/constructor_destructor_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/basic_assoc_cntnr/iterators_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/basic_assoc_cntnr/insert_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/basic_assoc_cntnr/info_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/basic_assoc_cntnr/extract_key.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/basic_assoc_cntnr/erase_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/basic_assoc_cntnr/d_insert_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/basic_assoc_cntnr/d_find_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/basic_assoc_cntnr/d_extract_key.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/basic_assoc_cntnr/constructors_destructor_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/basic_assoc_cntnr/constructor_destructor_fn_imps.hpp
+include/c++/4.1.0/ext/pb_assoc/detail/assoc_cntnr_base.hpp
+include/c++/4.1.0/ext/pb_assoc/data_type.hpp
+include/c++/4.1.0/ext/pb_assoc/assoc_cntnr.hpp
+include/c++/4.1.0/ext/numeric
+include/c++/4.1.0/ext/new_allocator.h
+include/c++/4.1.0/ext/mt_allocator.h
+include/c++/4.1.0/ext/memory
+include/c++/4.1.0/ext/malloc_allocator.h
+include/c++/4.1.0/ext/iterator
+include/c++/4.1.0/ext/hashtable.h
+include/c++/4.1.0/ext/hash_set
+include/c++/4.1.0/ext/hash_map
+include/c++/4.1.0/ext/hash_fun.h
+include/c++/4.1.0/ext/functional
+include/c++/4.1.0/ext/debug_allocator.h
+include/c++/4.1.0/ext/codecvt_specializations.h
+include/c++/4.1.0/ext/bitmap_allocator.h
+include/c++/4.1.0/ext/array_allocator.h
+include/c++/4.1.0/ext/algorithm
+include/c++/4.1.0/exception_defines.h
+include/c++/4.1.0/exception
+include/c++/4.1.0/deque
+include/c++/4.1.0/debug/vector
+include/c++/4.1.0/debug/string
+include/c++/4.1.0/debug/set.h
+include/c++/4.1.0/debug/set
+include/c++/4.1.0/debug/safe_sequence.h
+include/c++/4.1.0/debug/safe_iterator.tcc
+include/c++/4.1.0/debug/safe_iterator.h
+include/c++/4.1.0/debug/safe_base.h
+include/c++/4.1.0/debug/multiset.h
+include/c++/4.1.0/debug/multimap.h
+include/c++/4.1.0/debug/map.h
+include/c++/4.1.0/debug/map
+include/c++/4.1.0/debug/macros.h
+include/c++/4.1.0/debug/list
+include/c++/4.1.0/debug/hash_set.h
+include/c++/4.1.0/debug/hash_set
+include/c++/4.1.0/debug/hash_multiset.h
+include/c++/4.1.0/debug/hash_multimap.h
+include/c++/4.1.0/debug/hash_map.h
+include/c++/4.1.0/debug/hash_map
+include/c++/4.1.0/debug/functions.h
+include/c++/4.1.0/debug/formatter.h
+include/c++/4.1.0/debug/deque
+include/c++/4.1.0/debug/debug.h
+include/c++/4.1.0/debug/bitset
+include/c++/4.1.0/cxxabi.h
+include/c++/4.1.0/cwctype
+include/c++/4.1.0/cwchar
+include/c++/4.1.0/ctime
+include/c++/4.1.0/cstring
+include/c++/4.1.0/cstdlib
+include/c++/4.1.0/cstdio
+include/c++/4.1.0/cstddef
+include/c++/4.1.0/cstdarg
+include/c++/4.1.0/csignal
+include/c++/4.1.0/csetjmp
+include/c++/4.1.0/complex
+include/c++/4.1.0/cmath
+include/c++/4.1.0/clocale
+include/c++/4.1.0/climits
+include/c++/4.1.0/ciso646
+include/c++/4.1.0/cfloat
+include/c++/4.1.0/cerrno
+include/c++/4.1.0/cctype
+include/c++/4.1.0/cassert
+include/c++/4.1.0/bitset
+include/c++/4.1.0/bits/vector.tcc
+include/c++/4.1.0/bits/valarray_before.h
+include/c++/4.1.0/bits/valarray_array.tcc
+include/c++/4.1.0/bits/valarray_array.h
+include/c++/4.1.0/bits/valarray_after.h
+include/c++/4.1.0/bits/stringfwd.h
+include/c++/4.1.0/bits/streambuf_iterator.h
+include/c++/4.1.0/bits/streambuf.tcc
+include/c++/4.1.0/bits/stream_iterator.h
+include/c++/4.1.0/bits/stl_vector.h
+include/c++/4.1.0/bits/stl_uninitialized.h
+include/c++/4.1.0/bits/stl_tree.h
+include/c++/4.1.0/bits/stl_tempbuf.h
+include/c++/4.1.0/bits/stl_stack.h
+include/c++/4.1.0/bits/stl_set.h
+include/c++/4.1.0/bits/stl_relops.h
+include/c++/4.1.0/bits/stl_raw_storage_iter.h
+include/c++/4.1.0/bits/stl_queue.h
+include/c++/4.1.0/bits/stl_pair.h
+include/c++/4.1.0/bits/stl_numeric.h
+include/c++/4.1.0/bits/stl_multiset.h
+include/c++/4.1.0/bits/stl_multimap.h
+include/c++/4.1.0/bits/stl_map.h
+include/c++/4.1.0/bits/stl_list.h
+include/c++/4.1.0/bits/stl_iterator_base_types.h
+include/c++/4.1.0/bits/stl_iterator_base_funcs.h
+include/c++/4.1.0/bits/stl_iterator.h
+include/c++/4.1.0/bits/stl_heap.h
+include/c++/4.1.0/bits/stl_function.h
+include/c++/4.1.0/bits/stl_deque.h
+include/c++/4.1.0/bits/stl_construct.h
+include/c++/4.1.0/bits/stl_bvector.h
+include/c++/4.1.0/bits/stl_algobase.h
+include/c++/4.1.0/bits/stl_algo.h
+include/c++/4.1.0/bits/sstream.tcc
+include/c++/4.1.0/bits/slice_array.h
+include/c++/4.1.0/bits/postypes.h
+include/c++/4.1.0/bits/ostream.tcc
+include/c++/4.1.0/bits/mask_array.h
+include/c++/4.1.0/bits/localefwd.h
+include/c++/4.1.0/bits/locale_facets.tcc
+include/c++/4.1.0/bits/locale_facets.h
+include/c++/4.1.0/bits/locale_classes.h
+include/c++/4.1.0/bits/list.tcc
+include/c++/4.1.0/bits/istream.tcc
+include/c++/4.1.0/bits/ios_base.h
+include/c++/4.1.0/bits/indirect_array.h
+include/c++/4.1.0/bits/gslice_array.h
+include/c++/4.1.0/bits/gslice.h
+include/c++/4.1.0/bits/functexcept.h
+include/c++/4.1.0/bits/fstream.tcc
+include/c++/4.1.0/bits/deque.tcc
+include/c++/4.1.0/bits/cpp_type_traits.h
+include/c++/4.1.0/bits/concurrence.h
+include/c++/4.1.0/bits/concept_check.h
+include/c++/4.1.0/bits/codecvt.h
+include/c++/4.1.0/bits/cmath.tcc
+include/c++/4.1.0/bits/char_traits.h
+include/c++/4.1.0/bits/boost_concept_check.h
+include/c++/4.1.0/bits/basic_string.tcc
+include/c++/4.1.0/bits/basic_string.h
+include/c++/4.1.0/bits/basic_ios.tcc
+include/c++/4.1.0/bits/basic_ios.h
+include/c++/4.1.0/bits/atomicity.h
+include/c++/4.1.0/bits/allocator.h
+include/c++/4.1.0/backward/vector.h
+include/c++/4.1.0/backward/tree.h
+include/c++/4.1.0/backward/tempbuf.h
+include/c++/4.1.0/backward/strstream
+include/c++/4.1.0/backward/streambuf.h
+include/c++/4.1.0/backward/stream.h
+include/c++/4.1.0/backward/stack.h
+include/c++/4.1.0/backward/slist.h
+include/c++/4.1.0/backward/set.h
+include/c++/4.1.0/backward/rope.h
+include/c++/4.1.0/backward/queue.h
+include/c++/4.1.0/backward/pair.h
+include/c++/4.1.0/backward/ostream.h
+include/c++/4.1.0/backward/new.h
+include/c++/4.1.0/backward/multiset.h
+include/c++/4.1.0/backward/multimap.h
+include/c++/4.1.0/backward/map.h
+include/c++/4.1.0/backward/list.h
+include/c++/4.1.0/backward/iterator.h
+include/c++/4.1.0/backward/istream.h
+include/c++/4.1.0/backward/iostream.h
+include/c++/4.1.0/backward/iomanip.h
+include/c++/4.1.0/backward/heap.h
+include/c++/4.1.0/backward/hashtable.h
+include/c++/4.1.0/backward/hash_set.h
+include/c++/4.1.0/backward/hash_map.h
+include/c++/4.1.0/backward/function.h
+include/c++/4.1.0/backward/fstream.h
+include/c++/4.1.0/backward/deque.h
+include/c++/4.1.0/backward/defalloc.h
+include/c++/4.1.0/backward/complex.h
+include/c++/4.1.0/backward/bvector.h
+include/c++/4.1.0/backward/backward_warning.h
+include/c++/4.1.0/backward/alloc.h
+include/c++/4.1.0/backward/algobase.h
+include/c++/4.1.0/backward/algo.h
+include/c++/4.1.0/algorithm
+bin/psp-gcov
+bin/psp-gccbug
+bin/psp-gcc-4.1.0
+bin/psp-gcc
+bin/psp-g++
+bin/psp-cpp
+bin/psp-c++
+@dirrm libexec/gcc/psp/4.1.0/install-tools
+@dirrm libexec/gcc/psp/4.1.0
+@dirrm libexec/gcc/psp
+@dirrmtry libexec/gcc
+@dirrm lib/gcc/psp/4.1.0/install-tools/include
+@dirrm lib/gcc/psp/4.1.0/install-tools
+@dirrm lib/gcc/psp/4.1.0/include/ssp
+@dirrm lib/gcc/psp/4.1.0/include
+@dirrm lib/gcc/psp/4.1.0
+@dirrm lib/gcc/psp
+@dirrmtry lib/gcc
+@dirrmtry include/c++/4.1.0/tr1
+@dirrm include/c++/4.1.0/psp/bits/stdc++.h.gch
+@dirrm include/c++/4.1.0/psp/bits
+@dirrm include/c++/4.1.0/psp
+@dirrmtry include/c++/4.1.0/ext/pb_assoc/detail/value_type_adapter
+@dirrmtry include/c++/4.1.0/ext/pb_assoc/detail/unordered_iterator
+@dirrmtry include/c++/4.1.0/ext/pb_assoc/detail/typelist
+@dirrmtry include/c++/4.1.0/ext/pb_assoc/detail/tree_policy
+@dirrmtry include/c++/4.1.0/ext/pb_assoc/detail/tree_assoc_cntnr
+@dirrmtry include/c++/4.1.0/ext/pb_assoc/detail/splay_tree_
+@dirrmtry include/c++/4.1.0/ext/pb_assoc/detail/resize_policy
+@dirrmtry include/c++/4.1.0/ext/pb_assoc/detail/rb_tree_map_
+@dirrmtry include/c++/4.1.0/ext/pb_assoc/detail/ov_tree_map_
+@dirrmtry include/c++/4.1.0/ext/pb_assoc/detail/lu_policy
+@dirrmtry include/c++/4.1.0/ext/pb_assoc/detail/lu_map_
+@dirrmtry include/c++/4.1.0/ext/pb_assoc/detail/lu_assoc_cntnr
+@dirrmtry include/c++/4.1.0/ext/pb_assoc/detail/hash_fn
+@dirrmtry include/c++/4.1.0/ext/pb_assoc/detail/gp_ht_map_
+@dirrmtry include/c++/4.1.0/ext/pb_assoc/detail/gp_hash_assoc_cntnr
+@dirrmtry include/c++/4.1.0/ext/pb_assoc/detail/eq_fn
+@dirrmtry include/c++/4.1.0/ext/pb_assoc/detail/cc_ht_map_
+@dirrmtry include/c++/4.1.0/ext/pb_assoc/detail/cc_hash_assoc_cntnr
+@dirrmtry include/c++/4.1.0/ext/pb_assoc/detail/bin_search_tree_
+@dirrmtry include/c++/4.1.0/ext/pb_assoc/detail/basic_tree_assoc_cntnr
+@dirrmtry include/c++/4.1.0/ext/pb_assoc/detail/basic_hash_assoc_cntnr
+@dirrmtry include/c++/4.1.0/ext/pb_assoc/detail/basic_assoc_cntnr
+@dirrmtry include/c++/4.1.0/ext/pb_assoc/detail
+@dirrmtry include/c++/4.1.0/ext/pb_assoc
+@dirrmtry include/c++/4.1.0/ext
+@dirrmtry include/c++/4.1.0/debug
+@dirrmtry include/c++/4.1.0/bits
+@dirrmtry include/c++/4.1.0/backward
+@dirrmtry include/c++/4.1.0
+@dirrmtry include/c++
+@dirrmtry psp/lib
+@dirrmtry psp/bin
+@dirrmtry psp
diff --git a/devel/psptoolchain-gdb/Makefile b/devel/psptoolchain-gdb/Makefile
new file mode 100644
index 000000000000..fe0635b96bbb
--- /dev/null
+++ b/devel/psptoolchain-gdb/Makefile
@@ -0,0 +1,37 @@
+# New ports collection makefile for: psptoolchain-gdb
+# Date created: 15 February 2009
+# Whom: Tassilo Philipp <tphilipp@potion-studios.com>
+#
+# $FreeBSD$
+#
+
+PORTNAME= gdb
+PORTVERSION= 6.4
+CATEGORIES= devel
+MASTER_SITES= ${MASTER_SITE_GNU}
+MASTER_SITE_SUBDIR= ${PORTNAME}/
+PKGNAMEPREFIX= psptoolchain-
+
+MAINTAINER= tphilipp@potion-studios.com
+COMMENT= PlayStation Portable development toolchain ${PORTNAME}
+
+BUILD_DEPENDS= ${LOCALBASE}/psp/sdk/lib/libpspsdk.a:${PORTSDIR}/devel/psptoolchain-pspsdk-stage2
+
+USE_BZIP2= yes
+USE_GMAKE= yes
+
+HAS_CONFIGURE= yes
+CONFIGURE_ARGS?= --prefix=${PREFIX} --target="psp" --disable-nls --disable-install-libiberty
+
+MAN1= psp-gdb.1 \
+ psp-gdbtui.1 \
+ psp-run.1
+
+# Disable installation of .info files and libiberty.
+post-patch:
+ @${REINPLACE_CMD} -E 's/^(INFO_DEPS.*=)(.*)/\1#\2/' ${WRKSRC}/bfd/doc/Makefile.in
+ @${REINPLACE_CMD} -E 's/^(INFO_DEPS.*=)(.*)/\1#\2/' ${WRKSRC}/gdb/doc/Makefile.in
+ @${REINPLACE_CMD} -E 's/^(install:.*)(install-info.*)/\1#\2/' ${WRKSRC}/etc/Makefile.in
+ @${REINPLACE_CMD} -E 's/^(install:)(.*)/\1#\2/' ${WRKSRC}/libiberty/Makefile.in
+
+.include <bsd.port.mk>
diff --git a/devel/psptoolchain-gdb/distinfo b/devel/psptoolchain-gdb/distinfo
new file mode 100644
index 000000000000..2c2ca917cf8c
--- /dev/null
+++ b/devel/psptoolchain-gdb/distinfo
@@ -0,0 +1,3 @@
+MD5 (gdb-6.4.tar.bz2) = f62c14ba0316bc88e1b4b32a4e901ffb
+SHA256 (gdb-6.4.tar.bz2) = af6777836ab72b563a9e55467f990250e07e56c292cfac98762745c1512167ef
+SIZE (gdb-6.4.tar.bz2) = 13917226
diff --git a/devel/psptoolchain-gdb/files/patch-bfd-archures.c b/devel/psptoolchain-gdb/files/patch-bfd-archures.c
new file mode 100644
index 000000000000..09d5b976f73f
--- /dev/null
+++ b/devel/psptoolchain-gdb/files/patch-bfd-archures.c
@@ -0,0 +1,10 @@
+--- bfd/archures.c.orig 2005-10-25 18:40:09.000000000 +0100
++++ bfd/archures.c 2007-02-08 20:06:04.000000000 +0000
+@@ -154,6 +154,7 @@
+ .#define bfd_mach_mips16 16
+ .#define bfd_mach_mips5 5
+ .#define bfd_mach_mips_sb1 12310201 {* octal 'SB', 01 *}
++.#define bfd_mach_mips_allegrex 10111431 {* octal 'AL', 31 *}
+ .#define bfd_mach_mipsisa32 32
+ .#define bfd_mach_mipsisa32r2 33
+ .#define bfd_mach_mipsisa64 64
diff --git a/devel/psptoolchain-gdb/files/patch-bfd-bfd-in2.h b/devel/psptoolchain-gdb/files/patch-bfd-bfd-in2.h
new file mode 100644
index 000000000000..57003777bbab
--- /dev/null
+++ b/devel/psptoolchain-gdb/files/patch-bfd-bfd-in2.h
@@ -0,0 +1,10 @@
+--- bfd/bfd-in2.h.orig 2005-10-25 18:40:09.000000000 +0100
++++ bfd/bfd-in2.h 2007-02-08 20:06:04.000000000 +0000
+@@ -1742,6 +1742,7 @@
+ #define bfd_mach_mips16 16
+ #define bfd_mach_mips5 5
+ #define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */
++#define bfd_mach_mips_allegrex 10111431 /* octal 'AL', 31 */
+ #define bfd_mach_mipsisa32 32
+ #define bfd_mach_mipsisa32r2 33
+ #define bfd_mach_mipsisa64 64
diff --git a/devel/psptoolchain-gdb/files/patch-bfd-cpu-mips.c b/devel/psptoolchain-gdb/files/patch-bfd-cpu-mips.c
new file mode 100644
index 000000000000..6cc30abb2691
--- /dev/null
+++ b/devel/psptoolchain-gdb/files/patch-bfd-cpu-mips.c
@@ -0,0 +1,20 @@
+--- bfd/cpu-mips.c.orig 2005-05-04 16:53:06.000000000 +0100
++++ bfd/cpu-mips.c 2007-02-08 20:06:04.000000000 +0000
+@@ -86,6 +86,7 @@
+ I_mipsisa64,
+ I_mipsisa64r2,
+ I_sb1,
++ I_allegrex,
+ };
+
+ #define NN(index) (&arch_info_struct[(index) + 1])
+@@ -118,7 +119,8 @@
+ N (32, 32, bfd_mach_mipsisa32r2,"mips:isa32r2", FALSE, NN(I_mipsisa32r2)),
+ N (64, 64, bfd_mach_mipsisa64, "mips:isa64", FALSE, NN(I_mipsisa64)),
+ N (64, 64, bfd_mach_mipsisa64r2,"mips:isa64r2", FALSE, NN(I_mipsisa64r2)),
+- N (64, 64, bfd_mach_mips_sb1, "mips:sb1", FALSE, 0),
++ N (64, 64, bfd_mach_mips_sb1, "mips:sb1", FALSE, NN(I_sb1)),
++ N (32, 32, bfd_mach_mips_allegrex, "mips:allegrex", FALSE, 0),
+ };
+
+ /* The default architecture is mips:3000, but with a machine number of
diff --git a/devel/psptoolchain-gdb/files/patch-bfd-elfxx-mips.c b/devel/psptoolchain-gdb/files/patch-bfd-elfxx-mips.c
new file mode 100644
index 000000000000..69b7f6c60b15
--- /dev/null
+++ b/devel/psptoolchain-gdb/files/patch-bfd-elfxx-mips.c
@@ -0,0 +1,31 @@
+--- bfd/elfxx-mips.c.orig 2005-10-25 17:19:08.000000000 +0100
++++ bfd/elfxx-mips.c 2007-02-08 20:06:04.000000000 +0000
+@@ -4666,6 +4666,9 @@
+ case E_MIPS_MACH_SB1:
+ return bfd_mach_mips_sb1;
+
++ case E_MIPS_MACH_ALLEGREX:
++ return bfd_mach_mips_allegrex;
++
+ default:
+ switch (flags & EF_MIPS_ARCH)
+ {
+@@ -7950,6 +7953,10 @@
+ val = E_MIPS_ARCH_64 | E_MIPS_MACH_SB1;
+ break;
+
++ case bfd_mach_mips_allegrex:
++ val = E_MIPS_ARCH_2 | E_MIPS_MACH_ALLEGREX;
++ break;
++
+ case bfd_mach_mipsisa32:
+ val = E_MIPS_ARCH_32;
+ break;
+@@ -9648,6 +9655,7 @@
+ /* MIPS II extensions. */
+ { bfd_mach_mips4000, bfd_mach_mips6000 },
+ { bfd_mach_mipsisa32, bfd_mach_mips6000 },
++ { bfd_mach_mips_allegrex, bfd_mach_mips6000 },
+
+ /* MIPS I extensions. */
+ { bfd_mach_mips6000, bfd_mach_mips3000 },
diff --git a/devel/psptoolchain-gdb/files/patch-config.sub b/devel/psptoolchain-gdb/files/patch-config.sub
new file mode 100644
index 000000000000..3c47d3f94762
--- /dev/null
+++ b/devel/psptoolchain-gdb/files/patch-config.sub
@@ -0,0 +1,29 @@
+--- config.sub.orig 2005-07-14 02:24:56.000000000 +0100
++++ config.sub 2007-02-08 20:06:04.000000000 +0000
+@@ -256,6 +256,7 @@
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
++ | mipsallegrex | mipsallegrexel \
+ | mn10200 | mn10300 \
+ | ms1 \
+ | msp430 \
+@@ -335,6 +336,7 @@
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
++ | mipsallegrex-* | mipsallegrexel-* \
+ | mmix-* \
+ | ms1-* \
+ | msp430-* \
+@@ -678,6 +680,10 @@
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
++ psp)
++ basic_machine=mipsallegrexel-psp
++ os=-elf
++ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
diff --git a/devel/psptoolchain-gdb/files/patch-gdb-remote.c b/devel/psptoolchain-gdb/files/patch-gdb-remote.c
new file mode 100644
index 000000000000..5864447b0420
--- /dev/null
+++ b/devel/psptoolchain-gdb/files/patch-gdb-remote.c
@@ -0,0 +1,32 @@
+--- gdb/remote.c.orig 2005-07-20 03:56:43.000000000 +0100
++++ gdb/remote.c 2007-02-08 20:06:12.000000000 +0000
+@@ -1953,6 +1953,7 @@
+ int lose;
+ CORE_ADDR text_addr, data_addr, bss_addr;
+ struct section_offsets *offs;
++ int i;
+
+ putpkt ("qOffsets");
+
+@@ -2014,6 +2015,13 @@
+ memcpy (offs, symfile_objfile->section_offsets,
+ SIZEOF_N_SECTION_OFFSETS (symfile_objfile->num_sections));
+
++ /* GDB is stupid, lets fix up all sections to the same address not just a few :P */
++
++ for(i = 0; i < symfile_objfile->num_sections; i++)
++ {
++ offs->offsets[i] = text_addr;
++ }
++#if 0
+ offs->offsets[SECT_OFF_TEXT (symfile_objfile)] = text_addr;
+
+ /* This is a temporary kludge to force data and bss to use the same offsets
+@@ -2022,6 +2030,7 @@
+
+ offs->offsets[SECT_OFF_DATA (symfile_objfile)] = data_addr;
+ offs->offsets[SECT_OFF_BSS (symfile_objfile)] = data_addr;
++#endif
+
+ objfile_relocate (symfile_objfile, offs);
+ }
diff --git a/devel/psptoolchain-gdb/files/patch-include-bin-bugs.h b/devel/psptoolchain-gdb/files/patch-include-bin-bugs.h
new file mode 100644
index 000000000000..d1894be13b6c
--- /dev/null
+++ b/devel/psptoolchain-gdb/files/patch-include-bin-bugs.h
@@ -0,0 +1,7 @@
+--- include/bin-bugs.h.orig 2004-07-23 16:40:19.000000000 +0100
++++ include/bin-bugs.h 2007-02-08 20:06:04.000000000 +0000
+@@ -1,3 +1,3 @@
+ #ifndef REPORT_BUGS_TO
+-#define REPORT_BUGS_TO "<URL:http://www.sourceware.org/bugzilla/>"
++#define REPORT_BUGS_TO "<URL:http://wiki.pspdev.org/psp:toolchain#bugs>"
+ #endif
diff --git a/devel/psptoolchain-gdb/files/patch-include-elf-common.h b/devel/psptoolchain-gdb/files/patch-include-elf-common.h
new file mode 100644
index 000000000000..8c41452d02af
--- /dev/null
+++ b/devel/psptoolchain-gdb/files/patch-include-elf-common.h
@@ -0,0 +1,10 @@
+--- include/elf/common.h.orig 2005-09-30 16:12:52.000000000 +0100
++++ include/elf/common.h 2007-02-08 20:06:04.000000000 +0000
+@@ -93,6 +93,7 @@
+ #define ET_HIOS 0xFEFF /* Operating system-specific */
+ #define ET_LOPROC 0xFF00 /* Processor-specific */
+ #define ET_HIPROC 0xFFFF /* Processor-specific */
++#define ET_PSPEXEC 0xFFA0 /* Sony PSP executable file */
+
+ /* Values for e_machine, which identifies the architecture. These numbers
+ are officially assigned by registry@caldera.com. See below for a list of
diff --git a/devel/psptoolchain-gdb/files/patch-include-elf-mips.h b/devel/psptoolchain-gdb/files/patch-include-elf-mips.h
new file mode 100644
index 000000000000..f05c78ebf5e1
--- /dev/null
+++ b/devel/psptoolchain-gdb/files/patch-include-elf-mips.h
@@ -0,0 +1,10 @@
+--- include/elf/mips.h.orig 2005-05-10 11:21:10.000000000 +0100
++++ include/elf/mips.h 2007-02-08 20:06:04.000000000 +0000
+@@ -212,6 +212,7 @@
+ #define E_MIPS_MACH_5400 0x00910000
+ #define E_MIPS_MACH_5500 0x00980000
+ #define E_MIPS_MACH_9000 0x00990000
++#define E_MIPS_MACH_ALLEGREX 0x00A20000
+
+ /* Processor specific section indices. These sections do not actually
+ exist. Symbols with a st_shndx field corresponding to one of these
diff --git a/devel/psptoolchain-gdb/files/patch-include-opcode-mips.h b/devel/psptoolchain-gdb/files/patch-include-opcode-mips.h
new file mode 100644
index 000000000000..77a9b3d7bbe7
--- /dev/null
+++ b/devel/psptoolchain-gdb/files/patch-include-opcode-mips.h
@@ -0,0 +1,194 @@
+--- include/opcode/mips.h.orig 2005-09-06 19:42:58.000000000 +0100
++++ include/opcode/mips.h 2007-02-08 20:06:04.000000000 +0000
+@@ -203,6 +203,83 @@
+ #define MDMX_FMTSEL_VEC_QH 0x15
+ #define MDMX_FMTSEL_VEC_OB 0x16
+
++#define OP_SH_VFPU_DELTA 0
++#define OP_MASK_VFPU_DELTA 0xfffc
++#define OP_SH_VFPU_IMM3 16
++#define OP_MASK_VFPU_IMM3 0x7
++#define OP_SH_VFPU_IMM5 16
++#define OP_MASK_VFPU_IMM5 0x1f
++#define OP_SH_VFPU_IMM8 16
++#define OP_MASK_VFPU_IMM8 0xff
++#define OP_SH_VFPU_CC 18 /* Condition code. */
++#define OP_MASK_VFPU_CC 0x7
++#define OP_SH_VFPU_CONST 16
++#define OP_MASK_VFPU_CONST 0x1f
++#define OP_SH_VFPU_COND 0 /* Conditional compare. */
++#define OP_MASK_VFPU_COND 0xf
++#define OP_SH_VFPU_VMTVC 0
++#define OP_MASK_VFPU_VMTVC 0xff
++#define OP_SH_VFPU_VMFVC 8
++#define OP_MASK_VFPU_VMFVC 0xff
++#define OP_SH_VFPU_RWB 1
++#define OP_MASK_VFPU_RWB 0x1
++#define OP_SH_VFPU_ROT 16 /* Rotators used in vrot. */
++#define OP_MASK_VFPU_ROT 0x1f
++#define OP_SH_VFPU_FLOAT16 0
++#define OP_MASK_VFPU_FLOAT16 0xffff
++
++/* VFPU registers. */
++#define OP_SH_VFPU_VD 0
++#define OP_MASK_VFPU_VD 0x7f
++#define OP_SH_VFPU_VS 8
++#define OP_MASK_VFPU_VS 0x7f
++#define OP_SH_VFPU_VT 16
++#define OP_MASK_VFPU_VT 0x7f
++#define OP_SH_VFPU_VT_LO 16 /* Bits 0-4 of vt. */
++#define OP_MASK_VFPU_VT_LO 0x1f
++#define OP_SH_VFPU_VT_HI 5 /* Right-shifted. */
++#define OP_MASK_VFPU_VT_HI1 0x1 /* Bit 5 of vt. */
++#define OP_MASK_VFPU_VT_HI2 0x3 /* Bits 5-6 of vt. */
++/* Special handling of vs in vmmul instructions. */
++#define VFPU_OP_VT_VS_VD 0xff800000
++#define VFPU_OPCODE_VMMUL 0xf0000000
++
++/* VFPU prefix instruction operands. The *_SH_* values really specify where
++ the bitfield begins, as VFPU prefix instructions have four operands
++ encoded within the immediate field. */
++#define VFPU_SH_PFX_NEG 16
++#define VFPU_MASK_PFX_NEG 0x1 /* Negation. */
++#define VFPU_SH_PFX_CST 12
++#define VFPU_MASK_PFX_CST 0x1 /* Constant. */
++#define VFPU_SH_PFX_ABS_CSTHI 8
++#define VFPU_MASK_PFX_ABS_CSTHI 0x1 /* Abs/Constant (bit 2). */
++#define VFPU_MASK_PFX_SWZ_CSTLO 0x3 /* Swizzle/Constant (bits 0-1). */
++#define VFPU_SH_PFX_MASK 8
++#define VFPU_MASK_PFX_MASK 0x1 /* Mask. */
++#define VFPU_MASK_PFX_SAT 0x3 /* Saturation. */
++
++/* Special handling of the vrot instructions. */
++#define VFPU_MASK_OP_SIZE 0x8080 /* Masks the operand size (pair, triple, quad). */
++#define VFPU_OP_SIZE_PAIR 0x80
++#define VFPU_OP_SIZE_TRIPLE 0x8000
++#define VFPU_OP_SIZE_QUAD 0x8080
++/* Note that these are within the rotators field, and not the full opcode. */
++#define VFPU_SH_ROT_HI 2
++#define VFPU_MASK_ROT_HI 0x3
++#define VFPU_SH_ROT_LO 0
++#define VFPU_MASK_ROT_LO 0x3
++#define VFPU_SH_ROT_NEG 4 /* Negation. */
++#define VFPU_MASK_ROT_NEG 0x1
++
++/* VFPU 16-bit floating-point format. */
++#define VFPU_FLOAT16_EXP_MAX 0x1f
++#define VFPU_SH_FLOAT16_SIGN 15
++#define VFPU_MASK_FLOAT16_SIGN 0x1
++#define VFPU_SH_FLOAT16_EXP 10
++#define VFPU_MASK_FLOAT16_EXP 0x1f
++#define VFPU_SH_FLOAT16_FRAC 0
++#define VFPU_MASK_FLOAT16_FRAC 0x3ff
++
+ /* This structure holds information for a particular instruction. */
+
+ struct mips_opcode
+@@ -290,6 +367,29 @@
+ Requires that "+A" or "+E" occur first to set position.
+ Enforces: 32 < (pos+size) <= 64.
+
++ Sony Allegrex VFPU instructions:
++ "?o"
++ "?0" - "?3"
++ "?4" - "?7"
++ "?a"
++ "?b"
++ "?c"
++ "?e"
++ "?f"
++ "?i"
++ "?q"
++ "?r"
++ "?u"
++ "?w"
++ "?d"
++ "?m"
++ "?n"
++ "?s"
++ "?t"
++ "?v"
++ "?x"
++ "?z"
++
+ Floating point instructions:
+ "D" 5 bit destination register (OP_*_FD)
+ "M" 3 bit compare condition code (OP_*_CCC) (only used for mips4 and up)
+@@ -500,6 +600,8 @@
+ #define INSN_5400 0x01000000
+ /* NEC VR5500 instruction. */
+ #define INSN_5500 0x02000000
++/* Sony Allegrex instruction. */
++#define INSN_ALLEGREX 0x10000000
+ /* MT ASE */
+ #define INSN_MT 0x04000000
+
+@@ -549,6 +651,7 @@
+ #define CPU_MIPS64 64
+ #define CPU_MIPS64R2 65
+ #define CPU_SB1 12310201 /* octal 'SB', 01. */
++#define CPU_ALLEGREX 10111431 /* octal 'AL', 31. */
+
+ /* Test for membership in an ISA including chip specific ISAs. INSN
+ is pointer to an element of the opcode table; ISA is the specified
+@@ -570,6 +673,7 @@
+ || (cpu == CPU_VR4120 && ((insn)->membership & INSN_4120) != 0) \
+ || (cpu == CPU_VR5400 && ((insn)->membership & INSN_5400) != 0) \
+ || (cpu == CPU_VR5500 && ((insn)->membership & INSN_5500) != 0) \
++ || (cpu == CPU_ALLEGREX && ((insn)->membership & INSN_ALLEGREX) != 0) \
+ || 0) /* Please keep this term for easier source merging. */
+
+ /* This is a list of macro expanded instructions.
+@@ -685,6 +789,16 @@
+ M_LL_AB,
+ M_LLD_AB,
+ M_LS_A,
++ M_LVHIP,
++ M_LVHIS,
++ M_LVIP,
++ M_LVIQ,
++ M_LVIS,
++ M_LVIT,
++ M_LVLQ_AB,
++ M_LVRQ_AB,
++ M_LVQ_AB,
++ M_LVQ_AB_2,
+ M_LW_A,
+ M_LW_AB,
+ M_LWC0_A,
+@@ -774,6 +888,10 @@
+ M_SUB_I,
+ M_SUBU_I,
+ M_SUBU_I_2,
++ M_SVLQ_AB,
++ M_SVQ_AB,
++ M_SVRQ_AB,
++ M_SVS_AB,
+ M_TEQ_I,
+ M_TGE_I,
+ M_TGEU_I,
+@@ -788,14 +906,24 @@
+ M_ULH_A,
+ M_ULHU,
+ M_ULHU_A,
++ M_ULVQ,
++ M_ULVQ_AB,
++ M_ULVS,
+ M_ULW,
+ M_ULW_A,
+ M_USH,
+ M_USH_A,
++ M_USVQ,
++ M_USVQ_AB,
++ M_USVS,
+ M_USW,
+ M_USW_A,
+ M_USD,
+ M_USD_A,
++ M_VCMOVP,
++ M_VCMOVQ,
++ M_VCMOVS,
++ M_VCMOVT,
+ M_XOR_I,
+ M_COP0,
+ M_COP1,
diff --git a/devel/psptoolchain-gdb/files/patch-opcodes-mips-dis.c b/devel/psptoolchain-gdb/files/patch-opcodes-mips-dis.c
new file mode 100644
index 000000000000..c174617dba5e
--- /dev/null
+++ b/devel/psptoolchain-gdb/files/patch-opcodes-mips-dis.c
@@ -0,0 +1,557 @@
+--- opcodes/mips-dis.c.orig 2005-09-06 19:46:57.000000000 +0100
++++ opcodes/mips-dis.c 2007-02-08 20:06:04.000000000 +0000
+@@ -133,6 +133,139 @@
+ "c0_taglo", "c0_taghi", "c0_errorepc", "c0_desave",
+ };
+
++static const char * const vfpu_sreg_names[128] = {
++ "S000", "S010", "S020", "S030", "S100", "S110", "S120", "S130",
++ "S200", "S210", "S220", "S230", "S300", "S310", "S320", "S330",
++ "S400", "S410", "S420", "S430", "S500", "S510", "S520", "S530",
++ "S600", "S610", "S620", "S630", "S700", "S710", "S720", "S730",
++ "S001", "S011", "S021", "S031", "S101", "S111", "S121", "S131",
++ "S201", "S211", "S221", "S231", "S301", "S311", "S321", "S331",
++ "S401", "S411", "S421", "S431", "S501", "S511", "S521", "S531",
++ "S601", "S611", "S621", "S631", "S701", "S711", "S721", "S731",
++ "S002", "S012", "S022", "S032", "S102", "S112", "S122", "S132",
++ "S202", "S212", "S222", "S232", "S302", "S312", "S322", "S332",
++ "S402", "S412", "S422", "S432", "S502", "S512", "S522", "S532",
++ "S602", "S612", "S622", "S632", "S702", "S712", "S722", "S732",
++ "S003", "S013", "S023", "S033", "S103", "S113", "S123", "S133",
++ "S203", "S213", "S223", "S233", "S303", "S313", "S323", "S333",
++ "S403", "S413", "S423", "S433", "S503", "S513", "S523", "S533",
++ "S603", "S613", "S623", "S633", "S703", "S713", "S723", "S733"
++};
++
++static const char * const vfpu_vpreg_names[128] = {
++ "C000", "C010", "C020", "C030", "C100", "C110", "C120", "C130",
++ "C200", "C210", "C220", "C230", "C300", "C310", "C320", "C330",
++ "C400", "C410", "C420", "C430", "C500", "C510", "C520", "C530",
++ "C600", "C610", "C620", "C630", "C700", "C710", "C720", "C730",
++ "R000", "R001", "R002", "R003", "R100", "R101", "R102", "R103",
++ "R200", "R201", "R202", "R203", "R300", "R301", "R302", "R303",
++ "R400", "R401", "R402", "R403", "R500", "R501", "R502", "R503",
++ "R600", "R601", "R602", "R603", "R700", "R701", "R702", "R703",
++ "C002", "C012", "C022", "C032", "C102", "C112", "C122", "C132",
++ "C202", "C212", "C222", "C232", "C302", "C312", "C322", "C332",
++ "C402", "C412", "C422", "C432", "C502", "C512", "C522", "C532",
++ "C602", "C612", "C622", "C632", "C702", "C712", "C722", "C732",
++ "R020", "R021", "R022", "R023", "R120", "R121", "R122", "R123",
++ "R220", "R221", "R222", "R223", "R320", "R321", "R322", "R323",
++ "R420", "R421", "R422", "R423", "R520", "R521", "R522", "R523",
++ "R620", "R621", "R622", "R623", "R720", "R721", "R722", "R723"
++};
++
++static const char * const vfpu_vtreg_names[128] = {
++ "C000", "C010", "C020", "C030", "C100", "C110", "C120", "C130",
++ "C200", "C210", "C220", "C230", "C300", "C310", "C320", "C330",
++ "C400", "C410", "C420", "C430", "C500", "C510", "C520", "C530",
++ "C600", "C610", "C620", "C630", "C700", "C710", "C720", "C730",
++ "R000", "R001", "R002", "R003", "R100", "R101", "R102", "R103",
++ "R200", "R201", "R202", "R203", "R300", "R301", "R302", "R303",
++ "R400", "R401", "R402", "R403", "R500", "R501", "R502", "R503",
++ "R600", "R601", "R602", "R603", "R700", "R701", "R702", "R703",
++ "C001", "C011", "C021", "C031", "C101", "C111", "C121", "C131",
++ "C201", "C211", "C221", "C231", "C301", "C311", "C321", "C331",
++ "C401", "C411", "C421", "C431", "C501", "C511", "C521", "C531",
++ "C601", "C611", "C621", "C631", "C701", "C711", "C721", "C731",
++ "R010", "R011", "R012", "R013", "R110", "R111", "R112", "R113",
++ "R210", "R211", "R212", "R213", "R310", "R311", "R312", "R313",
++ "R410", "R411", "R412", "R413", "R510", "R511", "R512", "R513",
++ "R610", "R611", "R612", "R613", "R710", "R711", "R712", "R713"
++};
++
++static const char * const vfpu_vqreg_names[128] = {
++ "C000", "C010", "C020", "C030", "C100", "C110", "C120", "C130",
++ "C200", "C210", "C220", "C230", "C300", "C310", "C320", "C330",
++ "C400", "C410", "C420", "C430", "C500", "C510", "C520", "C530",
++ "C600", "C610", "C620", "C630", "C700", "C710", "C720", "C730",
++ "R000", "R001", "R002", "R003", "R100", "R101", "R102", "R103",
++ "R200", "R201", "R202", "R203", "R300", "R301", "R302", "R303",
++ "R400", "R401", "R402", "R403", "R500", "R501", "R502", "R503",
++ "R600", "R601", "R602", "R603", "R700", "R701", "R702", "R703",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", ""
++};
++
++static const char * const vfpu_mpreg_names[128] = {
++ "M000", "", "M020", "", "M100", "", "M120", "",
++ "M200", "", "M220", "", "M300", "", "M320", "",
++ "M400", "", "M420", "", "M500", "", "M520", "",
++ "M600", "", "M620", "", "M700", "", "M720", "",
++ "E000", "", "E002", "", "E100", "", "E102", "",
++ "E200", "", "E202", "", "E300", "", "E302", "",
++ "E400", "", "E402", "", "E500", "", "E502", "",
++ "E600", "", "E602", "", "E700", "", "E702", "",
++ "M002", "", "M022", "", "M102", "", "M122", "",
++ "M202", "", "M222", "", "M302", "", "M322", "",
++ "M402", "", "M422", "", "M502", "", "M522", "",
++ "M602", "", "M622", "", "M702", "", "M722", "",
++ "E020", "", "E022", "", "E120", "", "E122", "",
++ "E220", "", "E222", "", "E320", "", "E322", "",
++ "E420", "", "E422", "", "E520", "", "E522", "",
++ "E620", "", "E622", "", "E720", "", "E722", ""
++};
++
++static const char * const vfpu_mtreg_names[128] = {
++ "M000", "M010", "", "", "M100", "M110", "", "",
++ "M200", "M210", "", "", "M300", "M310", "", "",
++ "M400", "M410", "", "", "M500", "M510", "", "",
++ "M600", "M610", "", "", "M700", "M710", "", "",
++ "E000", "E001", "", "", "E100", "E101", "", "",
++ "E200", "E201", "", "", "E300", "E301", "", "",
++ "E400", "E401", "", "", "E500", "E501", "", "",
++ "E600", "E601", "", "", "E700", "E701", "", "",
++ "M001", "M011", "", "", "M101", "M111", "", "",
++ "M201", "M211", "", "", "M301", "M311", "", "",
++ "M401", "M411", "", "", "M501", "M511", "", "",
++ "M601", "M611", "", "", "M701", "M711", "", "",
++ "E010", "E011", "", "", "E110", "E111", "", "",
++ "E210", "E211", "", "", "E310", "E311", "", "",
++ "E410", "E411", "", "", "E510", "E511", "", "",
++ "E610", "E611", "", "", "E710", "E711", "", ""
++};
++
++static const char * const vfpu_mqreg_names[128] = {
++ "M000", "", "", "", "M100", "", "", "",
++ "M200", "", "", "", "M300", "", "", "",
++ "M400", "", "", "", "M500", "", "", "",
++ "M600", "", "", "", "M700", "", "", "",
++ "E000", "", "", "", "E100", "", "", "",
++ "E200", "", "", "", "E300", "", "", "",
++ "E400", "", "", "", "E500", "", "", "",
++ "E600", "", "", "", "E700", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", "",
++ "", "", "", "", "", "", "", ""
++};
++
+ static const struct mips_cp0sel_name mips_cp0sel_names_mips3264[] =
+ {
+ { 16, 1, "c0_config1" },
+@@ -288,6 +421,55 @@
+ "$24", "$25", "$26", "$27", "$28", "$29", "$30", "$31"
+ };
+
++static const char * const vfpu_cond_names[16] = {
++ "FL", "EQ", "LT", "LE", "TR", "NE", "GE", "GT",
++ "EZ", "EN", "EI", "ES", "NZ", "NN", "NI", "NS"
++};
++
++static const char * const vfpu_const_names[20] = {
++ "",
++ "VFPU_HUGE",
++ "VFPU_SQRT2",
++ "VFPU_SQRT1_2",
++ "VFPU_2_SQRTPI",
++ "VFPU_2_PI",
++ "VFPU_1_PI",
++ "VFPU_PI_4",
++ "VFPU_PI_2",
++ "VFPU_PI",
++ "VFPU_E",
++ "VFPU_LOG2E",
++ "VFPU_LOG10E",
++ "VFPU_LN2",
++ "VFPU_LN10",
++ "VFPU_2PI",
++ "VFPU_PI_6",
++ "VFPU_LOG10TWO",
++ "VFPU_LOG2TEN",
++ "VFPU_SQRT3_2"
++};
++
++#define VFPU_NUM_CONSTANTS \
++ ((sizeof vfpu_const_names) / (sizeof (vfpu_const_names[0])))
++const unsigned int vfpu_num_constants = VFPU_NUM_CONSTANTS;
++
++static const char * const vfpu_rwb_names[4] = {
++ "wt", "wb", "", ""
++};
++
++static const char * const pfx_cst_names[8] = {
++ "0", "1", "2", "1/2", "3", "1/3", "1/4", "1/6"
++};
++
++static const char * const pfx_swz_names[4] = {
++ "x", "y", "z", "w"
++};
++
++static const char * const pfx_sat_names[4] = {
++ "", "[0:1]", "", "[-1:1]"
++};
++
++
+ struct mips_abi_choice
+ {
+ const char * name;
+@@ -363,6 +545,8 @@
+ mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
+ { "mips5", 1, bfd_mach_mips5, CPU_MIPS5, ISA_MIPS5,
+ mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
++ { "allegrex", 1, bfd_mach_mips_allegrex, CPU_ALLEGREX, ISA_MIPS2,
++ mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
+
+ /* For stock MIPS32, disassemble all applicable MIPS-specified ASEs.
+ Note that MIPS-3D and MDMX are not applicable to MIPS32. (See
+@@ -1147,6 +1331,349 @@
+ (l >> OP_SH_FT) & OP_MASK_FT);
+ break;
+
++ case '?':
++ /* VFPU extensions. */
++ d++;
++ switch (*d)
++ {
++ case '\0':
++ /* xgettext:c-format */
++ (*info->fprintf_func) (info->stream,
++ _("# internal error, incomplete VFPU extension sequence (?)"));
++ return;
++
++ case 'o':
++ delta = (l >> OP_SH_VFPU_DELTA) & OP_MASK_VFPU_DELTA;
++ if (delta & 0x8000)
++ delta |= ~0xffff;
++ (*info->fprintf_func) (info->stream, "%d",
++ delta);
++ break;
++
++ case '0':
++ case '1':
++ case '2':
++ case '3':
++ {
++ unsigned int pos = *d, base = '0';
++ unsigned int negation = (l >> (pos - (base - VFPU_SH_PFX_NEG))) & VFPU_MASK_PFX_NEG;
++ unsigned int constant = (l >> (pos - (base - VFPU_SH_PFX_CST))) & VFPU_MASK_PFX_CST;
++ unsigned int abs_consthi =
++ (l >> (pos - (base - VFPU_SH_PFX_ABS_CSTHI))) & VFPU_MASK_PFX_ABS_CSTHI;
++ unsigned int swz_constlo = (l >> ((pos - base) * 2)) & VFPU_MASK_PFX_SWZ_CSTLO;
++
++ if (negation)
++ (*info->fprintf_func) (info->stream, "-");
++ if (constant)
++ {
++ (*info->fprintf_func) (info->stream, "%s",
++ pfx_cst_names[(abs_consthi << 2) | swz_constlo]);
++ }
++ else
++ {
++ if (abs_consthi)
++ (*info->fprintf_func) (info->stream, "|%s|",
++ pfx_swz_names[swz_constlo]);
++ else
++ (*info->fprintf_func) (info->stream, "%s",
++ pfx_swz_names[swz_constlo]);
++ }
++ }
++ break;
++
++ case '4':
++ case '5':
++ case '6':
++ case '7':
++ {
++ unsigned int pos = *d, base = '4';
++ unsigned int mask = (l >> (pos - (base - VFPU_MASK_PFX_MASK))) & VFPU_MASK_PFX_MASK;
++ unsigned int saturation = (l >> ((pos - base) * 2)) & VFPU_MASK_PFX_SAT;
++
++ if (mask)
++ (*info->fprintf_func) (info->stream, "m");
++ else
++ (*info->fprintf_func) (info->stream, "%s",
++ pfx_sat_names[saturation]);
++ }
++ break;
++
++ case 'a':
++ {
++ unsigned int c = (l >> OP_SH_VFPU_CONST) & OP_MASK_VFPU_CONST;
++ if (c < vfpu_num_constants)
++ {
++ (*info->fprintf_func) (info->stream, "%s",
++ vfpu_const_names[c]);
++ }
++ break;
++ }
++
++ case 'b':
++ /* 5-bit immediate value. */
++ (*info->fprintf_func) (info->stream, "%ld",
++ (l >> OP_SH_VFPU_IMM5) & OP_MASK_VFPU_IMM5);
++ break;
++
++ case 'c':
++ /* VFPU condition code. */
++ (*info->fprintf_func) (info->stream, "%ld",
++ (l >> OP_SH_VFPU_CC) & OP_MASK_VFPU_CC);
++ break;
++
++ case 'e':
++ /* 3-bit immediate value. */
++ (*info->fprintf_func) (info->stream, "%ld",
++ (l >> OP_SH_VFPU_IMM3) & OP_MASK_VFPU_IMM3);
++ break;
++
++ case 'f':
++ /* Conditional compare. */
++ (*info->fprintf_func) (info->stream, "%s",
++ vfpu_cond_names[(l >> OP_SH_VFPU_COND) & OP_MASK_VFPU_COND]);
++ /* Apparently this specifier is unused. */
++ d++;
++ break;
++
++ case 'i':
++ /* 8-bit immediate value. */
++ (*info->fprintf_func) (info->stream, "0x%02lx",
++ (l >> OP_SH_VFPU_IMM8) & OP_MASK_VFPU_IMM8);
++ break;
++
++ case 'q':
++ /* VFPU control register (vmtvc). */
++ (*info->fprintf_func) (info->stream, "$%ld",
++ (l >> OP_SH_VFPU_VMTVC) & OP_MASK_VFPU_VMTVC);
++ break;
++
++ case 'r':
++ /* VFPU control register (vmfvc). */
++ (*info->fprintf_func) (info->stream, "$%ld",
++ (l >> OP_SH_VFPU_VMFVC) & OP_MASK_VFPU_VMFVC);
++ break;
++
++ case 'u':
++ /* Convert a VFPU 16-bit floating-point number to IEEE754. */
++ {
++ union float2int {
++ unsigned int i;
++ float f;
++ } float2int;
++ unsigned short float16 = (l >> OP_SH_VFPU_FLOAT16) & OP_MASK_VFPU_FLOAT16;
++ unsigned int sign = (float16 >> VFPU_SH_FLOAT16_SIGN) & VFPU_MASK_FLOAT16_SIGN;
++ int exponent = (float16 >> VFPU_SH_FLOAT16_EXP) & VFPU_MASK_FLOAT16_EXP;
++ unsigned int fraction = float16 & VFPU_MASK_FLOAT16_FRAC;
++ char signchar = '+' + ((sign == 1) * 2);
++
++ if (exponent == VFPU_FLOAT16_EXP_MAX)
++ {
++ if (fraction == 0)
++ (*info->fprintf_func) (info->stream, "%cInf", signchar);
++ else
++ (*info->fprintf_func) (info->stream, "%cNaN", signchar);
++ }
++ else if (exponent == 0 && fraction == 0)
++ {
++ (*info->fprintf_func) (info->stream, "%c0", signchar);
++ }
++ else
++ {
++ if (exponent == 0)
++ {
++ do
++ {
++ fraction <<= 1;
++ exponent--;
++ }
++ while (!(fraction & (VFPU_MASK_FLOAT16_FRAC + 1)));
++
++ fraction &= VFPU_MASK_FLOAT16_FRAC;
++ }
++
++ /* Convert to 32-bit single-precision IEEE754. */
++ float2int.i = sign << 31;
++ float2int.i |= (exponent + 112) << 23;
++ float2int.i |= fraction << 13;
++ (*info->fprintf_func) (info->stream, "%g", float2int.f);
++ }
++ }
++ break;
++
++ case 'w':
++ {
++ const char *elements[4];
++ unsigned int opcode = l & VFPU_MASK_OP_SIZE;
++ unsigned int rotators = (l >> OP_SH_VFPU_ROT) & OP_MASK_VFPU_ROT;
++ unsigned int opsize, rothi, rotlo, negation, i;
++
++ /* Determine the operand size so we'll know how many elements to output. */
++ if (opcode == VFPU_OP_SIZE_PAIR)
++ opsize = 2;
++ else if (opcode == VFPU_OP_SIZE_TRIPLE)
++ opsize = 3;
++ else
++ opsize = (opcode == VFPU_OP_SIZE_QUAD) * 4; /* Sanity check. */
++
++ rothi = (rotators >> VFPU_SH_ROT_HI) & VFPU_MASK_ROT_HI;
++ rotlo = (rotators >> VFPU_SH_ROT_LO) & VFPU_MASK_ROT_LO;
++ negation = (rotators >> VFPU_SH_ROT_NEG) & VFPU_MASK_ROT_NEG;
++
++ if (rothi == rotlo)
++ {
++ if (negation)
++ {
++ elements[0] = "-s";
++ elements[1] = "-s";
++ elements[2] = "-s";
++ elements[3] = "-s";
++ }
++ else
++ {
++ elements[0] = "s";
++ elements[1] = "s";
++ elements[2] = "s";
++ elements[3] = "s";
++ }
++ }
++ else
++ {
++ elements[0] = "0";
++ elements[1] = "0";
++ elements[2] = "0";
++ elements[3] = "0";
++ }
++ if (negation)
++ elements[rothi] = "-s";
++ else
++ elements[rothi] = "s";
++ elements[rotlo] = "c";
++
++ (*info->fprintf_func) (info->stream, "[");
++ i = 0;
++ for (;;)
++ {
++ (*info->fprintf_func) (info->stream, "%s",
++ elements[i++]);
++ if (i >= opsize)
++ break;
++ (*info->fprintf_func) (info->stream, ",");
++ }
++ (*info->fprintf_func) (info->stream, "]");
++ }
++ break;
++
++ case 'd':
++ case 'm':
++ case 'n':
++ case 's':
++ case 't':
++ case 'v':
++ case 'x':
++ {
++ unsigned int vreg = 0;
++
++ /* The first char specifies the bitfield that contains the register number. */
++ switch (*d)
++ {
++ case 'd':
++ case 'v':
++ case 'x':
++ vreg = (l >> OP_SH_VFPU_VD) & OP_MASK_VFPU_VD;
++ break;
++
++ case 'm':
++ /* Combine bits 0-4 of vt with bits 5-6 of vt. */
++ vreg = ((l >> OP_SH_VFPU_VT_LO) & OP_MASK_VFPU_VT_LO)
++ | ((l & OP_MASK_VFPU_VT_HI2) << OP_SH_VFPU_VT_HI);
++ break;
++
++ case 'n':
++ /* Combine bits 0-4 of vt with bit 5 of vt. */
++ vreg = ((l >> OP_SH_VFPU_VT_LO) & OP_MASK_VFPU_VT_LO)
++ | ((l & OP_MASK_VFPU_VT_HI1) << OP_SH_VFPU_VT_HI);
++ break;
++
++ case 's':
++ {
++ unsigned int temp_vreg = l >> OP_SH_VFPU_VS;
++
++ vreg = temp_vreg & OP_MASK_VFPU_VS;
++ if ((l & VFPU_OP_VT_VS_VD) == VFPU_OPCODE_VMMUL)
++ {
++ /* vmmul instructions have the RXC bit (bit 13) inverted. */
++ if (temp_vreg & 0x20)
++ vreg = temp_vreg & 0x5f;
++ else
++ vreg |= 0x20;
++ }
++ }
++ break;
++
++ case 't':
++ vreg = (l >> OP_SH_VFPU_VT) & OP_MASK_VFPU_VT;
++ break;
++ }
++
++ /* The next char is the register set vreg comes from. */
++ d++;
++ switch (*d)
++ {
++ case '0':
++ (*info->fprintf_func) (info->stream, "%s.s",
++ vfpu_sreg_names[vreg]);
++ break;
++
++ case '1':
++ (*info->fprintf_func) (info->stream, "%s.p",
++ vfpu_vpreg_names[vreg]);
++ break;
++
++ case '2':
++ (*info->fprintf_func) (info->stream, "%s.t",
++ vfpu_vtreg_names[vreg]);
++ break;
++
++ case '3':
++ (*info->fprintf_func) (info->stream, "%s.q",
++ vfpu_vqreg_names[vreg]);
++ break;
++
++ case '5':
++ (*info->fprintf_func) (info->stream, "%s.p",
++ vfpu_mpreg_names[vreg]);
++ break;
++
++ case '6':
++ (*info->fprintf_func) (info->stream, "%s.t",
++ vfpu_mtreg_names[vreg]);
++ break;
++
++ case '7':
++ (*info->fprintf_func) (info->stream, "%s.q",
++ vfpu_mqreg_names[vreg]);
++ break;
++
++ default:
++ /* xgettext:c-format */
++ (*info->fprintf_func) (info->stream,
++ _("# internal error, undefined vreg modifier(%c)"),
++ *d);
++ break;
++ }
++
++ /* The last char is unused for disassembly. */
++ d++;
++ }
++ break;
++
++ case 'z':
++ (*info->fprintf_func) (info->stream, "%s",
++ vfpu_rwb_names[(l >> OP_SH_VFPU_RWB) & OP_MASK_VFPU_RWB]);
++ break;
++ }
++ break;
++
+ default:
+ /* xgettext:c-format */
+ (*info->fprintf_func) (info->stream,
diff --git a/devel/psptoolchain-gdb/files/patch-opcodes-mips-opc.c b/devel/psptoolchain-gdb/files/patch-opcodes-mips-opc.c
new file mode 100644
index 000000000000..e5d48d7dc8ba
--- /dev/null
+++ b/devel/psptoolchain-gdb/files/patch-opcodes-mips-opc.c
@@ -0,0 +1,608 @@
+--- opcodes/mips-opc.c.orig 2005-09-06 19:46:57.000000000 +0100
++++ opcodes/mips-opc.c 2007-02-08 20:06:04.000000000 +0000
+@@ -109,6 +109,7 @@
+ #define N5 (INSN_5400 | INSN_5500)
+ #define N54 INSN_5400
+ #define N55 INSN_5500
++#define AL INSN_ALLEGREX
+
+ #define G1 (T3 \
+ )
+@@ -298,6 +299,7 @@
+ {"bnel", "s,t,p", 0x54000000, 0xfc000000, CBL|RD_s|RD_t, 0, I2|T3 },
+ {"bnel", "s,I,p", 0, (int) M_BNEL_I, INSN_MACRO, 0, I2|T3 },
+ {"break", "", 0x0000000d, 0xffffffff, TRAP, 0, I1 },
++{"break", "B", 0x0000000d, 0xfc00003f, TRAP, 0, I32|AL },
+ {"break", "c", 0x0000000d, 0xfc00ffff, TRAP, 0, I1 },
+ {"break", "c,q", 0x0000000d, 0xfc00003f, TRAP, 0, I1 },
+ {"c.f.d", "S,T", 0x46200030, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, 0, I1 },
+@@ -459,7 +461,7 @@
+ {"cabs.un.d", "M,S,T", 0x46200071, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
+ {"cabs.un.ps", "M,S,T", 0x46c00071, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, 0, M3D },
+ {"cabs.un.s", "M,S,T", 0x46000071, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, 0, M3D },
+-{"cache", "k,o(b)", 0xbc000000, 0xfc000000, RD_b, 0, I3|I32|T3},
++{"cache", "k,o(b)", 0xbc000000, 0xfc000000, RD_b, 0, I3|I32|T3|AL},
+ {"ceil.l.d", "D,S", 0x4620000a, 0xffff003f, WR_D|RD_S|FP_D, 0, I3 },
+ {"ceil.l.s", "D,S", 0x4600000a, 0xffff003f, WR_D|RD_S|FP_S, 0, I3 },
+ {"ceil.w.d", "D,S", 0x4620000e, 0xffff003f, WR_D|RD_S|FP_D, 0, I2 },
+@@ -473,7 +475,9 @@
+ {"cftc1", "d,T", 0x41000023, 0xffe007ff, TRAP|LCD|WR_d|RD_C1|FP_S, 0, MT32 },
+ {"cftc2", "d,E", 0x41000025, 0xffe007ff, TRAP|LCD|WR_d|RD_C2, 0, MT32 },
+ {"clo", "U,s", 0x70000021, 0xfc0007ff, WR_d|WR_t|RD_s, 0, I32|N55 },
++{"clo", "d,s", 0x00000017, 0xfc1f07ff, WR_d|RD_s, 0, AL },
+ {"clz", "U,s", 0x70000020, 0xfc0007ff, WR_d|WR_t|RD_s, 0, I32|N55 },
++{"clz", "d,s", 0x00000016, 0xfc1f07ff, WR_d|RD_s, 0, AL },
+ {"ctc0", "t,G", 0x40c00000, 0xffe007ff, COD|RD_t|WR_CC, 0, I1 },
+ {"ctc1", "t,G", 0x44c00000, 0xffe007ff, COD|RD_t|WR_CC|FP_S, 0, I1 },
+ {"ctc1", "t,S", 0x44c00000, 0xffe007ff, COD|RD_t|WR_CC|FP_S, 0, I1 },
+@@ -498,13 +502,15 @@
+ {"cvt.ps.s","D,V,T", 0x46000026, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, 0, I5 },
+ {"cvt.pw.ps", "D,S", 0x46c00024, 0xffff003f, WR_D|RD_S|FP_S|FP_D, 0, M3D },
+ {"dabs", "d,v", 0, (int) M_DABS, INSN_MACRO, 0, I3 },
++{"max", "d,v,t", 0x0000002c, 0xfc0007ff, WR_d|RD_s|RD_t, 0, AL },
+ {"dadd", "d,v,t", 0x0000002c, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I3 },
+ {"dadd", "t,r,I", 0, (int) M_DADD_I, INSN_MACRO, 0, I3 },
+ {"daddi", "t,r,j", 0x60000000, 0xfc000000, WR_t|RD_s, 0, I3 },
+ {"daddiu", "t,r,j", 0x64000000, 0xfc000000, WR_t|RD_s, 0, I3 },
++{"min", "d,v,t", 0x0000002d, 0xfc0007ff, WR_d|RD_s|RD_t, 0, AL },
+ {"daddu", "d,v,t", 0x0000002d, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I3 },
+ {"daddu", "t,r,I", 0, (int) M_DADDU_I, INSN_MACRO, 0, I3 },
+-{"dbreak", "", 0x7000003f, 0xffffffff, 0, 0, N5 },
++{"dbreak", "", 0x7000003f, 0xffffffff, 0, 0, N5|AL },
+ {"dclo", "U,s", 0x70000025, 0xfc0007ff, RD_s|WR_d|WR_t, 0, I64|N55 },
+ {"dclz", "U,s", 0x70000024, 0xfc0007ff, RD_s|WR_d|WR_t, 0, I64|N55 },
+ /* dctr and dctw are used on the r5000. */
+@@ -593,7 +599,7 @@
+ {"dremu", "z,s,t", 0x0000001f, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, I3 },
+ {"dremu", "d,v,t", 3, (int) M_DREMU_3, INSN_MACRO, 0, I3 },
+ {"dremu", "d,v,I", 3, (int) M_DREMU_3I, INSN_MACRO, 0, I3 },
+-{"dret", "", 0x7000003e, 0xffffffff, 0, 0, N5 },
++{"dret", "", 0x7000003e, 0xffffffff, 0, 0, N5|AL },
+ {"drol", "d,v,t", 0, (int) M_DROL, INSN_MACRO, 0, I3 },
+ {"drol", "d,v,I", 0, (int) M_DROL_I, INSN_MACRO, 0, I3 },
+ {"dror", "d,v,t", 0, (int) M_DROR, INSN_MACRO, 0, I3 },
+@@ -634,10 +640,10 @@
+ {"ei", "t", 0x41606020, 0xffe0ffff, WR_t|WR_C0, 0, I33 },
+ {"emt", "", 0x41600be1, 0xffffffff, TRAP, 0, MT32 },
+ {"emt", "t", 0x41600be1, 0xffe0ffff, TRAP|WR_t, 0, MT32 },
+-{"eret", "", 0x42000018, 0xffffffff, 0, 0, I3|I32 },
++{"eret", "", 0x42000018, 0xffffffff, 0, 0, I3|I32|AL },
+ {"evpe", "", 0x41600021, 0xffffffff, TRAP, 0, MT32 },
+ {"evpe", "t", 0x41600021, 0xffe0ffff, TRAP|WR_t, 0, MT32 },
+-{"ext", "t,r,+A,+C", 0x7c000000, 0xfc00003f, WR_t|RD_s, 0, I33 },
++{"ext", "t,r,+A,+C", 0x7c000000, 0xfc00003f, WR_t|RD_s, 0, I33|AL },
+ {"floor.l.d", "D,S", 0x4620000b, 0xffff003f, WR_D|RD_S|FP_D, 0, I3 },
+ {"floor.l.s", "D,S", 0x4600000b, 0xffff003f, WR_D|RD_S|FP_S, 0, I3 },
+ {"floor.w.d", "D,S", 0x4620000f, 0xffff003f, WR_D|RD_S|FP_D, 0, I2 },
+@@ -646,7 +652,7 @@
+ {"flushd", "", 0xbc020000, 0xffffffff, 0, 0, L1 },
+ {"flushid", "", 0xbc030000, 0xffffffff, 0, 0, L1 },
+ {"hibernate","", 0x42000023, 0xffffffff, 0, 0, V1 },
+-{"ins", "t,r,+A,+B", 0x7c000004, 0xfc00003f, WR_t|RD_s, 0, I33 },
++{"ins", "t,r,+A,+B", 0x7c000004, 0xfc00003f, WR_t|RD_s, 0, I33|AL },
+ {"jr", "s", 0x00000008, 0xfc1fffff, UBD|RD_s, 0, I1 },
+ {"jr.hb", "s", 0x00000408, 0xfc1fffff, UBD|RD_s, 0, I33 },
+ {"j", "s", 0x00000008, 0xfc1fffff, UBD|RD_s, 0, I1 }, /* jr */
+@@ -680,18 +686,10 @@
+ {"ld", "t,o(b)", 0xdc000000, 0xfc000000, WR_t|RD_b, 0, I3 },
+ {"ld", "t,o(b)", 0, (int) M_LD_OB, INSN_MACRO, 0, I1 },
+ {"ld", "t,A(b)", 0, (int) M_LD_AB, INSN_MACRO, 0, I1 },
+-{"ldc1", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 },
+-{"ldc1", "E,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 },
+-{"ldc1", "T,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, 0, I2 },
+-{"ldc1", "E,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, 0, I2 },
+-{"l.d", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, /* ldc1 */
+-{"l.d", "T,o(b)", 0, (int) M_L_DOB, INSN_MACRO, 0, I1 },
+-{"l.d", "T,A(b)", 0, (int) M_L_DAB, INSN_MACRO, 0, I1 },
+-{"ldc2", "E,o(b)", 0xd8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 },
+-{"ldc2", "E,A(b)", 0, (int) M_LDC2_AB, INSN_MACRO, 0, I2 },
+-{"ldc3", "E,o(b)", 0xdc000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 },
+-{"ldc3", "E,A(b)", 0, (int) M_LDC3_AB, INSN_MACRO, 0, I2 },
+-{"ldl", "t,o(b)", 0x68000000, 0xfc000000, LDD|WR_t|RD_b, 0, I3 },
++/* ldc1 is at the bottom of the table. */
++/* ldc2 is at the bottom of the table. */
++/* ldc3 is at the bottom of the table. */
++{"ldl", "t,o(b)", 0x68000000, 0xfc000000, LDD|WR_t|RD_b, 0, I3|AL },
+ {"ldl", "t,A(b)", 0, (int) M_LDL_AB, INSN_MACRO, 0, I3 },
+ {"ldr", "t,o(b)", 0x6c000000, 0xfc000000, LDD|WR_t|RD_b, 0, I3 },
+ {"ldr", "t,A(b)", 0, (int) M_LDR_AB, INSN_MACRO, 0, I3 },
+@@ -721,8 +719,7 @@
+ {"lwc1", "E,A(b)", 0, (int) M_LWC1_AB, INSN_MACRO, 0, I1 },
+ {"l.s", "T,o(b)", 0xc4000000, 0xfc000000, CLD|RD_b|WR_T|FP_S, 0, I1 }, /* lwc1 */
+ {"l.s", "T,A(b)", 0, (int) M_LWC1_AB, INSN_MACRO, 0, I1 },
+-{"lwc2", "E,o(b)", 0xc8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I1 },
+-{"lwc2", "E,A(b)", 0, (int) M_LWC2_AB, INSN_MACRO, 0, I1 },
++/* lwc2 is at the bottom of the table. */
+ {"lwc3", "E,o(b)", 0xcc000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I1 },
+ {"lwc3", "E,A(b)", 0, (int) M_LWC3_AB, INSN_MACRO, 0, I1 },
+ {"lwl", "t,o(b)", 0x88000000, 0xfc000000, LDD|RD_b|WR_t, 0, I1 },
+@@ -755,10 +752,12 @@
+ {"madd.s", "D,R,S,T", 0x4c000020, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_S, 0, I4 },
+ {"madd.ps", "D,R,S,T", 0x4c000026, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0, I5 },
+ {"madd", "s,t", 0x0000001c, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 },
++{"madd", "s,t", 0x0000001c, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, AL },
+ {"madd", "s,t", 0x70000000, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55},
+ {"madd", "s,t", 0x70000000, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, G1 },
+ {"madd", "d,s,t", 0x70000000, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d|IS_M, 0, G1 },
+ {"maddu", "s,t", 0x0000001d, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 },
++{"maddu", "s,t", 0x0000001d, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, AL },
+ {"maddu", "s,t", 0x70000001, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55},
+ {"maddu", "s,t", 0x70000001, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, G1 },
+ {"maddu", "d,s,t", 0x70000001, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d|IS_M, 0, G1 },
+@@ -799,7 +798,7 @@
+ /* mfhc2 is at the bottom of the table. */
+ {"mfc3", "t,G", 0x4c000000, 0xffe007ff, LCD|WR_t|RD_C3, 0, I1 },
+ {"mfc3", "t,G,H", 0x4c000000, 0xffe007f8, LCD|WR_t|RD_C3, 0, I32 },
+-{"mfdr", "t,G", 0x7000003d, 0xffe007ff, LCD|WR_t|RD_C0, 0, N5 },
++{"mfdr", "t,G", 0x7000003d, 0xffe007ff, LCD|WR_t|RD_C0, 0, N5|AL },
+ {"mfhi", "d", 0x00000010, 0xffff07ff, WR_d|RD_HI, 0, I1 },
+ {"mfhi", "d,9", 0x00000010, 0xff9f07ff, WR_d|RD_HI, 0, D32 },
+ {"mflo", "d", 0x00000012, 0xffff07ff, WR_d|RD_LO, 0, I1 },
+@@ -818,7 +817,7 @@
+ {"movf.l", "X,Y,N", 0x46a00011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, MX|SB1 },
+ {"movf.s", "D,S,N", 0x46000011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_S, 0, I4|I32 },
+ {"movf.ps", "D,S,N", 0x46c00011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, I5 },
+-{"movn", "d,v,t", 0x0000000b, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I4|I32 },
++{"movn", "d,v,t", 0x0000000b, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I4|I32|AL },
+ {"ffc", "d,v", 0x0000000b, 0xfc1f07ff, WR_d|RD_s, 0, L1 },
+ {"movn.d", "D,S,t", 0x46200013, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, I4|I32 },
+ {"movn.l", "D,S,t", 0x46a00013, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, MX|SB1 },
+@@ -831,7 +830,7 @@
+ {"movt.l", "X,Y,N", 0x46a10011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, MX|SB1 },
+ {"movt.s", "D,S,N", 0x46010011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_S, 0, I4|I32 },
+ {"movt.ps", "D,S,N", 0x46c10011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, 0, I5 },
+-{"movz", "d,v,t", 0x0000000a, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I4|I32 },
++{"movz", "d,v,t", 0x0000000a, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I4|I32|AL },
+ {"ffs", "d,v", 0x0000000a, 0xfc1f07ff, WR_d|RD_s, 0, L1 },
+ {"movz.d", "D,S,t", 0x46200012, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, I4|I32 },
+ {"movz.l", "D,S,t", 0x46a00012, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, 0, MX|SB1 },
+@@ -848,8 +847,10 @@
+ {"msub.s", "D,R,S,T", 0x4c000028, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_S, 0, I4 },
+ {"msub.ps", "D,R,S,T", 0x4c00002e, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0, I5 },
+ {"msub", "s,t", 0x0000001e, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 },
++{"msub", "s,t", 0x0000002e, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, AL },
+ {"msub", "s,t", 0x70000004, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55 },
+ {"msubu", "s,t", 0x0000001f, 0xfc00ffff, RD_s|RD_t|WR_HILO, 0, L1 },
++{"msubu", "s,t", 0x0000002f, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, 0, AL },
+ {"msubu", "s,t", 0x70000005, 0xfc00ffff, RD_s|RD_t|MOD_HILO, 0, I32|N55 },
+ {"mtpc", "t,P", 0x4080c801, 0xffe0ffc1, COD|RD_t|WR_C0, 0, M1|N5 },
+ {"mtps", "t,P", 0x4080c800, 0xffe0ffc1, COD|RD_t|WR_C0, 0, M1|N5 },
+@@ -864,7 +865,7 @@
+ /* mthc2 is at the bottom of the table. */
+ {"mtc3", "t,G", 0x4c800000, 0xffe007ff, COD|RD_t|WR_C3|WR_CC, 0, I1 },
+ {"mtc3", "t,G,H", 0x4c800000, 0xffe007f8, COD|RD_t|WR_C3|WR_CC, 0, I32 },
+-{"mtdr", "t,G", 0x7080003d, 0xffe007ff, COD|RD_t|WR_C0, 0, N5 },
++{"mtdr", "t,G", 0x7080003d, 0xffe007ff, COD|RD_t|WR_C0, 0, N5|AL },
+ {"mthi", "s", 0x00000011, 0xfc1fffff, RD_s|WR_HI, 0, I1 },
+ {"mthi", "s,7", 0x00000011, 0xfc1fe7ff, RD_s|WR_HI, 0, D32 },
+ {"mtlo", "s", 0x00000013, 0xfc1fffff, RD_s|WR_LO, 0, I1 },
+@@ -1018,13 +1019,13 @@
+ {"rol", "d,v,I", 0, (int) M_ROL_I, INSN_MACRO, 0, I1 },
+ {"ror", "d,v,t", 0, (int) M_ROR, INSN_MACRO, 0, I1 },
+ {"ror", "d,v,I", 0, (int) M_ROR_I, INSN_MACRO, 0, I1 },
+-{"ror", "d,w,<", 0x00200002, 0xffe0003f, WR_d|RD_t, 0, N5|I33 },
+-{"rorv", "d,t,s", 0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d, 0, N5|I33 },
+-{"rotl", "d,v,t", 0, (int) M_ROL, INSN_MACRO, 0, I33 },
+-{"rotl", "d,v,I", 0, (int) M_ROL_I, INSN_MACRO, 0, I33 },
+-{"rotr", "d,v,t", 0, (int) M_ROR, INSN_MACRO, 0, I33 },
+-{"rotr", "d,v,I", 0, (int) M_ROR_I, INSN_MACRO, 0, I33 },
+-{"rotrv", "d,t,s", 0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d, 0, I33 },
++{"ror", "d,w,<", 0x00200002, 0xffe0003f, WR_d|RD_t, 0, N5|I33|AL },
++{"rorv", "d,t,s", 0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d, 0, N5|I33|AL },
++{"rotl", "d,v,t", 0, (int) M_ROL, INSN_MACRO, 0, I33|AL },
++{"rotl", "d,v,I", 0, (int) M_ROL_I, INSN_MACRO, 0, I33|AL },
++{"rotr", "d,v,t", 0, (int) M_ROR, INSN_MACRO, 0, I33|AL },
++{"rotr", "d,v,I", 0, (int) M_ROR_I, INSN_MACRO, 0, I33|AL },
++{"rotrv", "d,t,s", 0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d, 0, I33|AL },
+ {"round.l.d", "D,S", 0x46200008, 0xffff003f, WR_D|RD_S|FP_D, 0, I3 },
+ {"round.l.s", "D,S", 0x46000008, 0xffff003f, WR_D|RD_S|FP_S, 0, I3 },
+ {"round.w.d", "D,S", 0x4620000c, 0xffff003f, WR_D|RD_S|FP_D, 0, I2 },
+@@ -1056,24 +1057,17 @@
+ {"sdbbp", "c,q", 0x0000000e, 0xfc00003f, TRAP, 0, G2 },
+ {"sdbbp", "", 0x7000003f, 0xffffffff, TRAP, 0, I32 },
+ {"sdbbp", "B", 0x7000003f, 0xfc00003f, TRAP, 0, I32 },
+-{"sdc1", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 },
+-{"sdc1", "E,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 },
+-{"sdc1", "T,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, 0, I2 },
+-{"sdc1", "E,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, 0, I2 },
+-{"sdc2", "E,o(b)", 0xf8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I2 },
+-{"sdc2", "E,A(b)", 0, (int) M_SDC2_AB, INSN_MACRO, 0, I2 },
+-{"sdc3", "E,o(b)", 0xfc000000, 0xfc000000, SM|RD_C3|RD_b, 0, I2 },
+-{"sdc3", "E,A(b)", 0, (int) M_SDC3_AB, INSN_MACRO, 0, I2 },
+-{"s.d", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 },
+-{"s.d", "T,o(b)", 0, (int) M_S_DOB, INSN_MACRO, 0, I1 },
+-{"s.d", "T,A(b)", 0, (int) M_S_DAB, INSN_MACRO, 0, I1 },
+-{"sdl", "t,o(b)", 0xb0000000, 0xfc000000, SM|RD_t|RD_b, 0, I3 },
++/* sdc1 is at the bottom of the table. */
++/* sdc2 is at the bottom of the table. */
++/* sdc3 is at the bottom of the table. */
++/* s.d (sdc1 is at the bottom of the table. */
++{"sdl", "t,o(b)", 0xb0000000, 0xfc000000, SM|RD_t|RD_b, 0, I3|AL },
+ {"sdl", "t,A(b)", 0, (int) M_SDL_AB, INSN_MACRO, 0, I3 },
+ {"sdr", "t,o(b)", 0xb4000000, 0xfc000000, SM|RD_t|RD_b, 0, I3 },
+ {"sdr", "t,A(b)", 0, (int) M_SDR_AB, INSN_MACRO, 0, I3 },
+ {"sdxc1", "S,t(b)", 0x4c000009, 0xfc0007ff, SM|RD_S|RD_t|RD_b, 0, I4 },
+-{"seb", "d,w", 0x7c000420, 0xffe007ff, WR_d|RD_t, 0, I33 },
+-{"seh", "d,w", 0x7c000620, 0xffe007ff, WR_d|RD_t, 0, I33 },
++{"seb", "d,w", 0x7c000420, 0xffe007ff, WR_d|RD_t, 0, I33|AL },
++{"seh", "d,w", 0x7c000620, 0xffe007ff, WR_d|RD_t, 0, I33|AL },
+ {"selsl", "d,v,t", 0x00000005, 0xfc0007ff, WR_d|RD_s|RD_t, 0, L1 },
+ {"selsr", "d,v,t", 0x00000001, 0xfc0007ff, WR_d|RD_s|RD_t, 0, L1 },
+ {"seq", "d,v,t", 0, (int) M_SEQ, INSN_MACRO, 0, I1 },
+@@ -1165,8 +1159,7 @@
+ {"swc1", "E,A(b)", 0, (int) M_SWC1_AB, INSN_MACRO, 0, I1 },
+ {"s.s", "T,o(b)", 0xe4000000, 0xfc000000, SM|RD_T|RD_b|FP_S, 0, I1 }, /* swc1 */
+ {"s.s", "T,A(b)", 0, (int) M_SWC1_AB, INSN_MACRO, 0, I1 },
+-{"swc2", "E,o(b)", 0xe8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I1 },
+-{"swc2", "E,A(b)", 0, (int) M_SWC2_AB, INSN_MACRO, 0, I1 },
++/* swc2 is at the bottom of the table. */
+ {"swc3", "E,o(b)", 0xec000000, 0xfc000000, SM|RD_C3|RD_b, 0, I1 },
+ {"swc3", "E,A(b)", 0, (int) M_SWC3_AB, INSN_MACRO, 0, I1 },
+ {"swl", "t,o(b)", 0xa8000000, 0xfc000000, SM|RD_t|RD_b, 0, I1 },
+@@ -1251,7 +1244,8 @@
+ {"waiti", "", 0x42000020, 0xffffffff, TRAP, 0, L1 },
+ {"wb", "o(b)", 0xbc040000, 0xfc1f0000, SM|RD_b, 0, L1 },
+ {"wrpgpr", "d,w", 0x41c00000, 0xffe007ff, RD_t, 0, I33 },
+-{"wsbh", "d,w", 0x7c0000a0, 0xffe007ff, WR_d|RD_t, 0, I33 },
++{"wsbh", "d,w", 0x7c0000a0, 0xffe007ff, WR_d|RD_t, 0, I33|AL },
++{"wsbw", "d,t", 0x7c0000e0, 0xffe007ff, WR_d|RD_t, 0, AL },
+ {"xor", "d,v,t", 0x00000026, 0xfc0007ff, WR_d|RD_s|RD_t, 0, I1 },
+ {"xor", "t,r,I", 0, (int) M_XOR_I, INSN_MACRO, 0, I1 },
+ {"xor.ob", "X,Y,Q", 0x7800000d, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, 0, MX|SB1 },
+@@ -1263,6 +1257,319 @@
+ {"yield", "s", 0x7c000009, 0xfc1fffff, TRAP|RD_s, 0, MT32 },
+ {"yield", "d,s", 0x7c000009, 0xfc1f07ff, TRAP|WR_d|RD_s, 0, MT32 },
+
++/* Sony Allegrex CPU core. */
++{"bitrev", "d,t", 0x7c000520, 0xffe007ff, WR_d|RD_t, 0, AL },
++{"mfic", "t,G", 0x70000024, 0xffe007ff, LCD|WR_t|RD_C0, 0, AL },
++{"mtic", "t,G", 0x70000026, 0xffe007ff, COD|RD_t|WR_C0, 0, AL },
++
++/* Sony Allegrex VFPU instructions. */
++{"bvf", "?c,p", 0x49000000, 0xffe30000, CBD|RD_CC, 0, AL },
++{"bvfl", "?c,p", 0x49020000, 0xffe30000, CBL|RD_CC, 0, AL },
++{"bvt", "?c,p", 0x49010000, 0xffe30000, CBD|RD_CC, 0, AL },
++{"bvtl", "?c,p", 0x49030000, 0xffe30000, CBL|RD_CC, 0, AL },
++{"lv.s", "?m0x,?o(b)", 0xc8000000, 0xfc000000, CLD|RD_s|WR_CC, 0, AL },
++{"lv.s", "?m0x,A(b)", 0, (int) M_LVQ_AB, INSN_MACRO, 0, AL },
++{"ulv.s", "?m0x,o(b)", 0, (int) M_ULVS, INSN_MACRO, 0, AL },
++{"lv.q", "?n3x,?o(b)", 0xd8000000, 0xfc000002, CLD|RD_s|WR_CC, 0, AL },
++{"lv.q", "?n3x,A(b)", 0, (int) M_LVQ_AB_2, INSN_MACRO, 0, AL },
++{"ulv.q", "?n3x,?o(b)", 0, (int) M_ULVQ, INSN_MACRO, 0, AL },
++{"ulv.q", "?n3x,A(b)", 0, (int) M_ULVQ_AB, INSN_MACRO, 0, AL },
++{"lvi.s", "?t0x,l?y0", 0, (int) M_LVIS, INSN_MACRO, 0, AL },
++{"lvi.p", "?t1x,?[l?y0,l?y1?]", 0, (int) M_LVIP, INSN_MACRO, 0, AL },
++{"lvi.t", "?t2x,?[l?y0,l?y1,l?y2?]", 0, (int) M_LVIT, INSN_MACRO, 0, AL },
++{"lvi.q", "?t3x,?[l?y0,l?y1,l?y2,l?y3?]", 0, (int) M_LVIQ, INSN_MACRO, 0, AL },
++{"lvhi.s", "?t0x,?[?u?y0,?u?y1?]", 0, (int) M_LVHIS, INSN_MACRO, 0, AL },
++{"lvhi.p", "?t1x,?[?u?y0,?u?y1,?u?y2,?u?y3?]", 0, (int) M_LVHIP, INSN_MACRO, 0, AL },
++{"sv.s", "?m0x,?o(b)", 0xe8000000, 0xfc000000, SM|RD_s|RD_C2, 0, AL },
++{"sv.s", "?m0x,A(b)", 0, (int) M_SVS_AB, INSN_MACRO, 0, AL },
++{"usv.s", "?m0x,o(b)", 0, (int) M_USVS, INSN_MACRO, 0, AL },
++{"sv.q", "?n3x,?o(b)", 0xf8000000, 0xfc000002, SM|RD_s|RD_C2, 0, AL },
++{"sv.q", "?n3x,?o(b),?z", 0xf8000000, 0xfc000000, SM|RD_s|RD_C2, 0, AL },
++{"sv.q", "?n3x,A(b)", 0, (int) M_SVQ_AB, INSN_MACRO, 0, AL },
++{"sv.q", "?n3x,A(b),?z", 0, (int) M_SVQ_AB, INSN_MACRO, 0, AL },
++{"sv.q", "?n3x,A,?z", 0, (int) M_SVQ_AB, INSN_MACRO, 0, AL },
++{"usv.q", "?n3x,?o(b)", 0, (int) M_USVQ, INSN_MACRO, 0, AL },
++{"usv.q", "?n3x,A(b)", 0, (int) M_USVQ_AB, INSN_MACRO, 0, AL },
++{"vwb.q", "?n3x,?o(b)", 0xf8000002, 0xfc000002, SM|RD_s|RD_C2, 0, AL },
++{"lvl.q", "?n3x,?o(b)", 0xd4000000, 0xfc000002, CLD|RD_s|WR_CC, 0, AL },
++{"lvl.q", "?n3x,A(b)", 0, (int) M_LVLQ_AB, INSN_MACRO, 0, AL },
++{"lvr.q", "?n3x,?o(b)", 0xd4000002, 0xfc000002, CLD|RD_s|WR_CC, 0, AL },
++{"lvr.q", "?n3x,A(b)", 0, (int) M_LVRQ_AB, INSN_MACRO, 0, AL },
++{"svl.q", "?n3x,?o(b)", 0xf4000000, 0xfc000002, SM|RD_s|RD_C2, 0, AL },
++{"svl.q", "?n3x,A(b)", 0, (int) M_SVLQ_AB, INSN_MACRO, 0, AL },
++{"svr.q", "?n3x,?o(b)", 0xf4000002, 0xfc000002, SM|RD_s|RD_C2, 0, AL },
++{"svr.q", "?n3x,A(b)", 0, (int) M_SVRQ_AB, INSN_MACRO, 0, AL },
++{"mtv", "t,?d0z", 0x48e00000, 0xffe0ff80, LCD|WR_t|WR_C2, 0, AL },
++{"mfv", "t,?d0z", 0x48600000, 0xffe0ff80, COD|RD_t|WR_CC|RD_C2, 0, AL },
++{"mtvc", "t,?q", 0x48e00000, 0xffe0ff00, LCD|WR_t|WR_C2, 0, AL },
++{"mfvc", "t,?q", 0x48600000, 0xffe0ff00, COD|RD_t|WR_CC|RD_C2, 0, AL },
++{"vmtvc", "?q,?s0y", 0xd0510000, 0xffff8000, WR_C2, 0, AL },
++{"vmfvc", "?d0z,?r", 0xd0500000, 0xffff0080, RD_C2, 0, AL },
++{"vadd.q", "?d3d,?s3s,?t3t", 0x60008080, 0xff808080, RD_C2, 0, AL },
++{"vsub.q", "?d3d,?s3s,?t3t", 0x60808080, 0xff808080, RD_C2, 0, AL },
++{"vdiv.q", "?x3z,?s3y,?t3x", 0x63808080, 0xff808080, RD_C2, 0, AL },
++{"vmul.q", "?d3d,?s3s,?t3t", 0x64008080, 0xff808080, RD_C2, 0, AL },
++{"vdot.q", "?d0d,?s3s,?t3t", 0x64808080, 0xff808080, RD_C2, 0, AL },
++{"vscl.q", "?d3d,?s3s,?t0x", 0x65008080, 0xff808080, RD_C2, 0, AL },
++{"vhdp.q", "?d0d,?s3y,?t3t", 0x66008080, 0xff808080, RD_C2, 0, AL },
++{"vcmp.q", "?f2,?s3s,?t3t", 0x6c008080, 0xff8080f0, RD_C2, 0, AL },
++{"vcmp.q", "?f1,?s3s", 0x6c008080, 0xffff80f0, RD_C2, 0, AL },
++{"vcmp.q", "?f0", 0x6c008080, 0xfffffff0, RD_C2, 0, AL },
++{"vmin.q", "?d3d,?s3s,?t3t", 0x6d008080, 0xff808080, RD_C2, 0, AL },
++{"vmax.q", "?d3d,?s3s,?t3t", 0x6d808080, 0xff808080, RD_C2, 0, AL },
++{"vsgn.q", "?d3d,?s3s", 0xd04a8080, 0xffff8080, RD_C2, 0, AL },
++{"vcst.q", "?d3d,?a", 0xd0608080, 0xffe0ff80, RD_C2, 0, AL },
++{"vscmp.q", "?d3d,?s3s,?t3t", 0x6e808080, 0xff808080, RD_C2, 0, AL },
++{"vsge.q", "?d3d,?s3s,?t3t", 0x6f008080, 0xff808080, RD_C2, 0, AL },
++{"vslt.q", "?d3d,?s3s,?t3t", 0x6f808080, 0xff808080, RD_C2, 0, AL },
++{"vi2uc.q", "?d0m,?s3w", 0xd03c8080, 0xffff8080, RD_C2, 0, AL },
++{"vi2c.q", "?d0m,?s3w", 0xd03d8080, 0xffff8080, RD_C2, 0, AL },
++{"vi2us.q", "?d1m,?s3w", 0xd03e8080, 0xffff8080, RD_C2, 0, AL },
++{"vi2s.q", "?d1m,?s3w", 0xd03f8080, 0xffff8080, RD_C2, 0, AL },
++{"vmov.q", "?d3d,?s3s", 0xd0008080, 0xffff8080, RD_C2, 0, AL },
++{"vabs.q", "?d3d,?s3w", 0xd0018080, 0xffff8080, RD_C2, 0, AL },
++{"vneg.q", "?d3d,?s3w", 0xd0028080, 0xffff8080, RD_C2, 0, AL },
++{"vidt.q", "?d3d", 0xd0038080, 0xffffff80, RD_C2, 0, AL },
++{"vsat0.q", "?d3z,?s3s", 0xd0048080, 0xffff8080, RD_C2, 0, AL },
++{"vsat1.q", "?d3z,?s3s", 0xd0058080, 0xffff8080, RD_C2, 0, AL },
++{"vzero.q", "?d3d", 0xd0068080, 0xffffff80, RD_C2, 0, AL },
++{"vone.q", "?d3d", 0xd0078080, 0xffffff80, RD_C2, 0, AL },
++{"vrcp.q", "?x3z,?s3y", 0xd0108080, 0xffff8080, RD_C2, 0, AL },
++{"vrsq.q", "?x3z,?s3y", 0xd0118080, 0xffff8080, RD_C2, 0, AL },
++{"vsin.q", "?x3z,?s3y", 0xd0128080, 0xffff8080, RD_C2, 0, AL },
++{"vcos.q", "?x3z,?s3y", 0xd0138080, 0xffff8080, RD_C2, 0, AL },
++{"vexp2.q", "?x3z,?s3y", 0xd0148080, 0xffff8080, RD_C2, 0, AL },
++{"vlog2.q", "?x3z,?s3y", 0xd0158080, 0xffff8080, RD_C2, 0, AL },
++{"vsqrt.q", "?x3z,?s3y", 0xd0168080, 0xffff8080, RD_C2, 0, AL },
++{"vasin.q", "?x3z,?s3y", 0xd0178080, 0xffff8080, RD_C2, 0, AL },
++{"vnrcp.q", "?x3z,?s3y", 0xd0188080, 0xffff8080, RD_C2, 0, AL },
++{"vnsin.q", "?x3z,?s3y", 0xd01a8080, 0xffff8080, RD_C2, 0, AL },
++{"vrexp2.q", "?x3z,?s3y", 0xd01c8080, 0xffff8080, RD_C2, 0, AL },
++{"vrndi.q", "?d3z", 0xd0218080, 0xffffff80, RD_C2, 0, AL },
++{"vrndf1.q", "?d3z", 0xd0228080, 0xffffff80, RD_C2, 0, AL },
++{"vrndf2.q", "?d3z", 0xd0238080, 0xffffff80, RD_C2, 0, AL },
++{"vf2h.q", "?d1m,?s3s", 0xd0328080, 0xffff8080, RD_C2, 0, AL },
++{"vsrt1.q", "?d3d,?s3s", 0xd0408080, 0xffff8080, RD_C2, 0, AL },
++{"vsrt2.q", "?d3d,?s3s", 0xd0418080, 0xffff8080, RD_C2, 0, AL },
++{"vsrt3.q", "?d3d,?s3s", 0xd0488080, 0xffff8080, RD_C2, 0, AL },
++{"vsrt4.q", "?d3d,?s3s", 0xd0498080, 0xffff8080, RD_C2, 0, AL },
++{"vbfy1.q", "?d3d,?s3s", 0xd0428080, 0xffff8080, RD_C2, 0, AL },
++{"vbfy2.q", "?d3d,?s3s", 0xd0438080, 0xffff8080, RD_C2, 0, AL },
++{"vocp.q", "?d3d,?s3y", 0xd0448080, 0xffff8080, RD_C2, 0, AL },
++{"vfad.q", "?d0d,?s3s", 0xd0468080, 0xffff8080, RD_C2, 0, AL },
++{"vavg.q", "?d0d,?s3s", 0xd0478080, 0xffff8080, RD_C2, 0, AL },
++{"vf2in.q", "?d3m,?s3s,?b", 0xd2008080, 0xffe08080, RD_C2, 0, AL },
++{"vf2iz.q", "?d3m,?s3s,?b", 0xd2208080, 0xffe08080, RD_C2, 0, AL },
++{"vf2iu.q", "?d3m,?s3s,?b", 0xd2408080, 0xffe08080, RD_C2, 0, AL },
++{"vf2id.q", "?d3m,?s3s,?b", 0xd2608080, 0xffe08080, RD_C2, 0, AL },
++{"vi2f.q", "?d3d,?s3w,?b", 0xd2808080, 0xffe08080, RD_C2, 0, AL },
++{"vcmov.q", "?d3d,?s3s,?e", 0, (int) M_VCMOVQ, INSN_MACRO, 0, AL },
++{"vcmovt.q", "?d3d,?s3s,?e", 0xd2a08080, 0xfff88080, RD_C2, 0, AL },
++{"vcmovf.q", "?d3d,?s3s,?e", 0xd2a88080, 0xfff88080, RD_C2, 0, AL },
++{"vmmul.q", "?v7z,?s7y,?t7x", 0xf0008080, 0xff808080, RD_C2, 0, AL },
++{"vtfm4.q", "?v3z,?s7y,?t3x", 0xf1808080, 0xff808080, RD_C2, 0, AL },
++{"vhtfm4.q", "?v3z,?s7y,?t3x", 0xf1808000, 0xff808080, RD_C2, 0, AL },
++{"vmscl.q", "?x7z,?s7y,?t0x", 0xf2008080, 0xff808080, RD_C2, 0, AL },
++{"vqmul.q", "?v3z,?s3y,?t3x", 0xf2808080, 0xff808080, RD_C2, 0, AL },
++{"vmmov.q", "?x7z,?s7y", 0xf3808080, 0xffff8080, RD_C2, 0, AL },
++{"vmidt.q", "?d7z", 0xf3838080, 0xffffff80, RD_C2, 0, AL },
++{"vmzero.q", "?d7z", 0xf3868080, 0xffffff80, RD_C2, 0, AL },
++{"vmone.q", "?d7z", 0xf3878080, 0xffffff80, RD_C2, 0, AL },
++{"vrot.q", "?x3z,?s0y,?w", 0xf3a08080, 0xffe08080, RD_C2, 0, AL },
++{"vt4444.q", "?d1z,?s3w", 0xd0598080, 0xffff8080, RD_C2, 0, AL },
++{"vt5551.q", "?d1z,?s3w", 0xd05a8080, 0xffff8080, RD_C2, 0, AL },
++{"vt5650.q", "?d1z,?s3w", 0xd05b8080, 0xffff8080, RD_C2, 0, AL },
++{"vadd.t", "?d2d,?s2s,?t2t", 0x60008000, 0xff808080, RD_C2, 0, AL },
++{"vsub.t", "?d2d,?s2s,?t2t", 0x60808000, 0xff808080, RD_C2, 0, AL },
++{"vdiv.t", "?x2z,?s2y,?t2x", 0x63808000, 0xff808080, RD_C2, 0, AL },
++{"vmul.t", "?d2d,?s2s,?t2t", 0x64008000, 0xff808080, RD_C2, 0, AL },
++{"vdot.t", "?d0d,?s2s,?t2t", 0x64808000, 0xff808080, RD_C2, 0, AL },
++{"vscl.t", "?d2d,?s2s,?t0x", 0x65008000, 0xff808080, RD_C2, 0, AL },
++{"vhdp.t", "?d0d,?s2y,?t2t", 0x66008000, 0xff808080, RD_C2, 0, AL },
++{"vcrs.t", "?d2d,?s2y,?t2x", 0x66808000, 0xff808080, RD_C2, 0, AL },
++{"vcmp.t", "?f2,?s2s,?t2t", 0x6c008000, 0xff8080f0, RD_C2, 0, AL },
++{"vcmp.t", "?f1,?s2s", 0x6c008000, 0xffff80f0, RD_C2, 0, AL },
++{"vcmp.t", "?f0", 0x6c008000, 0xfffffff0, RD_C2, 0, AL },
++{"vmin.t", "?d2d,?s2s,?t2t", 0x6d008000, 0xff808080, RD_C2, 0, AL },
++{"vmax.t", "?d2d,?s2s,?t2t", 0x6d808000, 0xff808080, RD_C2, 0, AL },
++{"vsgn.t", "?d2d,?s2s", 0xd04a8000, 0xffff8080, RD_C2, 0, AL },
++{"vcst.t", "?d2d,?a", 0xd0608000, 0xffe0ff80, RD_C2, 0, AL },
++{"vscmp.t", "?d2d,?s2s,?t2t", 0x6e808000, 0xff808080, RD_C2, 0, AL },
++{"vsge.t", "?d2d,?s2s,?t2t", 0x6f008000, 0xff808080, RD_C2, 0, AL },
++{"vslt.t", "?d2d,?s2s,?t2t", 0x6f808000, 0xff808080, RD_C2, 0, AL },
++{"vmov.t", "?d2d,?s2s", 0xd0008000, 0xffff8080, RD_C2, 0, AL },
++{"vabs.t", "?d2d,?s2w", 0xd0018000, 0xffff8080, RD_C2, 0, AL },
++{"vneg.t", "?d2d,?s2w", 0xd0028000, 0xffff8080, RD_C2, 0, AL },
++{"vsat0.t", "?d2z,?s2s", 0xd0048000, 0xffff8080, RD_C2, 0, AL },
++{"vsat1.t", "?d2z,?s2s", 0xd0058000, 0xffff8080, RD_C2, 0, AL },
++{"vzero.t", "?d2d", 0xd0068000, 0xffffff80, RD_C2, 0, AL },
++{"vone.t", "?d2d", 0xd0078000, 0xffffff80, RD_C2, 0, AL },
++{"vrcp.t", "?x2z,?s2y", 0xd0108000, 0xffff8080, RD_C2, 0, AL },
++{"vrsq.t", "?x2z,?s2y", 0xd0118000, 0xffff8080, RD_C2, 0, AL },
++{"vsin.t", "?x2z,?s2y", 0xd0128000, 0xffff8080, RD_C2, 0, AL },
++{"vcos.t", "?x2z,?s2y", 0xd0138000, 0xffff8080, RD_C2, 0, AL },
++{"vexp2.t", "?x2z,?s2y", 0xd0148000, 0xffff8080, RD_C2, 0, AL },
++{"vlog2.t", "?x2z,?s2y", 0xd0158000, 0xffff8080, RD_C2, 0, AL },
++{"vsqrt.t", "?x2z,?s2y", 0xd0168000, 0xffff8080, RD_C2, 0, AL },
++{"vasin.t", "?x2z,?s2y", 0xd0178000, 0xffff8080, RD_C2, 0, AL },
++{"vnrcp.t", "?x2z,?s2y", 0xd0188000, 0xffff8080, RD_C2, 0, AL },
++{"vnsin.t", "?x2z,?s2y", 0xd01a8000, 0xffff8080, RD_C2, 0, AL },
++{"vrexp2.t", "?x2z,?s2y", 0xd01c8000, 0xffff8080, RD_C2, 0, AL },
++{"vrndi.t", "?d2z", 0xd0218000, 0xffffff80, RD_C2, 0, AL },
++{"vrndf1.t", "?d2z", 0xd0228000, 0xffffff80, RD_C2, 0, AL },
++{"vrndf2.t", "?d2z", 0xd0238000, 0xffffff80, RD_C2, 0, AL },
++{"vocp.t", "?d2d,?s2y", 0xd0448000, 0xffff8080, RD_C2, 0, AL },
++{"vfad.t", "?d0d,?s2s", 0xd0468000, 0xffff8080, RD_C2, 0, AL },
++{"vavg.t", "?d0d,?s2s", 0xd0478000, 0xffff8080, RD_C2, 0, AL },
++{"vf2in.t", "?d2m,?s2s,?b", 0xd2008000, 0xffe08080, RD_C2, 0, AL },
++{"vf2iz.t", "?d2m,?s2s,?b", 0xd2208000, 0xffe08080, RD_C2, 0, AL },
++{"vf2iu.t", "?d2m,?s2s,?b", 0xd2408000, 0xffe08080, RD_C2, 0, AL },
++{"vf2id.t", "?d2m,?s2s,?b", 0xd2608000, 0xffe08080, RD_C2, 0, AL },
++{"vi2f.t", "?d2d,?s2w,?b", 0xd2808000, 0xffe08080, RD_C2, 0, AL },
++{"vcmov.t", "?d2d,?s2s,?e", 0, (int) M_VCMOVT, INSN_MACRO, 0, AL },
++{"vcmovt.t", "?d2d,?s2s,?e", 0xd2a08000, 0xfff88080, RD_C2, 0, AL },
++{"vcmovf.t", "?d2d,?s2s,?e", 0xd2a88000, 0xfff88080, RD_C2, 0, AL },
++{"vmmul.t", "?v6z,?s6y,?t6x", 0xf0008000, 0xff808080, RD_C2, 0, AL },
++{"vtfm3.t", "?v2z,?s6y,?t2x", 0xf1008000, 0xff808080, RD_C2, 0, AL },
++{"vhtfm3.t", "?v2z,?s6y,?t2x", 0xf1000080, 0xff808080, RD_C2, 0, AL },
++{"vmscl.t", "?x6z,?s6y,?t0x", 0xf2008000, 0xff808080, RD_C2, 0, AL },
++{"vmmov.t", "?x6z,?s6y", 0xf3808000, 0xffff8080, RD_C2, 0, AL },
++{"vmidt.t", "?d6z", 0xf3838000, 0xffffff80, RD_C2, 0, AL },
++{"vmzero.t", "?d6z", 0xf3868000, 0xffffff80, RD_C2, 0, AL },
++{"vmone.t", "?d6z", 0xf3878000, 0xffffff80, RD_C2, 0, AL },
++{"vrot.t", "?x2z,?s0y,?w", 0xf3a08000, 0xffe08080, RD_C2, 0, AL },
++{"vcrsp.t", "?d2z,?s2y,?t2x", 0xf2808000, 0xff808080, RD_C2, 0, AL },
++{"vadd.p", "?d1d,?s1s,?t1t", 0x60000080, 0xff808080, RD_C2, 0, AL },
++{"vsub.p", "?d1d,?s1s,?t1t", 0x60800080, 0xff808080, RD_C2, 0, AL },
++{"vdiv.p", "?x1z,?s1y,?t1x", 0x63800080, 0xff808080, RD_C2, 0, AL },
++{"vmul.p", "?d1d,?s1s,?t1t", 0x64000080, 0xff808080, RD_C2, 0, AL },
++{"vdot.p", "?d0d,?s1s,?t1t", 0x64800080, 0xff808080, RD_C2, 0, AL },
++{"vscl.p", "?d1d,?s1s,?t0x", 0x65000080, 0xff808080, RD_C2, 0, AL },
++{"vhdp.p", "?d0d,?s1y,?t1t", 0x66000080, 0xff808080, RD_C2, 0, AL },
++{"vdet.p", "?d0d,?s1s,?t1x", 0x67000080, 0xff808080, RD_C2, 0, AL },
++{"vcmp.p", "?f2,?s1s,?t1t", 0x6c000080, 0xff8080f0, RD_C2, 0, AL },
++{"vcmp.p", "?f1,?s1s", 0x6c000080, 0xffff80f0, RD_C2, 0, AL },
++{"vcmp.p", "?f0", 0x6c000080, 0xfffffff0, RD_C2, 0, AL },
++{"vmin.p", "?d1d,?s1s,?t1t", 0x6d000080, 0xff808080, RD_C2, 0, AL },
++{"vmax.p", "?d1d,?s1s,?t1t", 0x6d800080, 0xff808080, RD_C2, 0, AL },
++{"vsgn.p", "?d1d,?s1s", 0xd04a0080, 0xffff8080, RD_C2, 0, AL },
++{"vcst.p", "?d1d,?a", 0xd0600080, 0xffe0ff80, RD_C2, 0, AL },
++{"vscmp.p", "?d1d,?s1s,?t1t", 0x6e800080, 0xff808080, RD_C2, 0, AL },
++{"vsge.p", "?d1d,?s1s,?t1t", 0x6f000080, 0xff808080, RD_C2, 0, AL },
++{"vslt.p", "?d1d,?s1s,?t1t", 0x6f800080, 0xff808080, RD_C2, 0, AL },
++{"vus2i.p", "?d3m,?s1y", 0xd03a0080, 0xffff8080, RD_C2, 0, AL },
++{"vs2i.p", "?d3m,?s1y", 0xd03b0080, 0xffff8080, RD_C2, 0, AL },
++{"vi2us.p", "?d0m,?s1w", 0xd03e0080, 0xffff8080, RD_C2, 0, AL },
++{"vi2s.p", "?d0m,?s1w", 0xd03f0080, 0xffff8080, RD_C2, 0, AL },
++{"vmov.p", "?d1d,?s1s", 0xd0000080, 0xffff8080, RD_C2, 0, AL },
++{"vabs.p", "?d1d,?s1w", 0xd0010080, 0xffff8080, RD_C2, 0, AL },
++{"vneg.p", "?d1d,?s1w", 0xd0020080, 0xffff8080, RD_C2, 0, AL },
++{"vidt.p", "?d1d", 0xd0030080, 0xffffff80, RD_C2, 0, AL },
++{"vsat0.p", "?d1z,?s1s", 0xd0040080, 0xffff8080, RD_C2, 0, AL },
++{"vsat1.p", "?d1z,?s1s", 0xd0050080, 0xffff8080, RD_C2, 0, AL },
++{"vzero.p", "?d1d", 0xd0060080, 0xffffff80, RD_C2, 0, AL },
++{"vone.p", "?d1d", 0xd0070080, 0xffffff80, RD_C2, 0, AL },
++{"vrcp.p", "?x1z,?s1y", 0xd0100080, 0xffff8080, RD_C2, 0, AL },
++{"vrsq.p", "?x1z,?s1y", 0xd0110080, 0xffff8080, RD_C2, 0, AL },
++{"vsin.p", "?x1z,?s1y", 0xd0120080, 0xffff8080, RD_C2, 0, AL },
++{"vcos.p", "?x1z,?s1y", 0xd0130080, 0xffff8080, RD_C2, 0, AL },
++{"vexp2.p", "?x1z,?s1y", 0xd0140080, 0xffff8080, RD_C2, 0, AL },
++{"vlog2.p", "?x1z,?s1y", 0xd0150080, 0xffff8080, RD_C2, 0, AL },
++{"vsqrt.p", "?x1z,?s1y", 0xd0160080, 0xffff8080, RD_C2, 0, AL },
++{"vasin.p", "?x1z,?s1y", 0xd0170080, 0xffff8080, RD_C2, 0, AL },
++{"vnrcp.p", "?x1z,?s1y", 0xd0180080, 0xffff8080, RD_C2, 0, AL },
++{"vnsin.p", "?x1z,?s1y", 0xd01a0080, 0xffff8080, RD_C2, 0, AL },
++{"vrexp2.p", "?x1z,?s1y", 0xd01c0080, 0xffff8080, RD_C2, 0, AL },
++{"vrndi.p", "?d1z", 0xd0210080, 0xffffff80, RD_C2, 0, AL },
++{"vrndf1.p", "?d1z", 0xd0220080, 0xffffff80, RD_C2, 0, AL },
++{"vrndf2.p", "?d1z", 0xd0230080, 0xffffff80, RD_C2, 0, AL },
++{"vf2h.p", "?d0m,?s1s", 0xd0320080, 0xffff8080, RD_C2, 0, AL },
++{"vh2f.p", "?d3d,?s1y", 0xd0330080, 0xffff8080, RD_C2, 0, AL },
++{"vbfy1.p", "?d1d,?s1s", 0xd0420080, 0xffff8080, RD_C2, 0, AL },
++{"vocp.p", "?d1d,?s1y", 0xd0440080, 0xffff8080, RD_C2, 0, AL },
++{"vsocp.p", "?d3z,?s1y", 0xd0450080, 0xffff8080, RD_C2, 0, AL },
++{"vfad.p", "?d0d,?s1s", 0xd0460080, 0xffff8080, RD_C2, 0, AL },
++{"vavg.p", "?d0d,?s1s", 0xd0470080, 0xffff8080, RD_C2, 0, AL },
++{"vf2in.p", "?d1m,?s1s,?b", 0xd2000080, 0xffe08080, RD_C2, 0, AL },
++{"vf2iz.p", "?d1m,?s1s,?b", 0xd2200080, 0xffe08080, RD_C2, 0, AL },
++{"vf2iu.p", "?d1m,?s1s,?b", 0xd2400080, 0xffe08080, RD_C2, 0, AL },
++{"vf2id.p", "?d1m,?s1s,?b", 0xd2600080, 0xffe08080, RD_C2, 0, AL },
++{"vi2f.p", "?d1d,?s1w,?b", 0xd2800080, 0xffe08080, RD_C2, 0, AL },
++{"vcmov.p", "?d1d,?s1s,?e", 0, (int) M_VCMOVP, INSN_MACRO, 0, AL },
++{"vcmovt.p", "?d1d,?s1s,?e", 0xd2a00080, 0xfff88080, RD_C2, 0, AL },
++{"vcmovf.p", "?d1d,?s1s,?e", 0xd2a80080, 0xfff88080, RD_C2, 0, AL },
++{"vmmul.p", "?v5z,?s5y,?t5x", 0xf0000080, 0xff808080, RD_C2, 0, AL },
++{"vtfm2.p", "?v1z,?s5y,?t1x", 0xf0800080, 0xff808080, RD_C2, 0, AL },
++{"vhtfm2.p", "?v1z,?s5y,?t1x", 0xf0800000, 0xff808080, RD_C2, 0, AL },
++{"vmscl.p", "?x5z,?s5y,?t0x", 0xf2000080, 0xff808080, RD_C2, 0, AL },
++{"vmmov.p", "?x5z,?s5y", 0xf3800080, 0xffff8080, RD_C2, 0, AL },
++{"vmidt.p", "?d5z", 0xf3830080, 0xffffff80, RD_C2, 0, AL },
++{"vmzero.p", "?d5z", 0xf3860080, 0xffffff80, RD_C2, 0, AL },
++{"vmone.p", "?d5z", 0xf3870080, 0xffffff80, RD_C2, 0, AL },
++{"vrot.p", "?x1z,?s0y,?w", 0xf3a00080, 0xffe08080, RD_C2, 0, AL },
++{"vadd.s", "?d0d,?s0s,?t0t", 0x60000000, 0xff808080, RD_C2, 0, AL },
++{"vsub.s", "?d0d,?s0s,?t0t", 0x60800000, 0xff808080, RD_C2, 0, AL },
++{"vdiv.s", "?x0d,?s0s,?t0t", 0x63800000, 0xff808080, RD_C2, 0, AL },
++{"vmul.s", "?d0d,?s0s,?t0t", 0x64000000, 0xff808080, RD_C2, 0, AL },
++{"vcmp.s", "?f2,?s0s,?t0t", 0x6c000000, 0xff8080f0, RD_C2, 0, AL },
++{"vcmp.s", "?f1,?s0s", 0x6c000000, 0xffff80f0, RD_C2, 0, AL },
++{"vcmp.s", "?f0", 0x6c000000, 0xfffffff0, RD_C2, 0, AL },
++{"vmin.s", "?d0d,?s0s,?t0t", 0x6d000000, 0xff808080, RD_C2, 0, AL },
++{"vmax.s", "?d0d,?s0s,?t0t", 0x6d800000, 0xff808080, RD_C2, 0, AL },
++{"vsgn.s", "?d0d,?s0s", 0xd04a0000, 0xffff8080, RD_C2, 0, AL },
++{"vcst.s", "?d0d,?a", 0xd0600000, 0xffe0ff80, RD_C2, 0, AL },
++{"vscmp.s", "?d0d,?s0s,?t0t", 0x6e800000, 0xff808080, RD_C2, 0, AL },
++{"vsge.s", "?d0d,?s0s,?t0t", 0x6f000000, 0xff808080, RD_C2, 0, AL },
++{"vslt.s", "?d0d,?s0s,?t0t", 0x6f800000, 0xff808080, RD_C2, 0, AL },
++{"vus2i.s", "?d1m,?s0y", 0xd03a0000, 0xffff8080, RD_C2, 0, AL },
++{"vs2i.s", "?d1m,?s0y", 0xd03b0000, 0xffff8080, RD_C2, 0, AL },
++{"vmov.s", "?d0d,?s0s", 0xd0000000, 0xffff8080, RD_C2, 0, AL },
++{"vabs.s", "?d0d,?s0w", 0xd0010000, 0xffff8080, RD_C2, 0, AL },
++{"vneg.s", "?d0d,?s0w", 0xd0020000, 0xffff8080, RD_C2, 0, AL },
++{"vsat0.s", "?d0z,?s0s", 0xd0040000, 0xffff8080, RD_C2, 0, AL },
++{"vsat1.s", "?d0z,?s0s", 0xd0050000, 0xffff8080, RD_C2, 0, AL },
++{"vzero.s", "?d0d", 0xd0060000, 0xffffff80, RD_C2, 0, AL },
++{"vone.s", "?d0d", 0xd0070000, 0xffffff80, RD_C2, 0, AL },
++{"vrcp.s", "?x0d,?s0s", 0xd0100000, 0xffff8080, RD_C2, 0, AL },
++{"vrsq.s", "?x0d,?s0s", 0xd0110000, 0xffff8080, RD_C2, 0, AL },
++{"vsin.s", "?x0d,?s0s", 0xd0120000, 0xffff8080, RD_C2, 0, AL },
++{"vcos.s", "?x0d,?s0s", 0xd0130000, 0xffff8080, RD_C2, 0, AL },
++{"vexp2.s", "?x0d,?s0s", 0xd0140000, 0xffff8080, RD_C2, 0, AL },
++{"vlog2.s", "?x0d,?s0s", 0xd0150000, 0xffff8080, RD_C2, 0, AL },
++{"vsqrt.s", "?x0d,?s0s", 0xd0160000, 0xffff8080, RD_C2, 0, AL },
++{"vasin.s", "?x0d,?s0s", 0xd0170000, 0xffff8080, RD_C2, 0, AL },
++{"vnrcp.s", "?x0d,?s0y", 0xd0180000, 0xffff8080, RD_C2, 0, AL },
++{"vnsin.s", "?x0d,?s0y", 0xd01a0000, 0xffff8080, RD_C2, 0, AL },
++{"vrexp2.s", "?x0d,?s0y", 0xd01c0000, 0xffff8080, RD_C2, 0, AL },
++{"vrnds.s", "?s0y", 0xd0200000, 0xffff80ff, RD_C2, 0, AL },
++{"vrndi.s", "?d0d", 0xd0210000, 0xffffff80, RD_C2, 0, AL },
++{"vrndf1.s", "?d0d", 0xd0220000, 0xffffff80, RD_C2, 0, AL },
++{"vrndf2.s", "?d0d", 0xd0230000, 0xffffff80, RD_C2, 0, AL },
++{"vh2f.s", "?d1d,?s0y", 0xd0330000, 0xffff8080, RD_C2, 0, AL },
++{"vsbz.s", "?d0d,?s0s", 0xd0360000, 0xffff8080, RD_C2, 0, AL },
++{"vsbn.s", "?d0d,?s0s,?t0t", 0x61000000, 0xff808080, RD_C2, 0, AL },
++{"vlgb.s", "?d0d,?s0s", 0xd0370000, 0xffff8080, RD_C2, 0, AL },
++{"vocp.s", "?d0d,?s0y", 0xd0440000, 0xffff8080, RD_C2, 0, AL },
++{"vsocp.s", "?d1z,?s0y", 0xd0450000, 0xffff8080, RD_C2, 0, AL },
++{"vf2in.s", "?d0m,?s0s,?b", 0xd2000000, 0xffe08080, RD_C2, 0, AL },
++{"vf2iz.s", "?d0m,?s0s,?b", 0xd2200000, 0xffe08080, RD_C2, 0, AL },
++{"vf2iu.s", "?d0m,?s0s,?b", 0xd2400000, 0xffe08080, RD_C2, 0, AL },
++{"vf2id.s", "?d0m,?s0s,?b", 0xd2600000, 0xffe08080, RD_C2, 0, AL },
++{"vi2f.s", "?d0d,?s0w,?b", 0xd2800000, 0xffe08080, RD_C2, 0, AL },
++{"vcmov.s", "?d0d,?s0s,?e", 0, (int) M_VCMOVS, INSN_MACRO, 0, AL },
++{"vcmovt.s", "?d0d,?s0s,?e", 0xd2a00000, 0xfff88080, RD_C2, 0, AL },
++{"vcmovf.s", "?d0d,?s0s,?e", 0xd2a80000, 0xfff88080, RD_C2, 0, AL },
++{"vwbn.s", "?d0d,?s0s,?i", 0xd3000000, 0xff008080, RD_C2, 0, AL },
++{"vpfxs", "?0,?1,?2,?3", 0xdc000000, 0xff000000, RD_C2, 0, AL },
++{"vpfxt", "?0,?1,?2,?3", 0xdd000000, 0xff000000, RD_C2, 0, AL },
++{"vpfxd", "?4,?5,?6,?7", 0xde000000, 0xff000000, RD_C2, 0, AL },
++{"viim.s", "?t0d,j", 0xdf000000, 0xff800000, RD_C2, 0, AL },
++{"vfim.s", "?t0d,?u", 0xdf800000, 0xff800000, RD_C2, 0, AL },
++{"vnop", "", 0xffff0000, 0xffffffff, RD_C2, 0, AL },
++{"vflush", "", 0xffff040d, 0xffffffff, RD_C2, 0, AL },
++{"vsync", "", 0xffff0320, 0xffffffff, RD_C2, 0, AL },
++{"vsync", "i", 0xffff0000, 0xffff0000, RD_C2, 0, AL },
++
+ /* Coprocessor 2 move/branch operations overlap with VR5400 .ob format
+ instructions so they are here for the latters to take precedence. */
+ {"bc2f", "p", 0x49000000, 0xffff0000, CBD|RD_CC, 0, I1 },
+@@ -1282,6 +1589,36 @@
+ {"mtc2", "t,G,H", 0x48800000, 0xffe007f8, COD|RD_t|WR_C2|WR_CC, 0, I32 },
+ {"mthc2", "t,i", 0x48e00000, 0xffe00000, COD|RD_t|WR_C2|WR_CC, 0, I33 },
+
++/* Coprocessor 2 load/store operations overlap with the Allegrex VFPU
++ instructions so they are here for the latters to take precedence. */
++/* COP1 ldc1 and sdc1 and COP3 ldc3 and sdc3 also overlap with the VFPU. */
++{"ldc1", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 },
++{"ldc1", "E,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 },
++{"ldc1", "T,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, 0, I2 },
++{"ldc1", "E,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, 0, I2 },
++{"l.d", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, 0, I2 }, /* ldc1 */
++{"l.d", "T,o(b)", 0, (int) M_L_DOB, INSN_MACRO, 0, I1 },
++{"l.d", "T,A(b)", 0, (int) M_L_DAB, INSN_MACRO, 0, I1 },
++{"ldc2", "E,o(b)", 0xd8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 },
++{"ldc2", "E,A(b)", 0, (int) M_LDC2_AB, INSN_MACRO, 0, I2 },
++{"ldc3", "E,o(b)", 0xdc000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I2 },
++{"ldc3", "E,A(b)", 0, (int) M_LDC3_AB, INSN_MACRO, 0, I2 },
++{"lwc2", "E,o(b)", 0xc8000000, 0xfc000000, CLD|RD_b|WR_CC, 0, I1 },
++{"lwc2", "E,A(b)", 0, (int) M_LWC2_AB, INSN_MACRO, 0, I1 },
++{"sdc1", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 },
++{"sdc1", "E,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 },
++{"sdc1", "T,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, 0, I2 },
++{"sdc1", "E,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, 0, I2 },
++{"s.d", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, 0, I2 },
++{"s.d", "T,o(b)", 0, (int) M_S_DOB, INSN_MACRO, 0, I1 },
++{"s.d", "T,A(b)", 0, (int) M_S_DAB, INSN_MACRO, 0, I1 },
++{"sdc2", "E,o(b)", 0xf8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I2 },
++{"sdc2", "E,A(b)", 0, (int) M_SDC2_AB, INSN_MACRO, 0, I2 },
++{"sdc3", "E,o(b)", 0xfc000000, 0xfc000000, SM|RD_C3|RD_b, 0, I2 },
++{"sdc3", "E,A(b)", 0, (int) M_SDC3_AB, INSN_MACRO, 0, I2 },
++{"swc2", "E,o(b)", 0xe8000000, 0xfc000000, SM|RD_C2|RD_b, 0, I1 },
++{"swc2", "E,A(b)", 0, (int) M_SWC2_AB, INSN_MACRO, 0, I1 },
++
+ /* No hazard protection on coprocessor instructions--they shouldn't
+ change the state of the processor and if they do it's up to the
+ user to put in nops as necessary. These are at the end so that the
diff --git a/devel/psptoolchain-gdb/pkg-descr b/devel/psptoolchain-gdb/pkg-descr
new file mode 100644
index 000000000000..ebd84fb39295
--- /dev/null
+++ b/devel/psptoolchain-gdb/pkg-descr
@@ -0,0 +1,4 @@
+The PlayStation Portable Toolchain is a collection of tools and utilities
+for homebrew PSP development.
+
+WWW: http://www.ps2dev.org
diff --git a/devel/psptoolchain-gdb/pkg-plist b/devel/psptoolchain-gdb/pkg-plist
new file mode 100644
index 000000000000..4afdc9c9f75a
--- /dev/null
+++ b/devel/psptoolchain-gdb/pkg-plist
@@ -0,0 +1,6 @@
+lib/libpsp-sim.a
+bin/psp-run
+bin/psp-gdbtui
+bin/psp-gdb
+@dirrmtry psp/lib
+@dirrmtry psp
diff --git a/devel/psptoolchain-newlib/Makefile b/devel/psptoolchain-newlib/Makefile
new file mode 100644
index 000000000000..5d97fedc9af4
--- /dev/null
+++ b/devel/psptoolchain-newlib/Makefile
@@ -0,0 +1,41 @@
+# New ports collection makefile for: psptoolchain-newlib
+# Date created: 13 February 2009
+# Whom: Tassilo Philipp <tphilipp@potion-studios.com>
+#
+# $FreeBSD$
+#
+
+PORTNAME= newlib
+PORTVERSION= 1.15.0
+CATEGORIES= devel
+MASTER_SITES= ftp://sources.redhat.com/pub/ \
+ ${MASTER_SITE_SOURCEWARE}
+MASTER_SITE_SUBDIR= ${PORTNAME}
+PKGNAMEPREFIX= psptoolchain-
+
+MAINTAINER= tphilipp@potion-studios.com
+COMMENT= PlayStation Portable development toolchain ${PORTNAME}
+
+PSP_GCC_STAGE_PREFIX= psp/stage1
+PSP_SDK_STAGE_PREFIX= psp/stage1
+
+BUILD_DEPENDS+= ${PREFIX}/${PSP_SDK_STAGE_PREFIX}/sdk/include/pspsdk.h:${PORTSDIR}/devel/psptoolchain-pspsdk-stage1 \
+ psp-ar:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-as:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-ld:${PORTSDIR}/devel/psptoolchain-binutils \
+ ${PREFIX}/${PSP_GCC_STAGE_PREFIX}/bin/psp-gcc:${PORTSDIR}/devel/psptoolchain-gcc-stage1
+
+USE_GMAKE= yes
+
+HAS_CONFIGURE= yes
+CONFIGURE_ENV= PATH=${PREFIX}/${PSP_GCC_STAGE_PREFIX}/bin:${PATH}
+MAKE_ENV= PATH=${PREFIX}/${PSP_GCC_STAGE_PREFIX}/bin:${PATH}
+CONFIGURE_ARGS= --prefix=${PREFIX} --target=psp
+MAKE_ARGS+= CC="${CC}" CFLAGS="${CFLAGS} -g" # Apparently, it doesn't work on the PSP without debug information
+
+# Disable installation of .info files and fix includedir reference.
+post-patch:
+ @${REINPLACE_CMD} -E 's/^(install:.*)(install-info.*)/\1#\2/' ${WRKSRC}/etc/Makefile.in
+ @${REINPLACE_CMD} -E 's#(-I\$${prefix}/)psp(/sdk/include)#\1${PSP_SDK_STAGE_PREFIX:S,/,\\/,}\2#' ${WRKSRC}/newlib/configure.host
+
+.include <bsd.port.mk>
diff --git a/devel/psptoolchain-newlib/distinfo b/devel/psptoolchain-newlib/distinfo
new file mode 100644
index 000000000000..6c0ae7541577
--- /dev/null
+++ b/devel/psptoolchain-newlib/distinfo
@@ -0,0 +1,3 @@
+MD5 (newlib-1.15.0.tar.gz) = 4020004b1b7a56ca4cf7f6d35b40a4cb
+SHA256 (newlib-1.15.0.tar.gz) = c4496102d38c59d1a47ddd5481af35caa1f65b76e2a94d9607737e17fd9e4465
+SIZE (newlib-1.15.0.tar.gz) = 10709842
diff --git a/devel/psptoolchain-newlib/files/patch-config.sub b/devel/psptoolchain-newlib/files/patch-config.sub
new file mode 100644
index 000000000000..fcde31b0a3e6
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-config.sub
@@ -0,0 +1,29 @@
+--- config.sub.orig 2006-12-11 06:12:46.000000000 +0200
++++ config.sub 2007-06-01 12:22:26.000000000 +0300
+@@ -267,6 +267,7 @@
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
++ | mipsallegrex | mipsallegrexel \
+ | mn10200 | mn10300 \
+ | mt \
+ | msp430 \
+@@ -348,6 +349,7 @@
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
++ | mipsallegrex-* | mipsallegrexel-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+@@ -690,6 +692,10 @@
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
++ psp)
++ basic_machine=mipsallegrexel-psp
++ os=-elf
++ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
diff --git a/devel/psptoolchain-newlib/files/patch-configure b/devel/psptoolchain-newlib/files/patch-configure
new file mode 100644
index 000000000000..6c1fc6241f6f
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-configure
@@ -0,0 +1,12 @@
+--- configure.orig 2006-12-12 03:38:04.000000000 +0200
++++ configure 2007-06-01 12:22:26.000000000 +0300
+@@ -1561,6 +1561,9 @@
+ mips*-*-linux*)
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ ;;
++ mipsallegrex*-*-*)
++ noconfigdirs="$noconfigdirs target-libgloss"
++ ;;
+ mips*-*-*)
+ noconfigdirs="$noconfigdirs gprof ${libgcj}"
+ ;;
diff --git a/devel/psptoolchain-newlib/files/patch-configure.in b/devel/psptoolchain-newlib/files/patch-configure.in
new file mode 100644
index 000000000000..c4d4423c9392
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-configure.in
@@ -0,0 +1,12 @@
+--- configure.in.orig 2006-12-12 03:38:04.000000000 +0200
++++ configure.in 2007-06-01 12:22:26.000000000 +0300
+@@ -737,6 +737,9 @@
+ mips*-*-linux*)
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+ ;;
++ mipsallegrex*-*-*)
++ noconfigdirs="$noconfigdirs target-libgloss"
++ ;;
+ mips*-*-*)
+ noconfigdirs="$noconfigdirs gprof ${libgcj}"
+ ;;
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-Makefile.am b/devel/psptoolchain-newlib/files/patch-newlib-Makefile.am
new file mode 100644
index 000000000000..1e620d228d53
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-Makefile.am
@@ -0,0 +1,21 @@
+--- newlib/Makefile.am.orig 2006-06-05 20:42:57.000000000 +0300
++++ newlib/Makefile.am 2007-06-01 12:22:26.000000000 +0300
+@@ -267,6 +267,18 @@
+ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/machine/`basename $$i`; \
+ else true; fi ; \
+ done; \
++ $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/netinet; \
++ for i in $(srcdir)/libc/sys/$(sys_dir)/netinet/*.h; do \
++ if [ -f $$i ]; then \
++ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/netinet/`basename $$i`; \
++ else true; fi ; \
++ done ; \
++ $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/arpa; \
++ for i in $(srcdir)/libc/sys/$(sys_dir)/arpa/*.h; do \
++ if [ -f $$i ]; then \
++ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/arpa/`basename $$i`; \
++ else true; fi ; \
++ done ; \
+ $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/sys; \
+ for i in $(srcdir)/libc/include/sys/*.h; do \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/sys/`basename $$i`; \
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-Makefile.in b/devel/psptoolchain-newlib/files/patch-newlib-Makefile.in
new file mode 100644
index 000000000000..0e4e3f7a76b2
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-Makefile.in
@@ -0,0 +1,21 @@
+--- newlib/Makefile.in.orig 2006-12-18 22:32:41.000000000 +0200
++++ newlib/Makefile.in 2007-06-01 12:22:26.000000000 +0300
+@@ -912,6 +912,18 @@
+ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/machine/`basename $$i`; \
+ else true; fi ; \
+ done; \
++ $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/netinet; \
++ for i in $(srcdir)/libc/sys/$(sys_dir)/netinet/*.h; do \
++ if [ -f $$i ]; then \
++ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/netinet/`basename $$i`; \
++ else true; fi ; \
++ done ; \
++ $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/arpa; \
++ for i in $(srcdir)/libc/sys/$(sys_dir)/arpa/*.h; do \
++ if [ -f $$i ]; then \
++ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/arpa/`basename $$i`; \
++ else true; fi ; \
++ done ; \
+ $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/sys; \
+ for i in $(srcdir)/libc/include/sys/*.h; do \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/sys/`basename $$i`; \
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-configure.host b/devel/psptoolchain-newlib/files/patch-newlib-configure.host
new file mode 100644
index 000000000000..51abda18cb88
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-configure.host
@@ -0,0 +1,27 @@
+--- newlib/configure.host.orig 2006-12-18 23:49:14.000000000 +0200
++++ newlib/configure.host 2007-06-01 12:22:26.000000000 +0300
+@@ -510,7 +510,7 @@
+ # NOTE: When newlib malloc uses a semaphore, RTEMS will switch to that.
+ *-*-rtems*)
+ default_newlib_io_long_long="yes"
+- newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED -DEXIT_PROVIDED -DMISSING_SYSCALL_NAMES -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_OPENDIR -DNO_EXEC -DHAVE_FCNTL"
++ newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED -DEXIT_PROVIDED -DMISSING_SYSCALL_NAMES -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_OPENDIR -DNO_EXEC -DHAVE_FCNTL -DHAVE_RENAME -DHAVE_NANOSLEEP"
+ ;;
+ # VxWorks supplies its own version of malloc, and the newlib one
+ # doesn't work because VxWorks does not have sbrk.
+@@ -632,7 +632,14 @@
+ ;;
+ mips*-*-elf*)
+ default_newlib_io_long_long="yes"
+- newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES"
++ case "${host}" in
++ mipsallegrex*-psp-*)
++ sys_dir=psp
++ syscall_dir=syscalls
++ newlib_cflags="${newlib_cflags} -G0 -mno-explicit-relocs -DCOMPACT_CTYPE -DCLOCK_PROVIDED -DHAVE_FCNTL -DMALLOC_ALIGNMENT=16 -I${prefix}/psp/sdk/include" ;;
++ *)
++ newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES" ;;
++ esac
+ ;;
+ mmix-*)
+ syscall_dir=syscalls
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-include-machine-time.h b/devel/psptoolchain-newlib/files/patch-newlib-libc-include-machine-time.h
new file mode 100644
index 000000000000..91e9bdf2fc6b
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-include-machine-time.h
@@ -0,0 +1,13 @@
+--- newlib/libc/include/machine/time.h.orig 2000-12-04 21:06:37.000000000 +0200
++++ newlib/libc/include/machine/time.h 2007-06-01 12:22:26.000000000 +0300
+@@ -9,6 +9,10 @@
+ #endif
+ #endif /* !__rtems__ */
+
++#if defined(__psp__)
++#define _CLOCKS_PER_SEC_ 1000000
++#endif
++
+ #endif /* _MACHTIME_H_ */
+
+
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-include-sys-config.h b/devel/psptoolchain-newlib/files/patch-newlib-libc-include-sys-config.h
new file mode 100644
index 000000000000..029d9e8373f2
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-include-sys-config.h
@@ -0,0 +1,15 @@
+--- newlib/libc/include/sys/config.h.orig 2006-08-30 00:00:59.000000000 +0300
++++ newlib/libc/include/sys/config.h 2007-06-01 12:22:26.000000000 +0300
+@@ -98,6 +98,12 @@
+ #define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
+ #endif
+
++/* We compile newlib with -G0 for PSP, but if we're compiling an app with $gp enabled,
++ then _impure_ptr is expected to live in .sdata. */
++#if defined(__psp__)
++#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
++#endif
++
+ #ifdef __xstormy16__
+ #define __SMALL_BITFIELDS
+ #undef INT_MAX
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-include-sys-types.h b/devel/psptoolchain-newlib/files/patch-newlib-libc-include-sys-types.h
new file mode 100644
index 000000000000..a7fd1bfb5a31
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-include-sys-types.h
@@ -0,0 +1,55 @@
+--- newlib/libc/include/sys/types.h.orig 2006-09-14 01:09:27.000000000 +0300
++++ newlib/libc/include/sys/types.h 2007-06-01 12:22:26.000000000 +0300
+@@ -199,52 +199,6 @@
+
+ typedef unsigned short nlink_t;
+
+-/* We don't define fd_set and friends if we are compiling POSIX
+- source, or if we have included (or may include as indicated
+- by __USE_W32_SOCKETS) the W32api winsock[2].h header which
+- defines Windows versions of them. Note that a program which
+- includes the W32api winsock[2].h header must know what it is doing;
+- it must not call the cygwin32 select function.
+-*/
+-# if !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (__USE_W32_SOCKETS))
+-# define _SYS_TYPES_FD_SET
+-# define NBBY 8 /* number of bits in a byte */
+-/*
+- * Select uses bit masks of file descriptors in longs.
+- * These macros manipulate such bit fields (the filesystem macros use chars).
+- * FD_SETSIZE may be defined by the user, but the default here
+- * should be >= NOFILE (param.h).
+- */
+-# ifndef FD_SETSIZE
+-# define FD_SETSIZE 64
+-# endif
+-
+-typedef long fd_mask;
+-# define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */
+-# ifndef howmany
+-# define howmany(x,y) (((x)+((y)-1))/(y))
+-# endif
+-
+-/* We use a macro for fd_set so that including Sockets.h afterwards
+- can work. */
+-typedef struct _types_fd_set {
+- fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
+-} _types_fd_set;
+-
+-#define fd_set _types_fd_set
+-
+-# define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS)))
+-# define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS)))
+-# define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS)))
+-# define FD_ZERO(p) (__extension__ (void)({ \
+- size_t __i; \
+- char *__tmp = (char *)p; \
+- for (__i = 0; __i < sizeof (*(p)); ++__i) \
+- *__tmp++ = 0; \
+-}))
+-
+-# endif /* !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (__USE_W32_SOCKETS)) */
+-
+ #undef __MS_types__
+ #undef _ST_INT32
+
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-include-time.h b/devel/psptoolchain-newlib/files/patch-newlib-libc-include-time.h
new file mode 100644
index 000000000000..646988d7472c
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-include-time.h
@@ -0,0 +1,19 @@
+--- newlib/libc/include/time.h.orig 2005-11-18 17:57:24.000000000 +0200
++++ newlib/libc/include/time.h 2007-06-01 12:22:26.000000000 +0300
+@@ -174,6 +174,16 @@
+ }
+ #endif
+ #endif /* _POSIX_TIMERS */
++#if defined(__psp__)
++#ifdef __cplusplus
++extern "C" {
++#endif
++int _EXFUN(nanosleep, (const struct timespec *rqtp, struct timespec *rmtp));
++#ifdef __cplusplus
++}
++#endif
++#endif /* __psp__ */
++
+
+ #ifdef __cplusplus
+ extern "C" {
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-configure b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-configure
new file mode 100644
index 000000000000..9c73bd8af27d
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-configure
@@ -0,0 +1,21 @@
+--- newlib/libc/sys/configure.orig 2006-12-19 00:21:54.000000000 +0200
++++ newlib/libc/sys/configure 2007-06-01 12:22:26.000000000 +0300
+@@ -284,6 +284,7 @@
+ ac_subdirs_all="$ac_subdirs_all mmixware"
+ ac_subdirs_all="$ac_subdirs_all netware"
+ ac_subdirs_all="$ac_subdirs_all rdos"
++ac_subdirs_all="$ac_subdirs_all psp"
+ ac_subdirs_all="$ac_subdirs_all rtems"
+ ac_subdirs_all="$ac_subdirs_all sh"
+ ac_subdirs_all="$ac_subdirs_all sparc64"
+@@ -4925,6 +4926,10 @@
+
+ subdirs="$subdirs netware"
+ ;;
++ psp)
++
++subdirs="$subdirs psp"
++ ;;
+ rdos)
+
+ subdirs="$subdirs rdos"
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-configure.in b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-configure.in
new file mode 100644
index 000000000000..c987db3d800a
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-configure.in
@@ -0,0 +1,10 @@
+--- newlib/libc/sys/configure.in.orig 2006-04-13 22:56:27.000000000 +0300
++++ newlib/libc/sys/configure.in 2007-06-01 12:22:26.000000000 +0300
+@@ -32,6 +32,7 @@
+ mmixware) AC_CONFIG_SUBDIRS(mmixware) ;;
+ netware) AC_CONFIG_SUBDIRS(netware) ;;
+ rdos) AC_CONFIG_SUBDIRS(rdos) ;;
++ psp) AC_CONFIG_SUBDIRS(psp) ;;
+ rtems) AC_CONFIG_SUBDIRS(rtems) ;;
+ sh) AC_CONFIG_SUBDIRS(sh) ;;
+ sparc64) AC_CONFIG_SUBDIRS(sparc64) ;;
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-Makefile.am b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-Makefile.am
new file mode 100644
index 000000000000..a925ce40b979
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-Makefile.am
@@ -0,0 +1,74 @@
+--- newlib/libc/sys/psp/Makefile.am.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/Makefile.am 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,71 @@
++## Process this file with automake to generate Makefile.in
++
++AUTOMAKE_OPTIONS = cygnus
++
++INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
++
++AM_CCASFLAGS = $(INCLUDES) $(CFLAGS)
++
++noinst_LIBRARIES = lib.a
++
++LIBCGLUE_MULT_OBJS = _close.o _exit.o _fork.o _fstat.o _getpid.o \
++ _gettimeofday.o _kill.o _lseek.o _open.o _read.o \
++ _sbrk.o _wait.o _write.o clock.o isatty.o time.o \
++ _link.o _unlink.o sleep.o opendir.o readdir.o \
++ closedir.o getcwd.o chdir.o mkdir.o rmdir.o \
++ realpath.o _stat.o truncate.o access.o tzset.o \
++ __psp_set_errno.o mlock.o _fcntl.o _rename.o nanosleep.o
++
++SOCKET_MULT_OBJS = socket.o accept.o bind.o connect.o getsockopt.o \
++ listen.o recv.o recvfrom.o send.o sendto.o \
++ setsockopt.o shutdown.o getsockname.o getpeername.o \
++ inet_ntoa.o
++
++PE_OBJS = pipe.o
++
++FDMAN_OBJS = fdman.o
++
++SELECT_OBJS = select.o
++
++INTERRUPT_OBJS = interrupt.o
++
++XPRINTF_MULT_OBJS = vxprintf.o _xprintf.o __sout.o vsnprintf.o snprintf.o \
++ vsprintf.o sprintf.o __mout.o mprintf.o vmprintf.o asprintf.o \
++ vasprintf.o __fout.o fprintf.o vfprintf.o printf.o vprintf.o \
++ _sprintf_r.o
++
++NETDB_MULT_OBJS = h_errno.o gethostbyaddr.o gethostbyname.o
++
++
++lib_a_SOURCES = libcglue.c socket.c pspcwd.c xprintf.c netdb.c pipe.c fdman.c select.c syscalls.c interrupt.S
++lib_a_LIBADD = $(LIBCGLUE_MULT_OBJS) $(SOCKET_MULT_OBJS) $(XPRINTF_MULT_OBJS) \
++ $(NETDB_MULT_OBJS) $(PIPE_OBJS) $(FDMAN_OBJS) $(SELECT_OBJS) $(INTERRUPT_OBJS)
++
++all: crt0.o
++
++$(LIBCGLUE_MULT_OBJS): libcglue.c
++ $(COMPILE) -DF_$* $< -c -o $@
++
++$(SOCKET_MULT_OBJS): socket.c
++ $(COMPILE) -DF_$* $< -c -o $@
++
++$(XPRINTF_MULT_OBJS): xprintf.c
++ $(COMPILE) -DF_$* $< -c -o $@
++
++$(NETDB_MULT_OBJS): netdb.c
++ $(COMPILE) -DF_$* $< -c -o $@
++
++$(PIPE_OBJS): pipe.c
++ $(COMPILE) -DF_$* $< -c -o $@
++
++$(FDMAN_OBJS): fdman.c
++ $(COMPILE) -DF_$* $< -c -o $@
++
++$(SELECT_OBJS): select.c
++ $(COMPILE) -DF_$* $< -c -o $@
++
++$(INTERRUPT_OBJS): interrupt.S
++ $(COMPILE) -DF_$* $< -c -o $@
++
++ACLOCAL_AMFLAGS = -I ../../..
++CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-Makefile.in b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-Makefile.in
new file mode 100644
index 000000000000..67dbe0341be6
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-Makefile.in
@@ -0,0 +1,467 @@
+--- newlib/libc/sys/psp/Makefile.in.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/Makefile.in 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,464 @@
++# Makefile.in generated by automake 1.9.6 from Makefile.am.
++# @configure_input@
++
++# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
++# 2003, 2004, 2005 Free Software Foundation, Inc.
++# This Makefile.in is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
++# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
++# PARTICULAR PURPOSE.
++
++@SET_MAKE@
++
++srcdir = @srcdir@
++top_srcdir = @top_srcdir@
++VPATH = @srcdir@
++pkgdatadir = $(datadir)/@PACKAGE@
++pkglibdir = $(libdir)/@PACKAGE@
++pkgincludedir = $(includedir)/@PACKAGE@
++top_builddir = .
++am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
++INSTALL = @INSTALL@
++install_sh_DATA = $(install_sh) -c -m 644
++install_sh_PROGRAM = $(install_sh) -c
++install_sh_SCRIPT = $(install_sh) -c
++INSTALL_HEADER = $(INSTALL_DATA)
++transform = $(program_transform_name)
++NORMAL_INSTALL = :
++PRE_INSTALL = :
++POST_INSTALL = :
++NORMAL_UNINSTALL = :
++PRE_UNINSTALL = :
++POST_UNINSTALL = :
++build_triplet = @build@
++host_triplet = @host@
++DIST_COMMON = $(srcdir)/../../../../config.guess \
++ $(srcdir)/../../../../config.sub README $(srcdir)/Makefile.in \
++ $(srcdir)/Makefile.am $(top_srcdir)/configure \
++ $(am__configure_deps) $(srcdir)/../../../../mkinstalldirs
++subdir = .
++ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
++am__aclocal_m4_deps = $(top_srcdir)/../../../acinclude.m4 \
++ $(top_srcdir)/configure.in
++am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
++ $(ACLOCAL_M4)
++am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
++ configure.lineno configure.status.lineno
++mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs
++CONFIG_CLEAN_FILES =
++LIBRARIES = $(noinst_LIBRARIES)
++ARFLAGS = cru
++lib_a_AR = $(AR) $(ARFLAGS)
++am__DEPENDENCIES_1 = _close.o _exit.o _fork.o _fstat.o _getpid.o \
++ _gettimeofday.o _kill.o _lseek.o _open.o _read.o _sbrk.o \
++ _wait.o _write.o clock.o isatty.o time.o _link.o _unlink.o \
++ sleep.o opendir.o readdir.o closedir.o getcwd.o chdir.o \
++ mkdir.o rmdir.o realpath.o _stat.o truncate.o access.o tzset.o \
++ __psp_set_errno.o mlock.o _fcntl.o _rename.o nanosleep.o
++am__DEPENDENCIES_2 = socket.o accept.o bind.o connect.o getsockopt.o \
++ listen.o recv.o recvfrom.o send.o sendto.o setsockopt.o \
++ shutdown.o getsockname.o getpeername.o inet_ntoa.o
++am__DEPENDENCIES_3 = vxprintf.o _xprintf.o __sout.o vsnprintf.o \
++ snprintf.o vsprintf.o sprintf.o __mout.o mprintf.o vmprintf.o \
++ asprintf.o vasprintf.o __fout.o fprintf.o vfprintf.o printf.o \
++ vprintf.o _sprintf_r.o
++am__DEPENDENCIES_4 = h_errno.o gethostbyaddr.o gethostbyname.o
++am__DEPENDENCIES_5 = fdman.o
++am__DEPENDENCIES_6 = select.o
++am__DEPENDENCIES_7 = interrupt.o
++lib_a_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \
++ $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_4) \
++ $(am__DEPENDENCIES_5) $(am__DEPENDENCIES_6) \
++ $(am__DEPENDENCIES_7)
++am_lib_a_OBJECTS = libcglue.$(OBJEXT) socket.$(OBJEXT) \
++ pspcwd.$(OBJEXT) xprintf.$(OBJEXT) netdb.$(OBJEXT) \
++ pipe.$(OBJEXT) fdman.$(OBJEXT) select.$(OBJEXT) \
++ syscalls.$(OBJEXT) interrupt.$(OBJEXT)
++lib_a_OBJECTS = $(am_lib_a_OBJECTS)
++DEFAULT_INCLUDES = -I. -I$(srcdir)
++depcomp =
++am__depfiles_maybe =
++CCASCOMPILE = $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)
++COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
++ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
++CCLD = $(CC)
++LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
++SOURCES = $(lib_a_SOURCES)
++ETAGS = etags
++CTAGS = ctags
++ACLOCAL = @ACLOCAL@
++AMDEP_FALSE = @AMDEP_FALSE@
++AMDEP_TRUE = @AMDEP_TRUE@
++AMTAR = @AMTAR@
++AR = @AR@
++AS = @AS@
++AUTOCONF = @AUTOCONF@
++AUTOHEADER = @AUTOHEADER@
++AUTOMAKE = @AUTOMAKE@
++AWK = @AWK@
++CC = @CC@
++CCAS = @CCAS@
++CCASFLAGS = @CCASFLAGS@
++CCDEPMODE = @CCDEPMODE@
++CYGPATH_W = @CYGPATH_W@
++DEFS = @DEFS@
++DEPDIR = @DEPDIR@
++ECHO_C = @ECHO_C@
++ECHO_N = @ECHO_N@
++ECHO_T = @ECHO_T@
++ELIX_LEVEL_0_FALSE = @ELIX_LEVEL_0_FALSE@
++ELIX_LEVEL_0_TRUE = @ELIX_LEVEL_0_TRUE@
++ELIX_LEVEL_1_FALSE = @ELIX_LEVEL_1_FALSE@
++ELIX_LEVEL_1_TRUE = @ELIX_LEVEL_1_TRUE@
++ELIX_LEVEL_2_FALSE = @ELIX_LEVEL_2_FALSE@
++ELIX_LEVEL_2_TRUE = @ELIX_LEVEL_2_TRUE@
++ELIX_LEVEL_3_FALSE = @ELIX_LEVEL_3_FALSE@
++ELIX_LEVEL_3_TRUE = @ELIX_LEVEL_3_TRUE@
++ELIX_LEVEL_4_FALSE = @ELIX_LEVEL_4_FALSE@
++ELIX_LEVEL_4_TRUE = @ELIX_LEVEL_4_TRUE@
++INSTALL_DATA = @INSTALL_DATA@
++INSTALL_PROGRAM = @INSTALL_PROGRAM@
++INSTALL_SCRIPT = @INSTALL_SCRIPT@
++INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
++LDFLAGS = @LDFLAGS@
++LIBOBJS = @LIBOBJS@
++LIBS = @LIBS@
++LTLIBOBJS = @LTLIBOBJS@
++MAINT = @MAINT@
++MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
++MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
++MAKEINFO = @MAKEINFO@
++MAY_SUPPLY_SYSCALLS_FALSE = @MAY_SUPPLY_SYSCALLS_FALSE@
++MAY_SUPPLY_SYSCALLS_TRUE = @MAY_SUPPLY_SYSCALLS_TRUE@
++NEWLIB_CFLAGS = @NEWLIB_CFLAGS@
++OBJEXT = @OBJEXT@
++PACKAGE = @PACKAGE@
++PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
++PACKAGE_NAME = @PACKAGE_NAME@
++PACKAGE_STRING = @PACKAGE_STRING@
++PACKAGE_TARNAME = @PACKAGE_TARNAME@
++PACKAGE_VERSION = @PACKAGE_VERSION@
++PATH_SEPARATOR = @PATH_SEPARATOR@
++RANLIB = @RANLIB@
++READELF = @READELF@
++SET_MAKE = @SET_MAKE@
++SHELL = @SHELL@
++STRIP = @STRIP@
++USE_LIBTOOL_FALSE = @USE_LIBTOOL_FALSE@
++USE_LIBTOOL_TRUE = @USE_LIBTOOL_TRUE@
++VERSION = @VERSION@
++aext = @aext@
++am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
++am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
++am__include = @am__include@
++am__leading_dot = @am__leading_dot@
++am__quote = @am__quote@
++am__tar = @am__tar@
++am__untar = @am__untar@
++bindir = @bindir@
++build = @build@
++build_alias = @build_alias@
++build_cpu = @build_cpu@
++build_os = @build_os@
++build_vendor = @build_vendor@
++datadir = @datadir@
++datarootdir = @datarootdir@
++docdir = @docdir@
++dvidir = @dvidir@
++exec_prefix = @exec_prefix@
++host = @host@
++host_alias = @host_alias@
++host_cpu = @host_cpu@
++host_os = @host_os@
++host_vendor = @host_vendor@
++htmldir = @htmldir@
++includedir = @includedir@
++infodir = @infodir@
++install_sh = @install_sh@
++libdir = @libdir@
++libexecdir = @libexecdir@
++libm_machine_dir = @libm_machine_dir@
++localedir = @localedir@
++localstatedir = @localstatedir@
++lpfx = @lpfx@
++machine_dir = @machine_dir@
++mandir = @mandir@
++mkdir_p = @mkdir_p@
++newlib_basedir = @newlib_basedir@
++oext = @oext@
++oldincludedir = @oldincludedir@
++pdfdir = @pdfdir@
++prefix = @prefix@
++program_transform_name = @program_transform_name@
++psdir = @psdir@
++sbindir = @sbindir@
++sharedstatedir = @sharedstatedir@
++sys_dir = @sys_dir@
++sysconfdir = @sysconfdir@
++target_alias = @target_alias@
++AUTOMAKE_OPTIONS = cygnus
++INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
++AM_CCASFLAGS = $(INCLUDES) $(CFLAGS)
++noinst_LIBRARIES = lib.a
++LIBCGLUE_MULT_OBJS = _close.o _exit.o _fork.o _fstat.o _getpid.o \
++ _gettimeofday.o _kill.o _lseek.o _open.o _read.o \
++ _sbrk.o _wait.o _write.o clock.o isatty.o time.o \
++ _link.o _unlink.o sleep.o opendir.o readdir.o \
++ closedir.o getcwd.o chdir.o mkdir.o rmdir.o \
++ realpath.o _stat.o truncate.o access.o tzset.o \
++ __psp_set_errno.o mlock.o _fcntl.o _rename.o nanosleep.o
++
++SOCKET_MULT_OBJS = socket.o accept.o bind.o connect.o getsockopt.o \
++ listen.o recv.o recvfrom.o send.o sendto.o \
++ setsockopt.o shutdown.o getsockname.o getpeername.o \
++ inet_ntoa.o
++
++PE_OBJS = pipe.o
++FDMAN_OBJS = fdman.o
++SELECT_OBJS = select.o
++INTERRUPT_OBJS = interrupt.o
++XPRINTF_MULT_OBJS = vxprintf.o _xprintf.o __sout.o vsnprintf.o snprintf.o \
++ vsprintf.o sprintf.o __mout.o mprintf.o vmprintf.o asprintf.o \
++ vasprintf.o __fout.o fprintf.o vfprintf.o printf.o vprintf.o \
++ _sprintf_r.o
++
++NETDB_MULT_OBJS = h_errno.o gethostbyaddr.o gethostbyname.o
++lib_a_SOURCES = libcglue.c socket.c pspcwd.c xprintf.c netdb.c pipe.c fdman.c select.c syscalls.c interrupt.S
++lib_a_LIBADD = $(LIBCGLUE_MULT_OBJS) $(SOCKET_MULT_OBJS) $(XPRINTF_MULT_OBJS) \
++ $(NETDB_MULT_OBJS) $(PIPE_OBJS) $(FDMAN_OBJS) $(SELECT_OBJS) $(INTERRUPT_OBJS)
++
++ACLOCAL_AMFLAGS = -I ../../..
++CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
++all: all-am
++
++.SUFFIXES:
++.SUFFIXES: .S .c .o .obj
++am--refresh:
++ @:
++$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
++ @for dep in $?; do \
++ case '$(am__configure_deps)' in \
++ *$$dep*) \
++ echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus '; \
++ cd $(srcdir) && $(AUTOMAKE) --cygnus \
++ && exit 0; \
++ exit 1;; \
++ esac; \
++ done; \
++ echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile'; \
++ cd $(top_srcdir) && \
++ $(AUTOMAKE) --cygnus Makefile
++.PRECIOUS: Makefile
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++ @case '$?' in \
++ *config.status*) \
++ echo ' $(SHELL) ./config.status'; \
++ $(SHELL) ./config.status;; \
++ *) \
++ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
++ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
++ esac;
++
++$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
++ $(SHELL) ./config.status --recheck
++
++$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
++ cd $(srcdir) && $(AUTOCONF)
++$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
++ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
++
++clean-noinstLIBRARIES:
++ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
++lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES)
++ -rm -f lib.a
++ $(lib_a_AR) lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD)
++ $(RANLIB) lib.a
++
++mostlyclean-compile:
++ -rm -f *.$(OBJEXT)
++
++distclean-compile:
++ -rm -f *.tab.c
++
++.S.o:
++ $(CCASCOMPILE) -c $<
++
++.S.obj:
++ $(CCASCOMPILE) -c `$(CYGPATH_W) '$<'`
++
++.c.o:
++ $(COMPILE) -c $<
++
++.c.obj:
++ $(COMPILE) -c `$(CYGPATH_W) '$<'`
++uninstall-info-am:
++
++ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
++ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
++ unique=`for i in $$list; do \
++ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
++ done | \
++ $(AWK) ' { files[$$0] = 1; } \
++ END { for (i in files) print i; }'`; \
++ mkid -fID $$unique
++tags: TAGS
++
++TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
++ $(TAGS_FILES) $(LISP)
++ tags=; \
++ here=`pwd`; \
++ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
++ unique=`for i in $$list; do \
++ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
++ done | \
++ $(AWK) ' { files[$$0] = 1; } \
++ END { for (i in files) print i; }'`; \
++ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
++ test -n "$$unique" || unique=$$empty_fix; \
++ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
++ $$tags $$unique; \
++ fi
++ctags: CTAGS
++CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
++ $(TAGS_FILES) $(LISP)
++ tags=; \
++ here=`pwd`; \
++ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
++ unique=`for i in $$list; do \
++ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
++ done | \
++ $(AWK) ' { files[$$0] = 1; } \
++ END { for (i in files) print i; }'`; \
++ test -z "$(CTAGS_ARGS)$$tags$$unique" \
++ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
++ $$tags $$unique
++
++GTAGS:
++ here=`$(am__cd) $(top_builddir) && pwd` \
++ && cd $(top_srcdir) \
++ && gtags -i $(GTAGS_ARGS) $$here
++
++distclean-tags:
++ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
++check-am:
++check: check-am
++all-am: Makefile $(LIBRARIES)
++installdirs:
++install: install-am
++install-exec: install-exec-am
++install-data: install-data-am
++uninstall: uninstall-am
++
++install-am: all-am
++ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
++
++installcheck: installcheck-am
++install-strip:
++ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
++ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
++ `test -z '$(STRIP)' || \
++ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
++mostlyclean-generic:
++
++clean-generic:
++
++distclean-generic:
++ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
++
++maintainer-clean-generic:
++ @echo "This command is intended for maintainers to use"
++ @echo "it deletes files that may require special tools to rebuild."
++clean: clean-am
++
++clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
++
++distclean: distclean-am
++ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
++ -rm -f Makefile
++distclean-am: clean-am distclean-compile distclean-generic \
++ distclean-tags
++
++dvi: dvi-am
++
++dvi-am:
++
++html: html-am
++
++info: info-am
++
++info-am:
++
++install-data-am:
++
++install-exec-am:
++
++install-info: install-info-am
++
++install-man:
++
++installcheck-am:
++
++maintainer-clean: maintainer-clean-am
++ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
++ -rm -rf $(top_srcdir)/autom4te.cache
++ -rm -f Makefile
++maintainer-clean-am: distclean-am maintainer-clean-generic
++
++mostlyclean: mostlyclean-am
++
++mostlyclean-am: mostlyclean-compile mostlyclean-generic
++
++pdf: pdf-am
++
++pdf-am:
++
++ps: ps-am
++
++ps-am:
++
++uninstall-am:
++
++.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
++ clean-generic clean-noinstLIBRARIES ctags distclean \
++ distclean-compile distclean-generic distclean-tags dvi dvi-am \
++ html html-am info info-am install install-am install-data \
++ install-data-am install-exec install-exec-am install-info \
++ install-info-am install-man install-strip installcheck \
++ installcheck-am installdirs maintainer-clean \
++ maintainer-clean-generic mostlyclean mostlyclean-compile \
++ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
++ uninstall-am uninstall-info-am
++
++
++all: crt0.o
++
++$(LIBCGLUE_MULT_OBJS): libcglue.c
++ $(COMPILE) -DF_$* $< -c -o $@
++
++$(SOCKET_MULT_OBJS): socket.c
++ $(COMPILE) -DF_$* $< -c -o $@
++
++$(XPRINTF_MULT_OBJS): xprintf.c
++ $(COMPILE) -DF_$* $< -c -o $@
++
++$(NETDB_MULT_OBJS): netdb.c
++ $(COMPILE) -DF_$* $< -c -o $@
++
++$(PIPE_OBJS): pipe.c
++ $(COMPILE) -DF_$* $< -c -o $@
++
++$(FDMAN_OBJS): fdman.c
++ $(COMPILE) -DF_$* $< -c -o $@
++
++$(SELECT_OBJS): select.c
++ $(COMPILE) -DF_$* $< -c -o $@
++
++$(INTERRUPT_OBJS): interrupt.S
++ $(COMPILE) -DF_$* $< -c -o $@
++# Tell versions [3.59,3.63) of GNU make to not export all variables.
++# Otherwise a system limit (for SysV at least) may be exceeded.
++.NOEXPORT:
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-README b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-README
new file mode 100644
index 000000000000..bdc790b3bdec
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-README
@@ -0,0 +1,19 @@
+--- newlib/libc/sys/psp/README.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/README 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,16 @@
++Newlib for PSP
++--
++
++This sys/psp directory depends on PSPSDK headers. It expects them to live in
++${prefix}/psp/sdk/include (see newlib/configure.host).
++
++I used automake 1.4-p6 to generate aclocal.m4 and Makefile.in:
++
++ aclocal -I ../../..
++ automake --cygnus
++
++Autoconf refused to work for me, so I copied configure from sys/sh and modified
++$ac_unique_file to point libcglue.c.
++
++--
++Marcus R. Brown <mrbrown@ocgnet.org>
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-aclocal.m4 b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-aclocal.m4
new file mode 100644
index 000000000000..3ec457ea6298
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-aclocal.m4
@@ -0,0 +1,883 @@
+--- newlib/libc/sys/psp/aclocal.m4.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/aclocal.m4 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,880 @@
++# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
++
++# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
++# 2005 Free Software Foundation, Inc.
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
++# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
++# PARTICULAR PURPOSE.
++
++# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# AM_AUTOMAKE_VERSION(VERSION)
++# ----------------------------
++# Automake X.Y traces this macro to ensure aclocal.m4 has been
++# generated from the m4 files accompanying Automake X.Y.
++AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
++
++# AM_SET_CURRENT_AUTOMAKE_VERSION
++# -------------------------------
++# Call AM_AUTOMAKE_VERSION so it can be traced.
++# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
++AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
++ [AM_AUTOMAKE_VERSION([1.9.6])])
++
++# AM_AUX_DIR_EXPAND -*- Autoconf -*-
++
++# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
++# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
++# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
++#
++# Of course, Automake must honor this variable whenever it calls a
++# tool from the auxiliary directory. The problem is that $srcdir (and
++# therefore $ac_aux_dir as well) can be either absolute or relative,
++# depending on how configure is run. This is pretty annoying, since
++# it makes $ac_aux_dir quite unusable in subdirectories: in the top
++# source directory, any form will work fine, but in subdirectories a
++# relative path needs to be adjusted first.
++#
++# $ac_aux_dir/missing
++# fails when called from a subdirectory if $ac_aux_dir is relative
++# $top_srcdir/$ac_aux_dir/missing
++# fails if $ac_aux_dir is absolute,
++# fails when called from a subdirectory in a VPATH build with
++# a relative $ac_aux_dir
++#
++# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
++# are both prefixed by $srcdir. In an in-source build this is usually
++# harmless because $srcdir is `.', but things will broke when you
++# start a VPATH build or use an absolute $srcdir.
++#
++# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
++# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
++# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
++# and then we would define $MISSING as
++# MISSING="\${SHELL} $am_aux_dir/missing"
++# This will work as long as MISSING is not called from configure, because
++# unfortunately $(top_srcdir) has no meaning in configure.
++# However there are other variables, like CC, which are often used in
++# configure, and could therefore not use this "fixed" $ac_aux_dir.
++#
++# Another solution, used here, is to always expand $ac_aux_dir to an
++# absolute PATH. The drawback is that using absolute paths prevent a
++# configured tree to be moved without reconfiguration.
++
++AC_DEFUN([AM_AUX_DIR_EXPAND],
++[dnl Rely on autoconf to set up CDPATH properly.
++AC_PREREQ([2.50])dnl
++# expand $ac_aux_dir to an absolute path
++am_aux_dir=`cd $ac_aux_dir && pwd`
++])
++
++# AM_CONDITIONAL -*- Autoconf -*-
++
++# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
++# Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# serial 7
++
++# AM_CONDITIONAL(NAME, SHELL-CONDITION)
++# -------------------------------------
++# Define a conditional.
++AC_DEFUN([AM_CONDITIONAL],
++[AC_PREREQ(2.52)dnl
++ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
++ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
++AC_SUBST([$1_TRUE])
++AC_SUBST([$1_FALSE])
++if $2; then
++ $1_TRUE=
++ $1_FALSE='#'
++else
++ $1_TRUE='#'
++ $1_FALSE=
++fi
++AC_CONFIG_COMMANDS_PRE(
++[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
++ AC_MSG_ERROR([[conditional "$1" was never defined.
++Usually this means the macro was only invoked conditionally.]])
++fi])])
++
++
++# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
++# Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# serial 8
++
++# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
++# written in clear, in which case automake, when reading aclocal.m4,
++# will think it sees a *use*, and therefore will trigger all it's
++# C support machinery. Also note that it means that autoscan, seeing
++# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
++
++
++# _AM_DEPENDENCIES(NAME)
++# ----------------------
++# See how the compiler implements dependency checking.
++# NAME is "CC", "CXX", "GCJ", or "OBJC".
++# We try a few techniques and use that to set a single cache variable.
++#
++# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
++# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
++# dependency, and given that the user is not expected to run this macro,
++# just rely on AC_PROG_CC.
++AC_DEFUN([_AM_DEPENDENCIES],
++[AC_REQUIRE([AM_SET_DEPDIR])dnl
++AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
++AC_REQUIRE([AM_MAKE_INCLUDE])dnl
++AC_REQUIRE([AM_DEP_TRACK])dnl
++
++ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
++ [$1], CXX, [depcc="$CXX" am_compiler_list=],
++ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
++ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
++ [depcc="$$1" am_compiler_list=])
++
++AC_CACHE_CHECK([dependency style of $depcc],
++ [am_cv_$1_dependencies_compiler_type],
++[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
++ # We make a subdir and do the tests there. Otherwise we can end up
++ # making bogus files that we don't know about and never remove. For
++ # instance it was reported that on HP-UX the gcc test will end up
++ # making a dummy file named `D' -- because `-MD' means `put the output
++ # in D'.
++ mkdir conftest.dir
++ # Copy depcomp to subdir because otherwise we won't find it if we're
++ # using a relative directory.
++ cp "$am_depcomp" conftest.dir
++ cd conftest.dir
++ # We will build objects and dependencies in a subdirectory because
++ # it helps to detect inapplicable dependency modes. For instance
++ # both Tru64's cc and ICC support -MD to output dependencies as a
++ # side effect of compilation, but ICC will put the dependencies in
++ # the current directory while Tru64 will put them in the object
++ # directory.
++ mkdir sub
++
++ am_cv_$1_dependencies_compiler_type=none
++ if test "$am_compiler_list" = ""; then
++ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
++ fi
++ for depmode in $am_compiler_list; do
++ # Setup a source with many dependencies, because some compilers
++ # like to wrap large dependency lists on column 80 (with \), and
++ # we should not choose a depcomp mode which is confused by this.
++ #
++ # We need to recreate these files for each test, as the compiler may
++ # overwrite some of them when testing with obscure command lines.
++ # This happens at least with the AIX C compiler.
++ : > sub/conftest.c
++ for i in 1 2 3 4 5 6; do
++ echo '#include "conftst'$i'.h"' >> sub/conftest.c
++ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
++ # Solaris 8's {/usr,}/bin/sh.
++ touch sub/conftst$i.h
++ done
++ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
++
++ case $depmode in
++ nosideeffect)
++ # after this tag, mechanisms are not by side-effect, so they'll
++ # only be used when explicitly requested
++ if test "x$enable_dependency_tracking" = xyes; then
++ continue
++ else
++ break
++ fi
++ ;;
++ none) break ;;
++ esac
++ # We check with `-c' and `-o' for the sake of the "dashmstdout"
++ # mode. It turns out that the SunPro C++ compiler does not properly
++ # handle `-M -o', and we need to detect this.
++ if depmode=$depmode \
++ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
++ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
++ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
++ >/dev/null 2>conftest.err &&
++ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
++ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
++ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
++ # icc doesn't choke on unknown options, it will just issue warnings
++ # or remarks (even with -Werror). So we grep stderr for any message
++ # that says an option was ignored or not supported.
++ # When given -MP, icc 7.0 and 7.1 complain thusly:
++ # icc: Command line warning: ignoring option '-M'; no argument required
++ # The diagnosis changed in icc 8.0:
++ # icc: Command line remark: option '-MP' not supported
++ if (grep 'ignoring option' conftest.err ||
++ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
++ am_cv_$1_dependencies_compiler_type=$depmode
++ break
++ fi
++ fi
++ done
++
++ cd ..
++ rm -rf conftest.dir
++else
++ am_cv_$1_dependencies_compiler_type=none
++fi
++])
++AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
++AM_CONDITIONAL([am__fastdep$1], [
++ test "x$enable_dependency_tracking" != xno \
++ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
++])
++
++
++# AM_SET_DEPDIR
++# -------------
++# Choose a directory name for dependency files.
++# This macro is AC_REQUIREd in _AM_DEPENDENCIES
++AC_DEFUN([AM_SET_DEPDIR],
++[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
++AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
++])
++
++
++# AM_DEP_TRACK
++# ------------
++AC_DEFUN([AM_DEP_TRACK],
++[AC_ARG_ENABLE(dependency-tracking,
++[ --disable-dependency-tracking speeds up one-time build
++ --enable-dependency-tracking do not reject slow dependency extractors])
++if test "x$enable_dependency_tracking" != xno; then
++ am_depcomp="$ac_aux_dir/depcomp"
++ AMDEPBACKSLASH='\'
++fi
++AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
++AC_SUBST([AMDEPBACKSLASH])
++])
++
++# Generate code to set up dependency tracking. -*- Autoconf -*-
++
++# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
++# Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++#serial 3
++
++# _AM_OUTPUT_DEPENDENCY_COMMANDS
++# ------------------------------
++AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
++[for mf in $CONFIG_FILES; do
++ # Strip MF so we end up with the name of the file.
++ mf=`echo "$mf" | sed -e 's/:.*$//'`
++ # Check whether this is an Automake generated Makefile or not.
++ # We used to match only the files named `Makefile.in', but
++ # some people rename them; so instead we look at the file content.
++ # Grep'ing the first line is not enough: some people post-process
++ # each Makefile.in and add a new line on top of each file to say so.
++ # So let's grep whole file.
++ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
++ dirpart=`AS_DIRNAME("$mf")`
++ else
++ continue
++ fi
++ # Extract the definition of DEPDIR, am__include, and am__quote
++ # from the Makefile without running `make'.
++ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
++ test -z "$DEPDIR" && continue
++ am__include=`sed -n 's/^am__include = //p' < "$mf"`
++ test -z "am__include" && continue
++ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
++ # When using ansi2knr, U may be empty or an underscore; expand it
++ U=`sed -n 's/^U = //p' < "$mf"`
++ # Find all dependency output files, they are included files with
++ # $(DEPDIR) in their names. We invoke sed twice because it is the
++ # simplest approach to changing $(DEPDIR) to its actual value in the
++ # expansion.
++ for file in `sed -n "
++ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
++ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
++ # Make sure the directory exists.
++ test -f "$dirpart/$file" && continue
++ fdir=`AS_DIRNAME(["$file"])`
++ AS_MKDIR_P([$dirpart/$fdir])
++ # echo "creating $dirpart/$file"
++ echo '# dummy' > "$dirpart/$file"
++ done
++done
++])# _AM_OUTPUT_DEPENDENCY_COMMANDS
++
++
++# AM_OUTPUT_DEPENDENCY_COMMANDS
++# -----------------------------
++# This macro should only be invoked once -- use via AC_REQUIRE.
++#
++# This code is only required when automatic dependency tracking
++# is enabled. FIXME. This creates each `.P' file that we will
++# need in order to bootstrap the dependency handling code.
++AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
++[AC_CONFIG_COMMANDS([depfiles],
++ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
++ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
++])
++
++# Do all the work for Automake. -*- Autoconf -*-
++
++# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
++# Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# serial 12
++
++# This macro actually does too much. Some checks are only needed if
++# your package does certain things. But this isn't really a big deal.
++
++# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
++# AM_INIT_AUTOMAKE([OPTIONS])
++# -----------------------------------------------
++# The call with PACKAGE and VERSION arguments is the old style
++# call (pre autoconf-2.50), which is being phased out. PACKAGE
++# and VERSION should now be passed to AC_INIT and removed from
++# the call to AM_INIT_AUTOMAKE.
++# We support both call styles for the transition. After
++# the next Automake release, Autoconf can make the AC_INIT
++# arguments mandatory, and then we can depend on a new Autoconf
++# release and drop the old call support.
++AC_DEFUN([AM_INIT_AUTOMAKE],
++[AC_PREREQ([2.58])dnl
++dnl Autoconf wants to disallow AM_ names. We explicitly allow
++dnl the ones we care about.
++m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
++AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
++AC_REQUIRE([AC_PROG_INSTALL])dnl
++# test to see if srcdir already configured
++if test "`cd $srcdir && pwd`" != "`pwd`" &&
++ test -f $srcdir/config.status; then
++ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
++fi
++
++# test whether we have cygpath
++if test -z "$CYGPATH_W"; then
++ if (cygpath --version) >/dev/null 2>/dev/null; then
++ CYGPATH_W='cygpath -w'
++ else
++ CYGPATH_W=echo
++ fi
++fi
++AC_SUBST([CYGPATH_W])
++
++# Define the identity of the package.
++dnl Distinguish between old-style and new-style calls.
++m4_ifval([$2],
++[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
++ AC_SUBST([PACKAGE], [$1])dnl
++ AC_SUBST([VERSION], [$2])],
++[_AM_SET_OPTIONS([$1])dnl
++ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
++ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
++
++_AM_IF_OPTION([no-define],,
++[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
++ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
++
++# Some tools Automake needs.
++AC_REQUIRE([AM_SANITY_CHECK])dnl
++AC_REQUIRE([AC_ARG_PROGRAM])dnl
++AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
++AM_MISSING_PROG(AUTOCONF, autoconf)
++AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
++AM_MISSING_PROG(AUTOHEADER, autoheader)
++AM_MISSING_PROG(MAKEINFO, makeinfo)
++AM_PROG_INSTALL_SH
++AM_PROG_INSTALL_STRIP
++AC_REQUIRE([AM_PROG_MKDIR_P])dnl
++# We need awk for the "check" target. The system "awk" is bad on
++# some platforms.
++AC_REQUIRE([AC_PROG_AWK])dnl
++AC_REQUIRE([AC_PROG_MAKE_SET])dnl
++AC_REQUIRE([AM_SET_LEADING_DOT])dnl
++_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
++ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
++ [_AM_PROG_TAR([v7])])])
++_AM_IF_OPTION([no-dependencies],,
++[AC_PROVIDE_IFELSE([AC_PROG_CC],
++ [_AM_DEPENDENCIES(CC)],
++ [define([AC_PROG_CC],
++ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
++AC_PROVIDE_IFELSE([AC_PROG_CXX],
++ [_AM_DEPENDENCIES(CXX)],
++ [define([AC_PROG_CXX],
++ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
++])
++])
++
++
++# When config.status generates a header, we must update the stamp-h file.
++# This file resides in the same directory as the config header
++# that is generated. The stamp files are numbered to have different names.
++
++# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
++# loop where config.status creates the headers, so we can generate
++# our stamp files there.
++AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
++[# Compute $1's index in $config_headers.
++_am_stamp_count=1
++for _am_header in $config_headers :; do
++ case $_am_header in
++ $1 | $1:* )
++ break ;;
++ * )
++ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
++ esac
++done
++echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
++
++# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# AM_PROG_INSTALL_SH
++# ------------------
++# Define $install_sh.
++AC_DEFUN([AM_PROG_INSTALL_SH],
++[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
++install_sh=${install_sh-"$am_aux_dir/install-sh"}
++AC_SUBST(install_sh)])
++
++# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# serial 2
++
++# Check whether the underlying file-system supports filenames
++# with a leading dot. For instance MS-DOS doesn't.
++AC_DEFUN([AM_SET_LEADING_DOT],
++[rm -rf .tst 2>/dev/null
++mkdir .tst 2>/dev/null
++if test -d .tst; then
++ am__leading_dot=.
++else
++ am__leading_dot=_
++fi
++rmdir .tst 2>/dev/null
++AC_SUBST([am__leading_dot])])
++
++# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
++# From Jim Meyering
++
++# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
++# Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# serial 4
++
++AC_DEFUN([AM_MAINTAINER_MODE],
++[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
++ dnl maintainer-mode is disabled by default
++ AC_ARG_ENABLE(maintainer-mode,
++[ --enable-maintainer-mode enable make rules and dependencies not useful
++ (and sometimes confusing) to the casual installer],
++ USE_MAINTAINER_MODE=$enableval,
++ USE_MAINTAINER_MODE=no)
++ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
++ AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
++ MAINT=$MAINTAINER_MODE_TRUE
++ AC_SUBST(MAINT)dnl
++]
++)
++
++AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
++
++# Check to see how 'make' treats includes. -*- Autoconf -*-
++
++# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# serial 3
++
++# AM_MAKE_INCLUDE()
++# -----------------
++# Check to see how make treats includes.
++AC_DEFUN([AM_MAKE_INCLUDE],
++[am_make=${MAKE-make}
++cat > confinc << 'END'
++am__doit:
++ @echo done
++.PHONY: am__doit
++END
++# If we don't find an include directive, just comment out the code.
++AC_MSG_CHECKING([for style of include used by $am_make])
++am__include="#"
++am__quote=
++_am_result=none
++# First try GNU make style include.
++echo "include confinc" > confmf
++# We grep out `Entering directory' and `Leaving directory'
++# messages which can occur if `w' ends up in MAKEFLAGS.
++# In particular we don't look at `^make:' because GNU make might
++# be invoked under some other name (usually "gmake"), in which
++# case it prints its new name instead of `make'.
++if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
++ am__include=include
++ am__quote=
++ _am_result=GNU
++fi
++# Now try BSD make style include.
++if test "$am__include" = "#"; then
++ echo '.include "confinc"' > confmf
++ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
++ am__include=.include
++ am__quote="\""
++ _am_result=BSD
++ fi
++fi
++AC_SUBST([am__include])
++AC_SUBST([am__quote])
++AC_MSG_RESULT([$_am_result])
++rm -f confinc confmf
++])
++
++# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
++
++# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
++# Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# serial 4
++
++# AM_MISSING_PROG(NAME, PROGRAM)
++# ------------------------------
++AC_DEFUN([AM_MISSING_PROG],
++[AC_REQUIRE([AM_MISSING_HAS_RUN])
++$1=${$1-"${am_missing_run}$2"}
++AC_SUBST($1)])
++
++
++# AM_MISSING_HAS_RUN
++# ------------------
++# Define MISSING if not defined so far and test if it supports --run.
++# If it does, set am_missing_run to use it, otherwise, to nothing.
++AC_DEFUN([AM_MISSING_HAS_RUN],
++[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
++test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
++# Use eval to expand $SHELL
++if eval "$MISSING --run true"; then
++ am_missing_run="$MISSING --run "
++else
++ am_missing_run=
++ AC_MSG_WARN([`missing' script is too old or missing])
++fi
++])
++
++# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# AM_PROG_MKDIR_P
++# ---------------
++# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
++#
++# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
++# created by `make install' are always world readable, even if the
++# installer happens to have an overly restrictive umask (e.g. 077).
++# This was a mistake. There are at least two reasons why we must not
++# use `-m 0755':
++# - it causes special bits like SGID to be ignored,
++# - it may be too restrictive (some setups expect 775 directories).
++#
++# Do not use -m 0755 and let people choose whatever they expect by
++# setting umask.
++#
++# We cannot accept any implementation of `mkdir' that recognizes `-p'.
++# Some implementations (such as Solaris 8's) are not thread-safe: if a
++# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
++# concurrently, both version can detect that a/ is missing, but only
++# one can create it and the other will error out. Consequently we
++# restrict ourselves to GNU make (using the --version option ensures
++# this.)
++AC_DEFUN([AM_PROG_MKDIR_P],
++[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
++ # We used to keeping the `.' as first argument, in order to
++ # allow $(mkdir_p) to be used without argument. As in
++ # $(mkdir_p) $(somedir)
++ # where $(somedir) is conditionally defined. However this is wrong
++ # for two reasons:
++ # 1. if the package is installed by a user who cannot write `.'
++ # make install will fail,
++ # 2. the above comment should most certainly read
++ # $(mkdir_p) $(DESTDIR)$(somedir)
++ # so it does not work when $(somedir) is undefined and
++ # $(DESTDIR) is not.
++ # To support the latter case, we have to write
++ # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
++ # so the `.' trick is pointless.
++ mkdir_p='mkdir -p --'
++else
++ # On NextStep and OpenStep, the `mkdir' command does not
++ # recognize any option. It will interpret all options as
++ # directories to create, and then abort because `.' already
++ # exists.
++ for d in ./-p ./--version;
++ do
++ test -d $d && rmdir $d
++ done
++ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
++ if test -f "$ac_aux_dir/mkinstalldirs"; then
++ mkdir_p='$(mkinstalldirs)'
++ else
++ mkdir_p='$(install_sh) -d'
++ fi
++fi
++AC_SUBST([mkdir_p])])
++
++# Helper functions for option handling. -*- Autoconf -*-
++
++# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# serial 3
++
++# _AM_MANGLE_OPTION(NAME)
++# -----------------------
++AC_DEFUN([_AM_MANGLE_OPTION],
++[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
++
++# _AM_SET_OPTION(NAME)
++# ------------------------------
++# Set option NAME. Presently that only means defining a flag for this option.
++AC_DEFUN([_AM_SET_OPTION],
++[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
++
++# _AM_SET_OPTIONS(OPTIONS)
++# ----------------------------------
++# OPTIONS is a space-separated list of Automake options.
++AC_DEFUN([_AM_SET_OPTIONS],
++[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
++
++# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
++# -------------------------------------------
++# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
++AC_DEFUN([_AM_IF_OPTION],
++[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
++
++# Check to make sure that the build environment is sane. -*- Autoconf -*-
++
++# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
++# Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# serial 4
++
++# AM_SANITY_CHECK
++# ---------------
++AC_DEFUN([AM_SANITY_CHECK],
++[AC_MSG_CHECKING([whether build environment is sane])
++# Just in case
++sleep 1
++echo timestamp > conftest.file
++# Do `set' in a subshell so we don't clobber the current shell's
++# arguments. Must try -L first in case configure is actually a
++# symlink; some systems play weird games with the mod time of symlinks
++# (eg FreeBSD returns the mod time of the symlink's containing
++# directory).
++if (
++ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
++ if test "$[*]" = "X"; then
++ # -L didn't work.
++ set X `ls -t $srcdir/configure conftest.file`
++ fi
++ rm -f conftest.file
++ if test "$[*]" != "X $srcdir/configure conftest.file" \
++ && test "$[*]" != "X conftest.file $srcdir/configure"; then
++
++ # If neither matched, then we have a broken ls. This can happen
++ # if, for instance, CONFIG_SHELL is bash and it inherits a
++ # broken ls alias from the environment. This has actually
++ # happened. Such a system could not be considered "sane".
++ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
++alias in your environment])
++ fi
++
++ test "$[2]" = conftest.file
++ )
++then
++ # Ok.
++ :
++else
++ AC_MSG_ERROR([newly created file is older than distributed files!
++Check your system clock])
++fi
++AC_MSG_RESULT(yes)])
++
++# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# AM_PROG_INSTALL_STRIP
++# ---------------------
++# One issue with vendor `install' (even GNU) is that you can't
++# specify the program used to strip binaries. This is especially
++# annoying in cross-compiling environments, where the build's strip
++# is unlikely to handle the host's binaries.
++# Fortunately install-sh will honor a STRIPPROG variable, so we
++# always use install-sh in `make install-strip', and initialize
++# STRIPPROG with the value of the STRIP variable (set by the user).
++AC_DEFUN([AM_PROG_INSTALL_STRIP],
++[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
++# Installed binaries are usually stripped using `strip' when the user
++# run `make install-strip'. However `strip' might not be the right
++# tool to use in cross-compilation environments, therefore Automake
++# will honor the `STRIP' environment variable to overrule this program.
++dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
++if test "$cross_compiling" != no; then
++ AC_CHECK_TOOL([STRIP], [strip], :)
++fi
++INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
++AC_SUBST([INSTALL_STRIP_PROGRAM])])
++
++# Check how to create a tarball. -*- Autoconf -*-
++
++# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# serial 2
++
++# _AM_PROG_TAR(FORMAT)
++# --------------------
++# Check how to create a tarball in format FORMAT.
++# FORMAT should be one of `v7', `ustar', or `pax'.
++#
++# Substitute a variable $(am__tar) that is a command
++# writing to stdout a FORMAT-tarball containing the directory
++# $tardir.
++# tardir=directory && $(am__tar) > result.tar
++#
++# Substitute a variable $(am__untar) that extract such
++# a tarball read from stdin.
++# $(am__untar) < result.tar
++AC_DEFUN([_AM_PROG_TAR],
++[# Always define AMTAR for backward compatibility.
++AM_MISSING_PROG([AMTAR], [tar])
++m4_if([$1], [v7],
++ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
++ [m4_case([$1], [ustar],, [pax],,
++ [m4_fatal([Unknown tar format])])
++AC_MSG_CHECKING([how to create a $1 tar archive])
++# Loop over all known methods to create a tar archive until one works.
++_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
++_am_tools=${am_cv_prog_tar_$1-$_am_tools}
++# Do not fold the above two line into one, because Tru64 sh and
++# Solaris sh will not grok spaces in the rhs of `-'.
++for _am_tool in $_am_tools
++do
++ case $_am_tool in
++ gnutar)
++ for _am_tar in tar gnutar gtar;
++ do
++ AM_RUN_LOG([$_am_tar --version]) && break
++ done
++ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
++ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
++ am__untar="$_am_tar -xf -"
++ ;;
++ plaintar)
++ # Must skip GNU tar: if it does not support --format= it doesn't create
++ # ustar tarball either.
++ (tar --version) >/dev/null 2>&1 && continue
++ am__tar='tar chf - "$$tardir"'
++ am__tar_='tar chf - "$tardir"'
++ am__untar='tar xf -'
++ ;;
++ pax)
++ am__tar='pax -L -x $1 -w "$$tardir"'
++ am__tar_='pax -L -x $1 -w "$tardir"'
++ am__untar='pax -r'
++ ;;
++ cpio)
++ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
++ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
++ am__untar='cpio -i -H $1 -d'
++ ;;
++ none)
++ am__tar=false
++ am__tar_=false
++ am__untar=false
++ ;;
++ esac
++
++ # If the value was cached, stop now. We just wanted to have am__tar
++ # and am__untar set.
++ test -n "${am_cv_prog_tar_$1}" && break
++
++ # tar/untar a dummy directory, and stop if the command works
++ rm -rf conftest.dir
++ mkdir conftest.dir
++ echo GrepMe > conftest.dir/file
++ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
++ rm -rf conftest.dir
++ if test -s conftest.tar; then
++ AM_RUN_LOG([$am__untar <conftest.tar])
++ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
++ fi
++done
++rm -rf conftest.dir
++
++AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
++AC_MSG_RESULT([$am_cv_prog_tar_$1])])
++AC_SUBST([am__tar])
++AC_SUBST([am__untar])
++]) # _AM_PROG_TAR
++
++m4_include([../../../acinclude.m4])
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-arpa-inet.h b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-arpa-inet.h
new file mode 100644
index 000000000000..e8fad4b3547b
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-arpa-inet.h
@@ -0,0 +1,29 @@
+--- newlib/libc/sys/psp/arpa/inet.h.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/arpa/inet.h 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,26 @@
++/* arpa/inet.h - Functions for converting IP addresses between strings and numbers */
++
++#ifndef _ARPA_INET_H_
++#define _ARPA_INET_H_
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#include <netinet/in.h>
++
++in_addr_t sceNetInetInetAddr(const char *ip);
++int sceNetInetInetAton(const char *ip, struct in_addr *in);
++const char* sceNetInetInetNtop(int af, const void *src, char *dst, socklen_t cnt);
++int sceNetInetInetPton(int af, const char *src, void *dst);
++
++char *inet_ntoa(struct in_addr in);
++#define inet_addr sceNetInetInetAddr
++#define inet_aton sceNetInetInetAton
++#define inet_ntop sceNetInetInetNtop
++#define inet_pton sceNetInetInetPton
++
++#ifdef __cplusplus
++}
++#endif
++#endif /* _ARPA_INET_H_ */
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-confdefs.h b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-confdefs.h
new file mode 100644
index 000000000000..0eb497377986
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-confdefs.h
@@ -0,0 +1,4 @@
+--- newlib/libc/sys/psp/confdefs.h.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/confdefs.h 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1 @@
++
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-configure b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-configure
new file mode 100644
index 000000000000..6356286ffd33
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-configure
@@ -0,0 +1,4089 @@
+--- newlib/libc/sys/psp/configure.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/configure 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,4086 @@
++#! /bin/sh
++# Guess values for system-dependent variables and create Makefiles.
++# Generated by GNU Autoconf 2.59 for newlib 1.15.0.
++#
++# Copyright (C) 2003 Free Software Foundation, Inc.
++# This configure script is free software; the Free Software Foundation
++# gives unlimited permission to copy, distribute and modify it.
++## --------------------- ##
++## M4sh Initialization. ##
++## --------------------- ##
++
++# Be Bourne compatible
++if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
++ emulate sh
++ NULLCMD=:
++ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
++ # is contrary to our usage. Disable this feature.
++ alias -g '${1+"$@"}'='"$@"'
++elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
++ set -o posix
++fi
++DUALCASE=1; export DUALCASE # for MKS sh
++
++# Support unset when possible.
++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
++ as_unset=unset
++else
++ as_unset=false
++fi
++
++
++# Work around bugs in pre-3.0 UWIN ksh.
++$as_unset ENV MAIL MAILPATH
++PS1='$ '
++PS2='> '
++PS4='+ '
++
++# NLS nuisances.
++for as_var in \
++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
++ LC_TELEPHONE LC_TIME
++do
++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
++ eval $as_var=C; export $as_var
++ else
++ $as_unset $as_var
++ fi
++done
++
++# Required to use basename.
++if expr a : '\(a\)' >/dev/null 2>&1; then
++ as_expr=expr
++else
++ as_expr=false
++fi
++
++if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
++ as_basename=basename
++else
++ as_basename=false
++fi
++
++
++# Name of the executable.
++as_me=`$as_basename "$0" ||
++$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
++ X"$0" : 'X\(//\)$' \| \
++ X"$0" : 'X\(/\)$' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X/"$0" |
++ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
++ /^X\/\(\/\/\)$/{ s//\1/; q; }
++ /^X\/\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++
++
++# PATH needs CR, and LINENO needs CR and PATH.
++# Avoid depending upon Character Ranges.
++as_cr_letters='abcdefghijklmnopqrstuvwxyz'
++as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
++as_cr_Letters=$as_cr_letters$as_cr_LETTERS
++as_cr_digits='0123456789'
++as_cr_alnum=$as_cr_Letters$as_cr_digits
++
++# The user is always right.
++if test "${PATH_SEPARATOR+set}" != set; then
++ echo "#! /bin/sh" >conf$$.sh
++ echo "exit 0" >>conf$$.sh
++ chmod +x conf$$.sh
++ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
++ PATH_SEPARATOR=';'
++ else
++ PATH_SEPARATOR=:
++ fi
++ rm -f conf$$.sh
++fi
++
++
++ as_lineno_1=$LINENO
++ as_lineno_2=$LINENO
++ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
++ test "x$as_lineno_1" != "x$as_lineno_2" &&
++ test "x$as_lineno_3" = "x$as_lineno_2" || {
++ # Find who we are. Look in the path if we contain no path at all
++ # relative or not.
++ case $0 in
++ *[\\/]* ) as_myself=$0 ;;
++ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
++done
++
++ ;;
++ esac
++ # We did not find ourselves, most probably we were run as `sh COMMAND'
++ # in which case we are not to be found in the path.
++ if test "x$as_myself" = x; then
++ as_myself=$0
++ fi
++ if test ! -f "$as_myself"; then
++ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
++ { (exit 1); exit 1; }; }
++ fi
++ case $CONFIG_SHELL in
++ '')
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for as_base in sh bash ksh sh5; do
++ case $as_dir in
++ /*)
++ if ("$as_dir/$as_base" -c '
++ as_lineno_1=$LINENO
++ as_lineno_2=$LINENO
++ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
++ test "x$as_lineno_1" != "x$as_lineno_2" &&
++ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
++ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
++ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
++ CONFIG_SHELL=$as_dir/$as_base
++ export CONFIG_SHELL
++ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
++ fi;;
++ esac
++ done
++done
++;;
++ esac
++
++ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
++ # uniformly replaced by the line number. The first 'sed' inserts a
++ # line-number line before each line; the second 'sed' does the real
++ # work. The second script uses 'N' to pair each line-number line
++ # with the numbered line, and appends trailing '-' during
++ # substitution so that $LINENO is not a special case at line end.
++ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
++ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
++ sed '=' <$as_myself |
++ sed '
++ N
++ s,$,-,
++ : loop
++ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
++ t loop
++ s,-$,,
++ s,^['$as_cr_digits']*\n,,
++ ' >$as_me.lineno &&
++ chmod +x $as_me.lineno ||
++ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
++ { (exit 1); exit 1; }; }
++
++ # Don't try to exec as it changes $[0], causing all sort of problems
++ # (the dirname of $[0] is not the place where we might find the
++ # original and so on. Autoconf is especially sensible to this).
++ . ./$as_me.lineno
++ # Exit status is that of the last command.
++ exit
++}
++
++
++case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
++ *c*,-n*) ECHO_N= ECHO_C='
++' ECHO_T=' ' ;;
++ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
++ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
++esac
++
++if expr a : '\(a\)' >/dev/null 2>&1; then
++ as_expr=expr
++else
++ as_expr=false
++fi
++
++rm -f conf$$ conf$$.exe conf$$.file
++echo >conf$$.file
++if ln -s conf$$.file conf$$ 2>/dev/null; then
++ # We could just check for DJGPP; but this test a) works b) is more generic
++ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
++ if test -f conf$$.exe; then
++ # Don't use ln at all; we don't have any links
++ as_ln_s='cp -p'
++ else
++ as_ln_s='ln -s'
++ fi
++elif ln conf$$.file conf$$ 2>/dev/null; then
++ as_ln_s=ln
++else
++ as_ln_s='cp -p'
++fi
++rm -f conf$$ conf$$.exe conf$$.file
++
++if mkdir -p . 2>/dev/null; then
++ as_mkdir_p=:
++else
++ test -d ./-p && rmdir ./-p
++ as_mkdir_p=false
++fi
++
++as_executable_p="test -f"
++
++# Sed expression to map a string onto a valid CPP name.
++as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
++
++# Sed expression to map a string onto a valid variable name.
++as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
++
++
++# IFS
++# We need space, tab and new line, in precisely that order.
++as_nl='
++'
++IFS=" $as_nl"
++
++# CDPATH.
++$as_unset CDPATH
++
++
++# Name of the host.
++# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
++# so uname gets run too.
++ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
++
++exec 6>&1
++
++#
++# Initializations.
++#
++ac_default_prefix=/usr/local
++ac_config_libobj_dir=.
++cross_compiling=no
++subdirs=
++MFLAGS=
++MAKEFLAGS=
++SHELL=${CONFIG_SHELL-/bin/sh}
++
++# Maximum number of lines to put in a shell here document.
++# This variable seems obsolete. It should probably be removed, and
++# only ac_max_sed_lines should be used.
++: ${ac_max_here_lines=38}
++
++# Identity of this package.
++PACKAGE_NAME='newlib'
++PACKAGE_TARNAME='newlib'
++PACKAGE_VERSION='1.15.0'
++PACKAGE_STRING='newlib 1.15.0'
++PACKAGE_BUGREPORT=''
++
++ac_unique_file="libcglue.c"
++ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAY_SUPPLY_SYSCALLS_TRUE MAY_SUPPLY_SYSCALLS_FALSE newlib_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar \
++ CC DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB READELF ac_ct_READELF MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CCAS CCASFLAGS NEWLIB_CFLAGS LDFLAGS ELIX_LEVEL_0_TRUE ELIX_LEVEL_0_FALSE ELIX_LEVEL_1_TRUE ELIX_LEVEL_1_FALSE ELIX_LEVEL_2_TRUE ELIX_LEVEL_2_FALSE ELIX_LEVEL_3_TRUE ELIX_LEVEL_3_FALSE ELIX_LEVEL_4_TRUE ELIX_LEVEL_4_FALSE USE_LIBTOOL_TRUE USE_LIBTOOL_FALSE OBJEXT oext aext lpfx libm_machine_dir machine_dir sys_dir LIBOBJS LTLIBOBJS'
++ac_subst_files=''
++
++# Initialize some variables set by options.
++ac_init_help=
++ac_init_version=false
++# The variables have the same names as the options, with
++# dashes changed to underlines.
++cache_file=/dev/null
++exec_prefix=NONE
++no_create=
++no_recursion=
++prefix=NONE
++program_prefix=NONE
++program_suffix=NONE
++program_transform_name=s,x,x,
++silent=
++site=
++srcdir=
++verbose=
++x_includes=NONE
++x_libraries=NONE
++
++# Installation directory options.
++# These are left unexpanded so users can "make install exec_prefix=/foo"
++# and all the variables that are supposed to be based on exec_prefix
++# by default will actually change.
++# Use braces instead of parens because sh, perl, etc. also accept them.
++bindir='${exec_prefix}/bin'
++sbindir='${exec_prefix}/sbin'
++libexecdir='${exec_prefix}/libexec'
++datadir='${prefix}/share'
++sysconfdir='${prefix}/etc'
++sharedstatedir='${prefix}/com'
++localstatedir='${prefix}/var'
++libdir='${exec_prefix}/lib'
++includedir='${prefix}/include'
++oldincludedir='/usr/include'
++infodir='${prefix}/info'
++mandir='${prefix}/man'
++
++ac_prev=
++for ac_option
++do
++ # If the previous option needs an argument, assign it.
++ if test -n "$ac_prev"; then
++ eval "$ac_prev=\$ac_option"
++ ac_prev=
++ continue
++ fi
++
++ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
++
++ # Accept the important Cygnus configure options, so we can diagnose typos.
++
++ case $ac_option in
++
++ -bindir | --bindir | --bindi | --bind | --bin | --bi)
++ ac_prev=bindir ;;
++ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
++ bindir=$ac_optarg ;;
++
++ -build | --build | --buil | --bui | --bu)
++ ac_prev=build_alias ;;
++ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
++ build_alias=$ac_optarg ;;
++
++ -cache-file | --cache-file | --cache-fil | --cache-fi \
++ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
++ ac_prev=cache_file ;;
++ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
++ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
++ cache_file=$ac_optarg ;;
++
++ --config-cache | -C)
++ cache_file=config.cache ;;
++
++ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
++ ac_prev=datadir ;;
++ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
++ | --da=*)
++ datadir=$ac_optarg ;;
++
++ -disable-* | --disable-*)
++ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
++ # Reject names that are not valid shell variable names.
++ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
++ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
++ { (exit 1); exit 1; }; }
++ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
++ eval "enable_$ac_feature=no" ;;
++
++ -enable-* | --enable-*)
++ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
++ # Reject names that are not valid shell variable names.
++ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
++ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
++ { (exit 1); exit 1; }; }
++ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
++ case $ac_option in
++ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
++ *) ac_optarg=yes ;;
++ esac
++ eval "enable_$ac_feature='$ac_optarg'" ;;
++
++ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
++ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
++ | --exec | --exe | --ex)
++ ac_prev=exec_prefix ;;
++ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
++ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
++ | --exec=* | --exe=* | --ex=*)
++ exec_prefix=$ac_optarg ;;
++
++ -gas | --gas | --ga | --g)
++ # Obsolete; use --with-gas.
++ with_gas=yes ;;
++
++ -help | --help | --hel | --he | -h)
++ ac_init_help=long ;;
++ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
++ ac_init_help=recursive ;;
++ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
++ ac_init_help=short ;;
++
++ -host | --host | --hos | --ho)
++ ac_prev=host_alias ;;
++ -host=* | --host=* | --hos=* | --ho=*)
++ host_alias=$ac_optarg ;;
++
++ -includedir | --includedir | --includedi | --included | --include \
++ | --includ | --inclu | --incl | --inc)
++ ac_prev=includedir ;;
++ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
++ | --includ=* | --inclu=* | --incl=* | --inc=*)
++ includedir=$ac_optarg ;;
++
++ -infodir | --infodir | --infodi | --infod | --info | --inf)
++ ac_prev=infodir ;;
++ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
++ infodir=$ac_optarg ;;
++
++ -libdir | --libdir | --libdi | --libd)
++ ac_prev=libdir ;;
++ -libdir=* | --libdir=* | --libdi=* | --libd=*)
++ libdir=$ac_optarg ;;
++
++ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
++ | --libexe | --libex | --libe)
++ ac_prev=libexecdir ;;
++ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
++ | --libexe=* | --libex=* | --libe=*)
++ libexecdir=$ac_optarg ;;
++
++ -localstatedir | --localstatedir | --localstatedi | --localstated \
++ | --localstate | --localstat | --localsta | --localst \
++ | --locals | --local | --loca | --loc | --lo)
++ ac_prev=localstatedir ;;
++ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
++ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
++ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
++ localstatedir=$ac_optarg ;;
++
++ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
++ ac_prev=mandir ;;
++ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
++ mandir=$ac_optarg ;;
++
++ -nfp | --nfp | --nf)
++ # Obsolete; use --without-fp.
++ with_fp=no ;;
++
++ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
++ | --no-cr | --no-c | -n)
++ no_create=yes ;;
++
++ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
++ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
++ no_recursion=yes ;;
++
++ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
++ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
++ | --oldin | --oldi | --old | --ol | --o)
++ ac_prev=oldincludedir ;;
++ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
++ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
++ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
++ oldincludedir=$ac_optarg ;;
++
++ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
++ ac_prev=prefix ;;
++ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
++ prefix=$ac_optarg ;;
++
++ -program-prefix | --program-prefix | --program-prefi | --program-pref \
++ | --program-pre | --program-pr | --program-p)
++ ac_prev=program_prefix ;;
++ -program-prefix=* | --program-prefix=* | --program-prefi=* \
++ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
++ program_prefix=$ac_optarg ;;
++
++ -program-suffix | --program-suffix | --program-suffi | --program-suff \
++ | --program-suf | --program-su | --program-s)
++ ac_prev=program_suffix ;;
++ -program-suffix=* | --program-suffix=* | --program-suffi=* \
++ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
++ program_suffix=$ac_optarg ;;
++
++ -program-transform-name | --program-transform-name \
++ | --program-transform-nam | --program-transform-na \
++ | --program-transform-n | --program-transform- \
++ | --program-transform | --program-transfor \
++ | --program-transfo | --program-transf \
++ | --program-trans | --program-tran \
++ | --progr-tra | --program-tr | --program-t)
++ ac_prev=program_transform_name ;;
++ -program-transform-name=* | --program-transform-name=* \
++ | --program-transform-nam=* | --program-transform-na=* \
++ | --program-transform-n=* | --program-transform-=* \
++ | --program-transform=* | --program-transfor=* \
++ | --program-transfo=* | --program-transf=* \
++ | --program-trans=* | --program-tran=* \
++ | --progr-tra=* | --program-tr=* | --program-t=*)
++ program_transform_name=$ac_optarg ;;
++
++ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
++ | -silent | --silent | --silen | --sile | --sil)
++ silent=yes ;;
++
++ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
++ ac_prev=sbindir ;;
++ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
++ | --sbi=* | --sb=*)
++ sbindir=$ac_optarg ;;
++
++ -sharedstatedir | --sharedstatedir | --sharedstatedi \
++ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
++ | --sharedst | --shareds | --shared | --share | --shar \
++ | --sha | --sh)
++ ac_prev=sharedstatedir ;;
++ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
++ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
++ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
++ | --sha=* | --sh=*)
++ sharedstatedir=$ac_optarg ;;
++
++ -site | --site | --sit)
++ ac_prev=site ;;
++ -site=* | --site=* | --sit=*)
++ site=$ac_optarg ;;
++
++ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
++ ac_prev=srcdir ;;
++ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
++ srcdir=$ac_optarg ;;
++
++ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
++ | --syscon | --sysco | --sysc | --sys | --sy)
++ ac_prev=sysconfdir ;;
++ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
++ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
++ sysconfdir=$ac_optarg ;;
++
++ -target | --target | --targe | --targ | --tar | --ta | --t)
++ ac_prev=target_alias ;;
++ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
++ target_alias=$ac_optarg ;;
++
++ -v | -verbose | --verbose | --verbos | --verbo | --verb)
++ verbose=yes ;;
++
++ -version | --version | --versio | --versi | --vers | -V)
++ ac_init_version=: ;;
++
++ -with-* | --with-*)
++ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
++ # Reject names that are not valid shell variable names.
++ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
++ { echo "$as_me: error: invalid package name: $ac_package" >&2
++ { (exit 1); exit 1; }; }
++ ac_package=`echo $ac_package| sed 's/-/_/g'`
++ case $ac_option in
++ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
++ *) ac_optarg=yes ;;
++ esac
++ eval "with_$ac_package='$ac_optarg'" ;;
++
++ -without-* | --without-*)
++ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
++ # Reject names that are not valid shell variable names.
++ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
++ { echo "$as_me: error: invalid package name: $ac_package" >&2
++ { (exit 1); exit 1; }; }
++ ac_package=`echo $ac_package | sed 's/-/_/g'`
++ eval "with_$ac_package=no" ;;
++
++ --x)
++ # Obsolete; use --with-x.
++ with_x=yes ;;
++
++ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
++ | --x-incl | --x-inc | --x-in | --x-i)
++ ac_prev=x_includes ;;
++ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
++ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
++ x_includes=$ac_optarg ;;
++
++ -x-libraries | --x-libraries | --x-librarie | --x-librari \
++ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
++ ac_prev=x_libraries ;;
++ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
++ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
++ x_libraries=$ac_optarg ;;
++
++ -*) { echo "$as_me: error: unrecognized option: $ac_option
++Try \`$0 --help' for more information." >&2
++ { (exit 1); exit 1; }; }
++ ;;
++
++ *=*)
++ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
++ # Reject names that are not valid shell variable names.
++ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
++ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
++ { (exit 1); exit 1; }; }
++ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
++ eval "$ac_envvar='$ac_optarg'"
++ export $ac_envvar ;;
++
++ *)
++ # FIXME: should be removed in autoconf 3.0.
++ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
++ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
++ echo "$as_me: WARNING: invalid host type: $ac_option" >&2
++ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
++ ;;
++
++ esac
++done
++
++if test -n "$ac_prev"; then
++ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
++ { echo "$as_me: error: missing argument to $ac_option" >&2
++ { (exit 1); exit 1; }; }
++fi
++
++# Be sure to have absolute paths.
++for ac_var in exec_prefix prefix
++do
++ eval ac_val=$`echo $ac_var`
++ case $ac_val in
++ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
++ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
++ { (exit 1); exit 1; }; };;
++ esac
++done
++
++# Be sure to have absolute paths.
++for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
++ localstatedir libdir includedir oldincludedir infodir mandir
++do
++ eval ac_val=$`echo $ac_var`
++ case $ac_val in
++ [\\/$]* | ?:[\\/]* ) ;;
++ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
++ { (exit 1); exit 1; }; };;
++ esac
++done
++
++# There might be people who depend on the old broken behavior: `$host'
++# used to hold the argument of --host etc.
++# FIXME: To remove some day.
++build=$build_alias
++host=$host_alias
++target=$target_alias
++
++# FIXME: To remove some day.
++if test "x$host_alias" != x; then
++ if test "x$build_alias" = x; then
++ cross_compiling=maybe
++ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
++ If a cross compiler is detected then cross compile mode will be used." >&2
++ elif test "x$build_alias" != "x$host_alias"; then
++ cross_compiling=yes
++ fi
++fi
++
++ac_tool_prefix=
++test -n "$host_alias" && ac_tool_prefix=$host_alias-
++
++test "$silent" = yes && exec 6>/dev/null
++
++
++# Find the source files, if location was not specified.
++if test -z "$srcdir"; then
++ ac_srcdir_defaulted=yes
++ # Try the directory containing this script, then its parent.
++ ac_confdir=`(dirname "$0") 2>/dev/null ||
++$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$0" : 'X\(//\)[^/]' \| \
++ X"$0" : 'X\(//\)$' \| \
++ X"$0" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$0" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ srcdir=$ac_confdir
++ if test ! -r $srcdir/$ac_unique_file; then
++ srcdir=..
++ fi
++else
++ ac_srcdir_defaulted=no
++fi
++if test ! -r $srcdir/$ac_unique_file; then
++ if test "$ac_srcdir_defaulted" = yes; then
++ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
++ { (exit 1); exit 1; }; }
++ else
++ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
++ { (exit 1); exit 1; }; }
++ fi
++fi
++(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
++ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
++ { (exit 1); exit 1; }; }
++srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
++ac_env_build_alias_set=${build_alias+set}
++ac_env_build_alias_value=$build_alias
++ac_cv_env_build_alias_set=${build_alias+set}
++ac_cv_env_build_alias_value=$build_alias
++ac_env_host_alias_set=${host_alias+set}
++ac_env_host_alias_value=$host_alias
++ac_cv_env_host_alias_set=${host_alias+set}
++ac_cv_env_host_alias_value=$host_alias
++ac_env_target_alias_set=${target_alias+set}
++ac_env_target_alias_value=$target_alias
++ac_cv_env_target_alias_set=${target_alias+set}
++ac_cv_env_target_alias_value=$target_alias
++ac_env_CCAS_set=${CCAS+set}
++ac_env_CCAS_value=$CCAS
++ac_cv_env_CCAS_set=${CCAS+set}
++ac_cv_env_CCAS_value=$CCAS
++ac_env_CCASFLAGS_set=${CCASFLAGS+set}
++ac_env_CCASFLAGS_value=$CCASFLAGS
++ac_cv_env_CCASFLAGS_set=${CCASFLAGS+set}
++ac_cv_env_CCASFLAGS_value=$CCASFLAGS
++
++#
++# Report the --help message.
++#
++if test "$ac_init_help" = "long"; then
++ # Omit some internal or obsolete options to make the list less imposing.
++ # This message is too long to be a string in the A/UX 3.1 sh.
++ cat <<_ACEOF
++\`configure' configures newlib 1.15.0 to adapt to many kinds of systems.
++
++Usage: $0 [OPTION]... [VAR=VALUE]...
++
++To assign environment variables (e.g., CC, CFLAGS...), specify them as
++VAR=VALUE. See below for descriptions of some of the useful variables.
++
++Defaults for the options are specified in brackets.
++
++Configuration:
++ -h, --help display this help and exit
++ --help=short display options specific to this package
++ --help=recursive display the short help of all the included packages
++ -V, --version display version information and exit
++ -q, --quiet, --silent do not print \`checking...' messages
++ --cache-file=FILE cache test results in FILE [disabled]
++ -C, --config-cache alias for \`--cache-file=config.cache'
++ -n, --no-create do not create output files
++ --srcdir=DIR find the sources in DIR [configure dir or \`..']
++
++_ACEOF
++
++ cat <<_ACEOF
++Installation directories:
++ --prefix=PREFIX install architecture-independent files in PREFIX
++ [$ac_default_prefix]
++ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
++ [PREFIX]
++
++By default, \`make install' will install all the files in
++\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
++an installation prefix other than \`$ac_default_prefix' using \`--prefix',
++for instance \`--prefix=\$HOME'.
++
++For better control, use the options below.
++
++Fine tuning of the installation directories:
++ --bindir=DIR user executables [EPREFIX/bin]
++ --sbindir=DIR system admin executables [EPREFIX/sbin]
++ --libexecdir=DIR program executables [EPREFIX/libexec]
++ --datadir=DIR read-only architecture-independent data [PREFIX/share]
++ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
++ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
++ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
++ --libdir=DIR object code libraries [EPREFIX/lib]
++ --includedir=DIR C header files [PREFIX/include]
++ --oldincludedir=DIR C header files for non-gcc [/usr/include]
++ --infodir=DIR info documentation [PREFIX/info]
++ --mandir=DIR man documentation [PREFIX/man]
++_ACEOF
++
++ cat <<\_ACEOF
++
++Program names:
++ --program-prefix=PREFIX prepend PREFIX to installed program names
++ --program-suffix=SUFFIX append SUFFIX to installed program names
++ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
++
++System types:
++ --build=BUILD configure for building on BUILD [guessed]
++ --host=HOST cross-compile to build programs to run on HOST [BUILD]
++_ACEOF
++fi
++
++if test -n "$ac_init_help"; then
++ case $ac_init_help in
++ short | recursive ) echo "Configuration of newlib 1.15.0:";;
++ esac
++ cat <<\_ACEOF
++
++Optional Features:
++ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
++ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
++ --enable-multilib build many library versions (default)
++ --enable-target-optspace optimize for space
++ --enable-malloc-debugging indicate malloc debugging requested
++ --enable-newlib-multithread enable support for multiple threads
++ --enable-newlib-iconv enable iconv library support
++ --enable-newlib-elix-level supply desired elix library level (1-4)
++ --disable-newlib-io-float disable printf/scanf family float support
++ --disable-newlib-supplied-syscalls disable newlib from supplying syscalls
++ --disable-dependency-tracking speeds up one-time build
++ --enable-dependency-tracking do not reject slow dependency extractors
++ --enable-maintainer-mode enable make rules and dependencies not useful
++ (and sometimes confusing) to the casual installer
++
++Some influential environment variables:
++ CCAS assembler compiler command (defaults to CC)
++ CCASFLAGS assembler compiler flags (defaults to CFLAGS)
++
++Use these variables to override the choices made by `configure' or to help
++it to find libraries and programs with nonstandard names/locations.
++
++_ACEOF
++fi
++
++if test "$ac_init_help" = "recursive"; then
++ # If there are subdirs, report their specific --help.
++ ac_popdir=`pwd`
++ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
++ test -d $ac_dir || continue
++ ac_builddir=.
++
++if test "$ac_dir" != .; then
++ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
++ # A "../" for each directory in $ac_dir_suffix.
++ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
++else
++ ac_dir_suffix= ac_top_builddir=
++fi
++
++case $srcdir in
++ .) # No --srcdir option. We are building in place.
++ ac_srcdir=.
++ if test -z "$ac_top_builddir"; then
++ ac_top_srcdir=.
++ else
++ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
++ fi ;;
++ [\\/]* | ?:[\\/]* ) # Absolute path.
++ ac_srcdir=$srcdir$ac_dir_suffix;
++ ac_top_srcdir=$srcdir ;;
++ *) # Relative path.
++ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
++ ac_top_srcdir=$ac_top_builddir$srcdir ;;
++esac
++
++# Do not use `cd foo && pwd` to compute absolute paths, because
++# the directories may not exist.
++case `pwd` in
++.) ac_abs_builddir="$ac_dir";;
++*)
++ case "$ac_dir" in
++ .) ac_abs_builddir=`pwd`;;
++ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
++ *) ac_abs_builddir=`pwd`/"$ac_dir";;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_builddir=${ac_top_builddir}.;;
++*)
++ case ${ac_top_builddir}. in
++ .) ac_abs_top_builddir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
++ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_srcdir=$ac_srcdir;;
++*)
++ case $ac_srcdir in
++ .) ac_abs_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
++ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_srcdir=$ac_top_srcdir;;
++*)
++ case $ac_top_srcdir in
++ .) ac_abs_top_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
++ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
++ esac;;
++esac
++
++ cd $ac_dir
++ # Check for guested configure; otherwise get Cygnus style configure.
++ if test -f $ac_srcdir/configure.gnu; then
++ echo
++ $SHELL $ac_srcdir/configure.gnu --help=recursive
++ elif test -f $ac_srcdir/configure; then
++ echo
++ $SHELL $ac_srcdir/configure --help=recursive
++ elif test -f $ac_srcdir/configure.ac ||
++ test -f $ac_srcdir/configure.in; then
++ echo
++ $ac_configure --help
++ else
++ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
++ fi
++ cd $ac_popdir
++ done
++fi
++
++test -n "$ac_init_help" && exit 0
++if $ac_init_version; then
++ cat <<\_ACEOF
++newlib configure 1.15.0
++generated by GNU Autoconf 2.59
++
++Copyright (C) 2003 Free Software Foundation, Inc.
++This configure script is free software; the Free Software Foundation
++gives unlimited permission to copy, distribute and modify it.
++_ACEOF
++ exit 0
++fi
++exec 5>config.log
++cat >&5 <<_ACEOF
++This file contains any messages produced by compilers while
++running configure, to aid debugging if configure makes a mistake.
++
++It was created by newlib $as_me 1.15.0, which was
++generated by GNU Autoconf 2.59. Invocation command line was
++
++ $ $0 $@
++
++_ACEOF
++{
++cat <<_ASUNAME
++## --------- ##
++## Platform. ##
++## --------- ##
++
++hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
++uname -m = `(uname -m) 2>/dev/null || echo unknown`
++uname -r = `(uname -r) 2>/dev/null || echo unknown`
++uname -s = `(uname -s) 2>/dev/null || echo unknown`
++uname -v = `(uname -v) 2>/dev/null || echo unknown`
++
++/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
++/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
++
++/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
++/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
++/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
++hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
++/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
++/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
++/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
++
++_ASUNAME
++
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ echo "PATH: $as_dir"
++done
++
++} >&5
++
++cat >&5 <<_ACEOF
++
++
++## ----------- ##
++## Core tests. ##
++## ----------- ##
++
++_ACEOF
++
++
++# Keep a trace of the command line.
++# Strip out --no-create and --no-recursion so they do not pile up.
++# Strip out --silent because we don't want to record it for future runs.
++# Also quote any args containing shell meta-characters.
++# Make two passes to allow for proper duplicate-argument suppression.
++ac_configure_args=
++ac_configure_args0=
++ac_configure_args1=
++ac_sep=
++ac_must_keep_next=false
++for ac_pass in 1 2
++do
++ for ac_arg
++ do
++ case $ac_arg in
++ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
++ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
++ | -silent | --silent | --silen | --sile | --sil)
++ continue ;;
++ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
++ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
++ esac
++ case $ac_pass in
++ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
++ 2)
++ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
++ if test $ac_must_keep_next = true; then
++ ac_must_keep_next=false # Got value, back to normal.
++ else
++ case $ac_arg in
++ *=* | --config-cache | -C | -disable-* | --disable-* \
++ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
++ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
++ | -with-* | --with-* | -without-* | --without-* | --x)
++ case "$ac_configure_args0 " in
++ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
++ esac
++ ;;
++ -* ) ac_must_keep_next=true ;;
++ esac
++ fi
++ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
++ # Get rid of the leading space.
++ ac_sep=" "
++ ;;
++ esac
++ done
++done
++$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
++$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
++
++# When interrupted or exit'd, cleanup temporary files, and complete
++# config.log. We remove comments because anyway the quotes in there
++# would cause problems or look ugly.
++# WARNING: Be sure not to use single quotes in there, as some shells,
++# such as our DU 5.0 friend, will then `close' the trap.
++trap 'exit_status=$?
++ # Save into config.log some information that might help in debugging.
++ {
++ echo
++
++ cat <<\_ASBOX
++## ---------------- ##
++## Cache variables. ##
++## ---------------- ##
++_ASBOX
++ echo
++ # The following way of writing the cache mishandles newlines in values,
++{
++ (set) 2>&1 |
++ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
++ *ac_space=\ *)
++ sed -n \
++ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
++ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
++ ;;
++ *)
++ sed -n \
++ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
++ ;;
++ esac;
++}
++ echo
++
++ cat <<\_ASBOX
++## ----------------- ##
++## Output variables. ##
++## ----------------- ##
++_ASBOX
++ echo
++ for ac_var in $ac_subst_vars
++ do
++ eval ac_val=$`echo $ac_var`
++ echo "$ac_var='"'"'$ac_val'"'"'"
++ done | sort
++ echo
++
++ if test -n "$ac_subst_files"; then
++ cat <<\_ASBOX
++## ------------- ##
++## Output files. ##
++## ------------- ##
++_ASBOX
++ echo
++ for ac_var in $ac_subst_files
++ do
++ eval ac_val=$`echo $ac_var`
++ echo "$ac_var='"'"'$ac_val'"'"'"
++ done | sort
++ echo
++ fi
++
++ if test -s confdefs.h; then
++ cat <<\_ASBOX
++## ----------- ##
++## confdefs.h. ##
++## ----------- ##
++_ASBOX
++ echo
++ sed "/^$/d" confdefs.h | sort
++ echo
++ fi
++ test "$ac_signal" != 0 &&
++ echo "$as_me: caught signal $ac_signal"
++ echo "$as_me: exit $exit_status"
++ } >&5
++ rm -f core *.core &&
++ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
++ exit $exit_status
++ ' 0
++for ac_signal in 1 2 13 15; do
++ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
++done
++ac_signal=0
++
++# confdefs.h avoids OS command line length limits that DEFS can exceed.
++rm -rf conftest* confdefs.h
++# AIX cpp loses on an empty file, so make sure it contains at least a newline.
++echo >confdefs.h
++
++# Predefined preprocessor variables.
++
++cat >>confdefs.h <<_ACEOF
++#define PACKAGE_NAME "$PACKAGE_NAME"
++_ACEOF
++
++
++cat >>confdefs.h <<_ACEOF
++#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
++_ACEOF
++
++
++cat >>confdefs.h <<_ACEOF
++#define PACKAGE_VERSION "$PACKAGE_VERSION"
++_ACEOF
++
++
++cat >>confdefs.h <<_ACEOF
++#define PACKAGE_STRING "$PACKAGE_STRING"
++_ACEOF
++
++
++cat >>confdefs.h <<_ACEOF
++#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
++_ACEOF
++
++
++# Let the site file select an alternate cache file if it wants to.
++# Prefer explicitly selected file to automatically selected ones.
++if test -z "$CONFIG_SITE"; then
++ if test "x$prefix" != xNONE; then
++ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
++ else
++ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
++ fi
++fi
++for ac_site_file in $CONFIG_SITE; do
++ if test -r "$ac_site_file"; then
++ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
++echo "$as_me: loading site script $ac_site_file" >&6;}
++ sed 's/^/| /' "$ac_site_file" >&5
++ . "$ac_site_file"
++ fi
++done
++
++if test -r "$cache_file"; then
++ # Some versions of bash will fail to source /dev/null (special
++ # files actually), so we avoid doing that.
++ if test -f "$cache_file"; then
++ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
++echo "$as_me: loading cache $cache_file" >&6;}
++ case $cache_file in
++ [\\/]* | ?:[\\/]* ) . $cache_file;;
++ *) . ./$cache_file;;
++ esac
++ fi
++else
++ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
++echo "$as_me: creating cache $cache_file" >&6;}
++ >$cache_file
++fi
++
++# Check that the precious variables saved in the cache have kept the same
++# value.
++ac_cache_corrupted=false
++for ac_var in `(set) 2>&1 |
++ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
++ eval ac_old_set=\$ac_cv_env_${ac_var}_set
++ eval ac_new_set=\$ac_env_${ac_var}_set
++ eval ac_old_val="\$ac_cv_env_${ac_var}_value"
++ eval ac_new_val="\$ac_env_${ac_var}_value"
++ case $ac_old_set,$ac_new_set in
++ set,)
++ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
++echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
++ ac_cache_corrupted=: ;;
++ ,set)
++ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
++echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
++ ac_cache_corrupted=: ;;
++ ,);;
++ *)
++ if test "x$ac_old_val" != "x$ac_new_val"; then
++ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
++echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
++ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
++echo "$as_me: former value: $ac_old_val" >&2;}
++ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
++echo "$as_me: current value: $ac_new_val" >&2;}
++ ac_cache_corrupted=:
++ fi;;
++ esac
++ # Pass precious variables to config.status.
++ if test "$ac_new_set" = set; then
++ case $ac_new_val in
++ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
++ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
++ *) ac_arg=$ac_var=$ac_new_val ;;
++ esac
++ case " $ac_configure_args " in
++ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
++ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
++ esac
++ fi
++done
++if $ac_cache_corrupted; then
++ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
++echo "$as_me: error: changes in the environment can compromise the build" >&2;}
++ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
++echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
++ { (exit 1); exit 1; }; }
++fi
++
++ac_ext=c
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_c_compiler_gnu
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++ac_aux_dir=
++for ac_dir in ../../../.. $srcdir/../../../..; do
++ if test -f $ac_dir/install-sh; then
++ ac_aux_dir=$ac_dir
++ ac_install_sh="$ac_aux_dir/install-sh -c"
++ break
++ elif test -f $ac_dir/install.sh; then
++ ac_aux_dir=$ac_dir
++ ac_install_sh="$ac_aux_dir/install.sh -c"
++ break
++ elif test -f $ac_dir/shtool; then
++ ac_aux_dir=$ac_dir
++ ac_install_sh="$ac_aux_dir/shtool install -c"
++ break
++ fi
++done
++if test -z "$ac_aux_dir"; then
++ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in ../../../.. $srcdir/../../../.." >&5
++echo "$as_me: error: cannot find install-sh or install.sh in ../../../.. $srcdir/../../../.." >&2;}
++ { (exit 1); exit 1; }; }
++fi
++ac_config_guess="$SHELL $ac_aux_dir/config.guess"
++ac_config_sub="$SHELL $ac_aux_dir/config.sub"
++ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
++
++
++
++# Make sure we can run config.sub.
++$ac_config_sub sun4 >/dev/null 2>&1 ||
++ { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
++echo "$as_me: error: cannot run $ac_config_sub" >&2;}
++ { (exit 1); exit 1; }; }
++
++echo "$as_me:$LINENO: checking build system type" >&5
++echo $ECHO_N "checking build system type... $ECHO_C" >&6
++if test "${ac_cv_build+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_cv_build_alias=$build_alias
++test -z "$ac_cv_build_alias" &&
++ ac_cv_build_alias=`$ac_config_guess`
++test -z "$ac_cv_build_alias" &&
++ { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
++echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
++ { (exit 1); exit 1; }; }
++ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
++ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
++echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
++ { (exit 1); exit 1; }; }
++
++fi
++echo "$as_me:$LINENO: result: $ac_cv_build" >&5
++echo "${ECHO_T}$ac_cv_build" >&6
++build=$ac_cv_build
++build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
++build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
++build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
++
++
++am__api_version="1.9"
++# Find a good install program. We prefer a C program (faster),
++# so one script is as good as another. But avoid the broken or
++# incompatible versions:
++# SysV /etc/install, /usr/sbin/install
++# SunOS /usr/etc/install
++# IRIX /sbin/install
++# AIX /bin/install
++# AmigaOS /C/install, which installs bootblocks on floppy discs
++# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
++# AFS /usr/afsws/bin/install, which mishandles nonexistent args
++# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
++# OS/2's system install, which has a completely different semantic
++# ./install, which can be erroneously created by make from ./install.sh.
++echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
++echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
++if test -z "$INSTALL"; then
++if test "${ac_cv_path_install+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ # Account for people who put trailing slashes in PATH elements.
++case $as_dir/ in
++ ./ | .// | /cC/* | \
++ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
++ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
++ /usr/ucb/* ) ;;
++ *)
++ # OSF1 and SCO ODT 3.0 have their own names for install.
++ # Don't use installbsd from OSF since it installs stuff as root
++ # by default.
++ for ac_prog in ginstall scoinst install; do
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
++ if test $ac_prog = install &&
++ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
++ # AIX install. It has an incompatible calling convention.
++ :
++ elif test $ac_prog = install &&
++ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
++ # program-specific install script used by HP pwplus--don't use.
++ :
++ else
++ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
++ break 3
++ fi
++ fi
++ done
++ done
++ ;;
++esac
++done
++
++
++fi
++ if test "${ac_cv_path_install+set}" = set; then
++ INSTALL=$ac_cv_path_install
++ else
++ # As a last resort, use the slow shell script. We don't cache a
++ # path for INSTALL within a source directory, because that will
++ # break other packages using the cache if that directory is
++ # removed, or if the path is relative.
++ INSTALL=$ac_install_sh
++ fi
++fi
++echo "$as_me:$LINENO: result: $INSTALL" >&5
++echo "${ECHO_T}$INSTALL" >&6
++
++# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
++# It thinks the first close brace ends the variable substitution.
++test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
++
++test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
++
++test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
++
++echo "$as_me:$LINENO: checking whether build environment is sane" >&5
++echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
++# Just in case
++sleep 1
++echo timestamp > conftest.file
++# Do `set' in a subshell so we don't clobber the current shell's
++# arguments. Must try -L first in case configure is actually a
++# symlink; some systems play weird games with the mod time of symlinks
++# (eg FreeBSD returns the mod time of the symlink's containing
++# directory).
++if (
++ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
++ if test "$*" = "X"; then
++ # -L didn't work.
++ set X `ls -t $srcdir/configure conftest.file`
++ fi
++ rm -f conftest.file
++ if test "$*" != "X $srcdir/configure conftest.file" \
++ && test "$*" != "X conftest.file $srcdir/configure"; then
++
++ # If neither matched, then we have a broken ls. This can happen
++ # if, for instance, CONFIG_SHELL is bash and it inherits a
++ # broken ls alias from the environment. This has actually
++ # happened. Such a system could not be considered "sane".
++ { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
++alias in your environment" >&5
++echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
++alias in your environment" >&2;}
++ { (exit 1); exit 1; }; }
++ fi
++
++ test "$2" = conftest.file
++ )
++then
++ # Ok.
++ :
++else
++ { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
++Check your system clock" >&5
++echo "$as_me: error: newly created file is older than distributed files!
++Check your system clock" >&2;}
++ { (exit 1); exit 1; }; }
++fi
++echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
++test "$program_prefix" != NONE &&
++ program_transform_name="s,^,$program_prefix,;$program_transform_name"
++# Use a double $ so make ignores it.
++test "$program_suffix" != NONE &&
++ program_transform_name="s,\$,$program_suffix,;$program_transform_name"
++# Double any \ or $. echo might interpret backslashes.
++# By default was `s,x,x', remove it if useless.
++cat <<\_ACEOF >conftest.sed
++s/[\\$]/&&/g;s/;s,x,x,$//
++_ACEOF
++program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
++rm conftest.sed
++
++# expand $ac_aux_dir to an absolute path
++am_aux_dir=`cd $ac_aux_dir && pwd`
++
++test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
++# Use eval to expand $SHELL
++if eval "$MISSING --run true"; then
++ am_missing_run="$MISSING --run "
++else
++ am_missing_run=
++ { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
++echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
++fi
++
++if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
++ # We used to keeping the `.' as first argument, in order to
++ # allow $(mkdir_p) to be used without argument. As in
++ # $(mkdir_p) $(somedir)
++ # where $(somedir) is conditionally defined. However this is wrong
++ # for two reasons:
++ # 1. if the package is installed by a user who cannot write `.'
++ # make install will fail,
++ # 2. the above comment should most certainly read
++ # $(mkdir_p) $(DESTDIR)$(somedir)
++ # so it does not work when $(somedir) is undefined and
++ # $(DESTDIR) is not.
++ # To support the latter case, we have to write
++ # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
++ # so the `.' trick is pointless.
++ mkdir_p='mkdir -p --'
++else
++ # On NextStep and OpenStep, the `mkdir' command does not
++ # recognize any option. It will interpret all options as
++ # directories to create, and then abort because `.' already
++ # exists.
++ for d in ./-p ./--version;
++ do
++ test -d $d && rmdir $d
++ done
++ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
++ if test -f "$ac_aux_dir/mkinstalldirs"; then
++ mkdir_p='$(mkinstalldirs)'
++ else
++ mkdir_p='$(install_sh) -d'
++ fi
++fi
++
++for ac_prog in gawk mawk nawk awk
++do
++ # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_AWK+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$AWK"; then
++ ac_cv_prog_AWK="$AWK" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_AWK="$ac_prog"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++AWK=$ac_cv_prog_AWK
++if test -n "$AWK"; then
++ echo "$as_me:$LINENO: result: $AWK" >&5
++echo "${ECHO_T}$AWK" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ test -n "$AWK" && break
++done
++
++echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
++echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
++set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
++if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.make <<\_ACEOF
++all:
++ @echo 'ac_maketemp="$(MAKE)"'
++_ACEOF
++# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
++eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
++if test -n "$ac_maketemp"; then
++ eval ac_cv_prog_make_${ac_make}_set=yes
++else
++ eval ac_cv_prog_make_${ac_make}_set=no
++fi
++rm -f conftest.make
++fi
++if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
++ echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
++ SET_MAKE=
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++ SET_MAKE="MAKE=${MAKE-make}"
++fi
++
++rm -rf .tst 2>/dev/null
++mkdir .tst 2>/dev/null
++if test -d .tst; then
++ am__leading_dot=.
++else
++ am__leading_dot=_
++fi
++rmdir .tst 2>/dev/null
++
++DEPDIR="${am__leading_dot}deps"
++
++ ac_config_commands="$ac_config_commands depfiles"
++
++
++am_make=${MAKE-make}
++cat > confinc << 'END'
++am__doit:
++ @echo done
++.PHONY: am__doit
++END
++# If we don't find an include directive, just comment out the code.
++echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
++echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
++am__include="#"
++am__quote=
++_am_result=none
++# First try GNU make style include.
++echo "include confinc" > confmf
++# We grep out `Entering directory' and `Leaving directory'
++# messages which can occur if `w' ends up in MAKEFLAGS.
++# In particular we don't look at `^make:' because GNU make might
++# be invoked under some other name (usually "gmake"), in which
++# case it prints its new name instead of `make'.
++if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
++ am__include=include
++ am__quote=
++ _am_result=GNU
++fi
++# Now try BSD make style include.
++if test "$am__include" = "#"; then
++ echo '.include "confinc"' > confmf
++ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
++ am__include=.include
++ am__quote="\""
++ _am_result=BSD
++ fi
++fi
++
++
++echo "$as_me:$LINENO: result: $_am_result" >&5
++echo "${ECHO_T}$_am_result" >&6
++rm -f confinc confmf
++
++# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
++if test "${enable_dependency_tracking+set}" = set; then
++ enableval="$enable_dependency_tracking"
++
++fi;
++if test "x$enable_dependency_tracking" != xno; then
++ am_depcomp="$ac_aux_dir/depcomp"
++ AMDEPBACKSLASH='\'
++fi
++
++
++if test "x$enable_dependency_tracking" != xno; then
++ AMDEP_TRUE=
++ AMDEP_FALSE='#'
++else
++ AMDEP_TRUE='#'
++ AMDEP_FALSE=
++fi
++
++
++
++
++# Check whether --enable-multilib or --disable-multilib was given.
++if test "${enable_multilib+set}" = set; then
++ enableval="$enable_multilib"
++ case "${enableval}" in
++ yes) multilib=yes ;;
++ no) multilib=no ;;
++ *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for multilib option" >&5
++echo "$as_me: error: bad value ${enableval} for multilib option" >&2;}
++ { (exit 1); exit 1; }; } ;;
++ esac
++else
++ multilib=yes
++fi;
++# Check whether --enable-target-optspace or --disable-target-optspace was given.
++if test "${enable_target_optspace+set}" = set; then
++ enableval="$enable_target_optspace"
++ case "${enableval}" in
++ yes) target_optspace=yes ;;
++ no) target_optspace=no ;;
++ *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for target-optspace option" >&5
++echo "$as_me: error: bad value ${enableval} for target-optspace option" >&2;}
++ { (exit 1); exit 1; }; } ;;
++ esac
++else
++ target_optspace=
++fi;
++# Check whether --enable-malloc-debugging or --disable-malloc-debugging was given.
++if test "${enable_malloc_debugging+set}" = set; then
++ enableval="$enable_malloc_debugging"
++ case "${enableval}" in
++ yes) malloc_debugging=yes ;;
++ no) malloc_debugging=no ;;
++ *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for malloc-debugging option" >&5
++echo "$as_me: error: bad value ${enableval} for malloc-debugging option" >&2;}
++ { (exit 1); exit 1; }; } ;;
++ esac
++else
++ malloc_debugging=
++fi;
++# Check whether --enable-newlib-multithread or --disable-newlib-multithread was given.
++if test "${enable_newlib_multithread+set}" = set; then
++ enableval="$enable_newlib_multithread"
++ case "${enableval}" in
++ yes) newlib_multithread=yes ;;
++ no) newlib_multithread=no ;;
++ *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for newlib-multithread option" >&5
++echo "$as_me: error: bad value ${enableval} for newlib-multithread option" >&2;}
++ { (exit 1); exit 1; }; } ;;
++ esac
++else
++ newlib_multithread=yes
++fi;
++# Check whether --enable-newlib-iconv or --disable-newlib-iconv was given.
++if test "${enable_newlib_iconv+set}" = set; then
++ enableval="$enable_newlib_iconv"
++ if test "${newlib_iconv+set}" != set; then
++ case "${enableval}" in
++ yes) newlib_iconv=yes ;;
++ no) newlib_iconv=no ;;
++ *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for newlib-iconv option" >&5
++echo "$as_me: error: bad value ${enableval} for newlib-iconv option" >&2;}
++ { (exit 1); exit 1; }; } ;;
++ esac
++ fi
++else
++ newlib_iconv=${newlib_iconv}
++fi;
++# Check whether --enable-newlib-elix-level or --disable-newlib-elix-level was given.
++if test "${enable_newlib_elix_level+set}" = set; then
++ enableval="$enable_newlib_elix_level"
++ case "${enableval}" in
++ 0) newlib_elix_level=0 ;;
++ 1) newlib_elix_level=1 ;;
++ 2) newlib_elix_level=2 ;;
++ 3) newlib_elix_level=3 ;;
++ 4) newlib_elix_level=4 ;;
++ *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for newlib-elix-level option" >&5
++echo "$as_me: error: bad value ${enableval} for newlib-elix-level option" >&2;}
++ { (exit 1); exit 1; }; } ;;
++ esac
++else
++ newlib_elix_level=0
++fi;
++# Check whether --enable-newlib-io-float or --disable-newlib-io-float was given.
++if test "${enable_newlib_io_float+set}" = set; then
++ enableval="$enable_newlib_io_float"
++ case "${enableval}" in
++ yes) newlib_io_float=yes ;;
++ no) newlib_io_float=no ;;
++ *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for newlib-io-float option" >&5
++echo "$as_me: error: bad value ${enableval} for newlib-io-float option" >&2;}
++ { (exit 1); exit 1; }; } ;;
++ esac
++else
++ newlib_io_float=yes
++fi;
++# Check whether --enable-newlib-supplied-syscalls or --disable-newlib-supplied-syscalls was given.
++if test "${enable_newlib_supplied_syscalls+set}" = set; then
++ enableval="$enable_newlib_supplied_syscalls"
++ case "${enableval}" in
++ yes) newlib_may_supply_syscalls=yes ;;
++ no) newlib_may_supply_syscalls=no ;;
++ *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for newlib-supplied-syscalls option" >&5
++echo "$as_me: error: bad value ${enableval} for newlib-supplied-syscalls option" >&2;}
++ { (exit 1); exit 1; }; } ;;
++ esac
++else
++ newlib_may_supply_syscalls=yes
++fi;
++
++
++if test x${newlib_may_supply_syscalls} = xyes; then
++ MAY_SUPPLY_SYSCALLS_TRUE=
++ MAY_SUPPLY_SYSCALLS_FALSE='#'
++else
++ MAY_SUPPLY_SYSCALLS_TRUE='#'
++ MAY_SUPPLY_SYSCALLS_FALSE=
++fi
++
++
++
++test -z "${with_target_subdir}" && with_target_subdir=.
++
++if test "${srcdir}" = "."; then
++ if test "${with_target_subdir}" != "."; then
++ newlib_basedir="${srcdir}/${with_multisrctop}../../../.."
++ else
++ newlib_basedir="${srcdir}/${with_multisrctop}../../.."
++ fi
++else
++ newlib_basedir="${srcdir}/../../.."
++fi
++
++
++echo "$as_me:$LINENO: checking host system type" >&5
++echo $ECHO_N "checking host system type... $ECHO_C" >&6
++if test "${ac_cv_host+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_cv_host_alias=$host_alias
++test -z "$ac_cv_host_alias" &&
++ ac_cv_host_alias=$ac_cv_build_alias
++ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
++ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
++echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
++ { (exit 1); exit 1; }; }
++
++fi
++echo "$as_me:$LINENO: result: $ac_cv_host" >&5
++echo "${ECHO_T}$ac_cv_host" >&6
++host=$ac_cv_host
++host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
++host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
++host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
++
++
++
++# test to see if srcdir already configured
++if test "`cd $srcdir && pwd`" != "`pwd`" &&
++ test -f $srcdir/config.status; then
++ { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
++echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
++ { (exit 1); exit 1; }; }
++fi
++
++# test whether we have cygpath
++if test -z "$CYGPATH_W"; then
++ if (cygpath --version) >/dev/null 2>/dev/null; then
++ CYGPATH_W='cygpath -w'
++ else
++ CYGPATH_W=echo
++ fi
++fi
++
++
++# Define the identity of the package.
++ PACKAGE='newlib'
++ VERSION='1.15.0'
++
++
++# Some tools Automake needs.
++
++ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
++
++
++AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
++
++
++AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
++
++
++AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
++
++
++MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
++
++install_sh=${install_sh-"$am_aux_dir/install-sh"}
++
++# Installed binaries are usually stripped using `strip' when the user
++# run `make install-strip'. However `strip' might not be the right
++# tool to use in cross-compilation environments, therefore Automake
++# will honor the `STRIP' environment variable to overrule this program.
++if test "$cross_compiling" != no; then
++ if test -n "$ac_tool_prefix"; then
++ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
++set dummy ${ac_tool_prefix}strip; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_STRIP+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$STRIP"; then
++ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++STRIP=$ac_cv_prog_STRIP
++if test -n "$STRIP"; then
++ echo "$as_me:$LINENO: result: $STRIP" >&5
++echo "${ECHO_T}$STRIP" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++fi
++if test -z "$ac_cv_prog_STRIP"; then
++ ac_ct_STRIP=$STRIP
++ # Extract the first word of "strip", so it can be a program name with args.
++set dummy strip; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$ac_ct_STRIP"; then
++ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_ac_ct_STRIP="strip"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
++fi
++fi
++ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
++if test -n "$ac_ct_STRIP"; then
++ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
++echo "${ECHO_T}$ac_ct_STRIP" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ STRIP=$ac_ct_STRIP
++else
++ STRIP="$ac_cv_prog_STRIP"
++fi
++
++fi
++INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
++
++# We need awk for the "check" target. The system "awk" is bad on
++# some platforms.
++# Always define AMTAR for backward compatibility.
++
++AMTAR=${AMTAR-"${am_missing_run}tar"}
++
++am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
++
++
++
++
++
++
++# FIXME: We temporarily define our own version of AC_PROG_CC. This is
++# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
++# are probably using a cross compiler, which will not be able to fully
++# link an executable. This should really be fixed in autoconf
++# itself.
++
++
++
++
++
++
++
++# Extract the first word of "gcc", so it can be a program name with args.
++set dummy gcc; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_CC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$CC"; then
++ ac_cv_prog_CC="$CC" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_CC="gcc"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++CC=$ac_cv_prog_CC
++if test -n "$CC"; then
++ echo "$as_me:$LINENO: result: $CC" >&5
++echo "${ECHO_T}$CC" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++
++depcc="$CC" am_compiler_list=
++
++echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
++echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
++if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
++ # We make a subdir and do the tests there. Otherwise we can end up
++ # making bogus files that we don't know about and never remove. For
++ # instance it was reported that on HP-UX the gcc test will end up
++ # making a dummy file named `D' -- because `-MD' means `put the output
++ # in D'.
++ mkdir conftest.dir
++ # Copy depcomp to subdir because otherwise we won't find it if we're
++ # using a relative directory.
++ cp "$am_depcomp" conftest.dir
++ cd conftest.dir
++ # We will build objects and dependencies in a subdirectory because
++ # it helps to detect inapplicable dependency modes. For instance
++ # both Tru64's cc and ICC support -MD to output dependencies as a
++ # side effect of compilation, but ICC will put the dependencies in
++ # the current directory while Tru64 will put them in the object
++ # directory.
++ mkdir sub
++
++ am_cv_CC_dependencies_compiler_type=none
++ if test "$am_compiler_list" = ""; then
++ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
++ fi
++ for depmode in $am_compiler_list; do
++ # Setup a source with many dependencies, because some compilers
++ # like to wrap large dependency lists on column 80 (with \), and
++ # we should not choose a depcomp mode which is confused by this.
++ #
++ # We need to recreate these files for each test, as the compiler may
++ # overwrite some of them when testing with obscure command lines.
++ # This happens at least with the AIX C compiler.
++ : > sub/conftest.c
++ for i in 1 2 3 4 5 6; do
++ echo '#include "conftst'$i'.h"' >> sub/conftest.c
++ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
++ # Solaris 8's {/usr,}/bin/sh.
++ touch sub/conftst$i.h
++ done
++ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
++
++ case $depmode in
++ nosideeffect)
++ # after this tag, mechanisms are not by side-effect, so they'll
++ # only be used when explicitly requested
++ if test "x$enable_dependency_tracking" = xyes; then
++ continue
++ else
++ break
++ fi
++ ;;
++ none) break ;;
++ esac
++ # We check with `-c' and `-o' for the sake of the "dashmstdout"
++ # mode. It turns out that the SunPro C++ compiler does not properly
++ # handle `-M -o', and we need to detect this.
++ if depmode=$depmode \
++ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
++ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
++ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
++ >/dev/null 2>conftest.err &&
++ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
++ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
++ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
++ # icc doesn't choke on unknown options, it will just issue warnings
++ # or remarks (even with -Werror). So we grep stderr for any message
++ # that says an option was ignored or not supported.
++ # When given -MP, icc 7.0 and 7.1 complain thusly:
++ # icc: Command line warning: ignoring option '-M'; no argument required
++ # The diagnosis changed in icc 8.0:
++ # icc: Command line remark: option '-MP' not supported
++ if (grep 'ignoring option' conftest.err ||
++ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
++ am_cv_CC_dependencies_compiler_type=$depmode
++ break
++ fi
++ fi
++ done
++
++ cd ..
++ rm -rf conftest.dir
++else
++ am_cv_CC_dependencies_compiler_type=none
++fi
++
++fi
++echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
++echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
++CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
++
++
++
++if
++ test "x$enable_dependency_tracking" != xno \
++ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
++ am__fastdepCC_TRUE=
++ am__fastdepCC_FALSE='#'
++else
++ am__fastdepCC_TRUE='#'
++ am__fastdepCC_FALSE=
++fi
++
++
++if test -z "$CC"; then
++ # Extract the first word of "cc", so it can be a program name with args.
++set dummy cc; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_CC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$CC"; then
++ ac_cv_prog_CC="$CC" # Let the user override the test.
++else
++ ac_prog_rejected=no
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
++ ac_prog_rejected=yes
++ continue
++ fi
++ ac_cv_prog_CC="cc"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++if test $ac_prog_rejected = yes; then
++ # We found a bogon in the path, so make sure we never use it.
++ set dummy $ac_cv_prog_CC
++ shift
++ if test $# != 0; then
++ # We chose a different compiler from the bogus one.
++ # However, it has the same basename, so the bogon will be chosen
++ # first if we set CC to just the basename; use the full file name.
++ shift
++ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
++ fi
++fi
++fi
++fi
++CC=$ac_cv_prog_CC
++if test -n "$CC"; then
++ echo "$as_me:$LINENO: result: $CC" >&5
++echo "${ECHO_T}$CC" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable cc found in \$PATH" >&5
++echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
++ { (exit 1); exit 1; }; }
++fi
++
++echo "$as_me:$LINENO: checking whether we are using GNU C" >&5
++echo $ECHO_N "checking whether we are using GNU C... $ECHO_C" >&6
++if test "${ac_cv_c_compiler_gnu+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat > conftest.c <<EOF
++#ifdef __GNUC__
++ yes;
++#endif
++EOF
++if { ac_try='${CC-cc} -E conftest.c'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } | egrep yes >/dev/null 2>&1; then
++ ac_cv_c_compiler_gnu=yes
++else
++ ac_cv_c_compiler_gnu=no
++fi
++fi
++echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
++echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
++
++if test $ac_cv_c_compiler_gnu = yes; then
++ GCC=yes
++ ac_test_CFLAGS="${CFLAGS+set}"
++ ac_save_CFLAGS="$CFLAGS"
++ CFLAGS=
++ ac_test_CFLAGS=${CFLAGS+set}
++ac_save_CFLAGS=$CFLAGS
++CFLAGS="-g"
++echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
++echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
++if test "${ac_cv_prog_cc_g+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag"
++ || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_prog_cc_g=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_prog_cc_g=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
++echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
++if test "$ac_test_CFLAGS" = set; then
++ CFLAGS=$ac_save_CFLAGS
++elif test $ac_cv_prog_cc_g = yes; then
++ if test "$GCC" = yes; then
++ CFLAGS="-g -O2"
++ else
++ CFLAGS="-g"
++ fi
++else
++ if test "$GCC" = yes; then
++ CFLAGS="-O2"
++ else
++ CFLAGS=
++ fi
++fi
++ if test "$ac_test_CFLAGS" = set; then
++ CFLAGS="$ac_save_CFLAGS"
++ elif test $ac_cv_prog_cc_g = yes; then
++ CFLAGS="-g -O2"
++ else
++ CFLAGS="-O2"
++ fi
++else
++ GCC=
++ test "${CFLAGS+set}" = set || CFLAGS="-g"
++fi
++
++
++if test -n "$ac_tool_prefix"; then
++ # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
++set dummy ${ac_tool_prefix}as; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_AS+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$AS"; then
++ ac_cv_prog_AS="$AS" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_AS="${ac_tool_prefix}as"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++AS=$ac_cv_prog_AS
++if test -n "$AS"; then
++ echo "$as_me:$LINENO: result: $AS" >&5
++echo "${ECHO_T}$AS" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++fi
++if test -z "$ac_cv_prog_AS"; then
++ ac_ct_AS=$AS
++ # Extract the first word of "as", so it can be a program name with args.
++set dummy as; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_AS+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$ac_ct_AS"; then
++ ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_ac_ct_AS="as"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++ac_ct_AS=$ac_cv_prog_ac_ct_AS
++if test -n "$ac_ct_AS"; then
++ echo "$as_me:$LINENO: result: $ac_ct_AS" >&5
++echo "${ECHO_T}$ac_ct_AS" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ AS=$ac_ct_AS
++else
++ AS="$ac_cv_prog_AS"
++fi
++
++if test -n "$ac_tool_prefix"; then
++ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
++set dummy ${ac_tool_prefix}ar; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_AR+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$AR"; then
++ ac_cv_prog_AR="$AR" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_AR="${ac_tool_prefix}ar"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++AR=$ac_cv_prog_AR
++if test -n "$AR"; then
++ echo "$as_me:$LINENO: result: $AR" >&5
++echo "${ECHO_T}$AR" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++fi
++if test -z "$ac_cv_prog_AR"; then
++ ac_ct_AR=$AR
++ # Extract the first word of "ar", so it can be a program name with args.
++set dummy ar; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$ac_ct_AR"; then
++ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_ac_ct_AR="ar"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++ac_ct_AR=$ac_cv_prog_ac_ct_AR
++if test -n "$ac_ct_AR"; then
++ echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
++echo "${ECHO_T}$ac_ct_AR" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ AR=$ac_ct_AR
++else
++ AR="$ac_cv_prog_AR"
++fi
++
++if test -n "$ac_tool_prefix"; then
++ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
++set dummy ${ac_tool_prefix}ranlib; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_RANLIB+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$RANLIB"; then
++ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++RANLIB=$ac_cv_prog_RANLIB
++if test -n "$RANLIB"; then
++ echo "$as_me:$LINENO: result: $RANLIB" >&5
++echo "${ECHO_T}$RANLIB" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++fi
++if test -z "$ac_cv_prog_RANLIB"; then
++ ac_ct_RANLIB=$RANLIB
++ # Extract the first word of "ranlib", so it can be a program name with args.
++set dummy ranlib; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$ac_ct_RANLIB"; then
++ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_ac_ct_RANLIB="ranlib"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
++fi
++fi
++ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
++if test -n "$ac_ct_RANLIB"; then
++ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
++echo "${ECHO_T}$ac_ct_RANLIB" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ RANLIB=$ac_ct_RANLIB
++else
++ RANLIB="$ac_cv_prog_RANLIB"
++fi
++
++if test -n "$ac_tool_prefix"; then
++ # Extract the first word of "${ac_tool_prefix}readelf", so it can be a program name with args.
++set dummy ${ac_tool_prefix}readelf; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_READELF+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$READELF"; then
++ ac_cv_prog_READELF="$READELF" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_READELF="${ac_tool_prefix}readelf"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++READELF=$ac_cv_prog_READELF
++if test -n "$READELF"; then
++ echo "$as_me:$LINENO: result: $READELF" >&5
++echo "${ECHO_T}$READELF" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++fi
++if test -z "$ac_cv_prog_READELF"; then
++ ac_ct_READELF=$READELF
++ # Extract the first word of "readelf", so it can be a program name with args.
++set dummy readelf; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_READELF+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$ac_ct_READELF"; then
++ ac_cv_prog_ac_ct_READELF="$ac_ct_READELF" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_ac_ct_READELF="readelf"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++ test -z "$ac_cv_prog_ac_ct_READELF" && ac_cv_prog_ac_ct_READELF=":"
++fi
++fi
++ac_ct_READELF=$ac_cv_prog_ac_ct_READELF
++if test -n "$ac_ct_READELF"; then
++ echo "$as_me:$LINENO: result: $ac_ct_READELF" >&5
++echo "${ECHO_T}$ac_ct_READELF" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ READELF=$ac_ct_READELF
++else
++ READELF="$ac_cv_prog_READELF"
++fi
++
++
++# Find a good install program. We prefer a C program (faster),
++# so one script is as good as another. But avoid the broken or
++# incompatible versions:
++# SysV /etc/install, /usr/sbin/install
++# SunOS /usr/etc/install
++# IRIX /sbin/install
++# AIX /bin/install
++# AmigaOS /C/install, which installs bootblocks on floppy discs
++# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
++# AFS /usr/afsws/bin/install, which mishandles nonexistent args
++# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
++# OS/2's system install, which has a completely different semantic
++# ./install, which can be erroneously created by make from ./install.sh.
++echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
++echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
++if test -z "$INSTALL"; then
++if test "${ac_cv_path_install+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ # Account for people who put trailing slashes in PATH elements.
++case $as_dir/ in
++ ./ | .// | /cC/* | \
++ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
++ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
++ /usr/ucb/* ) ;;
++ *)
++ # OSF1 and SCO ODT 3.0 have their own names for install.
++ # Don't use installbsd from OSF since it installs stuff as root
++ # by default.
++ for ac_prog in ginstall scoinst install; do
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
++ if test $ac_prog = install &&
++ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
++ # AIX install. It has an incompatible calling convention.
++ :
++ elif test $ac_prog = install &&
++ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
++ # program-specific install script used by HP pwplus--don't use.
++ :
++ else
++ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
++ break 3
++ fi
++ fi
++ done
++ done
++ ;;
++esac
++done
++
++
++fi
++ if test "${ac_cv_path_install+set}" = set; then
++ INSTALL=$ac_cv_path_install
++ else
++ # As a last resort, use the slow shell script. We don't cache a
++ # path for INSTALL within a source directory, because that will
++ # break other packages using the cache if that directory is
++ # removed, or if the path is relative.
++ INSTALL=$ac_install_sh
++ fi
++fi
++echo "$as_me:$LINENO: result: $INSTALL" >&5
++echo "${ECHO_T}$INSTALL" >&6
++
++# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
++# It thinks the first close brace ends the variable substitution.
++test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
++
++test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
++
++test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
++
++
++# Hack to ensure that INSTALL won't be set to "../" with autoconf 2.13. */
++ac_given_INSTALL=$INSTALL
++
++echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
++echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6
++ # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
++if test "${enable_maintainer_mode+set}" = set; then
++ enableval="$enable_maintainer_mode"
++ USE_MAINTAINER_MODE=$enableval
++else
++ USE_MAINTAINER_MODE=no
++fi;
++ echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
++echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6
++
++
++if test $USE_MAINTAINER_MODE = yes; then
++ MAINTAINER_MODE_TRUE=
++ MAINTAINER_MODE_FALSE='#'
++else
++ MAINTAINER_MODE_TRUE='#'
++ MAINTAINER_MODE_FALSE=
++fi
++
++ MAINT=$MAINTAINER_MODE_TRUE
++
++
++# By default we simply use the C compiler to build assembly code.
++
++test "${CCAS+set}" = set || CCAS=$CC
++test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
++
++
++
++
++# We need AC_EXEEXT to keep automake happy in cygnus mode. However,
++# at least currently, we never actually build a program, so we never
++# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
++# fails, because we are probably configuring with a cross compiler
++# which can't create executables. So we include AC_EXEEXT to keep
++# automake happy, but we don't execute it, since we don't care about
++# the result.
++if false; then
++
++ dummy_var=1
++fi
++
++. ${newlib_basedir}/configure.host
++
++newlib_cflags="${newlib_cflags} -fno-builtin"
++
++NEWLIB_CFLAGS=${newlib_cflags}
++
++
++LDFLAGS=${ldflags}
++
++
++
++
++if test x${newlib_elix_level} = x0; then
++ ELIX_LEVEL_0_TRUE=
++ ELIX_LEVEL_0_FALSE='#'
++else
++ ELIX_LEVEL_0_TRUE='#'
++ ELIX_LEVEL_0_FALSE=
++fi
++
++
++
++if test x${newlib_elix_level} = x1; then
++ ELIX_LEVEL_1_TRUE=
++ ELIX_LEVEL_1_FALSE='#'
++else
++ ELIX_LEVEL_1_TRUE='#'
++ ELIX_LEVEL_1_FALSE=
++fi
++
++
++
++if test x${newlib_elix_level} = x2; then
++ ELIX_LEVEL_2_TRUE=
++ ELIX_LEVEL_2_FALSE='#'
++else
++ ELIX_LEVEL_2_TRUE='#'
++ ELIX_LEVEL_2_FALSE=
++fi
++
++
++
++if test x${newlib_elix_level} = x3; then
++ ELIX_LEVEL_3_TRUE=
++ ELIX_LEVEL_3_FALSE='#'
++else
++ ELIX_LEVEL_3_TRUE='#'
++ ELIX_LEVEL_3_FALSE=
++fi
++
++
++
++if test x${newlib_elix_level} = x4; then
++ ELIX_LEVEL_4_TRUE=
++ ELIX_LEVEL_4_FALSE='#'
++else
++ ELIX_LEVEL_4_TRUE='#'
++ ELIX_LEVEL_4_FALSE=
++fi
++
++
++
++
++if test x${use_libtool} = xyes; then
++ USE_LIBTOOL_TRUE=
++ USE_LIBTOOL_FALSE='#'
++else
++ USE_LIBTOOL_TRUE='#'
++ USE_LIBTOOL_FALSE=
++fi
++
++
++# Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we
++# use oext, which is set in configure.host based on the target platform.
++OBJEXT=${oext}
++
++
++
++
++
++
++
++
++
++
++
++ ac_config_files="$ac_config_files Makefile"
++
++cat >confcache <<\_ACEOF
++# This file is a shell script that caches the results of configure
++# tests run on this system so they can be shared between configure
++# scripts and configure runs, see configure's option --config-cache.
++# It is not useful on other systems. If it contains results you don't
++# want to keep, you may remove or edit it.
++#
++# config.status only pays attention to the cache file if you give it
++# the --recheck option to rerun configure.
++#
++# `ac_cv_env_foo' variables (set or unset) will be overridden when
++# loading this file, other *unset* `ac_cv_foo' will be assigned the
++# following values.
++
++_ACEOF
++
++# The following way of writing the cache mishandles newlines in values,
++# but we know of no workaround that is simple, portable, and efficient.
++# So, don't put newlines in cache variables' values.
++# Ultrix sh set writes to stderr and can't be redirected directly,
++# and sets the high bit in the cache file unless we assign to the vars.
++{
++ (set) 2>&1 |
++ case `(ac_space=' '; set | grep ac_space) 2>&1` in
++ *ac_space=\ *)
++ # `set' does not quote correctly, so add quotes (double-quote
++ # substitution turns \\\\ into \\, and sed turns \\ into \).
++ sed -n \
++ "s/'/'\\\\''/g;
++ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
++ ;;
++ *)
++ # `set' quotes correctly as required by POSIX, so do not add quotes.
++ sed -n \
++ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
++ ;;
++ esac;
++} |
++ sed '
++ t clear
++ : clear
++ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
++ t end
++ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
++ : end' >>confcache
++if diff $cache_file confcache >/dev/null 2>&1; then :; else
++ if test -w $cache_file; then
++ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
++ cat confcache >$cache_file
++ else
++ echo "not updating unwritable cache $cache_file"
++ fi
++fi
++rm -f confcache
++
++test "x$prefix" = xNONE && prefix=$ac_default_prefix
++# Let make expand exec_prefix.
++test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
++
++# VPATH may cause trouble with some makes, so we remove $(srcdir),
++# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
++# trailing colons and then remove the whole line if VPATH becomes empty
++# (actually we leave an empty line to preserve line numbers).
++if test "x$srcdir" = x.; then
++ ac_vpsub='/^[ ]*VPATH[ ]*=/{
++s/:*\$(srcdir):*/:/;
++s/:*\${srcdir}:*/:/;
++s/:*@srcdir@:*/:/;
++s/^\([^=]*=[ ]*\):*/\1/;
++s/:*$//;
++s/^[^=]*=[ ]*$//;
++}'
++fi
++
++# Transform confdefs.h into DEFS.
++# Protect against shell expansion while executing Makefile rules.
++# Protect against Makefile macro expansion.
++#
++# If the first sed substitution is executed (which looks for macros that
++# take arguments), then we branch to the quote section. Otherwise,
++# look for a macro that doesn't take arguments.
++cat >confdef2opt.sed <<\_ACEOF
++t clear
++: clear
++s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g
++t quote
++s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g
++t quote
++d
++: quote
++s,[ `~#$^&*(){}\\|;'"<>?],\\&,g
++s,\[,\\&,g
++s,\],\\&,g
++s,\$,$$,g
++p
++_ACEOF
++# We use echo to avoid assuming a particular line-breaking character.
++# The extra dot is to prevent the shell from consuming trailing
++# line-breaks from the sub-command output. A line-break within
++# single-quotes doesn't work because, if this script is created in a
++# platform that uses two characters for line-breaks (e.g., DOS), tr
++# would break.
++ac_LF_and_DOT=`echo; echo .`
++DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
++rm -f confdef2opt.sed
++
++
++ac_libobjs=
++ac_ltlibobjs=
++for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
++ # 1. Remove the extension, and $U if already installed.
++ ac_i=`echo "$ac_i" |
++ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
++ # 2. Add them.
++ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
++ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
++done
++LIBOBJS=$ac_libobjs
++
++LTLIBOBJS=$ac_ltlibobjs
++
++
++if test -z "${MAY_SUPPLY_SYSCALLS_TRUE}" && test -z "${MAY_SUPPLY_SYSCALLS_FALSE}"; then
++ { { echo "$as_me:$LINENO: error: conditional \"MAY_SUPPLY_SYSCALLS\" was never defined.
++Usually this means the macro was only invoked conditionally." >&5
++echo "$as_me: error: conditional \"MAY_SUPPLY_SYSCALLS\" was never defined.
++Usually this means the macro was only invoked conditionally." >&2;}
++ { (exit 1); exit 1; }; }
++fi
++if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
++ { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
++Usually this means the macro was only invoked conditionally." >&5
++echo "$as_me: error: conditional \"AMDEP\" was never defined.
++Usually this means the macro was only invoked conditionally." >&2;}
++ { (exit 1); exit 1; }; }
++fi
++if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
++ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
++Usually this means the macro was only invoked conditionally." >&5
++echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
++Usually this means the macro was only invoked conditionally." >&2;}
++ { (exit 1); exit 1; }; }
++fi
++if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
++ { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
++Usually this means the macro was only invoked conditionally." >&5
++echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
++Usually this means the macro was only invoked conditionally." >&2;}
++ { (exit 1); exit 1; }; }
++fi
++if test -z "${ELIX_LEVEL_0_TRUE}" && test -z "${ELIX_LEVEL_0_FALSE}"; then
++ { { echo "$as_me:$LINENO: error: conditional \"ELIX_LEVEL_0\" was never defined.
++Usually this means the macro was only invoked conditionally." >&5
++echo "$as_me: error: conditional \"ELIX_LEVEL_0\" was never defined.
++Usually this means the macro was only invoked conditionally." >&2;}
++ { (exit 1); exit 1; }; }
++fi
++if test -z "${ELIX_LEVEL_1_TRUE}" && test -z "${ELIX_LEVEL_1_FALSE}"; then
++ { { echo "$as_me:$LINENO: error: conditional \"ELIX_LEVEL_1\" was never defined.
++Usually this means the macro was only invoked conditionally." >&5
++echo "$as_me: error: conditional \"ELIX_LEVEL_1\" was never defined.
++Usually this means the macro was only invoked conditionally." >&2;}
++ { (exit 1); exit 1; }; }
++fi
++if test -z "${ELIX_LEVEL_2_TRUE}" && test -z "${ELIX_LEVEL_2_FALSE}"; then
++ { { echo "$as_me:$LINENO: error: conditional \"ELIX_LEVEL_2\" was never defined.
++Usually this means the macro was only invoked conditionally." >&5
++echo "$as_me: error: conditional \"ELIX_LEVEL_2\" was never defined.
++Usually this means the macro was only invoked conditionally." >&2;}
++ { (exit 1); exit 1; }; }
++fi
++if test -z "${ELIX_LEVEL_3_TRUE}" && test -z "${ELIX_LEVEL_3_FALSE}"; then
++ { { echo "$as_me:$LINENO: error: conditional \"ELIX_LEVEL_3\" was never defined.
++Usually this means the macro was only invoked conditionally." >&5
++echo "$as_me: error: conditional \"ELIX_LEVEL_3\" was never defined.
++Usually this means the macro was only invoked conditionally." >&2;}
++ { (exit 1); exit 1; }; }
++fi
++if test -z "${ELIX_LEVEL_4_TRUE}" && test -z "${ELIX_LEVEL_4_FALSE}"; then
++ { { echo "$as_me:$LINENO: error: conditional \"ELIX_LEVEL_4\" was never defined.
++Usually this means the macro was only invoked conditionally." >&5
++echo "$as_me: error: conditional \"ELIX_LEVEL_4\" was never defined.
++Usually this means the macro was only invoked conditionally." >&2;}
++ { (exit 1); exit 1; }; }
++fi
++if test -z "${USE_LIBTOOL_TRUE}" && test -z "${USE_LIBTOOL_FALSE}"; then
++ { { echo "$as_me:$LINENO: error: conditional \"USE_LIBTOOL\" was never defined.
++Usually this means the macro was only invoked conditionally." >&5
++echo "$as_me: error: conditional \"USE_LIBTOOL\" was never defined.
++Usually this means the macro was only invoked conditionally." >&2;}
++ { (exit 1); exit 1; }; }
++fi
++
++: ${CONFIG_STATUS=./config.status}
++ac_clean_files_save=$ac_clean_files
++ac_clean_files="$ac_clean_files $CONFIG_STATUS"
++{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
++echo "$as_me: creating $CONFIG_STATUS" >&6;}
++cat >$CONFIG_STATUS <<_ACEOF
++#! $SHELL
++# Generated by $as_me.
++# Run this file to recreate the current configuration.
++# Compiler output produced by configure, useful for debugging
++# configure, is in config.log if it exists.
++
++debug=false
++ac_cs_recheck=false
++ac_cs_silent=false
++SHELL=\${CONFIG_SHELL-$SHELL}
++_ACEOF
++
++cat >>$CONFIG_STATUS <<\_ACEOF
++## --------------------- ##
++## M4sh Initialization. ##
++## --------------------- ##
++
++# Be Bourne compatible
++if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
++ emulate sh
++ NULLCMD=:
++ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
++ # is contrary to our usage. Disable this feature.
++ alias -g '${1+"$@"}'='"$@"'
++elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
++ set -o posix
++fi
++DUALCASE=1; export DUALCASE # for MKS sh
++
++# Support unset when possible.
++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
++ as_unset=unset
++else
++ as_unset=false
++fi
++
++
++# Work around bugs in pre-3.0 UWIN ksh.
++$as_unset ENV MAIL MAILPATH
++PS1='$ '
++PS2='> '
++PS4='+ '
++
++# NLS nuisances.
++for as_var in \
++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
++ LC_TELEPHONE LC_TIME
++do
++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
++ eval $as_var=C; export $as_var
++ else
++ $as_unset $as_var
++ fi
++done
++
++# Required to use basename.
++if expr a : '\(a\)' >/dev/null 2>&1; then
++ as_expr=expr
++else
++ as_expr=false
++fi
++
++if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
++ as_basename=basename
++else
++ as_basename=false
++fi
++
++
++# Name of the executable.
++as_me=`$as_basename "$0" ||
++$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
++ X"$0" : 'X\(//\)$' \| \
++ X"$0" : 'X\(/\)$' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X/"$0" |
++ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
++ /^X\/\(\/\/\)$/{ s//\1/; q; }
++ /^X\/\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++
++
++# PATH needs CR, and LINENO needs CR and PATH.
++# Avoid depending upon Character Ranges.
++as_cr_letters='abcdefghijklmnopqrstuvwxyz'
++as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
++as_cr_Letters=$as_cr_letters$as_cr_LETTERS
++as_cr_digits='0123456789'
++as_cr_alnum=$as_cr_Letters$as_cr_digits
++
++# The user is always right.
++if test "${PATH_SEPARATOR+set}" != set; then
++ echo "#! /bin/sh" >conf$$.sh
++ echo "exit 0" >>conf$$.sh
++ chmod +x conf$$.sh
++ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
++ PATH_SEPARATOR=';'
++ else
++ PATH_SEPARATOR=:
++ fi
++ rm -f conf$$.sh
++fi
++
++
++ as_lineno_1=$LINENO
++ as_lineno_2=$LINENO
++ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
++ test "x$as_lineno_1" != "x$as_lineno_2" &&
++ test "x$as_lineno_3" = "x$as_lineno_2" || {
++ # Find who we are. Look in the path if we contain no path at all
++ # relative or not.
++ case $0 in
++ *[\\/]* ) as_myself=$0 ;;
++ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
++done
++
++ ;;
++ esac
++ # We did not find ourselves, most probably we were run as `sh COMMAND'
++ # in which case we are not to be found in the path.
++ if test "x$as_myself" = x; then
++ as_myself=$0
++ fi
++ if test ! -f "$as_myself"; then
++ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
++echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
++ { (exit 1); exit 1; }; }
++ fi
++ case $CONFIG_SHELL in
++ '')
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for as_base in sh bash ksh sh5; do
++ case $as_dir in
++ /*)
++ if ("$as_dir/$as_base" -c '
++ as_lineno_1=$LINENO
++ as_lineno_2=$LINENO
++ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
++ test "x$as_lineno_1" != "x$as_lineno_2" &&
++ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
++ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
++ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
++ CONFIG_SHELL=$as_dir/$as_base
++ export CONFIG_SHELL
++ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
++ fi;;
++ esac
++ done
++done
++;;
++ esac
++
++ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
++ # uniformly replaced by the line number. The first 'sed' inserts a
++ # line-number line before each line; the second 'sed' does the real
++ # work. The second script uses 'N' to pair each line-number line
++ # with the numbered line, and appends trailing '-' during
++ # substitution so that $LINENO is not a special case at line end.
++ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
++ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
++ sed '=' <$as_myself |
++ sed '
++ N
++ s,$,-,
++ : loop
++ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
++ t loop
++ s,-$,,
++ s,^['$as_cr_digits']*\n,,
++ ' >$as_me.lineno &&
++ chmod +x $as_me.lineno ||
++ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
++echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
++ { (exit 1); exit 1; }; }
++
++ # Don't try to exec as it changes $[0], causing all sort of problems
++ # (the dirname of $[0] is not the place where we might find the
++ # original and so on. Autoconf is especially sensible to this).
++ . ./$as_me.lineno
++ # Exit status is that of the last command.
++ exit
++}
++
++
++case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
++ *c*,-n*) ECHO_N= ECHO_C='
++' ECHO_T=' ' ;;
++ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
++ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
++esac
++
++if expr a : '\(a\)' >/dev/null 2>&1; then
++ as_expr=expr
++else
++ as_expr=false
++fi
++
++rm -f conf$$ conf$$.exe conf$$.file
++echo >conf$$.file
++if ln -s conf$$.file conf$$ 2>/dev/null; then
++ # We could just check for DJGPP; but this test a) works b) is more generic
++ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
++ if test -f conf$$.exe; then
++ # Don't use ln at all; we don't have any links
++ as_ln_s='cp -p'
++ else
++ as_ln_s='ln -s'
++ fi
++elif ln conf$$.file conf$$ 2>/dev/null; then
++ as_ln_s=ln
++else
++ as_ln_s='cp -p'
++fi
++rm -f conf$$ conf$$.exe conf$$.file
++
++if mkdir -p . 2>/dev/null; then
++ as_mkdir_p=:
++else
++ test -d ./-p && rmdir ./-p
++ as_mkdir_p=false
++fi
++
++as_executable_p="test -f"
++
++# Sed expression to map a string onto a valid CPP name.
++as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
++
++# Sed expression to map a string onto a valid variable name.
++as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
++
++
++# IFS
++# We need space, tab and new line, in precisely that order.
++as_nl='
++'
++IFS=" $as_nl"
++
++# CDPATH.
++$as_unset CDPATH
++
++exec 6>&1
++
++# Open the log real soon, to keep \$[0] and so on meaningful, and to
++# report actual input values of CONFIG_FILES etc. instead of their
++# values after options handling. Logging --version etc. is OK.
++exec 5>>config.log
++{
++ echo
++ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
++## Running $as_me. ##
++_ASBOX
++} >&5
++cat >&5 <<_CSEOF
++
++This file was extended by newlib $as_me 1.15.0, which was
++generated by GNU Autoconf 2.59. Invocation command line was
++
++ CONFIG_FILES = $CONFIG_FILES
++ CONFIG_HEADERS = $CONFIG_HEADERS
++ CONFIG_LINKS = $CONFIG_LINKS
++ CONFIG_COMMANDS = $CONFIG_COMMANDS
++ $ $0 $@
++
++_CSEOF
++echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
++echo >&5
++_ACEOF
++
++# Files that config.status was made for.
++if test -n "$ac_config_files"; then
++ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
++fi
++
++if test -n "$ac_config_headers"; then
++ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
++fi
++
++if test -n "$ac_config_links"; then
++ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
++fi
++
++if test -n "$ac_config_commands"; then
++ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
++fi
++
++cat >>$CONFIG_STATUS <<\_ACEOF
++
++ac_cs_usage="\
++\`$as_me' instantiates files from templates according to the
++current configuration.
++
++Usage: $0 [OPTIONS] [FILE]...
++
++ -h, --help print this help, then exit
++ -V, --version print version number, then exit
++ -q, --quiet do not print progress messages
++ -d, --debug don't remove temporary files
++ --recheck update $as_me by reconfiguring in the same conditions
++ --file=FILE[:TEMPLATE]
++ instantiate the configuration file FILE
++
++Configuration files:
++$config_files
++
++Configuration commands:
++$config_commands
++
++Report bugs to <bug-autoconf@gnu.org>."
++_ACEOF
++
++cat >>$CONFIG_STATUS <<_ACEOF
++ac_cs_version="\\
++newlib config.status 1.15.0
++configured by $0, generated by GNU Autoconf 2.59,
++ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
++
++Copyright (C) 2003 Free Software Foundation, Inc.
++This config.status script is free software; the Free Software Foundation
++gives unlimited permission to copy, distribute and modify it."
++srcdir=$srcdir
++INSTALL="$INSTALL"
++_ACEOF
++
++cat >>$CONFIG_STATUS <<\_ACEOF
++# If no file are specified by the user, then we need to provide default
++# value. By we need to know if files were specified by the user.
++ac_need_defaults=:
++while test $# != 0
++do
++ case $1 in
++ --*=*)
++ ac_option=`expr "x$1" : 'x\([^=]*\)='`
++ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
++ ac_shift=:
++ ;;
++ -*)
++ ac_option=$1
++ ac_optarg=$2
++ ac_shift=shift
++ ;;
++ *) # This is not an option, so the user has probably given explicit
++ # arguments.
++ ac_option=$1
++ ac_need_defaults=false;;
++ esac
++
++ case $ac_option in
++ # Handling of the options.
++_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF
++ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
++ ac_cs_recheck=: ;;
++ --version | --vers* | -V )
++ echo "$ac_cs_version"; exit 0 ;;
++ --he | --h)
++ # Conflict between --help and --header
++ { { echo "$as_me:$LINENO: error: ambiguous option: $1
++Try \`$0 --help' for more information." >&5
++echo "$as_me: error: ambiguous option: $1
++Try \`$0 --help' for more information." >&2;}
++ { (exit 1); exit 1; }; };;
++ --help | --hel | -h )
++ echo "$ac_cs_usage"; exit 0 ;;
++ --debug | --d* | -d )
++ debug=: ;;
++ --file | --fil | --fi | --f )
++ $ac_shift
++ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
++ ac_need_defaults=false;;
++ --header | --heade | --head | --hea )
++ $ac_shift
++ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
++ ac_need_defaults=false;;
++ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
++ | -silent | --silent | --silen | --sile | --sil | --si | --s)
++ ac_cs_silent=: ;;
++
++ # This is an error.
++ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
++Try \`$0 --help' for more information." >&5
++echo "$as_me: error: unrecognized option: $1
++Try \`$0 --help' for more information." >&2;}
++ { (exit 1); exit 1; }; } ;;
++
++ *) ac_config_targets="$ac_config_targets $1" ;;
++
++ esac
++ shift
++done
++
++ac_configure_extra_args=
++
++if $ac_cs_silent; then
++ exec 6>/dev/null
++ ac_configure_extra_args="$ac_configure_extra_args --silent"
++fi
++
++_ACEOF
++cat >>$CONFIG_STATUS <<_ACEOF
++if \$ac_cs_recheck; then
++ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
++ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
++fi
++
++_ACEOF
++
++cat >>$CONFIG_STATUS <<_ACEOF
++#
++# INIT-COMMANDS section.
++#
++
++AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
++
++_ACEOF
++
++
++
++cat >>$CONFIG_STATUS <<\_ACEOF
++for ac_config_target in $ac_config_targets
++do
++ case "$ac_config_target" in
++ # Handling of arguments.
++ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
++ "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
++ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
++echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
++ { (exit 1); exit 1; }; };;
++ esac
++done
++
++# If the user did not use the arguments to specify the items to instantiate,
++# then the envvar interface is used. Set only those that are not.
++# We use the long form for the default assignment because of an extremely
++# bizarre bug on SunOS 4.1.3.
++if $ac_need_defaults; then
++ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
++ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
++fi
++
++# Have a temporary directory for convenience. Make it in the build tree
++# simply because there is no reason to put it here, and in addition,
++# creating and moving files from /tmp can sometimes cause problems.
++# Create a temporary directory, and hook for its removal unless debugging.
++$debug ||
++{
++ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
++ trap '{ (exit 1); exit 1; }' 1 2 13 15
++}
++
++# Create a (secure) tmp directory for tmp files.
++
++{
++ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
++ test -n "$tmp" && test -d "$tmp"
++} ||
++{
++ tmp=./confstat$$-$RANDOM
++ (umask 077 && mkdir $tmp)
++} ||
++{
++ echo "$me: cannot create a temporary directory in ." >&2
++ { (exit 1); exit 1; }
++}
++
++_ACEOF
++
++cat >>$CONFIG_STATUS <<_ACEOF
++
++#
++# CONFIG_FILES section.
++#
++
++# No need to generate the scripts if there are no CONFIG_FILES.
++# This happens for instance when ./config.status config.h
++if test -n "\$CONFIG_FILES"; then
++ # Protect against being on the right side of a sed subst in config.status.
++ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
++ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
++s,@SHELL@,$SHELL,;t t
++s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
++s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
++s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
++s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
++s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
++s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
++s,@exec_prefix@,$exec_prefix,;t t
++s,@prefix@,$prefix,;t t
++s,@program_transform_name@,$program_transform_name,;t t
++s,@bindir@,$bindir,;t t
++s,@sbindir@,$sbindir,;t t
++s,@libexecdir@,$libexecdir,;t t
++s,@datadir@,$datadir,;t t
++s,@sysconfdir@,$sysconfdir,;t t
++s,@sharedstatedir@,$sharedstatedir,;t t
++s,@localstatedir@,$localstatedir,;t t
++s,@libdir@,$libdir,;t t
++s,@includedir@,$includedir,;t t
++s,@oldincludedir@,$oldincludedir,;t t
++s,@infodir@,$infodir,;t t
++s,@mandir@,$mandir,;t t
++s,@build_alias@,$build_alias,;t t
++s,@host_alias@,$host_alias,;t t
++s,@target_alias@,$target_alias,;t t
++s,@DEFS@,$DEFS,;t t
++s,@ECHO_C@,$ECHO_C,;t t
++s,@ECHO_N@,$ECHO_N,;t t
++s,@ECHO_T@,$ECHO_T,;t t
++s,@LIBS@,$LIBS,;t t
++s,@MAY_SUPPLY_SYSCALLS_TRUE@,$MAY_SUPPLY_SYSCALLS_TRUE,;t t
++s,@MAY_SUPPLY_SYSCALLS_FALSE@,$MAY_SUPPLY_SYSCALLS_FALSE,;t t
++s,@newlib_basedir@,$newlib_basedir,;t t
++s,@build@,$build,;t t
++s,@build_cpu@,$build_cpu,;t t
++s,@build_vendor@,$build_vendor,;t t
++s,@build_os@,$build_os,;t t
++s,@host@,$host,;t t
++s,@host_cpu@,$host_cpu,;t t
++s,@host_vendor@,$host_vendor,;t t
++s,@host_os@,$host_os,;t t
++s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
++s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
++s,@INSTALL_DATA@,$INSTALL_DATA,;t t
++s,@CYGPATH_W@,$CYGPATH_W,;t t
++s,@PACKAGE@,$PACKAGE,;t t
++s,@VERSION@,$VERSION,;t t
++s,@ACLOCAL@,$ACLOCAL,;t t
++s,@AUTOCONF@,$AUTOCONF,;t t
++s,@AUTOMAKE@,$AUTOMAKE,;t t
++s,@AUTOHEADER@,$AUTOHEADER,;t t
++s,@MAKEINFO@,$MAKEINFO,;t t
++s,@install_sh@,$install_sh,;t t
++s,@STRIP@,$STRIP,;t t
++s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
++s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
++s,@mkdir_p@,$mkdir_p,;t t
++s,@AWK@,$AWK,;t t
++s,@SET_MAKE@,$SET_MAKE,;t t
++s,@am__leading_dot@,$am__leading_dot,;t t
++s,@AMTAR@,$AMTAR,;t t
++s,@am__tar@,$am__tar,;t t
++s,@am__untar@,$am__untar,;t t
++s,@CC@,$CC,;t t
++s,@DEPDIR@,$DEPDIR,;t t
++s,@am__include@,$am__include,;t t
++s,@am__quote@,$am__quote,;t t
++s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
++s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
++s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
++s,@CCDEPMODE@,$CCDEPMODE,;t t
++s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
++s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
++s,@AS@,$AS,;t t
++s,@ac_ct_AS@,$ac_ct_AS,;t t
++s,@AR@,$AR,;t t
++s,@ac_ct_AR@,$ac_ct_AR,;t t
++s,@RANLIB@,$RANLIB,;t t
++s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
++s,@READELF@,$READELF,;t t
++s,@ac_ct_READELF@,$ac_ct_READELF,;t t
++s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
++s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
++s,@MAINT@,$MAINT,;t t
++s,@CCAS@,$CCAS,;t t
++s,@CCASFLAGS@,$CCASFLAGS,;t t
++s,@NEWLIB_CFLAGS@,$NEWLIB_CFLAGS,;t t
++s,@LDFLAGS@,$LDFLAGS,;t t
++s,@ELIX_LEVEL_0_TRUE@,$ELIX_LEVEL_0_TRUE,;t t
++s,@ELIX_LEVEL_0_FALSE@,$ELIX_LEVEL_0_FALSE,;t t
++s,@ELIX_LEVEL_1_TRUE@,$ELIX_LEVEL_1_TRUE,;t t
++s,@ELIX_LEVEL_1_FALSE@,$ELIX_LEVEL_1_FALSE,;t t
++s,@ELIX_LEVEL_2_TRUE@,$ELIX_LEVEL_2_TRUE,;t t
++s,@ELIX_LEVEL_2_FALSE@,$ELIX_LEVEL_2_FALSE,;t t
++s,@ELIX_LEVEL_3_TRUE@,$ELIX_LEVEL_3_TRUE,;t t
++s,@ELIX_LEVEL_3_FALSE@,$ELIX_LEVEL_3_FALSE,;t t
++s,@ELIX_LEVEL_4_TRUE@,$ELIX_LEVEL_4_TRUE,;t t
++s,@ELIX_LEVEL_4_FALSE@,$ELIX_LEVEL_4_FALSE,;t t
++s,@USE_LIBTOOL_TRUE@,$USE_LIBTOOL_TRUE,;t t
++s,@USE_LIBTOOL_FALSE@,$USE_LIBTOOL_FALSE,;t t
++s,@OBJEXT@,$OBJEXT,;t t
++s,@oext@,$oext,;t t
++s,@aext@,$aext,;t t
++s,@lpfx@,$lpfx,;t t
++s,@libm_machine_dir@,$libm_machine_dir,;t t
++s,@machine_dir@,$machine_dir,;t t
++s,@sys_dir@,$sys_dir,;t t
++s,@LIBOBJS@,$LIBOBJS,;t t
++s,@LTLIBOBJS@,$LTLIBOBJS,;t t
++CEOF
++
++_ACEOF
++
++ cat >>$CONFIG_STATUS <<\_ACEOF
++ # Split the substitutions into bite-sized pieces for seds with
++ # small command number limits, like on Digital OSF/1 and HP-UX.
++ ac_max_sed_lines=48
++ ac_sed_frag=1 # Number of current file.
++ ac_beg=1 # First line for current file.
++ ac_end=$ac_max_sed_lines # Line after last line for current file.
++ ac_more_lines=:
++ ac_sed_cmds=
++ while $ac_more_lines; do
++ if test $ac_beg -gt 1; then
++ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
++ else
++ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
++ fi
++ if test ! -s $tmp/subs.frag; then
++ ac_more_lines=false
++ else
++ # The purpose of the label and of the branching condition is to
++ # speed up the sed processing (if there are no `@' at all, there
++ # is no need to browse any of the substitutions).
++ # These are the two extra sed commands mentioned above.
++ (echo ':t
++ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
++ if test -z "$ac_sed_cmds"; then
++ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
++ else
++ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
++ fi
++ ac_sed_frag=`expr $ac_sed_frag + 1`
++ ac_beg=$ac_end
++ ac_end=`expr $ac_end + $ac_max_sed_lines`
++ fi
++ done
++ if test -z "$ac_sed_cmds"; then
++ ac_sed_cmds=cat
++ fi
++fi # test -n "$CONFIG_FILES"
++
++_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF
++for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
++ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
++ case $ac_file in
++ - | *:- | *:-:* ) # input from stdin
++ cat >$tmp/stdin
++ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++ * ) ac_file_in=$ac_file.in ;;
++ esac
++
++ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
++ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
++$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$ac_file" : 'X\(//\)[^/]' \| \
++ X"$ac_file" : 'X\(//\)$' \| \
++ X"$ac_file" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$ac_file" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ { if $as_mkdir_p; then
++ mkdir -p "$ac_dir"
++ else
++ as_dir="$ac_dir"
++ as_dirs=
++ while test ! -d "$as_dir"; do
++ as_dirs="$as_dir $as_dirs"
++ as_dir=`(dirname "$as_dir") 2>/dev/null ||
++$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$as_dir" : 'X\(//\)[^/]' \| \
++ X"$as_dir" : 'X\(//\)$' \| \
++ X"$as_dir" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$as_dir" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ done
++ test ! -n "$as_dirs" || mkdir $as_dirs
++ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
++echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
++ { (exit 1); exit 1; }; }; }
++
++ ac_builddir=.
++
++if test "$ac_dir" != .; then
++ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
++ # A "../" for each directory in $ac_dir_suffix.
++ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
++else
++ ac_dir_suffix= ac_top_builddir=
++fi
++
++case $srcdir in
++ .) # No --srcdir option. We are building in place.
++ ac_srcdir=.
++ if test -z "$ac_top_builddir"; then
++ ac_top_srcdir=.
++ else
++ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
++ fi ;;
++ [\\/]* | ?:[\\/]* ) # Absolute path.
++ ac_srcdir=$srcdir$ac_dir_suffix;
++ ac_top_srcdir=$srcdir ;;
++ *) # Relative path.
++ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
++ ac_top_srcdir=$ac_top_builddir$srcdir ;;
++esac
++
++# Do not use `cd foo && pwd` to compute absolute paths, because
++# the directories may not exist.
++case `pwd` in
++.) ac_abs_builddir="$ac_dir";;
++*)
++ case "$ac_dir" in
++ .) ac_abs_builddir=`pwd`;;
++ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
++ *) ac_abs_builddir=`pwd`/"$ac_dir";;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_builddir=${ac_top_builddir}.;;
++*)
++ case ${ac_top_builddir}. in
++ .) ac_abs_top_builddir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
++ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_srcdir=$ac_srcdir;;
++*)
++ case $ac_srcdir in
++ .) ac_abs_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
++ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_srcdir=$ac_top_srcdir;;
++*)
++ case $ac_top_srcdir in
++ .) ac_abs_top_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
++ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
++ esac;;
++esac
++
++
++ case $INSTALL in
++ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
++ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
++ esac
++
++ if test x"$ac_file" != x-; then
++ { echo "$as_me:$LINENO: creating $ac_file" >&5
++echo "$as_me: creating $ac_file" >&6;}
++ rm -f "$ac_file"
++ fi
++ # Let's still pretend it is `configure' which instantiates (i.e., don't
++ # use $as_me), people would be surprised to read:
++ # /* config.h. Generated by config.status. */
++ if test x"$ac_file" = x-; then
++ configure_input=
++ else
++ configure_input="$ac_file. "
++ fi
++ configure_input=$configure_input"Generated from `echo $ac_file_in |
++ sed 's,.*/,,'` by configure."
++
++ # First look for the input files in the build tree, otherwise in the
++ # src tree.
++ ac_file_inputs=`IFS=:
++ for f in $ac_file_in; do
++ case $f in
++ -) echo $tmp/stdin ;;
++ [\\/$]*)
++ # Absolute (can't be DOS-style, as IFS=:)
++ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++echo "$as_me: error: cannot find input file: $f" >&2;}
++ { (exit 1); exit 1; }; }
++ echo "$f";;
++ *) # Relative
++ if test -f "$f"; then
++ # Build tree
++ echo "$f"
++ elif test -f "$srcdir/$f"; then
++ # Source tree
++ echo "$srcdir/$f"
++ else
++ # /dev/null tree
++ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++echo "$as_me: error: cannot find input file: $f" >&2;}
++ { (exit 1); exit 1; }; }
++ fi;;
++ esac
++ done` || { (exit 1); exit 1; }
++_ACEOF
++cat >>$CONFIG_STATUS <<_ACEOF
++ sed "$ac_vpsub
++$extrasub
++_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF
++:t
++/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
++s,@configure_input@,$configure_input,;t t
++s,@srcdir@,$ac_srcdir,;t t
++s,@abs_srcdir@,$ac_abs_srcdir,;t t
++s,@top_srcdir@,$ac_top_srcdir,;t t
++s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
++s,@builddir@,$ac_builddir,;t t
++s,@abs_builddir@,$ac_abs_builddir,;t t
++s,@top_builddir@,$ac_top_builddir,;t t
++s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
++s,@INSTALL@,$ac_INSTALL,;t t
++" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
++ rm -f $tmp/stdin
++ if test x"$ac_file" != x-; then
++ mv $tmp/out $ac_file
++ else
++ cat $tmp/out
++ rm -f $tmp/out
++ fi
++
++done
++_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF
++
++#
++# CONFIG_COMMANDS section.
++#
++for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
++ ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
++ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
++ ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
++$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$ac_dest" : 'X\(//\)[^/]' \| \
++ X"$ac_dest" : 'X\(//\)$' \| \
++ X"$ac_dest" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$ac_dest" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ { if $as_mkdir_p; then
++ mkdir -p "$ac_dir"
++ else
++ as_dir="$ac_dir"
++ as_dirs=
++ while test ! -d "$as_dir"; do
++ as_dirs="$as_dir $as_dirs"
++ as_dir=`(dirname "$as_dir") 2>/dev/null ||
++$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$as_dir" : 'X\(//\)[^/]' \| \
++ X"$as_dir" : 'X\(//\)$' \| \
++ X"$as_dir" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$as_dir" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ done
++ test ! -n "$as_dirs" || mkdir $as_dirs
++ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
++echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
++ { (exit 1); exit 1; }; }; }
++
++ ac_builddir=.
++
++if test "$ac_dir" != .; then
++ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
++ # A "../" for each directory in $ac_dir_suffix.
++ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
++else
++ ac_dir_suffix= ac_top_builddir=
++fi
++
++case $srcdir in
++ .) # No --srcdir option. We are building in place.
++ ac_srcdir=.
++ if test -z "$ac_top_builddir"; then
++ ac_top_srcdir=.
++ else
++ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
++ fi ;;
++ [\\/]* | ?:[\\/]* ) # Absolute path.
++ ac_srcdir=$srcdir$ac_dir_suffix;
++ ac_top_srcdir=$srcdir ;;
++ *) # Relative path.
++ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
++ ac_top_srcdir=$ac_top_builddir$srcdir ;;
++esac
++
++# Do not use `cd foo && pwd` to compute absolute paths, because
++# the directories may not exist.
++case `pwd` in
++.) ac_abs_builddir="$ac_dir";;
++*)
++ case "$ac_dir" in
++ .) ac_abs_builddir=`pwd`;;
++ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
++ *) ac_abs_builddir=`pwd`/"$ac_dir";;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_builddir=${ac_top_builddir}.;;
++*)
++ case ${ac_top_builddir}. in
++ .) ac_abs_top_builddir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
++ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_srcdir=$ac_srcdir;;
++*)
++ case $ac_srcdir in
++ .) ac_abs_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
++ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_srcdir=$ac_top_srcdir;;
++*)
++ case $ac_top_srcdir in
++ .) ac_abs_top_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
++ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
++ esac;;
++esac
++
++
++ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
++echo "$as_me: executing $ac_dest commands" >&6;}
++ case $ac_dest in
++ depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
++ # Strip MF so we end up with the name of the file.
++ mf=`echo "$mf" | sed -e 's/:.*$//'`
++ # Check whether this is an Automake generated Makefile or not.
++ # We used to match only the files named `Makefile.in', but
++ # some people rename them; so instead we look at the file content.
++ # Grep'ing the first line is not enough: some people post-process
++ # each Makefile.in and add a new line on top of each file to say so.
++ # So let's grep whole file.
++ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
++ dirpart=`(dirname "$mf") 2>/dev/null ||
++$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$mf" : 'X\(//\)[^/]' \| \
++ X"$mf" : 'X\(//\)$' \| \
++ X"$mf" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$mf" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ else
++ continue
++ fi
++ # Extract the definition of DEPDIR, am__include, and am__quote
++ # from the Makefile without running `make'.
++ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
++ test -z "$DEPDIR" && continue
++ am__include=`sed -n 's/^am__include = //p' < "$mf"`
++ test -z "am__include" && continue
++ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
++ # When using ansi2knr, U may be empty or an underscore; expand it
++ U=`sed -n 's/^U = //p' < "$mf"`
++ # Find all dependency output files, they are included files with
++ # $(DEPDIR) in their names. We invoke sed twice because it is the
++ # simplest approach to changing $(DEPDIR) to its actual value in the
++ # expansion.
++ for file in `sed -n "
++ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
++ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
++ # Make sure the directory exists.
++ test -f "$dirpart/$file" && continue
++ fdir=`(dirname "$file") 2>/dev/null ||
++$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$file" : 'X\(//\)[^/]' \| \
++ X"$file" : 'X\(//\)$' \| \
++ X"$file" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$file" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ { if $as_mkdir_p; then
++ mkdir -p $dirpart/$fdir
++ else
++ as_dir=$dirpart/$fdir
++ as_dirs=
++ while test ! -d "$as_dir"; do
++ as_dirs="$as_dir $as_dirs"
++ as_dir=`(dirname "$as_dir") 2>/dev/null ||
++$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$as_dir" : 'X\(//\)[^/]' \| \
++ X"$as_dir" : 'X\(//\)$' \| \
++ X"$as_dir" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$as_dir" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ done
++ test ! -n "$as_dirs" || mkdir $as_dirs
++ fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
++echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
++ { (exit 1); exit 1; }; }; }
++
++ # echo "creating $dirpart/$file"
++ echo '# dummy' > "$dirpart/$file"
++ done
++done
++ ;;
++ esac
++done
++_ACEOF
++
++cat >>$CONFIG_STATUS <<\_ACEOF
++
++{ (exit 0); exit 0; }
++_ACEOF
++chmod +x $CONFIG_STATUS
++ac_clean_files=$ac_clean_files_save
++
++
++# configure is writing to config.log, and then calls config.status.
++# config.status does its own redirection, appending to config.log.
++# Unfortunately, on DOS this fails, as config.log is still kept open
++# by configure, so config.status won't be able to write to it; its
++# output is simply discarded. So we exec the FD to /dev/null,
++# effectively closing config.log, so it can be properly (re)opened and
++# appended to by config.status. When coming back to configure, we
++# need to make the FD available again.
++if test "$no_create" != yes; then
++ ac_cs_success=:
++ ac_config_status_args=
++ test "$silent" = yes &&
++ ac_config_status_args="$ac_config_status_args --quiet"
++ exec 5>/dev/null
++ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
++ exec 5>>config.log
++ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
++ # would make configure fail if this is the last instruction.
++ $ac_cs_success || { (exit 1); exit 1; }
++fi
++
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-configure.in b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-configure.in
new file mode 100644
index 000000000000..489562ef4faf
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-configure.in
@@ -0,0 +1,17 @@
+--- newlib/libc/sys/psp/configure.in.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/configure.in 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,14 @@
++dnl This is the newlib/libc/sys/sun4 configure.in file.
++dnl Process this file with autoconf to produce a configure script.
++
++AC_PREREQ(2.59)
++AC_INIT([newlib],[NEWLIB_VERSION])
++AC_CONFIG_SRCDIR([libcglue.c])
++
++dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake.
++AC_CONFIG_AUX_DIR(../../../..)
++
++NEWLIB_CONFIGURE(../../..)
++
++AC_CONFIG_FILES(Makefile)
++AC_OUTPUT
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-crt0.c b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-crt0.c
new file mode 100644
index 000000000000..d060beab6984
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-crt0.c
@@ -0,0 +1,6 @@
+--- newlib/libc/sys/psp/crt0.c.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/crt0.c 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,3 @@
++/* The real crt0.c lives in PSPSDK. */
++
++void _start() { }
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-fdman.c b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-fdman.c
new file mode 100644
index 000000000000..27502fae541e
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-fdman.c
@@ -0,0 +1,118 @@
+--- newlib/libc/sys/psp/fdman.c.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/fdman.c 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,115 @@
++/*
++ * PSP Software Development Kit - http://www.pspdev.org
++ * -----------------------------------------------------------------------
++ * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
++ *
++ * fdman.c - File descriptor management.
++ *
++ * Copyright (c) 2006 Rafael Cabezas <rafpsp@gmail.com>
++ */
++#include <psptypes.h>
++#include <errno.h>
++#include "fdman.h"
++
++extern int pspDisableInterrupts();
++extern void pspEnableInterrupts(int);
++
++static __psp_descriptormap_type __psp_descriptor_data_pool[__PSP_FILENO_MAX];
++__psp_descriptormap_type *__psp_descriptormap [__PSP_FILENO_MAX];
++
++void __psp_fdman_init()
++{
++ int scefd;
++
++ /* Initialize descriptor data*/
++ memset(__psp_descriptor_data_pool, 0, sizeof(__psp_descriptormap_type) *__PSP_FILENO_MAX);
++ /* Initialize descriptor map*/
++ memset(__psp_descriptormap, 0, sizeof(__psp_descriptormap_type*)*__PSP_FILENO_MAX);
++
++ scefd = sceKernelStdin();
++ if ((scefd >= 0) && (scefd < __PSP_FILENO_MAX)) {
++ __psp_descriptormap[0] = &__psp_descriptor_data_pool[0];
++ __psp_descriptormap[0]->sce_descriptor = scefd;
++ __psp_descriptormap[0]->type = __PSP_DESCRIPTOR_TYPE_TTY;
++ }
++ scefd = sceKernelStdout();
++ if ((scefd >= 0) && (scefd < __PSP_FILENO_MAX)) {
++ __psp_descriptormap[1] = &__psp_descriptor_data_pool[1];
++ __psp_descriptormap[1]->sce_descriptor = scefd;
++ __psp_descriptormap[1]->type = __PSP_DESCRIPTOR_TYPE_TTY;
++ }
++ scefd = sceKernelStderr();
++ if ((scefd >= 0) && (scefd < __PSP_FILENO_MAX)) {
++ __psp_descriptormap[2] = &__psp_descriptor_data_pool[2];
++ __psp_descriptormap[2]->sce_descriptor = scefd;
++ __psp_descriptormap[2]->type = __PSP_DESCRIPTOR_TYPE_TTY;
++ }
++}
++
++int __psp_fdman_get_new_descriptor()
++{
++ int i = 0;
++ int inten;
++
++ inten = pspDisableInterrupts(); /* lock here to make thread safe */
++ for (i = 0; i < __PSP_FILENO_MAX; i++) {
++ if (__psp_descriptormap[i] == NULL) {
++ __psp_descriptormap[i] = &__psp_descriptor_data_pool[i];
++ __psp_descriptormap[i]->ref_count++;
++ pspEnableInterrupts(inten); /* release lock */
++ return i;
++ }
++ }
++ pspEnableInterrupts(inten); /* release lock */
++
++ errno = ENOMEM;
++ return -1;
++}
++
++int __psp_fdman_get_dup_descriptor(int fd)
++{
++ int i = 0;
++ int inten;
++
++ if (!__PSP_IS_FD_VALID(fd)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ inten = pspDisableInterrupts(); /* lock here to make thread safe */
++ for (i = 0; i < __PSP_FILENO_MAX; i++) {
++ if (__psp_descriptormap[i] == NULL) {
++ __psp_descriptormap[i] = &__psp_descriptor_data_pool[fd];
++ __psp_descriptormap[i]->ref_count++;
++ pspEnableInterrupts(inten); /* release lock */
++ return i;
++ }
++ }
++ pspEnableInterrupts(inten); /* release lock */
++
++ errno = ENOMEM;
++ return -1;
++}
++
++void __psp_fdman_release_descriptor(int fd)
++{
++ if (!__PSP_IS_FD_VALID(fd)) {
++ errno = EBADF;
++ return;
++ }
++
++ __psp_descriptormap[fd]->ref_count--;
++
++ if (__psp_descriptormap[fd]->ref_count == 0) {
++
++ if (__psp_descriptormap[fd]->filename != NULL) {
++ free(__psp_descriptormap[fd]->filename);
++ }
++ __psp_descriptormap[fd]->filename = NULL;
++ __psp_descriptormap[fd]->sce_descriptor = 0;
++ __psp_descriptormap[fd]->type = 0;
++ __psp_descriptormap[fd]->flags = 0;
++
++ }
++ __psp_descriptormap[fd] = NULL;
++}
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-fdman.h b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-fdman.h
new file mode 100644
index 000000000000..5f31a762b2e4
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-fdman.h
@@ -0,0 +1,47 @@
+--- newlib/libc/sys/psp/fdman.h.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/fdman.h 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,44 @@
++/*
++ * PSP Software Development Kit - http://www.pspdev.org
++ * -----------------------------------------------------------------------
++ * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
++ *
++ * fdman.h - File descriptor management.
++ *
++ * Copyright (c) 2006 Rafael Cabezas <rafpsp@gmail.com>
++ */
++
++#ifndef _FDMAN_H_
++ #define _FDMAN_H_
++
++ #define __PSP_FILENO_MAX 1024
++
++ #define __PSP_IS_FD_VALID(FD) \
++ ( (FD >= 0) && (FD < __PSP_FILENO_MAX) && (__psp_descriptormap[FD] != NULL) )
++
++ #define __PSP_IS_FD_OF_TYPE(FD, TYPE) \
++ ( (__PSP_IS_FD_VALID(FD)) && (__psp_descriptormap[FD]->type == TYPE) )
++
++ typedef enum {
++ __PSP_DESCRIPTOR_TYPE_FILE ,
++ __PSP_DESCRIPTOR_TYPE_PIPE ,
++ __PSP_DESCRIPTOR_TYPE_SOCKET,
++ __PSP_DESCRIPTOR_TYPE_TTY
++ } __psp_fdman_fd_types;
++
++ typedef struct {
++ char * filename;
++ u8 type;
++ u32 sce_descriptor;
++ u32 flags;
++ u32 ref_count;
++ } __psp_descriptormap_type;
++
++ extern __psp_descriptormap_type *__psp_descriptormap[__PSP_FILENO_MAX];
++
++ void __psp_fdman_init();
++ int __psp_fdman_get_new_descriptor();
++ int __psp_fdman_get_dup_descriptor(int fd);
++ void __psp_fdman_release_descriptor(int fd);
++
++#endif
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-include-netdb.h b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-include-netdb.h
new file mode 100644
index 000000000000..412165933f2f
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-include-netdb.h
@@ -0,0 +1,39 @@
+--- newlib/libc/sys/psp/include/netdb.h.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/include/netdb.h 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,36 @@
++/* Simple gethostbyname and gethostbyaddr replacements, note not thread safe */
++#ifndef __NETDB_H__
++#define __NETDB_H__
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#define NETDB_INTERNAL -1 /* see errno */
++#define NETDB_SUCCESS 0 /* no problem */
++#define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */
++#define TRY_AGAIN 2 /* Non-Authoritative Host not found, or SERVERFAIL */
++#define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
++#define NO_DATA 4 /* Valid name, no data record of requested type */
++#define NO_ADDRESS NO_DATA /* no address, look for MX record */
++
++extern int h_errno;
++
++struct hostent
++{
++ char *h_name;
++ char **h_aliases;
++ int h_addrtype;
++ int h_length;
++ char **h_addr_list;
++ char *h_addr;
++};
++
++struct hostent *gethostbyaddr(const void *addr, int len, int type);
++struct hostent *gethostbyname(const char *name);
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-interrupt.S b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-interrupt.S
new file mode 100644
index 000000000000..c6fb9ec371dc
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-interrupt.S
@@ -0,0 +1,69 @@
+--- newlib/libc/sys/psp/interrupt.S.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/interrupt.S 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,66 @@
++
++ .set noreorder
++ .set noat
++
++ .global pspDisableInterrupts
++ .ent pspDisableInterrupts
++
++pspDisableInterrupts:
++ mfic $v0, $0
++ mtic $0, $0
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ jr $ra
++ nop
++
++ .end pspDisableInterrupts
++
++ .global pspEnableInterrupts
++ .ent pspEnableInterrupts
++
++pspEnableInterrupts:
++ mtic $a0, $0
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ nop
++ jr $ra
++ nop
++
++ .end pspEnableInterrupts
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-libcglue.c b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-libcglue.c
new file mode 100644
index 000000000000..2985d2966342
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-libcglue.c
@@ -0,0 +1,939 @@
+--- newlib/libc/sys/psp/libcglue.c.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/libcglue.c 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,936 @@
++/*
++ * PSP Software Development Kit - http://www.pspdev.org
++ * -----------------------------------------------------------------------
++ * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
++ *
++ * libcglue.c - Newlib-compatible system calls.
++ *
++ * Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
++ * Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
++ * Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
++ * Copyright (c) 2005 Jim Paris <jim@jtan.com>
++ *
++ */
++#include <errno.h>
++#include <malloc.h>
++#include <reent.h>
++#include <stdarg.h>
++#include <stdlib.h>
++#include <string.h>
++#include <time.h>
++#include <sys/fcntl.h>
++#include <sys/stat.h>
++#include <sys/time.h>
++#include <sys/types.h>
++#include <sys/unistd.h>
++#include <sys/dirent.h>
++#include <sys/socket.h>
++
++#include <psptypes.h>
++#include <pspiofilemgr.h>
++#include <pspmodulemgr.h>
++#include <pspsysmem.h>
++#include <pspthreadman.h>
++#include <psputils.h>
++#include <psputility.h>
++#include <pspstdio.h>
++#include <pspintrman.h>
++#include "fdman.h"
++
++extern char __psp_cwd[MAXPATHLEN + 1];
++extern void __psp_init_cwd(char *argv_0);
++extern int __psp_path_absolute(const char *in, char *out, int len);
++extern int pspDisableInterrupts();
++extern void pspEnableInterrupts(int);
++
++/* The following functions are defined in socket.c. They have weak linkage so
++ that the user doesn't have to link against the PSP network libraries if they
++ don't use the sockets API. */
++extern int __psp_socket_close(int s) __attribute__((weak));
++extern ssize_t __psp_socket_recv(int s, void *buf, size_t len, int flags) __attribute__((weak));
++extern ssize_t __psp_socket_send(int s, const void *buf, size_t len, int flags) __attribute__((weak));
++
++extern int pipe(int fildes[2]);
++extern int __psp_pipe_close(int filedes);
++extern int __psp_pipe_nonblocking_read(int fd, void *buf, size_t len);
++extern int __psp_pipe_read(int fd, void *buf, size_t len);
++extern int __psp_pipe_write(int fd, const void *buf, size_t size);
++extern int __psp_pipe_nonblocking_write(int fd, const void *buf, size_t len);
++
++int __psp_set_errno(int code);
++
++#ifdef F___psp_set_errno
++int __psp_set_errno(int code)
++{
++ if ((code & 0x80010000) == 0x80010000) {
++ errno = code & 0xFFFF;
++ return -1;
++ }
++ return code;
++}
++#endif
++
++#ifdef F_getcwd
++char *getcwd(char *buf, size_t size)
++{
++ if(!buf) {
++ errno = EINVAL;
++ return NULL;
++ }
++
++ if(strlen(__psp_cwd) >= size) {
++ errno = ERANGE;
++ return NULL;
++ }
++
++ strcpy(buf, __psp_cwd);
++ return buf;
++}
++#endif
++
++#ifdef F_chdir
++int chdir(const char *path)
++{
++ char dest[MAXPATHLEN + 1];
++ SceUID uid;
++
++ if(__psp_path_absolute(path, dest, MAXPATHLEN) < 0) {
++ errno = ENAMETOOLONG;
++ return -1;
++ }
++
++ /* sceIoChdir doesn't give an indication of whether it worked,
++ so test for existence by attempting to open the dir */
++ uid = sceIoDopen(dest);
++ if(uid < 0) {
++ errno = ENOTDIR;
++ return -1;
++ }
++ sceIoDclose(uid);
++
++ sceIoChdir(dest);
++ strcpy(__psp_cwd, dest);
++ return 0;
++}
++#endif
++
++#ifdef F_mkdir
++int mkdir(const char *pathname, mode_t mode)
++{
++ char dest[MAXPATHLEN + 1];
++
++ if(__psp_path_absolute(pathname, dest, MAXPATHLEN) < 0) {
++ errno = ENAMETOOLONG;
++ return -1;
++ }
++
++ return __psp_set_errno(sceIoMkdir(dest, mode));
++}
++#endif
++
++#ifdef F_rmdir
++int rmdir(const char *pathname)
++{
++ char dest[MAXPATHLEN + 1];
++
++ if(__psp_path_absolute(pathname, dest, MAXPATHLEN) < 0) {
++ errno = ENAMETOOLONG;
++ return -1;
++ }
++
++ return __psp_set_errno(sceIoRmdir(dest));
++}
++#endif
++
++#ifdef F_realpath
++char *realpath(const char *path, char *resolved_path)
++{
++ if(!path || !resolved_path) {
++ errno = EINVAL;
++ return NULL;
++ }
++ if(__psp_path_absolute(path, resolved_path, MAXPATHLEN) < 0) {
++ errno = ENAMETOOLONG;
++ return NULL;
++ }
++ if(access(resolved_path, F_OK) < 0) {
++ errno = ENOENT;
++ return NULL;
++ }
++ return resolved_path;
++}
++#endif
++
++/* Wrappers of the standard open(), close(), read(), write(), unlink() and lseek() routines. */
++#ifdef F__open
++int _open(const char *name, int flags, int mode)
++{
++ int scefd, fd;
++ int sce_flags;
++ char dest[MAXPATHLEN + 1];
++
++ if(__psp_path_absolute(name, dest, MAXPATHLEN) < 0) {
++ errno = ENAMETOOLONG;
++ return -1;
++ }
++
++ /* O_RDONLY starts at 0, where PSP_O_RDONLY starts at 1, so remap the read/write
++ flags by adding 1. */
++ sce_flags = (flags & O_ACCMODE) + 1;
++
++ /* Translate standard open flags into the flags understood by the PSP kernel. */
++ if (flags & O_APPEND) {
++ sce_flags |= PSP_O_APPEND;
++ }
++ if (flags & O_CREAT) {
++ sce_flags |= PSP_O_CREAT;
++ }
++ if (flags & O_TRUNC) {
++ sce_flags |= PSP_O_TRUNC;
++ }
++ if (flags & O_EXCL) {
++ sce_flags |= PSP_O_EXCL;
++ }
++ if (flags & O_NONBLOCK) {
++ sce_flags |= PSP_O_NBLOCK;
++ }
++
++ scefd = sceIoOpen(dest, sce_flags, mode);
++ if (scefd >= 0) {
++ fd = __psp_fdman_get_new_descriptor();
++ if (fd != -1) {
++ __psp_descriptormap[fd]->sce_descriptor = scefd;
++ __psp_descriptormap[fd]->type = __PSP_DESCRIPTOR_TYPE_FILE;
++ __psp_descriptormap[fd]->flags = flags;
++ __psp_descriptormap[fd]->filename = strdup(dest);
++ return fd;
++ }
++ else {
++ sceIoClose(scefd);
++ errno = ENOMEM;
++ return -1;
++ }
++ }
++ else {
++ return __psp_set_errno(scefd);
++ }
++
++}
++#endif
++
++#ifdef F__close
++int _close(int fd)
++{
++ int ret = 0;
++
++ if (!__PSP_IS_FD_VALID(fd)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ switch(__psp_descriptormap[fd]->type)
++ {
++ case __PSP_DESCRIPTOR_TYPE_FILE:
++ case __PSP_DESCRIPTOR_TYPE_TTY:
++ if (__psp_descriptormap[fd]->ref_count == 1) {
++ ret = __psp_set_errno(sceIoClose(__psp_descriptormap[fd]->sce_descriptor));
++ }
++ __psp_fdman_release_descriptor(fd);
++ return ret;
++ break;
++ case __PSP_DESCRIPTOR_TYPE_PIPE:
++ return __psp_pipe_close(fd);
++ break;
++ case __PSP_DESCRIPTOR_TYPE_SOCKET:
++ if (__psp_socket_close != NULL) {
++ ret = __psp_socket_close(fd);
++ return ret;
++ }
++ break;
++ default:
++ break;
++ }
++
++ errno = EBADF;
++ return -1;
++}
++#endif
++
++#ifdef F__read
++int _read(int fd, void *buf, size_t size)
++{
++ if (!__PSP_IS_FD_VALID(fd)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ switch(__psp_descriptormap[fd]->type)
++ {
++ case __PSP_DESCRIPTOR_TYPE_FILE:
++ case __PSP_DESCRIPTOR_TYPE_TTY:
++ return __psp_set_errno(sceIoRead(__psp_descriptormap[fd]->sce_descriptor, buf, size));
++ break;
++ case __PSP_DESCRIPTOR_TYPE_PIPE:
++ if (__psp_descriptormap[fd]->flags & O_NONBLOCK) {
++ return __psp_pipe_nonblocking_read(fd, buf, size);
++ }
++ else {
++ return __psp_pipe_read(fd, buf, size);
++ }
++ break;
++ case __PSP_DESCRIPTOR_TYPE_SOCKET:
++ if (__psp_socket_recv != NULL) {
++ return __psp_socket_recv(fd, buf, size, 0);
++ }
++ break;
++ default:
++ break;
++ }
++
++ errno = EBADF;
++ return -1;
++
++}
++#endif
++
++#ifdef F__write
++int _write(int fd, const void *buf, size_t size)
++{
++ if (!__PSP_IS_FD_VALID(fd)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ switch(__psp_descriptormap[fd]->type)
++ {
++ case __PSP_DESCRIPTOR_TYPE_FILE:
++ case __PSP_DESCRIPTOR_TYPE_TTY:
++ return __psp_set_errno(sceIoWrite(__psp_descriptormap[fd]->sce_descriptor, buf, size));
++ break;
++ case __PSP_DESCRIPTOR_TYPE_PIPE:
++ if (__psp_descriptormap[fd]->flags & O_NONBLOCK) {
++ return __psp_pipe_nonblocking_write(fd, buf, size);
++ }
++ else {
++ return __psp_pipe_write(fd, buf, size);
++ }
++ break;
++ break;
++ case __PSP_DESCRIPTOR_TYPE_SOCKET:
++ if (__psp_socket_send != NULL) {
++ return __psp_socket_send(fd, buf, size, 0);
++ }
++ break;
++ default:
++ break;
++ }
++
++ errno = EBADF;
++ return -1;
++}
++#endif
++
++#ifdef F__lseek
++off_t _lseek(int fd, off_t offset, int whence)
++{
++ if (!__PSP_IS_FD_VALID(fd)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ switch(__psp_descriptormap[fd]->type)
++ {
++ case __PSP_DESCRIPTOR_TYPE_FILE:
++ /* We don't have to do anything with the whence argument because SEEK_* == PSP_SEEK_*. */
++ return (off_t) __psp_set_errno(sceIoLseek(__psp_descriptormap[fd]->sce_descriptor, offset, whence));
++ break;
++ case __PSP_DESCRIPTOR_TYPE_PIPE:
++ break;
++ case __PSP_DESCRIPTOR_TYPE_SOCKET:
++ break;
++ default:
++ break;
++ }
++
++ errno = EBADF;
++ return -1;
++
++}
++#endif
++
++#ifdef F__unlink
++int _unlink(const char *path)
++{
++ char dest[MAXPATHLEN + 1];
++
++ if(__psp_path_absolute(path, dest, MAXPATHLEN) < 0) {
++ errno = ENAMETOOLONG;
++ return -1;
++ }
++
++ return __psp_set_errno(sceIoRemove(dest));
++}
++#endif
++
++#ifdef F__link
++int _link(const char *name1, const char *name2)
++{
++ errno = ENOSYS;
++ return -1; /* not supported */
++}
++#endif
++
++#ifdef F_opendir
++DIR *opendir(const char *filename)
++{
++ char dest[MAXPATHLEN + 1];
++ DIR *dirp;
++ SceUID uid;
++
++ /* Normalize pathname so that opendir(".") works */
++ if(__psp_path_absolute(filename, dest, MAXPATHLEN) < 0) {
++ errno = ENOENT;
++ return NULL;
++ }
++
++ dirp = (DIR *)malloc(sizeof(DIR));
++
++ uid = sceIoDopen(dest);
++
++ if (uid < 0)
++ {
++ free(dirp);
++ (void) __psp_set_errno(uid);
++ return NULL;
++ }
++
++ dirp->uid = uid;
++
++ return dirp;
++}
++#endif
++
++#ifdef F_readdir
++struct dirent *readdir(DIR *dirp)
++{
++ int ret;
++
++ /* Zero the dirent, to avoid possible problems with sceIoDread */
++ memset(&dirp->de, 0, sizeof(struct dirent));
++
++ ret = sceIoDread(dirp->uid, (SceIoDirent *)&dirp->de);
++ if (ret == 0) {
++ /* EOF */
++ errno = 0;
++ return NULL;
++ }
++ if (ret < 0) {
++ (void) __psp_set_errno(ret);
++ return NULL;
++ }
++
++ return &dirp->de;
++}
++#endif
++
++#ifdef F_closedir
++int closedir(DIR *dirp)
++{
++ if (dirp != NULL)
++ {
++ int uid;
++ uid = dirp->uid;
++ free (dirp);
++ return __psp_set_errno(sceIoDclose(uid));
++ }
++ errno = EBADF;
++ return -1;
++}
++#endif
++
++/* Time routines. These wrap around the routines provided by the kernel. */
++#ifdef F__gettimeofday
++int _gettimeofday(struct timeval *tp, struct timezone *tzp)
++{
++ return __psp_set_errno(sceKernelLibcGettimeofday(tp, tzp));
++}
++
++#endif
++
++#if defined(F_clock)
++clock_t clock(void)
++{
++ return sceKernelLibcClock();
++}
++#endif
++
++#if defined(F_time)
++time_t time(time_t *t)
++{
++ return __psp_set_errno(sceKernelLibcTime(t));
++}
++#endif
++
++#if defined(F_sleep)
++unsigned int sleep(unsigned int secs) {
++ while(secs--) {
++ sceKernelDelayThreadCB(1000000);
++ }
++ return 0;
++}
++#endif
++
++/* PSP-compatible sbrk(). */
++#if defined(F__sbrk) || defined(F_glue__sbrk)
++/* TODO: Currently our default heap is set to the maximum available block size
++ when sbrk() is first called. Sony seems to always use a default of 64KB,
++ with the expectation that user programs will override the default size with
++ their own desired size. The only reason I can think of them doing this is
++ to allow each PRX to have their own seperate heap. I think that their
++ method is overkill for most user programs.
++
++ What I'd like to do instead is to use the default of 64KB for PRXes as Sony
++ does, but use the maximum available block size for executables. This avoids
++ the requirement of specifying the heap size manually in user programs.
++ However, we currently don't have a clean way to distinguish PRXes and normal
++ executables, so this code needs to be revisited once we do come up with a
++ way. */
++#define DEFAULT_PRX_HEAP_SIZE_KB 64
++
++/* If defined it specifies the desired size of the heap, in KB. */
++extern unsigned int sce_newlib_heap_kb_size __attribute__((weak));
++extern int __pspsdk_is_prx __attribute__((weak));
++
++/* UID of the memory block that represents the heap. */
++static SceUID __psp_heap_blockid;
++
++void * _sbrk(ptrdiff_t incr)
++{
++ static void * heap_bottom = NULL;
++ static void * heap_top = NULL;
++ static void * heap_ptr = NULL;
++
++ /* Has our heap been initialized? */
++ if (heap_bottom == NULL) {
++ /* No, initialize the heap. */
++ SceSize heap_size;
++
++ if (&sce_newlib_heap_kb_size != NULL) {
++ heap_size = sce_newlib_heap_kb_size * 1024;
++ } else {
++ if (&__pspsdk_is_prx != NULL) {
++ heap_size = DEFAULT_PRX_HEAP_SIZE_KB * 1024;
++ } else {
++ heap_size = sceKernelMaxFreeMemSize();
++ }
++ }
++
++ __psp_heap_blockid = sceKernelAllocPartitionMemory(2, "block", PSP_SMEM_Low, heap_size, NULL);
++ if (__psp_heap_blockid > 0) {
++ heap_bottom = sceKernelGetBlockHeadAddr(__psp_heap_blockid);
++ heap_ptr = heap_bottom;
++ heap_top = (unsigned char *) heap_bottom + heap_size;
++ }
++ }
++
++ void * heap_addr = (void *) -1;
++ void * next_heap_ptr = (void *) ((ptrdiff_t) heap_ptr + incr);
++ if ((heap_bottom != NULL) && (next_heap_ptr >= heap_bottom) && (next_heap_ptr < heap_top)) {
++ heap_addr = heap_ptr;
++ heap_ptr = next_heap_ptr;
++ }
++
++ return heap_addr;
++}
++
++/* Free the heap. */
++int __psp_free_heap(void)
++{
++ if (__psp_heap_blockid > 0) {
++ return sceKernelFreePartitionMemory(__psp_heap_blockid);
++ }
++
++ return __psp_heap_blockid;
++}
++#endif
++
++/* Other POSIX routines that must be defined. */
++#ifdef F__fstat
++int _fstat(int fd, struct stat *sbuf)
++{
++ int ret;
++ SceOff oldpos;
++ if (!__PSP_IS_FD_VALID(fd)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ switch(__psp_descriptormap[fd]->type)
++ {
++ case __PSP_DESCRIPTOR_TYPE_TTY:
++ memset(sbuf, '\0', sizeof(struct stat));
++ sbuf->st_mode = S_IFCHR;
++ return 0;
++ break;
++ case __PSP_DESCRIPTOR_TYPE_FILE:
++ if (__psp_descriptormap[fd]->filename != NULL) {
++ ret = stat(__psp_descriptormap[fd]->filename, sbuf);
++
++ /* Find true size of the open file */
++ oldpos = sceIoLseek(__psp_descriptormap[fd]->sce_descriptor, 0, SEEK_CUR);
++ if (oldpos != (off_t) -1) {
++ sbuf->st_size = (off_t) sceIoLseek(__psp_descriptormap[fd]->sce_descriptor, 0, SEEK_END);
++ sceIoLseek(__psp_descriptormap[fd]->sce_descriptor, oldpos, SEEK_SET);
++ }
++ return ret;
++ }
++ break;
++ case __PSP_DESCRIPTOR_TYPE_PIPE:
++ case __PSP_DESCRIPTOR_TYPE_SOCKET:
++ default:
++ break;
++ }
++
++ errno = EBADF;
++ return -1;
++}
++#endif
++
++#ifdef F_isatty
++int isatty(int fd)
++{
++ if (!__PSP_IS_FD_VALID(fd)) {
++ errno = EBADF;
++ return 0;
++ }
++
++ if (__psp_descriptormap[fd]->type == __PSP_DESCRIPTOR_TYPE_TTY) {
++ return 1;
++ }
++ else {
++ return 0;
++ }
++}
++#endif
++
++#ifdef F__stat
++static time_t psp_to_epoch_time(ScePspDateTime psp_time)
++{
++ struct tm conv_time;
++ conv_time.tm_year = psp_time.year;
++ conv_time.tm_mon = psp_time.month;
++ conv_time.tm_mday = psp_time.day;
++ conv_time.tm_hour = psp_time.hour;
++ conv_time.tm_min = psp_time.minute;
++ conv_time.tm_sec = psp_time.second;
++ conv_time.tm_isdst = -1;
++ return mktime(&conv_time);
++}
++
++int _stat(const char *filename, struct stat *buf)
++{
++ SceIoStat psp_stat;
++ char dest[MAXPATHLEN + 1];
++ int ret;
++
++ if(__psp_path_absolute(filename, dest, MAXPATHLEN) < 0) {
++ errno = ENAMETOOLONG;
++ return -1;
++ }
++
++ memset(buf, '\0', sizeof(struct stat));
++ ret = sceIoGetstat(dest, &psp_stat);
++ if (ret < 0) {
++ return __psp_set_errno(ret);
++ }
++
++ buf->st_ctime = psp_to_epoch_time(psp_stat.st_ctime);
++ buf->st_atime = psp_to_epoch_time(psp_stat.st_atime);
++ buf->st_mtime = psp_to_epoch_time(psp_stat.st_mtime);
++
++ buf->st_mode = (psp_stat.st_mode & 0xfff) |
++ ((FIO_S_ISLNK(psp_stat.st_mode))?(S_IFLNK):(0)) |
++ ((FIO_S_ISREG(psp_stat.st_mode))?(S_IFREG):(0)) |
++ ((FIO_S_ISDIR(psp_stat.st_mode))?(S_IFDIR):(0));
++ buf->st_size = psp_stat.st_size;
++ return 0;
++}
++#endif
++
++/* from stat.h in ps2sdk, this function may be correct */
++#define FIO_CST_SIZE 0x0004
++
++#ifdef F_truncate
++int truncate(const char *filename, off_t length)
++{
++ SceIoStat psp_stat;
++ char dest[MAXPATHLEN + 1];
++
++ if(__psp_path_absolute(filename, dest, MAXPATHLEN) < 0) {
++ errno = ENAMETOOLONG;
++ return -1;
++ }
++
++ psp_stat.st_size = length;
++ if(length < 0)
++ {
++ errno = EINVAL;
++ return -1;
++ }
++ return __psp_set_errno(sceIoChstat(dest, &psp_stat, FIO_CST_SIZE));
++}
++#endif
++
++/* Unsupported newlib system calls. */
++#ifdef F__fork
++pid_t fork(void)
++{
++ errno = ENOSYS;
++ return (pid_t) -1;
++}
++#endif
++
++#ifdef F__getpid
++pid_t _getpid(void)
++{
++ errno = ENOSYS;
++ return (pid_t) -1;
++}
++#endif
++
++#ifdef F__kill
++int _kill(int unused, int unused2)
++{
++ errno = ENOSYS;
++ return -1;
++}
++#endif
++
++#ifdef F__wait
++pid_t _wait(int *unused)
++{
++ errno = ENOSYS;
++ return (pid_t) -1;
++}
++#endif
++
++#ifdef F_access
++int access(const char *fn, int flags)
++{
++ struct stat s;
++ if (stat(fn, &s))
++ return -1;
++ if (s.st_mode & S_IFDIR)
++ return 0;
++ if (flags & W_OK)
++ {
++ if (s.st_mode & S_IWRITE)
++ return 0;
++ errno = EACCES;
++ return -1;
++ }
++ return 0;
++}
++#endif
++
++#ifdef F__fcntl
++int _fcntl(int fd, int cmd, ...)
++{
++ if (!__PSP_IS_FD_VALID(fd)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ switch (cmd)
++ {
++ case F_DUPFD:
++ {
++ return __psp_fdman_get_dup_descriptor(fd);
++ break;
++ }
++ case F_GETFL:
++ {
++ return __psp_descriptormap[fd]->flags;
++ break;
++ }
++ case F_SETFL:
++ {
++ int newfl;
++ va_list args;
++
++ va_start (args, cmd); /* Initialize the argument list. */
++ newfl = va_arg(args, int);
++ va_end (args); /* Clean up. */
++
++ __psp_descriptormap[fd]->flags = newfl;
++
++ switch(__psp_descriptormap[fd]->type)
++ {
++ case __PSP_DESCRIPTOR_TYPE_FILE:
++ break;
++ case __PSP_DESCRIPTOR_TYPE_PIPE:
++ break;
++ case __PSP_DESCRIPTOR_TYPE_SOCKET:
++ if (newfl & O_NONBLOCK)
++ {
++ int one = 1;
++ return setsockopt(fd, SOL_SOCKET, SO_NONBLOCK, (char *)&one, sizeof(one));
++ }
++ else
++ {
++ int zero = 0;
++ return setsockopt(fd, SOL_SOCKET, SO_NONBLOCK, (char *)&zero, sizeof(zero));
++ }
++ break;
++ default:
++ break;
++ }
++ return 0;
++ break;
++ }
++ }
++
++ errno = EBADF;
++ return -1;
++}
++#endif /* F__fcntl */
++
++#ifdef F_tzset
++void tzset(void)
++{
++ static int initialized = 0;
++
++ if (!initialized)
++ {
++ initialized = 1;
++
++ /* Don't init if TZ has already been set once, this probably means the user
++ wanted to override what we would set below. */
++ if (getenv("TZ") == NULL)
++ {
++ /* Initialize timezone from PSP configuration */
++ int tzOffset = 0;
++ sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_TIMEZONE, &tzOffset);
++ int tzOffsetAbs = tzOffset < 0 ? -tzOffset : tzOffset;
++ int hours = tzOffsetAbs / 60;
++ int minutes = tzOffsetAbs - hours * 60;
++ int pspDaylight = 0;
++ sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_DAYLIGHTSAVINGS, &pspDaylight);
++ static char tz[18];
++ sprintf(tz, "GMT%s%02i:%02i%s", tzOffset < 0 ? "+" : "-", hours, minutes, pspDaylight ? "daylight" : "");
++ setenv("TZ", tz, 1);
++ }
++ }
++
++ _tzset_r(_REENT);
++}
++#endif
++
++#ifdef F_mlock
++static unsigned int lock_count = 0;
++static unsigned int intr_flags = 0;
++
++void __malloc_lock(struct _reent *ptr)
++{
++ unsigned int flags = pspDisableInterrupts();
++
++ if (lock_count == 0) {
++ intr_flags = flags;
++ }
++
++ lock_count++;
++}
++
++void __malloc_unlock(struct _reent *ptr)
++{
++ if (--lock_count == 0) {
++ pspEnableInterrupts(intr_flags);
++ }
++}
++#endif
++
++/* Exit. */
++#if defined(F__exit) || defined(F_glue__exit)
++extern int sce_newlib_nocreate_thread_in_start __attribute__((weak));
++
++extern int __psp_free_heap(void);
++
++void _exit(int status)
++{
++ if (&sce_newlib_nocreate_thread_in_start == NULL) {
++ /* Free the heap created by _sbrk(). */
++ __psp_free_heap();
++
++ sceKernelSelfStopUnloadModule(1, 0, NULL);
++ } else {
++ if (status == 0) {
++ /* Free the heap created by _sbrk(). */
++ __psp_free_heap();
++ }
++
++ sceKernelExitThread(status);
++ }
++
++ while (1) ;
++}
++
++/* Note: This function is being linked into _exit.o.
++
++ Because __psp_libc_init is a weak import in crt0.c, the linker
++ chooses to ignore an object file in libc.a that contains just this
++ function, since it's not necessary for successful compilation.
++
++ By putting it instead in _exit.o, which is already used by crt0.c,
++ the linker sees __psp_libc_init and resolves the symbol properly.
++*/
++void __psp_libc_init(int argc, char *argv[])
++{
++ (void) argc;
++
++ /* Initialize cwd from this program's path */
++ __psp_init_cwd(argv[0]);
++
++ /* Initialize filedescriptor management */
++ __psp_fdman_init();
++}
++
++#endif /* F__exit */
++
++#ifdef F__rename
++int _rename(const char *old, const char *new)
++{
++ char oldname[MAXPATHLEN + 1];
++ char newname[MAXPATHLEN + 1];
++
++ if(__psp_path_absolute(old, oldname, MAXPATHLEN) < 0) {
++ errno = ENAMETOOLONG;
++ return -1;
++ }
++
++ if(__psp_path_absolute(new, newname, MAXPATHLEN) < 0) {
++ errno = ENAMETOOLONG;
++ return -1;
++ }
++
++ return __psp_set_errno(sceIoRename(oldname, newname));
++}
++#endif
++
++#ifdef F_nanosleep
++/* note: we don't use rem as we have no signals */
++int nanosleep(const struct timespec *req, struct timespec *rem)
++{
++ if( req == NULL )
++ return EFAULT;
++
++ if( rem != NULL ) {
++ rem->tv_sec = 0;
++ rem->tv_nsec = 0;
++ }
++
++ sceKernelDelayThreadCB( 1000000 * req->tv_sec + (req->tv_nsec / 1000) );
++
++ return 0;
++}
++#endif
++
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-netdb.c b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-netdb.c
new file mode 100644
index 000000000000..9a98f9cc9959
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-netdb.c
@@ -0,0 +1,106 @@
+--- newlib/libc/sys/psp/netdb.c.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/netdb.c 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,103 @@
++/* Simple gethostbyname and gethostbyaddr replacements using the resolver lib */
++#include <stdio.h>
++#include <netdb.h>
++#include <netinet/in.h>
++#include <arpa/inet.h>
++#include <sys/socket.h>
++#include <pspkerneltypes.h>
++#include <pspnet_resolver.h>
++
++#define MAX_NAME 512
++
++#ifdef F_h_errno
++int h_errno = NETDB_SUCCESS;
++#endif
++
++#ifdef F_gethostbyaddr
++struct hostent *gethostbyaddr(const void *addr, int len, int type)
++{
++ static struct hostent ent;
++ static char * aliases[1] = { NULL };
++ char buf[1024];
++ static char sname[MAX_NAME] = "";
++ static struct in_addr saddr = { 0 };
++ static char *addrlist[2] = { (char *) &saddr, NULL };
++ int rid;
++ int err;
++
++ if((len != sizeof(struct in_addr)) || (type != AF_INET) || (addr == NULL))
++ {
++ h_errno = HOST_NOT_FOUND;
++ return NULL;
++ }
++
++ memcpy(&saddr, addr, len);
++
++ if(sceNetResolverCreate(&rid, buf, sizeof(buf)) < 0)
++ {
++ h_errno = NO_RECOVERY;
++ return NULL;
++ }
++
++ err = sceNetResolverStartAtoN(rid, &saddr, sname, sizeof(sname), 2, 3);
++ sceNetResolverStop(rid);
++ sceNetResolverDelete(rid);
++ if(err < 0)
++ {
++ h_errno = HOST_NOT_FOUND;
++ return NULL;
++ }
++
++ ent.h_name = sname;
++ ent.h_aliases = aliases;
++ ent.h_addrtype = AF_INET;
++ ent.h_length = sizeof(struct in_addr);
++ ent.h_addr_list = addrlist;
++ ent.h_addr = (char *) &saddr;
++
++ return &ent;
++}
++#endif
++
++#ifdef F_gethostbyname
++struct hostent *gethostbyname(const char *name)
++{
++ static struct hostent ent;
++ char buf[1024];
++ static char sname[MAX_NAME] = "";
++ static struct in_addr saddr = { 0 };
++ static char *addrlist[2] = { (char *) &saddr, NULL };
++ int rid;
++
++ if(sceNetInetInetAton(name, &saddr) == 0)
++ {
++ int err;
++
++ if(sceNetResolverCreate(&rid, buf, sizeof(buf)) < 0)
++ {
++ h_errno = NO_RECOVERY;
++ return NULL;
++ }
++
++ err = sceNetResolverStartNtoA(rid, name, &saddr, 2, 3);
++ sceNetResolverDelete(rid);
++ if(err < 0)
++ {
++ h_errno = HOST_NOT_FOUND;
++ return NULL;
++ }
++
++ }
++
++ snprintf(sname, MAX_NAME, "%s", name);
++ ent.h_name = sname;
++ ent.h_aliases = 0;
++ ent.h_addrtype = AF_INET;
++ ent.h_length = sizeof(struct in_addr);
++ ent.h_addr_list = addrlist;
++ ent.h_addr = (char *) &saddr;
++
++ return &ent;
++}
++
++#endif
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-netinet-in.h b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-netinet-in.h
new file mode 100644
index 000000000000..e350e44418dd
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-netinet-in.h
@@ -0,0 +1,274 @@
+--- newlib/libc/sys/psp/netinet/in.h.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/netinet/in.h 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,271 @@
++/* $NetBSD: in.h,v 1.71 2005/08/05 09:21:25 elad Exp $ */
++
++/*
++ * Copyright (c) 1982, 1986, 1990, 1993
++ * The Regents of the University of California. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the University nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ *
++ * @(#)in.h 8.3 (Berkeley) 1/3/94
++ */
++
++/*
++ * Constants and structures defined by the internet system,
++ * Per RFC 790, September 1981, and numerous additions.
++ */
++
++#ifndef _NETINET_IN_H_
++#define _NETINET_IN_H_
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#include <sys/socket.h>
++
++typedef uint32_t in_addr_t;
++typedef uint16_t in_port_t;
++
++/*
++ * Protocols
++ */
++#define IPPROTO_IP 0 /* dummy for IP */
++#define IPPROTO_HOPOPTS 0 /* IP6 hop-by-hop options */
++#define IPPROTO_ICMP 1 /* control message protocol */
++#define IPPROTO_IGMP 2 /* group mgmt protocol */
++#define IPPROTO_GGP 3 /* gateway^2 (deprecated) */
++#define IPPROTO_IPV4 4 /* IP header */
++#define IPPROTO_IPIP 4 /* IP inside IP */
++#define IPPROTO_TCP 6 /* tcp */
++#define IPPROTO_EGP 8 /* exterior gateway protocol */
++#define IPPROTO_PUP 12 /* pup */
++#define IPPROTO_UDP 17 /* user datagram protocol */
++#define IPPROTO_IDP 22 /* xns idp */
++#define IPPROTO_TP 29 /* tp-4 w/ class negotiation */
++#define IPPROTO_IPV6 41 /* IP6 header */
++#define IPPROTO_ROUTING 43 /* IP6 routing header */
++#define IPPROTO_FRAGMENT 44 /* IP6 fragmentation header */
++#define IPPROTO_RSVP 46 /* resource reservation */
++#define IPPROTO_GRE 47 /* GRE encaps RFC 1701 */
++#define IPPROTO_ESP 50 /* encap. security payload */
++#define IPPROTO_AH 51 /* authentication header */
++#define IPPROTO_MOBILE 55 /* IP Mobility RFC 2004 */
++#define IPPROTO_IPV6_ICMP 58 /* IPv6 ICMP */
++#define IPPROTO_ICMPV6 58 /* ICMP6 */
++#define IPPROTO_NONE 59 /* IP6 no next header */
++#define IPPROTO_DSTOPTS 60 /* IP6 destination option */
++#define IPPROTO_EON 80 /* ISO cnlp */
++#define IPPROTO_ETHERIP 97 /* Ethernet-in-IP */
++#define IPPROTO_ENCAP 98 /* encapsulation header */
++#define IPPROTO_PIM 103 /* Protocol indep. multicast */
++#define IPPROTO_IPCOMP 108 /* IP Payload Comp. Protocol */
++#define IPPROTO_VRRP 112 /* VRRP RFC 2338 */
++
++#define IPPROTO_RAW 255 /* raw IP packet */
++#define IPPROTO_MAX 256
++
++/* last return value of *_input(), meaning "all job for this pkt is done". */
++#define IPPROTO_DONE 257
++
++/* sysctl placeholder for (FAST_)IPSEC */
++#define CTL_IPPROTO_IPSEC 258
++
++
++/*
++ * Local port number conventions:
++ *
++ * Ports < IPPORT_RESERVED are reserved for privileged processes (e.g. root),
++ * unless a kernel is compiled with IPNOPRIVPORTS defined.
++ *
++ * When a user does a bind(2) or connect(2) with a port number of zero,
++ * a non-conflicting local port address is chosen.
++ *
++ * The default range is IPPORT_ANONMIN to IPPORT_ANONMAX, although
++ * that is settable by sysctl(3); net.inet.ip.anonportmin and
++ * net.inet.ip.anonportmax respectively.
++ *
++ * A user may set the IPPROTO_IP option IP_PORTRANGE to change this
++ * default assignment range.
++ *
++ * The value IP_PORTRANGE_DEFAULT causes the default behavior.
++ *
++ * The value IP_PORTRANGE_HIGH is the same as IP_PORTRANGE_DEFAULT,
++ * and exists only for FreeBSD compatibility purposes.
++ *
++ * The value IP_PORTRANGE_LOW changes the range to the "low" are
++ * that is (by convention) restricted to privileged processes.
++ * This convention is based on "vouchsafe" principles only.
++ * It is only secure if you trust the remote host to restrict these ports.
++ * The range is IPPORT_RESERVEDMIN to IPPORT_RESERVEDMAX.
++ */
++
++#define IPPORT_RESERVED 1024
++#define IPPORT_ANONMIN 49152
++#define IPPORT_ANONMAX 65535
++#define IPPORT_RESERVEDMIN 600
++#define IPPORT_RESERVEDMAX (IPPORT_RESERVED-1)
++
++/*
++ * Internet address (a structure for historical reasons)
++ */
++struct in_addr {
++ in_addr_t s_addr;
++} __attribute__((__packed__));
++
++#define __IPADDR(x) ((uint32_t)(x))
++
++#define IN_CLASSA(i) (((uint32_t)(i) & __IPADDR(0x80000000)) == \
++ __IPADDR(0x00000000))
++#define IN_CLASSA_NET __IPADDR(0xff000000)
++#define IN_CLASSA_NSHIFT 24
++#define IN_CLASSA_HOST __IPADDR(0x00ffffff)
++#define IN_CLASSA_MAX 128
++
++#define IN_CLASSB(i) (((uint32_t)(i) & __IPADDR(0xc0000000)) == \
++ __IPADDR(0x80000000))
++#define IN_CLASSB_NET __IPADDR(0xffff0000)
++#define IN_CLASSB_NSHIFT 16
++#define IN_CLASSB_HOST __IPADDR(0x0000ffff)
++#define IN_CLASSB_MAX 65536
++
++#define IN_CLASSC(i) (((uint32_t)(i) & __IPADDR(0xe0000000)) == \
++ __IPADDR(0xc0000000))
++#define IN_CLASSC_NET __IPADDR(0xffffff00)
++#define IN_CLASSC_NSHIFT 8
++#define IN_CLASSC_HOST __IPADDR(0x000000ff)
++
++#define IN_CLASSD(i) (((uint32_t)(i) & __IPADDR(0xf0000000)) == \
++ __IPADDR(0xe0000000))
++/* These ones aren't really net and host fields, but routing needn't know. */
++#define IN_CLASSD_NET __IPADDR(0xf0000000)
++#define IN_CLASSD_NSHIFT 28
++#define IN_CLASSD_HOST __IPADDR(0x0fffffff)
++#define IN_MULTICAST(i) IN_CLASSD(i)
++
++#define IN_EXPERIMENTAL(i) (((uint32_t)(i) & __IPADDR(0xf0000000)) == \
++ __IPADDR(0xf0000000))
++#define IN_BADCLASS(i) (((uint32_t)(i) & __IPADDR(0xf0000000)) == \
++ __IPADDR(0xf0000000))
++
++#define IN_LOCAL_GROUP(i) (((uint32_t)(i) & __IPADDR(0xffffff00)) == \
++ __IPADDR(0xe0000000))
++
++#define INADDR_ANY __IPADDR(0x00000000)
++#define INADDR_LOOPBACK __IPADDR(0x7f000001)
++#define INADDR_BROADCAST __IPADDR(0xffffffff) /* must be masked */
++
++#define INADDR_UNSPEC_GROUP __IPADDR(0xe0000000) /* 224.0.0.0 */
++#define INADDR_ALLHOSTS_GROUP __IPADDR(0xe0000001) /* 224.0.0.1 */
++#define INADDR_ALLRTRS_GROUP __IPADDR(0xe0000002) /* 224.0.0.2 */
++#define INADDR_MAX_LOCAL_GROUP __IPADDR(0xe00000ff) /* 224.0.0.255 */
++
++#define IN_LOOPBACKNET 127 /* official! */
++
++/*
++ * Socket address, internet style.
++ */
++struct sockaddr_in {
++ uint8_t sin_len;
++ sa_family_t sin_family;
++ in_port_t sin_port;
++ struct in_addr sin_addr;
++ int8_t sin_zero[8];
++};
++
++#define INET_ADDRSTRLEN 16
++
++/*
++ * Structure used to describe IP options.
++ * Used to store options internally, to pass them to a process,
++ * or to restore options retrieved earlier.
++ * The ip_dst is used for the first-hop gateway when using a source route
++ * (this gets put into the header proper).
++ */
++struct ip_opts {
++ struct in_addr ip_dst; /* first hop, 0 w/o src rt */
++#if defined(__cplusplus)
++ int8_t Ip_opts[40]; /* actually variable in size */
++#else
++ int8_t ip_opts[40]; /* actually variable in size */
++#endif
++};
++
++/*
++ * Options for use with [gs]etsockopt at the IP level.
++ * First word of comment is data type; bool is stored in int.
++ */
++#define IP_OPTIONS 1 /* buf/ip_opts; set/get IP options */
++#define IP_HDRINCL 2 /* int; header is included with data */
++#define IP_TOS 3 /* int; IP type of service and preced. */
++#define IP_TTL 4 /* int; IP time to live */
++#define IP_RECVOPTS 5 /* bool; receive all IP opts w/dgram */
++#define IP_RECVRETOPTS 6 /* bool; receive IP opts for response */
++#define IP_RECVDSTADDR 7 /* bool; receive IP dst addr w/dgram */
++#define IP_RETOPTS 8 /* ip_opts; set/get IP options */
++#define IP_MULTICAST_IF 9 /* in_addr; set/get IP multicast i/f */
++#define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */
++#define IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback */
++#define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */
++#define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */
++#define IP_PORTRANGE 19 /* int; range to use for ephemeral port */
++#define IP_RECVIF 20 /* bool; receive reception if w/dgram */
++#define IP_ERRORMTU 21 /* int; get MTU of last xmit = EMSGSIZE */
++#if 1 /*IPSEC*/
++#define IP_IPSEC_POLICY 22 /* struct; get/set security policy */
++#endif
++
++/*
++ * Defaults and limits for options
++ */
++#define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */
++#define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */
++#define IP_MAX_MEMBERSHIPS 20 /* per socket; must fit in one mbuf */
++
++/*
++ * Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP.
++ */
++struct ip_mreq {
++ struct in_addr imr_multiaddr; /* IP multicast address of group */
++ struct in_addr imr_interface; /* local IP address of interface */
++};
++
++/*
++ * Argument for IP_PORTRANGE:
++ * - which range to search when port is unspecified at bind() or connect()
++ */
++#define IP_PORTRANGE_DEFAULT 0 /* default range */
++#define IP_PORTRANGE_HIGH 1 /* same as DEFAULT (FreeBSD compat) */
++#define IP_PORTRANGE_LOW 2 /* use privileged range */
++
++#define ntohs(x) __builtin_allegrex_wsbh(x)
++#define ntohl(x) __builtin_allegrex_wsbw(x)
++#define htons(x) __builtin_allegrex_wsbh(x)
++#define htonl(x) __builtin_allegrex_wsbw(x)
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* !_NETINET_IN_H_ */
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-netinet-tcp.h b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-netinet-tcp.h
new file mode 100644
index 000000000000..f0b3a623aeea
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-netinet-tcp.h
@@ -0,0 +1,15 @@
+--- newlib/libc/sys/psp/netinet/tcp.h.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/netinet/tcp.h 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,12 @@
++#ifndef __NETINET_TCP_H__
++#define __NETINET_TCP_H__
++
++#include <netinet/in.h>
++
++#define SOL_TCP IPPROTO_TCP
++
++/* Socket options */
++#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */
++#define TCP_MAXSEG 0x02 /* set maximum segment size */
++
++#endif
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-pipe.c b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-pipe.c
new file mode 100644
index 000000000000..ca669e5d6ed4
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-pipe.c
@@ -0,0 +1,308 @@
+--- newlib/libc/sys/psp/pipe.c.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/pipe.c 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,305 @@
++/*
++ * PSP Software Development Kit - http://www.pspdev.org
++ * -----------------------------------------------------------------------
++ * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
++ *
++ * pipe.c - Socket wrappers to provide similar functions to normal unix
++ *
++ * Copyright (c) 2006 Rafael Cabezas <rafpsp@gmail.com>
++ *
++ * - 20070630 Alper Akcan "anhanguera" <distchx@yahoo.com>
++ * [non]blocking read/write() fix
++ * illegal size fix for read/write()
++ *
++ */
++#include <stdio.h>
++#include <errno.h>
++#include <sys/syslimits.h>
++#include <sys/fd_set.h>
++
++#include <psptypes.h>
++#include <pspthreadman.h>
++#include <pspmodulemgr.h>
++#include <pspkerror.h>
++#include "fdman.h"
++
++/* Pipe functions */
++/* Returns how many bytes are in the pipe -- waiting to be read */
++size_t __psp_pipe_peekmsgsize(int fd)
++{
++ SceKernelMppInfo info;
++ info.size = sizeof(info);
++
++ if (!__PSP_IS_FD_OF_TYPE(fd, __PSP_DESCRIPTOR_TYPE_PIPE)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ if (sceKernelReferMsgPipeStatus(__psp_descriptormap[fd]->sce_descriptor, &info) == 0) {
++ return (info.bufSize - info.freeSize);
++ }
++ else {
++ return -1;
++ }
++}
++
++int pipe(int fildes[2])
++{
++ static int iIndex = 0;
++ char name[32];
++ iIndex++;
++
++ sprintf(name, "__psp_pipe_%02d", iIndex);
++
++ SceUID uid = sceKernelCreateMsgPipe(name, PSP_MEMORY_PARTITION_USER, 0, (void *)PIPE_BUF, NULL);
++
++ if (uid >= 0) {
++ fildes[0] = __psp_fdman_get_new_descriptor();
++ if (fildes[0] != -1) {
++ __psp_descriptormap[fildes[0]]->sce_descriptor = uid;
++ __psp_descriptormap[fildes[0]]->type = __PSP_DESCRIPTOR_TYPE_PIPE;
++ }
++ else {
++ sceKernelDeleteMsgPipe(uid);
++ errno = EFAULT;
++ return -1;
++ }
++
++ fildes[1] = __psp_fdman_get_dup_descriptor(fildes[0]);
++ if (fildes[1] != -1) {
++ __psp_descriptormap[fildes[1]]->sce_descriptor = uid;
++ return 0;
++ }
++ else {
++ sceKernelDeleteMsgPipe(uid);
++ errno = EFAULT;
++ return -1;
++ }
++
++ }
++ else {
++ errno = EFAULT;
++ return -1;
++ }
++}
++
++int __psp_pipe_close(int fd)
++{
++ int ret = 0;
++
++ if (!__PSP_IS_FD_OF_TYPE(fd, __PSP_DESCRIPTOR_TYPE_PIPE)) {
++ errno = EBADF;
++ return -1;
++ }
++
++
++ if ( __psp_descriptormap[fd]->ref_count == 1 ) {
++ /**
++ * Delete a message pipe
++ *
++ * @param uid - The UID of the pipe
++ *
++ * @return 0 on success, < 0 on error
++ */
++ ret = sceKernelDeleteMsgPipe(__psp_descriptormap[fd]->sce_descriptor);
++ }
++
++ __psp_fdman_release_descriptor(fd);
++
++ if(ret < 0) {
++ return __psp_set_errno(ret);
++ }
++
++ return 0;
++}
++
++int __psp_pipe_nonblocking_read(int fd, void *buf, size_t len)
++{
++ int ret;
++ int sceuid;
++ int size;
++
++ if (!__PSP_IS_FD_OF_TYPE(fd, __PSP_DESCRIPTOR_TYPE_PIPE)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ sceuid = __psp_descriptormap[fd]->sce_descriptor;
++
++ size = __psp_pipe_peekmsgsize(fd);
++ if (size > 0) {
++ if (size < len) {
++ len = size;
++ }
++ }
++ else if (size == 0) {
++ errno = EAGAIN;
++ return -1;
++ }
++ else {
++ errno = EBADF;
++ return -1;
++ }
++
++ /**
++ * Receive a message from a pipe
++ *
++ * @param uid - The UID of the pipe
++ * @param message - Pointer to the message
++ * @param size - Size of the message
++ * @param unk1 - Unknown
++ * @param unk2 - Unknown
++ * @param timeout - Timeout for receive
++ *
++ * @return 0 on success, < 0 on error
++ */
++ ret = sceKernelTryReceiveMsgPipe(sceuid, buf, len, 0, 0);
++
++ if (ret == 0) {/* Success - Data */
++ return len;
++ }
++ else if (ret == SCE_KERNEL_ERROR_MPP_EMPTY) {/* No data */
++ errno = EAGAIN;
++ return -1;
++ }
++ else {/* Error */
++ return __psp_set_errno(ret);
++ }
++}
++
++int __psp_pipe_read(int fd, void *buf, size_t len)
++{
++ int ret;
++ int sceuid;
++ int size;
++
++ if (!__PSP_IS_FD_OF_TYPE(fd, __PSP_DESCRIPTOR_TYPE_PIPE)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ sceuid = __psp_descriptormap[fd]->sce_descriptor;
++
++#if 0
++ /* we should block until there is some data (or maybe for enough data),
++ * peeking the msg size should be only for nonblocking reads
++ */
++ size = __psp_pipe_peekmsgsize(fd);
++ if (size > 0) {
++ if (size < len) {
++ len = size;
++ }
++ }
++ else {
++ errno = EBADF;
++ return -1;
++ }
++#endif
++ /* if len is greater than PIPE_BUF then, MsgPipe functions returns
++ * SCE_KERNEL_ERROR_ILLEGAL_SIZE, but it should read at least
++ * PIPE_BUF bytes, and return the number of bytes read.
++ */
++ if (len > PIPE_BUF) {
++ len = PIPE_BUF;
++ }
++
++ /**
++ * Receive a message from a pipe
++ *
++ * @param uid - The UID of the pipe
++ * @param message - Pointer to the message
++ * @param size - Size of the message
++ * @param unk1 - Unknown
++ * @param unk2 - Unknown
++ * @param timeout - Timeout for receive
++ *
++ * @return 0 on success, < 0 on error
++ */
++ ret = sceKernelReceiveMsgPipe(sceuid, buf, len, 0, NULL, NULL);
++
++ if (ret == 0) {/* Success - Data */
++ return len;
++ }
++ else {/* Error */
++ return __psp_set_errno(ret);
++ }
++}
++
++int __psp_pipe_write(int fd, const void *buf, size_t len)
++{
++ int ret;
++ int sceuid;
++ char *cbuf;
++
++ if (!__PSP_IS_FD_OF_TYPE(fd, __PSP_DESCRIPTOR_TYPE_PIPE)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ sceuid = __psp_descriptormap[fd]->sce_descriptor;
++
++ /* if len is greater than PIPE_BUF then, MsgPipe functions returns
++ * SCE_KERNEL_ERROR_ILLEGAL_SIZE, but it should write at least
++ * PIPE_BUF bytes, and return the number of bytes written.
++ */
++ if (len > PIPE_BUF) {
++ len = PIPE_BUF;
++ }
++
++ /**
++ * Send a message to a pipe
++ *
++ * @param uid - The UID of the pipe
++ * @param message - Pointer to the message
++ * @param size - Size of the message
++ * @param unk1 - Unknown
++ * @param unk2 - Unknown
++ * @param timeout - Timeout for send
++ *
++ * @return 0 on success, < 0 on error
++ */
++ cbuf = (char *)buf;
++ ret = sceKernelSendMsgPipe(sceuid, cbuf, len, 0, NULL, NULL);
++ if (ret == 0) {/* Success - Data */
++ return len;
++ }
++ else {/* Error */
++ return __psp_set_errno(ret);
++ }
++}
++
++int __psp_pipe_nonblocking_write(int fd, const void *buf, size_t len)
++{
++ int ret;
++ int sceuid;
++ char *cbuf;
++
++ if (!__PSP_IS_FD_OF_TYPE(fd, __PSP_DESCRIPTOR_TYPE_PIPE)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ sceuid = __psp_descriptormap[fd]->sce_descriptor;
++
++ /* if len is greater than PIPE_BUF then, MsgPipe functions returns
++ * SCE_KERNEL_ERROR_ILLEGAL_SIZE, but it should write at least
++ * PIPE_BUF bytes, and return the number of bytes written.
++ */
++ if (len > PIPE_BUF) {
++ len = PIPE_BUF;
++ }
++
++ cbuf = (char *)buf;
++ ret = sceKernelTrySendMsgPipe(sceuid, cbuf, len, 0, 0);
++
++ if (ret == 0) {/* Success - Data */
++ return len;
++ }
++ else if (ret == SCE_KERNEL_ERROR_MPP_FULL) {
++ errno = EAGAIN;
++ return -1;
++ }
++ else {/* Error */
++ return __psp_set_errno(ret);
++ }
++}
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-pspcwd.c b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-pspcwd.c
new file mode 100644
index 000000000000..38bea4ec1752
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-pspcwd.c
@@ -0,0 +1,169 @@
+--- newlib/libc/sys/psp/pspcwd.c.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/pspcwd.c 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,166 @@
++/*
++ * PSP Software Development Kit - http://www.pspdev.org
++ * -----------------------------------------------------------------------
++ * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
++ *
++ * pspcwd.c - Current working directory emulation helper functions
++ *
++ * Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
++ * Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
++ * Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
++ * Copyright (c) 2005 Jim Paris <jim@jtan.com>
++ *
++ */
++#include <string.h>
++#include <sys/types.h>
++#include <sys/unistd.h>
++
++#include <psptypes.h>
++#include <pspiofilemgr.h>
++
++char __psp_cwd[MAXPATHLEN + 1] = { 0 };
++
++/* Set the current working directory (CWD) to the path where the module was launched. */
++void __psp_init_cwd(char *argv_0)
++{
++ if (argv_0 != NULL) {
++ char base_path[MAXPATHLEN + 1];
++ char *end;
++
++ strncpy(base_path, argv_0, sizeof(base_path) - 1);
++ base_path[sizeof(base_path) - 1] = '\0';
++ end = strrchr(base_path, '/');
++ if (end != NULL) {
++ *(end + 1) = '\0';
++ chdir(base_path);
++ }
++ }
++}
++
++/* Return the number of bytes taken up by the "drive:" prefix,
++ or -1 if it's not found */
++int __psp_get_drive(const char *d)
++{
++ int i;
++ for(i=0; d[i]; i++) {
++ if(! ((d[i] >= 'a' && d[i] <= 'z') ||
++ (d[i] >= '0' && d[i] <= '9') ))
++ break;
++ }
++ if(d[i] == ':') return i+1;
++ return -1;
++}
++
++/* Like strcpy, but returns 0 if the string doesn't fit */
++int __psp_safe_strcpy(char *out, const char *in, int maxlen)
++{
++ for( ; maxlen > 0 && *in ; maxlen-- )
++ *(out++) = *(in++);
++ if(maxlen < 1) return 0;
++ *out = 0;
++ return 1;
++}
++
++/* Like strcat, but returns 0 if the string doesn't fit */
++int __psp_safe_strcat(char *out, const char *in, int maxlen)
++{
++ for( ; *out ; out++,maxlen-- )
++ continue;
++ return __psp_safe_strcpy(out, in, maxlen);
++}
++
++/* Normalize a pathname (without leading "drive:") by removing
++ . and .. components, duplicated /, etc. */
++int __psp_path_normalize(char *out, int len)
++{
++ int i, j;
++ int first, next;
++
++ /* First append "/" to make the rest easier */
++ if(!__psp_safe_strcat(out,"/",len)) return -10;
++
++ /* Convert "//" to "/" */
++ for(i=0; out[i+1]; i++) {
++ if(out[i]=='/' && out[i+1]=='/') {
++ for(j=i+1; out[j]; j++)
++ out[j] = out[j+1];
++ i--;
++ }
++ }
++
++ /* Convert "/./" to "/" */
++ for(i=0; out[i] && out[i+1] && out[i+2]; i++) {
++ if(out[i]=='/' && out[i+1]=='.' && out[i+2]=='/') {
++ for(j=i+1; out[j]; j++)
++ out[j] = out[j+2];
++ i--;
++ }
++ }
++
++ /* Convert "/asdf/../" to "/" until we can't anymore. Also
++ * convert leading "/../" to "/" */
++ first = next = 0;
++ while(1) {
++ /* If a "../" follows, remove it and the parent */
++ if(out[next+1] && out[next+1]=='.' &&
++ out[next+2] && out[next+2]=='.' &&
++ out[next+3] && out[next+3]=='/') {
++ for(j=0; out[first+j+1]; j++)
++ out[first+j+1] = out[next+j+4];
++ first = next = 0;
++ continue;
++ }
++
++ /* Find next slash */
++ first = next;
++ for(next=first+1; out[next] && out[next] != '/'; next++)
++ continue;
++ if(!out[next]) break;
++ }
++
++ /* Remove trailing "/" */
++ for(i=1; out[i]; i++)
++ continue;
++ if(i >= 1 && out[i-1] == '/')
++ out[i-1] = 0;
++
++ return 0;
++}
++
++/* Convert relative path to absolute path. */
++int __psp_path_absolute(const char *in, char *out, int len)
++{
++ int dr;
++
++ /* See what the relative URL starts with */
++ dr = __psp_get_drive(in);
++ if(dr > 0 && in[dr] == '/') {
++ /* It starts with "drive:/", so it's already absolute */
++ if(!__psp_safe_strcpy(out, in, len))
++ return -1;
++ } else if(in[0] == '/') {
++ /* It's absolute, but missing the drive, so use cwd's drive */
++ if(strlen(__psp_cwd) >= len)
++ return -2;
++ strcpy(out, __psp_cwd);
++ dr = __psp_get_drive(out);
++ out[dr] = 0;
++ if(!__psp_safe_strcat(out, in, len))
++ return -3;
++ } else {
++ /* It's not absolute, so append it to the current cwd */
++ if(strlen(__psp_cwd) >= len)
++ return -4;
++ strcpy(out, __psp_cwd);
++ if(!__psp_safe_strcat(out, "/", len))
++ return -6;
++ if(!__psp_safe_strcat(out, in, len))
++ return -7;
++ }
++
++ /* Now normalize the pathname portion */
++ dr = __psp_get_drive(out);
++ if(dr < 0) dr = 0;
++ return __psp_path_normalize(out + dr, len - dr);
++}
++
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-select.c b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-select.c
new file mode 100644
index 000000000000..0f457b01ae57
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-select.c
@@ -0,0 +1,202 @@
+--- newlib/libc/sys/psp/select.c.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/select.c 2007-06-01 17:45:11.000000000 +0300
+@@ -0,0 +1,199 @@
++/*
++ * PSP Software Development Kit - http://www.pspdev.org
++ * -----------------------------------------------------------------------
++ * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
++ *
++ * select.c - Socket wrappers to provide similar functions to normal unix
++ *
++ * Copyright (c) 2006 Rafael Cabezas <rafpsp@gmail.com>
++ *
++ * - 20070701 Alper Akcan "anhanguera" <distchx@yahoo.com>
++ * select EBADF fix
++ *
++ */
++#include <fcntl.h>
++#include <errno.h>
++#include <sys/select.h>
++#include <psptypes.h>
++#include <pspthreadman.h>
++
++#include "fdman.h"
++
++#define SELECT_POLLING_DELAY_IN_us 100
++
++static int __psp_poll_select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds);
++
++int select(int n, fd_set *readfds, fd_set *writefds,
++ fd_set *exceptfds, struct timeval *timeout)
++{
++ int count;
++ clock_t start_time, time;
++
++ start_time = clock();
++
++ count = 0;
++
++ if (timeout) {
++ time = (timeout->tv_sec * CLOCKS_PER_SEC) + (timeout->tv_usec * (1*1000*1000/CLOCKS_PER_SEC));
++ }
++ else {
++ time = 0;
++ }
++
++ for (;;) {
++ count = __psp_poll_select(n, readfds, writefds, exceptfds);
++ /* If timeout == NULL, then don't timeout! */
++ if ( (count > 0) || ((timeout != NULL) && ((clock() - start_time) >= time)) ) {
++ break;
++ }
++ if (count < 0) {
++ /* anhanguera - 20070701
++ * error, lets let the caller to handle error state
++ */
++ break;
++ }
++ else {
++ /* Nothing found, and not timed-out yet; let's yield for SELECT_POLLING_DELAY_IN_us, so we're not in a busy loop */
++ sceKernelDelayThread(SELECT_POLLING_DELAY_IN_us);
++ }
++ }
++
++ return count;
++}
++
++#define SCE_FD_SET(n, p) \
++ ((p)->fds_bits[((n) & 0xFF) /__NFDBITS] |= (1 << ((n) % __NFDBITS)))
++
++static int __psp_poll_select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds)
++{
++ int fd, count;
++ fd_set ready_readfds, ready_writefds, ready_exceptfds;
++ fd_set scereadfds, scewritefds, sceexceptfds;
++ SceKernelMppInfo info;
++ struct timeval scetv;
++
++ FD_ZERO(&ready_readfds);
++ FD_ZERO(&ready_writefds);
++ FD_ZERO(&ready_exceptfds);
++
++ info.size = sizeof(info);
++ scetv.tv_sec = 0;
++ scetv.tv_usec = 0;
++ count = 0;
++
++ for (fd = 0; fd < n; fd++)
++ {
++ if (__psp_descriptormap[fd] != NULL) {
++ switch(__psp_descriptormap[fd]->type)
++ {
++ case __PSP_DESCRIPTOR_TYPE_PIPE:
++ if (readfds && FD_ISSET(fd, readfds)) {
++ if (sceKernelReferMsgPipeStatus(__psp_descriptormap[fd]->sce_descriptor, &info) == 0) {
++ if (info.bufSize != info.freeSize) {
++ FD_SET(fd, &ready_readfds);
++ count++;
++ }
++ }
++ else {
++ FD_SET(fd, &ready_exceptfds);
++ count++;
++ }
++ }
++ if (writefds && FD_ISSET(fd, writefds)) {
++ if (sceKernelReferMsgPipeStatus(__psp_descriptormap[fd]->sce_descriptor, &info) == 0) {
++ if (info.freeSize > 0) {
++ FD_SET(fd, &ready_writefds);
++ count++;
++ }
++ }
++ else {
++ FD_SET(fd, &ready_exceptfds);
++ count++;
++ }
++ }
++ break;
++ case __PSP_DESCRIPTOR_TYPE_FILE:
++ if (readfds && FD_ISSET(fd, readfds)) {
++ if (readfds && FD_ISSET(fd, readfds)) {
++ /** Just set it for now */
++ FD_SET(fd, &ready_readfds);
++ count++;
++ }
++ }
++ break;
++ case __PSP_DESCRIPTOR_TYPE_SOCKET:
++ if (readfds && FD_ISSET(fd, readfds)) {
++ int sce_ret, sce_fd;
++ sce_fd = __psp_descriptormap[fd]->sce_descriptor;
++ FD_ZERO(&scereadfds);
++ SCE_FD_SET(sce_fd, &scereadfds);
++ errno = 0;
++ sce_ret = sceNetInetSelect (sce_fd+1, &scereadfds, NULL, NULL, &scetv);
++ if (sce_ret>0) {
++ FD_SET(fd, &ready_readfds);
++ count++;
++ }
++ else if (sce_ret == -1) {
++ errno = sceNetInetGetErrno();
++ if (exceptfds && FD_ISSET(fd, exceptfds)) {
++ FD_SET(fd, &ready_exceptfds);
++ count++;
++ } else {
++ count = -1;
++ }
++ }
++ }
++ if (writefds && FD_ISSET(fd, writefds)) {
++ int sce_ret;
++ FD_ZERO(&scewritefds);
++ SCE_FD_SET(__psp_descriptormap[fd]->sce_descriptor, &scewritefds);
++ sce_ret = sceNetInetSelect (__psp_descriptormap[fd]->sce_descriptor+1, NULL, &scewritefds, NULL, &scetv);
++ if (sce_ret>0) {
++ FD_SET(fd, &ready_writefds);
++ count++;
++ }
++ else if (sce_ret == -1) {
++ if (exceptfds && FD_ISSET(fd, exceptfds)) {
++ FD_SET(fd, &ready_exceptfds);
++ count++;
++ }
++ else {
++ count = -1;
++ }
++ }
++ }
++ break;
++ }
++ } else {
++ /* anhanguera - 20070701
++ *
++ * here we know that, system has no idea about 'fd'. if caller requested
++ * information about 'fd', return '-1' and set errno to 'EBADF'. we should
++ * increse the count and set exceptfd for fd, but it is safe to obey select
++ * manual.
++ *
++ * from manual;
++ * On error, -1 is returned, and errno is set appropriately; the sets and
++ * timeout become undefined, so do not rely on their contents after an error.
++ */
++ if ((readfds && FD_ISSET(fd, readfds)) ||
++ (writefds && FD_ISSET(fd, writefds)) ||
++ (exceptfds && FD_ISSET(fd, exceptfds))) {
++ errno = EBADF;
++ return -1;
++ }
++ }
++ }
++
++ if (count > 0) {
++ if (readfds)
++ *readfds = ready_readfds;
++ if (writefds)
++ *writefds = ready_writefds;
++ if (exceptfds)
++ *exceptfds = ready_exceptfds;
++ }
++
++ return count;
++}
++
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-socket.c b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-socket.c
new file mode 100644
index 000000000000..150a4d6336b9
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-socket.c
@@ -0,0 +1,393 @@
+--- newlib/libc/sys/psp/socket.c.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/socket.c 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,390 @@
++/*
++ * PSP Software Development Kit - http://www.pspdev.org
++ * -----------------------------------------------------------------------
++ * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
++ *
++ * socket.c - Socket wrappers to provide similar functions to normal unix
++ *
++ * Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
++ * Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
++ *
++ */
++#include <fcntl.h>
++#include <errno.h>
++#include <sys/socket.h>
++#include <sys/select.h>
++#include <netinet/in.h>
++#include <arpa/inet.h>
++
++#include <psptypes.h>
++#include "fdman.h"
++
++#ifdef F_socket
++int socket(int domain, int type, int protocol)
++{
++ int sock, scesock;
++ int i;
++
++ scesock = sceNetInetSocket(domain, type, protocol);
++ if(scesock < 0) {
++ errno = sceNetInetGetErrno();
++ return -1;
++ }
++
++ sock = __psp_fdman_get_new_descriptor();
++ if( sock != -1 ) {
++ __psp_descriptormap[sock]->sce_descriptor = scesock;
++ __psp_descriptormap[sock]->type = __PSP_DESCRIPTOR_TYPE_SOCKET;
++ }
++ else {
++ sceNetInetClose(scesock);
++ errno = ENOENT;
++ return -1;
++ }
++
++ return sock;
++}
++
++/* These are glue routines that are called from _close(), _read(), and
++ _write(). They are here so that any program that uses socket() will pull
++ them in and have expanded socket capability. */
++
++int __psp_socket_close(int sock)
++{
++ int ret = 0;
++
++ if (__psp_descriptormap[sock]->ref_count == 1) {
++ ret = sceNetInetClose(__psp_descriptormap[sock]->sce_descriptor);
++ }
++
++ __psp_fdman_release_descriptor(sock);
++
++ if(ret < 0)
++ {
++ /* If close is defined likely errno is */
++ errno = sceNetInetGetErrno();
++ return -1;
++ }
++
++ return 0;
++}
++
++ssize_t __psp_socket_recv(int s, void *buf, size_t len, int flags)
++{
++ return recv(s, buf, len, flags);
++}
++
++ssize_t __psp_socket_send(int s, const void *buf, size_t len, int flags)
++{
++ return send(s, buf, len, flags);
++}
++#endif
++
++#ifdef F_accept
++int accept(int s, struct sockaddr *addr, socklen_t *addrlen)
++{
++ int newscesock, newsock;
++
++ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ newscesock = sceNetInetAccept(__psp_descriptormap[s]->sce_descriptor, addr, addrlen);
++ if( (newscesock >= 0) ) {
++ newsock = __psp_fdman_get_new_descriptor();
++ if ( newsock != -1 ) {
++ __psp_descriptormap[newsock]->sce_descriptor = newscesock;
++ __psp_descriptormap[newsock]->type = __PSP_DESCRIPTOR_TYPE_SOCKET;
++ }
++ else {
++ sceNetInetClose(newscesock);
++ errno = ENOENT;
++ return -1;
++ }
++ }
++ else {
++ errno = ENOENT;
++ return -1;
++ }
++
++ return newsock;
++}
++#endif
++
++#ifdef F_bind
++int bind(int s, const struct sockaddr *my_addr, socklen_t addrlen)
++{
++ int ret;
++
++ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ ret = sceNetInetBind(__psp_descriptormap[s]->sce_descriptor, my_addr, addrlen);
++ if(ret < 0)
++ {
++ errno = sceNetInetGetErrno();
++ return -1;
++ }
++
++ return 0;
++}
++#endif
++
++#ifdef F_connect
++int connect(int s, const struct sockaddr *serv_addr, socklen_t addrlen)
++{
++ int ret;
++
++ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ ret = sceNetInetConnect(__psp_descriptormap[s]->sce_descriptor, serv_addr, addrlen);
++ if(ret < 0)
++ {
++ errno = sceNetInetGetErrno();
++ return -1;
++ }
++
++ return 0;
++}
++#endif
++
++#ifdef F_setsockopt
++int getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen)
++{
++ int ret;
++
++ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ ret = sceNetInetGetsockopt(__psp_descriptormap[s]->sce_descriptor, level, optname, optval, optlen);
++ if(ret < 0)
++ {
++ errno = sceNetInetGetErrno();
++ return -1;
++ }
++
++ return 0;
++}
++#endif
++
++#ifdef F_listen
++int listen(int s, int backlog)
++{
++ int ret;
++
++ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ ret = sceNetInetListen(__psp_descriptormap[s]->sce_descriptor, backlog);
++ if(ret < 0)
++ {
++ errno = sceNetInetGetErrno();
++ return -1;
++ }
++
++ return 0;
++}
++#endif
++
++#ifdef F_recv
++ssize_t recv(int s, void *buf, size_t len, int flags)
++{
++ int ret;
++
++ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ ret = sceNetInetRecv(__psp_descriptormap[s]->sce_descriptor, buf, len, flags);
++ if(ret < 0)
++ {
++ errno = sceNetInetGetErrno();
++ return -1;
++ }
++
++ return ret;
++}
++#endif
++
++#ifdef F_recvfrom
++ssize_t recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen)
++{
++ int ret;
++
++ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ ret = sceNetInetRecvfrom(__psp_descriptormap[s]->sce_descriptor, buf, len, flags, from, fromlen);
++ if(ret < 0)
++ {
++ errno = sceNetInetGetErrno();
++ return -1;
++ }
++
++ return ret;
++}
++#endif
++
++#ifdef F_send
++ssize_t send(int s, const void *buf, size_t len, int flags)
++{
++ int ret;
++
++ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ ret = sceNetInetSend(__psp_descriptormap[s]->sce_descriptor, buf, len, flags);
++ if(ret < 0)
++ {
++ errno = sceNetInetGetErrno();
++ return -1;
++ }
++
++ return ret;
++}
++#endif
++
++#ifdef F_sendto
++ssize_t sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen)
++{
++ int ret;
++
++ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ ret = sceNetInetSendto(__psp_descriptormap[s]->sce_descriptor, buf, len, flags, to, tolen);
++ if(ret < 0)
++ {
++ errno = sceNetInetGetErrno();
++ return -1;
++ }
++
++ return ret;
++}
++#endif
++
++#ifdef F_setsockopt
++int setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen)
++{
++ int ret;
++
++ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ ret = sceNetInetSetsockopt(__psp_descriptormap[s]->sce_descriptor, level, optname, optval, optlen);
++ if(ret < 0)
++ {
++ errno = sceNetInetGetErrno();
++ return -1;
++ }
++ else
++ {
++ if ( (level == SOL_SOCKET) && (optname == SO_NONBLOCK) ) {
++ if (*((int*)optval) == 1) {
++ __psp_descriptormap[s]->flags |= O_NONBLOCK;
++ }
++ else {
++ __psp_descriptormap[s]->flags &= ~O_NONBLOCK;
++ }
++ }
++ }
++
++ return 0;
++}
++#endif
++
++#ifdef F_shutdown
++int shutdown(int s, int how)
++{
++ int ret;
++
++ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ ret = sceNetInetShutdown(__psp_descriptormap[s]->sce_descriptor, how);
++ if(ret < 0)
++ {
++ errno = sceNetInetGetErrno();
++ return -1;
++ }
++
++ return 0;
++}
++#endif
++
++#ifdef F_getpeername
++int getpeername(int s, struct sockaddr *name, socklen_t *namelen)
++{
++ int ret;
++
++ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ ret = sceNetInetGetpeername(__psp_descriptormap[s]->sce_descriptor, name, namelen);
++ if(ret < 0)
++ {
++ errno = sceNetInetGetErrno();
++ return -1;
++ }
++
++ return 0;
++}
++#endif
++
++#ifdef F_getsockname
++int getsockname(int s, struct sockaddr *name, socklen_t *namelen)
++{
++ int ret;
++
++ if (!__PSP_IS_FD_OF_TYPE(s, __PSP_DESCRIPTOR_TYPE_SOCKET)) {
++ errno = EBADF;
++ return -1;
++ }
++
++ ret = sceNetInetGetsockname(__psp_descriptormap[s]->sce_descriptor, name, namelen);
++ if(ret < 0)
++ {
++ errno = sceNetInetGetErrno();
++ return -1;
++ }
++
++ return 0;
++}
++#endif
++
++#ifdef F_inet_ntoa
++char *inet_ntoa(struct in_addr in)
++{
++ static char ip_addr[INET_ADDRSTRLEN+1];
++
++ if(sceNetInetInetNtop(AF_INET, &in, ip_addr, INET_ADDRSTRLEN) == NULL)
++ {
++ strcpy(ip_addr, "Invalid");
++ }
++
++ return ip_addr;
++}
++#endif
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-sys-dirent.h b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-sys-dirent.h
new file mode 100644
index 000000000000..f9b494baab42
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-sys-dirent.h
@@ -0,0 +1,42 @@
+--- newlib/libc/sys/psp/sys/dirent.h.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/sys/dirent.h 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,39 @@
++#ifndef _SYS_DIRENT_H
++#define _SYS_DIRENT_H
++
++/* PSP dirent.h, based on pspiofilemgr_dirent.h
++ by Jim Paris <jim@jtan.com> */
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#include <pspiofilemgr_dirent.h>
++
++#define MAXNAMLEN 255
++
++/* Same as SceIoDirent, just with a different name. */
++struct dirent {
++ /** File status. */
++ SceIoStat d_stat;
++ /** File name. */
++ char d_name[256];
++ /** Device-specific data. */
++ void * d_private;
++ int dummy;
++};
++
++typedef struct {
++ SceUID uid;
++ struct dirent de;
++} DIR;
++
++DIR *opendir (const char *);
++struct dirent *readdir (DIR *);
++int closedir (DIR *);
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-sys-errno.h b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-sys-errno.h
new file mode 100644
index 000000000000..a66593da2219
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-sys-errno.h
@@ -0,0 +1,161 @@
+--- newlib/libc/sys/psp/sys/errno.h.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/sys/errno.h 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,158 @@
++/* errno.h for PSP, based on newlib/libc/include/sys/errno.h. */
++
++#ifndef _SYS_ERRNO_H_
++#ifdef __cplusplus
++extern "C" {
++#endif
++#define _SYS_ERRNO_H_
++
++#include <sys/reent.h>
++
++#ifndef _REENT_ONLY
++#define errno (*__errno())
++extern int *__errno _PARAMS ((void));
++#endif
++
++/* Please don't use these variables directly.
++ Use strerror instead. */
++extern __IMPORT _CONST char * _CONST _sys_errlist[];
++extern __IMPORT int _sys_nerr;
++#ifdef __CYGWIN__
++extern __IMPORT const char * const sys_errlist[];
++extern __IMPORT int sys_nerr;
++#endif
++
++#define __errno_r(ptr) ((ptr)->_errno)
++
++#define EPERM 1 /* Not super-user */
++#define ENOENT 2 /* No such file or directory */
++#define ESRCH 3 /* No such process */
++#define EINTR 4 /* Interrupted system call */
++#define EIO 5 /* I/O error */
++#define ENXIO 6 /* No such device or address */
++#define E2BIG 7 /* Arg list too long */
++#define ENOEXEC 8 /* Exec format error */
++#define EBADF 9 /* Bad file number */
++#define ECHILD 10 /* No children */
++#define EAGAIN 11 /* No more processes */
++#define ENOMEM 12 /* Not enough core */
++#define EACCES 13 /* Permission denied */
++#define EFAULT 14 /* Bad address */
++#define ENOTBLK 15 /* Block device required */
++#define EBUSY 16 /* Mount device busy */
++#define EEXIST 17 /* File exists */
++#define EXDEV 18 /* Cross-device link */
++#define ENODEV 19 /* No such device */
++#define ENOTDIR 20 /* Not a directory */
++#define EISDIR 21 /* Is a directory */
++#define EINVAL 22 /* Invalid argument */
++#define ENFILE 23 /* Too many open files in system */
++#define EMFILE 24 /* Too many open files */
++#define ENOTTY 25 /* Not a typewriter */
++#define ETXTBSY 26 /* Text file busy */
++#define EFBIG 27 /* File too large */
++#define ENOSPC 28 /* No space left on device */
++#define ESPIPE 29 /* Illegal seek */
++#define EROFS 30 /* Read only file system */
++#define EMLINK 31 /* Too many links */
++#define EPIPE 32 /* Broken pipe */
++#define EDOM 33 /* Math arg out of domain of func */
++#define ERANGE 34 /* Math result not representable */
++#define ENOMSG 35 /* No message of desired type */
++#define EIDRM 36 /* Identifier removed */
++#define ECHRNG 37 /* Channel number out of range */
++#define EL2NSYNC 38 /* Level 2 not synchronized */
++#define EL3HLT 39 /* Level 3 halted */
++#define EL3RST 40 /* Level 3 reset */
++#define ELNRNG 41 /* Link number out of range */
++#define EUNATCH 42 /* Protocol driver not attached */
++#define ENOCSI 43 /* No CSI structure available */
++#define EL2HLT 44 /* Level 2 halted */
++#define EDEADLK 45 /* Deadlock condition */
++#define ENOLCK 46 /* No record locks available */
++#define EBADE 50 /* Invalid exchange */
++#define EBADR 51 /* Invalid request descriptor */
++#define EXFULL 52 /* Exchange full */
++#define ENOANO 53 /* No anode */
++#define EBADRQC 54 /* Invalid request code */
++#define EBADSLT 55 /* Invalid slot */
++#define EDEADLOCK 56 /* File locking deadlock error */
++#define EBFONT 57 /* Bad font file fmt */
++#define ENOSTR 60 /* Device not a stream */
++#define ENODATA 61 /* No data (for no delay io) */
++#define ETIME 62 /* Timer expired */
++#define ENOSR 63 /* Out of streams resources */
++#define ENONET 64 /* Machine is not on the network */
++#define ENOPKG 65 /* Package not installed */
++#define EREMOTE 66 /* The object is remote */
++#define ENOLINK 67 /* The link has been severed */
++#define EADV 68 /* Advertise error */
++#define ESRMNT 69 /* Srmount error */
++#define ECOMM 70 /* Communication error on send */
++#define EPROTO 71 /* Protocol error */
++#define EMULTIHOP 74 /* Multihop attempted */
++#define ELBIN 75 /* Inode is remote (not really error) */
++#define EDOTDOT 76 /* Cross mount point (not really error) */
++#define EBADMSG 77 /* Trying to read unreadable message */
++#define EFTYPE 79 /* Inappropriate file type or format */
++#define ENOTUNIQ 80 /* Given log. name not unique */
++#define EBADFD 81 /* f.d. invalid for this operation */
++#define EREMCHG 82 /* Remote address changed */
++#define ELIBACC 83 /* Can't access a needed shared lib */
++#define ELIBBAD 84 /* Accessing a corrupted shared lib */
++#define ELIBSCN 85 /* .lib section in a.out corrupted */
++#define ELIBMAX 86 /* Attempting to link in too many libs */
++#define ELIBEXEC 87 /* Attempting to exec a shared library */
++#define ENOSYS 88 /* Function not implemented */
++#define ENMFILE 89 /* No more files */
++#define ENOTEMPTY 90 /* Directory not empty */
++#define ENAMETOOLONG 91 /* File or path name too long */
++#define ELOOP 92 /* Too many symbolic links */
++#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
++#define EPFNOSUPPORT 96 /* Protocol family not supported */
++#define ECONNRESET 104 /* Connection reset by peer */
++#define ENOBUFS 105 /* No buffer space available */
++#define EAFNOSUPPORT 106 /* Address family not supported by protocol family */
++#define EPROTOTYPE 107 /* Protocol wrong type for socket */
++#define ENOTSOCK 108 /* Socket operation on non-socket */
++#define ENOPROTOOPT 109 /* Protocol not available */
++#define ESHUTDOWN 110 /* Can't send after socket shutdown */
++#define ECONNREFUSED 111 /* Connection refused */
++#define EADDRINUSE 112 /* Address already in use */
++#define ECONNABORTED 113 /* Connection aborted */
++#define ENETUNREACH 114 /* Network is unreachable */
++#define ENETDOWN 115 /* Network interface is not configured */
++#define ETIMEDOUT 116 /* Connection timed out */
++#define EHOSTDOWN 117 /* Host is down */
++#define EHOSTUNREACH 118 /* Host is unreachable */
++#define EINPROGRESS 119 /* Connection already in progress */
++#define EALREADY 120 /* Socket already connected */
++#define EDESTADDRREQ 121 /* Destination address required */
++#define EMSGSIZE 122 /* Message too long */
++#define EPROTONOSUPPORT 123 /* Unknown protocol */
++#define ESOCKTNOSUPPORT 124 /* Socket type not supported */
++#define EADDRNOTAVAIL 125 /* Address not available */
++#define ENETRESET 126
++#define EISCONN 127 /* Socket is already connected */
++#define ENOTCONN 128 /* Socket is not connected */
++#define ETOOMANYREFS 129
++#define EPROCLIM 130
++#define EUSERS 131
++#define EDQUOT 132
++#define ESTALE 133
++#define ENOTSUP 134 /* Not supported */
++#define ENOMEDIUM 135 /* No medium (in tape drive) */
++#define ENOSHARE 136 /* No such host or network path */
++#define ECASECLASH 137 /* Filename exists with different case */
++#define EILSEQ 138
++#define EOVERFLOW 139 /* Value too large for defined data type */
++
++/* From cygwin32. */
++#define EWOULDBLOCK EAGAIN /* Operation would block */
++
++#define __ELASTERROR 2000 /* Users can add values starting here */
++
++#ifdef __cplusplus
++}
++#endif
++#endif /* _SYS_ERRNO_H */
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-sys-fd_set.h b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-sys-fd_set.h
new file mode 100644
index 000000000000..900b023de89f
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-sys-fd_set.h
@@ -0,0 +1,72 @@
+--- newlib/libc/sys/psp/sys/fd_set.h.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/sys/fd_set.h 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,69 @@
++/* $NetBSD: fd_set.h,v 1.1 2005/05/22 12:44:24 kleink Exp $ */
++
++/*-
++ * Copyright (c) 1992, 1993
++ * The Regents of the University of California. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the University nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ *
++ * from: @(#)types.h 8.4 (Berkeley) 1/21/94
++ */
++
++#ifndef _SYS_FD_SET_H_
++#define _SYS_FD_SET_H_
++
++#include <sys/socket.h>
++#include <stdint.h>
++
++/*
++ * Implementation dependent defines, hidden from user space. X/Open does not
++ * specify them.
++ */
++#define __NBBY 8 /* number of bits in a byte */
++typedef uint32_t __fd_mask;
++
++/* bits per mask */
++#define __NFDBITS ((unsigned int)sizeof(__fd_mask) * __NBBY)
++
++#define __howmany(x, y) (((x) + ((y) - 1)) / (y))
++
++#define FD_SETSIZE 256
++
++typedef struct fd_set {
++ __fd_mask fds_bits[__howmany(FD_SETSIZE, __NFDBITS)];
++} fd_set;
++
++#define FD_SET(n, p) \
++ ((p)->fds_bits[(n) /__NFDBITS] |= (1 << ((n) % __NFDBITS)))
++
++#define FD_CLR(n, p) \
++ ((p)->fds_bits[(n) /__NFDBITS] &= ~(1 << ((n) % __NFDBITS)))
++
++#define FD_ISSET(n, p) \
++ ((p)->fds_bits[(n) /__NFDBITS] & (1 << ((n) % __NFDBITS)))
++
++#define FD_ZERO(p) (void)__builtin_memset((p), 0, sizeof(*(p)))
++
++#endif /* _SYS_FD_SET_H_ */
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-sys-ioctl.h b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-sys-ioctl.h
new file mode 100644
index 000000000000..9457e54fb38e
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-sys-ioctl.h
@@ -0,0 +1,4 @@
+--- newlib/libc/sys/psp/sys/ioctl.h.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/sys/ioctl.h 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1 @@
++/* Empty file, here for compatibility */
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-sys-select.h b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-sys-select.h
new file mode 100644
index 000000000000..749856d449ff
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-sys-select.h
@@ -0,0 +1,57 @@
+--- newlib/libc/sys/psp/sys/select.h.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/sys/select.h 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,54 @@
++/* $NetBSD: select.h,v 1.24 2005/05/22 12:44:24 kleink Exp $ */
++
++/*-
++ * Copyright (c) 1992, 1993
++ * The Regents of the University of California. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the University nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ *
++ * @(#)select.h 8.2 (Berkeley) 1/4/94
++ */
++
++#ifndef _SYS_SELECT_H_
++#define _SYS_SELECT_H_
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#include <sys/fd_set.h>
++#include <sys/time.h>
++
++int sceNetInetSelect(int n, fd_set *readfds, fd_set *writefds,
++ fd_set *exceptfds, struct timeval *timeout);
++
++int select(int n, fd_set *readfds, fd_set *writefds,
++ fd_set *exceptfds, struct timeval *timeout);
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* !_SYS_SELECT_H_ */
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-sys-socket.h b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-sys-socket.h
new file mode 100644
index 000000000000..74636baab8aa
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-sys-socket.h
@@ -0,0 +1,297 @@
+--- newlib/libc/sys/psp/sys/socket.h.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/sys/socket.h 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,294 @@
++/* $NetBSD: socket.h,v 1.77 2005/11/29 03:12:16 christos Exp $ */
++
++/*
++ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the project nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++
++/*
++ * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994
++ * The Regents of the University of California. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the University nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ *
++ * @(#)socket.h 8.6 (Berkeley) 5/3/95
++ */
++
++#ifndef _SYS_SOCKET_H_
++#define _SYS_SOCKET_H_
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#include <stdint.h>
++#include <stddef.h>
++#include <sys/types.h>
++
++typedef uint8_t sa_family_t;
++typedef uint32_t socklen_t;
++
++/*
++ * Socket types.
++ */
++#define SOCK_STREAM 1 /* stream socket */
++#define SOCK_DGRAM 2 /* datagram socket */
++#define SOCK_RAW 3 /* raw-protocol interface */
++#define SOCK_RDM 4 /* reliably-delivered message */
++#define SOCK_SEQPACKET 5 /* sequenced packet stream */
++
++/*
++ * Option flags per-socket.
++ */
++#define SO_DEBUG 0x0001 /* turn on debugging info recording */
++#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
++#define SO_REUSEADDR 0x0004 /* allow local address reuse */
++#define SO_KEEPALIVE 0x0008 /* keep connections alive */
++#define SO_DONTROUTE 0x0010 /* just use interface addresses */
++#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
++#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */
++#define SO_LINGER 0x0080 /* linger on close if data present */
++#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */
++#define SO_REUSEPORT 0x0200 /* allow local address & port reuse */
++#define SO_TIMESTAMP 0x0400 /* timestamp received dgram traffic */
++
++/*
++ * Additional options, not kept in so_options.
++ */
++#define SO_SNDBUF 0x1001 /* send buffer size */
++#define SO_RCVBUF 0x1002 /* receive buffer size */
++#define SO_SNDLOWAT 0x1003 /* send low-water mark */
++#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
++#define SO_SNDTIMEO 0x1005 /* send timeout */
++#define SO_RCVTIMEO 0x1006 /* receive timeout */
++#define SO_ERROR 0x1007 /* get error status and clear */
++#define SO_TYPE 0x1008 /* get socket type */
++#define SO_OVERFLOWED 0x1009 /* datagrams: return packets dropped */
++#define SO_NONBLOCK 0x1009 /* non-blocking I/O */
++
++/*
++ * Structure used for manipulating linger option.
++ */
++struct linger {
++ int l_onoff; /* option on/off */
++ int l_linger; /* linger time in seconds */
++};
++
++/*
++ * Level number for (get/set)sockopt() to apply to socket itself.
++ */
++#define SOL_SOCKET 0xffff /* options for socket level */
++
++/*
++ * Address families.
++ */
++#define AF_UNSPEC 0 /* unspecified */
++#define AF_LOCAL 1 /* local to host (pipes, portals) */
++#define AF_UNIX AF_LOCAL /* backward compatibility */
++#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
++#define AF_IMPLINK 3 /* arpanet imp addresses */
++#define AF_PUP 4 /* pup protocols: e.g. BSP */
++#define AF_CHAOS 5 /* mit CHAOS protocols */
++#define AF_NS 6 /* XEROX NS protocols */
++#define AF_ISO 7 /* ISO protocols */
++#define AF_OSI AF_ISO
++#define AF_ECMA 8 /* european computer manufacturers */
++#define AF_DATAKIT 9 /* datakit protocols */
++#define AF_CCITT 10 /* CCITT protocols, X.25 etc */
++#define AF_SNA 11 /* IBM SNA */
++#define AF_DECnet 12 /* DECnet */
++#define AF_DLI 13 /* DEC Direct data link interface */
++#define AF_LAT 14 /* LAT */
++#define AF_HYLINK 15 /* NSC Hyperchannel */
++#define AF_APPLETALK 16 /* Apple Talk */
++#define AF_ROUTE 17 /* Internal Routing Protocol */
++#define AF_LINK 18 /* Link layer interface */
++#define AF_COIP 20 /* connection-oriented IP, aka ST II */
++#define AF_CNT 21 /* Computer Network Technology */
++#define AF_IPX 23 /* Novell Internet Protocol */
++#define AF_INET6 24 /* IP version 6 */
++#define AF_ISDN 26 /* Integrated Services Digital Network*/
++#define AF_E164 AF_ISDN /* CCITT E.164 recommendation */
++#define AF_NATM 27 /* native ATM access */
++#define AF_ARP 28 /* (rev.) addr. res. prot. (RFC 826) */
++#define AF_MAX 31
++
++/*
++ * Structure used by kernel to store most
++ * addresses.
++ */
++struct sockaddr {
++ uint8_t sa_len; /* total length */
++ sa_family_t sa_family; /* address family */
++ char sa_data[14]; /* actually longer; address value */
++};
++
++/*
++ * Protocol families, same as address families for now.
++ */
++#define PF_UNSPEC AF_UNSPEC
++#define PF_LOCAL AF_LOCAL
++#define PF_UNIX PF_LOCAL /* backward compatibility */
++#define PF_INET AF_INET
++#define PF_IMPLINK AF_IMPLINK
++#define PF_PUP AF_PUP
++#define PF_CHAOS AF_CHAOS
++#define PF_NS AF_NS
++#define PF_ISO AF_ISO
++#define PF_OSI AF_ISO
++#define PF_ECMA AF_ECMA
++#define PF_DATAKIT AF_DATAKIT
++#define PF_CCITT AF_CCITT
++#define PF_SNA AF_SNA
++#define PF_DECnet AF_DECnet
++#define PF_DLI AF_DLI
++#define PF_LAT AF_LAT
++#define PF_HYLINK AF_HYLINK
++#define PF_APPLETALK AF_APPLETALK
++#define PF_ROUTE AF_ROUTE
++#define PF_LINK AF_LINK
++#if defined(_NETBSD_SOURCE)
++#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */
++#endif
++#define PF_COIP AF_COIP
++#define PF_CNT AF_CNT
++#define PF_INET6 AF_INET6
++#define PF_IPX AF_IPX /* same format as AF_NS */
++#if defined(_NETBSD_SOURCE)
++#define PF_RTIP pseudo_AF_RTIP /* same format as AF_INET */
++#define PF_PIP pseudo_AF_PIP
++#endif
++#define PF_ISDN AF_ISDN /* same as E164 */
++#define PF_E164 AF_E164
++#define PF_NATM AF_NATM
++#define PF_ARP AF_ARP
++#if defined(_NETBSD_SOURCE)
++#define PF_KEY pseudo_AF_KEY /* like PF_ROUTE, only for key mgmt */
++#endif
++
++#define PF_MAX AF_MAX
++
++#define MSG_OOB 0x1 /* process out-of-band data */
++#define MSG_PEEK 0x2 /* peek at incoming message */
++#define MSG_DONTROUTE 0x4 /* send without using routing tables */
++#define MSG_EOR 0x8 /* data completes record */
++#define MSG_TRUNC 0x10 /* data discarded before delivery */
++#define MSG_CTRUNC 0x20 /* control data lost before delivery */
++#define MSG_WAITALL 0x40 /* wait for full request or error */
++#define MSG_DONTWAIT 0x80 /* this message should be nonblocking */
++#define MSG_BCAST 0x100 /* this message was rcvd using link-level brdcst */
++#define MSG_MCAST 0x200 /* this message was rcvd using link-level mcast */
++
++/*
++ * Types of socket shutdown(2).
++ */
++#define SHUT_RD 0 /* Disallow further receives. */
++#define SHUT_WR 1 /* Disallow further sends. */
++#define SHUT_RDWR 2 /* Disallow further sends/receives. */
++
++struct iovec {
++ void *iov_base; /* Base address. */
++ size_t iov_len; /* Length. */
++};
++
++struct msghdr {
++ void *msg_name; /* optional address */
++ socklen_t msg_namelen; /* size of address */
++ struct iovec *msg_iov; /* scatter/gather array */
++ int msg_iovlen; /* # elements in msg_iov */
++ void *msg_control; /* ancillary data, see below */
++ socklen_t msg_controllen; /* ancillary data buffer len */
++ int msg_flags; /* flags on received message */
++};
++
++/* BSD-compatible socket API. */
++int accept(int, struct sockaddr * __restrict, socklen_t * __restrict);
++int bind(int, const struct sockaddr *, socklen_t);
++int connect(int, const struct sockaddr *, socklen_t);
++int getpeername(int, struct sockaddr * __restrict, socklen_t * __restrict);
++int getsockname(int, struct sockaddr * __restrict, socklen_t * __restrict);
++int getsockopt(int, int, int, void * __restrict, socklen_t * __restrict);
++int listen(int, int);
++ssize_t recv(int, void *, size_t, int);
++ssize_t recvfrom(int, void * __restrict, size_t, int,
++ struct sockaddr * __restrict, socklen_t * __restrict);
++ssize_t recvmsg(int s, struct msghdr *msg, int flags);
++ssize_t send(int, const void *, size_t, int);
++ssize_t sendto(int, const void *,
++ size_t, int, const struct sockaddr *, socklen_t);
++ssize_t sendmsg(int s, const struct msghdr *msg, int flags);
++int setsockopt(int, int, int, const void *, socklen_t);
++int shutdown(int, int);
++int socket(int, int, int);
++
++/* sceNetInet socket API. */
++int sceNetInetAccept(int s, struct sockaddr *addr, socklen_t *addrlen);
++int sceNetInetBind(int s, const struct sockaddr *my_addr, socklen_t addrlen);
++int sceNetInetConnect(int s, const struct sockaddr *serv_addr, socklen_t addrlen);
++int sceNetInetGetsockopt(int s, int level, int optname, void *optval, socklen_t *optlen);
++int sceNetInetListen(int s, int backlog);
++ssize_t sceNetInetRecv(int s, void *buf, size_t len, int flags);
++ssize_t sceNetInetRecvfrom(int s, void *buf, size_t flags, int, struct sockaddr *from, socklen_t *fromlen);
++ssize_t sceNetInetRecvmsg(int s, struct msghdr *msg, int flags);
++ssize_t sceNetInetSend(int s, const void *buf, size_t len, int flags);
++ssize_t sceNetInetSendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen);
++ssize_t sceNetInetSendmsg(int s, const struct msghdr *msg, int flags);
++int sceNetInetSetsockopt(int s, int level, int optname, const void *optval, socklen_t optlen);
++int sceNetInetShutdown(int s, int how);
++int sceNetInetSocket(int domain, int type, int protocol);
++int sceNetInetClose(int s);
++int sceNetInetGetErrno(void);
++int sceNetInetGetsockname(int s, struct sockaddr *name, socklen_t *namelen);
++int sceNetInetGetpeername(int s, struct sockaddr *name, socklen_t *namelen);
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* !_SYS_SOCKET_H_ */
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-syscalls.c b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-syscalls.c
new file mode 100644
index 000000000000..5d4e2b4cf464
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-syscalls.c
@@ -0,0 +1,22 @@
+--- newlib/libc/sys/psp/syscalls.c.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/syscalls.c 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,19 @@
++/*
++ * PSP Software Development Kit - http://www.pspdev.org
++ * -----------------------------------------------------------------------
++ * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
++ *
++ * syscalls.c - functions in systeam namespace goes here
++ *
++ * Copyright (c) 2007 Alper Akcan "anhanguera" <distchx@yahoo.com>
++ *
++ */
++
++#include <stdio.h>
++
++int __psp_set_errno (int code);
++
++time_t _times (time_t *t)
++{
++ return __psp_set_errno(sceKernelLibcTime(t));
++}
diff --git a/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-xprintf.c b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-xprintf.c
new file mode 100644
index 000000000000..6b7617775462
--- /dev/null
+++ b/devel/psptoolchain-newlib/files/patch-newlib-libc-sys-psp-xprintf.c
@@ -0,0 +1,987 @@
+--- newlib/libc/sys/psp/xprintf.c.orig 1970-01-01 02:00:00.000000000 +0200
++++ newlib/libc/sys/psp/xprintf.c 2007-06-01 12:22:26.000000000 +0300
+@@ -0,0 +1,984 @@
++/*
++ * PSP Software Development Kit - http://www.pspdev.org
++ * -----------------------------------------------------------------------
++ * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
++ *
++ * xprintf.c - Various *printf functions.
++ *
++ * Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
++ * Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
++ * Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
++ *
++ * $Id: newlib-1.13.0.patch 1891 2006-05-02 15:32:28Z raf $
++ */
++/* Code borrowed from mysql's xprintf.c, by Richard Hipp */
++/* This xprintf.c file on which this one is based is in public domain. */
++
++#include <stdio.h>
++#include <string.h>
++#include <malloc.h>
++
++#include <stdarg.h>
++#include <stddef.h>
++
++/*
++** The maximum number of digits of accuracy in a floating-point conversion.
++*/
++#define MAXDIG 20
++
++/* Instead of including ctype.h, use the isdigit() prototype because psplibc doesn't
++ know about newlib, and newlib defines isdigit as a macro that uses _ctype_. */
++int isdigit(int __c);
++
++int vxprintf(void (*func)(char *, int, void *), void *arg, const char *format, va_list ap);
++
++#ifdef F_vxprintf
++/*
++** Conversion types fall into various categories as defined by the
++** following enumeration.
++*/
++
++enum e_type { /* The type of the format field */
++ RADIX, /* Integer types. %d, %x, %o, and so forth */
++ FLOAT, /* Floating point. %f */
++ EXP, /* Exponentional notation. %e and %E */
++ GENERIC, /* Floating or exponential, depending on exponent. %g */
++ SIZE, /* Return number of characters processed so far. %n */
++ STRING, /* Strings. %s */
++ PERCENT, /* Percent symbol. %% */
++ CHAR, /* Characters. %c */
++ ERROR, /* Used to indicate no such conversion type */
++/* The rest are extensions, not normally found in printf() */
++ CHARLIT, /* Literal characters. %' */
++ SEEIT, /* Strings with visible control characters. %S */
++ MEM_STRING, /* A string which should be deleted after use. %z */
++ ORDINAL, /* 1st, 2nd, 3rd and so forth */
++};
++
++/*
++** Each builtin conversion character (ex: the 'd' in "%d") is described
++** by an instance of the following structure
++*/
++typedef struct s_info { /* Information about each format field */
++ int fmttype; /* The format field code letter */
++ int base; /* The base for radix conversion */
++ char *charset; /* The character set for conversion */
++ int flag_signed; /* Is the quantity signed? */
++ char *prefix; /* Prefix on non-zero values in alt format */
++ enum e_type type; /* Conversion paradigm */
++} info;
++
++/*
++** The following table is searched linearly, so it is good to put the
++** most frequently used conversion types first.
++*/
++static info fmtinfo[] = {
++ { 'd', 10, "0123456789", 1, 0, RADIX, },
++ { 's', 0, 0, 0, 0, STRING, },
++ { 'S', 0, 0, 0, 0, SEEIT, },
++ { 'z', 0, 0, 0, 0, MEM_STRING, },
++ { 'c', 0, 0, 0, 0, CHAR, },
++ { 'o', 8, "01234567", 0, "0", RADIX, },
++ { 'u', 10, "0123456789", 0, 0, RADIX, },
++ { 'x', 16, "0123456789abcdef", 0, "x0", RADIX, },
++ { 'X', 16, "0123456789ABCDEF", 0, "X0", RADIX, },
++ { 'r', 10, "0123456789", 0, 0, ORDINAL, },
++ { 'f', 0, 0, 1, 0, FLOAT, },
++ { 'e', 0, "e", 1, 0, EXP, },
++ { 'E', 0, "E", 1, 0, EXP, },
++ { 'g', 0, "e", 1, 0, GENERIC, },
++ { 'G', 0, "E", 1, 0, GENERIC, },
++ { 'i', 10, "0123456789", 1, 0, RADIX, },
++ { 'n', 0, 0, 0, 0, SIZE, },
++ { 'S', 0, 0, 0, 0, SEEIT, },
++ { '%', 0, 0, 0, 0, PERCENT, },
++ { 'b', 2, "01", 0, "b0", RADIX, }, /* Binary notation */
++ { 'p', 16, "0123456789ABCDEF", 0, "x0", RADIX, }, /* Pointers */
++ { '\'', 0, 0, 0, 0, CHARLIT, }, /* Literal char */
++};
++#define NINFO (sizeof(fmtinfo)/sizeof(info)) /* Size of the fmtinfo table */
++
++/*
++** If NOFLOATINGPOINT is defined, then none of the floating point
++** conversions will work.
++*/
++#ifndef NOFLOATINGPOINT
++/*
++** "*val" is a double such that 0.1 <= *val < 10.0
++** Return the ascii code for the leading digit of *val, then
++** multiply "*val" by 10.0 to renormalize.
++**
++** Example:
++** input: *val = 3.14159
++** output: *val = 1.4159 function return = '3'
++**
++** The counter *cnt is incremented each time. After counter exceeds
++** 16 (the number of significant digits in a 64-bit float) '0' is
++** always returned.
++*/
++static int getdigit(long double *val, int *cnt){
++ int digit;
++ long double d;
++ if( (*cnt)++ >= MAXDIG ) return '0';
++ digit = (int)*val;
++ d = digit;
++ digit += '0';
++ *val = (*val - d)*10.0;
++ return digit;
++}
++#endif
++
++/*
++** Setting the size of the BUFFER involves trade-offs. No %d or %f
++** conversion can have more than BUFSIZE characters. If the field
++** width is larger than BUFSIZE, it is silently shortened. On the
++** other hand, this routine consumes more stack space with larger
++** BUFSIZEs. If you have some threads for which you want to minimize
++** stack space, you should keep BUFSIZE small.
++*/
++#define BUFSIZE 100 /* Size of the output buffer */
++
++/*
++** The root program. All variations call this core.
++**
++** INPUTS:
++** func This is a pointer to a function taking three arguments
++** 1. A pointer to the list of characters to be output
++** (Note, this list is NOT null terminated.)
++** 2. An integer number of characters to be output.
++** (Note: This number might be zero.)
++** 3. A pointer to anything. Same as the "arg" parameter.
++**
++** arg This is the pointer to anything which will be passed as the
++** third argument to "func". Use it for whatever you like.
++**
++** fmt This is the format string, as in the usual print.
++**
++** ap This is a pointer to a list of arguments. Same as in
++** vfprint.
++**
++** OUTPUTS:
++** The return value is the total number of characters sent to
++** the function "func". Returns -1 on a error.
++**
++** Note that the order in which automatic variables are declared below
++** seems to make a big difference in determining how fast this beast
++** will run.
++*/
++
++int vxprintf(func,arg,format,ap)
++ void (*func)(char*,int,void*);
++ void *arg;
++ const char *format;
++ va_list ap;
++{
++ register const char *fmt; /* The format string. */
++ register int c; /* Next character in the format string */
++ register char *bufpt; /* Pointer to the conversion buffer */
++ register int precision; /* Precision of the current field */
++ register int length; /* Length of the field */
++ register int idx; /* A general purpose loop counter */
++ int count; /* Total number of characters output */
++ int width; /* Width of the current field */
++ int flag_leftjustify; /* True if "-" flag is present */
++ int flag_plussign; /* True if "+" flag is present */
++ int flag_blanksign; /* True if " " flag is present */
++ int flag_alternateform; /* True if "#" flag is present */
++ int flag_zeropad; /* True if field width constant starts with zero */
++ int flag_long; /* True if "l" flag is present */
++ int flag_center; /* True if "=" flag is present */
++ unsigned long long longvalue; /* Value for integer types */
++
++ long double realvalue; /* Value for real types */
++ info *infop; /* Pointer to the appropriate info structure */
++ char buf[BUFSIZE]; /* Conversion buffer */
++ char prefix; /* Prefix character. "+" or "-" or " " or '\0'. */
++ int errorflag = 0; /* True if an error is encountered */
++ enum e_type xtype; /* Conversion paradigm */
++ char *zMem = 0; /* String to be freed */
++ static char spaces[] =
++ " ";
++#define SPACESIZE (sizeof(spaces)-1)
++#ifndef NOFLOATINGPOINT
++ int exp; /* exponent of real numbers */
++ long double rounder; /* Used for rounding floating point values */
++ int flag_dp; /* True if decimal point should be shown */
++ int flag_rtz; /* True if trailing zeros should be removed */
++ int flag_exp; /* True to force display of the exponent */
++ int nsd; /* Number of significant digits returned */
++#endif
++
++ fmt = format; /* Put in a register for speed */
++ count = length = 0;
++ bufpt = 0;
++ for(; (c=(*fmt))!=0; ++fmt){
++ if( c!='%' ){
++ register int amt;
++ bufpt = (char *)fmt;
++ amt = 1;
++ while( (c=(*++fmt))!='%' && c!=0 ) amt++;
++ (*func)(bufpt,amt,arg);
++ count += amt;
++ if( c==0 ) break;
++ }
++ if( (c=(*++fmt))==0 ){
++ errorflag = 1;
++ (*func)("%",1,arg);
++ count++;
++ break;
++ }
++ /* Find out what flags are present */
++ flag_leftjustify = flag_plussign = flag_blanksign =
++ flag_alternateform = flag_zeropad = flag_center = 0;
++ do{
++ switch( c ){
++ case '-': flag_leftjustify = 1; c = 0; break;
++ case '+': flag_plussign = 1; c = 0; break;
++ case ' ': flag_blanksign = 1; c = 0; break;
++ case '#': flag_alternateform = 1; c = 0; break;
++ case '0': flag_zeropad = 1; c = 0; break;
++ case '=': flag_center = 1; c = 0; break;
++ default: break;
++ }
++ }while( c==0 && (c=(*++fmt))!=0 );
++ if( flag_center ) flag_leftjustify = 0;
++ /* Get the field width */
++ width = 0;
++ if( c=='*' ){
++ width = va_arg(ap,int);
++ if( width<0 ){
++ flag_leftjustify = 1;
++ width = -width;
++ }
++ c = *++fmt;
++ }else{
++ while( isdigit(c) ){
++ width = width*10 + c - '0';
++ c = *++fmt;
++ }
++ }
++ if( width > BUFSIZE-10 ){
++ width = BUFSIZE-10;
++ }
++ /* Get the precision */
++ if( c=='.' ){
++ precision = 0;
++ c = *++fmt;
++ if( c=='*' ){
++ precision = va_arg(ap,int);
++#ifndef COMPATIBILITY
++ /* This is sensible, but SUN OS 4.1 doesn't do it. */
++ if( precision<0 ) precision = -precision;
++#endif
++ c = *++fmt;
++ }else{
++ while( isdigit(c) ){
++ precision = precision*10 + c - '0';
++ c = *++fmt;
++ }
++ }
++ /* Limit the precision to prevent overflowing buf[] during conversion */
++ if( precision>BUFSIZE-40 ) precision = BUFSIZE-40;
++ }else{
++ precision = -1;
++ }
++ /* Get the conversion type modifier */
++ if( c=='l' ){
++ flag_long = 1;
++ c = *++fmt;
++ if( c == 'l' ){
++ flag_long = 2;
++ c = *++fmt;
++ }
++ }else{
++ flag_long = 0;
++ }
++ /* Fetch the info entry for the field */
++ infop = 0;
++ for(idx=0; idx<NINFO; idx++){
++ if( c==fmtinfo[idx].fmttype ){
++ infop = &fmtinfo[idx];
++ break;
++ }
++ }
++ /* No info entry found. It must be an error. */
++ if( infop==0 ){
++ xtype = ERROR;
++ }else{
++ xtype = infop->type;
++ }
++
++ /*
++ ** At this point, variables are initialized as follows:
++ **
++ ** flag_alternateform TRUE if a '#' is present.
++ ** flag_plussign TRUE if a '+' is present.
++ ** flag_leftjustify TRUE if a '-' is present or if the
++ ** field width was negative.
++ ** flag_zeropad TRUE if the width began with 0.
++ ** flag_long TRUE if the letter 'l' (ell) prefixed
++ ** the conversion character.
++ ** flag_blanksign TRUE if a ' ' is present.
++ ** width The specified field width. This is
++ ** always non-negative. Zero is the default.
++ ** precision The specified precision. The default
++ ** is -1.
++ ** xtype The class of the conversion.
++ ** infop Pointer to the appropriate info struct.
++ */
++ switch( xtype ){
++ case ORDINAL:
++ case RADIX:
++ if(( flag_long>1 )&&( infop->flag_signed )){
++ signed long long t = va_arg(ap,signed long long);
++ longvalue = t;
++ }else if(( flag_long>1 )&&( !infop->flag_signed )){
++ unsigned long long t = va_arg(ap,unsigned long long);
++ longvalue = t;
++ }else if(( flag_long )&&( infop->flag_signed )){
++ signed long t = va_arg(ap,signed long);
++ longvalue = t;
++ }else if(( flag_long )&&( !infop->flag_signed )){
++ unsigned long t = va_arg(ap,unsigned long);
++ longvalue = t;
++ }else if(( !flag_long )&&( infop->flag_signed )){
++ signed int t = va_arg(ap,signed int) & ((unsigned long) 0xffffffff);
++ longvalue = t;
++ }else{
++ unsigned int t = va_arg(ap,unsigned int) & ((unsigned long) 0xffffffff);
++ longvalue = t;
++ }
++#ifdef COMPATIBILITY
++ /* For the format %#x, the value zero is printed "0" not "0x0".
++ ** I think this is stupid. */
++ if( longvalue==0 ) flag_alternateform = 0;
++#else
++ /* More sensible: turn off the prefix for octal (to prevent "00"),
++ ** but leave the prefix for hex. */
++ if( longvalue==0 && infop->base==8 ) flag_alternateform = 0;
++#endif
++ if( infop->flag_signed ){
++ if( *(long long*)&longvalue<0 ){
++ longvalue = -*(long long*)&longvalue;
++ prefix = '-';
++ }else if( flag_plussign ) prefix = '+';
++ else if( flag_blanksign ) prefix = ' ';
++ else prefix = 0;
++ }else prefix = 0;
++ if( flag_zeropad && precision<width-(prefix!=0) ){
++ precision = width-(prefix!=0);
++ }
++ bufpt = &buf[BUFSIZE];
++ if( xtype==ORDINAL ){
++ long a,b;
++ a = longvalue%10;
++ b = longvalue%100;
++ bufpt -= 2;
++ if( a==0 || a>3 || (b>10 && b<14) ){
++ bufpt[0] = 't';
++ bufpt[1] = 'h';
++ }else if( a==1 ){
++ bufpt[0] = 's';
++ bufpt[1] = 't';
++ }else if( a==2 ){
++ bufpt[0] = 'n';
++ bufpt[1] = 'd';
++ }else if( a==3 ){
++ bufpt[0] = 'r';
++ bufpt[1] = 'd';
++ }
++ }
++ {
++ register char *cset; /* Use registers for speed */
++ register int base;
++ cset = infop->charset;
++ base = infop->base;
++ do{ /* Convert to ascii */
++ *(--bufpt) = cset[longvalue%base];
++ longvalue = longvalue/base;
++ }while( longvalue>0 );
++ }
++ length = (int)(&buf[BUFSIZE]-bufpt);
++ if(infop->fmttype == 'p')
++ {
++ precision = 8;
++ flag_alternateform = 1;
++ }
++
++ for(idx=precision-length; idx>0; idx--){
++ *(--bufpt) = '0'; /* Zero pad */
++ }
++ if( prefix ) *(--bufpt) = prefix; /* Add sign */
++ if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */
++ char *pre, x;
++ pre = infop->prefix;
++ if( *bufpt!=pre[0] ){
++ for(pre=infop->prefix; (x=(*pre))!=0; pre++) *(--bufpt) = x;
++ }
++ }
++
++ length = (int)(&buf[BUFSIZE]-bufpt);
++ break;
++ case FLOAT:
++ case EXP:
++ case GENERIC:
++ realvalue = va_arg(ap,double);
++#ifndef NOFLOATINGPOINT
++ if( precision<0 ) precision = 6; /* Set default precision */
++ if( precision>BUFSIZE-10 ) precision = BUFSIZE-10;
++ if( realvalue<0.0 ){
++ realvalue = -realvalue;
++ prefix = '-';
++ }else{
++ if( flag_plussign ) prefix = '+';
++ else if( flag_blanksign ) prefix = ' ';
++ else prefix = 0;
++ }
++ if( infop->type==GENERIC && precision>0 ) precision--;
++ rounder = 0.0;
++#ifdef COMPATIBILITY
++ /* Rounding works like BSD when the constant 0.4999 is used. Wierd! */
++ for(idx=precision, rounder=0.4999; idx>0; idx--, rounder*=0.1);
++#else
++ /* It makes more sense to use 0.5 */
++ if( precision>MAXDIG-1 ) idx = MAXDIG-1;
++ else idx = precision;
++ for(rounder=0.5; idx>0; idx--, rounder*=0.1);
++#endif
++ if( infop->type==FLOAT ) realvalue += rounder;
++ /* Normalize realvalue to within 10.0 > realvalue >= 1.0 */
++ exp = 0;
++ if( realvalue>0.0 ){
++ int k = 0;
++ while( realvalue>=1e8 && k++<100 ){ realvalue *= 1e-8; exp+=8; }
++ while( realvalue>=10.0 && k++<100 ){ realvalue *= 0.1; exp++; }
++ while( realvalue<1e-8 && k++<100 ){ realvalue *= 1e8; exp-=8; }
++ while( realvalue<1.0 && k++<100 ){ realvalue *= 10.0; exp--; }
++ if( k>=100 ){
++ bufpt = "NaN";
++ length = 3;
++ break;
++ }
++ }
++ bufpt = buf;
++ /*
++ ** If the field type is GENERIC, then convert to either EXP
++ ** or FLOAT, as appropriate.
++ */
++ flag_exp = xtype==EXP;
++ if( xtype!=FLOAT ){
++ realvalue += rounder;
++ if( realvalue>=10.0 ){ realvalue *= 0.1; exp++; }
++ }
++ if( xtype==GENERIC ){
++ flag_rtz = !flag_alternateform;
++ if( exp<-4 || exp>precision ){
++ xtype = EXP;
++ }else{
++ precision = precision - exp;
++ xtype = FLOAT;
++ }
++ }else{
++ flag_rtz = 0;
++ }
++ /*
++ ** The "exp+precision" test causes output to be of type EXP if
++ ** the precision is too large to fit in buf[].
++ */
++ nsd = 0;
++ if( xtype==FLOAT && exp+precision<BUFSIZE-30 ){
++ flag_dp = (precision>0 || flag_alternateform);
++ if( prefix ) *(bufpt++) = prefix; /* Sign */
++ if( exp<0 ) *(bufpt++) = '0'; /* Digits before "." */
++ else for(; exp>=0; exp--) *(bufpt++) = getdigit(&realvalue,&nsd);
++ if( flag_dp ) *(bufpt++) = '.'; /* The decimal point */
++ for(exp++; exp<0 && precision>0; precision--, exp++){
++ *(bufpt++) = '0';
++ }
++ while( (precision--)>0 ) *(bufpt++) = getdigit(&realvalue,&nsd);
++ *(bufpt--) = 0; /* Null terminate */
++ if( flag_rtz && flag_dp ){ /* Remove trailing zeros and "." */
++ while( bufpt>=buf && *bufpt=='0' ) *(bufpt--) = 0;
++ if( bufpt>=buf && *bufpt=='.' ) *(bufpt--) = 0;
++ }
++ bufpt++; /* point to next free slot */
++ }else{ /* EXP or GENERIC */
++ flag_dp = (precision>0 || flag_alternateform);
++ if( prefix ) *(bufpt++) = prefix; /* Sign */
++ *(bufpt++) = getdigit(&realvalue,&nsd); /* First digit */
++ if( flag_dp ) *(bufpt++) = '.'; /* Decimal point */
++ while( (precision--)>0 ) *(bufpt++) = getdigit(&realvalue,&nsd);
++ bufpt--; /* point to last digit */
++ if( flag_rtz && flag_dp ){ /* Remove tail zeros */
++ while( bufpt>=buf && *bufpt=='0' ) *(bufpt--) = 0;
++ if( bufpt>=buf && *bufpt=='.' ) *(bufpt--) = 0;
++ }
++ bufpt++; /* point to next free slot */
++ if( exp || flag_exp ){
++ *(bufpt++) = infop->charset[0];
++ if( exp<0 ){ *(bufpt++) = '-'; exp = -exp; } /* sign of exp */
++ else { *(bufpt++) = '+'; }
++ if( exp>=100 ){
++ *(bufpt++) = (exp/100)+'0'; /* 100's digit */
++ exp %= 100;
++ }
++ *(bufpt++) = exp/10+'0'; /* 10's digit */
++ *(bufpt++) = exp%10+'0'; /* 1's digit */
++ }
++ }
++ /* The converted number is in buf[] and zero terminated. Output it.
++ ** Note that the number is in the usual order, not reversed as with
++ ** integer conversions. */
++ length = (int)(bufpt-buf);
++ bufpt = buf;
++
++ /* Special case: Add leading zeros if the flag_zeropad flag is
++ ** set and we are not left justified */
++ if( flag_zeropad && !flag_leftjustify && length < width){
++ int i;
++ int nPad = width - length;
++ for(i=width; i>=nPad; i--){
++ bufpt[i] = bufpt[i-nPad];
++ }
++ i = prefix!=0;
++ while( nPad-- ) bufpt[i++] = '0';
++ length = width;
++ }
++#endif
++ break;
++ case SIZE:
++ *(va_arg(ap,int*)) = count;
++ length = width = 0;
++ break;
++ case PERCENT:
++ buf[0] = '%';
++ bufpt = buf;
++ length = 1;
++ break;
++ case CHARLIT:
++ case CHAR:
++ c = buf[0] = (xtype==CHAR ? va_arg(ap,int) : *++fmt);
++ if( precision>=0 ){
++ for(idx=1; idx<precision; idx++) buf[idx] = c;
++ length = precision;
++ }else{
++ length =1;
++ }
++ bufpt = buf;
++ break;
++ case STRING:
++ case MEM_STRING:
++ zMem = bufpt = va_arg(ap,char*);
++ if( bufpt==0 ) bufpt = "(null)";
++ length = strlen(bufpt);
++ if( precision>=0 && precision<length ) length = precision;
++ break;
++ case SEEIT:
++ {
++ int i;
++ int c;
++ char *arg = va_arg(ap,char*);
++ for(i=0; i<BUFSIZE-1 && (c = *arg++)!=0; i++){
++ if( c<0x20 || c>=0x7f ){
++ buf[i++] = '^';
++ buf[i] = (c&0x1f)+0x40;
++ }else{
++ buf[i] = c;
++ }
++ }
++ bufpt = buf;
++ length = i;
++ if( precision>=0 && precision<length ) length = precision;
++ }
++ break;
++ case ERROR:
++ buf[0] = '%';
++ buf[1] = c;
++ errorflag = 0;
++ idx = 1+(c!=0);
++ (*func)("%",idx,arg);
++ count += idx;
++ if( c==0 ) fmt--;
++ break;
++ }/* End switch over the format type */
++ /*
++ ** The text of the conversion is pointed to by "bufpt" and is
++ ** "length" characters long. The field width is "width". Do
++ ** the output.
++ */
++ if( !flag_leftjustify ){
++ register int nspace;
++ nspace = width-length;
++ if( nspace>0 ){
++ if( flag_center ){
++ nspace = nspace/2;
++ width -= nspace;
++ flag_leftjustify = 1;
++ }
++ count += nspace;
++ while( nspace>=SPACESIZE ){
++ (*func)(spaces,SPACESIZE,arg);
++ nspace -= SPACESIZE;
++ }
++ if( nspace>0 ) (*func)(spaces,nspace,arg);
++ }
++ }
++ if( length>0 ){
++ (*func)(bufpt,length,arg);
++ count += length;
++ }
++ if( xtype==MEM_STRING && zMem ){
++ free(zMem);
++ }
++ if( flag_leftjustify ){
++ register int nspace;
++ nspace = width-length;
++ if( nspace>0 ){
++ count += nspace;
++ while( nspace>=SPACESIZE ){
++ (*func)(spaces,SPACESIZE,arg);
++ nspace -= SPACESIZE;
++ }
++ if( nspace>0 ) (*func)(spaces,nspace,arg);
++ }
++ }
++ }/* End for loop over the format string */
++ return errorflag ? -1 : count;
++} /* End of function */
++#endif
++
++#ifdef F__xprintf
++/*
++** This non-standard function is still occasionally useful....
++*/
++int xprintf(
++ void (*func)(char*,int,void*),
++ void *arg,
++ const char *format,
++ ...
++){
++ va_list ap;
++ va_start(ap,format);
++ return vxprintf(func,arg,format,ap);
++}
++#endif
++
++/*
++** Now for string-print, also as found in any standard library.
++** Add to this the snprint function which stops added characters
++** to the string at a given length.
++**
++** Note that snprint returns the length of the string as it would
++** be if there were no limit on the output.
++*/
++struct s_strargument { /* Describes the string being written to */
++ char *next; /* Next free slot in the string */
++ char *last; /* Last available slot in the string */
++};
++
++void __sout(char *, int, void *);
++#ifdef F___sout
++void __sout(txt,amt,arg)
++ char *txt;
++ int amt;
++ void *arg;
++{
++ register char *head;
++ register const char *t;
++ register int a;
++ register char *tail;
++ a = amt;
++ t = txt;
++ head = ((struct s_strargument*)arg)->next;
++ tail = ((struct s_strargument*)arg)->last;
++ if( tail ){
++ while( a-- >0 && head<tail ) *(head++) = *(t++);
++ }else{
++ while( a-- >0 ) *(head++) = *(t++);
++ }
++ *head = 0;
++ ((struct s_strargument*)arg)->next = head;
++}
++#endif
++
++#ifdef F_vsnprintf
++int vsnprintf(char *buf, size_t n, const char *fmt, va_list ap){
++ struct s_strargument arg;
++ arg.next = buf;
++ arg.last = &buf[n-1];
++ *buf = 0;
++ return vxprintf(__sout,&arg,fmt,ap);
++}
++#endif
++
++#ifdef F_snprintf
++int snprintf(char *str, size_t sz, const char *format, ...)
++{
++ va_list args;
++ struct s_strargument arg;
++ int ret;
++
++ arg.next = str;
++ arg.last = &str[sz-1];
++
++ va_start(args, format);
++ ret = vxprintf(__sout, &arg, format, args);
++ va_end(args);
++
++ return ret;
++}
++#endif
++
++#ifdef F_vsprintf
++int vsprintf(char *buf, const char *fmt, va_list ap){
++ struct s_strargument arg;
++ arg.next = buf;
++ arg.last = NULL;
++ *buf = 0;
++ return vxprintf(__sout,&arg,fmt,ap);
++}
++#endif
++
++#ifdef F_sprintf
++int sprintf (char *str, const char *format, ...)
++{
++ va_list args;
++ struct s_strargument arg;
++ int ret;
++
++ arg.next = str;
++ arg.last = NULL;
++
++ va_start(args, format);
++ ret = vxprintf(__sout, &arg, format, args);
++ va_end(args);
++
++ return ret;
++}
++#endif
++
++/*
++** The following section of code handles the mprintf routine, that
++** writes to memory obtained from malloc().
++*/
++
++/* This structure is used to store state information about the
++** write in progress
++*/
++struct sgMprintf {
++ char *zBase; /* A base allocation */
++ char *zText; /* The string collected so far */
++ int nChar; /* Length of the string so far */
++ int nAlloc; /* Amount of space allocated in zText */
++};
++
++void __mout(char *, int, void*);
++
++#ifdef F___mout
++/* The xprintf callback function. */
++void __mout(zNewText,nNewChar,arg)
++ char *zNewText;
++ int nNewChar;
++ void *arg;
++{
++ struct sgMprintf *pM = (struct sgMprintf*)arg;
++ if( pM->nChar + nNewChar + 1 > pM->nAlloc ){
++ pM->nAlloc = pM->nChar + nNewChar*2 + 1;
++ if( pM->zText==pM->zBase ){
++ pM->zText = malloc(pM->nAlloc);
++ if( pM->zText && pM->nChar ) memcpy(pM->zText,pM->zBase,pM->nChar);
++ }else{
++ pM->zText = realloc(pM->zText, pM->nAlloc);
++ }
++ }
++ if( pM->zText ){
++ memcpy(&pM->zText[pM->nChar], zNewText, nNewChar);
++ pM->nChar += nNewChar;
++ pM->zText[pM->nChar] = 0;
++ }
++}
++#endif
++
++/*
++** mprintf() works like printf(), but allocations memory to hold the
++** resulting string and returns a pointer to the allocated memory.
++**
++** We changed the name to TclMPrint() to conform with the Tcl private
++** routine naming conventions.
++*/
++
++#ifdef F_mprintf
++char *mprintf(const char *zFormat, ...){
++ va_list ap;
++ struct sgMprintf sMprintf;
++ char *zNew;
++ char zBuf[200];
++
++ va_start(ap,zFormat);
++ sMprintf.nChar = 0;
++ sMprintf.nAlloc = sizeof(zBuf);
++ sMprintf.zText = zBuf;
++ sMprintf.zBase = zBuf;
++ vxprintf(__mout,&sMprintf,zFormat,ap);
++ va_end(ap);
++ if( sMprintf.zText==sMprintf.zBase ){
++ zNew = malloc( sMprintf.nChar+1 );
++ if( zNew ) strcpy(zNew,zBuf);
++ }else{
++ zNew = realloc(sMprintf.zText,sMprintf.nChar+1);
++ }
++
++ return zNew;
++}
++#endif
++
++/* This is the varargs version of mprintf.
++**
++** The name is changed to TclVMPrintf() to conform with Tcl naming
++** conventions.
++*/
++#ifdef F_vmprintf
++char *vmprintf(const char *zFormat,va_list ap){
++ struct sgMprintf sMprintf;
++ char zBuf[200];
++ sMprintf.nChar = 0;
++ sMprintf.zText = zBuf;
++ sMprintf.nAlloc = sizeof(zBuf);
++ sMprintf.zBase = zBuf;
++ vxprintf(__mout,&sMprintf,zFormat,ap);
++ if( sMprintf.zText==sMprintf.zBase ){
++ sMprintf.zText = malloc( strlen(zBuf)+1 );
++ if( sMprintf.zText ) strcpy(sMprintf.zText,zBuf);
++ }else{
++ sMprintf.zText = realloc(sMprintf.zText,sMprintf.nChar+1);
++ }
++ return sMprintf.zText;
++}
++#endif
++
++#ifdef F_asprintf
++int asprintf(char ** strp, const char *zFormat, ...){
++ va_list ap;
++ struct sgMprintf sMprintf;
++ char *zNew;
++ char zBuf[200];
++
++ va_start(ap,zFormat);
++ sMprintf.nChar = 0;
++ sMprintf.nAlloc = sizeof(zBuf);
++ sMprintf.zText = zBuf;
++ sMprintf.zBase = zBuf;
++ vxprintf(__mout,&sMprintf,zFormat,ap);
++ va_end(ap);
++ if( sMprintf.zText==sMprintf.zBase ){
++ zNew = malloc( sMprintf.nChar+1 );
++ if( zNew ) strcpy(zNew,zBuf);
++ }else{
++ zNew = realloc(sMprintf.zText,sMprintf.nChar+1);
++ }
++
++ *strp = zNew;
++
++ return sMprintf.nChar+1;
++}
++#endif
++
++#ifdef F_vasprintf
++int vasprintf(char **strp, const char *format, va_list ap) {
++ struct sgMprintf sMprintf;
++ char zBuf[200];
++ sMprintf.nChar = 0;
++ sMprintf.zText = zBuf;
++ sMprintf.nAlloc = sizeof(zBuf);
++ sMprintf.zBase = zBuf;
++ vxprintf(__mout,&sMprintf,format,ap);
++ if( sMprintf.zText==sMprintf.zBase ){
++ sMprintf.zText = malloc( strlen(zBuf)+1 );
++ if( sMprintf.zText ) strcpy(sMprintf.zText,zBuf);
++ }else{
++ sMprintf.zText = realloc(sMprintf.zText,sMprintf.nChar+1);
++ }
++ *strp = sMprintf.zText;
++ return sMprintf.nChar;
++}
++#endif
++
++/*
++** The following section of code handles the standard fprintf routines
++** for pthreads.
++*/
++
++void __fout(char *, int, void *);
++
++#ifdef F___fout
++void __fout(zNewText,nNewChar,arg)
++ char *zNewText;
++ int nNewChar;
++ void *arg;
++{
++ fwrite(zNewText,1,nNewChar,(FILE*)arg);
++}
++#endif
++
++#ifdef F_fprintf
++/* The public interface routines */
++int fprintf(FILE *pOut, const char *zFormat, ...){
++ va_list ap;
++ int retc;
++
++ va_start(ap,zFormat);
++ retc = vxprintf(__fout,pOut,zFormat,ap);
++ va_end(ap);
++ return retc;
++}
++#endif
++
++#ifdef F_vfprintf
++int vfprintf(FILE *pOut, const char *zFormat, va_list ap){
++ return vxprintf(__fout,pOut,zFormat,ap);
++}
++#endif
++
++
++#ifdef F_printf
++int printf(const char *format, ...)
++{
++ va_list args;
++ int ret;
++
++ va_start(args, format);
++ ret = vprintf(format, args);
++ va_end(args);
++
++ return ret;
++}
++#endif
++
++#ifdef F_vprintf
++int vprintf(const char *format, va_list args)
++{
++ return vxprintf(__fout, stdout, format, args);
++}
++#endif
++
++#ifdef F__sprintf_r
++/* Idiotic kludge to get around newlib stupidity. tmpnam() calls this
++ directly, but since sprintf() above replaces newlib's sprintf() (and
++ _sprintf_r()) we have to define this in order to link tmpnam(). */
++int _sprintf_r(struct _reent *unused, char *str, const char *format, ...)
++{
++ va_list args;
++ struct s_strargument arg;
++ int ret;
++
++ (void) unused;
++ arg.next = str;
++ arg.last = NULL;
++
++ va_start(args, format);
++ ret = vxprintf(__sout, &arg, format, args);
++ va_end(args);
++
++ return ret;
++}
++#endif
diff --git a/devel/psptoolchain-newlib/pkg-descr b/devel/psptoolchain-newlib/pkg-descr
new file mode 100644
index 000000000000..ebd84fb39295
--- /dev/null
+++ b/devel/psptoolchain-newlib/pkg-descr
@@ -0,0 +1,4 @@
+The PlayStation Portable Toolchain is a collection of tools and utilities
+for homebrew PSP development.
+
+WWW: http://www.ps2dev.org
diff --git a/devel/psptoolchain-newlib/pkg-plist b/devel/psptoolchain-newlib/pkg-plist
new file mode 100644
index 000000000000..3ce66a21e9ed
--- /dev/null
+++ b/devel/psptoolchain-newlib/pkg-plist
@@ -0,0 +1,105 @@
+psp/lib/libm.a
+psp/lib/libg.a
+psp/lib/libc.a
+psp/lib/crt0.o
+psp/include/wctype.h
+psp/include/wchar.h
+psp/include/utmp.h
+psp/include/utime.h
+psp/include/unistd.h
+psp/include/unctrl.h
+psp/include/time.h
+psp/include/termios.h
+psp/include/sys/wait.h
+psp/include/sys/utime.h
+psp/include/sys/unistd.h
+psp/include/sys/types.h
+psp/include/sys/times.h
+psp/include/sys/timeb.h
+psp/include/sys/time.h
+psp/include/sys/syslimits.h
+psp/include/sys/string.h
+psp/include/sys/stdio.h
+psp/include/sys/stat.h
+psp/include/sys/socket.h
+psp/include/sys/signal.h
+psp/include/sys/select.h
+psp/include/sys/sched.h
+psp/include/sys/resource.h
+psp/include/sys/reent.h
+psp/include/sys/queue.h
+psp/include/sys/param.h
+psp/include/sys/lock.h
+psp/include/sys/ioctl.h
+psp/include/sys/iconvnls.h
+psp/include/sys/file.h
+psp/include/sys/features.h
+psp/include/sys/fd_set.h
+psp/include/sys/fcntl.h
+psp/include/sys/errno.h
+psp/include/sys/dirent.h
+psp/include/sys/config.h
+psp/include/sys/cdefs.h
+psp/include/sys/_types.h
+psp/include/string.h
+psp/include/stdlib.h
+psp/include/stdio.h
+psp/include/stdint.h
+psp/include/signal.h
+psp/include/setjmp.h
+psp/include/search.h
+psp/include/regdef.h
+psp/include/reent.h
+psp/include/pwd.h
+psp/include/pthread.h
+psp/include/process.h
+psp/include/paths.h
+psp/include/newlib.h
+psp/include/netinet/tcp.h
+psp/include/netinet/in.h
+psp/include/netdb.h
+psp/include/math.h
+psp/include/malloc.h
+psp/include/machine/types.h
+psp/include/machine/time.h
+psp/include/machine/termios.h
+psp/include/machine/stdlib.h
+psp/include/machine/setjmp.h
+psp/include/machine/setjmp-dj.h
+psp/include/machine/regdef.h
+psp/include/machine/param.h
+psp/include/machine/malloc.h
+psp/include/machine/ieeefp.h
+psp/include/machine/fastmath.h
+psp/include/machine/endian.h
+psp/include/machine/ansi.h
+psp/include/machine/_types.h
+psp/include/locale.h
+psp/include/limits.h
+psp/include/libgen.h
+psp/include/langinfo.h
+psp/include/inttypes.h
+psp/include/ieeefp.h
+psp/include/iconv.h
+psp/include/grp.h
+psp/include/getopt.h
+psp/include/fcntl.h
+psp/include/fastmath.h
+psp/include/errno.h
+psp/include/envz.h
+psp/include/dirent.h
+psp/include/ctype.h
+psp/include/assert.h
+psp/include/arpa/inet.h
+psp/include/argz.h
+psp/include/ar.h
+psp/include/alloca.h
+psp/include/_syslist.h
+psp/include/_ansi.h
+@dirrm psp/include/sys
+@dirrm psp/include/netinet
+@dirrm psp/include/machine
+@dirrm psp/include/arpa
+@dirrmtry psp/include/bits
+@dirrmtry psp/include
+@dirrmtry psp
diff --git a/devel/psptoolchain-pspsdk-stage1/Makefile b/devel/psptoolchain-pspsdk-stage1/Makefile
new file mode 100644
index 000000000000..707c113e1d94
--- /dev/null
+++ b/devel/psptoolchain-pspsdk-stage1/Makefile
@@ -0,0 +1,43 @@
+# New ports collection makefile for: psptoolchain-pspsdk-stage1
+# Date created: 7 August 2009
+# Whom: Tassilo Philipp <tphilipp@potion-studios.com>
+#
+# $FreeBSD$
+#
+
+PORTNAME= pspsdk
+PORTVERSION= 20090127
+CATEGORIES= devel
+MASTER_SITES= http://www.potion-studios.com/
+PKGNAMEPREFIX= psptoolchain-
+PKGNAMESUFFIX?= -stage1
+
+MAINTAINER= tphilipp@potion-studios.com
+COMMENT= PlayStation Portable development toolchain ${PORTNAME}
+
+PSP_SDK_STAGE_PREFIX= psp/stage1
+
+USE_AUTOTOOLS= libtool:22:env aclocal:19:env autoheader:262:env automake:19:env autoconf:262:env
+USE_GMAKE= yes
+HAS_CONFIGURE= yes
+CONFIGURE_ARGS?= --prefix=${PREFIX}/${PSP_SDK_STAGE_PREFIX} --with-pspdev="${PREFIX}/${PSP_SDK_STAGE_PREFIX}"
+
+# First stage only needs to install some data needed to compile newlib.
+# Patch a hardcoded prefix, such that we can set our own stage1 subdir.
+.if ${PKGNAMESUFFIX} == "-stage1"
+
+INSTALL_TARGET= install-data
+NO_BUILD= yes
+
+post-patch:
+ @${REINPLACE_CMD} -E 's/^(prefix="\$$pspdev")$$/#\1/' ${WRKSRC}/configure.ac
+ @${REINPLACE_CMD} -E 's/^(psp_targetdir=")psp(")$$/\1.\2/' ${WRKSRC}/configure.ac
+
+.endif
+
+pre-configure:
+ @cd ${WRKSRC} && ./bootstrap
+
+PLIST_SUB+= PSP_SDK_STAGE_PREFIX=${PSP_SDK_STAGE_PREFIX}
+
+.include <bsd.port.mk>
diff --git a/devel/psptoolchain-pspsdk-stage1/distinfo b/devel/psptoolchain-pspsdk-stage1/distinfo
new file mode 100644
index 000000000000..bb3b5c0799d1
--- /dev/null
+++ b/devel/psptoolchain-pspsdk-stage1/distinfo
@@ -0,0 +1,3 @@
+MD5 (pspsdk-20090127.tar.gz) = 889d04fa25522ca3ae886ddda669c52f
+SHA256 (pspsdk-20090127.tar.gz) = c18cf11c3a0dec950b913349e9d801e2d1b1d7acd0e9c8f57802b422dc5fd612
+SIZE (pspsdk-20090127.tar.gz) = 601708
diff --git a/devel/psptoolchain-pspsdk-stage1/files/patch-src-libc-libcglue.c b/devel/psptoolchain-pspsdk-stage1/files/patch-src-libc-libcglue.c
new file mode 100644
index 000000000000..a5d7486b57f3
--- /dev/null
+++ b/devel/psptoolchain-pspsdk-stage1/files/patch-src-libc-libcglue.c
@@ -0,0 +1,11 @@
+--- src/libc/libcglue.c.orig 2009-02-23 12:12:45.000000000 +0100
++++ src/libc/libcglue.c 2009-02-23 12:11:39.000000000 +0100
+@@ -42,7 +42,7 @@
+
+ /* If we're being built for PSPSDK's libc this function isn't defined. */
+ #ifdef F_glue_gettimeofday
+-int gettimeofday(struct timeval *tp, void *tzp)
++int gettimeofday(struct timeval *tp, struct timezone *tzp)
+ {
+ return sceKernelLibcGettimeofday(tp, tzp);
+ }
diff --git a/devel/psptoolchain-pspsdk-stage1/pkg-descr b/devel/psptoolchain-pspsdk-stage1/pkg-descr
new file mode 100644
index 000000000000..ebd84fb39295
--- /dev/null
+++ b/devel/psptoolchain-pspsdk-stage1/pkg-descr
@@ -0,0 +1,4 @@
+The PlayStation Portable Toolchain is a collection of tools and utilities
+for homebrew PSP development.
+
+WWW: http://www.ps2dev.org
diff --git a/devel/psptoolchain-pspsdk-stage1/pkg-plist b/devel/psptoolchain-pspsdk-stage1/pkg-plist
new file mode 100644
index 000000000000..1c887ba2e017
--- /dev/null
+++ b/devel/psptoolchain-pspsdk-stage1/pkg-plist
@@ -0,0 +1,416 @@
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/wlan/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/wlan/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/utility/systemparam/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/utility/systemparam/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/utility/osk/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/utility/osk/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/utility/netdialog/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/utility/netdialog/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/utility/netconf/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/utility/netconf/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/utility/msgdialog/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/utility/msgdialog/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/utility/htmlviewer/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/utility/htmlviewer/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/utility/gamesharing/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/utility/gamesharing/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/usb/storage/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/usb/storage/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/template/prx_template/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/template/prx_template/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/template/lib_template/template.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/template/lib_template/template.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/template/lib_template/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/template/kprx_template/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/template/kprx_template/exports.exp
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/template/kprx_template/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/template/elf_template/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/template/elf_template/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/savedata/utility/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/savedata/utility/data.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/savedata/utility/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/savedata/encrypt/psf.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/savedata/encrypt/psf.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/savedata/encrypt/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/savedata/encrypt/hash.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/savedata/encrypt/hash.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/savedata/encrypt/encrypt.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/savedata/encrypt/encrypt.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/savedata/encrypt/README.txt
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/savedata/encrypt/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/savedata/decrypt/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/savedata/decrypt/decrypt.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/savedata/decrypt/decrypt.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/savedata/decrypt/README.txt
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/savedata/decrypt/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/prx/testprx/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/prx/testprx/exports.exp
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/prx/testprx/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/prx/prx_loader/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/prx/prx_loader/MyLib.S
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/prx/prx_loader/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/power/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/power/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/net/wlanscan_elf/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/net/wlanscan_elf/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/net/wlanscan/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/net/wlanscan/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/net/simple_prx/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/net/simple_prx/exports.exp
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/net/simple_prx/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/net/simple/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/net/simple/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/net/resolver/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/net/resolver/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/nand/dumpipl/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/nand/dumpipl/README
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/nand/dumpipl/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/ms/callback/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/ms/callback/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/mp3/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/mp3/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/me/basic/me.S
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/me/basic/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/me/basic/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/threadstatus/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/threadstatus/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/systimer/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/systimer/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/sysevent/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/sysevent/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/registry/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/registry/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/regenum/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/regenum/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/messagebox/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/messagebox/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/loadmodule/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/loadmodule/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/kdumper/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/kdumper/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/idstorage/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/idstorage/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/fileio/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/fileio/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/cwd/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/cwd/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/ir/sircs/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/ir/sircs/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/ir/irda/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/ir/irda/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/zbufferfog/zbufferfog.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/zbufferfog/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/vertex/vertex.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/vertex/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/timing/timing.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/timing/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/text/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/text/font.raw
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/text/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/sprite/sprite.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/sprite/ball.raw
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/sprite/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/splinesurface/splinesurface.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/splinesurface/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/spharm/spharm.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/spharm/readme
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/spharm/mt19937.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/spharm/mt19937.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/spharm/logo.raw
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/spharm/disablefpu.S
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/spharm/cube.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/spharm/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/spharm/Image2.raw
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/spharm/Image1.raw
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/speed/speed.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/speed/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/skinning/skinning.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/skinning/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/signals/signals.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/signals/ball.raw
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/signals/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/shadowprojection/shadowprojection.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/shadowprojection/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/rendertarget/rendertarget.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/rendertarget/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/reflection/reflection.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/reflection/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/ortho/ortho.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/ortho/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/morphskin/morphskin.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/morphskin/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/morph/morph.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/morph/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/logic/logic.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/logic/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/lines/lines.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/lines/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/lights/lights.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/lights/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/integerdrawing/integerdrawing.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/integerdrawing/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/envmap/envmap.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/envmap/env0.raw
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/envmap/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/cube/logo.raw
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/cube/cube.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/cube/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/copy/copy.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/copy/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/common/vram.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/common/vram.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/common/menu.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/common/menu.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/common/geometry.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/common/geometry.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/common/callbacks.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/common/callbacks.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/clut/clut.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/clut/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/celshading/lightmap.raw
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/celshading/celshading.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/celshading/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/blit/blit.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/blit/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/blend/blend.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/blend/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/beginobject/beginobject.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/beginobject/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/debug/sio/readme.txt
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/debug/sio/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/debug/sio/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/debug/prxdecrypt/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/debug/prxdecrypt/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/debug/profiler/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/debug/profiler/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/debug/kprintf/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/debug/kprintf/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/debug/gdb/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/debug/gdb/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/debug/exception/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/debug/exception/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/debug/debugkb/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/debug/debugkb/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/controller/basic/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/controller/basic/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/audio/wavegen/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/audio/wavegen/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/audio/polyphonic/main.c
+%%PSP_SDK_STAGE_PREFIX%%/sdk/samples/audio/polyphonic/Makefile
+%%PSP_SDK_STAGE_PREFIX%%/sdk/lib/prxspecs
+%%PSP_SDK_STAGE_PREFIX%%/sdk/lib/linkfile.prx
+%%PSP_SDK_STAGE_PREFIX%%/sdk/lib/build_prx.mak
+%%PSP_SDK_STAGE_PREFIX%%/sdk/lib/build.mak
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspwlan.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspvideocodec.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspvfpu.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/psputilsforkernel.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/psputils.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/psputility_usbmodules.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/psputility_sysparam.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/psputility_savedata.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/psputility_osk.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/psputility_netparam.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/psputility_netmodules.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/psputility_netconf.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/psputility_msgdialog.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/psputility_modules.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/psputility_htmlviewer.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/psputility_gamesharing.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/psputility_avmodules.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/psputility.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspuser.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspusbstor.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspusbcam.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspusbbus.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspusbacc.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspusb.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspumd.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/psptypes.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspthreadman_kernel.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspthreadman.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspsystimer.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspsysreg.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspsysmem_kernel.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspsysmem.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspsysevent.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspsyscon.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspsysclib.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspsuspend.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspstub.s
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspstdio_kernel.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspstdio.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspssl.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspsircs.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspsdk.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/psprtc.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspreg.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspprof.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/psppower.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspopenpsid.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspnet_resolver.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspnet_inet.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspnet_apctl.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspnet_adhocmatching.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspnet_adhocctl.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspnet_adhoc.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspnet.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspnand_driver.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspmscm.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspmpegbase.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspmpeg.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspmp3.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspmodulemgr_kernel.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspmodulemgr.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspmoduleinfo.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspmoduleexport.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/psploadexec_kernel.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/psploadexec.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/psploadcore.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspkerror.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspkerneltypes.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspkernel.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspkdebug.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspjpeg.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspiofilemgr_stat.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspiofilemgr_kernel.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspiofilemgr_fcntl.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspiofilemgr_dirent.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspiofilemgr.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspintrman_kernel.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspintrman.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspinit.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspimpose_driver.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspimport.s
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspidstorage.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/psphttp.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/psphprm.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspgum.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspgu.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspge.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspfpu.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspexception.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspdisplay_kernel.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspdisplay.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspdebugkb.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspdebug.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspctrl_kernel.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspctrl.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspchnnlsv.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspaudiorouting.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspaudiolib.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspaudiocodec.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspaudio_kernel.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspaudio.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/pspatrac3.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/libc/unistd.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/libc/time.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/libc/string.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/libc/stdlib.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/libc/stdio.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/libc/malloc.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/libc/ctype.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/libc/assert.h
+%%PSP_SDK_STAGE_PREFIX%%/sdk/include/as_reg_compat.h
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/wlan
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/utility/systemparam
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/utility/osk
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/utility/netdialog
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/utility/netconf
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/utility/msgdialog
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/utility/htmlviewer
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/utility/gamesharing
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/utility
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/usb/storage
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/usb
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/template/prx_template
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/template/lib_template
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/template/kprx_template
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/template/elf_template
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/template
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/savedata/utility
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/savedata/encrypt
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/savedata/decrypt
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/savedata
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/prx/testprx
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/prx/prx_loader
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/prx
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/power
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/net/wlanscan_elf
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/net/wlanscan
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/net/simple_prx
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/net/simple
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/net/resolver
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/net
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/nand/dumpipl
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/nand
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/ms/callback
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/ms
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/mp3
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/me/basic
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/me
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/threadstatus
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/systimer
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/sysevent
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/registry
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/regenum
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/messagebox
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/loadmodule
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/kdumper
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/idstorage
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/fileio
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel/cwd
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/kernel
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/ir/sircs
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/ir/irda
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/ir
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/zbufferfog
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/vertex
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/timing
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/text
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/sprite
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/splinesurface
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/spharm
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/speed
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/skinning
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/signals
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/shadowprojection
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/rendertarget
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/reflection
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/ortho
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/morphskin
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/morph
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/logic
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/lines
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/lights
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/integerdrawing
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/envmap
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/cube
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/copy
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/common
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/clut
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/celshading
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/blit
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/blend
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu/beginobject
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/gu
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/debug/sio
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/debug/prxdecrypt
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/debug/profiler
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/debug/kprintf
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/debug/gdb
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/debug/exception
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/debug/debugkb
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/debug
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/controller/basic
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/controller
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/audio/wavegen
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/audio/polyphonic
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples/audio
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/samples
+@dirrmtry %%PSP_SDK_STAGE_PREFIX%%/sdk/lib
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/include/libc
+@dirrm %%PSP_SDK_STAGE_PREFIX%%/sdk/include
+@dirrmtry %%PSP_SDK_STAGE_PREFIX%%/sdk
+@dirrmtry %%PSP_SDK_STAGE_PREFIX%%
+@dirrmtry psp
diff --git a/devel/psptoolchain-pspsdk-stage2/Makefile b/devel/psptoolchain-pspsdk-stage2/Makefile
new file mode 100644
index 000000000000..2f875767fedf
--- /dev/null
+++ b/devel/psptoolchain-pspsdk-stage2/Makefile
@@ -0,0 +1,25 @@
+# New ports collection makefile for: psptoolchain-pspsdk-stage2
+# Date created: 7 August 2009
+# Whom: Tassilo Philipp <tphilipp@potion-studios.com>
+#
+# $FreeBSD$
+#
+
+PKGNAMESUFFIX= -stage2
+
+MAINTAINER= tphilipp@potion-studios.com
+COMMENT= PlayStation Portable development toolchain ${PORTNAME}
+
+BUILD_DEPENDS= psp-cpp:${PORTSDIR}/devel/psptoolchain-gcc-stage2 \
+ psp-gcc:${PORTSDIR}/devel/psptoolchain-gcc-stage2 \
+ psp-gcov:${PORTSDIR}/devel/psptoolchain-gcc-stage2 \
+ psp-g++:${PORTSDIR}/devel/psptoolchain-gcc-stage2 \
+ psp-ar:${PORTSDIR}/devel/psptoolchain-binutils \
+ ${LOCALBASE}/psp/lib/libc.a:${PORTSDIR}/devel/psptoolchain-newlib
+
+CONFIGURE_ARGS= --prefix=${PREFIX} --with-pspdev="${PREFIX}"
+
+PLIST= ${.CURDIR}/pkg-plist
+MASTERDIR= ${.CURDIR}/../psptoolchain-pspsdk-stage1
+
+.include "${MASTERDIR}/Makefile"
diff --git a/devel/psptoolchain-pspsdk-stage2/pkg-plist b/devel/psptoolchain-pspsdk-stage2/pkg-plist
new file mode 100644
index 000000000000..b8924878c871
--- /dev/null
+++ b/devel/psptoolchain-pspsdk-stage2/pkg-plist
@@ -0,0 +1,493 @@
+psp/sdk/samples/wlan/main.c
+psp/sdk/samples/wlan/Makefile
+psp/sdk/samples/utility/systemparam/main.c
+psp/sdk/samples/utility/systemparam/Makefile
+psp/sdk/samples/utility/osk/main.c
+psp/sdk/samples/utility/osk/Makefile
+psp/sdk/samples/utility/netdialog/main.c
+psp/sdk/samples/utility/netdialog/Makefile
+psp/sdk/samples/utility/netconf/main.c
+psp/sdk/samples/utility/netconf/Makefile
+psp/sdk/samples/utility/msgdialog/main.c
+psp/sdk/samples/utility/msgdialog/Makefile
+psp/sdk/samples/utility/htmlviewer/main.c
+psp/sdk/samples/utility/htmlviewer/Makefile
+psp/sdk/samples/utility/gamesharing/main.c
+psp/sdk/samples/utility/gamesharing/Makefile
+psp/sdk/samples/usb/storage/main.c
+psp/sdk/samples/usb/storage/Makefile
+psp/sdk/samples/template/prx_template/main.c
+psp/sdk/samples/template/prx_template/Makefile
+psp/sdk/samples/template/lib_template/template.h
+psp/sdk/samples/template/lib_template/template.c
+psp/sdk/samples/template/lib_template/Makefile
+psp/sdk/samples/template/kprx_template/main.c
+psp/sdk/samples/template/kprx_template/exports.exp
+psp/sdk/samples/template/kprx_template/Makefile
+psp/sdk/samples/template/elf_template/main.c
+psp/sdk/samples/template/elf_template/Makefile
+psp/sdk/samples/savedata/utility/main.c
+psp/sdk/samples/savedata/utility/data.h
+psp/sdk/samples/savedata/utility/Makefile
+psp/sdk/samples/savedata/encrypt/psf.h
+psp/sdk/samples/savedata/encrypt/psf.c
+psp/sdk/samples/savedata/encrypt/main.c
+psp/sdk/samples/savedata/encrypt/hash.h
+psp/sdk/samples/savedata/encrypt/hash.c
+psp/sdk/samples/savedata/encrypt/encrypt.h
+psp/sdk/samples/savedata/encrypt/encrypt.c
+psp/sdk/samples/savedata/encrypt/README.txt
+psp/sdk/samples/savedata/encrypt/Makefile
+psp/sdk/samples/savedata/decrypt/main.c
+psp/sdk/samples/savedata/decrypt/decrypt.h
+psp/sdk/samples/savedata/decrypt/decrypt.c
+psp/sdk/samples/savedata/decrypt/README.txt
+psp/sdk/samples/savedata/decrypt/Makefile
+psp/sdk/samples/prx/testprx/main.c
+psp/sdk/samples/prx/testprx/exports.exp
+psp/sdk/samples/prx/testprx/Makefile
+psp/sdk/samples/prx/prx_loader/main.c
+psp/sdk/samples/prx/prx_loader/MyLib.S
+psp/sdk/samples/prx/prx_loader/Makefile
+psp/sdk/samples/power/main.c
+psp/sdk/samples/power/Makefile
+psp/sdk/samples/net/wlanscan_elf/main.c
+psp/sdk/samples/net/wlanscan_elf/Makefile
+psp/sdk/samples/net/wlanscan/main.c
+psp/sdk/samples/net/wlanscan/Makefile
+psp/sdk/samples/net/simple_prx/main.c
+psp/sdk/samples/net/simple_prx/exports.exp
+psp/sdk/samples/net/simple_prx/Makefile
+psp/sdk/samples/net/simple/main.c
+psp/sdk/samples/net/simple/Makefile
+psp/sdk/samples/net/resolver/main.c
+psp/sdk/samples/net/resolver/Makefile
+psp/sdk/samples/nand/dumpipl/main.c
+psp/sdk/samples/nand/dumpipl/README
+psp/sdk/samples/nand/dumpipl/Makefile
+psp/sdk/samples/ms/callback/main.c
+psp/sdk/samples/ms/callback/Makefile
+psp/sdk/samples/mp3/main.c
+psp/sdk/samples/mp3/Makefile
+psp/sdk/samples/me/basic/me.S
+psp/sdk/samples/me/basic/main.c
+psp/sdk/samples/me/basic/Makefile
+psp/sdk/samples/kernel/threadstatus/main.c
+psp/sdk/samples/kernel/threadstatus/Makefile
+psp/sdk/samples/kernel/systimer/main.c
+psp/sdk/samples/kernel/systimer/Makefile
+psp/sdk/samples/kernel/sysevent/main.c
+psp/sdk/samples/kernel/sysevent/Makefile
+psp/sdk/samples/kernel/registry/main.c
+psp/sdk/samples/kernel/registry/Makefile
+psp/sdk/samples/kernel/regenum/main.c
+psp/sdk/samples/kernel/regenum/Makefile
+psp/sdk/samples/kernel/messagebox/main.c
+psp/sdk/samples/kernel/messagebox/Makefile
+psp/sdk/samples/kernel/loadmodule/main.c
+psp/sdk/samples/kernel/loadmodule/Makefile
+psp/sdk/samples/kernel/kdumper/main.c
+psp/sdk/samples/kernel/kdumper/Makefile
+psp/sdk/samples/kernel/idstorage/main.c
+psp/sdk/samples/kernel/idstorage/Makefile
+psp/sdk/samples/kernel/fileio/main.c
+psp/sdk/samples/kernel/fileio/Makefile
+psp/sdk/samples/kernel/cwd/main.c
+psp/sdk/samples/kernel/cwd/Makefile
+psp/sdk/samples/ir/sircs/main.c
+psp/sdk/samples/ir/sircs/Makefile
+psp/sdk/samples/ir/irda/main.c
+psp/sdk/samples/ir/irda/Makefile
+psp/sdk/samples/gu/zbufferfog/zbufferfog.c
+psp/sdk/samples/gu/zbufferfog/Makefile
+psp/sdk/samples/gu/vertex/vertex.c
+psp/sdk/samples/gu/vertex/Makefile
+psp/sdk/samples/gu/timing/timing.c
+psp/sdk/samples/gu/timing/Makefile
+psp/sdk/samples/gu/text/main.c
+psp/sdk/samples/gu/text/font.raw
+psp/sdk/samples/gu/text/Makefile
+psp/sdk/samples/gu/sprite/sprite.c
+psp/sdk/samples/gu/sprite/ball.raw
+psp/sdk/samples/gu/sprite/Makefile
+psp/sdk/samples/gu/splinesurface/splinesurface.c
+psp/sdk/samples/gu/splinesurface/Makefile
+psp/sdk/samples/gu/spharm/spharm.c
+psp/sdk/samples/gu/spharm/readme
+psp/sdk/samples/gu/spharm/mt19937.h
+psp/sdk/samples/gu/spharm/mt19937.c
+psp/sdk/samples/gu/spharm/logo.raw
+psp/sdk/samples/gu/spharm/disablefpu.S
+psp/sdk/samples/gu/spharm/cube.c
+psp/sdk/samples/gu/spharm/Makefile
+psp/sdk/samples/gu/spharm/Image2.raw
+psp/sdk/samples/gu/spharm/Image1.raw
+psp/sdk/samples/gu/speed/speed.c
+psp/sdk/samples/gu/speed/Makefile
+psp/sdk/samples/gu/skinning/skinning.c
+psp/sdk/samples/gu/skinning/Makefile
+psp/sdk/samples/gu/signals/signals.c
+psp/sdk/samples/gu/signals/ball.raw
+psp/sdk/samples/gu/signals/Makefile
+psp/sdk/samples/gu/shadowprojection/shadowprojection.c
+psp/sdk/samples/gu/shadowprojection/Makefile
+psp/sdk/samples/gu/rendertarget/rendertarget.c
+psp/sdk/samples/gu/rendertarget/Makefile
+psp/sdk/samples/gu/reflection/reflection.c
+psp/sdk/samples/gu/reflection/Makefile
+psp/sdk/samples/gu/ortho/ortho.c
+psp/sdk/samples/gu/ortho/Makefile
+psp/sdk/samples/gu/morphskin/morphskin.c
+psp/sdk/samples/gu/morphskin/Makefile
+psp/sdk/samples/gu/morph/morph.c
+psp/sdk/samples/gu/morph/Makefile
+psp/sdk/samples/gu/logic/logic.c
+psp/sdk/samples/gu/logic/Makefile
+psp/sdk/samples/gu/lines/lines.c
+psp/sdk/samples/gu/lines/Makefile
+psp/sdk/samples/gu/lights/lights.c
+psp/sdk/samples/gu/lights/Makefile
+psp/sdk/samples/gu/integerdrawing/integerdrawing.c
+psp/sdk/samples/gu/integerdrawing/Makefile
+psp/sdk/samples/gu/envmap/envmap.c
+psp/sdk/samples/gu/envmap/env0.raw
+psp/sdk/samples/gu/envmap/Makefile
+psp/sdk/samples/gu/cube/logo.raw
+psp/sdk/samples/gu/cube/cube.c
+psp/sdk/samples/gu/cube/Makefile
+psp/sdk/samples/gu/copy/copy.c
+psp/sdk/samples/gu/copy/Makefile
+psp/sdk/samples/gu/common/vram.h
+psp/sdk/samples/gu/common/vram.c
+psp/sdk/samples/gu/common/menu.h
+psp/sdk/samples/gu/common/menu.c
+psp/sdk/samples/gu/common/geometry.h
+psp/sdk/samples/gu/common/geometry.c
+psp/sdk/samples/gu/common/callbacks.h
+psp/sdk/samples/gu/common/callbacks.c
+psp/sdk/samples/gu/clut/clut.c
+psp/sdk/samples/gu/clut/Makefile
+psp/sdk/samples/gu/celshading/lightmap.raw
+psp/sdk/samples/gu/celshading/celshading.c
+psp/sdk/samples/gu/celshading/Makefile
+psp/sdk/samples/gu/blit/blit.c
+psp/sdk/samples/gu/blit/Makefile
+psp/sdk/samples/gu/blend/blend.c
+psp/sdk/samples/gu/blend/Makefile
+psp/sdk/samples/gu/beginobject/beginobject.c
+psp/sdk/samples/gu/beginobject/Makefile
+psp/sdk/samples/debug/sio/readme.txt
+psp/sdk/samples/debug/sio/main.c
+psp/sdk/samples/debug/sio/Makefile
+psp/sdk/samples/debug/prxdecrypt/main.c
+psp/sdk/samples/debug/prxdecrypt/Makefile
+psp/sdk/samples/debug/profiler/main.c
+psp/sdk/samples/debug/profiler/Makefile
+psp/sdk/samples/debug/kprintf/main.c
+psp/sdk/samples/debug/kprintf/Makefile
+psp/sdk/samples/debug/gdb/main.c
+psp/sdk/samples/debug/gdb/Makefile
+psp/sdk/samples/debug/exception/main.c
+psp/sdk/samples/debug/exception/Makefile
+psp/sdk/samples/debug/debugkb/main.c
+psp/sdk/samples/debug/debugkb/Makefile
+psp/sdk/samples/controller/basic/main.c
+psp/sdk/samples/controller/basic/Makefile
+psp/sdk/samples/audio/wavegen/main.c
+psp/sdk/samples/audio/wavegen/Makefile
+psp/sdk/samples/audio/polyphonic/main.c
+psp/sdk/samples/audio/polyphonic/Makefile
+psp/sdk/lib/prxspecs
+psp/sdk/lib/prxexports.o
+psp/sdk/lib/linkfile.prx
+psp/sdk/lib/libpspwlan.a
+psp/sdk/lib/libpspvshbridge.a
+psp/sdk/lib/libpspvideocodec.a
+psp/sdk/lib/libpspvfpu.a
+psp/sdk/lib/libpsputility.a
+psp/sdk/lib/libpspuser.a
+psp/sdk/lib/libpspusbstor.a
+psp/sdk/lib/libpspusbcam.a
+psp/sdk/lib/libpspusbbus_driver.a
+psp/sdk/lib/libpspusb_driver.a
+psp/sdk/lib/libpspusb.a
+psp/sdk/lib/libpspumd_driver.a
+psp/sdk/lib/libpspumd.a
+psp/sdk/lib/libpspssl.a
+psp/sdk/lib/libpspsircs.a
+psp/sdk/lib/libpspsdk.a
+psp/sdk/lib/libpsprtc_driver.a
+psp/sdk/lib/libpsprtc.a
+psp/sdk/lib/libpspreg_driver.a
+psp/sdk/lib/libpspreg.a
+psp/sdk/lib/libpspprof.a
+psp/sdk/lib/libpsppower_driver.a
+psp/sdk/lib/libpsppower.a
+psp/sdk/lib/libpsppaf.a
+psp/sdk/lib/libpspopenpsid.a
+psp/sdk/lib/libpspnet_resolver.a
+psp/sdk/lib/libpspnet_inet.a
+psp/sdk/lib/libpspnet_apctl.a
+psp/sdk/lib/libpspnet_adhocmatching.a
+psp/sdk/lib/libpspnet_adhocctl.a
+psp/sdk/lib/libpspnet_adhoc.a
+psp/sdk/lib/libpspnet.a
+psp/sdk/lib/libpspnand_driver.a
+psp/sdk/lib/libpspmpegbase_driver.a
+psp/sdk/lib/libpspmpegbase.a
+psp/sdk/lib/libpspmpeg.a
+psp/sdk/lib/libpspmp3.a
+psp/sdk/lib/libpsplibc.a
+psp/sdk/lib/libpspkernel.a
+psp/sdk/lib/libpspjpeg.a
+psp/sdk/lib/libpsphttp.a
+psp/sdk/lib/libpsphprm_driver.a
+psp/sdk/lib/libpsphprm.a
+psp/sdk/lib/libpspgum_vfpu.a
+psp/sdk/lib/libpspgum.a
+psp/sdk/lib/libpspgu.a
+psp/sdk/lib/libpspge_driver.a
+psp/sdk/lib/libpspge.a
+psp/sdk/lib/libpspgdb_user.a
+psp/sdk/lib/libpspgdb_kernel.a
+psp/sdk/lib/libpspgdb.a
+psp/sdk/lib/libpspfpu.a
+psp/sdk/lib/libpspdisplay_driver.a
+psp/sdk/lib/libpspdisplay.a
+psp/sdk/lib/libpspdebugkb.a
+psp/sdk/lib/libpspdebug.a
+psp/sdk/lib/libpspctrl_driver.a
+psp/sdk/lib/libpspctrl.a
+psp/sdk/lib/libpspchnnlsv.a
+psp/sdk/lib/libpspaudiolib.a
+psp/sdk/lib/libpspaudiocodec.a
+psp/sdk/lib/libpspaudio_driver.a
+psp/sdk/lib/libpspaudio.a
+psp/sdk/lib/libpspatrac3.a
+psp/sdk/lib/build_prx.mak
+psp/sdk/lib/build.mak
+psp/sdk/include/pspwlan.h
+psp/sdk/include/pspvideocodec.h
+psp/sdk/include/pspvfpu.h
+psp/sdk/include/psputilsforkernel.h
+psp/sdk/include/psputils.h
+psp/sdk/include/psputility_usbmodules.h
+psp/sdk/include/psputility_sysparam.h
+psp/sdk/include/psputility_savedata.h
+psp/sdk/include/psputility_osk.h
+psp/sdk/include/psputility_netparam.h
+psp/sdk/include/psputility_netmodules.h
+psp/sdk/include/psputility_netconf.h
+psp/sdk/include/psputility_msgdialog.h
+psp/sdk/include/psputility_modules.h
+psp/sdk/include/psputility_htmlviewer.h
+psp/sdk/include/psputility_gamesharing.h
+psp/sdk/include/psputility_avmodules.h
+psp/sdk/include/psputility.h
+psp/sdk/include/pspuser.h
+psp/sdk/include/pspusbstor.h
+psp/sdk/include/pspusbcam.h
+psp/sdk/include/pspusbbus.h
+psp/sdk/include/pspusbacc.h
+psp/sdk/include/pspusb.h
+psp/sdk/include/pspumd.h
+psp/sdk/include/psptypes.h
+psp/sdk/include/pspthreadman_kernel.h
+psp/sdk/include/pspthreadman.h
+psp/sdk/include/pspsystimer.h
+psp/sdk/include/pspsysreg.h
+psp/sdk/include/pspsysmem_kernel.h
+psp/sdk/include/pspsysmem.h
+psp/sdk/include/pspsysevent.h
+psp/sdk/include/pspsyscon.h
+psp/sdk/include/pspsysclib.h
+psp/sdk/include/pspsuspend.h
+psp/sdk/include/pspstub.s
+psp/sdk/include/pspstdio_kernel.h
+psp/sdk/include/pspstdio.h
+psp/sdk/include/pspssl.h
+psp/sdk/include/pspsircs.h
+psp/sdk/include/pspsdk.h
+psp/sdk/include/psprtc.h
+psp/sdk/include/pspreg.h
+psp/sdk/include/pspprof.h
+psp/sdk/include/psppower.h
+psp/sdk/include/pspopenpsid.h
+psp/sdk/include/pspnet_resolver.h
+psp/sdk/include/pspnet_inet.h
+psp/sdk/include/pspnet_apctl.h
+psp/sdk/include/pspnet_adhocmatching.h
+psp/sdk/include/pspnet_adhocctl.h
+psp/sdk/include/pspnet_adhoc.h
+psp/sdk/include/pspnet.h
+psp/sdk/include/pspnand_driver.h
+psp/sdk/include/pspmscm.h
+psp/sdk/include/pspmpegbase.h
+psp/sdk/include/pspmpeg.h
+psp/sdk/include/pspmp3.h
+psp/sdk/include/pspmodulemgr_kernel.h
+psp/sdk/include/pspmodulemgr.h
+psp/sdk/include/pspmoduleinfo.h
+psp/sdk/include/pspmoduleexport.h
+psp/sdk/include/psploadexec_kernel.h
+psp/sdk/include/psploadexec.h
+psp/sdk/include/psploadcore.h
+psp/sdk/include/pspkerror.h
+psp/sdk/include/pspkerneltypes.h
+psp/sdk/include/pspkernel.h
+psp/sdk/include/pspkdebug.h
+psp/sdk/include/pspjpeg.h
+psp/sdk/include/pspiofilemgr_stat.h
+psp/sdk/include/pspiofilemgr_kernel.h
+psp/sdk/include/pspiofilemgr_fcntl.h
+psp/sdk/include/pspiofilemgr_dirent.h
+psp/sdk/include/pspiofilemgr.h
+psp/sdk/include/pspintrman_kernel.h
+psp/sdk/include/pspintrman.h
+psp/sdk/include/pspinit.h
+psp/sdk/include/pspimpose_driver.h
+psp/sdk/include/pspimport.s
+psp/sdk/include/pspidstorage.h
+psp/sdk/include/psphttp.h
+psp/sdk/include/psphprm.h
+psp/sdk/include/pspgum.h
+psp/sdk/include/pspgu.h
+psp/sdk/include/pspge.h
+psp/sdk/include/pspfpu.h
+psp/sdk/include/pspexception.h
+psp/sdk/include/pspdisplay_kernel.h
+psp/sdk/include/pspdisplay.h
+psp/sdk/include/pspdebugkb.h
+psp/sdk/include/pspdebug.h
+psp/sdk/include/pspctrl_kernel.h
+psp/sdk/include/pspctrl.h
+psp/sdk/include/pspchnnlsv.h
+psp/sdk/include/pspaudiorouting.h
+psp/sdk/include/pspaudiolib.h
+psp/sdk/include/pspaudiocodec.h
+psp/sdk/include/pspaudio_kernel.h
+psp/sdk/include/pspaudio.h
+psp/sdk/include/pspatrac3.h
+psp/sdk/include/libc/unistd.h
+psp/sdk/include/libc/time.h
+psp/sdk/include/libc/string.h
+psp/sdk/include/libc/stdlib.h
+psp/sdk/include/libc/stdio.h
+psp/sdk/include/libc/malloc.h
+psp/sdk/include/libc/ctype.h
+psp/sdk/include/libc/assert.h
+psp/sdk/include/as_reg_compat.h
+psp/lib/crt0_prx.o
+bin/unpack-pbp
+bin/psp-prxgen
+bin/psp-fixup-imports
+bin/psp-config
+bin/psp-build-exports
+bin/pack-pbp
+bin/mksfoex
+bin/mksfo
+bin/bin2s
+bin/bin2o
+bin/bin2c
+@dirrm psp/sdk/samples/wlan
+@dirrm psp/sdk/samples/utility/systemparam
+@dirrm psp/sdk/samples/utility/osk
+@dirrm psp/sdk/samples/utility/netdialog
+@dirrm psp/sdk/samples/utility/netconf
+@dirrm psp/sdk/samples/utility/msgdialog
+@dirrm psp/sdk/samples/utility/htmlviewer
+@dirrm psp/sdk/samples/utility/gamesharing
+@dirrm psp/sdk/samples/utility
+@dirrm psp/sdk/samples/usb/storage
+@dirrm psp/sdk/samples/usb
+@dirrm psp/sdk/samples/template/prx_template
+@dirrm psp/sdk/samples/template/lib_template
+@dirrm psp/sdk/samples/template/kprx_template
+@dirrm psp/sdk/samples/template/elf_template
+@dirrm psp/sdk/samples/template
+@dirrm psp/sdk/samples/savedata/utility
+@dirrm psp/sdk/samples/savedata/encrypt
+@dirrm psp/sdk/samples/savedata/decrypt
+@dirrm psp/sdk/samples/savedata
+@dirrm psp/sdk/samples/prx/testprx
+@dirrm psp/sdk/samples/prx/prx_loader
+@dirrm psp/sdk/samples/prx
+@dirrm psp/sdk/samples/power
+@dirrm psp/sdk/samples/net/wlanscan_elf
+@dirrm psp/sdk/samples/net/wlanscan
+@dirrm psp/sdk/samples/net/simple_prx
+@dirrm psp/sdk/samples/net/simple
+@dirrm psp/sdk/samples/net/resolver
+@dirrm psp/sdk/samples/net
+@dirrm psp/sdk/samples/nand/dumpipl
+@dirrm psp/sdk/samples/nand
+@dirrm psp/sdk/samples/ms/callback
+@dirrm psp/sdk/samples/ms
+@dirrm psp/sdk/samples/mp3
+@dirrm psp/sdk/samples/me/basic
+@dirrm psp/sdk/samples/me
+@dirrm psp/sdk/samples/kernel/threadstatus
+@dirrm psp/sdk/samples/kernel/systimer
+@dirrm psp/sdk/samples/kernel/sysevent
+@dirrm psp/sdk/samples/kernel/registry
+@dirrm psp/sdk/samples/kernel/regenum
+@dirrm psp/sdk/samples/kernel/messagebox
+@dirrm psp/sdk/samples/kernel/loadmodule
+@dirrm psp/sdk/samples/kernel/kdumper
+@dirrm psp/sdk/samples/kernel/idstorage
+@dirrm psp/sdk/samples/kernel/fileio
+@dirrm psp/sdk/samples/kernel/cwd
+@dirrm psp/sdk/samples/kernel
+@dirrm psp/sdk/samples/ir/sircs
+@dirrm psp/sdk/samples/ir/irda
+@dirrm psp/sdk/samples/ir
+@dirrm psp/sdk/samples/gu/zbufferfog
+@dirrm psp/sdk/samples/gu/vertex
+@dirrm psp/sdk/samples/gu/timing
+@dirrm psp/sdk/samples/gu/text
+@dirrm psp/sdk/samples/gu/sprite
+@dirrm psp/sdk/samples/gu/splinesurface
+@dirrm psp/sdk/samples/gu/spharm
+@dirrm psp/sdk/samples/gu/speed
+@dirrm psp/sdk/samples/gu/skinning
+@dirrm psp/sdk/samples/gu/signals
+@dirrm psp/sdk/samples/gu/shadowprojection
+@dirrm psp/sdk/samples/gu/rendertarget
+@dirrm psp/sdk/samples/gu/reflection
+@dirrm psp/sdk/samples/gu/ortho
+@dirrm psp/sdk/samples/gu/morphskin
+@dirrm psp/sdk/samples/gu/morph
+@dirrm psp/sdk/samples/gu/logic
+@dirrm psp/sdk/samples/gu/lines
+@dirrm psp/sdk/samples/gu/lights
+@dirrm psp/sdk/samples/gu/integerdrawing
+@dirrm psp/sdk/samples/gu/envmap
+@dirrm psp/sdk/samples/gu/cube
+@dirrm psp/sdk/samples/gu/copy
+@dirrm psp/sdk/samples/gu/common
+@dirrm psp/sdk/samples/gu/clut
+@dirrm psp/sdk/samples/gu/celshading
+@dirrm psp/sdk/samples/gu/blit
+@dirrm psp/sdk/samples/gu/blend
+@dirrm psp/sdk/samples/gu/beginobject
+@dirrm psp/sdk/samples/gu
+@dirrm psp/sdk/samples/debug/sio
+@dirrm psp/sdk/samples/debug/prxdecrypt
+@dirrm psp/sdk/samples/debug/profiler
+@dirrm psp/sdk/samples/debug/kprintf
+@dirrm psp/sdk/samples/debug/gdb
+@dirrm psp/sdk/samples/debug/exception
+@dirrm psp/sdk/samples/debug/debugkb
+@dirrm psp/sdk/samples/debug
+@dirrm psp/sdk/samples/controller/basic
+@dirrm psp/sdk/samples/controller
+@dirrm psp/sdk/samples/audio/wavegen
+@dirrm psp/sdk/samples/audio/polyphonic
+@dirrm psp/sdk/samples/audio
+@dirrm psp/sdk/samples
+@dirrm psp/sdk/include/libc
+@dirrm psp/sdk/include
+@dirrmtry psp/sdk/lib
+@dirrmtry psp/sdk
+@dirrmtry psp/lib
+@dirrmtry psp
diff --git a/devel/psptoolchain/Makefile b/devel/psptoolchain/Makefile
new file mode 100644
index 000000000000..a18dcb840879
--- /dev/null
+++ b/devel/psptoolchain/Makefile
@@ -0,0 +1,40 @@
+# New ports collection makefile for: psptoolchain
+# Date created: 26 February 2009
+# Whom: Tassilo Philipp <tphilipp@potion-studios.com>
+#
+# $FreeBSD$
+#
+
+PORTNAME= psptoolchain
+PORTVERSION= 20090127
+CATEGORIES= devel
+MASTER_SITES= # none
+DISTFILES= # none
+
+MAINTAINER= tphilipp@potion-studios.com
+COMMENT= PlayStation Portable development toolchain meta port
+
+RUN_DEPENDS= psp-gdb:${PORTSDIR}/devel/psptoolchain-gdb \
+ psp-gcc:${PORTSDIR}/devel/psptoolchain-gcc-stage2 \
+ psp-g++:${PORTSDIR}/devel/psptoolchain-gcc-stage2 \
+ psp-ar:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-as:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-c++filt:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-gprof:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-ld:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-nm:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-objcopy:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-objdump:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-ranlib:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-readelf:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-size:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-strings:${PORTSDIR}/devel/psptoolchain-binutils \
+ psp-strip:${PORTSDIR}/devel/psptoolchain-binutils
+
+NO_WRKSUBDIR= YES
+NO_BUILD= YES
+NO_FETCH= YES
+
+do-install:
+
+.include <bsd.port.mk>
diff --git a/devel/psptoolchain/pkg-descr b/devel/psptoolchain/pkg-descr
new file mode 100644
index 000000000000..ebd84fb39295
--- /dev/null
+++ b/devel/psptoolchain/pkg-descr
@@ -0,0 +1,4 @@
+The PlayStation Portable Toolchain is a collection of tools and utilities
+for homebrew PSP development.
+
+WWW: http://www.ps2dev.org