mips: remove stub entries from syscallent files, generate stubs at build time

* linux/mips/genstub.sh: New file.
* Makefile.am (EXTRA_DIST): Add it.
* configure.ac [MIPS]: Use it to generate syscallent stubs.
* linux/mips/.gitignore: Add syscallent stubs.
* linux/mips/syscallent-n32.h: Remove stub entries, include
the stub file instead.
* linux/mips/syscallent-n64.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
diff --git a/configure.ac b/configure.ac
index 34a6215..a0b4859 100644
--- a/configure.ac
+++ b/configure.ac
@@ -807,5 +807,14 @@
 AM_CONDITIONAL([USE_LIBUNWIND], [test "x$use_libunwind" = xyes])
 AC_MSG_RESULT([$use_libunwind])
 
+if test "$arch" = mips && test "$no_create" != yes; then
+	mkdir -p linux/mips
+	if $srcdir/linux/mips/genstub.sh linux/mips; then
+		AC_MSG_RESULT([Generated MIPS syscallent stubs])
+	else
+		AC_MSG_FAILURE([Failed to generate syscallent stubs])
+	fi
+fi
+
 AC_CONFIG_FILES([Makefile tests/Makefile])
 AC_OUTPUT